@uwdata/mosaic-plot 0.10.0 → 0.11.0
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.
- package/dist/mosaic-plot.js +7721 -16747
- package/dist/mosaic-plot.min.js +19 -28
- package/package.json +6 -6
- package/src/interactors/Highlight.js +1 -1
- package/src/interactors/Nearest.js +11 -10
- package/src/marks/ConnectedMark.js +1 -1
- package/src/marks/util/stats.js +1 -1
- package/src/plot.js +1 -1
- package/src/transforms/time-interval.js +1 -1
package/dist/mosaic-plot.min.js
CHANGED
|
@@ -1,62 +1,53 @@
|
|
|
1
|
-
var iF=Object.create;var n_=Object.defineProperty;var oF=Object.getOwnPropertyDescriptor;var sF=Object.getOwnPropertyNames;var aF=Object.getPrototypeOf,cF=Object.prototype.hasOwnProperty;var u6=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ws=(e,t)=>{for(var n in t)n_(e,n,{get:t[n],enumerable:!0})},lF=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sF(t))!cF.call(e,i)&&i!==n&&n_(e,i,{get:()=>t[i],enumerable:!(r=oF(t,i))||r.enumerable});return e};var uF=(e,t,n)=>(n=e!=null?iF(aF(e)):{},lF(t||!e||!e.__esModule?n_(n,"default",{value:e,enumerable:!0}):n,e));var H7=u6((N7t,X7)=>{"use strict";function zG(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>=0?(o=s,i=s-1):r=s+1}return o}function qG(e,t,n,r,i){for(var o=i+1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c>0?(o=s,i=s-1):r=s+1}return o}function VG(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<0?(o=s,r=s+1):i=s-1}return o}function jG(e,t,n,r,i){for(var o=r-1;r<=i;){var s=r+i>>>1,a=e[s],c=n!==void 0?n(a,t):a-t;c<=0?(o=s,r=s+1):i=s-1}return o}function YG(e,t,n,r,i){for(;r<=i;){var o=r+i>>>1,s=e[o],a=n!==void 0?n(s,t):s-t;if(a===0)return o;a<=0?r=o+1:i=o-1}return-1}function ey(e,t,n,r,i,o){return typeof n=="function"?o(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):o(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}X7.exports={ge:function(e,t,n,r,i){return ey(e,t,n,r,i,zG)},gt:function(e,t,n,r,i){return ey(e,t,n,r,i,qG)},lt:function(e,t,n,r,i){return ey(e,t,n,r,i,VG)},le:function(e,t,n,r,i){return ey(e,t,n,r,i,jG)},eq:function(e,t,n,r,i){return ey(e,t,n,r,i,YG)}}});var rL=u6((O7t,nL)=>{"use strict";var Cw=H7(),jf=0,Al=1,Fw=2;nL.exports=GG;function AM(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}var ny=AM.prototype;function IM(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function Q7(e,t){var n=Yf(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function Z7(e,t){var n=e.intervals([]);n.push(t),Q7(e,n)}function K7(e,t){var n=e.intervals([]),r=n.indexOf(t);return r<0?jf:(n.splice(r,1),Q7(e,n),Al)}ny.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e};ny.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?Z7(this,e):this.left.insert(e):this.left=Yf([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?Z7(this,e):this.right.insert(e):this.right=Yf([e]);else{var n=Cw.ge(this.leftPoints,e,TM),r=Cw.ge(this.rightPoints,e,EM);this.leftPoints.splice(n,0,e),this.rightPoints.splice(r,0,e)}};ny.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return jf;var n=this.right?this.right.count:0;if(4*n>3*(t-1))return K7(this,e);var r=this.left.remove(e);return r===Fw?(this.left=null,this.count-=1,Al):(r===Al&&(this.count-=1),r)}else if(e[0]>this.mid){if(!this.right)return jf;var i=this.left?this.left.count:0;if(4*i>3*(t-1))return K7(this,e);var r=this.right.remove(e);return r===Fw?(this.right=null,this.count-=1,Al):(r===Al&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===e?Fw:jf;if(this.leftPoints.length===1&&this.leftPoints[0]===e){if(this.left&&this.right){for(var o=this,s=this.left;s.right;)o=s,s=s.right;if(o===this)s.right=this.right;else{var a=this.left,r=this.right;o.count-=s.count,o.right=s.left,s.left=a,s.right=r}IM(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?IM(this,this.left):IM(this,this.right);return Al}for(var a=Cw.ge(this.leftPoints,e,TM);a<this.leftPoints.length&&this.leftPoints[a][0]===e[0];++a)if(this.leftPoints[a]===e){this.count-=1,this.leftPoints.splice(a,1);for(var r=Cw.ge(this.rightPoints,e,EM);r<this.rightPoints.length&&this.rightPoints[r][1]===e[1];++r)if(this.rightPoints[r]===e)return this.rightPoints.splice(r,1),Al}return jf}};function J7(e,t,n){for(var r=0;r<e.length&&e[r][0]<=t;++r){var i=n(e[r]);if(i)return i}}function tL(e,t,n){for(var r=e.length-1;r>=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function eL(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}ny.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return J7(this.leftPoints,e,t)}else if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return tL(this.rightPoints,e,t)}else return eL(this.leftPoints,t)};ny.queryInterval=function(e,t,n){if(e<this.mid&&this.left){var r=this.left.queryInterval(e,t,n);if(r)return r}if(t>this.mid&&this.right){var r=this.right.queryInterval(e,t,n);if(r)return r}return t<this.mid?J7(this.leftPoints,t,n):e>this.mid?tL(this.rightPoints,e,n):eL(this.leftPoints,n)};function WG(e,t){return e-t}function TM(e,t){var n=e[0]-t[0];return n||e[1]-t[1]}function EM(e,t){var n=e[1]-t[1];return n||e[0]-t[0]}function Yf(e){if(e.length===0)return null;for(var t=[],n=0;n<e.length;++n)t.push(e[n][0],e[n][1]);t.sort(WG);for(var r=t[t.length>>1],i=[],o=[],s=[],n=0;n<e.length;++n){var a=e[n];a[1]<r?i.push(a):r<a[0]?o.push(a):s.push(a)}var c=s,l=s.slice();return c.sort(TM),l.sort(EM),new AM(r,Yf(i),Yf(o),c,l)}function MM(e){this.root=e}var Wf=MM.prototype;Wf.insert=function(e){this.root?this.root.insert(e):this.root=new AM(e[0],null,null,[e],[e])};Wf.remove=function(e){if(this.root){var t=this.root.remove(e);return t===Fw&&(this.root=null),t!==jf}return!1};Wf.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)};Wf.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)};Object.defineProperty(Wf,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(Wf,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function GG(e){return!e||e.length===0?new MM(null):new MM(Yf(e))}});var Gs=Symbol("Fixed"),bn=Symbol("Transient"),Kf=Symbol("Transform");var f6={};function Qf(e,t=!1){let n,r,i=f6;function o(l){n=e(l).then(()=>{if(r){let{value:u}=r;r=null,o(u)}else n=null})}function s(l){r={event:l}}function a(l){n?s(l):o(l)}function c(l){i!==l&&requestAnimationFrame(()=>{let u=i;i=f6,a(u)}),i=l}return t?c:a}var Jf=class{constructor(t){this._filterBy=t,this._requestUpdate=Qf(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(t){this._coordinator=t}get filterBy(){return this._filterBy}get filterIndexable(){return!0}fields(){return null}fieldInfo(t){return this}query(t){return null}queryPending(){return this}queryResult(t){return this}queryError(t){return this}requestQuery(t){let n=t||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}update(){return this}};function d6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Z(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{l(r.next(u))}catch(f){s(f)}}function c(u){try{l(r.throw(u))}catch(f){s(f)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function h6(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ft(e){return this instanceof Ft?(this.v=e,this):new Ft(e)}function br(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){r[d]&&(i[d]=function(m){return new Promise(function(y,g){o.push([d,m,y,g])>1||c(d,m)})},p&&(i[d]=p(i[d])))}function c(d,p){try{l(r[d](p))}catch(m){h(o[0][3],m)}}function l(d){d.value instanceof Ft?Promise.resolve(d.value.v).then(u,f):h(o[0][2],d)}function u(d){c("next",d)}function f(d){c("throw",d)}function h(d,p){d(p),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Bl(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(s){return(n=!n)?{value:Ft(e[i](s)),done:!1}:o?o(s):s}:o}}function ui(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof h6=="function"?h6(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var c_={};Ws(c_,{compareArrayLike:()=>a_,joinUint8Arrays:()=>wr,memcpy:()=>nh,rebaseValueOffsets:()=>My,toArrayBufferView:()=>kt,toArrayBufferViewAsyncIterator:()=>hi,toArrayBufferViewIterator:()=>Pi,toBigInt64Array:()=>Iy,toBigUint64Array:()=>xF,toFloat32Array:()=>wF,toFloat32ArrayAsyncIterator:()=>RF,toFloat32ArrayIterator:()=>EF,toFloat64Array:()=>_F,toFloat64ArrayAsyncIterator:()=>kF,toFloat64ArrayIterator:()=>DF,toInt16Array:()=>yF,toInt16ArrayAsyncIterator:()=>OF,toInt16ArrayIterator:()=>IF,toInt32Array:()=>ec,toInt32ArrayAsyncIterator:()=>LF,toInt32ArrayIterator:()=>MF,toInt8Array:()=>mF,toInt8ArrayAsyncIterator:()=>NF,toInt8ArrayIterator:()=>SF,toUint16Array:()=>gF,toUint16ArrayAsyncIterator:()=>FF,toUint16ArrayIterator:()=>AF,toUint32Array:()=>bF,toUint32ArrayAsyncIterator:()=>CF,toUint32ArrayIterator:()=>TF,toUint8Array:()=>_t,toUint8ArrayAsyncIterator:()=>s_,toUint8ArrayIterator:()=>o_,toUint8ClampedArray:()=>vF,toUint8ClampedArrayAsyncIterator:()=>$F,toUint8ClampedArrayIterator:()=>BF});var fF=new TextDecoder("utf-8"),th=e=>fF.decode(e),hF=new TextEncoder,Ui=e=>hF.encode(e);var dF=e=>typeof e=="number",p6=e=>typeof e=="boolean",Je=e=>typeof e=="function",jn=e=>e!=null&&Object(e)===e,xr=e=>jn(e)&&Je(e.then);var fi=e=>jn(e)&&Je(e[Symbol.iterator]),Ur=e=>jn(e)&&Je(e[Symbol.asyncIterator]),by=e=>jn(e)&&jn(e.schema);var xy=e=>jn(e)&&"done"in e&&"value"in e;var wy=e=>jn(e)&&Je(e.stat)&&dF(e.fd);var _y=e=>jn(e)&&eh(e.body),vy=e=>"_getDOMStream"in e&&"_getNodeStream"in e,m6=e=>jn(e)&&Je(e.abort)&&Je(e.getWriter)&&!vy(e),eh=e=>jn(e)&&Je(e.cancel)&&Je(e.getReader)&&!vy(e),y6=e=>jn(e)&&Je(e.end)&&Je(e.write)&&p6(e.writable)&&!vy(e),Sy=e=>jn(e)&&Je(e.read)&&Je(e.pipe)&&p6(e.readable)&&!vy(e),g6=e=>jn(e)&&Je(e.clear)&&Je(e.bytes)&&Je(e.position)&&Je(e.setPosition)&&Je(e.capacity)&&Je(e.getBufferIdentifier)&&Je(e.createLong);var i_=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function pF(e){let t=e[0]?[e[0]]:[],n,r,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:n,byteLength:i}=s,{byteOffset:r,byteLength:o}=a,n+i<r||r+o<n){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,n,r-n+o)}return t}function nh(e,t,n=0,r=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,i));return o.set(s,n),e}function wr(e,t){let n=pF(e),r=n.reduce((u,f)=>u+f.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,r);for(let u=n.length;++c<u;){if(i=n[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?n[c]=i.subarray(o.length):o.length===i.length&&c++,s?nh(s,o,a):s=o;break}nh(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function kt(e,t){let n=xy(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=Ui(n)),n instanceof ArrayBuffer?new e(n):n instanceof i_?new e(n):g6(n)?kt(e,n.bytes()):ArrayBuffer.isView(n)?n.byteLength<=0?new e(0):new e(n.buffer,n.byteOffset,n.byteLength/e.BYTES_PER_ELEMENT):e.from(n)):new e(0)}var mF=e=>kt(Int8Array,e),yF=e=>kt(Int16Array,e),ec=e=>kt(Int32Array,e),Iy=e=>kt(BigInt64Array,e),_t=e=>kt(Uint8Array,e),gF=e=>kt(Uint16Array,e),bF=e=>kt(Uint32Array,e),xF=e=>kt(BigUint64Array,e),wF=e=>kt(Float32Array,e),_F=e=>kt(Float64Array,e),vF=e=>kt(Uint8ClampedArray,e),r_=e=>(e.next(),e);function*Pi(e,t){let n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof i_?n(t):fi(t)?t:n(t);return yield*r_(function*(i){let o=null;do o=i.next(yield kt(e,o));while(!o.done)}(r[Symbol.iterator]())),new e}var SF=e=>Pi(Int8Array,e),IF=e=>Pi(Int16Array,e),MF=e=>Pi(Int32Array,e),o_=e=>Pi(Uint8Array,e),AF=e=>Pi(Uint16Array,e),TF=e=>Pi(Uint32Array,e),EF=e=>Pi(Float32Array,e),DF=e=>Pi(Float64Array,e),BF=e=>Pi(Uint8ClampedArray,e);function hi(e,t){return br(this,arguments,function*(){if(xr(t))return yield Ft(yield Ft(yield*Bl(ui(hi(e,yield Ft(t))))));let r=function(s){return br(this,arguments,function*(){yield yield Ft(yield Ft(s))})},i=function(s){return br(this,arguments,function*(){yield Ft(yield*Bl(ui(r_(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof i_?r(t):fi(t)?i(t):Ur(t)?t:r(t);return yield Ft(yield*Bl(ui(r_(function(s){return br(this,arguments,function*(){let a=null;do a=yield Ft(s.next(yield yield Ft(kt(e,a))));while(!a.done)})}(o[Symbol.asyncIterator]()))))),yield Ft(new e)})}var NF=e=>hi(Int8Array,e),OF=e=>hi(Int16Array,e),LF=e=>hi(Int32Array,e),s_=e=>hi(Uint8Array,e),FF=e=>hi(Uint16Array,e),CF=e=>hi(Uint32Array,e),RF=e=>hi(Float32Array,e),kF=e=>hi(Float64Array,e),$F=e=>hi(Uint8ClampedArray,e);function My(e,t,n){if(e!==0){n=n.slice(0,t);for(let r=-1,i=n.length;++r<i;)n[r]+=e}return n.subarray(0,t)}function a_(e,t){let n=0,r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n<r);return!0}var xn={fromIterable(e){return Ay(UF(e))},fromAsyncIterable(e){return Ay(PF(e))},fromDOMStream(e){return Ay(zF(e))},fromNodeStream(e){return Ay(qF(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},Ay=e=>(e.next(),e);function*UF(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?wr(r,s)[0]:([i,r,a]=wr(r,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=o_(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){(n=!0)&&typeof l.throw=="function"&&l.throw(u)}finally{n===!1&&typeof l.return=="function"&&l.return(null)}return null}function PF(e){return br(this,arguments,function*(){let n,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?wr(i,a)[0]:([o,i,c]=wr(i,a),o)}({cmd:s,size:a}=(yield yield Ft(null))||{cmd:"read",size:0});let u=s_(e)[Symbol.asyncIterator]();try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ft(u.next()):yield Ft(u.next(a-c)),!n&&o.byteLength>0&&(i.push(o),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ft(l()));while(a<c);while(!n)}catch(f){(r=!0)&&typeof u.throw=="function"&&(yield Ft(u.throw(f)))}finally{r===!1&&typeof u.return=="function"&&(yield Ft(u.return(new Uint8Array(0))))}return yield Ft(null)})}function zF(e){return br(this,arguments,function*(){let n=!1,r=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?wr(i,a)[0]:([o,i,c]=wr(i,a),o)}({cmd:s,size:a}=(yield yield Ft(null))||{cmd:"read",size:0});let u=new u_(e);try{do if({done:n,value:o}=Number.isNaN(a-c)?yield Ft(u.read()):yield Ft(u.read(a-c)),!n&&o.byteLength>0&&(i.push(_t(o)),c+=o.byteLength),n||a<=c)do({cmd:s,size:a}=yield yield Ft(l()));while(a<c);while(!n)}catch(f){(r=!0)&&(yield Ft(u.cancel(f)))}finally{r===!1?yield Ft(u.cancel()):e.locked&&u.releaseLock()}return yield Ft(null)})}var u_=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Z(this,void 0,void 0,function*(){let{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return Z(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let n=yield this.reader.read();return!n.done&&(n.value=_t(n)),n})}},l_=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function qF(e){return br(this,arguments,function*(){let n=[],r="error",i=!1,o=null,s,a,c=0,l=[],u;function f(){return s==="peek"?wr(l,a)[0]:([u,l,c]=wr(l,a),u)}if({cmd:s,size:a}=(yield yield Ft(null))||{cmd:"read",size:0},e.isTTY)return yield yield Ft(new Uint8Array(0)),yield Ft(null);try{n[0]=l_(e,"end"),n[1]=l_(e,"error");do{if(n[2]=l_(e,"readable"),[r,o]=yield Ft(Promise.race(n.map(d=>d[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(a-c)?(u=_t(e.read(a-c)),u.byteLength<a-c&&(u=_t(e.read()))):u=_t(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Ft(f()));while(a<c)}while(!i)}finally{yield Ft(h(n,r==="error"?o:null))}return yield Ft(null);function h(d,p){return u=l=null,new Promise((m,y)=>{for(let[g,b]of d)e.off(g,b);try{let g=e.destroy;g&&g.call(e,p),p=void 0}catch(g){p=g||p}finally{p!=null?y(p):m()}})}})}var ae;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(ae||(ae={}));var ye;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(ye||(ye={}));var he;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(he||(he={}));var Re;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Re||(Re={}));var at;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(at||(at={}));var on;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(on||(on={}));var zi=new Int32Array(2),Ty=new Float32Array(zi.buffer),Ey=new Float64Array(zi.buffer),Nl=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var rh;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(rh||(rh={}));var _r=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return zi[0]=this.readInt32(t),Ty[0]}readFloat64(t){return zi[Nl?0:1]=this.readInt32(t),zi[Nl?1:0]=this.readInt32(t+4),Ey[0]}writeInt8(t,n){this.bytes_[t]=n}writeUint8(t,n){this.bytes_[t]=n}writeInt16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,Number(BigInt.asIntN(32,n))),this.writeInt32(t+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(t,n){this.writeUint32(t,Number(BigInt.asUintN(32,n))),this.writeUint32(t+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(t,n){Ty[0]=n,this.writeInt32(t,zi[0])}writeFloat64(t,n){Ey[0]=n,this.writeInt32(t,zi[Nl?0:1]),this.writeInt32(t+4,zi[Nl?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let n=0;n<4;n++)t+=String.fromCharCode(this.readInt8(this.position_+4+n));return t}__offset(t,n){let r=t-this.readInt32(t);return n<this.readInt16(r)?this.readInt16(r+n):0}__union(t,n){return t.bb_pos=n+this.readInt32(n),t.bb=this,t}__string(t,n){t+=this.readInt32(t);let r=this.readInt32(t);t+=4;let i=this.bytes_.subarray(t,t+r);return n===rh.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,n){return typeof t=="string"?this.__string(n):this.__union(t,n)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let n=0;n<4;n++)if(t.charCodeAt(n)!=this.readInt8(this.position()+4+n))return!1;return!0}createScalarList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o)}return r}createObjList(t,n){let r=[];for(let i=0;i<n;++i){let o=t(i);o!==null&&r.push(o.unpack())}return r}};var nc=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let n;t?n=t:n=1024,this.bb=_r.allocate(n),this.space=n}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,n){t>this.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space<r+t+n;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)}pad(t){for(let n=0;n<t;n++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,n,r){(this.force_defaults||n!=r)&&(this.addInt8(n),this.slot(t))}addFieldInt16(t,n,r){(this.force_defaults||n!=r)&&(this.addInt16(n),this.slot(t))}addFieldInt32(t,n,r){(this.force_defaults||n!=r)&&(this.addInt32(n),this.slot(t))}addFieldInt64(t,n,r){(this.force_defaults||n!==r)&&(this.addInt64(n),this.slot(t))}addFieldFloat32(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat32(n),this.slot(t))}addFieldFloat64(t,n,r){(this.force_defaults||n!=r)&&(this.addFloat64(n),this.slot(t))}addFieldOffset(t,n,r){(this.force_defaults||n!=r)&&(this.addOffset(n),this.slot(t))}addFieldStruct(t,n,r){n!=r&&(this.nested(n),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let n=t.capacity();if(n&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let r=n<<1,i=_r.allocate(r);return i.setPosition(r-n),i.bytes().set(t.bytes(),r-n),i}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let n=0;n<t;n++)this.vtable[n]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),n=this.vtable_in_use-1;for(;n>=0&&this.vtable[n]==0;n--);let r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);let i=2;this.addInt16(t-this.object_start);let o=(r+i)*2;this.addInt16(o);let s=0,a=this.space;t:for(n=0;n<this.vtables.length;n++){let c=this.bb.capacity()-this.vtables[n];if(o==this.bb.readInt16(c)){for(let l=2;l<o;l+=2)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue t;s=this.vtables[n];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,n,r){let i=r?4:0;if(n){let o=n;if(this.prep(this.minalign,8+i),o.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let s=3;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){let r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(n<this.bb.readInt16(i)&&this.bb.readInt16(i+n)!=0))throw new TypeError("FlatBuffers: field "+n+" must be set")}startVector(t,n,r){this.notNested(),this.vector_num_elems=n,this.prep(4,t*n),this.prep(r,t*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let n=this.createString(t);return this.string_maps.set(t,n),n}createString(t){if(t==null)return 0;let n;return t instanceof Uint8Array?n=t:n=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length),this.bb.bytes().set(n,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let n=[];for(let r=0;r<t.length;++r){let i=t[r];if(i!==null)n.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return n}createStructOffsetList(t,n){return n(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var ih;(function(e){e[e.BUFFER=0]="BUFFER"})(ih||(ih={}));var oh;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(oh||(oh={}));var By=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):oh.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):ih.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,oh.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,ih.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return e.startBodyCompression(t),e.addCodec(t,n),e.addMethod(t,r),e.endBodyCompression(t)}};var Ol=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var Ll=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}};var vr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new Ll).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new Ol).__init(this.bb.__vector(this.bb_pos+r)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new By).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}};var jo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new vr).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var Xs;(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Xs||(Xs={}));var sh;(function(e){e[e.DenseArray=0]="DenseArray"})(sh||(sh={}));var pi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInt(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,n){t.addFieldInt32(0,n,0)}static addIsSigned(t,n){t.addFieldInt8(1,+n,0)}static endInt(t){return t.endObject()}static createInt(t,n,r){return e.startInt(t),e.addBitWidth(t,n),e.addIsSigned(t,r),e.endInt(t)}};var qi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryEncoding(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new pi).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):sh.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addIndexType(t,n){t.addFieldOffset(1,n,0)}static addIsOrdered(t,n){t.addFieldInt8(2,+n,0)}static addDictionaryKind(t,n){t.addFieldInt16(3,n,sh.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}};var tn=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsKeyValue(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}value(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,n){t.addFieldOffset(0,n,0)}static addValue(t,n){t.addFieldOffset(1,n,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,n,r){return e.startKeyValue(t),e.addKey(t,n),e.addValue(t,r),e.endKeyValue(t)}};var ah=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}};var ch=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBool(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}};var Hs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDate(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Re.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,Re.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,n){return e.startDate(t),e.addUnit(t,n),e.endDate(t)}};var Vi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDecimal(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,n){t.addFieldInt32(0,n,0)}static addScale(t,n){t.addFieldInt32(1,n,0)}static addBitWidth(t,n){t.addFieldInt32(2,n,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,n,r,i){return e.startDecimal(t),e.addPrecision(t,n),e.addScale(t,r),e.addBitWidth(t,i),e.endDecimal(t)}};var Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDuration(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,at.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,n){return e.startDuration(t),e.addUnit(t,n),e.endDuration(t)}};var Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,n){return e.startFixedSizeBinary(t),e.addByteWidth(t,n),e.endFixedSizeBinary(t)}};var Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFixedSizeList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,n){t.addFieldInt32(0,n,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,n){return e.startFixedSizeList(t),e.addListSize(t,n),e.endFixedSizeList(t)}};var Js=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFloatingPoint(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):he.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,n){t.addFieldInt16(0,n,he.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,n){return e.startFloatingPoint(t),e.addPrecision(t,n),e.endFloatingPoint(t)}};var ta=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsInterval(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):on.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,n){t.addFieldInt16(0,n,on.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,n){return e.startInterval(t),e.addUnit(t,n),e.endInterval(t)}};var lh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeBinary(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}};var uh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsLargeUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}};var fh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsList(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}};var ea=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMap(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,n){t.addFieldInt8(0,+n,0)}static endMap(t){return t.endObject()}static createMap(t,n){return e.startMap(t),e.addKeysSorted(t,n),e.endMap(t)}};var hh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsNull(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}};var dh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsStruct_(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}};var Yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTime(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,at.MILLISECOND)}static addBitWidth(t,n){t.addFieldInt32(1,n,32)}static endTime(t){return t.endObject()}static createTime(t,n,r){return e.startTime(t),e.addUnit(t,n),e.addBitWidth(t,r),e.endTime(t)}};var Wo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsTimestamp(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):at.SECOND}timezone(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.__string(this.bb_pos+n,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,n){t.addFieldInt16(0,n,at.SECOND)}static addTimezone(t,n){t.addFieldOffset(1,n,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,n,r){return e.startTimestamp(t),e.addUnit(t,n),e.addTimezone(t,r),e.endTimestamp(t)}};var mi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUnion(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ye.Sparse}typeIds(t){let n=this.bb.__offset(this.bb_pos,6);return n?this.bb.readInt32(this.bb.__vector(this.bb_pos+n)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,n){t.addFieldInt16(0,n,ye.Sparse)}static addTypeIds(t,n){t.addFieldOffset(1,n,0)}static createTypeIdsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}};var ph=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}};var de;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(de||(de={}));var On=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):de.NONE}type(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new qi).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,16);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,de.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}};var ar=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Xs.Little}fields(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new On).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,n){t.addFieldInt16(0,n,Xs.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,o){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}};var Ut;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ut||(Ut={}));var L;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(L||(L={}));var yi;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(yi||(yi={}));var B_={};Ws(B_,{clampRange:()=>Eh,createElementComparator:()=>oa,wrapIndex:()=>rc});var f_={};Ws(f_,{valueToString:()=>gi});function gi(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>gi(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}var m_={};Ws(m_,{BN:()=>yh,bigNumToBigInt:()=>x6,bigNumToNumber:()=>p_,bigNumToString:()=>Rl,isArrowBigNumSymbol:()=>b6});function Kt(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function h_(e,t){return Kt(e/t)+Kt(e%t)/Kt(t)}var b6=Symbol.for("isArrowBigNum");function bi(e,...t){return t.length===0?Object.setPrototypeOf(kt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}bi.prototype[b6]=!0;bi.prototype.toJSON=function(){return`"${Rl(this)}"`};bi.prototype.valueOf=function(e){return p_(this,e)};bi.prototype.toString=function(){return Rl(this)};bi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return p_(this);case"string":return Rl(this);case"default":return x6(this)}return Rl(this)};function Fl(...e){return bi.apply(this,e)}function Cl(...e){return bi.apply(this,e)}function mh(...e){return bi.apply(this,e)}Object.setPrototypeOf(Fl.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Cl.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(mh.prototype,Object.create(Uint32Array.prototype));Object.assign(Fl.prototype,bi.prototype,{constructor:Fl,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Cl.prototype,bi.prototype,{constructor:Cl,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(mh.prototype,bi.prototype,{constructor:mh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var VF=BigInt(4294967296)*BigInt(4294967296),jF=VF-BigInt(1);function p_(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:o}=e,s=new BigUint64Array(n,r,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^jF)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"){let u=BigInt(Math.pow(10,t)),f=c/u,h=c%u;return Kt(f)+Kt(h)/Kt(u)}return Kt(c)}function Rl(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return d_(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return d_(e);t=t.slice();let r=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+r;t[o]=a,r&=s===0?1:0}return`-${d_(t)}`}function x6(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Rl(e)}function d_(e){let t="",n=new Uint32Array(2),r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,s=r.length-1;do{for(n[0]=r[o=0];o<s;)r[o++]=n[1]=n[0]/10,n[0]=(n[0]-n[1]*10<<16)+r[o];r[o]=n[1]=n[0]/10,n[0]=n[0]-n[1]*10,t=`${n[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var yh=class e{static new(t,n){switch(n){case!0:return new Fl(t);case!1:return new Cl(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Fl(t)}return t.byteLength===16?new mh(t):new Cl(t)}static signed(t){return new Fl(t)}static unsigned(t){return new Cl(t)}static decimal(t){return new mh(t)}constructor(t,n){return e.new(t,n)}};var w6,_6,v6,S6,I6,M6,A6,T6,E6,D6,B6,N6,O6,L6,F6,C6,R6,k6,$6,U6,P6,z6,G=class e{static isNull(t){return t?.typeId===L.Null}static isInt(t){return t?.typeId===L.Int}static isFloat(t){return t?.typeId===L.Float}static isBinary(t){return t?.typeId===L.Binary}static isLargeBinary(t){return t?.typeId===L.LargeBinary}static isUtf8(t){return t?.typeId===L.Utf8}static isLargeUtf8(t){return t?.typeId===L.LargeUtf8}static isBool(t){return t?.typeId===L.Bool}static isDecimal(t){return t?.typeId===L.Decimal}static isDate(t){return t?.typeId===L.Date}static isTime(t){return t?.typeId===L.Time}static isTimestamp(t){return t?.typeId===L.Timestamp}static isInterval(t){return t?.typeId===L.Interval}static isDuration(t){return t?.typeId===L.Duration}static isList(t){return t?.typeId===L.List}static isStruct(t){return t?.typeId===L.Struct}static isUnion(t){return t?.typeId===L.Union}static isFixedSizeBinary(t){return t?.typeId===L.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===L.FixedSizeList}static isMap(t){return t?.typeId===L.Map}static isDictionary(t){return t?.typeId===L.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===ye.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===ye.Sparse}constructor(t){this.typeId=t}};w6=Symbol.toStringTag;G[w6]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]="DataType"))(G.prototype);var Ln=class extends G{constructor(){super(L.Null)}toString(){return"Null"}};_6=Symbol.toStringTag;Ln[_6]=(e=>e[Symbol.toStringTag]="Null")(Ln.prototype);var qe=class extends G{constructor(t,n){super(L.Int),this.isSigned=t,this.bitWidth=n}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};v6=Symbol.toStringTag;qe[v6]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(qe.prototype);var gh=class extends qe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},bh=class extends qe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},xi=class extends qe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},xh=class extends qe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},wh=class extends qe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},_h=class extends qe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},vh=class extends qe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Sh=class extends qe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(gh.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(bh.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(xi.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(xh.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(wh.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(_h.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(vh.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Sh.prototype,"ArrayType",{value:BigUint64Array});var Sr=class extends G{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case he.HALF:return Uint16Array;case he.SINGLE:return Float32Array;case he.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};S6=Symbol.toStringTag;Sr[S6]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Sr.prototype);var Ih=class extends Sr{constructor(){super(he.HALF)}},Mh=class extends Sr{constructor(){super(he.SINGLE)}},Ah=class extends Sr{constructor(){super(he.DOUBLE)}};Object.defineProperty(Ih.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Mh.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Ah.prototype,"ArrayType",{value:Float64Array});var ji=class extends G{constructor(){super(L.Binary)}toString(){return"Binary"}};I6=Symbol.toStringTag;ji[I6]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(ji.prototype);var Yi=class extends G{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};M6=Symbol.toStringTag;Yi[M6]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Yi.prototype);var Wi=class extends G{constructor(){super(L.Utf8)}toString(){return"Utf8"}};A6=Symbol.toStringTag;Wi[A6]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Wi.prototype);var Gi=class extends G{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};T6=Symbol.toStringTag;Gi[T6]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(Gi.prototype);var Xi=class extends G{constructor(){super(L.Bool)}toString(){return"Bool"}};E6=Symbol.toStringTag;Xi[E6]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Xi.prototype);var Hi=class extends G{constructor(t,n,r=128){super(L.Decimal),this.scale=t,this.precision=n,this.bitWidth=r}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};D6=Symbol.toStringTag;Hi[D6]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Hi.prototype);var Zi=class extends G{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Re[this.unit]}>`}get ArrayType(){return this.unit===Re.DAY?Int32Array:BigInt64Array}};B6=Symbol.toStringTag;Zi[B6]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(Zi.prototype);var Ki=class extends G{constructor(t,n){super(L.Time),this.unit=t,this.bitWidth=n}toString(){return`Time${this.bitWidth}<${at[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};N6=Symbol.toStringTag;Ki[N6]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Ki.prototype);var Qi=class extends G{constructor(t,n){super(L.Timestamp),this.unit=t,this.timezone=n}toString(){return`Timestamp<${at[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};O6=Symbol.toStringTag;Qi[O6]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Qi.prototype);var Ji=class extends G{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${on[this.unit]}>`}};L6=Symbol.toStringTag;Ji[L6]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ji.prototype);var to=class extends G{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${at[this.unit]}>`}};F6=Symbol.toStringTag;to[F6]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(to.prototype);var zr=class extends G{constructor(t){super(L.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};C6=Symbol.toStringTag;zr[C6]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(zr.prototype);var ge=class extends G{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};R6=Symbol.toStringTag;ge[R6]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ge.prototype);var qr=class extends G{constructor(t,n,r){super(L.Union),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};k6=Symbol.toStringTag;qr[k6]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(qr.prototype);var eo=class extends G{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};$6=Symbol.toStringTag;eo[$6]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(eo.prototype);var Vr=class extends G{constructor(t,n){super(L.FixedSizeList),this.listSize=t,this.children=[n]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};U6=Symbol.toStringTag;Vr[U6]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Vr.prototype);var jr=class extends G{constructor(t,n=!1){var r,i,o;if(super(L.Map),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t?.type)===null||r===void 0)&&r.children)){let s=(i=t?.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t?.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};P6=Symbol.toStringTag;jr[P6]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(jr.prototype);var YF=(e=>()=>++e)(-1),cr=class extends G{constructor(t,n,r,i){super(L.Dictionary),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?YF():Kt(r)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};z6=Symbol.toStringTag;cr[z6]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(cr.prototype);function Ir(e){let t=e;switch(e.typeId){case L.Decimal:return e.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}var dt=class{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return WF(this,t,n)}getVisitFnByTypeId(t,n=!0){return kl(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitLargeUtf8(t,...n){return null}visitBinary(t,...n){return null}visitLargeBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}};function WF(e,t,n=!0){return typeof t=="number"?kl(e,t,n):typeof t=="string"&&t in L?kl(e,L[t],n):t&&t instanceof G?kl(e,q6(t),n):t?.type&&t.type instanceof G?kl(e,q6(t.type),n):kl(e,L.NONE,n)}function kl(e,t,n=!0){let r=null;switch(t){case L.Null:r=e.visitNull;break;case L.Bool:r=e.visitBool;break;case L.Int:r=e.visitInt;break;case L.Int8:r=e.visitInt8||e.visitInt;break;case L.Int16:r=e.visitInt16||e.visitInt;break;case L.Int32:r=e.visitInt32||e.visitInt;break;case L.Int64:r=e.visitInt64||e.visitInt;break;case L.Uint8:r=e.visitUint8||e.visitInt;break;case L.Uint16:r=e.visitUint16||e.visitInt;break;case L.Uint32:r=e.visitUint32||e.visitInt;break;case L.Uint64:r=e.visitUint64||e.visitInt;break;case L.Float:r=e.visitFloat;break;case L.Float16:r=e.visitFloat16||e.visitFloat;break;case L.Float32:r=e.visitFloat32||e.visitFloat;break;case L.Float64:r=e.visitFloat64||e.visitFloat;break;case L.Utf8:r=e.visitUtf8;break;case L.LargeUtf8:r=e.visitLargeUtf8;break;case L.Binary:r=e.visitBinary;break;case L.LargeBinary:r=e.visitLargeBinary;break;case L.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case L.Date:r=e.visitDate;break;case L.DateDay:r=e.visitDateDay||e.visitDate;break;case L.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case L.Timestamp:r=e.visitTimestamp;break;case L.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case L.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case L.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case L.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case L.Time:r=e.visitTime;break;case L.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case L.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case L.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case L.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case L.Decimal:r=e.visitDecimal;break;case L.List:r=e.visitList;break;case L.Struct:r=e.visitStruct;break;case L.Union:r=e.visitUnion;break;case L.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case L.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case L.Dictionary:r=e.visitDictionary;break;case L.Interval:r=e.visitInterval;break;case L.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case L.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case L.Duration:r=e.visitDuration;break;case L.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case L.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case L.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case L.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case L.FixedSizeList:r=e.visitFixedSizeList;break;case L.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function q6(e){switch(e.typeId){case L.Null:return L.Null;case L.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?L.Int8:L.Uint8;case 16:return n?L.Int16:L.Uint16;case 32:return n?L.Int32:L.Uint32;case 64:return n?L.Int64:L.Uint64}return L.Int}case L.Float:switch(e.precision){case he.HALF:return L.Float16;case he.SINGLE:return L.Float32;case he.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(e.unit){case at.SECOND:return L.TimeSecond;case at.MILLISECOND:return L.TimeMillisecond;case at.MICROSECOND:return L.TimeMicrosecond;case at.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(e.unit){case at.SECOND:return L.TimestampSecond;case at.MILLISECOND:return L.TimestampMillisecond;case at.MICROSECOND:return L.TimestampMicrosecond;case at.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(e.unit){case Re.DAY:return L.DateDay;case Re.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(e.unit){case on.DAY_TIME:return L.IntervalDayTime;case on.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(e.unit){case at.SECOND:return L.DurationSecond;case at.MILLISECOND:return L.DurationMillisecond;case at.MICROSECOND:return L.DurationMicrosecond;case at.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(e.mode){case ye.Dense:return L.DenseUnion;case ye.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw new Error(`Unrecognized type '${L[e.typeId]}'`)}dt.prototype.visitInt8=null;dt.prototype.visitInt16=null;dt.prototype.visitInt32=null;dt.prototype.visitInt64=null;dt.prototype.visitUint8=null;dt.prototype.visitUint16=null;dt.prototype.visitUint32=null;dt.prototype.visitUint64=null;dt.prototype.visitFloat16=null;dt.prototype.visitFloat32=null;dt.prototype.visitFloat64=null;dt.prototype.visitDateDay=null;dt.prototype.visitDateMillisecond=null;dt.prototype.visitTimestampSecond=null;dt.prototype.visitTimestampMillisecond=null;dt.prototype.visitTimestampMicrosecond=null;dt.prototype.visitTimestampNanosecond=null;dt.prototype.visitTimeSecond=null;dt.prototype.visitTimeMillisecond=null;dt.prototype.visitTimeMicrosecond=null;dt.prototype.visitTimeNanosecond=null;dt.prototype.visitDenseUnion=null;dt.prototype.visitSparseUnion=null;dt.prototype.visitIntervalDayTime=null;dt.prototype.visitIntervalYearMonth=null;dt.prototype.visitDuration=null;dt.prototype.visitDurationSecond=null;dt.prototype.visitDurationMillisecond=null;dt.prototype.visitDurationMicrosecond=null;dt.prototype.visitDurationNanosecond=null;var y_={};Ws(y_,{float64ToUint16:()=>Th,uint16ToFloat64:()=>Ny});var V6=new Float64Array(1),$l=new Uint32Array(V6.buffer);function Ny(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function Th(e){if(e!==e)return 32256;V6[0]=e;let t=($l[1]&2147483648)>>16&65535,n=$l[1]&2146435072,r=0;return n>=1089470464?$l[0]>0?n=31744:(n=(n&2080374784)>>16,r=($l[1]&1048575)>>10):n<=1056964608?(r=1048576+($l[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=($l[1]&1048575)+512>>10),t|n|r&65535}var xt=class extends dt{};function It(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}var GF=(e,t,n)=>{e[t]=Math.floor(n/864e5)},j6=(e,t,n,r)=>{if(n+1<t.length){let i=Kt(t[n]),o=Kt(t[n+1]);e.set(r.subarray(0,o-i),i)}},XF=({offset:e,values:t},n,r)=>{let i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},Go=({values:e},t,n)=>{e[t]=n},g_=({values:e},t,n)=>{e[t]=n},Y6=({values:e},t,n)=>{e[t]=Th(n)},HF=(e,t,n)=>{switch(e.type.precision){case he.HALF:return Y6(e,t,n);case he.SINGLE:case he.DOUBLE:return g_(e,t,n)}},Oy=({values:e},t,n)=>{GF(e,t,n.valueOf())},Ly=({values:e},t,n)=>{e[t]=BigInt(n)},b_=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},W6=({values:e,valueOffsets:t},n,r)=>j6(e,t,n,r),G6=({values:e,valueOffsets:t},n,r)=>j6(e,t,n,Ui(r)),x_=(e,t,n)=>{e.type.unit===Re.DAY?Oy(e,t,n):Ly(e,t,n)},Fy=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},Cy=({values:e},t,n)=>{e[t]=BigInt(n)},Ry=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},ky=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},w_=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return Fy(e,t,n);case at.MILLISECOND:return Cy(e,t,n);case at.MICROSECOND:return Ry(e,t,n);case at.NANOSECOND:return ky(e,t,n)}},$y=({values:e},t,n)=>{e[t]=n},Uy=({values:e},t,n)=>{e[t]=n},Py=({values:e},t,n)=>{e[t]=n},zy=({values:e},t,n)=>{e[t]=n},__=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return $y(e,t,n);case at.MILLISECOND:return Uy(e,t,n);case at.MICROSECOND:return Py(e,t,n);case at.NANOSECOND:return zy(e,t,n)}},v_=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},ZF=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,o=wn.getVisitFn(r);if(Array.isArray(n))for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n[++s]);else for(let s=-1,a=i[t],c=i[t+1];a<c;)o(r,a++,n.get(++s))},KF=(e,t,n)=>{let r=e.children[0],{valueOffsets:i}=e,o=wn.getVisitFn(r),{[t]:s,[t+1]:a}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let l of c)if(o(r,s,l),++s>=a)break},QF=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[o]),JF=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(o)),tC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t.get(i.name)),eC=(e,t)=>(n,r,i,o)=>r&&n(r,e,t[i.name]),nC=(e,t,n)=>{let r=e.type.children.map(o=>wn.getVisitFn(o.type)),i=n instanceof Map?tC(t,n):n instanceof qt?JF(t,n):Array.isArray(n)?QF(t,n):eC(t,n);e.type.children.forEach((o,s)=>i(r[s],e.children[s],o,s))},rC=(e,t,n)=>{e.type.mode===ye.Dense?X6(e,t,n):H6(e,t,n)},X6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];wn.visit(i,e.valueOffsets[t],n)},H6=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];wn.visit(i,t,n)},iC=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},S_=(e,t,n)=>{e.type.unit===on.DAY_TIME?qy(e,t,n):Vy(e,t,n)},qy=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Vy=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},jy=({values:e},t,n)=>{e[t]=n},Yy=({values:e},t,n)=>{e[t]=n},Wy=({values:e},t,n)=>{e[t]=n},Gy=({values:e},t,n)=>{e[t]=n},I_=(e,t,n)=>{switch(e.type.unit){case at.SECOND:return jy(e,t,n);case at.MILLISECOND:return Yy(e,t,n);case at.MICROSECOND:return Wy(e,t,n);case at.NANOSECOND:return Gy(e,t,n)}},oC=(e,t,n)=>{let{stride:r}=e,i=e.children[0],o=wn.getVisitFn(i);if(Array.isArray(n))for(let s=-1,a=t*r;++s<r;)o(i,a+s,n[s]);else for(let s=-1,a=t*r;++s<r;)o(i,a+s,n.get(s))};xt.prototype.visitBool=It(XF);xt.prototype.visitInt=It(Go);xt.prototype.visitInt8=It(Go);xt.prototype.visitInt16=It(Go);xt.prototype.visitInt32=It(Go);xt.prototype.visitInt64=It(Go);xt.prototype.visitUint8=It(Go);xt.prototype.visitUint16=It(Go);xt.prototype.visitUint32=It(Go);xt.prototype.visitUint64=It(Go);xt.prototype.visitFloat=It(HF);xt.prototype.visitFloat16=It(Y6);xt.prototype.visitFloat32=It(g_);xt.prototype.visitFloat64=It(g_);xt.prototype.visitUtf8=It(G6);xt.prototype.visitLargeUtf8=It(G6);xt.prototype.visitBinary=It(W6);xt.prototype.visitLargeBinary=It(W6);xt.prototype.visitFixedSizeBinary=It(b_);xt.prototype.visitDate=It(x_);xt.prototype.visitDateDay=It(Oy);xt.prototype.visitDateMillisecond=It(Ly);xt.prototype.visitTimestamp=It(w_);xt.prototype.visitTimestampSecond=It(Fy);xt.prototype.visitTimestampMillisecond=It(Cy);xt.prototype.visitTimestampMicrosecond=It(Ry);xt.prototype.visitTimestampNanosecond=It(ky);xt.prototype.visitTime=It(__);xt.prototype.visitTimeSecond=It($y);xt.prototype.visitTimeMillisecond=It(Uy);xt.prototype.visitTimeMicrosecond=It(Py);xt.prototype.visitTimeNanosecond=It(zy);xt.prototype.visitDecimal=It(v_);xt.prototype.visitList=It(ZF);xt.prototype.visitStruct=It(nC);xt.prototype.visitUnion=It(rC);xt.prototype.visitDenseUnion=It(X6);xt.prototype.visitSparseUnion=It(H6);xt.prototype.visitDictionary=It(iC);xt.prototype.visitInterval=It(S_);xt.prototype.visitIntervalDayTime=It(qy);xt.prototype.visitIntervalYearMonth=It(Vy);xt.prototype.visitDuration=It(I_);xt.prototype.visitDurationSecond=It(jy);xt.prototype.visitDurationMillisecond=It(Yy);xt.prototype.visitDurationMicrosecond=It(Wy);xt.prototype.visitDurationNanosecond=It(Gy);xt.prototype.visitFixedSizeList=It(oC);xt.prototype.visitMap=It(KF);var wn=new xt;var wi=Symbol.for("parent"),Ul=Symbol.for("rowIndex"),na=class{constructor(t,n){return this[wi]=t,this[Ul]=n,new Proxy(this,new A_)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Ul],n=this[wi],r=n.type.children,i={};for(let o=-1,s=r.length;++o<s;)i[r[o].name]=Ve.visit(n.children[o],t);return i}toString(){return`{${[...this].map(([t,n])=>`${gi(t)}: ${gi(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new M_(this[wi],this[Ul])}},M_=class{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,Ve.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(na.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[wi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ul]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});var A_=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[wi].type.children.map(n=>n.name)}has(t,n){return t[wi].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[wi].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[wi].type.children.findIndex(i=>i.name===n);if(r!==-1){let i=Ve.visit(t[wi].children[r],t[Ul]);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[wi].type.children.findIndex(o=>o.name===n);return i!==-1?(wn.visit(t[wi].children[i],t[Ul],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}};var pt=class extends dt{};function vt(e){return(t,n)=>t.getValid(n)?e(t,n):null}var sC=(e,t)=>864e5*e[t],aC=(e,t)=>null,Z6=(e,t,n)=>{if(n+1>=t.length)return null;let r=Kt(t[n]),i=Kt(t[n+1]);return e.subarray(r,i)},cC=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<<r%8)!==0},K6=({values:e},t)=>sC(e,t),Q6=({values:e},t)=>Kt(e[t]),ra=({stride:e,values:t},n)=>t[e*n],lC=({stride:e,values:t},n)=>Ny(t[e*n]),J6=({values:e},t)=>e[t],uC=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),tA=({values:e,valueOffsets:t},n)=>Z6(e,t,n),eA=({values:e,valueOffsets:t},n)=>{let r=Z6(e,t,n);return r!==null?th(r):null},fC=({values:e},t)=>e[t],hC=({type:e,values:t},n)=>e.precision!==he.HALF?t[n]:Ny(t[n]),dC=(e,t)=>e.type.unit===Re.DAY?K6(e,t):Q6(e,t),nA=({values:e},t)=>1e3*Kt(e[t]),rA=({values:e},t)=>Kt(e[t]),iA=({values:e},t)=>h_(e[t],BigInt(1e3)),oA=({values:e},t)=>h_(e[t],BigInt(1e6)),pC=(e,t)=>{switch(e.type.unit){case at.SECOND:return nA(e,t);case at.MILLISECOND:return rA(e,t);case at.MICROSECOND:return iA(e,t);case at.NANOSECOND:return oA(e,t)}},sA=({values:e},t)=>e[t],aA=({values:e},t)=>e[t],cA=({values:e},t)=>e[t],lA=({values:e},t)=>e[t],mC=(e,t)=>{switch(e.type.unit){case at.SECOND:return sA(e,t);case at.MILLISECOND:return aA(e,t);case at.MICROSECOND:return cA(e,t);case at.NANOSECOND:return lA(e,t)}},yC=({values:e,stride:t},n)=>yh.decimal(e.subarray(t*n,t*(n+1))),gC=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:o,[t*r+1]:s}=n,c=i[0].slice(o,s-o);return new qt([c])},bC=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:o}=n,s=r[0];return new no(s.slice(i,o-i))},xC=(e,t)=>new na(e,t),wC=(e,t)=>e.type.mode===ye.Dense?uA(e,t):fA(e,t),uA=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ve.visit(r,e.valueOffsets[t])},fA=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ve.visit(r,t)},_C=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},vC=(e,t)=>e.type.unit===on.DAY_TIME?hA(e,t):dA(e,t),hA=({values:e},t)=>e.subarray(2*t,2*(t+1)),dA=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},pA=({values:e},t)=>e[t],mA=({values:e},t)=>e[t],yA=({values:e},t)=>e[t],gA=({values:e},t)=>e[t],SC=(e,t)=>{switch(e.type.unit){case at.SECOND:return pA(e,t);case at.MILLISECOND:return mA(e,t);case at.MICROSECOND:return yA(e,t);case at.NANOSECOND:return gA(e,t)}},IC=(e,t)=>{let{stride:n,children:r}=e,o=r[0].slice(t*n,n);return new qt([o])};pt.prototype.visitNull=vt(aC);pt.prototype.visitBool=vt(cC);pt.prototype.visitInt=vt(fC);pt.prototype.visitInt8=vt(ra);pt.prototype.visitInt16=vt(ra);pt.prototype.visitInt32=vt(ra);pt.prototype.visitInt64=vt(J6);pt.prototype.visitUint8=vt(ra);pt.prototype.visitUint16=vt(ra);pt.prototype.visitUint32=vt(ra);pt.prototype.visitUint64=vt(J6);pt.prototype.visitFloat=vt(hC);pt.prototype.visitFloat16=vt(lC);pt.prototype.visitFloat32=vt(ra);pt.prototype.visitFloat64=vt(ra);pt.prototype.visitUtf8=vt(eA);pt.prototype.visitLargeUtf8=vt(eA);pt.prototype.visitBinary=vt(tA);pt.prototype.visitLargeBinary=vt(tA);pt.prototype.visitFixedSizeBinary=vt(uC);pt.prototype.visitDate=vt(dC);pt.prototype.visitDateDay=vt(K6);pt.prototype.visitDateMillisecond=vt(Q6);pt.prototype.visitTimestamp=vt(pC);pt.prototype.visitTimestampSecond=vt(nA);pt.prototype.visitTimestampMillisecond=vt(rA);pt.prototype.visitTimestampMicrosecond=vt(iA);pt.prototype.visitTimestampNanosecond=vt(oA);pt.prototype.visitTime=vt(mC);pt.prototype.visitTimeSecond=vt(sA);pt.prototype.visitTimeMillisecond=vt(aA);pt.prototype.visitTimeMicrosecond=vt(cA);pt.prototype.visitTimeNanosecond=vt(lA);pt.prototype.visitDecimal=vt(yC);pt.prototype.visitList=vt(gC);pt.prototype.visitStruct=vt(xC);pt.prototype.visitUnion=vt(wC);pt.prototype.visitDenseUnion=vt(uA);pt.prototype.visitSparseUnion=vt(fA);pt.prototype.visitDictionary=vt(_C);pt.prototype.visitInterval=vt(vC);pt.prototype.visitIntervalDayTime=vt(hA);pt.prototype.visitIntervalYearMonth=vt(dA);pt.prototype.visitDuration=vt(SC);pt.prototype.visitDurationSecond=vt(pA);pt.prototype.visitDurationMillisecond=vt(mA);pt.prototype.visitDurationMicrosecond=vt(yA);pt.prototype.visitDurationNanosecond=vt(gA);pt.prototype.visitFixedSizeList=vt(IC);pt.prototype.visitMap=vt(bC);var Ve=new pt;var ia=Symbol.for("keys"),zl=Symbol.for("vals"),Pl=Symbol.for("kKeysAsStrings"),T_=Symbol.for("_kKeysAsStrings"),no=class{constructor(t){return this[ia]=new qt([t.children[0]]).memoize(),this[zl]=t.children[1],new Proxy(this,new D_)}get[Pl](){return this[T_]||(this[T_]=Array.from(this[ia].toArray(),String))}[Symbol.iterator](){return new E_(this[ia],this[zl])}get size(){return this[ia].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ia],n=this[zl],r={};for(let i=-1,o=t.length;++i<o;)r[t.get(i)]=Ve.visit(n,i);return r}toString(){return`{${[...this].map(([t,n])=>`${gi(t)}: ${gi(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},E_=class{constructor(t,n){this.keys=t,this.vals=n,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Ve.visit(this.vals,t)]})}},D_=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Pl]}has(t,n){return t[Pl].includes(n)}getOwnPropertyDescriptor(t,n){if(t[Pl].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];let r=t[Pl].indexOf(n);if(r!==-1){let i=Ve.visit(Reflect.get(t,zl),r);return Reflect.set(t,n,i),i}}set(t,n,r){let i=t[Pl].indexOf(n);return i!==-1?(wn.visit(Reflect.get(t,zl),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}};Object.defineProperties(no.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ia]:{writable:!0,enumerable:!1,configurable:!1,value:null},[zl]:{writable:!0,enumerable:!1,configurable:!1,value:null},[T_]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var bA;function Eh(e,t,n,r){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof n!="number"?i:n;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(bA=o,o=s,s=bA),s>i&&(s=i),r?r(e,o,s):[o,s]}var rc=(e,t)=>e<0?t+e:e,xA=e=>e!==e;function oa(e){if(typeof e!=="object"||e===null)return xA(e)?xA:n=>n===e;if(e instanceof Date){let n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?a_(e,n):!1:e instanceof Map?AC(e):Array.isArray(e)?MC(e):e instanceof qt?TC(e):EC(e,!0)}function MC(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=oa(e[n]);return Xy(t)}function AC(e){let t=-1,n=[];for(let r of e.values())n[++t]=oa(r);return Xy(n)}function TC(e){let t=[];for(let n=-1,r=e.length;++n<r;)t[n]=oa(e.get(n));return Xy(t)}function EC(e,t=!1){let n=Object.keys(e);if(!t&&n.length===0)return()=>!1;let r=[];for(let i=-1,o=n.length;++i<o;)r[i]=oa(e[n[i]]);return Xy(r,n)}function Xy(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return DC(e,n);case Map:return wA(e,n,n.keys());case no:case na:case Object:case void 0:return wA(e,n,t||Object.keys(n))}return n instanceof qt?BC(e,n):!1}}function DC(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t[r]))return!1;return!0}function BC(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t.get(r)))return!1;return!0}function wA(e,t,n){let r=n[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=r.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=r.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(r.return&&r.return(),i.return&&i.return(),o.return&&o.return(),!1)}var N_={};Ws(N_,{BitIterator:()=>ic,getBit:()=>_A,getBool:()=>Zy,packBools:()=>sc,popcnt_array:()=>vA,popcnt_bit_range:()=>Dh,popcnt_uint32:()=>Hy,setBool:()=>NC,truncateBitmap:()=>oc});function Zy(e,t,n,r){return(n&1<<r)!==0}function _A(e,t,n,r){return(n&1<<r)>>r}function NC(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function oc(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength<r){let i=new Uint8Array(r);return i.set(e%8===0?n.subarray(e>>3):sc(new ic(n,e,t,null,Zy)).subarray(0,r)),i}return n}function sc(e){let t=[],n=0,r=0,i=0;for(let s of e)s&&(i|=1<<r),++r===8&&(t[n++]=i,i=r=0);(n===0||r>0)&&(t[n++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}var ic=class{constructor(t,n,r,i,o){this.bytes=t,this.length=r,this.context=i,this.get=o,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};function Dh(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(let s of new ic(e,t,n-t,e,_A))o+=s;return o}let r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return Dh(e,t,i)+Dh(e,r,n)+vA(e,i>>3,r-i>>3)}function vA(e,t,n){let r=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=n===void 0?e.byteLength:i+n;for(;s-i>=4;)r+=Hy(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=Hy(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=Hy(o.getUint8(i)),i+=1;return r}function Hy(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var OC=-1,Jt=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return G.isSparseUnion(t)?this.children.some(n=>n.nullable):G.isDenseUnion(t)?this.children.some(n=>n.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:n,values:r,nullBitmap:i,typeIds:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(G.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=OC&&(n=this.nullBitmap)&&(this._nullCount=t=n.length===0?0:this.length-Dh(n,this.offset,this.offset+this.length)),t}constructor(t,n,r,i,o,s=[],a){this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=Ir(t),o&&((c=o[0])&&(this.valueOffsets=c),(c=o[1])&&(this.values=c),(c=o[2])&&(this.nullBitmap=c),(c=o[3])&&(this.typeIds=c)))}getValid(t){let{type:n}=this;if(G.isUnion(n)){let r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],o=r.mode===ye.Dense?this.valueOffsets[t]:t;return i.getValid(o)}if(this.nullable&&this.nullCount>0){let r=this.offset+t;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}setValid(t,n){let r,{type:i}=this;if(G.isUnion(i)){let o=i,s=this.children[o.typeIdToChildIndex[this.typeIds[t]]],a=o.mode===ye.Dense?this.valueOffsets[t]:t;r=s.getValid(a),s.setValid(a,n)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(oc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let f=o[u];r=(f&l)!==0,o[u]=n?f|l:f&~l}return r!==!!n&&(this._nullCount=this.nullCount+(n?-1:1)),n}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,o=this,s=this.children){return new e(t,n,r,i,o,s,this.dictionary)}slice(t,n){let{stride:r,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?r:1,c=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===L.Null)return this.clone(this.type,0,t,0);let{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<<n-(n&-8))-1,r>0&&i.set(oc(this.offset,n,this.nullBitmap),0);let o=this.buffers;return o[yi.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),o)}_sliceBuffers(t,n,r,i){let o,{buffers:s}=this;return(o=s[yi.TYPE])&&(s[yi.TYPE]=o.subarray(t,t+n)),(o=s[yi.OFFSET])&&(s[yi.OFFSET]=o.subarray(t,t+n+1))||(o=s[yi.DATA])&&(s[yi.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}};Jt.prototype.children=Object.freeze([]);var O_=class e extends dt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new Jt(n,r,i,i)}visitBool(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitInt(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.data),o=_t(t.nullBitmap),s=ec(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,i,o])}visitLargeUtf8(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.data),o=_t(t.nullBitmap),s=Iy(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,i,o])}visitBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.data),o=_t(t.nullBitmap),s=ec(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,i,o])}visitLargeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.data),o=_t(t.nullBitmap),s=Iy(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitDate(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitTime(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitList(t){let{["type"]:n,["offset"]:r=0,["child"]:i}=t,o=_t(t.nullBitmap),s=ec(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=_t(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,o=kt(n.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(G.isSparseUnion(n))return new Jt(n,r,s,a,[void 0,void 0,void 0,o],i);let c=ec(t.valueOffsets);return new Jt(n,r,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.indices.ArrayType,t.data),{["dictionary"]:s=new qt([new e().visit({type:n.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:n,["offset"]:r=0}=t,i=_t(t.nullBitmap),o=kt(n.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.valueType})}=t,o=_t(t.nullBitmap),{["length"]:s=i.length/Ir(n),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Jt(n,r,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:n,["offset"]:r=0,["child"]:i=new e().visit({type:n.childType})}=t,o=_t(t.nullBitmap),s=ec(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new Jt(n,r,a,c,[s,void 0,o],[i])}},LC=new O_;function At(e){return LC.visit(e)}var Bh=class{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}};function SA(e){return e.some(t=>t.nullable)}function Ky(e){return e.reduce((t,n)=>t+n.nullCount,0)}function Qy(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Jy(e,t,n,r){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=r)break;if(n>=c+l)continue;if(c>=n&&c+l<=r){i.push(a);continue}let u=Math.max(0,n-c),f=Math.min(r-c,l);i.push(a.slice(u,f-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function L_(e,t,n,r){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return n<t[s]?r(e,i,n-t[i]):null;o=i+Math.trunc((s-i)*.5),n<t[o]?s=o:i=o}while(i<s)}function Nh(e,t){return e.getValid(t)}function ql(e){function t(n,r,i){return e(n[r],i)}return function(n){let r=this.data;return L_(r,this._offsets,n,t)}}function t0(e){let t;function n(r,i,o){return e(r[i],o,t)}return function(r,i){let o=this.data;t=i;let s=L_(o,this._offsets,r,n);return t=void 0,s}}function e0(e){let t;function n(r,i,o){let s=o,a=0,c=0;for(let l=i-1,u=r.length;++l<u;){let f=r[l];if(~(a=e(f,t,s)))return c+a;s=0,c+=f.length}return-1}return function(r,i){t=r;let o=this.data,s=typeof i!="number"?n(o,0,0):L_(o,this._offsets,i,n);return t=void 0,s}}var mt=class extends dt{};function FC(e,t){return t===null&&e.length>0?0:-1}function CC(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new ic(n,e.offset+(t||0),e.length,n,Zy)){if(!i)return r;++r}return-1}function Tt(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case L.Union:break;case L.Dictionary:break;default:return CC(e,n)}let r=Ve.getVisitFn(e),i=oa(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}function IA(e,t,n){let r=Ve.getVisitFn(e),i=oa(t);for(let o=(n||0)-1,s=e.length;++o<s;)if(i(r(e,o)))return o;return-1}mt.prototype.visitNull=FC;mt.prototype.visitBool=Tt;mt.prototype.visitInt=Tt;mt.prototype.visitInt8=Tt;mt.prototype.visitInt16=Tt;mt.prototype.visitInt32=Tt;mt.prototype.visitInt64=Tt;mt.prototype.visitUint8=Tt;mt.prototype.visitUint16=Tt;mt.prototype.visitUint32=Tt;mt.prototype.visitUint64=Tt;mt.prototype.visitFloat=Tt;mt.prototype.visitFloat16=Tt;mt.prototype.visitFloat32=Tt;mt.prototype.visitFloat64=Tt;mt.prototype.visitUtf8=Tt;mt.prototype.visitLargeUtf8=Tt;mt.prototype.visitBinary=Tt;mt.prototype.visitLargeBinary=Tt;mt.prototype.visitFixedSizeBinary=Tt;mt.prototype.visitDate=Tt;mt.prototype.visitDateDay=Tt;mt.prototype.visitDateMillisecond=Tt;mt.prototype.visitTimestamp=Tt;mt.prototype.visitTimestampSecond=Tt;mt.prototype.visitTimestampMillisecond=Tt;mt.prototype.visitTimestampMicrosecond=Tt;mt.prototype.visitTimestampNanosecond=Tt;mt.prototype.visitTime=Tt;mt.prototype.visitTimeSecond=Tt;mt.prototype.visitTimeMillisecond=Tt;mt.prototype.visitTimeMicrosecond=Tt;mt.prototype.visitTimeNanosecond=Tt;mt.prototype.visitDecimal=Tt;mt.prototype.visitList=Tt;mt.prototype.visitStruct=Tt;mt.prototype.visitUnion=Tt;mt.prototype.visitDenseUnion=IA;mt.prototype.visitSparseUnion=IA;mt.prototype.visitDictionary=Tt;mt.prototype.visitInterval=Tt;mt.prototype.visitIntervalDayTime=Tt;mt.prototype.visitIntervalYearMonth=Tt;mt.prototype.visitDuration=Tt;mt.prototype.visitDurationSecond=Tt;mt.prototype.visitDurationMillisecond=Tt;mt.prototype.visitDurationMicrosecond=Tt;mt.prototype.visitDurationNanosecond=Tt;mt.prototype.visitFixedSizeList=Tt;mt.prototype.visitMap=Tt;var ac=new mt;var yt=class extends dt{};function St(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(G.isInt(t)&&t.bitWidth!==64||G.isTime(t)&&t.bitWidth!==64||G.isFloat(t)&&t.precision!==he.HALF))return new Bh(e.data.length,r=>{let i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new Bh(e.data.length,r=>{let o=e.data[r].length,s=e.slice(n,n+o);return n+=o,new F_(s)})}var F_=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};yt.prototype.visitNull=St;yt.prototype.visitBool=St;yt.prototype.visitInt=St;yt.prototype.visitInt8=St;yt.prototype.visitInt16=St;yt.prototype.visitInt32=St;yt.prototype.visitInt64=St;yt.prototype.visitUint8=St;yt.prototype.visitUint16=St;yt.prototype.visitUint32=St;yt.prototype.visitUint64=St;yt.prototype.visitFloat=St;yt.prototype.visitFloat16=St;yt.prototype.visitFloat32=St;yt.prototype.visitFloat64=St;yt.prototype.visitUtf8=St;yt.prototype.visitLargeUtf8=St;yt.prototype.visitBinary=St;yt.prototype.visitLargeBinary=St;yt.prototype.visitFixedSizeBinary=St;yt.prototype.visitDate=St;yt.prototype.visitDateDay=St;yt.prototype.visitDateMillisecond=St;yt.prototype.visitTimestamp=St;yt.prototype.visitTimestampSecond=St;yt.prototype.visitTimestampMillisecond=St;yt.prototype.visitTimestampMicrosecond=St;yt.prototype.visitTimestampNanosecond=St;yt.prototype.visitTime=St;yt.prototype.visitTimeSecond=St;yt.prototype.visitTimeMillisecond=St;yt.prototype.visitTimeMicrosecond=St;yt.prototype.visitTimeNanosecond=St;yt.prototype.visitDecimal=St;yt.prototype.visitList=St;yt.prototype.visitStruct=St;yt.prototype.visitUnion=St;yt.prototype.visitDenseUnion=St;yt.prototype.visitSparseUnion=St;yt.prototype.visitDictionary=St;yt.prototype.visitInterval=St;yt.prototype.visitIntervalDayTime=St;yt.prototype.visitIntervalYearMonth=St;yt.prototype.visitDuration=St;yt.prototype.visitDurationSecond=St;yt.prototype.visitDurationMillisecond=St;yt.prototype.visitDurationMicrosecond=St;yt.prototype.visitDurationNanosecond=St;yt.prototype.visitFixedSizeList=St;yt.prototype.visitMap=St;var Vl=new yt;var MA,AA={},TA={},qt=class e{constructor(t){var n,r,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof Jt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(n=o[0])===null||n===void 0?void 0:n.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=AA[s.typeId],u=o[0];this.isValid=f=>Nh(u,f),this.get=f=>a(u,f),this.set=(f,h)=>c(u,f,h),this.indexOf=f=>l(u,f),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,TA[s.typeId]),this._offsets=Qy(o);break}this.data=o,this.type=s,this.stride=Ir(s),this.numChildren=(i=(r=s.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullable(){return SA(this.data)}get nullCount(){return Ky(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(rc(t,this.length))}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}[Symbol.iterator](){return Vl.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new e(Eh(this,t,n,({data:r,_offsets:i},o,s)=>Jy(r,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:n,length:r,stride:i,ArrayType:o}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(n.length){case 0:return new o;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:n})=>n[t])):null}get isMemoized(){return G.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(G.isDictionary(this.type)){let t=new n0(this.data[0].dictionary),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return new n0(this)}unmemoize(){if(G.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{let i=r.clone();return i.dictionary=t,i});return new e(n)}return this}};MA=Symbol.toStringTag;qt[MA]=(e=>{e.type=G.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(L).map(n=>L[n]).filter(n=>typeof n=="number"&&n!==L.NONE);for(let n of t){let r=Ve.getVisitFnByTypeId(n),i=wn.getVisitFnByTypeId(n),o=ac.getVisitFnByTypeId(n);AA[n]={get:r,set:i,indexOf:o},TA[n]=Object.create(e,{isValid:{value:ql(Nh)},get:{value:ql(Ve.getVisitFnByTypeId(n))},set:{value:t0(wn.getVisitFnByTypeId(n))},indexOf:{value:e0(ac.getVisitFnByTypeId(n))}})}return"Vector"})(qt.prototype);var n0=class e extends qt{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=n.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){r.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new qt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function EA(e){if(!e||e.length<=0)return function(i){return!0};let t="",n=e.filter(r=>r===r);return n.length>0&&(t=`
|
|
2
|
-
switch (x) {${n.map(r=>`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
${t}`),new Function("x",`${t}
|
|
7
|
-
return true;`)}function RC(e){return typeof e!="bigint"?gi(e):`${gi(e)}n`}function C_(e,t){let n=Math.ceil(e)*t-1;return(n-n%64+64||64)/t}function DA(e,t=0){return e.length>=t?e.subarray(0,t):nh(new e.constructor(t),e,0)}var _i=class{constructor(t,n=0,r=1){this.length=Math.ceil(n/r),this.buffer=new t(this.length),this.stride=r,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?C_(r*1,this.BYTES_PER_ELEMENT):C_(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=C_(t*this.stride,this.BYTES_PER_ELEMENT);let n=DA(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=DA(this.buffer,t)}},Xo=class extends _i{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}},jl=class extends Xo{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){let{buffer:r}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=r[i]>>o&1;return n?s===0&&(r[i]|=1<<o,++this.numValid):s===1&&(r[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Yl=class extends Xo{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,n){let r=this.length-1,i=this.reserve(t-r+1).buffer;return r<t++&&r>=0&&i.fill(i[r],r,t),i[t]=i[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}};var we=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=Ir(t),this._nulls=new jl,n&&n.length>0&&(this._isValid=EA(n))}toVector(){return new qt([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:n,_values:r,_nulls:i,_typeIds:o,children:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((n,r)=>n+r.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,n,r,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:f}=this;(n=c?.flush(s))?i=l?.flush(s):(i=l?.flush(s))?t=u?.flush(l.last()):t=u?.flush(s),a>0&&(r=f?.flush(s));let h=this.children.map(d=>d.flush());return this.clear(),At({type:o,length:s,nullCount:a,children:h,child:h[0],data:t,typeIds:n,nullBitmap:r,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,n,r,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(n=this._values)===null||n===void 0||n.clear(),(r=this._offsets)===null||r===void 0||r.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};we.prototype.length=1;we.prototype.stride=1;we.prototype.children=null;we.prototype.finished=!1;we.prototype.nullValues=null;we.prototype._isValid=()=>!0;var je=class extends we{constructor(t){super(t),this._values=new Xo(this.ArrayType,0,this.stride)}setValue(t,n){let r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}},lr=class extends we{constructor(t){super(t),this._pendingLength=0,this._offsets=new Yl(t.type)}setValue(t,n){let r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n instanceof no?n[ia].length:n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}};var cc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,n,r,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(n??0)),t.offset()}};var Mr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ae.V1}schema(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new ar).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new cc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,n){let r=this.bb.__offset(this.bb_pos,10);return r?(n||new cc).__init(this.bb.__vector(this.bb_pos+r)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,ae.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}};var ie=class e{constructor(t=[],n,r,i=ae.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=R_(t)),this.dictionaries=r,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){let n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(r=>this.fields[r]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=r0(r0(new Map,this.metadata),n.metadata),o=n.fields.filter(a=>{let c=r.findIndex(l=>l.name===a.name);return~c?(r[c]=a.clone({metadata:r0(r0(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=R_(o,new Map);return new e([...r,...o],i,new Map([...this.dictionaries,...s]))}};ie.prototype.fields=null;ie.prototype.metadata=null;ie.prototype.dictionaries=null;var $t=class e{static new(...t){let[n,r,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${n}`,r,i,o)}constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,o]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,o=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(n,r,i,o)}};$t.prototype.type=null;$t.prototype.name=null;$t.prototype.nullable=null;$t.prototype.metadata=null;function r0(e,t){return new Map([...e||new Map,...t||new Map])}function R_(e,t=new Map){for(let n=-1,r=e.length;++n<r;){let o=e[n].type;if(G.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&R_(o.children,t)}return t}var kC=nc,$C=_r,Ho=class{static decode(t){t=new $C(_t(t));let n=Mr.getRootAsFooter(t),r=ie.decode(n.schema(),new Map,n.version());return new k_(r,n)}static encode(t){let n=new kC,r=ie.encode(n,t.schema);Mr.startRecordBatchesVector(n,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Zo.encode(n,s);let i=n.endVector();Mr.startDictionariesVector(n,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Zo.encode(n,s);let o=n.endVector();return Mr.startFooter(n),Mr.addSchema(n,r),Mr.addVersion(n,ae.V5),Mr.addRecordBatches(n,i),Mr.addDictionaries(n,o),Mr.finishFooterBuffer(n,Mr.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=ae.V5,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n<r;)(t=this.getRecordBatch(n))&&(yield t)}*dictionaryBatches(){for(let t,n=-1,r=this.numDictionaries;++n<r;)(t=this.getDictionaryBatch(n))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}};var k_=class extends Ho{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,n){super(t,n.version()),this._footer=n}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let n=this._footer.recordBatches(t);if(n)return Zo.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let n=this._footer.dictionaries(t);if(n)return Zo.decode(n)}return null}},Zo=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,n){let{metaDataLength:r}=n,i=BigInt(n.offset),o=BigInt(n.bodyLength);return cc.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=Kt(r),this.bodyLength=Kt(n)}};var xe=Object.freeze({done:!0,value:void 0}),Oh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},lc=class{tee(){return this._getDOMStream().tee()}pipe(t,n){return this._getNodeStream().pipe(t,n)}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},i0=class extends lc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Z(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(xe);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return xn.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return xn.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Z(this,void 0,void 0,function*(){return yield this.abort(t),xe})}return(t){return Z(this,void 0,void 0,function*(){return yield this.close(),xe})}read(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(xe)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};var ro=class extends i0{write(t){if((t=_t(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?th(this.toUint8Array(!0)):this.toUint8Array(!1).then(th)}toUint8Array(t=!1){return t?wr(this._values)[0]:Z(this,void 0,void 0,function*(){var n,r,i,o;let s=[],a=0;try{for(var c=!0,l=ui(this),u;u=yield l.next(),n=u.done,!n;c=!0){o=u.value,c=!1;let f=o;s.push(f),a+=f.byteLength}}catch(f){r={error:f}}finally{try{!c&&!n&&(i=l.return)&&(yield i.call(l))}finally{if(r)throw r.error}}return wr(s,a)[0]})}},io=class{constructor(t){t&&(this.source=new $_(xn.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Yr=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof ro?this.source=new Ko(xn.fromAsyncIterable(t)):Sy(t)?this.source=new Ko(xn.fromNodeStream(t)):eh(t)?this.source=new Ko(xn.fromDOMStream(t)):_y(t)?this.source=new Ko(xn.fromDOMStream(t.body)):fi(t)?this.source=new Ko(xn.fromIterable(t)):xr(t)?this.source=new Ko(xn.fromAsyncIterable(t)):Ur(t)&&(this.source=new Ko(xn.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},$_=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||xe)}return(t){return Object.create(this.source.return&&this.source.return(t)||xe)}},Ko=class{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return Z(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Z(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Z(this,arguments,void 0,function*(n,r="read"){return yield this.source.next({cmd:r,size:n})})}throw(t){return Z(this,void 0,void 0,function*(){let n=this.source.throw&&(yield this.source.throw(t))||xe;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return Z(this,void 0,void 0,function*(){let n=this.source.return&&(yield this.source.return(t))||xe;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}};var Lh=class extends io{constructor(t,n){super(),this.position=0,this.buffer=_t(t),this.size=n===void 0?this.buffer.byteLength:n}readInt32(t){let{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:n,size:r,position:i}=this;return n&&i<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,i+Math.min(r-i,t)),n.subarray(i,this.position)):null}readAt(t,n){let r=this.buffer,i=Math.min(this.size,t+n);return r?r.subarray(t,i):new Uint8Array(n)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},sa=class extends Yr{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=Z(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return Z(this,void 0,void 0,function*(){let{buffer:n,byteOffset:r}=yield this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)})}seek(t){return Z(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return Z(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:r,position:i}=this;if(n&&i<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(r,o+Math.min(r-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield n.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,n){return Z(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:i}=this;if(r&&t+n<i){let o=Math.min(i,t+n),s=new Uint8Array(o-t);return(yield r.read(s,0,n,t)).buffer}return new Uint8Array(n)})}close(){return Z(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return Z(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return Z(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}};var P_={};Ws(P_,{BaseInt64:()=>Fh,Int128:()=>Ch,Int64:()=>Qo,Uint64:()=>Ee});function Wl(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Gl=8,U_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Fh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let n=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=n[3]*r[3];this.buffer[0]=i&65535;let o=i>>>16;return i=n[2]*r[3],o+=i,i=n[3]*r[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){let n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Wl(this.buffer[1])} ${Wl(this.buffer[0])}`}},Ee=class e extends Fh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.length,i=new e(n);for(let o=0;o<r;){let s=Gl<r-o?Gl:r-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([U_[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},Qo=class e extends Fh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let n=this.buffer[1]<<0,r=t.buffer[1]<<0;return n<r||n===r&&this.buffer[0]<t.buffer[0]}static from(t,n=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=Gl<i-s?Gl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([U_[a],0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}},Ch=class e{constructor(t){this.buffer=t}high(){return new Qo(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Qo(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let n=new Ee(new Uint32Array([this.buffer[3],0])),r=new Ee(new Uint32Array([this.buffer[2],0])),i=new Ee(new Uint32Array([this.buffer[1],0])),o=new Ee(new Uint32Array([this.buffer[0],0])),s=new Ee(new Uint32Array([t.buffer[3],0])),a=new Ee(new Uint32Array([t.buffer[2],0])),c=new Ee(new Uint32Array([t.buffer[1],0])),l=new Ee(new Uint32Array([t.buffer[0],0])),u=Ee.multiply(o,l);this.buffer[0]=u.low();let f=new Ee(new Uint32Array([u.high(),0]));return u=Ee.multiply(i,l),f.plus(u),u=Ee.multiply(o,c),f.plus(u),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(u)?1:0,this.buffer[2]=f.high(),new Ee(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Ee.multiply(r,l)).plus(Ee.multiply(i,c)).plus(Ee.multiply(o,a)),this.buffer[3]+=Ee.multiply(n,l).plus(Ee.multiply(r,c)).plus(Ee.multiply(i,a)).plus(Ee.multiply(o,s)).low(),this}plus(t){let n=new Uint32Array(4);return n[3]=this.buffer[3]+t.buffer[3]>>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]<this.buffer[0]>>>0&&++n[1],n[1]<this.buffer[1]>>>0&&++n[2],n[2]<this.buffer[2]>>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${Wl(this.buffer[3])} ${Wl(this.buffer[2])} ${Wl(this.buffer[1])} ${Wl(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith("-"),i=t.length,o=new e(n);for(let s=r?1:0;s<i;){let a=Gl<i-s?Gl:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([U_[a],0,0,0]));o.times(l),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){let n=new Uint32Array(t.length*4);for(let r=-1,i=t.length;++r<i;)e.from(t[r],new Uint32Array(n.buffer,n.byteOffset+4*4*r,4));return n}};var Rh=class extends dt{constructor(t,n,r,i,o=ae.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=n,this.buffers=r,this.dictionaries=i,this.metadataVersion=o}visit(t){return super.visit(t instanceof $t?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return At({type:t,length:n})}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return this.metadataVersion<ae.V5&&this.readNullBitmap(t,r),t.mode===ye.Sparse?this.visitSparseUnion(t,{length:n,nullCount:r}):this.visitDenseUnion(t,{length:n,nullCount:r})}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDuration(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:n,nullCount:r}=this.nextFieldNode()){return At({type:t,length:n,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,n,r=this.nextBufferRange()){return n>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}},o0=class extends Rh{constructor(t,n,r,i,o){super(new Uint8Array(0),n,r,i,o),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):sc(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(t.OffsetArrayType,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return kt(Uint8Array,kt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){let{sources:r}=this;return G.isTimestamp(t)?kt(Uint8Array,Qo.convertArray(r[n])):(G.isInt(t)||G.isTime(t))&&t.bitWidth===64||G.isDuration(t)?kt(Uint8Array,Qo.convertArray(r[n])):G.isDate(t)&&t.unit===Re.MILLISECOND?kt(Uint8Array,Qo.convertArray(r[n])):G.isDecimal(t)?kt(Uint8Array,Ch.convertArray(r[n])):G.isBinary(t)||G.isLargeBinary(t)||G.isFixedSizeBinary(t)?UC(r[n]):G.isBool(t)?sc(r[n]):G.isUtf8(t)||G.isLargeUtf8(t)?Ui(r[n].join("")):kt(Uint8Array,kt(t.ArrayType,r[n].map(i=>+i)))}};function UC(e){let t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r>>1]=Number.parseInt(t.slice(r,r+2),16);return n}var Xl=class extends lr{constructor(t){super(t),this._values=new _i(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,_t(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,0);else{let c=a.length;i.set(a,o),r.set(s,c),o+=c}}};var Hl=class extends lr{constructor(t){super(t),this._values=new _i(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,_t(n))}_flushPending(t,n){let r=this._offsets,i=this._values.reserve(n).buffer,o=0;for(let[s,a]of t)if(a===void 0)r.set(s,BigInt(0));else{let c=a.length;i.set(a,o),r.set(s,BigInt(c)),o+=c}}};var s0=class extends we{constructor(t){super(t),this._values=new jl}setValue(t,n){this._values.set(t,+n)}};var uc=class extends je{};uc.prototype._setValue=x_;var kh=class extends uc{};kh.prototype._setValue=Oy;var $h=class extends uc{};$h.prototype._setValue=Ly;var Uh=class extends je{};Uh.prototype._setValue=v_;var a0=class extends we{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new cr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=fc({type:this.type.indices,nullValues:n}),this.dictionary=fc({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,n){let r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){let r=this._keysToIndices,i=this.valueToKey(n),o=r[i];return o===void 0&&(r[i]=o=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}};var Ph=class extends je{};Ph.prototype._setValue=b_;var c0=class extends we{setValue(t,n){let[r]=this.children,i=t*this.stride;for(let o=-1,s=n.length;++o<s;)r.set(i+o,n[o])}addChild(t,n="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let r=this.children.push(t);return this.type=new Vr(this.type.listSize,new $t(n,t.type,!0)),r}};var hc=class extends je{setValue(t,n){this._values.set(t,n)}},l0=class extends hc{setValue(t,n){super.setValue(t,Th(n))}},u0=class extends hc{},f0=class extends hc{};var dc=class extends je{};dc.prototype._setValue=S_;var zh=class extends dc{};zh.prototype._setValue=qy;var qh=class extends dc{};qh.prototype._setValue=Vy;var Jo=class extends je{};Jo.prototype._setValue=I_;var Vh=class extends Jo{};Vh.prototype._setValue=jy;var jh=class extends Jo{};jh.prototype._setValue=Yy;var Yh=class extends Jo{};Yh.prototype._setValue=Wy;var Wh=class extends Jo{};Wh.prototype._setValue=Gy;var Wr=class extends je{setValue(t,n){this._values.set(t,n)}},h0=class extends Wr{},d0=class extends Wr{},p0=class extends Wr{},m0=class extends Wr{},y0=class extends Wr{},g0=class extends Wr{},b0=class extends Wr{},x0=class extends Wr{};var w0=class extends lr{constructor(t){super(t),this._offsets=new Yl(t.type)}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new zr(new $t(n,t.type,!0)),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(typeof o>"u")n.set(i,0);else{let s=o,a=s.length,c=n.set(i,a).buffer[i];for(let l=-1;++l<a;)r.set(c+l,s[l])}}};var _0=class extends lr{set(t,n){return super.set(t,n)}setValue(t,n){let r=n instanceof Map?n:new Map(Object.entries(n)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=r.size,i.set(t,r)}addChild(t,n=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new jr(new $t(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let n=this._offsets,[r]=this.children;for(let[i,o]of t)if(o===void 0)n.set(i,0);else{let{[i]:s,[i+1]:a}=n.set(i,o.size).buffer;for(let c of o.entries())if(r.set(s,c),++s>=a)break}}};var v0=class extends we{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}};var S0=class extends we{setValue(t,n){let{children:r,type:i}=this;switch(Array.isArray(n)||n.constructor){case!0:return i.children.forEach((o,s)=>r[s].set(t,n[s]));case Map:return i.children.forEach((o,s)=>r[s].set(t,n.get(o.name)));default:return i.children.forEach((o,s)=>r[s].set(t,n[o.name]))}}setValid(t,n){return super.setValid(t,n)||this.children.forEach(r=>r.setValid(t,n)),n}addChild(t,n=`${this.numChildren}`){let r=this.children.push(t);return this.type=new ge([...this.type.children,new $t(n,t.type,!0)]),r}};var ts=class extends je{};ts.prototype._setValue=w_;var Gh=class extends ts{};Gh.prototype._setValue=Fy;var Xh=class extends ts{};Xh.prototype._setValue=Cy;var Hh=class extends ts{};Hh.prototype._setValue=Ry;var Zh=class extends ts{};Zh.prototype._setValue=ky;var es=class extends je{};es.prototype._setValue=__;var Kh=class extends es{};Kh.prototype._setValue=$y;var Qh=class extends es{};Qh.prototype._setValue=Uy;var Jh=class extends es{};Jh.prototype._setValue=Py;var td=class extends es{};td.prototype._setValue=zy;var Zl=class extends we{constructor(t){super(t),this._typeIds=new Xo(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r);let i=this.type.typeIdToChildIndex[r],o=this.children[i];o?.set(t,n)}addChild(t,n=`${this.children.length}`){let r=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new $t(n,t.type)];return this.type=new qr(o,[...s,r],a),r}_valueToChildTypeId(t,n,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},I0=class extends Zl{},M0=class extends Zl{constructor(t){super(t),this._offsets=new Xo(Int32Array)}setValue(t,n,r){let i=this._typeIds.set(t,r).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o?.set(s,n)}};var ed=class extends lr{constructor(t){super(t),this._values=new _i(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ui(n))}_flushPending(t,n){}};ed.prototype._flushPending=Xl.prototype._flushPending;var nd=class extends lr{constructor(t){super(t),this._values=new _i(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Ui(n))}_flushPending(t,n){}};nd.prototype._flushPending=Hl.prototype._flushPending;var z_=class extends dt{visitNull(){return v0}visitBool(){return s0}visitInt(){return Wr}visitInt8(){return h0}visitInt16(){return d0}visitInt32(){return p0}visitInt64(){return m0}visitUint8(){return y0}visitUint16(){return g0}visitUint32(){return b0}visitUint64(){return x0}visitFloat(){return hc}visitFloat16(){return l0}visitFloat32(){return u0}visitFloat64(){return f0}visitUtf8(){return ed}visitLargeUtf8(){return nd}visitBinary(){return Xl}visitLargeBinary(){return Hl}visitFixedSizeBinary(){return Ph}visitDate(){return uc}visitDateDay(){return kh}visitDateMillisecond(){return $h}visitTimestamp(){return ts}visitTimestampSecond(){return Gh}visitTimestampMillisecond(){return Xh}visitTimestampMicrosecond(){return Hh}visitTimestampNanosecond(){return Zh}visitTime(){return es}visitTimeSecond(){return Kh}visitTimeMillisecond(){return Qh}visitTimeMicrosecond(){return Jh}visitTimeNanosecond(){return td}visitDecimal(){return Uh}visitList(){return w0}visitStruct(){return S0}visitUnion(){return Zl}visitDenseUnion(){return M0}visitSparseUnion(){return I0}visitDictionary(){return a0}visitInterval(){return dc}visitIntervalDayTime(){return zh}visitIntervalYearMonth(){return qh}visitDuration(){return Jo}visitDurationSecond(){return Vh}visitDurationMillisecond(){return jh}visitDurationMicrosecond(){return Yh}visitDurationNanosecond(){return Wh}visitFixedSizeList(){return c0}visitMap(){return _0}},BA=new z_;var gt=class extends dt{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}};function Yn(e,t){return t instanceof e.constructor}function pc(e,t){return e===t||Yn(e,t)}function ns(e,t){return e===t||Yn(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function A0(e,t){return e===t||Yn(e,t)&&e.precision===t.precision}function PC(e,t){return e===t||Yn(e,t)&&e.byteWidth===t.byteWidth}function q_(e,t){return e===t||Yn(e,t)&&e.unit===t.unit}function rd(e,t){return e===t||Yn(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function id(e,t){return e===t||Yn(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function zC(e,t){return e===t||Yn(e,t)&&e.children.length===t.children.length&&oo.compareManyFields(e.children,t.children)}function qC(e,t){return e===t||Yn(e,t)&&e.children.length===t.children.length&&oo.compareManyFields(e.children,t.children)}function V_(e,t){return e===t||Yn(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&oo.compareManyFields(e.children,t.children)}function VC(e,t){return e===t||Yn(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&oo.visit(e.indices,t.indices)&&oo.visit(e.dictionary,t.dictionary)}function j_(e,t){return e===t||Yn(e,t)&&e.unit===t.unit}function od(e,t){return e===t||Yn(e,t)&&e.unit===t.unit}function jC(e,t){return e===t||Yn(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&oo.compareManyFields(e.children,t.children)}function YC(e,t){return e===t||Yn(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&oo.compareManyFields(e.children,t.children)}gt.prototype.visitNull=pc;gt.prototype.visitBool=pc;gt.prototype.visitInt=ns;gt.prototype.visitInt8=ns;gt.prototype.visitInt16=ns;gt.prototype.visitInt32=ns;gt.prototype.visitInt64=ns;gt.prototype.visitUint8=ns;gt.prototype.visitUint16=ns;gt.prototype.visitUint32=ns;gt.prototype.visitUint64=ns;gt.prototype.visitFloat=A0;gt.prototype.visitFloat16=A0;gt.prototype.visitFloat32=A0;gt.prototype.visitFloat64=A0;gt.prototype.visitUtf8=pc;gt.prototype.visitLargeUtf8=pc;gt.prototype.visitBinary=pc;gt.prototype.visitLargeBinary=pc;gt.prototype.visitFixedSizeBinary=PC;gt.prototype.visitDate=q_;gt.prototype.visitDateDay=q_;gt.prototype.visitDateMillisecond=q_;gt.prototype.visitTimestamp=rd;gt.prototype.visitTimestampSecond=rd;gt.prototype.visitTimestampMillisecond=rd;gt.prototype.visitTimestampMicrosecond=rd;gt.prototype.visitTimestampNanosecond=rd;gt.prototype.visitTime=id;gt.prototype.visitTimeSecond=id;gt.prototype.visitTimeMillisecond=id;gt.prototype.visitTimeMicrosecond=id;gt.prototype.visitTimeNanosecond=id;gt.prototype.visitDecimal=pc;gt.prototype.visitList=zC;gt.prototype.visitStruct=qC;gt.prototype.visitUnion=V_;gt.prototype.visitDenseUnion=V_;gt.prototype.visitSparseUnion=V_;gt.prototype.visitDictionary=VC;gt.prototype.visitInterval=j_;gt.prototype.visitIntervalDayTime=j_;gt.prototype.visitIntervalYearMonth=j_;gt.prototype.visitDuration=od;gt.prototype.visitDurationSecond=od;gt.prototype.visitDurationMillisecond=od;gt.prototype.visitDurationMicrosecond=od;gt.prototype.visitDurationNanosecond=od;gt.prototype.visitFixedSizeList=jC;gt.prototype.visitMap=YC;var oo=new gt;function mc(e,t){return oo.compareSchemas(e,t)}function NA(e,t){return oo.compareFields(e,t)}function OA(e,t){return oo.visit(e,t)}function fc(e){let t=e.type,n=new(BA.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let r=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(r)?(s,a)=>r[a]||i:({name:s})=>r[s]||i;for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);n.children.push(fc(Object.assign(Object.assign({},l),{type:c})))}}return n}function T0(e,t){return WC(e,t.map(n=>n.data.concat()))}function WC(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((f,h)=>Math.max(f,h.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=GC(n,s,u,t,i),s>0&&(r[o++]=At({type:new ge(n),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(f=>new Oe(e,f))]}function GC(e,t,n,r,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=r.length;++a<c;){let l=n[a],u=l?.length;if(u>=t)u===t?n[a]=l:(n[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,r[a].unshift(l.slice(t,u-t))));else{let f=e[a];e[a]=f.clone({nullable:!0}),n[a]=(o=l?._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:At({type:f.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return n}var LA,ur=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new ie([]),this._offsets=[0],this;let i,o;t[0]instanceof ie&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof Oe)return[c];if(c instanceof e)return c.batches;if(c instanceof Jt){if(c.type instanceof ge)return[new Oe(new ie(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(d=>new qt([c[d]])),f=i??new ie(l.map((d,p)=>new $t(String(d),u[p].type,u[p].nullable))),[,h]=T0(f,u);return h.length===0?[new Oe(c)]:h}}}return[]},a=t.flatMap(c=>s(c));if(i=(r=i??((n=a[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new ie([]),!(i instanceof ie))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof Oe))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!mc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??Qy(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Ky(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(rc(t,this.numRows))}set(t,n){}indexOf(t,n){return-1}[Symbol.iterator](){return this.batches.length>0?Vl.visit(new qt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
8
|
-
${this.toArray().join(`,
|
|
9
|
-
`)}
|
|
10
|
-
]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new e(n,r.map(i=>new Oe(n,i)))}slice(t,n){let r=this.schema;[t,n]=Eh({length:this.numRows},t,n);let i=Jy(this.data,this._offsets,t,n);return new e(r,i.map(o=>new Oe(r,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let n=this.data.map(r=>r.children[t]);if(n.length===0){let{type:r}=this.schema.fields[t],i=At({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new qt(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){n||(n=new qt([At({type:new Ln,length:this.numRows})]));let o=r.fields.slice(),s=o[t].clone({type:n.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,n],[r,i]=T0(r,a)}return new e(r,i)}select(t){let n=this.schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((a,c,l)=>{let[u,f]=a,h=n.findIndex(d=>d.name===c.name);return~h?f[h]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...n.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...r.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...T0(o,s))}};LA=Symbol.toStringTag;ur[LA]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=ql(Nh),e.get=ql(Ve.getVisitFn(L.Struct)),e.set=t0(wn.getVisitFn(L.Struct)),e.indexOf=e0(ac.getVisitFn(L.Struct)),"Table"))(ur.prototype);var CA,Oe=class e{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof ie))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=At({nullCount:0,type:new ge(this.schema.fields),children:this.schema.fields.map(n=>At({type:n.type,nullCount:0}))})]=t,!(this.data instanceof Jt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=FA(this.schema,this.data.children);break}case 1:{let[n]=t,{fields:r,children:i,length:o}=Object.keys(n).reduce((c,l,u)=>(c.children[u]=n[l],c.length=Math.max(c.length,n[l].length),c.fields[u]=$t.new({name:l,type:n[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ie(r),a=At({type:new ge(r),length:o,children:i,nullCount:0});[this.schema,this.data]=FA(s,a.children,o);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=RA(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Ve.visit(this.data,t)}at(t){return this.get(rc(t,this.numRows))}set(t,n){return wn.visit(this.data,t,n)}indexOf(t,n){return ac.visit(this.data,t,n)}[Symbol.iterator](){return Vl.visit(new qt([this.data]))}toArray(){return[...this]}concat(...t){return new ur(this.schema,[this,...t])}slice(t,n){let[r]=new qt([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new qt([this.data.children[t]]):null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&t<this.numCols){n||(n=new qt([At({type:new Ln,length:this.numRows})]));let o=r.fields.slice(),s=i.children.slice(),a=o[t].clone({type:n.type});[o[t],s[t]]=[a,n.data[0]],r=new ie(o,new Map(this.schema.metadata)),i=At({type:new ge(o),children:s})}return new e(r,i)}select(t){let n=this.schema.select(t),r=new ge(n.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(n,At({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(o=>this.data.children[o]).filter(Boolean),i=At({type:new ge(n.fields),length:this.numRows,children:r});return new e(n,i)}};CA=Symbol.toStringTag;Oe[CA]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(Oe.prototype);function FA(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;let i=[...e.fields],o=[...t],s=(n+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==n)&&(i[a]=c.clone({nullable:!0}),o[a]=(r=l?._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:At({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),At({type:new ge(i),length:n,children:o})]}function RA(e,t,n=new Map){var r,i;if(((r=e?.length)!==null&&r!==void 0?r:0)>0&&e?.length===t?.length)for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c?.dictionary)===null||i===void 0?void 0:i.data)||[]])RA(a.children,l?.children,n);if(G.isDictionary(a)){let{id:l}=a;if(!n.has(l))c?.dictionary&&n.set(l,c.dictionary);else if(n.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return n}var yc=class extends Oe{constructor(t){let n=t.fields.map(i=>At({type:i.type})),r=At({type:new ge(t.fields),nullCount:0,children:n});super(t,r)}};var vi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ae.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ut.NONE}header(t){let n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,n){t.addFieldInt16(0,n,ae.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,Ut.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,BigInt("0"))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,o,s){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}};var Y_=class extends dt{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return hh.startNull(n),hh.endNull(n)}visitInt(t,n){return pi.startInt(n),pi.addBitWidth(n,t.bitWidth),pi.addIsSigned(n,t.isSigned),pi.endInt(n)}visitFloat(t,n){return Js.startFloatingPoint(n),Js.addPrecision(n,t.precision),Js.endFloatingPoint(n)}visitBinary(t,n){return ah.startBinary(n),ah.endBinary(n)}visitLargeBinary(t,n){return lh.startLargeBinary(n),lh.endLargeBinary(n)}visitBool(t,n){return ch.startBool(n),ch.endBool(n)}visitUtf8(t,n){return ph.startUtf8(n),ph.endUtf8(n)}visitLargeUtf8(t,n){return uh.startLargeUtf8(n),uh.endLargeUtf8(n)}visitDecimal(t,n){return Vi.startDecimal(n),Vi.addScale(n,t.scale),Vi.addPrecision(n,t.precision),Vi.addBitWidth(n,t.bitWidth),Vi.endDecimal(n)}visitDate(t,n){return Hs.startDate(n),Hs.addUnit(n,t.unit),Hs.endDate(n)}visitTime(t,n){return Yo.startTime(n),Yo.addUnit(n,t.unit),Yo.addBitWidth(n,t.bitWidth),Yo.endTime(n)}visitTimestamp(t,n){let r=t.timezone&&n.createString(t.timezone)||void 0;return Wo.startTimestamp(n),Wo.addUnit(n,t.unit),r!==void 0&&Wo.addTimezone(n,r),Wo.endTimestamp(n)}visitInterval(t,n){return ta.startInterval(n),ta.addUnit(n,t.unit),ta.endInterval(n)}visitDuration(t,n){return Zs.startDuration(n),Zs.addUnit(n,t.unit),Zs.endDuration(n)}visitList(t,n){return fh.startList(n),fh.endList(n)}visitStruct(t,n){return dh.startStruct_(n),dh.endStruct_(n)}visitUnion(t,n){mi.startTypeIdsVector(n,t.typeIds.length);let r=mi.createTypeIdsVector(n,t.typeIds);return mi.startUnion(n),mi.addMode(n,t.mode),mi.addTypeIds(n,r),mi.endUnion(n)}visitDictionary(t,n){let r=this.visit(t.indices,n);return qi.startDictionaryEncoding(n),qi.addId(n,BigInt(t.id)),qi.addIsOrdered(n,t.isOrdered),r!==void 0&&qi.addIndexType(n,r),qi.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return Ks.startFixedSizeBinary(n),Ks.addByteWidth(n,t.byteWidth),Ks.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return Qs.startFixedSizeList(n),Qs.addListSize(n,t.listSize),Qs.endFixedSizeList(n)}visitMap(t,n){return ea.startMap(n),ea.addKeysSorted(n,t.keysSorted),ea.endMap(n)}},E0=new Y_;function PA(e,t=new Map){return new ie(HC(e,t),D0(e.metadata),t)}function W_(e){return new _n(e.count,qA(e.columns),VA(e.columns))}function zA(e){return new hr(W_(e.data),e.id,e.isDelta)}function HC(e,t){return(e.fields||[]).filter(Boolean).map(n=>$t.fromJSON(n,t))}function kA(e,t){return(e.children||[]).filter(Boolean).map(n=>$t.fromJSON(n,t))}function qA(e){return(e||[]).reduce((t,n)=>[...t,new Gr(n.count,ZC(n.VALIDITY)),...qA(n.children)],[])}function VA(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){let i=e[n];i.VALIDITY&&t.push(new fr(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new fr(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new fr(t.length,i.OFFSET.length)),i.DATA&&t.push(new fr(t.length,i.DATA.length)),t=VA(i.children,t)}return t}function ZC(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function jA(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=UA(e,kA(e,t)),i=new $t(e.name,s,e.nullable,D0(e.metadata))):t.has(n=o.id)?(r=(r=o.indexType)?$A(r):new xi,a=new cr(t.get(n),r,n,o.isOrdered),i=new $t(e.name,a,e.nullable,D0(e.metadata))):(r=(r=o.indexType)?$A(r):new xi,t.set(n,s=UA(e,kA(e,t))),a=new cr(s,r,n,o.isOrdered),i=new $t(e.name,a,e.nullable,D0(e.metadata))),i||null}function D0(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function $A(e){return new qe(e.isSigned,e.bitWidth)}function UA(e,t){let n=e.type.name;switch(n){case"NONE":return new Ln;case"null":return new Ln;case"binary":return new ji;case"largebinary":return new Yi;case"utf8":return new Wi;case"largeutf8":return new Gi;case"bool":return new Xi;case"list":return new zr((t||[])[0]);case"struct":return new ge(t||[]);case"struct_":return new ge(t||[])}switch(n){case"int":{let r=e.type;return new qe(r.isSigned,r.bitWidth)}case"floatingpoint":{let r=e.type;return new Sr(he[r.precision])}case"decimal":{let r=e.type;return new Hi(r.scale,r.precision,r.bitWidth)}case"date":{let r=e.type;return new Zi(Re[r.unit])}case"time":{let r=e.type;return new Ki(at[r.unit],r.bitWidth)}case"timestamp":{let r=e.type;return new Qi(at[r.unit],r.timezone)}case"interval":{let r=e.type;return new Ji(on[r.unit])}case"duration":{let r=e.type;return new to(at[r.unit])}case"union":{let r=e.type,[i,...o]=(r.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new qr(ye[s],r.typeIds||[],t||[])}case"fixedsizebinary":{let r=e.type;return new eo(r.byteWidth)}case"fixedsizelist":{let r=e.type;return new Vr(r.listSize,(t||[])[0])}case"map":{let r=e.type;return new jr((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var KC=nc,QC=_r,dr=class e{static fromJSON(t,n){let r=new e(0,ae.V5,n);return r._createHeader=JC(t,n),r}static decode(t){t=new QC(_t(t));let n=vi.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new e(r,i,o);return s._createHeader=tR(n,o),s}static encode(t){let n=new KC,r=-1;return t.isSchema()?r=ie.encode(n,t.header()):t.isRecordBatch()?r=_n.encode(n,t.header()):t.isDictionaryBatch()&&(r=hr.encode(n,t.header())),vi.startMessage(n),vi.addVersion(n,ae.V5),vi.addHeader(n,r),vi.addHeaderType(n,t.headerType),vi.addBodyLength(n,BigInt(t.bodyLength)),vi.finishMessageBuffer(n,vi.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof ie)return new e(0,ae.V5,Ut.Schema,t);if(t instanceof _n)return new e(n,ae.V5,Ut.RecordBatch,t);if(t instanceof hr)return new e(n,ae.V5,Ut.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Ut.Schema}isRecordBatch(){return this.headerType===Ut.RecordBatch}isDictionaryBatch(){return this.headerType===Ut.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Kt(t)}},_n=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=Kt(t)}},hr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=Kt(n)}},fr=class{constructor(t,n){this.offset=Kt(t),this.length=Kt(n)}},Gr=class{constructor(t,n){this.length=Kt(t),this.nullCount=Kt(n)}};function JC(e,t){return()=>{switch(t){case Ut.Schema:return ie.fromJSON(e);case Ut.RecordBatch:return _n.fromJSON(e);case Ut.DictionaryBatch:return hr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ut[t]}, type: ${t} }`)}}function tR(e,t){return()=>{switch(t){case Ut.Schema:return ie.decode(e.header(new ar),new Map,e.version());case Ut.RecordBatch:return _n.decode(e.header(new vr),e.version());case Ut.DictionaryBatch:return hr.decode(e.header(new jo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ut[t]}, type: ${t} }`)}}$t.encode=fR;$t.decode=lR;$t.fromJSON=jA;ie.encode=uR;ie.decode=eR;ie.fromJSON=PA;_n.encode=hR;_n.decode=nR;_n.fromJSON=W_;hr.encode=dR;hr.decode=rR;hr.fromJSON=zA;Gr.encode=pR;Gr.decode=oR;fr.encode=mR;fr.decode=iR;function eR(e,t=new Map,n=ae.V5){let r=cR(e,t);return new ie(r,B0(e),t,n)}function nR(e,t=ae.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new _n(e.length(),sR(e),aR(e,t))}function rR(e,t=ae.V5){return new hr(_n.decode(e.data(),t),e.id(),e.isDelta())}function iR(e){return new fr(e.offset(),e.length())}function oR(e){return new Gr(e.length(),e.nullCount())}function sR(e){let t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=Gr.decode(n));return t}function aR(e,t){let n=[];for(let r,i=-1,o=-1,s=e.buffersLength();++i<s;)(r=e.buffers(i))&&(t<ae.V4&&(r.bb_pos+=8*(i+1)),n[++o]=fr.decode(r));return n}function cR(e,t){let n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=$t.decode(r,t));return n}function YA(e,t){let n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=$t.decode(r,t));return n}function lR(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=GA(e,YA(e,t)),r=new $t(e.name(),i,e.nullable(),B0(e))):t.has(n=Kt(a.id()))?(o=(o=a.indexType())?WA(o):new xi,s=new cr(t.get(n),o,n,a.isOrdered()),r=new $t(e.name(),s,e.nullable(),B0(e))):(o=(o=a.indexType())?WA(o):new xi,t.set(n,i=GA(e,YA(e,t))),s=new cr(i,o,n,a.isOrdered()),r=new $t(e.name(),s,e.nullable(),B0(e))),r||null}function B0(e){let t=new Map;if(e)for(let n,r,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(n=e.customMetadata(i))&&(r=n.key())!=null&&t.set(r,n.value());return t}function WA(e){return new qe(e.isSigned(),e.bitWidth())}function GA(e,t){let n=e.typeType();switch(n){case de.NONE:return new Ln;case de.Null:return new Ln;case de.Binary:return new ji;case de.LargeBinary:return new Yi;case de.Utf8:return new Wi;case de.LargeUtf8:return new Gi;case de.Bool:return new Xi;case de.List:return new zr((t||[])[0]);case de.Struct_:return new ge(t||[])}switch(n){case de.Int:{let r=e.type(new pi);return new qe(r.isSigned(),r.bitWidth())}case de.FloatingPoint:{let r=e.type(new Js);return new Sr(r.precision())}case de.Decimal:{let r=e.type(new Vi);return new Hi(r.scale(),r.precision(),r.bitWidth())}case de.Date:{let r=e.type(new Hs);return new Zi(r.unit())}case de.Time:{let r=e.type(new Yo);return new Ki(r.unit(),r.bitWidth())}case de.Timestamp:{let r=e.type(new Wo);return new Qi(r.unit(),r.timezone())}case de.Interval:{let r=e.type(new ta);return new Ji(r.unit())}case de.Duration:{let r=e.type(new Zs);return new to(r.unit())}case de.Union:{let r=e.type(new mi);return new qr(r.mode(),r.typeIdsArray()||[],t||[])}case de.FixedSizeBinary:{let r=e.type(new Ks);return new eo(r.byteWidth())}case de.FixedSizeList:{let r=e.type(new Qs);return new Vr(r.listSize(),(t||[])[0])}case de.Map:{let r=e.type(new ea);return new jr((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${de[n]}" (${n})`)}function uR(e,t){let n=t.fields.map(o=>$t.encode(e,o));ar.startFieldsVector(e,n.length);let r=ar.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?ar.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return tn.startKeyValue(e),tn.addKey(e,a),tn.addValue(e,c),tn.endKeyValue(e)})):-1;return ar.startSchema(e),ar.addFields(e,r),ar.addEndianness(e,yR?Xs.Little:Xs.Big),i!==-1&&ar.addCustomMetadata(e,i),ar.endSchema(e)}function fR(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;G.isDictionary(o)?(s=o.dictionary.typeId,i=E0.visit(o,e),r=E0.visit(o.dictionary,e)):r=E0.visit(o,e);let a=(o.children||[]).map(u=>$t.encode(e,u)),c=On.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?On.createCustomMetadataVector(e,[...t.metadata].map(([u,f])=>{let h=e.createString(`${u}`),d=e.createString(`${f}`);return tn.startKeyValue(e),tn.addKey(e,h),tn.addValue(e,d),tn.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),On.startField(e),On.addType(e,r),On.addTypeType(e,s),On.addChildren(e,c),On.addNullable(e,!!t.nullable),n!==-1&&On.addName(e,n),i!==-1&&On.addDictionary(e,i),l!==-1&&On.addCustomMetadata(e,l),On.endField(e)}function hR(e,t){let n=t.nodes||[],r=t.buffers||[];vr.startNodesVector(e,n.length);for(let s of n.slice().reverse())Gr.encode(e,s);let i=e.endVector();vr.startBuffersVector(e,r.length);for(let s of r.slice().reverse())fr.encode(e,s);let o=e.endVector();return vr.startRecordBatch(e),vr.addLength(e,BigInt(t.length)),vr.addNodes(e,i),vr.addBuffers(e,o),vr.endRecordBatch(e)}function dR(e,t){let n=_n.encode(e,t.data);return jo.startDictionaryBatch(e),jo.addId(e,BigInt(t.id)),jo.addIsDelta(e,t.isDelta),jo.addData(e,n),jo.endDictionaryBatch(e)}function pR(e,t){return Ll.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function mR(e,t){return Ol.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var yR=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})();var X_=e=>`Expected ${Ut[e]} Message in stream, but was null or length 0.`,H_=e=>`Header pointer of flatbuffer-encoded ${Ut[e]} Message is null or length 0.`,XA=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,HA=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Kl=class{constructor(t){this.source=t instanceof io?t:new io(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?xe:t.value===-1&&(t=this.readMetadataLength()).done?xe:(t=this.readMetadata(t.value)).done?xe:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(X_(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let n=_t(this.source.read(t));if(n.byteLength<t)throw new Error(HA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){let n=Ut.Schema,r=this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(H_(n));return i}readMetadataLength(){let t=this.source.read(N0),n=t&&new _r(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){let n=this.source.read(t);if(!n)return xe;if(n.byteLength<t)throw new Error(XA(t,n.byteLength));return{done:!1,value:dr.decode(n)}}},sd=class{constructor(t,n){this.source=t instanceof Yr?t:wy(t)?new sa(t,n):new Yr(t)}[Symbol.asyncIterator](){return this}next(){return Z(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?xe:t.value===-1&&(t=yield this.readMetadataLength()).done?xe:(t=yield this.readMetadata(t.value)).done?xe:t})}throw(t){return Z(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return Z(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return Z(this,void 0,void 0,function*(){let n;if((n=yield this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(X_(t));return n.value})}readMessageBody(t){return Z(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let n=_t(yield this.source.read(t));if(n.byteLength<t)throw new Error(HA(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()})}readSchema(){return Z(this,arguments,void 0,function*(t=!1){let n=Ut.Schema,r=yield this.readMessage(n),i=r?.header();if(t&&!i)throw new Error(H_(n));return i})}readMetadataLength(){return Z(this,void 0,void 0,function*(){let t=yield this.source.read(N0),n=t&&new _r(t),r=n?.readInt32(0)||0;return{done:r===0,value:r}})}readMetadata(t){return Z(this,void 0,void 0,function*(){let n=yield this.source.read(t);if(!n)return xe;if(n.byteLength<t)throw new Error(XA(t,n.byteLength));return{done:!1,value:dr.decode(n)}})}},ad=class extends Kl{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Oh?t:new Oh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:dr.fromJSON(t.schema,Ut.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let n=t.dictionaries[this._dictionaryIndex++];return this._body=n.data.columns,{done:!1,value:dr.fromJSON(n,Ut.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let n=t.batches[this._batchIndex++];return this._body=n.columns,{done:!1,value:dr.fromJSON(n,Ut.RecordBatch)}}return this._body=[],xe}readMessageBody(t){return n(this._body);function n(r){return(r||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...n(o.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(X_(t));return n.value}readSchema(){let t=Ut.Schema,n=this.readMessage(t),r=n?.header();if(!n||!r)throw new Error(H_(t));return r}},N0=4,G_="ARROW1",Ql=new Uint8Array(G_.length);for(let e=0;e<G_.length;e+=1)Ql[e]=G_.codePointAt(e);function O0(e,t=0){for(let n=-1,r=Ql.length;++n<r;)if(Ql[n]!==e[t+n])return!1;return!0}var Jl=Ql.length,Z_=Jl+N0,ZA=Jl*2+N0;var Ar=class e extends lc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let n=this._impl.open(t);return xr(n)?n.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return xn.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return xn.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:by(t)?bR(t):wy(t)?_R(t):xr(t)?Z(this,void 0,void 0,function*(){return yield e.from(yield t)}):_y(t)||eh(t)||Sy(t)||Ur(t)?wR(new Yr(t)):xR(new io(t))}static readAll(t){return t instanceof e?t.isSync()?KA(t):QA(t):by(t)||ArrayBuffer.isView(t)||fi(t)||xy(t)?KA(t):QA(t)}},rs=class extends Ar{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return br(this,arguments,function*(){yield Ft(yield*Bl(ui(this[Symbol.iterator]())))})}},gc=class extends Ar{constructor(t){super(t),this._impl=t}readAll(){return Z(this,void 0,void 0,function*(){var t,n,r,i;let o=new Array;try{for(var s=!0,a=ui(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){n={error:l}}finally{try{!s&&!t&&(r=a.return)&&(yield r.call(a))}finally{if(n)throw n.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},bc=class extends rs{constructor(t){super(t),this._impl=t}},L0=class extends gc{constructor(t){super(t),this._impl=t}},F0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){let r=this._loadVectors(t,n,this.schema.fields),i=At({type:new ge(this.schema.fields),length:t.length,children:r});return new Oe(this.schema,i)}_loadDictionaryBatch(t,n){let{id:r,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(r);if(i||!a){let c=s.dictionaries.get(r),l=this._loadVectors(t.data,n,[c]);return(a&&i?a.concat(new qt(l)):new qt(l)).memoize()}return a.memoize()}_loadVectors(t,n,r){return new Rh(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}},tu=class extends F0{constructor(t,n){super(n),this._reader=by(t)?new ad(this._handle=t):new Kl(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=JA(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):xe}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):xe}next(){if(this.closed)return xe;let t,{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new yc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},eu=class extends F0{constructor(t,n){super(n),this._reader=new sd(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Z(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Z(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=JA(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Z(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):xe})}return(t){return Z(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):xe})}next(){return Z(this,void 0,void 0,function*(){if(this.closed)return xe;let t,{_reader:n}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let r=t.header(),i=yield n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new yc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Z(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},C0=class extends tu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,n){super(t instanceof Lh?t:new Lh(t),n)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var n;if(this.closed)return null;this._footer||this.open();let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ut.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null}_readDictionaryBatch(t){var n;let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){let i=this._reader.readMessage(Ut.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,n=t.size-Z_,r=t.readInt32(n),i=t.readAt(n-r,r);return Ho.decode(i)}_readNextMessageAndValidate(t){var n;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}},K_=class extends eu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...n){let r=typeof n[0]!="number"?n.shift():void 0,i=n[0]instanceof Map?n.shift():void 0;super(t instanceof sa?t:new sa(t,r),i)}isFile(){return!0}isAsync(){return!0}open(t){let n=Object.create(null,{open:{get:()=>super.open}});return Z(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)})}readRecordBatch(t){return Z(this,void 0,void 0,function*(){var n;if(this.closed)return null;this._footer||(yield this.open());let r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ut.RecordBatch);if(i?.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s)}}return null})}_readDictionaryBatch(t){return Z(this,void 0,void 0,function*(){var n;let r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){let i=yield this._reader.readMessage(Ut.DictionaryBatch);if(i?.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return Z(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let n=t.size-Z_,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return Ho.decode(i)})}_readNextMessageAndValidate(t){return Z(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=this._footer.getRecordBatch(this._recordBatchIndex);if(n&&(yield this._handle.seek(n.offset)))return yield this._reader.readMessage(t)}return null})}},Q_=class extends tu{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new o0(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}};function JA(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*KA(e){let t=Ar.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function QA(e){return br(this,arguments,function*(){let n=yield Ft(Ar.from(e));try{if(!(yield Ft(n.open({autoDestroy:!1}))).closed)do yield yield Ft(n);while(!(yield Ft(n.reset().open())).closed)}finally{yield Ft(n.cancel())}})}function bR(e){return new rs(new Q_(e))}function xR(e){let t=e.peek(Jl+7&-8);return t&&t.byteLength>=4?O0(t)?new bc(new C0(e.read())):new rs(new tu(e)):new rs(new tu(function*(){}()))}function wR(e){return Z(this,void 0,void 0,function*(){let t=yield e.peek(Jl+7&-8);return t&&t.byteLength>=4?O0(t)?new bc(new C0(yield e.read())):new gc(new eu(e)):new gc(new eu(function(){return br(this,arguments,function*(){})}()))})}function _R(e){return Z(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new sa(e,t);return t>=ZA&&O0(yield n.readAt(0,Jl+7&-8))?new L0(new K_(n)):new gc(new eu(n))})}var Ie=class e extends dt{static assemble(...t){let n=i=>i.flatMap(o=>Array.isArray(o)?n(o):o instanceof Oe?o.data.children:o.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof qt)return this.visitMany(t.data),this;let{type:n}=t;if(!G.isDictionary(n)){let{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(G.isUnion(n))this.nodes.push(new Gr(r,0));else{let{nullCount:i}=t;G.isNull(n)||Si.call(this,i<=0?new Uint8Array(0):oc(t.offset,r,t.nullBitmap)),this.nodes.push(new Gr(r,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Si(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new fr(this._byteLength,t)),this._byteLength+=t,this}function vR(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:o}=e;if(Si.call(this,i),n.mode===ye.Sparse)return J_.call(this,e);if(n.mode===ye.Dense){if(e.offset<=0)return Si.call(this,o),J_.call(this,e);{let s=new Int32Array(r),a=Object.create(null),c=Object.create(null);for(let l,u,f=-1;++f<r;)(l=i[f])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[f]),s[f]=o[f]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);Si.call(this,s),this.visitMany(e.children.map((l,u)=>{let f=n.typeIds[u],h=a[f],d=c[f];return l.slice(h,Math.min(r,d))}))}}return this}function SR(e){let t;return e.nullCount>=e.length?Si.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Si.call(this,oc(e.offset,e.length,t)):Si.call(this,sc(e.values))}function is(e){return Si.call(this,e.values.subarray(0,e.length*e.stride))}function R0(e){let{length:t,values:n,valueOffsets:r}=e,i=Kt(r[0]),o=Kt(r[t]),s=Math.min(o-i,n.byteLength-i);return Si.call(this,My(-i,t+1,r)),Si.call(this,n.subarray(i,i+s)),this}function tv(e){let{length:t,valueOffsets:n}=e;if(n){let{[0]:r,[t]:i}=n;return Si.call(this,My(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function J_(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Ie.prototype.visitBool=SR;Ie.prototype.visitInt=is;Ie.prototype.visitFloat=is;Ie.prototype.visitUtf8=R0;Ie.prototype.visitLargeUtf8=R0;Ie.prototype.visitBinary=R0;Ie.prototype.visitLargeBinary=R0;Ie.prototype.visitFixedSizeBinary=is;Ie.prototype.visitDate=is;Ie.prototype.visitTimestamp=is;Ie.prototype.visitTime=is;Ie.prototype.visitDecimal=is;Ie.prototype.visitList=tv;Ie.prototype.visitStruct=J_;Ie.prototype.visitUnion=vR;Ie.prototype.visitInterval=is;Ie.prototype.visitDuration=is;Ie.prototype.visitFixedSizeList=tv;Ie.prototype.visitMap=tv;var xc=class extends lc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ro,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,jn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return xr(t)?t.then(n=>this.writeAll(n)):Ur(t)?nv(this,t):ev(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof ro?this._sink=t:(this._sink=new ro,t&&m6(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&y6(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!mc(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof ur&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof Oe&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!mc(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof Oe?t instanceof yc||this._writeRecordBatch(t):t instanceof ur?this.writeAll(t.batches):fi(t)&&this.writeAll(t)}_writeMessage(t,n=8){let r=n-1,i=dr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===Ut.RecordBatch?this._recordBatchBlocks.push(new Zo(a,t.bodyLength,this._position)):t.headerType===Ut.DictionaryBatch&&this._dictionaryBlocks.push(new Zo(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let n=_t(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(dr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Ql)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=Ie.assemble(t),s=new _n(t.numRows,r,i),a=dr.from(s,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));let{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=Ie.assemble(new qt([t])),c=new _n(t.length,o,s),l=new hr(c,n,r),u=dr.from(l,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let o=-1,s=t.length;++o<s;)(n=t[o])&&(r=n.byteLength)>0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r?.slice(i)).length>0)for(let o of r.data)this._writeDictionaryBatch(o,n,i>0),i+=o.length}return this}},cd=class e extends xc{static writeAll(t,n){let r=new e(n);return xr(t)?t.then(i=>r.writeAll(i)):Ur(t)?nv(r,t):ev(r,t)}},ld=class e extends xc{static writeAll(t){let n=new e;return xr(t)?t.then(r=>n.writeAll(r)):Ur(t)?nv(n,t):ev(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let n=Ho.encode(new Ho(t,ae.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}};function ev(e,t){let n=t;t instanceof ur&&(n=t.batches,e.reset(void 0,t.schema));for(let r of n)e.write(r);return e.finish()}function nv(e,t){return Z(this,void 0,void 0,function*(){var n,r,i,o,s,a,c;try{for(n=!0,r=ui(t);i=yield r.next(),o=i.done,!o;n=!0){c=i.value,n=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!n&&!o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s.error}}return e.finish()})}function t4(e,t){if(Ur(e))return MR(e,t);if(fi(e))return IR(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function IR(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,n||(n=e[Symbol.iterator]()))},pull(s){n?o(s,n):s.close()},cancel(){(n?.return&&n.return()||!0)&&(n=null)}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=_t(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function MR(e,t){let n=null,r=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return Z(this,void 0,void 0,function*(){yield o(s,n||(n=e[Symbol.asyncIterator]()))})},pull(s){return Z(this,void 0,void 0,function*(){n?yield o(s,n):s.close()})},cancel(){return Z(this,void 0,void 0,function*(){(n?.return&&(yield n.return())||!0)&&(n=null)})}}),Object.assign({highWaterMark:r?i:void 0},t));function o(s,a){return Z(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(r?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=_t(l.value))&&(u!=null&&r&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}function r4(e){return new rv(e)}var rv=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count"}=t,o=d6(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=fc(o),this._getSize=i!=="bytes"?e4:n4;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?e4:n4}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let n=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-n}_maybeFlush(t,n){n!=null&&(this._bufferedSize>=n.desiredSize&&++this._numChunks&&this._enqueue(n,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(n,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(n,null)))}_enqueue(t,n){this._bufferedSize=0,this._controller=null,n==null?t.close():t.enqueue(n)}},e4=e=>{var t;return(t=e?.length)!==null&&t!==void 0?t:0},n4=e=>{var t;return(t=e?.byteLength)!==null&&t!==void 0?t:0};function k0(e,t){let n=new ro,r=null,i=new ReadableStream({cancel(){return Z(this,void 0,void 0,function*(){yield n.close()})},start(a){return Z(this,void 0,void 0,function*(){yield s(a,r||(r=yield o()))})},pull(a){return Z(this,void 0,void 0,function*(){r?yield s(a,r):a.close()})}});return{writable:new WritableStream(n,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return Z(this,void 0,void 0,function*(){return yield(yield Ar.from(n)).open(t)})}function s(a,c){return Z(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}function $0(e,t){let n=new this(e),r=new Yr(n),i=new ReadableStream({cancel(){return Z(this,void 0,void 0,function*(){yield r.cancel()})},pull(s){return Z(this,void 0,void 0,function*(){yield o(s)})},start(s){return Z(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(n,e),readable:i};function o(s){return Z(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield r.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}function ud(e){let t=Ar.from(e);return xr(t)?t.then(n=>ud(n)):t.isAsync()?t.readAll().then(n=>new ur(n)):new ur(t.readAll())}var YR=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},m_),P_),N_),y_),c_),B_),f_),{compareSchemas:mc,compareFields:NA,compareTypes:OA});xn.toDOMStream=t4;we.throughDOM=r4;Ar.throughDOM=k0;bc.throughDOM=k0;rs.throughDOM=k0;xc.throughDOM=$0;ld.throughDOM=$0;cd.throughDOM=$0;function iv(e="ws://localhost:3000/"){let t=[],n=!1,r=null,i,o={open(){n=!0,c()},close(){for(n=!1,r=null,i=null;t.length;)t.shift().reject("Socket closed")},error(l){if(r){let{reject:u}=r;r=null,c(),u(l)}else console.error("WebSocket error: ",l)},message({data:l}){if(r){let{query:u,resolve:f,reject:h}=r;if(r=null,c(),typeof l=="string"){let d=JSON.parse(l);d.error?h(d.error):f(d)}else if(u.type==="exec")f();else if(u.type==="arrow")f(ud(l.arrayBuffer()));else throw new Error(`Unexpected socket data: ${l}`)}else console.log("WebSocket message: ",l)}};function s(){i=new WebSocket(e);for(let l in o)i.addEventListener(l,o[l])}function a(l,u,f){i==null&&s(),t.push({query:l,resolve:u,reject:f}),n&&!r&&c()}function c(){t.length&&(r=t.shift(),i.send(JSON.stringify(r.query)))}return{get connected(){return n},query(l){return new Promise((u,f)=>a(l,u,f))}}}var pr=class{constructor(t,n){t&&(this.table=String(t)),n&&(this.column=n)}get columns(){return this.column?[this.column]:[]}toString(){let{table:t,column:n}=this;if(n){let r=n.startsWith("*")?n:`"${n}"`;return`${t?`${i4(t)}.`:""}${r}`}else return t?i4(t):"NULL"}};function i4(e){return e.split(".").map(n=>`"${n}"`).join(".")}function o4(e,t){return e instanceof pr&&e.column===t}function Vt(e){return typeof e=="string"?U0(e):e}function wc(e){return typeof e=="string"?s4(e):e}function s4(e){return new pr(e)}function U0(e,t=null){return arguments.length===1&&(t=e,e=null),new pr(e,t)}function os(e){switch(typeof e){case"boolean":return e?"TRUE":"FALSE";case"string":return`'${e.replace("'","''")}'`;case"number":return Number.isFinite(e)?String(e):"NULL";default:if(e==null)return"NULL";if(e instanceof Date){let t=+e;if(Number.isNaN(t))return"NULL";let n=e.getUTCFullYear(),r=e.getUTCMonth(),i=e.getUTCDate();return t===Date.UTC(n,r,i)?`MAKE_DATE(${n}, ${r+1}, ${i})`:`EPOCH_MS(${t})`}else return e instanceof RegExp?`'${e.source}'`:String(e)}}var ss=e=>typeof e?.addEventListener=="function";function P0(e){return e instanceof as}var as=class{constructor(t,n,r){this._expr=Array.isArray(t)?t:[t],this._deps=n||[],this.annotate(r);let i=this._expr.filter(o=>ss(o));i.length>0?(this._params=Array.from(new Set(i)),this._params.forEach(o=>{o.addEventListener("value",()=>WR(this,this.map?.get("value")))})):this.addEventListener=void 0}get value(){return this}get columns(){let{_params:t,_deps:n}=this;if(t){let r=new Set(t.flatMap(i=>{let o=i.value?.columns;return Array.isArray(o)?o:[]}));if(r.size){let i=new Set(n);return r.forEach(o=>i.add(o)),Array.from(i)}}return n}get column(){return this._deps.length?this._deps[0]:this.columns[0]}annotate(...t){return Object.assign(this,...t)}toString(){return this._expr.map(t=>ss(t)&&!P0(t)?os(t.value):t).join("")}addEventListener(t,n){let r=this.map||(this.map=new Map);(r.get(t)||(r.set(t,new Set),r.get(t))).add(n)}};function WR(e,t){if(t?.size)return Promise.allSettled(Array.from(t,n=>n(e)))}function ov(e,t){let n=[e[0]],r=new Set,i=t.length;for(let o=0,s=0;o<i;){let a=t[o];ss(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(l=>r.add(l)),n[s]+=typeof a=="string"?a:os(a));let c=e[++o];ss(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function q(e,...t){let{spans:n,cols:r}=ov(e,t);return new as(n,r)}var sv=e=>({value:e,toString:()=>os(e)});function fd(e){e(this.op,this),this.children?.forEach(t=>t.visit(e))}function a4(e,t){let n=t.filter(i=>i!=null).map(Vt),r=n.map((i,o)=>o?` ${e} `:"");return n.length===1?r.push(""):n.length>1&&(r[0]="(",r.push(")")),q(r,...n).annotate({op:e,children:n,visit:fd})}var Xr=(...e)=>a4("AND",e.flat()),hd=(...e)=>a4("OR",e.flat()),GR=e=>t=>q`(${e} ${Vt(t)})`.annotate({op:e,a:t,visit:fd}),XR=GR("NOT"),c4=e=>t=>q`(${Vt(t)} ${e})`.annotate({op:e,a:t,visit:fd}),dd=c4("IS NULL"),_c=c4("IS NOT NULL"),aa=e=>(t,n)=>q`(${Vt(t)} ${e} ${Vt(n)})`.annotate({op:e,a:t,b:n,visit:fd}),HR=aa("="),pd=aa("<>"),vc=aa("<"),av=aa(">"),Sc=aa("<="),ZR=aa(">="),KR=aa("IS DISTINCT FROM"),cv=aa("IS NOT DISTINCT FROM");function QR(e,t,n,r){t=Vt(t);let i=e.startsWith("NOT ")?"NOT ":"";return(n?r?q`${i}(${n[0]} <= ${t} AND ${t} < ${n[1]})`:q`(${t} ${e} ${n[0]} AND ${n[1]})`:q``).annotate({op:e,visit:fd,field:t,range:n})}var sn=(e,t,n)=>QR("BETWEEN",e,t,n);function Ic(e,t){return Array.from({length:e},()=>t)}function vn(e,t){return(...n)=>{let r=n.map(Vt),i=t?`::${t}`:"";return(r.length?q([`${e}(`,...Ic(r.length-1,", "),`)${i}`],...r):q`${e}()${i}`).annotate({func:e,args:r})}}var l4=vn("REGEXP_MATCHES"),u4=vn("CONTAINS"),f4=vn("PREFIX"),h4=vn("SUFFIX"),JR=vn("LOWER"),tk=vn("UPPER"),ek=vn("LENGTH"),nk=vn("ISNAN"),rk=vn("ISFINITE"),ik=vn("ISINF");var md=class e extends as{constructor(t,n,r,i,o="",s="",a=""){let c;if(i&&!(o||s||a))c=i?q`${n} OVER "${i}"`:q`${n} OVER ()`;else{let h=o&&s?" ":"",d=(o||s)&&a?" ":"";c=q`${n} OVER (${i?`"${i}" `:""}${o}${h}${s}${d}${a})`}r&&(c=q`(${c})::${r}`);let{_expr:u,_deps:f}=c;super(u,f),this.window=t,this.func=n,this.type=r,this.name=i,this.group=o,this.order=s,this.frame=a}get basis(){return this.column}get label(){let{func:t}=this;return t.label??t.toString()}over(t){let{window:n,func:r,type:i,group:o,order:s,frame:a}=this;return new e(n,r,i,t,o,s,a)}partitionby(...t){let n=t.flat().filter(u=>u).map(Vt),r=q(["PARTITION BY ",Ic(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,order:c,frame:l}=this;return new e(i,o,s,a,r,c,l)}orderby(...t){let n=t.flat().filter(u=>u).map(Vt),r=q(["ORDER BY ",Ic(n.length-1,", "),""],...n),{window:i,func:o,type:s,name:a,group:c,frame:l}=this;return new e(i,o,s,a,c,r,l)}rows(t){let n=d4("ROWS",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}range(t){let n=d4("RANGE",t),{window:r,func:i,type:o,name:s,group:a,order:c}=this;return new e(r,i,o,s,a,c,n)}};function d4(e,t){if(ss(t)){let n=q`${t}`;return n.toString=()=>`${e} ${p4(t.value)}`,n}return`${e} ${p4(t)}`}function p4(e){let[t,n]=e,r=t===0?"CURRENT ROW":Number.isFinite(t)?`${Math.abs(t)} PRECEDING`:"UNBOUNDED PRECEDING",i=n===0?"CURRENT ROW":Number.isFinite(n)?`${Math.abs(n)} FOLLOWING`:"UNBOUNDED FOLLOWING";return`BETWEEN ${r} AND ${i}`}function Ii(e,t){return(...n)=>{let r=vn(e)(...n);return new md(e,r,t)}}var ok=Ii("ROW_NUMBER","INTEGER"),sk=Ii("RANK","INTEGER"),ak=Ii("DENSE_RANK","INTEGER"),ck=Ii("PERCENT_RANK"),lk=Ii("CUME_DIST"),uk=Ii("NTILE"),fk=Ii("LAG"),hk=Ii("LEAD"),dk=Ii("FIRST_VALUE"),pk=Ii("LAST_VALUE"),mk=Ii("NTH_VALUE");function jt(e,...t){return q(e,...t).annotate({aggregate:!0})}var lv=class e extends as{constructor(t,n,r,i,o){n=(n||[]).map(Vt);let{strings:s,exprs:a}=yk(t,n,r,i,o),{spans:c,cols:l}=ov(s,a);super(c,l),this.aggregate=t,this.args=n,this.type=r,this.isDistinct=i,this.filter=o}get basis(){return this.column}get label(){let{aggregate:t,args:n,isDistinct:r}=this,i=r?"DISTINCT"+(n.length?" ":""):"",o=n.length?`(${i}${n.map(gk).join(", ")})`:"";return`${t.toLowerCase()}${o}`}distinct(){let{aggregate:t,args:n,type:r,filter:i}=this;return new e(t,n,r,!0,i)}where(t){let{aggregate:n,args:r,type:i,isDistinct:o}=this;return new e(n,r,i,o,t)}window(){let{aggregate:t,args:n,type:r,isDistinct:i}=this,o=new e(t,n,null,i);return new md(t,o,r)}partitionby(...t){return this.window().partitionby(...t)}orderby(...t){return this.window().orderby(...t)}rows(t){return this.window().rows(t)}range(t){return this.window().range(t)}};function yk(e,t,n,r,i){let o=`)${n?`::${n}`:""}`,s=[`${e}(${r?"DISTINCT ":""}`],a=[];return t.length?(s=s.concat([...Ic(t.length-1,", "),`${o}${i?" FILTER (WHERE ":""}`,...i?[")"]:[]]),a=[...t,...i?[i]:[]]):s[0]+="*"+o,{exprs:a,strings:s}}function gk(e){let t=os(e);return t&&t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Gt(e,t){return(...n)=>new lv(e,n,t)}var Tr=Gt("COUNT","INTEGER"),uv=Gt("AVG"),bk=Gt("AVG"),xk=Gt("MAD"),ca=Gt("MAX"),la=Gt("MIN"),Mi=Gt("SUM","DOUBLE"),wk=Gt("PRODUCT"),_k=Gt("MEDIAN"),vk=Gt("QUANTILE"),Sk=Gt("MODE"),Ik=Gt("VARIANCE"),fv=Gt("STDDEV"),Mk=Gt("SKEWNESS"),Ak=Gt("KURTOSIS"),Tk=Gt("ENTROPY"),Ek=Gt("VAR_POP"),Dk=Gt("STDDEV_POP"),Bk=Gt("CORR"),Nk=Gt("COVAR_SAMP"),Ok=Gt("COVAR_POP"),hv=Gt("REGR_INTERCEPT"),dv=Gt("REGR_SLOPE"),pv=Gt("REGR_COUNT"),Lk=Gt("REGR_R2"),mv=Gt("REGR_SYY"),yv=Gt("REGR_SXX"),Fk=Gt("REGR_SXY"),gv=Gt("REGR_AVGX"),Ck=Gt("REGR_AVGY"),Rk=Gt("FIRST"),kk=Gt("LAST"),z0=Gt("ARG_MIN"),q0=Gt("ARG_MAX"),$k=Gt("STRING_AGG"),Uk=Gt("ARRAY_AGG");function m4(e,t){let n=Vt(e),r=q`CAST(${n} AS ${t})`;return Object.defineProperty(r,"label",{enumerable:!0,get(){return e.label}}),Object.defineProperty(r,"aggregate",{enumerable:!0,get(){return e.aggregate||!1}}),r}var V0=e=>m4(e,"DOUBLE");var bv=e=>q`epoch_ms(${Vt(e)})`;function xv(e,t,n=1){let r=`INTERVAL ${n} ${t}`,i=Vt(e);return q`TIME_BUCKET(${r}, ${i})`.annotate({label:t})}var wv=vn("ST_AsGeoJSON"),Pk=vn("ST_X"),zk=vn("ST_Y"),qk=vn("ST_CENTROID");var Ct=class e{static select(...t){return new e().select(...t)}static from(...t){return new e().from(...t)}static with(...t){return new e().with(...t)}static union(...t){return new Mc("UNION",t.flat())}static unionAll(...t){return new Mc("UNION ALL",t.flat())}static intersect(...t){return new Mc("INTERSECT",t.flat())}static except(...t){return new Mc("EXCEPT",t.flat())}static describe(t){let n=t.clone(),{clone:r,toString:i}=n;return Object.assign(n,{describe:!0,clone:()=>e.describe(r.call(n)),toString:()=>`DESCRIBE ${i.call(n)}`})}constructor(){this.query={with:[],select:[],from:[],where:[],groupby:[],having:[],window:[],qualify:[],orderby:[]},this.cteFor=null}clone(){let t=new e;return t.query={...this.query},t}with(...t){let{query:n}=this;if(t.length===0)return n.with;{let r=[],i=(o,s)=>{let a=s.clone();a.cteFor=this,r.push({as:o,query:a})};return t.flat().forEach(o=>{if(o!=null)if(o.as&&o.query)i(o.as,o.query);else for(let s in o)i(s,o[s])}),n.with=n.with.concat(r),this}}select(...t){let{query:n}=this;if(t.length===0)return n.select;{let r=[];for(let o of t.flat())if(o!=null)if(typeof o=="string")r.push({as:o,expr:Vt(o)});else if(o instanceof pr)r.push({as:o.column,expr:o});else if(Array.isArray(o))r.push({as:o[0],expr:o[1]});else for(let s in o)r.push({as:j0(s),expr:Vt(o[s])});let i=new Set(r.map(o=>o.as));return n.select=n.select.filter(o=>!i.has(o.as)).concat(r.filter(o=>o.expr)),this}}$select(...t){return this.query.select=[],this.select(...t)}distinct(t=!0){return this.query.distinct=!!t,this}from(...t){let{query:n}=this;if(t.length===0)return n.from;{let r=[];return t.flat().forEach(i=>{if(i!=null)if(typeof i=="string")r.push({as:i,from:wc(i)});else if(i instanceof pr)r.push({as:i.table,from:i});else if(yd(i)||P0(i))r.push({from:i});else if(Array.isArray(i))r.push({as:j0(i[0]),from:wc(i[1])});else for(let o in i)r.push({as:j0(o),from:wc(i[o])})}),n.from=n.from.concat(r),this}}$from(...t){return this.query.from=[],this.from(...t)}sample(t,n){let{query:r}=this;if(arguments.length===0)return r.sample;{let i=t;return typeof t=="number"&&(i=t>0&&t<1?{perc:100*t,method:n}:{rows:Math.round(t),method:n}),r.sample=i,this}}where(...t){let{query:n}=this;return t.length===0?n.where:(n.where=n.where.concat(t.flat().filter(r=>r)),this)}$where(...t){return this.query.where=[],this.where(...t)}groupby(...t){let{query:n}=this;return t.length===0?n.groupby:(n.groupby=n.groupby.concat(t.flat().filter(r=>r).map(Vt)),this)}$groupby(...t){return this.query.groupby=[],this.groupby(...t)}having(...t){let{query:n}=this;return t.length===0?n.having:(n.having=n.having.concat(t.flat().filter(r=>r)),this)}window(...t){let{query:n}=this;if(t.length===0)return n.window;{let r=[];return t.flat().forEach(i=>{if(i!=null)for(let o in i)r.push({as:j0(o),expr:i[o]})}),n.window=n.window.concat(r),this}}qualify(...t){let{query:n}=this;return t.length===0?n.qualify:(n.qualify=n.qualify.concat(t.flat().filter(r=>r)),this)}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Vt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{query:t,cteFor:n}=this,i=(n?.query||t).with?.reduce((s,{as:a,query:c})=>(s[a]=c,s),{}),o=[];return t.from.forEach(({from:s})=>{if(yd(s))o.push(s);else if(i[s.table]){let a=i[s.table];o.push(a)}}),o}toString(){let{with:t,select:n,distinct:r,from:i,sample:o,where:s,groupby:a,having:c,window:l,qualify:u,orderby:f,limit:h,offset:d}=this.query,p=[];if(t.length){let y=t.map(({as:g,query:b})=>`"${g}" AS (${b})`);p.push(`WITH ${y.join(", ")}`)}let m=n.map(({as:y,expr:g})=>o4(g,y)&&!g.table?`${g}`:`${g} AS "${y}"`);if(p.push(`SELECT${r?" DISTINCT":""} ${m.join(", ")}`),i.length){let y=i.map(({as:g,from:b})=>{let w=yd(b)?`(${b})`:`${b}`;return!g||g===b.table?w:`${w} AS "${g}"`});p.push(`FROM ${y.join(", ")}`)}if(s.length){let y=s.map(String).filter(g=>g).join(" AND ");y&&p.push(`WHERE ${y}`)}if(o){let{rows:y,perc:g,method:b,seed:w}=o,x=y?`${y} ROWS`:`${g} PERCENT`,v=b?` (${b}${w!=null?`, ${w}`:""})`:"";p.push(`USING SAMPLE ${x}${v}`)}if(a.length&&p.push(`GROUP BY ${a.join(", ")}`),c.length){let y=c.map(String).filter(g=>g).join(" AND ");y&&p.push(`HAVING ${y}`)}if(l.length){let y=l.map(({as:g,expr:b})=>`"${g}" AS (${b})`);p.push(`WINDOW ${y.join(", ")}`)}if(u.length){let y=u.map(String).filter(g=>g).join(" AND ");y&&p.push(`QUALIFY ${y}`)}return f.length&&p.push(`ORDER BY ${f.join(", ")}`),Number.isFinite(h)&&p.push(`LIMIT ${h}`),Number.isFinite(d)&&p.push(`OFFSET ${d}`),p.join(" ")}},Mc=class e{constructor(t,n){this.op=t,this.queries=n.map(r=>r.clone()),this.query={orderby:[]},this.cteFor=null}clone(){let t=new e(this.op,this.queries);return t.query={...this.query},t}orderby(...t){let{query:n}=this;return t.length===0?n.orderby:(n.orderby=n.orderby.concat(t.flat().filter(r=>r).map(Vt)),this)}limit(t){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(t)?t:void 0,this)}offset(t){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(t)?t:void 0,this)}get subqueries(){let{queries:t,cteFor:n}=this;return n&&t.forEach(r=>r.cteFor=n),t}toString(){let{op:t,queries:n,query:{orderby:r,limit:i,offset:o}}=this,s=[n.join(` ${t} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(i)&&s.push(`LIMIT ${i}`),Number.isFinite(o)&&s.push(`OFFSET ${o}`),s.join(" ")}};function yd(e){return e instanceof Ct||e instanceof Mc}function _v(e){return yd(e)&&e.describe}function j0(e){return Vk(e)?e.slice(1,-1):e}function Vk(e){return e[0]==='"'&&e[e.length-1]==='"'}var Y0=e=>e;function y4(){return{apply:Y0,invert:Y0,sqlApply:Vt,sqlInvert:Y0}}function jk({base:e=null}={}){if(e==null||e===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:t=>q`LN(${Vt(t)})`,sqlInvert:t=>q`EXP(${t})`};if(e===10)return{apply:Math.log10,invert:t=>Math.pow(10,t),sqlApply:t=>q`LOG(${Vt(t)})`,sqlInvert:t=>q`POW(10, ${t})`};{let t=+e;return{apply:n=>Math.log(n)/Math.log(t),invert:n=>Math.pow(t,n),sqlApply:n=>q`LN(${Vt(n)}) / LN(${t})`,sqlInvert:n=>q`POW(${t}, ${n})`}}}function Yk({constant:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-t),sqlApply:n=>(n=Vt(n),q`SIGN(${n}) * LN(${t} + ABS(${n}))`),sqlInvert:n=>q`SIGN(${n}) * (EXP(ABS(${n})) - ${t})`}}function Wk(){return{apply:e=>Math.sign(e)*Math.sqrt(Math.abs(e)),invert:e=>Math.sign(e)*e*e,sqlApply:e=>(e=Vt(e),q`SIGN(${e}) * SQRT(ABS(${e}))`),sqlInvert:e=>q`SIGN(${e}) * (${e}) ** 2`}}function Gk({exponent:e=1}={}){let t=+e;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),t),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/t),sqlApply:n=>(n=Vt(n),q`SIGN(${n}) * POW(ABS(${n}), ${t})`),sqlInvert:n=>q`SIGN(${n}) * POW(ABS(${n}), 1/${t})`}}function g4(){return{apply:e=>+e,invert:e=>new Date(e),sqlApply:e=>e instanceof Date?+e:bv(Vt(e)),sqlInvert:Y0}}var Xk={identity:y4,linear:y4,log:jk,symlog:Yk,sqrt:Wk,pow:Gk,time:g4,utc:g4};function gd(e){let t=Xk[e.type];return t?{...e,...t(e)}:null}function W0(e,t,{replace:n=!1,temp:r=!0,view:i=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(i?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+e+" AS "+t}function x4(e){if(!e.filterIndexable)return null;let t=e.query(),n=vv(t);if(typeof n!="string"||!t.select)return null;let r=[],i=[],o={};for(let s of t.select()){let{as:a,expr:{aggregate:c,args:l}}=s,u=c?.toUpperCase?.();switch(u){case"COUNT":case"SUM":r.push({[a]:jt`SUM("${a}")::DOUBLE`});break;case"AVG":r.push({[a]:Zk(o,a,l[0])});break;case"ARG_MAX":r.push({[a]:Kk(o,a,l)});break;case"ARG_MIN":r.push({[a]:Qk(o,a,l)});break;case"VARIANCE":case"VAR_SAMP":o[a]=null,r.push({[a]:G0(o,l[0],n)});break;case"VAR_POP":o[a]=null,r.push({[a]:G0(o,l[0],n,!1)});break;case"STDDEV":case"STDDEV_SAMP":o[a]=null,r.push({[a]:jt`SQRT(${G0(o,l[0],n)})`});break;case"STDDEV_POP":o[a]=null,r.push({[a]:jt`SQRT(${G0(o,l[0],n,!1)})`});break;case"COVAR_SAMP":o[a]=null,r.push({[a]:X0(o,l,n)});break;case"COVAR_POP":o[a]=null,r.push({[a]:X0(o,l,n,!1)});break;case"CORR":o[a]=null,r.push({[a]:b4(o,l,n)});break;case"REGR_COUNT":o[a]=null,r.push({[a]:jt`${nu(o,l)}::DOUBLE`});break;case"REGR_AVGX":o[a]=null,r.push({[a]:v4(o,l)});break;case"REGR_AVGY":o[a]=null,r.push({[a]:S4(o,l)});break;case"REGR_SYY":o[a]=null,r.push({[a]:Iv(o,0,l,n)});break;case"REGR_SXX":o[a]=null,r.push({[a]:Iv(o,1,l,n)});break;case"REGR_SXY":o[a]=null,r.push({[a]:X0(o,l,n,null)});break;case"REGR_SLOPE":o[a]=null,r.push({[a]:I4(o,l,n)});break;case"REGR_INTERCEPT":o[a]=null,r.push({[a]:Jk(o,l,n)});break;case"REGR_R2":o[a]=null,r.push({[a]:jt`(${b4(o,l,n)}) ** 2`});break;case"MAX":case"MIN":case"BIT_AND":case"BIT_OR":case"BIT_XOR":case"BOOL_AND":case"BOOL_OR":case"PRODUCT":r.push({[a]:jt`${u}("${a}")`});break;default:if(!c)i.push(a);else return null}}return r.length?{from:n,dims:i,aggr:r,aux:o}:null}function Ai(e,...t){let n=t.length?"_"+t.map(Hk).join("_"):"";return`__${e}${n}__`}function Hk(e){return`${e}`.replaceAll('"',"").replaceAll(" ","_")}function vv(e){let t=e.subqueries;if(e.select){let r=e.from();if(!r.length)return;if(t.length===0)return r[0].from.table}let n=vv(t[0]);for(let r=1;r<t.length;++r){let i=vv(t[r]);if(i!==void 0&&i!==n)return NaN}return n}function w4(e,t){let n=Ai("count",t);return e[n]=jt`COUNT(${t})`,jt`SUM(${n})`.annotate({name:n})}function Zk(e,t,n){let r=w4(e,n);return jt`(SUM("${t}" * ${r.name}) / ${r})`}function bd(e,t){return q`(SELECT AVG(${e}) FROM "${t}")`}function Kk(e,t,[,n]){let r=Ai("max",n);return e[r]=jt`MAX(${n})`,jt`ARG_MAX("${t}", ${r})`}function Qk(e,t,[,n]){let r=Ai("min",n);return e[r]=jt`MIN(${n})`,jt`ARG_MIN("${t}", ${r})`}function G0(e,t,n,r=!0){let i=w4(e,t),o=Ai("rssq",t),s=Ai("rsum",t),a=q`${t} - ${bd(t,n)}`;return e[o]=jt`SUM((${a}) ** 2)`,e[s]=jt`SUM(${a})`,jt`(SUM(${o}) - (SUM(${s}) ** 2 / ${i})) / (${i}${r?" - 1":""})`}function X0(e,t,n,r=!0){let i=nu(e,t),o=_4(e,t,n),s=xd(e,1,t,n),a=xd(e,0,t,n),c=r===null?"":r?` / (${i} - 1)`:` / ${i}`;return jt`(${o} - ${s} * ${a} / ${i})${c}`}function b4(e,t,n){let r=nu(e,t),i=_4(e,t,n),o=Sv(e,1,t,n),s=Sv(e,0,t,n),a=xd(e,1,t,n),c=xd(e,0,t,n),l=jt`(${o} - (${a} ** 2) / ${r})`,u=jt`(${s} - (${c} ** 2) / ${r})`;return jt`(${i} - ${a} * ${c} / ${r}) / SQRT(${l} * ${u})`}function nu(e,[t,n]){let r=Ai("count",t,n);return e[r]=jt`REGR_COUNT(${t}, ${n})`,jt`SUM(${r})`.annotate({name:r})}function xd(e,t,n,r){let i=n[t],o=n[1-t],s=Ai("rs",i);return e[s]=jt`SUM(${i} - ${bd(i,r)}) FILTER (${o} IS NOT NULL)`,jt`SUM(${s})`}function Sv(e,t,n,r){let i=n[t],o=n[1-t],s=Ai("rss",i);return e[s]=jt`SUM((${i} - ${bd(i,r)}) ** 2) FILTER (${o} IS NOT NULL)`,jt`SUM(${s})`}function _4(e,t,n){let[r,i]=t,o=Ai("sxy",r,i);return e[o]=jt`SUM((${i} - ${bd(i,n)}) * (${r} - ${bd(r,n)}))`,jt`SUM(${o})`}function v4(e,t){let[n,r]=t,i=nu(e,t),o=Ai("avg",r,n);return e[o]=jt`REGR_AVGX(${n}, ${r})`,jt`(SUM(${o} * ${i.name}) / ${i})`}function S4(e,t){let[n,r]=t,i=nu(e,t),o=Ai("avg",n,r);return e[o]=jt`REGR_AVGY(${n}, ${r})`,jt`(SUM(${o} * ${i.name}) / ${i})`}function Iv(e,t,n,r){let i=nu(e,n),o=xd(e,t,n,r),s=Sv(e,t,n,r);return jt`(${s} - (${o} ** 2 / ${i}))`}function I4(e,t,n){let r=X0(e,t,n,null),i=Iv(e,1,t,n);return jt`(${r}) / ${i}`}function Jk(e,t,n){let r=v4(e,t),i=S4(e,t),o=I4(e,t,n);return jt`${i} - (${o}) * ${r}`}function A4(e){let t=2166136261;for(let n=0,r=e.length;n<r;++n){let i=e.charCodeAt(n),o=i&65280;o&&(t=M4(t^o>>8)),t=M4(t^i&255)}return t9(t)}function M4(e){return e+(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}function t9(e){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,e+=e<<5,e&4294967295}var e9={skip:!0,result:null},H0=class{constructor(t,{enabled:n=!0,temp:r=!0}={}){this.indexes=new Map,this.active=null,this.temp=r,this.mc=t,this._enabled=n}enabled(t){if(t===void 0)return this._enabled;this._enabled!==t&&(t||this.clear(),this._enabled=t)}clear(){this.mc.cancel(Array.from(this.indexes.values(),t=>t?.result)),this.indexes.clear(),this.active=null}index(t,n,r){if(!this._enabled)return null;let{indexes:i,mc:o,temp:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=n9(r),c.source===null))return null;if(i.has(t))return i.get(t);let l=x4(t),u;if(!l)u=null;else if(n.skip(t,r))u=e9;else{let f=n.remove(a).predicate(t);u=o9(t.query(f),c,l),u.result=o.exec(W0(u.table,u.create,{temp:s})),u.result.catch(h=>o.logger().error(h))}return i.set(t,u),u}};function n9(e){let{source:t,meta:n}=e,r=e.predicate,i=r?.columns,o,s;if(!n||!i)return{source:null,columns:s,predicate:o};let{type:a,scales:c,bin:l,pixelSize:u=1}=n;if(a==="point")o=f=>f,s=Object.fromEntries(i.map(f=>[`${f}`,Vt(f)]));else if(a==="interval"&&c){let f=c.map(h=>i9(h,u,l));f.some(h=>!h)||(f.length===1?(o=h=>h?sn("active0",h.range.map(f[0])):[],s={active0:f[0](r.field)}):(o=h=>h?Xr(h.children.map(({range:d},p)=>sn(`active${p}`,d.map(f[p])))):[],s=Object.fromEntries(r.children.map((h,d)=>[`active${d}`,f[d](h.field)]))))}return{source:s?t:null,columns:s,predicate:o}}var r9={ceil:"CEIL",round:"ROUND"};function i9(e,t,n){let{type:r,domain:i,range:o,apply:s,sqlApply:a}=gd(e);if(!s)return;let c=r9[`${n}`.toLowerCase()]||"FLOOR",l=s(Math.min(...i)),u=s(Math.max(...i)),f=r==="identity"?1:Math.abs(o[1]-o[0])/(u-l),h=f/t===1?"":`${f/t}::DOUBLE * `,d=l===0?"":` - ${l}::DOUBLE`;return p=>q`${c}(${h}(${a(p)}${d}))::INTEGER`}function o9(e,t,n){let{dims:r,aggr:i,aux:o}=n,{columns:s}=t,a=e.select({...s,...o}).groupby(Object.keys(s)),[c]=a.subqueries;if(c){let p=Object.values(s).flatMap(m=>m.columns);s9(c,p)}let l=a.orderby();a.query.orderby=[];let u=a.toString(),h=`cube_index_${(A4(u)>>>0).toString(16)}`,d=Ct.select(r,i).from(h).groupby(r).orderby(l);return new Mv({table:h,create:u,active:t,select:d})}function s9(e,t){let n=new Set,r=i=>{n.has(i)||(n.add(i),i.select&&i.from().length&&i.select(t),i.subqueries.forEach(r))};r(e)}var Mv=class{constructor({table:t,create:n,active:r,select:i}={}){this.table=t,this.create=n,this.result=null,this.active=r,this.select=i,this.skip=!1}query(t){return this.select.clone().where(this.active.predicate(t))}};var Ac=class extends Promise{constructor(){let t,n;super((r,i)=>{t=r,n=i}),this._resolve=t,this._reject=n}fulfill(t){return this._resolve(t),this}reject(t){return this._reject(t),this}};Ac.prototype.constructor=Promise;function a9(e){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(e)}function T4(e,t,n){let r=[],i=0;function o(){let s=c9(r,t);r=[],i=0;for(let a of s)u9(a,e,n),d9(a,t)}return{add(s,a){s.request.type==="arrow"?(i=i||a9(()=>o()),r.push({entry:s,priority:a,index:r.length})):e(s,a)}}}function c9(e,t){let n=[],r=new Map;for(let i of e){let{entry:{request:o}}=i,s=l9(o.query,t);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(i)}return n}function l9(e,t){let n=`${e}`;if(e instanceof Ct&&!t.get(n)){if(e.orderby().length||e.where().length||e.qualify().length||e.having().length)return n;let r=e.clone().$select("*"),i=e.groupby();if(i.length){let o={};e.select().forEach(({as:s,expr:a})=>o[s]=a),r.$groupby(i.map(s=>s instanceof pr&&o[s.column]||s))}return`${r}`}else return n}function u9(e,t,n){if(f9(e))t({request:{type:"arrow",cache:!1,record:!1,query:e.query=h9(e,n)},result:e.result=new Ac});else for(let{entry:r,priority:i}of e)t(r,i)}function f9(e){if(e.length>1){let t=`${e[0].entry.request.query}`;for(let n=1;n<e.length;++n)if(t!==`${e[n].entry.request.query}`)return!0}return!1}function h9(e,t){let n=e.maps=[],r=new Map;for(let s of e){let{query:a}=s.entry.request,c=[];n.push(c);for(let{as:l,expr:u}of a.select()){let f=`${u}`;r.has(f)||r.set(f,[`col${r.size}`,u]);let[h]=r.get(f);c.push([h,l])}t(`${a}`)}let i=e[0].entry.request.query.clone(),o=i.groupby();if(o.length){let s={};e.maps[0].forEach(([a,c])=>s[c]=a),i.$groupby(o.map(a=>a instanceof pr&&s[a.column]||a))}return i.$select(Array.from(r.values()))}async function d9(e,t){let{maps:n,query:r,result:i}=e;if(!n)return;let o;try{o=await i}catch(a){for(let{entry:c}of e)c.result.reject(a);return}let s=_v(r);e.forEach(({entry:a},c)=>{let{request:l,result:u}=a,f=n[c],h=s&&f?m9(o,f):f?p9(o,f):o;l.cache&&t.set(String(l.query),h),u.fulfill(h)})}function p9(e,t){let n={};for(let[r,i]of t)n[i]=e.getChild(r);return new e.constructor(n)}function m9(e,t){let n=new Map(t),r=[];for(let i of e)n.has(i.column_name)&&r.push({...i,column_name:n.get(i.column_name)});return r}var y9=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,E4=()=>({get:()=>{},set:(e,t)=>t,clear:()=>{}});function D4({max:e=1e3,ttl:t=3*60*60*1e3}={}){let n=new Map;function r(){let i=performance.now()-t,o=null,s=1/0;for(let[a,c]of n){let{last:l}=c;l<s&&(o=a,s=l),i>l&&n.delete(a)}o&&n.delete(o)}return{get(i){let o=n.get(i);if(o)return o.last=performance.now(),o.value},set(i,o){return n.set(i,{last:performance.now(),value:o}),n.size>e&&y9(r),o},clear(){n=new Map}}}function B4(e){let t=Array.from({length:e},()=>({head:null,tail:null}));return{isEmpty(){return t.every(n=>!n.head)},insert(n,r){let i=t[r];if(!i)throw new Error(`Invalid queue priority rank: ${r}`);let o={item:n,next:null};i.head===null?i.head=i.tail=o:i.tail=i.tail.next=o},remove(n){for(let r of t){let{head:i,tail:o}=r;for(let s=null,a=i;a;s=a,a=a.next)n(a.item)&&(a===i?i=a.next:s.next=a.next,a===o&&(o=s||i));r.head=i,r.tail=o}},next(){for(let n of t){let{head:r}=n;if(r!==null)return n.head=r.next,n.tail===r&&(n.tail=null),r.item}}}}var so={High:0,Normal:1,Low:2},Z0=class{constructor(){this.queue=B4(3),this.db=null,this.clientCache=null,this._logger=null,this._logQueries=!1,this.recorders=[],this.pending=null,this._consolidate=null}next(){if(this.pending||this.queue.isEmpty())return;let{request:t,result:n}=this.queue.next();this.pending=this.submit(t,n),this.pending.finally(()=>{this.pending=null,this.next()})}enqueue(t,n=so.Normal){this.queue.insert(t,n),this.next()}recordQuery(t){this.recorders.length&&t&&this.recorders.forEach(n=>n.add(t))}async submit(t,n){try{let{query:r,type:i,cache:o=!1,record:s=!0,options:a}=t,c=r?`${r}`:null;if(s&&this.recordQuery(c),o){let f=this.clientCache.get(c);if(f){this._logger.debug("Cache"),n.fulfill(f);return}}let l=performance.now();this._logQueries&&this._logger.debug("Query",{type:i,sql:c,...a});let u=await this.db.query({type:i,sql:c,...a});o&&this.clientCache.set(c,u),this._logger.debug(`Request: ${(performance.now()-l).toFixed(1)}`),n.fulfill(u)}catch(r){n.reject(r)}}cache(t){return t!==void 0?this.clientCache=t===!0?D4():t||E4():this.clientCache}logger(t){return t?this._logger=t:this._logger}logQueries(t){return t!==void 0?this._logQueries=!!t:this._logQueries}connector(t){return t?this.db=t:this.db}consolidate(t){t&&!this._consolidate?this._consolidate=T4(this.enqueue.bind(this),this.clientCache,this.recordQuery.bind(this)):!t&&this._consolidate&&(this._consolidate=null)}request(t,n=so.Normal){let r=new Ac,i={request:t,result:r};return this._consolidate?this._consolidate.add(i,n):this.enqueue(i,n),r}cancel(t){let n=new Set(t);n.size&&this.queue.remove(({result:r})=>n.has(r))}clear(){this.queue.remove(({result:t})=>(t.reject("Cleared"),!0))}record(){let t=[],n={add(r){t.push(r)},reset(){t=[]},snapshot(){return t.slice()},stop(){return this.recorders=this.recorders.filter(r=>r!==n),t}};return this.recorders.push(n),n}};function Av(e){switch(e){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(e.startsWith("DECIMAL"))return"number";if(e.startsWith("STRUCT")||e.startsWith("MAP"))return"object";if(e.endsWith("]"))return"array";throw new Error(`Unsupported type: ${e}`)}}function Tv(e){return typeof e?.getChild=="function"}function Ev(e){if(G.isTimestamp(e))return t=>t==null?t:new Date(t);if(G.isInt(e)&&e.bitWidth>=64)return t=>t==null?t:Number(t);if(G.isDecimal(e)){let t=1/Math.pow(10,e.scale);return n=>n==null?n:O4(n,t)}return t=>t}function Dv(e){let{type:t}=e;if(G.isTimestamp(t)){let n=e.length,r=new Array(n);for(let i=0;i<n;++i){let o=e.get(i);r[i]=o==null?null:new Date(o)}return r}if(G.isInt(t)&&t.bitWidth>=64){let n=e.length,r=e.nullCount?new Array(n):new Float64Array(n);for(let i=0;i<n;++i){let o=e.get(i);r[i]=o==null?null:Number(o)}return r}if(G.isDecimal(t)){let n=1/Math.pow(10,t.scale),r=e.length,i=e.nullCount?new Array(r):new Float64Array(r);for(let o=0;o<r;++o){let s=e.get(o);i[o]=s==null?null:O4(s,n)}return i}return e.nullCount?Array.from(e):e.toArray()}var N4=Array.from({length:8},(e,t)=>Math.pow(2,t*32));function O4(e,t){let n=e.length,r=0;if(e.signed&&(e[n-1]|0)<0){for(let i=0;i<n;++i)r+=~e[i]*N4[i];r=-(r+1)}else for(let i=0;i<n;++i)r+=e[i]*N4[i];return r*t}var g9="count",b9="nulls",x9="max",w9="min",_9="distinct";var v9={[g9]:Tr,[_9]:e=>Tr(e).distinct(),[x9]:ca,[w9]:la,[b9]:e=>Tr().where(dd(e))};function S9(e,t,n){return Ct.from(e).select(Array.from(n,r=>[r,v9[r](t)]))}async function L4(e,t){return t.length===1&&`${t[0].column}`=="*"?M9(e,t[0].table):(await Promise.all(t.map(n=>I9(e,n)))).filter(n=>n)}async function I9(e,{table:t,column:n,stats:r}){let i=Ct.from({source:t}).select({column:n}).groupby(n.aggregate?q`ALL`:[]),[o]=Array.from(await e.query(Ct.describe(i))),s={table:t,column:`${n}`,sqlType:o.column_type,type:Av(o.column_type),nullable:o.null==="YES"};if(!(r?.length||r?.size))return s;let a=await e.query(S9(t,n,r),{persist:!0});for(let c=0;c<a.numCols;++c){let{name:l}=a.schema.fields[c],u=a.getChildAt(c),f=Ev(u.type);s[l]=f(u.get(0))}return s}async function M9(e,t){let n=await e.query(`DESCRIBE ${wc(t)}`);return Array.from(n).map(r=>({table:t,column:r.column_name,sqlType:r.column_type,type:Av(r.column_type),nullable:r.null==="YES"}))}function F4(){return{debug(){},info(){},log(){},warn(){},error(){}}}var K0;function Bv(e){return e?K0=e:K0==null&&(K0=new Q0),K0}var Q0=class{constructor(t=iv(),{logger:n=console,manager:r=new Z0,cache:i=!0,consolidate:o=!0,indexes:s={}}={}){this.manager=r,this.manager.cache(i),this.manager.consolidate(o),this.dataCubeIndexer=new H0(this,s),this.logger(n),this.databaseConnector(t),this.clear()}clear({clients:t=!0,cache:n=!0}={}){this.manager.clear(),t&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(t){return this.manager.connector(t)}logger(t){return arguments.length&&(this._logger=t||F4(),this.manager.logger(this._logger)),this._logger}cancel(t){this.manager.cancel(t)}exec(t,{priority:n=so.Normal}={}){return t=Array.isArray(t)?t.join(`;
|
|
11
|
-
`):t,this.manager.request({type:"exec",query:t},n)}query(t,{type:n="arrow",cache:r=!0,priority:i=so.Normal,...o}={}){return this.manager.request({type:n,query:t,cache:r,options:o},i)}prefetch(t,n={}){return this.query(t,{...n,cache:!0,priority:so.Low})}createBundle(t,n,r=so.Low){let i={name:t,queries:n};return this.manager.request({type:"create-bundle",options:i},r)}loadBundle(t,n=so.High){let r={name:t};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(t,n,r=so.Normal){return t.queryPending(),this.query(n,{priority:r}).then(i=>t.queryResult(i).update(),i=>{this._logger.error(i),t.queryError(i)}).catch(i=>this._logger.error(i))}requestQuery(t,n){return this.dataCubeIndexer.clear(),n?this.updateClient(t,n):t.update()}async connect(t){let{clients:n}=this;if(n.has(t))throw new Error("Client already connected.");n.add(t),t.coordinator=this;let r=t.fields();r?.length&&t.fieldInfo(await L4(this,r)),A9(this,t.filterBy,t),t.requestQuery()}disconnect(t){let{clients:n,filterGroups:r}=this;if(!n.has(t))return;n.delete(t),t.coordinator=null;let i=r.get(t.filterBy);i&&i.clients.delete(t)}};function A9(e,t,n){if(!t)return;let r=e.filterGroups.get(t);if(!r){let i=s=>T9(e,t,s),o=()=>E9(e,t);t.addEventListener("activate",i),t.addEventListener("value",o),r={selection:t,clients:new Set,disconnect(){t.removeEventListener("activate",i),t.removeEventListener("value",o)}},e.filterGroups.set(t,r)}r.clients.add(n)}function T9(e,t,n){let{dataCubeIndexer:r,filterGroups:i}=e,{clients:o}=i.get(t);for(let s of o)r.index(s,t,n)}function E9(e,t){let{dataCubeIndexer:n,filterGroups:r}=e,{clients:i}=r.get(t),{active:o}=t;return Promise.allSettled(Array.from(i,s=>{let a=n.index(s,t,o),c=a?null:t.predicate(s);if(a?.skip||!a&&!c)return;let l=a?.query(o.predicate)??s.query(c);return e.updateClient(s,l)}))}var J0=class{constructor(){this._callbacks=new Map}addEventListener(t,n){this._callbacks.has(t)||this._callbacks.set(t,{callbacks:new Set,pending:null,queue:new Nv}),this._callbacks.get(t).callbacks.add(n)}removeEventListener(t,n){let r=this._callbacks.get(t);r&&r.callbacks.delete(n)}willEmit(t,n){return n}emitQueueFilter(t,n){return null}cancel(t){this._callbacks.get(t)?.queue.clear()}async pending(t){await this._callbacks.get(t)?.pending}emit(t,n){let r=this._callbacks.get(t)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(t,n));else{let i=this.willEmit(t,n),{callbacks:o,queue:s}=r;if(o?.size){let a=Array.from(o,c=>c(i));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(t,s.dequeue())})}}}},Nv=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(t,n){let r={value:t};if(n&&this.next){let i=this;for(;i.next;)n(i.next.value)?i=i.next:i.next=i.next.next;i.next=r}else this.next=r}dequeue(){let{next:t}=this;return this.next=t?.next,t?.value}};function wd(e,t){return e===t?!1:e instanceof Date&&t instanceof Date?+e!=+t:Array.isArray(e)&&Array.isArray(t)?D9(e,t):!0}function D9(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!0;return!1}function ru(e){return e instanceof iu}var iu=class e extends J0{constructor(t){super(),this._value=t}static value(t){return new e(t)}static array(t){if(t.some(n=>ru(n))){let n=new e,r=()=>{n.update(t.map(i=>ru(i)?i.value:i))};return r(),t.forEach(i=>ru(i)?i.addEventListener("value",r):0),n}return new e(t)}get value(){return this._value}update(t,{force:n}={}){return wd(this._value,t)||n?this.emit("value",t):this.cancel("value"),this}willEmit(t,n){return t==="value"&&(this._value=n),n}};function Ov(e){return e instanceof Ec}var Ec=class e extends iu{static intersect({cross:t=!1,empty:n=!1}={}){return new e(new Tc({cross:t,empty:n}))}static union({cross:t=!1,empty:n=!1}={}){return new e(new Tc({cross:t,empty:n,union:!0}))}static single({cross:t=!1,empty:n=!1}={}){return new e(new Tc({cross:t,empty:n,single:!0}))}static crossfilter({empty:t=!1}={}){return new e(new Tc({cross:!0,empty:t}))}constructor(t=new Tc){super([]),this._resolved=this._value,this._resolver=t}clone(){let t=new e(this._resolver);return t._value=t._resolved=this._value,t}remove(t){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:t}),n._value.active={source:t},n}get resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(t){return this.clauses.find(n=>n.source===t)?.value}activate(t){this.emit("activate",t)}update(t){return this._resolved=this._resolver.resolve(this._resolved,t,!0),this._resolved.active=t,super.update(this._resolved)}willEmit(t,n){return t==="value"?(this._value=n,this.value):n}emitQueueFilter(t,n){return t==="value"?this._resolver.queueFilter(n):null}skip(t,n){return this._resolver.skip(t,n)}predicate(t,n=!1){let{clauses:r}=this,i=n?null:r.active;return this._resolver.predicate(r,i,t)}},Tc=class{constructor({union:t,cross:n,single:r,empty:i}={}){this.union=!!t,this.cross=!!n,this.single=!!r,this.empty=!!i}resolve(t,n,r=!1){let{source:i,predicate:o}=n,s=t.filter(c=>i!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),o&&a.push(n),a}skip(t,n){return this.cross&&n?.clients?.has(t)}predicate(t,n,r){let{empty:i,union:o}=this;if(i&&!t.length)return["FALSE"];if(this.skip(r,n))return;let s=t.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return o&&s.length>1?hd(s):s}queueFilter(t){if(this.cross){let n=t.active?.source;return r=>r.active?.source!==n}return null}};function _d(e,t,{source:n,clients:r=n?new Set([n]):void 0}){let i=null;if(t){let o=t.map(s=>{let a=s.map((c,l)=>cv(e[l],sv(c)));return a.length>1?Xr(a):a[0]});i=o.length>1?hd(o):o[0]}return{meta:{type:"point"},source:n,clients:r,value:t,predicate:i}}function vd(e,t,{source:n,clients:r=n?new Set([n]):void 0,bin:i,scale:o,pixelSize:s=1}){let a=t!=null?sn(e,t):null;return{meta:{type:"interval",scales:o&&[o],bin:i,pixelSize:s},source:n,clients:r,value:t,predicate:a}}function Lv(e,t,{source:n,clients:r=n?new Set([n]):void 0,bin:i,scales:o=[],pixelSize:s=1}){let a=t!=null?Xr(e.map((l,u)=>sn(l,t[u]))):null;return{meta:{type:"interval",scales:o,bin:i,pixelSize:s},source:n,clients:r,value:t,predicate:a}}function Fv(){let e=new Set,t,n=new Promise(r=>t=r);return{pending(r){e.add(r)},ready(r){return e.delete(r),e.size===0},resolve(){n=new Promise(r=>{t(),t=r})},get promise(){return n}}}function Hr(e){return Tv(e)?B9(e):N9(e)}function B9(e){let{numRows:t,numCols:n,schema:{fields:r}}=e,i={};for(let o=0;o<n;++o){let s=r[o].name;i[s]?console.warn(`Redundant column name "${s}". Skipping...`):i[s]=Dv(e.getChildAt(o))}return{numRows:t,columns:i}}function N9(e){let t=e.length;if(typeof e[0]=="object"){let n=t?Object.keys(e[0]):[],r={};return n.length>0&&n.forEach(i=>{r[i]=e.map(o=>o[i])}),{numRows:t,columns:r}}else return{numRows:t,values:e}}var NM={};Ws(NM,{Area:()=>wl,Arrow:()=>Lm,BarX:()=>Fm,BarY:()=>Cm,Cell:()=>_l,Contour:()=>Gm,Density:()=>Zm,Dot:()=>vl,Frame:()=>Am,Geo:()=>Km,Hexgrid:()=>Qm,Image:()=>Jm,Line:()=>Sl,Link:()=>Nm,Mark:()=>wt,Raster:()=>Vm,Rect:()=>Ml,RuleX:()=>_m,RuleY:()=>vm,Text:()=>gl,TickX:()=>Um,TickY:()=>Pm,Tip:()=>Tm,Vector:()=>xl,area:()=>Bm,areaX:()=>Ga,areaY:()=>Vs,arrow:()=>BO,auto:()=>zO,autoSpec:()=>rM,axisFx:()=>rw,axisFy:()=>nw,axisX:()=>Im,axisY:()=>Sm,barX:()=>$o,barY:()=>Uo,bin:()=>qs,binX:()=>Ro,binY:()=>ko,bollinger:()=>Ka,bollingerX:()=>GO,bollingerY:()=>XO,boxX:()=>HO,boxY:()=>ZO,cell:()=>Xa,cellX:()=>OO,cellY:()=>LO,centroid:()=>W7,circle:()=>RO,cluster:()=>Y7,column:()=>pn,contour:()=>o7,crosshair:()=>c7,crosshairX:()=>l7,crosshairY:()=>u7,delaunayLink:()=>d7,delaunayMesh:()=>p7,density:()=>x7,differenceY:()=>v7,dodgeX:()=>sL,dodgeY:()=>aL,dot:()=>li,dotX:()=>FO,dotY:()=>CO,filter:()=>qD,find:()=>KD,formatIsoDate:()=>BI,formatMonth:()=>iN,formatNumber:()=>DI,formatWeekday:()=>oN,frame:()=>Sf,geo:()=>Tw,geoCentroid:()=>G7,graticule:()=>I7,gridFx:()=>aw,gridFy:()=>ow,gridX:()=>sw,gridY:()=>iw,group:()=>dm,groupX:()=>Ra,groupY:()=>ka,groupZ:()=>hm,hexagon:()=>kO,hexbin:()=>M7,hexgrid:()=>A7,hull:()=>m7,identity:()=>X,image:()=>E7,indexOf:()=>Ae,initializer:()=>Se,interpolateNearest:()=>Ym,interpolateNone:()=>Aw,interpolatorBarycentric:()=>jm,interpolatorRandomWalk:()=>Wm,legend:()=>KN,line:()=>Il,lineX:()=>Ha,lineY:()=>Za,linearRegressionX:()=>N7,linearRegressionY:()=>O7,link:()=>gw,map:()=>yr,mapX:()=>kf,mapY:()=>$f,marks:()=>Qe,normalize:()=>Rw,normalizeX:()=>fL,normalizeY:()=>hL,numberInterval:()=>H3,plot:()=>If,pointer:()=>qa,pointerX:()=>Va,pointerY:()=>Ps,raster:()=>e7,rect:()=>km,rectX:()=>Ff,rectY:()=>Cf,reverse:()=>VD,ruleX:()=>Rr,ruleY:()=>kr,scale:()=>$a,select:()=>pL,selectFirst:()=>ry,selectLast:()=>iy,selectMaxX:()=>Pw,selectMaxY:()=>zw,selectMinX:()=>$w,selectMinY:()=>Uw,shiftX:()=>dL,shuffle:()=>jD,sort:()=>_1,sphere:()=>S7,spike:()=>NN,stackX:()=>tM,stackX1:()=>_O,stackX2:()=>vO,stackY:()=>eM,stackY1:()=>SO,stackY2:()=>IO,text:()=>Co,textX:()=>H1,textY:()=>Z1,tickX:()=>Sw,tickY:()=>Iw,timeInterval:()=>am,tip:()=>uw,transform:()=>mn,tree:()=>SM,treeLink:()=>Ow,treeNode:()=>ty,utcInterval:()=>sl,valueof:()=>bt,vector:()=>VI,vectorX:()=>J1,vectorY:()=>tw,voronoi:()=>y7,voronoiMesh:()=>g7,window:()=>Uf,windowX:()=>qO,windowY:()=>VO});function Et(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ti(e){let t,n,r;e.length!==2?(t=Et,n=(a,c)=>Et(e(a),c),r=(a,c)=>e(a)-c):(t=e===Et||e===Wn?e:O9,n=e,r=e);function i(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(t(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&r(a[f-1],c)>-r(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function O9(){return 0}function Sd(e){return e===null?NaN:+e}function*C4(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var R4=Ti(Et),k4=R4.right,L9=R4.left,F9=Ti(Sd).center,cs=k4;var Id=$4(U4),Cv=$4(C9);function $4(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:s}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!s||!n&&!r)return t;let a=n&&e(n),c=r&&e(r),l=i.slice();return a&&c?(ou(a,l,i,o,s),ou(a,i,l,o,s),ou(a,l,i,o,s),su(c,i,l,o,s),su(c,l,i,o,s),su(c,i,l,o,s)):a?(ou(a,i,l,o,s),ou(a,l,i,o,s),ou(a,i,l,o,s)):c&&(su(c,i,l,o,s),su(c,l,i,o,s),su(c,i,l,o,s)),t}}function ou(e,t,n,r,i){for(let o=0,s=r*i;o<s;)e(t,n,o,o+=r,1)}function su(e,t,n,r,i){for(let o=0,s=r*i;o<r;++o)e(t,n,o,o+s,r)}function C9(e){let t=U4(e);return(n,r,i,o,s)=>{i<<=2,o<<=2,s<<=2,t(n,r,i+0,o+0,s),t(n,r,i+1,o+1,s),t(n,r,i+2,o+2,s),t(n,r,i+3,o+3,s)}}function U4(e){let t=Math.floor(e);if(t===e)return R9(e);let n=e-t,r=2*e+1;return(i,o,s,a,c)=>{if(!((a-=c)>=s))return;let l=t*o[s],u=c*t,f=u+c;for(let h=s,d=s+u;h<d;h+=c)l+=o[Math.min(a,h)];for(let h=s,d=a;h<=d;h+=c)l+=o[Math.min(a,h+u)],i[h]=(l+n*(o[Math.max(s,h-f)]+o[Math.min(a,h+f)]))/r,l-=o[Math.max(s,h-u)]}}function R9(e){let t=2*e+1;return(n,r,i,o,s)=>{if(!((o-=s)>=i))return;let a=e*r[i],c=s*e;for(let l=i,u=i+c;l<u;l+=s)a+=r[Math.min(o,l)];for(let l=i,u=o;l<=u;l+=s)a+=r[Math.min(o,l+c)],n[l]=a/t,a-=r[Math.max(i,l-c)]}}function ao(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function k9(e){return e.length|0}function $9(e){return!(e>0)}function U9(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function P9(e){return t=>e(...t)}function tg(...e){let t=typeof e[e.length-1]=="function"&&P9(e.pop());e=e.map(U9);let n=e.map(k9),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some($9))return o;for(;;){o.push(i.map((a,c)=>e[c][a]));let s=r;for(;++i[s]===n[s];){if(s===0)return t?o.map(t):o;i[s--]=0}}}function eg(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?i=>n+=+i||0:i=>n+=+t(i,r++,e)||0)}function ua(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function Zr(e,t){let n=ua(e,t);return n&&Math.sqrt(n)}function ce(e,t){let n,r;if(t===void 0)for(let i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var Sn=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let n=this._partials,r=0;for(let i=0;i<this._n&&i<32;i++){let o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){let t=this._partials,n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}};var Gn=class extends Map{constructor(t,n=q4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(Rv(this,t))}has(t){return super.has(Rv(this,t))}set(t,n){return super.set(P4(this,t),n)}delete(t){return super.delete(z4(this,t))}},Xn=class extends Set{constructor(t,n=q4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let r of t)this.add(r)}has(t){return super.has(Rv(this,t))}add(t){return super.add(P4(this,t))}delete(t){return super.delete(z4(this,t))}};function Rv({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function P4({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function z4({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function q4(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Md(e){return e}function an(e,...t){return $v(e,Md,Md,t)}function Ei(e,t,...n){return $v(e,Md,t,n)}function kv(e,t,...n){return $v(e,Array.from,t,n)}function $v(e,t,n,r){return function i(o,s){if(s>=r.length)return n(o);let a=new Gn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),h=a.get(f);h?h.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return t(a)}(e,0)}function Uv(e,t){return Array.from(t,n=>e[n])}function ls(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){let r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(let s of t){let a=Dc(s[i],s[o]);if(a)return a}})):(n=e.map(n),r.sort((i,o)=>Dc(n[i],n[o]))),Uv(e,r)}return e.sort(Ad(n))}function Ad(e=Et){if(e===Et)return Dc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Dc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function au(e,t,n){return(t.length!==2?ls(Ei(e,t,n),([r,i],[o,s])=>Et(i,s)||Et(r,o)):ls(an(e,n),([r,i],[o,s])=>t(i,s)||Et(r,o))).map(([r])=>r)}var z9=Math.sqrt(50),q9=Math.sqrt(10),V9=Math.sqrt(2);function ng(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=z9?10:o>=q9?5:o>=V9?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(e*l),c=Math.round(t*l),a/l<e&&++a,c/l>t&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(e/l),c=Math.round(t/l),a*l<e&&++a,c*l>t&&--c),c<a&&.5<=n&&n<2?ng(e,t,n*2):[a,c,l]}function In(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,o,s]=r?ng(t,e,n):ng(e,t,n);if(!(o>=i))return[];let a=o-i+1,c=new Array(a);if(r)if(s<0)for(let l=0;l<a;++l)c[l]=(o-l)/-s;else for(let l=0;l<a;++l)c[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)c[l]=(i+l)/-s;else for(let l=0;l<a;++l)c[l]=(i+l)*s;return c}function us(e,t,n){return t=+t,e=+e,n=+n,ng(e,t,n)[2]}function cu(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?us(t,e,n):us(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function lu(e,t,n){let r;for(;;){let i=us(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function fa(e){return Math.max(1,Math.ceil(Math.log(ao(e))/Math.LN2)+1)}function Xt(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rg(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function le(e,t){let n;if(t===void 0)for(let r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ig(e,t){let n,r=-1,i=-1;if(t===void 0)for(let o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function og(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Dc:Ad(i);r>n;){if(r-n>600){let c=r-n+1,l=t-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),d=Math.max(n,Math.floor(t-l*f/c+h)),p=Math.min(r,Math.floor(t+(c-l)*f/c+h));og(e,t,d,p,i)}let o=e[t],s=n,a=r;for(Td(e,n,t),i(e[r],o)>0&&Td(e,n,r);s<a;){for(Td(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?Td(e,n,a):(++a,Td(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Td(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Bc(e,t=Et){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Et(s,i)>0:Et(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function Hn(e,t,n){if(e=Float64Array.from(C4(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return le(e);if(t>=1)return Xt(e);var r,i=(r-1)*t,o=Math.floor(i),s=Xt(og(e,o).subarray(0,o+1)),a=le(e.subarray(o+1));return s+(a-s)*(i-o)}}function Pv(e,t,n=Sd){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function sg(e,t,n){let r=ao(e),i=Hn(e,.75)-Hn(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function Ed(e,t,n){let r=ao(e),i=Zr(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function fs(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function Di(e,t){return Hn(e,.5,t)}function*Y9(e){for(let t of e)yield*t}function uu(e){return Array.from(Y9(e))}function fu(e,t){let n=new Gn;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,i=0;for(let[o,s]of n)s>i&&(i=s,r=o);return r}function ag(e,t=W9){let n=[],r,i=!1;for(let o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function W9(e,t){return[e,t]}function ke(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Dd(e,t=Et){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(e),r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=Et);let i=(a,c)=>t(n[a],n[c]),o,s;return e=Uint32Array.from(n,(a,c)=>c),e.sort(t===Et?(a,c)=>Dc(n[a],n[c]):Ad(i)),e.forEach((a,c)=>{let l=i(a,o===void 0?a:o);l>=0?((o===void 0||l>0)&&(o=a,s=c),r[a]=s):r[a]=NaN}),r}function cg(e,t=Et){let n,r=!1;if(t.length===1){let i;for(let o of e){let s=t(o);(r?Et(s,i)<0:Et(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function Mn(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function ha(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function V4(e){return e}var zv=1,qv=2,Vv=3,lg=4,j4=1e-6;function G9(e){return"translate("+e+",0)"}function X9(e){return"translate(0,"+e+")"}function H9(e){return t=>+e(t)}function Z9(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function K9(){return!this.__axis}function Q9(e,t){var n=[],r=null,i=null,o=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===zv||e===lg?-1:1,u=e===lg||e===qv?"x":"y",f=e===zv||e===Vv?G9:X9;function h(d){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):V4),y=Math.max(o,0)+a,g=t.range(),b=+g[0]+c,w=+g[g.length-1]+c,x=(t.bandwidth?Z9:H9)(t.copy(),c),v=d.selection?d.selection():d,_=v.selectAll(".domain").data([null]),M=v.selectAll(".tick").data(p,t).order(),E=M.exit(),T=M.enter().append("g").attr("class","tick"),B=M.select("line"),I=M.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(T),B=B.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),I=I.merge(T.append("text").attr("fill","currentColor").attr(u,l*y).attr("dy",e===zv?"0em":e===Vv?"0.71em":"0.32em")),d!==v&&(_=_.transition(d),M=M.transition(d),B=B.transition(d),I=I.transition(d),E=E.transition(d).attr("opacity",j4).attr("transform",function(N){return isFinite(N=x(N))?f(N+c):this.getAttribute("transform")}),T.attr("opacity",j4).attr("transform",function(N){var O=this.parentNode.__axis;return f((O&&isFinite(O=O(N))?O:x(N))+c)})),E.remove(),_.attr("d",e===lg||e===qv?s?"M"+l*s+","+b+"H"+c+"V"+w+"H"+l*s:"M"+c+","+b+"V"+w:s?"M"+b+","+l*s+"V"+c+"H"+w+"V"+l*s:"M"+b+","+c+"H"+w),M.attr("opacity",1).attr("transform",function(N){return f(x(N)+c)}),B.attr(u+"2",l*o),I.attr(u,l*y).text(m),v.filter(K9).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===qv?"start":e===lg?"end":"middle"),v.each(function(){this.__axis=x})}return h.scale=function(d){return arguments.length?(t=d,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function jv(e){return Q9(Vv,e)}var J9={value:()=>{}};function W4(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ug(n)}function ug(e){this._=e}function t$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ug.prototype=W4.prototype={constructor:ug,on:function(e,t){var n=this._,r=t$(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=e$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=Y4(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Y4(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ug(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function e$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Y4(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=J9,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Nc=W4;var fg="http://www.w3.org/1999/xhtml",Kr={svg:"http://www.w3.org/2000/svg",xhtml:fg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Kr.hasOwnProperty(t)?{space:Kr[t],local:e}:e}function n$(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fg&&t.documentElement.namespaceURI===fg?t.createElement(e):t.createElementNS(n,e)}}function r$(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ds(e){var t=hs(e);return(t.local?r$:n$)(t)}function i$(){}function Oc(e){return e==null?i$:function(){return this.querySelector(e)}}function G4(e){typeof e!="function"&&(e=Oc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=e.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new Le(r,this._parents)}function Yv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function o$(){return[]}function Bd(e){return e==null?o$:function(){return this.querySelectorAll(e)}}function s$(e){return function(){return Yv(e.apply(this,arguments))}}function X4(e){typeof e=="function"?e=s$(e):e=Bd(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(e.call(c,c.__data__,l,s)),i.push(c));return new Le(r,i)}function Nd(e){return function(){return this.matches(e)}}function hg(e){return function(t){return t.matches(e)}}var a$=Array.prototype.find;function c$(e){return function(){return a$.call(this.children,e)}}function l$(){return this.firstElementChild}function H4(e){return this.select(e==null?l$:c$(typeof e=="function"?e:hg(e)))}var u$=Array.prototype.filter;function f$(){return Array.from(this.children)}function h$(e){return function(){return u$.call(this.children,e)}}function Z4(e){return this.selectAll(e==null?f$:h$(typeof e=="function"?e:hg(e)))}function K4(e){typeof e!="function"&&(e=Nd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Le(r,this._parents)}function dg(e){return new Array(e.length)}function Q4(){return new Le(this._enter||this._groups.map(dg),this._parents)}function Od(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Od.prototype={constructor:Od,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function J4(e){return function(){return e}}function d$(e,t,n,r,i,o){for(var s=0,a,c=t.length,l=o.length;s<l;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new Od(e,o[s]);for(;s<c;++s)(a=t[s])&&(i[s]=a)}function p$(e,t,n,r,i,o,s){var a,c,l=new Map,u=t.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=t[a])&&(h[a]=d=s.call(c,c.__data__,a,t)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(e,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new Od(e,o[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(h[a])===c&&(i[a]=c)}function m$(e){return e.__data__}function tT(e,t){if(!arguments.length)return Array.from(this,m$);var n=t?p$:d$,r=this._parents,i=this._groups;typeof e!="function"&&(e=J4(e));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=y$(e.call(u,u&&u.__data__,l,r)),p=d.length,m=a[l]=new Array(p),y=s[l]=new Array(p),g=c[l]=new Array(h);n(u,f,m,y,g,d,t);for(var b=0,w=0,x,v;b<p;++b)if(x=m[b]){for(b>=w&&(w=b+1);!(v=y[w])&&++w<p;);x._next=v||null}}return s=new Le(s,r),s._enter=a,s._exit=c,s}function y$(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eT(){return new Le(this._exit||this._groups.map(dg),this._parents)}function nT(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function rT(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=a[c]=new Array(f),d,p=0;p<f;++p)(d=l[p]||u[p])&&(h[p]=d);for(;c<i;++c)a[c]=n[c];return new Le(a,this._parents)}function iT(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oT(e){e||(e=g$);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new Le(i,this._parents).order()}function g$(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function aT(){return Array.from(this)}function cT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function lT(){let e=0;for(let t of this)++e;return e}function uT(){return!this.node()}function fT(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function b$(e){return function(){this.removeAttribute(e)}}function x$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function w$(e,t){return function(){this.setAttribute(e,t)}}function _$(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function v$(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function S$(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function hT(e,t){var n=hs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?x$:b$:typeof t=="function"?n.local?S$:v$:n.local?_$:w$)(n,t))}function pg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function I$(e){return function(){this.style.removeProperty(e)}}function M$(e,t,n){return function(){this.style.setProperty(e,t,n)}}function A$(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dT(e,t,n){return arguments.length>1?this.each((t==null?I$:typeof t=="function"?A$:M$)(e,t,n??"")):da(this.node(),e)}function da(e,t){return e.style.getPropertyValue(t)||pg(e).getComputedStyle(e,null).getPropertyValue(t)}function T$(e){return function(){delete this[e]}}function E$(e,t){return function(){this[e]=t}}function D$(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function pT(e,t){return arguments.length>1?this.each((t==null?T$:typeof t=="function"?D$:E$)(e,t)):this.node()[e]}function mT(e){return e.trim().split(/^|\s+/)}function Wv(e){return e.classList||new yT(e)}function yT(e){this._node=e,this._names=mT(e.getAttribute("class")||"")}yT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function gT(e,t){for(var n=Wv(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function bT(e,t){for(var n=Wv(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function B$(e){return function(){gT(this,e)}}function N$(e){return function(){bT(this,e)}}function O$(e,t){return function(){(t.apply(this,arguments)?gT:bT)(this,e)}}function xT(e,t){var n=mT(e+"");if(arguments.length<2){for(var r=Wv(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?O$:t?B$:N$)(n,t))}function L$(){this.textContent=""}function F$(e){return function(){this.textContent=e}}function C$(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wT(e){return arguments.length?this.each(e==null?L$:(typeof e=="function"?C$:F$)(e)):this.node().textContent}function R$(){this.innerHTML=""}function k$(e){return function(){this.innerHTML=e}}function $$(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _T(e){return arguments.length?this.each(e==null?R$:(typeof e=="function"?$$:k$)(e)):this.node().innerHTML}function U$(){this.nextSibling&&this.parentNode.appendChild(this)}function vT(){return this.each(U$)}function P$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ST(){return this.each(P$)}function IT(e){var t=typeof e=="function"?e:ds(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function z$(){return null}function MT(e,t){var n=typeof e=="function"?e:ds(e),r=t==null?z$:typeof t=="function"?t:Oc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function q$(){var e=this.parentNode;e&&e.removeChild(this)}function AT(){return this.each(q$)}function V$(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function j$(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TT(e){return this.select(e?j$:V$)}function ET(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Y$(e){return function(t){e.call(this,t,this.__data__)}}function W$(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function G$(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function X$(e,t,n){return function(){var r=this.__on,i,o=Y$(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function DT(e,t,n){var r=W$(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?X$:G$,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function BT(e,t,n){var r=pg(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function H$(e,t){return function(){return BT(this,e,t)}}function Z$(e,t){return function(){return BT(this,e,t.apply(this,arguments))}}function NT(e,t){return this.each((typeof t=="function"?Z$:H$)(e,t))}function*OT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var Gv=[null];function Le(e,t){this._groups=e,this._parents=t}function LT(){return new Le([[document.documentElement]],Gv)}function K$(){return this}Le.prototype=LT.prototype={constructor:Le,select:G4,selectAll:X4,selectChild:H4,selectChildren:Z4,filter:K4,data:tT,enter:Q4,exit:eT,join:nT,merge:rT,selection:K$,order:iT,sort:oT,call:sT,nodes:aT,node:cT,size:lT,empty:uT,each:fT,attr:hT,style:dT,property:pT,classed:xT,text:wT,html:_T,raise:vT,lower:ST,append:IT,insert:MT,remove:AT,clone:TT,datum:ET,on:DT,dispatch:NT,[Symbol.iterator]:OT};var ps=LT;function Pt(e){return typeof e=="string"?new Le([[document.querySelector(e)]],[document.documentElement]):new Le([[e]],Gv)}function FT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=FT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var mg={capture:!0,passive:!1};function yg(e){e.preventDefault(),e.stopImmediatePropagation()}function Ld(e){var t=e.document.documentElement,n=Pt(e).on("dragstart.drag",yg,mg);"onselectstart"in t?n.on("selectstart.drag",yg,mg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Fd(e,t){var n=e.document.documentElement,r=Pt(e).on("dragstart.drag",null);t&&(r.on("click.drag",yg,mg),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ms(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function lo(){}var ma=.7,Cc=1/ma,hu="\\s*([+-]?\\d+)\\s*",Cd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q$=/^#([0-9a-f]{3,8})$/,J$=new RegExp(`^rgb\\(${hu},${hu},${hu}\\)$`),tU=new RegExp(`^rgb\\(${co},${co},${co}\\)$`),eU=new RegExp(`^rgba\\(${hu},${hu},${hu},${Cd}\\)$`),nU=new RegExp(`^rgba\\(${co},${co},${co},${Cd}\\)$`),rU=new RegExp(`^hsl\\(${Cd},${co},${co}\\)$`),iU=new RegExp(`^hsla\\(${Cd},${co},${co},${Cd}\\)$`),CT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ms(lo,Er,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RT,formatHex:RT,formatHex8:oU,formatHsl:sU,formatRgb:kT,toString:kT});function RT(){return this.rgb().formatHex()}function oU(){return this.rgb().formatHex8()}function sU(){return VT(this).formatHsl()}function kT(){return this.rgb().formatRgb()}function Er(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q$.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$T(t):n===3?new Ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=J$.exec(e))?new Ye(t[1],t[2],t[3],1):(t=tU.exec(e))?new Ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eU.exec(e))?gg(t[1],t[2],t[3],t[4]):(t=nU.exec(e))?gg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rU.exec(e))?zT(t[1],t[2]/100,t[3]/100,1):(t=iU.exec(e))?zT(t[1],t[2]/100,t[3]/100,t[4]):CT.hasOwnProperty(e)?$T(CT[e]):e==="transparent"?new Ye(NaN,NaN,NaN,0):null}function $T(e){return new Ye(e>>16&255,e>>8&255,e&255,1)}function gg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ye(e,t,n,r)}function Rd(e){return e instanceof lo||(e=Er(e)),e?(e=e.rgb(),new Ye(e.r,e.g,e.b,e.opacity)):new Ye}function en(e,t,n,r){return arguments.length===1?Rd(e):new Ye(e,t,n,r??1)}function Ye(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ms(Ye,en,pa(lo,{brighter(e){return e=e==null?Cc:Math.pow(Cc,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ma:Math.pow(ma,e),new Ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ye(Fc(this.r),Fc(this.g),Fc(this.b),xg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:UT,formatHex:UT,formatHex8:aU,formatRgb:PT,toString:PT}));function UT(){return`#${Lc(this.r)}${Lc(this.g)}${Lc(this.b)}`}function aU(){return`#${Lc(this.r)}${Lc(this.g)}${Lc(this.b)}${Lc((isNaN(this.opacity)?1:this.opacity)*255)}`}function PT(){let e=xg(this.opacity);return`${e===1?"rgb(":"rgba("}${Fc(this.r)}, ${Fc(this.g)}, ${Fc(this.b)}${e===1?")":`, ${e})`}`}function xg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lc(e){return e=Fc(e),(e<16?"0":"")+e.toString(16)}function zT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Bi(e,t,n,r)}function VT(e){if(e instanceof Bi)return new Bi(e.h,e.s,e.l,e.opacity);if(e instanceof lo||(e=Er(e)),!e)return new Bi;if(e instanceof Bi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new Bi(s,a,c,e.opacity)}function kd(e,t,n,r){return arguments.length===1?VT(e):new Bi(e,t,n,r??1)}function Bi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ms(Bi,kd,pa(lo,{brighter(e){return e=e==null?Cc:Math.pow(Cc,e),new Bi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ma:Math.pow(ma,e),new Bi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ye(Xv(e>=240?e-240:e+120,i,r),Xv(e,i,r),Xv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Bi(qT(this.h),bg(this.s),bg(this.l),xg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=xg(this.opacity);return`${e===1?"hsl(":"hsla("}${qT(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qT(e){return e=(e||0)%360,e<0?e+360:e}function bg(e){return Math.max(0,Math.min(1,e||0))}function Xv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var wg=Math.PI/180,_g=180/Math.PI;var vg=18,jT=.96422,YT=1,WT=.82521,GT=4/29,du=6/29,XT=3*du*du,cU=du*du*du;function HT(e){if(e instanceof uo)return new uo(e.l,e.a,e.b,e.opacity);if(e instanceof ys)return ZT(e);e instanceof Ye||(e=Rd(e));var t=Qv(e.r),n=Qv(e.g),r=Qv(e.b),i=Hv((.2225045*t+.7168786*n+.0606169*r)/YT),o,s;return t===n&&n===r?o=s=i:(o=Hv((.4360747*t+.3850649*n+.1430804*r)/jT),s=Hv((.0139322*t+.0971045*n+.7141733*r)/WT)),new uo(116*i-16,500*(o-i),200*(i-s),e.opacity)}function pu(e,t,n,r){return arguments.length===1?HT(e):new uo(e,t,n,r??1)}function uo(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}ms(uo,pu,pa(lo,{brighter(e){return new uo(this.l+vg*(e??1),this.a,this.b,this.opacity)},darker(e){return new uo(this.l-vg*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=jT*Zv(t),e=YT*Zv(e),n=WT*Zv(n),new Ye(Kv(3.1338561*t-1.6168667*e-.4906146*n),Kv(-.9787684*t+1.9161415*e+.033454*n),Kv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Hv(e){return e>cU?Math.pow(e,1/3):e/XT+GT}function Zv(e){return e>du?e*e*e:XT*(e-GT)}function Kv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Qv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function lU(e){if(e instanceof ys)return new ys(e.h,e.c,e.l,e.opacity);if(e instanceof uo||(e=HT(e)),e.a===0&&e.b===0)return new ys(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*_g;return new ys(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function $d(e,t,n,r){return arguments.length===1?lU(e):new ys(e,t,n,r??1)}function ys(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ZT(e){if(isNaN(e.h))return new uo(e.l,0,0,e.opacity);var t=e.h*wg;return new uo(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ms(ys,$d,pa(lo,{brighter(e){return new ys(this.h,this.c,this.l+vg*(e??1),this.opacity)},darker(e){return new ys(this.h,this.c,this.l-vg*(e??1),this.opacity)},rgb(){return ZT(this).rgb()}}));var t8=-.14861,Jv=1.78277,t2=-.29227,Sg=-.90649,Ud=1.97294,KT=Ud*Sg,QT=Ud*Jv,JT=Jv*t2-Sg*t8;function uU(e){if(e instanceof Rc)return new Rc(e.h,e.s,e.l,e.opacity);e instanceof Ye||(e=Rd(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(JT*r+KT*t-QT*n)/(JT+KT-QT),o=r-i,s=(Ud*(n-i)-t2*o)/Sg,a=Math.sqrt(s*s+o*o)/(Ud*i*(1-i)),c=a?Math.atan2(s,o)*_g-120:NaN;return new Rc(c<0?c+360:c,a,i,e.opacity)}function Zn(e,t,n,r){return arguments.length===1?uU(e):new Rc(e,t,n,r??1)}function Rc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ms(Rc,Zn,pa(lo,{brighter(e){return e=e==null?Cc:Math.pow(Cc,e),new Rc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ma:Math.pow(ma,e),new Rc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*wg,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ye(255*(t+n*(t8*r+Jv*i)),255*(t+n*(t2*r+Sg*i)),255*(t+n*(Ud*r)),this.opacity)}}));function e2(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function e8(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return e2((n-r/t)*t,s,i,o,a)}}function n8(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],a=e[(r+2)%t];return e2((n-r/t)*t,i,o,s,a)}}var mu=e=>()=>e;function r8(e,t){return function(n){return e+n*t}}function fU(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function yu(e,t){var n=t-e;return n?r8(e,n>180||n<-180?n-360*Math.round(n/360):n):mu(isNaN(e)?t:e)}function i8(e){return(e=+e)==1?Me:function(t,n){return n-t?fU(t,n,e):mu(isNaN(t)?n:t)}}function Me(e,t){var n=t-e;return n?r8(e,n):mu(isNaN(e)?t:e)}var Qr=function e(t){var n=i8(t);function r(i,o){var s=n((i=en(i)).r,(o=en(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Me(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function o8(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=en(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(c){return a.r=r(c),a.g=i(c),a.b=o(c),a+""}}}var n2=o8(e8),hU=o8(n8);function s8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function a8(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function c8(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Dr(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function l8(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function u8(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Dr(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var i2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,r2=new RegExp(i2.source,"g");function dU(e){return function(){return e}}function pU(e){return function(t){return e(t)+""}}function Pd(e,t){var n=i2.lastIndex=r2.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=i2.exec(e))&&(i=r2.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:_e(r,i)})),n=r2.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?pU(c[0].x):dU(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Dr(e,t){var n=typeof t,r;return t==null||n==="boolean"?mu(t):(n==="number"?_e:n==="string"?(r=Er(t))?(t=r,Qr):Pd:t instanceof Er?Qr:t instanceof Date?l8:a8(t)?s8:Array.isArray(t)?c8:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?u8:_e)(e,t)}function kc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var f8=180/Math.PI,Ig={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function o2(e,t,n,r,i,o){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*f8,skewX:Math.atan(c)*f8,scaleX:s,scaleY:a}}var Mg;function h8(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ig:o2(t.a,t.b,t.c,t.d,t.e,t.f)}function d8(e){return e==null?Ig:(Mg||(Mg=document.createElementNS("http://www.w3.org/2000/svg","g")),Mg.setAttribute("transform",e),(e=Mg.transform.baseVal.consolidate())?(e=e.matrix,o2(e.a,e.b,e.c,e.d,e.e,e.f)):Ig)}function p8(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push("translate(",null,t,null,n);p.push({i:m-4,x:_e(l,f)},{i:m-2,x:_e(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:_e(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:_e(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:_e(l,f)},{i:m-2,x:_e(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,m=h.length,y;++p<m;)f[(y=h[p]).i]=y.x(d);return f.join("")}}}var s2=p8(h8,"px, ","px)","deg)"),a2=p8(d8,", ",")",")");var mU=1e-12;function m8(e){return((e=Math.exp(e))+1/e)/2}function yU(e){return((e=Math.exp(e))-1/e)/2}function gU(e){return((e=Math.exp(2*e))-1)/(e+1)}var c2=function e(t,n,r){function i(o,s){var a=o[0],c=o[1],l=o[2],u=s[0],f=s[1],h=s[2],d=u-a,p=f-c,m=d*d+p*p,y,g;if(m<mU)g=Math.log(h/l)/t,y=function(M){return[a+M*d,c+M*p,l*Math.exp(t*M*g)]};else{var b=Math.sqrt(m),w=(h*h-l*l+r*m)/(2*l*n*b),x=(h*h-l*l-r*m)/(2*h*n*b),v=Math.log(Math.sqrt(w*w+1)-w),_=Math.log(Math.sqrt(x*x+1)-x);g=(_-v)/t,y=function(M){var E=M*g,T=m8(v),B=l/(n*b)*(T*gU(t*E+v)-yU(v));return[a+B*d,c+B*p,l*T/m8(t*E+v)]}}return y.duration=g*1e3*t/Math.SQRT2,y}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,c=a*a;return e(s,a,c)},i}(Math.SQRT2,2,4);function y8(e){return function(t,n){var r=e((t=kd(t)).h,(n=kd(n)).h),i=Me(t.s,n.s),o=Me(t.l,n.l),s=Me(t.opacity,n.opacity);return function(a){return t.h=r(a),t.s=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var l2=y8(yu),bU=y8(Me);function Ag(e,t){var n=Me((e=pu(e)).l,(t=pu(t)).l),r=Me(e.a,t.a),i=Me(e.b,t.b),o=Me(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=r(s),e.b=i(s),e.opacity=o(s),e+""}}function g8(e){return function(t,n){var r=e((t=$d(t)).h,(n=$d(n)).h),i=Me(t.c,n.c),o=Me(t.l,n.l),s=Me(t.opacity,n.opacity);return function(a){return t.h=r(a),t.c=i(a),t.l=o(a),t.opacity=s(a),t+""}}}var u2=g8(yu),xU=g8(Me);function b8(e){return function t(n){n=+n;function r(i,o){var s=e((i=Zn(i)).h,(o=Zn(o)).h),a=Me(i.s,o.s),c=Me(i.l,o.l),l=Me(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=t,r}(1)}var wU=b8(yu),gu=b8(Me);function fo(e,t){t===void 0&&(t=e,e=Dr);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function Cn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var bu=0,qd=0,zd=0,w8=1e3,Tg,Vd,Eg=0,$c=0,Dg=0,jd=typeof performance=="object"&&performance.now?performance:Date,_8=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wd(){return $c||(_8(_U),$c=jd.now()+Dg)}function _U(){$c=0}function Yd(){this._call=this._time=this._next=null}Yd.prototype=Bg.prototype={constructor:Yd,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Wd():+n)+(t==null?0:+t),!this._next&&Vd!==this&&(Vd?Vd._next=this:Tg=this,Vd=this),this._call=e,this._time=n,f2()},stop:function(){this._call&&(this._call=null,this._time=1/0,f2())}};function Bg(e,t,n){var r=new Yd;return r.restart(e,t,n),r}function v8(){Wd(),++bu;for(var e=Tg,t;e;)(t=$c-e._time)>=0&&e._call.call(void 0,t),e=e._next;--bu}function x8(){$c=(Eg=jd.now())+Dg,bu=qd=0;try{v8()}finally{bu=0,SU(),$c=0}}function vU(){var e=jd.now(),t=e-Eg;t>w8&&(Dg-=t,Eg=e)}function SU(){for(var e,t=Tg,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Tg=n);Vd=e,f2(r)}function f2(e){if(!bu){qd&&(qd=clearTimeout(qd));var t=e-$c;t>24?(e<1/0&&(qd=setTimeout(x8,e-jd.now()-Dg)),zd&&(zd=clearInterval(zd))):(zd||(Eg=jd.now(),zd=setInterval(vU,w8)),bu=1,_8(x8))}}function Ng(e,t,n){var r=new Yd;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var IU=Nc("start","end","cancel","interrupt"),MU=[],M8=0,S8=1,Lg=2,Og=3,I8=4,Fg=5,Gd=6;function ya(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;AU(e,n,{name:t,index:r,group:i,on:IU,tween:MU,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:M8})}function Xd(e,t){var n=nn(e,t);if(n.state>M8)throw new Error("too late; already scheduled");return n}function An(e,t){var n=nn(e,t);if(n.state>Og)throw new Error("too late; already running");return n}function nn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function AU(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bg(o,0,n.time);function o(l){n.state=S8,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==S8)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Og)return Ng(s);d.state===I8?(d.state=Gd,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete r[u]):+u<t&&(d.state=Gd,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete r[u])}if(Ng(function(){n.state===Og&&(n.state=I8,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Lg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Lg){for(n.state=Og,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Fg,1),f=-1,h=i.length;++f<h;)i[f].call(e,u);n.state===Fg&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Gd,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function ho(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Lg&&r.state<Fg,r.state=Gd,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function A8(e){return this.each(function(){ho(this,e)})}function TU(e,t){var n,r;return function(){var i=An(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function EU(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=An(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function T8(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=nn(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?TU:EU)(n,e,t))}function xu(e,t,n){var r=e._id;return e.each(function(){var i=An(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return nn(i,r).value[t]}}function Cg(e,t){var n;return(typeof t=="number"?_e:t instanceof Er?Qr:(n=Er(t))?(t=n,Qr):Pd)(e,t)}function DU(e){return function(){this.removeAttribute(e)}}function BU(e){return function(){this.removeAttributeNS(e.space,e.local)}}function NU(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function OU(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function LU(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function FU(e,t,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a)))}}function E8(e,t){var n=hs(e),r=n==="transform"?a2:Cg;return this.attrTween(e,typeof t=="function"?(n.local?FU:LU)(n,r,xu(this,"attr."+e,t)):t==null?(n.local?BU:DU)(n):(n.local?OU:NU)(n,r,t))}function CU(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function RU(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function kU(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&RU(e,o)),n}return i._value=t,i}function $U(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&CU(e,o)),n}return i._value=t,i}function D8(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=hs(e);return this.tween(n,(r.local?kU:$U)(r,t))}function UU(e,t){return function(){Xd(this,e).delay=+t.apply(this,arguments)}}function PU(e,t){return t=+t,function(){Xd(this,e).delay=t}}function B8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?UU:PU)(t,e)):nn(this.node(),t).delay}function zU(e,t){return function(){An(this,e).duration=+t.apply(this,arguments)}}function qU(e,t){return t=+t,function(){An(this,e).duration=t}}function N8(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?zU:qU)(t,e)):nn(this.node(),t).duration}function VU(e,t){if(typeof t!="function")throw new Error;return function(){An(this,e).ease=t}}function O8(e){var t=this._id;return arguments.length?this.each(VU(t,e)):nn(this.node(),t).ease}function jU(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;An(this,e).ease=n}}function L8(e){if(typeof e!="function")throw new Error;return this.each(jU(this._id,e))}function F8(e){typeof e!="function"&&(e=Nd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&e.call(c,c.__data__,l,o)&&a.push(c);return new Kn(r,this._parents,this._name,this._id)}function C8(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=t[a];return new Kn(s,this._parents,this._name,this._id)}function YU(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function WU(e,t,n){var r,i,o=YU(t)?Xd:An;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function R8(e,t){var n=this._id;return arguments.length<2?nn(this.node(),n).on.on(e):this.each(WU(n,e,t))}function GU(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function k8(){return this.on("end.remove",GU(this._id))}function $8(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oc(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,f,h=0;h<c;++h)(u=a[h])&&(f=e.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,ya(l[h],t,n,h,l,nn(u,n)));return new Kn(o,this._parents,t,n)}function U8(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bd(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=e.call(u,u.__data__,f,c),d,p=nn(u,n),m=0,y=h.length;m<y;++m)(d=h[m])&&ya(d,t,n,m,h,p);o.push(h),s.push(u)}return new Kn(o,s,t,n)}var XU=ps.prototype.constructor;function P8(){return new XU(this._groups,this._parents)}function HU(e,t){var n,r,i;return function(){var o=da(this,e),s=(this.style.removeProperty(e),da(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function z8(e){return function(){this.style.removeProperty(e)}}function ZU(e,t,n){var r,i=n+"",o;return function(){var s=da(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function KU(e,t,n){var r,i,o;return function(){var s=da(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),da(this,e))),s===c?null:s===r&&c===i?o:(i=c,o=t(r=s,a))}}function QU(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var c=An(this,e),l=c.on,u=c.value[o]==null?a||(a=z8(t)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function q8(e,t,n){var r=(e+="")=="transform"?s2:Cg;return t==null?this.styleTween(e,HU(e,r)).on("end.style."+e,z8(e)):typeof t=="function"?this.styleTween(e,KU(e,r,xu(this,"style."+e,t))).each(QU(this._id,e)):this.styleTween(e,ZU(e,r,t),n).on("end.style."+e,null)}function JU(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function tP(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&JU(e,s,n)),r}return o._value=t,o}function V8(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,tP(e,t,n??""))}function eP(e){return function(){this.textContent=e}}function nP(e){return function(){var t=e(this);this.textContent=t??""}}function j8(e){return this.tween("text",typeof e=="function"?nP(xu(this,"text",e)):eP(e==null?"":e+""))}function rP(e){return function(t){this.textContent=e.call(this,t)}}function iP(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&rP(i)),t}return r._value=e,r}function Y8(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,iP(e))}function W8(){for(var e=this._name,t=this._id,n=Rg(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=nn(c,t);ya(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(r,this._parents,e,n)}function G8(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=An(this,r),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),i===0&&o()})}var oP=0;function Kn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function X8(e){return ps().transition(e)}function Rg(){return++oP}var gs=ps.prototype;Kn.prototype=X8.prototype={constructor:Kn,select:$8,selectAll:U8,selectChild:gs.selectChild,selectChildren:gs.selectChildren,filter:F8,merge:C8,selection:P8,transition:W8,call:gs.call,nodes:gs.nodes,node:gs.node,size:gs.size,empty:gs.empty,each:gs.each,on:R8,attr:E8,attrTween:D8,style:q8,styleTween:V8,text:j8,textTween:Y8,remove:k8,tween:T8,delay:B8,duration:N8,ease:O8,easeVarying:L8,end:G8,[Symbol.iterator]:gs[Symbol.iterator]};function kg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sP={time:null,delay:0,duration:250,ease:kg};function aP(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function H8(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=Rg(),(n=sP).time=Wd(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&ya(c,e,t,l,s,n||aP(c,t));return new Kn(r,this._parents,e,t)}ps.prototype.interrupt=A8;ps.prototype.transition=H8;var $g=e=>()=>e;function h2(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Z8(e){e.stopImmediatePropagation()}function Ug(e){e.preventDefault(),e.stopImmediatePropagation()}var K8={name:"drag"},d2={name:"space"},wu={name:"handle"},_u={name:"center"},{abs:Q8,max:Rn,min:kn}=Math;function J8(e){return[+e[0],+e[1]]}function m2(e){return[J8(e[0]),J8(e[1])]}var Pg={name:"x",handles:["w","e"].map(Hd),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},zg={name:"y",handles:["n","s"].map(Hd),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},cP={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Hd),input:function(e){return e==null?null:m2(e)},output:function(e){return e}},bs={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},tE={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},eE={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},lP={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},uP={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Hd(e){return{type:e}}function fP(e){return!e.ctrlKey&&!e.button}function hP(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function dP(){return navigator.maxTouchPoints||"ontouchstart"in this}function p2(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function pP(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function y2(){return x2(Pg)}function g2(){return x2(zg)}function b2(){return x2(cP)}function x2(e){var t=hP,n=fP,r=dP,i=!0,o=Nc("start","brush","end"),s=6,a;function c(y){var g=y.property("__brush",m).selectAll(".overlay").data([Hd("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",bs.overlay).merge(g).each(function(){var w=p2(this).extent;Pt(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),y.selectAll(".selection").data([Hd("selection")]).enter().append("rect").attr("class","selection").attr("cursor",bs.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=y.selectAll(".handle").data(e.handles,function(w){return w.type});b.exit().remove(),b.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return bs[w.type]}),y.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(y,g,b){y.tween?y.on("start.brush",function(w){u(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){u(this,arguments).end(w)}).tween("brush",function(){var w=this,x=w.__brush,v=u(w,arguments),_=x.selection,M=e.input(typeof g=="function"?g.apply(this,arguments):g,x.extent),E=Dr(_,M);function T(B){x.selection=B===1&&M===null?null:E(B),l.call(w),v.brush()}return _!==null&&M!==null?T:T(1)}):y.each(function(){var w=this,x=arguments,v=w.__brush,_=e.input(typeof g=="function"?g.apply(w,x):g,v.extent),M=u(w,x).beforestart();ho(w),v.selection=_===null?null:_,l.call(w),M.start(b).brush(b).end(b)})},c.clear=function(y,g){c.move(y,null,g)};function l(){var y=Pt(this),g=p2(this).selection;g?(y.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),y.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?g[1][0]-s/2:g[0][0]-s/2}).attr("y",function(b){return b.type[0]==="s"?g[1][1]-s/2:g[0][1]-s/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?g[1][0]-g[0][0]+s:s}).attr("height",function(b){return b.type==="e"||b.type==="w"?g[1][1]-g[0][1]+s:s})):y.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(y,g,b){var w=y.__brush.emitter;return w&&(!b||!w.clean)?w:new f(y,g,b)}function f(y,g,b){this.that=y,this.args=g,this.state=y.__brush,this.active=0,this.clean=b}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(y,g){return this.starting?(this.starting=!1,this.emit("start",y,g)):this.emit("brush",y),this},brush:function(y,g){return this.emit("brush",y,g),this},end:function(y,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",y,g)),this},emit:function(y,g,b){var w=Pt(this.that).datum();o.call(y,this.that,new h2(y,{sourceEvent:g,target:c,selection:e.output(this.state.selection),mode:b,dispatch:o}),w)}};function h(y){if(a&&!y.touches||!n.apply(this,arguments))return;var g=this,b=y.target.__data__.type,w=(i&&y.metaKey?b="overlay":b)==="selection"?K8:i&&y.altKey?_u:wu,x=e===zg?null:lP[b],v=e===Pg?null:uP[b],_=p2(g),M=_.extent,E=_.selection,T=M[0][0],B,I,N=M[0][1],O,S,A=M[1][0],D,C,R=M[1][1],F,k,$=0,U=0,W,et=x&&v&&i&&y.shiftKey,rt,st,j=Array.from(y.touches||[y],J=>{let se=J.identifier;return J=Fn(J,g),J.point0=J.slice(),J.identifier=se,J});ho(g);var ot=u(g,arguments,!0).beforestart();if(b==="overlay"){E&&(W=!0);let J=[j[0],j[1]||j[0]];_.selection=E=[[B=e===zg?T:kn(J[0][0],J[1][0]),O=e===Pg?N:kn(J[0][1],J[1][1])],[D=e===zg?A:Rn(J[0][0],J[1][0]),F=e===Pg?R:Rn(J[0][1],J[1][1])]],j.length>1&&Lt(y)}else B=E[0][0],O=E[0][1],D=E[1][0],F=E[1][1];I=B,S=O,C=D,k=F;var z=Pt(g).attr("pointer-events","none"),H=z.selectAll(".overlay").attr("cursor",bs[b]);if(y.touches)ot.moved=P,ot.ended=ft;else{var nt=Pt(y.view).on("mousemove.brush",P,!0).on("mouseup.brush",ft,!0);i&&nt.on("keydown.brush",Wt,!0).on("keyup.brush",Ht,!0),Ld(y.view)}l.call(g),ot.start(y,w.name);function P(J){for(let se of J.changedTouches||[J])for(let gr of j)gr.identifier===se.identifier&&(gr.cur=Fn(se,g));if(et&&!rt&&!st&&j.length===1){let se=j[0];Q8(se.cur[0]-se[0])>Q8(se.cur[1]-se[1])?st=!0:rt=!0}for(let se of j)se.cur&&(se[0]=se.cur[0],se[1]=se.cur[1]);W=!0,Ug(J),Lt(J)}function Lt(J){let se=j[0],gr=se.point0;var ki;switch($=se[0]-gr[0],U=se[1]-gr[1],w){case d2:case K8:{x&&($=Rn(T-B,kn(A-D,$)),I=B+$,C=D+$),v&&(U=Rn(N-O,kn(R-F,U)),S=O+U,k=F+U);break}case wu:{j[1]?(x&&(I=Rn(T,kn(A,j[0][0])),C=Rn(T,kn(A,j[1][0])),x=1),v&&(S=Rn(N,kn(R,j[0][1])),k=Rn(N,kn(R,j[1][1])),v=1)):(x<0?($=Rn(T-B,kn(A-B,$)),I=B+$,C=D):x>0&&($=Rn(T-D,kn(A-D,$)),I=B,C=D+$),v<0?(U=Rn(N-O,kn(R-O,U)),S=O+U,k=F):v>0&&(U=Rn(N-F,kn(R-F,U)),S=O,k=F+U));break}case _u:{x&&(I=Rn(T,kn(A,B-$*x)),C=Rn(T,kn(A,D+$*x))),v&&(S=Rn(N,kn(R,O-U*v)),k=Rn(N,kn(R,F+U*v)));break}}C<I&&(x*=-1,ki=B,B=D,D=ki,ki=I,I=C,C=ki,b in tE&&H.attr("cursor",bs[b=tE[b]])),k<S&&(v*=-1,ki=O,O=F,F=ki,ki=S,S=k,k=ki,b in eE&&H.attr("cursor",bs[b=eE[b]])),_.selection&&(E=_.selection),rt&&(I=E[0][0],C=E[1][0]),st&&(S=E[0][1],k=E[1][1]),(E[0][0]!==I||E[0][1]!==S||E[1][0]!==C||E[1][1]!==k)&&(_.selection=[[I,S],[C,k]],l.call(g),ot.brush(J,w.name))}function ft(J){if(Z8(J),J.touches){if(J.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else Fd(J.view,W),nt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),H.attr("cursor",bs.overlay),_.selection&&(E=_.selection),pP(E)&&(_.selection=null,l.call(g)),ot.end(J,w.name)}function Wt(J){switch(J.keyCode){case 16:{et=x&&v;break}case 18:{w===wu&&(x&&(D=C-$*x,B=I+$*x),v&&(F=k-U*v,O=S+U*v),w=_u,Lt(J));break}case 32:{(w===wu||w===_u)&&(x<0?D=C-$:x>0&&(B=I-$),v<0?F=k-U:v>0&&(O=S-U),w=d2,H.attr("cursor",bs.selection),Lt(J));break}default:return}Ug(J)}function Ht(J){switch(J.keyCode){case 16:{et&&(rt=st=et=!1,Lt(J));break}case 18:{w===_u&&(x<0?D=C:x>0&&(B=I),v<0?F=k:v>0&&(O=S),w=wu,Lt(J));break}case 32:{w===d2&&(J.altKey?(x&&(D=C-$*x,B=I+$*x),v&&(F=k-U*v,O=S+U*v),w=_u):(x<0?D=C:x>0&&(B=I),v<0?F=k:v>0&&(O=S),w=wu),H.attr("cursor",bs[b]),Lt(J));break}default:return}Ug(J)}}function d(y){u(this,arguments).moved(y)}function p(y){u(this,arguments).ended(y)}function m(){var y=this.__brush||{selection:null};return y.extent=m2(t.apply(this,arguments)),y.dim=e,y}return c.extent=function(y){return arguments.length?(t=typeof y=="function"?y:$g(m2(y)),c):t},c.filter=function(y){return arguments.length?(n=typeof y=="function"?y:$g(!!y),c):n},c.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:$g(!!y),c):r},c.handleSize=function(y){return arguments.length?(s=+y,c):s},c.keyModifiers=function(y){return arguments.length?(i=!!y,c):i},c.on=function(){var y=o.on.apply(o,arguments);return y===o?c:y},c}var w2=Math.PI,_2=2*w2,Uc=1e-6,mP=_2-Uc;function nE(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function yP(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nE;let n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}var ga=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nE:yP(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=r-t,l=i-n,u=s-t,f=a-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Uc)if(!(Math.abs(f*c-l*u)>Uc)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=c*c+l*l,y=d*d+p*p,g=Math.sqrt(m),b=Math.sqrt(h),w=o*Math.tan((w2-Math.acos((m+h-y)/(2*g*b)))/2),x=w/b,v=w/g;Math.abs(x-1)>Uc&&this._append`L${t+x*u},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*d>u*p)},${this._x1=t+v*c},${this._y1=n+v*l}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=t+a,u=n+c,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Uc||Math.abs(this._y1-u)>Uc)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%_2+_2),h>mP?this._append`A${r},${r},0,1,${f},${t-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>Uc&&this._append`A${r},${r},0,${+(h>=w2)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function rE(){return new ga}rE.prototype=ga.prototype;function Qn(e=3){return new ga(+e)}var gP=Array.prototype,qg=gP.slice;function iE(e,t){return e-t}function oE(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}var po=e=>()=>e;function sE(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=bP(e,t[n]))return i;return 0}function bP(e,t){for(var n=t[0],r=t[1],i=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var c=e[o],l=c[0],u=c[1],f=e[a],h=f[0],d=f[1];if(xP(c,f,t))return 0;u>r!=d>r&&n<(h-l)*(r-u)/(d-u)+l&&(i=-i)}return i}function xP(e,t,n){var r;return wP(e,t,n)&&_P(e[r=+(e[0]===t[0])],n[r],t[r])}function wP(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function _P(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function aE(){}var xs=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ba(){var e=1,t=1,n=fa,r=c;function i(l){var u=n(l);if(Array.isArray(u))u=u.slice().sort(iE);else{let f=ce(l,vP);for(u=In(...lu(f[0],f[1],u),u);u[u.length-1]>=f[1];)u.pop();for(;u[1]<f[0];)u.shift()}return u.map(f=>o(l,f))}function o(l,u){let f=u==null?NaN:+u;if(isNaN(f))throw new Error(`invalid value: ${u}`);var h=[],d=[];return s(l,f,function(p){r(p,l,f),oE(p)>0?h.push([p]):d.push(p)}),d.forEach(function(p){for(var m=0,y=h.length,g;m<y;++m)if(sE((g=h[m])[0],p)!==-1){g.push(p);return}}),{type:"MultiPolygon",value:u,coordinates:h}}function s(l,u,f){var h=new Array,d=new Array,p,m,y,g,b,w;for(p=m=-1,g=Pc(l[0],u),xs[g<<1].forEach(x);++p<e-1;)y=g,g=Pc(l[p+1],u),xs[y|g<<1].forEach(x);for(xs[g<<0].forEach(x);++m<t-1;){for(p=-1,g=Pc(l[m*e+e],u),b=Pc(l[m*e],u),xs[g<<1|b<<2].forEach(x);++p<e-1;)y=g,g=Pc(l[m*e+e+p+1],u),w=b,b=Pc(l[m*e+p+1],u),xs[y|g<<1|b<<2|w<<3].forEach(x);xs[g|b<<3].forEach(x)}for(p=-1,b=l[m*e]>=u,xs[b<<2].forEach(x);++p<e-1;)w=b,b=Pc(l[m*e+p+1],u),xs[b<<2|w<<3].forEach(x);xs[b<<3].forEach(x);function x(v){var _=[v[0][0]+p,v[0][1]+m],M=[v[1][0]+p,v[1][1]+m],E=a(_),T=a(M),B,I;(B=d[E])?(I=h[T])?(delete d[B.end],delete h[I.start],B===I?(B.ring.push(M),f(B.ring)):h[B.start]=d[I.end]={start:B.start,end:I.end,ring:B.ring.concat(I.ring)}):(delete d[B.end],B.ring.push(M),d[B.end=T]=B):(B=h[T])?(I=d[E])?(delete h[B.start],delete d[I.end],B===I?(B.ring.push(M),f(B.ring)):h[I.start]=d[B.end]={start:I.start,end:B.end,ring:I.ring.concat(B.ring)}):(delete h[B.start],B.ring.unshift(_),h[B.start=E]=B):h[E]=d[T]={start:E,end:T,ring:[_,M]}}}function a(l){return l[0]*2+l[1]*(e+1)*4}function c(l,u,f){l.forEach(function(h){var d=h[0],p=h[1],m=d|0,y=p|0,g=v2(u[y*e+m]);d>0&&d<e&&m===d&&(h[0]=cE(d,v2(u[y*e+m-1]),g,f)),p>0&&p<t&&y===p&&(h[1]=cE(p,v2(u[(y-1)*e+m]),g,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[e,t];var u=Math.floor(l[0]),f=Math.floor(l[1]);if(!(u>=0&&f>=0))throw new Error("invalid size");return e=u,t=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?po(qg.call(l)):po(l),i):n},i.smooth=function(l){return arguments.length?(r=l?c:aE,i):r===c},i}function vP(e){return isFinite(e)?e:NaN}function Pc(e,t){return e==null?!1:+e>=t}function v2(e){return e==null||isNaN(e=+e)?-1/0:e}function cE(e,t,n,r){let i=r-t,o=n-t,s=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(s)?e:e+s-.5}function SP(e){return e[0]}function IP(e){return e[1]}function MP(){return 1}function S2(){var e=SP,t=IP,n=MP,r=960,i=500,o=20,s=2,a=o*3,c=r+a*2>>s,l=i+a*2>>s,u=po(20);function f(b){var w=new Float32Array(c*l),x=Math.pow(2,-s),v=-1;for(let O of b){var _=(e(O,++v,b)+a)*x,M=(t(O,v,b)+a)*x,E=+n(O,v,b);if(E&&_>=0&&_<c&&M>=0&&M<l){var T=Math.floor(_),B=Math.floor(M),I=_-T-.5,N=M-B-.5;w[T+B*c]+=(1-I)*(1-N)*E,w[T+1+B*c]+=I*(1-N)*E,w[T+1+(B+1)*c]+=I*N*E,w[T+(B+1)*c]+=(1-I)*N*E}}return Id({data:w,width:c,height:l},o*x),w}function h(b){var w=f(b),x=u(w),v=Math.pow(2,2*s);return Array.isArray(x)||(x=In(Number.MIN_VALUE,Xt(w)/v,x)),ba().size([c,l]).thresholds(x.map(_=>_*v))(w).map((_,M)=>(_.value=+x[M],d(_)))}h.contours=function(b){var w=f(b),x=ba().size([c,l]),v=Math.pow(2,2*s),_=M=>{M=+M;var E=d(x.contour(w,M*v));return E.value=M,E};return Object.defineProperty(_,"max",{get:()=>Xt(w)/v}),_};function d(b){return b.coordinates.forEach(p),b}function p(b){b.forEach(m)}function m(b){b.forEach(y)}function y(b){b[0]=b[0]*Math.pow(2,s)-a,b[1]=b[1]*Math.pow(2,s)-a}function g(){return a=o*3,c=r+a*2>>s,l=i+a*2>>s,h}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:po(+b),h):e},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:po(+b),h):t},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:po(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var w=+b[0],x=+b[1];if(!(w>=0&&x>=0))throw new Error("invalid size");return r=w,i=x,g()},h.cellSize=function(b){if(!arguments.length)return 1<<s;if(!((b=+b)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(b)/Math.LN2),g()},h.thresholds=function(b){return arguments.length?(u=typeof b=="function"?b:Array.isArray(b)?po(qg.call(b)):po(b),h):u},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,g()},h}var Qt=11102230246251565e-32,We=134217729,Zd=(3+8*Qt)*Qt;function zc(e,t,n,r,i){let o,s,a,c,l=t[0],u=r[0],f=0,h=0;u>l==u>-l?(o=l,l=t[++f]):(o=u,u=r[++h]);let d=0;if(f<e&&h<n)for(u>l==u>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=u+o,a=o-(s-u),u=r[++h]),o=s,a!==0&&(i[d++]=a);f<e&&h<n;)u>l==u>-l?(s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f]):(s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h]),o=s,a!==0&&(i[d++]=a);for(;f<e;)s=o+l,c=s-o,a=o-(s-c)+(l-c),l=t[++f],o=s,a!==0&&(i[d++]=a);for(;h<n;)s=o+u,c=s-o,a=o-(s-c)+(u-c),u=r[++h],o=s,a!==0&&(i[d++]=a);return(o!==0||d===0)&&(i[d++]=o),d}function Kd(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function V(e){return new Float64Array(e)}var AP=(3+16*Qt)*Qt,TP=(2+12*Qt)*Qt,EP=(9+64*Qt)*Qt*Qt,vu=V(4),lE=V(8),uE=V(12),fE=V(16),Jn=V(4);function DP(e,t,n,r,i,o,s){let a,c,l,u,f,h,d,p,m,y,g,b,w,x,v,_,M,E,T=e-i,B=n-i,I=t-o,N=r-o;x=T*N,h=We*T,d=h-(h-T),p=T-d,h=We*N,m=h-(h-N),y=N-m,v=p*y-(x-d*m-p*m-d*y),_=I*B,h=We*I,d=h-(h-I),p=I-d,h=We*B,m=h-(h-B),y=B-m,M=p*y-(_-d*m-p*m-d*y),g=v-M,f=v-g,vu[0]=v-(g+f)+(f-M),b=x+g,f=b-x,w=x-(b-f)+(g-f),g=w-_,f=w-g,vu[1]=w-(g+f)+(f-_),E=b+g,f=E-b,vu[2]=b-(E-f)+(g-f),vu[3]=E;let O=Kd(4,vu),S=TP*s;if(O>=S||-O>=S||(f=e-T,a=e-(T+f)+(f-i),f=n-B,l=n-(B+f)+(f-i),f=t-I,c=t-(I+f)+(f-o),f=r-N,u=r-(N+f)+(f-o),a===0&&c===0&&l===0&&u===0)||(S=EP*s+Zd*Math.abs(O),O+=T*u+N*a-(I*l+B*c),O>=S||-O>=S))return O;x=a*N,h=We*a,d=h-(h-a),p=a-d,h=We*N,m=h-(h-N),y=N-m,v=p*y-(x-d*m-p*m-d*y),_=c*B,h=We*c,d=h-(h-c),p=c-d,h=We*B,m=h-(h-B),y=B-m,M=p*y-(_-d*m-p*m-d*y),g=v-M,f=v-g,Jn[0]=v-(g+f)+(f-M),b=x+g,f=b-x,w=x-(b-f)+(g-f),g=w-_,f=w-g,Jn[1]=w-(g+f)+(f-_),E=b+g,f=E-b,Jn[2]=b-(E-f)+(g-f),Jn[3]=E;let A=zc(4,vu,4,Jn,lE);x=T*u,h=We*T,d=h-(h-T),p=T-d,h=We*u,m=h-(h-u),y=u-m,v=p*y-(x-d*m-p*m-d*y),_=I*l,h=We*I,d=h-(h-I),p=I-d,h=We*l,m=h-(h-l),y=l-m,M=p*y-(_-d*m-p*m-d*y),g=v-M,f=v-g,Jn[0]=v-(g+f)+(f-M),b=x+g,f=b-x,w=x-(b-f)+(g-f),g=w-_,f=w-g,Jn[1]=w-(g+f)+(f-_),E=b+g,f=E-b,Jn[2]=b-(E-f)+(g-f),Jn[3]=E;let D=zc(A,lE,4,Jn,uE);x=a*u,h=We*a,d=h-(h-a),p=a-d,h=We*u,m=h-(h-u),y=u-m,v=p*y-(x-d*m-p*m-d*y),_=c*l,h=We*c,d=h-(h-c),p=c-d,h=We*l,m=h-(h-l),y=l-m,M=p*y-(_-d*m-p*m-d*y),g=v-M,f=v-g,Jn[0]=v-(g+f)+(f-M),b=x+g,f=b-x,w=x-(b-f)+(g-f),g=w-_,f=w-g,Jn[1]=w-(g+f)+(f-_),E=b+g,f=E-b,Jn[2]=b-(E-f)+(g-f),Jn[3]=E;let C=zc(D,uE,4,Jn,fE);return fE[C-1]}function Su(e,t,n,r,i,o){let s=(t-o)*(n-i),a=(e-i)*(r-o),c=s-a,l=Math.abs(s+a);return Math.abs(c)>=AP*l?c:-DP(e,t,n,r,i,o,l)}var Pyt=(7+56*Qt)*Qt,zyt=(3+28*Qt)*Qt,qyt=(26+288*Qt)*Qt*Qt,Vyt=V(4),jyt=V(4),Yyt=V(4),Wyt=V(4),Gyt=V(4),Xyt=V(4),Hyt=V(4),Zyt=V(4),Kyt=V(4),Qyt=V(8),Jyt=V(8),t0t=V(8),e0t=V(4),n0t=V(8),r0t=V(8),i0t=V(8),o0t=V(12),s0t=V(192),a0t=V(192);var u0t=(10+96*Qt)*Qt,f0t=(4+48*Qt)*Qt,h0t=(44+576*Qt)*Qt*Qt,d0t=V(4),p0t=V(4),m0t=V(4),y0t=V(4),g0t=V(4),b0t=V(4),x0t=V(4),w0t=V(4),_0t=V(8),v0t=V(8),S0t=V(8),I0t=V(8),M0t=V(8),A0t=V(8),T0t=V(8),E0t=V(8),D0t=V(8),B0t=V(4),N0t=V(4),O0t=V(4),L0t=V(8),F0t=V(16),C0t=V(16),R0t=V(16),k0t=V(32),$0t=V(32),U0t=V(48),P0t=V(64),z0t=V(1152),q0t=V(1152);var W0t=(16+224*Qt)*Qt,G0t=(5+72*Qt)*Qt,X0t=(71+1408*Qt)*Qt*Qt,H0t=V(4),Z0t=V(4),K0t=V(4),Q0t=V(4),J0t=V(4),tgt=V(4),egt=V(4),ngt=V(4),rgt=V(4),igt=V(4),ogt=V(24),sgt=V(24),agt=V(24),cgt=V(24),lgt=V(24),ugt=V(24),fgt=V(24),hgt=V(24),dgt=V(24),pgt=V(24),mgt=V(1152),ygt=V(1152),ggt=V(1152),bgt=V(1152),xgt=V(1152),wgt=V(2304),_gt=V(2304),vgt=V(3456),Sgt=V(5760),Igt=V(8),Mgt=V(8),Agt=V(8),Tgt=V(16),Egt=V(24),Dgt=V(48),Bgt=V(48),Ngt=V(96),Ogt=V(192),Lgt=V(384),Fgt=V(384),Cgt=V(384),Rgt=V(768);var kgt=V(96),$gt=V(96),Ugt=V(96),Pgt=V(1152);var dE=Math.pow(2,-52),Vg=new Uint32Array(512),Mu=class e{static from(t,n=CP,r=RP){let i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){let a=t[s];o[2*s]=n(a),o[2*s+1]=r(a)}return new e(o)}constructor(t){let n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1,a=1/0,c=1/0,l=-1/0,u=-1/0;for(let T=0;T<s;T++){let B=t[2*T],I=t[2*T+1];B<a&&(a=B),I<c&&(c=I),B>l&&(l=B),I>u&&(u=I),this._ids[T]=T}let f=(a+l)/2,h=(c+u)/2,d,p,m;for(let T=0,B=1/0;T<s;T++){let I=I2(f,h,t[2*T],t[2*T+1]);I<B&&(d=T,B=I)}let y=t[2*d],g=t[2*d+1];for(let T=0,B=1/0;T<s;T++){if(T===d)continue;let I=I2(y,g,t[2*T],t[2*T+1]);I<B&&I>0&&(p=T,B=I)}let b=t[2*p],w=t[2*p+1],x=1/0;for(let T=0;T<s;T++){if(T===d||T===p)continue;let B=LP(y,g,b,w,t[2*T],t[2*T+1]);B<x&&(m=T,x=B)}let v=t[2*m],_=t[2*m+1];if(x===1/0){for(let I=0;I<s;I++)this._dists[I]=t[2*I]-t[0]||t[2*I+1]-t[1];Iu(this._ids,this._dists,0,s-1);let T=new Uint32Array(s),B=0;for(let I=0,N=-1/0;I<s;I++){let O=this._ids[I],S=this._dists[O];S>N&&(T[B++]=O,N=S)}this.hull=T.subarray(0,B),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Su(y,g,b,w,v,_)<0){let T=p,B=b,I=w;p=m,b=v,w=_,m=T,v=B,_=I}let M=FP(y,g,b,w,v,_);this._cx=M.x,this._cy=M.y;for(let T=0;T<s;T++)this._dists[T]=I2(t[2*T],t[2*T+1],M.x,M.y);Iu(this._ids,this._dists,0,s-1),this._hullStart=d;let E=3;r[d]=n[m]=p,r[p]=n[d]=m,r[m]=n[p]=d,i[d]=0,i[p]=1,i[m]=2,o.fill(-1),o[this._hashKey(y,g)]=d,o[this._hashKey(b,w)]=p,o[this._hashKey(v,_)]=m,this.trianglesLen=0,this._addTriangle(d,p,m,-1,-1,-1);for(let T=0,B,I;T<this._ids.length;T++){let N=this._ids[T],O=t[2*N],S=t[2*N+1];if(T>0&&Math.abs(O-B)<=dE&&Math.abs(S-I)<=dE||(B=O,I=S,N===d||N===p||N===m))continue;let A=0;for(let k=0,$=this._hashKey(O,S);k<this._hashSize&&(A=o[($+k)%this._hashSize],!(A!==-1&&A!==r[A]));k++);A=n[A];let D=A,C;for(;C=r[D],Su(O,S,t[2*D],t[2*D+1],t[2*C],t[2*C+1])>=0;)if(D=C,D===A){D=-1;break}if(D===-1)continue;let R=this._addTriangle(D,N,r[D],-1,-1,i[D]);i[N]=this._legalize(R+2),i[D]=R,E++;let F=r[D];for(;C=r[F],Su(O,S,t[2*F],t[2*F+1],t[2*C],t[2*C+1])<0;)R=this._addTriangle(F,N,C,i[N],-1,i[F]),i[N]=this._legalize(R+2),r[F]=F,E--,F=C;if(D===A)for(;C=n[D],Su(O,S,t[2*C],t[2*C+1],t[2*D],t[2*D+1])<0;)R=this._addTriangle(C,N,D,-1,i[D],i[C]),this._legalize(R+2),i[C]=R,r[D]=D,E--,D=C;this._hullStart=n[N]=D,r[D]=n[F]=N,r[N]=F,o[this._hashKey(O,S)]=N,o[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(E);for(let T=0,B=this._hullStart;T<E;T++)this.hull[T]=B,B=r[B];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(NP(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:n,_halfedges:r,coords:i}=this,o=0,s=0;for(;;){let a=r[t],c=t-t%3;if(s=c+(t+2)%3,a===-1){if(o===0)break;t=Vg[--o];continue}let l=a-a%3,u=c+(t+1)%3,f=l+(a+2)%3,h=n[s],d=n[t],p=n[u],m=n[f];if(OP(i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[a]=h;let g=r[f];if(g===-1){let w=this._hullStart;do{if(this._hullTri[w]===f){this._hullTri[w]=t;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(t,g),this._link(a,r[s]),this._link(s,f);let b=l+(a+1)%3;o<Vg.length&&(Vg[o++]=b)}else{if(o===0)break;t=Vg[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,s){let a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}};function NP(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function I2(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function OP(e,t,n,r,i,o,s,a){let c=e-s,l=t-a,u=n-s,f=r-a,h=i-s,d=o-a,p=c*c+l*l,m=u*u+f*f,y=h*h+d*d;return c*(f*y-m*d)-l*(u*y-m*h)+p*(u*d-f*h)<0}function LP(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=(l*u-a*f)*h,p=(s*f-c*u)*h;return d*d+p*p}function FP(e,t,n,r,i,o){let s=n-e,a=r-t,c=i-e,l=o-t,u=s*s+a*a,f=c*c+l*l,h=.5/(s*l-a*c),d=e+(l*u-a*f)*h,p=t+(s*f-c*u)*h;return{x:d,y:p}}function Iu(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let o=e[i],s=t[o],a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{let i=n+r>>1,o=n+1,s=r;Qd(e,i,o),t[e[n]]>t[e[r]]&&Qd(e,n,r),t[e[o]]>t[e[r]]&&Qd(e,o,r),t[e[n]]>t[e[o]]&&Qd(e,n,o);let a=e[o],c=t[a];for(;;){do o++;while(t[e[o]]<c);do s--;while(t[e[s]]>c);if(s<o)break;Qd(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(Iu(e,t,o,r),Iu(e,t,n,s-1)):(Iu(e,t,n,s-1),Iu(e,t,o,r))}}function Qd(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function CP(e){return e[0]}function RP(e){return e[1]}var Jr=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;let i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>1e-6||Math.abs(this._y1-o)>1e-6)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}};var xa=class{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}};var Jd=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this,o,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,y=0,g=r.length,b,w;m<g;m+=3,y+=2){let x=r[m]*2,v=r[m+1]*2,_=r[m+2]*2,M=t[x],E=t[x+1],T=t[v],B=t[v+1],I=t[_],N=t[_+1],O=T-M,S=B-E,A=I-M,D=N-E,C=(O*D-S*A)*2;if(Math.abs(C)<1e-9){if(o===void 0){o=s=0;for(let F of n)o+=t[F*2],s+=t[F*2+1];o/=n.length,s/=n.length}let R=1e9*Math.sign((o-M)*D-(s-E)*A);b=(M+I)/2-R*D,w=(E+N)/2+R*A}else{let R=1/C,F=O*O+S*S,k=A*A+D*D;b=M+(D*F-S*k)*R,w=E+(O*k-A*F)*R}a[y]=b,a[y+1]=w}let c=n[n.length-1],l,u=c*4,f,h=t[2*c],d,p=t[2*c+1];i.fill(0);for(let m=0;m<n.length;++m)c=n[m],l=u,f=h,d=p,u=c*4,h=t[2*c],p=t[2*c+1],i[l+2]=i[u]=d-p,i[l+3]=i[u+1]=h-f}render(t){let n=t==null?t=new Jr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=r.length;u<f;++u){let h=r[u];if(h<u)continue;let d=Math.floor(u/3)*2,p=Math.floor(h/3)*2,m=s[d],y=s[d+1],g=s[p],b=s[p+1];this._renderSegment(m,y,g,b,t)}let c,l=o[o.length-1];for(let u=0;u<o.length;++u){c=l,l=o[u];let f=Math.floor(i[l]/3)*2,h=s[f],d=s[f+1],p=c*4,m=this._project(h,d,a[p+2],a[p+3]);m&&this._renderSegment(h,d,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new Jr:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){let r=n==null?n=new Jr:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(i[s]!==i[s-2]||i[s+1]!==i[s-1])&&n.lineTo(i[s],i[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){let i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){let n=new xa;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let s,a=this._regioncode(t,n),c=this._regioncode(r,i);a===0&&c===0?(o.moveTo(t,n),o.lineTo(r,i)):(s=this._clipSegment(t,n,r,i,a,c))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){let n=this._clip(t);if(n)for(let r of this.delaunay.neighbors(t)){let i=this._clip(r);if(i){t:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,c=i.length;a<c;a+=2)if(n[o]===i[a]&&n[o+1]===i[a+1]&&n[(o+2)%s]===i[(a+c-2)%c]&&n[(o+3)%s]===i[(a+c-1)%c]){yield r;break t}}}}_cell(t){let{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,s=r[t];if(s===-1)return null;let a=[],c=s;do{let l=Math.floor(c/3);if(a.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,o[c]!==t)break;c=i[c]}while(c!==s&&c!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(t);if(n===null)return null;let{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){let r=n.length,i=null,o,s,a=n[r-2],c=n[r-1],l,u=this._regioncode(a,c),f,h=0;for(let d=0;d<r;d+=2)if(o=a,s=c,a=n[d],c=n[d+1],l=u,u=this._regioncode(a,c),l===0&&u===0)f=h,h=0,i?i.push(a,c):i=[a,c];else{let p,m,y,g,b;if(l===0){if((p=this._clipSegment(o,s,a,c,l,u))===null)continue;[m,y,g,b]=p}else{if((p=this._clipSegment(a,c,o,s,u,l))===null)continue;[g,b,m,y]=p,f=h,h=this._edgecode(m,y),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(m,y):i=[m,y]}f=h,h=this._edgecode(g,b),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(g,b):i=[g,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(t,f,h,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,s){let a=o<s;for(a&&([t,n,r,i,o,s]=[r,i,t,n,s,o]);;){if(o===0&&s===0)return a?[r,i,t,n]:[t,n,r,i];if(o&s)return null;let c,l,u=o||s;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),o?(t=c,n=l,o=this._regioncode(t,n)):(r=c,i=l,s=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,i))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(c[0],c[1]),a=this._clipFinite(t,a))for(let l=0,u=a.length,f,h=this._edgecode(a[u-2],a[u-1]);l<u;l+=2)f=h,h=this._edgecode(a[l],a[l+1]),f&&h&&(l=this._edge(t,f,h,a,l),u=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,r,i,o){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(i[o]!==s||i[o+1]!==a)&&this.contains(t,s,a)&&(i.splice(o,0,s,a),o+=2)}return o}_project(t,n,r,i){let o=1/0,s,a,c;if(i<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/i)<o&&(c=this.ymin,a=t+(o=s)*r)}else if(i>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)<o&&(c=this.ymax,a=t+(o=s)*r)}if(r>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)<o&&(a=this.xmax,c=n+(o=s)*i)}else if(r<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/r)<o&&(a=this.xmin,c=n+(o=s)*i)}return[a,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){let r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}};var kP=2*Math.PI,Au=Math.pow;function $P(e){return e[0]}function UP(e){return e[1]}function PP(e){let{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){let i=2*t[r],o=2*t[r+1],s=2*t[r+2];if((n[s]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}function zP(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var ti=class e{static from(t,n=$P,r=UP,i){return new e("length"in t?qP(t,n,r,i):Float64Array.from(VP(t,n,r,i)))}constructor(t){this._delaunator=new Mu(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&PP(t)){this.collinear=Int32Array.from({length:n.length/2},(h,d)=>d).sort((h,d)=>n[2*h]-n[2*d]||n[2*h+1]-n[2*d+1]);let c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let h=0,d=n.length/2;h<d;++h){let p=zP(n[2*h],n[2*h+1],f);n[2*h]=p[0],n[2*h+1]=p[1]}this._delaunator=new Mu(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,l=r.length;c<l;++c){let u=o[c%3===2?c-2:c+1];(r[c]===-1||s[u]===-1)&&(s[u]=c)}for(let c=0,l=i.length;c<l;++c)a[i[c]]=c;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Jd(this,t)}*neighbors(t){let{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){let f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}let c=n[t];if(c===-1)return;let l=c,u=-1;do{if(yield u=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){let f=r[(i[t]+1)%r.length];f!==u&&(yield f);return}}while(l!==c)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;let i=r,o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){let{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:c,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let u=t,f=Au(n-l[t*2],2)+Au(r-l[t*2+1],2),h=i[t],d=h;do{let p=c[d],m=Au(n-l[p*2],2)+Au(r-l[p*2+1],2);if(m<f&&(f=m,u=p),d=d%3===2?d-2:d+1,c[d]!==t)break;if(d=a[d],d===-1){if(d=o[(s[t]+1)%o.length],d!==p&&Au(n-l[d*2],2)+Au(r-l[d*2+1],2)<f)return d;break}}while(d!==h);return u}render(t){let n=t==null?t=new Jr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let s=0,a=i.length;s<a;++s){let c=i[s];if(c<s)continue;let l=o[s]*2,u=o[c]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;let r=t==null?t=new Jr:void 0,{points:i}=this;for(let o=0,s=i.length;o<s;o+=2){let a=i[o],c=i[o+1];t.moveTo(a+n,c),t.arc(a,c,n,0,kP)}return r&&r.value()}renderHull(t){let n=t==null?t=new Jr:void 0,{hull:r,points:i}=this,o=r[0]*2,s=r.length;t.moveTo(i[o],i[o+1]);for(let a=1;a<s;++a){let c=2*r[a];t.lineTo(i[c],i[c+1])}return t.closePath(),n&&n.value()}hullPolygon(){let t=new xa;return this.renderHull(t),t.value()}renderTriangle(t,n){let r=n==null?n=new Jr:void 0,{points:i,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,c=o[t+2]*2;return n.moveTo(i[s],i[s+1]),n.lineTo(i[a],i[a+1]),n.lineTo(i[c],i[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){let n=new xa;return this.renderTriangle(t,n),n.value()}};function qP(e,t,n,r){let i=e.length,o=new Float64Array(i*2);for(let s=0;s<i;++s){let a=e[s];o[s*2]=t.call(r,a,s,e),o[s*2+1]=n.call(r,a,s,e)}return o}function*VP(e,t,n,r){let i=0;for(let o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}function pE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qc(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function mo(e){return e=qc(Math.abs(e)),e?e[1]:NaN}function mE(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function yE(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yo(e){if(!(t=jP.exec(e)))throw new Error("invalid format: "+e);var t;return new jg({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}yo.prototype=jg.prototype;function jg(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}jg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function gE(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var M2;function bE(e,t){var n=qc(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(M2=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+qc(e,Math.max(0,t+o-1))[0]}function A2(e,t){var n=qc(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var T2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:pE,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>A2(e*100,t),r:A2,s:bE,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function E2(e){return e}var xE=Array.prototype.map,wE=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function _E(e){var t=e.grouping===void 0||e.thousands===void 0?E2:mE(xE.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?E2:yE(xE.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"\u2212":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=yo(f);var h=f.fill,d=f.align,p=f.sign,m=f.symbol,y=f.zero,g=f.width,b=f.comma,w=f.precision,x=f.trim,v=f.type;v==="n"?(b=!0,v="g"):T2[v]||(w===void 0&&(w=12),x=!0,v="g"),(y||h==="0"&&d==="=")&&(y=!0,h="0",d="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M=m==="$"?r:/[%p]/.test(v)?s:"",E=T2[v],T=/[defgprs%]/.test(v);w=w===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function B(I){var N=_,O=M,S,A,D;if(v==="c")O=E(I)+O,I="";else{I=+I;var C=I<0||1/I<0;if(I=isNaN(I)?c:E(Math.abs(I),w),x&&(I=gE(I)),C&&+I==0&&p!=="+"&&(C=!1),N=(C?p==="("?p:a:p==="-"||p==="("?"":p)+N,O=(v==="s"?wE[8+M2/3]:"")+O+(C&&p==="("?")":""),T){for(S=-1,A=I.length;++S<A;)if(D=I.charCodeAt(S),48>D||D>57){O=(D===46?i+I.slice(S+1):I.slice(S))+O,I=I.slice(0,S);break}}}b&&!y&&(I=t(I,1/0));var R=N.length+I.length+O.length,F=R<g?new Array(g-R+1).join(h):"";switch(b&&y&&(I=t(F+I,F.length?g-O.length:1/0),F=""),d){case"<":I=N+I+O+F;break;case"=":I=N+F+I+O;break;case"^":I=F.slice(0,R=F.length>>1)+N+I+O+F.slice(R);break;default:I=F+N+I+O;break}return o(I)}return B.toString=function(){return f+""},B}function u(f,h){var d=l((f=yo(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(mo(h)/3)))*3,m=Math.pow(10,-p),y=wE[8+p/3];return function(g){return d(m*g)+y}}return{format:l,formatPrefix:u}}var Yg,ei,Wg;D2({thousands:",",grouping:[3],currency:["$",""]});function D2(e){return Yg=_E(e),ei=Yg.format,Wg=Yg.formatPrefix,Yg}function B2(e){return Math.max(0,-mo(Math.abs(e)))}function N2(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(mo(t)/3)))*3-mo(Math.abs(e)))}function O2(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,mo(t)-mo(e))+1}var tt=1e-6,Vc=1e-12,Dt=Math.PI,pe=Dt/2,L2=Dt/4,cn=Dt*2,Fe=180/Dt,zt=Dt/180,Rt=Math.abs,ni=Math.atan,Ge=Math.atan2,Q=Math.cos,tp=Math.ceil,Gg=Math.exp;var Xg=Math.hypot,jc=Math.log,Hg=Math.pow,K=Math.sin,$n=Math.sign||function(e){return e>0?1:e<0?-1:0},me=Math.sqrt,Tu=Math.tan;function Zg(e){return e>1?0:e<-1?Dt:Math.acos(e)}function ve(e){return e>1?pe:e<-1?-pe:Math.asin(e)}function Xe(){}function Kg(e,t){e&&SE.hasOwnProperty(e.type)&&SE[e.type](e,t)}var vE={Feature:function(e,t){Kg(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Kg(n[r].geometry,t)}},SE={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){F2(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)F2(n[r],t,0)},Polygon:function(e,t){IE(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)IE(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Kg(n[r],t)}};function F2(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function IE(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)F2(e[n],t,1);t.polygonEnd()}function Br(e,t){e&&vE.hasOwnProperty(e.type)?vE[e.type](e,t):Kg(e,t)}function ep(e){return[Ge(e[1],e[0]),ve(e[2])]}function go(e){var t=e[0],n=e[1],r=Q(n);return[r*Q(t),r*K(t),K(n)]}function np(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Qg(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function rp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ip(e){var t=me(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var op,Jg,tb,eb,nb,rb,ib,ob,C2,R2,k2,TE,EE,tr,er,nr,Ni={sphere:Xe,point:$2,lineStart:ME,lineEnd:AE,polygonStart:function(){Ni.lineStart=GP,Ni.lineEnd=XP},polygonEnd:function(){Ni.lineStart=ME,Ni.lineEnd=AE}};function $2(e,t){e*=zt,t*=zt;var n=Q(t);sp(n*Q(e),n*K(e),K(t))}function sp(e,t,n){++op,tb+=(e-tb)/op,eb+=(t-eb)/op,nb+=(n-nb)/op}function ME(){Ni.point=YP}function YP(e,t){e*=zt,t*=zt;var n=Q(t);tr=n*Q(e),er=n*K(e),nr=K(t),Ni.point=WP,sp(tr,er,nr)}function WP(e,t){e*=zt,t*=zt;var n=Q(t),r=n*Q(e),i=n*K(e),o=K(t),s=Ge(me((s=er*o-nr*i)*s+(s=nr*r-tr*o)*s+(s=tr*i-er*r)*s),tr*r+er*i+nr*o);Jg+=s,rb+=s*(tr+(tr=r)),ib+=s*(er+(er=i)),ob+=s*(nr+(nr=o)),sp(tr,er,nr)}function AE(){Ni.point=$2}function GP(){Ni.point=HP}function XP(){DE(TE,EE),Ni.point=$2}function HP(e,t){TE=e,EE=t,e*=zt,t*=zt,Ni.point=DE;var n=Q(t);tr=n*Q(e),er=n*K(e),nr=K(t),sp(tr,er,nr)}function DE(e,t){e*=zt,t*=zt;var n=Q(t),r=n*Q(e),i=n*K(e),o=K(t),s=er*o-nr*i,a=nr*r-tr*o,c=tr*i-er*r,l=Xg(s,a,c),u=ve(l),f=l&&-u/l;C2.add(f*s),R2.add(f*a),k2.add(f*c),Jg+=u,rb+=u*(tr+(tr=r)),ib+=u*(er+(er=i)),ob+=u*(nr+(nr=o)),sp(tr,er,nr)}function U2(e){op=Jg=tb=eb=nb=rb=ib=ob=0,C2=new Sn,R2=new Sn,k2=new Sn,Br(e,Ni);var t=+C2,n=+R2,r=+k2,i=Xg(t,n,r);return i<Vc&&(t=rb,n=ib,r=ob,Jg<tt&&(t=tb,n=eb,r=nb),i=Xg(t,n,r),i<Vc)?[NaN,NaN]:[Ge(n,t)*Fe,ve(r/i)*Fe]}function ap(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function P2(e,t){return Rt(e)>Dt&&(e-=Math.round(e/cn)*cn),[e,t]}P2.invert=P2;function z2(e,t,n){return(e%=cn)?t||n?ap(NE(e),OE(t,n)):NE(e):t||n?OE(t,n):P2}function BE(e){return function(t,n){return t+=e,Rt(t)>Dt&&(t-=Math.round(t/cn)*cn),[t,n]}}function NE(e){var t=BE(e);return t.invert=BE(-e),t}function OE(e,t){var n=Q(e),r=K(e),i=Q(t),o=K(t);function s(a,c){var l=Q(c),u=Q(a)*l,f=K(a)*l,h=K(c),d=h*n+u*r;return[Ge(f*i-d*o,u*n-h*r),ve(d*i+f*o)]}return s.invert=function(a,c){var l=Q(c),u=Q(a)*l,f=K(a)*l,h=K(c),d=h*i-f*o;return[Ge(f*i+h*o,u*n+d*r),ve(d*n-u*r)]},s}function LE(e){e=z2(e[0]*zt,e[1]*zt,e.length>2?e[2]*zt:0);function t(n){return n=e(n[0]*zt,n[1]*zt),n[0]*=Fe,n[1]*=Fe,n}return t.invert=function(n){return n=e.invert(n[0]*zt,n[1]*zt),n[0]*=Fe,n[1]*=Fe,n},t}function CE(e,t,n,r,i,o){if(n){var s=Q(t),a=K(t),c=r*n;i==null?(i=t+r*cn,o=t-c/2):(i=FE(s,i),o=FE(s,o),(r>0?i<o:i>o)&&(i+=r*cn));for(var l,u=i;r>0?u>o:u<o;u-=c)l=ep([s,-a*Q(u),-a*K(u)]),e.point(l[0],l[1])}}function FE(e,t){t=go(t),t[0]-=e,ip(t);var n=Zg(-t[1]);return((-t[2]<0?-n:n)+cn-tt)%cn}function sb(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Xe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Du(e,t){return Rt(e[0]-t[0])<tt&&Rt(e[1]-t[1])<tt}function ab(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function cb(e,t,n,r,i){var o=[],s=[],a,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,y=p[0],g=p[m],b;if(Du(y,g)){if(!y[2]&&!g[2]){for(i.lineStart(),a=0;a<m;++a)i.point((y=p[a])[0],y[1]);i.lineEnd();return}g[0]+=2*tt}o.push(b=new ab(y,p,null,!0)),s.push(b.o=new ab(y,null,b,!1)),o.push(b=new ab(g,p,null,!1)),s.push(b.o=new ab(g,null,b,!0))}}),!!o.length){for(s.sort(t),RE(o),RE(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var l=o[0],u,f;;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,c=u.length;a<c;++a)i.point((f=u[a])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(u=h.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,d=!d}while(!h.v);i.lineEnd()}}}function RE(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function q2(e){return Rt(e[0])<=Dt?e[0]:$n(e[0])*((Rt(e[0])+Dt)%cn-Dt)}function kE(e,t){var n=q2(t),r=t[1],i=K(r),o=[K(n),-Q(n),0],s=0,a=0,c=new Sn;i===1?r=pe+tt:i===-1&&(r=-pe-tt);for(var l=0,u=e.length;l<u;++l)if(h=(f=e[l]).length)for(var f,h,d=f[h-1],p=q2(d),m=d[1]/2+L2,y=K(m),g=Q(m),b=0;b<h;++b,p=x,y=_,g=M,d=w){var w=f[b],x=q2(w),v=w[1]/2+L2,_=K(v),M=Q(v),E=x-p,T=E>=0?1:-1,B=T*E,I=B>Dt,N=y*_;if(c.add(Ge(N*T*K(B),g*M+N*Q(B))),s+=I?E+T*cn:E,I^p>=n^x>=n){var O=Eu(go(d),go(w));ip(O);var S=Eu(o,O);ip(S);var A=(I^E>=0?-1:1)*ve(S[2]);(r>A||r===A&&(O[0]||O[1]))&&(a+=I^E>=0?1:-1)}}return(s<-tt||s<tt&&c<-Vc)^a&1}function lb(e,t,n,r){return function(i){var o=t(i),s=sb(),a=t(s),c=!1,l,u,f,h={point:d,lineStart:m,lineEnd:y,polygonStart:function(){h.point=g,h.lineStart=b,h.lineEnd=w,u=[],l=[]},polygonEnd:function(){h.point=d,h.lineStart=m,h.lineEnd=y,u=uu(u);var x=kE(l,r);u.length?(c||(i.polygonStart(),c=!0),cb(u,KP,x,n,i)):x&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(x,v){e(x,v)&&i.point(x,v)}function p(x,v){o.point(x,v)}function m(){h.point=p,o.lineStart()}function y(){h.point=d,o.lineEnd()}function g(x,v){f.push([x,v]),a.point(x,v)}function b(){a.lineStart(),f=[]}function w(){g(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),v=s.result(),_,M=v.length,E,T,B;if(f.pop(),l.push(f),f=null,!!M){if(x&1){if(T=v[0],(E=T.length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),_=0;_<E;++_)i.point((B=T[_])[0],B[1]);i.lineEnd()}return}M>1&&x&2&&v.push(v.pop().concat(v.shift())),u.push(v.filter(ZP))}}return h}}function ZP(e){return e.length>1}function KP(e,t){return((e=e.x)[0]<0?e[1]-pe-tt:pe-e[1])-((t=t.x)[0]<0?t[1]-pe-tt:pe-t[1])}var V2=lb(function(){return!0},QP,tz,[-Dt,-pe]);function QP(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Dt:-Dt,c=Rt(o-t);Rt(c-Dt)<tt?(e.point(t,n=(n+s)/2>0?pe:-pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&c>=Dt&&(Rt(t-r)<tt&&(t-=r*tt),Rt(o-a)<tt&&(o-=a*tt),n=JP(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function JP(e,t,n,r){var i,o,s=K(e-n);return Rt(s)>tt?ni((K(t)*(o=Q(r))*K(n)-K(r)*(i=Q(t))*K(e))/(i*o*s)):(t+r)/2}function tz(e,t,n,r){var i;if(e==null)i=n*pe,r.point(-Dt,i),r.point(0,i),r.point(Dt,i),r.point(Dt,0),r.point(Dt,-i),r.point(0,-i),r.point(-Dt,-i),r.point(-Dt,0),r.point(-Dt,i);else if(Rt(e[0]-t[0])>tt){var o=e[0]<t[0]?Dt:-Dt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function $E(e){var t=Q(e),n=6*zt,r=t>0,i=Rt(t)>tt;function o(u,f,h,d){CE(d,e,n,h,u,f)}function s(u,f){return Q(u)*Q(f)>t}function a(u){var f,h,d,p,m;return{lineStart:function(){p=d=!1,m=1},point:function(y,g){var b=[y,g],w,x=s(y,g),v=r?x?0:l(y,g):x?l(y+(y<0?Dt:-Dt),g):0;if(!f&&(p=d=x)&&u.lineStart(),x!==d&&(w=c(f,b),(!w||Du(f,w)||Du(b,w))&&(b[2]=1)),x!==d)m=0,x?(u.lineStart(),w=c(b,f),u.point(w[0],w[1])):(w=c(f,b),u.point(w[0],w[1],2),u.lineEnd()),f=w;else if(i&&f&&r^x){var _;!(v&h)&&(_=c(b,f,!0))&&(m=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}x&&(!f||!Du(f,b))&&u.point(b[0],b[1]),f=b,d=x,h=v},lineEnd:function(){d&&u.lineEnd(),f=null},clean:function(){return m|(p&&d)<<1}}}function c(u,f,h){var d=go(u),p=go(f),m=[1,0,0],y=Eu(d,p),g=np(y,y),b=y[0],w=g-b*b;if(!w)return!h&&u;var x=t*g/w,v=-t*b/w,_=Eu(m,y),M=rp(m,x),E=rp(y,v);Qg(M,E);var T=_,B=np(M,T),I=np(T,T),N=B*B-I*(np(M,M)-1);if(!(N<0)){var O=me(N),S=rp(T,(-B-O)/I);if(Qg(S,M),S=ep(S),!h)return S;var A=u[0],D=f[0],C=u[1],R=f[1],F;D<A&&(F=A,A=D,D=F);var k=D-A,$=Rt(k-Dt)<tt,U=$||k<tt;if(!$&&R<C&&(F=C,C=R,R=F),U?$?C+R>0^S[1]<(Rt(S[0]-A)<tt?C:R):C<=S[1]&&S[1]<=R:k>Dt^(A<=S[0]&&S[0]<=D)){var W=rp(T,(-B+O)/I);return Qg(W,M),[S,ep(W)]}}}function l(u,f){var h=r?e:Dt-e,d=0;return u<-h?d|=1:u>h&&(d|=2),f<-h?d|=4:f>h&&(d|=8),d}return lb(s,a,o,r?[0,-e]:[-Dt,e-Dt])}function UE(e,t,n,r,i,o){var s=e[0],a=e[1],c=t[0],l=t[1],u=0,f=1,h=c-s,d=l-a,p;if(p=n-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}if(p=r-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}return u>0&&(e[0]=s+u*h,e[1]=a+u*d),f<1&&(t[0]=s+f*h,t[1]=a+f*d),!0}}}}}var cp=1e9,ub=-cp;function Bu(e,t,n,r){function i(l,u){return e<=l&&l<=n&&t<=u&&u<=r}function o(l,u,f,h){var d=0,p=0;if(l==null||(d=s(l,f))!==(p=s(u,f))||c(l,u)<0^f>0)do h.point(d===0||d===3?e:n,d>1?r:t);while((d=(d+f+4)%4)!==p);else h.point(u[0],u[1])}function s(l,u){return Rt(l[0]-e)<tt?u>0?0:3:Rt(l[0]-n)<tt?u>0?2:1:Rt(l[1]-t)<tt?u>0?1:0:u>0?3:2}function a(l,u){return c(l.x,u.x)}function c(l,u){var f=s(l,1),h=s(u,1);return f!==h?f-h:f===0?u[1]-l[1]:f===1?l[0]-u[0]:f===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,f=sb(),h,d,p,m,y,g,b,w,x,v,_,M={point:E,lineStart:N,lineEnd:O,polygonStart:B,polygonEnd:I};function E(A,D){i(A,D)&&u.point(A,D)}function T(){for(var A=0,D=0,C=d.length;D<C;++D)for(var R=d[D],F=1,k=R.length,$=R[0],U,W,et=$[0],rt=$[1];F<k;++F)U=et,W=rt,$=R[F],et=$[0],rt=$[1],W<=r?rt>r&&(et-U)*(r-W)>(rt-W)*(e-U)&&++A:rt<=r&&(et-U)*(r-W)<(rt-W)*(e-U)&&--A;return A}function B(){u=f,h=[],d=[],_=!0}function I(){var A=T(),D=_&&A,C=(h=uu(h)).length;(D||C)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),C&&cb(h,a,A,o,l),l.polygonEnd()),u=l,h=d=p=null}function N(){M.point=S,d&&d.push(p=[]),v=!0,x=!1,b=w=NaN}function O(){h&&(S(m,y),g&&x&&f.rejoin(),h.push(f.result())),M.point=E,x&&u.lineEnd()}function S(A,D){var C=i(A,D);if(d&&p.push([A,D]),v)m=A,y=D,g=C,v=!1,C&&(u.lineStart(),u.point(A,D));else if(C&&x)u.point(A,D);else{var R=[b=Math.max(ub,Math.min(cp,b)),w=Math.max(ub,Math.min(cp,w))],F=[A=Math.max(ub,Math.min(cp,A)),D=Math.max(ub,Math.min(cp,D))];UE(R,F,e,t,n,r)?(x||(u.lineStart(),u.point(R[0],R[1])),u.point(F[0],F[1]),C||u.lineEnd(),_=!1):C&&(u.lineStart(),u.point(A,D),_=!1)}b=A,w=D,x=C}return M}}function PE(e,t,n){var r=ke(e,t-tt,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function zE(e,t,n){var r=ke(e,t-tt,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function j2(){var e,t,n,r,i,o,s,a,c=10,l=c,u=90,f=360,h,d,p,m,y=2.5;function g(){return{type:"MultiLineString",coordinates:b()}}function b(){return ke(tp(r/u)*u,n,u).map(p).concat(ke(tp(a/f)*f,s,f).map(m)).concat(ke(tp(t/c)*c,e,c).filter(function(w){return Rt(w%u)>tt}).map(h)).concat(ke(tp(o/l)*l,i,l).filter(function(w){return Rt(w%f)>tt}).map(d))}return g.lines=function(){return b().map(function(w){return{type:"LineString",coordinates:w}})},g.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(m(s).slice(1),p(n).reverse().slice(1),m(a).reverse().slice(1))]}},g.extent=function(w){return arguments.length?g.extentMajor(w).extentMinor(w):g.extentMinor()},g.extentMajor=function(w){return arguments.length?(r=+w[0][0],n=+w[1][0],a=+w[0][1],s=+w[1][1],r>n&&(w=r,r=n,n=w),a>s&&(w=a,a=s,s=w),g.precision(y)):[[r,a],[n,s]]},g.extentMinor=function(w){return arguments.length?(t=+w[0][0],e=+w[1][0],o=+w[0][1],i=+w[1][1],t>e&&(w=t,t=e,e=w),o>i&&(w=o,o=i,i=w),g.precision(y)):[[t,o],[e,i]]},g.step=function(w){return arguments.length?g.stepMajor(w).stepMinor(w):g.stepMinor()},g.stepMajor=function(w){return arguments.length?(u=+w[0],f=+w[1],g):[u,f]},g.stepMinor=function(w){return arguments.length?(c=+w[0],l=+w[1],g):[c,l]},g.precision=function(w){return arguments.length?(y=+w,h=PE(o,i,90),d=zE(t,e,y),p=PE(a,s,90),m=zE(r,n,y),g):y},g.extentMajor([[-180,-90+tt],[180,90-tt]]).extentMinor([[-180,-80-tt],[180,80+tt]])}function Y2(){return j2()()}var lp=e=>e;var W2=new Sn,G2=new Sn,qE,VE,X2,H2,wa={point:Xe,lineStart:Xe,lineEnd:Xe,polygonStart:function(){wa.lineStart=ez,wa.lineEnd=rz},polygonEnd:function(){wa.lineStart=wa.lineEnd=wa.point=Xe,W2.add(Rt(G2)),G2=new Sn},result:function(){var e=W2/2;return W2=new Sn,e}};function ez(){wa.point=nz}function nz(e,t){wa.point=jE,qE=X2=e,VE=H2=t}function jE(e,t){G2.add(H2*e-X2*t),X2=e,H2=t}function rz(){jE(qE,VE)}var Z2=wa;var Nu=1/0,fb=Nu,up=-Nu,hb=up,iz={point:oz,lineStart:Xe,lineEnd:Xe,polygonStart:Xe,polygonEnd:Xe,result:function(){var e=[[Nu,fb],[up,hb]];return up=hb=-(fb=Nu=1/0),e}};function oz(e,t){e<Nu&&(Nu=e),e>up&&(up=e),t<fb&&(fb=t),t>hb&&(hb=t)}var Ou=iz;var K2=0,Q2=0,fp=0,db=0,pb=0,Lu=0,J2=0,tS=0,hp=0,GE,XE,bo,xo,Oi={point:Yc,lineStart:YE,lineEnd:WE,polygonStart:function(){Oi.lineStart=cz,Oi.lineEnd=lz},polygonEnd:function(){Oi.point=Yc,Oi.lineStart=YE,Oi.lineEnd=WE},result:function(){var e=hp?[J2/hp,tS/hp]:Lu?[db/Lu,pb/Lu]:fp?[K2/fp,Q2/fp]:[NaN,NaN];return K2=Q2=fp=db=pb=Lu=J2=tS=hp=0,e}};function Yc(e,t){K2+=e,Q2+=t,++fp}function YE(){Oi.point=sz}function sz(e,t){Oi.point=az,Yc(bo=e,xo=t)}function az(e,t){var n=e-bo,r=t-xo,i=me(n*n+r*r);db+=i*(bo+e)/2,pb+=i*(xo+t)/2,Lu+=i,Yc(bo=e,xo=t)}function WE(){Oi.point=Yc}function cz(){Oi.point=uz}function lz(){HE(GE,XE)}function uz(e,t){Oi.point=HE,Yc(GE=bo=e,XE=xo=t)}function HE(e,t){var n=e-bo,r=t-xo,i=me(n*n+r*r);db+=i*(bo+e)/2,pb+=i*(xo+t)/2,Lu+=i,i=xo*e-bo*t,J2+=i*(bo+e),tS+=i*(xo+t),hp+=i*3,Yc(bo=e,xo=t)}var eS=Oi;function mb(e){this._context=e}mb.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,cn);break}}},result:Xe};var rS=new Sn,nS,ZE,KE,dp,pp,yb={point:Xe,lineStart:function(){yb.point=fz},lineEnd:function(){nS&&QE(ZE,KE),yb.point=Xe},polygonStart:function(){nS=!0},polygonEnd:function(){nS=null},result:function(){var e=+rS;return rS=new Sn,e}};function fz(e,t){yb.point=QE,ZE=dp=e,KE=pp=t}function QE(e,t){dp-=e,pp-=t,rS.add(me(dp*dp+pp*pp)),dp=e,pp=t}var iS=yb;var JE,gb,t5,e5,Fu=class{constructor(t){this._append=t==null?n5:hz(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==t5||this._append!==gb){let r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,t5=r,gb=this._append,e5=this._,this._=i}this._+=e5;break}}}result(){let t=this._;return this._="",t.length?t:null}};function n5(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function hz(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return n5;if(t!==JE){let n=10**t;JE=t,gb=function(i){let o=1;this._+=i[0];for(let s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return gb}function Tn(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Br(a,i(o))),o.result()}return s.area=function(a){return Br(a,i(Z2)),Z2.result()},s.measure=function(a){return Br(a,i(iS)),iS.result()},s.bounds=function(a){return Br(a,i(Ou)),Ou.result()},s.centroid=function(a){return Br(a,i(eS)),eS.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,lp):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new Fu(n)):new mb(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);n=c}return t===null&&(o=new Fu(n)),s},s.projection(e).digits(n).context(t)}function Wc(e){return{stream:Cu(e)}}function Cu(e){return function(t){var n=new oS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function oS(){}oS.prototype={constructor:oS,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function sS(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Br(n,e.stream(Ou)),t(Ou.result()),r!=null&&e.clipExtent(r),e}function mp(e,t,n){return sS(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,c])},n)}function bb(e,t,n){return mp(e,[[0,0],t],n)}function xb(e,t,n){return sS(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function wb(e,t,n){return sS(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var r5=16,dz=Q(30*zt);function aS(e,t){return+t?mz(e,t):pz(e)}function pz(e){return Cu({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function mz(e,t){function n(r,i,o,s,a,c,l,u,f,h,d,p,m,y){var g=l-r,b=u-i,w=g*g+b*b;if(w>4*t&&m--){var x=s+h,v=a+d,_=c+p,M=me(x*x+v*v+_*_),E=ve(_/=M),T=Rt(Rt(_)-1)<tt||Rt(o-f)<tt?(o+f)/2:Ge(v,x),B=e(T,E),I=B[0],N=B[1],O=I-r,S=N-i,A=b*O-g*S;(A*A/w>t||Rt((g*O+b*S)/w-.5)>.3||s*h+a*d+c*p<dz)&&(n(r,i,o,s,a,c,I,N,T,x/=M,v/=M,_,m,y),y.point(I,N),n(I,N,T,x,v,_,l,u,f,h,d,p,m,y))}}return function(r){var i,o,s,a,c,l,u,f,h,d,p,m,y={point:g,lineStart:b,lineEnd:x,polygonStart:function(){r.polygonStart(),y.lineStart=v},polygonEnd:function(){r.polygonEnd(),y.lineStart=b}};function g(E,T){E=e(E,T),r.point(E[0],E[1])}function b(){f=NaN,y.point=w,r.lineStart()}function w(E,T){var B=go([E,T]),I=e(E,T);n(f,h,u,d,p,m,f=I[0],h=I[1],u=E,d=B[0],p=B[1],m=B[2],r5,r),r.point(f,h)}function x(){y.point=g,r.lineEnd()}function v(){b(),y.point=_,y.lineEnd=M}function _(E,T){w(i=E,T),o=f,s=h,a=d,c=p,l=m,y.point=w}function M(){n(f,h,u,d,p,m,o,s,i,a,c,l,r5,r),y.lineEnd=x,x()}return y}}var yz=Cu({point:function(e,t){this.stream.point(e*zt,t*zt)}});function gz(e){return Cu({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function bz(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function i5(e,t,n,r,i,o){if(!o)return bz(e,t,n,r,i);var s=Q(o),a=K(o),c=s*e,l=a*e,u=s/e,f=a/e,h=(a*n-s*t)/e,d=(a*t+s*n)/e;function p(m,y){return m*=r,y*=i,[c*m-l*y+t,n-l*m-c*y]}return p.invert=function(m,y){return[r*(u*m-f*y+h),i*(d-f*m-u*y)]},p}function En(e){return cS(function(){return e})()}function cS(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,c=0,l=0,u,f=0,h=1,d=1,p=null,m=V2,y=null,g,b,w,x=lp,v=.5,_,M,E,T,B;function I(A){return E(A[0]*zt,A[1]*zt)}function N(A){return A=E.invert(A[0],A[1]),A&&[A[0]*Fe,A[1]*Fe]}I.stream=function(A){return T&&B===A?T:T=yz(gz(u)(m(_(x(B=A)))))},I.preclip=function(A){return arguments.length?(m=A,p=void 0,S()):m},I.postclip=function(A){return arguments.length?(x=A,y=g=b=w=null,S()):x},I.clipAngle=function(A){return arguments.length?(m=+A?$E(p=A*zt):(p=null,V2),S()):p*Fe},I.clipExtent=function(A){return arguments.length?(x=A==null?(y=g=b=w=null,lp):Bu(y=+A[0][0],g=+A[0][1],b=+A[1][0],w=+A[1][1]),S()):y==null?null:[[y,g],[b,w]]},I.scale=function(A){return arguments.length?(n=+A,O()):n},I.translate=function(A){return arguments.length?(r=+A[0],i=+A[1],O()):[r,i]},I.center=function(A){return arguments.length?(o=A[0]%360*zt,s=A[1]%360*zt,O()):[o*Fe,s*Fe]},I.rotate=function(A){return arguments.length?(a=A[0]%360*zt,c=A[1]%360*zt,l=A.length>2?A[2]%360*zt:0,O()):[a*Fe,c*Fe,l*Fe]},I.angle=function(A){return arguments.length?(f=A%360*zt,O()):f*Fe},I.reflectX=function(A){return arguments.length?(h=A?-1:1,O()):h<0},I.reflectY=function(A){return arguments.length?(d=A?-1:1,O()):d<0},I.precision=function(A){return arguments.length?(_=aS(M,v=A*A),S()):me(v)},I.fitExtent=function(A,D){return mp(I,A,D)},I.fitSize=function(A,D){return bb(I,A,D)},I.fitWidth=function(A,D){return xb(I,A,D)},I.fitHeight=function(A,D){return wb(I,A,D)};function O(){var A=i5(n,0,0,h,d,f).apply(null,t(o,s)),D=i5(n,r-A[0],i-A[1],h,d,f);return u=z2(a,c,l),M=ap(t,D),E=ap(u,M),_=aS(M,v),S()}function S(){return T=B=null,I}return function(){return t=e.apply(this,arguments),I.invert=t.invert&&N,O()}}function Ru(e){var t=0,n=Dt/3,r=cS(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*zt,n=o[1]*zt):[t*Fe,n*Fe]},i}function o5(e){var t=Q(e);function n(r,i){return[r*t,K(i)/t]}return n.invert=function(r,i){return[r/t,ve(i*t)]},n}function s5(e,t){var n=K(e),r=(n+K(t))/2;if(Rt(r)<tt)return o5(e);var i=1+n*(2*r-n),o=me(i)/r;function s(a,c){var l=me(i-2*r*K(c))/r;return[l*K(a*=r),o-l*Q(a)]}return s.invert=function(a,c){var l=o-c,u=Ge(a,Rt(l))*$n(l);return l*r<0&&(u-=Dt*$n(a)*$n(l)),[u/r,ve((i-(a*a+l*l)*r*r)/(2*r))]},s}function _a(){return Ru(s5).scale(155.424).center([0,33.6442])}function yp(){return _a().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function xz(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function lS(){var e,t,n=yp(),r,i=_a().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=_a().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,l={point:function(h,d){c=[h,d]}};function u(h){var d=h[0],p=h[1];return c=null,r.point(d,p),c||(o.point(d,p),c)||(a.point(d,p),c)}u.invert=function(h){var d=n.scale(),p=n.translate(),m=(h[0]-p[0])/d,y=(h[1]-p[1])/d;return(y>=.12&&y<.234&&m>=-.425&&m<-.214?i:y>=.166&&y<.234&&m>=-.214&&m<-.115?s:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=xz([n.stream(t=h),i.stream(h),s.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),s.precision(h),f()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),s.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var d=n.scale(),p=+h[0],m=+h[1];return r=n.translate(h).clipExtent([[p-.455*d,m-.238*d],[p+.455*d,m+.238*d]]).stream(l),o=i.translate([p-.307*d,m+.201*d]).clipExtent([[p-.425*d+tt,m+.12*d+tt],[p-.214*d-tt,m+.234*d-tt]]).stream(l),a=s.translate([p-.205*d,m+.212*d]).clipExtent([[p-.214*d+tt,m+.166*d+tt],[p-.115*d-tt,m+.234*d-tt]]).stream(l),f()},u.fitExtent=function(h,d){return mp(u,h,d)},u.fitSize=function(h,d){return bb(u,h,d)},u.fitWidth=function(h,d){return xb(u,h,d)},u.fitHeight=function(h,d){return wb(u,h,d)};function f(){return e=t=null,u}return u.scale(1070)}function _b(e){return function(t,n){var r=Q(t),i=Q(n),o=e(r*i);return o===1/0?[2,0]:[o*i*K(t),o*K(n)]}}function wo(e){return function(t,n){var r=me(t*t+n*n),i=e(r),o=K(i),s=Q(i);return[Ge(t*o,r*s),ve(r&&n*o/r)]}}var uS=_b(function(e){return me(2/(1+e))});uS.invert=wo(function(e){return 2*ve(e/2)});function fS(){return En(uS).scale(124.75).clipAngle(180-.001)}var hS=_b(function(e){return(e=Zg(e))&&e/K(e)});hS.invert=wo(function(e){return e});function dS(){return En(hS).scale(79.4188).clipAngle(180-.001)}function ku(e,t){return[e,jc(Tu((pe+t)/2))]}ku.invert=function(e,t){return[e,2*ni(Gg(t))-pe]};function pS(){return mS(ku).scale(961/cn)}function mS(e){var t=En(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,c,l;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=c=l=null:(s=+f[0][0],a=+f[0][1],c=+f[1][0],l=+f[1][1]),u()):s==null?null:[[s,a],[c,l]]};function u(){var f=Dt*r(),h=t(LE(t.rotate()).invert([0,0]));return o(s==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:e===ku?[[Math.max(h[0]-f,s),a],[Math.min(h[0]+f,c),l]]:[[s,Math.max(h[1]-f,a)],[c,Math.min(h[1]+f,l)]])}return u()}function vb(e){return Tu((pe+e)/2)}function a5(e,t){var n=Q(e),r=e===t?K(e):jc(n/Q(t))/jc(vb(t)/vb(e)),i=n*Hg(vb(e),r)/r;if(!r)return ku;function o(s,a){i>0?a<-pe+tt&&(a=-pe+tt):a>pe-tt&&(a=pe-tt);var c=i/Hg(vb(a),r);return[c*K(r*s),i-c*Q(r*s)]}return o.invert=function(s,a){var c=i-a,l=$n(r)*me(s*s+c*c),u=Ge(s,Rt(c))*$n(c);return c*r<0&&(u-=Dt*$n(s)*$n(c)),[u/r,2*ni(Hg(i/l,1/r))-pe]},o}function yS(){return Ru(a5).scale(109.5).parallels([30,30])}function $u(e,t){return[e,t]}$u.invert=$u;function gS(){return En($u).scale(152.63)}function c5(e,t){var n=Q(e),r=e===t?K(e):(n-Q(t))/(t-e),i=n/r+e;if(Rt(r)<tt)return $u;function o(s,a){var c=i-a,l=r*s;return[c*K(l),i-c*Q(l)]}return o.invert=function(s,a){var c=i-a,l=Ge(s,Rt(c))*$n(c);return c*r<0&&(l-=Dt*$n(s)*$n(c)),[l/r,i-$n(r)*me(s*s+c*c)]},o}function bS(){return Ru(c5).scale(131.154).center([0,13.9389])}var gp=1.340264,bp=-.081106,xp=893e-6,wp=.003796,Sb=me(3)/2,wz=12;function xS(e,t){var n=ve(Sb*K(t)),r=n*n,i=r*r*r;return[e*Q(n)/(Sb*(gp+3*bp*r+i*(7*xp+9*wp*r))),n*(gp+bp*r+i*(xp+wp*r))]}xS.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,c;o<wz&&(a=n*(gp+bp*r+i*(xp+wp*r))-t,c=gp+3*bp*r+i*(7*xp+9*wp*r),n-=s=a/c,r=n*n,i=r*r*r,!(Rt(s)<Vc));++o);return[Sb*e*(gp+3*bp*r+i*(7*xp+9*wp*r))/Q(n),ve(K(n)/Sb)]};function wS(){return En(xS).scale(177.158)}function _S(e,t){var n=Q(t),r=Q(e)*n;return[n*K(e)/r,K(t)/r]}_S.invert=wo(ni);function vS(){return En(_S).scale(144.049).clipAngle(60)}function SS(e,t){return[Q(t)*K(e),K(t)]}SS.invert=wo(ve);function IS(){return En(SS).scale(249.5).clipAngle(90+tt)}function MS(e,t){var n=Q(t),r=1+Q(e)*n;return[n*K(e)/r,K(t)/r]}MS.invert=wo(function(e){return 2*ni(e)});function AS(){return En(MS).scale(250).clipAngle(142)}function TS(e,t){return[jc(Tu((pe+t)/2)),-e]}TS.invert=function(e,t){return[-t,2*ni(Gg(e))-pe]};function ES(){var e=mS(TS),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function _z(e,t){return e.parent===t.parent?1:2}function vz(e){return e.reduce(Sz,0)/e.length}function Sz(e,t){return e+t.x}function Iz(e){return 1+e.reduce(Mz,0)}function Mz(e,t){return Math.max(e,t.y)}function Az(e){for(var t;t=e.children;)e=t[0];return e}function Tz(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ib(){var e=_z,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(h){var d=h.children;d?(h.x=vz(d),h.y=Iz(d)):(h.x=s?a+=e(h,s):0,h.y=0,s=h)});var c=Az(o),l=Tz(o),u=c.x-e(c,l)/2,f=l.x+e(l,c)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*t,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-u)/(f-u)*t,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function Ez(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function l5(){return this.eachAfter(Ez)}function u5(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function f5(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function h5(e,t){for(var n=this,r=[n],i=[],o,s,a,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function d5(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function p5(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function m5(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function y5(e){for(var t=this,n=Dz(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Dz(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function g5(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function b5(){return Array.from(this)}function x5(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function w5(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*_5(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function DS(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Oz)):t===void 0&&(t=Nz);for(var n=new va(e),r,i=[n],o,s,a,c;r=i.pop();)if((s=t(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)i.push(o=s[a]=new va(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(BS)}function Bz(){return DS(this).eachBefore(Lz)}function Nz(e){return e.children}function Oz(e){return Array.isArray(e)?e[1]:null}function Lz(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function BS(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function va(e){this.data=e,this.depth=this.height=0,this.parent=null}va.prototype=DS.prototype={constructor:va,count:l5,each:u5,eachAfter:h5,eachBefore:f5,find:d5,sum:p5,sort:m5,path:y5,ancestors:g5,descendants:b5,leaves:x5,links:w5,copy:Bz,[Symbol.iterator]:_5};function Mb(e){return e==null?null:Fz(e)}function Fz(e){if(typeof e!="function")throw new Error;return e}var Cz={depth:-1},v5={},NS={};function Rz(e){return e.id}function kz(e){return e.parentId}function Ab(){var e=Rz,t=kz,n;function r(i){var o=Array.from(i),s=e,a=t,c,l,u,f,h,d,p,m,y=new Map;if(n!=null){let g=o.map((x,v)=>$z(n(x,v,i))),b=g.map(S5),w=new Set(g).add("");for(let x of b)w.has(x)||(w.add(x),g.push(x),b.push(S5(x)),o.push(NS));s=(x,v)=>g[v],a=(x,v)=>b[v]}for(u=0,c=o.length;u<c;++u)l=o[u],d=o[u]=new va(l),(p=s(l,u,i))!=null&&(p+="")&&(m=d.id=p,y.set(m,y.has(m)?v5:d)),(p=a(l,u,i))!=null&&(p+="")&&(d.parent=p);for(u=0;u<c;++u)if(d=o[u],p=d.parent){if(h=y.get(p),!h)throw new Error("missing: "+p);if(h===v5)throw new Error("ambiguous: "+p);h.children?h.children.push(d):h.children=[d],d.parent=h}else{if(f)throw new Error("multiple roots");f=d}if(!f)throw new Error("no root");if(n!=null){for(;f.data===NS&&f.children.length===1;)f=f.children[0],--c;for(let g=o.length-1;g>=0&&(d=o[g],d.data===NS);--g)d.data=null}if(f.parent=Cz,f.eachBefore(function(g){g.depth=g.parent.depth+1,--c}).eachBefore(BS),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Mb(i),r):e},r.parentId=function(i){return arguments.length?(t=Mb(i),r):t},r.path=function(i){return arguments.length?(n=Mb(i),r):n},r}function $z(e){e=`${e}`;let t=e.length;return OS(e,t-1)&&!OS(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function S5(e){let t=e.length;if(t<2)return"";for(;--t>1&&!OS(e,t););return e.slice(0,t)}function OS(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Uz(e,t){return e.parent===t.parent?1:2}function LS(e){var t=e.children;return t?t[0]:e.t}function FS(e){var t=e.children;return t?t[t.length-1]:e.t}function Pz(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function zz(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function qz(e,t,n){return e.a.parent===t.parent?e.a:n}function Tb(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Tb.prototype=Object.create(va.prototype);function Vz(e){for(var t=new Tb(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new Tb(o[s],s)),i.parent=n;return(t.parent=new Tb(null,0)).children=[t],t}function Gc(){var e=Uz,t=1,n=1,r=null;function i(l){var u=Vz(l);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)l.eachBefore(c);else{var f=l,h=l,d=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>d.depth&&(d=b)});var p=f===h?1:e(f,h)/2,m=p-f.x,y=t/(h.x+p+m),g=n/(d.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*y,b.y=b.depth*g})}return l}function o(l){var u=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(u){zz(l);var d=(u[0].z+u[u.length-1].z)/2;h?(l.z=h.z+e(l._,h._),l.m=l.z-d):l.z=d}else h&&(l.z=h.z+e(l._,h._));l.parent.A=a(l,h,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,u,f){if(u){for(var h=l,d=l,p=u,m=h.parent.children[0],y=h.m,g=d.m,b=p.m,w=m.m,x;p=FS(p),h=LS(h),p&&h;)m=LS(m),d=FS(d),d.a=l,x=p.z+b-h.z-y+e(p._,h._),x>0&&(Pz(qz(p,l,f),l,x),y+=x,g+=x),b+=p.m,y+=h.m,w+=m.m,g+=d.m;p&&!FS(d)&&(d.t=p,d.m+=b-g),h&&!LS(m)&&(m.t=h,m.m+=y-w,f=l)}return f}function c(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}var I5=23283064365386963e-26;function Xc(e=Math.random()){let t=(0<=e&&e<1?e/I5:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,I5*(t>>>0))}function He(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function _p(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var vp=Symbol("implicit");function Hc(){var e=new Gn,t=[],n=[],r=vp;function i(o){let s=e.get(o);if(s===void 0){if(r!==vp)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Gn;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Hc(t,n).unknown(r)},He.apply(i,arguments),i}function Sa(){var e=Hc().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-c+l*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-c))*u,s=o*(1-c),a&&(p=Math.round(p),s=Math.round(s));var y=ke(h).map(function(g){return p+o*g});return n(d?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return Sa(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},He.apply(f(),arguments)}function M5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return M5(t())},e}function CS(){return M5(Sa.apply(null,arguments).paddingInner(1))}function RS(e){return function(){return e}}function Uu(e){return+e}var A5=[0,1];function mr(e){return e}function kS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:RS(isNaN(t)?NaN:.5)}function jz(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Yz(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=kS(i,r),o=n(s,o)):(r=kS(r,i),o=n(o,s)),function(a){return o(r(a))}}function Wz(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=kS(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var c=cs(e,a,1,r)-1;return o[c](i[c](a))}}function _o(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Zc(){var e=A5,t=A5,n=Dr,r,i,o,s=mr,a,c,l;function u(){var h=Math.min(e.length,t.length);return s!==mr&&(s=jz(e[0],e[h-1])),a=h>2?Wz:Yz,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((l||(l=a(t,e.map(r),_e)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Uu),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=kc,u()},f.clamp=function(h){return arguments.length?(s=h?!0:mr,u()):s!==mr},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function Sp(){return Zc()(mr,mr)}function $S(e,t,n,r){var i=cu(e,t,n),o;switch(r=yo(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=N2(i,s))&&(r.precision=o),Wg(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=O2(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=B2(i))&&(r.precision=o-(r.type==="%")*2);break}}return ei(r)}function ws(e){var t=e.domain;return e.ticks=function(n){var r=t();return In(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return $S(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],c,l,u=10;for(a<s&&(l=s,s=a,a=l,l=i,i=o,o=l);u-- >0;){if(l=us(s,a,n),l===c)return r[i]=s,r[o]=a,t(r);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;c=l}return e},e}function _s(){var e=Sp();return e.copy=function(){return _o(e,_s())},He.apply(e,arguments),ws(e)}function Ip(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Uu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Ip(e).unknown(t)},e=arguments.length?Array.from(e,Uu):[0,1],ws(n)}function Mp(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function T5(e){return Math.log(e)}function E5(e){return Math.exp(e)}function Gz(e){return-Math.log(-e)}function Xz(e){return-Math.exp(-e)}function Hz(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Zz(e){return e===10?Hz:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kz(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function D5(e){return(t,n)=>-e(-t,n)}function US(e){let t=e(T5,E5),n=t.domain,r=10,i,o;function s(){return i=Kz(r),o=Zz(r),n()[0]<0?(i=D5(i),o=D5(o),e(Gz,Xz)):e(T5,E5),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,m,y=a==null?10:+a,g=[];if(!(r%1)&&d-h<y){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;g.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<l)){if(m>u)break;g.push(m)}g.length*2<y&&(g=In(l,u,y))}else g=In(h,d,Math.min(d-h,y)).map(o);return f?g.reverse():g},t.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=yo(c)).precision==null&&(c.trim=!0),c=ei(c)),a===1/0)return c;let l=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},t.nice=()=>n(Mp(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function Ap(){let e=US(Zc()).domain([1,10]);return e.copy=()=>_o(e,Ap()).base(e.base()),He.apply(e,arguments),e}function B5(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function N5(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PS(e){var t=1,n=e(B5(t),N5(t));return n.constant=function(r){return arguments.length?e(B5(t=+r),N5(t)):t},ws(n)}function Tp(){var e=PS(Zc());return e.copy=function(){return _o(e,Tp()).constant(e.constant())},He.apply(e,arguments)}function O5(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qz(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Jz(e){return e<0?-e*e:e*e}function zS(e){var t=e(mr,mr),n=1;function r(){return n===1?e(mr,mr):n===.5?e(Qz,Jz):e(O5(n),O5(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ws(t)}function Ep(){var e=zS(Zc());return e.copy=function(){return _o(e,Ep()).exponent(e.exponent())},He.apply(e,arguments),e}function Dp(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=Pv(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[cs(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Et),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Dp().domain(e).range(t).unknown(r)},He.apply(o,arguments)}function Bp(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[cs(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Bp().domain(e).range(t).unknown(n)},He.apply(i,arguments)}var qS=new Date,VS=new Date;function be(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return c},i.filter=o=>be(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(qS.setTime(+o),VS.setTime(+s),e(qS),e(VS),Math.floor(n(qS,VS))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var Np=be(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Np.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?be(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Np);var Zvt=Np.range;var ln=be(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),L5=ln.range;var vs=be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),tq=vs.range,Ss=be(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),eq=Ss.range;var Is=be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),nq=Is.range,Ms=be(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),rq=Ms.range;var ri=be(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),iq=ri.range,Jc=be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),oq=Jc.range,tl=be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),sq=tl.range;function el(e){return be(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var Nr=el(0),Ia=el(1),Eb=el(2),Db=el(3),So=el(4),Bb=el(5),Nb=el(6),C5=Nr.range,aq=Ia.range,cq=Eb.range,lq=Db.range,uq=So.range,fq=Bb.range,hq=Nb.range;function nl(e){return be(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/6048e5)}var Or=nl(0),Ma=nl(1),Ob=nl(2),Lb=nl(3),Io=nl(4),Fb=nl(5),Cb=nl(6),R5=Or.range,dq=Ma.range,pq=Ob.range,mq=Lb.range,yq=Io.range,gq=Fb.range,bq=Cb.range;var As=be(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),xq=As.range,Ts=be(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),wq=Ts.range;var Un=be(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:be(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});var _q=Un.range,Pn=be(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Pn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:be(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});var vq=Pn.range;function $5(e,t,n,r,i,o){let s=[[ln,1,1e3],[ln,5,5*1e3],[ln,15,15*1e3],[ln,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function a(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){let h=Math.abs(u-l)/f,d=Ti(([,,y])=>y).right(s,h);if(d===s.length)return e.every(cu(l/31536e6,u/31536e6,f));if(d===0)return Np.every(Math.max(cu(l,u,f),1));let[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,c]}var[jS,Lp]=$5(Pn,Ts,Or,tl,Ms,Ss),[YS,WS]=$5(Un,As,Nr,ri,Is,vs);function GS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function XS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Fp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function HS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,c=e.shortMonths,l=Cp(i),u=Rp(i),f=Cp(o),h=Rp(o),d=Cp(s),p=Rp(s),m=Cp(a),y=Rp(a),g=Cp(c),b=Rp(c),w={a:C,A:R,b:F,B:k,c:null,d:j5,e:j5,f:Wq,g:nV,G:iV,H:Vq,I:jq,j:Yq,L:H5,m:Gq,M:Xq,p:$,q:U,Q:G5,s:X5,S:Hq,u:Zq,U:Kq,V:Qq,w:Jq,W:tV,x:null,X:null,y:eV,Y:rV,Z:oV,"%":W5},x={a:W,A:et,b:rt,B:st,c:null,d:Y5,e:Y5,f:lV,g:xV,G:_V,H:sV,I:aV,j:cV,L:K5,m:uV,M:fV,p:j,q:ot,Q:G5,s:X5,S:hV,u:dV,U:pV,V:mV,w:yV,W:gV,x:null,X:null,y:bV,Y:wV,Z:vV,"%":W5},v={a:B,A:I,b:N,B:O,c:S,d:q5,e:q5,f:Uq,g:z5,G:P5,H:V5,I:V5,j:Cq,L:$q,m:Fq,M:Rq,p:T,q:Lq,Q:zq,s:qq,S:kq,u:Eq,U:Dq,V:Bq,w:Tq,W:Nq,x:A,X:D,y:z5,Y:P5,Z:Oq,"%":Pq};w.x=_(n,w),w.X=_(r,w),w.c=_(t,w),x.x=_(n,x),x.X=_(r,x),x.c=_(t,x);function _(z,H){return function(nt){var P=[],Lt=-1,ft=0,Wt=z.length,Ht,J,se;for(nt instanceof Date||(nt=new Date(+nt));++Lt<Wt;)z.charCodeAt(Lt)===37&&(P.push(z.slice(ft,Lt)),(J=U5[Ht=z.charAt(++Lt)])!=null?Ht=z.charAt(++Lt):J=Ht==="e"?" ":"0",(se=H[Ht])&&(Ht=se(nt,J)),P.push(Ht),ft=Lt+1);return P.push(z.slice(ft,Lt)),P.join("")}}function M(z,H){return function(nt){var P=Fp(1900,void 0,1),Lt=E(P,z,nt+="",0),ft,Wt;if(Lt!=nt.length)return null;if("Q"in P)return new Date(P.Q);if("s"in P)return new Date(P.s*1e3+("L"in P?P.L:0));if(H&&!("Z"in P)&&(P.Z=0),"p"in P&&(P.H=P.H%12+P.p*12),P.m===void 0&&(P.m="q"in P?P.q:0),"V"in P){if(P.V<1||P.V>53)return null;"w"in P||(P.w=1),"Z"in P?(ft=XS(Fp(P.y,0,1)),Wt=ft.getUTCDay(),ft=Wt>4||Wt===0?Ma.ceil(ft):Ma(ft),ft=Jc.offset(ft,(P.V-1)*7),P.y=ft.getUTCFullYear(),P.m=ft.getUTCMonth(),P.d=ft.getUTCDate()+(P.w+6)%7):(ft=GS(Fp(P.y,0,1)),Wt=ft.getDay(),ft=Wt>4||Wt===0?Ia.ceil(ft):Ia(ft),ft=ri.offset(ft,(P.V-1)*7),P.y=ft.getFullYear(),P.m=ft.getMonth(),P.d=ft.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),Wt="Z"in P?XS(Fp(P.y,0,1)).getUTCDay():GS(Fp(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(Wt+5)%7:P.w+P.U*7-(Wt+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,XS(P)):GS(P)}}function E(z,H,nt,P){for(var Lt=0,ft=H.length,Wt=nt.length,Ht,J;Lt<ft;){if(P>=Wt)return-1;if(Ht=H.charCodeAt(Lt++),Ht===37){if(Ht=H.charAt(Lt++),J=v[Ht in U5?H.charAt(Lt++):Ht],!J||(P=J(z,nt,P))<0)return-1}else if(Ht!=nt.charCodeAt(P++))return-1}return P}function T(z,H,nt){var P=l.exec(H.slice(nt));return P?(z.p=u.get(P[0].toLowerCase()),nt+P[0].length):-1}function B(z,H,nt){var P=d.exec(H.slice(nt));return P?(z.w=p.get(P[0].toLowerCase()),nt+P[0].length):-1}function I(z,H,nt){var P=f.exec(H.slice(nt));return P?(z.w=h.get(P[0].toLowerCase()),nt+P[0].length):-1}function N(z,H,nt){var P=g.exec(H.slice(nt));return P?(z.m=b.get(P[0].toLowerCase()),nt+P[0].length):-1}function O(z,H,nt){var P=m.exec(H.slice(nt));return P?(z.m=y.get(P[0].toLowerCase()),nt+P[0].length):-1}function S(z,H,nt){return E(z,t,H,nt)}function A(z,H,nt){return E(z,n,H,nt)}function D(z,H,nt){return E(z,r,H,nt)}function C(z){return s[z.getDay()]}function R(z){return o[z.getDay()]}function F(z){return c[z.getMonth()]}function k(z){return a[z.getMonth()]}function $(z){return i[+(z.getHours()>=12)]}function U(z){return 1+~~(z.getMonth()/3)}function W(z){return s[z.getUTCDay()]}function et(z){return o[z.getUTCDay()]}function rt(z){return c[z.getUTCMonth()]}function st(z){return a[z.getUTCMonth()]}function j(z){return i[+(z.getUTCHours()>=12)]}function ot(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var H=_(z+="",w);return H.toString=function(){return z},H},parse:function(z){var H=M(z+="",!1);return H.toString=function(){return z},H},utcFormat:function(z){var H=_(z+="",x);return H.toString=function(){return z},H},utcParse:function(z){var H=M(z+="",!0);return H.toString=function(){return z},H}}}var U5={"-":"",_:" ",0:"0"},un=/^\s*\d+/,Iq=/^%/,Mq=/[\\^$*+?|[\]().{}]/g;function te(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Aq(e){return e.replace(Mq,"\\$&")}function Cp(e){return new RegExp("^(?:"+e.map(Aq).join("|")+")","i")}function Rp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Tq(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Eq(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Bq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Nq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function P5(e,t,n){var r=un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function z5(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Oq(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Lq(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Fq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function q5(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cq(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function V5(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Rq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function kq(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function $q(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Uq(e,t,n){var r=un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pq(e,t,n){var r=Iq.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zq(e,t,n){var r=un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qq(e,t,n){var r=un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function j5(e,t){return te(e.getDate(),t,2)}function Vq(e,t){return te(e.getHours(),t,2)}function jq(e,t){return te(e.getHours()%12||12,t,2)}function Yq(e,t){return te(1+ri.count(Un(e),e),t,3)}function H5(e,t){return te(e.getMilliseconds(),t,3)}function Wq(e,t){return H5(e,t)+"000"}function Gq(e,t){return te(e.getMonth()+1,t,2)}function Xq(e,t){return te(e.getMinutes(),t,2)}function Hq(e,t){return te(e.getSeconds(),t,2)}function Zq(e){var t=e.getDay();return t===0?7:t}function Kq(e,t){return te(Nr.count(Un(e)-1,e),t,2)}function Z5(e){var t=e.getDay();return t>=4||t===0?So(e):So.ceil(e)}function Qq(e,t){return e=Z5(e),te(So.count(Un(e),e)+(Un(e).getDay()===4),t,2)}function Jq(e){return e.getDay()}function tV(e,t){return te(Ia.count(Un(e)-1,e),t,2)}function eV(e,t){return te(e.getFullYear()%100,t,2)}function nV(e,t){return e=Z5(e),te(e.getFullYear()%100,t,2)}function rV(e,t){return te(e.getFullYear()%1e4,t,4)}function iV(e,t){var n=e.getDay();return e=n>=4||n===0?So(e):So.ceil(e),te(e.getFullYear()%1e4,t,4)}function oV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+te(t/60|0,"0",2)+te(t%60,"0",2)}function Y5(e,t){return te(e.getUTCDate(),t,2)}function sV(e,t){return te(e.getUTCHours(),t,2)}function aV(e,t){return te(e.getUTCHours()%12||12,t,2)}function cV(e,t){return te(1+Jc.count(Pn(e),e),t,3)}function K5(e,t){return te(e.getUTCMilliseconds(),t,3)}function lV(e,t){return K5(e,t)+"000"}function uV(e,t){return te(e.getUTCMonth()+1,t,2)}function fV(e,t){return te(e.getUTCMinutes(),t,2)}function hV(e,t){return te(e.getUTCSeconds(),t,2)}function dV(e){var t=e.getUTCDay();return t===0?7:t}function pV(e,t){return te(Or.count(Pn(e)-1,e),t,2)}function Q5(e){var t=e.getUTCDay();return t>=4||t===0?Io(e):Io.ceil(e)}function mV(e,t){return e=Q5(e),te(Io.count(Pn(e),e)+(Pn(e).getUTCDay()===4),t,2)}function yV(e){return e.getUTCDay()}function gV(e,t){return te(Ma.count(Pn(e)-1,e),t,2)}function bV(e,t){return te(e.getUTCFullYear()%100,t,2)}function xV(e,t){return e=Q5(e),te(e.getUTCFullYear()%100,t,2)}function wV(e,t){return te(e.getUTCFullYear()%1e4,t,4)}function _V(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Io(e):Io.ceil(e),te(e.getUTCFullYear()%1e4,t,4)}function vV(){return"+0000"}function W5(){return"%"}function G5(e){return+e}function X5(e){return Math.floor(+e/1e3)}var Pu,zu,J5,Mo,tD;ZS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ZS(e){return Pu=HS(e),zu=Pu.format,J5=Pu.parse,Mo=Pu.utcFormat,tD=Pu.utcParse,Pu}function SV(e){return new Date(e)}function IV(e){return e instanceof Date?+e:+new Date(+e)}function Rb(e,t,n,r,i,o,s,a,c,l){var u=Sp(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),m=l("%I:%M"),y=l("%I %p"),g=l("%a %d"),b=l("%b %d"),w=l("%B"),x=l("%Y");function v(_){return(c(_)<_?d:a(_)<_?p:s(_)<_?m:o(_)<_?y:r(_)<_?i(_)<_?g:b:n(_)<_?w:x)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?h(Array.from(_,IV)):h().map(SV)},u.ticks=function(_){var M=h();return e(M[0],M[M.length-1],_??10)},u.tickFormat=function(_,M){return M==null?v:l(M)},u.nice=function(_){var M=h();return(!_||typeof _.range!="function")&&(_=t(M[0],M[M.length-1],_??10)),_?h(Mp(M,_)):u},u.copy=function(){return _o(u,Rb(e,t,n,r,i,o,s,a,c,l))},u}function kb(){return He.apply(Rb(YS,WS,Un,As,Nr,ri,Is,vs,ln,zu).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $b(){return He.apply(Rb(jS,Lp,Pn,Ts,Or,Jc,Ms,Ss,ln,Mo).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function kp(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ub(){var e=0,t=.5,n=1,r=1,i,o,s,a,c,l=mr,u,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+u(m))-o)*(r*m<r*o?a:c),l(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=u(e=+e),o=u(t=+t),s=u(n=+n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(l=m,d):l};function p(m){return function(y){var g,b,w;return arguments.length?([g,b,w]=y,l=fo(m,[g,b,w]),d):[l(0),l(.5),l(1)]}}return d.range=p(Dr),d.rangeRound=p(kc),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return u=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function $p(){var e=ws(Ub()(mr));return e.copy=function(){return kp(e,$p())},_p.apply(e,arguments)}function Pb(){var e=US(Ub()).domain([.1,1,10]);return e.copy=function(){return kp(e,Pb()).base(e.base())},_p.apply(e,arguments)}function zb(){var e=PS(Ub());return e.copy=function(){return kp(e,zb()).constant(e.constant())},_p.apply(e,arguments)}function qb(){var e=zS(Ub());return e.copy=function(){return kp(e,qb()).exponent(e.exponent())},_p.apply(e,arguments)}function Y(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}var KS=Y("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var QS=Y("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var JS=Y("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var t3=Y("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var e3=Y("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var n3=Y("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var r3=Y("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var i3=Y("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var o3=Y("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var s3=Y("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var a3=Y("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ht=e=>n2(e[e.length-1]);var Vb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Y),jb=ht(Vb);var Yb=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Y),Wb=ht(Yb);var Gb=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Y),Xb=ht(Gb);var Hb=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Y),Zb=ht(Hb);var Up=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Y),qu=ht(Up);var Kb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Y),Qb=ht(Kb);var Pp=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Y),Vu=ht(Pp);var Jb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Y),tx=ht(Jb);var ex=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Y),nx=ht(ex);var rx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Y),ix=ht(rx);var ox=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Y),sx=ht(ox);var ax=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Y),cx=ht(ax);var lx=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Y),ux=ht(lx);var fx=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Y),hx=ht(fx);var dx=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Y),px=ht(dx);var mx=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Y),yx=ht(mx);var gx=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Y),bx=ht(gx);var xx=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Y),wx=ht(xx);var _x=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Y),vx=ht(_x);var Sx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Y),Ix=ht(Sx);var Mx=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Y),Ax=ht(Mx);var Tx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Y),Ex=ht(Tx);var Dx=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Y),Bx=ht(Dx);var Nx=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Y),Ox=ht(Nx);var Lx=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Y),Fx=ht(Lx);var Cx=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Y),Rx=ht(Cx);var kx=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Y),$x=ht(kx);function Ux(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}var Px=gu(Zn(300,.5,0),Zn(-240,.5,1));var qx=gu(Zn(-100,.75,.35),Zn(80,1.5,.8)),Vx=gu(Zn(260,.75,.35),Zn(80,1.5,.8)),zx=Zn();function jx(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return zx.h=360*e-100,zx.s=1.5-1.5*t,zx.l=.8-.9*t,zx+""}var Yx=en(),MV=Math.PI/3,AV=Math.PI*2/3;function Wx(e){var t;return e=(.5-e)*Math.PI,Yx.r=255*(t=Math.sin(e))*t,Yx.g=255*(t=Math.sin(e+MV))*t,Yx.b=255*(t=Math.sin(e+AV))*t,Yx+""}function Gx(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Xx(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var Hx=Xx(Y("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Zx=Xx(Y("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Kx=Xx(Y("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Qx=Xx(Y("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ze(e){return function(){return e}}var c3=Math.cos;var ju=Math.min,zp=Math.sin,ee=Math.sqrt,l3=1e-12,rl=Math.PI,_Mt=rl/2,Yu=2*rl;function Jx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new ga(t)}var MMt=Array.prototype.slice;function t1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eD(e){this._context=e}eD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Es(e){return new eD(e)}function e1(e){return e[0]}function n1(e){return e[1]}function qp(e,t){var n=Ze(!0),r=null,i=Es,o=null,s=Jx(a);e=typeof e=="function"?e:e===void 0?e1:Ze(e),t=typeof t=="function"?t:t===void 0?n1:Ze(t);function a(c){var l,u=(c=t1(c)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,l,c),+t(f,l,c));if(d)return o=null,d+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ze(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ze(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ze(!!c),a):n},a.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),a):i},a.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),a):r},a}function Wu(e,t,n){var r=null,i=Ze(!0),o=null,s=Es,a=null,c=Jx(l);e=typeof e=="function"?e:e===void 0?e1:Ze(+e),t=typeof t=="function"?t:t===void 0?Ze(0):Ze(+t),n=typeof n=="function"?n:n===void 0?n1:Ze(+n);function l(f){var h,d,p,m=(f=t1(f)).length,y,g=!1,b,w=new Array(m),x=new Array(m);for(o==null&&(a=s(b=c())),h=0;h<=m;++h){if(!(h<m&&i(y=f[h],h,f))===g)if(g=!g)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(w[p],x[p]);a.lineEnd(),a.areaEnd()}g&&(w[h]=+e(y,h,f),x[h]=+t(y,h,f),a.point(r?+r(y,h,f):w[h],n?+n(y,h,f):x[h]))}if(b)return a=null,b+""||null}function u(){return qp().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ze(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ze(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ze(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ze(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ze(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ze(+f),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ze(!!f),l):i},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}var r1=class{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}};function u3(e){return new r1(e,!0)}function f3(e){return new r1(e,!1)}var TV=ee(3),Vp={draw(e,t){let n=ee(t+ju(t/28,.75))*.59436,r=n/2,i=r*TV;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}};var Ds={draw(e,t){let n=ee(t/rl);e.moveTo(n,0),e.arc(0,0,n,0,Yu)}};var jp={draw(e,t){let n=ee(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};var nD=ee(1/3),EV=nD*2,Yp={draw(e,t){let n=ee(t/EV),r=n*nD;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}};var Wp={draw(e,t){let n=ee(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}};var Gp={draw(e,t){let n=ee(t-ju(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}};var Xp={draw(e,t){let n=ee(t),r=-n/2;e.rect(r,r,n,n)}};var Hp={draw(e,t){let n=ee(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};var DV=.8908130915292852,rD=zp(rl/10)/zp(7*rl/10),BV=zp(Yu/10)*rD,NV=-c3(Yu/10)*rD,Zp={draw(e,t){let n=ee(t*DV),r=BV*n,i=NV*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){let s=Yu*o/5,a=c3(s),c=zp(s);e.lineTo(c*n,-a*n),e.lineTo(a*r-c*i,c*r+a*i)}e.closePath()}};var h3=ee(3),Kp={draw(e,t){let n=-ee(t/(h3*3));e.moveTo(0,n*2),e.lineTo(-h3*n,-n),e.lineTo(h3*n,-n),e.closePath()}};var OV=ee(3),Qp={draw(e,t){let n=ee(t)*.6824,r=n/2,i=n*OV/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};var ii=-.5,oi=ee(3)/2,d3=1/ee(12),LV=(d3/2+1)*3,Jp={draw(e,t){let n=ee(t/LV),r=n/2,i=n*d3,o=r,s=n*d3+n,a=-o,c=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,c),e.lineTo(ii*r-oi*i,oi*r+ii*i),e.lineTo(ii*o-oi*s,oi*o+ii*s),e.lineTo(ii*a-oi*c,oi*a+ii*c),e.lineTo(ii*r+oi*i,ii*i-oi*r),e.lineTo(ii*o+oi*s,ii*s-oi*o),e.lineTo(ii*a+oi*c,ii*c-oi*a),e.closePath()}};var Gu={draw(e,t){let n=ee(t-ju(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};var i1=[Ds,jp,Yp,Xp,Zp,Kp,Jp],p3=[Ds,Gp,Gu,Qp,Vp,Hp,Wp];function si(){}function Xu(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function tm(e){this._context=e}tm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Xu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Xu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m3(e){return new tm(e)}function iD(e){this._context=e}iD.prototype={areaStart:si,areaEnd:si,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Xu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y3(e){return new iD(e)}function oD(e){this._context=e}oD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Xu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function g3(e){return new oD(e)}function sD(e,t){this._basis=new tm(e),this._beta=t}sD.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+c*o),this._beta*t[a]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var b3=function e(t){function n(r){return t===1?new tm(r):new sD(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Hu(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function o1(e,t){this._context=e,this._k=(1-t)/6}o1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Hu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var x3=function e(t){function n(r){return new o1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function s1(e,t){this._context=e,this._k=(1-t)/6}s1.prototype={areaStart:si,areaEnd:si,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var w3=function e(t){function n(r){return new s1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function a1(e,t){this._context=e,this._k=(1-t)/6}a1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _3=function e(t){function n(r){return new a1(r,t)}return n.tension=function(r){return e(+r)},n}(0);function em(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>l3){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>l3){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function aD(e,t){this._context=e,this._alpha=t}aD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:em(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var v3=function e(t){function n(r){return t?new aD(r,t):new o1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cD(e,t){this._context=e,this._alpha=t}cD.prototype={areaStart:si,areaEnd:si,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:em(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var S3=function e(t){function n(r){return t?new cD(r,t):new s1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lD(e,t){this._context=e,this._alpha=t}lD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:em(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var I3=function e(t){function n(r){return t?new lD(r,t):new a1(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uD(e){this._context=e}uD.prototype={areaStart:si,areaEnd:si,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function M3(e){return new uD(e)}function fD(e){return e<0?-1:1}function hD(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(fD(o)+fD(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function dD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function A3(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function c1(e){this._context=e}c1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:A3(this,this._t0,dD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,A3(this,dD(this,n=hD(this,e,t)),n);break;default:A3(this,this._t0,n=hD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function pD(e){this._context=new mD(e)}(pD.prototype=Object.create(c1.prototype)).point=function(e,t){c1.prototype.point.call(this,t,e)};function mD(e){this._context=e}mD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function T3(e){return new c1(e)}function E3(e){return new pD(e)}function gD(e){this._context=e}gD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=yD(e),i=yD(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function yD(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function D3(e){return new gD(e)}function l1(e,t){this._context=e,this._t=t}l1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function B3(e){return new l1(e,.5)}function N3(e){return new l1(e,0)}function O3(e){return new l1(e,1)}var nm=e=>()=>e;function L3(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Lr(e,t,n){this.k=e,this.x=t,this.y=n}Lr.prototype={constructor:Lr,scale:function(e){return e===1?this:new Lr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Lr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rm=new Lr(1,0,0);F3.prototype=Lr.prototype;function F3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rm;return e.__zoom}function u1(e){e.stopImmediatePropagation()}function Zu(e){e.preventDefault(),e.stopImmediatePropagation()}function FV(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function CV(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function bD(){return this.__zoom||rm}function RV(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function kV(){return navigator.maxTouchPoints||"ontouchstart"in this}function $V(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function C3(){var e=FV,t=CV,n=$V,r=RV,i=kV,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=c2,l=Nc("start","zoom","end"),u,f,h,d=500,p=150,m=0,y=10;function g(S){S.property("__zoom",bD).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",I).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,A,D,C){var R=S.selection?S.selection():S;R.property("__zoom",bD),S!==R?v(S,A,D,C):R.interrupt().each(function(){_(this,arguments).event(C).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},g.scaleBy=function(S,A,D,C){g.scaleTo(S,function(){var R=this.__zoom.k,F=typeof A=="function"?A.apply(this,arguments):A;return R*F},D,C)},g.scaleTo=function(S,A,D,C){g.transform(S,function(){var R=t.apply(this,arguments),F=this.__zoom,k=D==null?x(R):typeof D=="function"?D.apply(this,arguments):D,$=F.invert(k),U=typeof A=="function"?A.apply(this,arguments):A;return n(w(b(F,U),k,$),R,s)},D,C)},g.translateBy=function(S,A,D,C){g.transform(S,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,C)},g.translateTo=function(S,A,D,C,R){g.transform(S,function(){var F=t.apply(this,arguments),k=this.__zoom,$=C==null?x(F):typeof C=="function"?C.apply(this,arguments):C;return n(rm.translate($[0],$[1]).scale(k.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof D=="function"?-D.apply(this,arguments):-D),F,s)},C,R)};function b(S,A){return A=Math.max(o[0],Math.min(o[1],A)),A===S.k?S:new Lr(A,S.x,S.y)}function w(S,A,D){var C=A[0]-D[0]*S.k,R=A[1]-D[1]*S.k;return C===S.x&&R===S.y?S:new Lr(S.k,C,R)}function x(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,A,D,C){S.on("start.zoom",function(){_(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(C).end()}).tween("zoom",function(){var R=this,F=arguments,k=_(R,F).event(C),$=t.apply(R,F),U=D==null?x($):typeof D=="function"?D.apply(R,F):D,W=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),et=R.__zoom,rt=typeof A=="function"?A.apply(R,F):A,st=c(et.invert(U).concat(W/et.k),rt.invert(U).concat(W/rt.k));return function(j){if(j===1)j=rt;else{var ot=st(j),z=W/ot[2];j=new Lr(z,U[0]-ot[0]*z,U[1]-ot[1]*z)}k.zoom(null,j)}})}function _(S,A,D){return!D&&S.__zooming||new M(S,A)}function M(S,A){this.that=S,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,A),this.taps=0}M.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,A){return this.mouse&&S!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var A=Pt(this.that).datum();l.call(S,this.that,new L3(S,{sourceEvent:this.sourceEvent,target:g,type:S,transform:this.that.__zoom,dispatch:l}),A)}};function E(S,...A){if(!e.apply(this,arguments))return;var D=_(this,A).event(S),C=this.__zoom,R=Math.max(o[0],Math.min(o[1],C.k*Math.pow(2,r.apply(this,arguments)))),F=Fn(S);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=C.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(C.k===R)return;D.mouse=[F,C.invert(F)],ho(this),D.start()}Zu(S),D.wheel=setTimeout(k,p),D.zoom("mouse",n(w(b(C,R),D.mouse[0],D.mouse[1]),D.extent,s));function k(){D.wheel=null,D.end()}}function T(S,...A){if(h||!e.apply(this,arguments))return;var D=S.currentTarget,C=_(this,A,!0).event(S),R=Pt(S.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",W,!0),F=Fn(S,D),k=S.clientX,$=S.clientY;Ld(S.view),u1(S),C.mouse=[F,this.__zoom.invert(F)],ho(this),C.start();function U(et){if(Zu(et),!C.moved){var rt=et.clientX-k,st=et.clientY-$;C.moved=rt*rt+st*st>m}C.event(et).zoom("mouse",n(w(C.that.__zoom,C.mouse[0]=Fn(et,D),C.mouse[1]),C.extent,s))}function W(et){R.on("mousemove.zoom mouseup.zoom",null),Fd(et.view,C.moved),Zu(et),C.event(et).end()}}function B(S,...A){if(e.apply(this,arguments)){var D=this.__zoom,C=Fn(S.changedTouches?S.changedTouches[0]:S,this),R=D.invert(C),F=D.k*(S.shiftKey?.5:2),k=n(w(b(D,F),C,R),t.apply(this,A),s);Zu(S),a>0?Pt(this).transition().duration(a).call(v,k,C,S):Pt(this).call(g.transform,k,C,S)}}function I(S,...A){if(e.apply(this,arguments)){var D=S.touches,C=D.length,R=_(this,A,S.changedTouches.length===C).event(S),F,k,$,U;for(u1(S),k=0;k<C;++k)$=D[k],U=Fn($,this),U=[U,this.__zoom.invert(U),$.identifier],R.touch0?!R.touch1&&R.touch0[2]!==U[2]&&(R.touch1=U,R.taps=0):(R.touch0=U,F=!0,R.taps=1+!!u);u&&(u=clearTimeout(u)),F&&(R.taps<2&&(f=U[0],u=setTimeout(function(){u=null},d)),ho(this),R.start())}}function N(S,...A){if(this.__zooming){var D=_(this,A).event(S),C=S.changedTouches,R=C.length,F,k,$,U;for(Zu(S),F=0;F<R;++F)k=C[F],$=Fn(k,this),D.touch0&&D.touch0[2]===k.identifier?D.touch0[0]=$:D.touch1&&D.touch1[2]===k.identifier&&(D.touch1[0]=$);if(k=D.that.__zoom,D.touch1){var W=D.touch0[0],et=D.touch0[1],rt=D.touch1[0],st=D.touch1[1],j=(j=rt[0]-W[0])*j+(j=rt[1]-W[1])*j,ot=(ot=st[0]-et[0])*ot+(ot=st[1]-et[1])*ot;k=b(k,Math.sqrt(j/ot)),$=[(W[0]+rt[0])/2,(W[1]+rt[1])/2],U=[(et[0]+st[0])/2,(et[1]+st[1])/2]}else if(D.touch0)$=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(w(k,$,U),D.extent,s))}}function O(S,...A){if(this.__zooming){var D=_(this,A).event(S),C=S.changedTouches,R=C.length,F,k;for(u1(S),h&&clearTimeout(h),h=setTimeout(function(){h=null},d),F=0;F<R;++F)k=C[F],D.touch0&&D.touch0[2]===k.identifier?delete D.touch0:D.touch1&&D.touch1[2]===k.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(k=Fn(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<y)){var $=Pt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return g.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:nm(+S),g):r},g.filter=function(S){return arguments.length?(e=typeof S=="function"?S:nm(!!S),g):e},g.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:nm(!!S),g):i},g.extent=function(S){return arguments.length?(t=typeof S=="function"?S:nm([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),g):t},g.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],g):[o[0],o[1]]},g.translateExtent=function(S){return arguments.length?(s[0][0]=+S[0][0],s[1][0]=+S[1][0],s[0][1]=+S[0][1],s[1][1]=+S[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(S){return arguments.length?(n=S,g):n},g.duration=function(S){return arguments.length?(a=+S,g):a},g.interpolate=function(S){return arguments.length?(c=S,g):c},g.on=function(){var S=l.on.apply(l,arguments);return S===l?g:S},g.clickDistance=function(S){return arguments.length?(m=(S=+S)*S,g):Math.sqrt(m)},g.tapDistance=function(S){return arguments.length?(y=+S,g):y},g}function $e(e){return e!=null&&!Number.isNaN(e)}function fn(e,t){return+$e(t)-+$e(e)||Et(e,t)}function il(e,t){return+$e(t)-+$e(e)||Wn(e,t)}function im(e){return e!=null&&`${e}`!=""}function Ku(e){return isFinite(e)?e:NaN}function rr(e){return e>0&&isFinite(e)?e:NaN}function Aa(e){return e<0&&isFinite(e)?e:NaN}function f1(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return typeof t=="function"?t(e):t;let n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${UV(e.getUTCFullYear(),4)}-${Bs(e.getUTCMonth()+1,2)}-${Bs(e.getUTCDate(),2)}${n||r||i||o?`T${Bs(n,2)}:${Bs(r,2)}${i||o?`:${Bs(i,2)}${o?`.${Bs(o,3)}`:""}`:""}Z`:""}`}function UV(e){return e<0?`-${Bs(-e,6)}`:e>9999?`+${Bs(e,6)}`:Bs(e,4)}function Bs(e,t){return`${e}`.padStart(t,"0")}var PV=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function om(e,t){return PV.test(e+="")?new Date(e):typeof t=="function"?t(e):t}function Ns(e){if(e==null)return;let t=e[0],n=e[e.length-1];return Wn(t,n)}var Ju=1e3,Ea=Ju*60,Da=Ea*60,To=Da*24,Ao=To*7,ol=To*30,Ta=To*365,R3=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",Ju],["5 seconds",5*Ju],["15 seconds",15*Ju],["30 seconds",30*Ju],["minute",Ea],["5 minutes",5*Ea],["15 minutes",15*Ea],["30 minutes",30*Ea],["hour",Da],["3 hours",3*Da],["6 hours",6*Da],["12 hours",12*Da],["day",To],["2 days",2*To],["week",Ao],["2 weeks",2*Ao],["month",ol],["3 months",3*ol],["6 months",6*ol],["year",Ta],["2 years",2*Ta],["5 years",5*Ta],["10 years",10*Ta],["20 years",20*Ta],["50 years",50*Ta],["100 years",100*Ta]],k3=new Map([["second",Ju],["minute",Ea],["hour",Da],["day",To],["monday",Ao],["tuesday",Ao],["wednesday",Ao],["thursday",Ao],["friday",Ao],["saturday",Ao],["sunday",Ao],["week",Ao],["month",ol],["year",Ta]]),wD=new Map([["second",ln],["minute",vs],["hour",Is],["day",ri],["monday",Ia],["tuesday",Eb],["wednesday",Db],["thursday",So],["friday",Bb],["saturday",Nb],["sunday",Nr],["week",Nr],["month",As],["year",Un]]),$3=new Map([["second",ln],["minute",Ss],["hour",Ms],["day",tl],["monday",Ma],["tuesday",Ob],["wednesday",Lb],["thursday",Io],["friday",Fb],["saturday",Cb],["sunday",Or],["week",Or],["month",Ts],["year",Pn]]),tf=Symbol("intervalDuration"),d1=Symbol("intervalType");for(let[e,t]of wD)t[tf]=k3.get(e),t[d1]="time";for(let[e,t]of $3)t[tf]=k3.get(e),t[d1]="utc";var sm=[["year",Pn,"utc"],["month",Ts,"utc"],["day",tl,"utc",6*ol],["hour",Ms,"utc",3*To],["minute",Ss,"utc",6*Da],["second",ln,"utc",30*Ea]],h1=[["year",Un,"time"],["month",As,"time"],["day",ri,"time",6*ol],["hour",Is,"time",3*To],["minute",vs,"time",6*Da],["second",ln,"time",30*Ea]],zV=[sm[0],h1[0],sm[1],h1[1],sm[2],h1[2],...sm.slice(3)];function p1(e){let t=`${e}`.toLowerCase();t.endsWith("s")&&(t=t.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(t);switch(r&&(t=t.slice(r[0].length),n=+r[1]),t){case"quarter":t="month",n*=3;break;case"half":t="month",n*=6;break}let i=$3.get(t);if(!i)throw new Error(`unknown interval: ${e}`);if(n>1&&!i.every)throw new Error(`non-periodic interval: ${t}`);return[t,n]}function am(e){return _D(p1(e),"time")}function sl(e){return _D(p1(e),"utc")}function _D([e,t],n){let r=(n==="time"?wD:$3).get(e);return t>1&&(r=r.every(t),r[tf]=k3.get(e)*t,r[d1]=n),r}function U3(e,t){if(!(t>1))return;let n=e[tf];if(!R3.some(([,i])=>i===n)||n%To===0&&To<n&&n<ol)return;let[r]=R3[Ti(([,i])=>Math.log(i)).center(R3,Math.log(n*t))];return(e[d1]==="time"?am:sl)(r)}function xD(e,t,n){let r=t==="time"?zu:Mo;if(n==null)return r(e==="year"?"%Y":e==="month"?"%Y-%m":e==="day"?"%Y-%m-%d":e==="hour"||e==="minute"?"%Y-%m-%dT%H:%M":e==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let i=qV(n);switch(e){case"millisecond":return Qu(r(".%L"),r(":%M:%S"),i);case"second":return Qu(r(":%S"),r("%-I:%M"),i);case"minute":return Qu(r("%-I:%M"),r("%p"),i);case"hour":return Qu(r("%-I %p"),r("%b %-d"),i);case"day":return Qu(r("%-d"),r("%b"),i);case"month":return Qu(r("%b"),r("%Y"),i);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function qV(e){return e==="left"||e==="right"?(t,n)=>`
|
|
12
|
-
${t}
|
|
13
|
-
${n}`:e==="top"?(t,n)=>`${n}
|
|
14
|
-
${t}`:(t,n)=>`${t}
|
|
15
|
-
${n}`}function VV(e){return e==="time"?h1:e==="utc"?sm:zV}function vD(e,t,n){let r=Xt(ag(t,(i,o)=>Math.abs(o-i)));if(r<1e3)return xD("millisecond","utc",n);for(let[i,o,s,a]of VV(e)){if(r>a||i==="hour"&&!r)break;if(t.every(c=>o.floor(c)>=c))return xD(i,s,n)}}function Qu(e,t,n){return(r,i,o)=>{let s=e(r,i),a=t(r,i),c=i-Ns(o);return i!==c&&o[c]!==void 0&&a===t(o[c],c)?s:n(s,a)}}var al=Object.getPrototypeOf(Uint8Array),jV=Object.prototype.toString,P3=Symbol("reindex");function bt(e,t,n){let r=typeof t;return r==="string"?SD(e,z3(t),n):r==="function"?SD(e,t,n):r==="number"||t instanceof Date||r==="boolean"?Yt(e,hn(t),n):typeof t?.transform=="function"?ID(t.transform(e),n):YV(ID(t,n),e?.[P3])}function YV(e,t){return e!=null&&t?lm(e,t):e}function SD(e,t,n){return Yt(e,n?.prototype instanceof al?WV(t):t,n)}function ID(e,t){return t===void 0?Pe(e):e instanceof t?e:t.prototype instanceof al&&!(e instanceof al)?t.from(e,q3):t.from(e)}function WV(e){return(t,n)=>q3(e(t,n))}var Ba=[null],z3=e=>t=>t[e],Ae={transform:ir},X={transform:e=>e};var cm=()=>1,MD=()=>!0,Ue=e=>e==null?e:`${e}`,Bt=e=>e==null?e:+e;var cl=e=>e?e[0]:void 0,Na=e=>e?e[1]:void 0,AD=e=>e?e[2]:void 0,hn=e=>()=>e;function ef(e){let t=+`${e}`.slice(1)/100;return(n,r)=>Hn(n,t,r)}function Ke(e){return e instanceof al?e:Yt(e,q3,Float64Array)}function q3(e){return e==null?NaN:Number(e)}function TD(e){return Yt(e,V3)}function V3(e){return e instanceof Date&&!isNaN(e)?e:typeof e=="string"?om(e):e==null||isNaN(e=+e)?void 0:new Date(e)}function De(e,t){return e===void 0&&(e=t),e===null?[void 0,"none"]:Fa(e)?[void 0,e]:[e,void 0]}function oe(e,t){return e===void 0&&(e=t),e===null||typeof e=="number"?[void 0,e]:[e,void 0]}function j3(e,t,n){if(e!=null)return rn(e,t,n)}function rn(e,t,n){let r=`${e}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${t}: ${e}`);return r}function Pe(e){return e==null||e instanceof Array||e instanceof al?e:Array.from(e)}function Yt(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Oa(e,t=Array){return e instanceof t?e.slice():t.from(e)}function Y3({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function W3({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function nf(e){return Y3(e)||W3(e)||e.interval!==void 0}function dn(e){return e?.toString===jV}function Eo(e){return dn(e)&&(e.type!==void 0||e.domain!==void 0)}function Fr(e){return dn(e)&&typeof e.transform!="function"}function Do(e){return Fr(e)&&e.value===void 0&&e.channel===void 0}function G3(e,t,n,r=X){return t===void 0&&n===void 0?(t=0,n=e===void 0?r:e):t===void 0?t=e===void 0?0:e:n===void 0&&(n=e===void 0?0:e),[t,n]}function Ce(e,t){return e===void 0&&t===void 0?[cl,Na]:[e,t]}function zn({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=De(t)),e===void 0&&([e]=De(n)),e}function ir(e){let t=e.length,n=new Uint32Array(t);for(let r=0;r<t;++r)n[r]=r;return n}function lm(e,t){return Yt(t,n=>e[n],e.constructor)}function rf(e){return e.length===1?(t,n)=>e(lm(n,t)):e}function Os(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Ls(e){return e!==null&&typeof e=="object"?e.valueOf():e}function m1(e,t){if(t[e]!==void 0)return t[e];switch(e){case"x1":case"x2":e="x";break;case"y1":case"y2":e="y";break}return t[e]}function pn(e){let t;return[{transform:()=>t,label:Bn(e)},n=>t=n]}function Dn(e){return e==null?[e]:pn(e)}function Bn(e,t){return typeof e=="string"?e:e&&e.label!==void 0?e.label:t}function of(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return Be(r)||Be(i)?Yt(r,(o,s)=>new Date((+r[s]+ +i[s])/2)):Yt(r,(o,s)=>(+r[s]+ +i[s])/2,Float64Array)},label:e.label}}function ll(e,t){let n=X3(t?.interval,t?.type);return n?Yt(e,n):e}function X3(e,t){let n=sf(e,t);return n&&(r=>$e(r)?n.floor(r):r)}function sf(e,t){if(e!=null){if(typeof e=="number")return H3(e);if(typeof e=="string")return(t==="time"?am:sl)(e);if(typeof e.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof e.offset!="function")throw new Error("invalid interval; missing offset method");return e}}function H3(e){e=+e,0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let t=Math.abs(e);return e<0?{floor:n=>Math.floor(n*t)/t,offset:(n,r=1)=>(n*t+Math.floor(r))/t,range:(n,r)=>ke(Math.ceil(n*t),r*t).map(i=>i/t)}:{floor:n=>Math.floor(n/t)*t,offset:(n,r=1)=>n+t*Math.floor(r),range:(n,r)=>ke(Math.ceil(n/t),r/t).map(i=>i*t)}}function Bo(e,t){if(e=sf(e,t),e&&typeof e.range!="function")throw new Error("invalid interval: missing range method");return e}function ED(e,t){if(e=Bo(e,t),e&&typeof e.ceil!="function")throw new Error("invalid interval: missing ceil method");return e}function DD(e){return La(e)&&typeof e?.floor=="function"&&e.floor()instanceof Date}function La(e){return typeof e?.range=="function"}function ai(e){return e===void 0||Fr(e)?e:{value:e}}function BD(e){return e==null?null:{transform:t=>bt(t,e,Float64Array),label:Bn(e)}}function ND(e){if(!or(e))return!1;for(let t of e)if(t!=null)return typeof t=="object"&&"0"in t&&"1"in t}function or(e){return e&&typeof e[Symbol.iterator]=="function"}function y1(e){for(let t of e)if(t!=null)return typeof t!="object"||t instanceof Date}function Te(e){for(let t of e){if(t==null)continue;let n=typeof t;return n==="string"||n==="boolean"}}function Be(e){for(let t of e)if(t!=null)return t instanceof Date}function OD(e){for(let t of e)if(t!=null)return typeof t=="string"&&isNaN(t)&&om(t)}function LD(e){for(let t of e)if(t!=null){if(typeof t!="string")return!1;if(t.trim())return!isNaN(t)}}function Fs(e){for(let t of e)if(t!=null)return typeof t=="number"}function g1(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}var GV=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function Fa(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(e)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(e)||GV.has(e))}function FD(e){return typeof e=="number"&&(0<=e&&e<=1||isNaN(e))}function ne(e){return e==null||Cs(e)}function Cs(e){return/^\s*none\s*$/i.test(e)}function CD(e){return/^\s*round\s*$/i.test(e)}function b1(e,t){return j3(e,t,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function No(e="middle"){return b1(e,"frameAnchor")}function RD(e={},...t){let n=e;for(let r of t)for(let i in r)if(n[i]===void 0){let o=r[i];n===e?n={...n,[i]:o}:n[i]=o}return n}function XV(e){console.warn("named iterables are deprecated; please use an object instead");let t=new Set;return Object.fromEntries(Array.from(e,n=>{let{name:r}=n;if(r==null)throw new Error("missing name");let i=`${r}`;if(i==="__proto__")throw new Error(`illegal name: ${i}`);if(t.has(i))throw new Error(`duplicate name: ${i}`);return t.add(i),[r,n]}))}function um(e){return or(e)?XV(e):e}function x1(e){return e===!0?e="frame":e===!1?e=null:e!=null&&(e=rn(e,"clip",["frame","sphere"])),e}var ci=Symbol("position"),Cr=Symbol("color"),ul=Symbol("radius"),fl=Symbol("length"),hl=Symbol("opacity"),af=Symbol("symbol"),kD=Symbol("projection"),fe=new Map([["x",ci],["y",ci],["fx",ci],["fy",ci],["r",ul],["color",Cr],["opacity",hl],["symbol",af],["length",fl],["projection",kD]]);function $D(e){return e===ci||e===kD}function UD(e){return e===ci||e===ul||e===fl||e===hl}var Z3=Math.sqrt(3),K3=2/Z3,HV={draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*K3,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}},Q3=new Map([["asterisk",Vp],["circle",Ds],["cross",jp],["diamond",Yp],["diamond2",Wp],["hexagon",HV],["plus",Gp],["square",Xp],["square2",Hp],["star",Zp],["times",Gu],["triangle",Kp],["triangle2",Qp],["wye",Jp]]);function J3(e){return e&&typeof e.draw=="function"}function PD(e){return J3(e)?!0:typeof e!="string"?!1:Q3.has(e.toLowerCase())}function cf(e){if(e==null||J3(e))return e;let t=Q3.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid symbol: ${e}`)}function zD(e){if(e==null||J3(e))return[void 0,e];if(typeof e=="string"){let t=Q3.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function mn({filter:e,sort:t,reverse:n,transform:r,initializer:i,...o}={},s){if(r===void 0&&(e!=null&&(r=nI(e)),t!=null&&!Do(t)&&(r=tI(r,iI(t))),n&&(r=tI(r,rI))),s!=null&&i!=null)throw new Error("transforms cannot be applied after initializers");return{...o,...(t===null||Do(t))&&{sort:t},transform:tI(r,s)}}function Se({filter:e,sort:t,reverse:n,initializer:r,...i}={},o){return r===void 0&&(e!=null&&(r=nI(e)),t!=null&&!Do(t)&&(r=eI(r,iI(t))),n&&(r=eI(r,rI))),{...i,...(t===null||Do(t))&&{sort:t},initializer:eI(r,o)}}function tI(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i){return{data:n,facets:r}=e.call(this,n,r,i),t.call(this,Pe(n),r,i)}}function eI(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i,...o){let s,a,c,l,u,f;return{data:a=n,facets:c=r,channels:s}=e.call(this,n,r,i,...o),{data:u=a,facets:f=c,channels:l}=t.call(this,a,c,{...i,...s},...o),{data:u,facets:f,channels:{...s,...l}}}}function w1(e,t){return(e.initializer!=null?Se:mn)(e,t)}function qD(e,t){return w1(t,nI(e))}function nI(e){return(t,n)=>{let r=bt(t,e);return{data:t,facets:n.map(i=>i.filter(o=>r[o]))}}}function VD({sort:e,...t}={}){return{...w1(t,rI),sort:Do(e)?e:null}}function rI(e,t){return{data:e,facets:t.map(n=>n.slice().reverse())}}function jD({seed:e,sort:t,...n}={}){return{...w1(n,YD(e==null?Math.random:Xc(e))),sort:Do(t)?t:null}}function _1(e,{sort:t,...n}={}){return{...(Fr(e)&&e.channel!==void 0?Se:w1)(n,iI(e)),sort:Do(t)?t:null}}function iI(e){return(typeof e=="function"&&e.length!==1?ZV:YD)(e)}function ZV(e){return(t,n)=>{let r=(i,o)=>e(t[i],t[o]);return{data:t,facets:n.map(i=>i.slice().sort(r))}}}function YD(e){let t,n;({channel:t,value:e,order:n}={...ai(e)});let r=t?.startsWith("-");if(r&&(t=t.slice(1)),n===void 0&&(n=r?il:fn),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=fn;break;case"descending":n=il;break;default:throw new Error(`invalid order: ${n}`)}return(i,o,s)=>{let a;if(t===void 0)a=bt(i,e);else{if(s===void 0)throw new Error("channel sort requires an initializer");if(a=s[t],!a)return{};a=a.value}let c=(l,u)=>n(a[l],a[u]);return{data:i,facets:o.map(l=>l.slice().sort(c))}}}function hm(e,t){return v1(null,null,e,t)}function Ra(e={y:"count"},t={}){let{x:n=X}=t;if(n==null)throw new Error("missing channel: x");return v1(n,null,e,t)}function ka(e={x:"count"},t={}){let{y:n=X}=t;if(n==null)throw new Error("missing channel: y");return v1(null,n,e,t)}function dm(e={fill:"count"},t={}){let{x:n,y:r}=t;if([n,r]=Ce(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return v1(n,r,e,t)}function v1(e,t,{data:n=M1,filter:r,sort:i,reverse:o,...s}={},a={}){s=sI(s,a),n=ZD(n,X),i=i==null?void 0:XD("sort",i,a),r=r==null?void 0:HD("filter",r,a);let[c,l]=Dn(e),[u,f]=Dn(t),{z:h,fill:d,stroke:p,x1:m,x2:y,y1:g,y2:b,...w}=a,[x,v]=Dn(h),[_]=De(d),[M]=De(p),[E,T]=Dn(_),[B,I]=Dn(M);return{..."z"in a&&{z:x||h},..."fill"in a&&{fill:E||d},..."stroke"in a&&{stroke:B||p},...mn(w,(N,O,S)=>{let A=ll(bt(N,e),S?.x),D=ll(bt(N,t),S?.y),C=bt(N,h),R=bt(N,_),F=bt(N,M),k=pm(s,{z:C,fill:R,stroke:F}),$=[],U=[],W=A&&l([]),et=D&&f([]),rt=C&&v([]),st=R&&T([]),j=F&&I([]),ot=0;for(let z of s)z.initialize(N);i&&i.initialize(N),r&&r.initialize(N);for(let z of O){let H=[];for(let nt of s)nt.scope("facet",z);i&&i.scope("facet",z),r&&r.scope("facet",z);for(let[nt,P]of Ca(z,k))for(let[Lt,ft]of Ca(P,D))for(let[Wt,Ht]of Ca(ft,A)){let J={data:N};if(A&&(J.x=Wt),D&&(J.y=Lt),k&&(J.z=nt),!(r&&!r.reduce(Ht,J))){H.push(ot++),U.push(n.reduceIndex(Ht,N,J)),A&&W.push(Wt),D&&et.push(Lt),C&&rt.push(k===C?nt:C[Ht[0]]),R&&st.push(k===R?nt:R[Ht[0]]),F&&j.push(k===F?nt:F[Ht[0]]);for(let se of s)se.reduce(Ht,J);i&&i.reduce(Ht,J)}}$.push(H)}return aI($,i,o),{data:U,facets:$}}),...!Oo(s,"x")&&(c?{x:c}:{x1:m,x2:y}),...!Oo(s,"y")&&(u?{y:u}:{y1:g,y2:b}),...Object.fromEntries(s.map(({name:N,output:O})=>[N,O]))}}function Oo(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function oI(e,t,n=S1){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push(["title",nj]),t.href!=null&&e.href===void 0&&r.push(["href",A1]),r.filter(([,i])=>i!==void 0).map(([i,o])=>o===null?KV(i):n(i,o,t))}function S1(e,t,n,r=I1){let i;dn(t)&&"reduce"in t&&(i=t.scale,t=t.reduce);let o=r(e,t,n),[s,a]=pn(o.label),c;return{name:e,output:i===void 0?s:{value:s,scale:i},initialize(l){o.initialize(l),c=a([])},scope(l,u){o.scope(l,u)},reduce(l,u){c.push(o.reduce(l,u))}}}function KV(e){return{name:e,initialize(){},scope(){},reduce(){}}}function I1(e,t,n,r=lf){let i=m1(e,n),o=r(t,i),s,a;return{label:Bn(o===fm?null:i,o.label),initialize(c){s=i===void 0?c:bt(c,i),o.scope==="data"&&(a=o.reduceIndex(ir(c),s))},scope(c,l){o.scope===c&&(a=o.reduceIndex(l,s))},reduce(c,l){return o.scope==null?o.reduceIndex(c,s,l):o.reduceIndex(c,s,a,l)}}}function Ca(e,t){return t?an(e,n=>t[n]):[[,e]]}function lf(e,t,n=QV){if(e==null)return n(e);if(typeof e.reduceIndex=="function")return e;if(typeof e.reduce=="function"&&dn(e))return tj(e);if(typeof e=="function")return ej(e);if(/^p\d{2}$/i.test(e))return Rs(ef(e));switch(`${e}`.toLowerCase()){case"first":return A1;case"last":return rj;case"identity":return M1;case"count":return fm;case"distinct":return ij;case"sum":return t==null?fm:oj;case"proportion":return GD(t,"data");case"proportion-facet":return GD(t,"facet");case"deviation":return Rs(Zr);case"min":return Rs(le);case"min-index":return Rs(ig);case"max":return Rs(Xt);case"max-index":return Rs(rg);case"mean":return WD(fs);case"median":return WD(Di);case"variance":return Rs(ua);case"mode":return Rs(fu)}return n(e)}function QV(e){throw new Error(`invalid reduce: ${e}`)}function sI(e,t){return oI(e,t,XD)}function XD(e,t,n){return S1(e,t,n,HD)}function HD(e,t,n){return I1(e,t,n,ZD)}function ZD(e,t){return lf(e,t,JV)}function JV(e){switch(`${e}`.toLowerCase()){case"x":return sj;case"y":return aj;case"z":return cI}throw new Error(`invalid group reduce: ${e}`)}function pm(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(i=>i.name===n))return r}}function aI(e,t,n){if(t){let r=t.output.transform(),i=(o,s)=>fn(r[o],r[s]);e.forEach(o=>o.sort(i))}n&&e.forEach(r=>r.reverse())}function tj(e){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...e,reduceIndex:e.reduce.bind(e)}}function ej(e){return{reduceIndex(t,n,r){return e(lm(n,t),r)}}}function Rs(e){return{reduceIndex(t,n){return e(t,r=>n[r])}}}function WD(e){return{reduceIndex(t,n){let r=e(t,i=>n[i]);return Be(n)?new Date(r):r}}}var M1={reduceIndex(e,t){return lm(t,e)}},A1={reduceIndex(e,t){return t[e[0]]}},nj={reduceIndex(e,t){let r=ls(Ei(e,o=>o.length,o=>t[o]),Na),i=r.slice(-5).reverse();if(i.length<r.length){let o=r.slice(0,-4);i[4]=[`\u2026 ${o.length.toLocaleString("en-US")} more`,Mn(o,Na)]}return i.map(([o,s])=>`${o} (${s.toLocaleString("en-US")})`).join(`
|
|
16
|
-
`)}},rj={reduceIndex(e,t){return t[e[e.length-1]]}},fm={label:"Frequency",reduceIndex(e){return e.length}},ij={label:"Distinct",reduceIndex(e,t){let n=new Xn;for(let r of e)n.add(t[r]);return n.size}},oj=Rs(Mn);function GD(e,t){return e==null?{scope:t,label:"Frequency",reduceIndex:(n,r,i=1)=>n.length/i}:{scope:t,reduceIndex:(n,r,i=1)=>Mn(n,o=>r[o])/i}}var sj={reduceIndex(e,t,{x:n}){return n}},aj={reduceIndex(e,t,{y:n}){return n}},cI={reduceIndex(e,t,{z:n}){return n}};function KD(e){if(typeof e!="function")throw new Error(`invalid test function: ${e}`);return{reduceIndex(t,n,{data:r}){return n[t.find(i=>e(r[i],i,r))]}}}function uf(e,{scale:t,type:n,value:r,filter:i,hint:o,label:s=Bn(r)},a){return o===void 0&&typeof r?.transform=="function"&&(o=r.hint),uI(a,{scale:t,type:n,value:bt(e,r),label:s,filter:i,hint:o})}function T1(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,uf(t,r,n)]))}function ff(e,t){let n=Object.fromEntries(Object.entries(e).map(([r,{scale:i,value:o}])=>{let s=i==null?null:t[i];return[r,s==null?o:Yt(o,s)]}));return n.channels=e,n}function uI(e,t){let{scale:n,value:r}=t;if(n===!0||n==="auto")switch(e){case"fill":case"stroke":case"color":t.scale=n!==!0&&g1(r,Fa)?null:"color";break;case"fillOpacity":case"strokeOpacity":case"opacity":t.scale=n!==!0&&g1(r,FD)?null:"opacity";break;case"symbol":n!==!0&&g1(r,PD)?(t.scale=null,t.value=Yt(r,cf)):t.scale="symbol";break;default:t.scale=fe.has(e)?e:null;break}else if(n===!1)t.scale=null;else if(n!=null&&!fe.has(n))throw new Error(`unknown scale: ${n}`);return t}function JD(e,t,n,r,i){let{order:o,reverse:s,reduce:a=!0,limit:c}=i;for(let l in i){if(!fe.has(l))continue;let{value:u,order:f=o,reverse:h=s,reduce:d=a,limit:p=c}=ai(i[l]),m=u?.startsWith("-");if(m&&(u=u.slice(1)),f=f===void 0?m!==(u==="width"||u==="height")?eB:tB:uj(f),d==null||d===!1)continue;let y=l==="fx"||l==="fy"?lj(t,r[l]):cj(n,l);if(!y)throw new Error(`missing channel for scale: ${l}`);let g=y.value,[b=0,w=1/0]=or(p)?p:p<0?[p]:[0,p];if(u==null)y.domain=()=>{let x=Array.from(new Xn(g));return h&&(x=x.reverse()),(b!==0||w!==1/0)&&(x=x.slice(b,w)),x};else{let x=u==="data"?e:u==="height"?QD(n,"y1","y2"):u==="width"?QD(n,"x1","x2"):lI(n,u,u==="y"?"y2":u==="x"?"x2":void 0),v=lf(d===!0?"max":d,x);y.domain=()=>{let _=kv(ir(g),M=>v.reduceIndex(M,x),M=>g[M]);return f&&_.sort(f),h&&_.reverse(),(b!==0||w!==1/0)&&(_=_.slice(b,w)),_.map(cl)}}}}function cj(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function lj(e,t){let n=e.original;if(n===e)return t;let r=t.value,i=t.value=[];for(let o=0;o<n.length;++o){let s=r[n[o][0]];for(let a of e[o])i[a]=s}return t}function QD(e,t,n){let r=lI(e,t),i=lI(e,n);return Yt(i,(o,s)=>Math.abs(o-r[s]),Float64Array)}function lI(e,t,n){let r=e[t];if(!r&&n!==void 0&&(r=e[n]),r)return r.value;throw new Error(`missing channel: ${t}`)}function uj(e){if(e==null||typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"ascending":return tB;case"descending":return eB}throw new Error(`invalid order: ${e}`)}function tB([e,t],[n,r]){return fn(t,r)||fn(e,n)}function eB([e,t],[n,r]){return il(t,r)||fn(e,n)}function mm(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}var sB=new Map([["accent",QS],["category10",KS],["dark2",JS],["observable10",t3],["paired",e3],["pastel1",n3],["pastel2",r3],["set1",i3],["set2",o3],["set3",s3],["tableau10",a3]]);function aB(e){return e!=null&&sB.has(`${e}`.toLowerCase())}var nB=new Map([...sB,["brbg",ks(Vb,jb)],["prgn",ks(Yb,Wb)],["piyg",ks(Gb,Xb)],["puor",ks(Hb,Zb)],["rdbu",ks(Up,qu)],["rdgy",ks(Kb,Qb)],["rdylbu",ks(Pp,Vu)],["rdylgn",ks(Jb,tx)],["spectral",ks(ex,nx)],["burd",rB(Up,qu)],["buylrd",rB(Pp,Vu)],["blues",yn(Tx,Ex)],["greens",yn(Dx,Bx)],["greys",yn(Nx,Ox)],["oranges",yn(kx,$x)],["purples",yn(Lx,Fx)],["reds",yn(Cx,Rx)],["turbo",$s(Gx)],["viridis",$s(Hx)],["magma",$s(Zx)],["inferno",$s(Kx)],["plasma",$s(Qx)],["cividis",$s(Ux)],["cubehelix",$s(Px)],["warm",$s(qx)],["cool",$s(Vx)],["bugn",yn(rx,ix)],["bupu",yn(ox,sx)],["gnbu",yn(ax,cx)],["orrd",yn(lx,ux)],["pubu",yn(dx,px)],["pubugn",yn(fx,hx)],["purd",yn(mx,yx)],["rdpu",yn(gx,bx)],["ylgn",yn(_x,vx)],["ylgnbu",yn(xx,wx)],["ylorbr",yn(Sx,Ix)],["ylorrd",yn(Mx,Ax)],["rainbow",iB(jx)],["sinebow",iB(Wx)]]);function yn(e,t){return({length:n})=>n===1?[e[3][1]]:n===2?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?Cn(t,n):e[n])}function ks(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?Cn(t,n):e[n])}function rB(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?Cn(r=>t(1-r),n):e[n].slice().reverse())}function $s(e){return({length:t})=>Cn(e,Math.max(2,Math.floor(t)))}function iB(e){return({length:t})=>Cn(e,Math.floor(t)+1).slice(0,-1)}function fI(e){let t=`${e}`.toLowerCase();if(!nB.has(t))throw new Error(`unknown ordinal scheme: ${t}`);return nB.get(t)}function ym(e,t){let n=fI(e),r=typeof n=="function"?n({length:t}):n;return r.length!==t?r.slice(0,t):r}function cB(e,t="greys"){let n=new Set,[r,i]=ym(t,2);for(let o of e)if(o!=null)if(o===!0)n.add(i);else if(o===!1)n.add(r);else return;return[...n]}var oB=new Map([["brbg",jb],["prgn",Wb],["piyg",Xb],["puor",Zb],["rdbu",qu],["rdgy",Qb],["rdylbu",Vu],["rdylgn",tx],["spectral",nx],["burd",e=>qu(1-e)],["buylrd",e=>Vu(1-e)],["blues",Ex],["greens",Bx],["greys",Ox],["purples",Fx],["reds",Rx],["oranges",$x],["turbo",Gx],["viridis",Hx],["magma",Zx],["inferno",Kx],["plasma",Qx],["cividis",Ux],["cubehelix",Px],["warm",qx],["cool",Vx],["bugn",ix],["bupu",sx],["gnbu",cx],["orrd",ux],["pubugn",hx],["pubu",px],["purd",yx],["rdpu",bx],["ylgnbu",wx],["ylgn",vx],["ylorbr",Ix],["ylorrd",Ax],["rainbow",jx],["sinebow",Wx]]);function hf(e){let t=`${e}`.toLowerCase();if(!oB.has(t))throw new Error(`unknown quantitative scheme: ${t}`);return oB.get(t)}var fj=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function lB(e){return e!=null&&fj.has(`${e}`.toLowerCase())}var dI=e=>t=>e(1-t),hI=[0,1],uB=new Map([["number",_e],["rgb",Qr],["hsl",l2],["hcl",u2],["lab",Ag]]);function pI(e){let t=`${e}`.toLowerCase();if(!uB.has(t))throw new Error(`unknown interpolator: ${t}`);return uB.get(t)}function pf(e,t,n,{type:r,nice:i,clamp:o,zero:s,domain:a=bB(e,n),unknown:c,round:l,scheme:u,interval:f,range:h=fe.get(e)===ul?mj(n,a):fe.get(e)===fl?yj(n,a):fe.get(e)===hl?hI:void 0,interpolate:d=fe.get(e)===Cr?u==null&&h!==void 0?Qr:hf(u!==void 0?u:r==="cyclical"?"rainbow":"turbo"):l?kc:_e,reverse:p}){if(f=Bo(f,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof d!="function"&&(d=pI(d)),p=!!p,h!==void 0){let m=(a=Pe(a)).length,y=(h=Pe(h)).length;if(m!==y){if(d.length===1)throw new Error("invalid piecewise interpolator");d=fo(d,h),h=void 0}}if(d.length===1?(p&&(d=dI(d),p=!1),h===void 0&&(h=Float64Array.from(a,(m,y)=>y/(a.length-1)),h.length===2&&(h=hI)),t.interpolate((h===hI?hn:gm)(d))):t.interpolate(d),s){let[m,y]=ce(a);(m>0||y<0)&&(a=Oa(a),(Ns(a)||1)===Math.sign(m)?a[0]=0:a[a.length-1]=0)}return p&&(a=ha(a)),t.domain(a).unknown(c),i&&(t.nice(hj(i,r)),a=t.domain()),h!==void 0&&t.range(h),o&&t.clamp(o),{type:r,domain:a,range:h,scale:t,interpolate:d,interval:f}}function hj(e,t){return e===!0?void 0:typeof e=="number"?e:ED(e,t)}function fB(e,t,n){return pf(e,_s(),t,n)}function hB(e,t,n){return mI(e,t,{...n,exponent:.5})}function mI(e,t,{exponent:n=1,...r}){return pf(e,Ep().exponent(n),t,{...r,type:"pow"})}function dB(e,t,{base:n=10,domain:r=gj(t),...i}){return pf(e,Ap().base(n),t,{...i,domain:r})}function pB(e,t,{constant:n=1,...r}){return pf(e,Tp().constant(n),t,r)}function mB(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:o="rdylbu",domain:s=bj(t),unknown:a,interpolate:c,reverse:l}){return n===void 0&&(n=c!==void 0?Cn(c,i):fe.get(e)===Cr?ym(o,i):void 0),s.length>0&&(s=Dp(s,n===void 0?{length:i}:n).quantiles()),E1(e,t,{domain:s,range:n,reverse:l,unknown:a})}function yB(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i="rdylbu",domain:o=bB(e,t),unknown:s,interpolate:a,reverse:c}){let[l,u]=ce(o),f;return n===void 0?(f=In(l,u,r),f[0]<=l&&f.splice(0,1),f[f.length-1]>=u&&f.pop(),r=f.length+1,n=a!==void 0?Cn(a,r):fe.get(e)===Cr?ym(i,r):void 0):(f=Cn(_e(l,u),r+1).slice(1,-1),l instanceof Date&&(f=f.map(h=>new Date(h)))),Ns(Pe(o))<0&&f.reverse(),E1(e,t,{domain:f,range:n,reverse:c,unknown:s})}function E1(e,t,{domain:n=[0],unknown:r,scheme:i="rdylbu",interpolate:o,range:s=o!==void 0?Cn(o,n.length+1):fe.get(e)===Cr?ym(i,n.length+1):void 0,reverse:a}){n=Pe(n);let c=Ns(n);if(!isNaN(c)&&!dj(n,c))throw new Error(`the ${e} scale has a non-monotonic domain`);return a&&(s=ha(s)),{type:"threshold",scale:Bp(c<0?ha(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function dj(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let o=Wn(i,i=e[n]);if(o!==0&&o!==t)return!1}return!0}function gB(e){return{type:"identity",scale:UD(fe.get(e))?Ip():t=>t}}function df(e,t=Ku){return e.length?[le(e,({value:n})=>n===void 0?n:le(n,t)),Xt(e,({value:n})=>n===void 0?n:Xt(n,t))]:[0,1]}function bB(e,t){let n=fe.get(e);return(n===ul||n===hl||n===fl?pj:df)(t)}function pj(e){return[0,e.length?Xt(e,({value:t})=>t===void 0?t:Xt(t,Ku)):1]}function mj(e,t){let n=e.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=Hn(e,.5,({value:s})=>s===void 0?NaN:Hn(s,.25,rr)),i=t.map(s=>3*Math.sqrt(s/r)),o=30/Xt(i);return o<1?i.map(s=>s*o):i}function yj(e,t){let n=Di(e,({value:o})=>o===void 0?NaN:Di(o,Math.abs)),r=t.map(o=>12*o/n),i=60/Xt(r);return i<1?r.map(o=>o*i):r}function gj(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return df(e,rr);if(n<0)return df(e,Aa)}return[1,10]}function bj(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let r of n)t.push(r);return t}function gm(e){return(t,n)=>r=>e(t+r*(n-t))}var yI=0,gI;function xB(){let e=yI;return yI=0,gI=void 0,e}function qn(e){e!==gI&&(gI=e,console.warn(e),++yI)}function D1(e,t,n,r,{type:i,nice:o,clamp:s,domain:a=df(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:h=!0,interpolate:d=fe.get(e)===Cr?u==null&&f!==void 0?Qr:hf(u!==void 0?u:"rdbu"):_e,reverse:p}){l=+l,a=Pe(a);let[m,y]=a;if(a.length>2&&qn(`Warning: the diverging ${e} scale domain contains extra elements.`),Wn(m,y)<0&&([m,y]=[y,m],p=!p),m=Math.min(m,l),y=Math.max(y,l),typeof d!="function"&&(d=pI(d)),f!==void 0&&(d=d.length===1?gm(d)(...f):fo(d,f)),p&&(d=dI(d)),h){let g=n.apply(l),b=g-n.apply(m),w=n.apply(y)-g;b<w?m=n.invert(g-w):b>w&&(y=n.invert(g+b))}return t.domain([m,l,y]).unknown(c).interpolator(d),s&&t.clamp(s),o&&t.nice(o),{type:i,domain:[m,y],pivot:l,interpolate:d,scale:t}}function wB(e,t,n){return D1(e,$p(),xj,t,n)}function _B(e,t,n){return bI(e,t,{...n,exponent:.5})}function bI(e,t,{exponent:n=1,...r}){return D1(e,qb().exponent(n=+n),vj(n),t,{...r,type:"diverging-pow"})}function vB(e,t,{base:n=10,pivot:r=1,domain:i=df(t,r<0?Aa:rr),...o}){return D1(e,Pb().base(n=+n),wj,t,{domain:i,pivot:r,...o})}function SB(e,t,{constant:n=1,...r}){return D1(e,zb().constant(n=+n),Sj(n),t,r)}var xj={apply(e){return e},invert(e){return e}},wj={apply:Math.log,invert:Math.exp},_j={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return Math.sign(e)*(e*e)}};function vj(e){return e===.5?_j:{apply(t){return Math.sign(t)*Math.pow(Math.abs(t),e)},invert(t){return Math.sign(t)*Math.pow(Math.abs(t),1/e)}}}function Sj(e){return{apply(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))},invert(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}}function IB(e,t,n,r){return pf(e,t,n,r)}function MB(e,t,n){return IB(e,kb(),t,n)}function AB(e,t,n){return IB(e,$b(),t,n)}var mf=Symbol("ordinal");function EB(e,t,n,{type:r,interval:i,domain:o,range:s,reverse:a,hint:c}){return i=Bo(i,r),o===void 0&&(o=LB(n,i,e)),(r==="categorical"||r===mf)&&(r="ordinal"),a&&(o=ha(o)),o=t.domain(o).domain(),s!==void 0&&(typeof s=="function"&&(s=s(o)),t.range(s)),{type:r,domain:o,range:s,scale:t,hint:c,interval:i}}function DB(e,t,{type:n,interval:r,domain:i,range:o,scheme:s,unknown:a,...c}){r=Bo(r,n),i===void 0&&(i=LB(t,r,e));let l;if(fe.get(e)===af)l=Ij(t),o=o===void 0?Mj(l):Yt(o,cf);else if(fe.get(e)===Cr&&(o===void 0&&(n==="ordinal"||n===mf)&&(o=cB(i,s),o!==void 0&&(s=void 0)),s===void 0&&o===void 0&&(s=n==="ordinal"?"turbo":"observable10"),s!==void 0))if(o!==void 0){let u=hf(s),f=o[0],h=o[1]-o[0];o=({length:d})=>Cn(p=>u(f+h*p),d)}else o=fI(s);if(a===vp)throw new Error(`implicit unknown on ${e} scale is not supported`);return EB(e,Hc().unknown(a),t,{...c,type:n,domain:i,range:o,hint:l})}function BB(e,t,{align:n=.5,padding:r=.5,...i}){return OB(CS().align(n).padding(r),t,i,e)}function NB(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:o=e==="fx"||e==="fy"?0:r,...s}){return OB(Sa().align(n).paddingInner(i).paddingOuter(o),t,s,e)}function OB(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=EB(r,e,t,n),e.round=i,e}function LB(e,t,n){let r=new Xn;for(let{value:i,domain:o}of e){if(o!==void 0)return o();if(i!==void 0)for(let s of i)r.add(s)}if(t!==void 0){let[i,o]=ce(r).map(t.floor,t);return t.range(i,t.offset(o))}if(r.size>1e4&&fe.get(n)===ci)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return ls(r,fn)}function TB(e,t){let n;for(let{hint:r}of e){let i=r?.[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}function Ij(e){return{fill:TB(e,"fill"),stroke:TB(e,"stroke")}}function Mj(e){return ne(e.fill)?p3:i1}function bm(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:o=n,insetLeft:s=n,round:a,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,facet:{label:p=t}={},...m}={}){let y={};for(let[g,b]of e){let w=m[g],x=zB(g,b,{round:fe.get(g)===ci?a:void 0,nice:c,clamp:l,zero:u,align:f,padding:h,projection:d,...w});if(x){let{label:v=g==="fx"||g==="fy"?p:t,percent:_,transform:M,inset:E,insetTop:T=E!==void 0?E:g==="y"?r:0,insetRight:B=E!==void 0?E:g==="x"?i:0,insetBottom:I=E!==void 0?E:g==="y"?o:0,insetLeft:N=E!==void 0?E:g==="x"?s:0}=w||{};if(M==null)M=void 0;else if(typeof M!="function")throw new Error("invalid scale transform; not a function");x.percent=!!_,x.label=v===void 0?Aj(b,x):v,x.transform=M,g==="x"||g==="fx"?(x.insetLeft=+N,x.insetRight=+B):(g==="y"||g==="fy")&&(x.insetTop=+T,x.insetBottom=+I),y[g]=x}}return y}function wI(e){let t={},n={scales:t};for(let[r,i]of Object.entries(e)){let{scale:o,type:s,interval:a,label:c}=i;t[r]=VB(i),n[r]=o,o.type=s,a!=null&&(o.interval=a),c!=null&&(o.label=c)}return n}function $B(e,t){let{x:n,y:r,fx:i,fy:o}=e,s=i||o?O1(t):t;i&&FB(i,s),o&&CB(o,s);let a=i||o?_I(e,t):t;n&&FB(n,a),r&&CB(r,a)}function Aj(e=[],t){let n;for(let{label:r}of e)if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}if(n!==void 0)return!Lo(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function N1(e){return Math.sign(Ns(e.domain()))*Math.sign(Ns(e.range()))}function O1(e){let{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:o,height:s,facet:{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u}}=e;return{marginTop:Math.max(t,a),marginRight:Math.max(n,c),marginBottom:Math.max(r,l),marginLeft:Math.max(i,u),width:o,height:s}}function _I({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=O1(n);return{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:e?e.scale.bandwidth()+s+i:a,height:t?t.scale.bandwidth()+r+o:c,facet:{width:a,height:c}}}function FB(e,t){if(e.range===void 0){let{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:o=0,marginRight:s=0}=t,a=o+n,c=i-s-r;e.range=[a,Math.max(a,c)],Lo(e)||(e.range=PB(e)),e.scale.range(e.range)}UB(e)}function CB(e,t){if(e.range===void 0){let{insetTop:n,insetBottom:r}=e,{height:i,marginTop:o=0,marginBottom:s=0}=t,a=o+n,c=i-s-r;e.range=[Math.max(a,c),a],Lo(e)?e.range.reverse():e.range=PB(e),e.scale.range(e.range)}UB(e)}function UB(e){e.round===void 0&&Dj(e)&&Tj(e)<=30&&e.scale.round(!0)}function Tj({scale:e}){let t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,o=e.paddingOuter?e.paddingOuter():e.padding(),s=t-i,a=Math.abs(r-n)/Math.max(1,s+o*2);return(a-Math.floor(a))*s}function PB(e){let t=e.scale.domain().length+vI(e);if(!(t>2))return e.range;let[n,r]=e.range;return Array.from({length:t},(i,o)=>n+o/(t-1)*(r-n))}function L1(e,t,n){return zB(e,n===void 0?void 0:[{hint:n}],{...t})}function zB(e,t=[],n={}){let r=Ej(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!=="fx"&&e!=="fy"&&Lo({type:r})){let i=t.map(({value:o})=>o).filter(o=>o!==void 0);i.some(Be)?qn(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${yf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${yf(r)}".`):i.some(OD)?qn(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${yf(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${yf(r)}".`):i.some(LD)&&qn(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${yf(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${yf(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=B1(t,n,Ke);break;case"identity":switch(fe.get(e)){case ci:n=B1(t,n,Ke);break;case af:n=B1(t,n,Bj);break}break;case"utc":case"time":n=B1(t,n,TD);break}switch(r){case"diverging":return wB(e,t,n);case"diverging-sqrt":return _B(e,t,n);case"diverging-pow":return bI(e,t,n);case"diverging-log":return vB(e,t,n);case"diverging-symlog":return SB(e,t,n);case"categorical":case"ordinal":case mf:return DB(e,t,n);case"cyclical":case"sequential":case"linear":return fB(e,t,n);case"sqrt":return hB(e,t,n);case"threshold":return E1(e,t,n);case"quantile":return mB(e,t,n);case"quantize":return yB(e,t,n);case"pow":return mI(e,t,n);case"log":return dB(e,t,n);case"symlog":return pB(e,t,n);case"utc":return AB(e,t,n);case"time":return MB(e,t,n);case"point":return BB(e,t,n);case"band":return NB(e,t,n);case"identity":return gB(e);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function yf(e){return typeof e=="symbol"?e.description:e}function RB(e){return typeof e=="string"?`${e}`.toLowerCase():e}var kB={toString:()=>"projection"};function Ej(e,t,{type:n,domain:r,range:i,scheme:o,pivot:s,projection:a}){if(n=RB(n),e==="fx"||e==="fy")return"band";(e==="x"||e==="y")&&a!=null&&(n=kB);for(let l of t){let u=RB(l.type);if(u!==void 0){if(n===void 0)n=u;else if(n!==u)throw new Error(`scale incompatible with channel: ${n} !== ${u}`)}}if(n===kB)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:l})=>l!==void 0))return;let c=fe.get(e);if(c===ul)return"sqrt";if(c===hl||c===fl)return"linear";if(c===af)return"ordinal";if((r||i||[]).length>2)return xI(c);if(r!==void 0){if(Te(r))return xI(c);if(Be(r))return"utc"}else{let l=t.map(({value:u})=>u).filter(u=>u!==void 0);if(l.some(Te))return xI(c);if(l.some(Be))return"utc"}if(c===Cr){if(s!=null||lB(o))return"diverging";if(aB(o))return"categorical"}return"linear"}function xI(e){switch(e){case ci:return"point";case Cr:return mf;default:return"ordinal"}}function Lo({type:e}){return e==="ordinal"||e==="point"||e==="band"||e===mf}function vI({type:e}){return e==="threshold"}function Dj({type:e}){return e==="point"||e==="band"}function sr(e){if(e===void 0)return!0;let t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r<i;++r)if(e(t[r])-n)return!1;return!0}function B1(e,{domain:t,...n},r){for(let i of e)i.value!==void 0&&(t===void 0&&(t=i.value?.domain),i.value=r(i.value));return{domain:t===void 0?t:r(t),...n}}function Bj(e){return Yt(e,cf)}function $a(e={}){let t;for(let n in e)if(fe.has(n)&&Eo(e[n])){if(t!==void 0)throw new Error("ambiguous scale definition; multiple scales found");t=VB(L1(n,e[n]))}if(t===void 0)throw new Error("invalid scale definition; no scale found");return t}function qB(e){return t=>{if(!fe.has(t=`${t}`))throw new Error(`unknown scale: ${t}`);return e[t]}}function VB({scale:e,type:t,domain:n,range:r,interpolate:i,interval:o,transform:s,percent:a,pivot:c}){if(t==="identity")return{type:"identity",apply:u=>u,invert:u=>u};let l=e.unknown?e.unknown():void 0;return{type:t,domain:Oa(n),...r!==void 0&&{range:Oa(r)},...s!==void 0&&{transform:s},...a&&{percent:a},...l!==void 0&&{unknown:l},...o!==void 0&&{interval:o},...i!==void 0&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:u=>e(u),...e.invert&&{invert:u=>e.invert(u)}}}function YB(e,t){let{fx:n,fy:r}=bm(e,t),i=n?.scale.domain(),o=r?.scale.domain();return i&&o?tg(i,o).map(([s,a],c)=>({x:s,y:a,i:c})):i?i.map((s,a)=>({x:s,i:a})):o?o.map((s,a)=>({y:s,i:a})):void 0}function WB(e,{x:t,y:n}){return t&&=TI(t),n&&=TI(n),e.filter(t&&n?r=>t.has(r.x)&&n.has(r.y):t?r=>t.has(r.x):r=>n.has(r.y)).sort(t&&n?(r,i)=>t.get(r.x)-t.get(i.x)||n.get(r.y)-n.get(i.y):t?(r,i)=>t.get(r.x)-t.get(i.x):(r,i)=>n.get(r.y)-n.get(i.y))}function C1(e,{fx:t,fy:n}){let r=ir(e),i=t?.value,o=n?.value;return t&&n?Ei(r,s=>(s.fx=i[s[0]],s.fy=o[s[0]],s),s=>i[s],s=>o[s]):t?Ei(r,s=>(s.fx=i[s[0]],s),s=>i[s]):Ei(r,s=>(s.fy=o[s[0]],s),s=>o[s])}function GB(e,t,{marginTop:n,marginLeft:r}){return e&&t?({x:i,y:o})=>`translate(${e(i)-r},${t(o)-n})`:e?({x:i})=>`translate(${e(i)-r},0)`:({y:i})=>`translate(0,${t(i)-n})`}function XB(e){let t=[],n=new Uint32Array(Mn(e,r=>r.length));for(let r of e){let i=0;for(let o of e)r!==o&&(n.set(o,i),i+=o.length);t.push(n.slice(0,i))}return t}var Nj=new Map([["top",SI],["right",AI],["bottom",II],["left",MI],["top-left",F1(SI,MI)],["top-right",F1(SI,AI)],["bottom-left",F1(II,MI)],["bottom-right",F1(II,AI)],["top-empty",Lj],["right-empty",Rj],["bottom-empty",Fj],["left-empty",Cj],["empty",kj]]);function HB(e){if(e==null)return null;let t=Nj.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid facet anchor: ${e}`)}var jB=new WeakMap;function TI(e){let t=jB.get(e);return t||jB.set(e,t=new Gn(Yt(e,(n,r)=>[n,r]))),t}function Ua(e,t){return TI(e).get(t)}function Oj(e,t,n){return t=Ls(t),n=Ls(n),e.find(r=>Object.is(Ls(r.x),t)&&Object.is(Ls(r.y),n))}function R1(e,t,n){return Oj(e,t,n)?.empty}function SI(e,{y:t},{y:n}){return t?Ua(t,n)===0:!0}function II(e,{y:t},{y:n}){return t?Ua(t,n)===t.length-1:!0}function MI(e,{x:t},{x:n}){return t?Ua(t,n)===0:!0}function AI(e,{x:t},{x:n}){return t?Ua(t,n)===t.length-1:!0}function Lj(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ua(t,r);if(o>0)return R1(e,n,t[o-1])}function Fj(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ua(t,r);if(o<t.length-1)return R1(e,n,t[o+1])}function Cj(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ua(t,n);if(o>0)return R1(e,t[o-1],r)}function Rj(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let o=Ua(t,n);if(o<t.length-1)return R1(e,t[o+1],r)}function kj(e,t,{empty:n}){return n}function F1(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function k1(e,{channels:{fx:t,fy:n},groups:r}){return t&&n?e.map(({x:i,y:o})=>r.get(i)?.get(o)??[]):t?e.map(({x:i})=>r.get(i)??[]):e.map(({y:i})=>r.get(i)??[])}var KB=Math.PI,Us=2*KB,ZB=.618;function QB({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:o=t}={},s){if(e==null)return;if(typeof e.stream=="function")return e;let a,c,l="frame";if(dn(e)){let v;if({type:e,domain:c,inset:v,insetTop:n=v!==void 0?v:n,insetRight:r=v!==void 0?v:r,insetBottom:i=v!==void 0?v:i,insetLeft:o=v!==void 0?v:o,clip:l=l,...a}=e,e==null)return}typeof e!="function"&&({type:e}=JB(e));let{width:u,height:f,marginLeft:h,marginRight:d,marginTop:p,marginBottom:m}=s,y=u-h-d-o-r,g=f-p-m-n-i;if(e=e?.({width:y,height:g,clip:l,...a}),e==null)return;l=$j(l,h,p,u-d,f-m);let b=h+o,w=p+n,x;if(c!=null){let[[v,_],[M,E]]=Tn(e).bounds(c),T=Math.min(y/(M-v),g/(E-_));T>0?(b-=(T*(v+M)-y)/2,w-=(T*(_+E)-g)/2,x=Wc({point(B,I){this.stream.point(B*T+b,I*T+w)}})):qn("Warning: the projection could not be fit to the specified domain; using the default scale.")}return x??=b===0&&w===0?tN():Wc({point(v,_){this.stream.point(v+b,_+w)}}),{stream:v=>e.stream(x.stream(l(v)))}}function JB(e){switch(`${e}`.toLowerCase()){case"albers-usa":return Li(lS,.7463,.4673);case"albers":return $1(yp,.7463,.4673);case"azimuthal-equal-area":return Li(fS,4,4);case"azimuthal-equidistant":return Li(dS,Us,Us);case"conic-conformal":return $1(yS,Us,Us);case"conic-equal-area":return $1(_a,6.1702,2.9781);case"conic-equidistant":return $1(bS,7.312,3.6282);case"equal-earth":return Li(wS,5.4133,2.6347);case"equirectangular":return Li(gS,Us,KB);case"gnomonic":return Li(vS,3.4641,3.4641);case"identity":return{type:tN};case"reflect-y":return{type:Uj};case"mercator":return Li(pS,Us,Us);case"orthographic":return Li(IS,2,2);case"stereographic":return Li(AS,2,2);case"transverse-mercator":return Li(ES,Us,Us);default:throw new Error(`unknown projection type: ${e}`)}}function $j(e,t,n,r,i){if(e===!1||e==null||typeof e=="number")return o=>o;switch(e===!0&&(e="frame"),`${e}`.toLowerCase()){case"frame":return Bu(t,n,r,i);default:throw new Error(`unknown projection clip type: ${e}`)}}function Li(e,t,n){return{type:({width:r,height:i,rotate:o,precision:s=.15,clip:a})=>{let c=e();return s!=null&&c.precision?.(s),o!=null&&c.rotate?.(o),typeof a=="number"&&c.clipAngle?.(a),c.scale(Math.min(r/t,i/n)),c.translate([r/2,i/2]),c},aspectRatio:n/t}}function $1(e,t,n){let{type:r,aspectRatio:i}=Li(e,t,n);return{type:o=>{let{parallels:s,domain:a,width:c,height:l}=o,u=r(o);return s!=null&&(u.parallels(s),a===void 0&&u.fitSize([c,l],{type:"Sphere"})),u},aspectRatio:i}}var tN=hn({stream:e=>e}),Uj=hn(Wc({point(e,t){this.stream.point(e,-t)}}));function EI(e,t,n,r){let i=n[e],o=n[t],s=i.length,a=n[e]=new Float64Array(s).fill(NaN),c=n[t]=new Float64Array(s).fill(NaN),l,u=r.stream({point(f,h){a[l]=f,c[l]=h}});for(l=0;l<s;++l)u.point(i[l],o[l])}function eN({projection:e}={}){return e==null?!1:typeof e.stream=="function"?!0:(dn(e)&&(e=e.type),e!=null)}function nN(e){if(typeof e?.stream=="function")return ZB;if(dn(e)&&(e=e.type),e!=null){if(typeof e!="function"){let{aspectRatio:t}=JB(e);if(t)return t}return ZB}}function Pa(e,t,{projection:n}){let{x:r,y:i}=e,o={};return r&&(o.x=r),i&&(o.y=i),o=ff(o,t),n&&r?.scale==="x"&&i?.scale==="y"&&EI("x","y",o,n),r&&(o.x=Ke(o.x)),i&&(o.y=Ke(o.y)),o}function rN(e){let t=[],n=[],r={scale:"x",value:t},i={scale:"y",value:n},o={point(s,a){t.push(s),n.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of e.value)Br(s,o);return[r,i]}function za(e={}){let{document:t=typeof window<"u"?window.document:void 0,clip:n}=e;return{document:t,clip:x1(n)}}function lt(e,{document:t}){return Pt(ds(e).call(t.documentElement))}function U1(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((i,o)=>i!==r[o]))&&(n=r,t=e(...r)),t)}var Pj=U1(e=>new Intl.NumberFormat(e)),zj=U1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{month:t}})),qj=U1((e,t)=>new Intl.DateTimeFormat(e,{timeZone:"UTC",...t&&{weekday:t}}));function DI(e="en-US"){let t=Pj(e);return n=>n!=null&&!isNaN(n)?t.format(n):void 0}function iN(e="en-US",t="short"){let n=zj(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function oN(e="en-US",t="short"){let n=qj(e,t);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function BI(e){return f1(e,"Invalid Date")}function Vj(e="en-US"){let t=DI(e);return n=>(n instanceof Date?BI:typeof n=="number"?t:Ue)(n)}var Fo=Vj();var Ne=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,jj=0;function P1(){return`plot-clip-${++jj}`}function z1(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:o,target:s,fill:a,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:y,opacity:g,mixBlendMode:b,imageFilter:w,paintOrder:x,pointerEvents:v,shapeRendering:_,channels:M},{ariaLabel:E,fill:T="currentColor",fillOpacity:B,stroke:I="none",strokeOpacity:N,strokeWidth:O,strokeLinecap:S,strokeLinejoin:A,strokeMiterlimit:D,paintOrder:C}){T===null&&(a=null,c=null),I===null&&(l=null,f=null),ne(T)?!ne(I)&&(!ne(a)||M?.fill)&&(I="none"):ne(I)&&(!ne(l)||M?.stroke)&&(T="none");let[R,F]=De(a,T),[k,$]=oe(c,B),[U,W]=De(l,I),[et,rt]=oe(f,N),[st,j]=oe(g);Cs(W)||(u===void 0&&(u=O),d===void 0&&(d=S),h===void 0&&(h=A),p===void 0&&!CD(h)&&(p=D),!Cs(F)&&x===void 0&&(x=C));let[ot,z]=oe(u);return T!==null&&(e.fill=ue(F,"currentColor"),e.fillOpacity=xm($,1)),I!==null&&(e.stroke=ue(W,"none"),e.strokeWidth=xm(z,1),e.strokeOpacity=xm(rt,1),e.strokeLinejoin=ue(h,"miter"),e.strokeLinecap=ue(d,"butt"),e.strokeMiterlimit=xm(p,4),e.strokeDasharray=ue(m,"none"),e.strokeDashoffset=ue(y,"0")),e.target=Ue(s),e.ariaLabel=Ue(E),e.ariaDescription=Ue(i),e.ariaHidden=Ue(o),e.opacity=xm(j,1),e.mixBlendMode=ue(b,"normal"),e.imageFilter=ue(w,"none"),e.paintOrder=ue(x,"normal"),e.pointerEvents=ue(v,"auto"),e.shapeRendering=ue(_,"auto"),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:R,scale:"auto",optional:!0},fillOpacity:{value:k,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:et,scale:"auto",optional:!0},strokeWidth:{value:ot,optional:!0},opacity:{value:st,scale:"auto",optional:!0}}}function Yj(e,t){t&&e.filter(n=>im(t[n])).append("title").call(Gj,t)}function Wj(e,t){t&&e.filter(([n])=>im(t[n])).append("title").call(Xj,t)}function Gj(e,t){t&&e.text(n=>Fo(t[n]))}function Xj(e,t){t&&e.text(([n])=>Fo(t[n]))}function Zt(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",h=>r[h]),o&&ut(e,"fill",h=>o[h]),s&&ut(e,"fill-opacity",h=>s[h]),a&&ut(e,"stroke",h=>a[h]),c&&ut(e,"stroke-opacity",h=>c[h]),l&&ut(e,"stroke-width",h=>l[h]),u&&ut(e,"opacity",h=>u[h]),f&&sN(e,h=>f[h],t),n||Yj(e,i)}function dl(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:l,opacity:u,href:f}){r&&ut(e,"aria-label",([h])=>r[h]),o&&ut(e,"fill",([h])=>o[h]),s&&ut(e,"fill-opacity",([h])=>s[h]),a&&ut(e,"stroke",([h])=>a[h]),c&&ut(e,"stroke-opacity",([h])=>c[h]),l&&ut(e,"stroke-width",([h])=>l[h]),u&&ut(e,"opacity",([h])=>u[h]),f&&sN(e,([h])=>f[h],t),n||Wj(e,i)}function Hj({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:o,strokeWidth:s,opacity:a,href:c},{tip:l}){return[e,l?void 0:t,n,r,i,o,s,a,c].filter(u=>u!==void 0)}function wm(e,t,n){let r=an(e,i=>t[i]);return n===void 0&&r.size>1+e.length>>1&&qn("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*q1(e,t,n,r){let{z:i}=n,{z:o}=r,s=Hj(r,n),a=[...t,...s];for(let c of o?wm(e,o,i):[e]){let l,u;t:for(let f of c){for(let h of a)if(!$e(h[f])){u&&u.push(-1);continue t}if(l===void 0){u&&(yield u),l=s.map(h=>Ls(h[f])),u=[f];continue}u.push(f);for(let h=0;h<s.length;++h)if(Ls(s[h][f])!==l[h]){yield u,l=s.map(p=>Ls(p[f])),u=[f];continue t}}u&&(yield u)}}function Zj(e,t,n,r){let i,{clip:o=r.clip}=t;switch(o){case"frame":{let{width:s,height:a,marginLeft:c,marginRight:l,marginTop:u,marginBottom:f}=n,h=P1();i=`url(#${h})`,e=lt("svg:g",r).call(d=>d.append("svg:clipPath").attr("id",h).append("rect").attr("x",c).attr("y",u).attr("width",s-l-c).attr("height",a-u-f)).each(function(){this.appendChild(e.node()),e.node=()=>this});break}case"sphere":{let{projection:s}=r;if(!s)throw new Error('the "sphere" clip option requires a projection');let a=P1();i=`url(#${a})`,e.append("clipPath").attr("id",a).append("path").attr("d",Tn(s)({type:"Sphere"}));break}}ut(e,"aria-label",t.ariaLabel),ut(e,"aria-description",t.ariaDescription),ut(e,"aria-hidden",t.ariaHidden),ut(e,"clip-path",i)}function Ot(e,t,n,r){Zj(e,t,n,r),ut(e,"fill",t.fill),ut(e,"fill-opacity",t.fillOpacity),ut(e,"stroke",t.stroke),ut(e,"stroke-width",t.strokeWidth),ut(e,"stroke-opacity",t.strokeOpacity),ut(e,"stroke-linejoin",t.strokeLinejoin),ut(e,"stroke-linecap",t.strokeLinecap),ut(e,"stroke-miterlimit",t.strokeMiterlimit),ut(e,"stroke-dasharray",t.strokeDasharray),ut(e,"stroke-dashoffset",t.strokeDashoffset),ut(e,"shape-rendering",t.shapeRendering),ut(e,"filter",t.imageFilter),ut(e,"paint-order",t.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?"none":void 0}=t;ut(e,"pointer-events",i)}function Nt(e,t){Kj(e,"mix-blend-mode",t.mixBlendMode),ut(e,"opacity",t.opacity)}function sN(e,t,n){e.each(function(r){let i=t(r);if(i!=null){let o=this.ownerDocument.createElementNS(Kr.svg,"a");o.setAttribute("fill","inherit"),o.setAttributeNS(Kr.xlink,"href",i),n!=null&&o.setAttribute("target",n),this.parentNode.insertBefore(o,this).appendChild(this)}})}function ut(e,t,n){n!=null&&e.attr(t,n)}function Kj(e,t,n){n!=null&&e.style(t,n)}function Mt(e,t,{x:n,y:r},i=Ne,o=Ne){i+=t.dx,o+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(o+=r.bandwidth()/2),(i||o)&&e.attr("transform",`translate(${i},${o})`)}function ue(e,t){if((e=Ue(e))!==t)return e}function xm(e,t){if((e=Bt(e))!==t)return e}var Qj=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function gf(e){if(e===void 0)return"plot-d6a7b5";if(e=`${e}`,!Qj.test(e))throw new Error(`invalid class name: ${e}`);return e}function bf(e,t){if(typeof t=="string")e.property("style",t);else if(t!=null)for(let n of e)Object.assign(n.style,t)}function gn({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:o,marginLeft:s}){return[/left$/.test(e)?s:/right$/.test(e)?t-i:(s+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-o:(r+n-o)/2]}var wt=class{constructor(t,n={},r={},i){let{facet:o="auto",facetAnchor:s,fx:a,fy:c,sort:l,dx:u=0,dy:f=0,margin:h=0,marginTop:d=h,marginRight:p=h,marginBottom:m=h,marginLeft:y=h,clip:g=i?.clip,channels:b,tip:w,render:x}=r;if(this.data=t,this.sort=Do(l)?l:null,this.initializer=Se(r).initializer,this.transform=this.initializer?r.transform:mn(r).transform,o===null||o===!1?this.facet=null:(this.facet=rn(o===!0?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===Ba&&typeof a=="string"?[a]:a,this.fy=t===Ba&&typeof c=="string"?[c]:c),this.facetAnchor=HB(s),n=um(n),b!==void 0&&(n={...Jj(b),...n}),i!==void 0&&(n={...z1(this,r,i),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,_])=>{if(Fr(_.value)){let{value:M,label:E=_.label,scale:T=_.scale}=_.value;_={..._,label:E,scale:T,value:M}}if(t===Ba&&typeof _.value=="string"){let{value:M}=_;_={..._,value:[M]}}return[v,_]}).filter(([v,{value:_,optional:M}])=>{if(_!=null)return!0;if(M)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+u,this.dy=+f,this.marginTop=+d,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+y,this.clip=x1(g),this.tip=tY(w),this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:_}=n[v];if(!(_!=="x"&&_!=="y"))throw new Error("super-faceting cannot use x or y")}}x!=null&&(this.render=xf(x,this.render))}initialize(t,n,r){let i=Pe(this.data);t===void 0&&i!=null&&(t=[ir(i)]);let o=t;this.transform!=null&&({facets:t,data:i}=this.transform(i,t,r),i=Pe(i)),t!==void 0&&(t.original=o);let s=T1(this.channels,i);return this.sort!=null&&JD(i,t,s,n,this.sort),{data:i,facets:t,channels:s}}filter(t,n,r){for(let i in n){let{filter:o=$e}=n[i];if(o!==null){let s=r[i];t=t.filter(a=>o(s[a]))}}return t}project(t,n,r){for(let i in t)if(t[i].scale==="x"&&/^x|x$/.test(i)){let o=i.replace(/^x|x$/,"y");o in t&&t[o].scale==="y"&&EI(i,o,n,r.projection)}}scale(t,n,r){let i=ff(t,n);return r.projection&&this.project(t,i,r),i}};function Qe(...e){return e.plot=wt.prototype.plot,e}function xf(e,t){if(e==null)return t===null?void 0:t;if(t==null)return e===null?void 0:e;if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);return function(n,r,i,o,s,a){return e.call(this,n,r,i,o,s,(c,l,u,f,h)=>t.call(this,c,l,u,f,h,a))}}function Jj(e){return Object.fromEntries(Object.entries(um(e)).map(([t,n])=>(n=typeof n=="string"?{value:n,label:t}:ai(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[t,n])))}function tY(e){return e===!0?"xy":e===!1||e==null?null:typeof e=="string"?rn(e,"tip",["x","y","xy"]):e}function Fi(e,t){return e?.tip===!0?{...e,tip:t}:dn(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}function cN(e,t,n={}){let r=.5-Ne,i=.5+Ne,o=.5+Ne,s=.5-Ne;for(let{marginTop:m,marginRight:y,marginBottom:g,marginLeft:b}of t)m>r&&(r=m),y>i&&(i=y),g>o&&(o=g),b>s&&(s=b);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:l=a!==void 0?a:i,marginBottom:u=a!==void 0?a:o,marginLeft:f=a!==void 0?a:s}=n;c=+c,l=+l,u=+u,f=+f;let{width:h=640,height:d=eY(e,n,{width:h,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,c-r+u-o)}=n;h=+h,d=+d;let p={width:h,height:d,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f};if(e.fx||e.fy){let{margin:m,marginTop:y=m!==void 0?m:c,marginRight:g=m!==void 0?m:l,marginBottom:b=m!==void 0?m:u,marginLeft:w=m!==void 0?m:f}=n.facet??{};y=+y,g=+g,b=+b,w=+w,p.facet={marginTop:y,marginRight:g,marginBottom:b,marginLeft:w}}return p}function eY({x:e,y:t,fy:n,fx:r},{projection:i,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let f=n?n.scale.domain().length:1,h=nN(i);if(h){let p=r?r.scale.domain().length:1,m=(1.1*f-.1)/(1.1*p-.1)*h,y=Math.max(.1,Math.min(10,m));return Math.round((s-u-c)*y+a+l)}let d=t?Lo(t)?t.scale.domain().length:Math.max(7,17/f):1;if(o!=null){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);let p=aN("y",t)/(aN("x",e)*o),m=r?r.scale.bandwidth():1,y=n?n.scale.bandwidth():1,g=m*(s-u-c)-e.insetLeft-e.insetRight;return(p*g+t.insetTop+t.insetBottom)/y+a+l}return!!(t||n)*Math.max(1,Math.min(60,d*f))*20+!!r*30+60}function aN(e,t){if(!t)throw new Error(`aspectRatio requires ${e} scale`);let{type:n,domain:r}=t,i;switch(n){case"linear":case"utc":case"time":i=Number;break;case"pow":{let a=t.scale.exponent();i=c=>Math.pow(c,a);break}case"log":i=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${e} scale for aspectRatio: ${n}`)}let[o,s]=ce(r);return Math.abs(i(s)-i(o))}var lN=new WeakMap;function NI(e,t,{x:n,y:r,px:i,py:o,maxRadius:s=40,channels:a,render:c,...l}={}){return s=+s,i!=null&&(n??=null,a={...a,px:{value:i,scale:"x"}}),o!=null&&(r??=null,a={...a,py:{value:o,scale:"y"}}),{x:n,y:r,channels:a,...l,render:xf(function(u,f,h,d,p,m){p={...p,pointerSticky:!1};let y=p.ownerSVGElement,{data:g}=p.getMarkState(this),b=lN.get(y);b||lN.set(y,b={sticky:!1,roots:[],renders:[]});let w=b.renders.push(W)-1,{x,y:v,fx:_,fy:M}=f,E=_?_(u.fx)-d.marginLeft:0,T=M?M(u.fy)-d.marginTop:0;x?.bandwidth&&(E+=x.bandwidth()/2),v?.bandwidth&&(T+=v.bandwidth()/2);let B=u.fi!=null,I;if(B){let j=b.facetStates;j||(b.facetStates=j=new Map),I=j.get(this),I||j.set(this,I=new Map)}let[N,O]=gn(this,d),{px:S,py:A}=h,D=S?j=>S[j]:OI(h,N),C=A?j=>A[j]:LI(h,O),R,F,k,$;function U(j,ot){if(B)if($&&($=cancelAnimationFrame($)),j==null)I.delete(u.fi);else{I.set(u.fi,ot),$=requestAnimationFrame(()=>{$=null;for(let[z,H]of I)if(H<ot||H===ot&&z<u.fi){j=null;break}W(j)});return}W(j)}function W(j){if(R===j&&k===b.sticky)return;R=j,k=p.pointerSticky=b.sticky;let ot=R==null?[]:[R];B&&(ot.fx=u.fx,ot.fy=u.fy,ot.fi=u.fi);let z=m(ot,f,h,d,p);if(F){if(B){let H=F.parentNode,nt=F.getAttribute("transform"),P=z.getAttribute("transform");nt?z.setAttribute("transform",nt):z.removeAttribute("transform"),P?H.setAttribute("transform",P):H.removeAttribute("transform"),z.removeAttribute("aria-label"),z.removeAttribute("aria-description"),z.removeAttribute("aria-hidden")}F.replaceWith(z)}return b.roots[w]=F=z,R==null&&I?.size>1||p.dispatchValue(R==null?null:g[R]),z}function et(j){if(b.sticky||j.pointerType==="mouse"&&j.buttons===1)return;let[ot,z]=Fn(j);ot-=E,z-=T;let H=ot<d.marginLeft||ot>d.width-d.marginRight?1:e,nt=z<d.marginTop||z>d.height-d.marginBottom?1:t,P=null,Lt=s*s;for(let ft of u){let Wt=H*(D(ft)-ot),Ht=nt*(C(ft)-z),J=Wt*Wt+Ht*Ht;J<=Lt&&(P=ft,Lt=J)}if(P!=null&&(e!==1||t!==1)){let ft=D(P)-ot,Wt=C(P)-z;Lt=ft*ft+Wt*Wt}U(P,Lt)}function rt(j){j.pointerType==="mouse"&&R!=null&&(b.sticky&&b.roots.some(ot=>ot?.contains(j.target))||(b.sticky?(b.sticky=!1,b.renders.forEach(ot=>ot(null))):(b.sticky=!0,W(R)),j.stopImmediatePropagation()))}function st(j){j.pointerType==="mouse"&&(b.sticky||U(null))}return y.addEventListener("pointerenter",et),y.addEventListener("pointermove",et),y.addEventListener("pointerdown",rt),y.addEventListener("pointerleave",st),W(null)},c)}}function qa(e){return NI(1,1,e)}function Va(e){return NI(1,.01,e)}function Ps(e){return NI(.01,1,e)}function OI({x1:e,x2:t,x:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function LI({y1:e,y2:t,y:n=e},r){return e&&t?i=>(e[i]+t[i])/2:n?i=>n[i]:()=>r}function V1(e){return Lo(e)&&e.interval===void 0?void 0:"tabular-nums"}function uN(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:o=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:l=0,style:u,ticks:f=(i-l-a)/64,tickFormat:h,fontVariant:d=V1(e),round:p=!0,opacity:m,className:y}=t,g=za(t);y=gf(y),m=oe(m)[1],h===null&&(h=()=>null);let b=lt("svg",g).attr("class",`${y}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",o).attr("viewBox",`0 0 ${i} ${o}`).call(N=>N.append("style").text(`:where(.${y}-ramp) {
|
|
1
|
+
var T9=Object.create;var f1=Object.defineProperty;var I9=Object.getOwnPropertyDescriptor;var $9=Object.getOwnPropertyNames;var C9=Object.getPrototypeOf,k9=Object.prototype.hasOwnProperty;var U_=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),N9=(t,e)=>{for(var n in e)f1(t,n,{get:e[n],enumerable:!0})},O9=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $9(e))!k9.call(t,o)&&o!==n&&f1(t,o,{get:()=>e[o],enumerable:!(r=I9(e,o))||r.enumerable});return t};var R9=(t,e,n)=>(n=t!=null?T9(C9(t)):{},O9(e||!t||!t.__esModule?f1(n,"default",{value:t,enumerable:!0}):n,t));var mT=U_((ZMt,dT)=>{"use strict";function kB(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>=0?(i=s,o=s-1):r=s+1}return i}function NB(t,e,n,r,o){for(var i=o+1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c>0?(i=s,o=s-1):r=s+1}return i}function OB(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<0?(i=s,r=s+1):o=s-1}return i}function RB(t,e,n,r,o){for(var i=r-1;r<=o;){var s=r+o>>>1,a=t[s],c=n!==void 0?n(a,e):a-e;c<=0?(i=s,r=s+1):o=s-1}return i}function LB(t,e,n,r,o){for(;r<=o;){var i=r+o>>>1,s=t[i],a=n!==void 0?n(s,e):s-e;if(a===0)return i;a<=0?r=i+1:o=i-1}return-1}function Tp(t,e,n,r,o,i){return typeof n=="function"?i(t,e,n,r===void 0?0:r|0,o===void 0?t.length-1:o|0):i(t,e,void 0,n===void 0?0:n|0,r===void 0?t.length-1:r|0)}dT.exports={ge:function(t,e,n,r,o){return Tp(t,e,n,r,o,kB)},gt:function(t,e,n,r,o){return Tp(t,e,n,r,o,NB)},lt:function(t,e,n,r,o){return Tp(t,e,n,r,o,OB)},le:function(t,e,n,r,o){return Tp(t,e,n,r,o,RB)},eq:function(t,e,n,r,o){return Tp(t,e,n,r,o,LB)}}});var MT=U_((KMt,_T)=>{"use strict";var Yy=mT(),uf=0,ya=1,zy=2;_T.exports=FB;function i_(t,e,n,r,o){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=o,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var Ip=i_.prototype;function r_(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function xT(t,e){var n=pf(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function gT(t,e){var n=t.intervals([]);n.push(e),xT(t,n)}function yT(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?uf:(n.splice(r,1),xT(t,n),ya)}Ip.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t};Ip.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?gT(this,t):this.left.insert(t):this.left=pf([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?gT(this,t):this.right.insert(t):this.right=pf([t]);else{var n=Yy.ge(this.leftPoints,t,s_),r=Yy.ge(this.rightPoints,t,a_);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}};Ip.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return uf;var n=this.right?this.right.count:0;if(4*n>3*(e-1))return yT(this,t);var r=this.left.remove(t);return r===zy?(this.left=null,this.count-=1,ya):(r===ya&&(this.count-=1),r)}else if(t[0]>this.mid){if(!this.right)return uf;var o=this.left?this.left.count:0;if(4*o>3*(e-1))return yT(this,t);var r=this.right.remove(t);return r===zy?(this.right=null,this.count-=1,ya):(r===ya&&(this.count-=1),r)}else{if(this.count===1)return this.leftPoints[0]===t?zy:uf;if(this.leftPoints.length===1&&this.leftPoints[0]===t){if(this.left&&this.right){for(var i=this,s=this.left;s.right;)i=s,s=s.right;if(i===this)s.right=this.right;else{var a=this.left,r=this.right;i.count-=s.count,i.right=s.left,s.left=a,s.right=r}r_(this,s),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?r_(this,this.left):r_(this,this.right);return ya}for(var a=Yy.ge(this.leftPoints,t,s_);a<this.leftPoints.length&&this.leftPoints[a][0]===t[0];++a)if(this.leftPoints[a]===t){this.count-=1,this.leftPoints.splice(a,1);for(var r=Yy.ge(this.rightPoints,t,a_);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),ya}return uf}};function bT(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var o=n(t[r]);if(o)return o}}function wT(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var o=n(t[r]);if(o)return o}}function vT(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}Ip.queryPoint=function(t,e){if(t<this.mid){if(this.left){var n=this.left.queryPoint(t,e);if(n)return n}return bT(this.leftPoints,t,e)}else if(t>this.mid){if(this.right){var n=this.right.queryPoint(t,e);if(n)return n}return wT(this.rightPoints,t,e)}else return vT(this.leftPoints,e)};Ip.queryInterval=function(t,e,n){if(t<this.mid&&this.left){var r=this.left.queryInterval(t,e,n);if(r)return r}if(e>this.mid&&this.right){var r=this.right.queryInterval(t,e,n);if(r)return r}return e<this.mid?bT(this.leftPoints,e,n):t>this.mid?wT(this.rightPoints,t,n):vT(this.leftPoints,n)};function DB(t,e){return t-e}function s_(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function a_(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function pf(t){if(t.length===0)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(DB);for(var r=e[e.length>>1],o=[],i=[],s=[],n=0;n<t.length;++n){var a=t[n];a[1]<r?o.push(a):r<a[0]?i.push(a):s.push(a)}var c=s,f=s.slice();return c.sort(s_),f.sort(a_),new i_(r,pf(o),pf(i),c,f)}function o_(t){this.root=t}var hf=o_.prototype;hf.insert=function(t){this.root?this.root.insert(t):this.root=new i_(t[0],null,null,[t],[t])};hf.remove=function(t){if(this.root){var e=this.root.remove(t);return e===zy&&(this.root=null),e!==uf}return!1};hf.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)};hf.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)};Object.defineProperty(hf,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(hf,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function FB(t){return!t||t.length===0?new o_(null):new o_(pf(t))}});var oi=Symbol("Fixed"),Ne=Symbol("Transient"),xf=Symbol("Transform");var j_={};function bf(t,e=!1){let n,r,o=j_;function i(f){n=t(f).finally(()=>{if(r){let{value:l}=r;r=null,i(l)}else n=null})}function s(f){r={event:f}}function a(f){n?s(f):i(f)}function c(f){o!==f&&requestAnimationFrame(()=>{let l=o;o=j_,a(l)}),o=f}return e?c:a}var wf=class{constructor(e){this._filterBy=e,this._requestUpdate=bf(()=>this.requestQuery(),!0),this._coordinator=null}get coordinator(){return this._coordinator}set coordinator(e){this._coordinator=e}get filterBy(){return this._filterBy}get filterIndexable(){return!0}fields(){return null}fieldInfo(e){return this}query(e){return null}queryPending(){return this}queryResult(e){return this}queryError(e){return this}requestQuery(e){let n=e||this.query(this.filterBy?.predicate(this));return this._coordinator.requestQuery(this,n)}requestUpdate(){this._requestUpdate()}initialize(){return this._coordinator.initializeClient(this)}update(){return this}};var vf=Uint8Array.of(65,82,82,79,87,49),Bn={V1:0,V2:1,V3:2,V4:3,V5:4};var zn={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},B={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},va={HALF:0,SINGLE:1,DOUBLE:2},fo={DAY:0,MILLISECOND:1},we={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},Yn={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},lo={Sparse:0,Dense:1};var _a=Uint8Array,jp=Uint16Array,Xp=Uint32Array,Gp=BigUint64Array,_f=Int8Array,X_=Int16Array,yn=Int32Array,Sn=BigInt64Array,l1=Float32Array,ii=Float64Array;function G_(t,e){let n=Math.log2(t)-3;return(e?[_f,X_,yn,Sn]:[_a,jp,Xp,Gp])[n]}var hY=Object.getPrototypeOf(Int8Array);function Ma(t,e){let n=0,r=t.length;if(r<=2147483648)do{let o=n+r>>>1;t[o]<=e?n=o+1:r=o}while(n<r);else do{let o=Math.trunc((n+r)/2);t[o]<=e?n=o+1:r=o}while(n<r);return n}function Vp(t,e,n){if(e(t))return t;throw new Error(n(t))}function xn(t,e,n){return e=Array.isArray(e)?e:Object.values(e),Vp(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function Wp(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}var uo=t=>`Unsupported data type: "${Wp(B,t)}" (id ${t})`,Mf=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function V_(t){return Object.hasOwn(t,"name")&&W_(t.type)}function W_(t){return typeof t?.typeId=="number"}function si(t,e="",n=!0){return V_(t)?t:Mf(e,Vp(t,W_,()=>"Data type expected."),n)}var Hp=(t,e,n=!1,r=-1)=>({typeId:B.Dictionary,id:r,dictionary:t,indices:e||Sa(),ordered:n});var Qp=(t=32,e=!0)=>({typeId:B.Int,bitWidth:xn(t,[8,16,32,64]),signed:e,values:G_(t,e)});var Sa=()=>Qp(32);var u1=(t=2)=>({typeId:B.Float,precision:xn(t,va),values:[jp,l1,ii][t]});var p1=()=>({typeId:B.Binary,offsets:yn}),Zp=()=>({typeId:B.Utf8,offsets:yn});var h1=(t,e,n=128)=>({typeId:B.Decimal,precision:t,scale:e,bitWidth:xn(n,[128,256]),values:Gp}),d1=t=>({typeId:B.Date,unit:xn(t,fo),values:t===fo.DAY?yn:Sn});var m1=(t=we.MILLISECOND,e=32)=>({typeId:B.Time,unit:xn(t,we),bitWidth:xn(e,[32,64]),values:e===32?yn:Sn});var Kp=(t=we.MILLISECOND,e=null)=>({typeId:B.Timestamp,unit:xn(t,we),timezone:e,values:Sn}),g1=(t=Yn.MONTH_DAY_NANO)=>({typeId:B.Interval,unit:xn(t,Yn),values:t===Yn.MONTH_DAY_NANO?void 0:yn}),Jp=t=>({typeId:B.List,children:[si(t)],offsets:yn}),th=t=>({typeId:B.Struct,children:Array.isArray(t)&&V_(t[0])?t:Object.entries(t).map(([e,n])=>Mf(e,n))}),y1=(t,e,n,r)=>(n??=e.map((o,i)=>i),{typeId:B.Union,mode:xn(t,lo),typeIds:n,typeMap:n.reduce((o,i,s)=>(o[i]=s,o),{}),children:e.map((o,i)=>si(o,`_${i}`)),typeIdForValue:r,offsets:yn}),x1=t=>({typeId:B.FixedSizeBinary,stride:t}),eh=(t,e)=>({typeId:B.FixedSizeList,stride:e,children:[si(t)]}),H_=(t,e)=>({typeId:B.Map,keysSorted:t,children:[e],offsets:yn});var b1=(t=we.MILLISECOND)=>({typeId:B.Duration,unit:xn(t,we),values:Sn}),w1=()=>({typeId:B.LargeBinary,offsets:Sn}),v1=()=>({typeId:B.LargeUtf8,offsets:Sn}),_1=t=>({typeId:B.LargeList,children:[si(t)],offsets:Sn}),M1=(t,e)=>({typeId:B.RunEndEncoded,children:[Vp(si(t,"run_ends"),n=>n.type.typeId===B.Int,()=>"Run-ends must have an integer type."),si(e,"values")]});var S1=t=>({typeId:B.ListView,children:[si(t,"value")],offsets:yn}),A1=t=>({typeId:B.LargeListView,children:[si(t,"value")],offsets:Sn});var L9=new ii(2),nh=L9.buffer,_Y=new Sn(nh),MY=new Xp(nh),SY=new yn(nh),AY=new _a(nh);function _r(t){if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function rh(t,e){return Number(t/e)+Number(t%e)/Number(e)}var Aa=t=>BigInt.asUintN(64,t);function Z_(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=Aa(~t[n])|Aa(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function K_(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=Aa(~t[n])|Aa(~t[n+1])<<64n|Aa(~t[n+2])<<128n|Aa(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var F9=new TextDecoder("utf-8"),CY=new TextEncoder;function Ea(t){return F9.decode(t)}var as=4;function E1(t,e){return(t[e>>3]&1<<e%8)!==0}function je(t,e){let n=e+Pt(t,e),r=n-Pt(t,n),o=Oe(t,r);return(i,s,a=null)=>{if(i<o){let c=Oe(t,r+i);if(c)return s(t,n+c)}return a}}function ir(t,e){return e}function ai(t,e){return!!P9(t,e)}function P9(t,e){return Sf(t,e)<<24>>24}function Sf(t,e){return t[e]}function Oe(t,e){return q9(t,e)<<16>>16}function q9(t,e){return t[e]|t[e+1]<<8}function Pt(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function J_(t,e){return Pt(t,e)>>>0}function ve(t,e){return _r(BigInt.asIntN(64,BigInt(J_(t,e))+(BigInt(J_(t,e+as))<<32n)))}function cs(t,e){let n=e+Pt(t,e),r=Pt(t,n);return n+=as,Ea(t.subarray(n,n+r))}function An(t,e,n,r){if(!e)return[];let o=e+Pt(t,e);return Array.from({length:Pt(t,o)},(i,s)=>r(t,o+as+s*n))}var T1=Symbol("rowIndex");function Af(t,e){class n{constructor(i){this[T1]=i}toJSON(){return t6(t,e,this[T1])}}let r=n.prototype;for(let o=0;o<t.length;++o){if(Object.hasOwn(r,t[o]))continue;let i=e[o];Object.defineProperty(r,t[o],{get(){return i.at(this[T1])},enumerable:!0})}return o=>new n(o)}function oh(t,e){return n=>t6(t,e,n)}function t6(t,e,n){let r={};for(let o=0;o<t.length;++o)r[t[o]]=e[o].at(n);return r}function e6(t){return t instanceof ci}var fs=class{static ArrayType=null;constructor({length:e,nullCount:n,type:r,validity:o,values:i,offsets:s,sizes:a,children:c}){this.length=e,this.nullCount=n,this.type=r,this.validity=o,this.values=i,this.offsets=s,this.sizes=a,this.children=c,(!n||!this.validity)&&(this.at=f=>this.value(f))}get[Symbol.toStringTag](){return"Batch"}at(e){return this.isValid(e)?this.value(e):null}isValid(e){return E1(this.validity,e)}value(e){return this.values[e]}slice(e,n){let r=n-e,o=Array(r);for(let i=0;i<r;++i)o[i]=this.at(e+i);return o}*[Symbol.iterator](){for(let e=0;e<this.length;++e)yield this.at(e)}},ci=class extends fs{constructor(e){super(e);let{length:n,values:r}=this;this.values=r.subarray(0,n)}slice(e,n){return this.nullCount?super.slice(e,n):this.values.subarray(e,n)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},Ef=class extends fs{static ArrayType=ii},Zt=class extends fs{static ArrayType=Array},Tf=class extends Zt{value(e){return null}},Mr=class extends Ef{value(e){return _r(this.values[e])}},ih=class extends Ef{value(e){let n=this.values[e],r=(n&31744)>>10,o=(n&1023)/1024,i=(-1)**((n&32768)>>15);switch(r){case 31:return i*(o?Number.NaN:1/0);case 0:return i*(o?6103515625e-14*o:0)}return i*2**(r-15)*(1+o)}},sh=class extends Zt{value(e){return E1(this.values,e)}},ah=class extends fs{constructor(e){super(e);let{bitWidth:n,scale:r}=this.type;this.decimal=n===128?Z_:K_,this.scale=10n**BigInt(r)}},ch=class extends ah{static ArrayType=ii;value(e){return rh(this.decimal(this.values,e),this.scale)}},fh=class extends ah{static ArrayType=Array;value(e){return this.decimal(this.values,e)}},If=class extends Zt{constructor(e){super(e),this.source=e}value(e){return new Date(this.source.value(e))}},lh=class extends Ef{value(e){return 864e5*this.values[e]}},n6=Mr,uh=class extends Mr{value(e){return super.value(e)*1e3}},r6=Mr,ph=class extends Mr{value(e){return rh(this.values[e],1000n)}},hh=class extends Mr{value(e){return rh(this.values[e],1000000n)}},dh=class extends Zt{value(e){return this.values.subarray(e<<1,e+1<<1)}},mh=class extends Zt{value(e){let n=this.values,r=e<<4;return Float64Array.of(Pt(n,r),Pt(n,r+4),ve(n,r+8))}},o6=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),i6=({values:t,offsets:e},n)=>t.subarray(_r(e[n]),_r(e[n+1])),gh=class extends Zt{value(e){return o6(this,e)}},yh=class extends Zt{value(e){return i6(this,e)}},xh=class extends Zt{value(e){return Ea(o6(this,e))}},bh=class extends Zt{value(e){return Ea(i6(this,e))}},wh=class extends Zt{value(e){let n=this.offsets;return this.children[0].slice(n[e],n[e+1])}},vh=class extends Zt{value(e){let n=this.offsets;return this.children[0].slice(_r(n[e]),_r(n[e+1]))}},_h=class extends Zt{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(n,r)}},Mh=class extends Zt{value(e){let n=this.offsets[e],r=n+this.sizes[e];return this.children[0].slice(_r(n),_r(r))}},Sh=class extends Zt{constructor(e){super(e),this.stride=this.type.stride}},Ah=class extends Sh{value(e){let{stride:n,values:r}=this;return r.subarray(e*n,(e+1)*n)}},Eh=class extends Sh{value(e){let{children:n,stride:r}=this;return n[0].slice(e*r,(e+1)*r)}};function s6({children:t,offsets:e},n){let[r,o]=t[0].children,i=e[n],s=e[n+1],a=[];for(let c=i;c<s;++c)a.push([r.at(c),o.at(c)]);return a}var Th=class extends Zt{value(e){return s6(this,e)}},Ih=class extends Zt{value(e){return new Map(s6(this,e))}},$f=class extends Zt{constructor({typeIds:e,...n}){super(n),this.typeIds=e,this.typeMap=this.type.typeMap}value(e,n=e){let{typeIds:r,children:o,typeMap:i}=this;return o[i[r[e]]].at(n)}},$h=class extends $f{value(e){return super.value(e,this.offsets[e])}},Cf=class extends Zt{constructor(e,n=oh){super(e),this.names=this.type.children.map(r=>r.name),this.factory=n(this.names,this.children)}value(e){return this.factory(e)}},Ch=class extends Cf{constructor(e){super(e,Af)}},kh=class extends Zt{value(e){let[{values:n},r]=this.children;return r.at(Ma(n,e))}},Nh=class extends Zt{setDictionary(e){return this.dictionary=e,this.cache=e.cache(),this}value(e){return this.cache[this.key(e)]}key(e){return this.values[e]}},Oh=class extends Zt{constructor({data:e,...n}){super(n),this.data=e}view(e){let{values:n,data:r}=this,o=e<<4,i=o+4,s=n,a=Pt(s,o);return a>12&&(i=Pt(s,o+12),s=r[Pt(s,o+8)]),s.subarray(i,i+a)}},Rh=class extends Oh{value(e){return this.view(e)}},Lh=class extends Oh{value(e){return Ea(this.view(e))}};function I1(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new ls(e,t)}}var ls=class{constructor(e,n=e[0]?.type){this.type=n,this.length=e.reduce((i,s)=>i+s.length,0),this.nullCount=e.reduce((i,s)=>i+s.nullCount,0),this.data=e;let r=e.length,o=new Int32Array(r+1);if(r===1){let[i]=e;o[1]=i.length,this.at=s=>i.at(s)}else for(let i=0,s=0;i<r;++i)o[i+1]=s+=e[i].length;this.offsets=o}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let e=this.data;return e.length===1?e[0][Symbol.iterator]():B9(e)}at(e){let{data:n,offsets:r}=this,o=Ma(r,e)-1;return n[o]?.at(e-r[o])}get(e){return this.at(e)}toArray(){let{length:e,nullCount:n,data:r}=this,o=!n&&e6(r[0]),i=r.length;if(o&&i===1)return r[0].values;let s=!i||n>0?Array:r[0].constructor.ArrayType??r[0].values.constructor,a=new s(e);return o?z9(a,r):Y9(a,r)}cache(){return this._cache??(this._cache=this.toArray())}};function*B9(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function z9(t,e){for(let n=0,r=0;n<e.length;++n){let{values:o}=e[n];t.set(o,r),r+=o.length}return t}function Y9(t,e){let n=-1;for(let r=0;r<e.length;++r){let o=e[r];for(let i=0;i<o.length;++i)t[++n]=o.at(i)}return t}var Ta=class t{constructor(e,n,r=!1){let o=e.fields.map(s=>s.name);this.schema=e,this.names=o,this.children=n,this.factory=r?Af:oh;let i=[];this.getFactory=s=>i[s]??(i[s]=this.factory(o,n.map(a=>a.data[s])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){return this.children[0]?.length??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:o,schema:i}=this,{fields:s}=i;return new t({...i,fields:e.map((a,c)=>U9(s[a],n[c]))},e.map(a=>r[a]),o===Af)}select(e,n){let r=this.names,o=e.map(i=>r.indexOf(i));return this.selectAt(o,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((o,i)=>r[o]=e[i]?.toArray()??[]),r}toArray(){let{children:e,getFactory:n,numRows:r}=this,o=e[0]?.data??[],i=Array(r);for(let s=0,a=-1;s<o.length;++s){let c=n(s);for(let f=0;f<o[s].length;++f)i[++a]=c(f)}return i}*[Symbol.iterator](){let{children:e,getFactory:n}=this,r=e[0]?.data??[];for(let o=0;o<r.length;++o){let i=n(o);for(let s=0;s<r[o].length;++s)yield i(s)}}at(e){let{children:n,getFactory:r,numRows:o}=this;if(e<0||e>=o)return null;let[{offsets:i}]=n,s=Ma(i,e)-1;return r(s)(e-i[s])}get(e){return this.at(e)}};function U9(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function kf(t,e={}){let{typeId:n,bitWidth:r,precision:o,unit:i}=t,{useBigInt:s,useDate:a,useDecimalBigInt:c,useMap:f,useProxy:l}=e;switch(n){case B.Null:return Tf;case B.Bool:return sh;case B.Int:case B.Time:case B.Duration:return s||r<64?ci:Mr;case B.Float:return o?ci:ih;case B.Date:return a6(i===fo.DAY?lh:n6,a&&If);case B.Timestamp:return a6(i===we.SECOND?uh:i===we.MILLISECOND?r6:i===we.MICROSECOND?ph:hh,a&&If);case B.Decimal:return c?fh:ch;case B.Interval:return i===Yn.DAY_TIME?dh:i===Yn.YEAR_MONTH?ci:mh;case B.FixedSizeBinary:return Ah;case B.Utf8:return xh;case B.LargeUtf8:return bh;case B.Binary:return gh;case B.LargeBinary:return yh;case B.BinaryView:return Rh;case B.Utf8View:return Lh;case B.List:return wh;case B.LargeList:return vh;case B.Map:return f?Ih:Th;case B.ListView:return _h;case B.LargeListView:return Mh;case B.FixedSizeList:return Eh;case B.Struct:return l?Ch:Cf;case B.RunEndEncoded:return kh;case B.Dictionary:return Nh;case B.Union:return t.mode?$h:$f}throw new Error(uo(n))}function a6(t,e){return e?class extends e{constructor(r){super(new t(r))}}:t}function j9(t,e){return{offset:ve(t,e),metadataLength:Pt(t,e+8),bodyLength:ve(t,e+16)}}function $1(t,e){return An(t,e,24,j9)}function Dh(t,e,n){let r=je(t,e);if(r(10,ir,0))throw new Error("Record batch compression not implemented");let o=n<Bn.V4?8:0;return{length:r(4,ve,0),nodes:An(t,r(6,ir),16,(i,s)=>({length:ve(i,s),nullCount:ve(i,s+8)})),regions:An(t,r(8,ir),16+o,(i,s)=>({offset:ve(i,s+o),length:ve(i,s+o+8)})),variadic:An(t,r(12,ir),8,ve)}}function c6(t,e,n){let r=je(t,e);return{id:r(4,ve,0),data:r(6,(o,i)=>Dh(o,i,n)),isDelta:r(8,ai,!1)}}function C1(t,e,n,r){xn(n,B,uo);let o=je(t,e);switch(n){case B.Binary:return p1();case B.Utf8:return Zp();case B.LargeBinary:return w1();case B.LargeUtf8:return v1();case B.List:return Jp(r[0]);case B.ListView:return S1(r[0]);case B.LargeList:return _1(r[0]);case B.LargeListView:return A1(r[0]);case B.Struct:return th(r);case B.RunEndEncoded:return M1(r[0],r[1]);case B.Int:return Qp(o(4,Pt,0),o(6,ai,!1));case B.Float:return u1(o(4,Oe,va.HALF));case B.Decimal:return h1(o(4,Pt,0),o(6,Pt,0),o(8,Pt,128));case B.Date:return d1(o(4,Oe,fo.MILLISECOND));case B.Time:return m1(o(4,Oe,we.MILLISECOND),o(6,Pt,32));case B.Timestamp:return Kp(o(4,Oe,we.SECOND),o(6,cs));case B.Interval:return g1(o(4,Oe,Yn.YEAR_MONTH));case B.Duration:return b1(o(4,Oe,we.MILLISECOND));case B.FixedSizeBinary:return x1(o(4,Pt,0));case B.FixedSizeList:return eh(r[0],o(4,Pt,0));case B.Map:return H_(o(4,ai,!1),r[0]);case B.Union:return y1(o(4,Oe,lo.Sparse),r,An(t,o(6,ir),4,Pt))}return{typeId:n}}function Nf(t,e){let n=An(t,e,4,(r,o)=>{let i=je(r,o);return[i(4,cs),i(6,cs)]});return n.length?new Map(n):null}function Fh(t,e,n){let r=je(t,e);return{version:n,endianness:r(4,Oe,0),fields:r(6,X9,[]),metadata:r(8,Nf)}}function X9(t,e){return An(t,e,4,f6)}function f6(t,e){let n=je(t,e),r=n(8,Sf,B.NONE),o=n(10,ir,0),i=n(12,V9),s=n(14,(c,f)=>G9(c,f)),a=C1(t,o,r,s);return i&&(i.dictionary=a,a=i),{name:n(4,cs),type:a,nullable:n(6,ai,!1),metadata:n(16,Nf)}}function G9(t,e){let n=An(t,e,4,f6);return n.length?n:null}function V9(t,e){if(!e)return null;let n=je(t,e);return Hp(null,n(6,W9,Sa()),n(8,ai,!1),n(4,ve,0))}function W9(t,e){return C1(t,e,B.Int)}var H9=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,Q9=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,Z9=t=>`Unsupported message type: ${t} (${Wp(zn,t)})`;function Ph(t,e){let n=Pt(t,e)||0;if(e+=as,n===-1&&(n=Pt(t,e)||0,e+=as),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw new Error(H9(n,r.byteLength));let o=je(r,0),i=o(4,Oe,Bn.V1),s=o(6,Sf,zn.NONE),a=o(8,ir,0),c=o(10,ve,0),f;if(a){let l=s===zn.Schema?Fh:s===zn.DictionaryBatch?c6:s===zn.RecordBatch?Dh:null;if(!l)throw new Error(Z9(s));if(f=l(r,a,i),c>0){let u=t.subarray(e,e+=c);if(u.byteLength<c)throw new Error(Q9(c,u.byteLength));f.body=u}}return{version:i,type:s,index:e,content:f}}function l6(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&K9(e)?tI(e):J9(e)}function K9(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(vf[e]!==t[e])return!1;return!0}function J9(t){let e=[t].flat(),n,r=[],o=[];for(let i of e){if(!(i instanceof Uint8Array))throw new Error("IPC data batch was not a Uint8Array.");let s=0;for(;;){let a=Ph(i,s);if(a===null)break;if(s=a.index,!!a.content)switch(a.type){case zn.Schema:n||(n=a.content);break;case zn.RecordBatch:r.push(a.content);break;case zn.DictionaryBatch:o.push(a.content);break}}}return{schema:n,dictionaries:o,records:r,metadata:null}}function tI(t){let e=t.byteLength-(vf.length+4),n=Pt(t,e),r=je(t,e-n),o=r(4,Oe,Bn.V1),i=r(8,$1,[]),s=r(10,$1,[]);return{schema:r(6,(a,c)=>Fh(a,c,o)),dictionaries:i.map(({offset:a})=>Ph(t,a).content),records:s.map(({offset:a})=>Ph(t,a).content),metadata:r(12,Nf)}}function N1(t,e){return eI(l6(t),e)}function eI(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:o}=t,{version:i,fields:s}=n,a=new Map,c=rI(e,i,a),f=new Map;nI(n,p=>{let h=p.type;h.typeId===B.Dictionary&&f.set(h.id,h.dictionary)});let l=new Map;for(let p of r){let{id:h,data:d,isDelta:m,body:g}=p,y=f.get(h),x=k1(y,c({...d,body:g}));if(l.has(h)){let w=l.get(h);m||w.clear(),w.add(x)}else{if(m)throw new Error("Delta update can not be first dictionary batch.");l.set(h,I1(y).add(x))}}l.forEach((p,h)=>a.set(h,p.done()));let u=s.map(p=>I1(p.type));for(let p of o){let h=c(p);s.forEach((d,m)=>u[m].add(k1(d.type,h)))}return new Ta(n,u.map(p=>p.done()),e.useProxy)}function nI(t,e){t.fields.forEach(function n(r){e(r),r.type.dictionary?.children?.forEach(n),r.type.children?.forEach(n)})}function rI(t,e,n){let r={version:e,options:t,dictionary:o=>n.get(o)};return o=>{let{length:i,nodes:s,regions:a,variadic:c,body:f}=o,l=-1,u=-1,p=-1;return{...r,length:i,node:()=>s[++l],buffer:h=>{let{length:d,offset:m}=a[++u];return h?new h(f.buffer,f.byteOffset+m,d/h.BYTES_PER_ELEMENT):f.subarray(m,m+d)},variadic:()=>c[++p],visit(h){return h.map(d=>k1(d.type,this))}}}}function k1(t,e){let{typeId:n}=t,{length:r,options:o,node:i,buffer:s,variadic:a,version:c}=e,f=kf(t,o);if(n===B.Null)return new f({length:r,nullCount:r,type:t});let l={...i(),type:t};switch(n){case B.Bool:case B.Int:case B.Time:case B.Duration:case B.Float:case B.Decimal:case B.Date:case B.Timestamp:case B.Interval:case B.FixedSizeBinary:return new f({...l,validity:s(),values:s(t.values)});case B.Utf8:case B.LargeUtf8:case B.Binary:case B.LargeBinary:return new f({...l,validity:s(),offsets:s(t.offsets),values:s()});case B.BinaryView:case B.Utf8View:return new f({...l,validity:s(),values:s(),data:Array.from({length:a()},()=>s())});case B.List:case B.LargeList:case B.Map:return new f({...l,validity:s(),offsets:s(t.offsets),children:e.visit(t.children)});case B.ListView:case B.LargeListView:return new f({...l,validity:s(),offsets:s(t.offsets),sizes:s(t.offsets),children:e.visit(t.children)});case B.FixedSizeList:case B.Struct:return new f({...l,validity:s(),children:e.visit(t.children)});case B.RunEndEncoded:return new f({...l,children:e.visit(t.children)});case B.Dictionary:{let{id:u,indices:p}=t;return new f({...l,validity:s(),values:s(p.values)}).setDictionary(e.dictionary(u))}case B.Union:return c<Bn.V5&&s(),new f({...l,typeIds:s(_f),offsets:t.mode===lo.Sparse?null:s(t.offsets),children:e.visit(t.children)});default:throw new Error(uo(n))}}var ij=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;function Of(t){return N1(t,{useDate:!0})}function O1(t="ws://localhost:3000/"){let e=[],n=!1,r=null,o,i={open(){n=!0,c()},close(){for(n=!1,r=null,o=null;e.length;)e.shift().reject("Socket closed")},error(f){if(r){let{reject:l}=r;r=null,c(),l(f)}else console.error("WebSocket error: ",f)},message({data:f}){if(r){let{query:l,resolve:u,reject:p}=r;if(r=null,c(),typeof f=="string"){let h=JSON.parse(f);h.error?p(h.error):u(h)}else if(l.type==="exec")u();else if(l.type==="arrow")u(Of(f));else throw new Error(`Unexpected socket data: ${f}`)}else console.log("WebSocket message: ",f)}};function s(){o=new WebSocket(t),o.binaryType="arraybuffer";for(let f in i)o.addEventListener(f,i[f])}function a(f,l,u){o==null&&s(),e.push({query:f,resolve:l,reject:u}),n&&!r&&c()}function c(){e.length&&(r=e.shift(),o.send(JSON.stringify(r.query)))}return{get connected(){return n},query(f){return new Promise((l,u)=>a(f,l,u))}}}var bn=class{constructor(e,n){e&&(this.table=String(e)),n&&(this.column=n)}get columns(){return this.column?[this.column]:[]}toString(){let{table:e,column:n}=this;if(n){let r=n.startsWith("*")?n:`"${n}"`;return`${e?`${y6(e)}.`:""}${r}`}else return e?y6(e):"NULL"}};function y6(t){return t.split(".").map(n=>`"${n}"`).join(".")}function x6(t,e){return t instanceof bn&&t.column===e}function _t(t){return typeof t=="string"?qh(t):t}function ps(t){return typeof t=="string"?b6(t):t}function b6(t){return new bn(t)}function qh(t,e=null){return arguments.length===1&&(e=t,t=null),new bn(t,e)}function ho(t){switch(typeof t){case"boolean":return t?"TRUE":"FALSE";case"string":return`'${t.replace("'","''")}'`;case"number":return Number.isFinite(t)?String(t):"NULL";default:if(t==null)return"NULL";if(t instanceof Date){let e=+t;if(Number.isNaN(e))return"NULL";let n=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate();return e===Date.UTC(n,r,o)?`MAKE_DATE(${n}, ${r+1}, ${o})`:`EPOCH_MS(${e})`}else return t instanceof RegExp?`'${t.source}'`:String(t)}}var mo=t=>typeof t?.addEventListener=="function";function Bh(t){return t instanceof go}var go=class{constructor(e,n,r){this._expr=Array.isArray(e)?e:[e],this._deps=n||[],this.annotate(r);let o=this._expr.filter(i=>mo(i));o.length>0?(this._params=Array.from(new Set(o)),this._params.forEach(i=>{i.addEventListener("value",()=>EI(this,this.map?.get("value")))})):this.addEventListener=void 0}get value(){return this}get columns(){let{_params:e,_deps:n}=this;if(e){let r=new Set(e.flatMap(o=>{let i=o.value?.columns;return Array.isArray(i)?i:[]}));if(r.size){let o=new Set(n);return r.forEach(i=>o.add(i)),Array.from(o)}}return n}get column(){return this._deps.length?this._deps[0]:this.columns[0]}annotate(...e){return Object.assign(this,...e)}toString(){return this._expr.map(e=>mo(e)&&!Bh(e)?ho(e.value):e).join("")}addEventListener(e,n){let r=this.map||(this.map=new Map);(r.get(e)||(r.set(e,new Set),r.get(e))).add(n)}};function EI(t,e){if(e?.size)return Promise.allSettled(Array.from(e,n=>n(t)))}function R1(t,e){let n=[t[0]],r=new Set,o=e.length;for(let i=0,s=0;i<o;){let a=e[i];mo(a)?n[++s]=a:(Array.isArray(a?.columns)&&a.columns.forEach(f=>r.add(f)),n[s]+=typeof a=="string"?a:ho(a));let c=t[++i];mo(n[s])?n[++s]=c:n[s]+=c}return{spans:n,cols:Array.from(r)}}function Y(t,...e){let{spans:n,cols:r}=R1(t,e);return new go(n,r)}var zh=t=>({value:t,toString:()=>ho(t)});function Rf(t){t(this.op,this),this.children?.forEach(e=>e.visit(t))}function w6(t,e){let n=e.filter(o=>o!=null).map(_t),r=n.map((o,i)=>i?` ${t} `:"");return n.length===1?r.push(""):n.length>1&&(r[0]="(",r.push(")")),Y(r,...n).annotate({op:t,children:n,visit:Rf})}var Un=(...t)=>w6("AND",t.flat()),Lf=(...t)=>w6("OR",t.flat()),TI=t=>e=>Y`(${t} ${_t(e)})`.annotate({op:t,a:e,visit:Rf}),II=TI("NOT"),v6=t=>e=>Y`(${_t(e)} ${t})`.annotate({op:t,a:e,visit:Rf}),Df=v6("IS NULL"),hs=v6("IS NOT NULL"),fi=t=>(e,n)=>Y`(${_t(e)} ${t} ${_t(n)})`.annotate({op:t,a:e,b:n,visit:Rf}),$I=fi("="),Ff=fi("<>"),ds=fi("<"),L1=fi(">"),ms=fi("<="),CI=fi(">="),kI=fi("IS DISTINCT FROM"),Yh=fi("IS NOT DISTINCT FROM");function NI(t,e,n,r){e=_t(e);let o=t.startsWith("NOT ")?"NOT ":"";return(n?r?Y`${o}(${n[0]} <= ${e} AND ${e} < ${n[1]})`:Y`(${e} ${t} ${n[0]} AND ${n[1]})`:Y``).annotate({op:t,visit:Rf,field:e,range:n})}var _e=(t,e,n)=>NI("BETWEEN",t,e,n);function gs(t,e){return Array.from({length:t},()=>e)}function Re(t,e){return(...n)=>{let r=n.map(_t),o=e?`::${e}`:"";return(r.length?Y([`${t}(`,...gs(r.length-1,", "),`)${o}`],...r):Y`${t}()${o}`).annotate({func:t,args:r})}}var _6=Re("REGEXP_MATCHES"),M6=Re("CONTAINS"),S6=Re("PREFIX"),A6=Re("SUFFIX"),OI=Re("LOWER"),RI=Re("UPPER"),LI=Re("LENGTH"),DI=Re("ISNAN"),FI=Re("ISFINITE"),PI=Re("ISINF");var Pf=class t extends go{constructor(e,n,r,o,i="",s="",a=""){let c;if(o&&!(i||s||a))c=o?Y`${n} OVER "${o}"`:Y`${n} OVER ()`;else{let p=i&&s?" ":"",h=(i||s)&&a?" ":"";c=Y`${n} OVER (${o?`"${o}" `:""}${i}${p}${s}${h}${a})`}r&&(c=Y`(${c})::${r}`);let{_expr:l,_deps:u}=c;super(l,u),this.window=e,this.func=n,this.type=r,this.name=o,this.group=i,this.order=s,this.frame=a}get basis(){return this.column}get label(){let{func:e}=this;return e.label??e.toString()}over(e){let{window:n,func:r,type:o,group:i,order:s,frame:a}=this;return new t(n,r,o,e,i,s,a)}partitionby(...e){let n=e.flat().filter(l=>l).map(_t),r=Y(["PARTITION BY ",gs(n.length-1,", "),""],...n),{window:o,func:i,type:s,name:a,order:c,frame:f}=this;return new t(o,i,s,a,r,c,f)}orderby(...e){let n=e.flat().filter(l=>l).map(_t),r=Y(["ORDER BY ",gs(n.length-1,", "),""],...n),{window:o,func:i,type:s,name:a,group:c,frame:f}=this;return new t(o,i,s,a,c,r,f)}rows(e){let n=E6("ROWS",e),{window:r,func:o,type:i,name:s,group:a,order:c}=this;return new t(r,o,i,s,a,c,n)}range(e){let n=E6("RANGE",e),{window:r,func:o,type:i,name:s,group:a,order:c}=this;return new t(r,o,i,s,a,c,n)}};function E6(t,e){if(mo(e)){let n=Y`${e}`;return n.toString=()=>`${t} ${T6(e.value)}`,n}return`${t} ${T6(e)}`}function T6(t){let[e,n]=t,r=e===0?"CURRENT ROW":Number.isFinite(e)?`${Math.abs(e)} PRECEDING`:"UNBOUNDED PRECEDING",o=n===0?"CURRENT ROW":Number.isFinite(n)?`${Math.abs(n)} FOLLOWING`:"UNBOUNDED FOLLOWING";return`BETWEEN ${r} AND ${o}`}function sr(t,e){return(...n)=>{let r=Re(t)(...n);return new Pf(t,r,e)}}var qI=sr("ROW_NUMBER","INTEGER"),BI=sr("RANK","INTEGER"),zI=sr("DENSE_RANK","INTEGER"),YI=sr("PERCENT_RANK"),UI=sr("CUME_DIST"),jI=sr("NTILE"),XI=sr("LAG"),GI=sr("LEAD"),VI=sr("FIRST_VALUE"),WI=sr("LAST_VALUE"),HI=sr("NTH_VALUE");function St(t,...e){return Y(t,...e).annotate({aggregate:!0})}var D1=class t extends go{constructor(e,n,r,o,i){n=(n||[]).map(_t);let{strings:s,exprs:a}=QI(e,n,r,o,i),{spans:c,cols:f}=R1(s,a);super(c,f),this.aggregate=e,this.args=n,this.type=r,this.isDistinct=o,this.filter=i}get basis(){return this.column}get label(){let{aggregate:e,args:n,isDistinct:r}=this,o=r?"DISTINCT"+(n.length?" ":""):"",i=n.length?`(${o}${n.map(ZI).join(", ")})`:"";return`${e.toLowerCase()}${i}`}distinct(){let{aggregate:e,args:n,type:r,filter:o}=this;return new t(e,n,r,!0,o)}where(e){let{aggregate:n,args:r,type:o,isDistinct:i}=this;return new t(n,r,o,i,e)}window(){let{aggregate:e,args:n,type:r,isDistinct:o}=this,i=new t(e,n,null,o);return new Pf(e,i,r)}partitionby(...e){return this.window().partitionby(...e)}orderby(...e){return this.window().orderby(...e)}rows(e){return this.window().rows(e)}range(e){return this.window().range(e)}};function QI(t,e,n,r,o){let i=`)${n?`::${n}`:""}`,s=[`${t}(${r?"DISTINCT ":""}`],a=[];return e.length?(s=s.concat([...gs(e.length-1,", "),`${i}${o?" FILTER (WHERE ":""}`,...o?[")"]:[]]),a=[...e,...o?[o]:[]]):s[0]+="*"+i,{exprs:a,strings:s}}function ZI(t){let e=ho(t);return e&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Et(t,e){return(...n)=>new D1(t,n,e)}var En=Et("COUNT","INTEGER"),F1=Et("AVG"),KI=Et("AVG"),JI=Et("MAD"),li=Et("MAX"),ui=Et("MIN"),ar=Et("SUM","DOUBLE"),t$=Et("PRODUCT"),e$=Et("MEDIAN"),n$=Et("QUANTILE"),r$=Et("MODE"),o$=Et("VARIANCE"),P1=Et("STDDEV"),i$=Et("SKEWNESS"),s$=Et("KURTOSIS"),a$=Et("ENTROPY"),c$=Et("VAR_POP"),f$=Et("STDDEV_POP"),l$=Et("CORR"),u$=Et("COVAR_SAMP"),p$=Et("COVAR_POP"),q1=Et("REGR_INTERCEPT"),B1=Et("REGR_SLOPE"),z1=Et("REGR_COUNT"),h$=Et("REGR_R2"),Y1=Et("REGR_SYY"),U1=Et("REGR_SXX"),d$=Et("REGR_SXY"),j1=Et("REGR_AVGX"),m$=Et("REGR_AVGY"),g$=Et("FIRST"),y$=Et("LAST"),Uh=Et("ARG_MIN"),jh=Et("ARG_MAX"),x$=Et("STRING_AGG"),b$=Et("ARRAY_AGG");function I6(t,e){let n=_t(t),r=Y`CAST(${n} AS ${e})`;return Object.defineProperty(r,"label",{enumerable:!0,get(){return t.label}}),Object.defineProperty(r,"aggregate",{enumerable:!0,get(){return t.aggregate||!1}}),r}var Xh=t=>I6(t,"DOUBLE");var X1=t=>Y`epoch_ms(${_t(t)})`;function G1(t,e,n=1){let r=`INTERVAL ${n} ${e}`,o=_t(t);return Y`TIME_BUCKET(${r}, ${o})`.annotate({label:e})}var V1=Re("ST_AsGeoJSON"),w$=Re("ST_X"),v$=Re("ST_Y"),_$=Re("ST_CENTROID");var yt=class t{static select(...e){return new t().select(...e)}static from(...e){return new t().from(...e)}static with(...e){return new t().with(...e)}static union(...e){return new ys("UNION",e.flat())}static unionAll(...e){return new ys("UNION ALL",e.flat())}static intersect(...e){return new ys("INTERSECT",e.flat())}static except(...e){return new ys("EXCEPT",e.flat())}static describe(e){let n=e.clone(),{clone:r,toString:o}=n;return Object.assign(n,{describe:!0,clone:()=>t.describe(r.call(n)),toString:()=>`DESCRIBE ${o.call(n)}`})}constructor(){this.query={with:[],select:[],from:[],where:[],groupby:[],having:[],window:[],qualify:[],orderby:[]},this.cteFor=null}clone(){let e=new t;return e.query={...this.query},e}with(...e){let{query:n}=this;if(e.length===0)return n.with;{let r=[],o=(i,s)=>{let a=s.clone();a.cteFor=this,r.push({as:i,query:a})};return e.flat().forEach(i=>{if(i!=null)if(i.as&&i.query)o(i.as,i.query);else for(let s in i)o(s,i[s])}),n.with=n.with.concat(r),this}}select(...e){let{query:n}=this;if(e.length===0)return n.select;{let r=[];for(let i of e.flat())if(i!=null)if(typeof i=="string")r.push({as:i,expr:_t(i)});else if(i instanceof bn)r.push({as:i.column,expr:i});else if(Array.isArray(i))r.push({as:i[0],expr:i[1]});else for(let s in i)r.push({as:Gh(s),expr:_t(i[s])});let o=new Set(r.map(i=>i.as));return n.select=n.select.filter(i=>!o.has(i.as)).concat(r.filter(i=>i.expr)),this}}$select(...e){return this.query.select=[],this.select(...e)}distinct(e=!0){return this.query.distinct=!!e,this}from(...e){let{query:n}=this;if(e.length===0)return n.from;{let r=[];return e.flat().forEach(o=>{if(o!=null)if(typeof o=="string")r.push({as:o,from:ps(o)});else if(o instanceof bn)r.push({as:o.table,from:o});else if(qf(o)||Bh(o))r.push({from:o});else if(Array.isArray(o))r.push({as:Gh(o[0]),from:ps(o[1])});else for(let i in o)r.push({as:Gh(i),from:ps(o[i])})}),n.from=n.from.concat(r),this}}$from(...e){return this.query.from=[],this.from(...e)}sample(e,n){let{query:r}=this;if(arguments.length===0)return r.sample;{let o=e;return typeof e=="number"&&(o=e>0&&e<1?{perc:100*e,method:n}:{rows:Math.round(e),method:n}),r.sample=o,this}}where(...e){let{query:n}=this;return e.length===0?n.where:(n.where=n.where.concat(e.flat().filter(r=>r)),this)}$where(...e){return this.query.where=[],this.where(...e)}groupby(...e){let{query:n}=this;return e.length===0?n.groupby:(n.groupby=n.groupby.concat(e.flat().filter(r=>r).map(_t)),this)}$groupby(...e){return this.query.groupby=[],this.groupby(...e)}having(...e){let{query:n}=this;return e.length===0?n.having:(n.having=n.having.concat(e.flat().filter(r=>r)),this)}window(...e){let{query:n}=this;if(e.length===0)return n.window;{let r=[];return e.flat().forEach(o=>{if(o!=null)for(let i in o)r.push({as:Gh(i),expr:o[i]})}),n.window=n.window.concat(r),this}}qualify(...e){let{query:n}=this;return e.length===0?n.qualify:(n.qualify=n.qualify.concat(e.flat().filter(r=>r)),this)}orderby(...e){let{query:n}=this;return e.length===0?n.orderby:(n.orderby=n.orderby.concat(e.flat().filter(r=>r).map(_t)),this)}limit(e){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(e)?e:void 0,this)}offset(e){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(e)?e:void 0,this)}get subqueries(){let{query:e,cteFor:n}=this,o=(n?.query||e).with?.reduce((s,{as:a,query:c})=>(s[a]=c,s),{}),i=[];return e.from.forEach(({from:s})=>{if(qf(s))i.push(s);else if(o[s.table]){let a=o[s.table];i.push(a)}}),i}toString(){let{with:e,select:n,distinct:r,from:o,sample:i,where:s,groupby:a,having:c,window:f,qualify:l,orderby:u,limit:p,offset:h}=this.query,d=[];if(e.length){let g=e.map(({as:y,query:x})=>`"${y}" AS (${x})`);d.push(`WITH ${g.join(", ")}`)}let m=n.map(({as:g,expr:y})=>x6(y,g)&&!y.table?`${y}`:`${y} AS "${g}"`);if(d.push(`SELECT${r?" DISTINCT":""} ${m.join(", ")}`),o.length){let g=o.map(({as:y,from:x})=>{let w=qf(x)?`(${x})`:`${x}`;return!y||y===x.table?w:`${w} AS "${y}"`});d.push(`FROM ${g.join(", ")}`)}if(s.length){let g=s.map(String).filter(y=>y).join(" AND ");g&&d.push(`WHERE ${g}`)}if(i){let{rows:g,perc:y,method:x,seed:w}=i,b=g?`${g} ROWS`:`${y} PERCENT`,_=x?` (${x}${w!=null?`, ${w}`:""})`:"";d.push(`USING SAMPLE ${b}${_}`)}if(a.length&&d.push(`GROUP BY ${a.join(", ")}`),c.length){let g=c.map(String).filter(y=>y).join(" AND ");g&&d.push(`HAVING ${g}`)}if(f.length){let g=f.map(({as:y,expr:x})=>`"${y}" AS (${x})`);d.push(`WINDOW ${g.join(", ")}`)}if(l.length){let g=l.map(String).filter(y=>y).join(" AND ");g&&d.push(`QUALIFY ${g}`)}return u.length&&d.push(`ORDER BY ${u.join(", ")}`),Number.isFinite(p)&&d.push(`LIMIT ${p}`),Number.isFinite(h)&&d.push(`OFFSET ${h}`),d.join(" ")}},ys=class t{constructor(e,n){this.op=e,this.queries=n.map(r=>r.clone()),this.query={orderby:[]},this.cteFor=null}clone(){let e=new t(this.op,this.queries);return e.query={...this.query},e}orderby(...e){let{query:n}=this;return e.length===0?n.orderby:(n.orderby=n.orderby.concat(e.flat().filter(r=>r).map(_t)),this)}limit(e){let{query:n}=this;return arguments.length===0?n.limit:(n.limit=Number.isFinite(e)?e:void 0,this)}offset(e){let{query:n}=this;return arguments.length===0?n.offset:(n.offset=Number.isFinite(e)?e:void 0,this)}get subqueries(){let{queries:e,cteFor:n}=this;return n&&e.forEach(r=>r.cteFor=n),e}toString(){let{op:e,queries:n,query:{orderby:r,limit:o,offset:i}}=this,s=[n.join(` ${e} `)];return r.length&&s.push(`ORDER BY ${r.join(", ")}`),Number.isFinite(o)&&s.push(`LIMIT ${o}`),Number.isFinite(i)&&s.push(`OFFSET ${i}`),s.join(" ")}};function qf(t){return t instanceof yt||t instanceof ys}function W1(t){return qf(t)&&t.describe}function Gh(t){return M$(t)?t.slice(1,-1):t}function M$(t){return t[0]==='"'&&t[t.length-1]==='"'}var Vh=t=>t;function $6(){return{apply:Vh,invert:Vh,sqlApply:_t,sqlInvert:Vh}}function S$({base:t=null}={}){if(t==null||t===Math.E)return{apply:Math.log,invert:Math.exp,sqlApply:e=>Y`LN(${_t(e)})`,sqlInvert:e=>Y`EXP(${e})`};if(t===10)return{apply:Math.log10,invert:e=>Math.pow(10,e),sqlApply:e=>Y`LOG(${_t(e)})`,sqlInvert:e=>Y`POW(10, ${e})`};{let e=+t;return{apply:n=>Math.log(n)/Math.log(e),invert:n=>Math.pow(e,n),sqlApply:n=>Y`LN(${_t(n)}) / LN(${e})`,sqlInvert:n=>Y`POW(${e}, ${n})`}}}function A$({constant:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.log1p(Math.abs(n)),invert:n=>Math.sign(n)*Math.exp(Math.abs(n)-e),sqlApply:n=>(n=_t(n),Y`SIGN(${n}) * LN(${e} + ABS(${n}))`),sqlInvert:n=>Y`SIGN(${n}) * (EXP(ABS(${n})) - ${e})`}}function E$(){return{apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*t*t,sqlApply:t=>(t=_t(t),Y`SIGN(${t}) * SQRT(ABS(${t}))`),sqlInvert:t=>Y`SIGN(${t}) * (${t}) ** 2`}}function T$({exponent:t=1}={}){let e=+t;return{apply:n=>Math.sign(n)*Math.pow(Math.abs(n),e),invert:n=>Math.sign(n)*Math.pow(Math.abs(n),1/e),sqlApply:n=>(n=_t(n),Y`SIGN(${n}) * POW(ABS(${n}), ${e})`),sqlInvert:n=>Y`SIGN(${n}) * POW(ABS(${n}), 1/${e})`}}function C6(){return{apply:t=>+t,invert:t=>new Date(t),sqlApply:t=>t instanceof Date?+t:X1(_t(t)),sqlInvert:Vh}}var I$={identity:$6,linear:$6,log:S$,symlog:A$,sqrt:E$,pow:T$,time:C6,utc:C6};function Bf(t){let e=I$[t.type];return e?{...t,...e(t)}:null}function Wh(t,e,{replace:n=!1,temp:r=!0,view:o=!1}={}){return"CREATE"+(n?" OR REPLACE ":" ")+(r?"TEMP ":"")+(o?"VIEW":"TABLE")+(n?" ":" IF NOT EXISTS ")+t+" AS "+e}function N6(t){if(!t.filterIndexable)return null;let e=t.query(),n=Zh(e,a=>a.from()?.[0].from.table);if(typeof n!="string"||!e.select)return null;let r=[],o=[],i={},s=a=>{let c=a.column;return`(SELECT AVG(${Zh(e,l=>l.select().find(u=>u.as===c)?.expr)??a}) FROM "${n}")`};for(let a of e.select()){let{as:c,expr:{aggregate:f,args:l}}=a,u=f?.toUpperCase?.();switch(u){case"COUNT":case"SUM":r.push({[c]:St`SUM("${c}")::DOUBLE`});break;case"AVG":r.push({[c]:C$(i,c,l[0])});break;case"ARG_MAX":r.push({[c]:k$(i,c,l)});break;case"ARG_MIN":r.push({[c]:N$(i,c,l)});break;case"VARIANCE":case"VAR_SAMP":i[c]=null,r.push({[c]:Hh(i,l[0],s)});break;case"VAR_POP":i[c]=null,r.push({[c]:Hh(i,l[0],s,!1)});break;case"STDDEV":case"STDDEV_SAMP":i[c]=null,r.push({[c]:St`SQRT(${Hh(i,l[0],s)})`});break;case"STDDEV_POP":i[c]=null,r.push({[c]:St`SQRT(${Hh(i,l[0],s,!1)})`});break;case"COVAR_SAMP":i[c]=null,r.push({[c]:Qh(i,l,s)});break;case"COVAR_POP":i[c]=null,r.push({[c]:Qh(i,l,s,!1)});break;case"CORR":i[c]=null,r.push({[c]:k6(i,l,s)});break;case"REGR_COUNT":i[c]=null,r.push({[c]:St`${Ia(i,l)}::DOUBLE`});break;case"REGR_AVGX":i[c]=null,r.push({[c]:L6(i,l)});break;case"REGR_AVGY":i[c]=null,r.push({[c]:D6(i,l)});break;case"REGR_SYY":i[c]=null,r.push({[c]:Q1(i,0,l,s)});break;case"REGR_SXX":i[c]=null,r.push({[c]:Q1(i,1,l,s)});break;case"REGR_SXY":i[c]=null,r.push({[c]:Qh(i,l,s,null)});break;case"REGR_SLOPE":i[c]=null,r.push({[c]:F6(i,l,s)});break;case"REGR_INTERCEPT":i[c]=null,r.push({[c]:O$(i,l,s)});break;case"REGR_R2":i[c]=null,r.push({[c]:St`(${k6(i,l,s)}) ** 2`});break;case"MAX":case"MIN":case"BIT_AND":case"BIT_OR":case"BIT_XOR":case"BOOL_AND":case"BOOL_OR":case"PRODUCT":r.push({[c]:St`${u}("${c}")`});break;default:if(!f)o.push(c);else return null}}return r.length?{from:n,dims:o,aggr:r,aux:i}:null}function cr(t,...e){let n=e.length?"_"+e.map($$).join("_"):"";return`__${t}${n}__`}function $$(t){return`${t}`.replaceAll('"',"").replaceAll(" ","_")}function Zh(t,e){let n=t.subqueries;if(t.select&&n.length===0)return e(t);let r=Zh(n[0],e);for(let o=1;o<n.length;++o){let i=Zh(n[o],e);if(i!==void 0&&i!==r)return NaN}return r}function O6(t,e){let n=cr("count",e);return t[n]=St`COUNT(${e})`,St`SUM(${n})`.annotate({name:n})}function C$(t,e,n){let r=O6(t,n);return St`(SUM("${e}" * ${r.name}) / ${r})`}function k$(t,e,[,n]){let r=cr("max",n);return t[r]=St`MAX(${n})`,St`ARG_MAX("${e}", ${r})`}function N$(t,e,[,n]){let r=cr("min",n);return t[r]=St`MIN(${n})`,St`ARG_MIN("${e}", ${r})`}function Hh(t,e,n,r=!0){let o=O6(t,e),i=cr("rssq",e),s=cr("rsum",e),a=Y`${e} - ${n(e)}`;return t[i]=St`SUM((${a}) ** 2)`,t[s]=St`SUM(${a})`,St`(SUM(${i}) - (SUM(${s}) ** 2 / ${o})) / (${o}${r?" - 1":""})`}function Qh(t,e,n,r=!0){let o=Ia(t,e),i=R6(t,e,n),s=zf(t,1,e,n),a=zf(t,0,e,n),c=r===null?"":r?` / (${o} - 1)`:` / ${o}`;return St`(${i} - ${s} * ${a} / ${o})${c}`}function k6(t,e,n){let r=Ia(t,e),o=R6(t,e,n),i=H1(t,1,e,n),s=H1(t,0,e,n),a=zf(t,1,e,n),c=zf(t,0,e,n),f=St`(${i} - (${a} ** 2) / ${r})`,l=St`(${s} - (${c} ** 2) / ${r})`;return St`(${o} - ${a} * ${c} / ${r}) / SQRT(${f} * ${l})`}function Ia(t,[e,n]){let r=cr("count",e,n);return t[r]=St`REGR_COUNT(${e}, ${n})`,St`SUM(${r})`.annotate({name:r})}function zf(t,e,n,r){let o=n[e],i=n[1-e],s=cr("rs",o);return t[s]=St`SUM(${o} - ${r(o)}) FILTER (${i} IS NOT NULL)`,St`SUM(${s})`}function H1(t,e,n,r){let o=n[e],i=n[1-e],s=cr("rss",o);return t[s]=St`SUM((${o} - ${r(o)}) ** 2) FILTER (${i} IS NOT NULL)`,St`SUM(${s})`}function R6(t,e,n){let[r,o]=e,i=cr("sxy",r,o);return t[i]=St`SUM((${o} - ${n(o)}) * (${r} - ${n(r)}))`,St`SUM(${i})`}function L6(t,e){let[n,r]=e,o=Ia(t,e),i=cr("avg",r,n);return t[i]=St`REGR_AVGX(${n}, ${r})`,St`(SUM(${i} * ${o.name}) / ${o})`}function D6(t,e){let[n,r]=e,o=Ia(t,e),i=cr("avg",n,r);return t[i]=St`REGR_AVGY(${n}, ${r})`,St`(SUM(${i} * ${o.name}) / ${o})`}function Q1(t,e,n,r){let o=Ia(t,n),i=zf(t,e,n,r),s=H1(t,e,n,r);return St`(${s} - (${i} ** 2 / ${o}))`}function F6(t,e,n){let r=Qh(t,e,n,null),o=Q1(t,1,e,n);return St`(${r}) / ${o}`}function O$(t,e,n){let r=L6(t,e),o=D6(t,e),i=F6(t,e,n);return St`${o} - (${i}) * ${r}`}function q6(t){let e=2166136261;for(let n=0,r=t.length;n<r;++n){let o=t.charCodeAt(n),i=o&65280;i&&(e=P6(e^i>>8)),e=P6(e^o&255)}return R$(e)}function P6(t){return t+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}function R$(t){return t+=t<<13,t^=t>>>7,t+=t<<3,t^=t>>>17,t+=t<<5,t&4294967295}var L$={skip:!0,result:null},Kh=class{constructor(e,{schema:n="mosaic",enabled:r=!0}={}){this.indexes=new Map,this.active=null,this.mc=e,this._schema=n,this._enabled=r}set enabled(e){this._enabled!==e&&(e||this.clear(),this._enabled=e)}get enabled(){return this._enabled}set schema(e){this._schema!==e&&(this.clear(),this._schema=e)}get schema(){return this._schema}dropIndexTables(){return this.clear(),this.mc.exec(`DROP SCHEMA IF EXISTS "${this.schema}" CASCADE`)}clear(){this.indexes.clear(),this.active=null}index(e,n,r){if(!this.enabled)return null;let{indexes:o,mc:i,schema:s}=this,{source:a}=r;if(!a||this.active&&(this.active.source!==a&&this.clear(),this.active?.source===null))return null;let{active:c}=this;if(!c&&(this.active=c=D$(r),c.source===null))return null;if(o.has(e))return o.get(e);let f=N6(e),l;if(!f)l=null;else if(n.skip(e,r))l=L$;else{let u=n.remove(a).predicate(e);l=q$(e.query(u),c,f,s),l.result=i.exec([`CREATE SCHEMA IF NOT EXISTS ${s}`,Wh(l.table,l.create,{temp:!1})]),l.result.catch(p=>i.logger().error(p))}return o.set(e,l),l}};function D$(t){let{source:e,meta:n}=t,r=t.predicate,o=r?.columns,i,s;if(!n||!o)return{source:null,columns:s,predicate:i};let{type:a,scales:c,bin:f,pixelSize:l=1}=n;if(a==="point")i=u=>u,s=Object.fromEntries(o.map(u=>[`${u}`,_t(u)]));else if(a==="interval"&&c){let u=c.map(p=>P$(p,l,f));u.some(p=>!p)||(u.length===1?(i=p=>p?_e("active0",p.range.map(u[0])):[],s={active0:u[0](r.field)}):(i=p=>p?Un(p.children.map(({range:h},d)=>_e(`active${d}`,h.map(u[d])))):[],s=Object.fromEntries(r.children.map((p,h)=>[`active${h}`,u[h](p.field)]))))}return{source:s?e:null,columns:s,predicate:i}}var F$={ceil:"CEIL",round:"ROUND"};function P$(t,e,n){let{type:r,domain:o,range:i,apply:s,sqlApply:a}=Bf(t);if(!s)return;let c=F$[`${n}`.toLowerCase()]||"FLOOR",f=s(Math.min(...o)),l=s(Math.max(...o)),u=r==="identity"?1:Math.abs(i[1]-i[0])/(l-f),p=u/e===1?"":`${u/e}::DOUBLE * `,h=f===0?"":` - ${f}::DOUBLE`;return d=>Y`${c}(${p}(${a(d)}${h}))::INTEGER`}function q$(t,e,n,r){let{dims:o,aggr:i,aux:s}=n,{columns:a}=e,c=t.select({...a,...s}).groupby(Object.keys(a)),[f]=c.subqueries;if(f){let m=Object.values(a).flatMap(g=>g.columns);B$(f,m)}let l=c.orderby();c.query.orderby=[];let u=c.toString(),p=(q6(u)>>>0).toString(16),h=`${r}.cube_${p}`,d=yt.select(o,i).from(h).groupby(o).orderby(l);return new Z1({id:p,table:h,create:u,active:e,select:d})}function B$(t,e){let n=new Set,r=o=>{n.has(o)||(n.add(o),o.select&&o.from().length&&o.select(e),o.subqueries.forEach(r))};r(t)}var Z1=class{constructor({table:e,create:n,active:r,select:o}={}){this.table=e,this.create=n,this.result=null,this.active=r,this.select=o,this.skip=!1}query(e){return this.select.clone().where(this.active.predicate(e))}};var xs=class extends Promise{constructor(){let e,n;super((r,o)=>{e=r,n=o}),this._resolve=e,this._reject=n}fulfill(e){return this._resolve(e),this}reject(e){return this._reject(e),this}};xs.prototype.constructor=Promise;function z$(t){return(typeof requestAnimationFrame<"u"?requestAnimationFrame:typeof setImmediate<"u"?setImmediate:setTimeout)(t)}function B6(t,e,n){let r=[],o=0;function i(){let s=Y$(r,e);r=[],o=0;for(let a of s)j$(a,t,n),V$(a,e)}return{add(s,a){s.request.type==="arrow"?(o=o||z$(()=>i()),r.push({entry:s,priority:a,index:r.length})):t(s,a)}}}function Y$(t,e){let n=[],r=new Map;for(let o of t){let{entry:{request:i}}=o,s=U$(i.query,e);if(!r.has(s)){let a=[];n.push(a),r.set(s,a)}r.get(s).push(o)}return n}function U$(t,e){let n=`${t}`;if(t instanceof yt&&!e.get(n)){if(t.orderby().length||t.where().length||t.qualify().length||t.having().length)return n;let r=t.clone().$select("*"),o=t.groupby();if(o.length){let i={};t.select().forEach(({as:s,expr:a})=>i[s]=a),r.$groupby(o.map(s=>s instanceof bn&&i[s.column]||s))}else t.select().some(({expr:i})=>i.aggregate)&&r.$groupby("ALL");return`${r}`}else return n}function j$(t,e,n){if(X$(t))e({request:{type:"arrow",cache:!1,record:!1,query:t.query=G$(t,n)},result:t.result=new xs});else for(let{entry:r,priority:o}of t)e(r,o)}function X$(t){if(t.length>1){let e=`${t[0].entry.request.query}`;for(let n=1;n<t.length;++n)if(e!==`${t[n].entry.request.query}`)return!0}return!1}function G$(t,e){let n=t.maps=[],r=new Map;for(let s of t){let{query:a}=s.entry.request,c=[];n.push(c);for(let{as:f,expr:l}of a.select()){let u=`${l}`;r.has(u)||r.set(u,[`col${r.size}`,l]);let[p]=r.get(u);c.push([p,f])}e(`${a}`)}let o=t[0].entry.request.query.clone(),i=o.groupby();if(i.length){let s={};t.maps[0].forEach(([a,c])=>s[c]=a),o.$groupby(i.map(a=>a instanceof bn&&s[a.column]||a))}return o.$select(Array.from(r.values()))}async function V$(t,e){let{maps:n,query:r,result:o}=t;if(!n)return;let i;try{i=await o}catch(a){for(let{entry:c}of t)c.result.reject(a);return}let s=W1(r);t.forEach(({entry:a},c)=>{let{request:f,result:l}=a,u=n[c],p=s&&u?H$(i,u):u?W$(i,u):i;f.cache&&e.set(String(f.query),p),l.fulfill(p)})}function W$(t,e){return t.select(e.map(n=>n[0]),e.map(n=>n[1]))}function H$(t,e){let n=new Map(e),r=[];for(let o of t)n.has(o.column_name)&&r.push({...o,column_name:n.get(o.column_name)});return r}var Q$=typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,z6=()=>({get:()=>{},set:(t,e)=>e,clear:()=>{}});function Y6({max:t=1e3,ttl:e=3*60*60*1e3}={}){let n=new Map;function r(){let o=performance.now()-e,i=null,s=1/0;for(let[a,c]of n){let{last:f}=c;f<s&&(i=a,s=f),o>f&&n.delete(a)}i&&n.delete(i)}return{get(o){let i=n.get(o);if(i)return i.last=performance.now(),i.value},set(o,i){return n.set(o,{last:performance.now(),value:i}),n.size>t&&Q$(r),i},clear(){n=new Map}}}var Jh=class{constructor(e){this.queue=Array.from({length:e},()=>({head:null,tail:null}))}isEmpty(){return this.queue.every(e=>!e.head)}insert(e,n){let r=this.queue[n];if(!r)throw new Error(`Invalid queue priority rank: ${n}`);let o={item:e,next:null};r.head===null?r.head=r.tail=o:r.tail=r.tail.next=o}remove(e){for(let n of this.queue){let{head:r,tail:o}=n;for(let i=null,s=r;s;i=s,s=s.next)e(s.item)&&(s===r?r=s.next:i.next=s.next,s===o&&(o=i||r));n.head=r,n.tail=o}}next(){for(let e of this.queue){let{head:n}=e;if(n!==null)return e.head=n.next,e.tail===n&&(e.tail=null),n.item}}};var Sr={High:0,Normal:1,Low:2},td=class{constructor(){this.queue=new Jh(3),this.db=null,this.clientCache=null,this._logger=null,this._logQueries=!1,this.recorders=[],this.pending=null,this._consolidate=null}next(){if(this.pending||this.queue.isEmpty())return;let{request:e,result:n}=this.queue.next();this.pending=this.submit(e,n),this.pending.finally(()=>{this.pending=null,this.next()})}enqueue(e,n=Sr.Normal){this.queue.insert(e,n),this.next()}recordQuery(e){this.recorders.length&&e&&this.recorders.forEach(n=>n.add(e))}async submit(e,n){try{let{query:r,type:o,cache:i=!1,record:s=!0,options:a}=e,c=r?`${r}`:null;if(s&&this.recordQuery(c),i){let u=this.clientCache.get(c);if(u){this._logger.debug("Cache"),n.fulfill(u);return}}let f=performance.now();this._logQueries&&this._logger.debug("Query",{type:o,sql:c,...a});let l=await this.db.query({type:o,sql:c,...a});i&&this.clientCache.set(c,l),this._logger.debug(`Request: ${(performance.now()-f).toFixed(1)}`),n.fulfill(l)}catch(r){n.reject(r)}}cache(e){return e!==void 0?this.clientCache=e===!0?Y6():e||z6():this.clientCache}logger(e){return e?this._logger=e:this._logger}logQueries(e){return e!==void 0?this._logQueries=!!e:this._logQueries}connector(e){return e?this.db=e:this.db}consolidate(e){e&&!this._consolidate?this._consolidate=B6(this.enqueue.bind(this),this.clientCache,this.recordQuery.bind(this)):!e&&this._consolidate&&(this._consolidate=null)}request(e,n=Sr.Normal){let r=new xs,o={request:e,result:r};return this._consolidate?this._consolidate.add(o,n):this.enqueue(o,n),r}cancel(e){let n=new Set(e);n.size&&this.queue.remove(({result:r})=>n.has(r)?(r.reject("Canceled"),!0):!1)}clear(){this.queue.remove(({result:e})=>(e.reject("Cleared"),!0))}record(){let e=[],n={add(r){e.push(r)},reset(){e=[]},snapshot(){return e.slice()},stop(){return this.recorders=this.recorders.filter(r=>r!==n),e}};return this.recorders.push(n),n}};function K1(t){switch(t){case"BIGINT":case"HUGEINT":case"INTEGER":case"SMALLINT":case"TINYINT":case"UBIGINT":case"UINTEGER":case"USMALLINT":case"UTINYINT":case"DOUBLE":case"FLOAT":case"REAL":return"number";case"DATE":case"TIMESTAMP":case"TIMESTAMPTZ":case"TIMESTAMP WITH TIME ZONE":case"TIME":case"TIMESTAMP_NS":return"date";case"BOOLEAN":return"boolean";case"VARCHAR":case"UUID":case"JSON":return"string";case"ARRAY":case"LIST":return"array";case"BLOB":case"STRUCT":case"MAP":case"GEOMETRY":return"object";default:if(t.startsWith("DECIMAL"))return"number";if(t.startsWith("STRUCT")||t.startsWith("MAP"))return"object";if(t.endsWith("]"))return"array";throw new Error(`Unsupported type: ${t}`)}}var Z$="count",K$="nulls",J$="max",tC="min",eC="distinct";var nC={[Z$]:En,[eC]:t=>En(t).distinct(),[J$]:li,[tC]:ui,[K$]:t=>En().where(Df(t))};function rC(t,e,n){return yt.from(t).select(Array.from(n,r=>[r,nC[r](e)]))}async function U6(t,e){return e.length===1&&`${e[0].column}`=="*"?iC(t,e[0].table):(await Promise.all(e.map(n=>oC(t,n)))).filter(n=>n)}async function oC(t,{table:e,column:n,stats:r}){let o=yt.from({source:e}).select({column:n}).groupby(n.aggregate?Y`ALL`:[]),[i]=Array.from(await t.query(yt.describe(o))),s={table:e,column:`${n}`,sqlType:i.column_type,type:K1(i.column_type),nullable:i.null==="YES"};if(!(r?.length||r?.size))return s;let[a]=await t.query(rC(e,n,r),{persist:!0});return Object.assign(s,a)}async function iC(t,e){let n=await t.query(`DESCRIBE ${ps(e)}`);return Array.from(n).map(r=>({table:e,column:r.column_name,sqlType:r.column_type,type:K1(r.column_type),nullable:r.null==="YES"}))}function j6(){return{debug(){},info(){},log(){},warn(){},error(){}}}var ed;function J1(t){return t?ed=t:ed==null&&(ed=new nd),ed}var nd=class{constructor(e=O1(),{logger:n=console,manager:r=new td,cache:o=!0,consolidate:i=!0,indexes:s={}}={}){this.manager=r,this.manager.cache(o),this.manager.consolidate(i),this.databaseConnector(e),this.logger(n),this.clear(),this.dataCubeIndexer=new Kh(this,s)}clear({clients:e=!0,cache:n=!0}={}){this.manager.clear(),e&&(this.filterGroups?.forEach(r=>r.disconnect()),this.filterGroups=new Map,this.clients?.forEach(r=>this.disconnect(r)),this.clients=new Set),n&&this.manager.cache().clear()}databaseConnector(e){return this.manager.connector(e)}logger(e){return arguments.length&&(this._logger=e||j6(),this.manager.logger(this._logger)),this._logger}cancel(e){this.manager.cancel(e)}exec(e,{priority:n=Sr.Normal}={}){return e=Array.isArray(e)?e.filter(r=>r).join(`;
|
|
2
|
+
`):e,this.manager.request({type:"exec",query:e},n)}query(e,{type:n="arrow",cache:r=!0,priority:o=Sr.Normal,...i}={}){return this.manager.request({type:n,query:e,cache:r,options:i},o)}prefetch(e,n={}){return this.query(e,{...n,cache:!0,priority:Sr.Low})}createBundle(e,n,r=Sr.Low){let o={name:e,queries:n.map(i=>typeof i=="string"?{sql:i}:i)};return this.manager.request({type:"create-bundle",options:o},r)}loadBundle(e,n=Sr.High){let r={name:e};return this.manager.request({type:"load-bundle",options:r},n)}updateClient(e,n,r=Sr.Normal){return e.queryPending(),this.query(n,{priority:r}).then(o=>e.queryResult(o).update(),o=>{this._logger.error(o),e.queryError(o)}).catch(o=>this._logger.error(o))}requestQuery(e,n){return this.dataCubeIndexer.clear(),n?this.updateClient(e,n):Promise.resolve(e.update())}async connect(e){let{clients:n}=this;if(n.has(e))throw new Error("Client already connected.");n.add(e),e.coordinator=this,this.initializeClient(e),sC(this,e.filterBy,e)}async initializeClient(e){let n=e.fields();return n?.length&&e.fieldInfo(await U6(this,n)),e.requestQuery()}disconnect(e){let{clients:n,filterGroups:r}=this;if(!n.has(e))return;n.delete(e),e.coordinator=null;let o=r.get(e.filterBy);o&&o.clients.delete(e)}};function sC(t,e,n){if(!e)return;let r=t.filterGroups.get(e);if(!r){let o=s=>aC(t,e,s),i=()=>cC(t,e);e.addEventListener("activate",o),e.addEventListener("value",i),r={selection:e,clients:new Set,disconnect(){e.removeEventListener("activate",o),e.removeEventListener("value",i)}},t.filterGroups.set(e,r)}r.clients.add(n)}function aC(t,e,n){let{dataCubeIndexer:r,filterGroups:o}=t,{clients:i}=o.get(e);for(let s of i)r.index(s,e,n)}function cC(t,e){let{dataCubeIndexer:n,filterGroups:r}=t,{clients:o}=r.get(e),{active:i}=e;return Promise.allSettled(Array.from(o,s=>{let a=n.index(s,e,i),c=a?null:e.predicate(s);if(a?.skip||!a&&!c)return;let f=a?.query(i.predicate)??s.query(c);return t.updateClient(s,f)}))}var rd=class{constructor(){this._callbacks=new Map}addEventListener(e,n){this._callbacks.has(e)||this._callbacks.set(e,{callbacks:new Set,pending:null,queue:new tx}),this._callbacks.get(e).callbacks.add(n)}removeEventListener(e,n){let r=this._callbacks.get(e);r&&r.callbacks.delete(n)}willEmit(e,n){return n}emitQueueFilter(e,n){return null}cancel(e){this._callbacks.get(e)?.queue.clear()}async pending(e){await this._callbacks.get(e)?.pending}emit(e,n){let r=this._callbacks.get(e)||{};if(r.pending)r.queue.enqueue(n,this.emitQueueFilter(e,n));else{let o=this.willEmit(e,n),{callbacks:i,queue:s}=r;if(i?.size){let a=Array.from(i,c=>c(o));r.pending=Promise.allSettled(a).then(()=>{r.pending=null,s.isEmpty()||this.emit(e,s.dequeue())})}}}},tx=class{constructor(){this.clear()}clear(){this.next=null}isEmpty(){return!this.next}enqueue(e,n){let r={value:e};if(n&&this.next){let o=this;for(;o.next;)n(o.next.value)?o=o.next:o.next=o.next.next;o.next=r}else this.next=r}dequeue(){let{next:e}=this;return this.next=e?.next,e?.value}};function Yf(t,e){return t===e?!1:t instanceof Date&&e instanceof Date?+t!=+e:Array.isArray(t)&&Array.isArray(e)?fC(t,e):!0}function fC(t,e){if(t.length!==e.length)return!0;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!0;return!1}function $a(t){return t instanceof Ca}var Ca=class t extends rd{constructor(e){super(),this._value=e}static value(e){return new t(e)}static array(e){if(e.some(n=>$a(n))){let n=new t,r=()=>{n.update(e.map(o=>$a(o)?o.value:o))};return r(),e.forEach(o=>$a(o)?o.addEventListener("value",r):0),n}return new t(e)}get value(){return this._value}update(e,{force:n}={}){return Yf(this._value,e)||n?this.emit("value",e):this.cancel("value"),this}willEmit(e,n){return e==="value"&&(this._value=n),n}};function ex(t){return t instanceof pi}function od(t,e){return new pi(new id(t),e&&[e].flat())}var pi=class t extends Ca{static intersect({cross:e=!1,empty:n=!1,include:r=[]}={}){return od({cross:e,empty:n},r)}static union({cross:e=!1,empty:n=!1,include:r=[]}={}){return od({cross:e,empty:n,union:!0},r)}static single({cross:e=!1,empty:n=!1,include:r=[]}={}){return od({cross:e,empty:n,single:!0},r)}static crossfilter({empty:e=!1,include:n=[]}={}){return od({cross:!0,empty:e},n)}constructor(e=new id,n=[]){if(super([]),this._resolved=this._value,this._resolver=e,this._relay=new Set,Array.isArray(n))for(let r of n)r._relay.add(this)}clone(){let e=new t(this._resolver);return e._value=e._resolved=this._value,e}remove(e){let n=this.clone();return n._value=n._resolved=n._resolver.resolve(this._resolved,{source:e}),n._value.active={source:e},n}get resolver(){return this._resolver}get single(){return this._resolver.single}get clauses(){return super.value}get active(){return this.clauses.active}get value(){return this.active?.value}valueFor(e){return this.clauses.find(n=>n.source===e)?.value}activate(e){this.emit("activate",e),this._relay.forEach(n=>n.activate(e))}update(e){return this._resolved=this._resolver.resolve(this._resolved,e,!0),this._resolved.active=e,this._relay.forEach(n=>n.update(e)),super.update(this._resolved)}willEmit(e,n){return e==="value"?(this._value=n,this.value):n}emitQueueFilter(e,n){return e==="value"?this._resolver.queueFilter(n):null}skip(e,n){return this._resolver.skip(e,n)}predicate(e,n=!1){let{clauses:r}=this,o=n?null:r.active;return this._resolver.predicate(r,o,e)}},id=class{constructor({union:e,cross:n,single:r,empty:o}={}){this.union=!!e,this.cross=!!n,this.single=!!r,this.empty=!!o}resolve(e,n,r=!1){let{source:o,predicate:i}=n,s=e.filter(c=>o!==c.source),a=this.single?[]:s;return this.single&&r&&s.forEach(c=>c.source?.reset?.()),i&&a.push(n),a}skip(e,n){return this.cross&&n?.clients?.has(e)}predicate(e,n,r){let{empty:o,union:i}=this;if(o&&!e.length)return["FALSE"];if(this.skip(r,n))return;let s=e.filter(a=>!this.skip(r,a)).map(a=>a.predicate);return i&&s.length>1?Lf(s):s}queueFilter(e){if(this.cross){let n=e.active?.source;return r=>r.active?.source!==n}return null}};function nx(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=e!==void 0?Yh(t,zh(e)):null;return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function Uf(t,e,{source:n,clients:r=n?new Set([n]):void 0}){let o=null;if(e){let i=e.map(s=>{let a=s.map((c,f)=>Yh(t[f],zh(c)));return a.length>1?Un(a):a[0]});o=i.length>1?Lf(i):i[0]}return{meta:{type:"point"},source:n,clients:r,value:e,predicate:o}}function jf(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scale:i,pixelSize:s=1}){let a=e!=null?_e(t,e):null;return{meta:{type:"interval",scales:i&&[i],bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function rx(t,e,{source:n,clients:r=n?new Set([n]):void 0,bin:o,scales:i=[],pixelSize:s=1}){let a=e!=null?Un(t.map((f,l)=>_e(f,e[l]))):null;return{meta:{type:"interval",scales:i,bin:o,pixelSize:s},source:n,clients:r,value:e,predicate:a}}function ox(t){return typeof t?.getChild=="function"}function ix(){let t=new Set,e,n=new Promise(r=>e=r);return{pending(r){t.add(r)},ready(r){return t.delete(r),t.size===0},resolve(){n=new Promise(r=>{e(),e=r})},get promise(){return n}}}function jn(t){return ox(t)?lC(t):uC(t)}function lC(t){let{numRows:e}=t;return{numRows:e,columns:t.toColumns()}}function uC(t){let e=t.length;if(typeof t[0]=="object"){let n=e?Object.keys(t[0]):[],r={};return n.length>0&&n.forEach(o=>{r[o]=t.map(i=>i[o])}),{numRows:e,columns:r}}else return{numRows:e,values:t}}var l_={};N9(l_,{Area:()=>la,Arrow:()=>sp,BarX:()=>ua,BarY:()=>pa,Cell:()=>ha,Contour:()=>yp,Density:()=>wp,Dot:()=>da,Frame:()=>Ju,Geo:()=>vp,Hexgrid:()=>_p,Image:()=>Mp,Line:()=>ma,Link:()=>op,Mark:()=>lt,Raster:()=>hp,Rect:()=>fa,RuleX:()=>ju,RuleY:()=>Xu,Text:()=>sa,TickX:()=>fp,TickY:()=>lp,Tip:()=>tp,Vector:()=>ca,WaffleX:()=>Ap,WaffleY:()=>Ep,area:()=>rp,areaX:()=>ts,areaY:()=>ti,arrow:()=>YA,auto:()=>JA,autoSpec:()=>Lv,axisFx:()=>sy,axisFy:()=>iy,axisX:()=>Vu,axisY:()=>Gu,barX:()=>ro,barY:()=>oo,bin:()=>Jo,binX:()=>eo,binY:()=>no,bollinger:()=>os,bollingerX:()=>iE,bollingerY:()=>sE,boxX:()=>aE,boxY:()=>cE,cell:()=>es,cellX:()=>jA,cellY:()=>XA,centroid:()=>Oy,circle:()=>WA,cluster:()=>sT,column:()=>$e,contour:()=>yE,crosshair:()=>wE,crosshairX:()=>vE,crosshairY:()=>_E,delaunayLink:()=>AE,delaunayMesh:()=>EE,density:()=>kE,differenceX:()=>RE,differenceY:()=>LE,dodgeX:()=>ET,dodgeY:()=>TT,dot:()=>or,dotX:()=>GA,dotY:()=>VA,filter:()=>tS,find:()=>fS,formatIsoDate:()=>sv,formatMonth:()=>d7,formatNumber:()=>iv,formatWeekday:()=>m7,frame:()=>Zc,geo:()=>Ry,geoCentroid:()=>FE,graticule:()=>qE,gridFx:()=>ly,gridFy:()=>cy,gridX:()=>fy,gridY:()=>ay,group:()=>Du,groupX:()=>qi,groupY:()=>Bi,groupZ:()=>Lu,hexagon:()=>HA,hexbin:()=>BE,hexgrid:()=>zE,hull:()=>TE,identity:()=>G,image:()=>UE,indexOf:()=>Yt,initializer:()=>jt,interpolateNearest:()=>mp,interpolateNone:()=>Ny,interpolatorBarycentric:()=>dp,interpolatorRandomWalk:()=>gp,legend:()=>lA,line:()=>ga,lineX:()=>ns,lineY:()=>rs,linearRegressionX:()=>GE,linearRegressionY:()=>VE,link:()=>My,map:()=>_n,mapX:()=>rf,mapY:()=>of,marks:()=>ge,normalize:()=>Uy,normalizeX:()=>kT,normalizeY:()=>NT,numberInterval:()=>Mw,plot:()=>Kc,pointer:()=>Gi,pointerX:()=>Vi,pointerY:()=>Zo,raster:()=>hE,rect:()=>Ku,rectX:()=>Hc,rectY:()=>Qc,reverse:()=>eS,ruleX:()=>Fn,ruleY:()=>Pn,scale:()=>zi,select:()=>DT,selectFirst:()=>$p,selectLast:()=>Cp,selectMaxX:()=>Vy,selectMaxY:()=>Wy,selectMinX:()=>Xy,selectMinY:()=>Gy,shiftX:()=>OT,shiftY:()=>RT,shuffle:()=>nS,sort:()=>Tg,sphere:()=>PE,spike:()=>j7,stackX:()=>Sv,stackX1:()=>gA,stackX2:()=>yA,stackY:()=>Av,stackY1:()=>xA,stackY2:()=>bA,text:()=>to,textX:()=>Kg,textY:()=>Jg,tickX:()=>$y,tickY:()=>Cy,timeInterval:()=>$u,tip:()=>yy,transform:()=>me,tree:()=>e_,treeLink:()=>qy,treeNode:()=>Sp,utcInterval:()=>Qs,valueof:()=>ft,vector:()=>vv,vectorX:()=>ny,vectorY:()=>ry,voronoi:()=>IE,voronoiMesh:()=>$E,waffleX:()=>pT,waffleY:()=>hT,window:()=>sf,windowX:()=>tE,windowY:()=>eE});function ht(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function en(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fr(t){let e,n,r;t.length!==2?(e=ht,n=(a,c)=>ht(t(a),c),r=(a,c)=>t(a)-c):(e=t===ht||t===en?t:pC,n=t,r=t);function o(a,c,f=0,l=a.length){if(f<l){if(e(c,c)!==0)return l;do{let u=f+l>>>1;n(a[u],c)<0?f=u+1:l=u}while(f<l)}return f}function i(a,c,f=0,l=a.length){if(f<l){if(e(c,c)!==0)return l;do{let u=f+l>>>1;n(a[u],c)<=0?f=u+1:l=u}while(f<l)}return f}function s(a,c,f=0,l=a.length){let u=o(a,c,f,l-1);return u>f&&r(a[u-1],c)>-r(a[u],c)?u-1:u}return{left:o,center:s,right:i}}function pC(){return 0}function Xf(t){return t===null?NaN:+t}function*X6(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}var G6=fr(ht),V6=G6.right,hC=G6.left,dC=fr(Xf).center,yo=V6;var Gf=W6(H6),sx=W6(mC);function W6(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:o,width:i,height:s}=e;if(!((i=Math.floor(i))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(s!==void 0?s:o.length/i))>=0))throw new RangeError("invalid height");if(!i||!s||!n&&!r)return e;let a=n&&t(n),c=r&&t(r),f=o.slice();return a&&c?(ka(a,f,o,i,s),ka(a,o,f,i,s),ka(a,f,o,i,s),Na(c,o,f,i,s),Na(c,f,o,i,s),Na(c,o,f,i,s)):a?(ka(a,o,f,i,s),ka(a,f,o,i,s),ka(a,o,f,i,s)):c&&(Na(c,o,f,i,s),Na(c,f,o,i,s),Na(c,o,f,i,s)),e}}function ka(t,e,n,r,o){for(let i=0,s=r*o;i<s;)t(e,n,i,i+=r,1)}function Na(t,e,n,r,o){for(let i=0,s=r*o;i<r;++i)t(e,n,i,i+s,r)}function mC(t){let e=H6(t);return(n,r,o,i,s)=>{o<<=2,i<<=2,s<<=2,e(n,r,o+0,i+0,s),e(n,r,o+1,i+1,s),e(n,r,o+2,i+2,s),e(n,r,o+3,i+3,s)}}function H6(t){let e=Math.floor(t);if(e===t)return gC(t);let n=t-e,r=2*t+1;return(o,i,s,a,c)=>{if(!((a-=c)>=s))return;let f=e*i[s],l=c*e,u=l+c;for(let p=s,h=s+l;p<h;p+=c)f+=i[Math.min(a,p)];for(let p=s,h=a;p<=h;p+=c)f+=i[Math.min(a,p+l)],o[p]=(f+n*(i[Math.max(s,p-u)]+i[Math.min(a,p+u)]))/r,f-=i[Math.max(s,p-l)]}}function gC(t){let e=2*t+1;return(n,r,o,i,s)=>{if(!((i-=s)>=o))return;let a=t*r[o],c=s*t;for(let f=o,l=o+c;f<l;f+=s)a+=r[Math.min(i,f)];for(let f=o,l=i;f<=l;f+=s)a+=r[Math.min(i,f+c)],n[f]=a/e,a-=r[Math.max(o,f-c)]}}function Ar(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(o=+o)>=o&&++n}return n}function yC(t){return t.length|0}function xC(t){return!(t>0)}function bC(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function wC(t){return e=>t(...e)}function sd(...t){let e=typeof t[t.length-1]=="function"&&wC(t.pop());t=t.map(bC);let n=t.map(yC),r=t.length-1,o=new Array(r+1).fill(0),i=[];if(r<0||n.some(xC))return i;for(;;){i.push(o.map((a,c)=>t[c][a]));let s=r;for(;++o[s]===n[s];){if(s===0)return e?i.map(e):i;o[s--]=0}}}function ad(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?o=>n+=+o||0:o=>n+=+e(o,r++,t)||0)}function hi(t,e){let n=0,r,o=0,i=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-o,o+=r/++n,i+=r*(s-o));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-o,o+=r/++n,i+=r*(a-o))}if(n>1)return i/(n-1)}function Xn(t,e){let n=hi(t,e);return n&&Math.sqrt(n)}function kt(t,e){let n,r;if(e===void 0)for(let o of t)o!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)));else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}var Le=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){let n=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let i=n[o],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(n[r++]=a),e=s}return n[r]=e,this._n=r+1,this}valueOf(){let e=this._partials,n=this._n,r,o,i,s=0;if(n>0){for(s=e[--n];n>0&&(r=s,o=e[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&e[n-1]<0||i>0&&e[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}};var nn=class extends Map{constructor(e,n=K6){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,o]of e)this.set(r,o)}get(e){return super.get(ax(this,e))}has(e){return super.has(ax(this,e))}set(e,n){return super.set(Q6(this,e),n)}delete(e){return super.delete(Z6(this,e))}},rn=class extends Set{constructor(e,n=K6){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let r of e)this.add(r)}has(e){return super.has(ax(this,e))}add(e){return super.add(Q6(this,e))}delete(e){return super.delete(Z6(this,e))}};function ax({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function Q6({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Z6({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function K6(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Vf(t){return t}function De(t,...e){return fx(t,Vf,Vf,e)}function lr(t,e,...n){return fx(t,Vf,e,n)}function cx(t,e,...n){return fx(t,Array.from,e,n)}function fx(t,e,n,r){return function o(i,s){if(s>=r.length)return n(i);let a=new nn,c=r[s++],f=-1;for(let l of i){let u=c(l,++f,i),p=a.get(u);p?p.push(l):a.set(u,[l])}for(let[l,u]of a)a.set(l,o(u,s));return e(a)}(t,0)}function lx(t,e){return Array.from(e,n=>t[n])}function xo(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){let r=Uint32Array.from(t,(o,i)=>i);return e.length>1?(e=e.map(o=>t.map(o)),r.sort((o,i)=>{for(let s of e){let a=bs(s[o],s[i]);if(a)return a}})):(n=t.map(n),r.sort((o,i)=>bs(n[o],n[i]))),lx(t,r)}return t.sort(Wf(n))}function Wf(t=ht){if(t===ht)return bs;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{let r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function bs(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function Oa(t,e,n){return(e.length!==2?xo(lr(t,e,n),([r,o],[i,s])=>ht(o,s)||ht(r,i)):xo(De(t,n),([r,o],[i,s])=>e(o,s)||ht(r,i))).map(([r])=>r)}var vC=Math.sqrt(50),_C=Math.sqrt(10),MC=Math.sqrt(2);function cd(t,e,n){let r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),s=i>=vC?10:i>=_C?5:i>=MC?2:1,a,c,f;return o<0?(f=Math.pow(10,-o)/s,a=Math.round(t*f),c=Math.round(e*f),a/f<t&&++a,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,a=Math.round(t/f),c=Math.round(e/f),a*f<t&&++a,c*f>e&&--c),c<a&&.5<=n&&n<2?cd(t,e,n*2):[a,c,f]}function Fe(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[o,i,s]=r?cd(e,t,n):cd(t,e,n);if(!(i>=o))return[];let a=i-o+1,c=new Array(a);if(r)if(s<0)for(let f=0;f<a;++f)c[f]=(i-f)/-s;else for(let f=0;f<a;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<a;++f)c[f]=(o+f)/-s;else for(let f=0;f<a;++f)c[f]=(o+f)*s;return c}function bo(t,e,n){return e=+e,t=+t,n=+n,cd(t,e,n)[2]}function Ra(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?bo(e,t,n):bo(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}function La(t,e,n){let r;for(;;){let o=bo(t,e,n);if(o===r||o===0||!isFinite(o))return[t,e];o>0?(t=Math.floor(t/o)*o,e=Math.ceil(e/o)*o):o<0&&(t=Math.ceil(t*o)/o,e=Math.floor(e*o)/o),r=o}}function di(t){return Math.max(1,Math.ceil(Math.log(Ar(t))/Math.LN2)+1)}function Tt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o)}return n}function fd(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i,r=o);return r}function Ft(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function ld(t,e){let n,r=-1,o=-1;if(e===void 0)for(let i of t)++o,i!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);else for(let i of t)(i=e(i,++o,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i,r=o);return r}function ud(t,e,n=0,r=1/0,o){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(o=o===void 0?bs:Wf(o);r>n;){if(r-n>600){let c=r-n+1,f=e-n+1,l=Math.log(c),u=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*u*(c-u)/c)*(f-c/2<0?-1:1),h=Math.max(n,Math.floor(e-f*u/c+p)),d=Math.min(r,Math.floor(e+(c-f)*u/c+p));ud(t,e,h,d,o)}let i=t[e],s=n,a=r;for(Hf(t,n,e),o(t[r],i)>0&&Hf(t,n,r);s<a;){for(Hf(t,s,a),++s,--a;o(t[s],i)<0;)++s;for(;o(t[a],i)>0;)--a}o(t[n],i)===0?Hf(t,n,a):(++a,Hf(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function Hf(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function ws(t,e=ht){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?ht(s,o)>0:ht(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)>0:e(o,o)===0)&&(n=o,r=!0);return n}function on(t,e,n){if(t=Float64Array.from(X6(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Ft(t);if(e>=1)return Tt(t);var r,o=(r-1)*e,i=Math.floor(o),s=Tt(ud(t,i).subarray(0,i+1)),a=Ft(t.subarray(i+1));return s+(a-s)*(o-i)}}function ux(t,e,n=Xf){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),s=+n(t[i],i,t),a=+n(t[i+1],i+1,t);return s+(a-s)*(o-i)}}function pd(t,e,n){let r=Ar(t),o=on(t,.75)-on(t,.25);return r&&o?Math.ceil((n-e)/(2*o*Math.pow(r,-1/3))):1}function Qf(t,e,n){let r=Ar(t),o=Xn(t);return r&&o?Math.ceil((n-e)*Math.cbrt(r)/(3.49*o)):1}function wo(t,e){let n=0,r=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(++n,r+=o);else{let o=-1;for(let i of t)(i=e(i,++o,t))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function ur(t,e){return on(t,.5,e)}function*AC(t){for(let e of t)yield*e}function Da(t){return Array.from(AC(t))}function Fa(t,e){let n=new nn;if(e===void 0)for(let i of t)i!=null&&i>=i&&n.set(i,(n.get(i)||0)+1);else{let i=-1;for(let s of t)(s=e(s,++i,t))!=null&&s>=s&&n.set(s,(n.get(s)||0)+1)}let r,o=0;for(let[i,s]of n)s>o&&(o=s,r=i);return r}function hd(t,e=EC){let n=[],r,o=!1;for(let i of t)o&&n.push(e(r,i)),r=i,o=!0;return n}function EC(t,e){return[t,e]}function ie(t,e,n){t=+t,e=+e,n=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(o);++r<o;)i[r]=t+r*n;return i}function Zf(t,e=ht){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t),r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=ht);let o=(a,c)=>e(n[a],n[c]),i,s;return t=Uint32Array.from(n,(a,c)=>c),t.sort(e===ht?(a,c)=>bs(n[a],n[c]):Wf(o)),t.forEach((a,c)=>{let f=o(a,i===void 0?a:i);f>=0?((i===void 0||f>0)&&(i=a,s=c),r[a]=s):r[a]=NaN}),r}function dd(t,e=ht){let n,r=!1;if(e.length===1){let o;for(let i of t){let s=e(i);(r?ht(s,o)<0:ht(s,s)===0)&&(n=i,o=s,r=!0)}}else for(let o of t)(r?e(o,n)<0:e(o,o)===0)&&(n=o,r=!0);return n}function Pe(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function mi(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function J6(t){return t}var px=1,hx=2,dx=3,md=4,t3=1e-6;function TC(t){return"translate("+t+",0)"}function IC(t){return"translate(0,"+t+")"}function $C(t){return e=>+t(e)}function CC(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function kC(){return!this.__axis}function NC(t,e){var n=[],r=null,o=null,i=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===px||t===md?-1:1,l=t===md||t===hx?"x":"y",u=t===px||t===dx?TC:IC;function p(h){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),m=o??(e.tickFormat?e.tickFormat.apply(e,n):J6),g=Math.max(i,0)+a,y=e.range(),x=+y[0]+c,w=+y[y.length-1]+c,b=(e.bandwidth?CC:$C)(e.copy(),c),_=h.selection?h.selection():h,v=_.selectAll(".domain").data([null]),A=_.selectAll(".tick").data(d,e).order(),T=A.exit(),E=A.enter().append("g").attr("class","tick"),$=A.select("line"),S=A.select("text");v=v.merge(v.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(E),$=$.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",f*i)),S=S.merge(E.append("text").attr("fill","currentColor").attr(l,f*g).attr("dy",t===px?"0em":t===dx?"0.71em":"0.32em")),h!==_&&(v=v.transition(h),A=A.transition(h),$=$.transition(h),S=S.transition(h),T=T.transition(h).attr("opacity",t3).attr("transform",function(k){return isFinite(k=b(k))?u(k+c):this.getAttribute("transform")}),E.attr("opacity",t3).attr("transform",function(k){var O=this.parentNode.__axis;return u((O&&isFinite(O=O(k))?O:b(k))+c)})),T.remove(),v.attr("d",t===md||t===hx?s?"M"+f*s+","+x+"H"+c+"V"+w+"H"+f*s:"M"+c+","+x+"V"+w:s?"M"+x+","+f*s+"V"+c+"H"+w+"V"+f*s:"M"+x+","+c+"H"+w),A.attr("opacity",1).attr("transform",function(k){return u(b(k)+c)}),$.attr(l+"2",f*i),S.attr(l,f*g).text(m),_.filter(kC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===hx?"start":t===md?"end":"middle"),_.each(function(){this.__axis=b})}return p.scale=function(h){return arguments.length?(e=h,p):e},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),p):n.slice()},p.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),p):r&&r.slice()},p.tickFormat=function(h){return arguments.length?(o=h,p):o},p.tickSize=function(h){return arguments.length?(i=s=+h,p):i},p.tickSizeInner=function(h){return arguments.length?(i=+h,p):i},p.tickSizeOuter=function(h){return arguments.length?(s=+h,p):s},p.tickPadding=function(h){return arguments.length?(a=+h,p):a},p.offset=function(h){return arguments.length?(c=+h,p):c},p}function mx(t){return NC(dx,t)}var OC={value:()=>{}};function n3(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new gd(n)}function gd(t){this._=t}function RC(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}gd.prototype=n3.prototype={constructor:gd,on:function(t,e){var n=this._,r=RC(t+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(t=r[i]).type)&&(o=LC(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=r[i]).type)n[o]=e3(n[o],t.name,e);else if(e==null)for(o in n)n[o]=e3(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new gd(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};function LC(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function e3(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=OC,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var vs=n3;var yd="http://www.w3.org/1999/xhtml",sn={svg:"http://www.w3.org/2000/svg",xhtml:yd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vo(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),sn.hasOwnProperty(e)?{space:sn[e],local:t}:t}function DC(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===yd&&e.documentElement.namespaceURI===yd?e.createElement(t):e.createElementNS(n,t)}}function FC(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function _o(t){var e=vo(t);return(e.local?FC:DC)(e)}function PC(){}function _s(t){return t==null?PC:function(){return this.querySelector(t)}}function r3(t){typeof t!="function"&&(t=_s(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=new Array(s),c,f,l=0;l<s;++l)(c=i[l])&&(f=t.call(c,c.__data__,l,i))&&("__data__"in c&&(f.__data__=c.__data__),a[l]=f);return new ne(r,this._parents)}function gx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function qC(){return[]}function Kf(t){return t==null?qC:function(){return this.querySelectorAll(t)}}function BC(t){return function(){return gx(t.apply(this,arguments))}}function o3(t){typeof t=="function"?t=BC(t):t=Kf(t);for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var s=e[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&(r.push(t.call(c,c.__data__,f,s)),o.push(c));return new ne(r,o)}function Jf(t){return function(){return this.matches(t)}}function xd(t){return function(e){return e.matches(t)}}var zC=Array.prototype.find;function YC(t){return function(){return zC.call(this.children,t)}}function UC(){return this.firstElementChild}function i3(t){return this.select(t==null?UC:YC(typeof t=="function"?t:xd(t)))}var jC=Array.prototype.filter;function XC(){return Array.from(this.children)}function GC(t){return function(){return jC.call(this.children,t)}}function s3(t){return this.selectAll(t==null?XC:GC(typeof t=="function"?t:xd(t)))}function a3(t){typeof t!="function"&&(t=Jf(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new ne(r,this._parents)}function bd(t){return new Array(t.length)}function c3(){return new ne(this._enter||this._groups.map(bd),this._parents)}function tl(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}tl.prototype={constructor:tl,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function f3(t){return function(){return t}}function VC(t,e,n,r,o,i){for(var s=0,a,c=e.length,f=i.length;s<f;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new tl(t,i[s]);for(;s<c;++s)(a=e[s])&&(o[s]=a)}function WC(t,e,n,r,o,i,s){var a,c,f=new Map,l=e.length,u=i.length,p=new Array(l),h;for(a=0;a<l;++a)(c=e[a])&&(p[a]=h=s.call(c,c.__data__,a,e)+"",f.has(h)?o[a]=c:f.set(h,c));for(a=0;a<u;++a)h=s.call(t,i[a],a,i)+"",(c=f.get(h))?(r[a]=c,c.__data__=i[a],f.delete(h)):n[a]=new tl(t,i[a]);for(a=0;a<l;++a)(c=e[a])&&f.get(p[a])===c&&(o[a]=c)}function HC(t){return t.__data__}function l3(t,e){if(!arguments.length)return Array.from(this,HC);var n=e?WC:VC,r=this._parents,o=this._groups;typeof t!="function"&&(t=f3(t));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),f=0;f<i;++f){var l=r[f],u=o[f],p=u.length,h=QC(t.call(l,l&&l.__data__,f,r)),d=h.length,m=a[f]=new Array(d),g=s[f]=new Array(d),y=c[f]=new Array(p);n(l,u,m,g,y,h,e);for(var x=0,w=0,b,_;x<d;++x)if(b=m[x]){for(x>=w&&(w=x+1);!(_=g[w])&&++w<d;);b._next=_||null}}return s=new ne(s,r),s._enter=a,s._exit=c,s}function QC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function u3(){return new ne(this._exit||this._groups.map(bd),this._parents)}function p3(t,e,n){var r=this.enter(),o=this,i=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function h3(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var f=n[c],l=r[c],u=f.length,p=a[c]=new Array(u),h,d=0;d<u;++d)(h=f[d]||l[d])&&(p[d]=h);for(;c<o;++c)a[c]=n[c];return new ne(a,this._parents)}function d3(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function m3(t){t||(t=ZC);function e(u,p){return u&&p?t(u.__data__,p.__data__):!u-!p}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),f,l=0;l<a;++l)(f=s[l])&&(c[l]=f);c.sort(e)}return new ne(o,this._parents).order()}function ZC(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function g3(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function y3(){return Array.from(this)}function x3(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function b3(){let t=0;for(let e of this)++t;return t}function w3(){return!this.node()}function v3(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&t.call(a,a.__data__,i,o);return this}function KC(t){return function(){this.removeAttribute(t)}}function JC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tk(t,e){return function(){this.setAttribute(t,e)}}function ek(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function nk(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function rk(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function _3(t,e){var n=vo(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?JC:KC:typeof e=="function"?n.local?rk:nk:n.local?ek:tk)(n,e))}function wd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ok(t){return function(){this.style.removeProperty(t)}}function ik(t,e,n){return function(){this.style.setProperty(t,e,n)}}function sk(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function M3(t,e,n){return arguments.length>1?this.each((e==null?ok:typeof e=="function"?sk:ik)(t,e,n??"")):gi(this.node(),t)}function gi(t,e){return t.style.getPropertyValue(e)||wd(t).getComputedStyle(t,null).getPropertyValue(e)}function ak(t){return function(){delete this[t]}}function ck(t,e){return function(){this[t]=e}}function fk(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function S3(t,e){return arguments.length>1?this.each((e==null?ak:typeof e=="function"?fk:ck)(t,e)):this.node()[t]}function A3(t){return t.trim().split(/^|\s+/)}function yx(t){return t.classList||new E3(t)}function E3(t){this._node=t,this._names=A3(t.getAttribute("class")||"")}E3.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function T3(t,e){for(var n=yx(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function I3(t,e){for(var n=yx(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function lk(t){return function(){T3(this,t)}}function uk(t){return function(){I3(this,t)}}function pk(t,e){return function(){(e.apply(this,arguments)?T3:I3)(this,t)}}function $3(t,e){var n=A3(t+"");if(arguments.length<2){for(var r=yx(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?pk:e?lk:uk)(n,e))}function hk(){this.textContent=""}function dk(t){return function(){this.textContent=t}}function mk(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function C3(t){return arguments.length?this.each(t==null?hk:(typeof t=="function"?mk:dk)(t)):this.node().textContent}function gk(){this.innerHTML=""}function yk(t){return function(){this.innerHTML=t}}function xk(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function k3(t){return arguments.length?this.each(t==null?gk:(typeof t=="function"?xk:yk)(t)):this.node().innerHTML}function bk(){this.nextSibling&&this.parentNode.appendChild(this)}function N3(){return this.each(bk)}function wk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function O3(){return this.each(wk)}function R3(t){var e=typeof t=="function"?t:_o(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function vk(){return null}function L3(t,e){var n=typeof t=="function"?t:_o(t),r=e==null?vk:typeof e=="function"?e:_s(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _k(){var t=this.parentNode;t&&t.removeChild(this)}function D3(){return this.each(_k)}function Mk(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Sk(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function F3(t){return this.select(t?Sk:Mk)}function P3(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ak(t){return function(e){t.call(this,e,this.__data__)}}function Ek(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Tk(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,o=e.length,i;n<o;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++r]=i;++r?e.length=r:delete this.__on}}}function Ik(t,e,n){return function(){var r=this.__on,o,i=Ak(e);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=e;return}}this.addEventListener(t.type,i,n),o={type:t.type,name:t.name,value:e,listener:i,options:n},r?r.push(o):this.__on=[o]}}function q3(t,e,n){var r=Ek(t+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,f=a.length,l;c<f;++c)for(o=0,l=a[c];o<i;++o)if((s=r[o]).type===l.type&&s.name===l.name)return l.value}return}for(a=e?Ik:Tk,o=0;o<i;++o)this.each(a(r[o],e,n));return this}function B3(t,e,n){var r=wd(t),o=r.CustomEvent;typeof o=="function"?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function $k(t,e){return function(){return B3(this,t,e)}}function Ck(t,e){return function(){return B3(this,t,e.apply(this,arguments))}}function z3(t,e){return this.each((typeof e=="function"?Ck:$k)(t,e))}function*Y3(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var xx=[null];function ne(t,e){this._groups=t,this._parents=e}function U3(){return new ne([[document.documentElement]],xx)}function kk(){return this}ne.prototype=U3.prototype={constructor:ne,select:r3,selectAll:o3,selectChild:i3,selectChildren:s3,filter:a3,data:l3,enter:c3,exit:u3,join:p3,merge:h3,selection:kk,order:d3,sort:m3,call:g3,nodes:y3,node:x3,size:b3,empty:w3,each:v3,attr:_3,style:M3,property:S3,classed:$3,text:C3,html:k3,raise:N3,lower:O3,append:R3,insert:L3,remove:D3,clone:F3,datum:P3,on:q3,dispatch:z3,[Symbol.iterator]:Y3};var Mo=U3;function bt(t){return typeof t=="string"?new ne([[document.querySelector(t)]],[document.documentElement]):new ne([[t]],xx)}function j3(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Xe(t,e){if(t=j3(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var vd={capture:!0,passive:!1};function _d(t){t.preventDefault(),t.stopImmediatePropagation()}function el(t){var e=t.document.documentElement,n=bt(t).on("dragstart.drag",_d,vd);"onselectstart"in e?n.on("selectstart.drag",_d,vd):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function nl(t,e){var n=t.document.documentElement,r=bt(t).on("dragstart.drag",null);e&&(r.on("click.drag",_d,vd),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function So(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function yi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Tr(){}var xi=.7,As=1/xi,Pa="\\s*([+-]?\\d+)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nk=/^#([0-9a-f]{3,8})$/,Ok=new RegExp(`^rgb\\(${Pa},${Pa},${Pa}\\)$`),Rk=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),Lk=new RegExp(`^rgba\\(${Pa},${Pa},${Pa},${rl}\\)$`),Dk=new RegExp(`^rgba\\(${Er},${Er},${Er},${rl}\\)$`),Fk=new RegExp(`^hsl\\(${rl},${Er},${Er}\\)$`),Pk=new RegExp(`^hsla\\(${rl},${Er},${Er},${rl}\\)$`),X3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};So(Tr,Tn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:G3,formatHex:G3,formatHex8:qk,formatHsl:Bk,formatRgb:V3,toString:V3});function G3(){return this.rgb().formatHex()}function qk(){return this.rgb().formatHex8()}function Bk(){return J3(this).formatHsl()}function V3(){return this.rgb().formatRgb()}function Tn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Nk.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?W3(e):n===3?new ce(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Md(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Md(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ok.exec(t))?new ce(e[1],e[2],e[3],1):(e=Rk.exec(t))?new ce(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Lk.exec(t))?Md(e[1],e[2],e[3],e[4]):(e=Dk.exec(t))?Md(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Fk.exec(t))?Z3(e[1],e[2]/100,e[3]/100,1):(e=Pk.exec(t))?Z3(e[1],e[2]/100,e[3]/100,e[4]):X3.hasOwnProperty(t)?W3(X3[t]):t==="transparent"?new ce(NaN,NaN,NaN,0):null}function W3(t){return new ce(t>>16&255,t>>8&255,t&255,1)}function Md(t,e,n,r){return r<=0&&(t=e=n=NaN),new ce(t,e,n,r)}function ol(t){return t instanceof Tr||(t=Tn(t)),t?(t=t.rgb(),new ce(t.r,t.g,t.b,t.opacity)):new ce}function ye(t,e,n,r){return arguments.length===1?ol(t):new ce(t,e,n,r??1)}function ce(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}So(ce,ye,yi(Tr,{brighter(t){return t=t==null?As:Math.pow(As,t),new ce(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?xi:Math.pow(xi,t),new ce(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ce(Ss(this.r),Ss(this.g),Ss(this.b),Ad(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:H3,formatHex:H3,formatHex8:zk,formatRgb:Q3,toString:Q3}));function H3(){return`#${Ms(this.r)}${Ms(this.g)}${Ms(this.b)}`}function zk(){return`#${Ms(this.r)}${Ms(this.g)}${Ms(this.b)}${Ms((isNaN(this.opacity)?1:this.opacity)*255)}`}function Q3(){let t=Ad(this.opacity);return`${t===1?"rgb(":"rgba("}${Ss(this.r)}, ${Ss(this.g)}, ${Ss(this.b)}${t===1?")":`, ${t})`}`}function Ad(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ss(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ms(t){return t=Ss(t),(t<16?"0":"")+t.toString(16)}function Z3(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pr(t,e,n,r)}function J3(t){if(t instanceof pr)return new pr(t.h,t.s,t.l,t.opacity);if(t instanceof Tr||(t=Tn(t)),!t)return new pr;if(t instanceof pr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(e===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new pr(s,a,c,t.opacity)}function il(t,e,n,r){return arguments.length===1?J3(t):new pr(t,e,n,r??1)}function pr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}So(pr,il,yi(Tr,{brighter(t){return t=t==null?As:Math.pow(As,t),new pr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?xi:Math.pow(xi,t),new pr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new ce(bx(t>=240?t-240:t+120,o,r),bx(t,o,r),bx(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new pr(K3(this.h),Sd(this.s),Sd(this.l),Ad(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Ad(this.opacity);return`${t===1?"hsl(":"hsla("}${K3(this.h)}, ${Sd(this.s)*100}%, ${Sd(this.l)*100}%${t===1?")":`, ${t})`}`}}));function K3(t){return t=(t||0)%360,t<0?t+360:t}function Sd(t){return Math.max(0,Math.min(1,t||0))}function bx(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Ed=Math.PI/180,Td=180/Math.PI;var Id=18,t4=.96422,e4=1,n4=.82521,r4=4/29,qa=6/29,o4=3*qa*qa,Yk=qa*qa*qa;function i4(t){if(t instanceof Ir)return new Ir(t.l,t.a,t.b,t.opacity);if(t instanceof Ao)return s4(t);t instanceof ce||(t=ol(t));var e=Mx(t.r),n=Mx(t.g),r=Mx(t.b),o=wx((.2225045*e+.7168786*n+.0606169*r)/e4),i,s;return e===n&&n===r?i=s=o:(i=wx((.4360747*e+.3850649*n+.1430804*r)/t4),s=wx((.0139322*e+.0971045*n+.7141733*r)/n4)),new Ir(116*o-16,500*(i-o),200*(o-s),t.opacity)}function Ba(t,e,n,r){return arguments.length===1?i4(t):new Ir(t,e,n,r??1)}function Ir(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}So(Ir,Ba,yi(Tr,{brighter(t){return new Ir(this.l+Id*(t??1),this.a,this.b,this.opacity)},darker(t){return new Ir(this.l-Id*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=t4*vx(e),t=e4*vx(t),n=n4*vx(n),new ce(_x(3.1338561*e-1.6168667*t-.4906146*n),_x(-.9787684*e+1.9161415*t+.033454*n),_x(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function wx(t){return t>Yk?Math.pow(t,1/3):t/o4+r4}function vx(t){return t>qa?t*t*t:o4*(t-r4)}function _x(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Mx(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Uk(t){if(t instanceof Ao)return new Ao(t.h,t.c,t.l,t.opacity);if(t instanceof Ir||(t=i4(t)),t.a===0&&t.b===0)return new Ao(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Td;return new Ao(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function sl(t,e,n,r){return arguments.length===1?Uk(t):new Ao(t,e,n,r??1)}function Ao(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function s4(t){if(isNaN(t.h))return new Ir(t.l,0,0,t.opacity);var e=t.h*Ed;return new Ir(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}So(Ao,sl,yi(Tr,{brighter(t){return new Ao(this.h,this.c,this.l+Id*(t??1),this.opacity)},darker(t){return new Ao(this.h,this.c,this.l-Id*(t??1),this.opacity)},rgb(){return s4(this).rgb()}}));var l4=-.14861,Sx=1.78277,Ax=-.29227,$d=-.90649,al=1.97294,a4=al*$d,c4=al*Sx,f4=Sx*Ax-$d*l4;function jk(t){if(t instanceof Es)return new Es(t.h,t.s,t.l,t.opacity);t instanceof ce||(t=ol(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(f4*r+a4*e-c4*n)/(f4+a4-c4),i=r-o,s=(al*(n-o)-Ax*i)/$d,a=Math.sqrt(s*s+i*i)/(al*o*(1-o)),c=a?Math.atan2(s,i)*Td-120:NaN;return new Es(c<0?c+360:c,a,o,t.opacity)}function an(t,e,n,r){return arguments.length===1?jk(t):new Es(t,e,n,r??1)}function Es(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}So(Es,an,yi(Tr,{brighter(t){return t=t==null?As:Math.pow(As,t),new Es(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?xi:Math.pow(xi,t),new Es(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Ed,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),o=Math.sin(t);return new ce(255*(e+n*(l4*r+Sx*o)),255*(e+n*(Ax*r+$d*o)),255*(e+n*(al*r)),this.opacity)}}));function Ex(t,e,n,r,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*n+(1+3*t+3*i-3*s)*r+s*o)/6}function u4(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],s=r>0?t[r-1]:2*o-i,a=r<e-1?t[r+2]:2*i-o;return Ex((n-r/e)*e,s,o,i,a)}}function p4(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],s=t[(r+1)%e],a=t[(r+2)%e];return Ex((n-r/e)*e,o,i,s,a)}}var za=t=>()=>t;function h4(t,e){return function(n){return t+n*e}}function Xk(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Ya(t,e){var n=e-t;return n?h4(t,n>180||n<-180?n-360*Math.round(n/360):n):za(isNaN(t)?e:t)}function d4(t){return(t=+t)==1?Wt:function(e,n){return n-e?Xk(e,n,t):za(isNaN(e)?n:e)}}function Wt(t,e){var n=e-t;return n?h4(t,n):za(isNaN(t)?e:t)}var Gn=function t(e){var n=d4(e);function r(o,i){var s=n((o=ye(o)).r,(i=ye(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),f=Wt(o.opacity,i.opacity);return function(l){return o.r=s(l),o.g=a(l),o.b=c(l),o.opacity=f(l),o+""}}return r.gamma=t,r}(1);function m4(t){return function(e){var n=e.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=ye(e[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=t(r),o=t(o),i=t(i),a.opacity=1,function(c){return a.r=r(c),a.g=o(c),a.b=i(c),a+""}}}var Tx=m4(u4),Gk=m4(p4);function g4(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=t[o]*(1-i)+e[o]*i;return r}}function y4(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function x4(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=In(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function b4(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Gt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function w4(t,e){var n={},r={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=In(t[o],e[o]):r[o]=e[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var $x=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ix=new RegExp($x.source,"g");function Vk(t){return function(){return t}}function Wk(t){return function(e){return t(e)+""}}function cl(t,e){var n=$x.lastIndex=Ix.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=$x.exec(t))&&(o=Ix.exec(e));)(i=o.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:Gt(r,o)})),n=Ix.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?Wk(c[0].x):Vk(e):(e=c.length,function(f){for(var l=0,u;l<e;++l)a[(u=c[l]).i]=u.x(f);return a.join("")})}function In(t,e){var n=typeof e,r;return e==null||n==="boolean"?za(e):(n==="number"?Gt:n==="string"?(r=Tn(e))?(e=r,Gn):cl:e instanceof Tn?Gn:e instanceof Date?b4:y4(e)?g4:Array.isArray(e)?x4:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?w4:Gt)(t,e)}function Ts(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var v4=180/Math.PI,Cd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cx(t,e,n,r,o,i){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*v4,skewX:Math.atan(c)*v4,scaleX:s,scaleY:a}}var kd;function _4(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Cd:Cx(e.a,e.b,e.c,e.d,e.e,e.f)}function M4(t){return t==null?Cd:(kd||(kd=document.createElementNS("http://www.w3.org/2000/svg","g")),kd.setAttribute("transform",t),(t=kd.transform.baseVal.consolidate())?(t=t.matrix,Cx(t.a,t.b,t.c,t.d,t.e,t.f)):Cd)}function S4(t,e,n,r){function o(f){return f.length?f.pop()+" ":""}function i(f,l,u,p,h,d){if(f!==u||l!==p){var m=h.push("translate(",null,e,null,n);d.push({i:m-4,x:Gt(f,u)},{i:m-2,x:Gt(l,p)})}else(u||p)&&h.push("translate("+u+e+p+n)}function s(f,l,u,p){f!==l?(f-l>180?l+=360:l-f>180&&(f+=360),p.push({i:u.push(o(u)+"rotate(",null,r)-2,x:Gt(f,l)})):l&&u.push(o(u)+"rotate("+l+r)}function a(f,l,u,p){f!==l?p.push({i:u.push(o(u)+"skewX(",null,r)-2,x:Gt(f,l)}):l&&u.push(o(u)+"skewX("+l+r)}function c(f,l,u,p,h,d){if(f!==u||l!==p){var m=h.push(o(h)+"scale(",null,",",null,")");d.push({i:m-4,x:Gt(f,u)},{i:m-2,x:Gt(l,p)})}else(u!==1||p!==1)&&h.push(o(h)+"scale("+u+","+p+")")}return function(f,l){var u=[],p=[];return f=t(f),l=t(l),i(f.translateX,f.translateY,l.translateX,l.translateY,u,p),s(f.rotate,l.rotate,u,p),a(f.skewX,l.skewX,u,p),c(f.scaleX,f.scaleY,l.scaleX,l.scaleY,u,p),f=l=null,function(h){for(var d=-1,m=p.length,g;++d<m;)u[(g=p[d]).i]=g.x(h);return u.join("")}}}var kx=S4(_4,"px, ","px)","deg)"),Nx=S4(M4,", ",")",")");var Hk=1e-12;function A4(t){return((t=Math.exp(t))+1/t)/2}function Qk(t){return((t=Math.exp(t))-1/t)/2}function Zk(t){return((t=Math.exp(2*t))-1)/(t+1)}var Ox=function t(e,n,r){function o(i,s){var a=i[0],c=i[1],f=i[2],l=s[0],u=s[1],p=s[2],h=l-a,d=u-c,m=h*h+d*d,g,y;if(m<Hk)y=Math.log(p/f)/e,g=function(A){return[a+A*h,c+A*d,f*Math.exp(e*A*y)]};else{var x=Math.sqrt(m),w=(p*p-f*f+r*m)/(2*f*n*x),b=(p*p-f*f-r*m)/(2*p*n*x),_=Math.log(Math.sqrt(w*w+1)-w),v=Math.log(Math.sqrt(b*b+1)-b);y=(v-_)/e,g=function(A){var T=A*y,E=A4(_),$=f/(n*x)*(E*Zk(e*T+_)-Qk(_));return[a+$*h,c+$*d,f*E/A4(e*T+_)]}}return g.duration=y*1e3*e/Math.SQRT2,g}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return t(s,a,c)},o}(Math.SQRT2,2,4);function E4(t){return function(e,n){var r=t((e=il(e)).h,(n=il(n)).h),o=Wt(e.s,n.s),i=Wt(e.l,n.l),s=Wt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.s=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var Rx=E4(Ya),Kk=E4(Wt);function Nd(t,e){var n=Wt((t=Ba(t)).l,(e=Ba(e)).l),r=Wt(t.a,e.a),o=Wt(t.b,e.b),i=Wt(t.opacity,e.opacity);return function(s){return t.l=n(s),t.a=r(s),t.b=o(s),t.opacity=i(s),t+""}}function T4(t){return function(e,n){var r=t((e=sl(e)).h,(n=sl(n)).h),o=Wt(e.c,n.c),i=Wt(e.l,n.l),s=Wt(e.opacity,n.opacity);return function(a){return e.h=r(a),e.c=o(a),e.l=i(a),e.opacity=s(a),e+""}}}var Lx=T4(Ya),Jk=T4(Wt);function I4(t){return function e(n){n=+n;function r(o,i){var s=t((o=an(o)).h,(i=an(i)).h),a=Wt(o.s,i.s),c=Wt(o.l,i.l),f=Wt(o.opacity,i.opacity);return function(l){return o.h=s(l),o.s=a(l),o.l=c(Math.pow(l,n)),o.opacity=f(l),o+""}}return r.gamma=e,r}(1)}var tN=I4(Ya),Ua=I4(Wt);function $r(t,e){e===void 0&&(e=t,t=In);for(var n=0,r=e.length-1,o=e[0],i=new Array(r<0?0:r);n<r;)i[n]=t(o,o=e[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return i[a](s-a)}}function Ge(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var ja=0,ll=0,fl=0,C4=1e3,Od,ul,Rd=0,Is=0,Ld=0,pl=typeof performance=="object"&&performance.now?performance:Date,k4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function dl(){return Is||(k4(eN),Is=pl.now()+Ld)}function eN(){Is=0}function hl(){this._call=this._time=this._next=null}hl.prototype=Dd.prototype={constructor:hl,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?dl():+n)+(e==null?0:+e),!this._next&&ul!==this&&(ul?ul._next=this:Od=this,ul=this),this._call=t,this._time=n,Dx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dx())}};function Dd(t,e,n){var r=new hl;return r.restart(t,e,n),r}function N4(){dl(),++ja;for(var t=Od,e;t;)(e=Is-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ja}function $4(){Is=(Rd=pl.now())+Ld,ja=ll=0;try{N4()}finally{ja=0,rN(),Is=0}}function nN(){var t=pl.now(),e=t-Rd;e>C4&&(Ld-=e,Rd=t)}function rN(){for(var t,e=Od,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Od=n);ul=t,Dx(r)}function Dx(t){if(!ja){ll&&(ll=clearTimeout(ll));var e=t-Is;e>24?(t<1/0&&(ll=setTimeout($4,t-pl.now()-Ld)),fl&&(fl=clearInterval(fl))):(fl||(Rd=pl.now(),fl=setInterval(nN,C4)),ja=1,k4($4))}}function Fd(t,e,n){var r=new hl;return e=e==null?0:+e,r.restart(o=>{r.stop(),t(o+e)},e,n),r}var oN=vs("start","end","cancel","interrupt"),iN=[],L4=0,O4=1,qd=2,Pd=3,R4=4,Bd=5,ml=6;function bi(t,e,n,r,o,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;sN(t,n,{name:e,index:r,group:o,on:oN,tween:iN,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:L4})}function gl(t,e){var n=xe(t,e);if(n.state>L4)throw new Error("too late; already scheduled");return n}function qe(t,e){var n=xe(t,e);if(n.state>Pd)throw new Error("too late; already running");return n}function xe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function sN(t,e,n){var r=t.__transition,o;r[e]=n,n.timer=Dd(i,0,n.time);function i(f){n.state=O4,n.timer.restart(s,n.delay,n.time),n.delay<=f&&s(f-n.delay)}function s(f){var l,u,p,h;if(n.state!==O4)return c();for(l in r)if(h=r[l],h.name===n.name){if(h.state===Pd)return Fd(s);h.state===R4?(h.state=ml,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[l]):+l<e&&(h.state=ml,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[l])}if(Fd(function(){n.state===Pd&&(n.state=R4,n.timer.restart(a,n.delay,n.time),a(f))}),n.state=qd,n.on.call("start",t,t.__data__,n.index,n.group),n.state===qd){for(n.state=Pd,o=new Array(p=n.tween.length),l=0,u=-1;l<p;++l)(h=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(o[++u]=h);o.length=u+1}}function a(f){for(var l=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=Bd,1),u=-1,p=o.length;++u<p;)o[u].call(t,l);n.state===Bd&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=ml,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function Cr(t,e){var n=t.__transition,r,o,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){i=!1;continue}o=r.state>qd&&r.state<Bd,r.state=ml,r.timer.stop(),r.on.call(o?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}i&&delete t.__transition}}function D4(t){return this.each(function(){Cr(this,t)})}function aN(t,e){var n,r;return function(){var o=qe(this,t),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function cN(t,e,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=qe(this,t),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:e,value:n},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=a;break}c===f&&o.push(a)}i.tween=o}}function F4(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=xe(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===t)return s.value;return null}return this.each((e==null?aN:cN)(n,t,e))}function Xa(t,e,n){var r=t._id;return t.each(function(){var o=qe(this,r);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return xe(o,r).value[e]}}function zd(t,e){var n;return(typeof e=="number"?Gt:e instanceof Tn?Gn:(n=Tn(e))?(e=n,Gn):cl)(t,e)}function fN(t){return function(){this.removeAttribute(t)}}function lN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function uN(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=e(r=s,n)}}function pN(t,e,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=e(r=s,n)}}function hN(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function dN(t,e,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a)))}}function P4(t,e){var n=vo(t),r=n==="transform"?Nx:zd;return this.attrTween(t,typeof e=="function"?(n.local?dN:hN)(n,r,Xa(this,"attr."+t,e)):e==null?(n.local?lN:fN)(n):(n.local?pN:uN)(n,r,e))}function mN(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function gN(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function yN(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&gN(t,i)),n}return o._value=e,o}function xN(t,e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&mN(t,i)),n}return o._value=e,o}function q4(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=vo(t);return this.tween(n,(r.local?yN:xN)(r,e))}function bN(t,e){return function(){gl(this,t).delay=+e.apply(this,arguments)}}function wN(t,e){return e=+e,function(){gl(this,t).delay=e}}function B4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?bN:wN)(e,t)):xe(this.node(),e).delay}function vN(t,e){return function(){qe(this,t).duration=+e.apply(this,arguments)}}function _N(t,e){return e=+e,function(){qe(this,t).duration=e}}function z4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?vN:_N)(e,t)):xe(this.node(),e).duration}function MN(t,e){if(typeof e!="function")throw new Error;return function(){qe(this,t).ease=e}}function Y4(t){var e=this._id;return arguments.length?this.each(MN(e,t)):xe(this.node(),e).ease}function SN(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,t).ease=n}}function U4(t){if(typeof t!="function")throw new Error;return this.each(SN(this._id,t))}function j4(t){typeof t!="function"&&(t=Jf(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i=e[o],s=i.length,a=r[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&a.push(c);return new cn(r,this._parents,this._name,this._id)}function X4(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=e[a],f=n[a],l=c.length,u=s[a]=new Array(l),p,h=0;h<l;++h)(p=c[h]||f[h])&&(u[h]=p);for(;a<r;++a)s[a]=e[a];return new cn(s,this._parents,this._name,this._id)}function AN(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function EN(t,e,n){var r,o,i=AN(e)?gl:qe;return function(){var s=i(this,t),a=s.on;a!==r&&(o=(r=a).copy()).on(e,n),s.on=o}}function G4(t,e){var n=this._id;return arguments.length<2?xe(this.node(),n).on.on(t):this.each(EN(n,t,e))}function TN(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function V4(){return this.on("end.remove",TN(this._id))}function W4(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_s(t));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,f=i[s]=new Array(c),l,u,p=0;p<c;++p)(l=a[p])&&(u=t.call(l,l.__data__,p,a))&&("__data__"in l&&(u.__data__=l.__data__),f[p]=u,bi(f[p],e,n,p,f,xe(l,n)));return new cn(i,this._parents,e,n)}function H4(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Kf(t));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],f=c.length,l,u=0;u<f;++u)if(l=c[u]){for(var p=t.call(l,l.__data__,u,c),h,d=xe(l,n),m=0,g=p.length;m<g;++m)(h=p[m])&&bi(h,e,n,m,p,d);i.push(p),s.push(l)}return new cn(i,s,e,n)}var IN=Mo.prototype.constructor;function Q4(){return new IN(this._groups,this._parents)}function $N(t,e){var n,r,o;return function(){var i=gi(this,t),s=(this.style.removeProperty(t),gi(this,t));return i===s?null:i===n&&s===r?o:o=e(n=i,r=s)}}function Z4(t){return function(){this.style.removeProperty(t)}}function CN(t,e,n){var r,o=n+"",i;return function(){var s=gi(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}function kN(t,e,n){var r,o,i;return function(){var s=gi(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),gi(this,t))),s===c?null:s===r&&c===o?i:(o=c,i=e(r=s,a))}}function NN(t,e){var n,r,o,i="style."+e,s="end."+i,a;return function(){var c=qe(this,t),f=c.on,l=c.value[i]==null?a||(a=Z4(e)):void 0;(f!==n||o!==l)&&(r=(n=f).copy()).on(s,o=l),c.on=r}}function K4(t,e,n){var r=(t+="")=="transform"?kx:zd;return e==null?this.styleTween(t,$N(t,r)).on("end.style."+t,Z4(t)):typeof e=="function"?this.styleTween(t,kN(t,r,Xa(this,"style."+t,e))).each(NN(this._id,t)):this.styleTween(t,CN(t,r,e),n).on("end.style."+t,null)}function ON(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function RN(t,e,n){var r,o;function i(){var s=e.apply(this,arguments);return s!==o&&(r=(o=s)&&ON(t,s,n)),r}return i._value=e,i}function J4(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,RN(t,e,n??""))}function LN(t){return function(){this.textContent=t}}function DN(t){return function(){var e=t(this);this.textContent=e??""}}function t5(t){return this.tween("text",typeof t=="function"?DN(Xa(this,"text",t)):LN(t==null?"":t+""))}function FN(t){return function(e){this.textContent=t.call(this,e)}}function PN(t){var e,n;function r(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&FN(o)),e}return r._value=t,r}function e5(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,PN(t))}function n5(){for(var t=this._name,e=this._id,n=Yd(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)if(c=s[f]){var l=xe(c,e);bi(c,t,n,f,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new cn(r,this._parents,t,n)}function r5(){var t,e,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var f=qe(this,r),l=f.on;l!==t&&(e=(t=l).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),f.on=e}),o===0&&i()})}var qN=0;function cn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function o5(t){return Mo().transition(t)}function Yd(){return++qN}var Eo=Mo.prototype;cn.prototype=o5.prototype={constructor:cn,select:W4,selectAll:H4,selectChild:Eo.selectChild,selectChildren:Eo.selectChildren,filter:j4,merge:X4,selection:Q4,transition:n5,call:Eo.call,nodes:Eo.nodes,node:Eo.node,size:Eo.size,empty:Eo.empty,each:Eo.each,on:G4,attr:P4,attrTween:q4,style:K4,styleTween:J4,text:t5,textTween:e5,remove:V4,tween:F4,delay:B4,duration:z4,ease:Y4,easeVarying:U4,end:r5,[Symbol.iterator]:Eo[Symbol.iterator]};function Ud(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var BN={time:null,delay:0,duration:250,ease:Ud};function zN(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function i5(t){var e,n;t instanceof cn?(e=t._id,t=t._name):(e=Yd(),(n=BN).time=dl(),t=t==null?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,f=0;f<a;++f)(c=s[f])&&bi(c,t,e,f,s,n||zN(c,e));return new cn(r,this._parents,t,e)}Mo.prototype.interrupt=D4;Mo.prototype.transition=i5;var jd=t=>()=>t;function Fx(t,{sourceEvent:e,target:n,selection:r,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function s5(t){t.stopImmediatePropagation()}function Xd(t){t.preventDefault(),t.stopImmediatePropagation()}var a5={name:"drag"},Px={name:"space"},Ga={name:"handle"},Va={name:"center"},{abs:c5,max:Ve,min:We}=Math;function f5(t){return[+t[0],+t[1]]}function Bx(t){return[f5(t[0]),f5(t[1])]}var Gd={name:"x",handles:["w","e"].map(yl),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Vd={name:"y",handles:["n","s"].map(yl),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},YN={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(yl),input:function(t){return t==null?null:Bx(t)},output:function(t){return t}},To={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},l5={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},u5={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},UN={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},jN={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function yl(t){return{type:t}}function XN(t){return!t.ctrlKey&&!t.button}function GN(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function VN(){return navigator.maxTouchPoints||"ontouchstart"in this}function qx(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function WN(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function zx(){return jx(Gd)}function Yx(){return jx(Vd)}function Ux(){return jx(YN)}function jx(t){var e=GN,n=XN,r=VN,o=!0,i=vs("start","brush","end"),s=6,a;function c(g){var y=g.property("__brush",m).selectAll(".overlay").data([yl("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",To.overlay).merge(y).each(function(){var w=qx(this).extent;bt(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),g.selectAll(".selection").data([yl("selection")]).enter().append("rect").attr("class","selection").attr("cursor",To.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=g.selectAll(".handle").data(t.handles,function(w){return w.type});x.exit().remove(),x.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return To[w.type]}),g.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",p).filter(r).on("touchstart.brush",p).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,y,x){g.tween?g.on("start.brush",function(w){l(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){l(this,arguments).end(w)}).tween("brush",function(){var w=this,b=w.__brush,_=l(w,arguments),v=b.selection,A=t.input(typeof y=="function"?y.apply(this,arguments):y,b.extent),T=In(v,A);function E($){b.selection=$===1&&A===null?null:T($),f.call(w),_.brush()}return v!==null&&A!==null?E:E(1)}):g.each(function(){var w=this,b=arguments,_=w.__brush,v=t.input(typeof y=="function"?y.apply(w,b):y,_.extent),A=l(w,b).beforestart();Cr(w),_.selection=v===null?null:v,f.call(w),A.start(x).brush(x).end(x)})},c.clear=function(g,y){c.move(g,null,y)};function f(){var g=bt(this),y=qx(this).selection;y?(g.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?y[1][1]-y[0][1]+s:s})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(g,y,x){var w=g.__brush.emitter;return w&&(!x||!w.clean)?w:new u(g,y,x)}function u(g,y,x){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=x}u.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,y){return this.starting?(this.starting=!1,this.emit("start",g,y)):this.emit("brush",g),this},brush:function(g,y){return this.emit("brush",g,y),this},end:function(g,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,y)),this},emit:function(g,y,x){var w=bt(this.that).datum();i.call(g,this.that,new Fx(g,{sourceEvent:y,target:c,selection:t.output(this.state.selection),mode:x,dispatch:i}),w)}};function p(g){if(a&&!g.touches||!n.apply(this,arguments))return;var y=this,x=g.target.__data__.type,w=(o&&g.metaKey?x="overlay":x)==="selection"?a5:o&&g.altKey?Va:Ga,b=t===Vd?null:UN[x],_=t===Gd?null:jN[x],v=qx(y),A=v.extent,T=v.selection,E=A[0][0],$,S,k=A[0][1],O,M,I=A[1][0],C,N,L=A[1][1],R,D,F=0,P=0,V,J=b&&_&&o&&g.shiftKey,et,rt,j=Array.from(g.touches||[g],Z=>{let Dt=Z.identifier;return Z=Xe(Z,y),Z.point0=Z.slice(),Z.identifier=Dt,Z});Cr(y);var nt=l(y,arguments,!0).beforestart();if(x==="overlay"){T&&(V=!0);let Z=[j[0],j[1]||j[0]];v.selection=T=[[$=t===Vd?E:We(Z[0][0],Z[1][0]),O=t===Gd?k:We(Z[0][1],Z[1][1])],[C=t===Vd?I:Ve(Z[0][0],Z[1][0]),R=t===Gd?L:Ve(Z[0][1],Z[1][1])]],j.length>1&>(g)}else $=T[0][0],O=T[0][1],C=T[1][0],R=T[1][1];S=$,M=O,N=C,D=R;var z=bt(y).attr("pointer-events","none"),W=z.selectAll(".overlay").attr("cursor",To[x]);if(g.touches)nt.moved=q,nt.ended=at;else{var tt=bt(g.view).on("mousemove.brush",q,!0).on("mouseup.brush",at,!0);o&&tt.on("keydown.brush",At,!0).on("keyup.brush",It,!0),el(g.view)}f.call(y),nt.start(g,w.name);function q(Z){for(let Dt of Z.changedTouches||[Z])for(let Mn of j)Mn.identifier===Dt.identifier&&(Mn.cur=Xe(Dt,y));if(J&&!et&&!rt&&j.length===1){let Dt=j[0];c5(Dt.cur[0]-Dt[0])>c5(Dt.cur[1]-Dt[1])?rt=!0:et=!0}for(let Dt of j)Dt.cur&&(Dt[0]=Dt.cur[0],Dt[1]=Dt.cur[1]);V=!0,Xd(Z),gt(Z)}function gt(Z){let Dt=j[0],Mn=Dt.point0;var wr;switch(F=Dt[0]-Mn[0],P=Dt[1]-Mn[1],w){case Px:case a5:{b&&(F=Ve(E-$,We(I-C,F)),S=$+F,N=C+F),_&&(P=Ve(k-O,We(L-R,P)),M=O+P,D=R+P);break}case Ga:{j[1]?(b&&(S=Ve(E,We(I,j[0][0])),N=Ve(E,We(I,j[1][0])),b=1),_&&(M=Ve(k,We(L,j[0][1])),D=Ve(k,We(L,j[1][1])),_=1)):(b<0?(F=Ve(E-$,We(I-$,F)),S=$+F,N=C):b>0&&(F=Ve(E-C,We(I-C,F)),S=$,N=C+F),_<0?(P=Ve(k-O,We(L-O,P)),M=O+P,D=R):_>0&&(P=Ve(k-R,We(L-R,P)),M=O,D=R+P));break}case Va:{b&&(S=Ve(E,We(I,$-F*b)),N=Ve(E,We(I,C+F*b))),_&&(M=Ve(k,We(L,O-P*_)),D=Ve(k,We(L,R+P*_)));break}}N<S&&(b*=-1,wr=$,$=C,C=wr,wr=S,S=N,N=wr,x in l5&&W.attr("cursor",To[x=l5[x]])),D<M&&(_*=-1,wr=O,O=R,R=wr,wr=M,M=D,D=wr,x in u5&&W.attr("cursor",To[x=u5[x]])),v.selection&&(T=v.selection),et&&(S=T[0][0],N=T[1][0]),rt&&(M=T[0][1],D=T[1][1]),(T[0][0]!==S||T[0][1]!==M||T[1][0]!==N||T[1][1]!==D)&&(v.selection=[[S,M],[N,D]],f.call(y),nt.brush(Z,w.name))}function at(Z){if(s5(Z),Z.touches){if(Z.touches.length)return;a&&clearTimeout(a),a=setTimeout(function(){a=null},500)}else nl(Z.view,V),tt.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),W.attr("cursor",To.overlay),v.selection&&(T=v.selection),WN(T)&&(v.selection=null,f.call(y)),nt.end(Z,w.name)}function At(Z){switch(Z.keyCode){case 16:{J=b&&_;break}case 18:{w===Ga&&(b&&(C=N-F*b,$=S+F*b),_&&(R=D-P*_,O=M+P*_),w=Va,gt(Z));break}case 32:{(w===Ga||w===Va)&&(b<0?C=N-F:b>0&&($=S-F),_<0?R=D-P:_>0&&(O=M-P),w=Px,W.attr("cursor",To.selection),gt(Z));break}default:return}Xd(Z)}function It(Z){switch(Z.keyCode){case 16:{J&&(et=rt=J=!1,gt(Z));break}case 18:{w===Va&&(b<0?C=N:b>0&&($=S),_<0?R=D:_>0&&(O=M),w=Ga,gt(Z));break}case 32:{w===Px&&(Z.altKey?(b&&(C=N-F*b,$=S+F*b),_&&(R=D-P*_,O=M+P*_),w=Va):(b<0?C=N:b>0&&($=S),_<0?R=D:_>0&&(O=M),w=Ga),W.attr("cursor",To[x]),gt(Z));break}default:return}Xd(Z)}}function h(g){l(this,arguments).moved(g)}function d(g){l(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Bx(e.apply(this,arguments)),g.dim=t,g}return c.extent=function(g){return arguments.length?(e=typeof g=="function"?g:jd(Bx(g)),c):e},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:jd(!!g),c):n},c.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:jd(!!g),c):r},c.handleSize=function(g){return arguments.length?(s=+g,c):s},c.keyModifiers=function(g){return arguments.length?(o=!!g,c):o},c.on=function(){var g=i.on.apply(i,arguments);return g===i?c:g},c}var Xx=Math.PI,Gx=2*Xx,$s=1e-6,HN=Gx-$s;function p5(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function QN(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return p5;let n=10**e;return function(r){this._+=r[0];for(let o=1,i=r.length;o<i;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}var wi=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?p5:QN(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,o){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+o}`}bezierCurveTo(e,n,r,o,i,s){this._append`C${+e},${+n},${+r},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,r,o,i){if(e=+e,n=+n,r=+r,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,c=r-e,f=o-n,l=s-e,u=a-n,p=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(p>$s)if(!(Math.abs(u*c-f*l)>$s)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,d=o-a,m=c*c+f*f,g=h*h+d*d,y=Math.sqrt(m),x=Math.sqrt(p),w=i*Math.tan((Xx-Math.acos((m+p-g)/(2*y*x)))/2),b=w/x,_=w/y;Math.abs(b-1)>$s&&this._append`L${e+b*l},${n+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=e+_*c},${this._y1=n+_*f}`}}arc(e,n,r,o,i,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(o),c=r*Math.sin(o),f=e+a,l=n+c,u=1^s,p=s?o-i:i-o;this._x1===null?this._append`M${f},${l}`:(Math.abs(this._x1-f)>$s||Math.abs(this._y1-l)>$s)&&this._append`L${f},${l}`,r&&(p<0&&(p=p%Gx+Gx),p>HN?this._append`A${r},${r},0,1,${u},${e-a},${n-c}A${r},${r},0,1,${u},${this._x1=f},${this._y1=l}`:p>$s&&this._append`A${r},${r},0,${+(p>=Xx)},${u},${this._x1=e+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(e,n,r,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function h5(){return new wi}h5.prototype=wi.prototype;function fn(t=3){return new wi(+t)}var ZN=Array.prototype,Wd=ZN.slice;function d5(t,e){return t-e}function m5(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}var kr=t=>()=>t;function g5(t,e){for(var n=-1,r=e.length,o;++n<r;)if(o=KN(t,e[n]))return o;return 0}function KN(t,e){for(var n=e[0],r=e[1],o=-1,i=0,s=t.length,a=s-1;i<s;a=i++){var c=t[i],f=c[0],l=c[1],u=t[a],p=u[0],h=u[1];if(JN(c,u,e))return 0;l>r!=h>r&&n<(p-f)*(r-l)/(h-l)+f&&(o=-o)}return o}function JN(t,e,n){var r;return tO(t,e,n)&&eO(t[r=+(t[0]===e[0])],n[r],e[r])}function tO(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function eO(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function y5(){}var Io=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function vi(){var t=1,e=1,n=di,r=c;function o(f){var l=n(f);if(Array.isArray(l))l=l.slice().sort(d5);else{let u=kt(f,nO);for(l=Fe(...La(u[0],u[1],l),l);l[l.length-1]>=u[1];)l.pop();for(;l[1]<u[0];)l.shift()}return l.map(u=>i(f,u))}function i(f,l){let u=l==null?NaN:+l;if(isNaN(u))throw new Error(`invalid value: ${l}`);var p=[],h=[];return s(f,u,function(d){r(d,f,u),m5(d)>0?p.push([d]):h.push(d)}),h.forEach(function(d){for(var m=0,g=p.length,y;m<g;++m)if(g5((y=p[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:p}}function s(f,l,u){var p=new Array,h=new Array,d,m,g,y,x,w;for(d=m=-1,y=Cs(f[0],l),Io[y<<1].forEach(b);++d<t-1;)g=y,y=Cs(f[d+1],l),Io[g|y<<1].forEach(b);for(Io[y<<0].forEach(b);++m<e-1;){for(d=-1,y=Cs(f[m*t+t],l),x=Cs(f[m*t],l),Io[y<<1|x<<2].forEach(b);++d<t-1;)g=y,y=Cs(f[m*t+t+d+1],l),w=x,x=Cs(f[m*t+d+1],l),Io[g|y<<1|x<<2|w<<3].forEach(b);Io[y|x<<3].forEach(b)}for(d=-1,x=f[m*t]>=l,Io[x<<2].forEach(b);++d<t-1;)w=x,x=Cs(f[m*t+d+1],l),Io[x<<2|w<<3].forEach(b);Io[x<<3].forEach(b);function b(_){var v=[_[0][0]+d,_[0][1]+m],A=[_[1][0]+d,_[1][1]+m],T=a(v),E=a(A),$,S;($=h[T])?(S=p[E])?(delete h[$.end],delete p[S.start],$===S?($.ring.push(A),u($.ring)):p[$.start]=h[S.end]={start:$.start,end:S.end,ring:$.ring.concat(S.ring)}):(delete h[$.end],$.ring.push(A),h[$.end=E]=$):($=p[E])?(S=h[T])?(delete p[$.start],delete h[S.end],$===S?($.ring.push(A),u($.ring)):p[S.start]=h[$.end]={start:S.start,end:$.end,ring:S.ring.concat($.ring)}):(delete p[$.start],$.ring.unshift(v),p[$.start=T]=$):p[T]=h[E]={start:T,end:E,ring:[v,A]}}}function a(f){return f[0]*2+f[1]*(t+1)*4}function c(f,l,u){f.forEach(function(p){var h=p[0],d=p[1],m=h|0,g=d|0,y=Vx(l[g*t+m]);h>0&&h<t&&m===h&&(p[0]=x5(h,Vx(l[g*t+m-1]),y,u)),d>0&&d<e&&g===d&&(p[1]=x5(d,Vx(l[(g-1)*t+m]),y,u))})}return o.contour=i,o.size=function(f){if(!arguments.length)return[t,e];var l=Math.floor(f[0]),u=Math.floor(f[1]);if(!(l>=0&&u>=0))throw new Error("invalid size");return t=l,e=u,o},o.thresholds=function(f){return arguments.length?(n=typeof f=="function"?f:Array.isArray(f)?kr(Wd.call(f)):kr(f),o):n},o.smooth=function(f){return arguments.length?(r=f?c:y5,o):r===c},o}function nO(t){return isFinite(t)?t:NaN}function Cs(t,e){return t==null?!1:+t>=e}function Vx(t){return t==null||isNaN(t=+t)?-1/0:t}function x5(t,e,n,r){let o=r-e,i=n-e,s=isFinite(o)||isFinite(i)?o/i:Math.sign(o)/Math.sign(i);return isNaN(s)?t:t+s-.5}function rO(t){return t[0]}function oO(t){return t[1]}function iO(){return 1}function Wx(){var t=rO,e=oO,n=iO,r=960,o=500,i=20,s=2,a=i*3,c=r+a*2>>s,f=o+a*2>>s,l=kr(20);function u(x){var w=new Float32Array(c*f),b=Math.pow(2,-s),_=-1;for(let O of x){var v=(t(O,++_,x)+a)*b,A=(e(O,_,x)+a)*b,T=+n(O,_,x);if(T&&v>=0&&v<c&&A>=0&&A<f){var E=Math.floor(v),$=Math.floor(A),S=v-E-.5,k=A-$-.5;w[E+$*c]+=(1-S)*(1-k)*T,w[E+1+$*c]+=S*(1-k)*T,w[E+1+($+1)*c]+=S*k*T,w[E+($+1)*c]+=(1-S)*k*T}}return Gf({data:w,width:c,height:f},i*b),w}function p(x){var w=u(x),b=l(w),_=Math.pow(2,2*s);return Array.isArray(b)||(b=Fe(Number.MIN_VALUE,Tt(w)/_,b)),vi().size([c,f]).thresholds(b.map(v=>v*_))(w).map((v,A)=>(v.value=+b[A],h(v)))}p.contours=function(x){var w=u(x),b=vi().size([c,f]),_=Math.pow(2,2*s),v=A=>{A=+A;var T=h(b.contour(w,A*_));return T.value=A,T};return Object.defineProperty(v,"max",{get:()=>Tt(w)/_}),v};function h(x){return x.coordinates.forEach(d),x}function d(x){x.forEach(m)}function m(x){x.forEach(g)}function g(x){x[0]=x[0]*Math.pow(2,s)-a,x[1]=x[1]*Math.pow(2,s)-a}function y(){return a=i*3,c=r+a*2>>s,f=o+a*2>>s,p}return p.x=function(x){return arguments.length?(t=typeof x=="function"?x:kr(+x),p):t},p.y=function(x){return arguments.length?(e=typeof x=="function"?x:kr(+x),p):e},p.weight=function(x){return arguments.length?(n=typeof x=="function"?x:kr(+x),p):n},p.size=function(x){if(!arguments.length)return[r,o];var w=+x[0],b=+x[1];if(!(w>=0&&b>=0))throw new Error("invalid size");return r=w,o=b,y()},p.cellSize=function(x){if(!arguments.length)return 1<<s;if(!((x=+x)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(x)/Math.LN2),y()},p.thresholds=function(x){return arguments.length?(l=typeof x=="function"?x:Array.isArray(x)?kr(Wd.call(x)):kr(x),p):l},p.bandwidth=function(x){if(!arguments.length)return Math.sqrt(i*(i+1));if(!((x=+x)>=0))throw new Error("invalid bandwidth");return i=(Math.sqrt(4*x*x+1)-1)/2,y()},p}var $t=11102230246251565e-32,fe=134217729,xl=(3+8*$t)*$t;function ks(t,e,n,r,o){let i,s,a,c,f=e[0],l=r[0],u=0,p=0;l>f==l>-f?(i=f,f=e[++u]):(i=l,l=r[++p]);let h=0;if(u<t&&p<n)for(l>f==l>-f?(s=f+i,a=i-(s-f),f=e[++u]):(s=l+i,a=i-(s-l),l=r[++p]),i=s,a!==0&&(o[h++]=a);u<t&&p<n;)l>f==l>-f?(s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++u]):(s=i+l,c=s-i,a=i-(s-c)+(l-c),l=r[++p]),i=s,a!==0&&(o[h++]=a);for(;u<t;)s=i+f,c=s-i,a=i-(s-c)+(f-c),f=e[++u],i=s,a!==0&&(o[h++]=a);for(;p<n;)s=i+l,c=s-i,a=i-(s-c)+(l-c),l=r[++p],i=s,a!==0&&(o[h++]=a);return(i!==0||h===0)&&(o[h++]=i),h}function bl(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function U(t){return new Float64Array(t)}var sO=(3+16*$t)*$t,aO=(2+12*$t)*$t,cO=(9+64*$t)*$t*$t,Wa=U(4),b5=U(8),w5=U(12),v5=U(16),ln=U(4);function fO(t,e,n,r,o,i,s){let a,c,f,l,u,p,h,d,m,g,y,x,w,b,_,v,A,T,E=t-o,$=n-o,S=e-i,k=r-i;b=E*k,p=fe*E,h=p-(p-E),d=E-h,p=fe*k,m=p-(p-k),g=k-m,_=d*g-(b-h*m-d*m-h*g),v=S*$,p=fe*S,h=p-(p-S),d=S-h,p=fe*$,m=p-(p-$),g=$-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,u=_-y,Wa[0]=_-(y+u)+(u-A),x=b+y,u=x-b,w=b-(x-u)+(y-u),y=w-v,u=w-y,Wa[1]=w-(y+u)+(u-v),T=x+y,u=T-x,Wa[2]=x-(T-u)+(y-u),Wa[3]=T;let O=bl(4,Wa),M=aO*s;if(O>=M||-O>=M||(u=t-E,a=t-(E+u)+(u-o),u=n-$,f=n-($+u)+(u-o),u=e-S,c=e-(S+u)+(u-i),u=r-k,l=r-(k+u)+(u-i),a===0&&c===0&&f===0&&l===0)||(M=cO*s+xl*Math.abs(O),O+=E*l+k*a-(S*f+$*c),O>=M||-O>=M))return O;b=a*k,p=fe*a,h=p-(p-a),d=a-h,p=fe*k,m=p-(p-k),g=k-m,_=d*g-(b-h*m-d*m-h*g),v=c*$,p=fe*c,h=p-(p-c),d=c-h,p=fe*$,m=p-(p-$),g=$-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,u=_-y,ln[0]=_-(y+u)+(u-A),x=b+y,u=x-b,w=b-(x-u)+(y-u),y=w-v,u=w-y,ln[1]=w-(y+u)+(u-v),T=x+y,u=T-x,ln[2]=x-(T-u)+(y-u),ln[3]=T;let I=ks(4,Wa,4,ln,b5);b=E*l,p=fe*E,h=p-(p-E),d=E-h,p=fe*l,m=p-(p-l),g=l-m,_=d*g-(b-h*m-d*m-h*g),v=S*f,p=fe*S,h=p-(p-S),d=S-h,p=fe*f,m=p-(p-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,u=_-y,ln[0]=_-(y+u)+(u-A),x=b+y,u=x-b,w=b-(x-u)+(y-u),y=w-v,u=w-y,ln[1]=w-(y+u)+(u-v),T=x+y,u=T-x,ln[2]=x-(T-u)+(y-u),ln[3]=T;let C=ks(I,b5,4,ln,w5);b=a*l,p=fe*a,h=p-(p-a),d=a-h,p=fe*l,m=p-(p-l),g=l-m,_=d*g-(b-h*m-d*m-h*g),v=c*f,p=fe*c,h=p-(p-c),d=c-h,p=fe*f,m=p-(p-f),g=f-m,A=d*g-(v-h*m-d*m-h*g),y=_-A,u=_-y,ln[0]=_-(y+u)+(u-A),x=b+y,u=x-b,w=b-(x-u)+(y-u),y=w-v,u=w-y,ln[1]=w-(y+u)+(u-v),T=x+y,u=T-x,ln[2]=x-(T-u)+(y-u),ln[3]=T;let N=ks(C,w5,4,ln,v5);return v5[N-1]}function Ha(t,e,n,r,o,i){let s=(e-i)*(n-o),a=(t-o)*(r-i),c=s-a,f=Math.abs(s+a);return Math.abs(c)>=sO*f?c:-fO(t,e,n,r,o,i,f)}var Oit=(7+56*$t)*$t,Rit=(3+28*$t)*$t,Lit=(26+288*$t)*$t*$t,Dit=U(4),Fit=U(4),Pit=U(4),qit=U(4),Bit=U(4),zit=U(4),Yit=U(4),Uit=U(4),jit=U(4),Xit=U(8),Git=U(8),Vit=U(8),Wit=U(4),Hit=U(8),Qit=U(8),Zit=U(8),Kit=U(12),Jit=U(192),tst=U(192);var rst=(10+96*$t)*$t,ost=(4+48*$t)*$t,ist=(44+576*$t)*$t*$t,sst=U(4),ast=U(4),cst=U(4),fst=U(4),lst=U(4),ust=U(4),pst=U(4),hst=U(4),dst=U(8),mst=U(8),gst=U(8),yst=U(8),xst=U(8),bst=U(8),wst=U(8),vst=U(8),_st=U(8),Mst=U(4),Sst=U(4),Ast=U(4),Est=U(8),Tst=U(16),Ist=U(16),$st=U(16),Cst=U(32),kst=U(32),Nst=U(48),Ost=U(64),Rst=U(1152),Lst=U(1152);var qst=(16+224*$t)*$t,Bst=(5+72*$t)*$t,zst=(71+1408*$t)*$t*$t,Yst=U(4),Ust=U(4),jst=U(4),Xst=U(4),Gst=U(4),Vst=U(4),Wst=U(4),Hst=U(4),Qst=U(4),Zst=U(4),Kst=U(24),Jst=U(24),tat=U(24),eat=U(24),nat=U(24),rat=U(24),oat=U(24),iat=U(24),sat=U(24),aat=U(24),cat=U(1152),fat=U(1152),lat=U(1152),uat=U(1152),pat=U(1152),hat=U(2304),dat=U(2304),mat=U(3456),gat=U(5760),yat=U(8),xat=U(8),bat=U(8),wat=U(16),vat=U(24),_at=U(48),Mat=U(48),Sat=U(96),Aat=U(192),Eat=U(384),Tat=U(384),Iat=U(384),$at=U(768);var Cat=U(96),kat=U(96),Nat=U(96),Oat=U(1152);var M5=Math.pow(2,-52),Hd=new Uint32Array(512),Za=class t{static from(e,n=mO,r=gO){let o=e.length,i=new Float64Array(o*2);for(let s=0;s<o;s++){let a=e[s];i[2*s]=n(a),i[2*s+1]=r(a)}return new t(i)}constructor(e){let n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;let r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){let{coords:e,_hullPrev:n,_hullNext:r,_hullTri:o,_hullHash:i}=this,s=e.length>>1,a=1/0,c=1/0,f=-1/0,l=-1/0;for(let E=0;E<s;E++){let $=e[2*E],S=e[2*E+1];$<a&&(a=$),S<c&&(c=S),$>f&&(f=$),S>l&&(l=S),this._ids[E]=E}let u=(a+f)/2,p=(c+l)/2,h,d,m;for(let E=0,$=1/0;E<s;E++){let S=Hx(u,p,e[2*E],e[2*E+1]);S<$&&(h=E,$=S)}let g=e[2*h],y=e[2*h+1];for(let E=0,$=1/0;E<s;E++){if(E===h)continue;let S=Hx(g,y,e[2*E],e[2*E+1]);S<$&&S>0&&(d=E,$=S)}let x=e[2*d],w=e[2*d+1],b=1/0;for(let E=0;E<s;E++){if(E===h||E===d)continue;let $=hO(g,y,x,w,e[2*E],e[2*E+1]);$<b&&(m=E,b=$)}let _=e[2*m],v=e[2*m+1];if(b===1/0){for(let S=0;S<s;S++)this._dists[S]=e[2*S]-e[0]||e[2*S+1]-e[1];Qa(this._ids,this._dists,0,s-1);let E=new Uint32Array(s),$=0;for(let S=0,k=-1/0;S<s;S++){let O=this._ids[S],M=this._dists[O];M>k&&(E[$++]=O,k=M)}this.hull=E.subarray(0,$),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Ha(g,y,x,w,_,v)<0){let E=d,$=x,S=w;d=m,x=_,w=v,m=E,_=$,v=S}let A=dO(g,y,x,w,_,v);this._cx=A.x,this._cy=A.y;for(let E=0;E<s;E++)this._dists[E]=Hx(e[2*E],e[2*E+1],A.x,A.y);Qa(this._ids,this._dists,0,s-1),this._hullStart=h;let T=3;r[h]=n[m]=d,r[d]=n[h]=m,r[m]=n[d]=h,o[h]=0,o[d]=1,o[m]=2,i.fill(-1),i[this._hashKey(g,y)]=h,i[this._hashKey(x,w)]=d,i[this._hashKey(_,v)]=m,this.trianglesLen=0,this._addTriangle(h,d,m,-1,-1,-1);for(let E=0,$,S;E<this._ids.length;E++){let k=this._ids[E],O=e[2*k],M=e[2*k+1];if(E>0&&Math.abs(O-$)<=M5&&Math.abs(M-S)<=M5||($=O,S=M,k===h||k===d||k===m))continue;let I=0;for(let D=0,F=this._hashKey(O,M);D<this._hashSize&&(I=i[(F+D)%this._hashSize],!(I!==-1&&I!==r[I]));D++);I=n[I];let C=I,N;for(;N=r[C],Ha(O,M,e[2*C],e[2*C+1],e[2*N],e[2*N+1])>=0;)if(C=N,C===I){C=-1;break}if(C===-1)continue;let L=this._addTriangle(C,k,r[C],-1,-1,o[C]);o[k]=this._legalize(L+2),o[C]=L,T++;let R=r[C];for(;N=r[R],Ha(O,M,e[2*R],e[2*R+1],e[2*N],e[2*N+1])<0;)L=this._addTriangle(R,k,N,o[k],-1,o[R]),o[k]=this._legalize(L+2),r[R]=R,T--,R=N;if(C===I)for(;N=n[C],Ha(O,M,e[2*N],e[2*N+1],e[2*C],e[2*C+1])<0;)L=this._addTriangle(N,k,C,-1,o[C],o[N]),this._legalize(L+2),o[N]=L,r[C]=C,T--,C=N;this._hullStart=n[k]=C,r[C]=n[R]=k,r[k]=R,i[this._hashKey(O,M)]=k,i[this._hashKey(e[2*C],e[2*C+1])]=C}this.hull=new Uint32Array(T);for(let E=0,$=this._hullStart;E<T;E++)this.hull[E]=$,$=r[$];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(uO(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:n,_halfedges:r,coords:o}=this,i=0,s=0;for(;;){let a=r[e],c=e-e%3;if(s=c+(e+2)%3,a===-1){if(i===0)break;e=Hd[--i];continue}let f=a-a%3,l=c+(e+1)%3,u=f+(a+2)%3,p=n[s],h=n[e],d=n[l],m=n[u];if(pO(o[2*p],o[2*p+1],o[2*h],o[2*h+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){n[e]=m,n[a]=p;let y=r[u];if(y===-1){let w=this._hullStart;do{if(this._hullTri[w]===u){this._hullTri[w]=e;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(e,y),this._link(a,r[s]),this._link(s,u);let x=f+(a+1)%3;i<Hd.length&&(Hd[i++]=x)}else{if(i===0)break;e=Hd[--i]}}return s}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,o,i,s){let a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,o),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}};function uO(t,e){let n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Hx(t,e,n,r){let o=t-n,i=e-r;return o*o+i*i}function pO(t,e,n,r,o,i,s,a){let c=t-s,f=e-a,l=n-s,u=r-a,p=o-s,h=i-a,d=c*c+f*f,m=l*l+u*u,g=p*p+h*h;return c*(u*g-m*h)-f*(l*g-m*p)+d*(l*h-u*p)<0}function hO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,l=s*s+a*a,u=c*c+f*f,p=.5/(s*f-a*c),h=(f*l-a*u)*p,d=(s*u-c*l)*p;return h*h+d*d}function dO(t,e,n,r,o,i){let s=n-t,a=r-e,c=o-t,f=i-e,l=s*s+a*a,u=c*c+f*f,p=.5/(s*f-a*c),h=t+(f*l-a*u)*p,d=e+(s*u-c*l)*p;return{x:h,y:d}}function Qa(t,e,n,r){if(r-n<=20)for(let o=n+1;o<=r;o++){let i=t[o],s=e[i],a=o-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let o=n+r>>1,i=n+1,s=r;wl(t,o,i),e[t[n]]>e[t[r]]&&wl(t,n,r),e[t[i]]>e[t[r]]&&wl(t,i,r),e[t[n]]>e[t[i]]&&wl(t,n,i);let a=t[i],c=e[a];for(;;){do i++;while(e[t[i]]<c);do s--;while(e[t[s]]>c);if(s<i)break;wl(t,i,s)}t[n+1]=t[s],t[s]=a,r-i+1>=s-n?(Qa(t,e,i,r),Qa(t,e,n,s-1)):(Qa(t,e,n,s-1),Qa(t,e,i,r))}}function wl(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}function mO(t){return t[0]}function gO(t){return t[1]}var Vn=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;let o=e+r,i=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${o},${i}`:(Math.abs(this._x1-o)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+o+","+i),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=o},${this._y1=i}`)}rect(e,n,r,o){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+o}h${-r}Z`}value(){return this._||null}};var _i=class{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}};var vl=class{constructor(e,[n,r,o,i]=[0,0,960,500]){if(!((o=+o)>=(n=+n))||!((i=+i)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=o,this.xmin=n,this.ymax=i,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:n,triangles:r},vectors:o}=this,i,s,a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,x,w;m<y;m+=3,g+=2){let b=r[m]*2,_=r[m+1]*2,v=r[m+2]*2,A=e[b],T=e[b+1],E=e[_],$=e[_+1],S=e[v],k=e[v+1],O=E-A,M=$-T,I=S-A,C=k-T,N=(O*C-M*I)*2;if(Math.abs(N)<1e-9){if(i===void 0){i=s=0;for(let R of n)i+=e[R*2],s+=e[R*2+1];i/=n.length,s/=n.length}let L=1e9*Math.sign((i-A)*C-(s-T)*I);x=(A+S)/2-L*C,w=(T+k)/2+L*I}else{let L=1/N,R=O*O+M*M,D=I*I+C*C;x=A+(C*R-M*D)*L,w=T+(O*D-I*R)*L}a[g]=x,a[g+1]=w}let c=n[n.length-1],f,l=c*4,u,p=e[2*c],h,d=e[2*c+1];o.fill(0);for(let m=0;m<n.length;++m)c=n[m],f=l,u=p,h=d,l=c*4,p=e[2*c],d=e[2*c+1],o[f+2]=o[l]=h-d,o[f+3]=o[l+1]=p-u}render(e){let n=e==null?e=new Vn:void 0,{delaunay:{halfedges:r,inedges:o,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let l=0,u=r.length;l<u;++l){let p=r[l];if(p<l)continue;let h=Math.floor(l/3)*2,d=Math.floor(p/3)*2,m=s[h],g=s[h+1],y=s[d],x=s[d+1];this._renderSegment(m,g,y,x,e)}let c,f=i[i.length-1];for(let l=0;l<i.length;++l){c=f,f=i[l];let u=Math.floor(o[f]/3)*2,p=s[u],h=s[u+1],d=c*4,m=this._project(p,h,a[d+2],a[d+3]);m&&this._renderSegment(p,h,m[0],m[1],e)}return n&&n.value()}renderBounds(e){let n=e==null?e=new Vn:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){let r=n==null?n=new Vn:void 0,o=this._clip(e);if(o===null||!o.length)return;n.moveTo(o[0],o[1]);let i=o.length;for(;o[0]===o[i-2]&&o[1]===o[i-1]&&i>1;)i-=2;for(let s=2;s<i;s+=2)(o[s]!==o[s-2]||o[s+1]!==o[s-1])&&n.lineTo(o[s],o[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){let o=this.cellPolygon(n);o&&(o.index=n,yield o)}}cellPolygon(e){let n=new _i;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,o,i){let s,a=this._regioncode(e,n),c=this._regioncode(r,o);a===0&&c===0?(i.moveTo(e,n),i.lineTo(r,o)):(s=this._clipSegment(e,n,r,o,a,c))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){let n=this._clip(e);if(n)for(let r of this.delaunay.neighbors(e)){let o=this._clip(r);if(o){t:for(let i=0,s=n.length;i<s;i+=2)for(let a=0,c=o.length;a<c;a+=2)if(n[i]===o[a]&&n[i+1]===o[a+1]&&n[(i+2)%s]===o[(a+c-2)%c]&&n[(i+3)%s]===o[(a+c-1)%c]){yield r;break t}}}}_cell(e){let{circumcenters:n,delaunay:{inedges:r,halfedges:o,triangles:i}}=this,s=r[e];if(s===-1)return null;let a=[],c=s;do{let f=Math.floor(c/3);if(a.push(n[f*2],n[f*2+1]),c=c%3===2?c-2:c+1,i[c]!==e)break;c=o[c]}while(c!==s&&c!==-1);return a}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let n=this._cell(e);if(n===null)return null;let{vectors:r}=this,o=e*4;return this._simplify(r[o]||r[o+1]?this._clipInfinite(e,n,r[o],r[o+1],r[o+2],r[o+3]):this._clipFinite(e,n))}_clipFinite(e,n){let r=n.length,o=null,i,s,a=n[r-2],c=n[r-1],f,l=this._regioncode(a,c),u,p=0;for(let h=0;h<r;h+=2)if(i=a,s=c,a=n[h],c=n[h+1],f=l,l=this._regioncode(a,c),f===0&&l===0)u=p,p=0,o?o.push(a,c):o=[a,c];else{let d,m,g,y,x;if(f===0){if((d=this._clipSegment(i,s,a,c,f,l))===null)continue;[m,g,y,x]=d}else{if((d=this._clipSegment(a,c,i,s,l,f))===null)continue;[y,x,m,g]=d,u=p,p=this._edgecode(m,g),u&&p&&this._edge(e,u,p,o,o.length),o?o.push(m,g):o=[m,g]}u=p,p=this._edgecode(y,x),u&&p&&this._edge(e,u,p,o,o.length),o?o.push(y,x):o=[y,x]}if(o)u=p,p=this._edgecode(o[0],o[1]),u&&p&&this._edge(e,u,p,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,n,r,o,i,s){let a=i<s;for(a&&([e,n,r,o,i,s]=[r,o,e,n,s,i]);;){if(i===0&&s===0)return a?[r,o,e,n]:[e,n,r,o];if(i&s)return null;let c,f,l=i||s;l&8?(c=e+(r-e)*(this.ymax-n)/(o-n),f=this.ymax):l&4?(c=e+(r-e)*(this.ymin-n)/(o-n),f=this.ymin):l&2?(f=n+(o-n)*(this.xmax-e)/(r-e),c=this.xmax):(f=n+(o-n)*(this.xmin-e)/(r-e),c=this.xmin),i?(e=c,n=f,i=this._regioncode(e,n)):(r=c,o=f,s=this._regioncode(r,o))}}_clipInfinite(e,n,r,o,i,s){let a=Array.from(n),c;if((c=this._project(a[0],a[1],r,o))&&a.unshift(c[0],c[1]),(c=this._project(a[a.length-2],a[a.length-1],i,s))&&a.push(c[0],c[1]),a=this._clipFinite(e,a))for(let f=0,l=a.length,u,p=this._edgecode(a[l-2],a[l-1]);f<l;f+=2)u=p,p=this._edgecode(a[f],a[f+1]),u&&p&&(f=this._edge(e,u,p,a,f),l=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,n,r,o,i){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(o[i]!==s||o[i+1]!==a)&&this.contains(e,s,a)&&(o.splice(i,0,s,a),i+=2)}return i}_project(e,n,r,o){let i=1/0,s,a,c;if(o<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/o)<i&&(c=this.ymin,a=e+(i=s)*r)}else if(o>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/o)<i&&(c=this.ymax,a=e+(i=s)*r)}if(r>0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)<i&&(a=this.xmax,c=n+(i=s)*o)}else if(r<0){if(e<=this.xmin)return null;(s=(this.xmin-e)/r)<i&&(a=this.xmin,c=n+(i=s)*o)}return[a,c]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){let r=(n+2)%e.length,o=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[o]||e[n+1]===e[r+1]&&e[r+1]===e[o+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}};var yO=2*Math.PI,Ka=Math.pow;function xO(t){return t[0]}function bO(t){return t[1]}function wO(t){let{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){let o=2*e[r],i=2*e[r+1],s=2*e[r+2];if((n[s]-n[o])*(n[i+1]-n[o+1])-(n[i]-n[o])*(n[s+1]-n[o+1])>1e-10)return!1}return!0}function vO(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var Wn=class t{static from(e,n=xO,r=bO,o){return new t("length"in e?_O(e,n,r,o):Float64Array.from(MO(e,n,r,o)))}constructor(e){this._delaunator=new Za(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&wO(e)){this.collinear=Int32Array.from({length:n.length/2},(p,h)=>h).sort((p,h)=>n[2*p]-n[2*h]||n[2*p+1]-n[2*h+1]);let c=this.collinear[0],f=this.collinear[this.collinear.length-1],l=[n[2*c],n[2*c+1],n[2*f],n[2*f+1]],u=1e-8*Math.hypot(l[3]-l[1],l[2]-l[0]);for(let p=0,h=n.length/2;p<h;++p){let d=vO(n[2*p],n[2*p+1],u);n[2*p]=d[0],n[2*p+1]=d[1]}this._delaunator=new Za(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,o=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let c=0,f=r.length;c<f;++c){let l=i[c%3===2?c-2:c+1];(r[c]===-1||s[l]===-1)&&(s[l]=c)}for(let c=0,f=o.length;c<f;++c)a[o[c]]=c;o.length<=2&&o.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],s[o[0]]=1,o.length===2&&(s[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(e){return new vl(this,e)}*neighbors(e){let{inedges:n,hull:r,_hullIndex:o,halfedges:i,triangles:s,collinear:a}=this;if(a){let u=a.indexOf(e);u>0&&(yield a[u-1]),u<a.length-1&&(yield a[u+1]);return}let c=n[e];if(c===-1)return;let f=c,l=-1;do{if(yield l=s[f],f=f%3===2?f-2:f+1,s[f]!==e)return;if(f=i[f],f===-1){let u=r[(o[e]+1)%r.length];u!==l&&(yield u);return}}while(f!==c)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;let o=r,i;for(;(i=this._step(r,e,n))>=0&&i!==r&&i!==o;)r=i;return i}_step(e,n,r){let{inedges:o,hull:i,_hullIndex:s,halfedges:a,triangles:c,points:f}=this;if(o[e]===-1||!f.length)return(e+1)%(f.length>>1);let l=e,u=Ka(n-f[e*2],2)+Ka(r-f[e*2+1],2),p=o[e],h=p;do{let d=c[h],m=Ka(n-f[d*2],2)+Ka(r-f[d*2+1],2);if(m<u&&(u=m,l=d),h=h%3===2?h-2:h+1,c[h]!==e)break;if(h=a[h],h===-1){if(h=i[(s[e]+1)%i.length],h!==d&&Ka(n-f[h*2],2)+Ka(r-f[h*2+1],2)<u)return h;break}}while(h!==p);return l}render(e){let n=e==null?e=new Vn:void 0,{points:r,halfedges:o,triangles:i}=this;for(let s=0,a=o.length;s<a;++s){let c=o[s];if(c<s)continue;let f=i[s]*2,l=i[c]*2;e.moveTo(r[f],r[f+1]),e.lineTo(r[l],r[l+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;let r=e==null?e=new Vn:void 0,{points:o}=this;for(let i=0,s=o.length;i<s;i+=2){let a=o[i],c=o[i+1];e.moveTo(a+n,c),e.arc(a,c,n,0,yO)}return r&&r.value()}renderHull(e){let n=e==null?e=new Vn:void 0,{hull:r,points:o}=this,i=r[0]*2,s=r.length;e.moveTo(o[i],o[i+1]);for(let a=1;a<s;++a){let c=2*r[a];e.lineTo(o[c],o[c+1])}return e.closePath(),n&&n.value()}hullPolygon(){let e=new _i;return this.renderHull(e),e.value()}renderTriangle(e,n){let r=n==null?n=new Vn:void 0,{points:o,triangles:i}=this,s=i[e*=3]*2,a=i[e+1]*2,c=i[e+2]*2;return n.moveTo(o[s],o[s+1]),n.lineTo(o[a],o[a+1]),n.lineTo(o[c],o[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){let{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){let n=new _i;return this.renderTriangle(e,n),n.value()}};function _O(t,e,n,r){let o=t.length,i=new Float64Array(o*2);for(let s=0;s<o;++s){let a=t[s];i[s*2]=e.call(r,a,s,t),i[s*2+1]=n.call(r,a,s,t)}return i}function*MO(t,e,n,r){let o=0;for(let i of t)yield e.call(r,i,o,t),yield n.call(r,i,o,t),++o}function S5(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ns(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Nr(t){return t=Ns(Math.abs(t)),t?t[1]:NaN}function A5(t,e){return function(n,r){for(var o=n.length,i=[],s=0,a=t[0],c=0;o>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(n.substring(o-=a,o+a)),!((c+=a+1)>r));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function E5(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var SO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Or(t){if(!(e=SO.exec(t)))throw new Error("invalid format: "+t);var e;return new Qd({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Or.prototype=Qd.prototype;function Qd(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Qd.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function T5(t){t:for(var e=t.length,n=1,r=-1,o;n<e;++n)switch(t[n]){case".":r=o=n;break;case"0":r===0&&(r=n),o=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(o+1):t}var Qx;function I5(t,e){var n=Ns(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Qx=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Ns(t,Math.max(0,e+i-1))[0]}function Zx(t,e){var n=Ns(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}var Kx={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:S5,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Zx(t*100,e),r:Zx,s:I5,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Jx(t){return t}var $5=Array.prototype.map,C5=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function k5(t){var e=t.grouping===void 0||t.thousands===void 0?Jx:A5($5.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Jx:E5($5.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(u){u=Or(u);var p=u.fill,h=u.align,d=u.sign,m=u.symbol,g=u.zero,y=u.width,x=u.comma,w=u.precision,b=u.trim,_=u.type;_==="n"?(x=!0,_="g"):Kx[_]||(w===void 0&&(w=12),b=!0,_="g"),(g||p==="0"&&h==="=")&&(g=!0,p="0",h="=");var v=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?s:"",T=Kx[_],E=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function $(S){var k=v,O=A,M,I,C;if(_==="c")O=T(S)+O,S="";else{S=+S;var N=S<0||1/S<0;if(S=isNaN(S)?c:T(Math.abs(S),w),b&&(S=T5(S)),N&&+S==0&&d!=="+"&&(N=!1),k=(N?d==="("?d:a:d==="-"||d==="("?"":d)+k,O=(_==="s"?C5[8+Qx/3]:"")+O+(N&&d==="("?")":""),E){for(M=-1,I=S.length;++M<I;)if(C=S.charCodeAt(M),48>C||C>57){O=(C===46?o+S.slice(M+1):S.slice(M))+O,S=S.slice(0,M);break}}}x&&!g&&(S=e(S,1/0));var L=k.length+S.length+O.length,R=L<y?new Array(y-L+1).join(p):"";switch(x&&g&&(S=e(R+S,R.length?y-O.length:1/0),R=""),h){case"<":S=k+S+O+R;break;case"=":S=k+R+S+O;break;case"^":S=R.slice(0,L=R.length>>1)+k+S+O+R.slice(L);break;default:S=R+k+S+O;break}return i(S)}return $.toString=function(){return u+""},$}function l(u,p){var h=f((u=Or(u),u.type="f",u)),d=Math.max(-8,Math.min(8,Math.floor(Nr(p)/3)))*3,m=Math.pow(10,-d),g=C5[8+d/3];return function(y){return h(m*y)+g}}return{format:f,formatPrefix:l}}var Zd,Hn,Kd;tb({thousands:",",grouping:[3],currency:["$",""]});function tb(t){return Zd=k5(t),Hn=Zd.format,Kd=Zd.formatPrefix,Zd}function eb(t){return Math.max(0,-Nr(Math.abs(t)))}function nb(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nr(e)/3)))*3-Nr(Math.abs(t)))}function rb(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Nr(e)-Nr(t))+1}var K=1e-6,Os=1e-12,dt=Math.PI,Bt=dt/2,ob=dt/4,Me=dt*2,re=180/dt,wt=dt/180,xt=Math.abs,Qn=Math.atan,le=Math.atan2,Q=Math.cos,_l=Math.ceil,Jd=Math.exp;var tm=Math.hypot,Rs=Math.log,em=Math.pow,H=Math.sin,He=Math.sign||function(t){return t>0?1:t<0?-1:0},zt=Math.sqrt,Ja=Math.tan;function nm(t){return t>1?0:t<-1?dt:Math.acos(t)}function Vt(t){return t>1?Bt:t<-1?-Bt:Math.asin(t)}function ue(){}function rm(t,e){t&&O5.hasOwnProperty(t.type)&&O5[t.type](t,e)}var N5={Feature:function(t,e){rm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)rm(n[r].geometry,e)}},O5={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ib(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)ib(n[r],e,0)},Polygon:function(t,e){R5(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)R5(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)rm(n[r],e)}};function ib(t,e,n){var r=-1,o=t.length-n,i;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function R5(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ib(t[n],e,1);e.polygonEnd()}function $n(t,e){t&&N5.hasOwnProperty(t.type)?N5[t.type](t,e):rm(t,e)}function Ml(t){return[le(t[1],t[0]),Vt(t[2])]}function Rr(t){var e=t[0],n=t[1],r=Q(n);return[r*Q(e),r*H(e),H(n)]}function Sl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function om(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Al(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function El(t){var e=zt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Tl,im,sm,am,cm,fm,lm,um,sb,ab,cb,F5,P5,un,pn,hn,hr={sphere:ue,point:fb,lineStart:L5,lineEnd:D5,polygonStart:function(){hr.lineStart=TO,hr.lineEnd=IO},polygonEnd:function(){hr.lineStart=L5,hr.lineEnd=D5}};function fb(t,e){t*=wt,e*=wt;var n=Q(e);Il(n*Q(t),n*H(t),H(e))}function Il(t,e,n){++Tl,sm+=(t-sm)/Tl,am+=(e-am)/Tl,cm+=(n-cm)/Tl}function L5(){hr.point=AO}function AO(t,e){t*=wt,e*=wt;var n=Q(e);un=n*Q(t),pn=n*H(t),hn=H(e),hr.point=EO,Il(un,pn,hn)}function EO(t,e){t*=wt,e*=wt;var n=Q(e),r=n*Q(t),o=n*H(t),i=H(e),s=le(zt((s=pn*i-hn*o)*s+(s=hn*r-un*i)*s+(s=un*o-pn*r)*s),un*r+pn*o+hn*i);im+=s,fm+=s*(un+(un=r)),lm+=s*(pn+(pn=o)),um+=s*(hn+(hn=i)),Il(un,pn,hn)}function D5(){hr.point=fb}function TO(){hr.point=$O}function IO(){q5(F5,P5),hr.point=fb}function $O(t,e){F5=t,P5=e,t*=wt,e*=wt,hr.point=q5;var n=Q(e);un=n*Q(t),pn=n*H(t),hn=H(e),Il(un,pn,hn)}function q5(t,e){t*=wt,e*=wt;var n=Q(e),r=n*Q(t),o=n*H(t),i=H(e),s=pn*i-hn*o,a=hn*r-un*i,c=un*o-pn*r,f=tm(s,a,c),l=Vt(f),u=f&&-l/f;sb.add(u*s),ab.add(u*a),cb.add(u*c),im+=l,fm+=l*(un+(un=r)),lm+=l*(pn+(pn=o)),um+=l*(hn+(hn=i)),Il(un,pn,hn)}function lb(t){Tl=im=sm=am=cm=fm=lm=um=0,sb=new Le,ab=new Le,cb=new Le,$n(t,hr);var e=+sb,n=+ab,r=+cb,o=tm(e,n,r);return o<Os&&(e=fm,n=lm,r=um,im<K&&(e=sm,n=am,r=cm),o=tm(e,n,r),o<Os)?[NaN,NaN]:[le(n,e)*re,Vt(r/o)*re]}function $l(t,e){function n(r,o){return r=t(r,o),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,o){return r=e.invert(r,o),r&&t.invert(r[0],r[1])}),n}function ub(t,e){return xt(t)>dt&&(t-=Math.round(t/Me)*Me),[t,e]}ub.invert=ub;function pb(t,e,n){return(t%=Me)?e||n?$l(z5(t),Y5(e,n)):z5(t):e||n?Y5(e,n):ub}function B5(t){return function(e,n){return e+=t,xt(e)>dt&&(e-=Math.round(e/Me)*Me),[e,n]}}function z5(t){var e=B5(t);return e.invert=B5(-t),e}function Y5(t,e){var n=Q(t),r=H(t),o=Q(e),i=H(e);function s(a,c){var f=Q(c),l=Q(a)*f,u=H(a)*f,p=H(c),h=p*n+l*r;return[le(u*o-h*i,l*n-p*r),Vt(h*o+u*i)]}return s.invert=function(a,c){var f=Q(c),l=Q(a)*f,u=H(a)*f,p=H(c),h=p*o-u*i;return[le(u*o+p*i,l*n+h*r),Vt(h*n-l*r)]},s}function U5(t){t=pb(t[0]*wt,t[1]*wt,t.length>2?t[2]*wt:0);function e(n){return n=t(n[0]*wt,n[1]*wt),n[0]*=re,n[1]*=re,n}return e.invert=function(n){return n=t.invert(n[0]*wt,n[1]*wt),n[0]*=re,n[1]*=re,n},e}function X5(t,e,n,r,o,i){if(n){var s=Q(e),a=H(e),c=r*n;o==null?(o=e+r*Me,i=e-c/2):(o=j5(s,o),i=j5(s,i),(r>0?o<i:o>i)&&(o+=r*Me));for(var f,l=o;r>0?l>i:l<i;l-=c)f=Ml([s,-a*Q(l),-a*H(l)]),t.point(f[0],f[1])}}function j5(t,e){e=Rr(e),e[0]-=t,El(e);var n=nm(-e[1]);return((-e[2]<0?-n:n)+Me-K)%Me}function pm(){var t=[],e;return{point:function(n,r,o){e.push([n,r,o])},lineStart:function(){t.push(e=[])},lineEnd:ue,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function ec(t,e){return xt(t[0]-e[0])<K&&xt(t[1]-e[1])<K}function hm(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function dm(t,e,n,r,o){var i=[],s=[],a,c;if(t.forEach(function(d){if(!((m=d.length-1)<=0)){var m,g=d[0],y=d[m],x;if(ec(g,y)){if(!g[2]&&!y[2]){for(o.lineStart(),a=0;a<m;++a)o.point((g=d[a])[0],g[1]);o.lineEnd();return}y[0]+=2*K}i.push(x=new hm(g,d,null,!0)),s.push(x.o=new hm(g,null,x,!1)),i.push(x=new hm(y,d,null,!1)),s.push(x.o=new hm(y,null,x,!0))}}),!!i.length){for(s.sort(e),G5(i),G5(s),a=0,c=s.length;a<c;++a)s[a].e=n=!n;for(var f=i[0],l,u;;){for(var p=f,h=!0;p.v;)if((p=p.n)===f)return;l=p.z,o.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,c=l.length;a<c;++a)o.point((u=l[a])[0],u[1]);else r(p.x,p.n.x,1,o);p=p.n}else{if(h)for(l=p.p.z,a=l.length-1;a>=0;--a)o.point((u=l[a])[0],u[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,l=p.z,h=!h}while(!p.v);o.lineEnd()}}}function G5(t){if(e=t.length){for(var e,n=0,r=t[0],o;++n<e;)r.n=o=t[n],o.p=r,r=o;r.n=o=t[0],o.p=r}}function hb(t){return xt(t[0])<=dt?t[0]:He(t[0])*((xt(t[0])+dt)%Me-dt)}function V5(t,e){var n=hb(e),r=e[1],o=H(r),i=[H(n),-Q(n),0],s=0,a=0,c=new Le;o===1?r=Bt+K:o===-1&&(r=-Bt-K);for(var f=0,l=t.length;f<l;++f)if(p=(u=t[f]).length)for(var u,p,h=u[p-1],d=hb(h),m=h[1]/2+ob,g=H(m),y=Q(m),x=0;x<p;++x,d=b,g=v,y=A,h=w){var w=u[x],b=hb(w),_=w[1]/2+ob,v=H(_),A=Q(_),T=b-d,E=T>=0?1:-1,$=E*T,S=$>dt,k=g*v;if(c.add(le(k*E*H($),y*A+k*Q($))),s+=S?T+E*Me:T,S^d>=n^b>=n){var O=tc(Rr(h),Rr(w));El(O);var M=tc(i,O);El(M);var I=(S^T>=0?-1:1)*Vt(M[2]);(r>I||r===I&&(O[0]||O[1]))&&(a+=S^T>=0?1:-1)}}return(s<-K||s<K&&c<-Os)^a&1}function mm(t,e,n,r){return function(o){var i=e(o),s=pm(),a=e(s),c=!1,f,l,u,p={point:h,lineStart:m,lineEnd:g,polygonStart:function(){p.point=y,p.lineStart=x,p.lineEnd=w,l=[],f=[]},polygonEnd:function(){p.point=h,p.lineStart=m,p.lineEnd=g,l=Da(l);var b=V5(f,r);l.length?(c||(o.polygonStart(),c=!0),dm(l,kO,b,n,o)):b&&(c||(o.polygonStart(),c=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),l=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function h(b,_){t(b,_)&&o.point(b,_)}function d(b,_){i.point(b,_)}function m(){p.point=d,i.lineStart()}function g(){p.point=h,i.lineEnd()}function y(b,_){u.push([b,_]),a.point(b,_)}function x(){a.lineStart(),u=[]}function w(){y(u[0][0],u[0][1]),a.lineEnd();var b=a.clean(),_=s.result(),v,A=_.length,T,E,$;if(u.pop(),f.push(u),u=null,!!A){if(b&1){if(E=_[0],(T=E.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),v=0;v<T;++v)o.point(($=E[v])[0],$[1]);o.lineEnd()}return}A>1&&b&2&&_.push(_.pop().concat(_.shift())),l.push(_.filter(CO))}}return p}}function CO(t){return t.length>1}function kO(t,e){return((t=t.x)[0]<0?t[1]-Bt-K:Bt-t[1])-((e=e.x)[0]<0?e[1]-Bt-K:Bt-e[1])}var db=mm(function(){return!0},NO,RO,[-dt,-Bt]);function NO(t){var e=NaN,n=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(i,s){var a=i>0?dt:-dt,c=xt(i-e);xt(c-dt)<K?(t.point(e,n=(n+s)/2>0?Bt:-Bt),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(i,n),o=0):r!==a&&c>=dt&&(xt(e-r)<K&&(e-=r*K),xt(i-a)<K&&(i-=a*K),n=OO(e,n,i,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),o=0),t.point(e=i,n=s),r=a},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-o}}}function OO(t,e,n,r){var o,i,s=H(t-n);return xt(s)>K?Qn((H(e)*(i=Q(r))*H(n)-H(r)*(o=Q(e))*H(t))/(o*i*s)):(e+r)/2}function RO(t,e,n,r){var o;if(t==null)o=n*Bt,r.point(-dt,o),r.point(0,o),r.point(dt,o),r.point(dt,0),r.point(dt,-o),r.point(0,-o),r.point(-dt,-o),r.point(-dt,0),r.point(-dt,o);else if(xt(t[0]-e[0])>K){var i=t[0]<e[0]?dt:-dt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function W5(t){var e=Q(t),n=6*wt,r=e>0,o=xt(e)>K;function i(l,u,p,h){X5(h,t,n,p,l,u)}function s(l,u){return Q(l)*Q(u)>e}function a(l){var u,p,h,d,m;return{lineStart:function(){d=h=!1,m=1},point:function(g,y){var x=[g,y],w,b=s(g,y),_=r?b?0:f(g,y):b?f(g+(g<0?dt:-dt),y):0;if(!u&&(d=h=b)&&l.lineStart(),b!==h&&(w=c(u,x),(!w||ec(u,w)||ec(x,w))&&(x[2]=1)),b!==h)m=0,b?(l.lineStart(),w=c(x,u),l.point(w[0],w[1])):(w=c(u,x),l.point(w[0],w[1],2),l.lineEnd()),u=w;else if(o&&u&&r^b){var v;!(_&p)&&(v=c(x,u,!0))&&(m=0,r?(l.lineStart(),l.point(v[0][0],v[0][1]),l.point(v[1][0],v[1][1]),l.lineEnd()):(l.point(v[1][0],v[1][1]),l.lineEnd(),l.lineStart(),l.point(v[0][0],v[0][1],3)))}b&&(!u||!ec(u,x))&&l.point(x[0],x[1]),u=x,h=b,p=_},lineEnd:function(){h&&l.lineEnd(),u=null},clean:function(){return m|(d&&h)<<1}}}function c(l,u,p){var h=Rr(l),d=Rr(u),m=[1,0,0],g=tc(h,d),y=Sl(g,g),x=g[0],w=y-x*x;if(!w)return!p&&l;var b=e*y/w,_=-e*x/w,v=tc(m,g),A=Al(m,b),T=Al(g,_);om(A,T);var E=v,$=Sl(A,E),S=Sl(E,E),k=$*$-S*(Sl(A,A)-1);if(!(k<0)){var O=zt(k),M=Al(E,(-$-O)/S);if(om(M,A),M=Ml(M),!p)return M;var I=l[0],C=u[0],N=l[1],L=u[1],R;C<I&&(R=I,I=C,C=R);var D=C-I,F=xt(D-dt)<K,P=F||D<K;if(!F&&L<N&&(R=N,N=L,L=R),P?F?N+L>0^M[1]<(xt(M[0]-I)<K?N:L):N<=M[1]&&M[1]<=L:D>dt^(I<=M[0]&&M[0]<=C)){var V=Al(E,(-$+O)/S);return om(V,A),[M,Ml(V)]}}}function f(l,u){var p=r?t:dt-t,h=0;return l<-p?h|=1:l>p&&(h|=2),u<-p?h|=4:u>p&&(h|=8),h}return mm(s,a,i,r?[0,-t]:[-dt,t-dt])}function H5(t,e,n,r,o,i){var s=t[0],a=t[1],c=e[0],f=e[1],l=0,u=1,p=c-s,h=f-a,d;if(d=n-s,!(!p&&d>0)){if(d/=p,p<0){if(d<l)return;d<u&&(u=d)}else if(p>0){if(d>u)return;d>l&&(l=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>u)return;d>l&&(l=d)}else if(p>0){if(d<l)return;d<u&&(u=d)}if(d=r-a,!(!h&&d>0)){if(d/=h,h<0){if(d<l)return;d<u&&(u=d)}else if(h>0){if(d>u)return;d>l&&(l=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>u)return;d>l&&(l=d)}else if(h>0){if(d<l)return;d<u&&(u=d)}return l>0&&(t[0]=s+l*p,t[1]=a+l*h),u<1&&(e[0]=s+u*p,e[1]=a+u*h),!0}}}}}var Cl=1e9,gm=-Cl;function nc(t,e,n,r){function o(f,l){return t<=f&&f<=n&&e<=l&&l<=r}function i(f,l,u,p){var h=0,d=0;if(f==null||(h=s(f,u))!==(d=s(l,u))||c(f,l)<0^u>0)do p.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+u+4)%4)!==d);else p.point(l[0],l[1])}function s(f,l){return xt(f[0]-t)<K?l>0?0:3:xt(f[0]-n)<K?l>0?2:1:xt(f[1]-e)<K?l>0?1:0:l>0?3:2}function a(f,l){return c(f.x,l.x)}function c(f,l){var u=s(f,1),p=s(l,1);return u!==p?u-p:u===0?l[1]-f[1]:u===1?f[0]-l[0]:u===2?f[1]-l[1]:l[0]-f[0]}return function(f){var l=f,u=pm(),p,h,d,m,g,y,x,w,b,_,v,A={point:T,lineStart:k,lineEnd:O,polygonStart:$,polygonEnd:S};function T(I,C){o(I,C)&&l.point(I,C)}function E(){for(var I=0,C=0,N=h.length;C<N;++C)for(var L=h[C],R=1,D=L.length,F=L[0],P,V,J=F[0],et=F[1];R<D;++R)P=J,V=et,F=L[R],J=F[0],et=F[1],V<=r?et>r&&(J-P)*(r-V)>(et-V)*(t-P)&&++I:et<=r&&(J-P)*(r-V)<(et-V)*(t-P)&&--I;return I}function $(){l=u,p=[],h=[],v=!0}function S(){var I=E(),C=v&&I,N=(p=Da(p)).length;(C||N)&&(f.polygonStart(),C&&(f.lineStart(),i(null,null,1,f),f.lineEnd()),N&&dm(p,a,I,i,f),f.polygonEnd()),l=f,p=h=d=null}function k(){A.point=M,h&&h.push(d=[]),_=!0,b=!1,x=w=NaN}function O(){p&&(M(m,g),y&&b&&u.rejoin(),p.push(u.result())),A.point=T,b&&l.lineEnd()}function M(I,C){var N=o(I,C);if(h&&d.push([I,C]),_)m=I,g=C,y=N,_=!1,N&&(l.lineStart(),l.point(I,C));else if(N&&b)l.point(I,C);else{var L=[x=Math.max(gm,Math.min(Cl,x)),w=Math.max(gm,Math.min(Cl,w))],R=[I=Math.max(gm,Math.min(Cl,I)),C=Math.max(gm,Math.min(Cl,C))];H5(L,R,t,e,n,r)?(b||(l.lineStart(),l.point(L[0],L[1])),l.point(R[0],R[1]),N||l.lineEnd(),v=!1):N&&(l.lineStart(),l.point(I,C),v=!1)}x=I,w=C,b=N}return A}}function Q5(t,e,n){var r=ie(t,e-K,n).concat(e);return function(o){return r.map(function(i){return[o,i]})}}function Z5(t,e,n){var r=ie(t,e-K,n).concat(e);return function(o){return r.map(function(i){return[i,o]})}}function mb(){var t,e,n,r,o,i,s,a,c=10,f=c,l=90,u=360,p,h,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:x()}}function x(){return ie(_l(r/l)*l,n,l).map(d).concat(ie(_l(a/u)*u,s,u).map(m)).concat(ie(_l(e/c)*c,t,c).filter(function(w){return xt(w%l)>K}).map(p)).concat(ie(_l(i/f)*f,o,f).filter(function(w){return xt(w%u)>K}).map(h))}return y.lines=function(){return x().map(function(w){return{type:"LineString",coordinates:w}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(m(s).slice(1),d(n).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(w){return arguments.length?y.extentMajor(w).extentMinor(w):y.extentMinor()},y.extentMajor=function(w){return arguments.length?(r=+w[0][0],n=+w[1][0],a=+w[0][1],s=+w[1][1],r>n&&(w=r,r=n,n=w),a>s&&(w=a,a=s,s=w),y.precision(g)):[[r,a],[n,s]]},y.extentMinor=function(w){return arguments.length?(e=+w[0][0],t=+w[1][0],i=+w[0][1],o=+w[1][1],e>t&&(w=e,e=t,t=w),i>o&&(w=i,i=o,o=w),y.precision(g)):[[e,i],[t,o]]},y.step=function(w){return arguments.length?y.stepMajor(w).stepMinor(w):y.stepMinor()},y.stepMajor=function(w){return arguments.length?(l=+w[0],u=+w[1],y):[l,u]},y.stepMinor=function(w){return arguments.length?(c=+w[0],f=+w[1],y):[c,f]},y.precision=function(w){return arguments.length?(g=+w,p=Q5(i,o,90),h=Z5(e,t,g),d=Q5(a,s,90),m=Z5(r,n,g),y):g},y.extentMajor([[-180,-90+K],[180,90-K]]).extentMinor([[-180,-80-K],[180,80+K]])}function gb(){return mb()()}var kl=t=>t;var yb=new Le,xb=new Le,K5,J5,bb,wb,Mi={point:ue,lineStart:ue,lineEnd:ue,polygonStart:function(){Mi.lineStart=LO,Mi.lineEnd=FO},polygonEnd:function(){Mi.lineStart=Mi.lineEnd=Mi.point=ue,yb.add(xt(xb)),xb=new Le},result:function(){var t=yb/2;return yb=new Le,t}};function LO(){Mi.point=DO}function DO(t,e){Mi.point=tM,K5=bb=t,J5=wb=e}function tM(t,e){xb.add(wb*t-bb*e),bb=t,wb=e}function FO(){tM(K5,J5)}var vb=Mi;var rc=1/0,ym=rc,Nl=-rc,xm=Nl,PO={point:qO,lineStart:ue,lineEnd:ue,polygonStart:ue,polygonEnd:ue,result:function(){var t=[[rc,ym],[Nl,xm]];return Nl=xm=-(ym=rc=1/0),t}};function qO(t,e){t<rc&&(rc=t),t>Nl&&(Nl=t),e<ym&&(ym=e),e>xm&&(xm=e)}var oc=PO;var _b=0,Mb=0,Ol=0,bm=0,wm=0,ic=0,Sb=0,Ab=0,Rl=0,rM,oM,Lr,Dr,dr={point:Ls,lineStart:eM,lineEnd:nM,polygonStart:function(){dr.lineStart=YO,dr.lineEnd=UO},polygonEnd:function(){dr.point=Ls,dr.lineStart=eM,dr.lineEnd=nM},result:function(){var t=Rl?[Sb/Rl,Ab/Rl]:ic?[bm/ic,wm/ic]:Ol?[_b/Ol,Mb/Ol]:[NaN,NaN];return _b=Mb=Ol=bm=wm=ic=Sb=Ab=Rl=0,t}};function Ls(t,e){_b+=t,Mb+=e,++Ol}function eM(){dr.point=BO}function BO(t,e){dr.point=zO,Ls(Lr=t,Dr=e)}function zO(t,e){var n=t-Lr,r=e-Dr,o=zt(n*n+r*r);bm+=o*(Lr+t)/2,wm+=o*(Dr+e)/2,ic+=o,Ls(Lr=t,Dr=e)}function nM(){dr.point=Ls}function YO(){dr.point=jO}function UO(){iM(rM,oM)}function jO(t,e){dr.point=iM,Ls(rM=Lr=t,oM=Dr=e)}function iM(t,e){var n=t-Lr,r=e-Dr,o=zt(n*n+r*r);bm+=o*(Lr+t)/2,wm+=o*(Dr+e)/2,ic+=o,o=Dr*t-Lr*e,Sb+=o*(Lr+t),Ab+=o*(Dr+e),Rl+=o*3,Ls(Lr=t,Dr=e)}var Eb=dr;function vm(t){this._context=t}vm.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Me);break}}},result:ue};var Ib=new Le,Tb,sM,aM,Ll,Dl,_m={point:ue,lineStart:function(){_m.point=XO},lineEnd:function(){Tb&&cM(sM,aM),_m.point=ue},polygonStart:function(){Tb=!0},polygonEnd:function(){Tb=null},result:function(){var t=+Ib;return Ib=new Le,t}};function XO(t,e){_m.point=cM,sM=Ll=t,aM=Dl=e}function cM(t,e){Ll-=t,Dl-=e,Ib.add(zt(Ll*Ll+Dl*Dl)),Ll=t,Dl=e}var $b=_m;var fM,Mm,lM,uM,sc=class{constructor(e){this._append=e==null?pM:GO(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==lM||this._append!==Mm){let r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,lM=r,Mm=this._append,uM=this._,this._=o}this._+=uM;break}}}result(){let e=this._;return this._="",e.length?e:null}};function pM(t){let e=1;this._+=t[0];for(let n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function GO(t){let e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return pM;if(e!==fM){let n=10**e;fM=e,Mm=function(o){let i=1;this._+=o[0];for(let s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return Mm}function Se(t,e){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),$n(a,o(i))),i.result()}return s.area=function(a){return $n(a,o(vb)),vb.result()},s.measure=function(a){return $n(a,o($b)),$b.result()},s.bounds=function(a){return $n(a,o(oc)),oc.result()},s.centroid=function(a){return $n(a,o(Eb)),Eb.result()},s.projection=function(a){return arguments.length?(o=a==null?(t=null,kl):(t=a).stream,s):t},s.context=function(a){return arguments.length?(i=a==null?(e=null,new sc(n)):new vm(e=a),typeof r!="function"&&i.pointRadius(r),s):e},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{let c=Math.floor(a);if(!(c>=0))throw new RangeError(`invalid digits: ${a}`);n=c}return e===null&&(i=new sc(n)),s},s.projection(t).digits(n).context(e)}function Ds(t){return{stream:ac(t)}}function ac(t){return function(e){var n=new Cb;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Cb(){}Cb.prototype={constructor:Cb,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function kb(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),$n(n,t.stream(oc)),e(oc.result()),r!=null&&t.clipExtent(r),t}function Fl(t,e,n){return kb(t,function(r){var o=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+e[0][0]+(o-s*(r[1][0]+r[0][0]))/2,c=+e[0][1]+(i-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,c])},n)}function Sm(t,e,n){return Fl(t,[[0,0],e],n)}function Am(t,e,n){return kb(t,function(r){var o=+e,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];t.scale(150*i).translate([s,a])},n)}function Em(t,e,n){return kb(t,function(r){var o=+e,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([s,a])},n)}var hM=16,VO=Q(30*wt);function Nb(t,e){return+e?HO(t,e):WO(t)}function WO(t){return ac({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function HO(t,e){function n(r,o,i,s,a,c,f,l,u,p,h,d,m,g){var y=f-r,x=l-o,w=y*y+x*x;if(w>4*e&&m--){var b=s+p,_=a+h,v=c+d,A=zt(b*b+_*_+v*v),T=Vt(v/=A),E=xt(xt(v)-1)<K||xt(i-u)<K?(i+u)/2:le(_,b),$=t(E,T),S=$[0],k=$[1],O=S-r,M=k-o,I=x*O-y*M;(I*I/w>e||xt((y*O+x*M)/w-.5)>.3||s*p+a*h+c*d<VO)&&(n(r,o,i,s,a,c,S,k,E,b/=A,_/=A,v,m,g),g.point(S,k),n(S,k,E,b,_,v,f,l,u,p,h,d,m,g))}}return function(r){var o,i,s,a,c,f,l,u,p,h,d,m,g={point:y,lineStart:x,lineEnd:b,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=x}};function y(T,E){T=t(T,E),r.point(T[0],T[1])}function x(){u=NaN,g.point=w,r.lineStart()}function w(T,E){var $=Rr([T,E]),S=t(T,E);n(u,p,l,h,d,m,u=S[0],p=S[1],l=T,h=$[0],d=$[1],m=$[2],hM,r),r.point(u,p)}function b(){g.point=y,r.lineEnd()}function _(){x(),g.point=v,g.lineEnd=A}function v(T,E){w(o=T,E),i=u,s=p,a=h,c=d,f=m,g.point=w}function A(){n(u,p,l,h,d,m,i,s,o,a,c,f,hM,r),g.lineEnd=b,b()}return g}}var QO=ac({point:function(t,e){this.stream.point(t*wt,e*wt)}});function ZO(t){return ac({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function KO(t,e,n,r,o){function i(s,a){return s*=r,a*=o,[e+t*s,n-t*a]}return i.invert=function(s,a){return[(s-e)/t*r,(n-a)/t*o]},i}function dM(t,e,n,r,o,i){if(!i)return KO(t,e,n,r,o);var s=Q(i),a=H(i),c=s*t,f=a*t,l=s/t,u=a/t,p=(a*n-s*e)/t,h=(a*e+s*n)/t;function d(m,g){return m*=r,g*=o,[c*m-f*g+e,n-f*m-c*g]}return d.invert=function(m,g){return[r*(l*m-u*g+p),o*(h-u*m-l*g)]},d}function Be(t){return Ob(function(){return t})()}function Ob(t){var e,n=150,r=480,o=250,i=0,s=0,a=0,c=0,f=0,l,u=0,p=1,h=1,d=null,m=db,g=null,y,x,w,b=kl,_=.5,v,A,T,E,$;function S(I){return T(I[0]*wt,I[1]*wt)}function k(I){return I=T.invert(I[0],I[1]),I&&[I[0]*re,I[1]*re]}S.stream=function(I){return E&&$===I?E:E=QO(ZO(l)(m(v(b($=I)))))},S.preclip=function(I){return arguments.length?(m=I,d=void 0,M()):m},S.postclip=function(I){return arguments.length?(b=I,g=y=x=w=null,M()):b},S.clipAngle=function(I){return arguments.length?(m=+I?W5(d=I*wt):(d=null,db),M()):d*re},S.clipExtent=function(I){return arguments.length?(b=I==null?(g=y=x=w=null,kl):nc(g=+I[0][0],y=+I[0][1],x=+I[1][0],w=+I[1][1]),M()):g==null?null:[[g,y],[x,w]]},S.scale=function(I){return arguments.length?(n=+I,O()):n},S.translate=function(I){return arguments.length?(r=+I[0],o=+I[1],O()):[r,o]},S.center=function(I){return arguments.length?(i=I[0]%360*wt,s=I[1]%360*wt,O()):[i*re,s*re]},S.rotate=function(I){return arguments.length?(a=I[0]%360*wt,c=I[1]%360*wt,f=I.length>2?I[2]%360*wt:0,O()):[a*re,c*re,f*re]},S.angle=function(I){return arguments.length?(u=I%360*wt,O()):u*re},S.reflectX=function(I){return arguments.length?(p=I?-1:1,O()):p<0},S.reflectY=function(I){return arguments.length?(h=I?-1:1,O()):h<0},S.precision=function(I){return arguments.length?(v=Nb(A,_=I*I),M()):zt(_)},S.fitExtent=function(I,C){return Fl(S,I,C)},S.fitSize=function(I,C){return Sm(S,I,C)},S.fitWidth=function(I,C){return Am(S,I,C)},S.fitHeight=function(I,C){return Em(S,I,C)};function O(){var I=dM(n,0,0,p,h,u).apply(null,e(i,s)),C=dM(n,r-I[0],o-I[1],p,h,u);return l=pb(a,c,f),A=$l(e,C),T=$l(l,A),v=Nb(A,_),M()}function M(){return E=$=null,S}return function(){return e=t.apply(this,arguments),S.invert=e.invert&&k,O()}}function cc(t){var e=0,n=dt/3,r=Ob(t),o=r(e,n);return o.parallels=function(i){return arguments.length?r(e=i[0]*wt,n=i[1]*wt):[e*re,n*re]},o}function mM(t){var e=Q(t);function n(r,o){return[r*e,H(o)/e]}return n.invert=function(r,o){return[r/e,Vt(o*e)]},n}function gM(t,e){var n=H(t),r=(n+H(e))/2;if(xt(r)<K)return mM(t);var o=1+n*(2*r-n),i=zt(o)/r;function s(a,c){var f=zt(o-2*r*H(c))/r;return[f*H(a*=r),i-f*Q(a)]}return s.invert=function(a,c){var f=i-c,l=le(a,xt(f))*He(f);return f*r<0&&(l-=dt*He(a)*He(f)),[l/r,Vt((o-(a*a+f*f)*r*r)/(2*r))]},s}function Si(){return cc(gM).scale(155.424).center([0,33.6442])}function Pl(){return Si().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function JO(t){var e=t.length;return{point:function(n,r){for(var o=-1;++o<e;)t[o].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Rb(){var t,e,n=Pl(),r,o=Si().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=Si().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,c,f={point:function(p,h){c=[p,h]}};function l(p){var h=p[0],d=p[1];return c=null,r.point(h,d),c||(i.point(h,d),c)||(a.point(h,d),c)}l.invert=function(p){var h=n.scale(),d=n.translate(),m=(p[0]-d[0])/h,g=(p[1]-d[1])/h;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?o:g>=.166&&g<.234&&m>=-.214&&m<-.115?s:n).invert(p)},l.stream=function(p){return t&&e===p?t:t=JO([n.stream(e=p),o.stream(p),s.stream(p)])},l.precision=function(p){return arguments.length?(n.precision(p),o.precision(p),s.precision(p),u()):n.precision()},l.scale=function(p){return arguments.length?(n.scale(p),o.scale(p*.35),s.scale(p),l.translate(n.translate())):n.scale()},l.translate=function(p){if(!arguments.length)return n.translate();var h=n.scale(),d=+p[0],m=+p[1];return r=n.translate(p).clipExtent([[d-.455*h,m-.238*h],[d+.455*h,m+.238*h]]).stream(f),i=o.translate([d-.307*h,m+.201*h]).clipExtent([[d-.425*h+K,m+.12*h+K],[d-.214*h-K,m+.234*h-K]]).stream(f),a=s.translate([d-.205*h,m+.212*h]).clipExtent([[d-.214*h+K,m+.166*h+K],[d-.115*h-K,m+.234*h-K]]).stream(f),u()},l.fitExtent=function(p,h){return Fl(l,p,h)},l.fitSize=function(p,h){return Sm(l,p,h)},l.fitWidth=function(p,h){return Am(l,p,h)},l.fitHeight=function(p,h){return Em(l,p,h)};function u(){return t=e=null,l}return l.scale(1070)}function Tm(t){return function(e,n){var r=Q(e),o=Q(n),i=t(r*o);return i===1/0?[2,0]:[i*o*H(e),i*H(n)]}}function Fr(t){return function(e,n){var r=zt(e*e+n*n),o=t(r),i=H(o),s=Q(o);return[le(e*i,r*s),Vt(r&&n*i/r)]}}var Lb=Tm(function(t){return zt(2/(1+t))});Lb.invert=Fr(function(t){return 2*Vt(t/2)});function Db(){return Be(Lb).scale(124.75).clipAngle(180-.001)}var Fb=Tm(function(t){return(t=nm(t))&&t/H(t)});Fb.invert=Fr(function(t){return t});function Pb(){return Be(Fb).scale(79.4188).clipAngle(180-.001)}function fc(t,e){return[t,Rs(Ja((Bt+e)/2))]}fc.invert=function(t,e){return[t,2*Qn(Jd(e))-Bt]};function qb(){return Bb(fc).scale(961/Me)}function Bb(t){var e=Be(t),n=e.center,r=e.scale,o=e.translate,i=e.clipExtent,s=null,a,c,f;e.scale=function(u){return arguments.length?(r(u),l()):r()},e.translate=function(u){return arguments.length?(o(u),l()):o()},e.center=function(u){return arguments.length?(n(u),l()):n()},e.clipExtent=function(u){return arguments.length?(u==null?s=a=c=f=null:(s=+u[0][0],a=+u[0][1],c=+u[1][0],f=+u[1][1]),l()):s==null?null:[[s,a],[c,f]]};function l(){var u=dt*r(),p=e(U5(e.rotate()).invert([0,0]));return i(s==null?[[p[0]-u,p[1]-u],[p[0]+u,p[1]+u]]:t===fc?[[Math.max(p[0]-u,s),a],[Math.min(p[0]+u,c),f]]:[[s,Math.max(p[1]-u,a)],[c,Math.min(p[1]+u,f)]])}return l()}function Im(t){return Ja((Bt+t)/2)}function yM(t,e){var n=Q(t),r=t===e?H(t):Rs(n/Q(e))/Rs(Im(e)/Im(t)),o=n*em(Im(t),r)/r;if(!r)return fc;function i(s,a){o>0?a<-Bt+K&&(a=-Bt+K):a>Bt-K&&(a=Bt-K);var c=o/em(Im(a),r);return[c*H(r*s),o-c*Q(r*s)]}return i.invert=function(s,a){var c=o-a,f=He(r)*zt(s*s+c*c),l=le(s,xt(c))*He(c);return c*r<0&&(l-=dt*He(s)*He(c)),[l/r,2*Qn(em(o/f,1/r))-Bt]},i}function zb(){return cc(yM).scale(109.5).parallels([30,30])}function lc(t,e){return[t,e]}lc.invert=lc;function Yb(){return Be(lc).scale(152.63)}function xM(t,e){var n=Q(t),r=t===e?H(t):(n-Q(e))/(e-t),o=n/r+t;if(xt(r)<K)return lc;function i(s,a){var c=o-a,f=r*s;return[c*H(f),o-c*Q(f)]}return i.invert=function(s,a){var c=o-a,f=le(s,xt(c))*He(c);return c*r<0&&(f-=dt*He(s)*He(c)),[f/r,o-He(r)*zt(s*s+c*c)]},i}function Ub(){return cc(xM).scale(131.154).center([0,13.9389])}var ql=1.340264,Bl=-.081106,zl=893e-6,Yl=.003796,$m=zt(3)/2,tR=12;function jb(t,e){var n=Vt($m*H(e)),r=n*n,o=r*r*r;return[t*Q(n)/($m*(ql+3*Bl*r+o*(7*zl+9*Yl*r))),n*(ql+Bl*r+o*(zl+Yl*r))]}jb.invert=function(t,e){for(var n=e,r=n*n,o=r*r*r,i=0,s,a,c;i<tR&&(a=n*(ql+Bl*r+o*(zl+Yl*r))-e,c=ql+3*Bl*r+o*(7*zl+9*Yl*r),n-=s=a/c,r=n*n,o=r*r*r,!(xt(s)<Os));++i);return[$m*t*(ql+3*Bl*r+o*(7*zl+9*Yl*r))/Q(n),Vt(H(n)/$m)]};function Xb(){return Be(jb).scale(177.158)}function Gb(t,e){var n=Q(e),r=Q(t)*n;return[n*H(t)/r,H(e)/r]}Gb.invert=Fr(Qn);function Vb(){return Be(Gb).scale(144.049).clipAngle(60)}function Wb(t,e){return[Q(e)*H(t),H(e)]}Wb.invert=Fr(Vt);function Hb(){return Be(Wb).scale(249.5).clipAngle(90+K)}function Qb(t,e){var n=Q(e),r=1+Q(t)*n;return[n*H(t)/r,H(e)/r]}Qb.invert=Fr(function(t){return 2*Qn(t)});function Zb(){return Be(Qb).scale(250).clipAngle(142)}function Kb(t,e){return[Rs(Ja((Bt+e)/2)),-t]}Kb.invert=function(t,e){return[-e,2*Qn(Jd(t))-Bt]};function Jb(){var t=Bb(Kb),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function eR(t,e){return t.parent===e.parent?1:2}function nR(t){return t.reduce(rR,0)/t.length}function rR(t,e){return t+e.x}function oR(t){return 1+t.reduce(iR,0)}function iR(t,e){return Math.max(t,e.y)}function sR(t){for(var e;e=t.children;)t=e[0];return t}function aR(t){for(var e;e=t.children;)t=e[e.length-1];return t}function Cm(){var t=eR,e=1,n=1,r=!1;function o(i){var s,a=0;i.eachAfter(function(p){var h=p.children;h?(p.x=nR(h),p.y=oR(h)):(p.x=s?a+=t(p,s):0,p.y=0,s=p)});var c=sR(i),f=aR(i),l=c.x-t(c,f)/2,u=f.x+t(f,c)/2;return i.eachAfter(r?function(p){p.x=(p.x-i.x)*e,p.y=(i.y-p.y)*n}:function(p){p.x=(p.x-l)/(u-l)*e,p.y=(1-(i.y?p.y/i.y:1))*n})}return o.separation=function(i){return arguments.length?(t=i,o):t},o.size=function(i){return arguments.length?(r=!1,e=+i[0],n=+i[1],o):r?null:[e,n]},o.nodeSize=function(i){return arguments.length?(r=!0,e=+i[0],n=+i[1],o):r?[e,n]:null},o}function cR(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function bM(){return this.eachAfter(cR)}function wM(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function vM(t,e){for(var n=this,r=[n],o,i,s=-1;n=r.pop();)if(t.call(e,n,++s,this),o=n.children)for(i=o.length-1;i>=0;--i)r.push(o[i]);return this}function _M(t,e){for(var n=this,r=[n],o=[],i,s,a,c=-1;n=r.pop();)if(o.push(n),i=n.children)for(s=0,a=i.length;s<a;++s)r.push(i[s]);for(;n=o.pop();)t.call(e,n,++c,this);return this}function MM(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function SM(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n})}function AM(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function EM(t){for(var e=this,n=fR(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function fR(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;for(t=n.pop(),e=r.pop();t===e;)o=t,t=n.pop(),e=r.pop();return o}function TM(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function IM(){return Array.from(this)}function $M(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function CM(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*kM(){var t=this,e,n=[t],r,o,i;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(o=0,i=r.length;o<i;++o)n.push(r[o]);while(n.length)}function t2(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=pR)):e===void 0&&(e=uR);for(var n=new Ai(t),r,o=[n],i,s,a,c;r=o.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)o.push(i=s[a]=new Ai(s[a])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(e2)}function lR(){return t2(this).eachBefore(hR)}function uR(t){return t.children}function pR(t){return Array.isArray(t)?t[1]:null}function hR(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function e2(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Ai(t){this.data=t,this.depth=this.height=0,this.parent=null}Ai.prototype=t2.prototype={constructor:Ai,count:bM,each:wM,eachAfter:_M,eachBefore:vM,find:MM,sum:SM,sort:AM,path:EM,ancestors:TM,descendants:IM,leaves:$M,links:CM,copy:lR,[Symbol.iterator]:kM};function km(t){return t==null?null:dR(t)}function dR(t){if(typeof t!="function")throw new Error;return t}var mR={depth:-1},NM={},n2={};function gR(t){return t.id}function yR(t){return t.parentId}function Nm(){var t=gR,e=yR,n;function r(o){var i=Array.from(o),s=t,a=e,c,f,l,u,p,h,d,m,g=new Map;if(n!=null){let y=i.map((b,_)=>xR(n(b,_,o))),x=y.map(OM),w=new Set(y).add("");for(let b of x)w.has(b)||(w.add(b),y.push(b),x.push(OM(b)),i.push(n2));s=(b,_)=>y[_],a=(b,_)=>x[_]}for(l=0,c=i.length;l<c;++l)f=i[l],h=i[l]=new Ai(f),(d=s(f,l,o))!=null&&(d+="")&&(m=h.id=d,g.set(m,g.has(m)?NM:h)),(d=a(f,l,o))!=null&&(d+="")&&(h.parent=d);for(l=0;l<c;++l)if(h=i[l],d=h.parent){if(p=g.get(d),!p)throw new Error("missing: "+d);if(p===NM)throw new Error("ambiguous: "+d);p.children?p.children.push(h):p.children=[h],h.parent=p}else{if(u)throw new Error("multiple roots");u=h}if(!u)throw new Error("no root");if(n!=null){for(;u.data===n2&&u.children.length===1;)u=u.children[0],--c;for(let y=i.length-1;y>=0&&(h=i[y],h.data===n2);--y)h.data=null}if(u.parent=mR,u.eachBefore(function(y){y.depth=y.parent.depth+1,--c}).eachBefore(e2),u.parent=null,c>0)throw new Error("cycle");return u}return r.id=function(o){return arguments.length?(t=km(o),r):t},r.parentId=function(o){return arguments.length?(e=km(o),r):e},r.path=function(o){return arguments.length?(n=km(o),r):n},r}function xR(t){t=`${t}`;let e=t.length;return r2(t,e-1)&&!r2(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function OM(t){let e=t.length;if(e<2)return"";for(;--e>1&&!r2(t,e););return t.slice(0,e)}function r2(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function bR(t,e){return t.parent===e.parent?1:2}function o2(t){var e=t.children;return e?e[0]:t.t}function i2(t){var e=t.children;return e?e[e.length-1]:t.t}function wR(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function vR(t){for(var e=0,n=0,r=t.children,o=r.length,i;--o>=0;)i=r[o],i.z+=e,i.m+=e,e+=i.s+(n+=i.c)}function _R(t,e,n){return t.a.parent===e.parent?t.a:n}function Om(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Om.prototype=Object.create(Ai.prototype);function MR(t){for(var e=new Om(t,0),n,r=[e],o,i,s,a;n=r.pop();)if(i=n._.children)for(n.children=new Array(a=i.length),s=a-1;s>=0;--s)r.push(o=n.children[s]=new Om(i[s],s)),o.parent=n;return(e.parent=new Om(null,0)).children=[e],e}function Fs(){var t=bR,e=1,n=1,r=null;function o(f){var l=MR(f);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(s),r)f.eachBefore(c);else{var u=f,p=f,h=f;f.eachBefore(function(x){x.x<u.x&&(u=x),x.x>p.x&&(p=x),x.depth>h.depth&&(h=x)});var d=u===p?1:t(u,p)/2,m=d-u.x,g=e/(p.x+d+m),y=n/(h.depth||1);f.eachBefore(function(x){x.x=(x.x+m)*g,x.y=x.depth*y})}return f}function i(f){var l=f.children,u=f.parent.children,p=f.i?u[f.i-1]:null;if(l){vR(f);var h=(l[0].z+l[l.length-1].z)/2;p?(f.z=p.z+t(f._,p._),f.m=f.z-h):f.z=h}else p&&(f.z=p.z+t(f._,p._));f.parent.A=a(f,p,f.parent.A||u[0])}function s(f){f._.x=f.z+f.parent.m,f.m+=f.parent.m}function a(f,l,u){if(l){for(var p=f,h=f,d=l,m=p.parent.children[0],g=p.m,y=h.m,x=d.m,w=m.m,b;d=i2(d),p=o2(p),d&&p;)m=o2(m),h=i2(h),h.a=f,b=d.z+x-p.z-g+t(d._,p._),b>0&&(wR(_R(d,f,u),f,b),g+=b,y+=b),x+=d.m,g+=p.m,w+=m.m,y+=h.m;d&&!i2(h)&&(h.t=d,h.m+=x-y),p&&!o2(m)&&(m.t=p,m.m+=g-w,u=f)}return u}function c(f){f.x*=e,f.y=f.depth*n}return o.separation=function(f){return arguments.length?(t=f,o):t},o.size=function(f){return arguments.length?(r=!1,e=+f[0],n=+f[1],o):r?null:[e,n]},o.nodeSize=function(f){return arguments.length?(r=!0,e=+f[0],n=+f[1],o):r?[e,n]:null},o}var RM=23283064365386963e-26;function Ps(t=Math.random()){let e=(0<=t&&t<1?t/RM:Math.abs(t))|0;return()=>(e=1664525*e+1013904223|0,RM*(e>>>0))}function pe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Ul(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var jl=Symbol("implicit");function qs(){var t=new nn,e=[],n=[],r=jl;function o(i){let s=t.get(i);if(s===void 0){if(r!==jl)return r;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new nn;for(let s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(n=Array.from(i),o):n.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return qs(e,n).unknown(r)},pe.apply(o,arguments),o}function Ei(){var t=qs().unknown(void 0),e=t.domain,n=t.range,r=0,o=1,i,s,a=!1,c=0,f=0,l=.5;delete t.unknown;function u(){var p=e().length,h=o<r,d=h?o:r,m=h?r:o;i=(m-d)/Math.max(1,p-c+f*2),a&&(i=Math.floor(i)),d+=(m-d-i*(p-c))*l,s=i*(1-c),a&&(d=Math.round(d),s=Math.round(s));var g=ie(p).map(function(y){return d+i*y});return n(h?g.reverse():g)}return t.domain=function(p){return arguments.length?(e(p),u()):e()},t.range=function(p){return arguments.length?([r,o]=p,r=+r,o=+o,u()):[r,o]},t.rangeRound=function(p){return[r,o]=p,r=+r,o=+o,a=!0,u()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(p){return arguments.length?(a=!!p,u()):a},t.padding=function(p){return arguments.length?(c=Math.min(1,f=+p),u()):c},t.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),u()):c},t.paddingOuter=function(p){return arguments.length?(f=+p,u()):f},t.align=function(p){return arguments.length?(l=Math.max(0,Math.min(1,p)),u()):l},t.copy=function(){return Ei(e(),[r,o]).round(a).paddingInner(c).paddingOuter(f).align(l)},pe.apply(u(),arguments)}function LM(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return LM(e())},t}function s2(){return LM(Ei.apply(null,arguments).paddingInner(1))}function a2(t){return function(){return t}}function uc(t){return+t}var DM=[0,1];function wn(t){return t}function c2(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:a2(isNaN(e)?NaN:.5)}function SR(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function AR(t,e,n){var r=t[0],o=t[1],i=e[0],s=e[1];return o<r?(r=c2(o,r),i=n(s,i)):(r=c2(r,o),i=n(i,s)),function(a){return i(r(a))}}function ER(t,e,n){var r=Math.min(t.length,e.length)-1,o=new Array(r),i=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)o[s]=c2(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var c=yo(t,a,1,r)-1;return i[c](o[c](a))}}function Pr(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Bs(){var t=DM,e=DM,n=In,r,o,i,s=wn,a,c,f;function l(){var p=Math.min(t.length,e.length);return s!==wn&&(s=SR(t[0],t[p-1])),a=p>2?ER:AR,c=f=null,u}function u(p){return p==null||isNaN(p=+p)?i:(c||(c=a(t.map(r),e,n)))(r(s(p)))}return u.invert=function(p){return s(o((f||(f=a(e,t.map(r),Gt)))(p)))},u.domain=function(p){return arguments.length?(t=Array.from(p,uc),l()):t.slice()},u.range=function(p){return arguments.length?(e=Array.from(p),l()):e.slice()},u.rangeRound=function(p){return e=Array.from(p),n=Ts,l()},u.clamp=function(p){return arguments.length?(s=p?!0:wn,l()):s!==wn},u.interpolate=function(p){return arguments.length?(n=p,l()):n},u.unknown=function(p){return arguments.length?(i=p,u):i},function(p,h){return r=p,o=h,l()}}function Xl(){return Bs()(wn,wn)}function f2(t,e,n,r){var o=Ra(t,e,n),i;switch(r=Or(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(i=nb(o,s))&&(r.precision=i),Kd(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=rb(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=eb(o))&&(r.precision=i-(r.type==="%")*2);break}}return Hn(r)}function $o(t){var e=t.domain;return t.ticks=function(n){var r=e();return Fe(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return f2(o[0],o[o.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),o=0,i=r.length-1,s=r[o],a=r[i],c,f,l=10;for(a<s&&(f=s,s=a,a=f,f=o,o=i,i=f);l-- >0;){if(f=bo(s,a,n),f===c)return r[o]=s,r[i]=a,e(r);if(f>0)s=Math.floor(s/f)*f,a=Math.ceil(a/f)*f;else if(f<0)s=Math.ceil(s*f)/f,a=Math.floor(a*f)/f;else break;c=f}return t},t}function Co(){var t=Xl();return t.copy=function(){return Pr(t,Co())},pe.apply(t,arguments),$o(t)}function Gl(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,uc),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Gl(t).unknown(e)},t=arguments.length?Array.from(t,uc):[0,1],$o(n)}function Vl(t,e){t=t.slice();var n=0,r=t.length-1,o=t[n],i=t[r],s;return i<o&&(s=n,n=r,r=s,s=o,o=i,i=s),t[n]=e.floor(o),t[r]=e.ceil(i),t}function FM(t){return Math.log(t)}function PM(t){return Math.exp(t)}function TR(t){return-Math.log(-t)}function IR(t){return-Math.exp(-t)}function $R(t){return isFinite(t)?+("1e"+t):t<0?0:t}function CR(t){return t===10?$R:t===Math.E?Math.exp:e=>Math.pow(t,e)}function kR(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function qM(t){return(e,n)=>-t(-e,n)}function l2(t){let e=t(FM,PM),n=e.domain,r=10,o,i;function s(){return o=kR(r),i=CR(r),n()[0]<0?(o=qM(o),i=qM(i),t(TR,IR)):t(FM,PM),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{let c=n(),f=c[0],l=c[c.length-1],u=l<f;u&&([f,l]=[l,f]);let p=o(f),h=o(l),d,m,g=a==null?10:+a,y=[];if(!(r%1)&&h-p<g){if(p=Math.floor(p),h=Math.ceil(h),f>0){for(;p<=h;++p)for(d=1;d<r;++d)if(m=p<0?d/i(-p):d*i(p),!(m<f)){if(m>l)break;y.push(m)}}else for(;p<=h;++p)for(d=r-1;d>=1;--d)if(m=p>0?d/i(-p):d*i(p),!(m<f)){if(m>l)break;y.push(m)}y.length*2<g&&(y=Fe(f,l,g))}else y=Fe(p,h,Math.min(h-p,g)).map(i);return u?y.reverse():y},e.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Or(c)).precision==null&&(c.trim=!0),c=Hn(c)),a===1/0)return c;let f=Math.max(1,r*a/e.ticks().length);return l=>{let u=l/i(Math.round(o(l)));return u*r<r-.5&&(u*=r),u<=f?c(l):""}},e.nice=()=>n(Vl(n(),{floor:a=>i(Math.floor(o(a))),ceil:a=>i(Math.ceil(o(a)))})),e}function Wl(){let t=l2(Bs()).domain([1,10]);return t.copy=()=>Pr(t,Wl()).base(t.base()),pe.apply(t,arguments),t}function BM(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function zM(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function u2(t){var e=1,n=t(BM(e),zM(e));return n.constant=function(r){return arguments.length?t(BM(e=+r),zM(e)):e},$o(n)}function Hl(){var t=u2(Bs());return t.copy=function(){return Pr(t,Hl()).constant(t.constant())},pe.apply(t,arguments)}function YM(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function NR(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function OR(t){return t<0?-t*t:t*t}function p2(t){var e=t(wn,wn),n=1;function r(){return n===1?t(wn,wn):n===.5?t(NR,OR):t(YM(n),YM(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},$o(e)}function Ql(){var t=p2(Bs());return t.copy=function(){return Pr(t,Ql()).exponent(t.exponent())},pe.apply(t,arguments),t}function Zl(){var t=[],e=[],n=[],r;function o(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=ux(t,s/a);return i}function i(s){return s==null||isNaN(s=+s)?r:e[yo(n,s)]}return i.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},i.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(ht),o()},i.range=function(s){return arguments.length?(e=Array.from(s),o()):e.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return Zl().domain(t).range(e).unknown(r)},pe.apply(i,arguments)}function Kl(){var t=[.5],e=[0,1],n,r=1;function o(i){return i!=null&&i<=i?e[yo(t,i,0,r)]:n}return o.domain=function(i){return arguments.length?(t=Array.from(i),r=Math.min(t.length,e.length-1),o):t.slice()},o.range=function(i){return arguments.length?(e=Array.from(i),r=Math.min(t.length,e.length-1),o):e.slice()},o.invertExtent=function(i){var s=e.indexOf(i);return[t[s-1],t[s]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return Kl().domain(t).range(e).unknown(n)},pe.apply(o,arguments)}var h2=new Date,d2=new Date;function Ut(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{let s=o(i),a=o.ceil(i);return i-s<a-i?s:a},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,a)=>{let c=[];if(i=o.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return c;let f;do c.push(f=new Date(+i)),e(i,a),t(i);while(f<i&&i<s);return c},o.filter=i=>Ut(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(o.count=(i,s)=>(h2.setTime(+i),d2.setTime(+s),t(h2),t(d2),Math.floor(n(h2,d2))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?s=>r(s)%i===0:s=>o.count(0,s)%i===0):o)),o}var Jl=Ut(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Jl.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ut(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Jl);var Uht=Jl.range;var Ae=Ut(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),UM=Ae.range;var ko=Ut(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),RR=ko.range,No=Ut(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),LR=No.range;var Oo=Ut(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),DR=Oo.range,Ro=Ut(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),FR=Ro.range;var Zn=Ut(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),PR=Zn.range,Us=Ut(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),qR=Us.range,js=Ut(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),BR=js.range;function Xs(t){return Ut(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Cn=Xs(0),Ti=Xs(1),Rm=Xs(2),Lm=Xs(3),Br=Xs(4),Dm=Xs(5),Fm=Xs(6),XM=Cn.range,zR=Ti.range,YR=Rm.range,UR=Lm.range,jR=Br.range,XR=Dm.range,GR=Fm.range;function Gs(t){return Ut(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var kn=Gs(0),Ii=Gs(1),Pm=Gs(2),qm=Gs(3),zr=Gs(4),Bm=Gs(5),zm=Gs(6),GM=kn.range,VR=Ii.range,WR=Pm.range,HR=qm.range,QR=zr.range,ZR=Bm.range,KR=zm.range;var Lo=Ut(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),JR=Lo.range,Do=Ut(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),tL=Do.range;var Qe=Ut(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Qe.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ut(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var eL=Qe.range,Ze=Ut(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Ze.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ut(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var nL=Ze.range;function WM(t,e,n,r,o,i){let s=[[Ae,1,1e3],[Ae,5,5*1e3],[Ae,15,15*1e3],[Ae,30,30*1e3],[i,1,6e4],[i,5,5*6e4],[i,15,15*6e4],[i,30,30*6e4],[o,1,36e5],[o,3,3*36e5],[o,6,6*36e5],[o,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(f,l,u){let p=l<f;p&&([f,l]=[l,f]);let h=u&&typeof u.range=="function"?u:c(f,l,u),d=h?h.range(f,+l+1):[];return p?d.reverse():d}function c(f,l,u){let p=Math.abs(l-f)/u,h=fr(([,,g])=>g).right(s,p);if(h===s.length)return t.every(Ra(f/31536e6,l/31536e6,u));if(h===0)return Jl.every(Math.max(Ra(f,l,u),1));let[d,m]=s[p/s[h-1][2]<s[h][2]/p?h-1:h];return d.every(m)}return[a,c]}var[m2,eu]=WM(Ze,Do,kn,js,Ro,No),[g2,y2]=WM(Qe,Lo,Cn,Zn,Oo,ko);function x2(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function b2(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function nu(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function w2(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,f=ru(o),l=ou(o),u=ru(i),p=ou(i),h=ru(s),d=ou(s),m=ru(a),g=ou(a),y=ru(c),x=ou(c),w={a:N,A:L,b:R,B:D,c:null,d:t8,e:t8,f:EL,g:DL,G:PL,H:ML,I:SL,j:AL,L:i8,m:TL,M:IL,p:F,q:P,Q:r8,s:o8,S:$L,u:CL,U:kL,V:NL,w:OL,W:RL,x:null,X:null,y:LL,Y:FL,Z:qL,"%":n8},b={a:V,A:J,b:et,B:rt,c:null,d:e8,e:e8,f:UL,g:JL,G:eD,H:BL,I:zL,j:YL,L:a8,m:jL,M:XL,p:j,q:nt,Q:r8,s:o8,S:GL,u:VL,U:WL,V:HL,w:QL,W:ZL,x:null,X:null,y:KL,Y:tD,Z:nD,"%":n8},_={a:$,A:S,b:k,B:O,c:M,d:KM,e:KM,f:bL,g:ZM,G:QM,H:JM,I:JM,j:mL,L:xL,m:dL,M:gL,p:E,q:hL,Q:vL,s:_L,S:yL,u:cL,U:fL,V:lL,w:aL,W:uL,x:I,X:C,y:ZM,Y:QM,Z:pL,"%":wL};w.x=v(n,w),w.X=v(r,w),w.c=v(e,w),b.x=v(n,b),b.X=v(r,b),b.c=v(e,b);function v(z,W){return function(tt){var q=[],gt=-1,at=0,At=z.length,It,Z,Dt;for(tt instanceof Date||(tt=new Date(+tt));++gt<At;)z.charCodeAt(gt)===37&&(q.push(z.slice(at,gt)),(Z=HM[It=z.charAt(++gt)])!=null?It=z.charAt(++gt):Z=It==="e"?" ":"0",(Dt=W[It])&&(It=Dt(tt,Z)),q.push(It),at=gt+1);return q.push(z.slice(at,gt)),q.join("")}}function A(z,W){return function(tt){var q=nu(1900,void 0,1),gt=T(q,z,tt+="",0),at,At;if(gt!=tt.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(W&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(at=b2(nu(q.y,0,1)),At=at.getUTCDay(),at=At>4||At===0?Ii.ceil(at):Ii(at),at=Us.offset(at,(q.V-1)*7),q.y=at.getUTCFullYear(),q.m=at.getUTCMonth(),q.d=at.getUTCDate()+(q.w+6)%7):(at=x2(nu(q.y,0,1)),At=at.getDay(),at=At>4||At===0?Ti.ceil(at):Ti(at),at=Zn.offset(at,(q.V-1)*7),q.y=at.getFullYear(),q.m=at.getMonth(),q.d=at.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),At="Z"in q?b2(nu(q.y,0,1)).getUTCDay():x2(nu(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(At+5)%7:q.w+q.U*7-(At+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,b2(q)):x2(q)}}function T(z,W,tt,q){for(var gt=0,at=W.length,At=tt.length,It,Z;gt<at;){if(q>=At)return-1;if(It=W.charCodeAt(gt++),It===37){if(It=W.charAt(gt++),Z=_[It in HM?W.charAt(gt++):It],!Z||(q=Z(z,tt,q))<0)return-1}else if(It!=tt.charCodeAt(q++))return-1}return q}function E(z,W,tt){var q=f.exec(W.slice(tt));return q?(z.p=l.get(q[0].toLowerCase()),tt+q[0].length):-1}function $(z,W,tt){var q=h.exec(W.slice(tt));return q?(z.w=d.get(q[0].toLowerCase()),tt+q[0].length):-1}function S(z,W,tt){var q=u.exec(W.slice(tt));return q?(z.w=p.get(q[0].toLowerCase()),tt+q[0].length):-1}function k(z,W,tt){var q=y.exec(W.slice(tt));return q?(z.m=x.get(q[0].toLowerCase()),tt+q[0].length):-1}function O(z,W,tt){var q=m.exec(W.slice(tt));return q?(z.m=g.get(q[0].toLowerCase()),tt+q[0].length):-1}function M(z,W,tt){return T(z,e,W,tt)}function I(z,W,tt){return T(z,n,W,tt)}function C(z,W,tt){return T(z,r,W,tt)}function N(z){return s[z.getDay()]}function L(z){return i[z.getDay()]}function R(z){return c[z.getMonth()]}function D(z){return a[z.getMonth()]}function F(z){return o[+(z.getHours()>=12)]}function P(z){return 1+~~(z.getMonth()/3)}function V(z){return s[z.getUTCDay()]}function J(z){return i[z.getUTCDay()]}function et(z){return c[z.getUTCMonth()]}function rt(z){return a[z.getUTCMonth()]}function j(z){return o[+(z.getUTCHours()>=12)]}function nt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var W=v(z+="",w);return W.toString=function(){return z},W},parse:function(z){var W=A(z+="",!1);return W.toString=function(){return z},W},utcFormat:function(z){var W=v(z+="",b);return W.toString=function(){return z},W},utcParse:function(z){var W=A(z+="",!0);return W.toString=function(){return z},W}}}var HM={"-":"",_:" ",0:"0"},Ee=/^\s*\d+/,oL=/^%/,iL=/[\\^$*+?|[\]().{}]/g;function Nt(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function sL(t){return t.replace(iL,"\\$&")}function ru(t){return new RegExp("^(?:"+t.map(sL).join("|")+")","i")}function ou(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function aL(t,e,n){var r=Ee.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function cL(t,e,n){var r=Ee.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function fL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function lL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function uL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function QM(t,e,n){var r=Ee.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ZM(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function pL(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function hL(t,e,n){var r=Ee.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function dL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function KM(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function mL(t,e,n){var r=Ee.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function JM(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function gL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function yL(t,e,n){var r=Ee.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function xL(t,e,n){var r=Ee.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function bL(t,e,n){var r=Ee.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function wL(t,e,n){var r=oL.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function vL(t,e,n){var r=Ee.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function _L(t,e,n){var r=Ee.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function t8(t,e){return Nt(t.getDate(),e,2)}function ML(t,e){return Nt(t.getHours(),e,2)}function SL(t,e){return Nt(t.getHours()%12||12,e,2)}function AL(t,e){return Nt(1+Zn.count(Qe(t),t),e,3)}function i8(t,e){return Nt(t.getMilliseconds(),e,3)}function EL(t,e){return i8(t,e)+"000"}function TL(t,e){return Nt(t.getMonth()+1,e,2)}function IL(t,e){return Nt(t.getMinutes(),e,2)}function $L(t,e){return Nt(t.getSeconds(),e,2)}function CL(t){var e=t.getDay();return e===0?7:e}function kL(t,e){return Nt(Cn.count(Qe(t)-1,t),e,2)}function s8(t){var e=t.getDay();return e>=4||e===0?Br(t):Br.ceil(t)}function NL(t,e){return t=s8(t),Nt(Br.count(Qe(t),t)+(Qe(t).getDay()===4),e,2)}function OL(t){return t.getDay()}function RL(t,e){return Nt(Ti.count(Qe(t)-1,t),e,2)}function LL(t,e){return Nt(t.getFullYear()%100,e,2)}function DL(t,e){return t=s8(t),Nt(t.getFullYear()%100,e,2)}function FL(t,e){return Nt(t.getFullYear()%1e4,e,4)}function PL(t,e){var n=t.getDay();return t=n>=4||n===0?Br(t):Br.ceil(t),Nt(t.getFullYear()%1e4,e,4)}function qL(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Nt(e/60|0,"0",2)+Nt(e%60,"0",2)}function e8(t,e){return Nt(t.getUTCDate(),e,2)}function BL(t,e){return Nt(t.getUTCHours(),e,2)}function zL(t,e){return Nt(t.getUTCHours()%12||12,e,2)}function YL(t,e){return Nt(1+Us.count(Ze(t),t),e,3)}function a8(t,e){return Nt(t.getUTCMilliseconds(),e,3)}function UL(t,e){return a8(t,e)+"000"}function jL(t,e){return Nt(t.getUTCMonth()+1,e,2)}function XL(t,e){return Nt(t.getUTCMinutes(),e,2)}function GL(t,e){return Nt(t.getUTCSeconds(),e,2)}function VL(t){var e=t.getUTCDay();return e===0?7:e}function WL(t,e){return Nt(kn.count(Ze(t)-1,t),e,2)}function c8(t){var e=t.getUTCDay();return e>=4||e===0?zr(t):zr.ceil(t)}function HL(t,e){return t=c8(t),Nt(zr.count(Ze(t),t)+(Ze(t).getUTCDay()===4),e,2)}function QL(t){return t.getUTCDay()}function ZL(t,e){return Nt(Ii.count(Ze(t)-1,t),e,2)}function KL(t,e){return Nt(t.getUTCFullYear()%100,e,2)}function JL(t,e){return t=c8(t),Nt(t.getUTCFullYear()%100,e,2)}function tD(t,e){return Nt(t.getUTCFullYear()%1e4,e,4)}function eD(t,e){var n=t.getUTCDay();return t=n>=4||n===0?zr(t):zr.ceil(t),Nt(t.getUTCFullYear()%1e4,e,4)}function nD(){return"+0000"}function n8(){return"%"}function r8(t){return+t}function o8(t){return Math.floor(+t/1e3)}var pc,hc,f8,Yr,l8;v2({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function v2(t){return pc=w2(t),hc=pc.format,f8=pc.parse,Yr=pc.utcFormat,l8=pc.utcParse,pc}function rD(t){return new Date(t)}function oD(t){return t instanceof Date?+t:+new Date(+t)}function Ym(t,e,n,r,o,i,s,a,c,f){var l=Xl(),u=l.invert,p=l.domain,h=f(".%L"),d=f(":%S"),m=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),x=f("%b %d"),w=f("%B"),b=f("%Y");function _(v){return(c(v)<v?h:a(v)<v?d:s(v)<v?m:i(v)<v?g:r(v)<v?o(v)<v?y:x:n(v)<v?w:b)(v)}return l.invert=function(v){return new Date(u(v))},l.domain=function(v){return arguments.length?p(Array.from(v,oD)):p().map(rD)},l.ticks=function(v){var A=p();return t(A[0],A[A.length-1],v??10)},l.tickFormat=function(v,A){return A==null?_:f(A)},l.nice=function(v){var A=p();return(!v||typeof v.range!="function")&&(v=e(A[0],A[A.length-1],v??10)),v?p(Vl(A,v)):l},l.copy=function(){return Pr(l,Ym(t,e,n,r,o,i,s,a,c,f))},l}function Um(){return pe.apply(Ym(g2,y2,Qe,Lo,Cn,Zn,Oo,ko,Ae,hc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jm(){return pe.apply(Ym(m2,eu,Ze,Do,kn,Us,Ro,No,Ae,Yr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function iu(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Xm(){var t=0,e=.5,n=1,r=1,o,i,s,a,c,f=wn,l,u=!1,p;function h(m){return isNaN(m=+m)?p:(m=.5+((m=+l(m))-i)*(r*m<r*i?a:c),f(u?Math.max(0,Math.min(1,m)):m))}h.domain=function(m){return arguments.length?([t,e,n]=m,o=l(t=+t),i=l(e=+e),s=l(n=+n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h):[t,e,n]},h.clamp=function(m){return arguments.length?(u=!!m,h):u},h.interpolator=function(m){return arguments.length?(f=m,h):f};function d(m){return function(g){var y,x,w;return arguments.length?([y,x,w]=g,f=$r(m,[y,x,w]),h):[f(0),f(.5),f(1)]}}return h.range=d(In),h.rangeRound=d(Ts),h.unknown=function(m){return arguments.length?(p=m,h):p},function(m){return l=m,o=m(t),i=m(e),s=m(n),a=o===i?0:.5/(i-o),c=i===s?0:.5/(s-i),r=i<o?-1:1,h}}function su(){var t=$o(Xm()(wn));return t.copy=function(){return iu(t,su())},Ul.apply(t,arguments)}function Gm(){var t=l2(Xm()).domain([.1,1,10]);return t.copy=function(){return iu(t,Gm()).base(t.base())},Ul.apply(t,arguments)}function Vm(){var t=u2(Xm());return t.copy=function(){return iu(t,Vm()).constant(t.constant())},Ul.apply(t,arguments)}function Wm(){var t=p2(Xm());return t.copy=function(){return iu(t,Wm()).exponent(t.exponent())},Ul.apply(t,arguments)}function X(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}var _2=X("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var M2=X("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");var S2=X("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");var A2=X("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");var E2=X("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");var T2=X("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");var I2=X("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");var $2=X("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");var C2=X("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");var k2=X("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var N2=X("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var ct=t=>Tx(t[t.length-1]);var Hm=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(X),Qm=ct(Hm);var Zm=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(X),Km=ct(Zm);var Jm=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(X),t0=ct(Jm);var e0=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(X),n0=ct(e0);var au=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(X),dc=ct(au);var r0=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(X),o0=ct(r0);var cu=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(X),mc=ct(cu);var i0=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(X),s0=ct(i0);var a0=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(X),c0=ct(a0);var f0=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(X),l0=ct(f0);var u0=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(X),p0=ct(u0);var h0=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(X),d0=ct(h0);var m0=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(X),g0=ct(m0);var y0=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(X),x0=ct(y0);var b0=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(X),w0=ct(b0);var v0=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(X),_0=ct(v0);var M0=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(X),S0=ct(M0);var A0=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(X),E0=ct(A0);var T0=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(X),I0=ct(T0);var $0=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(X),C0=ct($0);var k0=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(X),N0=ct(k0);var O0=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(X),R0=ct(O0);var L0=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(X),D0=ct(L0);var F0=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(X),P0=ct(F0);var q0=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(X),B0=ct(q0);var z0=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(X),Y0=ct(z0);var U0=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(X),j0=ct(U0);function X0(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}var G0=Ua(an(300,.5,0),an(-240,.5,1));var W0=Ua(an(-100,.75,.35),an(80,1.5,.8)),H0=Ua(an(260,.75,.35),an(80,1.5,.8)),V0=an();function Q0(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return V0.h=360*t-100,V0.s=1.5-1.5*e,V0.l=.8-.9*e,V0+""}var Z0=ye(),iD=Math.PI/3,sD=Math.PI*2/3;function K0(t){var e;return t=(.5-t)*Math.PI,Z0.r=255*(e=Math.sin(t))*e,Z0.g=255*(e=Math.sin(t+iD))*e,Z0.b=255*(e=Math.sin(t+sD))*e,Z0+""}function J0(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function tg(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var eg=tg(X("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ng=tg(X("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),rg=tg(X("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),og=tg(X("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function he(t){return function(){return t}}var O2=Math.cos;var gc=Math.min,fu=Math.sin,Ot=Math.sqrt,R2=1e-12,Vs=Math.PI,dyt=Vs/2,yc=2*Vs;function ig(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new wi(e)}var xyt=Array.prototype.slice;function sg(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function u8(t){this._context=t}u8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Fo(t){return new u8(t)}function ag(t){return t[0]}function cg(t){return t[1]}function lu(t,e){var n=he(!0),r=null,o=Fo,i=null,s=ig(a);t=typeof t=="function"?t:t===void 0?ag:he(t),e=typeof e=="function"?e:e===void 0?cg:he(e);function a(c){var f,l=(c=sg(c)).length,u,p=!1,h;for(r==null&&(i=o(h=s())),f=0;f<=l;++f)!(f<l&&n(u=c[f],f,c))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+t(u,f,c),+e(u,f,c));if(h)return i=null,h+""||null}return a.x=function(c){return arguments.length?(t=typeof c=="function"?c:he(+c),a):t},a.y=function(c){return arguments.length?(e=typeof c=="function"?c:he(+c),a):e},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:he(!!c),a):n},a.curve=function(c){return arguments.length?(o=c,r!=null&&(i=o(r)),a):o},a.context=function(c){return arguments.length?(c==null?r=i=null:i=o(r=c),a):r},a}function xc(t,e,n){var r=null,o=he(!0),i=null,s=Fo,a=null,c=ig(f);t=typeof t=="function"?t:t===void 0?ag:he(+t),e=typeof e=="function"?e:e===void 0?he(0):he(+e),n=typeof n=="function"?n:n===void 0?cg:he(+n);function f(u){var p,h,d,m=(u=sg(u)).length,g,y=!1,x,w=new Array(m),b=new Array(m);for(i==null&&(a=s(x=c())),p=0;p<=m;++p){if(!(p<m&&o(g=u[p],p,u))===y)if(y=!y)h=p,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=p-1;d>=h;--d)a.point(w[d],b[d]);a.lineEnd(),a.areaEnd()}y&&(w[p]=+t(g,p,u),b[p]=+e(g,p,u),a.point(r?+r(g,p,u):w[p],n?+n(g,p,u):b[p]))}if(x)return a=null,x+""||null}function l(){return lu().defined(o).curve(s).context(i)}return f.x=function(u){return arguments.length?(t=typeof u=="function"?u:he(+u),r=null,f):t},f.x0=function(u){return arguments.length?(t=typeof u=="function"?u:he(+u),f):t},f.x1=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:he(+u),f):r},f.y=function(u){return arguments.length?(e=typeof u=="function"?u:he(+u),n=null,f):e},f.y0=function(u){return arguments.length?(e=typeof u=="function"?u:he(+u),f):e},f.y1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:he(+u),f):n},f.lineX0=f.lineY0=function(){return l().x(t).y(e)},f.lineY1=function(){return l().x(t).y(n)},f.lineX1=function(){return l().x(r).y(e)},f.defined=function(u){return arguments.length?(o=typeof u=="function"?u:he(!!u),f):o},f.curve=function(u){return arguments.length?(s=u,i!=null&&(a=s(i)),f):s},f.context=function(u){return arguments.length?(u==null?i=a=null:a=s(i=u),f):i},f}var fg=class{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}};function L2(t){return new fg(t,!0)}function D2(t){return new fg(t,!1)}var aD=Ot(3),uu={draw(t,e){let n=Ot(e+gc(e/28,.75))*.59436,r=n/2,o=r*aD;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-o,-r),t.lineTo(o,r),t.moveTo(-o,r),t.lineTo(o,-r)}};var Po={draw(t,e){let n=Ot(e/Vs);t.moveTo(n,0),t.arc(0,0,n,0,yc)}};var pu={draw(t,e){let n=Ot(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var p8=Ot(1/3),cD=p8*2,hu={draw(t,e){let n=Ot(e/cD),r=n*p8;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var du={draw(t,e){let n=Ot(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}};var mu={draw(t,e){let n=Ot(e-gc(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}};var gu={draw(t,e){let n=Ot(e),r=-n/2;t.rect(r,r,n,n)}};var yu={draw(t,e){let n=Ot(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}};var fD=.8908130915292852,h8=fu(Vs/10)/fu(7*Vs/10),lD=fu(yc/10)*h8,uD=-O2(yc/10)*h8,xu={draw(t,e){let n=Ot(e*fD),r=lD*n,o=uD*n;t.moveTo(0,-n),t.lineTo(r,o);for(let i=1;i<5;++i){let s=yc*i/5,a=O2(s),c=fu(s);t.lineTo(c*n,-a*n),t.lineTo(a*r-c*o,c*r+a*o)}t.closePath()}};var F2=Ot(3),bu={draw(t,e){let n=-Ot(e/(F2*3));t.moveTo(0,n*2),t.lineTo(-F2*n,-n),t.lineTo(F2*n,-n),t.closePath()}};var pD=Ot(3),wu={draw(t,e){let n=Ot(e)*.6824,r=n/2,o=n*pD/2;t.moveTo(0,-n),t.lineTo(o,r),t.lineTo(-o,r),t.closePath()}};var Kn=-.5,Jn=Ot(3)/2,P2=1/Ot(12),hD=(P2/2+1)*3,vu={draw(t,e){let n=Ot(e/hD),r=n/2,o=n*P2,i=r,s=n*P2+n,a=-i,c=s;t.moveTo(r,o),t.lineTo(i,s),t.lineTo(a,c),t.lineTo(Kn*r-Jn*o,Jn*r+Kn*o),t.lineTo(Kn*i-Jn*s,Jn*i+Kn*s),t.lineTo(Kn*a-Jn*c,Jn*a+Kn*c),t.lineTo(Kn*r+Jn*o,Kn*o-Jn*r),t.lineTo(Kn*i+Jn*s,Kn*s-Jn*i),t.lineTo(Kn*a+Jn*c,Kn*c-Jn*a),t.closePath()}};var bc={draw(t,e){let n=Ot(e-gc(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};var lg=[Po,pu,hu,gu,xu,bu,vu],q2=[Po,mu,bc,wu,uu,yu,du];function tr(){}function wc(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function _u(t){this._context=t}_u.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function B2(t){return new _u(t)}function d8(t){this._context=t}d8.prototype={areaStart:tr,areaEnd:tr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function z2(t){return new d8(t)}function m8(t){this._context=t}m8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Y2(t){return new m8(t)}function g8(t,e){this._basis=new _u(t),this._beta=e}g8.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],o=e[0],i=t[n]-r,s=e[n]-o,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+c*i),this._beta*e[a]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var U2=function t(e){function n(r){return e===1?new _u(r):new g8(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function vc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ug(t,e){this._context=t,this._k=(1-e)/6}ug.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vc(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:vc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var j2=function t(e){function n(r){return new ug(r,e)}return n.tension=function(r){return t(+r)},n}(0);function pg(t,e){this._context=t,this._k=(1-e)/6}pg.prototype={areaStart:tr,areaEnd:tr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var X2=function t(e){function n(r){return new pg(r,e)}return n.tension=function(r){return t(+r)},n}(0);function hg(t,e){this._context=t,this._k=(1-e)/6}hg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var G2=function t(e){function n(r){return new hg(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Mu(t,e,n){var r=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>R2){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>R2){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/l,s=(s*f+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,o,i,s,t._x2,t._y2)}function y8(t,e){this._context=t,this._alpha=e}y8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Mu(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var V2=function t(e){function n(r){return e?new y8(r,e):new ug(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function x8(t,e){this._context=t,this._alpha=e}x8.prototype={areaStart:tr,areaEnd:tr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Mu(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var W2=function t(e){function n(r){return e?new x8(r,e):new pg(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function b8(t,e){this._context=t,this._alpha=e}b8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mu(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var H2=function t(e){function n(r){return e?new b8(r,e):new hg(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function w8(t){this._context=t}w8.prototype={areaStart:tr,areaEnd:tr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Q2(t){return new w8(t)}function v8(t){return t<0?-1:1}function _8(t,e,n){var r=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(r||o<0&&-0),s=(n-t._y1)/(o||r<0&&-0),a=(i*o+s*r)/(r+o);return(v8(i)+v8(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function M8(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Z2(t,e,n){var r=t._x0,o=t._y0,i=t._x1,s=t._y1,a=(i-r)/3;t._context.bezierCurveTo(r+a,o+a*e,i-a,s-a*n,i,s)}function dg(t){this._context=t}dg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Z2(this,this._t0,M8(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Z2(this,M8(this,n=_8(this,t,e)),n);break;default:Z2(this,this._t0,n=_8(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function S8(t){this._context=new A8(t)}(S8.prototype=Object.create(dg.prototype)).point=function(t,e){dg.prototype.point.call(this,e,t)};function A8(t){this._context=t}A8.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,o,i){this._context.bezierCurveTo(e,t,r,n,i,o)}};function K2(t){return new dg(t)}function J2(t){return new S8(t)}function T8(t){this._context=t}T8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=E8(t),o=E8(e),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function E8(t){var e,n=t.length-1,r,o=new Array(n),i=new Array(n),s=new Array(n);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,i[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=o[e]/i[e-1],i[e]-=r,s[e]-=r*s[e-1];for(o[n-1]=s[n-1]/i[n-1],e=n-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function tw(t){return new T8(t)}function mg(t,e){this._context=t,this._t=e}mg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function ew(t){return new mg(t,.5)}function nw(t){return new mg(t,0)}function rw(t){return new mg(t,1)}var Su=t=>()=>t;function ow(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Nn(t,e,n){this.k=t,this.x=e,this.y=n}Nn.prototype={constructor:Nn,scale:function(t){return t===1?this:new Nn(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Nn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Au=new Nn(1,0,0);iw.prototype=Nn.prototype;function iw(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Au;return t.__zoom}function gg(t){t.stopImmediatePropagation()}function _c(t){t.preventDefault(),t.stopImmediatePropagation()}function dD(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function mD(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function I8(){return this.__zoom||Au}function gD(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function yD(){return navigator.maxTouchPoints||"ontouchstart"in this}function xD(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function sw(){var t=dD,e=mD,n=xD,r=gD,o=yD,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Ox,f=vs("start","zoom","end"),l,u,p,h=500,d=150,m=0,g=10;function y(M){M.property("__zoom",I8).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",$).filter(o).on("touchstart.zoom",S).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,I,C,N){var L=M.selection?M.selection():M;L.property("__zoom",I8),M!==L?_(M,I,C,N):L.interrupt().each(function(){v(this,arguments).event(N).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(M,I,C,N){y.scaleTo(M,function(){var L=this.__zoom.k,R=typeof I=="function"?I.apply(this,arguments):I;return L*R},C,N)},y.scaleTo=function(M,I,C,N){y.transform(M,function(){var L=e.apply(this,arguments),R=this.__zoom,D=C==null?b(L):typeof C=="function"?C.apply(this,arguments):C,F=R.invert(D),P=typeof I=="function"?I.apply(this,arguments):I;return n(w(x(R,P),D,F),L,s)},C,N)},y.translateBy=function(M,I,C,N){y.transform(M,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof C=="function"?C.apply(this,arguments):C),e.apply(this,arguments),s)},null,N)},y.translateTo=function(M,I,C,N,L){y.transform(M,function(){var R=e.apply(this,arguments),D=this.__zoom,F=N==null?b(R):typeof N=="function"?N.apply(this,arguments):N;return n(Au.translate(F[0],F[1]).scale(D.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof C=="function"?-C.apply(this,arguments):-C),R,s)},N,L)};function x(M,I){return I=Math.max(i[0],Math.min(i[1],I)),I===M.k?M:new Nn(I,M.x,M.y)}function w(M,I,C){var N=I[0]-C[0]*M.k,L=I[1]-C[1]*M.k;return N===M.x&&L===M.y?M:new Nn(M.k,N,L)}function b(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function _(M,I,C,N){M.on("start.zoom",function(){v(this,arguments).event(N).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(N).end()}).tween("zoom",function(){var L=this,R=arguments,D=v(L,R).event(N),F=e.apply(L,R),P=C==null?b(F):typeof C=="function"?C.apply(L,R):C,V=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),J=L.__zoom,et=typeof I=="function"?I.apply(L,R):I,rt=c(J.invert(P).concat(V/J.k),et.invert(P).concat(V/et.k));return function(j){if(j===1)j=et;else{var nt=rt(j),z=V/nt[2];j=new Nn(z,P[0]-nt[0]*z,P[1]-nt[1]*z)}D.zoom(null,j)}})}function v(M,I,C){return!C&&M.__zooming||new A(M,I)}function A(M,I){this.that=M,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,I),this.taps=0}A.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,I){return this.mouse&&M!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var I=bt(this.that).datum();f.call(M,this.that,new ow(M,{sourceEvent:this.sourceEvent,target:y,type:M,transform:this.that.__zoom,dispatch:f}),I)}};function T(M,...I){if(!t.apply(this,arguments))return;var C=v(this,I).event(M),N=this.__zoom,L=Math.max(i[0],Math.min(i[1],N.k*Math.pow(2,r.apply(this,arguments)))),R=Xe(M);if(C.wheel)(C.mouse[0][0]!==R[0]||C.mouse[0][1]!==R[1])&&(C.mouse[1]=N.invert(C.mouse[0]=R)),clearTimeout(C.wheel);else{if(N.k===L)return;C.mouse=[R,N.invert(R)],Cr(this),C.start()}_c(M),C.wheel=setTimeout(D,d),C.zoom("mouse",n(w(x(N,L),C.mouse[0],C.mouse[1]),C.extent,s));function D(){C.wheel=null,C.end()}}function E(M,...I){if(p||!t.apply(this,arguments))return;var C=M.currentTarget,N=v(this,I,!0).event(M),L=bt(M.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",V,!0),R=Xe(M,C),D=M.clientX,F=M.clientY;el(M.view),gg(M),N.mouse=[R,this.__zoom.invert(R)],Cr(this),N.start();function P(J){if(_c(J),!N.moved){var et=J.clientX-D,rt=J.clientY-F;N.moved=et*et+rt*rt>m}N.event(J).zoom("mouse",n(w(N.that.__zoom,N.mouse[0]=Xe(J,C),N.mouse[1]),N.extent,s))}function V(J){L.on("mousemove.zoom mouseup.zoom",null),nl(J.view,N.moved),_c(J),N.event(J).end()}}function $(M,...I){if(t.apply(this,arguments)){var C=this.__zoom,N=Xe(M.changedTouches?M.changedTouches[0]:M,this),L=C.invert(N),R=C.k*(M.shiftKey?.5:2),D=n(w(x(C,R),N,L),e.apply(this,I),s);_c(M),a>0?bt(this).transition().duration(a).call(_,D,N,M):bt(this).call(y.transform,D,N,M)}}function S(M,...I){if(t.apply(this,arguments)){var C=M.touches,N=C.length,L=v(this,I,M.changedTouches.length===N).event(M),R,D,F,P;for(gg(M),D=0;D<N;++D)F=C[D],P=Xe(F,this),P=[P,this.__zoom.invert(P),F.identifier],L.touch0?!L.touch1&&L.touch0[2]!==P[2]&&(L.touch1=P,L.taps=0):(L.touch0=P,R=!0,L.taps=1+!!l);l&&(l=clearTimeout(l)),R&&(L.taps<2&&(u=P[0],l=setTimeout(function(){l=null},h)),Cr(this),L.start())}}function k(M,...I){if(this.__zooming){var C=v(this,I).event(M),N=M.changedTouches,L=N.length,R,D,F,P;for(_c(M),R=0;R<L;++R)D=N[R],F=Xe(D,this),C.touch0&&C.touch0[2]===D.identifier?C.touch0[0]=F:C.touch1&&C.touch1[2]===D.identifier&&(C.touch1[0]=F);if(D=C.that.__zoom,C.touch1){var V=C.touch0[0],J=C.touch0[1],et=C.touch1[0],rt=C.touch1[1],j=(j=et[0]-V[0])*j+(j=et[1]-V[1])*j,nt=(nt=rt[0]-J[0])*nt+(nt=rt[1]-J[1])*nt;D=x(D,Math.sqrt(j/nt)),F=[(V[0]+et[0])/2,(V[1]+et[1])/2],P=[(J[0]+rt[0])/2,(J[1]+rt[1])/2]}else if(C.touch0)F=C.touch0[0],P=C.touch0[1];else return;C.zoom("touch",n(w(D,F,P),C.extent,s))}}function O(M,...I){if(this.__zooming){var C=v(this,I).event(M),N=M.changedTouches,L=N.length,R,D;for(gg(M),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),R=0;R<L;++R)D=N[R],C.touch0&&C.touch0[2]===D.identifier?delete C.touch0:C.touch1&&C.touch1[2]===D.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(D=Xe(D,this),Math.hypot(u[0]-D[0],u[1]-D[1])<g)){var F=bt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return y.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:Su(+M),y):r},y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Su(!!M),y):t},y.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Su(!!M),y):o},y.extent=function(M){return arguments.length?(e=typeof M=="function"?M:Su([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),y):e},y.scaleExtent=function(M){return arguments.length?(i[0]=+M[0],i[1]=+M[1],y):[i[0],i[1]]},y.translateExtent=function(M){return arguments.length?(s[0][0]=+M[0][0],s[1][0]=+M[1][0],s[0][1]=+M[0][1],s[1][1]=+M[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(M){return arguments.length?(n=M,y):n},y.duration=function(M){return arguments.length?(a=+M,y):a},y.interpolate=function(M){return arguments.length?(c=M,y):c},y.on=function(){var M=f.on.apply(f,arguments);return M===f?y:M},y.clickDistance=function(M){return arguments.length?(m=(M=+M)*M,y):Math.sqrt(m)},y.tapDistance=function(M){return arguments.length?(g=+M,y):g},y}function Ht(t){return t!=null&&!Number.isNaN(t)}function Te(t,e){return+Ht(e)-+Ht(t)||ht(t,e)}function Ws(t,e){return+Ht(e)-+Ht(t)||en(t,e)}function Eu(t){return t!=null&&`${t}`!=""}function Mc(t){return isFinite(t)?t:NaN}function dn(t){return t>0&&isFinite(t)?t:NaN}function $i(t){return t<0&&isFinite(t)?t:NaN}function yg(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return typeof e=="function"?e(t):e;let n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return`${bD(t.getUTCFullYear(),4)}-${qo(t.getUTCMonth()+1,2)}-${qo(t.getUTCDate(),2)}${n||r||o||i?`T${qo(n,2)}:${qo(r,2)}${o||i?`:${qo(o,2)}${i?`.${qo(i,3)}`:""}`:""}Z`:""}`}function bD(t){return t<0?`-${qo(-t,6)}`:t>9999?`+${qo(t,6)}`:qo(t,4)}function qo(t,e){return`${t}`.padStart(e,"0")}var wD=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function Tu(t,e){return wD.test(t+="")?new Date(t):typeof e=="function"?e(t):e}function Bo(t){if(t==null)return;let e=t[0],n=t[t.length-1];return en(e,n)}var Ac=1e3,ki=Ac*60,Ni=ki*60,jr=Ni*24,Ur=jr*7,Hs=jr*30,Ci=jr*365,aw=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",Ac],["5 seconds",5*Ac],["15 seconds",15*Ac],["30 seconds",30*Ac],["minute",ki],["5 minutes",5*ki],["15 minutes",15*ki],["30 minutes",30*ki],["hour",Ni],["3 hours",3*Ni],["6 hours",6*Ni],["12 hours",12*Ni],["day",jr],["2 days",2*jr],["week",Ur],["2 weeks",2*Ur],["month",Hs],["3 months",3*Hs],["6 months",6*Hs],["year",Ci],["2 years",2*Ci],["5 years",5*Ci],["10 years",10*Ci],["20 years",20*Ci],["50 years",50*Ci],["100 years",100*Ci]],cw=new Map([["second",Ac],["minute",ki],["hour",Ni],["day",jr],["monday",Ur],["tuesday",Ur],["wednesday",Ur],["thursday",Ur],["friday",Ur],["saturday",Ur],["sunday",Ur],["week",Ur],["month",Hs],["year",Ci]]),C8=new Map([["second",Ae],["minute",ko],["hour",Oo],["day",Zn],["monday",Ti],["tuesday",Rm],["wednesday",Lm],["thursday",Br],["friday",Dm],["saturday",Fm],["sunday",Cn],["week",Cn],["month",Lo],["year",Qe]]),fw=new Map([["second",Ae],["minute",No],["hour",Ro],["day",js],["monday",Ii],["tuesday",Pm],["wednesday",qm],["thursday",zr],["friday",Bm],["saturday",zm],["sunday",kn],["week",kn],["month",Do],["year",Ze]]),Ec=Symbol("intervalDuration"),bg=Symbol("intervalType");for(let[t,e]of C8)e[Ec]=cw.get(t),e[bg]="time";for(let[t,e]of fw)e[Ec]=cw.get(t),e[bg]="utc";var Iu=[["year",Ze,"utc"],["month",Do,"utc"],["day",js,"utc",6*Hs],["hour",Ro,"utc",3*jr],["minute",No,"utc",6*Ni],["second",Ae,"utc",30*ki]],xg=[["year",Qe,"time"],["month",Lo,"time"],["day",Zn,"time",6*Hs],["hour",Oo,"time",3*jr],["minute",ko,"time",6*Ni],["second",Ae,"time",30*ki]],vD=[Iu[0],xg[0],Iu[1],xg[1],Iu[2],xg[2],...Iu.slice(3)];function wg(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(e);switch(r&&(e=e.slice(r[0].length),n=+r[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6;break}let o=fw.get(e);if(!o)throw new Error(`unknown interval: ${t}`);if(n>1&&!o.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function $u(t){return k8(wg(t),"time")}function Qs(t){return k8(wg(t),"utc")}function k8([t,e],n){let r=(n==="time"?C8:fw).get(t);return e>1&&(r=r.every(e),r[Ec]=cw.get(t)*e,r[bg]=n),r}function lw(t,e){if(!(e>1))return;let n=t[Ec];if(!aw.some(([,o])=>o===n)||n%jr===0&&jr<n&&n<Hs)return;let[r]=aw[fr(([,o])=>Math.log(o)).center(aw,Math.log(n*e))];return(t[bg]==="time"?$u:Qs)(r)}function $8(t,e,n){let r=e==="time"?hc:Yr;if(n==null)return r(t==="year"?"%Y":t==="month"?"%Y-%m":t==="day"?"%Y-%m-%d":t==="hour"||t==="minute"?"%Y-%m-%dT%H:%M":t==="second"?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");let o=_D(n);switch(t){case"millisecond":return Sc(r(".%L"),r(":%M:%S"),o);case"second":return Sc(r(":%S"),r("%-I:%M"),o);case"minute":return Sc(r("%-I:%M"),r("%p"),o);case"hour":return Sc(r("%-I %p"),r("%b %-d"),o);case"day":return Sc(r("%-d"),r("%b"),o);case"month":return Sc(r("%b"),r("%Y"),o);case"year":return r("%Y")}throw new Error("unable to format time ticks")}function _D(t){return t==="left"||t==="right"?(e,n)=>`
|
|
3
|
+
${e}
|
|
4
|
+
${n}`:t==="top"?(e,n)=>`${n}
|
|
5
|
+
${e}`:(e,n)=>`${e}
|
|
6
|
+
${n}`}function MD(t){return t==="time"?xg:t==="utc"?Iu:vD}function N8(t,e,n){let r=Tt(hd(e,(o,i)=>Math.abs(i-o)));if(r<1e3)return $8("millisecond","utc",n);for(let[o,i,s,a]of MD(t)){if(r>a||o==="hour"&&!r)break;if(e.every(c=>i.floor(c)>=c))return $8(o,s,n)}}function Sc(t,e,n){return(r,o,i)=>{let s=t(r,o),a=e(r,o),c=o-Bo(i);return o!==c&&i[c]!==void 0&&a===e(i[c],c)?s:n(s,a)}}var Cu=Object.getPrototypeOf(Uint8Array),SD=Object.prototype.toString;function vn(t){return t instanceof Array||t instanceof Cu}function R8(t){return t instanceof Cu&&!AD(t)}function L8(t){return t?.prototype instanceof Cu&&!ED(t)}function AD(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}function ED(t){return t===BigInt64Array||t===BigUint64Array}var pw=Symbol("reindex");function ft(t,e,n){let r=typeof e;return r==="string"?V8(t)?hw(t.getChild(e),n):O8(t,dw(e),n):r==="function"?O8(t,e,n):r==="number"||e instanceof Date||r==="boolean"?Mt(t,te(e),n):typeof e?.transform=="function"?uw(e.transform(t),n):TD(uw(e,n),t?.[pw])}function TD(t,e){return t!=null&&e?Nu(t,e):t}function O8(t,e,n){return Mt(t,L8(n)?(r,o)=>mw(e(r,o)):e,n)}function uw(t,e){return e===void 0?On(t):W8(t)?hw(t,e):t instanceof e?t:e.from(t,L8(e)&&!R8(t)?mw:void 0)}function hw(t,e){return t==null?t:(e===void 0||e===Array)&&CD(t.type)?gw(t.toArray()):uw(t.toArray(),e)}var Oi=[null],dw=t=>e=>{let n=e[t];return n===void 0&&e.type==="Feature"?e.properties?.[t]:n},Yt={transform:mn},G={transform:t=>t};var ku=()=>1,D8=()=>!0,se=t=>t==null?t:`${t}`,Ct=t=>t==null?t:+t;var Zs=t=>t?t[0]:void 0,Ri=t=>t?t[1]:void 0,F8=t=>t?t[2]:void 0,te=t=>()=>t;function Tc(t){let e=+`${t}`.slice(1)/100;return(n,r)=>on(n,e,r)}function de(t){return R8(t)?t:Mt(t,mw,Float64Array)}function mw(t){return t==null?NaN:Number(t)}function gw(t){return Mt(t,yw)}function yw(t){return t instanceof Date&&!isNaN(t)?t:typeof t=="string"?Tu(t):t==null||isNaN(t=Number(t))?void 0:new Date(t)}function Kt(t,e){return t===void 0&&(t=e),t===null?[void 0,"none"]:Pi(t)?[void 0,t]:[t,void 0]}function Lt(t,e){return t===void 0&&(t=e),t===null||typeof t=="number"?[void 0,t]:[t,void 0]}function xw(t,e,n){if(t!=null)return be(t,e,n)}function be(t,e,n){let r=`${t}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${e}: ${t}`);return r}function zo(t){return V8(t)?t:On(t)}function On(t){if(t==null||vn(t))return t;if(W8(t))return hw(t);switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return[t]}return Array.from(t)}function Mt(t,e,n=Array){return t==null?t:t instanceof n?t.map(e):n.from(t,e)}function Li(t,e=Array){return t instanceof e?t.slice():e.from(t)}function bw({x:t,x1:e,x2:n}){return t!==void 0||e!==void 0||n!==void 0}function ww({y:t,y1:e,y2:n}){return t!==void 0||e!==void 0||n!==void 0}function Yo(t){return bw(t)||ww(t)||t.interval!==void 0}function Ie(t){return t?.toString===SD}function Xr(t){return Ie(t)&&(t.type!==void 0||t.domain!==void 0)}function Rn(t){return Ie(t)&&typeof t.transform!="function"}function Gr(t){return Rn(t)&&t.value===void 0&&t.channel===void 0}function vw(t,e,n,r=G){return e===void 0&&n===void 0?(e=0,n=t===void 0?r:t):e===void 0?e=t===void 0?0:t:n===void 0&&(n=t===void 0?0:t),[e,n]}function oe(t,e){return t===void 0&&e===void 0?[Zs,Ri]:[t,e]}function Ke({z:t,fill:e,stroke:n}={}){return t===void 0&&([t]=Kt(e)),t===void 0&&([t]=Kt(n)),t}function Di(t){return vn(t)?t.length:t?.numRows}function mn(t){let e=Di(t),n=new Uint32Array(e);for(let r=0;r<e;++r)n[r]=r;return n}function Nu(t,e){return vn(t)?Mt(e,n=>t[n],t.constructor):Mt(e,n=>t.at(n))}function Ic(t){return t.length===1?(e,n)=>t(Nu(n,e)):t}function Uo(t,e,n){return t.subarray?t.subarray(e,n):t.slice(e,n)}function er(t){return t!==null&&typeof t=="object"?t.valueOf():t}function vg(t,e){if(e[t]!==void 0)return e[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y";break}return e[t]}function $e(t){let e;return[{transform:()=>e,label:Ye(t)},n=>e=n]}function ze(t){return t==null?[t]:$e(t)}function Ye(t,e){return typeof t=="string"?t:t&&t.label!==void 0?t.label:e}function $c(t,e){return{transform(n){let r=t.transform(n),o=e.transform(n);return Jt(r)||Jt(o)?Mt(r,(i,s)=>new Date((+r[s]+ +o[s])/2)):Mt(r,(i,s)=>(+r[s]+ +o[s])/2,Float64Array)},label:t.label}}function Ks(t,e){let n=_w(e?.interval,e?.type);return n?Mt(t,n):t}function _w(t,e){let n=Cc(t,e);return n&&(r=>Ht(r)?n.floor(r):r)}function Cc(t,e){if(t!=null){if(typeof t=="number")return Mw(t);if(typeof t=="string")return(e==="time"?$u:Qs)(t);if(typeof t.floor!="function")throw new Error("invalid interval; missing floor method");if(typeof t.offset!="function")throw new Error("invalid interval; missing offset method");return t}}function Mw(t){t=+t,0<t&&t<1&&Number.isInteger(1/t)&&(t=-1/t);let e=Math.abs(t);return t<0?{floor:n=>Math.floor(n*e)/e,offset:(n,r=1)=>(n*e+Math.floor(r))/e,range:(n,r)=>ie(Math.ceil(n*e),r*e).map(o=>o/e)}:{floor:n=>Math.floor(n/e)*e,offset:(n,r=1)=>n+e*Math.floor(r),range:(n,r)=>ie(Math.ceil(n/e),r/e).map(o=>o*e)}}function Vr(t,e){if(t=Cc(t,e),t&&typeof t.range!="function")throw new Error("invalid interval: missing range method");return t}function P8(t,e){if(t=Vr(t,e),t&&typeof t.ceil!="function")throw new Error("invalid interval: missing ceil method");return t}function q8(t){return Fi(t)&&typeof t?.floor=="function"&&t.floor()instanceof Date}function Fi(t){return typeof t?.range=="function"}function nr(t){return t===void 0||Rn(t)?t:{value:t}}function B8(t){return t==null?null:{transform:e=>ft(e,t,Float64Array),label:Ye(t)}}function z8(t){if(!gn(t))return!1;for(let e of t)if(e!=null)return typeof e=="object"&&"0"in e&&"1"in e}function gn(t){return t&&typeof t[Symbol.iterator]=="function"}function _g(t){for(let e of t)if(e!=null)return typeof e!="object"||e instanceof Date}function Qt(t){for(let e of t){if(e==null)continue;let n=typeof e;return n==="string"||n==="boolean"}}function Jt(t){for(let e of t)if(e!=null)return e instanceof Date}function Y8(t){for(let e of t)if(e!=null)return typeof e=="string"&&isNaN(e)&&Tu(e)}function U8(t){for(let e of t)if(e!=null){if(typeof e!="string")return!1;if(e.trim())return!isNaN(e)}}function jo(t){for(let e of t)if(e!=null)return typeof e=="number"}function Mg(t,e){let n;for(let r of t)if(r!=null){if(!e(r))return!1;n=!0}return n}var ID=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function Pi(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(t)||ID.has(t))}function j8(t){return typeof t=="number"&&(0<=t&&t<=1||isNaN(t))}function Rt(t){return t==null||Xo(t)}function Xo(t){return/^\s*none\s*$/i.test(t)}function X8(t){return/^\s*round\s*$/i.test(t)}function Sg(t,e){return xw(t,e,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function Wr(t="middle"){return Sg(t,"frameAnchor")}function G8(t={},...e){let n=t;for(let r of e)for(let o in r)if(n[o]===void 0){let i=r[o];n===t?n={...n,[o]:i}:n[o]=i}return n}function $D(t){console.warn("named iterables are deprecated; please use an object instead");let e=new Set;return Object.fromEntries(Array.from(t,n=>{let{name:r}=n;if(r==null)throw new Error("missing name");let o=`${r}`;if(o==="__proto__")throw new Error(`illegal name: ${o}`);if(e.has(o))throw new Error(`duplicate name: ${o}`);return e.add(o),[r,n]}))}function Ou(t){return gn(t)?$D(t):t}function Ag(t){return t===!0?t="frame":t===!1?t=null:t!=null&&(t=be(t,"clip",["frame","sphere"])),t}function V8(t){return t&&typeof t.getChild=="function"&&typeof t.toArray=="function"&&t.schema&&Array.isArray(t.schema.fields)}function W8(t){return t&&typeof t.toArray=="function"&&t.type}function CD(t){return t&&(t.typeId===8||t.typeId===10)&&t.unit===1}var rr=Symbol("position"),Ln=Symbol("color"),Js=Symbol("radius"),ta=Symbol("length"),ea=Symbol("opacity"),kc=Symbol("symbol"),H8=Symbol("projection"),qt=new Map([["x",rr],["y",rr],["fx",rr],["fy",rr],["r",Js],["color",Ln],["opacity",ea],["symbol",kc],["length",ta],["projection",H8]]);function Q8(t){return t===rr||t===H8}function Z8(t){return t===rr||t===Js||t===ta||t===ea}var Sw=Math.sqrt(3),Aw=2/Sw,kD={draw(t,e){let n=Math.sqrt(e/Math.PI),r=n*Aw,o=r/2;t.moveTo(0,r),t.lineTo(n,o),t.lineTo(n,-o),t.lineTo(0,-r),t.lineTo(-n,-o),t.lineTo(-n,o),t.closePath()}},Ew=new Map([["asterisk",uu],["circle",Po],["cross",pu],["diamond",hu],["diamond2",du],["hexagon",kD],["plus",mu],["square",gu],["square2",yu],["star",xu],["times",bc],["triangle",bu],["triangle2",wu],["wye",vu]]);function Tw(t){return t&&typeof t.draw=="function"}function K8(t){return Tw(t)?!0:typeof t!="string"?!1:Ew.has(t.toLowerCase())}function Nc(t){if(t==null||Tw(t))return t;let e=Ew.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid symbol: ${t}`)}function J8(t){if(t==null||Tw(t))return[void 0,t];if(typeof t=="string"){let e=Ew.get(`${t}`.toLowerCase());if(e)return[void 0,e]}return[t,void 0]}function me({filter:t,sort:e,reverse:n,transform:r,initializer:o,...i}={},s){if(r===void 0&&(t!=null&&(r=Cw(t)),e!=null&&!Gr(e)&&(r=Iw(r,Nw(e))),n&&(r=Iw(r,kw))),s!=null&&o!=null)throw new Error("transforms cannot be applied after initializers");return{...i,...(e===null||Gr(e))&&{sort:e},transform:Iw(r,s)}}function jt({filter:t,sort:e,reverse:n,initializer:r,...o}={},i){return r===void 0&&(t!=null&&(r=Cw(t)),e!=null&&!Gr(e)&&(r=$w(r,Nw(e))),n&&(r=$w(r,kw))),{...o,...(e===null||Gr(e))&&{sort:e},initializer:$w(r,i)}}function Iw(t,e){return t==null?e===null?void 0:e:e==null?t===null?void 0:t:function(n,r,o){return{data:n,facets:r}=t.call(this,n,r,o),e.call(this,zo(n),r,o)}}function $w(t,e){return t==null?e===null?void 0:e:e==null?t===null?void 0:t:function(n,r,o,...i){let s,a,c,f,l,u;return{data:a=n,facets:c=r,channels:s}=t.call(this,n,r,o,...i),{data:l=a,facets:u=c,channels:f}=e.call(this,a,c,{...o,...s},...i),{data:l,facets:u,channels:{...s,...f}}}}function Eg(t,e){return(t.initializer!=null?jt:me)(t,e)}function tS(t,e){return Eg(e,Cw(t))}function Cw(t){return(e,n)=>{let r=ft(e,t);return{data:e,facets:n.map(o=>o.filter(i=>r[i]))}}}function eS({sort:t,...e}={}){return{...Eg(e,kw),sort:Gr(t)?t:null}}function kw(t,e){return{data:t,facets:e.map(n=>n.slice().reverse())}}function nS({seed:t,sort:e,...n}={}){return{...Eg(n,rS(t==null?Math.random:Ps(t))),sort:Gr(e)?e:null}}function Tg(t,{sort:e,...n}={}){return{...(Rn(t)&&t.channel!==void 0?jt:Eg)(n,Nw(t)),sort:Gr(e)?e:null}}function Nw(t){return(typeof t=="function"&&t.length!==1?ND:rS)(t)}function ND(t){return(e,n)=>{let r=vn(e)?(o,i)=>t(e[o],e[i]):(o,i)=>t(e.get(o),e.get(i));return{data:e,facets:n.map(o=>o.slice().sort(r))}}}function rS(t){let e,n;({channel:e,value:t,order:n}={...nr(t)});let r=e?.startsWith("-");if(r&&(e=e.slice(1)),n===void 0&&(n=r?Ws:Te),typeof n!="function")switch(`${n}`.toLowerCase()){case"ascending":n=Te;break;case"descending":n=Ws;break;default:throw new Error(`invalid order: ${n}`)}return(o,i,s)=>{let a;if(e===void 0)a=ft(o,t);else{if(s===void 0)throw new Error("channel sort requires an initializer");if(a=s[e],!a)return{};a=a.value}let c=(f,l)=>n(a[f],a[l]);return{data:o,facets:i.map(f=>f.slice().sort(c))}}}function Lu(t,e){return Ig(null,null,t,e)}function qi(t={y:"count"},e={}){let{x:n=G}=e;if(n==null)throw new Error("missing channel: x");return Ig(n,null,t,e)}function Bi(t={x:"count"},e={}){let{y:n=G}=e;if(n==null)throw new Error("missing channel: y");return Ig(null,n,t,e)}function Du(t={fill:"count"},e={}){let{x:n,y:r}=e;if([n,r]=oe(n,r),n==null)throw new Error("missing channel: x");if(r==null)throw new Error("missing channel: y");return Ig(n,r,t,e)}function Ig(t,e,{data:n=kg,filter:r,sort:o,reverse:i,...s}={},a={}){s=Rw(s,a),n=cS(n,G),o=o==null?void 0:sS("sort",o,a),r=r==null?void 0:aS("filter",r,a);let[c,f]=ze(t),[l,u]=ze(e),{z:p,fill:h,stroke:d,x1:m,x2:g,y1:y,y2:x,...w}=a,[b,_]=ze(p),[v]=Kt(h),[A]=Kt(d),[T,E]=ze(v),[$,S]=ze(A);return{..."z"in a&&{z:b||p},..."fill"in a&&{fill:T||h},..."stroke"in a&&{stroke:$||d},...me(w,(k,O,M)=>{let I=Ks(ft(k,t),M?.x),C=Ks(ft(k,e),M?.y),N=ft(k,p),L=ft(k,v),R=ft(k,A),D=Fu(s,{z:N,fill:L,stroke:R}),F=[],P=[],V=I&&f([]),J=C&&u([]),et=N&&_([]),rt=L&&E([]),j=R&&S([]),nt=0;for(let z of s)z.initialize(k);o&&o.initialize(k),r&&r.initialize(k);for(let z of O){let W=[];for(let tt of s)tt.scope("facet",z);o&&o.scope("facet",z),r&&r.scope("facet",z);for(let[tt,q]of Hr(z,D))for(let[gt,at]of Hr(q,C))for(let[At,It]of Hr(at,I)){let Z={data:k};if(I&&(Z.x=At),C&&(Z.y=gt),D&&(Z.z=tt),!(r&&!r.reduce(It,Z))){W.push(nt++),P.push(n.reduceIndex(It,k,Z)),I&&V.push(At),C&&J.push(gt),N&&et.push(D===N?tt:N[It[0]]),L&&rt.push(D===L?tt:L[It[0]]),R&&j.push(D===R?tt:R[It[0]]);for(let Dt of s)Dt.reduce(It,Z);o&&o.reduce(It,Z)}}F.push(W)}return Lw(F,o,i),{data:P,facets:F}}),...!Qr(s,"x")&&(c?{x:c}:{x1:m,x2:g}),...!Qr(s,"y")&&(l?{y:l}:{y1:y,y2:x}),...Object.fromEntries(s.map(({name:k,output:O})=>[k,O]))}}function Qr(t,...e){for(let{name:n}of t)if(e.includes(n))return!0;return!1}function Ow(t,e,n=$g){let r=Object.entries(t);return e.title!=null&&t.title===void 0&&r.push(["title",PD]),e.href!=null&&t.href===void 0&&r.push(["href",Ng]),r.filter(([,o])=>o!==void 0).map(([o,i])=>i===null?OD(o):n(o,i,e))}function $g(t,e,n,r=Cg){let o;Ie(e)&&"reduce"in e&&(o=e.scale,e=e.reduce);let i=r(t,e,n),[s,a]=$e(i.label),c;return{name:t,output:o===void 0?s:{value:s,scale:o},initialize(f){i.initialize(f),c=a([])},scope(f,l){i.scope(f,l)},reduce(f,l){c.push(i.reduce(f,l))}}}function OD(t){return{name:t,initialize(){},scope(){},reduce(){}}}function Cg(t,e,n,r=Oc){let o=vg(t,n),i=r(e,o),s,a;return{label:Ye(i===Ru?null:o,i.label),initialize(c){s=o===void 0?c:ft(c,o),i.scope==="data"&&(a=i.reduceIndex(mn(c),s))},scope(c,f){i.scope===c&&(a=i.reduceIndex(f,s))},reduce(c,f){return i.scope==null?i.reduceIndex(c,s,f):i.reduceIndex(c,s,a,f)}}}function Hr(t,e){return e?De(t,n=>e[n]):[[,t]]}function Oc(t,e,n=RD){if(t==null)return n(t);if(typeof t.reduceIndex=="function")return t;if(typeof t.reduce=="function"&&Ie(t))return DD(t);if(typeof t=="function")return FD(t);if(/^p\d{2}$/i.test(t))return Go(Tc(t));switch(`${t}`.toLowerCase()){case"first":return Ng;case"last":return qD;case"identity":return kg;case"count":return Ru;case"distinct":return BD;case"sum":return e==null?Ru:zD;case"proportion":return iS(e,"data");case"proportion-facet":return iS(e,"facet");case"deviation":return Go(Xn);case"min":return Go(Ft);case"min-index":return Go(ld);case"max":return Go(Tt);case"max-index":return Go(fd);case"mean":return oS(wo);case"median":return oS(ur);case"variance":return Go(hi);case"mode":return Go(Fa)}return n(t)}function RD(t){throw new Error(`invalid reduce: ${t}`)}function Rw(t,e){return Ow(t,e,sS)}function sS(t,e,n){return $g(t,e,n,aS)}function aS(t,e,n){return Cg(t,e,n,cS)}function cS(t,e){return Oc(t,e,LD)}function LD(t){switch(`${t}`.toLowerCase()){case"x":return YD;case"y":return UD;case"z":return Dw}throw new Error(`invalid group reduce: ${t}`)}function Fu(t,e){for(let n in e){let r=e[n];if(r!==void 0&&!t.some(o=>o.name===n))return r}}function Lw(t,e,n){if(e){let r=e.output.transform(),o=(i,s)=>Te(r[i],r[s]);t.forEach(i=>i.sort(o))}n&&t.forEach(r=>r.reverse())}function DD(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}function FD(t){return{reduceIndex(e,n,r){return t(Nu(n,e),r)}}}function Go(t){return{reduceIndex(e,n){return t(e,r=>n[r])}}}function oS(t){return{reduceIndex(e,n){let r=t(e,o=>n[o]);return Jt(n)?new Date(r):r}}}var kg={reduceIndex(t,e){return Nu(e,t)}},Ng={reduceIndex(t,e){return e[t[0]]}},PD={reduceIndex(t,e){let r=xo(lr(t,i=>i.length,i=>e[i]),Ri),o=r.slice(-5).reverse();if(o.length<r.length){let i=r.slice(0,-4);o[4]=[`\u2026 ${i.length.toLocaleString("en-US")} more`,Pe(i,Ri)]}return o.map(([i,s])=>`${i} (${s.toLocaleString("en-US")})`).join(`
|
|
7
|
+
`)}},qD={reduceIndex(t,e){return e[t[t.length-1]]}},Ru={label:"Frequency",reduceIndex(t){return t.length}},BD={label:"Distinct",reduceIndex(t,e){let n=new rn;for(let r of t)n.add(e[r]);return n.size}},zD=Go(Pe);function iS(t,e){return t==null?{scope:e,label:"Frequency",reduceIndex:(n,r,o=1)=>n.length/o}:{scope:e,reduceIndex:(n,r,o=1)=>Pe(n,i=>r[i])/o}}var YD={reduceIndex(t,e,{x:n}){return n}},UD={reduceIndex(t,e,{y:n}){return n}},Dw={reduceIndex(t,e,{z:n}){return n}};function fS(t){if(typeof t!="function")throw new Error(`invalid test function: ${t}`);return{reduceIndex(e,n,{data:r}){return n[e.find(vn(r)?o=>t(r[o],o,r):o=>t(r.get(o),o,r))]}}}function Rc(t,{scale:e,type:n,value:r,filter:o,hint:i,label:s=Ye(r)},a){return i===void 0&&typeof r?.transform=="function"&&(i=r.hint),Pw(a,{scale:e,type:n,value:ft(t,r),label:s,filter:o,hint:i})}function Og(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,Rc(e,r,n)]))}function Lc(t,e){let n=Object.fromEntries(Object.entries(t).map(([r,{scale:o,value:i}])=>{let s=o==null?null:e[o];return[r,s==null?i:Mt(i,s)]}));return n.channels=t,n}function Pw(t,e){let{scale:n,value:r}=e;if(n===!0||n==="auto")switch(t){case"fill":case"stroke":case"color":e.scale=n!==!0&&Mg(r,Pi)?null:"color",e.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":e.scale=n!==!0&&Mg(r,j8)?null:"opacity",e.defaultScale="opacity";break;case"symbol":n!==!0&&Mg(r,K8)?(e.scale=null,e.value=Mt(r,Nc)):e.scale="symbol",e.defaultScale="symbol";break;default:e.scale=qt.has(t)?t:null;break}else if(n===!1)e.scale=null;else if(n!=null&&!qt.has(n))throw new Error(`unknown scale: ${n}`);return e}function uS(t,e,n,r,o){let{order:i,reverse:s,reduce:a=!0,limit:c}=o;for(let f in o){if(!qt.has(f))continue;let{value:l,order:u=i,reverse:p=s,reduce:h=a,limit:d=c}=nr(o[f]),m=l?.startsWith("-");if(m&&(l=l.slice(1)),u=u===void 0?m!==(l==="width"||l==="height")?hS:pS:GD(u),h==null||h===!1)continue;let g=f==="fx"||f==="fy"?XD(e,r[f]):jD(n,f);if(!g)throw new Error(`missing channel for scale: ${f}`);let y=g.value,[x=0,w=1/0]=gn(d)?d:d<0?[d]:[0,d];if(l==null)g.domain=()=>{let b=Array.from(new rn(y));return p&&(b=b.reverse()),(x!==0||w!==1/0)&&(b=b.slice(x,w)),b};else{let b=l==="data"?t:l==="height"?lS(n,"y1","y2"):l==="width"?lS(n,"x1","x2"):Fw(n,l,l==="y"?"y2":l==="x"?"x2":void 0),_=Oc(h===!0?"max":h,b);g.domain=()=>{let v=cx(mn(y),A=>_.reduceIndex(A,b),A=>y[A]);return u&&v.sort(u),p&&v.reverse(),(x!==0||w!==1/0)&&(v=v.slice(x,w)),v.map(Zs)}}}}function jD(t,e){for(let n in t){let r=t[n];if(r.scale===e)return r}}function XD(t,e){let n=t.original;if(n===t)return e;let r=e.value,o=e.value=[];for(let i=0;i<n.length;++i){let s=r[n[i][0]];for(let a of t[i])o[a]=s}return e}function lS(t,e,n){let r=Fw(t,e),o=Fw(t,n);return Mt(o,(i,s)=>Math.abs(i-r[s]),Float64Array)}function Fw(t,e,n){let r=t[e];if(!r&&n!==void 0&&(r=t[n]),r)return r.value;throw new Error(`missing channel: ${e}`)}function GD(t){if(t==null||typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"ascending":return pS;case"descending":return hS}throw new Error(`invalid order: ${t}`)}function pS([t,e],[n,r]){return Te(e,r)||Te(t,n)}function hS([t,e],[n,r]){return Ws(e,r)||Te(t,n)}function Pu(t,e){let n=t[e];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}var xS=new Map([["accent",M2],["category10",_2],["dark2",S2],["observable10",A2],["paired",E2],["pastel1",T2],["pastel2",I2],["set1",$2],["set2",C2],["set3",k2],["tableau10",N2]]);function bS(t){return t!=null&&xS.has(`${t}`.toLowerCase())}var dS=new Map([...xS,["brbg",Vo(Hm,Qm)],["prgn",Vo(Zm,Km)],["piyg",Vo(Jm,t0)],["puor",Vo(e0,n0)],["rdbu",Vo(au,dc)],["rdgy",Vo(r0,o0)],["rdylbu",Vo(cu,mc)],["rdylgn",Vo(i0,s0)],["spectral",Vo(a0,c0)],["burd",mS(au,dc)],["buylrd",mS(cu,mc)],["blues",Ce(O0,R0)],["greens",Ce(L0,D0)],["greys",Ce(F0,P0)],["oranges",Ce(U0,j0)],["purples",Ce(q0,B0)],["reds",Ce(z0,Y0)],["turbo",Wo(J0)],["viridis",Wo(eg)],["magma",Wo(ng)],["inferno",Wo(rg)],["plasma",Wo(og)],["cividis",Wo(X0)],["cubehelix",Wo(G0)],["warm",Wo(W0)],["cool",Wo(H0)],["bugn",Ce(f0,l0)],["bupu",Ce(u0,p0)],["gnbu",Ce(h0,d0)],["orrd",Ce(m0,g0)],["pubu",Ce(b0,w0)],["pubugn",Ce(y0,x0)],["purd",Ce(v0,_0)],["rdpu",Ce(M0,S0)],["ylgn",Ce(T0,I0)],["ylgnbu",Ce(A0,E0)],["ylorbr",Ce($0,C0)],["ylorrd",Ce(k0,N0)],["rainbow",gS(Q0)],["sinebow",gS(K0)]]);function Ce(t,e){return({length:n})=>n===1?[t[3][1]]:n===2?[t[3][1],t[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?Ge(e,n):t[n])}function Vo(t,e){return({length:n})=>n===2?[t[3][0],t[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?Ge(e,n):t[n])}function mS(t,e){return({length:n})=>n===2?[t[3][2],t[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?Ge(r=>e(1-r),n):t[n].slice().reverse())}function Wo(t){return({length:e})=>Ge(t,Math.max(2,Math.floor(e)))}function gS(t){return({length:e})=>Ge(t,Math.floor(e)+1).slice(0,-1)}function qw(t){let e=`${t}`.toLowerCase();if(!dS.has(e))throw new Error(`unknown ordinal scheme: ${e}`);return dS.get(e)}function qu(t,e){let n=qw(t),r=typeof n=="function"?n({length:e}):n;return r.length!==e?r.slice(0,e):r}function wS(t,e="greys"){let n=new Set,[r,o]=qu(e,2);for(let i of t)if(i!=null)if(i===!0)n.add(o);else if(i===!1)n.add(r);else return;return[...n]}var yS=new Map([["brbg",Qm],["prgn",Km],["piyg",t0],["puor",n0],["rdbu",dc],["rdgy",o0],["rdylbu",mc],["rdylgn",s0],["spectral",c0],["burd",t=>dc(1-t)],["buylrd",t=>mc(1-t)],["blues",R0],["greens",D0],["greys",P0],["purples",B0],["reds",Y0],["oranges",j0],["turbo",J0],["viridis",eg],["magma",ng],["inferno",rg],["plasma",og],["cividis",X0],["cubehelix",G0],["warm",W0],["cool",H0],["bugn",l0],["bupu",p0],["gnbu",d0],["orrd",g0],["pubugn",x0],["pubu",w0],["purd",_0],["rdpu",S0],["ylgnbu",E0],["ylgn",I0],["ylorbr",C0],["ylorrd",N0],["rainbow",Q0],["sinebow",K0]]);function Dc(t){let e=`${t}`.toLowerCase();if(!yS.has(e))throw new Error(`unknown quantitative scheme: ${e}`);return yS.get(e)}var VD=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);function vS(t){return t!=null&&VD.has(`${t}`.toLowerCase())}var zw=t=>e=>t(1-e),Bw=[0,1],_S=new Map([["number",Gt],["rgb",Gn],["hsl",Rx],["hcl",Lx],["lab",Nd]]);function Yw(t){let e=`${t}`.toLowerCase();if(!_S.has(e))throw new Error(`unknown interpolator: ${e}`);return _S.get(e)}function Pc(t,e,n,{type:r,nice:o,clamp:i,zero:s,domain:a=CS(t,n),unknown:c,round:f,scheme:l,interval:u,range:p=qt.get(t)===Js?ZD(n,a):qt.get(t)===ta?KD(n,a):qt.get(t)===ea?Bw:void 0,interpolate:h=qt.get(t)===Ln?l==null&&p!==void 0?Gn:Dc(l!==void 0?l:r==="cyclical"?"rainbow":"turbo"):f?Ts:Gt,reverse:d}){if(u=Vr(u,r),(r==="cyclical"||r==="sequential")&&(r="linear"),typeof h!="function"&&(h=Yw(h)),d=!!d,p!==void 0){let m=(a=On(a)).length,g=(p=On(p)).length;if(m!==g){if(h.length===1)throw new Error("invalid piecewise interpolator");h=$r(h,p),p=void 0}}if(h.length===1?(d&&(h=zw(h),d=!1),p===void 0&&(p=Float64Array.from(a,(m,g)=>g/(a.length-1)),p.length===2&&(p=Bw)),e.interpolate((p===Bw?te:Bu)(h))):e.interpolate(h),s){let[m,g]=kt(a);(m>0||g<0)&&(a=Li(a),(Bo(a)||1)===Math.sign(m)?a[0]=0:a[a.length-1]=0)}return d&&(a=mi(a)),e.domain(a).unknown(c),o&&(e.nice(WD(o,r)),a=e.domain()),p!==void 0&&e.range(p),i&&e.clamp(i),{type:r,domain:a,range:p,scale:e,interpolate:h,interval:u}}function WD(t,e){return t===!0?void 0:typeof t=="number"?t:P8(t,e)}function MS(t,e,n){return Pc(t,Co(),e,n)}function SS(t,e,n){return Uw(t,e,{...n,exponent:.5})}function Uw(t,e,{exponent:n=1,...r}){return Pc(t,Ql().exponent(n),e,{...r,type:"pow"})}function AS(t,e,{base:n=10,domain:r=JD(e),...o}){return Pc(t,Wl().base(n),e,{...o,domain:r})}function ES(t,e,{constant:n=1,...r}){return Pc(t,Hl().constant(n),e,r)}function TS(t,e,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:o=r,scheme:i="rdylbu",domain:s=tF(e),unknown:a,interpolate:c,reverse:f}){return n===void 0&&(n=c!==void 0?Ge(c,o):qt.get(t)===Ln?qu(i,o):void 0),s.length>0&&(s=Zl(s,n===void 0?{length:o}:n).quantiles()),Rg(t,e,{domain:s,range:n,reverse:f,unknown:a})}function IS(t,e,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:o="rdylbu",domain:i=CS(t,e),unknown:s,interpolate:a,reverse:c}){let[f,l]=kt(i),u;return n===void 0?(u=Fe(f,l,r),u[0]<=f&&u.splice(0,1),u[u.length-1]>=l&&u.pop(),r=u.length+1,n=a!==void 0?Ge(a,r):qt.get(t)===Ln?qu(o,r):void 0):(u=Ge(Gt(f,l),r+1).slice(1,-1),f instanceof Date&&(u=u.map(p=>new Date(p)))),Bo(On(i))<0&&u.reverse(),Rg(t,e,{domain:u,range:n,reverse:c,unknown:s})}function Rg(t,e,{domain:n=[0],unknown:r,scheme:o="rdylbu",interpolate:i,range:s=i!==void 0?Ge(i,n.length+1):qt.get(t)===Ln?qu(o,n.length+1):void 0,reverse:a}){n=On(n);let c=Bo(n);if(!isNaN(c)&&!HD(n,c))throw new Error(`the ${t} scale has a non-monotonic domain`);return a&&(s=mi(s)),{type:"threshold",scale:Kl(c<0?mi(n):n,s===void 0?[]:s).unknown(r),domain:n,range:s}}function HD(t,e){for(let n=1,r=t.length,o=t[0];n<r;++n){let i=en(o,o=t[n]);if(i!==0&&i!==e)return!1}return!0}function $S(t){return{type:"identity",scale:Z8(qt.get(t))?Gl():e=>e}}function Fc(t,e=Mc){return t.length?[Ft(t,({value:n})=>n===void 0?n:Ft(n,e)),Tt(t,({value:n})=>n===void 0?n:Tt(n,e))]:[0,1]}function CS(t,e){let n=qt.get(t);return(n===Js||n===ea||n===ta?QD:Fc)(e)}function QD(t){return[0,t.length?Tt(t,({value:e})=>e===void 0?e:Tt(e,Mc)):1]}function ZD(t,e){let n=t.find(({radius:s})=>s!==void 0);if(n!==void 0)return[0,n.radius];let r=on(t,.5,({value:s})=>s===void 0?NaN:on(s,.25,dn)),o=e.map(s=>3*Math.sqrt(s/r)),i=30/Tt(o);return i<1?o.map(s=>s*i):o}function KD(t,e){let n=ur(t,({value:i})=>i===void 0?NaN:ur(i,Math.abs)),r=e.map(i=>12*i/n),o=60/Tt(r);return o<1?r.map(i=>i*o):r}function JD(t){for(let{value:e}of t)if(e!==void 0)for(let n of e){if(n>0)return Fc(t,dn);if(n<0)return Fc(t,$i)}return[1,10]}function tF(t){let e=[];for(let{value:n}of t)if(n!==void 0)for(let r of n)e.push(r);return e}function Bu(t){return(e,n)=>r=>t(e+r*(n-e))}var jw=0,Xw;function kS(){let t=jw;return jw=0,Xw=void 0,t}function Je(t){t!==Xw&&(Xw=t,console.warn(t),++jw)}function Lg(t,e,n,r,{type:o,nice:i,clamp:s,domain:a=Fc(r),unknown:c,pivot:f=0,scheme:l,range:u,symmetric:p=!0,interpolate:h=qt.get(t)===Ln?l==null&&u!==void 0?Gn:Dc(l!==void 0?l:"rdbu"):Gt,reverse:d}){f=+f,a=On(a);let[m,g]=a;if(a.length>2&&Je(`Warning: the diverging ${t} scale domain contains extra elements.`),en(m,g)<0&&([m,g]=[g,m],d=!d),m=Math.min(m,f),g=Math.max(g,f),typeof h!="function"&&(h=Yw(h)),u!==void 0&&(h=h.length===1?Bu(h)(...u):$r(h,u)),d&&(h=zw(h)),p){let y=n.apply(f),x=y-n.apply(m),w=n.apply(g)-y;x<w?m=n.invert(y-w):x>w&&(g=n.invert(y+x))}return e.domain([m,f,g]).unknown(c).interpolator(h),s&&e.clamp(s),i&&e.nice(i),{type:o,domain:[m,g],pivot:f,interpolate:h,scale:e}}function NS(t,e,n){return Lg(t,su(),eF,e,n)}function OS(t,e,n){return Gw(t,e,{...n,exponent:.5})}function Gw(t,e,{exponent:n=1,...r}){return Lg(t,Wm().exponent(n=+n),oF(n),e,{...r,type:"diverging-pow"})}function RS(t,e,{base:n=10,pivot:r=1,domain:o=Fc(e,r<0?$i:dn),...i}){return Lg(t,Gm().base(n=+n),nF,e,{domain:o,pivot:r,...i})}function LS(t,e,{constant:n=1,...r}){return Lg(t,Vm().constant(n=+n),iF(n),e,r)}var eF={apply(t){return t},invert(t){return t}},nF={apply:Math.log,invert:Math.exp},rF={apply(t){return Math.sign(t)*Math.sqrt(Math.abs(t))},invert(t){return Math.sign(t)*(t*t)}};function oF(t){return t===.5?rF:{apply(e){return Math.sign(e)*Math.pow(Math.abs(e),t)},invert(e){return Math.sign(e)*Math.pow(Math.abs(e),1/t)}}}function iF(t){return{apply(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))},invert(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}}function DS(t,e,n,r){return Pc(t,e,n,r)}function FS(t,e,n){return DS(t,Um(),e,n)}function PS(t,e,n){return DS(t,jm(),e,n)}var qc=Symbol("ordinal");function BS(t,e,n,{type:r,interval:o,domain:i,range:s,reverse:a,hint:c}){return o=Vr(o,r),i===void 0&&(i=XS(n,o,t)),(r==="categorical"||r===qc)&&(r="ordinal"),a&&(i=mi(i)),i=e.domain(i).domain(),s!==void 0&&(typeof s=="function"&&(s=s(i)),e.range(s)),{type:r,domain:i,range:s,scale:e,hint:c,interval:o}}function zS(t,e,{type:n,interval:r,domain:o,range:i,scheme:s,unknown:a,...c}){r=Vr(r,n),o===void 0&&(o=XS(e,r,t));let f;if(qt.get(t)===kc)f=sF(e),i=i===void 0?aF(f):Mt(i,Nc);else if(qt.get(t)===Ln&&(i===void 0&&(n==="ordinal"||n===qc)&&(i=wS(o,s),i!==void 0&&(s=void 0)),s===void 0&&i===void 0&&(s=n==="ordinal"?"turbo":"observable10"),s!==void 0))if(i!==void 0){let l=Dc(s),u=i[0],p=i[1]-i[0];i=({length:h})=>Ge(d=>l(u+p*d),h)}else i=qw(s);if(a===jl)throw new Error(`implicit unknown on ${t} scale is not supported`);return BS(t,qs().unknown(a),e,{...c,type:n,domain:o,range:i,hint:f})}function YS(t,e,{align:n=.5,padding:r=.5,...o}){return jS(s2().align(n).padding(r),e,o,t)}function US(t,e,{align:n=.5,padding:r=.1,paddingInner:o=r,paddingOuter:i=t==="fx"||t==="fy"?0:r,...s}){return jS(Ei().align(n).paddingInner(o).paddingOuter(i),e,s,t)}function jS(t,e,n,r){let{round:o}=n;return o!==void 0&&t.round(o=!!o),t=BS(r,t,e,n),t.round=o,t}function XS(t,e,n){let r=new rn;for(let{value:o,domain:i}of t){if(i!==void 0)return i();if(o!==void 0)for(let s of o)r.add(s)}if(e!==void 0){let[o,i]=kt(r).map(e.floor,e);return e.range(o,e.offset(i))}if(r.size>1e4&&qt.get(n)===rr)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return xo(r,Te)}function qS(t,e){let n;for(let{hint:r}of t){let o=r?.[e];if(o!==void 0){if(n===void 0)n=o;else if(n!==o)return}}return n}function sF(t){return{fill:qS(t,"fill"),stroke:qS(t,"stroke")}}function aF(t){return Rt(t.fill)?q2:lg}function zu(t,{label:e,inset:n=0,insetTop:r=n,insetRight:o=n,insetBottom:i=n,insetLeft:s=n,round:a,nice:c,clamp:f,zero:l,align:u,padding:p,projection:h,facet:{label:d=e}={},...m}={}){let g={};for(let[y,x]of t){let w=m[y],b=JS(y,x,{round:qt.get(y)===rr?a:void 0,nice:c,clamp:f,zero:l,align:u,padding:p,projection:h,...w});if(b){let{label:_=y==="fx"||y==="fy"?d:e,percent:v,transform:A,inset:T,insetTop:E=T!==void 0?T:y==="y"?r:0,insetRight:$=T!==void 0?T:y==="x"?o:0,insetBottom:S=T!==void 0?T:y==="y"?i:0,insetLeft:k=T!==void 0?T:y==="x"?s:0}=w||{};if(A==null)A=void 0;else if(typeof A!="function")throw new Error("invalid scale transform; not a function");b.percent=!!v,b.label=_===void 0?cF(x,b):_,b.transform=A,y==="x"||y==="fx"?(b.insetLeft=+k,b.insetRight=+$):(y==="y"||y==="fy")&&(b.insetTop=+E,b.insetBottom=+S),g[y]=b}}return g}function Ww(t){let e={},n={scales:e};for(let[r,o]of Object.entries(t)){let{scale:i,type:s,interval:a,label:c}=o;e[r]=e7(o),n[r]=i,i.type=s,a!=null&&(i.interval=a),c!=null&&(i.label=c)}return n}function QS(t,e){let{x:n,y:r,fx:o,fy:i}=t,s=o||i?Pg(e):e;o&&GS(o,s),i&&VS(i,s);let a=o||i?Hw(t,e):e;n&&GS(n,a),r&&VS(r,a)}function cF(t=[],e){let n;for(let{label:r}of t)if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}if(n!==void 0)return!Zr(e)&&e.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function Fg(t){return Math.sign(Bo(t.domain()))*Math.sign(Bo(t.range()))}function Pg(t){let{marginTop:e,marginRight:n,marginBottom:r,marginLeft:o,width:i,height:s,facet:{marginTop:a,marginRight:c,marginBottom:f,marginLeft:l}}=t;return{marginTop:Math.max(e,a),marginRight:Math.max(n,c),marginBottom:Math.max(r,f),marginLeft:Math.max(o,l),width:i,height:s}}function Hw({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=Pg(n);return{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:t?t.scale.bandwidth()+s+o:a,height:e?e.scale.bandwidth()+r+i:c,facet:{width:a,height:c}}}function GS(t,e){if(t.range===void 0){let{insetLeft:n,insetRight:r}=t,{width:o,marginLeft:i=0,marginRight:s=0}=e,a=i+n,c=o-s-r;t.range=[a,Math.max(a,c)],Zr(t)||(t.range=KS(t)),t.scale.range(t.range)}ZS(t)}function VS(t,e){if(t.range===void 0){let{insetTop:n,insetBottom:r}=t,{height:o,marginTop:i=0,marginBottom:s=0}=e,a=i+n,c=o-s-r;t.range=[Math.max(a,c),a],Zr(t)?t.range.reverse():t.range=KS(t),t.scale.range(t.range)}ZS(t)}function ZS(t){t.round===void 0&&uF(t)&&fF(t)<=30&&t.scale.round(!0)}function fF({scale:t}){let e=t.domain().length,[n,r]=t.range(),o=t.paddingInner?t.paddingInner():1,i=t.paddingOuter?t.paddingOuter():t.padding(),s=e-o,a=Math.abs(r-n)/Math.max(1,s+i*2);return(a-Math.floor(a))*s}function KS(t){let e=t.scale.domain().length+Qw(t);if(!(e>2))return t.range;let[n,r]=t.range;return Array.from({length:e},(o,i)=>n+i/(e-1)*(r-n))}function qg(t,e,n){return JS(t,n===void 0?void 0:[{hint:n}],{...e})}function JS(t,e=[],n={}){let r=lF(t,e,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&t!=="fx"&&t!=="fy"&&Zr({type:r})){let o=e.map(({value:i})=>i).filter(i=>i!==void 0);o.some(Jt)?Je(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Bc(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${Bc(r)}".`):o.some(Y8)?Je(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Bc(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${Bc(r)}".`):o.some(U8)&&Je(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Bc(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${Bc(r)}".`)}switch(n.type=r,r){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=Dg(e,n,de);break;case"identity":switch(qt.get(t)){case rr:n=Dg(e,n,de);break;case kc:n=Dg(e,n,pF);break}break;case"utc":case"time":n=Dg(e,n,gw);break}switch(r){case"diverging":return NS(t,e,n);case"diverging-sqrt":return OS(t,e,n);case"diverging-pow":return Gw(t,e,n);case"diverging-log":return RS(t,e,n);case"diverging-symlog":return LS(t,e,n);case"categorical":case"ordinal":case qc:return zS(t,e,n);case"cyclical":case"sequential":case"linear":return MS(t,e,n);case"sqrt":return SS(t,e,n);case"threshold":return Rg(t,e,n);case"quantile":return TS(t,e,n);case"quantize":return IS(t,e,n);case"pow":return Uw(t,e,n);case"log":return AS(t,e,n);case"symlog":return ES(t,e,n);case"utc":return PS(t,e,n);case"time":return FS(t,e,n);case"point":return YS(t,e,n);case"band":return US(t,e,n);case"identity":return $S(t);case void 0:return;default:throw new Error(`unknown scale type: ${r}`)}}function Bc(t){return typeof t=="symbol"?t.description:t}function WS(t){return typeof t=="string"?`${t}`.toLowerCase():t}var HS={toString:()=>"projection"};function lF(t,e,{type:n,domain:r,range:o,scheme:i,pivot:s,projection:a}){if(n=WS(n),t==="fx"||t==="fy")return"band";(t==="x"||t==="y")&&a!=null&&(n=HS);for(let f of e){let l=WS(f.type);if(l!==void 0){if(n===void 0)n=l;else if(n!==l)throw new Error(`scale incompatible with channel: ${n} !== ${l}`)}}if(n===HS)return;if(n!==void 0)return n;if(r===void 0&&!e.some(({value:f})=>f!==void 0))return;let c=qt.get(t);if(c===Js)return"sqrt";if(c===ea||c===ta)return"linear";if(c===kc)return"ordinal";if((r||o||[]).length>2)return Vw(c);if(r!==void 0){if(Qt(r))return Vw(c);if(Jt(r))return"utc"}else{let f=e.map(({value:l})=>l).filter(l=>l!==void 0);if(f.some(Qt))return Vw(c);if(f.some(Jt))return"utc"}if(c===Ln){if(s!=null||vS(i))return"diverging";if(bS(i))return"categorical"}return"linear"}function Vw(t){switch(t){case rr:return"point";case Ln:return qc;default:return"ordinal"}}function Zr({type:t}){return t==="ordinal"||t==="point"||t==="band"||t===qc}function Qw({type:t}){return t==="threshold"}function uF({type:t}){return t==="point"||t==="band"}function Dn(t){if(t===void 0)return!0;let e=t.domain(),n=t(e[0]);for(let r=1,o=e.length;r<o;++r)if(t(e[r])-n)return!1;return!0}function Dg(t,{domain:e,...n},r){for(let o of t)o.value!==void 0&&(e===void 0&&(e=o.value?.domain),o.value=r(o.value));return{domain:e===void 0?e:r(e),...n}}function pF(t){return Mt(t,Nc)}function zi(t={}){let e;for(let n in t)if(qt.has(n)&&Xr(t[n])){if(e!==void 0)throw new Error("ambiguous scale definition; multiple scales found");e=e7(qg(n,t[n]))}if(e===void 0)throw new Error("invalid scale definition; no scale found");return e}function t7(t){return e=>{if(!qt.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return t[e]}}function e7({scale:t,type:e,domain:n,range:r,interpolate:o,interval:i,transform:s,percent:a,pivot:c}){if(e==="identity")return{type:"identity",apply:l=>l,invert:l=>l};let f=t.unknown?t.unknown():void 0;return{type:e,domain:Li(n),...r!==void 0&&{range:Li(r)},...s!==void 0&&{transform:s},...a&&{percent:a},...f!==void 0&&{unknown:f},...i!==void 0&&{interval:i},...o!==void 0&&{interpolate:o},...t.clamp&&{clamp:t.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:l=>t(l),...t.invert&&{invert:l=>t.invert(l)}}}function r7(t,e){let{fx:n,fy:r}=zu(t,e),o=n?.scale.domain(),i=r?.scale.domain();return o&&i?sd(o,i).map(([s,a],c)=>({x:s,y:a,i:c})):o?o.map((s,a)=>({x:s,i:a})):i?i.map((s,a)=>({y:s,i:a})):void 0}function o7(t,{x:e,y:n}){return e&&=ev(e),n&&=ev(n),t.filter(e&&n?r=>e.has(r.x)&&n.has(r.y):e?r=>e.has(r.x):r=>n.has(r.y)).sort(e&&n?(r,o)=>e.get(r.x)-e.get(o.x)||n.get(r.y)-n.get(o.y):e?(r,o)=>e.get(r.x)-e.get(o.x):(r,o)=>n.get(r.y)-n.get(o.y))}function zg(t,{fx:e,fy:n}){let r=mn(t),o=e?.value,i=n?.value;return e&&n?lr(r,s=>(s.fx=o[s[0]],s.fy=i[s[0]],s),s=>o[s],s=>i[s]):e?lr(r,s=>(s.fx=o[s[0]],s),s=>o[s]):lr(r,s=>(s.fy=i[s[0]],s),s=>i[s])}function i7(t,e,{marginTop:n,marginLeft:r}){return t&&e?({x:o,y:i})=>`translate(${t(o)-r},${e(i)-n})`:t?({x:o})=>`translate(${t(o)-r},0)`:({y:o})=>`translate(0,${e(o)-n})`}function s7(t){let e=[],n=new Uint32Array(Pe(t,r=>r.length));for(let r of t){let o=0;for(let i of t)r!==i&&(n.set(i,o),o+=i.length);e.push(n.slice(0,o))}return e}var hF=new Map([["top",Zw],["right",tv],["bottom",Kw],["left",Jw],["top-left",Bg(Zw,Jw)],["top-right",Bg(Zw,tv)],["bottom-left",Bg(Kw,Jw)],["bottom-right",Bg(Kw,tv)],["top-empty",mF],["right-empty",xF],["bottom-empty",gF],["left-empty",yF],["empty",bF]]);function a7(t){if(t==null)return null;let e=hF.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid facet anchor: ${t}`)}var n7=new WeakMap;function ev(t){let e=n7.get(t);return e||n7.set(t,e=new nn(Mt(t,(n,r)=>[n,r]))),e}function Yi(t,e){return ev(t).get(e)}function dF(t,e,n){return e=er(e),n=er(n),t.find(r=>Object.is(er(r.x),e)&&Object.is(er(r.y),n))}function Yg(t,e,n){return dF(t,e,n)?.empty}function Zw(t,{y:e},{y:n}){return e?Yi(e,n)===0:!0}function Kw(t,{y:e},{y:n}){return e?Yi(e,n)===e.length-1:!0}function Jw(t,{x:e},{x:n}){return e?Yi(e,n)===0:!0}function tv(t,{x:e},{x:n}){return e?Yi(e,n)===e.length-1:!0}function mF(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=Yi(e,r);if(i>0)return Yg(t,n,e[i-1])}function gF(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=Yi(e,r);if(i<e.length-1)return Yg(t,n,e[i+1])}function yF(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=Yi(e,n);if(i>0)return Yg(t,e[i-1],r)}function xF(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;let i=Yi(e,n);if(i<e.length-1)return Yg(t,e[i+1],r)}function bF(t,e,{empty:n}){return n}function Bg(t,e){return function(){return t.apply(null,arguments)&&e.apply(null,arguments)}}function Ug(t,{channels:{fx:e,fy:n},groups:r}){return e&&n?t.map(({x:o,y:i})=>r.get(o)?.get(i)??[]):e?t.map(({x:o})=>r.get(o)??[]):t.map(({y:o})=>r.get(o)??[])}var c7=Math.PI,Ho=2*c7,nv=.618;function f7({projection:t,inset:e=0,insetTop:n=e,insetRight:r=e,insetBottom:o=e,insetLeft:i=e}={},s){if(t==null)return;if(typeof t.stream=="function")return t;let a,c,f="frame";if(Ie(t)){let _;if({type:t,domain:c,inset:_,insetTop:n=_!==void 0?_:n,insetRight:r=_!==void 0?_:r,insetBottom:o=_!==void 0?_:o,insetLeft:i=_!==void 0?_:i,clip:f=f,...a}=t,t==null)return}typeof t!="function"&&({type:t}=rv(t));let{width:l,height:u,marginLeft:p,marginRight:h,marginTop:d,marginBottom:m}=s,g=l-p-h-i-r,y=u-d-m-n-o;if(t=t?.({width:g,height:y,clip:f,...a}),t==null)return;f=wF(f,p,d,l-h,u-m);let x=p+i,w=d+n,b;if(c!=null){let[[_,v],[A,T]]=Se(t).bounds(c),E=Math.min(g/(A-_),y/(T-v));E>0?(x-=(E*(_+A)-g)/2,w-=(E*(v+T)-y)/2,b=Ds({point($,S){this.stream.point($*E+x,S*E+w)}})):Je("Warning: the projection could not be fit to the specified domain; using the default scale.")}return b??=x===0&&w===0?l7():Ds({point(_,v){this.stream.point(_+x,v+w)}}),{stream:_=>t.stream(b.stream(f(_)))}}function rv(t){switch(`${t}`.toLowerCase()){case"albers-usa":return mr(Rb,.7463,.4673);case"albers":return jg(Pl,.7463,.4673);case"azimuthal-equal-area":return mr(Db,4,4);case"azimuthal-equidistant":return mr(Pb,Ho,Ho);case"conic-conformal":return jg(zb,Ho,Ho);case"conic-equal-area":return jg(Si,6.1702,2.9781);case"conic-equidistant":return jg(Ub,7.312,3.6282);case"equal-earth":return mr(Xb,5.4133,2.6347);case"equirectangular":return mr(Yb,Ho,c7);case"gnomonic":return mr(Vb,3.4641,3.4641);case"identity":return{type:l7};case"reflect-y":return{type:vF};case"mercator":return mr(qb,Ho,Ho);case"orthographic":return mr(Hb,2,2);case"stereographic":return mr(Zb,2,2);case"transverse-mercator":return mr(Jb,Ho,Ho);default:throw new Error(`unknown projection type: ${t}`)}}function wF(t,e,n,r,o){if(t===!1||t==null||typeof t=="number")return i=>i;switch(t===!0&&(t="frame"),`${t}`.toLowerCase()){case"frame":return nc(e,n,r,o);default:throw new Error(`unknown projection clip type: ${t}`)}}function mr(t,e,n){return{type:({width:r,height:o,rotate:i,precision:s=.15,clip:a})=>{let c=t();return s!=null&&c.precision?.(s),i!=null&&c.rotate?.(i),typeof a=="number"&&c.clipAngle?.(a),r!=null&&(c.scale(Math.min(r/e,o/n)),c.translate([r/2,o/2])),c},aspectRatio:n/e}}function jg(t,e,n){let{type:r,aspectRatio:o}=mr(t,e,n);return{type:i=>{let{parallels:s,domain:a,width:c,height:f}=i,l=r(i);return s!=null&&(l.parallels(s),a===void 0&&c!=null&&l.fitSize([c,f],{type:"Sphere"})),l},aspectRatio:o}}var l7=te({stream:t=>t}),vF=te(Ds({point(t,e){this.stream.point(t,-e)}}));function ov(t,e,n,r){let o=n[t],i=n[e],s=o.length,a=n[t]=new Float64Array(s).fill(NaN),c=n[e]=new Float64Array(s).fill(NaN),f,l=r.stream({point(u,p){a[f]=u,c[f]=p}});for(f=0;f<s;++f)l.point(o[f],i[f])}function u7({projection:t}={}){return t==null?!1:typeof t.stream=="function"?!0:(Ie(t)&&(t=t.type),t!=null)}function p7(t){if(typeof t?.stream=="function")return nv;if(Ie(t)){let e,n;if({domain:e,type:t,...n}=t,e!=null&&t!=null){let r=typeof t=="string"?rv(t).type:t,[[o,i],[s,a]]=Se(r({...n,width:100,height:100})).bounds(e),c=(a-i)/(s-o);return c&&isFinite(c)?c<.2?.2:c>5?5:c:nv}}if(t!=null){if(typeof t!="function"){let{aspectRatio:e}=rv(t);if(e)return e}return nv}}function Kr(t,e,{projection:n}){let{x:r,y:o}=t,i={};return r&&(i.x=r),o&&(i.y=o),i=Lc(i,e),n&&r?.scale==="x"&&o?.scale==="y"&&ov("x","y",i,n),r&&(i.x=de(i.x)),o&&(i.y=de(i.y)),i}function h7(t){let e=[],n=[],r={scale:"x",value:e},o={scale:"y",value:n},i={point(s,a){e.push(s),n.push(a)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let s of t.value)$n(s,i);return[r,o]}function Ui(t={}){let{document:e=typeof window<"u"?window.document:void 0,clip:n}=t;return{document:e,clip:Ag(n)}}function ot(t,{document:e}){return bt(_o(t).call(e.documentElement))}var Xg=Symbol("unset");function ji(t){return(t.length===1?_F:MF)(t)}function _F(t){let e,n=Xg;return r=>(Object.is(n,r)||(n=r,e=t(r)),e)}function MF(t){let e,n;return(...r)=>((n?.length!==r.length||n.some((o,i)=>!Object.is(o,r[i])))&&(n=r,e=t(...r)),e)}var SF=ji(t=>new Intl.NumberFormat(t)),AF=ji((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{month:e}})),EF=ji((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{weekday:e}}));function iv(t="en-US"){let e=SF(t);return n=>n!=null&&!isNaN(n)?e.format(n):void 0}function d7(t="en-US",e="short"){let n=AF(t,e);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2e3,+r)))?n.format(r):void 0}function m7(t="en-US",e="short"){let n=EF(t,e);return r=>r!=null&&!isNaN(r=+new Date(Date.UTC(2001,0,+r)))?n.format(r):void 0}function sv(t){return yg(t,"Invalid Date")}function TF(t="en-US"){let e=iv(t);return n=>(n instanceof Date?sv:typeof n=="number"?e:se)(n)}var Jr=TF();var ee=(typeof window<"u"?window.devicePixelRatio>1:typeof it>"u")?0:.5,IF=0,$F=0;function av(){return`plot-clip-${++IF}`}function g7(){return`plot-pattern-${++$F}`}function Gg(t,{title:e,href:n,ariaLabel:r,ariaDescription:o,ariaHidden:i,target:s,fill:a,fillOpacity:c,stroke:f,strokeWidth:l,strokeOpacity:u,strokeLinejoin:p,strokeLinecap:h,strokeMiterlimit:d,strokeDasharray:m,strokeDashoffset:g,opacity:y,mixBlendMode:x,imageFilter:w,paintOrder:b,pointerEvents:_,shapeRendering:v,channels:A},{ariaLabel:T,fill:E="currentColor",fillOpacity:$,stroke:S="none",strokeOpacity:k,strokeWidth:O,strokeLinecap:M,strokeLinejoin:I,strokeMiterlimit:C,paintOrder:N}){E===null&&(a=null,c=null),S===null&&(f=null,u=null),Rt(E)?!Rt(S)&&(!Rt(a)||A?.fill)&&(S="none"):Rt(S)&&(!Rt(f)||A?.stroke)&&(E="none");let[L,R]=Kt(a,E),[D,F]=Lt(c,$),[P,V]=Kt(f,S),[J,et]=Lt(u,k),[rt,j]=Lt(y);Xo(V)||(l===void 0&&(l=O),h===void 0&&(h=M),p===void 0&&(p=I),d===void 0&&!X8(p)&&(d=C),!Xo(R)&&b===void 0&&(b=N));let[nt,z]=Lt(l);return E!==null&&(t.fill=Xt(R,"currentColor"),t.fillOpacity=Yu(F,1)),S!==null&&(t.stroke=Xt(V,"none"),t.strokeWidth=Yu(z,1),t.strokeOpacity=Yu(et,1),t.strokeLinejoin=Xt(p,"miter"),t.strokeLinecap=Xt(h,"butt"),t.strokeMiterlimit=Yu(d,4),t.strokeDasharray=Xt(m,"none"),t.strokeDashoffset=Xt(g,"0")),t.target=se(s),t.ariaLabel=se(T),t.ariaDescription=se(o),t.ariaHidden=se(i),t.opacity=Yu(j,1),t.mixBlendMode=Xt(x,"normal"),t.imageFilter=Xt(w,"none"),t.paintOrder=Xt(b,"normal"),t.pointerEvents=Xt(_,"auto"),t.shapeRendering=Xt(v,"auto"),{title:{value:e,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:L,scale:"auto",optional:!0},fillOpacity:{value:D,scale:"auto",optional:!0},stroke:{value:P,scale:"auto",optional:!0},strokeOpacity:{value:J,scale:"auto",optional:!0},strokeWidth:{value:nt,optional:!0},opacity:{value:rt,scale:"auto",optional:!0}}}function CF(t,e){e&&t.filter(n=>Eu(e[n])).append("title").call(NF,e)}function kF(t,e){e&&t.filter(([n])=>Eu(e[n])).append("title").call(OF,e)}function NF(t,e){e&&t.text(n=>Jr(e[n]))}function OF(t,e){e&&t.text(([n])=>Jr(e[n]))}function vt(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:i,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:f,opacity:l,href:u}){r&&st(t,"aria-label",p=>r[p]),i&&st(t,"fill",p=>i[p]),s&&st(t,"fill-opacity",p=>s[p]),a&&st(t,"stroke",p=>a[p]),c&&st(t,"stroke-opacity",p=>c[p]),f&&st(t,"stroke-width",p=>f[p]),l&&st(t,"opacity",p=>l[p]),u&&x7(t,p=>u[p],e),n||CF(t,o)}function na(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:i,fillOpacity:s,stroke:a,strokeOpacity:c,strokeWidth:f,opacity:l,href:u}){r&&st(t,"aria-label",([p])=>r[p]),i&&st(t,"fill",([p])=>i[p]),s&&st(t,"fill-opacity",([p])=>s[p]),a&&st(t,"stroke",([p])=>a[p]),c&&st(t,"stroke-opacity",([p])=>c[p]),f&&st(t,"stroke-width",([p])=>f[p]),l&&st(t,"opacity",([p])=>l[p]),u&&x7(t,([p])=>u[p],e),n||kF(t,o)}function RF({ariaLabel:t,title:e,fill:n,fillOpacity:r,stroke:o,strokeOpacity:i,strokeWidth:s,opacity:a,href:c},{tip:f}){return[t,f?void 0:e,n,r,o,i,s,a,c].filter(l=>l!==void 0)}function Uu(t,e,n){let r=De(t,o=>e[o]);return n===void 0&&r.size>1+t.length>>1&&Je("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),r.values()}function*Vg(t,e,n,r){let{z:o}=n,{z:i}=r,s=RF(r,n),a=[...e,...s];for(let c of i?Uu(t,i,o):[t]){let f,l;t:for(let u of c){for(let p of a)if(!Ht(p[u])){l&&l.push(-1);continue t}if(f===void 0){l&&(yield l),f=s.map(p=>er(p[u])),l=[u];continue}l.push(u);for(let p=0;p<s.length;++p)if(er(s[p][u])!==f[p]){yield l,f=s.map(d=>er(d[u])),l=[u];continue t}}l&&(yield l)}}function LF(t,e,n,r){let o,{clip:i=r.clip}=e;switch(i){case"frame":{t=ot("svg:g",r).each(function(){this.appendChild(t.node()),t.node=()=>this}),o=DF(r,n);break}case"sphere":{o=FF(r);break}}st(t,"aria-label",e.ariaLabel),st(t,"aria-description",e.ariaDescription),st(t,"aria-hidden",e.ariaHidden),st(t,"clip-path",o)}function y7(t){let e=new WeakMap;return(n,r)=>{let o=e.get(n);if(!o){let i=av();bt(n.ownerSVGElement).append("clipPath").attr("id",i).call(t,n,r),e.set(n,o=`url(#${i})`)}return o}}var DF=y7((t,e,n)=>{let{width:r,height:o,marginLeft:i,marginRight:s,marginTop:a,marginBottom:c}=n;t.append("rect").attr("x",i).attr("y",a).attr("width",r-s-i).attr("height",o-a-c)}),FF=y7((t,e)=>{let{projection:n}=e;if(!n)throw new Error('the "sphere" clip option requires a projection');t.append("path").attr("d",Se(n)({type:"Sphere"}))});function mt(t,e,n,r){LF(t,e,n,r),st(t,"class",e.className),st(t,"fill",e.fill),st(t,"fill-opacity",e.fillOpacity),st(t,"stroke",e.stroke),st(t,"stroke-width",e.strokeWidth),st(t,"stroke-opacity",e.strokeOpacity),st(t,"stroke-linejoin",e.strokeLinejoin),st(t,"stroke-linecap",e.strokeLinecap),st(t,"stroke-miterlimit",e.strokeMiterlimit),st(t,"stroke-dasharray",e.strokeDasharray),st(t,"stroke-dashoffset",e.strokeDashoffset),st(t,"shape-rendering",e.shapeRendering),st(t,"filter",e.imageFilter),st(t,"paint-order",e.paintOrder);let{pointerEvents:o=r.pointerSticky===!1?"none":void 0}=e;st(t,"pointer-events",o)}function ut(t,e){PF(t,"mix-blend-mode",e.mixBlendMode),st(t,"opacity",e.opacity)}function x7(t,e,n){t.each(function(r){let o=e(r);if(o!=null){let i=this.ownerDocument.createElementNS(sn.svg,"a");i.setAttribute("fill","inherit"),i.setAttributeNS(sn.xlink,"href",o),n!=null&&i.setAttribute("target",n),this.parentNode.insertBefore(i,this).appendChild(this)}})}function st(t,e,n){n!=null&&t.attr(e,n)}function PF(t,e,n){n!=null&&t.style(e,n)}function pt(t,e,{x:n,y:r},o=ee,i=ee){o+=e.dx,i+=e.dy,n?.bandwidth&&(o+=n.bandwidth()/2),r?.bandwidth&&(i+=r.bandwidth()/2),(o||i)&&t.attr("transform",`translate(${o},${i})`)}function Xt(t,e){if((t=se(t))!==e)return t}function Yu(t,e){if((t=Ct(t))!==e)return t}var qF=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function Xi(t){if(t===void 0)return"plot-d6a7b5";if(t=`${t}`,!qF.test(t))throw new Error(`invalid class name: ${t}`);return t}function zc(t,e){if(typeof e=="string")t.property("style",e);else if(e!=null)for(let n of t)Object.assign(n.style,e)}function ke({frameAnchor:t},{width:e,height:n,marginTop:r,marginRight:o,marginBottom:i,marginLeft:s}){return[/left$/.test(t)?s:/right$/.test(t)?e-o:(s+e-o)/2,/^top/.test(t)?r:/^bottom/.test(t)?n-i:(r+n-i)/2]}var lt=class{constructor(e,n={},r={},o){let{facet:i="auto",facetAnchor:s,fx:a,fy:c,sort:f,dx:l=0,dy:u=0,margin:p=0,marginTop:h=p,marginRight:d=p,marginBottom:m=p,marginLeft:g=p,className:y,clip:x=o?.clip,channels:w,tip:b,render:_}=r;if(this.data=e,this.sort=Gr(f)?f:null,this.initializer=jt(r).initializer,this.transform=this.initializer?r.transform:me(r).transform,i===null||i===!1?this.facet=null:(this.facet=be(i===!0?"include":i,"facet",["auto","include","exclude","super"]),this.fx=e===Oi&&typeof a=="string"?[a]:a,this.fy=e===Oi&&typeof c=="string"?[c]:c),this.facetAnchor=a7(s),n=Ou(n),w!==void 0&&(n={...BF(w),...n}),o!==void 0&&(n={...Gg(this,r,o),...n}),this.channels=Object.fromEntries(Object.entries(n).map(([v,A])=>{if(Rn(A.value)){let{value:T,label:E=A.label,scale:$=A.scale}=A.value;A={...A,label:E,scale:$,value:T}}if(e===Oi&&typeof A.value=="string"){let{value:T}=A;A={...A,value:[T]}}return[v,A]}).filter(([v,{value:A,optional:T}])=>{if(A!=null)return!0;if(T)return!1;throw new Error(`missing channel value: ${v}`)})),this.dx=+l,this.dy=+u,this.marginTop=+h,this.marginRight=+d,this.marginBottom=+m,this.marginLeft=+g,this.clip=Ag(x),this.tip=zF(b),this.className=y?Xi(y):null,this.facet==="super"){if(a||c)throw new Error("super-faceting cannot use fx or fy");for(let v in this.channels){let{scale:A}=n[v];if(!(A!=="x"&&A!=="y"))throw new Error("super-faceting cannot use x or y")}}_!=null&&(this.render=Qo(_,this.render))}initialize(e,n,r){let o=zo(this.data);e===void 0&&o!=null&&(e=[mn(o)]);let i=e;this.transform!=null&&({facets:e,data:o}=this.transform(o,e,r),o=zo(o)),e!==void 0&&(e.original=i);let s=Og(this.channels,o);return this.sort!=null&&uS(o,e,s,n,this.sort),{data:o,facets:e,channels:s}}filter(e,n,r){for(let o in n){let{filter:i=Ht}=n[o];if(i!==null){let s=r[o];e=e.filter(a=>i(s[a]))}}return e}project(e,n,r){for(let o in e)if(e[o].scale==="x"&&/^x|x$/.test(o)){let i=o.replace(/^x|x$/,"y");i in e&&e[i].scale==="y"&&ov(o,i,n,r.projection)}}scale(e,n,r){let o=Lc(e,n);return r.projection&&this.project(e,o,r),o}};function ge(...t){return t.plot=lt.prototype.plot,t}function Qo(t,e){if(t==null)return e===null?void 0:e;if(e==null)return t===null?void 0:t;if(typeof t!="function")throw new TypeError(`invalid render transform: ${t}`);if(typeof e!="function")throw new TypeError(`invalid render transform: ${e}`);return function(n,r,o,i,s,a){return t.call(this,n,r,o,i,s,(c,f,l,u,p)=>e.call(this,c,f,l,u,p,a))}}function BF(t){return Object.fromEntries(Object.entries(Ou(t)).map(([e,n])=>(n=typeof n=="string"?{value:n,label:e}:nr(n),n.filter===void 0&&n.scale==null&&(n={...n,filter:null}),[e,n])))}function zF(t){return t===!0?"xy":t===!1||t==null?null:typeof t=="string"?be(t,"tip",["x","y","xy"]):t}function gr(t,e){return t?.tip===!0?{...t,tip:e}:Ie(t?.tip)&&t.tip.pointer===void 0?{...t,tip:{...t.tip,pointer:e}}:t}function w7(t,e,n={}){let r=.5-ee,o=.5+ee,i=.5+ee,s=.5-ee;for(let{marginTop:m,marginRight:g,marginBottom:y,marginLeft:x}of e)m>r&&(r=m),g>o&&(o=g),y>i&&(i=y),x>s&&(s=x);let{margin:a,marginTop:c=a!==void 0?a:r,marginRight:f=a!==void 0?a:o,marginBottom:l=a!==void 0?a:i,marginLeft:u=a!==void 0?a:s}=n;c=+c,f=+f,l=+l,u=+u;let{width:p=640,height:h=YF(t,n,{width:p,marginTopDefault:r,marginRightDefault:o,marginBottomDefault:i,marginLeftDefault:s})+Math.max(0,c-r+l-i)}=n;p=+p,h=+h;let d={width:p,height:h,marginTop:c,marginRight:f,marginBottom:l,marginLeft:u};if(t.fx||t.fy){let{margin:m,marginTop:g=m!==void 0?m:c,marginRight:y=m!==void 0?m:f,marginBottom:x=m!==void 0?m:l,marginLeft:w=m!==void 0?m:u}=n.facet??{};g=+g,y=+y,x=+x,w=+w,d.facet={marginTop:g,marginRight:y,marginBottom:x,marginLeft:w}}return d}function YF({x:t,y:e,fy:n,fx:r},{projection:o,aspectRatio:i},{width:s,marginTopDefault:a,marginRightDefault:c,marginBottomDefault:f,marginLeftDefault:l}){let u=n&&n.scale.domain().length||1,p=p7(o);if(p){let d=r?r.scale.domain().length:1,m=(1.1*u-.1)/(1.1*d-.1)*p,g=Math.max(.1,Math.min(10,m));return Math.round((s-l-c)*g+a+f)}let h=e?Zr(e)?e.scale.domain().length||1:Math.max(7,17/u):1;if(i!=null){if(i=+i,!(isFinite(i)&&i>0))throw new Error(`invalid aspectRatio: ${i}`);let d=b7("y",e)/(b7("x",t)*i),m=r?r.scale.bandwidth():1,g=n?n.scale.bandwidth():1,y=m*(s-l-c)-t.insetLeft-t.insetRight;return(d*y+e.insetTop+e.insetBottom)/g+a+f}return!!(e||n)*Math.max(1,Math.min(60,h*u))*20+!!r*30+60}function b7(t,e){if(!e)throw new Error(`aspectRatio requires ${t} scale`);let{type:n,domain:r}=e,o;switch(n){case"linear":case"utc":case"time":o=Number;break;case"pow":{let a=e.scale.exponent();o=c=>Math.pow(c,a);break}case"log":o=Math.log;break;case"point":case"band":return r.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${n}`)}let[i,s]=kt(r);return Math.abs(o(s)-o(i))}var v7=new WeakMap;function cv(t,e,{x:n,y:r,px:o,py:i,maxRadius:s=40,channels:a,render:c,...f}={}){return s=+s,o!=null&&(n??=null,a={...a,px:{value:o,scale:"x"}}),i!=null&&(r??=null,a={...a,py:{value:i,scale:"y"}}),{x:n,y:r,channels:a,...f,render:Qo(function(l,u,p,h,d,m){d={...d,pointerSticky:!1};let g=d.ownerSVGElement,{data:y}=d.getMarkState(this),x=v7.get(g);x||v7.set(g,x={sticky:!1,roots:[],renders:[]});let w=x.renders.push(V)-1,{x:b,y:_,fx:v,fy:A}=u,T=v?v(l.fx)-h.marginLeft:0,E=A?A(l.fy)-h.marginTop:0;b?.bandwidth&&(T+=b.bandwidth()/2),_?.bandwidth&&(E+=_.bandwidth()/2);let $=l.fi!=null,S;if($){let j=x.facetStates;j||(x.facetStates=j=new Map),S=j.get(this),S||j.set(this,S=new Map)}let[k,O]=ke(this,h),{px:M,py:I}=p,C=M?j=>M[j]:fv(p,k),N=I?j=>I[j]:lv(p,O),L,R,D,F;function P(j,nt){if($)if(F&&(F=cancelAnimationFrame(F)),j==null)S.delete(l.fi);else{S.set(l.fi,nt),F=requestAnimationFrame(()=>{F=null;for(let[z,W]of S)if(W<nt||W===nt&&z<l.fi){j=null;break}V(j)});return}V(j)}function V(j){if(L===j&&D===x.sticky)return;L=j,D=d.pointerSticky=x.sticky;let nt=L==null?[]:[L];$&&(nt.fx=l.fx,nt.fy=l.fy,nt.fi=l.fi);let z=m(nt,u,p,h,d);if(R){if($){let W=R.parentNode,tt=R.getAttribute("transform"),q=z.getAttribute("transform");tt?z.setAttribute("transform",tt):z.removeAttribute("transform"),q?W.setAttribute("transform",q):W.removeAttribute("transform"),z.removeAttribute("aria-label"),z.removeAttribute("aria-description"),z.removeAttribute("aria-hidden")}R.replaceWith(z)}if(x.roots[w]=R=z,!(L==null&&S?.size>1)){let W=L==null?null:vn(y)?y[L]:y.get(L);d.dispatchValue(W)}return z}function J(j){if(x.sticky||j.pointerType==="mouse"&&j.buttons===1)return;let[nt,z]=Xe(j);nt-=T,z-=E;let W=nt<h.marginLeft||nt>h.width-h.marginRight?1:t,tt=z<h.marginTop||z>h.height-h.marginBottom?1:e,q=null,gt=s*s;for(let at of l){let At=W*(C(at)-nt),It=tt*(N(at)-z),Z=At*At+It*It;Z<=gt&&(q=at,gt=Z)}if(q!=null&&(t!==1||e!==1)){let at=C(q)-nt,At=N(q)-z;gt=at*at+At*At}P(q,gt)}function et(j){j.pointerType==="mouse"&&L!=null&&(x.sticky&&x.roots.some(nt=>nt?.contains(j.target))||(x.sticky?(x.sticky=!1,x.renders.forEach(nt=>nt(null))):(x.sticky=!0,V(L)),j.stopImmediatePropagation()))}function rt(j){j.pointerType==="mouse"&&(x.sticky||P(null))}return g.addEventListener("pointerenter",J),g.addEventListener("pointermove",J),g.addEventListener("pointerdown",et),g.addEventListener("pointerleave",rt),V(null)},c)}}function Gi(t){return cv(1,1,t)}function Vi(t){return cv(1,.01,t)}function Zo(t){return cv(.01,1,t)}function fv({x1:t,x2:e,x:n=t},r){return t&&e?o=>(t[o]+e[o])/2:n?o=>n[o]:()=>r}function lv({y1:t,y2:e,y:n=t},r){return t&&e?o=>(t[o]+e[o])/2:n?o=>n[o]:()=>r}function Wg(t){return Zr(t)&&t.interval===void 0?void 0:"tabular-nums"}function _7(t,e){let{label:n=t.label,tickSize:r=6,width:o=240,height:i=44+r,marginTop:s=18,marginRight:a=0,marginBottom:c=16+r,marginLeft:f=0,style:l,ticks:u=(o-f-a)/64,tickFormat:p,fontVariant:h=Wg(t),round:d=!0,opacity:m,className:g}=e,y=Ui(e);g=Xi(g),m=Lt(m)[1],p===null&&(p=()=>null);let x=ot("svg",y).attr("class",`${g}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",o).attr("height",i).attr("viewBox",`0 0 ${o} ${i}`).call(k=>k.append("style").text(`:where(.${g}-ramp) {
|
|
17
8
|
display: block;
|
|
18
9
|
height: auto;
|
|
19
10
|
height: intrinsic;
|
|
20
11
|
max-width: 100%;
|
|
21
12
|
overflow: visible;
|
|
22
13
|
}
|
|
23
|
-
:where(.${
|
|
14
|
+
:where(.${g}-ramp text) {
|
|
24
15
|
white-space: pre;
|
|
25
|
-
}`)).call(bf,u),w=N=>N.selectAll(".tick line").attr("y1",s+c-o),x,v=p?(N,O)=>N.rangeRound(O):(N,O)=>N.range(O),{type:_,domain:M,range:E,interpolate:T,scale:B,pivot:I}=e;if(T){let N=E===void 0?T:fo(T.length===1?gm(T):T,E);x=v(B.copy(),Cn(_e(l,i-a),Math.min(M.length+(I!==void 0),E===void 0?1/0:E.length)));let O=256,S=g.document.createElement("canvas");S.width=O,S.height=1;let A=S.getContext("2d");for(let D=0,C=O-1;D<O;++D)A.fillStyle=N(D/C),A.fillRect(D,0,1,1);b.append("image").attr("opacity",m).attr("x",l).attr("y",s).attr("width",i-l-a).attr("height",o-s-c).attr("preserveAspectRatio","none").attr("xlink:href",S.toDataURL())}else if(_==="threshold"){let N=M,O=h===void 0?S=>S:typeof h=="string"?ei(h):h;x=v(_s().domain([-1,E.length-1]),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(E).enter().append("rect").attr("x",(S,A)=>x(A-1)).attr("y",s).attr("width",(S,A)=>x(A)-x(A-1)).attr("height",o-s-c).attr("fill",S=>S),f=Yt(N,(S,A)=>A),h=S=>O(N[S],S)}else x=v(Sa().domain(M),[l,i-a]),b.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",x).attr("y",s).attr("width",Math.max(0,x.bandwidth()-1)).attr("height",o-s-c).attr("fill",B),w=()=>{};return b.append("g").attr("transform",`translate(0,${o-c})`).call(jv(x).ticks(Array.isArray(f)?null:f,typeof h=="string"?h:void 0).tickFormat(typeof h=="function"?h:void 0).tickSize(r).tickValues(Array.isArray(f)?f:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ue(d,"normal")).call(w).call(N=>N.select(".domain").remove()),n!==void 0&&b.append("text").attr("x",l).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),b.node()}var wf=Math.PI/180;function Ci(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=FI(n),e.markerMid=FI(r),e.markerEnd=FI(i)}function FI(e){if(e==null||e===!1)return null;if(e===!0)return hN;if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"none":return null;case"arrow":return fN("auto");case"arrow-reverse":return fN("auto-start-reverse");case"dot":return nY;case"circle":case"circle-fill":return hN;case"circle-stroke":return rY;case"tick":return CI("auto");case"tick-x":return CI(90);case"tick-y":return CI(0)}throw new Error(`invalid marker: ${e}`)}function fN(e){return(t,n)=>lt("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",e).attr("fill","none").attr("stroke",t).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function nY(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function hN(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",e).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function rY(e,t){return lt("svg:marker",t).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",e).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function CI(e){return(t,n)=>lt("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",e).attr("stroke",t).call(r=>r.append("path").attr("d","M0,-3v6")).node()}var iY=0;function zs(e,t,{stroke:n},r){return pN(e,t,n&&(i=>n[i]),r)}function dN(e,t,{stroke:n},r){return pN(e,t,n&&(([i])=>n[i]),r)}function pN(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},o=()=>i,s){let a=new Map;function c(l){return function(u){let f=o(u),h=a.get(l);h||a.set(l,h=new Map);let d=h.get(f);if(!d){let p=this.parentNode.insertBefore(l(f,s),this),m=`plot-marker-${++iY}`;p.setAttribute("id",m),h.set(f,d=`url(#${m})`)}return d}}t&&e.attr("marker-start",c(t)),n&&e.attr("marker-mid",c(n)),r&&e.attr("marker-end",c(r))}function pl({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=mN(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function ml({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=mN(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function mN(e,t,n){return e===void 0&&t===void 0&&n===void 0?Ne?[1,0]:[.5,.5]:[t,n]}function yN(e,{interval:t}){return e={...ai(e)},e.interval=sf(e.interval===void 0?t:e.interval),e}function j1(e,t,n,r){let{[e]:i,[`${e}1`]:o,[`${e}2`]:s}=n,{value:a,interval:c}=yN(i,n);if(a==null||c==null&&!r)return n;let l=Bn(i);if(c==null){let d,p={transform:m=>d||(d=bt(m,a)),label:l};return{...n,[e]:void 0,[`${e}1`]:o===void 0?p:o,[`${e}2`]:s===void 0&&!(o===s&&r)?p:s}}let u,f;function h(d){return f!==void 0&&d===u?f:f=Yt(bt(u=d,a),p=>c.floor(p))}return t({...n,[e]:void 0,[`${e}1`]:o===void 0?{transform:h,label:l}:o,[`${e}2`]:s===void 0?{transform:d=>h(d).map(p=>c.offset(p)),label:l}:s})}function gN(e,t,n){let{[e]:r}=n,{value:i,interval:o}=yN(r,n);return i==null||o==null?n:t({...n,[e]:{label:Bn(r),transform:s=>{let a=Yt(bt(s,i),l=>o.floor(l)),c=a.map(l=>o.offset(l));return a.map(Be(a)?(l,u)=>l==null||isNaN(l=+l)||(u=c[u],u==null)||isNaN(u=+u)?void 0:new Date((l+u)/2):(l,u)=>l==null||(u=c[u],u==null)?NaN:(+l+ +u)/2)}}})}function RI(e={}){return j1("x",pl,e,!0)}function kI(e={}){return j1("y",ml,e,!0)}function Y1(e={}){return j1("x",pl,e)}function W1(e={}){return j1("y",ml,e)}function G1(e={}){return gN("x",pl,e)}function X1(e={}){return gN("y",ml,e)}var bN={ariaLabel:"rule",fill:null,stroke:"currentColor"},_m=class extends wt{constructor(t,n={}){let{x:r,y1:i,y2:o,inset:s=0,insetTop:a=s,insetBottom:c=s}=n;super(t,{x:{value:r,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},Fi(n,"x"),bN),this.insetTop=Bt(a),this.insetBottom=Bt(c),Ci(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y1:l,y2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:y}=i,{insetTop:g,insetBottom:b}=this;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s},Ne,0).call(w=>w.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",c?x=>c[x]:(m+f-p)/2).attr("x2",c?x=>c[x]:(m+f-p)/2).attr("y1",l&&!sr(a)?x=>l[x]+g:d+g).attr("y2",u&&!sr(a)?a.bandwidth?x=>u[x]+a.bandwidth()-b:x=>u[x]-b:h-y-b).call(Zt,this,r).call(zs,this,r,o)).node()}},vm=class extends wt{constructor(t,n={}){let{x1:r,x2:i,y:o,inset:s=0,insetRight:a=s,insetLeft:c=s}=n;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Fi(n,"y"),bN),this.insetRight=Bt(a),this.insetLeft=Bt(c),Ci(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{y:c,x1:l,x2:u}=r,{width:f,height:h,marginTop:d,marginRight:p,marginLeft:m,marginBottom:y}=i,{insetLeft:g,insetRight:b}=this;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{y:c&&a},0,Ne).call(w=>w.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",l&&!sr(s)?x=>l[x]+g:m+g).attr("x2",u&&!sr(s)?s.bandwidth?x=>u[x]+s.bandwidth()-b:x=>u[x]-b:f-p-b).attr("y1",c?x=>c[x]:(d+h-y)/2).attr("y2",c?x=>c[x]:(d+h-y)/2).call(Zt,this,r).call(zs,this,r,o)).node()}};function Rr(e,t){let{x:n=X,y:r,y1:i,y2:o,...s}=W1(t);return[i,o]=xN(r,i,o),new _m(e,{...s,x:n,y1:i,y2:o})}function kr(e,t){let{y:n=X,x:r,x1:i,x2:o,...s}=Y1(t);return[i,o]=xN(r,i,o),new vm(e,{...s,y:n,x1:i,x2:o})}function xN(e,t,n){if(e==null){if(t===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,t]}else{if(t===void 0)return n===void 0?[0,e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}function ja(e,...t){let n=t.length;for(let r=0,i=!0;r<n;++r)typeof t[r]!="function"&&(i&&(e=e.slice(),i=!1),e.splice(r,2,e[r]+t[r]+e[r+1]),t.splice(r,1),--r,--n);return r=>{let i=e[0];for(let o=0;o<n;++o)i+=t[o](r)+e[o+1];return i}}var oY={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},IN="\xAD",gl=class extends wt{constructor(t,n={}){let{x:r,y:i,text:o=or(t)&&y1(t)?X:Ae,frameAnchor:s,textAnchor:a=/right$/i.test(s)?"end":/left$/i.test(s)?"start":"middle",lineAnchor:c=/^top/i.test(s)?"top":/^bottom/i.test(s)?"bottom":"middle",lineHeight:l=1,lineWidth:u=1/0,textOverflow:f,monospace:h,fontFamily:d=h?"ui-monospace, monospace":void 0,fontSize:p,fontStyle:m,fontVariant:y,fontWeight:g,rotate:b}=n,[w,x]=oe(b,0),[v,_]=lY(p);if(super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:v,optional:!0},rotate:{value:BD(w),optional:!0},text:{value:o,filter:im,optional:!0}},n,oY),this.rotate=x,this.textAnchor=ue(a,"middle"),this.lineAnchor=rn(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+u,this.textOverflow=UI(f),this.monospace=!!h,this.fontFamily=Ue(d),this.fontSize=_,this.fontStyle=Ue(m),this.fontVariant=Ue(y),this.fontWeight=Ue(g),this.frameAnchor=No(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=zI(this),this.clipLine=qI(this)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,rotate:u,text:f,title:h,fontSize:d}=r,{rotate:p}=this,[m,y]=gn(this,i);return lt("svg:g",o).call(Ot,this,i,o).call(PI,this,f,i).call(Mt,this,{x:c&&s,y:l&&a}).call(g=>g.selectAll().data(t).enter().append("text").call(Nt,this).call(sY,this,f,h).attr("transform",ja`translate(${c?b=>c[b]:m},${l?b=>l[b]:y})${u?b=>` rotate(${u[b]})`:p?` rotate(${p})`:""}`).call(ut,"font-size",d&&(b=>d[b])).call(Zt,this,r)).node()}};function UI(e){return e==null?null:rn(e,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function sY(e,t,n,r){if(!n)return;let{lineAnchor:i,lineHeight:o,textOverflow:s,splitLines:a,clipLine:c}=t;e.each(function(l){let u=a(Fo(n[l])??"").map(c),f=u.length,h=i==="top"?.71:i==="bottom"?1-f:(164-f*100)/200;if(f>1){let d=0;for(let p=0;p<f;++p){if(++d,!u[p])continue;let m=this.ownerDocument.createElementNS(Kr.svg,"tspan");m.setAttribute("x",0),p===d-1?m.setAttribute("y",`${(h+p)*o}em`):m.setAttribute("dy",`${d*o}em`),m.textContent=u[p],this.appendChild(m),d=0}}else h&&this.setAttribute("y",`${h*o}em`),this.textContent=u[0];if(s&&!r&&u[0]!==n[l]){let d=this.ownerDocument.createElementNS(Kr.svg,"title");d.textContent=n[l],this.appendChild(d)}})}function Co(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new gl(e,{...r,x:t,y:n})}function H1(e,{x:t=X,...n}={}){return new gl(e,X1({...n,x:t}))}function Z1(e,{y:t=X,...n}={}){return new gl(e,G1({...n,y:t}))}function PI(e,t,n){ut(e,"text-anchor",t.textAnchor),ut(e,"font-family",t.fontFamily),ut(e,"font-size",t.fontSize),ut(e,"font-style",t.fontStyle),ut(e,"font-variant",t.fontVariant===void 0?aY(n):t.fontVariant),ut(e,"font-weight",t.fontWeight)}function aY(e){return e&&(Fs(e)||Be(e))?"tabular-nums":void 0}var cY=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function lY(e){return e==null||typeof e=="number"?[void 0,e]:typeof e!="string"?[e,void 0]:(e=e.trim().toLowerCase(),cY.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0])}function uY(e,t,n){let r=[],i,o=0;for(let[s,a,c]of fY(e)){if(i===void 0&&(i=s),o>i&&n(e,i,a)>t&&(r.push(e.slice(i,o)+(e[o-1]===IN?"-":"")),i=s),c){r.push(e.slice(i,a)),i=void 0;continue}o=a}return r}function*fY(e){let t=0,n=0,r=e.length;for(;n<r;){let i=1;switch(e[n]){case IN:case"-":++n,yield[t,n,!1],t=n;break;case" ":for(yield[t,n,!1];e[++n]===" ";);t=n;break;case"\r":e[n+1]===`
|
|
26
|
-
`&&++
|
|
27
|
-
`:yield[t,n,!0],n+=i,t=n;break;default:++n;break}}yield[t,n,!0]}var wN={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function K1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=_f(e,i))r+=wN[e[i]]??(AN(e,i)?120:wN.e);return r}function Q1(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=_f(e,i))r+=AN(e,i)?126:63;return r}function zI({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return o=>o.split(/\r\n?|\n/g);let r=e?Q1:K1,i=t*100;return o=>uY(o,i,r)}function qI({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return o=>o;let r=e?Q1:K1,i=t*100;switch(n){case"clip-start":return o=>vN(o,i,r,"");case"clip-end":return o=>_N(o,i,r,"");case"ellipsis-start":return o=>vN(o,i,r,yl);case"ellipsis-middle":return o=>hY(o,i,r,yl);case"ellipsis-end":return o=>_N(o,i,r,yl)}}var yl="\u2026";function bl(e,t,n,r){let i=[],o=0;for(let s=0,a=0,c=e.length;s<c;s=a){a=_f(e,s);let l=n(e,s,a);if(o+l>t){for(o+=r;o>t&&s>0;)a=s,s=i.pop(),o-=n(e,s,a);return[s,t-o]}o+=l,i.push(s)}return[-1,0]}function _N(e,t,n,r){e=e.trim();let i=n(r),[o]=bl(e,t,n,i);return o<0?e:e.slice(0,o).trimEnd()+r}function hY(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r)/2,[s,a]=bl(e,t/2,n,o),[c]=bl(e,i-t/2-a+o,n,-o);return c<0?r:e.slice(0,s).trimEnd()+r+e.slice(_f(e,c)).trimStart()}function vN(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let o=n(r),[s]=bl(e,i-t+o,n,-o);return s<0?r:r+e.slice(_f(e,s)).trimStart()}var $I=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,SN=/\p{Extended_Pictographic}/uy;function _f(e,t){return t+=dY(e,t)?2:1,mY(e,t)&&(t=$I.lastIndex),pY(e,t)?_f(e,t+1):t}function MN(e,t){return e.charCodeAt(t)<128}function dY(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<56320){let r=e.charCodeAt(t+1);return r>=56320&&r<57344}return!1}function pY(e,t){return e.charCodeAt(t)===8205}function mY(e,t){return MN(e,t)?!1:($I.lastIndex=t,$I.test(e))}function AN(e,t){return MN(e,t)?!1:(SN.lastIndex=t,SN.test(e))}var TN={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},EN=3.5,yY=EN*5,DN={draw(e,t,n){let r=t*n/yY;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},BN={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},gY=new Map([["arrow",DN],["spike",BN]]);function bY(e){return e&&typeof e.draw=="function"}function xY(e){if(bY(e))return e;let t=gY.get(`${e}`.toLowerCase());if(t)return t;throw new Error(`invalid shape: ${e}`)}var xl=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o=EN,length:s,rotate:a,shape:c=DN,anchor:l="middle",frameAnchor:u}=n,[f,h]=oe(s,12),[d,p]=oe(a,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:f,scale:"length",optional:!0},rotate:{value:d,optional:!0}},n,TN),this.r=+o,this.length=h,this.rotate=p,this.shape=xY(c),this.anchor=rn(l,"anchor",["start","middle","end"]),this.frameAnchor=No(u)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,length:u,rotate:f}=r,{length:h,rotate:d,anchor:p,shape:m,r:y}=this,[g,b]=gn(this,i);return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(w=>w.selectAll().data(t).enter().append("path").call(Nt,this).attr("transform",ja`translate(${c?x=>c[x]:g},${l?x=>l[x]:b})${f?x=>` rotate(${f[x]})`:d?` rotate(${d})`:""}${p==="start"?"":p==="end"?u?x=>` translate(0,${u[x]})`:` translate(0,${h})`:u?x=>` translate(0,${u[x]/2})`:` translate(0,${h/2})`}`).attr("d",u?x=>{let v=Qn();return m.draw(v,u[x],y),v}:(()=>{let x=Qn();return m.draw(x,h,y),x})()).call(Zt,this,r)).node()}};function VI(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=Ce(n,r)),new xl(e,{...i,x:n,y:r})}function J1(e,t={}){let{x:n=X,...r}=t;return new xl(e,{...r,x:n})}function tw(e,t={}){let{y:n=X,...r}=t;return new xl(e,{...r,y:n})}function NN(e,t={}){let{shape:n=BN,stroke:r=TN.stroke,strokeWidth:i=1,fill:o=r,fillOpacity:s=.3,anchor:a="start",...c}=t;return VI(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:o,fillOpacity:s,anchor:a})}function Ya(e,t){return arguments.length<2&&!or(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function ew({anchor:e}={},t){return e===void 0?t[0]:rn(e,"anchor",t)}function ON(e){return ew(e,["left","right"])}function LN(e){return ew(e,["right","left"])}function FN(e){return ew(e,["bottom","top"])}function CN(e){return ew(e,["top","bottom"])}function Sm(){let[e,t]=Ya(...arguments);return RN("y",ON(t),e,t)}function nw(){let[e,t]=Ya(...arguments);return RN("fy",LN(t),e,t)}function Im(){let[e,t]=Ya(...arguments);return kN("x",FN(t),e,t)}function rw(){let[e,t]=Ya(...arguments);return kN("fx",CN(t),e,t)}function RN(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="y"?6:0,tickPadding:m,tickRotate:y,x:g,margin:b,marginTop:w=b===void 0?20:b,marginRight:x=b===void 0?t==="right"?40:0:b,marginBottom:v=b===void 0?20:b,marginLeft:_=b===void 0?t==="left"?40:0:b,label:M,labelAnchor:E,labelArrow:T,labelOffset:B,...I}){return p=Bt(p),m=Bt(m),y=Bt(y),E!==void 0&&(E=rn(E,"labelAnchor",["center","top","bottom"])),T=YN(T),Qe(p&&!ne(o)?wY(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:y,x:g,...I}):null,ne(c)?null:vY(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,x:g,marginTop:w,marginRight:x,marginBottom:v,marginLeft:_,...I}),!ne(c)&&M!==null?Co([],zN({fill:c,fillOpacity:l,...I},function(N,O,S,A,D){let C=A[e],{marginTop:R,marginRight:F,marginBottom:k,marginLeft:$}=e==="y"&&D.inset||D,U=E??(C.bandwidth?"center":"top"),W=B??(t==="right"?F:$)-3;return U==="center"?(this.textAnchor=void 0,this.lineAnchor=t==="right"?"bottom":"top",this.frameAnchor=t,this.rotate=-90):(this.textAnchor=t==="right"?"end":"start",this.lineAnchor=U,this.frameAnchor=`${U}-${t}`,this.rotate=0),this.dy=U==="top"?3-R:U==="bottom"?k-3:0,this.dx=t==="right"?W:-W,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[jN(e,C,{anchor:t,label:M,labelAnchor:U,labelArrow:T})]}}}})):null)}function kN(e,t,n,{color:r="currentColor",opacity:i=1,stroke:o=r,strokeOpacity:s=i,strokeWidth:a=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=e==="x"?6:0,tickPadding:m,tickRotate:y,y:g,margin:b,marginTop:w=b===void 0?t==="top"?30:0:b,marginRight:x=b===void 0?20:b,marginBottom:v=b===void 0?t==="bottom"?30:0:b,marginLeft:_=b===void 0?20:b,label:M,labelAnchor:E,labelArrow:T,labelOffset:B,...I}){return p=Bt(p),m=Bt(m),y=Bt(y),E!==void 0&&(E=rn(E,"labelAnchor",["center","left","right"])),T=YN(T),Qe(p&&!ne(o)?_Y(e,t,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:y,y:g,...I}):null,ne(c)?null:SY(e,t,n,{fill:c,fillOpacity:l,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,y:g,marginTop:w,marginRight:x,marginBottom:v,marginLeft:_,...I}),!ne(c)&&M!==null?Co([],zN({fill:c,fillOpacity:l,...I},function(N,O,S,A,D){let C=A[e],{marginTop:R,marginRight:F,marginBottom:k,marginLeft:$}=e==="x"&&D.inset||D,U=E??(C.bandwidth?"center":"right"),W=B??(t==="top"?R:k)-3;return U==="center"?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${U}`,this.textAnchor=U==="right"?"end":"start"),this.lineAnchor=t,this.dy=t==="top"?-W:W,this.dx=U==="right"?F-3:U==="left"?3-$:0,this.ariaLabel=`${e}-axis label`,{facets:[[0]],channels:{text:{value:[jN(e,C,{anchor:t,label:M,labelAnchor:U,labelArrow:T})]}}}})):null)}function wY(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="y"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetLeft:u=l,insetRight:f=l,dx:h=0,y:d=e==="y"?void 0:null,...p}){return vf(tw,e,n,{ariaLabel:`${e}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:i,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:d,...p,dx:t==="left"?+h-Ne+ +u:+h+Ne-f,anchor:"start",length:c,shape:t==="left"?TY:EY})}function _Y(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:o=null,facetAnchor:s=t+(e==="x"?"-empty":""),frameAnchor:a=t,tickSize:c,inset:l=0,insetTop:u=l,insetBottom:f=l,dy:h=0,x:d=e==="x"?void 0:null,...p}){return vf(J1,e,n,{ariaLabel:`${e}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:o,strokeLinecap:i,facetAnchor:s,frameAnchor:a,x:d,...p,dy:t==="bottom"?+h-Ne-f:+h+Ne+ +u,anchor:"start",length:c,shape:t==="bottom"?MY:AY})}function vY(e,t,n,{facetAnchor:r=t+(e==="y"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>60?4*Math.cos(s*wf):0),text:c,textAnchor:l=Math.abs(s)>60?"middle":t==="left"?"end":"start",lineAnchor:u=s>60?"top":s<-60?"bottom":"middle",fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y=e==="y"?void 0:null,...g}){return vf(Z1,e,n,{ariaLabel:`${e}-axis tick label`},{facetAnchor:r,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,y,...g,dx:t==="left"?+m-o-a+ +d:+m+ +o+ +a-p},function(b,w,x,v,_){f===void 0&&(this.fontVariant=VN(b)),c===void 0&&(_.text=qN(b,w,x,v,t))})}function SY(e,t,n,{facetAnchor:r=t+(e==="x"?"-empty":""),frameAnchor:i=t,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>=10?4*Math.cos(s*wf):0),text:c,textAnchor:l=Math.abs(s)>=10?s<0^t==="bottom"?"start":"end":"middle",lineAnchor:u=Math.abs(s)>=10?"middle":t==="bottom"?"top":"bottom",fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:y=e==="x"?void 0:null,...g}){return vf(H1,e,n,{ariaLabel:`${e}-axis tick label`},{facetAnchor:r,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:f,rotate:s,x:y,...g,dy:t==="bottom"?+m+ +o+ +a-p:+m-o-a+ +d},function(b,w,x,v,_){f===void 0&&(this.fontVariant=VN(b)),c===void 0&&(_.text=qN(b,w,x,v,t))})}function iw(){let[e,t]=Ya(...arguments);return $N("y",ON(t),e,t)}function ow(){let[e,t]=Ya(...arguments);return $N("fy",LN(t),e,t)}function sw(){let[e,t]=Ya(...arguments);return UN("x",FN(t),e,t)}function aw(){let[e,t]=Ya(...arguments);return UN("fx",CN(t),e,t)}function $N(e,t,n,{y:r=e==="y"?void 0:null,x:i=null,x1:o=t==="left"?i:null,x2:s=t==="right"?i:null,...a}){return vf(kr,e,n,{ariaLabel:`${e}-grid`,ariaHidden:!0},{y:r,x1:o,x2:s,...PN(a)})}function UN(e,t,n,{x:r=e==="x"?void 0:null,y:i=null,y1:o=t==="top"?i:null,y2:s=t==="bottom"?i:null,...a}){return vf(Rr,e,n,{ariaLabel:`${e}-grid`,ariaHidden:!0},{x:r,y1:o,y2:s,...PN(a)})}function PN({color:e="currentColor",opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...o}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...o}}function zN({fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u=!1},f){return[,e]=De(e),[,t]=oe(t),{facet:"super",x:null,y:null,fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:l,clip:u,initializer:f}}function vf(e,t,n,r,i,o){let s;function a(u,f,h,d,p,m){let y=u==null&&(t==="fx"||t==="fy"),{[t]:g}=d;if(!g)throw new Error(`missing scale: ${t}`);let b=g.domain(),{interval:w,ticks:x,tickFormat:v,tickSpacing:_=t==="x"?80:35}=i;if(typeof x=="string"&&WN(g)&&(w=x,x=void 0),x===void 0&&(x=Bo(w,g.type)??IY(g,_)),u==null){if(or(x))u=Pe(x);else if(La(x))u=jI(x,...ce(b));else if(g.interval){let E=g.interval;if(g.ticks){let[T,B]=ce(b),I=(B-T)/E[tf];E=U3(E,I/x)??E,u=jI(E,T,B)}else{u=b;let T=u.length;E=U3(E,T/x)??E,E!==g.interval&&(u=jI(E,...ce(u)))}if(E===g.interval){let T=Math.round(u.length/x);T>1&&(u=u.filter((B,I)=>I%T===0))}}else g.ticks?u=g.ticks(x):u=b;if(!g.ticks&&u.length&&u!==b){let E=new Xn(b);u=u.filter(T=>E.has(T)),u.length||qn(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t==="y"||t==="x"?f=[ir(u)]:s[t]={scale:t,value:X}}o?.call(this,g,u,x,v,s);let M=Object.fromEntries(Object.entries(s).map(([E,T])=>[E,{...T,value:bt(u,T.value)}]));return y&&(f=m.filterFacets(u,M)),{data:u,facets:f,channels:M}}let c=Se(i).initializer,l=e(n,Se({...i,initializer:a},c));return n==null?(s=l.channels,l.channels={}):s={},r!==void 0&&Object.assign(l,r),l.clip===void 0&&(l.clip=!1),l}function IY(e,t){let[n,r]=ce(e.range());return(r-n)/t}function qN(e,t,n,r,i){return{value:Mm(e,t,n,r,i)}}function Mm(e,t,n,r,i){return typeof r=="function"&&!(e.type==="log"&&e.tickFormat)?r:r===void 0&&t&&Be(t)?vD(e.type,t,i)??Fo:e.tickFormat?e.tickFormat(typeof n=="number"?n:null,r):r===void 0?Fo:typeof r=="string"?(Be(e.domain())?Mo:ei)(r):hn(r)}function jI(e,t,n){return e.range(t,e.offset(e.floor(n)))}var MY={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},AY={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},TY={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},EY={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function VN(e){return e.bandwidth&&!e.interval?void 0:"tabular-nums"}function jN(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:o}={}){if(!(r==null||r.inferred&&WN(t)&&/^(date|time|year)$/i.test(r))){if(r=String(r),o==="auto"&&(o=(!t.bandwidth||t.interval)&&!/[↑↓→←]/.test(r)),!o)return r;if(o===!0){let s=N1(t);s&&(o=/x$/.test(e)||i==="center"?/x$/.test(e)===s<0?"left":"right":s<0?"up":"down")}switch(o){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return n==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return n==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function YN(e="auto"){return ne(e)?!1:typeof e=="boolean"?e:rn(e,"labelArrow",["auto","up","right","down","left"])}function WN(e){return Be(e.domain())}function GN(e,t){if(t==null)return t;let n=e(t);if(!n)throw new Error(`scale not found: ${t}`);return n}function XN(e,{opacity:t,...n}={}){if(!Lo(e)&&!vI(e))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return ZN(e,n,(r,i,o,s)=>r.append("svg").attr("width",o).attr("height",s).attr("fill",i.scale).attr("fill-opacity",oe(t)[1]).append("rect").attr("width","100%").attr("height","100%"))}function HN(e,{fill:t=e.hint?.fill!==void 0?e.hint.fill:"none",fillOpacity:n=1,stroke:r=e.hint?.stroke!==void 0?e.hint.stroke:ne(t)?"currentColor":"none",strokeOpacity:i=1,strokeWidth:o=1.5,r:s=4.5,...a}={},c){let[l,u]=De(t),[f,h]=De(r),d=GN(c,l),p=GN(c,f),m=s*s*Math.PI;return n=oe(n)[1],i=oe(i)[1],o=oe(o)[1],ZN(e,a,(y,g,b,w)=>y.append("svg").attr("viewBox","-8 -8 16 16").attr("width",b).attr("height",w).attr("fill",l==="color"?x=>d.scale(x):u).attr("fill-opacity",n).attr("stroke",f==="color"?x=>p.scale(x):h).attr("stroke-opacity",i).attr("stroke-width",o).append("path").attr("d",x=>{let v=Qn();return e.scale(x).draw(v,m),v}))}function ZN(e,t={},n){let{columns:r,tickFormat:i,fontVariant:o=V1(e),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:l=0,className:u,style:f,width:h}=t,d=za(t);u=gf(u),i=Mm(e.scale,e.domain,void 0,i);let p=lt("div",d).attr("class",`${u}-swatches ${u}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${u}-swatches-columns .${u}-swatch) {
|
|
16
|
+
}`)).call(zc,l),w=k=>k.selectAll(".tick line").attr("y1",s+c-i),b,_=d?(k,O)=>k.rangeRound(O):(k,O)=>k.range(O),{type:v,domain:A,range:T,interpolate:E,scale:$,pivot:S}=t;if(E){let k=T===void 0?E:$r(E.length===1?Bu(E):E,T);b=_($.copy(),Ge(Gt(f,o-a),Math.min(A.length+(S!==void 0),T===void 0?1/0:T.length)));let O=256,M=y.document.createElement("canvas");M.width=O,M.height=1;let I=M.getContext("2d");for(let C=0,N=O-1;C<O;++C)I.fillStyle=k(C/N),I.fillRect(C,0,1,1);x.append("image").attr("opacity",m).attr("x",f).attr("y",s).attr("width",o-f-a).attr("height",i-s-c).attr("preserveAspectRatio","none").attr("xlink:href",M.toDataURL())}else if(v==="threshold"){let k=A,O=p===void 0?M=>M:typeof p=="string"?Hn(p):p;b=_(Co().domain([-1,T.length-1]),[f,o-a]),x.append("g").attr("fill-opacity",m).selectAll().data(T).enter().append("rect").attr("x",(M,I)=>b(I-1)).attr("y",s).attr("width",(M,I)=>b(I)-b(I-1)).attr("height",i-s-c).attr("fill",M=>M),u=Mt(k,(M,I)=>I),p=M=>O(k[M],M)}else b=_(Ei().domain(A),[f,o-a]),x.append("g").attr("fill-opacity",m).selectAll().data(A).enter().append("rect").attr("x",b).attr("y",s).attr("width",Math.max(0,b.bandwidth()-1)).attr("height",i-s-c).attr("fill",$),w=()=>{};return x.append("g").attr("transform",`translate(0,${i-c})`).call(mx(b).ticks(Array.isArray(u)?null:u,typeof p=="string"?p:void 0).tickFormat(typeof p=="function"?p:void 0).tickSize(r).tickValues(Array.isArray(u)?u:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",Xt(h,"normal")).call(w).call(k=>k.select(".domain").remove()),n!==void 0&&x.append("text").attr("x",f).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),x.node()}var Yc=Math.PI/180;function yr(t,{marker:e,markerStart:n=e,markerMid:r=e,markerEnd:o=e}={}){t.markerStart=uv(n),t.markerMid=uv(r),t.markerEnd=uv(o)}function uv(t){if(t==null||t===!1)return null;if(t===!0)return S7;if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return M7("auto");case"arrow-reverse":return M7("auto-start-reverse");case"dot":return UF;case"circle":case"circle-fill":return S7;case"circle-stroke":return jF;case"tick":return pv("auto");case"tick-x":return pv(90);case"tick-y":return pv(0)}throw new Error(`invalid marker: ${t}`)}function M7(t){return(e,n)=>ot("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(r=>r.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function UF(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call(n=>n.append("circle").attr("r",2.5)).node()}function S7(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function jF(t,e){return ot("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-width",1.5).call(n=>n.append("circle").attr("r",3)).node()}function pv(t){return(e,n)=>ot("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",e).call(r=>r.append("path").attr("d","M0,-3v6")).node()}var XF=0;function Ko(t,e,{stroke:n},r){return T7(t,e,n&&(o=>n[o]),null,r)}function A7(t,e,{stroke:n,z:r},o){return T7(t,e,n&&(([i])=>n[i]),r,o)}var hv=1,E7=2;function GF(t,e){let n=new Uint8Array(e.length),r=t.data().filter(i=>i.length>1),o=r.length;for(let i=0,s=Xg;i<o;++i){let a=r[i];if(a.length>1){let c=a[0];s!==(s=er(e[c]))&&(n[c]|=hv)}}for(let i=o-1,s=Xg;i>=0;--i){let a=r[i];if(a.length>1){let c=a[0];s!==(s=er(e[c]))&&(n[c]|=E7)}}return([i])=>n[i]}function T7(t,{markerStart:e,markerMid:n,markerEnd:r,stroke:o},i=()=>o,s,a){if(!e&&!n&&!r)return;let c=new Map,f=s&&GF(t,s);function l(u,p,h){return function(d){if(h&&!h(d))return;let m=i(d),g=c.get(p);g||c.set(p,g=new Map);let y=g.get(m);if(!y){let x=this.parentNode.insertBefore(p(m,a),this),w=`plot-marker-${++XF}`;x.setAttribute("id",w),g.set(m,y=`url(#${w})`)}this.setAttribute(u,y)}}e&&t.each(l("marker-start",e,f&&(u=>f(u)&hv))),n&&f&&t.each(l("marker-start",n,u=>!(f(u)&hv))),n&&t.each(l("marker-mid",n)),r&&t.each(l("marker-end",r,f&&(u=>f(u)&E7)))}function ra({inset:t,insetLeft:e,insetRight:n,...r}={}){return[e,n]=I7(t,e,n),{inset:t,insetLeft:e,insetRight:n,...r}}function oa({inset:t,insetTop:e,insetBottom:n,...r}={}){return[e,n]=I7(t,e,n),{inset:t,insetTop:e,insetBottom:n,...r}}function I7(t,e,n){return t===void 0&&e===void 0&&n===void 0?ee?[1,0]:[.5,.5]:[e,n]}function $7(t,{interval:e}){return t={...nr(t)},t.interval=Cc(t.interval===void 0?e:t.interval),t}function Hg(t,e,n,r){let{[t]:o,[`${t}1`]:i,[`${t}2`]:s}=n,{value:a,interval:c}=$7(o,n);if(a==null||c==null&&!r)return n;let f=Ye(o);if(c==null){let h,d={transform:m=>h||(h=ft(m,a)),label:f};return{...n,[t]:void 0,[`${t}1`]:i===void 0?d:i,[`${t}2`]:s===void 0&&!(i===s&&r)?d:s}}let l,u;function p(h){return u!==void 0&&h===l?u:u=Mt(ft(l=h,a),d=>c.floor(d))}return e({...n,[t]:void 0,[`${t}1`]:i===void 0?{transform:p,label:f}:i,[`${t}2`]:s===void 0?{transform:h=>p(h).map(d=>c.offset(d)),label:f}:s})}function C7(t,e,n){let{[t]:r}=n,{value:o,interval:i}=$7(r,n);return o==null||i==null?n:e({...n,[t]:{label:Ye(r),transform:s=>{let a=Mt(ft(s,o),f=>i.floor(f)),c=a.map(f=>i.offset(f));return a.map(Jt(a)?(f,l)=>f==null||isNaN(f=+f)||(l=c[l],l==null)||isNaN(l=+l)?void 0:new Date((f+l)/2):(f,l)=>f==null||(l=c[l],l==null)?NaN:(+f+ +l)/2)}}})}function dv(t={}){return Hg("x",ra,t,!0)}function mv(t={}){return Hg("y",oa,t,!0)}function Uc(t={}){return Hg("x",ra,t)}function jc(t={}){return Hg("y",oa,t)}function Qg(t={}){return C7("x",ra,t)}function Zg(t={}){return C7("y",oa,t)}var k7={ariaLabel:"rule",fill:null,stroke:"currentColor"},ju=class extends lt{constructor(e,n={}){let{x:r,y1:o,y2:i,inset:s=0,insetTop:a=s,insetBottom:c=s}=n;super(e,{x:{value:r,scale:"x",optional:!0},y1:{value:o,scale:"y",optional:!0},y2:{value:i,scale:"y",optional:!0}},gr(n,"x"),k7),this.insetTop=Ct(a),this.insetBottom=Ct(c),yr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y1:f,y2:l}=r,{width:u,height:p,marginTop:h,marginRight:d,marginLeft:m,marginBottom:g}=o,{insetTop:y,insetBottom:x}=this;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s},ee,0).call(w=>w.selectAll().data(e).enter().append("line").call(ut,this).attr("x1",c?b=>c[b]:(m+u-d)/2).attr("x2",c?b=>c[b]:(m+u-d)/2).attr("y1",f&&!Dn(a)?b=>f[b]+y:h+y).attr("y2",l&&!Dn(a)?a.bandwidth?b=>l[b]+a.bandwidth()-x:b=>l[b]-x:p-g-x).call(vt,this,r).call(Ko,this,r,i)).node()}},Xu=class extends lt{constructor(e,n={}){let{x1:r,x2:o,y:i,inset:s=0,insetRight:a=s,insetLeft:c=s}=n;super(e,{y:{value:i,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:!0},x2:{value:o,scale:"x",optional:!0}},gr(n,"y"),k7),this.insetRight=Ct(a),this.insetLeft=Ct(c),yr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{y:c,x1:f,x2:l}=r,{width:u,height:p,marginTop:h,marginRight:d,marginLeft:m,marginBottom:g}=o,{insetLeft:y,insetRight:x}=this;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{y:c&&a},0,ee).call(w=>w.selectAll().data(e).enter().append("line").call(ut,this).attr("x1",f&&!Dn(s)?b=>f[b]+y:m+y).attr("x2",l&&!Dn(s)?s.bandwidth?b=>l[b]+s.bandwidth()-x:b=>l[b]-x:u-d-x).attr("y1",c?b=>c[b]:(h+p-g)/2).attr("y2",c?b=>c[b]:(h+p-g)/2).call(vt,this,r).call(Ko,this,r,i)).node()}};function Fn(t,e){let{x:n=G,y:r,y1:o,y2:i,...s}=jc(e);return[o,i]=N7(r,o,i),new ju(t,{...s,x:n,y1:o,y2:i})}function Pn(t,e){let{y:n=G,x:r,x1:o,x2:i,...s}=Uc(e);return[o,i]=N7(r,o,i),new Xu(t,{...s,y:n,x1:o,x2:i})}function N7(t,e,n){if(t==null){if(e===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,e]}else{if(e===void 0)return n===void 0?[0,t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}function xr(t,...e){let n=e.length;for(let r=0,o=!0;r<n;++r)typeof e[r]!="function"&&(o&&(t=t.slice(),o=!1),t.splice(r,2,t[r]+e[r]+t[r+1]),e.splice(r,1),--r,--n);return r=>{let o=t[0];for(let i=0;i<n;++i)o+=e[i](r)+t[i+1];return o}}var VF={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},F7="\xAD",sa=class extends lt{constructor(e,n={}){let{x:r,y:o,text:i=gn(e)&&_g(e)?G:Yt,frameAnchor:s,textAnchor:a=/right$/i.test(s)?"end":/left$/i.test(s)?"start":"middle",lineAnchor:c=/^top/i.test(s)?"top":/^bottom/i.test(s)?"bottom":"middle",lineHeight:f=1,lineWidth:l=1/0,textOverflow:u,monospace:p,fontFamily:h=p?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:m,fontVariant:g,fontWeight:y,rotate:x}=n,[w,b]=Lt(x,0),[_,v]=ZF(d);if(super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},fontSize:{value:_,optional:!0},rotate:{value:B8(w),optional:!0},text:{value:i,filter:Eu,optional:!0}},n,VF),this.rotate=b,this.textAnchor=Xt(a,"middle"),this.lineAnchor=be(c,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+f,this.lineWidth=+l,this.textOverflow=yv(u),this.monospace=!!p,this.fontFamily=se(h),this.fontSize=v,this.fontStyle=se(m),this.fontVariant=se(g),this.fontWeight=se(y),this.frameAnchor=Wr(s),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${l}`);this.splitLines=bv(this),this.clipLine=wv(this)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,rotate:l,text:u,title:p,fontSize:h}=r,{rotate:d}=this,[m,g]=ke(this,o);return ot("svg:g",i).call(mt,this,o,i).call(xv,this,u,o).call(pt,this,{x:c&&s,y:f&&a}).call(y=>y.selectAll().data(e).enter().append("text").call(ut,this).call(WF,this,u,p).attr("transform",xr`translate(${c?x=>c[x]:m},${f?x=>f[x]:g})${l?x=>` rotate(${l[x]})`:d?` rotate(${d})`:""}`).call(st,"font-size",h&&(x=>h[x])).call(vt,this,r)).node()}};function yv(t){return t==null?null:be(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function WF(t,e,n,r){if(!n)return;let{lineAnchor:o,lineHeight:i,textOverflow:s,splitLines:a,clipLine:c}=e;t.each(function(f){let l=a(Jr(n[f])??"").map(c),u=l.length,p=o==="top"?.71:o==="bottom"?1-u:(164-u*100)/200;if(u>1){let h=0;for(let d=0;d<u;++d){if(++h,!l[d])continue;let m=this.ownerDocument.createElementNS(sn.svg,"tspan");m.setAttribute("x",0),d===h-1?m.setAttribute("y",`${(p+d)*i}em`):m.setAttribute("dy",`${h*i}em`),m.textContent=l[d],this.appendChild(m),h=0}}else p&&this.setAttribute("y",`${p*i}em`),this.textContent=l[0];if(s&&!r&&l[0]!==n[f]){let h=this.ownerDocument.createElementNS(sn.svg,"title");h.textContent=n[f],this.appendChild(h)}})}function to(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=oe(e,n)),new sa(t,{...r,x:e,y:n})}function Kg(t,{x:e=G,...n}={}){return new sa(t,Zg({...n,x:e}))}function Jg(t,{y:e=G,...n}={}){return new sa(t,Qg({...n,y:e}))}function xv(t,e,n){st(t,"text-anchor",e.textAnchor),st(t,"font-family",e.fontFamily),st(t,"font-size",e.fontSize),st(t,"font-style",e.fontStyle),st(t,"font-variant",e.fontVariant===void 0?HF(n):e.fontVariant),st(t,"font-weight",e.fontWeight)}function HF(t){return t&&(jo(t)||Jt(t))?"tabular-nums":void 0}var QF=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function ZF(t){return t==null||typeof t=="number"?[void 0,t]:typeof t!="string"?[t,void 0]:(t=t.trim().toLowerCase(),QF.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}function KF(t,e,n){let r=[],o,i=0;for(let[s,a,c]of JF(t)){if(o===void 0&&(o=s),i>o&&n(t,o,a)>e&&(r.push(t.slice(o,i)+(t[i-1]===F7?"-":"")),o=s),c){r.push(t.slice(o,a)),o=void 0;continue}i=a}return r}function*JF(t){let e=0,n=0,r=t.length;for(;n<r;){let o=1;switch(t[n]){case F7:case"-":++n,yield[e,n,!1],e=n;break;case" ":for(yield[e,n,!1];t[++n]===" ";);e=n;break;case"\r":t[n+1]===`
|
|
17
|
+
`&&++o;case`
|
|
18
|
+
`:yield[e,n,!0],n+=o,e=n;break;default:++n;break}}yield[e,n,!0]}var O7={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"\u2018":31,"\u2019":31,"\u201C":47,"\u201D":47,"\u2026":82};function ty(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=Xc(t,o))r+=O7[t[o]]??(q7(t,o)?120:O7.e);return r}function ey(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=Xc(t,o))r+=q7(t,o)?126:63;return r}function bv({monospace:t,lineWidth:e,textOverflow:n}){if(n!=null||e==1/0)return i=>i.split(/\r\n?|\n/g);let r=t?ey:ty,o=e*100;return i=>KF(i,o,r)}function wv({monospace:t,lineWidth:e,textOverflow:n}){if(n==null||e==1/0)return i=>i;let r=t?ey:ty,o=e*100;switch(n){case"clip-start":return i=>L7(i,o,r,"");case"clip-end":return i=>R7(i,o,r,"");case"ellipsis-start":return i=>L7(i,o,r,ia);case"ellipsis-middle":return i=>tP(i,o,r,ia);case"ellipsis-end":return i=>R7(i,o,r,ia)}}var ia="\u2026";function aa(t,e,n,r){let o=[],i=0;for(let s=0,a=0,c=t.length;s<c;s=a){a=Xc(t,s);let f=n(t,s,a);if(i+f>e){for(i+=r;i>e&&s>0;)a=s,s=o.pop(),i-=n(t,s,a);return[s,e-i]}i+=f,o.push(s)}return[-1,0]}function R7(t,e,n,r){t=t.trim();let o=n(r),[i]=aa(t,e,n,o);return i<0?t:t.slice(0,i).trimEnd()+r}function tP(t,e,n,r){t=t.trim();let o=n(t);if(o<=e)return t;let i=n(r)/2,[s,a]=aa(t,e/2,n,i),[c]=aa(t,o-e/2-a+i,n,-i);return c<0?r:t.slice(0,s).trimEnd()+r+t.slice(Xc(t,c)).trimStart()}function L7(t,e,n,r){t=t.trim();let o=n(t);if(o<=e)return t;let i=n(r),[s]=aa(t,o-e+i,n,-i);return s<0?r:r+t.slice(Xc(t,s)).trimStart()}var gv=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,D7=/\p{Extended_Pictographic}/uy;function Xc(t,e){return e+=eP(t,e)?2:1,rP(t,e)&&(e=gv.lastIndex),nP(t,e)?Xc(t,e+1):e}function P7(t,e){return t.charCodeAt(e)<128}function eP(t,e){let n=t.charCodeAt(e);if(n>=55296&&n<56320){let r=t.charCodeAt(e+1);return r>=56320&&r<57344}return!1}function nP(t,e){return t.charCodeAt(e)===8205}function rP(t,e){return P7(t,e)?!1:(gv.lastIndex=e,gv.test(t))}function q7(t,e){return P7(t,e)?!1:(D7.lastIndex=e,D7.test(t))}var B7={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},z7=3.5,oP=z7*5,Y7={draw(t,e,n){let r=e*n/oP;t.moveTo(0,0),t.lineTo(0,-e),t.moveTo(-r,r-e),t.lineTo(0,-e),t.lineTo(r,r-e)}},U7={draw(t,e,n){t.moveTo(-n,0),t.lineTo(0,-e),t.lineTo(n,0)}},iP=new Map([["arrow",Y7],["spike",U7]]);function sP(t){return t&&typeof t.draw=="function"}function aP(t){if(sP(t))return t;let e=iP.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid shape: ${t}`)}var ca=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i=z7,length:s,rotate:a,shape:c=Y7,anchor:f="middle",frameAnchor:l}=n,[u,p]=Lt(s,12),[h,d]=Lt(a,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},length:{value:u,scale:"length",optional:!0},rotate:{value:h,optional:!0}},n,B7),this.r=+i,this.length=p,this.rotate=d,this.shape=aP(c),this.anchor=be(f,"anchor",["start","middle","end"]),this.frameAnchor=Wr(l)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,length:l,rotate:u}=r,{length:p,rotate:h,anchor:d,shape:m,r:g}=this,[y,x]=ke(this,o);return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(w=>w.selectAll().data(e).enter().append("path").call(ut,this).attr("transform",xr`translate(${c?b=>c[b]:y},${f?b=>f[b]:x})${u?b=>` rotate(${u[b]})`:h?` rotate(${h})`:""}${d==="start"?"":d==="end"?l?b=>` translate(0,${l[b]})`:` translate(0,${p})`:l?b=>` translate(0,${l[b]/2})`:` translate(0,${p/2})`}`).attr("d",l?b=>{let _=fn();return m.draw(_,l[b],g),_}:(()=>{let b=fn();return m.draw(b,p,g),b})()).call(vt,this,r)).node()}};function vv(t,e={}){let{x:n,y:r,...o}=e;return e.frameAnchor===void 0&&([n,r]=oe(n,r)),new ca(t,{...o,x:n,y:r})}function ny(t,e={}){let{x:n=G,...r}=e;return new ca(t,{...r,x:n})}function ry(t,e={}){let{y:n=G,...r}=e;return new ca(t,{...r,y:n})}function j7(t,e={}){let{shape:n=U7,stroke:r=B7.stroke,strokeWidth:o=1,fill:i=r,fillOpacity:s=.3,anchor:a="start",...c}=e;return vv(t,{...c,shape:n,stroke:r,strokeWidth:o,fill:i,fillOpacity:s,anchor:a})}function Wi(t,e){return arguments.length<2&&!gn(t)&&(e=t,t=null),e===void 0&&(e={}),[t,e]}function oy({anchor:t}={},e){return t===void 0?e[0]:be(t,"anchor",e)}function X7(t){return oy(t,["left","right"])}function G7(t){return oy(t,["right","left"])}function V7(t){return oy(t,["bottom","top"])}function W7(t){return oy(t,["top","bottom"])}function Gu(){let[t,e]=Wi(...arguments);return H7("y",X7(e),t,e)}function iy(){let[t,e]=Wi(...arguments);return H7("fy",G7(e),t,e)}function Vu(){let[t,e]=Wi(...arguments);return Q7("x",V7(e),t,e)}function sy(){let[t,e]=Wi(...arguments);return Q7("fx",W7(e),t,e)}function H7(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:s=o,strokeWidth:a=1,fill:c=r,fillOpacity:f=o,textAnchor:l,textStroke:u,textStrokeOpacity:p,textStrokeWidth:h,tickSize:d=t==="y"?6:0,tickPadding:m,tickRotate:g,x:y,margin:x,marginTop:w=x===void 0?20:x,marginRight:b=x===void 0?e==="right"?40:0:x,marginBottom:_=x===void 0?20:x,marginLeft:v=x===void 0?e==="left"?40:0:x,label:A,labelAnchor:T,labelArrow:E,labelOffset:$,...S}){return d=Ct(d),m=Ct(m),g=Ct(g),T!==void 0&&(T=be(T,"labelAnchor",["center","top","bottom"])),E=oA(E),ge(d&&!Rt(i)?cP(t,e,n,{stroke:i,strokeOpacity:s,strokeWidth:a,tickSize:d,tickPadding:m,tickRotate:g,x:y,...S}):null,Rt(c)?null:lP(t,e,n,{fill:c,fillOpacity:f,stroke:u,strokeOpacity:p,strokeWidth:h,textAnchor:l,tickSize:d,tickPadding:m,tickRotate:g,x:y,marginTop:w,marginRight:b,marginBottom:_,marginLeft:v,...S}),!Rt(c)&&A!==null?to([],tA({fill:c,fillOpacity:f,...S},function(k,O,M,I,C){let N=I[t],{marginTop:L,marginRight:R,marginBottom:D,marginLeft:F}=t==="y"&&C.inset||C,P=T??(N.bandwidth?"center":"top"),V=$??(e==="right"?R:F)-3;return P==="center"?(this.textAnchor=void 0,this.lineAnchor=e==="right"?"bottom":"top",this.frameAnchor=e,this.rotate=-90):(this.textAnchor=e==="right"?"end":"start",this.lineAnchor=P,this.frameAnchor=`${P}-${e}`,this.rotate=0),this.dy=P==="top"?3-L:P==="bottom"?D-3:0,this.dx=e==="right"?V:-V,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[rA(t,N,{anchor:e,label:A,labelAnchor:P,labelArrow:E})]}}}})):null)}function Q7(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:s=o,strokeWidth:a=1,fill:c=r,fillOpacity:f=o,textAnchor:l,textStroke:u,textStrokeOpacity:p,textStrokeWidth:h,tickSize:d=t==="x"?6:0,tickPadding:m,tickRotate:g,y,margin:x,marginTop:w=x===void 0?e==="top"?30:0:x,marginRight:b=x===void 0?20:x,marginBottom:_=x===void 0?e==="bottom"?30:0:x,marginLeft:v=x===void 0?20:x,label:A,labelAnchor:T,labelArrow:E,labelOffset:$,...S}){return d=Ct(d),m=Ct(m),g=Ct(g),T!==void 0&&(T=be(T,"labelAnchor",["center","left","right"])),E=oA(E),ge(d&&!Rt(i)?fP(t,e,n,{stroke:i,strokeOpacity:s,strokeWidth:a,tickSize:d,tickPadding:m,tickRotate:g,y,...S}):null,Rt(c)?null:uP(t,e,n,{fill:c,fillOpacity:f,stroke:u,strokeOpacity:p,strokeWidth:h,textAnchor:l,tickSize:d,tickPadding:m,tickRotate:g,y,marginTop:w,marginRight:b,marginBottom:_,marginLeft:v,...S}),!Rt(c)&&A!==null?to([],tA({fill:c,fillOpacity:f,...S},function(k,O,M,I,C){let N=I[t],{marginTop:L,marginRight:R,marginBottom:D,marginLeft:F}=t==="x"&&C.inset||C,P=T??(N.bandwidth?"center":"right"),V=$??(e==="top"?L:D)-3;return P==="center"?(this.frameAnchor=e,this.textAnchor=void 0):(this.frameAnchor=`${e}-${P}`,this.textAnchor=P==="right"?"end":"start"),this.lineAnchor=e,this.dy=e==="top"?-V:V,this.dx=P==="right"?R-3:P==="left"?3-F:0,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[rA(t,N,{anchor:e,label:A,labelAnchor:P,labelArrow:E})]}}}})):null)}function cP(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:s=e+(t==="y"?"-empty":""),frameAnchor:a=e,tickSize:c,inset:f=0,insetLeft:l=f,insetRight:u=f,dx:p=0,y:h=t==="y"?void 0:null,...d}){return Gc(ry,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:o,strokeLinejoin:i,facetAnchor:s,frameAnchor:a,y:h,...d,dx:e==="left"?+p-ee+ +l:+p+ee-u,anchor:"start",length:c,shape:e==="left"?mP:gP})}function fP(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:s=e+(t==="x"?"-empty":""),frameAnchor:a=e,tickSize:c,inset:f=0,insetTop:l=f,insetBottom:u=f,dy:p=0,x:h=t==="x"?void 0:null,...d}){return Gc(ny,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:i,strokeLinecap:o,facetAnchor:s,frameAnchor:a,x:h,...d,dy:e==="bottom"?+p-ee-u:+p+ee+ +l,anchor:"start",length:c,shape:e==="bottom"?hP:dP})}function lP(t,e,n,{facetAnchor:r=e+(t==="y"?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:s=0,tickPadding:a=Math.max(3,9-i)+(Math.abs(s)>60?4*Math.cos(s*Yc):0),text:c,textAnchor:f=Math.abs(s)>60?"middle":e==="left"?"end":"start",lineAnchor:l=s>60?"top":s<-60?"bottom":"middle",fontVariant:u,inset:p=0,insetLeft:h=p,insetRight:d=p,dx:m=0,y:g=t==="y"?void 0:null,...y}){return Gc(Jg,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:c,textAnchor:f,lineAnchor:l,fontVariant:u,rotate:s,y:g,...y,dx:e==="left"?+m-i-a+ +h:+m+ +i+ +a-d},function(x,w,b,_,v){u===void 0&&(this.fontVariant=nA(x)),c===void 0&&(v.text=eA(x,w,b,_,e))})}function uP(t,e,n,{facetAnchor:r=e+(t==="x"?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:s=0,tickPadding:a=Math.max(3,9-i)+(Math.abs(s)>=10?4*Math.cos(s*Yc):0),text:c,textAnchor:f=Math.abs(s)>=10?s<0^e==="bottom"?"start":"end":"middle",lineAnchor:l=Math.abs(s)>=10?"middle":e==="bottom"?"top":"bottom",fontVariant:u,inset:p=0,insetTop:h=p,insetBottom:d=p,dy:m=0,x:g=t==="x"?void 0:null,...y}){return Gc(Kg,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:c===void 0?null:c,textAnchor:f,lineAnchor:l,fontVariant:u,rotate:s,x:g,...y,dy:e==="bottom"?+m+ +i+ +a-d:+m-i-a+ +h},function(x,w,b,_,v){u===void 0&&(this.fontVariant=nA(x)),c===void 0&&(v.text=eA(x,w,b,_,e))})}function ay(){let[t,e]=Wi(...arguments);return Z7("y",X7(e),t,e)}function cy(){let[t,e]=Wi(...arguments);return Z7("fy",G7(e),t,e)}function fy(){let[t,e]=Wi(...arguments);return K7("x",V7(e),t,e)}function ly(){let[t,e]=Wi(...arguments);return K7("fx",W7(e),t,e)}function Z7(t,e,n,{y:r=t==="y"?void 0:null,x:o=null,x1:i=e==="left"?o:null,x2:s=e==="right"?o:null,...a}){return Gc(Pn,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{y:r,x1:i,x2:s,...J7(a)})}function K7(t,e,n,{x:r=t==="x"?void 0:null,y:o=null,y1:i=e==="top"?o:null,y2:s=e==="bottom"?o:null,...a}){return Gc(Fn,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{x:r,y1:i,y2:s,...J7(a)})}function J7({color:t="currentColor",opacity:e=.1,stroke:n=t,strokeOpacity:r=e,strokeWidth:o=1,...i}){return{stroke:n,strokeOpacity:r,strokeWidth:o,...i}}function tA({fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:f,clip:l=!1},u){return[,t]=Kt(t),[,e]=Lt(e),{facet:"super",x:null,y:null,fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:s,monospace:a,pointerEvents:c,shapeRendering:f,clip:l,initializer:u}}function Gc(t,e,n,r,o,i){let s;function a(l,u,p,h,d,m){let g=l==null&&(e==="fx"||e==="fy"),{[e]:y}=h;if(!y)throw new Error(`missing scale: ${e}`);let x=y.domain(),{interval:w,ticks:b,tickFormat:_,tickSpacing:v=e==="x"?80:35}=o;if(typeof b=="string"&&iA(y)&&(w=b,b=void 0),b===void 0&&(b=Vr(w,y.type)??pP(y,v)),l==null){if(gn(b))l=On(b);else if(Fi(b))l=_v(b,...kt(x));else if(y.interval){let T=y.interval;if(y.ticks){let[E,$]=kt(x),S=($-E)/T[Ec];T=lw(T,S/b)??T,l=_v(T,E,$)}else{l=x;let E=l.length;T=lw(T,E/b)??T,T!==y.interval&&(l=_v(T,...kt(l)))}if(T===y.interval){let E=Math.round(l.length/b);E>1&&(l=l.filter(($,S)=>S%E===0))}}else y.ticks?l=y.ticks(b):l=x;if(!y.ticks&&l.length&&l!==x){let T=new rn(x);l=l.filter(E=>T.has(E)),l.length||Je(`Warning: the ${e}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}e==="y"||e==="x"?u=[mn(l)]:s[e]={scale:e,value:G}}i?.call(this,y,l,b,_,s);let A=Object.fromEntries(Object.entries(s).map(([T,E])=>[T,{...E,value:ft(l,E.value)}]));return g&&(u=m.filterFacets(l,A)),{data:l,facets:u,channels:A}}let c=jt(o).initializer,f=t(n,jt({...o,initializer:a},c));return n==null?(s=f.channels,f.channels={}):s={},r!==void 0&&Object.assign(f,r),f.clip===void 0&&(f.clip=!1),f}function pP(t,e){let[n,r]=kt(t.range());return(r-n)/e}function eA(t,e,n,r,o){return{value:Wu(t,e,n,r,o)}}function Wu(t,e,n,r,o){return typeof r=="function"&&!(t.type==="log"&&t.tickFormat)?r:r===void 0&&e&&Jt(e)?N8(t.type,e,o)??Jr:t.tickFormat?t.tickFormat(typeof n=="number"?n:null,r):r===void 0?Jr:typeof r=="string"?(Jt(t.domain())?Yr:Hn)(r):te(r)}function _v(t,e,n){return t.range(e,t.offset(t.floor(n)))}var hP={draw(t,e){t.moveTo(0,0),t.lineTo(0,e)}},dP={draw(t,e){t.moveTo(0,0),t.lineTo(0,-e)}},mP={draw(t,e){t.moveTo(0,0),t.lineTo(-e,0)}},gP={draw(t,e){t.moveTo(0,0),t.lineTo(e,0)}};function nA(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function rA(t,e,{anchor:n,label:r=e.label,labelAnchor:o,labelArrow:i}={}){if(!(r==null||r.inferred&&iA(e)&&/^(date|time|year)$/i.test(r))){if(r=String(r),i==="auto"&&(i=(!e.bandwidth||e.interval)&&!/[↑↓→←]/.test(r)),!i)return r;if(i===!0){let s=Fg(e);s&&(i=/x$/.test(t)||o==="center"?/x$/.test(t)===s<0?"left":"right":s<0?"up":"down")}switch(i){case"left":return`\u2190 ${r}`;case"right":return`${r} \u2192`;case"up":return n==="right"?`${r} \u2191`:`\u2191 ${r}`;case"down":return n==="right"?`${r} \u2193`:`\u2193 ${r}`}return r}}function oA(t="auto"){return Rt(t)?!1:typeof t=="boolean"?t:be(t,"labelArrow",["auto","up","right","down","left"])}function iA(t){return Jt(t.domain())}function sA(t,e){if(e==null)return e;let n=t(e);if(!n)throw new Error(`scale not found: ${e}`);return n}function aA(t,{opacity:e,...n}={}){if(!Zr(t)&&!Qw(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return fA(t,n,(r,o,i,s)=>r.append("svg").attr("width",i).attr("height",s).attr("fill",o.scale).attr("fill-opacity",Lt(e)[1]).append("rect").attr("width","100%").attr("height","100%"))}function cA(t,{fill:e=t.hint?.fill!==void 0?t.hint.fill:"none",fillOpacity:n=1,stroke:r=t.hint?.stroke!==void 0?t.hint.stroke:Rt(e)?"currentColor":"none",strokeOpacity:o=1,strokeWidth:i=1.5,r:s=4.5,...a}={},c){let[f,l]=Kt(e),[u,p]=Kt(r),h=sA(c,f),d=sA(c,u),m=s*s*Math.PI;return n=Lt(n)[1],o=Lt(o)[1],i=Lt(i)[1],fA(t,a,(g,y,x,w)=>g.append("svg").attr("viewBox","-8 -8 16 16").attr("width",x).attr("height",w).attr("fill",f==="color"?b=>h.scale(b):l).attr("fill-opacity",n).attr("stroke",u==="color"?b=>d.scale(b):p).attr("stroke-opacity",o).attr("stroke-width",i).append("path").attr("d",b=>{let _=fn();return t.scale(b).draw(_,m),_}))}function fA(t,e={},n){let{columns:r,tickFormat:o,fontVariant:i=Wg(t),swatchSize:s=15,swatchWidth:a=s,swatchHeight:c=s,marginLeft:f=0,className:l,style:u,width:p}=e,h=Ui(e);l=Xi(l),o=Wu(t.scale,t.domain,void 0,o);let d=ot("div",h).attr("class",`${l}-swatches ${l}-swatches-${r!=null?"columns":"wrap"}`),m;return r!=null?(m=`:where(.${l}-swatches-columns .${l}-swatch) {
|
|
28
19
|
display: flex;
|
|
29
20
|
align-items: center;
|
|
30
21
|
break-inside: avoid;
|
|
31
22
|
padding-bottom: 1px;
|
|
32
23
|
}
|
|
33
|
-
:where(.${
|
|
24
|
+
:where(.${l}-swatches-columns .${l}-swatch::before) {
|
|
34
25
|
flex-shrink: 0;
|
|
35
26
|
}
|
|
36
|
-
:where(.${
|
|
27
|
+
:where(.${l}-swatches-columns .${l}-swatch-label) {
|
|
37
28
|
white-space: nowrap;
|
|
38
29
|
overflow: hidden;
|
|
39
30
|
text-overflow: ellipsis;
|
|
40
|
-
}`,
|
|
31
|
+
}`,d.style("columns",r).selectAll().data(t.domain).enter().append("div").attr("class",`${l}-swatch`).call(n,t,a,c).call(g=>g.append("div").attr("class",`${l}-swatch-label`).attr("title",o).text(o))):(m=`:where(.${l}-swatches-wrap) {
|
|
41
32
|
display: flex;
|
|
42
33
|
align-items: center;
|
|
43
34
|
min-height: 33px;
|
|
44
35
|
flex-wrap: wrap;
|
|
45
36
|
}
|
|
46
|
-
:where(.${
|
|
37
|
+
:where(.${l}-swatches-wrap .${l}-swatch) {
|
|
47
38
|
display: inline-flex;
|
|
48
39
|
align-items: center;
|
|
49
40
|
margin-right: 1em;
|
|
50
|
-
}`,
|
|
41
|
+
}`,d.selectAll().data(t.domain).enter().append("span").attr("class",`${l}-swatch`).call(n,t,a,c).append(function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))})),d.call(g=>g.insert("style","*").text(`:where(.${l}-swatches) {
|
|
51
42
|
font-family: system-ui, sans-serif;
|
|
52
43
|
font-size: 10px;
|
|
53
44
|
margin-bottom: 0.5em;
|
|
54
45
|
}
|
|
55
|
-
:where(.${
|
|
46
|
+
:where(.${l}-swatch > svg) {
|
|
56
47
|
margin-right: 0.5em;
|
|
57
48
|
overflow: visible;
|
|
58
49
|
}
|
|
59
|
-
${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+h}px`).style("font-variant",ue(o,"normal")).call(bf,f).node()}var cw=new Map([["symbol",HN],["color",JN],["opacity",DY]]);function KN(e={}){for(let[t,n]of cw){let r=e[t];if(Eo(r)){let i=za(e),o;if(t==="symbol"){let{fill:s,stroke:a=s===void 0&&Eo(e.color)?"color":void 0}=e;o={fill:s,stroke:a}}return n(L1(t,r,o),YI(i,r,e),s=>Eo(e[s])?L1(s,e[s]):null)}}throw new Error("unknown legend type; no scale found")}function QN(e,t,n={}){return(r,i)=>{if(!cw.has(r))throw new Error(`unknown legend type: ${r}`);if(r in e)return cw.get(r)(e[r],YI(t,n[r],i),o=>e[o])}}function YI({className:e,...t},{label:n,ticks:r,tickFormat:i}={},o){return RD(o,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function JN(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type==="ordinal"?"swatches":"ramp"),e.domain!==void 0)switch(`${t}`.toLowerCase()){case"swatches":return XN(e,n);case"ramp":return uN(e,n);default:throw new Error(`unknown legend type: ${t}`)}}function DY({type:e,interpolate:t,...n},{legend:r=!0,color:i=en(0,0,0),...o}){if(!t)throw new Error(`${e} opacity scales are not supported`);if(r===!0&&(r="ramp"),`${r}`.toLowerCase()!=="ramp")throw new Error(`${r} opacity legends are not supported`);return JN({type:e,...n,interpolate:BY(i)},{legend:r,...o})}function BY(e){let{r:t,g:n,b:r}=en(e)||en(0,0,0);return i=>`rgba(${t},${n},${r},${i})`}function tO(e,t,n){let r=[];for(let[i,o]of cw){let s=n[i];if(s?.legend&&i in e){let a=o(e[i],YI(t,e[i],s),c=>e[c]);a!=null&&r.push(a)}}return r}var NY={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},OY={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Am=class extends wt{constructor(t={}){let{anchor:n=null,inset:r=0,insetTop:i=r,insetRight:o=r,insetBottom:s=r,insetLeft:a=r,rx:c,ry:l}=t;super(Ba,void 0,t,n==null?NY:OY),this.anchor=j3(n,"anchor",["top","right","bottom","left"]),this.insetTop=Bt(i),this.insetRight=Bt(o),this.insetBottom=Bt(s),this.insetLeft=Bt(a),this.rx=Bt(c),this.ry=Bt(l)}render(t,n,r,i,o){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:l,width:u,height:f}=i,{anchor:h,insetTop:d,insetRight:p,insetBottom:m,insetLeft:y,rx:g,ry:b}=this,w=l+y,x=u-a-p,v=s+d,_=f-c-m;return lt(h?"svg:line":"svg:rect",o).datum(0).call(Ot,this,i,o).call(Nt,this).call(Zt,this,r).call(Mt,this,{}).call(h==="left"?M=>M.attr("x1",w).attr("x2",w).attr("y1",v).attr("y2",_):h==="right"?M=>M.attr("x1",x).attr("x2",x).attr("y1",v).attr("y2",_):h==="top"?M=>M.attr("x1",w).attr("x2",x).attr("y1",v).attr("y2",v):h==="bottom"?M=>M.attr("x1",w).attr("x2",x).attr("y1",_).attr("y2",_):M=>M.attr("x",w).attr("y",v).attr("width",x-w).attr("height",_-v).attr("rx",g).attr("ry",b)).node()}};function Sf(e){return new Am(e)}var WI={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},LY=new Set(["geometry","href","src","ariaLabel","scales"]),Tm=class extends wt{constructor(t,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&or(t)&&y1(t)&&(n={...n,title:X});let{x:r,y:i,x1:o,x2:s,y1:a,y2:c,anchor:l,preferredAnchor:u="bottom",monospace:f,fontFamily:h=f?"ui-monospace, monospace":void 0,fontSize:d,fontStyle:p,fontVariant:m,fontWeight:y,lineHeight:g=1,lineWidth:b=20,frameAnchor:w,format:x,textAnchor:v="start",textOverflow:_,textPadding:M=8,title:E,pointerSize:T=12,pathFilter:B="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(t,{x:{value:o!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:i,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:o==null},y2:{value:c,scale:"y",optional:a==null},title:{value:E,optional:!0}},n,WI),this.anchor=b1(l,"anchor"),this.preferredAnchor=b1(u,"preferredAnchor"),this.frameAnchor=No(w),this.textAnchor=ue(v,"middle"),this.textPadding=+M,this.pointerSize=+T,this.pathFilter=Ue(B),this.lineHeight=+g,this.lineWidth=+b,this.textOverflow=UI(_),this.monospace=!!f,this.fontFamily=Ue(h),this.fontSize=Bt(d),this.fontStyle=Ue(p),this.fontVariant=Ue(m),this.fontWeight=Ue(y);for(let I in WI)I in this.channels&&(this[I]=WI[I]);this.splitLines=zI(this),this.clipLine=qI(this),this.format=typeof x=="string"||typeof x=="function"?{title:x}:{...x}}render(t,n,r,i,o){let s=this,{x:a,y:c,fx:l,fy:u}=n,{ownerSVGElement:f,document:h}=o,{anchor:d,monospace:p,lineHeight:m,lineWidth:y}=this,{textPadding:g,pointerSize:b,pathFilter:w}=this,{marginTop:x,marginLeft:v}=i,{x1:_,y1:M,x2:E,y2:T,x:B=_??E,y:I=M??T}=r,N=l?l(t.fx)-v:0,O=u?u(t.fy)-x:0,[S,A]=gn(this,i),D=OI(r,S),C=LI(r,A),R=p?Q1:K1,F=R(yl),k,$;"title"in r?(k=eO.call(this,{title:r.channels.title},n),$=kY):(k=eO.call(this,r.channels,n),$=$Y);let U=lt("svg:g",o).call(Ot,this,i,o).call(PI,this).call(Mt,this,{x:B&&a,y:I&&c}).call(rt=>rt.selectAll().data(t).enter().append("g").attr("transform",st=>`translate(${Math.round(D(st))},${Math.round(C(st))})`).call(Nt,this).call(st=>st.append("path").attr("filter",w)).call(st=>st.append("text").each(function(j){let ot=Pt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let z=$.call(s,j,t,k,n,r);if(typeof z=="string")for(let H of s.splitLines(z))W(ot,{value:s.clipLine(H)});else{let H=new Set;for(let nt of z){let{label:P=""}=nt;P&&H.has(P)||(H.add(P),W(ot,nt))}}})));function W(rt,{label:st,value:j,color:ot,opacity:z}){st??="",j??="";let H=ot!=null||z!=null,nt,P=y*100,[Lt]=bl(st,P,R,F);if(Lt>=0)st=st.slice(0,Lt).trimEnd()+yl,nt=j.trim(),j="";else{(st||!j&&!H)&&(j=" "+j);let[Wt]=bl(j,P-R(st),R,F);Wt>=0&&(nt=j.trim(),j=j.slice(0,Wt).trimEnd()+yl)}let ft=rt.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");st&&ft.append("tspan").attr("font-weight","bold").text(st),j&&ft.append(()=>h.createTextNode(j)),H&&ft.append("tspan").text(" \u25A0").attr("fill",ot).attr("fill-opacity",z).style("user-select","none"),nt&&ft.append("title").text(nt)}function et(){let{width:rt,height:st}=i.facet??i;U.selectChildren().each(function(j){let{x:ot,width:z,height:H}=this.getBBox();z=Math.round(z),H=Math.round(H);let nt=d;if(nt===void 0){let ft=D(j)+N,Wt=C(j)+O,Ht=ft+z+b+g*2<rt,J=ft-z-b-g*2>0,se=Wt+H+b+g*2<st,gr=Wt-H-b-g*2>0;nt=Ht&&J?se&&gr?s.preferredAnchor:gr?"bottom":"top":se&&gr?Ht?"left":"right":(Ht||J)&&(se||gr)?`${gr?"bottom":"top"}-${Ht?"left":"right"}`:s.preferredAnchor}let P=this.firstChild,Lt=this.lastChild;if(P.setAttribute("d",RY(nt,b,g,z,H)),ot)for(let ft of Lt.childNodes)ft.setAttribute("x",-ot);Lt.setAttribute("y",`${+FY(nt,Lt.childNodes.length,m).toFixed(6)}em`),Lt.setAttribute("transform",`translate(${CY(nt,b,g,z,H)})`)}),U.attr("visibility",null)}return t.length&&(U.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(et):typeof requestAnimationFrame<"u"&&requestAnimationFrame(et)),U.node()}};function uw(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new Tm(e,{...r,x:t,y:n})}function FY(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function CY(e,t,n,r,i){switch(e){case"middle":return[-r/2,i/2];case"top-left":return[n,t+n];case"top":return[-r/2,t/2+n];case"top-right":return[-r-n,t+n];case"right":return[-t/2-r-n,i/2];case"bottom-left":return[n,-t-n];case"bottom":return[-r/2,-t/2-n];case"bottom-right":return[-r-n,-t-n];case"left":return[n+t/2,i/2]}}function RY(e,t,n,r,i){let o=r+n*2,s=i+n*2;switch(e){case"middle":return`M${-o/2},${-s/2}h${o}v${s}h${-o}z`;case"top-left":return`M0,0l${t},${t}h${o-t}v${s}h${-o}z`;case"top":return`M0,0l${t/2},${t/2}h${(o-t)/2}v${s}h${-o}v${-s}h${(o-t)/2}z`;case"top-right":return`M0,0l${-t},${t}h${t-o}v${s}h${o}z`;case"right":return`M0,0l${-t/2},${-t/2}v${t/2-s/2}h${-o}v${s}h${o}v${t/2-s/2}z`;case"bottom-left":return`M0,0l${t},${-t}h${o-t}v${-s}h${-o}z`;case"bottom":return`M0,0l${t/2},${-t/2}h${(o-t)/2}v${-s}h${-o}v${s}h${(o-t)/2}z`;case"bottom-right":return`M0,0l${-t},${-t}h${t-o}v${-s}h${o}z`;case"left":return`M0,0l${t/2},${-t/2}v${t/2-s/2}h${o}v${s}h${-o}v${t/2-s/2}z`}}function eO(e,t){let n={},r=this.format;r=nO(r,e,"x"),r=nO(r,e,"y"),this.format=r;for(let i in r){let o=r[i];if(!(o===null||o===!1))if(i==="fx"||i==="fy")n[i]=!0;else{let s=mm(e,i);s&&(n[i]=s)}}for(let i in e){if(i in n||i in r||LY.has(i))continue;let o=mm(e,i);o&&(n[i]=o)}this.facet&&(t.fx&&!("fx"in r)&&(n.fx=!0),t.fy&&!("fy"in r)&&(n.fy=!0));for(let i in n){let o=this.format[i];if(typeof o=="string"){let s=n[i]?.value??t[i]?.domain()??[];this.format[i]=(Be(s)?Mo:ei)(o)}else if(o===void 0||o===!0){let s=t[i];this.format[i]=s?.bandwidth?Mm(s,s.domain()):Fo}}return n}function nO(e,t,n){if(!(n in e))return e;let r=`${n}1`,i=`${n}2`;if((r in e||!(r in t))&&(i in e||!(i in t)))return e;let o=Object.entries(e),s=e[n];return o.splice(o.findIndex(([a])=>a===n)+1,0,[r,s],[i,s]),Object.fromEntries(o)}function kY(e,t,{title:n}){return this.format.title(n.value[e],e)}function*$Y(e,t,n,r,i){for(let o in n){if(o==="fx"||o==="fy"){yield{label:lw(r,n,o),value:this.format[o](t[o],e)};continue}if(o==="x1"&&"x2"in n||o==="y1"&&"y2"in n)continue;let s=n[o];if(o==="x2"&&"x1"in n)yield{label:iO(r,n,"x"),value:rO(this.format.x2,n.x1,s,e)};else if(o==="y2"&&"y1"in n)yield{label:iO(r,n,"y"),value:rO(this.format.y2,n.y1,s,e)};else{let a=s.value[e],c=s.scale;if(!$e(a)&&c==null)continue;yield{label:lw(r,n,o),value:this.format[o](a,e),color:c==="color"?i[o][e]:null,opacity:c==="opacity"?i[o][e]:null}}}}function rO(e,t,n,r){return n.hint?.length?`${e(n.value[r]-t.value[r],r)}`:`${e(t.value[r],r)}\u2013${e(n.value[r],r)}`}function iO(e,t,n){let r=lw(e,t,`${n}1`,n),i=lw(e,t,`${n}2`,n);return r===i?r:`${r}\u2013${i}`}function lw(e,t,n,r=n){let i=t[n],o=e[i?.scale??n];return String(o?.label??i?.label??r)}function If(e={}){let{facet:t,style:n,title:r,subtitle:i,caption:o,ariaLabel:s,ariaDescription:a}=e,c=gf(e.className),l=e.marks===void 0?[]:sO(e.marks);l.push(...jY(l));let u=qY(t,e),f=new Map;for(let F of l){let k=aO(F,u,e);k&&f.set(F,k)}let h=new Map;u&&Em(h,[u],e),Em(h,f,e);let d=sO(YY(l,h,e));for(let F of d){let k=aO(F,u,e);k&&f.set(F,k)}l.unshift(...d);let p=YB(h,e);if(p!==void 0){let F=u?k1(p,u):void 0;for(let $ of l){if($.facet===null||$.facet==="super")continue;let U=f.get($);U!==void 0&&(U.facetsIndex=$.fx!=null||$.fy!=null?k1(p,U):F)}let k=new Set;for(let{facetsIndex:$}of f.values())$?.forEach((U,W)=>{U?.length>0&&k.add(W)});p.forEach(0<k.size&&k.size<p.length?($,U)=>$.empty=!k.has(U):$=>$.empty=!1);for(let $ of l)if($.facet==="exclude"){let U=f.get($);U!==void 0&&(U.facetsIndex=XB(U.facetsIndex))}}for(let F of fe.keys())Eo(e[F])&&F!=="fx"&&F!=="fy"&&h.set(F,[]);let m=new Map;for(let F of l){if(m.has(F))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:k,channels:$}=f.get(F)??{},{data:U,facets:W,channels:et}=F.initialize(k,$,e);HI(et,e),m.set(F,{data:U,facets:W,channels:et})}let y=bm(Em(h,m,e),e),g=cN(y,l,e);$B(y,g);let b=wI(y),{fx:w,fy:x}=b,v=w||x?_I(y,g):g,_=w||x?QY(b,g):g,M=za(e),E=M.document,T=ds("svg").call(E.documentElement),B=T;M.ownerSVGElement=T,M.className=c,M.projection=QB(e,v),M.filterFacets=(F,k)=>k1(p,{channels:k,groups:C1(F,k)}),M.getMarkState=F=>{let k=m.get(F),$=f.get(F);return{...k,channels:{...k.channels,...$?.channels}}},M.dispatchValue=F=>{B.value!==F&&(B.value=F,B.dispatchEvent(new Event("input",{bubbles:!0})))};let I=new Set;for(let[F,k]of m)if(F.initializer!=null){let $=F.facet==="super"?_:v,U=F.initializer(k.data,k.facets,k.channels,b,$,M);if(U.data!==void 0&&(k.data=U.data),U.facets!==void 0&&(k.facets=U.facets),U.channels!==void 0){let{fx:W,fy:et,...rt}=U.channels;zY(rt),Object.assign(k.channels,rt);for(let st of Object.values(rt)){let{scale:j}=st;j!=null&&!$D(fe.get(j))&&(uO(st,e),I.add(j))}(W!=null||et!=null)&&f.set(F,!0)}}if(I.size){let F=new Map;Em(F,m,e,W=>I.has(W)),Em(h,m,e,W=>I.has(W));let k=KY(bm(F,e),y),{scales:$,...U}=wI(k);Object.assign(y,k),Object.assign(b,U),Object.assign(b.scales,$)}let N,O;p!==void 0&&(N={x:w?.domain(),y:x?.domain()},p=WB(p,N),O=GB(w,x,g));for(let[F,k]of m)k.values=F.scale(k.channels,b,M);let{width:S,height:A}=g;Pt(T).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",S).attr("height",A).attr("viewBox",`0 0 ${S} ${A}`).attr("aria-label",s).attr("aria-description",a).call(F=>F.append("style").text(`:where(.${c}) {
|
|
50
|
+
${m}`)).style("margin-left",f?`${+f}px`:null).style("width",p===void 0?null:`${+p}px`).style("font-variant",Xt(i,"normal")).call(zc,u).node()}var uy=new Map([["symbol",cA],["color",pA],["opacity",yP]]);function lA(t={}){for(let[e,n]of uy){let r=t[e];if(Xr(r)){let o=Ui(t),i;if(e==="symbol"){let{fill:s,stroke:a=s===void 0&&Xr(t.color)?"color":void 0}=t;i={fill:s,stroke:a}}return n(qg(e,r,i),Mv(o,r,t),s=>Xr(t[s])?qg(s,t[s]):null)}}throw new Error("unknown legend type; no scale found")}function uA(t,e,n={}){return(r,o)=>{if(!uy.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return uy.get(r)(t[r],Mv(e,n[r],o),i=>t[i])}}function Mv({className:t,...e},{label:n,ticks:r,tickFormat:o}={},i){return G8(i,{className:t,...e},{label:n,ticks:r,tickFormat:o})}function pA(t,{legend:e=!0,...n}){if(e===!0&&(e=t.type==="ordinal"?"swatches":"ramp"),t.domain!==void 0)switch(`${e}`.toLowerCase()){case"swatches":return aA(t,n);case"ramp":return _7(t,n);default:throw new Error(`unknown legend type: ${e}`)}}function yP({type:t,interpolate:e,...n},{legend:r=!0,color:o=ye(0,0,0),...i}){if(!e)throw new Error(`${t} opacity scales are not supported`);if(r===!0&&(r="ramp"),`${r}`.toLowerCase()!=="ramp")throw new Error(`${r} opacity legends are not supported`);return pA({type:t,...n,interpolate:xP(o)},{legend:r,...i})}function xP(t){let{r:e,g:n,b:r}=ye(t)||ye(0,0,0);return o=>`rgba(${e},${n},${r},${o})`}function hA(t,e,n){let r=[];for(let[o,i]of uy){let s=n[o];if(s?.legend&&o in t){let a=i(t[o],Mv(e,t[o],s),c=>t[c]);a!=null&&r.push(a)}}return r}function Hi(t={}){return bw(t)?t:{...t,x:G}}function Qi(t={}){return ww(t)?t:{...t,y:G}}function py(t,e){if(e.length===1)return{data:t,facets:e};let n=Di(t),r=new Uint8Array(n),o=0;for(let a of e)for(let c of a)r[c]&&++o,r[c]=1;if(o===0)return{data:t,facets:e};t=Li(t);let i=t[pw]=new Uint32Array(n+o);e=e.map(a=>Li(a,Uint32Array));let s=n;r.fill(0);for(let a of e)for(let c=0,f=a.length;c<f;++c){let l=a[c];r[l]?(a[c]=s,t[s]=t[l],i[s]=l,++s):i[l]=l,r[l]=1}return{data:t,facets:e}}function Sv(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{y1:n,y:r=n,x:o,...i}=e,[s,a,c,f]=Wc(r,o,"y","x",t,i);return{...s,y1:n,y:a,x1:c,x2:f,x:$c(c,f)}}function gA(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{y1:n,y:r=n,x:o}=e,[i,s,a]=Wc(r,o,"y","x",t,e);return{...i,y1:n,y:s,x:a}}function yA(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{y1:n,y:r=n,x:o}=e,[i,s,,a]=Wc(r,o,"y","x",t,e);return{...i,y1:n,y:s,x:a}}function Av(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{x1:n,x:r=n,y:o,...i}=e,[s,a,c,f]=Wc(r,o,"x","y",t,i);return{...s,x1:n,x:a,y1:c,y2:f,y:$c(c,f)}}function xA(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{x1:n,x:r=n,y:o}=e,[i,s,a]=Wc(r,o,"x","y",t,e);return{...i,x1:n,x:s,y:a}}function bA(t={},e={}){arguments.length===1&&([t,e]=Vc(t));let{x1:n,x:r=n,y:o}=e,[i,s,,a]=Wc(r,o,"x","y",t,e);return{...i,x1:n,x:s,y:a}}function Zi({x:t,x1:e,x2:n,...r}={}){return r=gr(r,"y"),e===void 0&&n===void 0?Sv({x:t,...r}):([e,n]=vw(t,e,n),{...r,x1:e,x2:n})}function Ki({y:t,y1:e,y2:n,...r}={}){return r=gr(r,"x"),e===void 0&&n===void 0?Av({y:t,...r}):([e,n]=vw(t,e,n),{...r,y1:e,y2:n})}function Vc(t){let{offset:e,order:n,reverse:r,...o}=t;return[{offset:e,order:n,reverse:r},o]}var bP={length:!0};function Wc(t,e=ku,n,r,{offset:o,order:i,reverse:s},a){if(e===null)throw new Error(`stack requires ${r}`);let c=Ke(a),[f,l]=ze(t),[u,p]=$e(e),[h,d]=$e(e);return u.hint=h.hint=bP,o=wP(o),i=MP(i,o,r),[me(a,(m,g,y)=>{({data:m,facets:g}=py(m,g));let x=t==null?void 0:l(Ks(ft(m,t),y?.[n])),w=ft(m,e,Float64Array),b=ft(m,c),_=i&&i(m,x,w,b),v=Di(m),A=p(new Float64Array(v)),T=d(new Float64Array(v)),E=[];for(let $ of g){let S=x?Array.from(De($,k=>x[k]).values()):[$];if(_)for(let k of S)k.sort(_);for(let k of S){let O=0,M=0;s&&k.reverse();for(let I of k){let C=w[I];C<0?O=T[I]=(A[I]=O)+C:C>0?M=T[I]=(A[I]=M)+C:T[I]=A[I]=M}}E.push(S)}return o&&o(E,A,T,b),{data:m,facets:g}}),f,u,h]}function wP(t){if(t!=null){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return vP;case"center":case"silhouette":return _P;case"wiggle":return vA}throw new Error(`unknown offset: ${t}`)}}function wA(t,e){let n=0,r=0;for(let o of t){let i=e[o];i<n&&(n=i),i>r&&(r=i)}return[n,r]}function vP(t,e,n){for(let r of t)for(let o of r){let[i,s]=wA(o,n);for(let a of o){let c=1/(s-i||1);e[a]=c*(e[a]-i),n[a]=c*(n[a]-i)}}}function _P(t,e,n){for(let r of t){for(let o of r){let[i,s]=wA(o,n);for(let a of o){let c=(s+i)/2;e[a]-=c,n[a]-=c}}_A(r,e,n)}MA(t,e,n)}function vA(t,e,n,r){for(let o of t){let i=new nn,s=0;for(let a of o){let c=-1,f=a.map(h=>Math.abs(n[h]-e[h])),l=a.map(h=>{c=r?r[h]:++c;let d=n[h]-e[h],m=i.has(c)?d-i.get(c):0;return i.set(c,d),m}),u=[0,...ad(l)];for(let h of a)e[h]+=s,n[h]+=s;let p=Pe(f);p&&(s-=Pe(f,(h,d)=>(l[d]/2+u[d])*h)/p)}_A(o,e,n)}MA(t,e,n)}function _A(t,e,n){let r=Ft(t,o=>Ft(o,i=>e[i]));for(let o of t)for(let i of o)e[i]-=r,n[i]-=r}function MA(t,e,n){let r=t.length;if(r===1)return;let o=t.map(a=>a.flat()),i=o.map(a=>(Ft(a,c=>e[c])+Tt(a,c=>n[c]))/2),s=Ft(i);for(let a=0;a<r;a++){let c=s-i[a];for(let f of o[a])e[f]+=c,n[f]+=c}}function MP(t,e,n){if(t===void 0&&e===vA)return dA(Te);if(t!=null){if(typeof t=="string"){let r=t.startsWith("-"),o=r?Ws:Te;switch((r?t.slice(1):t).toLowerCase()){case"value":case n:return SP(o);case"z":return AP(o);case"sum":return EP(o);case"appearance":return TP(o);case"inside-out":return dA(o)}return mA(dw(t))}if(typeof t=="function")return(t.length===1?mA:IP)(t);if(vn(t))return $P(t);throw new Error(`invalid order: ${t}`)}}function SP(t){return(e,n,r)=>(o,i)=>t(r[o],r[i])}function AP(t){return(e,n,r,o)=>(i,s)=>t(o[i],o[s])}function EP(t){return hy(t,(e,n,r,o)=>Oa(mn(e),i=>Pe(i,s=>r[s]),i=>o[i]))}function TP(t){return hy(t,(e,n,r,o)=>Oa(mn(e),i=>n[ws(i,s=>r[s])],i=>o[i]))}function dA(t){return hy(t,(e,n,r,o)=>{let i=mn(e),s=Oa(i,u=>n[ws(u,p=>r[p])],u=>o[u]),a=lr(i,u=>Pe(u,p=>r[p]),u=>o[u]),c=[],f=[],l=0;for(let u of s)l<0?(l+=a.get(u),c.push(u)):(l-=a.get(u),f.push(u));return f.reverse().concat(c)})}function mA(t){return e=>{let n=ft(e,t);return(r,o)=>Te(n[r],n[o])}}function IP(t){return e=>vn(e)?(n,r)=>t(e[n],e[r]):(n,r)=>t(e.get(n),e.get(r))}function $P(t){return hy(Te,()=>t)}function hy(t,e){return(n,r,o,i)=>{if(!i)throw new Error("missing channel: z");let s=new nn(e(n,r,o,i).map((a,c)=>[a,c]));return(a,c)=>t(s.get(i[a]),s.get(i[c]))}}var CP={ariaLabel:"rect"},fa=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s}=n;super(e,{x1:{value:r,scale:"x",type:r!=null&&i==null?"band":void 0,optional:!0},y1:{value:o,scale:"y",type:o!=null&&s==null?"band":void 0,optional:!0},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,CP),Hu(this,n),Qu(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x1:c,y1:f,x2:l,y2:u}=r,{marginTop:p,marginRight:h,marginBottom:d,marginLeft:m,width:g,height:y}=o,{projection:x}=i,{insetTop:w,insetRight:b,insetBottom:_,insetLeft:v}=this,{rx:A,ry:T,rx1y1:E,rx1y2:$,rx2y1:S,rx2y2:k}=this;(c||l)&&!x&&Dn(s)&&(c=l=null),(f||u)&&!x&&Dn(a)&&(f=u=null);let O=s?.bandwidth?s.bandwidth():0,M=a?.bandwidth?a.bandwidth():0;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{},0,0).call(I=>I.selectAll().data(e).enter().call(E||$||S||k?C=>C.append("path").call(ut,this).call(Zu,c&&l?N=>c[N]+(l[N]<c[N]?-b:v):c?N=>c[N]+v:m+v,f&&u?N=>f[N]+(u[N]<f[N]?-_:w):f?N=>f[N]+w:p+w,c&&l?N=>l[N]-(l[N]<c[N]?-v:b):c?N=>c[N]+O-b:g-h-b,f&&u?N=>u[N]-(u[N]<f[N]?-w:_):f?N=>f[N]+M-_:y-d-_,this).call(vt,this,r):C=>C.append("rect").call(ut,this).attr("x",c?l?N=>Math.min(c[N],l[N])+v:N=>c[N]+v:m+v).attr("y",f?u?N=>Math.min(f[N],u[N])+w:N=>f[N]+w:p+w).attr("width",c?l?N=>Math.max(0,Math.abs(l[N]-c[N])+O-v-b):O-v-b:g-h-m-b-v).attr("height",f?u?N=>Math.max(0,Math.abs(f[N]-u[N])+M-w-_):M-w-_:y-p-d-w-_).call(st,"rx",A).call(st,"ry",T).call(vt,this,r))).node()}};function Hu(t,{inset:e=0,insetTop:n=e,insetRight:r=e,insetBottom:o=e,insetLeft:i=e}={}){t.insetTop=Ct(n),t.insetRight=Ct(r),t.insetBottom=Ct(o),t.insetLeft=Ct(i)}function Qu(t,{r:e,rx:n,ry:r,rx1:o=e,ry1:i=e,rx2:s=e,ry2:a=e,rx1y1:c=o!==void 0?+o:i!==void 0?+i:0,rx1y2:f=o!==void 0?+o:a!==void 0?+a:0,rx2y1:l=s!==void 0?+s:i!==void 0?+i:0,rx2y2:u=s!==void 0?+s:a!==void 0?+a:0}={}){c||f||l||u?(t.rx1y1=c,t.rx1y2=f,t.rx2y1=l,t.rx2y2=u):(t.rx=Xt(n,"auto"),t.ry=Xt(r,"auto"))}function Zu(t,e,n,r,o,i){let{rx1y1:s,rx1y2:a,rx2y1:c,rx2y2:f}=i;typeof e!="function"&&(e=te(e)),typeof n!="function"&&(n=te(n)),typeof r!="function"&&(r=te(r)),typeof o!="function"&&(o=te(o));let l=Math.max(Math.abs(s+c),Math.abs(a+f)),u=Math.max(Math.abs(s+a),Math.abs(c+f));t.attr("d",p=>{let h=e(p),d=n(p),m=r(p),g=o(p),y=h>m,x=d>g,w=y?m:h,b=y?h:m,_=x?g:d,v=x?d:g,A=Math.min(1,(b-w)/l,(v-_)/u),T=A*(y?x?f:c:x?a:s),E=A*(y?x?a:s:x?f:c),$=A*(y?x?s:a:x?c:f),S=A*(y?x?c:f:x?s:a);return`M${w},${_+my(T,S)}A${T},${T} 0 0 ${T<0?0:1} ${w+dy(T,S)},${_}H${b-dy(E,$)}A${E},${E} 0 0 ${E<0?0:1} ${b},${_+my(E,$)}V${v-my($,E)}A${$},${$} 0 0 ${$<0?0:1} ${b-dy($,E)},${v}H${w+dy(S,T)}A${S},${S} 0 0 ${S<0?0:1} ${w},${v-my(S,T)}Z`})}function dy(t,e){return e<0?t:Math.abs(t)}function my(t,e){return e<0?Math.abs(t):t}function Ku(t,e){return new fa(t,dv(mv(e)))}function Hc(t,e={}){return Yo(e)||(e={...e,y:Yt,x2:G,interval:1}),new fa(t,Zi(mv(Hi(e))))}function Qc(t,e={}){return Yo(e)||(e={...e,x:Yt,y2:G,interval:1}),new fa(t,Ki(dv(Qi(e))))}var kP={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},NP={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1},Ju=class extends lt{constructor(e={}){let{anchor:n=null}=e;super(Oi,void 0,e,n==null?kP:NP),this.anchor=xw(n,"anchor",["top","right","bottom","left"]),Hu(this,e),n||Qu(this,e)}render(e,n,r,o,i){let{marginTop:s,marginRight:a,marginBottom:c,marginLeft:f,width:l,height:u}=o,{anchor:p,insetTop:h,insetRight:d,insetBottom:m,insetLeft:g}=this,{rx:y,ry:x,rx1y1:w,rx1y2:b,rx2y1:_,rx2y2:v}=this,A=f+g,T=l-a-d,E=s+h,$=u-c-m;return ot(p?"svg:line":w||b||_||v?"svg:path":"svg:rect",i).datum(0).call(mt,this,o,i).call(ut,this).call(vt,this,r).call(pt,this,{}).call(p==="left"?S=>S.attr("x1",A).attr("x2",A).attr("y1",E).attr("y2",$):p==="right"?S=>S.attr("x1",T).attr("x2",T).attr("y1",E).attr("y2",$):p==="top"?S=>S.attr("x1",A).attr("x2",T).attr("y1",E).attr("y2",E):p==="bottom"?S=>S.attr("x1",A).attr("x2",T).attr("y1",$).attr("y2",$):w||b||_||v?S=>S.call(Zu,A,E,T,$,this):S=>S.attr("x",A).attr("y",E).attr("width",T-A).attr("height",$-E).attr("rx",y).attr("ry",x)).node()}};function Zc(t){return new Ju(t)}var Ev={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},OP=new Set(["geometry","href","src","ariaLabel","scales"]),tp=class extends lt{constructor(e,n={}){n.tip&&(n={...n,tip:!1}),n.title===void 0&&gn(e)&&_g(e)&&(n={...n,title:G});let{x:r,y:o,x1:i,x2:s,y1:a,y2:c,anchor:f,preferredAnchor:l="bottom",monospace:u,fontFamily:p=u?"ui-monospace, monospace":void 0,fontSize:h,fontStyle:d,fontVariant:m,fontWeight:g,lineHeight:y=1,lineWidth:x=20,frameAnchor:w,format:b,textAnchor:_="start",textOverflow:v,textPadding:A=8,title:T,pointerSize:E=12,pathFilter:$="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=n;super(e,{x:{value:i!=null&&s!=null?null:r,scale:"x",optional:!0},y:{value:a!=null&&c!=null?null:o,scale:"y",optional:!0},x1:{value:i,scale:"x",optional:s==null},y1:{value:a,scale:"y",optional:c==null},x2:{value:s,scale:"x",optional:i==null},y2:{value:c,scale:"y",optional:a==null},title:{value:T,optional:!0}},n,Ev),this.anchor=Sg(f,"anchor"),this.preferredAnchor=Sg(l,"preferredAnchor"),this.frameAnchor=Wr(w),this.textAnchor=Xt(_,"middle"),this.textPadding=+A,this.pointerSize=+E,this.pathFilter=se($),this.lineHeight=+y,this.lineWidth=+x,this.textOverflow=yv(v),this.monospace=!!u,this.fontFamily=se(p),this.fontSize=Ct(h),this.fontStyle=se(d),this.fontVariant=se(m),this.fontWeight=se(g);for(let S in Ev)S in this.channels&&(this[S]=Ev[S]);this.splitLines=bv(this),this.clipLine=wv(this),this.format=typeof b=="string"||typeof b=="function"?{title:b}:{...b}}render(e,n,r,o,i){let s=this,{x:a,y:c,fx:f,fy:l}=n,{ownerSVGElement:u,document:p}=i,{anchor:h,monospace:d,lineHeight:m,lineWidth:g}=this,{textPadding:y,pointerSize:x,pathFilter:w}=this,{marginTop:b,marginLeft:_}=o,{x1:v,y1:A,x2:T,y2:E,x:$=v??T,y:S=A??E}=r,k=f?f(e.fx)-_:0,O=l?l(e.fy)-b:0,[M,I]=ke(this,o),C=fv(r,M),N=lv(r,I),L=d?ey:ty,R=L(ia),D,F;"title"in r?(D=SA.call(this,{title:r.channels.title},n),F=FP):(D=SA.call(this,r.channels,n),F=PP);let P=ot("svg:g",i).call(mt,this,o,i).call(xv,this).call(pt,this,{x:$&&a,y:S&&c}).call(et=>et.selectAll().data(e).enter().append("g").attr("transform",rt=>`translate(${Math.round(C(rt))},${Math.round(N(rt))})`).call(ut,this).call(rt=>rt.append("path").attr("filter",w)).call(rt=>rt.append("text").each(function(j){let nt=bt(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");let z=F.call(s,j,e,D,n,r);if(typeof z=="string")for(let W of s.splitLines(z))V(nt,{value:s.clipLine(W)});else{let W=new Set;for(let tt of z){let{label:q=""}=tt;q&&W.has(q)||(W.add(q),V(nt,tt))}}})));function V(et,{label:rt,value:j,color:nt,opacity:z}){rt??="",j??="";let W=nt!=null||z!=null,tt,q=g*100,[gt]=aa(rt,q,L,R);if(gt>=0)rt=rt.slice(0,gt).trimEnd()+ia,tt=j.trim(),j="";else{(rt||!j&&!W)&&(j=" "+j);let[At]=aa(j,q-L(rt),L,R);At>=0&&(tt=j.trim(),j=j.slice(0,At).trimEnd()+ia)}let at=et.append("tspan").attr("x",0).attr("dy",`${m}em`).text("\u200B");rt&&at.append("tspan").attr("font-weight","bold").text(rt),j&&at.append(()=>p.createTextNode(j)),W&&at.append("tspan").text(" \u25A0").attr("fill",nt).attr("fill-opacity",z).style("user-select","none"),tt&&at.append("title").text(tt)}function J(){let{width:et,height:rt}=o.facet??o;P.selectChildren().each(function(j){let{x:nt,width:z,height:W}=this.getBBox();z=Math.round(z),W=Math.round(W);let tt=h;if(tt===void 0){let at=C(j)+k,At=N(j)+O,It=at+z+x+y*2<et,Z=at-z-x-y*2>0,Dt=At+W+x+y*2<rt,Mn=At-W-x-y*2>0;tt=It&&Z?Dt&&Mn?s.preferredAnchor:Mn?"bottom":"top":Dt&&Mn?It?"left":"right":(It||Z)&&(Dt||Mn)?`${Mn?"bottom":"top"}-${It?"left":"right"}`:s.preferredAnchor}let q=this.firstChild,gt=this.lastChild;if(q.setAttribute("d",DP(tt,x,y,z,W)),nt)for(let at of gt.childNodes)at.setAttribute("x",-nt);gt.setAttribute("y",`${+RP(tt,gt.childNodes.length,m).toFixed(6)}em`),gt.setAttribute("transform",`translate(${LP(tt,x,y,z,W)})`)}),P.attr("visibility",null)}return e.length&&(P.attr("visibility","hidden"),u.isConnected?Promise.resolve().then(J):typeof requestAnimationFrame<"u"&&requestAnimationFrame(J)),P.node()}};function yy(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=oe(e,n)),new tp(t,{...r,x:e,y:n})}function RP(t,e,n){return/^top(?:-|$)/.test(t)?.94-n:-.29-e*n}function LP(t,e,n,r,o){switch(t){case"middle":return[-r/2,o/2];case"top-left":return[n,e+n];case"top":return[-r/2,e/2+n];case"top-right":return[-r-n,e+n];case"right":return[-e/2-r-n,o/2];case"bottom-left":return[n,-e-n];case"bottom":return[-r/2,-e/2-n];case"bottom-right":return[-r-n,-e-n];case"left":return[n+e/2,o/2]}}function DP(t,e,n,r,o){let i=r+n*2,s=o+n*2;switch(t){case"middle":return`M${-i/2},${-s/2}h${i}v${s}h${-i}z`;case"top-left":return`M0,0l${e},${e}h${i-e}v${s}h${-i}z`;case"top":return`M0,0l${e/2},${e/2}h${(i-e)/2}v${s}h${-i}v${-s}h${(i-e)/2}z`;case"top-right":return`M0,0l${-e},${e}h${e-i}v${s}h${i}z`;case"right":return`M0,0l${-e/2},${-e/2}v${e/2-s/2}h${-i}v${s}h${i}v${e/2-s/2}z`;case"bottom-left":return`M0,0l${e},${-e}h${i-e}v${-s}h${-i}z`;case"bottom":return`M0,0l${e/2},${-e/2}h${(i-e)/2}v${-s}h${-i}v${s}h${(i-e)/2}z`;case"bottom-right":return`M0,0l${-e},${-e}h${e-i}v${-s}h${i}z`;case"left":return`M0,0l${e/2},${-e/2}v${e/2-s/2}h${i}v${s}h${-i}v${e/2-s/2}z`}}function SA(t,e){let n={},r=this.format;r=AA(r,t,"x"),r=AA(r,t,"y"),this.format=r;for(let o in r){let i=r[o];if(!(i===null||i===!1))if(o==="fx"||o==="fy")n[o]=!0;else{let s=Pu(t,o);s&&(n[o]=s)}}for(let o in t){if(o in n||o in r||OP.has(o)||(o==="x"||o==="y")&&t.geometry)continue;let i=Pu(t,o);if(i){if(i.scale==null&&i.defaultScale==="color")continue;n[o]=i}}this.facet&&(e.fx&&!("fx"in r)&&(n.fx=!0),e.fy&&!("fy"in r)&&(n.fy=!0));for(let o in n){let i=this.format[o];if(typeof i=="string"){let s=n[o]?.value??e[o]?.domain()??[];this.format[o]=(Jt(s)?Yr:Hn)(i)}else if(i===void 0||i===!0){let s=e[o];this.format[o]=s?.bandwidth?Wu(s,s.domain()):Jr}}return n}function AA(t,e,n){if(!(n in t))return t;let r=`${n}1`,o=`${n}2`;if((r in t||!(r in e))&&(o in t||!(o in e)))return t;let i=Object.entries(t),s=t[n];return i.splice(i.findIndex(([a])=>a===n)+1,0,[r,s],[o,s]),Object.fromEntries(i)}function FP(t,e,{title:n}){return this.format.title(n.value[t],t)}function*PP(t,e,n,r,o){for(let i in n){if(i==="fx"||i==="fy"){yield{label:gy(r,n,i),value:this.format[i](e[i],t)};continue}if(i==="x1"&&"x2"in n||i==="y1"&&"y2"in n)continue;let s=n[i];if(i==="x2"&&"x1"in n)yield{label:TA(r,n,"x"),value:EA(this.format.x2,n.x1,s,t)};else if(i==="y2"&&"y1"in n)yield{label:TA(r,n,"y"),value:EA(this.format.y2,n.y1,s,t)};else{let a=s.value[t],c=s.scale;if(!Ht(a)&&c==null)continue;yield{label:gy(r,n,i),value:this.format[i](a,t),color:c==="color"?o[i][t]:null,opacity:c==="opacity"?o[i][t]:null}}}}function EA(t,e,n,r){return n.hint?.length?`${t(n.value[r]-e.value[r],r)}`:`${t(e.value[r],r)}\u2013${t(n.value[r],r)}`}function TA(t,e,n){let r=gy(t,e,`${n}1`,n),o=gy(t,e,`${n}2`,n);return r===o?r:`${r}\u2013${o}`}function gy(t,e,n,r=n){let o=e[n],i=t[o?.scale??n];return String(i?.label??o?.label??r)}function Kc(t={}){let{facet:e,style:n,title:r,subtitle:o,caption:i,ariaLabel:s,ariaDescription:a}=t,c=Xi(t.className),f=t.marks===void 0?[]:$A(t.marks);f.push(...jP(f));let l=YP(e,t),u=new Map;for(let R of f){let D=CA(R,l,t);D&&u.set(R,D)}let p=new Map;l&&ep(p,[l],t),ep(p,u,t);let h=$A(XP(f,p,t));for(let R of h){let D=CA(R,l,t);D&&u.set(R,D)}f.unshift(...h);let d=r7(p,t);if(d!==void 0){let R=l?Ug(d,l):void 0;for(let F of f){if(F.facet===null||F.facet==="super")continue;let P=u.get(F);P!==void 0&&(P.facetsIndex=F.fx!=null||F.fy!=null?Ug(d,P):R)}let D=new Set;for(let{facetsIndex:F}of u.values())F?.forEach((P,V)=>{P?.length>0&&D.add(V)});d.forEach(0<D.size&&D.size<d.length?(F,P)=>F.empty=!D.has(P):F=>F.empty=!1);for(let F of f)if(F.facet==="exclude"){let P=u.get(F);P!==void 0&&(P.facetsIndex=s7(P.facetsIndex))}}for(let R of qt.keys())Xr(t[R])&&R!=="fx"&&R!=="fy"&&p.set(R,[]);let m=new Map;for(let R of f){if(m.has(R))throw new Error("duplicate mark; each mark must be unique");let{facetsIndex:D,channels:F}=u.get(R)??{},{data:P,facets:V,channels:J}=R.initialize(D,F,t);$v(J,t),m.set(R,{data:P,facets:V,channels:J})}let g=zu(ep(p,m,t),t),y=w7(g,f,t);QS(g,y);let x=Ww(g),{fx:w,fy:b}=x,_=w||b?Hw(g,y):y,v=w||b?KP(x,y):y,A=Ui(t),T=A.document,E=_o("svg").call(T.documentElement),$=E;A.ownerSVGElement=E,A.className=c,A.projection=f7(t,_),A.filterFacets=(R,D)=>Ug(d,{channels:D,groups:zg(R,D)}),A.getMarkState=R=>{let D=m.get(R),F=u.get(R);return{...D,channels:{...D.channels,...F?.channels}}},A.dispatchValue=R=>{$.value!==R&&($.value=R,$.dispatchEvent(new Event("input",{bubbles:!0})))};let S=new Set;for(let[R,D]of m)if(R.initializer!=null){let F=R.facet==="super"?v:_,P=R.initializer(D.data,D.facets,D.channels,x,F,A);if(P.data!==void 0&&(D.data=P.data),P.facets!==void 0&&(D.facets=P.facets),P.channels!==void 0){let{fx:V,fy:J,...et}=P.channels;zP(et),Object.assign(D.channels,et);for(let rt of Object.values(et)){let{scale:j}=rt;j!=null&&!Q8(qt.get(j))&&(OA(rt,t),S.add(j))}(V!=null||J!=null)&&u.set(R,!0)}}if(S.size){let R=new Map;ep(R,m,t,V=>S.has(V)),ep(p,m,t,V=>S.has(V));let D=ZP(zu(R,t),g),{scales:F,...P}=Ww(D);Object.assign(g,D),Object.assign(x,P),Object.assign(x.scales,F)}let k,O;d!==void 0&&(k={x:w?.domain(),y:b?.domain()},d=o7(d,k),O=i7(w,b,y));for(let[R,D]of m)D.values=R.scale(D.channels,x,A);let{width:M,height:I}=y;bt(E).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",M).attr("height",I).attr("viewBox",`0 0 ${M} ${I}`).attr("aria-label",s).attr("aria-description",a).call(R=>R.append("style").text(`:where(.${c}) {
|
|
60
51
|
--plot-background: white;
|
|
61
52
|
display: block;
|
|
62
53
|
height: auto;
|
|
@@ -66,4 +57,4 @@ ${m}`)).style("margin-left",l?`${+l}px`:null).style("width",h===void 0?null:`${+
|
|
|
66
57
|
:where(.${c} text),
|
|
67
58
|
:where(.${c} tspan) {
|
|
68
59
|
white-space: pre;
|
|
69
|
-
}`)).call(bf,n);for(let F of l){let{channels:k,values:$,facets:U}=m.get(F);if(p===void 0||F.facet==="super"){let W=null;if(U&&(W=U[0],W=F.filter(W,k,$),W.length===0))continue;let et=F.render(W,b,$,_,M);if(et==null)continue;T.appendChild(et)}else{let W;for(let et of p){if(!(F.facetAnchor?.(p,N,et)??!et.empty))continue;let rt=null;if(U){let j=f.has(F);if(rt=U[j?et.i:0],rt=F.filter(rt,k,$),rt.length===0)continue;!j&&rt===U[0]&&(rt=Os(rt)),rt.fx=et.x,rt.fy=et.y,rt.fi=et.i}let st=F.render(rt,b,$,v,M);if(st!=null){(W??=Pt(T).append("g")).append(()=>st).datum(et);for(let j of["aria-label","aria-description","aria-hidden","transform"])st.hasAttribute(j)&&(W.attr(j,st.getAttribute(j)),st.removeAttribute(j))}}W?.selectChildren().attr("transform",O)}}let D=tO(y,M,e),{figure:C=r!=null||i!=null||o!=null||D.length>0}=e;C&&(B=E.createElement("figure"),B.className=`${c}-figure`,B.style.maxWidth="initial",r!=null&&B.append(oO(E,r,"h2")),i!=null&&B.append(oO(E,i,"h3")),B.append(...D,T),o!=null&&B.append(UY(E,o)),"value"in T&&(B.value=T.value,delete T.value)),B.scale=qB(b.scales),B.legend=QN(y,M,e);let R=xB();return R>0&&Pt(T).append("text").attr("x",S).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${R.toLocaleString("en-US")} warning${R===1?"":"s"}. Please check the console.`),B}function oO(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function UY(e,t){let n=e.createElement("figcaption");return n.append(t),n}function sO(e){return e.flat(1/0).filter(t=>t!=null).map(PY)}function PY(e){return typeof e.render=="function"?e:new XI(e)}var XI=class extends wt{constructor(t){if(typeof t!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}};function HI(e,t){for(let n in e)uO(e[n],t);return e}function uO(e,t){let{scale:n,transform:r=!0}=e;if(n==null||!r)return;let{type:i,percent:o,interval:s,transform:a=o?c=>c==null?NaN:c*100:X3(s,i)}=t[n]??{};a!=null&&(e.value=Yt(e.value,a),e.transform=!1)}function zY(e){for(let t in e)uI(t,e[t])}function Em(e,t,n,r=MD){for(let{channels:i}of t.values())for(let o in i){let s=i[o],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!eN(n)){let c=n.x?.domain===void 0,l=n.y?.domain===void 0;if(c||l){let[u,f]=rN(s);c&&GI(e,"x",u),l&&GI(e,"y",f)}}}else GI(e,a,s)}return e}function GI(e,t,n){let r=e.get(t);r!==void 0?r.push(n):e.set(t,[n])}function qY(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=Pe(e.data);if(i==null)throw new Error("missing facet data");let o={};n!=null&&(o.fx=uf(i,{value:n,scale:"fx"})),r!=null&&(o.fy=uf(i,{value:r,scale:"fy"})),HI(o,t);let s=C1(i,o);return{channels:o,groups:s,data:e.data}}function aO(e,t,n){if(e.facet===null||e.facet==="super")return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let c=Pe(e.data??r??i);if(c===void 0)throw new Error(`missing facet data in ${e.ariaLabel}`);if(c===null)return;let l={};return r!=null&&(l.fx=uf(c,{value:r,scale:"fx"})),i!=null&&(l.fy=uf(c,{value:i,scale:"fy"})),HI(l,n),{channels:l,groups:C1(c,l)}}if(t===void 0)return;let{channels:o,groups:s,data:a}=t;if(e.facet!=="auto"||e.data===a)return{channels:o,groups:s};a.length>0&&(s.size>1||s.size===1&&o.fx&&o.fy&&[...s][0][1].size>1)&&Pe(e.data)?.length===a.length&&qn(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function VY(e,t={}){return Se({...t,x:null,y:null},(n,r,i,o,s,a)=>a.getMarkState(e))}function jY(e){let t=[];for(let n of e){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:i,preferredAnchor:o}=r;i=/^x$/i.test(i)?Va:/^y$/i.test(i)?Ps:qa,r=i(VY(n,r)),r.title=null,o===void 0&&(r.preferredAnchor=i===Ps?"left":"bottom");let s=uw(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,t.push(s)}}return t}function YY(e,t,n){let{projection:r,x:i={},y:o={},fx:s={},fy:a={},axis:c,grid:l,facet:u={},facet:{axis:f=c,grid:h}=u,x:{axis:d=c,grid:p=d===null?null:l}=i,y:{axis:m=c,grid:y=m===null?null:l}=o,fx:{axis:g=f,grid:b=g===null?null:h}=s,fy:{axis:w=f,grid:x=w===null?null:h}=a}=n;(r||!Eo(i)&&!cO("x",e))&&(d=p=null),(r||!Eo(o)&&!cO("y",e))&&(m=y=null),t.has("fx")||(g=b=null),t.has("fy")||(w=x=null),d===void 0&&(d=!dw(e,"x")),m===void 0&&(m=!dw(e,"y")),g===void 0&&(g=!dw(e,"fx")),w===void 0&&(w=!dw(e,"fy")),d===!0&&(d="bottom"),m===!0&&(m="left"),g===!0&&(g=d==="top"||d===null?"bottom":"top"),w===!0&&(w=m==="right"||m===null?"left":"right");let v=[];return hw(v,x,ow,a),fw(v,w,nw,"right","left",u,a),hw(v,b,aw,s),fw(v,g,rw,"top","bottom",u,s),hw(v,y,iw,o),fw(v,m,Sm,"left","right",n,o),hw(v,p,sw,i),fw(v,d,Im,"bottom","top",n,i),v}function fw(e,t,n,r,i,o,s){if(!t)return;let a=WY(t);s=GY(a?r:t,o,s);let{line:c}=s;(n===Sm||n===Im)&&c&&!Cs(c)&&e.push(Sf(XY(s))),e.push(n(s)),a&&e.push(n({...s,anchor:i,label:null}))}function hw(e,t,n,r){!t||Cs(t)||e.push(n(HY(t,r)))}function WY(e){return/^\s*both\s*$/i.test(e)}function GY(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h=t.label,labelAnchor:d,labelArrow:p=t.labelArrow,labelOffset:m}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}function XY(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+"-empty",stroke:n===!0?void 0:n}}function HY(e,{stroke:t=Fa(e)?e:void 0,ticks:n=ZY(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:o}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:o}}function ZY(e){switch(typeof e){case"number":return!0;case"string":return!Fa(e)}return or(e)||typeof e?.range=="function"}function dw(e,t){let n=`${t}-axis `;return e.some(r=>r.ariaLabel?.startsWith(n))}function cO(e,t){for(let n of t)for(let r in n.channels){let{scale:i}=n.channels[r];if(i===e||i==="projection")return!0}return!1}function KY(e,t){for(let n in e){let r=e[n],i=t[n];r.label===void 0&&i&&(r.label=i.label)}return e}function QY({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s,width:a,height:c}=O1(n),l=e&&lO(e),u=t&&lO(t);return{marginTop:t?u[0]:r,marginRight:e?a-l[1]:i,marginBottom:t?c-u[1]:o,marginLeft:e?l[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function lO(e){let t=e.domain(),n=e(t[0]),r=e(t[t.length-1]);return r<n&&([n,r]=[r,n]),[n,r+e.bandwidth()]}var JY=new Map([["basis",m3],["basis-closed",y3],["basis-open",g3],["bundle",b3],["bump-x",u3],["bump-y",f3],["cardinal",x3],["cardinal-closed",w3],["cardinal-open",_3],["catmull-rom",v3],["catmull-rom-closed",S3],["catmull-rom-open",I3],["linear",Es],["linear-closed",M3],["monotone-x",T3],["monotone-y",E3],["natural",D3],["step",B3],["step-after",O3],["step-before",N3]]);function Dm(e=Es,t){if(typeof e=="function")return e;let n=JY.get(`${e}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${e}`);if(t!==void 0){if("beta"in n)return n.beta(t);if("tension"in n)return n.tension(t);if("alpha"in n)return n.alpha(t)}return n}function pw(e=Wa,t){return typeof e!="function"&&`${e}`.toLowerCase()==="auto"?Wa:Dm(e,t)}function Wa(e){return Es(e)}function Ro(e={y:"count"},t={}){[e,t]=KI(e,t);let{x:n,y:r}=t;return ZI(mw(n,t,X),null,null,r,e,pl(t))}function ko(e={x:"count"},t={}){[e,t]=KI(e,t);let{x:n,y:r}=t;return ZI(null,mw(r,t,X),n,null,e,ml(t))}function qs(e={fill:"count"},t={}){[e,t]=KI(e,t);let{x:n,y:r}=tW(t);return ZI(n,r,null,null,e,pl(ml(t)))}function dO(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=A1}=n,i={filter:null};return n[t]!=null&&(i[t]=r),n[`${t}1`]!=null&&(i[`${t}1`]=r),n[`${t}2`]!=null&&(i[`${t}2`]=r),e(i,n)}function Mf(e={}){return dO(Ro,"y",Fi(e,"x"))}function Af(e={}){return dO(ko,"x",Fi(e,"y"))}function ZI(e,t,n,r,{data:i=M1,filter:o=fm,sort:s,reverse:a,...c}={},l={}){e=fO(e),t=fO(t),c=eW(c,l),i=yO(i,X),s=s==null?void 0:pO("sort",s,l),o=o==null?void 0:mO("filter",o,l),n!=null&&Oo(c,"x","x1","x2")&&(n=null),r!=null&&Oo(c,"y","y1","y2")&&(r=null);let[u,f]=Dn(e),[h,d]=Dn(e),[p,m]=Dn(t),[y,g]=Dn(t),[b,w]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[x,v]=Dn(b),{x:_,y:M,z:E,fill:T,stroke:B,x1:I,x2:N,y1:O,y2:S,domain:A,cumulative:D,thresholds:C,interval:R,...F}=l,[k,$]=Dn(E),[U]=De(T),[W]=De(B),[et,rt]=Dn(U),[st,j]=Dn(W);return{..."z"in l&&{z:k||E},..."fill"in l&&{fill:et||T},..."stroke"in l&&{stroke:st||B},...mn(F,(ot,z,H)=>{let nt=ll(bt(ot,b),H?.[w]),P=bt(ot,E),Lt=bt(ot,U),ft=bt(ot,W),Wt=pm(c,{z:P,fill:Lt,stroke:ft}),Ht=[],J=[],se=nt&&v([]),gr=P&&$([]),ki=Lt&&rt([]),ZL=ft&&j([]),a6=e&&f([]),KL=e&&d([]),c6=t&&m([]),QL=t&&g([]),JL=iW(e,t,ot),tF=0;for(let El of c)El.initialize(ot);s&&s.initialize(ot),o&&o.initialize(ot);for(let El of z){let l6=[];for(let Dl of c)Dl.scope("facet",El);s&&s.scope("facet",El),o&&o.scope("facet",El);for(let[Dl,eF]of Ca(El,Wt))for(let[nF,gy]of Ca(eF,nt))for(let[$i,Vo]of JL(gy))if(Wt&&(Vo.z=Dl),!(o&&!o.reduce($i,Vo))){l6.push(tF++),J.push(i.reduceIndex($i,ot,Vo)),nt&&se.push(nF),P&&gr.push(Wt===P?Dl:P[($i.length>0?$i:gy)[0]]),Lt&&ki.push(Wt===Lt?Dl:Lt[($i.length>0?$i:gy)[0]]),ft&&ZL.push(Wt===ft?Dl:ft[($i.length>0?$i:gy)[0]]),a6&&(a6.push(Vo.x1),KL.push(Vo.x2)),c6&&(c6.push(Vo.y1),QL.push(Vo.y2));for(let rF of c)rF.reduce($i,Vo);s&&s.reduce($i,Vo)}Ht.push(l6)}return aI(Ht,s,a),{data:J,facets:Ht}}),...!Oo(c,"x")&&(u?{x1:u,x2:h,x:of(u,h)}:{x:_,x1:I,x2:N}),...!Oo(c,"y")&&(p?{y1:p,y2:y,y:of(p,y)}:{y:M,y1:O,y2:S}),...x&&{[w]:x},...Object.fromEntries(c.map(({name:ot,output:z})=>[ot,z]))}}function KI({cumulative:e,domain:t,thresholds:n,interval:r,...i},o){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...o}]}function mw(e,{cumulative:t,domain:n,thresholds:r,interval:i},o){return e={...ai(e)},e.domain===void 0&&(e.domain=n),e.cumulative===void 0&&(e.cumulative=t),e.thresholds===void 0&&(e.thresholds=r),e.interval===void 0&&(e.interval=i),e.value===void 0&&(e.value=o),e.thresholds=QI(e.thresholds,e.interval),e}function tW(e){let{x:t,y:n}=e;return t=mw(t,e),n=mw(n,e),[t.value,n.value]=Ce(t.value,n.value),{x:t,y:n}}function fO(e){if(e==null)return;let{value:t,cumulative:n,domain:r=ce,thresholds:i}=e,o=s=>{let a=bt(s,t),c;if(Be(a)||rW(i)){a=Yt(a,V3,Float64Array);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!La(i)?i(a,u,f):i;typeof h=="number"&&(h=Lp(u,f,h)),La(h)&&(r===ce&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f))),c=h}else{a=Ke(a);let[u,f]=typeof r=="function"?r(a):r,h=typeof i=="function"&&!La(i)?i(a,u,f):i;if(typeof h=="number")if(r===ce){let d=us(u,f,h);if(isFinite(d))if(d>0){let p=Math.round(u/d),m=Math.round(f/d);p*d<=u||--p,m*d>f||++m;let y=m-p+1;h=new Float64Array(y);for(let g=0;g<y;++g)h[g]=(p+g)*d}else if(d<0){d=-d;let p=Math.round(u*d),m=Math.round(f*d);p/d<=u||--p,m/d>f||++m;let y=m-p+1;h=new Float64Array(y);for(let g=0;g<y;++g)h[g]=(p+g)/d}else h=[u];else h=[u]}else h=In(u,f,h);else La(h)&&(r===ce&&(u=h.floor(u),f=h.offset(h.floor(f))),h=h.range(u,h.offset(f)));c=h}let l=[];if(c.length===1)l.push([c[0],c[0]]);else for(let u=1;u<c.length;++u)l.push([c[u-1],c[u]]);return l.bin=(n<0?sW:n>0?oW:JI)(l,c,a),l};return o.label=Bn(t),o}function QI(e,t,n=hO){if(e===void 0)return t===void 0?n:Bo(t);if(typeof e=="string"){switch(e.toLowerCase()){case"freedman-diaconis":return sg;case"scott":return Ed;case"sturges":return fa;case"auto":return hO}return sl(e)}return e}function eW(e,t){return oI(e,t,pO)}function pO(e,t,n){return S1(e,t,n,mO)}function mO(e,t,n){return I1(e,t,n,yO)}function yO(e,t){return lf(e,t,nW)}function nW(e){switch(`${e}`.toLowerCase()){case"x":return aW;case"x1":return lW;case"x2":return uW;case"y":return cW;case"y1":return fW;case"y2":return hW;case"z":return cI}throw new Error(`invalid bin reduce: ${e}`)}function hO(e,t,n){return Math.min(200,Ed(e,t,n))}function rW(e){return DD(e)||or(e)&&Be(e)}function iW(e,t,n){let r=e?.(n),i=t?.(n);return r&&i?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries()){let u=i.bin(s[a]);for(let[f,[h,d]]of i.entries())yield[u[f],{data:n,x1:c,y1:h,x2:l,y2:d}]}}:r?function*(o){let s=r.bin(o);for(let[a,[c,l]]of r.entries())yield[s[a],{data:n,x1:c,x2:l}]}:function*(o){let s=i.bin(o);for(let[a,[c,l]]of i.entries())yield[s[a],{data:n,y1:c,y2:l}]}}function JI(e,t,n){return t=Ke(t),r=>{let i=e.map(()=>[]);for(let o of r)i[cs(t,n[o])-1]?.push(o);return i}}function oW(e,t,n){let r=JI(e,t,n);return i=>{let o=r(i);for(let s=1,a=o.length;s<a;++s){let c=o[s-1],l=o[s];for(let u of c)l.push(u)}return o}}function sW(e,t,n){let r=JI(e,t,n);return i=>{let o=r(i);for(let s=o.length-2;s>=0;--s){let a=o[s+1],c=o[s];for(let l of a)c.push(l)}return o}}function gO(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}var aW={reduceIndex(e,t,{x1:n,x2:r}){return gO(n,r)}},cW={reduceIndex(e,t,{y1:n,y2:r}){return gO(n,r)}},lW={reduceIndex(e,t,{x1:n}){return n}},uW={reduceIndex(e,t,{x2:n}){return n}},fW={reduceIndex(e,t,{y1:n}){return n}},hW={reduceIndex(e,t,{y2:n}){return n}};function Tf(e={}){return Y3(e)?e:{...e,x:X}}function Ef(e={}){return W3(e)?e:{...e,y:X}}function bO(e,t){if(t.length===1)return{data:e,facets:t};let n=e.length,r=new Uint8Array(n),i=0;for(let a of t)for(let c of a)r[c]&&++i,r[c]=1;if(i===0)return{data:e,facets:t};e=Oa(e);let o=e[P3]=new Uint32Array(n+i);t=t.map(a=>Oa(a,Uint32Array));let s=n;r.fill(0);for(let a of t)for(let c=0,l=a.length;c<l;++c){let u=a[c];r[u]?(a[c]=s,e[s]=e[u],o[s]=u,++s):o[u]=u,r[u]=1}return{data:e,facets:t}}function tM(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{y1:n,y:r=n,x:i,...o}=t,[s,a,c,l]=Of(r,i,"y","x",e,o);return{...s,y1:n,y:a,x1:c,x2:l,x:of(c,l)}}function _O(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{y1:n,y:r=n,x:i}=t,[o,s,a]=Of(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function vO(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{y1:n,y:r=n,x:i}=t,[o,s,,a]=Of(r,i,"y","x",e,t);return{...o,y1:n,y:s,x:a}}function eM(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{x1:n,x:r=n,y:i,...o}=t,[s,a,c,l]=Of(r,i,"x","y",e,o);return{...s,x1:n,x:a,y1:c,y2:l,y:of(c,l)}}function SO(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{x1:n,x:r=n,y:i}=t,[o,s,a]=Of(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function IO(e={},t={}){arguments.length===1&&([e,t]=Nf(e));let{x1:n,x:r=n,y:i}=t,[o,s,,a]=Of(r,i,"x","y",e,t);return{...o,x1:n,x:s,y:a}}function Df({x:e,x1:t,x2:n,...r}={}){return r=Fi(r,"y"),t===void 0&&n===void 0?tM({x:e,...r}):([t,n]=G3(e,t,n),{...r,x1:t,x2:n})}function Bf({y:e,y1:t,y2:n,...r}={}){return r=Fi(r,"x"),t===void 0&&n===void 0?eM({y:e,...r}):([t,n]=G3(e,t,n),{...r,y1:t,y2:n})}function Nf(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}var dW={length:!0};function Of(e,t=cm,n,r,{offset:i,order:o,reverse:s},a){if(t===null)throw new Error(`stack requires ${r}`);let c=zn(a),[l,u]=Dn(e),[f,h]=pn(t),[d,p]=pn(t);return f.hint=d.hint=dW,i=pW(i),o=gW(o,i,r),[mn(a,(m,y,g)=>{({data:m,facets:y}=bO(m,y));let b=e==null?void 0:u(ll(bt(m,e),g?.[n])),w=bt(m,t,Float64Array),x=bt(m,c),v=o&&o(m,b,w,x),_=m.length,M=h(new Float64Array(_)),E=p(new Float64Array(_)),T=[];for(let B of y){let I=b?Array.from(an(B,N=>b[N]).values()):[B];if(v)for(let N of I)N.sort(v);for(let N of I){let O=0,S=0;s&&N.reverse();for(let A of N){let D=w[A];D<0?O=E[A]=(M[A]=O)+D:D>0?S=E[A]=(M[A]=S)+D:E[A]=M[A]=S}}T.push(I)}return i&&i(T,M,E,x),{data:m,facets:y}}),l,f,d]}function pW(e){if(e!=null){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"expand":case"normalize":return mW;case"center":case"silhouette":return yW;case"wiggle":return AO}throw new Error(`unknown offset: ${e}`)}}function MO(e,t){let n=0,r=0;for(let i of e){let o=t[i];o<n&&(n=o),o>r&&(r=o)}return[n,r]}function mW(e,t,n){for(let r of e)for(let i of r){let[o,s]=MO(i,n);for(let a of i){let c=1/(s-o||1);t[a]=c*(t[a]-o),n[a]=c*(n[a]-o)}}}function yW(e,t,n){for(let r of e){for(let i of r){let[o,s]=MO(i,n);for(let a of i){let c=(s+o)/2;t[a]-=c,n[a]-=c}}TO(r,t,n)}EO(e,t,n)}function AO(e,t,n,r){for(let i of e){let o=new Gn,s=0;for(let a of i){let c=-1,l=a.map(d=>Math.abs(n[d]-t[d])),u=a.map(d=>{c=r?r[d]:++c;let p=n[d]-t[d],m=o.has(c)?p-o.get(c):0;return o.set(c,p),m}),f=[0,...eg(u)];for(let d of a)t[d]+=s,n[d]+=s;let h=Mn(l);h&&(s-=Mn(l,(d,p)=>(u[p]/2+f[p])*d)/h)}TO(i,t,n)}EO(e,t,n)}function TO(e,t,n){let r=le(e,i=>le(i,o=>t[o]));for(let i of e)for(let o of i)t[o]-=r,n[o]-=r}function EO(e,t,n){let r=e.length;if(r===1)return;let i=e.map(a=>a.flat()),o=i.map(a=>(le(a,c=>t[c])+Xt(a,c=>n[c]))/2),s=le(o);for(let a=0;a<r;a++){let c=s-o[a];for(let l of i[a])t[l]+=c,n[l]+=c}}function gW(e,t,n){if(e===void 0&&t===AO)return xO(fn);if(e!=null){if(typeof e=="string"){let r=e.startsWith("-"),i=r?il:fn;switch((r?e.slice(1):e).toLowerCase()){case"value":case n:return bW(i);case"z":return xW(i);case"sum":return wW(i);case"appearance":return _W(i);case"inside-out":return xO(i)}return wO(z3(e))}if(typeof e=="function")return(e.length===1?wO:vW)(e);if(Array.isArray(e))return SW(e);throw new Error(`invalid order: ${e}`)}}function bW(e){return(t,n,r)=>(i,o)=>e(r[i],r[o])}function xW(e){return(t,n,r,i)=>(o,s)=>e(i[o],i[s])}function wW(e){return yw(e,(t,n,r,i)=>au(ir(t),o=>Mn(o,s=>r[s]),o=>i[o]))}function _W(e){return yw(e,(t,n,r,i)=>au(ir(t),o=>n[Bc(o,s=>r[s])],o=>i[o]))}function xO(e){return yw(e,(t,n,r,i)=>{let o=ir(t),s=au(o,f=>n[Bc(f,h=>r[h])],f=>i[f]),a=Ei(o,f=>Mn(f,h=>r[h]),f=>i[f]),c=[],l=[],u=0;for(let f of s)u<0?(u+=a.get(f),c.push(f)):(u-=a.get(f),l.push(f));return l.reverse().concat(c)})}function wO(e){return t=>{let n=bt(t,e);return(r,i)=>fn(n[r],n[i])}}function vW(e){return t=>(n,r)=>e(t[n],t[r])}function SW(e){return yw(fn,()=>e)}function yw(e,t){return(n,r,i,o)=>{if(!o)throw new Error("missing channel: z");let s=new Gn(t(n,r,i,o).map((a,c)=>[a,c]));return(a,c)=>e(s.get(o[a]),s.get(o[c]))}}var IW={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},wl=class extends wt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,z:a,curve:c,tension:l}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:zn(n),optional:!0}},n,IW),this.z=a,this.curve=Dm(c,l)}filter(t){return t}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n,0,0).call(u=>u.selectAll().data(q1(t,[s,a,c,l],this,r)).enter().append("path").call(Nt,this).call(dl,this,r).attr("d",Wu().curve(this.curve).defined(f=>f>=0).x0(f=>s[f]).y0(f=>a[f]).x1(f=>c[f]).y1(f=>l[f]))).node()}};function Bm(e,t){return t===void 0?Vs(e,{x:cl,y:Na}):new wl(e,t)}function Ga(e,t){let{y:n=Ae,...r}=Af(t);return new wl(e,Df(Tf({...r,y1:n,y2:void 0})))}function Vs(e,t){let{x:n=Ae,...r}=Mf(t);return new wl(e,Bf(Ef({...r,x1:n,x2:void 0})))}var MW={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Nm=class extends wt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,curve:a,tension:c}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,MW),this.curve=pw(a,c),Ci(this,n)}project(t,n,r){this.curve!==Wa&&super.project(t,n,r)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a}=r,{curve:u}=this;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(f=>f.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",u===Wa&&o.projection?AW(o.projection,s,a,c,l):h=>{let d=Qn(),p=u(d);return p.lineStart(),p.point(s[h],a[h]),p.point(c[h],l[h]),p.lineEnd(),d}).call(Zt,this,r).call(zs,this,r,o)).node()}};function AW(e,t,n,r,i){let o=Tn(e);return t=Ke(t),n=Ke(n),r=Ke(r),i=Ke(i),s=>o({type:"LineString",coordinates:[[t[s],n[s]],[r[s],i[s]]]})}function gw(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=Om(t,n,r),[o,s]=Om(i,o,s),new Nm(e,{...a,x1:n,x2:r,y1:o,y2:s})}function Om(e,t,n){if(e===void 0){if(t===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[t]}else{if(t===void 0)return n===void 0?[e]:[e,n];if(n===void 0)return[e,t]}return[t,n]}var TW={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},Lm=class extends wt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,bend:a=0,headAngle:c=60,headLength:l=8,inset:u=0,insetStart:f=u,insetEnd:h=u,sweep:d}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:i,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,TW),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+l,this.insetStart=+f,this.insetEnd=+h,this.sweep=EW(d)}render(t,n,r,i,o){let{x1:s,y1:a,x2:c=s,y2:l=a,SW:u}=r,{strokeWidth:f,bend:h,headAngle:d,headLength:p,insetStart:m,insetEnd:y}=this,g=u?x=>u[x]:hn(f===void 0?1:f),b=d*wf/2,w=p/1.5;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(x=>x.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",v=>{let _=s[v],M=a[v],E=c[v],T=l[v],B=Math.hypot(E-_,T-M);if(B<=m+y)return null;let I=Math.atan2(T-M,E-_),N=Math.min(w*g(v),B/3),O=this.sweep(_,M,E,T)*h*wf,S=Math.hypot(B/Math.tan(O),B)/2;if(m||y)if(S<1e5){let et=Math.sign(O),[rt,st]=DW([_,M],[E,T],S,et);if(m&&([_,M]=DO([rt,st,S],[_,M,m],-et*Math.sign(m))),y){let[j,ot]=DO([rt,st,S],[E,T,y],et*Math.sign(y));I+=Math.atan2(ot-st,j-rt)-Math.atan2(T-st,E-rt),E=j,T=ot}}else{let et=E-_,rt=T-M,st=Math.hypot(et,rt);m&&(_+=et/st*m,M+=rt/st*m),y&&(E-=et/st*y,T-=rt/st*y)}let A=I+O,D=A+b,C=A-b,R=E-N*Math.cos(D),F=T-N*Math.sin(D),k=E-N*Math.cos(C),$=T-N*Math.sin(C),U=S<1e5?`A${S},${S} 0,0,${O>0?1:0} `:"L",W=N?`M${R},${F}L${E},${T}L${k},${$}`:"";return`M${_},${M}${U}${E},${T}${W}`}).call(Zt,this,r)).node()}};function EW(e=1){if(typeof e=="number")return hn(Math.sign(e));if(typeof e=="function")return(t,n,r,i)=>Math.sign(e(t,n,r,i));switch(rn(e,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,n,r)=>Et(t,r);case"-x":return(t,n,r)=>Wn(t,r);case"+y":return(t,n,r,i)=>Et(n,i);case"-y":return(t,n,r,i)=>Wn(n,i)}}function DW([e,t],[n,r],i,o){let s=n-e,a=r-t,c=Math.hypot(s,a),l=o*Math.sqrt(i*i-c*c/4)/c;return[(e+n)/2-a*l,(t+r)/2+s*l]}function DO([e,t,n],[r,i,o],s){let a=r-e,c=i-t,l=Math.hypot(a,c),u=(a*a+c*c-o*o+n*n)/(2*l),f=s*Math.sqrt(n*n-u*u);return[e+(a*u+c*f)/l,t+(c*u-a*f)/l]}function BO(e,{x:t,x1:n,x2:r,y:i,y1:o,y2:s,...a}={}){return[n,r]=Om(t,n,r),[o,s]=Om(i,o,s),new Lm(e,{...a,x1:n,x2:r,y1:o,y2:s})}var Lf=class extends wt{constructor(t,n,r={},i){super(t,n,r,i);let{inset:o=0,insetTop:s=o,insetRight:a=o,insetBottom:c=o,insetLeft:l=o,rx:u,ry:f}=r;this.insetTop=Bt(s),this.insetRight=Bt(a),this.insetBottom=Bt(c),this.insetLeft=Bt(l),this.rx=ue(u,"auto"),this.ry=ue(f,"auto")}render(t,n,r,i,o){let{rx:s,ry:a}=this;return lt("svg:g",o).call(Ot,this,i,o).call(this._transform,this,n).call(c=>c.selectAll().data(t).enter().append("rect").call(Nt,this).attr("x",this._x(n,r,i)).attr("width",this._width(n,r,i)).attr("y",this._y(n,r,i)).attr("height",this._height(n,r,i)).call(ut,"rx",s).call(ut,"ry",a).call(Zt,this,r)).node()}_x(t,{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n?o=>n[o]+i:r+i}_y(t,{y:n},{marginTop:r}){let{insetTop:i}=this;return n?o=>n[o]+i:r+i}_width({x:t},{x:n},{marginRight:r,marginLeft:i,width:o}){let{insetLeft:s,insetRight:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}_height({y:t},{y:n},{marginTop:r,marginBottom:i,height:o}){let{insetTop:s,insetBottom:a}=this,c=n&&t?t.bandwidth():o-r-i;return Math.max(0,c-s-a)}},NO={ariaLabel:"bar"},Fm=class extends Lf{constructor(t,n={}){let{x1:r,x2:i,y:o}=n;super(t,{x1:{value:r,scale:"x"},x2:{value:i,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n,NO)}_transform(t,n,{x:r}){t.call(Mt,n,{x:r},0,0)}_x({x:t},{x1:n,x2:r},{marginLeft:i}){let{insetLeft:o}=this;return sr(t)?i+o:s=>Math.min(n[s],r[s])+o}_width({x:t},{x1:n,x2:r},{marginRight:i,marginLeft:o,width:s}){let{insetLeft:a,insetRight:c}=this;return sr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}},Cm=class extends Lf{constructor(t,n={}){let{x:r,y1:i,y2:o}=n;super(t,{y1:{value:i,scale:"y"},y2:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n,NO)}_transform(t,n,{y:r}){t.call(Mt,n,{y:r},0,0)}_y({y:t},{y1:n,y2:r},{marginTop:i}){let{insetTop:o}=this;return sr(t)?i+o:s=>Math.min(n[s],r[s])+o}_height({y:t},{y1:n,y2:r},{marginTop:i,marginBottom:o,height:s}){let{insetTop:a,insetBottom:c}=this;return sr(t)?s-i-o-a-c:l=>Math.max(0,Math.abs(r[l]-n[l])-a-c)}};function $o(e,t={}){return nf(t)||(t={...t,y:Ae,x2:X}),new Fm(e,Df(Y1(Tf(t))))}function Uo(e,t={}){return nf(t)||(t={...t,x:Ae,y2:X}),new Cm(e,Bf(W1(Ef(t))))}var BW={ariaLabel:"cell"},_l=class extends Lf{constructor(t,{x:n,y:r,...i}={}){super(t,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},i,BW)}_transform(t,n){t.call(Mt,n,{},0,0)}};function Xa(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new _l(e,{...r,x:t,y:n})}function OO(e,{x:t=Ae,fill:n,stroke:r,...i}={}){return n===void 0&&De(r)[0]===void 0&&(n=X),new _l(e,{...i,x:t,fill:n,stroke:r})}function LO(e,{y:t=Ae,fill:n,stroke:r,...i}={}){return n===void 0&&De(r)[0]===void 0&&(n=X),new _l(e,{...i,y:t,fill:n,stroke:r})}var NW={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function Rm(e){return e.sort===void 0&&e.reverse===void 0?_1({channel:"-r"},e):e}var vl=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o,rotate:s,symbol:a=Ds,frameAnchor:c}=n,[l,u]=oe(s,0),[f,h]=zD(a),[d,p]=oe(o,f==null?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:d,scale:"r",filter:rr,optional:!0},rotate:{value:l,optional:!0},symbol:{value:f,scale:"auto",optional:!0}},Rm(n),NW),this.r=p,this.rotate=u,this.symbol=h,this.frameAnchor=No(c);let{channels:m}=this,{symbol:y}=m;if(y){let{fill:g,stroke:b}=m;y.hint={fill:g?g.value===y.value?"color":"currentColor":this.fill??"currentColor",stroke:b?b.value===y.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,r:u,rotate:f,symbol:h}=r,{r:d,rotate:p,symbol:m}=this,[y,g]=gn(this,i),b=m===Ds,w=u?void 0:d*d*Math.PI;return Aa(d)&&(t=[]),lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(x=>x.selectAll().data(t).enter().append(b?"circle":"path").call(Nt,this).call(b?v=>{v.attr("cx",c?_=>c[_]:y).attr("cy",l?_=>l[_]:g).attr("r",u?_=>u[_]:d)}:v=>{v.attr("transform",ja`translate(${c?_=>c[_]:y},${l?_=>l[_]:g})${f?_=>` rotate(${f[_]})`:p?` rotate(${p})`:""}`).attr("d",u&&h?_=>{let M=Qn();return h[_].draw(M,u[_]*u[_]*Math.PI),M}:u?_=>{let M=Qn();return m.draw(M,u[_]*u[_]*Math.PI),M}:h?_=>{let M=Qn();return h[_].draw(M,w),M}:(()=>{let _=Qn();return m.draw(_,w),_})())}).call(Zt,this,r)).node()}};function li(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new vl(e,{...r,x:t,y:n})}function FO(e,{x:t=X,...n}={}){return new vl(e,X1({...n,x:t}))}function CO(e,{y:t=X,...n}={}){return new vl(e,G1({...n,y:t}))}function RO(e,t){return li(e,{...t,symbol:"circle"})}function kO(e,t){return li(e,{...t,symbol:"hexagon"})}var OW={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Sl=class extends wt{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:zn(n),optional:!0}},n,OW),this.z=o,this.curve=pw(s,a),Ci(this,n)}filter(t){return t}project(t,n,r){this.curve!==Wa&&super.project(t,n,r)}render(t,n,r,i,o){let{x:s,y:a}=r,{curve:c}=this;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(l=>l.selectAll().data(q1(t,[s,a],this,r)).enter().append("path").call(Nt,this).call(dl,this,r).call(dN,this,r,o).attr("d",c===Wa&&o.projection?LW(o.projection,s,a):qp().curve(c).defined(u=>u>=0).x(u=>s[u]).y(u=>a[u]))).node()}};function LW(e,t,n){let r=Tn(e);return t=Ke(t),n=Ke(n),i=>{let o=[],s=[o];for(let a of i)a===-1?(o=[],s.push(o)):o.push([t[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function Il(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new Sl(e,{...r,x:t,y:n})}function Ha(e,{x:t=X,y:n=Ae,...r}={}){return new Sl(e,Af({...r,x:t,y:n}))}function Za(e,{x:t=Ae,y:n=X,...r}={}){return new Sl(e,Mf({...r,x:t,y:n}))}var FW={ariaLabel:"rect"},Ml=class extends wt{constructor(t,n={}){let{x1:r,y1:i,x2:o,y2:s,inset:a=0,insetTop:c=a,insetRight:l=a,insetBottom:u=a,insetLeft:f=a,rx:h,ry:d}=n;super(t,{x1:{value:r,scale:"x",type:r!=null&&o==null?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:i!=null&&s==null?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,FW),this.insetTop=Bt(c),this.insetRight=Bt(l),this.insetBottom=Bt(u),this.insetLeft=Bt(f),this.rx=ue(h,"auto"),this.ry=ue(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x1:c,y1:l,x2:u,y2:f}=r,{marginTop:h,marginRight:d,marginBottom:p,marginLeft:m,width:y,height:g}=i,{projection:b}=o,{insetTop:w,insetRight:x,insetBottom:v,insetLeft:_,rx:M,ry:E}=this,T=(s?.bandwidth?s.bandwidth():0)-_-x,B=(a?.bandwidth?a.bandwidth():0)-w-v;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{},0,0).call(I=>I.selectAll().data(t).enter().append("rect").call(Nt,this).attr("x",c&&(b||!sr(s))?u?N=>Math.min(c[N],u[N])+_:N=>c[N]+_:m+_).attr("y",l&&(b||!sr(a))?f?N=>Math.min(l[N],f[N])+w:N=>l[N]+w:h+w).attr("width",c&&(b||!sr(s))?u?N=>Math.max(0,Math.abs(u[N]-c[N])+T):T:y-d-m-x-_).attr("height",l&&(b||!sr(a))?f?N=>Math.max(0,Math.abs(l[N]-f[N])+B):B:g-h-p-w-v).call(ut,"rx",M).call(ut,"ry",E).call(Zt,this,r)).node()}};function km(e,t){return new Ml(e,RI(kI(t)))}function Ff(e,t={}){return nf(t)||(t={...t,y:Ae,x2:X,interval:1}),new Ml(e,Df(kI(Tf(t))))}function Cf(e,t={}){return nf(t)||(t={...t,x:Ae,y2:X,interval:1}),new Ml(e,Bf(RI(Ef(t))))}function rM(e,t){t=CW(t);let{x:n,y:r,color:i,size:o}=t,s=bw(e,n),a=bw(e,r),c=bw(e,i),l=bw(e,o),{fx:u,fy:f,x:{value:h,reduce:d,zero:p,...m},y:{value:y,reduce:g,zero:b,...w},color:{value:x,color:v,reduce:_},size:{value:M,reduce:E},mark:T}=t;if(d===void 0&&(d=g==null&&h==null&&M==null&&y!=null?"count":null),g===void 0&&(g=d==null&&y==null&&M==null&&h!=null?"count":null),E===void 0&&M==null&&_==null&&d==null&&g==null&&(h==null||Te(s))&&(y==null||Te(a))&&(E="count"),p===void 0&&(p=xw(d)?!0:void 0),b===void 0&&(b=xw(g)?!0:void 0),h==null&&y==null)throw new Error("must specify x or y");if(d!=null&&y==null)throw new Error("reducing x requires y");if(g!=null&&h==null)throw new Error("reducing y requires x");T===void 0&&(T=M!=null||E!=null?"dot":xw(d)||xw(g)||_!=null?"bar":h!=null&&y!=null?Te(s)||Te(a)||d==null&&g==null&&!$m(s)&&!$m(a)?"dot":"line":h!=null||y!=null?"rule":null);let B,I,N;switch(T){case"dot":N=li,I="stroke";break;case"line":N=s&&a||d!=null||g!=null?b||g!=null||s&&$m(s)?Za:p||d!=null||a&&$m(a)?Ha:Il:s?Ha:Za,I="stroke",UO(c)&&(B=null);break;case"area":N=!(b||g!=null)&&(p||d!=null||a&&$m(a))?Ga:Vs,I="fill",UO(c)&&(B=null);break;case"rule":N=s?Rr:kr,I="stroke";break;case"bar":N=d!=null?Te(a)?$O(d)&&s&&Te(s)?Xa:$o:Ff:g!=null?Te(s)?$O(g)&&a&&Te(a)?Xa:Uo:Cf:_!=null||E!=null?s&&Te(s)&&a&&Te(a)?Xa:s&&Te(s)?Uo:a&&Te(a)?$o:km:s&&Fs(s)&&!(a&&Fs(a))?$o:a&&Fs(a)&&!(s&&Fs(s))?Uo:Xa,I="fill";break;default:throw new Error(`invalid mark: ${T}`)}let O={fx:u,fy:f,x:s??void 0,y:a??void 0,[I]:c??v,z:B,r:l??void 0,tip:!0},S,A={[I]:_??void 0,r:E??void 0};if(d!=null&&g!=null)throw new Error("cannot reduce both x and y");return g!=null?(A.y=g,S=Te(s)?Ra:Ro):d!=null?(A.x=d,S=Te(a)?ka:ko):(_!=null||E!=null)&&(s&&a?S=Te(s)&&Te(a)?dm:Te(s)?ko:Te(a)?Ro:qs:s?S=Te(s)?Ra:Ro:a&&(S=Te(a)?ka:ko)),(S===qs||S===Ro)&&(O.x={value:s,...m}),(S===qs||S===ko)&&(O.y={value:a,...w}),p===void 0&&(p=s&&!(S===qs||S===Ro)&&(N===$o||N===Ga||N===Ff||N===kr)),b===void 0&&(b=a&&!(S===qs||S===ko)&&(N===Uo||N===Vs||N===Cf||N===Rr)),{fx:u??null,fy:f??null,x:{value:h??null,reduce:d??null,zero:!!p,...m},y:{value:y??null,reduce:g??null,zero:!!b,...w},color:{value:x??null,reduce:_??null,...v!==void 0&&{color:v}},size:{value:M??null,reduce:E??null},mark:T,markImpl:PO[N],markOptions:O,transformImpl:PO[S],transformOptions:A,colorMode:I}}function zO(e,t){let n=rM(e,t),{fx:r,fy:i,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:c,colorMode:l}=n,u=nM[n.markImpl],f=nM[n.transformImpl],h=r!=null||i!=null?Sf({strokeOpacity:.1}):null,d=[o?Rr([0]):null,s?kr([0]):null],p=u(e,f?f(c,a):a);return l==="stroke"?Qe(h,d,p):Qe(h,p,d)}function $m(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let i=Math.sign(Et(t,r));if(i){if(n!==void 0&&i!==n)return!1;t=r,n=i}}return!0}function CW({x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}={}){return Fr(e)||(e=Rf(e)),Fr(t)||(t=Rf(t)),Fr(n)||(n=Fa(n)?{color:n}:Rf(n)),Fr(r)||(r=Rf(r)),Fr(i)&&({value:i}=Rf(i)),Fr(o)&&({value:o}=Rf(o)),s!=null&&(s=`${s}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:o,mark:s}}function bw(e,t){let n=bt(e,t.value);return n&&(n.label=Bn(t.value)),n}function Rf(e){return RW(e)?{reduce:e}:{value:e}}function xw(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function $O(e){return/^(?:first|last|mode)$/i.test(e)}function RW(e){if(e==null)return!1;if(typeof e.reduceIndex=="function"||typeof e.reduce=="function"&&dn(e)||/^p\d{2}$/i.test(e))return!0;switch(`${e}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}function UO(e){return e?new Xn(e).size>e.length>>1:!1}var nM={dot:li,line:Il,lineX:Ha,lineY:Za,areaX:Ga,areaY:Vs,ruleX:Rr,ruleY:kr,barX:$o,barY:Uo,rect:km,rectX:Ff,rectY:Cf,cell:Xa,bin:qs,binX:Ro,binY:ko,group:dm,groupX:Ra,groupY:ka},PO=Object.fromEntries(Object.entries(nM).map(([e,t])=>[t,e]));function kf(e,t={}){let{x:n,x1:r,x2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,x:n=X});let o={};return n!=null&&(o.x=e),r!=null&&(o.x1=e),i!=null&&(o.x2=e),yr(o,t)}function $f(e,t={}){let{y:n,y1:r,y2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,y:n=X});let o={};return n!=null&&(o.y=e),r!=null&&(o.y1=e),i!=null&&(o.y2=e),yr(o,t)}function yr(e={},t={}){let n=zn(t),r=Object.entries(e).map(([i,o])=>{let s=m1(i,t);if(s==null)throw new Error(`missing channel: ${i}`);let[a,c]=pn(s);return{key:i,input:s,output:a,setOutput:c,map:kW(o)}});return{...mn(t,(i,o)=>{let s=bt(i,n),a=r.map(({input:l})=>bt(i,l)),c=r.map(({setOutput:l})=>l(new Array(i.length)));for(let l of o)for(let u of s?an(l,f=>s[f]).values():[l])r.forEach(({map:f},h)=>f.mapIndex(u,a[h],c[h]));return{data:i,facets:o}}),...Object.fromEntries(r.map(({key:i,output:o})=>[i,o]))}}function kW(e){if(e==null)throw new Error("missing map");if(typeof e.mapIndex=="function")return e;if(typeof e.map=="function"&&dn(e))return $W(e);if(typeof e=="function")return iM(rf(e));switch(`${e}`.toLowerCase()){case"cumsum":return PW;case"rank":return iM((t,n)=>Dd(t,r=>n[r]));case"quantile":return iM((t,n)=>UW(t,r=>n[r]))}throw new Error(`invalid map: ${e}`)}function $W(e){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:e.map.bind(e)}}function UW(e,t){let n=ao(e,t)-1;return Dd(e,t).map(r=>r/n)}function iM(e){return{mapIndex(t,n,r){let i=e(t,n);if(i.length!==t.length)throw new Error("map function returned a mismatched length");for(let o=0,s=t.length;o<s;++o)r[t[o]]=i[o]}}}var PW={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function qO(e={},t){return arguments.length===1&&(t=e),kf(Uf(e),t)}function VO(e={},t){return arguments.length===1&&(t=e),$f(Uf(e),t)}function Uf(e={}){typeof e=="number"&&(e={k:e});let{k:t,reduce:n,shift:r,anchor:i,strict:o}=e;if(i===void 0&&r!==void 0&&(i=qW(r),qn(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw new Error(`invalid k: ${t}`);return VW(n)(t,zW(i,t),o)}function zW(e="middle",t){switch(`${e}`.toLowerCase()){case"middle":return t-1>>1;case"start":return 0;case"end":return t-1}throw new Error(`invalid anchor: ${e}`)}function qW(e){switch(`${e}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${e}`)}function VW(e="mean"){if(typeof e=="string"){if(/^p\d{2}$/i.test(e))return ww(ef(e));switch(e.toLowerCase()){case"deviation":return ww(Zr);case"max":return _w((t,n)=>Xt(t,r=>n[r]));case"mean":return jW;case"median":return ww(Di);case"min":return _w((t,n)=>le(t,r=>n[r]));case"mode":return _w((t,n)=>fu(t,r=>n[r]));case"sum":return jO;case"variance":return ww(ua);case"difference":return GW;case"ratio":return XW;case"first":return HW;case"last":return ZW}}if(typeof e!="function")throw new Error(`invalid reduce: ${e}`);return _w(rf(e))}function ww(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=l=>o[l]==null?NaN:+o[l],c=0;for(let l=0;l<t-1;++l)isNaN(a(l))&&++c;for(let l=0,u=i.length-t+1;l<u;++l)isNaN(a(l+t-1))&&++c,s[i[l+n]]=c===0?e(Os(i,l,l+t),a):NaN,isNaN(a(l))&&--c}}:{mapIndex(i,o,s){let a=c=>o[c]==null?NaN:+o[c];for(let c=-n;c<0;++c)s[i[c+n]]=e(Os(i,0,c+t),a);for(let c=0,l=i.length-n;c<l;++c)s[i[c+n]]=e(Os(i,c,c+t),a)}}}function _w(e){return(t,n,r)=>r?{mapIndex(i,o,s){let a=0;for(let c=0;c<t-1;++c)a+=$e(o[i[c]]);for(let c=0,l=i.length-t+1;c<l;++c)a+=$e(o[i[c+t-1]]),a===t&&(s[i[c+n]]=e(Os(i,c,c+t),o)),a-=$e(o[i[c]])}}:{mapIndex(i,o,s){for(let a=-n;a<0;++a)s[i[a+n]]=e(Os(i,0,a+t),o);for(let a=0,c=i.length-n;a<c;++a)s[i[a+n]]=e(Os(i,a,a+t),o)}}}function jO(e,t,n){return n?{mapIndex(r,i,o){let s=0,a=0;for(let c=0;c<e-1;++c){let l=i[r[c]];l===null||isNaN(l)?++s:a+=+l}for(let c=0,l=r.length-e+1;c<l;++c){let u=i[r[c]],f=i[r[c+e-1]];f===null||isNaN(f)?++s:a+=+f,o[r[c+t]]=s===0?a:NaN,u===null||isNaN(u)?--s:a-=+u}}}:{mapIndex(r,i,o){let s=0,a=r.length;for(let c=0,l=Math.min(a,e-t-1);c<l;++c)s+=+i[r[c]]||0;for(let c=-t,l=a-t;c<l;++c)s+=+i[r[c+e-1]]||0,o[r[c+t]]=s,s-=+i[r[c]]||0}}}function jW(e,t,n){if(n){let r=jO(e,t,n);return{mapIndex(i,o,s){r.mapIndex(i,o,s);for(let a=0,c=i.length-e+1;a<c;++a)s[i[a+t]]/=e}}}else return{mapIndex(r,i,o){let s=0,a=0,c=r.length;for(let l=0,u=Math.min(c,e-t-1);l<u;++l){let f=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a)}for(let l=-t,u=c-t;l<u;++l){let f=i[r[l+e-1]],h=i[r[l]];f!==null&&!isNaN(f=+f)&&(s+=f,++a),o[r[l+t]]=s/a,h!==null&&!isNaN(h=+h)&&(s-=h,--a)}}}}function YW(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if($e(o))return o}}function WW(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if($e(o))return o}}function YO(e,t,n,r){for(let i=n+r;n<i;++n){let o=e[t[n]];if(o!==null&&!isNaN(o=+o))return o}}function WO(e,t,n,r){for(let i=n+r-1;i>=n;--i){let o=e[t[i]];if(o!==null&&!isNaN(o=+o))return o}}function GW(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l-c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=WO(i,r,s,e)-YO(i,r,s,e)}}}function XW(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s){let c=i[r[s]],l=i[r[s+e-1]];o[r[s+t]]=c===null||l===null?NaN:l/c}}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=WO(i,r,s,e)/YO(i,r,s,e)}}}function HW(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=YW(i,r,s,e)}}}function ZW(e,t,n){return n?{mapIndex(r,i,o){for(let s=0,a=r.length-e;s<a;++s)o[r[s+t]]=i[r[s+e-1]]}}:{mapIndex(r,i,o){for(let s=-t,a=r.length-e+t+1;s<a;++s)o[r[s+t]]=WW(i,r,s,e)}}}var js={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function GO(e,{x:t=X,y:n,k:r=js.k,color:i=js.color,opacity:o=js.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Qe(ne(s)?null:Ga(e,yr({x1:Ka({k:-r,...f}),x2:Ka({k:r,...f})},{x1:t,x2:t,y:n,fill:s,fillOpacity:a,...f})),ne(c)?null:Ha(e,yr({x:Ka(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function XO(e,{x:t,y:n=X,k:r=js.k,color:i=js.color,opacity:o=js.opacity,fill:s=i,fillOpacity:a=o,stroke:c=i,strokeOpacity:l,strokeWidth:u,...f}={}){return Qe(ne(s)?null:Vs(e,yr({y1:Ka({k:-r,...f}),y2:Ka({k:r,...f})},{x:t,y1:n,y2:n,fill:s,fillOpacity:a,...f})),ne(c)?null:Za(e,yr({y:Ka(f)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...f})))}function Ka({n:e=js.n,k:t=0,strict:n=js.strict,anchor:r=js.anchor}={}){return Uf({k:e,reduce:i=>fs(i)+t*(Zr(i)||0),strict:n,anchor:r})}var KW={ariaLabel:"tick",fill:null,stroke:"currentColor"},vw=class extends wt{constructor(t,n,r){super(t,n,r,KW),Ci(this,r)}render(t,n,r,i,o){return lt("svg:g",o).call(Ot,this,i,o).call(this._transform,this,n).call(s=>s.selectAll().data(t).enter().append("line").call(Nt,this).attr("x1",this._x1(n,r,i)).attr("x2",this._x2(n,r,i)).attr("y1",this._y1(n,r,i)).attr("y2",this._y2(n,r,i)).call(Zt,this,r).call(zs,this,r,o)).node()}},Um=class extends vw{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetTop:s=o,insetBottom:a=o}=n;super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},n),this.insetTop=Bt(s),this.insetBottom=Bt(a)}_transform(t,n,{x:r}){t.call(Mt,n,{x:r},Ne,0)}_x1(t,{x:n}){return r=>n[r]}_x2(t,{x:n}){return r=>n[r]}_y1({y:t},{y:n},{marginTop:r}){let{insetTop:i}=this;return n&&t?o=>n[o]+i:r+i}_y2({y:t},{y:n},{height:r,marginBottom:i}){let{insetBottom:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}},Pm=class extends vw{constructor(t,n={}){let{x:r,y:i,inset:o=0,insetRight:s=o,insetLeft:a=o}=n;super(t,{y:{value:i,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Bt(s),this.insetLeft=Bt(a)}_transform(t,n,{y:r}){t.call(Mt,n,{y:r},0,Ne)}_x1({x:t},{x:n},{marginLeft:r}){let{insetLeft:i}=this;return n&&t?o=>n[o]+i:r+i}_x2({x:t},{x:n},{width:r,marginRight:i}){let{insetRight:o}=this;return n&&t?s=>n[s]+t.bandwidth()-o:r-i-o}_y1(t,{y:n}){return r=>n[r]}_y2(t,{y:n}){return r=>n[r]}};function Sw(e,{x:t=X,...n}={}){return new Um(e,{...n,x:t})}function Iw(e,{y:t=X,...n}={}){return new Pm(e,{...n,y:t})}function HO(e,{x:t=X,y:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?ka:hm;return Qe(kr(e,u({x1:oM,x2:sM},{x:t,y:n,stroke:o,strokeOpacity:s,...l})),$o(e,u({x1:"p25",x2:"p75"},{x:t,y:n,fill:r,fillOpacity:i,...l})),Sw(e,u({x:"p50"},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),li(e,yr({x:KO},{x:t,y:n,z:n,stroke:o,strokeOpacity:s,...l})))}function ZO(e,{y:t=X,x:n=null,fill:r="#ccc",fillOpacity:i,stroke:o="currentColor",strokeOpacity:s,strokeWidth:a=2,sort:c,...l}={}){let u=n!=null?Ra:hm;return Qe(Rr(e,u({y1:oM,y2:sM},{x:n,y:t,stroke:o,strokeOpacity:s,...l})),Uo(e,u({y1:"p25",y2:"p75"},{x:n,y:t,fill:r,fillOpacity:i,...l})),Iw(e,u({y:"p50"},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:a,sort:c,...l})),li(e,yr({y:KO},{x:n,y:t,z:n,stroke:o,strokeOpacity:s,...l})))}function KO(e){let t=oM(e),n=sM(e);return e.map(r=>r<t||r>n?r:NaN)}function oM(e){let t=QO(e)*2.5-JO(e)*1.5;return le(e,n=>n>=t?n:NaN)}function sM(e){let t=JO(e)*2.5-QO(e)*1.5;return Xt(e,n=>n<=t?n:NaN)}function QO(e){return Hn(e,.25)}function JO(e){return Hn(e,.75)}var QW={ariaLabel:"raster",stroke:null,pixelSize:1};function Pf(e,t){let n=+e;if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}function t7(e,t){let n=Math.floor(e);if(isNaN(n))throw new Error(`invalid ${t}: ${e}`);return n}var qm=class extends wt{constructor(t,n,r={},i){let{width:o,height:s,x:a,y:c,x1:l=a==null?0:void 0,y1:u=c==null?0:void 0,x2:f=a==null?o:void 0,y2:h=c==null?s:void 0,pixelSize:d=i.pixelSize,blur:p=0,interpolate:m}=r;if(o!=null&&(o=t7(o,"width")),s!=null&&(s=t7(s,"height")),l!=null&&(l=Pf(l,"x1")),u!=null&&(u=Pf(u,"y1")),f!=null&&(f=Pf(f,"x2")),h!=null&&(h=Pf(h,"y2")),a==null&&(l==null||f==null))throw new Error("missing x");if(c==null&&(u==null||h==null))throw new Error("missing y");t!=null&&o!=null&&s!=null&&(a===void 0&&l!=null&&f!=null&&(a=sG(l,f,o,s)),c===void 0&&u!=null&&h!=null&&(c=aG(u,h,o,s))),super(t,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:l==null?null:[l],scale:"x",optional:!0,filter:null},y1:{value:u==null?null:[u],scale:"y",optional:!0,filter:null},x2:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y2:{value:h==null?null:[h],scale:"y",optional:!0,filter:null},...n},r,i),this.width=o,this.height=s,this.pixelSize=Pf(d,"pixelSize"),this.blur=Pf(p,"blur"),this.interpolate=a==null||c==null?null:JW(m)}},Vm=class extends qm{constructor(t,n={}){let{imageRendering:r}=n;if(t==null){let{fill:i,fillOpacity:o}=n;oe(o)[0]!==void 0&&(n=Mw("fillOpacity",n)),De(i)[0]!==void 0&&(n=Mw("fill",n))}super(t,void 0,n,QW),this.imageRendering=ue(r,"auto")}scale(t,{color:n,...r},i){return super.scale(t,r,i)}render(t,n,r,i,o){let s=n[r.channels.fill?.scale]??(A=>A),{x:a,y:c}=r,{document:l}=o,[u,f,h,d]=n7(r,i,o),p=h-u,m=d-f,{pixelSize:y,width:g=Math.round(Math.abs(p)/y),height:b=Math.round(Math.abs(m)/y)}=this,w=g*b,{fill:x,fillOpacity:v}=r,_=0;if(this.interpolate){let A=g/p,D=b/m,C=Yt(a,F=>(F-u)*A,Float64Array),R=Yt(c,F=>(F-f)*D,Float64Array);x&&(x=this.interpolate(t,g,b,C,R,x)),v&&(v=this.interpolate(t,g,b,C,R,v))}else this.data==null&&t&&(_=t.fi*w);let M=l.createElement("canvas");M.width=g,M.height=b;let E=M.getContext("2d"),T=E.createImageData(g,b),B=T.data,{r:I,g:N,b:O}=en(this.fill)??{r:0,g:0,b:0},S=(this.fillOpacity??1)*255;for(let A=0;A<w;++A){let D=A<<2;if(x){let C=s(x[A+_]);if(C==null){B[D+3]=0;continue}({r:I,g:N,b:O}=en(C))}v&&(S=v[A+_]*255),B[D+0]=I,B[D+1]=N,B[D+2]=O,B[D+3]=S}return this.blur>0&&Cv(T,this.blur),E.putImageData(T,0,0),lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(A=>A.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(h-u)},${Math.sign(d-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(ut,"image-rendering",this.imageRendering).call(Nt,this).attr("xlink:href",M.toDataURL())).node()}};function aM(e,t,n){arguments.length<3&&(n=t,t=null);let{x:r,y:i,[e]:o,...s}=n;return r===void 0&&i===void 0&&ND(t)&&(r=cl,i=Na,o===void 0&&(o=AD)),[t,{...s,x:r,y:i,[e]:o}]}function e7(){let[e,t]=aM("fill",...arguments);return new Vm(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:X})}function n7({x1:e,y1:t,x2:n,y2:r},i,{projection:o}){let{width:s,height:a,marginTop:c,marginRight:l,marginBottom:u,marginLeft:f}=i;return[e&&o==null?e[0]:f,t&&o==null?t[0]:c,n&&o==null?n[0]:s-l,r&&o==null?r[0]:a-u]}function cM({x1:e,y1:t,x2:n,y2:r},i,o,s){let a={};return e&&(a.x1=e),t&&(a.y1=t),n&&(a.x2=n),r&&(a.y2=r),n7(ff(a,i),o,s)}function Mw(e,t={}){let{[e]:n}=t;if(typeof n!="function")throw new Error(`invalid ${e}: not a function`);return Se({...t,[e]:void 0},function(r,i,o,s,a,c){let{x:l,y:u}=s;if(!l)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");let[f,h,d,p]=cM(o,s,a,c),m=d-f,y=p-h,{pixelSize:g}=this,{width:b=Math.round(Math.abs(m)/g),height:w=Math.round(Math.abs(y)/g)}=t,x=new Array(b*w*(i?i.length:1)),v=m/b,_=y/w,M=0;for(let E of i??[void 0])for(let T=.5;T<w;++T)for(let B=.5;B<b;++B,++M)x[M]=n(l.invert(f+B*v),u.invert(h+T*_),E);return{data:x,facets:i,channels:{[e]:{value:x,scale:"auto"}}}})}function JW(e){if(typeof e=="function")return e;if(e==null)return Aw;switch(`${e}`.toLowerCase()){case"none":return Aw;case"nearest":return Ym;case"barycentric":return jm();case"random-walk":return Wm()}throw new Error(`invalid interpolate: ${e}`)}function Aw(e,t,n,r,i,o){let s=new Array(t*n);for(let a of e)r[a]<0||r[a]>=t||i[a]<0||i[a]>=n||(s[Math.floor(i[a])*t+Math.floor(r[a])]=o[a]);return s}function jm({random:e=Xc(42)}={}){return(t,n,r,i,o,s)=>{let{points:a,triangles:c,hull:l}=ti.from(t,d=>i[d],d=>o[d]),u=new s.constructor(n*r).fill(NaN),f=new Uint8Array(n*r),h=oG(s,e);for(let d=0;d<c.length;d+=3){let p=c[d],m=c[d+1],y=c[d+2],g=a[2*p],b=a[2*m],w=a[2*y],x=a[2*p+1],v=a[2*m+1],_=a[2*y+1],M=Math.min(g,b,w),E=Math.max(g,b,w),T=Math.min(x,v,_),B=Math.max(x,v,_),I=(v-_)*(g-w)+(x-_)*(w-b);if(!I)continue;let N=s[t[p]],O=s[t[m]],S=s[t[y]];for(let A=Math.floor(M);A<E;++A)for(let D=Math.floor(T);D<B;++D){if(A<0||A>=n||D<0||D>=r)continue;let C=A+.5,R=D+.5,F=Math.sign(I),k=(v-_)*(C-w)+(R-_)*(w-b);if(k*F<0)continue;let $=(_-x)*(C-w)+(R-_)*(g-w);if($*F<0)continue;let U=I-(k+$);if(U*F<0)continue;let W=A+n*D;u[W]=h(N,k/I,O,$/I,S,U/I,A,D),f[W]=1}}return tG(u,f,i,o,s,n,r,l,t,h),u}}function tG(e,t,n,r,i,o,s,a,c,l){n=Float64Array.from(a,d=>n[c[d]]),r=Float64Array.from(a,d=>r[c[d]]),i=Array.from(a,d=>i[c[d]]);let u=n.length,f=Array.from({length:u},(d,p)=>nG(p,n,r)),h=0;for(let d=0;d<s;++d){let p=d+.5;for(let m=0;m<o;++m){let y=m+o*d;if(!t[y]){let g=m+.5;for(let b=0;b<u;++b){let w=(u+h+(b%2?(b+1)/2:-b/2))%u;if(f[w](g,p)){let x=eG(n.at(w-1),r.at(w-1),n[w],r[w],g,p);e[y]=l(i.at(w-1),x,i[w],1-x,i[w],0,m,d),h=w;break}}}}}}function eG(e,t,n,r,i,o){let s=n-e,a=r-t,c=s*(n-i)+a*(r-o),l=s*(i-e)+a*(o-t);return c>0&&l>0?c/(c+l):+(c>l)}function zm(e,t,n,r){return e*r-n*t}function nG(e,t,n){let r=t.length,i=t.at(e-2),o=n.at(e-2),s=t.at(e-1),a=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),f=n.at(e+1-r),h=s-c,d=a-l,p=i-s,m=o-a,y=c-u,g=l-f,b=Math.hypot(h,d),w=Math.hypot(p,m),x=Math.hypot(y,g);return(v,_)=>{let M=v-s,E=_-a,T=v-c,B=_-l;return zm(M,E,T,B)>-1e-6&&zm(M,E,h,d)*w-zm(M,E,p,m)*b>-1e-6&&zm(T,B,y,g)*b-zm(T,B,h,d)*x<=0}}function Ym(e,t,n,r,i,o){let s=new o.constructor(t*n),a=ti.from(e,u=>r[u],u=>i[u]),c,l;for(let u=.5,f=0;u<n;++u){l=c;for(let h=.5;h<t;++h,++f)l=a.find(h,u,l),h===.5&&(c=l),s[f]=o[e[l]]}return s}function Wm({random:e=Xc(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,o,s,a,c)=>{let l=new c.constructor(i*o),u=ti.from(r,p=>s[p],p=>a[p]),f,h,d;for(let p=.5,m=0;p<o;++p){h=f;for(let y=.5;y<i;++y,++m){let g=y,b=p;d=h=u.find(g,b,h),y===.5&&(f=h);let w,x=0;for(;(w=Math.hypot(s[r[d]]-g,a[r[d]]-b))>t&&x<n;){let v=e(y,p,x)*2*Math.PI;g+=Math.cos(v)*w,b+=Math.sin(v)*w,d=u.find(g,b,d),++x}l[m]=c[r[d]]}}return l}}function rG(e,t,n,r,i,o){return t*e+r*n+o*i}function iG(e){return(t,n,r,i,o,s,a,c)=>{let l=e(a,c);return l<n?t:l<n+i?r:o}}function oG(e,t){return Fs(e)||Be(e)?rG:iG(t)}function sG(e,t,n){return{transform(r){let i=r.length,o=new Float64Array(i),s=(t-e)/n,a=e+s/2;for(let c=0;c<i;++c)o[c]=c%n*s+a;return o}}}function aG(e,t,n,r){return{transform(i){let o=i.length,s=new Float64Array(o),a=(t-e)/r,c=e+a/2;for(let l=0;l<o;++l)s[l]=Math.floor(l/n)%r*a+c;return s}}}var r7={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},Gm=class extends qm{constructor(t,{smooth:n=!0,value:r,...i}={}){let o=z1({},i,r7);if(r===void 0){for(let a in o)if(o[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=i[a],i[a]="value"}}if(r!=null){let a={transform:c=>c.map(l=>l.value),label:Bn(r)};for(let c in o)i[c]==="value"&&(i[c]=a)}if(t==null){if(r==null)throw new Error("missing contour value");i=Mw("value",{value:r,...i}),r=null}else{let{interpolate:a}=i;r===void 0&&(r=X),a===void 0&&(i.interpolate="nearest")}super(t,{value:{value:r,optional:!0}},cG(i),r7);let s={geometry:{value:X}};for(let a in this.channels){let c=this.channels[a],{scale:l}=c;l==="x"||l==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(t,{x:n,y:r,value:i,...o},s){return super.filter(t,o,s)}render(t,n,r,i,o){let{geometry:s}=r,a=Tn();return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(c=>{c.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",l=>a(s[l])).call(Zt,this,r)}).node()}};function cG({thresholds:e,interval:t,...n}){return e=QI(e,t,fa),Se(n,function(r,i,o,s,a,c){let[l,u,f,h]=cM(o,s,a,c),d=f-l,p=h-u,{pixelSize:m,width:y=Math.round(Math.abs(d)/m),height:g=Math.round(Math.abs(p)/m)}=this,b=y/d,w=g/p,x=o.value.value,v=[];if(this.interpolate){let{x:B,y:I}=Pa(o,s,c),N=Yt(B,D=>(D-l)*b,Float64Array),O=Yt(I,D=>(D-u)*w,Float64Array),S=[o.x,o.y,o.value],A=[N,O,x];for(let D of i){let C=this.filter(D,S,A);v.push(this.interpolate(C,y,g,N,O,x))}}else if(i){let B=y*g,I=i.length;for(let N=0;N<I;++N)v.push(x.slice(N*B,N*B+B))}else v.push(x);if(this.blur>0)for(let B of v)Id({data:B,width:y,height:g},this.blur);let _=lG(e,x,...uG(v));if(_===null)throw new Error(`unsupported thresholds: ${e}`);let{contour:M}=ba().size([y,g]).smooth(this.smooth),E=[],T=[];for(let B of v)T.push(ke(E.length,E.push(...Yt(_,I=>M(B,I)))));for(let{coordinates:B}of E)for(let I of B)for(let N of I)for(let O of N)O[0]=O[0]/b+l,O[1]=O[1]/w+u;return{data:E,facets:T,channels:T1(this.contourChannels,E)}})}function lG(e,t,n,r){if(typeof e?.range=="function")return e.range(e.floor(n),r);if(typeof e=="function"&&(e=e(t,n,r)),typeof e!="number")return Pe(e);let i=In(...lu(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function o7(){return new Gm(...aM("value",...arguments))}function uG(e){return[le(e,t=>le(t,i7)),Xt(e,t=>Xt(t,i7))]}function i7(e){return isFinite(e)?e:NaN}function c7(e,t){return lM(qa,e,t)}function l7(e,t={}){return lM(Va,e,t)}function u7(e,t={}){return lM(Ps,e,t)}function lM(e,t,n={}){let{x:r,y:i,maxRadius:o}=n,s=e({px:r,py:i,maxRadius:o}),a=[];r!=null&&a.push(Rr(t,s7("x",{...s,inset:-6},n))),i!=null&&a.push(kr(t,s7("y",{...s,inset:-6},n))),r!=null&&a.push(Co(t,a7("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),i!=null&&a.push(Co(t,a7("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return Qe(...a)}function f7(e,{channels:t,...n},{facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:c,transform:l,initializer:u}){return{...n,facet:r,facetAnchor:i,fx:o,fy:s,[e]:a,channels:{...t,...c},transform:l,initializer:fG(e,u)}}function fG(e,t){return t==null?t:function(n,r,{x:i,y:o,px:s,py:a,...c},...l){let{channels:{x:u,y:f,...h}={},...d}=t.call(this,n,r,{...c,x:s,y:a},...l);return{channels:{...h,...u&&{px:u,...e==="x"&&{x:u}},...f&&{py:f,...e==="y"&&{y:f}}},...d}}}function s7(e,t,n){let{color:r="currentColor",opacity:i=.2,ruleStroke:o=r,ruleStrokeOpacity:s=i,ruleStrokeWidth:a}=n;return{...f7(e,t,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function a7(e,t,n){let{color:r="currentColor",textFill:i=r,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...f7(e,t,hG(e,n)),fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:c}}function hG(e,t){return Se(t,(n,r,i)=>({channels:{text:{value:mm(i,e)?.value}}}))}var dG={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},pG={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},mG={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},yG={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},gG={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},uM=class extends wt{constructor(t,n={}){let{x:r,y:i,z:o,curve:s,tension:a}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,dG),this.curve=Dm(s,a),Ci(this,n)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,{curve:f}=this,[h,d]=gn(this,i),p=c?b=>c[b]:hn(h),m=l?b=>l[b]:hn(d),y=this;function g(b){let w=-1,x=[],v={};for(let S in r)v[S]=[];let _=[],M=[],E=[],T=[];function B(S,A){S=b[S],A=b[A],x.push(++w),_[w]=p(S),E[w]=m(S),M[w]=p(A),T[w]=m(A);for(let D in r)v[D].push(r[D][A])}let{halfedges:I,hull:N,triangles:O}=ti.from(b,p,m);for(let S=0;S<I.length;++S){let A=I[S];A>S&&B(O[S],O[A])}for(let S=0;S<N.length;++S)B(N[S],N[(S+1)%N.length]);Pt(this).selectAll().data(x).enter().append("path").call(Nt,y).attr("d",S=>{let A=Qn(),D=f(A);return D.lineStart(),D.point(_[S],E[S]),D.point(M[S],T[S]),D.lineEnd(),A}).call(Zt,y,v).call(zs,y,v,o)}return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(u?b=>b.selectAll().data(an(t,w=>u[w]).values()).enter().append("g").each(g):b=>b.datum(t).each(g)).node()}},Xm=class extends wt{constructor(t,n={},r,i=({z:o})=>o){let{x:o,y:s}=n;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:i(n),optional:!0}},n,r)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=gn(this,i),d=c?g=>c[g]:hn(f),p=l?g=>l[g]:hn(h),m=this;function y(g){let b=ti.from(g,d,p);Pt(this).append("path").datum(g[0]).call(Nt,m).attr("d",m._render(b,i)).call(Zt,m,r)}return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(u?g=>g.selectAll().data(an(t,b=>u[b]).values()).enter().append("g").each(y):g=>g.datum(t).each(y)).node()}},fM=class extends Xm{constructor(t,n={}){super(t,n,pG),this.fill="none"}_render(t){return t.render()}},hM=class extends Xm{constructor(t,n={}){super(t,n,mG,zn)}_render(t){return t.renderHull()}},dM=class extends wt{constructor(t,n={}){let{x:r,y:i,z:o}=n;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:o,optional:!0}},n,yG)}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,z:u}=r,[f,h]=gn(this,i),d=c?g=>c[g]:hn(f),p=l?g=>l[g]:hn(h),m=this;function y(g){let b=ti.from(g,d,p),w=h7(b,i);Pt(this).selectAll().data(g).enter().append("path").call(Nt,m).attr("d",(x,v)=>w.renderCell(v)).call(Zt,m,r)}return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(u?g=>g.selectAll().data(an(t,b=>u[b]).values()).enter().append("g").each(y):g=>g.datum(t).each(y)).node()}},pM=class extends Xm{constructor(t,n){super(t,n,gG),this.fill="none"}_render(t,n){return h7(t,n).render()}};function h7(e,t){let{width:n,height:r,marginTop:i,marginRight:o,marginBottom:s,marginLeft:a}=t;return e.voronoi([a,i,n-o,r-s])}function Hm(e,t,{x:n,y:r,...i}={}){return[n,r]=Ce(n,r),new e(t,{...i,x:n,y:r})}function d7(e,t){return Hm(uM,e,t)}function p7(e,t){return Hm(fM,e,t)}function m7(e,t){return Hm(hM,e,t)}function y7(e,t){return Hm(dM,e,t)}function g7(e,t){return Hm(pM,e,t)}var bG={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Zm=class extends wt{constructor(t,{x:n,y:r,z:i,weight:o,fill:s,stroke:a,...c}={}){let l=b7(s)&&(s="currentColor",!0),u=b7(a)&&(a="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:zn({z:i,fill:s,stroke:a}),optional:!0},weight:{value:o,optional:!0}},wG({...c,fill:s,stroke:a},l,u),bG),l&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=i}filter(t){return t}render(t,n,r,i,o){let{contours:s}=r,a=Tn();return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{}).call(c=>c.selectAll().data(t).enter().append("path").call(Nt,this).call(Zt,this,r).attr("d",l=>a(s[l]))).node()}};function x7(e,{x:t,y:n,...r}={}){return[t,n]=Ce(t,n),new Zm(e,{...r,x:t,y:n})}var xG=new Set(["x","y","z","weight"]);function wG(e,t,n){let{bandwidth:i,thresholds:o}=e;return i=i===void 0?20:+i,o=o===void 0?20:typeof o?.[Symbol.iterator]=="function"?Ke(o):+o,Se(e,function(s,a,c,l,u,f){let h=c.weight?Ke(c.weight.value):null,d=c.z?.value,{z:p}=this,[m,y]=gn(this,u),{width:g,height:b}=u,{x:w,y:x}=Pa(c,l,f),v=Object.fromEntries(Object.entries(c).filter(([O])=>!xG.has(O)).map(([O,S])=>[O,{...S,value:[]}])),_=t&&[],M=n&&[],E=S2().x(w?O=>w[O]:m).y(x?O=>x[O]:y).weight(h?O=>h[O]:1).size([g,b]).bandwidth(i),T=[];for(let O of a){let S=[];T.push(S);for(let A of d?wm(O,d,p):[O]){let D=E.contours(A);S.push([A,D])}}let B=o;if(!(B instanceof al)){let O=0;for(let S of T)for(let[,A]of S){let D=A.max;D>O&&(O=D)}B=Float64Array.from({length:o-1},(S,A)=>O*100*(A+1)/o)}let I=[],N=[];for(let O of T){let S=[];I.push(S);for(let[A,D]of O)for(let C of B){S.push(N.length),N.push(D(C/100)),_&&_.push(C),M&&M.push(C);for(let R in v)v[R].value.push(c[R].value[A[0]])}}return _&&_.push(0),M&&M.push(0),{data:s,facets:I,channels:{...v,..._&&{fill:{value:_,scale:"color"}},...M&&{stroke:{value:M,scale:"color"}},contours:{value:N}}}})}function b7(e){return/^density$/i.test(e)}function v7(e,{x1:t,x2:n,y1:r,y2:i,x:o=t===void 0&&n===void 0?Ae:void 0,y:s=r===void 0&&i===void 0?X:void 0,fill:a,positiveFill:c="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:f=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:p,z:m=De(d)[0],clip:y,tip:g,render:b,...w}={}){return[t,n]=w7(o,t,n),[r,i]=w7(s,r,i),t===n&&r===i&&(r=Qa(0)),{tip:g}=Fi({tip:g},"x"),Qe(ne(c)?null:Object.assign(Bm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:c,fillOpacity:f,render:xf(b,_7(!0)),clip:y,...w}),{ariaLabel:"positive difference"}),ne(l)?null:Object.assign(Bm(e,{x1:t,x2:n,y1:r,y2:i,z:m,fill:l,fillOpacity:h,render:xf(b,_7(!1)),clip:y,...w}),{ariaLabel:"negative difference"}),Il(e,{x:n,y:i,z:m,stroke:d,strokeOpacity:p,tip:g,clip:!0,...w}))}function w7(e,t,n){return t===void 0&&n===void 0?t=n=Qa(e):t===void 0?(n=Qa(n),t=e===void 0?n:Qa(e)):n===void 0?(t=Qa(t),n=e===void 0?t:Qa(e)):(t=Qa(t),n=Qa(n)),[t,n]}function Qa(e){let t,{value:n,label:r=Bn(n)}=ai(e);return{transform:i=>t||(t=bt(i,n)),label:r}}function _7(e){return(t,n,r,i,o,s)=>{let{x1:a,x2:c}=r,{height:l}=i,u=new Float32Array(a.length),f=new Float32Array(c.length);(e===N1(n.y)<0?u:f).fill(l);let h=s(t,n,{...r,x2:a,y2:f},i,o),d=s(t,n,{...r,x1:c,y1:u},i,o),p=h.querySelector("g")??h,m=d.querySelector("g")??d;for(let y=0;p.firstChild;y+=2){let g=P1(),b=lt("svg:clipPath",o).attr("id",g).node();b.appendChild(p.firstChild),m.childNodes[y].setAttribute("clip-path",`url(#${g})`),m.insertBefore(b,m.childNodes[y])}return d}}var _G={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Km=class extends wt{constructor(t,n={}){let[r,i]=oe(n.r,3);super(t,{geometry:{value:n.geometry,scale:"projection"},r:{value:r,scale:"r",filter:rr,optional:!0}},Rm(n),_G),this.r=i}render(t,n,r,i,o){let{geometry:s,r:a}=r,c=Tn(o.projection??vG(n)),{r:l}=this;return Aa(l)?t=[]:l!==void 0&&c.pointRadius(l),lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(u=>{u.selectAll().data(t).enter().append("path").call(Nt,this).attr("d",a?f=>c.pointRadius(a[f])(s[f]):f=>c(s[f])).call(Zt,this,r)}).node()}};function vG({x:e,y:t}){if(e||t)return e??=n=>n,t??=n=>n,Wc({point(n,r){this.stream.point(e(n),t(r))}})}function Tw(e,{geometry:t=X,...n}={}){switch(e?.type){case"FeatureCollection":e=e.features;break;case"GeometryCollection":e=e.geometries;break;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":e=[e];break}return new Km(e,{geometry:t,...n})}function S7({strokeWidth:e=1.5,...t}={}){return Tw({type:"Sphere"},{strokeWidth:e,...t})}function I7({strokeOpacity:e=.1,...t}={}){return Tw(Y2(),{strokeOpacity:e,...t})}var zf=.5,qf=0;function M7(e={fill:"count"},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:Bt(t),e=sI(e,n),Oo(e,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!Oo(e,"r")&&(n.r=t/2),Se(n,(i,o,s,a,c,l)=>{let{x:u,y:f,z:h,fill:d,stroke:p,symbol:m}=s;if(u===void 0)throw new Error("missing channel: x");if(f===void 0)throw new Error("missing channel: y");({x:u,y:f}=Pa(s,a,l)),h=h?h.value:bt(i,r),d=d?.value,p=p?.value,m=m?.value;let y=pm(e,{z:h,fill:d,stroke:p,symbol:m}),g=h&&[],b=d&&[],w=p&&[],x=m&&[],v=[],_=[],M=[],E=-1;for(let N of e)N.initialize(i);for(let N of o){let O=[];for(let S of e)S.scope("facet",N);for(let[S,A]of Ca(N,y))for(let{index:D,extent:C}of SG(i,A,u,f,t)){O.push(++E),_.push(C.x),M.push(C.y),h&&g.push(y===h?S:h[D[0]]),d&&b.push(y===d?S:d[D[0]]),p&&w.push(y===p?S:p[D[0]]),m&&x.push(y===m?S:m[D[0]]);for(let R of e)R.reduce(D,C)}v.push(O)}let T=s.x.scale,B=s.y.scale,I={x:{value:_,source:a[T]?{value:Yt(_,a[T].invert),scale:T}:null},y:{value:M,source:a[B]?{value:Yt(M,a[B].invert),scale:B}:null},...h&&{z:{value:g}},...d&&{fill:{value:b,scale:"auto"}},...p&&{stroke:{value:w,scale:"auto"}},...m&&{symbol:{value:x,scale:"auto"}},...Object.fromEntries(e.map(({name:N,output:O})=>[N,{scale:"auto",label:O.label,radius:N==="r"?t/2:void 0,value:O.transform()}]))};return{data:i,facets:v,channels:I}})}function SG(e,t,n,r,i){let o=i*(1.5/Z3),s=new Map;for(let a of t){let c=n[a],l=r[a];if(isNaN(c)||isNaN(l))continue;let u=Math.round(l=(l-qf)/o),f=Math.round(c=(c-zf)/i-(u&1)/2),h=l-u;if(Math.abs(h)*3>1){let m=c-f,y=f+(c<f?-1:1)/2,g=u+(l<u?-1:1),b=c-y,w=l-g;m*m+h*h>b*b+w*w&&(f=y+(u&1?1:-1)/2,u=g)}let d=`${f},${u}`,p=s.get(d);p===void 0&&(p={index:[],extent:{data:e,x:(f+(u&1)/2)*i+zf,y:u*o+qf}},s.set(d,p)),p.index.push(a)}return s.values()}var IG={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function A7(e){return new Qm(e)}var Qm=class extends wt{constructor({binWidth:t=20,clip:n=!0,...r}={}){super(Ba,void 0,{clip:n,...r},IG),this.binWidth=Bt(t)}render(t,n,r,i,o){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:l,marginLeft:u,width:f,height:h}=i,d=u-zf,p=f-c-zf,m=a-qf,y=h-l-qf,g=s/2,b=g*K3,w=b/2,x=g*2,v=b*1.5,_=Math.floor(d/x),M=Math.ceil(p/x),E=Math.floor((m+w)/v),T=Math.ceil((y-w)/v)+1,B=`m0,${Ja(-b)}l${Ja(g)},${Ja(w)}v${Ja(b)}l${Ja(-g)},${Ja(w)}`,I=B;for(let N=E;N<T;++N)for(let O=_;O<M;++O)I+=`M${Ja(O*x+(N&1)*g)},${Ja(N*v)}${B}`;return lt("svg:g",o).datum(0).call(Ot,this,i,o).call(Mt,this,{},Ne+zf,Ne+qf).call(N=>N.append("path").call(Nt,this).call(Zt,this,r).attr("d",I)).node()}};function Ja(e){return Math.round(e*1e3)/1e3}var MG={ariaLabel:"image",fill:null,stroke:null};function AG(e){return/^\.*\//.test(e)}function TG(e){return/^(blob|data|file|http|https):/i.test(e)}function EG(e){return typeof e=="string"&&(AG(e)||TG(e))?[void 0,e]:[e,void 0]}var Jm=class extends wt{constructor(t,n={}){let{x:r,y:i,r:o,width:s,height:a,rotate:c,src:l,preserveAspectRatio:u,crossOrigin:f,frameAnchor:h,imageRendering:d}=n;o==null&&(o=void 0),o===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[p,m]=EG(l),[y,g]=oe(o),[b,w]=oe(s,g!==void 0?g*2:void 0),[x,v]=oe(a,g!==void 0?g*2:void 0),[_,M]=oe(c,0);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:y,scale:"r",filter:rr,optional:!0},width:{value:b,filter:rr,optional:!0},height:{value:x,filter:rr,optional:!0},rotate:{value:_,optional:!0},src:{value:p,optional:!0}},Rm(n),MG),this.src=m,this.width=w,this.rotate=M,this.height=v,this.r=g,this.preserveAspectRatio=ue(u,"xMidYMid"),this.crossOrigin=Ue(f),this.frameAnchor=No(h),this.imageRendering=ue(d,"auto")}render(t,n,r,i,o){let{x:s,y:a}=n,{x:c,y:l,width:u,height:f,r:h,rotate:d,src:p}=r,{r:m,width:y,height:g,rotate:b}=this,[w,x]=gn(this,i);return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,{x:c&&s,y:l&&a}).call(v=>v.selectAll().data(t).enter().append("image").call(Nt,this).attr("x",T7(c,u,h,w,y,m)).attr("y",T7(l,f,h,x,g,m)).attr("width",u?_=>u[_]:y!==void 0?y:h?_=>h[_]*2:m*2).attr("height",f?_=>f[_]:g!==void 0?g:h?_=>h[_]*2:m*2).attr("transform",d?_=>`rotate(${d[_]})`:b?`rotate(${b})`:null).attr("transform-origin",d||b?ja`${c?_=>c[_]:w}px ${l?_=>l[_]:x}px`:null).call(ut,"href",p?_=>p[_]:this.src).call(ut,"preserveAspectRatio",this.preserveAspectRatio).call(ut,"crossorigin",this.crossOrigin).call(ut,"image-rendering",this.imageRendering).call(ut,"clip-path",h?_=>`circle(${h[_]}px)`:m!==void 0?`circle(${m}px)`:null).call(Zt,this,r)).node()}};function T7(e,t,n,r,i,o){return t&&e?s=>e[s]-t[s]/2:t?s=>r-t[s]/2:e&&i!==void 0?s=>e[s]-i/2:i!==void 0?r-i/2:n&&e?s=>e[s]-n[s]:n?s=>r-n[s]:e?s=>e[s]-o:r-o}function E7(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Ce(t,n)),new Jm(e,{...r,x:t,y:n})}function DG(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,y,g;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),y=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*y))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,y=u+f,e<u/y?d=Math.pow(t*y*e,1/t):d=1-Math.pow(n*y*(1-e),1/n)),g=-Vf(t)-Vf(n)+Vf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=BG(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+g),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function BG(e,t,n){var r=e===0||e===1?0:Math.exp(Vf(t+n)-Vf(t)-Vf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*D7(e,t,n)/t:1-r*D7(1-e,n,t)/n}function D7(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Vf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function B7(e,t){var n=DG(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}var NG={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ew=class extends wt{constructor(t,n={}){let{x:r,y:i,z:o,ci:s=.95,precision:a=4}=n;if(super(t,{x:{value:r,scale:"x"},y:{value:i,scale:"y"},z:{value:zn(n),optional:!0}},n,NG),this.z=o,this.ci=+s,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${s}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(t,n,r,i,o){let{x:s,y:a,z:c}=r,{ci:l}=this;return lt("svg:g",o).call(Ot,this,i,o).call(Mt,this,n).call(u=>u.selectAll().data(c?wm(t,c,this.z):[t]).enter().call(f=>f.append("path").attr("fill","none").call(Nt,this).call(dl,this,{...r,fill:null,fillOpacity:null}).attr("d",h=>this._renderLine(h,s,a)).call(l&&!Cs(this.fill)?h=>h.select(OG).attr("stroke","none").call(Nt,this).call(dl,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",d=>this._renderBand(d,s,a)):()=>{}))).node()}};function OG(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(Kr.svg,"path"),this)}var mM=class extends Ew{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ce(t,u=>r[u]),c=Dw(t,r,n),l=L7(t,r,n,(1-i)/2,c);return Wu().y(u=>u).x0(u=>l(u,-1)).x1(u=>l(u,1))(ke(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ce(t,a=>r[a]),s=Dw(t,r,n);return`M${s(i)},${i}L${s(o)},${o}`}},yM=class extends Ew{constructor(t,n){super(t,n)}_renderBand(t,n,r){let{ci:i,precision:o}=this,[s,a]=ce(t,u=>n[u]),c=Dw(t,n,r),l=L7(t,n,r,(1-i)/2,c);return Wu().x(u=>u).y0(u=>l(u,-1)).y1(u=>l(u,1))(ke(s,a-o/2,o).concat(a))}_renderLine(t,n,r){let[i,o]=ce(t,a=>n[a]),s=Dw(t,n,r);return`M${i},${s(i)}L${o},${s(o)}`}};function N7(e,{y:t=Ae,x:n=X,stroke:r,fill:i=ne(r)?"currentColor":r,...o}={}){return new mM(e,Af({...o,x:n,y:t,fill:i,stroke:r}))}function O7(e,{x:t=Ae,y:n=X,stroke:r,fill:i=ne(r)?"currentColor":r,...o}={}){return new yM(e,Mf({...o,x:t,y:n,fill:i,stroke:r}))}function Dw(e,t,n){let r=0,i=0,o=0,s=0;for(let u of e){let f=t[u],h=n[u];r+=f,i+=h,o+=f*h,s+=f*f}let a=e.length,c=(a*o-r*i)/(a*s-r*r),l=(i-c*r)/a;return u=>c*u+l}function L7(e,t,n,r,i){let o=Mn(e,u=>t[u])/e.length,s=0,a=0;for(let u of e)s+=(t[u]-o)**2,a+=(n[u]-i(t[u]))**2;let c=Math.sqrt(a/(e.length-2)),l=B7(r,e.length-2);return(u,f)=>{let h=i(u),d=c*Math.sqrt(1/e.length+(u-o)**2/s);return h+f*l*d}}function ty({path:e=X,delimiter:t,frameAnchor:n,treeLayout:r=Gc,treeSort:i,treeSeparation:o,treeAnchor:s,treeFilter:a,...c}={}){s=Lw(s),i=R7(i),a!=null&&(a=bM(a)),n===void 0&&(n=s.frameAnchor);let l=k7(t),u=j7(c,bM),[f,h]=pn(),[d,p]=pn();return{x:f,y:d,frameAnchor:n,...mn(c,(m,y)=>{let g=l(bt(m,e)),b=h([]),w=p([]),x=-1,v=[],_=[],M=Ab().path(T=>g[T]),E=r();E.nodeSize&&E.nodeSize([1,1]),E.separation&&o!==void 0&&E.separation(o??cm);for(let T of u)T[Nw]=T[q7]([]);for(let T of y){let B=[],I=M(T.filter(N=>g[N]!=null)).each(N=>N.data=m[N.data]);i!=null&&I.sort(i),E(I);for(let N of I.descendants())if(!(a!=null&&!a(N))){B.push(++x),v[x]=N.data,s.position(N,x,b,w);for(let O of u)O[Nw][x]=O[V7](N)}_.push(B)}return{data:v,facets:_}}),...Object.fromEntries(u)}}function Ow({path:e=X,delimiter:t,curve:n="bump-x",stroke:r="#555",strokeWidth:i=1.5,strokeOpacity:o=.5,treeLayout:s=Gc,treeSort:a,treeSeparation:c,treeAnchor:l,treeFilter:u,...f}={}){l=Lw(l),a=R7(a),u!=null&&(u=C7(u)),f={curve:n,stroke:r,strokeWidth:i,strokeOpacity:o,...f};let h=k7(t),d=j7(f,C7),[p,m]=pn(),[y,g]=pn(),[b,w]=pn(),[x,v]=pn();return{x1:p,x2:y,y1:b,y2:x,...mn(f,(_,M)=>{let E=h(bt(_,e)),T=m([]),B=g([]),I=w([]),N=v([]),O=-1,S=[],A=[],D=Ab().path(R=>E[R]),C=s();C.nodeSize&&C.nodeSize([1,1]),C.separation&&c!==void 0&&C.separation(c??cm);for(let R of d)R[Nw]=R[q7]([]);for(let R of M){let F=[],k=D(R.filter($=>E[$]!=null)).each($=>$.data=_[$.data]);a!=null&&k.sort(a),C(k);for(let{source:$,target:U}of k.links())if(!(u!=null&&!u(U,$))){F.push(++O),S[O]=U.data,l.position($,O,T,I),l.position(U,O,B,N);for(let W of d)W[Nw][O]=W[V7](U,$)}A.push(F)}return{data:S,facets:A}}),...Object.fromEntries(d)}}function Lw(e="left"){switch(`${e}`.trim().toLowerCase()){case"left":return LG;case"right":return FG}throw new Error(`invalid tree anchor: ${e}`)}var LG={frameAnchor:"left",dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},FG={frameAnchor:"right",dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function R7(e){return e==null||typeof e=="function"?e:`${e}`.trim().toLowerCase().startsWith("node:")?F7(bM(e)):F7(CG(e))}function F7(e){return(t,n)=>fn(e(t),e(n))}function CG(e){return t=>t.data?.[e]}function k7(e="/"){if(e=`${e}`,e==="/")return n=>n;if(e.length!==1)throw new Error("delimiter must be exactly one character");let t=e.charCodeAt(0);return n=>n.map(r=>RG(r,t))}var gM=92,$7=47;function RG(e,t){if(t===gM)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,i=e.length;r<i;++r){switch(e.charCodeAt(r)){case gM:if(!n){n=!0;continue}break;case t:n?(e=e.slice(0,r-1)+e.slice(r),--r,--i):e=e.slice(0,r)+"/"+e.slice(r+1);break;case $7:n?(e=e.slice(0,r)+"\\\\"+e.slice(r),r+=2,i+=2):(e=e.slice(0,r)+"\\"+e.slice(r),++r,++i);break}n=!1}return e}function kG(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case gM:if(!t){t=!0;continue}case $7:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r);break}t=!1}return e}function U7(e){return dn(e)&&typeof e.node=="function"}function $G(e){return dn(e)&&typeof e.link=="function"}function bM(e){if(U7(e))return e.node;if(e=`${e}`.trim().toLowerCase(),!!e.startsWith("node:")){switch(e){case"node:name":return wM;case"node:path":return xM;case"node:internal":return P7;case"node:external":return z7;case"node:depth":return _M;case"node:height":return vM}throw new Error(`invalid node value: ${e}`)}}function C7(e){if(U7(e))return e.node;if($G(e))return e.link;if(e=`${e}`.trim().toLowerCase(),!(!e.startsWith("node:")&&!e.startsWith("parent:"))){switch(e){case"parent:name":return Bw(wM);case"parent:path":return Bw(xM);case"parent:depth":return Bw(_M);case"parent:height":return Bw(vM);case"node:name":return wM;case"node:path":return xM;case"node:internal":return P7;case"node:external":return z7;case"node:depth":return _M;case"node:height":return vM}throw new Error(`invalid link value: ${e}`)}}function xM(e){return e.id}function wM(e){return UG(e.id)}function _M(e){return e.depth}function vM(e){return e.height}function P7(e){return!!e.children}function z7(e){return!e.children}function Bw(e){return(t,n)=>n==null?void 0:e(n)}function UG(e){let t=e.length;for(;--t>0&&!PG(e,t););return kG(e.slice(t+1))}function PG(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var q7=2,V7=3,Nw=4;function j7(e,t){let n=[];for(let r in e){let i=e[r],o=t(i);o!==void 0&&n.push([r,...pn(i),o])}return n}function SM(e,{fill:t,stroke:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:f=u,markerEnd:h=u,dot:d=ne(f)&&ne(h),text:p="node:name",textStroke:m="var(--plot-background)",title:y="node:path",dx:g,dy:b,textAnchor:w,treeLayout:x=Gc,textLayout:v=x===Gc||x===Ib?"mirrored":"normal",tip:_,...M}={}){if(g===void 0&&(g=Lw(M.treeAnchor).dx),w!==void 0)throw new Error("textAnchor is not a configurable tree option");v=rn(v,"textLayout",["mirrored","normal"]);function E(T){return Co(e,ty({treeLayout:x,text:p,fill:t===void 0?"currentColor":t,stroke:m,dx:g,dy:b,title:y,...T,...M}))}return Qe(gw(e,Ow({treeLayout:x,markerStart:f,markerEnd:h,stroke:n!==void 0?n:t===void 0?"node:internal":t,strokeWidth:r,strokeOpacity:i,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:l,...M})),d?li(e,ty({treeLayout:x,fill:t===void 0?"node:internal":t,title:y,tip:_,...M})):null,p!=null?v==="mirrored"?[E({textAnchor:"start",treeFilter:"node:external"}),E({textAnchor:"end",treeFilter:"node:internal",dx:-g})]:E():null)}function Y7(e,t){return SM(e,{...t,treeLayout:Ib})}function W7({geometry:e=X,...t}={}){return Se({...t,x:null,y:null},(n,r,i,o,s,{projection:a})=>{let c=bt(n,e),l=c.length,u=new Float64Array(l),f=new Float64Array(l),h=Tn(a);for(let d=0;d<l;++d)[u[d],f[d]]=h.centroid(c[d]);return{data:n,facets:r,channels:{x:{value:u,scale:a==null?"x":null,source:null},y:{value:f,scale:a==null?"y":null,source:null}}}})}function G7({geometry:e=X,...t}={}){let n;return{...t,x:{transform:r=>Float64Array.from(n=bt(bt(r,e),U2),([i])=>i)},y:{transform:()=>Float64Array.from(n,([,r])=>r)}}}var iL=uF(rL(),1);var XG=({marginLeft:e})=>[1,e],HG=({width:e,marginRight:t})=>[-1,e-t],ZG=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],KG=({marginTop:e})=>[1,e],QG=({height:e,marginBottom:t})=>[-1,e-t],JG=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function oL(e){return typeof e=="string"?{anchor:e}:e}function sL(e={},t={}){arguments.length===1&&([e,t]=cL(e));let{anchor:n="left",padding:r=1,r:i=t.r}=oL(e);switch(`${n}`.toLowerCase()){case"left":n=XG;break;case"right":n=HG;break;case"middle":n=ZG;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return lL("x","y",n,Bt(r),i,t)}function aL(e={},t={}){arguments.length===1&&([e,t]=cL(e));let{anchor:n="bottom",padding:r=1,r:i=t.r}=oL(e);switch(`${n}`.toLowerCase()){case"top":n=KG;break;case"bottom":n=QG;break;case"middle":n=JG;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return lL("y","x",n,Bt(r),i,t)}function cL(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function lL(e,t,n,r,i,o){if(i!=null&&typeof i!="number"){let{channels:s,sort:a,reverse:c}=o;s=um(s),s?.r===void 0&&(o={...o,channels:{...s,r:{value:i,scale:"r"}}}),a===void 0&&c===void 0&&(o.sort={channel:"-r"})}return Se(o,function(s,a,c,l,u,f){let{[t]:h,r:d}=c;if(!c[t])throw new Error(`missing channel: ${t}`);({[t]:h}=Pa(c,l,f));let p=d?void 0:i!==void 0?Bt(i):this.r!==void 0?this.r:3;d&&(d=bt(d.value,l[d.scale]||X,Float64Array));let[m,y]=n(u),g=m?eX:tX,b=new Float64Array(h.length),w=d?x=>d[x]:()=>p;for(let x of a){let v=(0,iL.default)();x=x.filter(d?M=>Ku(h[M])&&rr(d[M]):M=>Ku(h[M]));let _=new Float64Array(2*x.length+2);for(let M of x){let E=w(M),T=m?E+r:0,B=h[M]-E,I=h[M]+E,N=2;v.queryInterval(B-r,I+r,([,,S])=>{let A=b[S]-T,D=h[M]-h[S],C=r+(d?d[M]+d[S]:2*p),R=Math.sqrt(C*C-D*D);_[N++]=A-R,_[N++]=A+R});let O=_.slice(0,N);m&&(O=O.filter(S=>S>=0));t:for(let S of O.sort(g)){for(let A=0;A<N;A+=2)if(_[A]+1e-6<S&&S<_[A+1]-1e-6)continue t;b[M]=S+T;break}v.insert([B,I,M])}}m||(m=1);for(let x of a)for(let v of x)b[v]=b[v]*m+y;return{data:s,facets:a,channels:{[e]:{value:b,source:null},[t]:{value:h,source:c[t]},...d&&{r:{value:d,source:c.r}}}}})}function tX(e,t){return Math.abs(e)-Math.abs(t)}function eX(e,t){return e-t}function fL(e,t){return arguments.length===1&&({basis:e,...t}=e),kf(Rw(e),t)}function hL(e,t){return arguments.length===1&&({basis:e,...t}=e),$f(Rw(e),t)}function Rw(e){if(e===void 0)return uL;if(typeof e=="function")return kw(rf(e));if(/^p\d{2}$/i.test(e))return Gf(ef(e));switch(`${e}`.toLowerCase()){case"deviation":return iX;case"first":return uL;case"last":return rX;case"max":return oX;case"mean":return sX;case"median":return aX;case"min":return cX;case"sum":return lX;case"extent":return nX}throw new Error(`invalid basis: ${e}`)}function kw(e){return{mapIndex(t,n,r){let i=+e(t,n);for(let o of t)r[o]=n[o]===null?NaN:n[o]/i}}}function Gf(e){return kw((t,n)=>e(t,r=>n[r]))}var nX={mapIndex(e,t,n){let[r,i]=ce(e,s=>t[s]),o=i-r;for(let s of e)n[s]=t[s]===null?NaN:(t[s]-r)/o}},uL=kw((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if($e(r))return r}}),rX=kw((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if($e(r))return r}}),iX={mapIndex(e,t,n){let r=fs(e,o=>t[o]),i=Zr(e,o=>t[o]);for(let o of e)n[o]=t[o]===null?NaN:i?(t[o]-r)/i:0}},oX=Gf(Xt),sX=Gf(fs),aX=Gf(Di),cX=Gf(le),lX=Gf(Mn);function dL(e,t){return uX("x",e,t)}function uX(e,t,n={}){let r,i=1;if(typeof t=="number")i=t,r=(l,u)=>+l+u;else{if(typeof t=="string"){let l=t.startsWith("-")?-1:1;[t,i]=p1(t.replace(/^[+-]/,"")),i*=l}t=sf(t),r=(l,u)=>t.offset(l,u)}let o=`${e}1`,s=`${e}2`,a=yr({[o]:l=>l.map(u=>r(u,i)),[s]:l=>l},n),c=a[s].transform;return a[s].transform=()=>{let l=c(),[u,f]=ce(l);return l.domain=i<0?[u,r(f,i)]:[r(u,i),f],l},a}function pL(e,t={}){if(typeof e=="string")switch(e.toLowerCase()){case"first":return ry(t);case"last":return iy(t)}if(typeof e=="function")return tc(null,e,t);let n,r;for(n in e){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=fX(e[n])}if(r===void 0)throw new Error(`invalid selector: ${e}`);return tc(n,r,t)}function fX(e){if(typeof e=="function")return e;switch(`${e}`.toLowerCase()){case"min":return DM;case"max":return BM}throw new Error(`unknown selector: ${e}`)}function ry(e){return tc(null,hX,e)}function iy(e){return tc(null,dX,e)}function $w(e){return tc("x",DM,e)}function Uw(e){return tc("y",DM,e)}function Pw(e){return tc("x",BM,e)}function zw(e){return tc("y",BM,e)}function*hX(e){yield e[0]}function*dX(e){yield e[e.length-1]}function*DM(e,t){yield cg(e,n=>t[n])}function*BM(e,t){yield Bc(e,n=>t[n])}function tc(e,t,n){if(e!=null){if(n[e]==null)throw new Error(`missing channel: ${e}`);e=n[e]}let r=zn(n);return mn(n,(i,o)=>{let s=bt(i,r),a=bt(i,e),c=[];for(let l of o){let u=[];for(let f of s?an(l,h=>s[h]).values():[l])for(let h of t(f,a))u.push(h);c.push(u)}return{data:i,facets:c}})}wt.prototype.plot=function({marks:e=[],...t}={}){return If({...t,marks:[...e,this]})};var pX=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function mX(e,t,n){for(let r=0;r<t.length;++r){let i=t[r];r===t.length-1?e[i]=n:e=e[i]||(e[i]={})}}function mL(e,t,n){for(let r in e){let i=pX.get(r);if(i==null)throw new Error(`Unrecognized plot attribute: ${r}`);let o=e[r];typeof o=="symbol"?n.push(r):o!==void 0&&mX(t,i.split("."),o)}}var yX=new Set(["frame","hexgrid","sphere","graticule"]),gX=new Map([["first",ry],["last",iy],["maxX",Pw],["maxY",zw],["minX",$w],["minY",Uw],["nearest",qa],["nearestX",Va],["nearestXY",Ps]]);async function gL(e){let t={marks:[]},n=[],{attributes:r,marks:i}=e;mL(r,t,n);let o=[];for(let a of i)for(let{type:c,data:l,options:u}of a.plotSpecs()){let{select:f,...h}=u,d=gX.get(f)?.(h)??h,p=yX.has(c)?[d]:[l,d];t.marks.push(NM[c](...p)),o.push(a.index)}xX(t,e);let s=If(t);wX(s,o),bX(e,s,r,n);for(let a of e.interactors)await a.init(s);return s}function bX(e,t,n,r){r.forEach(i=>{let o=n[i];if(o===Gs){if(!i.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${i}`);let s=i.slice(0,-6),a=t.scale(s);a?.domain&&e.setAttribute(i,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${o}`)})}function xX(e,t){let{marks:n}=t;qw("x",e,n),qw("y",e,n),qw("fx",e,n),qw("fy",e,n)}function qw(e,t,n){let r=t[e]||{};if(r.axis===null||r.label!==void 0)return;let i=n.map(l=>l.channelField(e)?.field);if(i.every(l=>l==null))return;let o,s,a;for(let l=0;l<i.length;++l){let{column:u,label:f}=i[l]||{};u===void 0&&f===void 0||(o===void 0&&s===void 0?(o=u,s=f,a=_X(n[l].data,e)||"number"):s!==f?s=void 0:o!==u&&(o=void 0))}let c=s||o;if(c!==void 0){if((a==="number"||a==="date")&&(e==="x"||e==="y")){r.percent&&(c=`${c} (%)`);let l=(e==="x"?1:-1)*(r.reverse?-1:1);e==="x"||r.labelAnchor==="center"?c=e==="x"==l<0?`\u2190 ${c}`:`${c} \u2192`:c=`${l<0?"\u2191 ":"\u2193 "}${c}`}t[e]={...r,label:c}}}function wX(e,t){let n=e.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)yL(r,t);else yL(e,t)}function yL(e,t){let n=-1;for(let r of e.children){let i=r.getAttribute("aria-label")||"";r.nodeName==="style"||i.includes("-axis")||i.includes("-grid")||r.setAttribute("data-index",t[++n])}}function _X(e,t){if(!e)return;let{columns:n}=e,r=n[t]??n[t+"1"]??n[t+"2"];if(r){for(let i of r)if(i!=null)return i instanceof Date?"date":typeof i}}var vX={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},OM=class{constructor(t){this.attributes={...vX},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=t||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=Fv()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:t,right:n}=this.margins();return this.getAttribute("width")-t-n}innerHeight(t=400){let{top:n,bottom:r}=this.margins(),i=this.getAttribute("height");return i==null&&(i=SX(this,n,r)||t,this.setAttribute("height",i,{silent:!0})),i-n-r}pending(t){this.synch.pending(t)}update(t){return this.synch.ready(t)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let t=await gL(this),n=this.legends.flatMap(({legend:r,include:i})=>{let o=r.init(t);return i?o:[]});this.element.replaceChildren(t,...n),this.synch.resolve()}getAttribute(t){return this.attributes[t]}setAttribute(t,n,r){return wd(this.attributes[t],n)?(n===void 0?delete this.attributes[t]:this.attributes[t]=n,r?.silent||this.listeners?.get(t)?.forEach(i=>i(t,n)),!0):!1}addAttributeListener(t,n){let r=this.listeners||(this.listeners=new Map);return r.has(t)||r.set(t,new Set),r.get(t).add(n),this}removeAttributeListener(t,n){return this.listeners?.get(t)?.delete(n)}addParams(t,n){let{params:r}=this;for(let i of n)r.has(i)?r.get(i).push(t):(r.set(i,[t]),i.addEventListener("value",()=>Promise.allSettled(r.get(i).map(o=>o.requestQuery()))))}addMark(t){return t.setPlot(this,this.marks.length),this.marks.push(t),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(t){return this.interactors.push(t),this}addLegend(t,n=!0){t.setPlot(this),this.legends.push({legend:t,include:n})}};function SX(e,t,n){let r=e.getAttribute("aspectRatio");if(r==null)return;let i=e.getAttribute("xDomain"),o=e.getAttribute("yDomain");if(!i||!o)return;let s=Math.abs(i[1]-i[0]);return Math.abs(o[1]-o[0])*e.innerWidth()/(r*s)+t+n}function Vw(e){return typeof e!="string"?!1:(e=e.toLowerCase().trim(),e==="none"||e==="currentcolor"||e.startsWith("url(")&&e.endsWith(")")||e.startsWith("var(")&&e.endsWith(")")||Er(e)!==null)}var IX=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function bL(e){return IX.has(e)}var MX=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function xL(e){return MX.has(`${e}`.toLowerCase())}var wL=e=>e==="stroke"||e==="fill",AX=e=>/opacity$/i.test(e),TX=e=>e==="symbol",EX=(e,t)=>e!=="sort"&&e!=="tip"&&t!=null&&!Array.isArray(t),LM=(e,t)=>({channel:e,field:t,as:t instanceof pr?t.column:e}),FM=(e,t)=>({channel:e,value:t}),jw=e=>Array.isArray(e),Nn=class extends Jf{constructor(t,n,r,i={}){super(n?.options?.filterBy),this.type=t,this.reqs=i,this.source=n,jw(this.source)&&(this.data=Hr(this.source));let o=this.channels=[],s=this.detail=new Set,a=this.params=new Set,c=(l,u)=>{let f=typeof u;if(l==="channels")for(let h in u)s.add(h),c(h,u[h]);else if(f==="function"&&u[Kf]){let h=u(this,l);for(let d in h)c(d,h[d])}else if(f==="string")bL(l)||wL(l)&&Vw(u)||TX(l)&&xL(u)?o.push(FM(l,u)):o.push(LM(l,U0(u)));else if(ss(u))if(Array.isArray(u.columns))o.push(LM(l,u)),a.add(u);else{let h=FM(l,u.value);o.push(h),u.addEventListener("value",d=>(h.value=d,this.update()))}else f==="object"&&EX(l,u)?o.push(LM(l,u)):u!==void 0&&o.push(FM(l,u))};for(let l in r)c(l,r[l])}setPlot(t,n){this.plot=t,this.index=n,t.addParams(this,this.params),this.source?.table&&this.queryPending()}hasOwnData(){return this.source==null||jw(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(t){return this.channels.find(n=>n.channel===t)}channelField(t,{exact:n=!1}={}){let r=n?this.channel(t):this.channels.find(i=>i.channel.startsWith(t));return r?.field?r:null}fields(){if(this.hasOwnData())return null;let{source:{table:t},channels:n,reqs:r}=this,i=new Map;for(let{channel:o,field:s}of n){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,l=i.get(c)??i.set(c,new Set).get(c);a.forEach(u=>l.add(u)),r[o]?.forEach(u=>l.add(u))}return Array.from(i,([o,s])=>({table:t,column:o,stats:s}))}fieldInfo(t){let n=Object.fromEntries(t.map(r=>[r.column,r]));for(let r of this.channels){let{field:i}=r;i&&Object.assign(r,n[i.stats?.column??i])}return this._fieldInfo=!0,this}query(t=[]){if(this.hasOwnData())return null;let{channels:n,source:{table:r}}=this;return oy(n,r).where(t)}queryPending(){return this.plot.pending(this),this}queryResult(t){return this.data=Hr(t),this}update(){return this.plot.update(this)}plotSpecs(){let{type:t,data:n,detail:r,channels:i}=this;return CM(t,r,i,n)}};function Vn(e,t){let n=t?.[e.as]??e.as;return Object.hasOwn(e,"value")?e.value:wL(e.channel)?{value:n,scale:"color"}:AX(e.channel)?{value:n,scale:"opacity"}:n}function oy(e,t,n=[]){let r=Ct.from({source:t}),i=new Set,o=!1;for(let s of e){let{channel:a,field:c,as:l}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(c.aggregate)o=!0;else{if(i.has(l))continue;i.add(l)}r.select({[l]:c})}}}return o&&r.groupby(Array.from(i)),r}function CM(e,t,n,r,i={}){let{numRows:o,values:s,columns:a}=r??{},c={};for(let f of n){let h=t.has(f.channel)?c:i;h[f.channel]=Vn(f,a)}return t.size&&(i.channels=c),[{type:e,data:s??(r?{length:o}:null),options:i}]}function Tl(e,t){let{plot:n}=e,r=n.getAttribute(`${t}Scale`);if(!r){let{type:o}=e.channelField(t);r=o==="date"?"time":"linear"}let i={type:r};switch(r){case"log":i.base=n.getAttribute(`${t}Base`)??10;break;case"pow":i.exponent=n.getAttribute(`${t}Exponent`)??1;break;case"symlog":i.constant=n.getAttribute(`${t}Constant`)??1;break}return gd(i)}function $r(e,t,n,r,i=1,o){let{field:s}=e.channelField(t);o=o??s;let{type:a,apply:c,sqlApply:l}=Tl(e,t),u=!!e.plot.getAttribute(`${t}Reverse`),[f,h]=r.map(b=>c(b)),d=l(o),p=a==="time"||a==="utc"?d:o,m=h===f?0:(n-i)/(h-f),y=m!==1?` * ${m}::DOUBLE`:"";return[u?q`(${h} - ${d}::DOUBLE)${y}`:q`(${d}::DOUBLE - ${f})${y}`,p]}var RM={x:["min","max"]},kM={y:["min","max"]},Yw={...RM,...kM};function _L(e,t,n,r,i){let{plot:o}=e,s=o.getAttribute(r),a=o.getAttribute(i);if(Array.isArray(s)&&!s[bn])return s;{let{column:c,min:l,max:u}=e.channelField(n),f=$M(t,c)||(a?_s().domain([l,u]).nice().domain():[l,u]);return s!==Gs&&(f[bn]=!0),o.setAttribute(r,f,{silent:!0}),f}}function Po(e,t){return _L(e,t,"x","xDomain","xNice")}function zo(e,t){return _L(e,t,"y","yDomain","yNice")}function $M(e,t){if(!e)return;let n,r,i=(o,s)=>{if(o==="BETWEEN"&&`${s.field}`===t){let{range:a}=s;a&&(n==null||a[0]<n)&&(n=a[0]),a&&(r==null||a[1]>r)&&(r=a[1])}};return Array.isArray(e)?e.forEach(o=>o.visit?.(i)):e.visit&&e.visit(i),n!=null&&r!=null&&n!==r?[n,r]:void 0}var UM=class extends Nn{constructor(t,n,r){let i=t.endsWith("X")?"y":t.endsWith("Y")?"x":null,o=i?{[i]:["min","max"]}:void 0;super(t,n,r,o),this.dim=i}query(t=[]){let{plot:n,dim:r,source:i}=this,{optimize:o=!0}=i.options||{},s=super.query(t);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:l,as:u,type:f,min:h,max:d}=this.channelField(r);if(o&&(f==="date"||f==="number")&&c){let m=r==="x"?n.innerWidth():n.innerHeight(),[y,g]=$M(t,l)||[h,d],[b]=$r(this,r,m,[y,g],1,u),w=s.select().map(x=>x.as).filter(x=>x!==u&&x!==c);return DX(s,b,u,c,w)}else return s.orderby(l)}};function DX(e,t,n,r,i=[]){let o=q`FLOOR(${t})::INTEGER`,s=a=>Ct.from(e).select(a).groupby(o,i);return Ct.union(s([{[n]:la(n),[r]:z0(r,n)},...i]),s([{[n]:ca(n),[r]:q0(r,n)},...i]),s([{[n]:z0(n,r),[r]:la(r)},...i]),s([{[n]:q0(n,r),[r]:ca(r)},...i])).orderby(i,n)}function vL(e,t=[]){return new t.constructor(e)}function SL(e,t,n){let r=vL(e,n),i=n.length;for(let o=0;o<i;++o)r[t[o]]=n[o];return r}function IL(e,t,n,r,i,o,s){let a=n.length,c=e*t,l=i.map(d=>r[d]),u={},f=[],h=new Int32Array(a);if(o?.length){let d=o.map(m=>r[m]),p={};for(let m=0;m<a;++m){let y=d.map(g=>g[m]);h[m]=p[y]??=f.push(y)-1}for(let m=0;m<o.length;++m)u[o[m]]=f.map(y=>y[m])}else f.push([]);if(s){let d=n.map(y=>y%e),p=n.map(y=>Math.floor(y/e)),m=f.map(()=>[]);for(let y=0;y<a;++y)m[h[y]].push(y);i.forEach((y,g)=>{let b=l[g];u[y]=f.map((w,x)=>s(m[x],e,t,d,p,b))})}else i.forEach((d,p)=>{let m=l[p],y=u[d]=f.map(()=>vL(c,m));for(let g=0;g<a;++g)y[h[g]][n[g]]=m[g]});return{numRows:f.length,columns:u}}function sy(e){let t=1/0,n=-1/0;return e.forEach(r=>{let i=r.length;for(let o=0;o<i;++o){let s=r[o];s<t&&(t=s),s>n&&(n=s)}}),Number.isFinite(t)&&Number.isFinite(n)?[t,n]:[0,1]}function ML(e){let t=new Xn;return e.forEach(n=>{let r=n.length;for(let i=0;i<r;++i)t.add(n[i])}),Array.from(t).sort(Et)}function ze(e,t){return ru(e)?(e.addEventListener("value",t),e.value):e}function ay(e,t=!1){let n=new Float64Array(5),r=new Float64Array(4);BX(n,r,e);let i=Float64Array.of(0,r[1]-n[1]*r[0],r[2]-n[2]*r[0],r[3]-n[3]*r[0],-n[4]*r[0]),o=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/o,a=(i[1]+i[2]+i[3]+i[4])/o;return{sigma:e,negative:t,a:n,b_causal:r,b_anticausal:i,sum_causal:s,sum_anticausal:a}}function BX(e,t,n){let i=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),o=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,l=Float64Array.of(-o*Math.cos(a),o*Math.sin(a),-o*Math.cos(-a),o*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),u=n*2.5066282746310007,f=Float64Array.of(i[0],i[1],0,0,0,0,0,0),h=Float64Array.of(1,0,l[0],l[1],0,0,0,0,0,0),d,p;for(p=2;p<8;p+=2){for(f[p]=l[p]*f[p-2]-l[p+1]*f[p-1],f[p+1]=l[p]*f[p-1]+l[p+1]*f[p-2],d=p-2;d>0;d-=2)f[d]+=l[p]*f[d-2]-l[p+1]*f[d-1],f[d+1]+=l[p]*f[d-1]+l[p+1]*f[d-2];for(d=0;d<=p;d+=2)f[d]+=i[p]*h[d]-i[p+1]*h[d+1],f[d+1]+=i[p]*h[d+1]+i[p+1]*h[d];for(h[p+2]=l[p]*h[p]-l[p+1]*h[p+1],h[p+3]=l[p]*h[p+1]+l[p+1]*h[p],d=p;d>0;d-=2)h[d]+=l[p]*h[d-2]-l[p+1]*h[d-1],h[d+1]+=l[p]*h[d-1]+l[p+1]*h[d-2]}for(p=0;p<4;++p)d=p<<1,t[p]=f[d]/u,e[p+1]=h[d+2]}function AL(e,t,n,[r,i]){let o=new Float64Array(Math.max(r,i)),s=new Float64Array(Math.max(r,i)),a=new Float64Array(5),c=new Float64Array(n.length);for(let l=0,u=0;l<i;++l,u+=r){let f=c.subarray(u);Ww(e,n.subarray(u),r,1,o,s,a,f)}for(let l=0;l<r;++l){let u=c.subarray(l);Ww(t,u,i,r,o,s,a,u)}return c}function Ww(e,t,n,r=1,i=new Float64Array(n),o=new Float64Array(n),s=new Float64Array(5),a=i,c=NX){let l=r*2,u=r*3,f=r*4,h=r*n,d,p;for(c(i,t,n,r,e.b_causal,3,e.a,4,e.sum_causal,s,e.sigma),p=4,d=f;p<n;++p,d+=r)i[p]=e.b_causal[0]*t[d]+e.b_causal[1]*t[d-r]+e.b_causal[2]*t[d-l]+e.b_causal[3]*t[d-u]-e.a[1]*i[p-1]-e.a[2]*i[p-2]-e.a[3]*i[p-3]-e.a[4]*i[p-4];for(c(o,t,n,-r,e.b_anticausal,4,e.a,4,e.sum_anticausal,s,e.sigma),p=4,d=h-r*5;p<n;++p,d-=r)o[p]=e.b_anticausal[1]*t[d+r]+e.b_anticausal[2]*t[d+l]+e.b_anticausal[3]*t[d+u]+e.b_anticausal[4]*t[d+f]-e.a[1]*o[p-1]-e.a[2]*o[p-2]-e.a[3]*o[p-3]-e.a[4]*o[p-4];if(e.negative)for(p=0,d=0;p<n;++p,d+=r)a[d]=i[p]+o[n-p-1];else for(p=0,d=0;p<n;++p,d+=r)a[d]=Math.max(0,i[p]+o[n-p-1]);return a}function NX(e,t,n,r,i,o,s,a,c,l,u,f=.5){let h=Math.abs(r)*n,d=r<0?h+r:0,p,m,y;for(m=0;m<=a;++m)for(l[m]=m<=o?i[m]:0,y=1;y<=a&&y<=m;++y)l[m]-=s[y]*l[m-y];for(y=0;y<a;++y)for(e[y]=0,m=1;m<=y;++m)p=d+r*m,p>=0&&p<h&&(e[y]+=l[y-m]*t[p]);let g=t[d],b=Math.ceil(u*10);for(m=0;m<b;++m){for(y=0;y<a;++y)e[y]+=l[y]*g;if(c-=Math.abs(l[0]),c<=f)break;for(l[a]=m+a<=o?i[m+a]:0,y=1;y<=a;++y)l[a]-=s[y]*l[a-y];for(y=0;y<a;++y)l[y]=l[y+1]}}var Ys="density",Ri=class extends Nn{constructor(t,n,r){let{bandwidth:i=0,interpolate:o="none",pixelSize:s=1,pad:a=1,width:c,height:l,...u}=r,f=OX(u);super(t,n,u,Yw),this.densityMap=f,this.bandwidth=ze(i,h=>(this.bandwidth=h,this.grids?this.convolve().update():null)),this.interpolate=ze(o,h=>(this.interpolate=h,this.requestUpdate())),this.pixelSize=ze(s,h=>(this.pixelSize=h,this.requestUpdate())),this.pad=ze(a,h=>(this.pad=h,this.requestUpdate())),this.width=ze(c,h=>(this.width=h,this.requestUpdate())),this.height=ze(l,h=>(this.height=h,this.requestUpdate()))}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};t.addAttributeListener("xDomain",r),t.addAttributeListener("yDomain",r),super.setPlot(t,n)}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[bn]&&!n[bn]}query(t=[]){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[a,c]=this.extentX=Po(this,t),[l,u]=this.extentY=zo(this,t),[f,h]=this.bins=this.binDimensions(),[d,p]=$r(this,"x",f,[a,c],r),[m,y]=$r(this,"y",h,[l,u],r),g=r?[sn(p,[+a,+c]),sn(y,[+l,+u])]:[Sc(+a,p),vc(p,+c),Sc(+l,y),vc(y,+u)],b=Ct.from(s.table).where(t.concat(g)),w=this.groupby=[],x={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:E,field:T}=_;T.aggregate?(x[E]=T,o[E]=!0):E==="weight"?x[Ys]=Mi(T):E!=="x"&&E!=="y"&&(b.select({[M]:T}),w.push(M))}let v=this.aggr=Object.keys(x);if(x.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push(Ys),x.density=Tr()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!x.density)throw new Error("Linear binning not applicable to custom aggregates.");return CX(b,d,m,x[Ys],f,w)}else return FX(b,d,m,x,f,w)}binDimensions(){let{plot:t,pixelSize:n,width:r,height:i}=this;return[r??Math.round(t.innerWidth()/n),i??Math.round(t.innerHeight()/n)]}queryResult(t){let[n,r]=this.bins,i=LX(this.interpolate),{columns:o}=Hr(t);return this.grids0=IL(n,r,o.index,o,this.aggr,this.groupby,i),this.convolve()}convolve(){let{aggr:t,bandwidth:n,bins:r,grids0:i,plot:o}=this;if(this.grids=i,n>0){let s=t.length===1?t[0]:t.includes(Ys)?Ys:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=i.columns[s],c=o.innerWidth(),l=o.innerHeight(),[u,f]=r,h=a.some(m=>m.some(y=>y<0)),d=ay(n*(u-1)/c,h),p=ay(n*(f-1)/l,h);this.grids={numRows:i.numRows,columns:{...i.columns,[s]:a.map(m=>AL(d,p,m,r))}}}return this}};function OX(e){let t={};for(let n in e)e[n]==="density"&&(delete e[n],t[n]=!0);return t}function LX(e="none"){if(typeof e=="function")return e;switch(e.toLowerCase()){case"none":case"linear":return;case"nearest":return Ym;case"barycentric":return jm();case"random-walk":return Wm()}throw new Error(`invalid interpolate: ${e}`)}function FX(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function CX(e,t,n,r,i,o){let s=r?.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Ct.from(Ct.unionAll(c,l,u,f)).select({index:"i",density:Mi("w")},o).groupby("index",o).having(pd("density",0))}var PM=class extends Ri{constructor(t,n){let{thresholds:r=10,...i}=n;super("geo",t,{bandwidth:20,interpolate:"linear",pixelSize:2,...i}),this.thresholds=ze(r,o=>(this.thresholds=o,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:t,densityMap:n,grids:r,thresholds:i,plot:o}=this,{numRows:s,columns:a}=r,c=i,l;if(Array.isArray(c))l=c;else{let[,I]=sy(a.density);l=Array.from({length:c-1},(N,O)=>I*(O+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[u,f]=t,[h,d]=o.getAttribute("xDomain"),[p,m]=o.getAttribute("yDomain"),y=(d-h)/u,g=(m-p)/f,b=+h,w=+p,x=I=>b+I*y,v=I=>w+I*g,_=ba().size(t),M=this.contourData=Array(s*l.length),{density:E,...T}=a,B=Object.entries(T);for(let I=0,N=0;I<s;++I){let O=E[I],S=B.reduce((A,[D,C])=>(A[D]=C[I],A),{});for(let A=0;A<l.length;++A,++N)M[N]=Object.assign(RX(_.contour(O,l[A]),x,v),S)}return this}plotSpecs(){let{type:t,channels:n,densityMap:r,contourData:i}=this,o={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(o[a]=Vn(s))}for(let s in r)r[s]&&(o[s]=Vn({channel:s,as:"value"}));return[{type:t,data:i,options:o}]}};function RX(e,t,n){function r(s){s.forEach(i)}function i(s){s.forEach(o)}function o(s){s[0]=t(s[0]),s[1]=n(s[1])}return e.coordinates.forEach(r),e}function cy(e){return Array.from({length:e},(t,n)=>n)}function Gw(e,t){let n=t.reduce((i,o,s)=>(i[o]=s,i),{}),r=cy(e.length);return r.sort((i,o)=>n[e[i]]-n[e[o]]),r}function Xw(e,t){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",e),n.setAttribute("height",t),n}throw new Error("Can not create a canvas instance.")}function TL(e=1){let t=255*e|0;return(n,r,i)=>{for(let o=0,s=0;o<i;++o)for(let a=0;a<r;++a,s+=4)n[s+3]=t}}function EL(e){let{apply:t}=e;return(n,r,i,o)=>{for(let s=0,a=0;s<i;++s)for(let c=0,l=(i-s-1)*r;c<r;++c,a+=4)n[a+3]=255*t(o[c+l])|0}}function DL(e={}){let{r:t=0,g:n=0,b:r=0,opacity:i=1}=typeof e=="string"?en(e):e,o=new Uint8ClampedArray([t,n,r,255*i|0]);return(s,a,c)=>{for(let l=0,u=0;l<c;++l)for(let f=0;f<a;++f,u+=4)s[u+0]=o[0],s[u+1]=o[1],s[u+2]=o[2],s[u+3]=o[3]}}function BL(e){let{domain:t,range:n}=e,r=Object.create(null),i=new Uint8ClampedArray(4*t.length),o=t.length-1,s=n.length;for(let a=0;a<=o;++a){let c=n[a%s],{r:l,g:u,b:f,opacity:h=1}=typeof c=="string"?en(c):c,d=a<<2;i[d+0]=l,i[d+1]=u,i[d+2]=f,i[d+3]=255*h|0,r[t[a]]=d}return(a,c,l,u)=>{if(u.map)for(let f=0,h=0;f<l;++f)for(let d=0,p=(l-f-1)*c;d<c;++d,h+=4){let m=r[u[d+p]];a[h+0]=i[m+0],a[h+1]=i[m+1],a[h+2]=i[m+2],a[h+3]=i[m+3]}else{let f=r[u];for(let h=0,d=0;h<l;++h)for(let p=0;p<c;++p,d+=4)a[d+0]=i[f+0],a[d+1]=i[f+1],a[d+2]=i[f+2],a[d+3]=i[f+3]}}}function NL(e,t,n){let{interpolate:r}=t,i=new Uint8ClampedArray(4*e),o=e-1;for(let s=0;s<=o;++s){let a=r(s/o),{r:c,g:l,b:u,opacity:f=1}=typeof a=="string"?en(a):a,h=s<<2;i[h+0]=c,i[h+1]=l,i[h+2]=u,i[h+3]=255*f|0}return(s,a,c,l)=>{for(let u=0,f=0;u<c;++u)for(let h=0,d=(c-u-1)*a;h<a;++h,f+=4){let p=o*n(l[h+d])<<2;s[f+0]=i[p+0],s[f+1]=i[p+1],s[f+2]=i[p+2],s[f+3]=i[p+3]}}}var Xf=class extends Ri{constructor(t,n){super("image",t,n),this.image=null}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,grids:n}=this,[r,i]=t,{numRows:o,columns:s}=n,{canvas:a,ctx:c,img:l}=PX(this,r,i),{alpha:u,alphaProp:f,color:h,colorProp:d}=qM(this),p=s[f]??[],m=s[d]??[],y=o>1&&d&&this.groupby?.includes(d)?Gw(m,this.plot.getAttribute("colorDomain")):cy(o);return this.data={numRows:o,columns:{src:Array.from({length:o},(g,b)=>(h?.(l.data,r,i,m[y[b]]),u?.(l.data,r,i,p[y[b]]),c.putImageData(l,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:t,plot:n,data:{numRows:r,columns:i}}=this,o={src:i.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:{length:r},options:o}]}},zM=class extends Xf{constructor(t,n){super(t,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function qM(e){let{aggr:t,densityMap:n,groupby:r,plot:i}=e,o=t.includes(Ys),s=t.includes("fillOpacity"),a=e.channel("fill"),c=e.channel("fillOpacity");if(t.length>2||o&&s)throw new Error("Invalid raster encodings. Try dropping an aggregate?");if(r.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let l=n.fill||t.includes("fill")?"grid":r.includes(a?.as)?"group":Vw(a?.value)?a.value:o&&i.getAttribute("colorScheme")?"grid":void 0,u=n.fillOpacity||t.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:o&&l!=="grid"?"grid":void 0;if(l!=="grid"&&u!=="grid")throw new Error("Raster mark missing density values.");let f=a?.as??(l==="grid"?Ys:null),h=c?.as??(u==="grid"?Ys:null),d=l!=="grid"&&l!=="group"?DL(l):$X(e,f),p=u!=="grid"?TL(u):kX(e,h);return{alphaProp:h,colorProp:f,alpha:p,color:d}}function kX(e,t){let{plot:n,grids:r}=e,i=n.getAttribute("opacityDomain"),o=i===Gs,s=i?.[bn],a=!o&&!s&&i||sy(r.columns[t]);(o||s||!i)&&(o||(a[bn]=!0),n.setAttribute("opacityDomain",a));let c=$a({opacity:{type:n.getAttribute("opacityScale"),domain:a,clamp:n.getAttribute("opacityClamp"),nice:n.getAttribute("opacityNice"),reverse:n.getAttribute("opacityReverse"),zero:n.getAttribute("opacityZero"),base:n.getAttribute("opacityBase"),exponent:n.getAttribute("opacityExponent"),constant:n.getAttribute("opacityConstant")}});return EL(c)}function $X(e,t){let{plot:n,grids:r}=e,i=r.columns[t],o=!i[0]?.map,s=o||Array.isArray(i[0]),a=n.getAttribute("colorDomain"),c=a===Gs,l=a?.[bn],u=!c&&!l&&a||(o?i.slice().sort(Et):s?ML(i):sy(i));(c||l||!a)&&(c||(u[bn]=!0),n.setAttribute("colorDomain",u));let f=$a({color:{type:n.getAttribute("colorScale"),domain:u,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return BL(f);{let h=$a({x:{type:UX(f.type),domain:f.domain,reverse:f.reverse,range:[0,1],clamp:f.clamp,base:f.base,exponent:f.exponent,constant:f.constant}});return NL(1024,f,h.apply)}}function UX(e){return e.endsWith("symlog")?"symlog":e.endsWith("log")?"log":e.endsWith("pow")?"pow":e.endsWith("sqrt")?"sqrt":e==="diverging"?"linear":e}function PX(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Xw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}var VM=class extends Xf{constructor(t,n){let{normalize:r=!0,...i}=n;super(t,i),this.normalize=ze(r,o=>(this.normalize=o,this.requestUpdate()))}query(t=[]){let{channels:n,normalize:r,source:i,pad:o}=this,[s,a]=this.bins=this.binDimensions(),[c]=$r(this,"x",s,Po(this,t),o),[l]=$r(this,"y",a,zo(this,t),o),u=Ct.from(i.table).where(zX(this,t));this.aggr=["density"];let f=this.groupby=[],h=[];for(let d of n)if(Object.hasOwn(d,"field")){let{channel:p,field:m}=d;p==="z"?(u.select({[p]:m}),h.push("z")):p!=="x"&&p!=="y"&&(u.select({[p]:m}),f.push(p))}return qX(u,c,l,h,s,a,f,r)}};function zX(e,t){if(Array.isArray(t)&&!t.length)return t;let{column:n}=e.channelField("x"),{column:r}=e.channelField("y"),i=s=>{let a=`${s.field}`;return s.op!=="BETWEEN"||a!==n&&a!==r},o=s=>s.op==="AND"?Xr(s.children.filter(a=>i(a))):s;return Array.isArray(t)?t.filter(s=>i(s)).map(s=>o(s)):o(t)}function qX(e,t,n,r,i,o,s=[],a=!0){e.select({x:q`FLOOR(${t})::INTEGER`,y:q`FLOOR(${n})::INTEGER`});let c=s.concat(r),l=c.length?`PARTITION BY ${c.join(", ")} `:"",u=Ct.from(e).select(c,{x0:"x",y0:"y",dx:q`(lead(x) OVER sw - x)`,dy:q`(lead(y) OVER sw - y)`}).window({sw:q`${l}ORDER BY x ASC`}).qualify(Xr(q`(x0 < ${i} OR x0 + dx < ${i})`,q`(y0 < ${o} OR y0 + dy < ${o})`,q`(x0 > 0 OR x0 + dx > 0)`,q`(y0 > 0 OR y0 + dy > 0)`)),f=Ct.select({x:q`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),h=Ct.select({i:q`UNNEST(range((${f})))::INTEGER`}),d=Ct.unionAll(Ct.select(c,{x:q`x0 + i`,y:q`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(q`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),Ct.select(c,{x:q`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:q`y0 + SIGN(dy) * i`}).from("pairs","indices").where(q`ABS(dy) > ABS(dx) AND i < ABS(dy)`),Ct.select(c,{x:"x0",y:"y0"}).from("pairs").where(dd("dx"))),p=["x"].concat(c).join(", "),m=Ct.from("raster").select(c,"x","y",a?{w:q`1.0 / COUNT(*) OVER (PARTITION BY ${p})`}:null).where(Xr(sn("x",[0,i],!0),sn("y",[0,o],!0)));return Ct.with({pairs:u,indices:h,raster:d,points:m}).from("points").select(s,{index:q`x + y * ${i}::INTEGER`,density:a?Mi("w"):Tr()}).groupby("index",s)}var jM=class extends Nn{constructor(t,n,r){let{bins:i=1024,bandwidth:o=20,...s}=r,a=t.endsWith("X")?"y":"x";super(t,n,s,a==="x"?RM:kM),this.dim=a,this.bins=ze(i,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=ze(o,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterIndexable(){let t=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(t);return n&&!n[bn]}query(t=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:i,source:{table:o}}=this,s=this.extent=(i==="x"?Po:zo)(this,t),[a,c]=$r(this,i,n,s),l=oy(r,o,[i]).where(t.concat(sn(c,s))),u=this.channelField("weight")?"weight":null;return VX(l,a,u)}queryResult(t){let{columns:{index:n,density:r}}=Hr(t);return this.grid=SL(this.bins,n,r),this.convolve()}convolve(){let{bins:t,bandwidth:n,dim:r,grid:i,plot:o,extent:[s,a]}=this,c=i.some(w=>w<0),l=r==="x"?o.innerWidth():o.innerHeight(),u=ay(n*(t-1)/l,c),f=Ww(u,i,t),h=r==="x"?"y":"x",d=this.channelField(r).as,p=+s,m=(a-p)/(t-1),y=1/m,g=new Float64Array(t),b=new Float64Array(t);for(let w=0;w<t;++w)g[w]=p+w*m,b[w]=f[w]*y;return this.data={numRows:t,columns:{[d]:g,[h]:b}},this}plotSpecs(){let{type:t,data:{numRows:n,columns:r},channels:i,dim:o}=this,s=o==="x"?{y:r.y}:{x:r.x};for(let a of i)s[a.channel]=Vn(a,r);return[{type:t,data:{length:n},options:s}]}};function VX(e,t,n){let r=n?`* ${n}`:"",i=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER`,w:q`(FLOOR(p) + 1 - p)${r}`}),o=e.clone().select({p:t,i:q`FLOOR(p)::INTEGER + 1`,w:q`(p - FLOOR(p))${r}`});return Ct.from(Ct.unionAll(i,o)).select({index:"i",density:Mi("w")}).groupby("index").having(av("density",0))}var YM=class extends Ri{constructor(t,n){let{type:r="dot",...i}=n;super(r,t,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...i})}convolve(){super.convolve();let{bins:t,pad:n,extentX:r,extentY:i}=this,[o,s]=t,a=Tl(this,"x"),c=Tl(this,"y"),[l,u]=r.map(y=>a.apply(y)),[f,h]=i.map(y=>c.apply(y)),d=(u-l)/(o-n),p=(h-f)/(s-n),m=n?0:.5;return this.data=jX(this.grids,t,l,f,d,p,a.invert,c.invert,m),this}plotSpecs(){let{type:t,channels:n,densityMap:r,data:{numRows:i,columns:o}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?o[c]:Vn(a,o)}for(let a in r)r[a]&&(s[a]=o.density);return[{type:t,data:{length:i},options:s}]}};function jX(e,t,n,r,i,o,s,a,c){let l=1/(i*o),[u,f]=t,h=u*f,d=h*e.numRows,p=new Float64Array(d),m=new Float64Array(d),y=new Float64Array(d),g={x:p,y:m,density:y},{density:b,...w}=e.columns;for(let v in w)g[v]=new w[v].constructor(d);let x=0;for(let v=0;v<e.numRows;++v){for(let M in w)g[M].fill(w[M][v],x,x+h);let _=b[v];for(let M=0,E=0;E<f;++E)for(let T=0;T<u;++T,++x,++M)p[x]=s(n+(T+c)*i),m[x]=a(r+(E+c)*o),y[x]=_[M]*l}return{numRows:d,columns:g}}function YX(e,t,n){var r=1e-8,i=t-1,o=n-1,s=0,a,c,l,u,f,h,d,p,m,y,g;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),d=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(d=-d),p=(d*d-3)/6,m=2/(1/(2*t-1)+1/(2*n-1)),y=d*Math.sqrt(p+m)/m-(1/(2*n-1)-1/(2*t-1))*(p+5/6-2/(3*m)),d=t/(t+n*Math.exp(2*y))):(a=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*a)/t,f=Math.exp(n*c)/n,y=u+f,e<u/y?d=Math.pow(t*y*e,1/t):d=1-Math.pow(n*y*(1-e),1/n)),g=-Hf(t)-Hf(n)+Hf(t+n);s<10;s++){if(d===0||d===1)return d;if(h=WX(d,t,n)-e,u=Math.exp(i*Math.log(d)+o*Math.log(1-d)+g),f=h/u,d-=u=f/(1-.5*Math.min(1,f*(i/d-o/(1-d)))),d<=0&&(d=.5*(d+u)),d>=1&&(d=.5*(d+u+1)),Math.abs(u)<r*d&&s>0)break}return d}function WX(e,t,n){var r=e===0||e===1?0:Math.exp(Hf(t+n)-Hf(t)-Hf(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?0:e<(t+1)/(t+n+2)?r*OL(e,t,n)/t:1-r*OL(1-e,n,t)/n}function OL(e,t,n){var r=1e-30,i=1,o=t+n,s=t+1,a=t-1,c=1,l=1-o*e/s,u,f,h,d;for(Math.abs(l)<r&&(l=r),l=1/l,d=l;i<=100&&(u=2*i,f=i*(n-i)*e/((a+u)*(t+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,d*=l*c,f=-(t+i)*(o+i)*e/((t+u)*(s+u)),l=1+f*l,Math.abs(l)<r&&(l=r),c=1+f/c,Math.abs(c)<r&&(c=r),l=1/l,h=l*c,d*=h,!(Math.abs(h-1)<3e-7));i++);return d}function Hf(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,o,s;for(s=(o=i=e)+5.5,s-=(i+.5)*Math.log(s);t<6;t++)r+=n[t]/++o;return Math.log(2.506628274631*r/i)-s}function LL(e,t){var n=YX(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function FL(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}var WM=class extends Nn{constructor(t,n,r){let i=t.endsWith("X")?"y":"x",{ci:o=.95,...s}=r;super(t,n,s),this.dim=i,this.field=this.channelField(i).field,this.channels=this.channels.filter(a=>a.channel!==i),this.ci=ze(o,a=>(this.ci=a,this.update()))}query(t=[]){let{channels:n,field:r,source:{table:i}}=this,o=n.concat([{field:uv(r),as:"__avg__"},{field:Tr(r),as:"__n__"},{field:fv(r),as:"__sd__"}]);return oy(o,i).where(t)}queryResult(t){return this.data=Hr(t),this}plotSpecs(){let{type:t,dim:n,detail:r,data:i,ci:o,channels:s}=this,a=Math.SQRT2*FL(o),{columns:{__avg__:c,__sd__:l,__n__:u}}=i,f={[`${n}1`]:c.map((h,d)=>h-a*l[d]/Math.sqrt(u[d])),[`${n}2`]:c.map((h,d)=>h+a*l[d]/Math.sqrt(u[d]))};return CM(t,r,s,i,f)}};var GX="geom",GM=class extends Nn{constructor(t,n={},r){!jw(t)&&!n?.geometry&&(n.geometry=wv(GX)),super("geo",t,n,r)}queryResult(t){super.queryResult(t);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(i=>JSON.parse(i)))}return this}};var XM=class extends Nn{constructor(t,n){let{type:r="hexagon",binWidth:i=20,...o}=n;super(r,t,{r:i/2,clip:!0,...o},Yw),this.binWidth=ze(i,s=>(this.binWidth=s,this.requestUpdate()))}get filterIndexable(){let t=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return t&&n&&!t[bn]&&!n[bn]}query(t=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:i,source:o}=this,s,a,c=new Set,l={};for(let x of i)if(x.channel!=="orderby"){if(x.channel==="x")s=x;else if(x.channel==="y")a=x;else if(Object.hasOwn(x,"field")){let{as:v,field:_}=x;l[v]=_,_.aggregate||c.add(v)}}let[u,f]=Po(this,t),[h,d]=zo(this,t),p=.5-n.getAttribute("marginLeft"),m=0-n.getAttribute("marginTop"),y=`${r}::DOUBLE`,g=`${r*(1.5/Math.sqrt(3))}::DOUBLE`,b=`${n.innerWidth()/(f-u)}::DOUBLE`,w=`${n.innerHeight()/(d-h)}::DOUBLE`;return Ct.select({[s.as]:q`${u}::DOUBLE + ((_x + 0.5 * (_y & 1)) * ${y} + ${p})::DOUBLE / ${b}`,[a.as]:q`${d}::DOUBLE - (_y * ${g} + ${m})::DOUBLE / ${w}`,...l}).groupby("_x","_y",...c).from(Ct.select({_py:q`(${w} * (${d}::DOUBLE - ${a.field}) - ${m}) / ${g}`,_pj:q`ROUND(_py)::INTEGER`,_px:q`(${b} * (${s.field} - ${u}::DOUBLE) - ${p}) / ${y} - 0.5 * (_pj & 1)`,_pi:q`ROUND(_px)::INTEGER`,_tt:q`ABS(_py-_pj) * 3 > 1 AND (_px-_pi)**2 + (_py-_pj)**2 > (_px - _pi - 0.5 * CASE WHEN _px < _pi THEN -1 ELSE 1 END)**2 + (_py - _pj - CASE WHEN _py < _pj THEN -1 ELSE 1 END)**2`,_x:q`CASE WHEN _tt THEN (_pi + (CASE WHEN _px < _pi THEN -0.5 ELSE 0.5 END) + (CASE WHEN _pj & 1 <> 0 THEN 0.5 ELSE -0.5 END))::INTEGER ELSE _pi END`,_y:q`CASE WHEN _tt THEN (_pj + CASE WHEN _py < _pj THEN -1 ELSE 1 END)::INTEGER ELSE _pj END`},"*").from(o.table).where(_c(s.field),_c(a.field),t))}};var HM=class extends Ri{constructor(t,n){let{origin:r=[0,0],dim:i="xy",...o}=n;super("image",t,o),this.image=null,this.origin=r,this.tileX=i.toLowerCase().includes("x"),this.tileY=i.toLowerCase().includes("y")}setPlot(t,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};t.addAttributeListener("schemeColor",r),super.setPlot(t,n)}requestQuery(){return this.requestTiles()}query(t=[]){return this._filter=t,null}tileQuery(t){let{interpolate:n,pad:r,channels:i,densityMap:o,source:s}=this,[[a,c],[l,u]]=t,[f,h]=this.bins,[d,p]=$r(this,"x",f,[a,c],r),[m,y]=$r(this,"y",h,[l,u],r),g=r?[sn(p,[+a,+c]),sn(y,[+l,+u])]:[Sc(+a,p),vc(p,+c),Sc(+l,y),vc(y,+u)],b=Ct.from(s.table).where(g),w=this.groupby=[],x={};for(let _ of i)if(Object.hasOwn(_,"field")){let{as:M,channel:E,field:T}=_;T.aggregate?(x[E]=T,o[E]=!0):E==="weight"?x.density=Mi(T):E!=="x"&&E!=="y"&&(b.select({[M]:T}),w.push(M))}let v=this.aggr=Object.keys(x);if(x.density&&v.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(v.length||(v.push("density"),x.density=Tr()),n==="linear"){if(v.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!x.density)throw new Error("Linear binning not applicable to custom aggregates.");return QX(b,d,m,x.density,f,w)}else return KX(b,d,m,x,f,w)}async requestTiles(){let t=Bv();this.prefetch&&t.cancel(this.prefetch);let{pad:n,tileX:r,tileY:i,origin:[o,s]}=this,[a,c]=this.bins=this.binDimensions(),[l,u]=Po(this,this._filter),[f,h]=zo(this,this._filter),d=u-l,p=h-f,m=Math.floor((l-o)*(a-n)/d),y=Math.floor((f-s)*(c-n)/p),g=(I,N)=>[[o+I*d,o+(I+1)*d],[s+N*p,s+(N+1)*p]],b=Math.floor((l-o)/d),w=r?CL((u-o)/d):b,x=Math.floor((f-s)/p),v=i?CL((h-s)/p):x,_=[];for(let I=b;I<=w;++I)for(let N=x;N<=v;++N)_.push([I,N]);let M=_.map(([I,N])=>t.query(this.tileQuery(g(I,N)))),E=[];if(r)for(let I=x;I<=v;++I)E.push([w+1,I]),E.push([b-1,I]);if(i){let I=r?b-1:b,N=r?w+1:w;for(let O=I;O<=N;++O)E.push([O,v+1]),E.push([O,x-1])}this.prefetch=E.map(([I,N])=>t.prefetch(this.tileQuery(g(I,N))));let T=await Promise.all(M),B=XX(a,c,m,y,_,T);this.grids0={numRows:B.length,columns:{density:[B]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:t,grids:n}=this,[r,i]=t,{numRows:o,columns:s}=n,{canvas:a,ctx:c,img:l}=ZX(this,r,i),{alpha:u,alphaProp:f,color:h,colorProp:d}=qM(this),p=s[f]??[],m=s[d]??[],y=o>1&&d&&this.groupby?.includes(d)?Gw(m,this.plot.getAttribute("colorDomain")):cy(o);return this.data={numRows:o,columns:{src:Array.from({length:o},(g,b)=>(h?.(l.data,r,i,m[y[b]]),u?.(l.data,r,i,p[y[b]]),c.putImageData(l,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:t,plot:n,data:{numRows:r,columns:i}}=this,o={src:i.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:t,data:{length:r},options:o}]}};function XX(e,t,n,r,i,o){let s=new Float64Array(e*t);return o.forEach((a,c)=>{let[l,u]=i[c],f=l*e-n,h=u*t-r;HX(e,t,s,a,f,h)}),s}function HX(e,t,n,r,i,o){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let l=0;l<s;++l){let u=a[l],f=i+u%e,h=o+Math.floor(u/e);0<=f&&f<e&&0<=h&&h<t&&(n[f+h*e]=c[l])}}function ZX(e,t,n){if(!e.image||e.image.w!==t||e.image.h!==n){let r=Xw(t,n),i=r.getContext("2d",{willReadFrequently:!0}),o=i.getImageData(0,0,t,n);e.image={canvas:r,ctx:i,img:o,w:t,h:n}}return e.image}function KX(e,t,n,r,i,o){return e.select({index:q`FLOOR(${t})::INTEGER + FLOOR(${n})::INTEGER * ${i}`,...r}).groupby("index",o)}function QX(e,t,n,r,i,o){let s=r.column?`* ${r.column}`:"",a=(h,d)=>e.clone().select({xp:t,yp:n,i:h,w:d}),c=a(q`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),l=a(q`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),u=a(q`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(q`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${i}`,q`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return Ct.from(Ct.unionAll(c,l,u,f)).select({index:"i",density:Mi("w")},o).groupby("index",o).having(pd("density",0))}function CL(e){let t=Math.floor(e);return t===e?t-1:t}var KM=class extends Nn{constructor(t,n){let{ci:r=.95,precision:i=4,...o}=n;super("line",t,o);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=ze(r,a=>(this.ci=a,s())),this.precision=ze(i,a=>(this.precision=a,s()))}query(t=[]){let n=this.channelField("x").as,r=this.channelField("y").as,i=Array.from(new Set(["stroke","z","fx","fy"].flatMap(o=>this.channelField(o)?.as||[])));return Ct.from(super.query(t)).select({intercept:hv(r,n),slope:dv(r,n),n:pv(r,n),ssy:mv(r,n),ssx:yv(r,n),xm:gv(r,n),x0:V0(la(n).where(_c(r))),x1:V0(ca(n).where(_c(r)))}).select(i).groupby(i)}queryResult(t){return this.modelFit=Hr(t),this.lineData=JX(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:t,modelFit:n,precision:r,plot:i}=this,o=i.innerWidth();return this.areaData=t?tH(n,t,r,o):null,this}plotSpecs(){let{lineData:t,areaData:n,channels:r,ci:i}=this,o=t.columns,s=i?n.columns:{},a={x:o.x,y:o.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let l of r)switch(l.channel){case"x":case"y":case"fill":break;case"tip":c.tip=Vn(l,s);break;case"stroke":a.stroke=Vn(l,o),c.fill=Vn(l,s);break;case"strokeOpacity":a.strokeOpacity=Vn(l,o);break;case"fillOpacity":c.fillOpacity=Vn(l,s);break;default:a[l.channel]=Vn(l,o),c[l.channel]=Vn(l,s);break}return[...i?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:t.numRows},options:a}]}};function ZM(e,t){if(e.concat)return e.concat(t);let n=new e.constructor(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}function JX(e){let{x0:t=[],x1:n=[],xm:r,intercept:i,slope:o,n:s,ssx:a,ssy:c,...l}=e.columns,u=(d,p)=>i[p]+d*o[p],f=ZM(t,n),h=ZM(t.map(u),n.map(u));for(let d in l)l[d]=ZM(l[d],l[d]);return{numRows:f.length,columns:{x:f,y:h,...l}}}function tH(e,t,n,r){let i=e.numRows,{x0:o,x1:s,xm:a,intercept:c,slope:l,n:u,ssx:f,ssy:h,...d}=e.columns,p=Object.keys(d),m={x:[],y1:[],y2:[]};p.forEach(y=>m[y]=[]);for(let y=0;y<i;++y){let g=n*(s[y]-o[y])/r,b=LL((1-t)/2,u[y]-2)*Math.sqrt(h[y]/(u[y]-2));ke(o[y],s[y]-g/2,g).concat(s[y]).forEach(w=>{let x=c[y]+w*l[y],v=b*Math.sqrt(1/u[y]+(w-a[y])**2/f[y]);m.x.push(w),m.y1.push(x-v),m.y2.push(x+v),p.forEach(_=>m[_].push(d[_][y]))})}return{numRows:m.x.length,columns:m}}function RL(e){let t=e.toLowerCase(),n=e.length,r="";for(let i=0;i<n;++i)r+=(e[i]!==t[i]?"-":"")+t[i];return r}function Zf(e){let t={};for(let n in e)t[RL(n)]=e[n];return t}function eH(e){let{channels:t}=e,n=new Set,r=!1,i=!1;for(let o of t){let{channel:s,field:a,as:c}=o;if(s==="orderby")r=!0;else if(a)if(a.aggregate)i=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&i&&n.size&&e.channels.push({channel:"orderby",value:Array.from(n)}),e}var QM=class{constructor(t,{selection:n,channels:r={}}){this.mark=eH(t),this.selection=n;let i=Object.entries(Zf(r));this.channels=i.length?i:[["opacity",.2]],this.selection.addEventListener("value",Qf(()=>this.update()))}init(t){this.svg=t;let n=this.values=[],r=this.mark.index,i=this.nodes=t.querySelectorAll(`[data-index="${r}"] > *`),{channels:o}=this;for(let s=0;s<i.length;++s){let a=i[s];n.push(o.map(c=>a.getAttribute(c[0])))}return this.update()}async update(){let{svg:t,nodes:n,channels:r,values:i,mark:o,selection:s}=this;if(!t)return;let a=await nH(o,s);for(let c=0;c<n.length;++c){let l=n[c],u=i[c],f=l.__data__,h=a(Array.isArray(f)?f[0]:f);for(let d=0;d<r.length;++d){let[p,m]=r[d];l.setAttribute(p,h?u[d]:m)}}}};async function nH(e,t){let n=t?.predicate(e);if(!n||n.length===0)return()=>!0;let r=e.filterBy?.predicate(e,!0),i={__:Xr(n)},o=e.query(r);(o.queries||[o]).forEach(c=>{c.groupby().length?c.select(i):c.$select(i)});let s=await e.coordinator.query(o),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.get(c):c=>s[c].__:()=>!1}function JM(e){let t=e.on,n=!0;function r(i){n=!1,i(),n=!0}return e.reset=(...i)=>{r(()=>e.clear(...i))},e.moveSilent=(...i)=>{r(()=>e.move(...i))},e.on=(...i)=>{if(i.length>1&&i[1]){let o=i[1];i[1]=(...s)=>n&&o(...s)}return t(...i)},e}function kL(){return JM(b2())}function $L(){return JM(y2())}function UL(){return JM(g2())}function ly(e,t){return e===t||e&&t&&Math.abs(e[0]-t[0])<1e-12&&Math.abs(e[1]-t[1])<1e-12||!1}function qo(e,t){let n=e.channelField(t)?.field;return n?.basis||n}function uy(e,t,n=1){return t.invert(n*Math.floor(e/n))}function Hw(){let e=this,t=e.getScreenCTM,n;e.getScreenCTM=()=>e.isConnected?n=t.call(e):n}var fy=class{constructor(t,{channel:n,selection:r,field:i=void 0,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.channel=n,this.pixelSize=o||1,this.selection=r,this.peers=s,this.field=i||qo(t,n),this.style=a&&Zf(a),this.brush=n==="y"?UL():$L(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[0,1]))}publish(t){let n;t&&(n=t.map(r=>uy(r,this.scale,this.pixelSize)).sort((r,i)=>r-i)),ly(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(n)))}clause(t){let{mark:n,pixelSize:r,field:i,scale:o}=this;return vd(i,t,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:o,pixelSize:r})}init(t,n){let{brush:r,channel:i,style:o}=this;this.scale=t.scale(i);let s=t.scale("x").range,a=t.scale("y").range;r.extent([[le(s),le(a)],[Xt(s),Xt(a)]]);let c=this.value?.map(this.scale.apply).sort(Et),l=Pt(t).selectAll('g[aria-label="facet"]');if(n=l.size()?l:Pt(n??t),this.g=n.append("g").attr("class",`interval-${i}`).each(Hw).call(r).call(r.moveSilent,c),o){let u=this.g.selectAll("rect.selection");for(let f in o)u.attr(f,o[f])}t.addEventListener("pointerenter",u=>{u.buttons||this.activate()})}};var t6=class{constructor(t,{selection:n,xfield:r,yfield:i,pixelSize:o=1,peers:s=!0,brush:a}){this.mark=t,this.pixelSize=o||1,this.selection=n,this.peers=s,this.xfield=r||qo(t,"x"),this.yfield=i||qo(t,"y"),this.style=a&&Zf(a),this.brush=kL(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[[0,1],[0,1]]))}publish(t){let{value:n,pixelSize:r,xscale:i,yscale:o}=this,s,a;if(t){let[c,l]=t;s=[c[0],l[0]].map(u=>uy(u,i,r)).sort(Et),a=[c[1],l[1]].map(u=>uy(u,o,r)).sort(Et)}(!ly(s,n?.[0])||!ly(a,n?.[1]))&&(this.value=t?[s,a]:void 0,this.g.call(this.brush.moveSilent,t),this.selection.update(this.clause(this.value)))}clause(t){let{mark:n,pixelSize:r,xfield:i,yfield:o,xscale:s,yscale:a}=this;return Lv([i,o],t,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}init(t){let{brush:n,style:r}=this,i=this.xscale=t.scale("x"),o=this.yscale=t.scale("y"),s=i.range,a=o.range;n.extent([[le(s),le(a)],[Xt(s),Xt(a)]]);let c=Pt(t).selectAll('g[aria-label="facet"]'),l=c.size()?c:Pt(t);if(this.g=l.append("g").attr("class","interval-xy").each(Hw).call(n),r){let u=this.g.selectAll("rect.selection");for(let f in r)u.attr(f,r[f])}if(this.value){let[u,f]=this.value[0].map(i.apply).sort(Et),[h,d]=this.value[1].map(o.apply).sort(Et);this.g.call(n.moveSilent,[[u,h],[f,d]])}t.addEventListener("pointerenter",u=>{u.buttons||this.activate()})}};var e6=class{constructor(t,{selection:n,pointer:r,channels:i,fields:o,maxRadius:s=40}){this.mark=t,this.selection=n,this.clients=new Set().add(t),this.pointer=r,this.channels=i||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=o||this.channels.map(a=>qo(t,[a])),this.maxRadius=s,this.valueIndex=-1}clause(t){let{clients:n,fields:r}=this;return _d(r,t&&[t],{source:this,clients:n})}init(t){let n=this,{mark:r,channels:i,selection:o,maxRadius:s}=this,{data:{columns:a}}=r,c=i.map(b=>r.channelField(b).as),l=!Ov(o),u=Pt(t).selectAll('g[aria-label="facet"]'),f=u.size()?u:Pt(t),h=t.scale("x").apply,d=t.scale("y").apply,p=Array.from(a[r.channelField("x").as],h),m=Array.from(a[r.channelField("y").as],d),y=this.pointer==="y"?.01:1,g=this.pointer==="x"?.01:1;f.on("pointerenter pointerdown pointermove",function(b){let[w,x]=Fn(b,this),v=rH(p,m,w,x,y,g,s);if(v!==this.valueIndex){this.valueIndex=v;let _=v<0?void 0:c.map(M=>a[M][v]);l?v>-1&&o.update(_.length>1?_:_[0]):o.update(n.clause(_))}}),!l&&(f.on("pointerleave",()=>{o.update(n.clause(void 0))}),t.addEventListener("pointerenter",b=>{if(!b.buttons){let w=this.channels.map(()=>0);o.activate(this.clause(w))}}))}};function rH(e,t,n,r,i,o,s){let a=s*s,c=-1;for(let l=0;l<e.length;++l){let u=i*(e[l]-n),f=o*(t[l]-r),h=u*u+f*f;h<=a&&(a=h,c=l)}return c}var PL=(e,t)=>e-t,r6=class{constructor(t,{x:n=new Ec,y:r=new Ec,xfield:i,yfield:o,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=t,this.xsel=n,this.ysel=r,this.xfield=i||qo(t,"x"),this.yfield=o||qo(t,"y"),this.zoom=n6(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:l}=t;a&&this.xsel.addEventListener("value",u=>{l.setAttribute("xDomain",u)&&l.update()}),c&&this.ysel.addEventListener("value",u=>{l.setAttribute("yDomain",u)&&l.update()})}publish(t){if(this.panx){let n=iH(t,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=oH(t,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(t,n,r){return vd(n,t,{source:this,clients:this.mark.plot.markSet,scale:r})}init(t){if(this.svg=t,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:i}},xsel:o,ysel:s}=this;this.xscale=t.scale("x"),this.yscale=t.scale("y");let a=this.xscale.range.slice().sort(PL),c=this.yscale.range.slice().sort(PL),l=n6(n,[-1/0,1/0],a),u=n6(r,[-1/0,1/0],c),f=C3().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[l[0],u[0]],[l[1],u[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>i.__zoom=new Lr(1,0,0)).on("zoom",({transform:h})=>this.publish(h));if(Pt(i).call(f),n||r){let h=!1;i.addEventListener("pointerenter",d=>{if(!h&&(h=!0,!d.buttons)){if(n){let{xscale:p,xfield:m}=this;o.activate(this.clause(p.domain,m,p))}if(r){let{yscale:p,yfield:m}=this;s.activate(this.clause(p.domain,m,p))}}}),i.addEventListener("pointerleave",()=>h=!1)}}};function n6(e,t,n){return e?Array.isArray(e)?e:t:n}function iH(e,t){return t.range.map(e.invertX,e).map(t.invert,t)}function oH(e,t){return t.range.map(e.invertY,e).map(t.invert,t)}var hy=class{constructor(t,{selection:n,channels:r,peers:i=!0}){this.value=null,this.mark=t,this.selection=n,this.peers=i;let o=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let l=0;l<c.length;++l){let u=t.channelField(c[l],{exact:!0});if(u){o.push(u.field?.basis||u.field),s.push(u.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(t){let{fields:n,mark:r}=this;return _d(n,t,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(t,n,r){let{mark:i,as:o,selection:s}=this,{data:{columns:a={}}={}}=i;r??=l=>o.map(u=>{let f=l.__data__;return a[u][Array.isArray(f)?f[0]:f]}),n??=`[data-index="${i.index}"]`;let c=new Set(t.querySelectorAll(n));t.addEventListener("pointerdown",l=>{let u=s.single?s.value:this.value,f=l.target,h=null;if(sH(c,f)){let d=r(f);(l.shiftKey||l.metaKey)&&u?.length?(h=u.filter(p=>i6(p,d)),h.length===u.length&&h.push(d)):u?.length===1&&!i6(u[0],d)?h=null:h=[d]}this.value=h,aH(u,h)&&s.update(this.clause(h))}),t.addEventListener("pointerenter",l=>{l.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function sH(e,t){return e.has(t)||e.has(t.parentNode)||e.has(t.parentNode?.parentNode)}function aH(e,t){return e==null||t==null?e!=null||t!=null:e.length!==t.length||e.some((n,r)=>i6(n,t[r]))}function i6(e,t){let n=e.length;if(t.length!==n)return!0;for(let r=0;r<n;++r)if(e[r]!==t[r])return!0;return!1}var qL=":scope > div, :scope > span",Zw="swatch",zL="ramp",o6=class{constructor(t,n){let{as:r,field:i,...o}=n;this.channel=t,this.options=o,this.type=null,this.handler=null,this.selection=r,this.field=i,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(t){this.plot=t}init(t){let n=cH(this,t);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:t,handler:n}=this,{single:r,value:i}=t,o=r?i:t.valueFor(n),s=o&&o.length?new Set(o.map(c=>c[0])):null,a=this.legend.querySelectorAll(qL);for(let c of a){let l=s?s.has(c.__data__):!0;c.style.opacity=l?1:.2}}};function cH(e,t){let{channel:n,plot:r,selection:i}=e,o=t.scale(n),s=o.type==="ordinal"?Zw:zL,a={label:r.getAttribute(`${n}Label`)??null,...e.options},c=s===Zw?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},l=t.legend(n,c);e.legend=l;let u=!!i;if(u&&s===zL){let f=c.width??240,h=hH(o,f);h?l.scale=function(d){return d==="x"?{range:[0,f]}:d==="y"?{range:[-10,0]}:d===n?h:void 0}:u=!1}if(u){let f=lH(e,s);s===Zw?(f.init(l,qL,h=>[h.__data__]),e.update()):f.init(l,l.querySelector("g:last-of-type"))}return l}function lH(e,t){let{channel:n,handler:r,selection:i}=e;if(r)return r;let o=uH(e);return t===Zw?(e.handler=new hy(o,{selection:i,channels:[n],peers:!1}),i.addEventListener("value",()=>e.update())):e.handler=new fy(o,{selection:i,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),e.handler}function uH(e){let{channel:t,plot:n}=e,r=e.field??fH(n.marks,t)??"value";if(r){let i={field:r};return{plot:n,channelField:o=>t===o?i:void 0}}}function fH(e,t){let n=t==="color"?["fill","stroke"]:t==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=e.length-1;r>-1;--r)for(let i of n){let o=e[r].channelField(i,{exact:!0});if(o)return o.field}return null}function hH(e,t){let{apply:n,invert:r,interpolate:i,...o}=e,s=e.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return $a({x:{...o,type:a,range:[0,t]}})}function Kw(e,t,n=0,r=Math.LN10){let i,o=Math.ceil(Math.log(t)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(e)/r)-o));for(;Math.ceil(e/s)>t;)s*=10;let a=[5,2];for(let c=0,l=a.length;c<l;++c)i=s/a[c],i>=n&&e/i<=t&&(s=i);return s}function VL(e,t,n){let{step:r,steps:i,minstep:o=0,nice:s=!0}=n;if(s!==!1){let a=t-e,c=Math.LN10;r=r||Kw(a,i||25,o,c);let l=Math.log(r),u=l>=0?0:~~(-l/c)+1,f=Math.pow(10,-u-1);l=Math.floor(e/r+f)*r,e=e<l?l-r:l,t=Math.ceil(t/r)*r,i=Math.round((t-e)/r)}return{min:e,max:t,steps:i}}var GL="year",jL="month",YL="day",Qw="hour",Jw="minute",t_="second",dH="millisecond",py=1e3,my=py*60,yy=my*60,e_=yy*24,pH=e_*7,WL=e_*30,mH=e_*365,dy=[[t_,1,py],[t_,5,5*py],[t_,15,15*py],[t_,30,30*py],[Jw,1,my],[Jw,5,5*my],[Jw,15,15*my],[Jw,30,30*my],[Qw,1,yy],[Qw,3,3*yy],[Qw,6,6*yy],[Qw,12,12*yy],[YL,1,e_],[YL,7,pH],[jL,1,WL],[jL,3,3*WL],[GL,1,mH]];function XL(e,t,n){let r=t-e,i=r/n,o=Ti(s=>s[2]).right(dy,i);return o===dy.length?{interval:GL,step:Kw(r,n)}:o?(o=dy[i/dy[o-1][2]<dy[o][2]/i?o-1:o],{interval:o[0],step:o[1]}):{interval:dH,step:Kw(r,n,1)}}var yH=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function gH(e,t){return yH.has(`${e.type}-${t}`)}function HL(e,t={}){let n=(r,i)=>gH(r,i)?{[`${i}1`]:s6(r,i,e,t),[`${i}2`]:s6(r,i,e,{...t,offset:1})}:{[i]:s6(r,i,e,t)};return n[Kf]=!0,n}function s6(e,t,n,r){return{column:n,label:n,get columns(){return[n]},get basis(){return n},get stats(){return{column:n,stats:["min","max"]}},toString(){let{type:i,min:o,max:s}=e.channelField(t),{interval:a,steps:c,offset:l=0}=r,u=a??(i==="date"||bH(e,t)?"date":"number");if(u==="number"){let{apply:f,sqlApply:h,sqlInvert:d}=Tl(e,t),p=VL(f(o),f(s),r),m=h(n),y=p.min===0?m:`(${m} - ${p.min})`,g=`${(p.max-p.min)/p.steps}::DOUBLE`,b=l?`${l} + `:"",w=`${p.min} + ${g} * (${b}FLOOR(${y} / ${g}))`;return`${d(w)}`}else{let{interval:f,step:h=1}=u==="date"?XL(o,s,c||40):r,d=l?` + INTERVAL ${l*h} ${f}`:"";return`(${xv(n,f,h)}${d})`}}}}function bH(e,t){let n=e.plot.getAttribute(`${t}Scale`);return n==="utc"||n==="time"}export{UM as ConnectedMark,PM as ContourMark,VM as DenseLineMark,jM as Density1DMark,YM as Density2DMark,WM as ErrorBarMark,Gs as Fixed,GM as GeoMark,Ri as Grid2DMark,zM as HeatmapMark,XM as HexbinMark,QM as Highlight,fy as Interval1D,t6 as Interval2D,o6 as Legend,Nn as Mark,e6 as Nearest,r6 as PanZoom,OM as Plot,Xf as RasterMark,HM as RasterTileMark,KM as RegressionMark,hy as Toggle,Kf as Transform,bn as Transient,HL as bin};
|
|
60
|
+
}`)).call(zc,n);for(let R of f){let{channels:D,values:F,facets:P}=m.get(R);if(d===void 0||R.facet==="super"){let V=null;if(P&&(V=P[0],V=R.filter(V,D,F),V.length===0))continue;let J=R.render(V,x,F,v,A);if(J==null)continue;E.appendChild(J)}else{let V;for(let J of d){if(!(R.facetAnchor?.(d,k,J)??!J.empty))continue;let et=null;if(P){let j=u.has(R);if(et=P[j?J.i:0],et=R.filter(et,D,F),et.length===0)continue;!j&&et===P[0]&&(et=Uo(et)),et.fx=J.x,et.fy=J.y,et.fi=J.i}let rt=R.render(et,x,F,_,A);if(rt!=null){(V??=bt(E).append("g")).append(()=>rt).datum(J);for(let j of["aria-label","aria-description","aria-hidden","transform"])rt.hasAttribute(j)&&(V.attr(j,rt.getAttribute(j)),rt.removeAttribute(j))}}V?.selectChildren().attr("transform",O)}}let C=hA(g,A,t),{figure:N=r!=null||o!=null||i!=null||C.length>0}=t;N&&($=T.createElement("figure"),$.className=`${c}-figure`,$.style.maxWidth="initial",r!=null&&$.append(IA(T,r,"h2")),o!=null&&$.append(IA(T,o,"h3")),$.append(...C,E),i!=null&&$.append(qP(T,i)),"value"in E&&($.value=E.value,delete E.value)),$.scale=t7(x.scales),$.legend=uA(g,A,t);let L=kS();return L>0&&bt(E).append("text").attr("x",M).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("\u26A0\uFE0F").append("title").text(`${L.toLocaleString("en-US")} warning${L===1?"":"s"}. Please check the console.`),$}function IA(t,e,n){if(e.ownerDocument)return e;let r=t.createElement(n);return r.append(e),r}function qP(t,e){let n=t.createElement("figcaption");return n.append(e),n}function $A(t){return t.flat(1/0).filter(e=>e!=null).map(BP)}function BP(t){return typeof t.render=="function"?t:new Iv(t)}var Iv=class extends lt{constructor(e){if(typeof e!="function")throw new TypeError("invalid mark; missing render function");super(),this.render=e}render(){}};function $v(t,e){for(let n in t)OA(t[n],e);return t}function OA(t,e){let{scale:n,transform:r=!0}=t;if(n==null||!r)return;let{type:o,percent:i,interval:s,transform:a=i?c=>c==null?NaN:c*100:_w(s,o)}=e[n]??{};a!=null&&(t.value=Mt(t.value,a),t.transform=!1)}function zP(t){for(let e in t)Pw(e,t[e])}function ep(t,e,n,r=D8){for(let{channels:o}of e.values())for(let i in o){let s=o[i],{scale:a}=s;if(a!=null&&r(a))if(a==="projection"){if(!u7(n)){let c=n.x?.domain===void 0,f=n.y?.domain===void 0;if(c||f){let[l,u]=h7(s);c&&Tv(t,"x",l),f&&Tv(t,"y",u)}}}else Tv(t,a,s)}return t}function Tv(t,e,n){let r=t.get(e);r!==void 0?r.push(n):t.set(e,[n])}function YP(t,e){if(t==null)return;let{x:n,y:r}=t;if(n==null&&r==null)return;let o=zo(t.data);if(o==null)throw new Error("missing facet data");let i={};n!=null&&(i.fx=Rc(o,{value:n,scale:"fx"})),r!=null&&(i.fy=Rc(o,{value:r,scale:"fy"})),$v(i,e);let s=zg(o,i);return{channels:i,groups:s,data:t.data}}function CA(t,e,n){if(t.facet===null||t.facet==="super")return;let{fx:r,fy:o}=t;if(r!=null||o!=null){let c=zo(t.data??r??o);if(c===void 0)throw new Error(`missing facet data in ${t.ariaLabel}`);if(c===null)return;let f={};return r!=null&&(f.fx=Rc(c,{value:r,scale:"fx"})),o!=null&&(f.fy=Rc(c,{value:o,scale:"fy"})),$v(f,n),{channels:f,groups:zg(c,f)}}if(e===void 0)return;let{channels:i,groups:s,data:a}=e;if(t.facet!=="auto"||t.data===a)return{channels:i,groups:s};a.length>0&&(s.size>1||s.size===1&&i.fx&&i.fy&&[...s][0][1].size>1)&&Di(zo(t.data))===Di(a)&&Je(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn\u2019t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function UP(t,e={}){return jt({...e,x:null,y:null},(n,r,o,i,s,a)=>a.getMarkState(t))}function jP(t){let e=[];for(let n of t){let r=n.tip;if(r){r===!0?r={}:typeof r=="string"&&(r={pointer:r});let{pointer:o,preferredAnchor:i}=r;o=/^x$/i.test(o)?Vi:/^y$/i.test(o)?Zo:Gi,r=o(UP(n,r)),r.title=null,i===void 0&&(r.preferredAnchor=o===Zo?"left":"bottom");let s=yy(n.data,r);s.facet=n.facet,s.facetAnchor=n.facetAnchor,e.push(s)}}return e}function XP(t,e,n){let{projection:r,x:o={},y:i={},fx:s={},fy:a={},axis:c,grid:f,facet:l={},facet:{axis:u=c,grid:p}=l,x:{axis:h=c,grid:d=h===null?null:f}=o,y:{axis:m=c,grid:g=m===null?null:f}=i,fx:{axis:y=u,grid:x=y===null?null:p}=s,fy:{axis:w=u,grid:b=w===null?null:p}=a}=n;(r||!Xr(o)&&!kA("x",t))&&(h=d=null),(r||!Xr(i)&&!kA("y",t))&&(m=g=null),e.has("fx")||(y=x=null),e.has("fy")||(w=b=null),h===void 0&&(h=!wy(t,"x")),m===void 0&&(m=!wy(t,"y")),y===void 0&&(y=!wy(t,"fx")),w===void 0&&(w=!wy(t,"fy")),h===!0&&(h="bottom"),m===!0&&(m="left"),y===!0&&(y=h==="top"||h===null?"bottom":"top"),w===!0&&(w=m==="right"||m===null?"left":"right");let _=[];return by(_,b,cy,a),xy(_,w,iy,"right","left",l,a),by(_,x,ly,s),xy(_,y,sy,"top","bottom",l,s),by(_,g,ay,i),xy(_,m,Gu,"left","right",n,i),by(_,d,fy,o),xy(_,h,Vu,"bottom","top",n,o),_}function xy(t,e,n,r,o,i,s){if(!e)return;let a=GP(e);s=VP(a?r:e,i,s);let{line:c}=s;(n===Gu||n===Vu)&&c&&!Xo(c)&&t.push(Zc(WP(s))),t.push(n(s)),a&&t.push(n({...s,anchor:o,label:null}))}function by(t,e,n,r){!e||Xo(e)||t.push(n(HP(e,r)))}function GP(t){return/^\s*both\s*$/i.test(t)}function VP(t,e,{line:n=e.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:l,ariaDescription:u,label:p=e.label,labelAnchor:h,labelArrow:d=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:r,tickSize:o,tickSpacing:i,tickPadding:s,tickFormat:a,tickRotate:c,fontVariant:f,ariaLabel:l,ariaDescription:u,label:p,labelAnchor:h,labelArrow:d,labelOffset:m}}function WP(t){let{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:n===!0?void 0:n}}function HP(t,{stroke:e=Pi(t)?t:void 0,ticks:n=QP(t)?t:void 0,tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:e,ticks:n,tickSpacing:r,ariaLabel:o,ariaDescription:i}}function QP(t){switch(typeof t){case"number":return!0;case"string":return!Pi(t)}return gn(t)||typeof t?.range=="function"}function wy(t,e){let n=`${e}-axis `;return t.some(r=>r.ariaLabel?.startsWith(n))}function kA(t,e){for(let n of e)for(let r in n.channels){let{scale:o}=n.channels[r];if(o===t||o==="projection")return!0}return!1}function ZP(t,e){for(let n in t){let r=t[n],o=e[n];r.label===void 0&&o&&(r.label=o.label)}return t}function KP({fx:t,fy:e},n){let{marginTop:r,marginRight:o,marginBottom:i,marginLeft:s,width:a,height:c}=Pg(n),f=t&&NA(t),l=e&&NA(e);return{marginTop:e?l[0]:r,marginRight:t?a-f[1]:o,marginBottom:e?c-l[1]:i,marginLeft:t?f[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:c}}function NA(t){let e=t.domain();if(e.length===0)return[0,t.bandwidth()];let n=t(e[0]),r=t(e[e.length-1]);return r<n&&([n,r]=[r,n]),[n,r+t.bandwidth()]}var JP=new Map([["basis",B2],["basis-closed",z2],["basis-open",Y2],["bundle",U2],["bump-x",L2],["bump-y",D2],["cardinal",j2],["cardinal-closed",X2],["cardinal-open",G2],["catmull-rom",V2],["catmull-rom-closed",W2],["catmull-rom-open",H2],["linear",Fo],["linear-closed",Q2],["monotone-x",K2],["monotone-y",J2],["natural",tw],["step",ew],["step-after",rw],["step-before",nw]]);function np(t=Fo,e){if(typeof t=="function")return t;let n=JP.get(`${t}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${t}`);if(e!==void 0){if("beta"in n)return n.beta(e);if("tension"in n)return n.tension(e);if("alpha"in n)return n.alpha(e)}return n}function vy(t=Ji,e){return typeof t!="function"&&`${t}`.toLowerCase()==="auto"?Ji:np(t,e)}function Ji(t){return Fo(t)}function eo(t={y:"count"},e={}){[t,e]=kv(t,e);let{x:n,y:r}=e;return Cv(_y(n,e,G),null,null,r,t,ra(e))}function no(t={x:"count"},e={}){[t,e]=kv(t,e);let{x:n,y:r}=e;return Cv(null,_y(r,e,G),n,null,t,oa(e))}function Jo(t={fill:"count"},e={}){[t,e]=kv(t,e);let{x:n,y:r}=tq(e);return Cv(n,r,null,null,t,ra(oa(e)))}function DA(t,e,n={}){if(n?.interval==null)return n;let{reduce:r=Ng}=n,o={filter:null};return n[e]!=null&&(o[e]=r),n[`${e}1`]!=null&&(o[`${e}1`]=r),n[`${e}2`]!=null&&(o[`${e}2`]=r),t(o,n)}function Jc(t={}){return DA(eo,"y",gr(t,"x"))}function tf(t={}){return DA(no,"x",gr(t,"y"))}function Cv(t,e,n,r,{data:o=kg,filter:i=Ru,sort:s,reverse:a,...c}={},f={}){t=RA(t),e=RA(e),c=eq(c,f),o=qA(o,G),s=s==null?void 0:FA("sort",s,f),i=i==null?void 0:PA("filter",i,f),n!=null&&Qr(c,"x","x1","x2")&&(n=null),r!=null&&Qr(c,"y","y1","y2")&&(r=null);let[l,u]=ze(t),[p,h]=ze(t),[d,m]=ze(e),[g,y]=ze(e),[x,w]=n!=null?[n,"x"]:r!=null?[r,"y"]:[],[b,_]=ze(x),{x:v,y:A,z:T,fill:E,stroke:$,x1:S,x2:k,y1:O,y2:M,domain:I,cumulative:C,thresholds:N,interval:L,...R}=f,[D,F]=ze(T),[P]=Kt(E),[V]=Kt($),[J,et]=ze(P),[rt,j]=ze(V);return{..."z"in f&&{z:D||T},..."fill"in f&&{fill:J||E},..."stroke"in f&&{stroke:rt||$},...me(R,(nt,z,W)=>{let tt=Ks(ft(nt,x),W?.[w]),q=ft(nt,T),gt=ft(nt,P),at=ft(nt,V),At=Fu(c,{z:q,fill:gt,stroke:at}),It=[],Z=[],Dt=tt&&_([]),Mn=q&&F([]),wr=gt&&et([]),b9=at&&j([]),B_=t&&u([]),w9=t&&h([]),z_=e&&m([]),v9=e&&y([]),_9=oq(t,e,nt),M9=0;for(let ba of c)ba.initialize(nt);s&&s.initialize(nt),i&&i.initialize(nt);for(let ba of z){let Y_=[];for(let wa of c)wa.scope("facet",ba);s&&s.scope("facet",ba),i&&i.scope("facet",ba);for(let[wa,S9]of Hr(ba,At))for(let[A9,Up]of Hr(S9,tt))for(let[vr,co]of _9(Up))if(At&&(co.z=wa),!(i&&!i.reduce(vr,co))){Y_.push(M9++),Z.push(o.reduceIndex(vr,nt,co)),tt&&Dt.push(A9),q&&Mn.push(At===q?wa:q[(vr.length>0?vr:Up)[0]]),gt&&wr.push(At===gt?wa:gt[(vr.length>0?vr:Up)[0]]),at&&b9.push(At===at?wa:at[(vr.length>0?vr:Up)[0]]),B_&&(B_.push(co.x1),w9.push(co.x2)),z_&&(z_.push(co.y1),v9.push(co.y2));for(let E9 of c)E9.reduce(vr,co);s&&s.reduce(vr,co)}It.push(Y_)}return Lw(It,s,a),{data:Z,facets:It}}),...!Qr(c,"x")&&(l?{x1:l,x2:p,x:$c(l,p)}:{x:v,x1:S,x2:k}),...!Qr(c,"y")&&(d?{y1:d,y2:g,y:$c(d,g)}:{y:A,y1:O,y2:M}),...b&&{[w]:b},...Object.fromEntries(c.map(({name:nt,output:z})=>[nt,z]))}}function kv({cumulative:t,domain:e,thresholds:n,interval:r,...o},i){return[o,{cumulative:t,domain:e,thresholds:n,interval:r,...i}]}function _y(t,{cumulative:e,domain:n,thresholds:r,interval:o},i){return t={...nr(t)},t.domain===void 0&&(t.domain=n),t.cumulative===void 0&&(t.cumulative=e),t.thresholds===void 0&&(t.thresholds=r),t.interval===void 0&&(t.interval=o),t.value===void 0&&(t.value=i),t.thresholds=Nv(t.thresholds,t.interval),t}function tq(t){let{x:e,y:n}=t;return e=_y(e,t),n=_y(n,t),[e.value,n.value]=oe(e.value,n.value),{x:e,y:n}}function RA(t){if(t==null)return;let{value:e,cumulative:n,domain:r=kt,thresholds:o}=t,i=s=>{let a=ft(s,e),c;if(Jt(a)||rq(o)){a=Mt(a,yw,Float64Array);let[l,u]=typeof r=="function"?r(a):r,p=typeof o=="function"&&!Fi(o)?o(a,l,u):o;typeof p=="number"&&(p=eu(l,u,p)),Fi(p)&&(r===kt&&(l=p.floor(l),u=p.offset(p.floor(u))),p=p.range(l,p.offset(u))),c=p}else{a=de(a);let[l,u]=typeof r=="function"?r(a):r,p=typeof o=="function"&&!Fi(o)?o(a,l,u):o;if(typeof p=="number")if(r===kt){let h=bo(l,u,p);if(isFinite(h))if(h>0){let d=Math.round(l/h),m=Math.round(u/h);d*h<=l||--d,m*h>u||++m;let g=m-d+1;p=new Float64Array(g);for(let y=0;y<g;++y)p[y]=(d+y)*h}else if(h<0){h=-h;let d=Math.round(l*h),m=Math.round(u*h);d/h<=l||--d,m/h>u||++m;let g=m-d+1;p=new Float64Array(g);for(let y=0;y<g;++y)p[y]=(d+y)/h}else p=[l];else p=[l]}else p=Fe(l,u,p);else Fi(p)&&(r===kt&&(l=p.floor(l),u=p.offset(p.floor(u))),p=p.range(l,p.offset(u)));c=p}let f=[];if(c.length===1)f.push([c[0],c[0]]);else for(let l=1;l<c.length;++l)f.push([c[l-1],c[l]]);return f.bin=(n<0?sq:n>0?iq:Ov)(f,c,a),f};return i.label=Ye(e),i}function Nv(t,e,n=LA){if(t===void 0)return e===void 0?n:Vr(e);if(typeof t=="string"){switch(t.toLowerCase()){case"freedman-diaconis":return pd;case"scott":return Qf;case"sturges":return di;case"auto":return LA}return Qs(t)}return t}function eq(t,e){return Ow(t,e,FA)}function FA(t,e,n){return $g(t,e,n,PA)}function PA(t,e,n){return Cg(t,e,n,qA)}function qA(t,e){return Oc(t,e,nq)}function nq(t){switch(`${t}`.toLowerCase()){case"x":return aq;case"x1":return fq;case"x2":return lq;case"y":return cq;case"y1":return uq;case"y2":return pq;case"z":return Dw}throw new Error(`invalid bin reduce: ${t}`)}function LA(t,e,n){return Math.min(200,Qf(t,e,n))}function rq(t){return q8(t)||gn(t)&&Jt(t)}function oq(t,e,n){let r=t?.(n),o=e?.(n);return r&&o?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries()){let l=o.bin(s[a]);for(let[u,[p,h]]of o.entries())yield[l[u],{data:n,x1:c,y1:p,x2:f,y2:h}]}}:r?function*(i){let s=r.bin(i);for(let[a,[c,f]]of r.entries())yield[s[a],{data:n,x1:c,x2:f}]}:function*(i){let s=o.bin(i);for(let[a,[c,f]]of o.entries())yield[s[a],{data:n,y1:c,y2:f}]}}function Ov(t,e,n){return e=de(e),r=>{let o=t.map(()=>[]);for(let i of r)o[yo(e,n[i])-1]?.push(i);return o}}function iq(t,e,n){let r=Ov(t,e,n);return o=>{let i=r(o);for(let s=1,a=i.length;s<a;++s){let c=i[s-1],f=i[s];for(let l of c)f.push(l)}return i}}function sq(t,e,n){let r=Ov(t,e,n);return o=>{let i=r(o);for(let s=i.length-2;s>=0;--s){let a=i[s+1],c=i[s];for(let f of a)c.push(f)}return i}}function BA(t,e){let n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}var aq={reduceIndex(t,e,{x1:n,x2:r}){return BA(n,r)}},cq={reduceIndex(t,e,{y1:n,y2:r}){return BA(n,r)}},fq={reduceIndex(t,e,{x1:n}){return n}},lq={reduceIndex(t,e,{x2:n}){return n}},uq={reduceIndex(t,e,{y1:n}){return n}},pq={reduceIndex(t,e,{y2:n}){return n}};var hq={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},la=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,z:a,curve:c,tension:f}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0},z:{value:Ke(n),optional:!0}},n,hq),this.z=a,this.curve=np(c,f)}filter(e){return e}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n,0,0).call(l=>l.selectAll().data(Vg(e,[s,a,c,f],this,r)).enter().append("path").call(ut,this).call(na,this,r).attr("d",xc().curve(this.curve).defined(u=>u>=0).x0(u=>s[u]).y0(u=>a[u]).x1(u=>c[u]).y1(u=>f[u]))).node()}};function rp(t,e){return e===void 0?ti(t,{x:Zs,y:Ri}):new la(t,e)}function ts(t,e){let{y:n=Yt,...r}=tf(e);return new la(t,Zi(Hi({...r,y1:n,y2:void 0})))}function ti(t,e){let{x:n=Yt,...r}=Jc(e);return new la(t,Ki(Qi({...r,x1:n,x2:void 0})))}var dq={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},op=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,curve:a,tension:c}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,dq),this.curve=vy(a,c),yr(this,n)}project(e,n,r){this.curve!==Ji&&super.project(e,n,r)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a}=r,{curve:l}=this;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(u=>u.selectAll().data(e).enter().append("path").call(ut,this).attr("d",l===Ji&&i.projection?mq(i.projection,s,a,c,f):p=>{let h=fn(),d=l(h);return d.lineStart(),d.point(s[p],a[p]),d.point(c[p],f[p]),d.lineEnd(),h}).call(vt,this,r).call(Ko,this,r,i)).node()}};function mq(t,e,n,r,o){let i=Se(t);return e=de(e),n=de(n),r=de(r),o=de(o),s=>i({type:"LineString",coordinates:[[e[s],n[s]],[r[s],o[s]]]})}function My(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=ip(e,n,r),[i,s]=ip(o,i,s),new op(t,{...a,x1:n,x2:r,y1:i,y2:s})}function ip(t,e,n){if(t===void 0){if(e===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[e]}else{if(e===void 0)return n===void 0?[t]:[t,n];if(n===void 0)return[t,e]}return[e,n]}var gq={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5},sp=class extends lt{constructor(e,n={}){let{x1:r,y1:o,x2:i,y2:s,bend:a=0,headAngle:c=60,headLength:f=8,inset:l=0,insetStart:u=l,insetEnd:p=l,sweep:h}=n;super(e,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:s,scale:"y",optional:!0}},n,gq),this.bend=a===!0?22.5:Math.max(-90,Math.min(90,a)),this.headAngle=+c,this.headLength=+f,this.insetStart=+u,this.insetEnd=+p,this.sweep=yq(h)}render(e,n,r,o,i){let{x1:s,y1:a,x2:c=s,y2:f=a,SW:l}=r,{strokeWidth:u,bend:p,headAngle:h,headLength:d,insetStart:m,insetEnd:g}=this,y=l?b=>l[b]:te(u===void 0?1:u),x=h*Yc/2,w=d/1.5;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(b=>b.selectAll().data(e).enter().append("path").call(ut,this).attr("d",_=>{let v=s[_],A=a[_],T=c[_],E=f[_],$=Math.hypot(T-v,E-A);if($<=m+g)return null;let S=Math.atan2(E-A,T-v),k=Math.min(w*y(_),$/3),O=this.sweep(v,A,T,E)*p*Yc,M=Math.hypot($/Math.tan(O),$)/2;if(m||g)if(M<1e5){let J=Math.sign(O),[et,rt]=xq([v,A],[T,E],M,J);if(m&&([v,A]=zA([et,rt,M],[v,A,m],-J*Math.sign(m))),g){let[j,nt]=zA([et,rt,M],[T,E,g],J*Math.sign(g));S+=Math.atan2(nt-rt,j-et)-Math.atan2(E-rt,T-et),T=j,E=nt}}else{let J=T-v,et=E-A,rt=Math.hypot(J,et);m&&(v+=J/rt*m,A+=et/rt*m),g&&(T-=J/rt*g,E-=et/rt*g)}let I=S+O,C=I+x,N=I-x,L=T-k*Math.cos(C),R=E-k*Math.sin(C),D=T-k*Math.cos(N),F=E-k*Math.sin(N),P=M<1e5?`A${M},${M} 0,0,${O>0?1:0} `:"L",V=k?`M${L},${R}L${T},${E}L${D},${F}`:"";return`M${v},${A}${P}${T},${E}${V}`}).call(vt,this,r)).node()}};function yq(t=1){if(typeof t=="number")return te(Math.sign(t));if(typeof t=="function")return(e,n,r,o)=>Math.sign(t(e,n,r,o));switch(be(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(e,n,r)=>ht(e,r);case"-x":return(e,n,r)=>en(e,r);case"+y":return(e,n,r,o)=>ht(n,o);case"-y":return(e,n,r,o)=>en(n,o)}}function xq([t,e],[n,r],o,i){let s=n-t,a=r-e,c=Math.hypot(s,a),f=i*Math.sqrt(o*o-c*c/4)/c;return[(t+n)/2-a*f,(e+r)/2+s*f]}function zA([t,e,n],[r,o,i],s){let a=r-t,c=o-e,f=Math.hypot(a,c),l=(a*a+c*c-i*i+n*n)/(2*f),u=s*Math.sqrt(n*n-l*l);return[t+(a*l+c*u)/f,e+(c*l-a*u)/f]}function YA(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:s,...a}={}){return[n,r]=ip(e,n,r),[i,s]=ip(o,i,s),new sp(t,{...a,x1:n,x2:r,y1:i,y2:s})}var bq={ariaLabel:"bar"},ef=class extends lt{constructor(e,n,r={},o=bq){super(e,n,r,o),Hu(this,r),Qu(this,r)}render(e,n,r,o,i){let{rx:s,ry:a,rx1y1:c,rx1y2:f,rx2y1:l,rx2y2:u}=this,p=this._x(n,r,o),h=this._y(n,r,o),d=this._width(n,r,o),m=this._height(n,r,o);return ot("svg:g",i).call(mt,this,o,i).call(this._transform,this,n).call(g=>g.selectAll().data(e).enter().call(c||f||l||u?y=>y.append("path").call(ut,this).call(Zu,p,h,UA(p,d),UA(h,m),this).call(vt,this,r):y=>y.append("rect").call(ut,this).attr("x",p).attr("width",d).attr("y",h).attr("height",m).call(st,"rx",s).call(st,"ry",a).call(vt,this,r))).node()}_x(e,{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n?i=>n[i]+o:r+o}_y(e,{y:n},{marginTop:r}){let{insetTop:o}=this;return n?i=>n[i]+o:r+o}_width({x:e},{x:n},{marginRight:r,marginLeft:o,width:i}){let{insetLeft:s,insetRight:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}_height({y:e},{y:n},{marginTop:r,marginBottom:o,height:i}){let{insetTop:s,insetBottom:a}=this,c=n&&e?e.bandwidth():i-r-o;return Math.max(0,c-s-a)}};function UA(t,e){return typeof t=="function"&&typeof e=="function"?n=>t(n)+e(n):typeof t=="function"?n=>t(n)+e:typeof e=="function"?n=>t+e(n):t+e}var ua=class extends ef{constructor(e,n={},r){let{x1:o,x2:i,y:s}=n;super(e,{x1:{value:o,scale:"x"},x2:{value:i,scale:"x"},y:{value:s,scale:"y",type:"band",optional:!0}},n,r)}_transform(e,n,{x:r}){e.call(pt,n,{x:r},0,0)}_x({x:e},{x1:n,x2:r},{marginLeft:o}){let{insetLeft:i}=this;return Dn(e)?o+i:s=>Math.min(n[s],r[s])+i}_width({x:e},{x1:n,x2:r},{marginRight:o,marginLeft:i,width:s}){let{insetLeft:a,insetRight:c}=this;return Dn(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}},pa=class extends ef{constructor(e,n={},r){let{x:o,y1:i,y2:s}=n;super(e,{y1:{value:i,scale:"y"},y2:{value:s,scale:"y"},x:{value:o,scale:"x",type:"band",optional:!0}},n,r)}_transform(e,n,{y:r}){e.call(pt,n,{y:r},0,0)}_y({y:e},{y1:n,y2:r},{marginTop:o}){let{insetTop:i}=this;return Dn(e)?o+i:s=>Math.min(n[s],r[s])+i}_height({y:e},{y1:n,y2:r},{marginTop:o,marginBottom:i,height:s}){let{insetTop:a,insetBottom:c}=this;return Dn(e)?s-o-i-a-c:f=>Math.max(0,Math.abs(r[f]-n[f])-a-c)}};function ro(t,e={}){return Yo(e)||(e={...e,y:Yt,x2:G}),new ua(t,Zi(Uc(Hi(e))))}function oo(t,e={}){return Yo(e)||(e={...e,x:Yt,y2:G}),new pa(t,Ki(jc(Qi(e))))}var wq={ariaLabel:"cell"},ha=class extends ef{constructor(e,{x:n,y:r,...o}={}){super(e,{x:{value:n,scale:"x",type:"band",optional:!0},y:{value:r,scale:"y",type:"band",optional:!0}},o,wq)}_transform(e,n){e.call(pt,n,{},0,0)}};function es(t,{x:e,y:n,...r}={}){return[e,n]=oe(e,n),new ha(t,{...r,x:e,y:n})}function jA(t,{x:e=Yt,fill:n,stroke:r,...o}={}){return n===void 0&&Kt(r)[0]===void 0&&(n=G),new ha(t,{...o,x:e,fill:n,stroke:r})}function XA(t,{y:e=Yt,fill:n,stroke:r,...o}={}){return n===void 0&&Kt(r)[0]===void 0&&(n=G),new ha(t,{...o,y:e,fill:n,stroke:r})}var vq={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function ap(t){return t.sort===void 0&&t.reverse===void 0?Tg({channel:"-r"},t):t}var da=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i,rotate:s,symbol:a=Po,frameAnchor:c}=n,[f,l]=Lt(s,0),[u,p]=J8(a),[h,d]=Lt(i,u==null?3:4.5);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:h,scale:"r",filter:dn,optional:!0},rotate:{value:f,optional:!0},symbol:{value:u,scale:"auto",optional:!0}},ap(n),vq),this.r=d,this.rotate=l,this.symbol=p,this.frameAnchor=Wr(c);let{channels:m}=this,{symbol:g}=m;if(g){let{fill:y,stroke:x}=m;g.hint={fill:y?y.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:x?x.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,r:l,rotate:u,symbol:p}=r,{r:h,rotate:d,symbol:m}=this,[g,y]=ke(this,o),x=m===Po,w=l?void 0:h*h*Math.PI;return $i(h)&&(e=[]),ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(b=>b.selectAll().data(e).enter().append(x?"circle":"path").call(ut,this).call(x?_=>{_.attr("cx",c?v=>c[v]:g).attr("cy",f?v=>f[v]:y).attr("r",l?v=>l[v]:h)}:_=>{_.attr("transform",xr`translate(${c?v=>c[v]:g},${f?v=>f[v]:y})${u?v=>` rotate(${u[v]})`:d?` rotate(${d})`:""}`).attr("d",l&&p?v=>{let A=fn();return p[v].draw(A,l[v]*l[v]*Math.PI),A}:l?v=>{let A=fn();return m.draw(A,l[v]*l[v]*Math.PI),A}:p?v=>{let A=fn();return p[v].draw(A,w),A}:(()=>{let v=fn();return m.draw(v,w),v})())}).call(vt,this,r)).node()}};function or(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=oe(e,n)),new da(t,{...r,x:e,y:n})}function GA(t,{x:e=G,...n}={}){return new da(t,Zg({...n,x:e}))}function VA(t,{y:e=G,...n}={}){return new da(t,Qg({...n,y:e}))}function WA(t,e){return or(t,{...e,symbol:"circle"})}function HA(t,e){return or(t,{...e,symbol:"hexagon"})}var _q={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},ma=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:Ke(n),optional:!0}},n,_q),this.z=i,this.curve=vy(s,a),yr(this,n)}filter(e){return e}project(e,n,r){this.curve!==Ji&&super.project(e,n,r)}render(e,n,r,o,i){let{x:s,y:a}=r,{curve:c}=this;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(f=>f.selectAll().data(Vg(e,[s,a],this,r)).enter().append("path").call(ut,this).call(na,this,r).call(A7,this,r,i).attr("d",c===Ji&&i.projection?Mq(i.projection,s,a):lu().curve(c).defined(l=>l>=0).x(l=>s[l]).y(l=>a[l]))).node()}};function Mq(t,e,n){let r=Se(t);return e=de(e),n=de(n),o=>{let i=[],s=[i];for(let a of o)a===-1?(i=[],s.push(i)):i.push([e[a],n[a]]);return r({type:"MultiLineString",coordinates:s})}}function ga(t,{x:e,y:n,...r}={}){return[e,n]=oe(e,n),new ma(t,{...r,x:e,y:n})}function ns(t,{x:e=G,y:n=Yt,...r}={}){return new ma(t,tf({...r,x:e,y:n}))}function rs(t,{x:e=Yt,y:n=G,...r}={}){return new ma(t,Jc({...r,x:e,y:n}))}function Lv(t,e){e=Sq(e);let{x:n,y:r,color:o,size:i}=e,s=Sy(t,n),a=Sy(t,r),c=Sy(t,o),f=Sy(t,i),{fx:l,fy:u,x:{value:p,reduce:h,zero:d,...m},y:{value:g,reduce:y,zero:x,...w},color:{value:b,color:_,reduce:v},size:{value:A,reduce:T},mark:E}=e;if(h===void 0&&(h=y==null&&p==null&&A==null&&g!=null?"count":null),y===void 0&&(y=h==null&&g==null&&A==null&&p!=null?"count":null),T===void 0&&A==null&&v==null&&h==null&&y==null&&(p==null||Qt(s))&&(g==null||Qt(a))&&(T="count"),d===void 0&&(d=Ay(h)?!0:void 0),x===void 0&&(x=Ay(y)?!0:void 0),p==null&&g==null)throw new Error("must specify x or y");if(h!=null&&g==null)throw new Error("reducing x requires y");if(y!=null&&p==null)throw new Error("reducing y requires x");E===void 0&&(E=A!=null||T!=null?"dot":Ay(h)||Ay(y)||v!=null?"bar":p!=null&&g!=null?Qt(s)||Qt(a)||h==null&&y==null&&!cp(s)&&!cp(a)?"dot":"line":p!=null||g!=null?"rule":null);let $,S,k;switch(E){case"dot":k=or,S="stroke";break;case"line":k=s&&a||h!=null||y!=null?x||y!=null||s&&cp(s)?rs:d||h!=null||a&&cp(a)?ns:ga:s?ns:rs,S="stroke",ZA(c)&&($=null);break;case"area":k=!(x||y!=null)&&(d||h!=null||a&&cp(a))?ts:ti,S="fill",ZA(c)&&($=null);break;case"rule":k=s?Fn:Pn,S="stroke";break;case"bar":k=h!=null?Qt(a)?QA(h)&&s&&Qt(s)?es:ro:Hc:y!=null?Qt(s)?QA(y)&&a&&Qt(a)?es:oo:Qc:v!=null||T!=null?s&&Qt(s)&&a&&Qt(a)?es:s&&Qt(s)?oo:a&&Qt(a)?ro:Ku:s&&jo(s)&&!(a&&jo(a))?ro:a&&jo(a)&&!(s&&jo(s))?oo:es,S="fill";break;default:throw new Error(`invalid mark: ${E}`)}let O={fx:l,fy:u,x:s??void 0,y:a??void 0,[S]:c??_,z:$,r:f??void 0,tip:!0},M,I={[S]:v??void 0,r:T??void 0};if(h!=null&&y!=null)throw new Error("cannot reduce both x and y");return y!=null?(I.y=y,M=Qt(s)?qi:eo):h!=null?(I.x=h,M=Qt(a)?Bi:no):(v!=null||T!=null)&&(s&&a?M=Qt(s)&&Qt(a)?Du:Qt(s)?no:Qt(a)?eo:Jo:s?M=Qt(s)?qi:eo:a&&(M=Qt(a)?Bi:no)),(M===Jo||M===eo)&&(O.x={value:s,...m}),(M===Jo||M===no)&&(O.y={value:a,...w}),d===void 0&&(d=s&&!(M===Jo||M===eo)&&(k===ro||k===ts||k===Hc||k===Pn)),x===void 0&&(x=a&&!(M===Jo||M===no)&&(k===oo||k===ti||k===Qc||k===Fn)),{fx:l??null,fy:u??null,x:{value:p??null,reduce:h??null,zero:!!d,...m},y:{value:g??null,reduce:y??null,zero:!!x,...w},color:{value:b??null,reduce:v??null,..._!==void 0&&{color:_}},size:{value:A??null,reduce:T??null},mark:E,markImpl:KA[k],markOptions:O,transformImpl:KA[M],transformOptions:I,colorMode:S}}function JA(t,e){let n=Lv(t,e),{fx:r,fy:o,x:{zero:i},y:{zero:s},markOptions:a,transformOptions:c,colorMode:f}=n,l=Rv[n.markImpl],u=Rv[n.transformImpl],p=r!=null||o!=null?Zc({strokeOpacity:.1}):null,h=[i?Fn([0]):null,s?Pn([0]):null],d=l(t,u?u(c,a):a);return f==="stroke"?ge(p,h,d):ge(p,d,h)}function cp(t){let e,n;for(let r of t){if(r==null)continue;if(e===void 0){e=r;continue}let o=Math.sign(ht(e,r));if(o){if(n!==void 0&&o!==n)return!1;e=r,n=o}}return!0}function Sq({x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}={}){return Rn(t)||(t=nf(t)),Rn(e)||(e=nf(e)),Rn(n)||(n=Pi(n)?{color:n}:nf(n)),Rn(r)||(r=nf(r)),Rn(o)&&({value:o}=nf(o)),Rn(i)&&({value:i}=nf(i)),s!=null&&(s=`${s}`.toLowerCase()),{x:t,y:e,color:n,size:r,fx:o,fy:i,mark:s}}function Sy(t,e){let n=ft(t,e.value);return n&&(n.label=Ye(e.value)),n}function nf(t){return Aq(t)?{reduce:t}:{value:t}}function Ay(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function QA(t){return/^(?:first|last|mode)$/i.test(t)}function Aq(t){if(t==null)return!1;if(typeof t.reduceIndex=="function"||typeof t.reduce=="function"&&Ie(t)||/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}function ZA(t){return t?new rn(t).size>t.length>>1:!1}var Rv={dot:or,line:ga,lineX:ns,lineY:rs,areaX:ts,areaY:ti,ruleX:Fn,ruleY:Pn,barX:ro,barY:oo,rect:Ku,rectX:Hc,rectY:Qc,cell:es,bin:Jo,binX:eo,binY:no,group:Du,groupX:qi,groupY:Bi},KA=Object.fromEntries(Object.entries(Rv).map(([t,e])=>[e,t]));function rf(t,e={}){let{x:n,x1:r,x2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,x:n=G});let i={};return n!=null&&(i.x=t),r!=null&&(i.x1=t),o!=null&&(i.x2=t),_n(i,e)}function of(t,e={}){let{y:n,y1:r,y2:o}=e;n===void 0&&r===void 0&&o===void 0&&(e={...e,y:n=G});let i={};return n!=null&&(i.y=t),r!=null&&(i.y1=t),o!=null&&(i.y2=t),_n(i,e)}function _n(t={},e={}){let n=Ke(e),r=Object.entries(t).map(([o,i])=>{let s=vg(o,e);if(s==null)throw new Error(`missing channel: ${o}`);let[a,c]=$e(s);return{key:o,input:s,output:a,setOutput:c,map:Eq(i)}});return{...me(e,(o,i)=>{let s=ft(o,n),a=r.map(({input:f})=>ft(o,f)),c=r.map(({setOutput:f})=>f(new Array(o.length)));for(let f of i)for(let l of s?De(f,u=>s[u]).values():[f])r.forEach(({map:u},p)=>u.mapIndex(l,a[p],c[p]));return{data:o,facets:i}}),...Object.fromEntries(r.map(({key:o,output:i})=>[o,i]))}}function Eq(t){if(t==null)throw new Error("missing map");if(typeof t.mapIndex=="function")return t;if(typeof t.map=="function"&&Ie(t))return Tq(t);if(typeof t=="function")return Dv(Ic(t));switch(`${t}`.toLowerCase()){case"cumsum":return $q;case"rank":return Dv((e,n)=>Zf(e,r=>n[r]));case"quantile":return Dv((e,n)=>Iq(e,r=>n[r]))}throw new Error(`invalid map: ${t}`)}function Tq(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}function Iq(t,e){let n=Ar(t,e)-1;return Zf(t,e).map(r=>r/n)}function Dv(t){return{mapIndex(e,n,r){let o=t(e,n);if(o.length!==e.length)throw new Error("map function returned a mismatched length");for(let i=0,s=e.length;i<s;++i)r[e[i]]=o[i]}}}var $q={mapIndex(t,e,n){let r=0;for(let o of t)n[o]=r+=e[o]}};function tE(t={},e){return arguments.length===1&&(e=t),rf(sf(t),e)}function eE(t={},e){return arguments.length===1&&(e=t),of(sf(t),e)}function sf(t={}){typeof t=="number"&&(t={k:t});let{k:e,reduce:n,shift:r,anchor:o,strict:i}=t;if(o===void 0&&r!==void 0&&(o=kq(r),Je(`Warning: the shift option is deprecated; please use anchor "${o}" instead.`)),!((e=Math.floor(e))>0))throw new Error(`invalid k: ${e}`);return Nq(n)(e,Cq(o,e),i)}function Cq(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}function kq(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}function Nq(t="mean"){if(typeof t=="string"){if(/^p\d{2}$/i.test(t))return Ey(Tc(t));switch(t.toLowerCase()){case"deviation":return Ey(Xn);case"max":return Ty((e,n)=>Tt(e,r=>n[r]));case"mean":return Oq;case"median":return Ey(ur);case"min":return Ty((e,n)=>Ft(e,r=>n[r]));case"mode":return Ty((e,n)=>Fa(e,r=>n[r]));case"sum":return nE;case"variance":return Ey(hi);case"difference":return Dq;case"ratio":return Fq;case"first":return Pq;case"last":return qq}}if(typeof t!="function")throw new Error(`invalid reduce: ${t}`);return Ty(Ic(t))}function Ey(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=f=>i[f]==null?NaN:+i[f],c=0;for(let f=0;f<e-1;++f)isNaN(a(f))&&++c;for(let f=0,l=o.length-e+1;f<l;++f)isNaN(a(f+e-1))&&++c,s[o[f+n]]=c===0?t(Uo(o,f,f+e),a):NaN,isNaN(a(f))&&--c}}:{mapIndex(o,i,s){let a=c=>i[c]==null?NaN:+i[c];for(let c=-n;c<0;++c)s[o[c+n]]=t(Uo(o,0,c+e),a);for(let c=0,f=o.length-n;c<f;++c)s[o[c+n]]=t(Uo(o,c,c+e),a)}}}function Ty(t){return(e,n,r)=>r?{mapIndex(o,i,s){let a=0;for(let c=0;c<e-1;++c)a+=Ht(i[o[c]]);for(let c=0,f=o.length-e+1;c<f;++c)a+=Ht(i[o[c+e-1]]),a===e&&(s[o[c+n]]=t(Uo(o,c,c+e),i)),a-=Ht(i[o[c]])}}:{mapIndex(o,i,s){for(let a=-n;a<0;++a)s[o[a+n]]=t(Uo(o,0,a+e),i);for(let a=0,c=o.length-n;a<c;++a)s[o[a+n]]=t(Uo(o,a,a+e),i)}}}function nE(t,e,n){return n?{mapIndex(r,o,i){let s=0,a=0;for(let c=0;c<t-1;++c){let f=o[r[c]];f===null||isNaN(f)?++s:a+=+f}for(let c=0,f=r.length-t+1;c<f;++c){let l=o[r[c]],u=o[r[c+t-1]];u===null||isNaN(u)?++s:a+=+u,i[r[c+e]]=s===0?a:NaN,l===null||isNaN(l)?--s:a-=+l}}}:{mapIndex(r,o,i){let s=0,a=r.length;for(let c=0,f=Math.min(a,t-e-1);c<f;++c)s+=+o[r[c]]||0;for(let c=-e,f=a-e;c<f;++c)s+=+o[r[c+t-1]]||0,i[r[c+e]]=s,s-=+o[r[c]]||0}}}function Oq(t,e,n){if(n){let r=nE(t,e,n);return{mapIndex(o,i,s){r.mapIndex(o,i,s);for(let a=0,c=o.length-t+1;a<c;++a)s[o[a+e]]/=t}}}else return{mapIndex(r,o,i){let s=0,a=0,c=r.length;for(let f=0,l=Math.min(c,t-e-1);f<l;++f){let u=o[r[f]];u!==null&&!isNaN(u=+u)&&(s+=u,++a)}for(let f=-e,l=c-e;f<l;++f){let u=o[r[f+t-1]],p=o[r[f]];u!==null&&!isNaN(u=+u)&&(s+=u,++a),i[r[f+e]]=s/a,p!==null&&!isNaN(p=+p)&&(s-=p,--a)}}}}function Rq(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(Ht(i))return i}}function Lq(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(Ht(i))return i}}function rE(t,e,n,r){for(let o=n+r;n<o;++n){let i=t[e[n]];if(i!==null&&!isNaN(i=+i))return i}}function oE(t,e,n,r){for(let o=n+r-1;o>=n;--o){let i=t[e[o]];if(i!==null&&!isNaN(i=+i))return i}}function Dq(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f-c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=oE(o,r,s,t)-rE(o,r,s,t)}}}function Fq(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s){let c=o[r[s]],f=o[r[s+t-1]];i[r[s+e]]=c===null||f===null?NaN:f/c}}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=oE(o,r,s,t)/rE(o,r,s,t)}}}function Pq(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=Rq(o,r,s,t)}}}function qq(t,e,n){return n?{mapIndex(r,o,i){for(let s=0,a=r.length-t;s<a;++s)i[r[s+e]]=o[r[s+t-1]]}}:{mapIndex(r,o,i){for(let s=-e,a=r.length-t+e+1;s<a;++s)i[r[s+e]]=Lq(o,r,s,t)}}}var ei={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function iE(t,{x:e=G,y:n,k:r=ei.k,color:o=ei.color,opacity:i=ei.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:l,...u}={}){return ge(Rt(s)?null:ts(t,_n({x1:os({k:-r,...u}),x2:os({k:r,...u})},{x1:e,x2:e,y:n,fill:s,fillOpacity:a,...u})),Rt(c)?null:ns(t,_n({x:os(u)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:l,...u})))}function sE(t,{x:e,y:n=G,k:r=ei.k,color:o=ei.color,opacity:i=ei.opacity,fill:s=o,fillOpacity:a=i,stroke:c=o,strokeOpacity:f,strokeWidth:l,...u}={}){return ge(Rt(s)?null:ti(t,_n({y1:os({k:-r,...u}),y2:os({k:r,...u})},{x:e,y1:n,y2:n,fill:s,fillOpacity:a,...u})),Rt(c)?null:rs(t,_n({y:os(u)},{x:e,y:n,stroke:c,strokeOpacity:f,strokeWidth:l,...u})))}function os({n:t=ei.n,k:e=0,strict:n=ei.strict,anchor:r=ei.anchor}={}){return sf({k:t,reduce:o=>wo(o)+e*(Xn(o)||0),strict:n,anchor:r})}var Bq={ariaLabel:"tick",fill:null,stroke:"currentColor"},Iy=class extends lt{constructor(e,n,r){super(e,n,r,Bq),yr(this,r)}render(e,n,r,o,i){return ot("svg:g",i).call(mt,this,o,i).call(this._transform,this,n).call(s=>s.selectAll().data(e).enter().append("line").call(ut,this).attr("x1",this._x1(n,r,o)).attr("x2",this._x2(n,r,o)).attr("y1",this._y1(n,r,o)).attr("y2",this._y2(n,r,o)).call(vt,this,r).call(Ko,this,r,i)).node()}},fp=class extends Iy{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetTop:s=i,insetBottom:a=i}=n;super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},n),this.insetTop=Ct(s),this.insetBottom=Ct(a)}_transform(e,n,{x:r}){e.call(pt,n,{x:r},ee,0)}_x1(e,{x:n}){return r=>n[r]}_x2(e,{x:n}){return r=>n[r]}_y1({y:e},{y:n},{marginTop:r}){let{insetTop:o}=this;return n&&e?i=>n[i]+o:r+o}_y2({y:e},{y:n},{height:r,marginBottom:o}){let{insetBottom:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}},lp=class extends Iy{constructor(e,n={}){let{x:r,y:o,inset:i=0,insetRight:s=i,insetLeft:a=i}=n;super(e,{y:{value:o,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},n),this.insetRight=Ct(s),this.insetLeft=Ct(a)}_transform(e,n,{y:r}){e.call(pt,n,{y:r},0,ee)}_x1({x:e},{x:n},{marginLeft:r}){let{insetLeft:o}=this;return n&&e?i=>n[i]+o:r+o}_x2({x:e},{x:n},{width:r,marginRight:o}){let{insetRight:i}=this;return n&&e?s=>n[s]+e.bandwidth()-i:r-o-i}_y1(e,{y:n}){return r=>n[r]}_y2(e,{y:n}){return r=>n[r]}};function $y(t,{x:e=G,...n}={}){return new fp(t,{...n,x:e})}function Cy(t,{y:e=G,...n}={}){return new lp(t,{...n,y:e})}function aE(t,{x:e=G,y:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...l}={}){let u=n!=null?Bi:Lu;return ge(Pn(t,u({x1:Fv,x2:Pv},{x:e,y:n,stroke:s,strokeOpacity:a,...l})),ro(t,u({x1:"p25",x2:"p75"},{x:e,y:n,fill:o,fillOpacity:i,...l})),$y(t,u({x:"p50"},{x:e,y:n,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...l})),or(t,_n({x:fE},{x:e,y:n,z:n,r,stroke:s,strokeOpacity:a,...l})))}function cE(t,{y:e=G,x:n=null,r,fill:o="#ccc",fillOpacity:i,stroke:s="currentColor",strokeOpacity:a,strokeWidth:c=2,sort:f,...l}={}){let u=n!=null?qi:Lu;return ge(Fn(t,u({y1:Fv,y2:Pv},{x:n,y:e,stroke:s,strokeOpacity:a,...l})),oo(t,u({y1:"p25",y2:"p75"},{x:n,y:e,fill:o,fillOpacity:i,...l})),Cy(t,u({y:"p50"},{x:n,y:e,stroke:s,strokeOpacity:a,strokeWidth:c,sort:f,...l})),or(t,_n({y:fE},{x:n,y:e,z:n,r,stroke:s,strokeOpacity:a,...l})))}function fE(t){let e=Fv(t),n=Pv(t);return t.map(r=>r<e||r>n?r:NaN)}function Fv(t){let e=lE(t)*2.5-uE(t)*1.5;return Ft(t,n=>n>=e?n:NaN)}function Pv(t){let e=uE(t)*2.5-lE(t)*1.5;return Tt(t,n=>n<=e?n:NaN)}function lE(t){return on(t,.25)}function uE(t){return on(t,.75)}var zq={ariaLabel:"raster",stroke:null,pixelSize:1};function af(t,e){let n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function pE(t,e){let n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}var pp=class extends lt{constructor(e,n,r={},o){let{width:i,height:s,x:a,y:c,x1:f=a==null?0:void 0,y1:l=c==null?0:void 0,x2:u=a==null?i:void 0,y2:p=c==null?s:void 0,pixelSize:h=o.pixelSize,blur:d=0,interpolate:m}=r;if(i!=null&&(i=pE(i,"width")),s!=null&&(s=pE(s,"height")),f!=null&&(f=af(f,"x1")),l!=null&&(l=af(l,"y1")),u!=null&&(u=af(u,"x2")),p!=null&&(p=af(p,"y2")),a==null&&(f==null||u==null))throw new Error("missing x");if(c==null&&(l==null||p==null))throw new Error("missing y");e!=null&&i!=null&&s!=null&&(a===void 0&&f!=null&&u!=null&&(a=Hq(f,u,i,s)),c===void 0&&l!=null&&p!=null&&(c=Qq(l,p,i,s))),super(e,{x:{value:a,scale:"x",optional:!0},y:{value:c,scale:"y",optional:!0},x1:{value:f==null?null:[f],scale:"x",optional:!0,filter:null},y1:{value:l==null?null:[l],scale:"y",optional:!0,filter:null},x2:{value:u==null?null:[u],scale:"x",optional:!0,filter:null},y2:{value:p==null?null:[p],scale:"y",optional:!0,filter:null},...n},r,o),this.width=i,this.height=s,this.pixelSize=af(h,"pixelSize"),this.blur=af(d,"blur"),this.interpolate=a==null||c==null?null:Yq(m)}},hp=class extends pp{constructor(e,n={}){let{imageRendering:r}=n;if(e==null){let{fill:o,fillOpacity:i}=n;Lt(i)[0]!==void 0&&(n=ky("fillOpacity",n)),Kt(o)[0]!==void 0&&(n=ky("fill",n))}super(e,void 0,n,zq),this.imageRendering=Xt(r,"auto")}scale(e,{color:n,...r},o){return super.scale(e,r,o)}render(e,n,r,o,i){let s=n[r.channels.fill?.scale]??(I=>I),{x:a,y:c}=r,{document:f}=i,[l,u,p,h]=dE(r,o,i),d=p-l,m=h-u,{pixelSize:g,width:y=Math.round(Math.abs(d)/g),height:x=Math.round(Math.abs(m)/g)}=this,w=y*x,{fill:b,fillOpacity:_}=r,v=0;if(this.interpolate){let I=y/d,C=x/m,N=Mt(a,R=>(R-l)*I,Float64Array),L=Mt(c,R=>(R-u)*C,Float64Array);b&&(b=this.interpolate(e,y,x,N,L,b)),_&&(_=this.interpolate(e,y,x,N,L,_))}else this.data==null&&e&&(v=e.fi*w);let A=f.createElement("canvas");A.width=y,A.height=x;let T=A.getContext("2d"),E=T.createImageData(y,x),$=E.data,{r:S,g:k,b:O}=ye(this.fill)??{r:0,g:0,b:0},M=(this.fillOpacity??1)*255;for(let I=0;I<w;++I){let C=I<<2;if(b){let N=s(b[I+v]);if(N==null){$[C+3]=0;continue}({r:S,g:k,b:O}=ye(N))}_&&(M=_[I+v]*255),$[C+0]=S,$[C+1]=k,$[C+2]=O,$[C+3]=M}return this.blur>0&&sx(E,this.blur),T.putImageData(E,0,0),ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(I=>I.append("image").attr("transform",`translate(${l},${u}) scale(${Math.sign(p-l)},${Math.sign(h-u)})`).attr("width",Math.abs(d)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(st,"image-rendering",this.imageRendering).call(ut,this).attr("xlink:href",A.toDataURL())).node()}};function qv(t,e,n){arguments.length<3&&(n=e,e=null);let{x:r,y:o,[t]:i,...s}=n;return r===void 0&&o===void 0&&z8(e)&&(r=Zs,o=Ri,i===void 0&&(i=F8)),[e,{...s,x:r,y:o,[t]:i}]}function hE(){let[t,e]=qv("fill",...arguments);return new hp(t,t==null||e.fill!==void 0||e.fillOpacity!==void 0?e:{...e,fill:G})}function dE({x1:t,y1:e,x2:n,y2:r},o,{projection:i}){let{width:s,height:a,marginTop:c,marginRight:f,marginBottom:l,marginLeft:u}=o;return[t&&i==null?t[0]:u,e&&i==null?e[0]:c,n&&i==null?n[0]:s-f,r&&i==null?r[0]:a-l]}function Bv({x1:t,y1:e,x2:n,y2:r},o,i,s){let a={};return t&&(a.x1=t),e&&(a.y1=e),n&&(a.x2=n),r&&(a.y2=r),dE(Lc(a,o),i,s)}function ky(t,e={}){let{[t]:n}=e;if(typeof n!="function")throw new Error(`invalid ${t}: not a function`);return jt({...e,[t]:void 0},function(r,o,i,s,a,c){let{x:f,y:l}=s;if(!f)throw new Error("missing scale: x");if(!l)throw new Error("missing scale: y");let[u,p,h,d]=Bv(i,s,a,c),m=h-u,g=d-p,{pixelSize:y}=this,{width:x=Math.round(Math.abs(m)/y),height:w=Math.round(Math.abs(g)/y)}=e,b=new Array(x*w*(o?o.length:1)),_=m/x,v=g/w,A=0;for(let T of o??[void 0])for(let E=.5;E<w;++E)for(let $=.5;$<x;++$,++A)b[A]=n(f.invert(u+$*_),l.invert(p+E*v),T);return{data:b,facets:o,channels:{[t]:{value:b,scale:"auto"}}}})}function Yq(t){if(typeof t=="function")return t;if(t==null)return Ny;switch(`${t}`.toLowerCase()){case"none":return Ny;case"nearest":return mp;case"barycentric":return dp();case"random-walk":return gp()}throw new Error(`invalid interpolate: ${t}`)}function Ny(t,e,n,r,o,i){let s=new Array(e*n);for(let a of t)r[a]<0||r[a]>=e||o[a]<0||o[a]>=n||(s[Math.floor(o[a])*e+Math.floor(r[a])]=i[a]);return s}function dp({random:t=Ps(42)}={}){return(e,n,r,o,i,s)=>{let{points:a,triangles:c,hull:f}=Wn.from(e,h=>o[h],h=>i[h]),l=new s.constructor(n*r).fill(NaN),u=new Uint8Array(n*r),p=Wq(s,t);for(let h=0;h<c.length;h+=3){let d=c[h],m=c[h+1],g=c[h+2],y=a[2*d],x=a[2*m],w=a[2*g],b=a[2*d+1],_=a[2*m+1],v=a[2*g+1],A=Math.min(y,x,w),T=Math.max(y,x,w),E=Math.min(b,_,v),$=Math.max(b,_,v),S=(_-v)*(y-w)+(b-v)*(w-x);if(!S)continue;let k=s[e[d]],O=s[e[m]],M=s[e[g]];for(let I=Math.floor(A);I<T;++I)for(let C=Math.floor(E);C<$;++C){if(I<0||I>=n||C<0||C>=r)continue;let N=I+.5,L=C+.5,R=Math.sign(S),D=(_-v)*(N-w)+(L-v)*(w-x);if(D*R<0)continue;let F=(v-b)*(N-w)+(L-v)*(y-w);if(F*R<0)continue;let P=S-(D+F);if(P*R<0)continue;let V=I+n*C;l[V]=p(k,D/S,O,F/S,M,P/S,I,C),u[V]=1}}return Uq(l,u,o,i,s,n,r,f,e,p),l}}function Uq(t,e,n,r,o,i,s,a,c,f){n=Float64Array.from(a,h=>n[c[h]]),r=Float64Array.from(a,h=>r[c[h]]),o=Array.from(a,h=>o[c[h]]);let l=n.length,u=Array.from({length:l},(h,d)=>Xq(d,n,r)),p=0;for(let h=0;h<s;++h){let d=h+.5;for(let m=0;m<i;++m){let g=m+i*h;if(!e[g]){let y=m+.5;for(let x=0;x<l;++x){let w=(l+p+(x%2?(x+1)/2:-x/2))%l;if(u[w](y,d)){let b=jq(n.at(w-1),r.at(w-1),n[w],r[w],y,d);t[g]=f(o.at(w-1),b,o[w],1-b,o[w],0,m,h),p=w;break}}}}}}function jq(t,e,n,r,o,i){let s=n-t,a=r-e,c=s*(n-o)+a*(r-i),f=s*(o-t)+a*(i-e);return c>0&&f>0?c/(c+f):+(c>f)}function up(t,e,n,r){return t*r-n*e}function Xq(t,e,n){let r=e.length,o=e.at(t-2),i=n.at(t-2),s=e.at(t-1),a=n.at(t-1),c=e[t],f=n[t],l=e.at(t+1-r),u=n.at(t+1-r),p=s-c,h=a-f,d=o-s,m=i-a,g=c-l,y=f-u,x=Math.hypot(p,h),w=Math.hypot(d,m),b=Math.hypot(g,y);return(_,v)=>{let A=_-s,T=v-a,E=_-c,$=v-f;return up(A,T,E,$)>-1e-6&&up(A,T,p,h)*w-up(A,T,d,m)*x>-1e-6&&up(E,$,g,y)*x-up(E,$,p,h)*b<=0}}function mp(t,e,n,r,o,i){let s=new i.constructor(e*n),a=Wn.from(t,l=>r[l],l=>o[l]),c,f;for(let l=.5,u=0;l<n;++l){f=c;for(let p=.5;p<e;++p,++u)f=a.find(p,l,f),p===.5&&(c=f),s[u]=i[t[f]]}return s}function gp({random:t=Ps(42),minDistance:e=.5,maxSteps:n=2}={}){return(r,o,i,s,a,c)=>{let f=new c.constructor(o*i),l=Wn.from(r,d=>s[d],d=>a[d]),u,p,h;for(let d=.5,m=0;d<i;++d){p=u;for(let g=.5;g<o;++g,++m){let y=g,x=d;h=p=l.find(y,x,p),g===.5&&(u=p);let w,b=0;for(;(w=Math.hypot(s[r[h]]-y,a[r[h]]-x))>e&&b<n;){let _=t(g,d,b)*2*Math.PI;y+=Math.cos(_)*w,x+=Math.sin(_)*w,h=l.find(y,x,h),++b}f[m]=c[r[h]]}}return f}}function Gq(t,e,n,r,o,i){return e*t+r*n+i*o}function Vq(t){return(e,n,r,o,i,s,a,c)=>{let f=t(a,c);return f<n?e:f<n+o?r:i}}function Wq(t,e){return jo(t)||Jt(t)?Gq:Vq(e)}function Hq(t,e,n){return{transform(r){let o=r.length,i=new Float64Array(o),s=(e-t)/n,a=t+s/2;for(let c=0;c<o;++c)i[c]=c%n*s+a;return i}}}function Qq(t,e,n,r){return{transform(o){let i=o.length,s=new Float64Array(i),a=(e-t)/r,c=t+a/2;for(let f=0;f<i;++f)s[f]=Math.floor(f/n)%r*a+c;return s}}}var mE={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2},yp=class extends pp{constructor(e,{smooth:n=!0,value:r,...o}={}){let i=Gg({},o,mE);if(r===void 0){for(let a in i)if(i[a].value!=null){if(r!==void 0)throw new Error("ambiguous contour value");r=o[a],o[a]="value"}}if(r!=null){let a={transform:c=>c.map(f=>f.value),label:Ye(r)};for(let c in i)o[c]==="value"&&(o[c]=a)}if(e==null){if(r==null)throw new Error("missing contour value");o=ky("value",{value:r,...o}),r=null}else{let{interpolate:a}=o;r===void 0&&(r=G),a===void 0&&(o.interpolate="nearest")}super(e,{value:{value:r,optional:!0}},Zq(o),mE);let s={geometry:{value:G}};for(let a in this.channels){let c=this.channels[a],{scale:f}=c;f==="x"||f==="y"||a==="value"||(s[a]=c,delete this.channels[a])}this.contourChannels=s,this.smooth=!!n}filter(e,{x:n,y:r,value:o,...i},s){return super.filter(e,i,s)}render(e,n,r,o,i){let{geometry:s}=r,a=Se();return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(c=>{c.selectAll().data(e).enter().append("path").call(ut,this).attr("d",f=>a(s[f])).call(vt,this,r)}).node()}};function Zq({thresholds:t,interval:e,...n}){return t=Nv(t,e,di),jt(n,function(r,o,i,s,a,c){let[f,l,u,p]=Bv(i,s,a,c),h=u-f,d=p-l,{pixelSize:m,width:g=Math.round(Math.abs(h)/m),height:y=Math.round(Math.abs(d)/m)}=this,x=g/h,w=y/d,b=i.value.value,_=[];if(this.interpolate){let{x:$,y:S}=Kr(i,s,c),k=Mt($,C=>(C-f)*x,Float64Array),O=Mt(S,C=>(C-l)*w,Float64Array),M=[i.x,i.y,i.value],I=[k,O,b];for(let C of o){let N=this.filter(C,M,I);_.push(this.interpolate(N,g,y,k,O,b))}}else if(o){let $=g*y,S=o.length;for(let k=0;k<S;++k)_.push(b.slice(k*$,k*$+$))}else _.push(b);if(this.blur>0)for(let $ of _)Gf({data:$,width:g,height:y},this.blur);let v=Kq(t,b,...Jq(_));if(v===null)throw new Error(`unsupported thresholds: ${t}`);let{contour:A}=vi().size([g,y]).smooth(this.smooth),T=[],E=[];for(let $ of _)E.push(ie(T.length,T.push(...Mt(v,S=>A($,S)))));for(let{coordinates:$}of T)for(let S of $)for(let k of S)for(let O of k)O[0]=O[0]/x+f,O[1]=O[1]/w+l;return{data:T,facets:E,channels:Og(this.contourChannels,T)}})}function Kq(t,e,n,r){if(typeof t?.range=="function")return t.range(t.floor(n),r);if(typeof t=="function"&&(t=t(e,n,r)),typeof t!="number")return On(t);let o=Fe(...La(n,r,t),t);for(;o[o.length-1]>=r;)o.pop();for(;o[1]<n;)o.shift();return o}function yE(){return new yp(...qv("value",...arguments))}function Jq(t){return[Ft(t,e=>Ft(e,gE)),Tt(t,e=>Tt(e,gE))]}function gE(t){return isFinite(t)?t:NaN}function wE(t,e){return zv(Gi,t,e)}function vE(t,e={}){return zv(Vi,t,e)}function _E(t,e={}){return zv(Zo,t,e)}function zv(t,e,n={}){let{x:r,y:o,maxRadius:i}=n,s=t({px:r,py:o,maxRadius:i}),a=[];r!=null&&a.push(Fn(e,xE("x",{...s,inset:-6},n))),o!=null&&a.push(Pn(e,xE("y",{...s,inset:-6},n))),r!=null&&a.push(to(e,bE("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),o!=null&&a.push(to(e,bE("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(let c of a)c.ariaLabel=`crosshair ${c.ariaLabel}`;return ge(...a)}function ME(t,{channels:e,...n},{facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:c,transform:f,initializer:l}){return{...n,facet:r,facetAnchor:o,fx:i,fy:s,[t]:a,channels:{...e,...c},transform:f,initializer:tB(t,l)}}function tB(t,e){return e==null?e:function(n,r,{x:o,y:i,px:s,py:a,...c},...f){let{channels:{x:l,y:u,...p}={},...h}=e.call(this,n,r,{...c,x:s,y:a},...f);return{channels:{...p,...l&&{px:l,...t==="x"&&{x:l}},...u&&{py:u,...t==="y"&&{y:u}}},...h}}}function xE(t,e,n){let{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:s=o,ruleStrokeWidth:a}=n;return{...ME(t,e,n),stroke:i,strokeOpacity:s,strokeWidth:a}}function bE(t,e,n){let{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:c=5}=n;return{...ME(t,e,eB(t,n)),fill:o,fillOpacity:i,stroke:s,strokeOpacity:a,strokeWidth:c}}function eB(t,e){return jt(e,(n,r,o)=>({channels:{text:{value:Pu(o,t)?.value}}}))}var nB={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},rB={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},oB={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},iB={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},sB={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Yv=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,curve:s,tension:a}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},n,nB),this.curve=np(s,a),yr(this,n)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:l}=r,{curve:u}=this,[p,h]=ke(this,o),d=c?x=>c[x]:te(p),m=f?x=>f[x]:te(h),g=this;function y(x){let w=-1,b=[],_={};for(let M in r)_[M]=[];let v=[],A=[],T=[],E=[];function $(M,I){M=x[M],I=x[I],b.push(++w),v[w]=d(M),T[w]=m(M),A[w]=d(I),E[w]=m(I);for(let C in r)_[C].push(r[C][I])}let{halfedges:S,hull:k,triangles:O}=Wn.from(x,d,m);for(let M=0;M<S.length;++M){let I=S[M];I>M&&$(O[M],O[I])}for(let M=0;M<k.length;++M)$(k[M],k[(M+1)%k.length]);bt(this).selectAll().data(b).enter().append("path").call(ut,g).attr("d",M=>{let I=fn(),C=u(I);return C.lineStart(),C.point(v[M],T[M]),C.point(A[M],E[M]),C.lineEnd(),I}).call(vt,g,_).call(Ko,g,_,i)}return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(l?x=>x.selectAll().data(De(e,w=>l[w]).values()).enter().append("g").each(y):x=>x.datum(e).each(y)).node()}},xp=class extends lt{constructor(e,n={},r,o=({z:i})=>i){let{x:i,y:s}=n;super(e,{x:{value:i,scale:"x",optional:!0},y:{value:s,scale:"y",optional:!0},z:{value:o(n),optional:!0}},n,r)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,z:l}=r,[u,p]=ke(this,o),h=c?y=>c[y]:te(u),d=f?y=>f[y]:te(p),m=this;function g(y){let x=Wn.from(y,h,d);bt(this).append("path").datum(y[0]).call(ut,m).attr("d",m._render(x,o)).call(vt,m,r)}return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(l?y=>y.selectAll().data(De(e,x=>l[x]).values()).enter().append("g").each(g):y=>y.datum(e).each(g)).node()}},Uv=class extends xp{constructor(e,n={}){super(e,n,rB),this.fill="none"}_render(e){return e.render()}},jv=class extends xp{constructor(e,n={}){super(e,n,oB,Ke)}_render(e){return e.renderHull()}},Xv=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i}=n;super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i,optional:!0}},jt(n,function(s,a,c,f,l,u){let{x:p,y:h,z:d}=c;({x:p,y:h}=Kr(c,f,u)),d=d?.value;let m=new Array((p??h).length).fill(null),[g,y]=ke(this,l),x=p?b=>p[b]:te(g),w=h?b=>h[b]:te(y);for(let b of a){p&&(b=b.filter(_=>Ht(x(_)))),h&&(b=b.filter(_=>Ht(w(_))));for(let[,_]of Hr(b,d)){let v=Wn.from(_,x,w),A=SE(v,l);for(let T=0,E=_.length;T<E;++T)m[_[T]]=A.renderCell(T)}}return{data:s,facets:a,channels:{cells:{value:m}}}}),iB)}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,cells:l}=r;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(u=>{u.selectAll().data(e).enter().append("path").call(ut,this).attr("d",p=>l[p]).call(vt,this,r)}).node()}},Gv=class extends xp{constructor(e,n){super(e,n,sB),this.fill="none"}_render(e,n){return SE(e,n).render()}};function SE(t,e){let{width:n,height:r,marginTop:o,marginRight:i,marginBottom:s,marginLeft:a}=e;return t.voronoi([a,o,n-i,r-s])}function bp(t,e,{x:n,y:r,...o}={}){return[n,r]=oe(n,r),new t(e,{...o,x:n,y:r})}function AE(t,e){return bp(Yv,t,e)}function EE(t,e){return bp(Uv,t,e)}function TE(t,e){return bp(jv,t,e)}function IE(t,{x:e,y:n,initializer:r,...o}={}){return bp(Xv,t,{...me({...o,x:e,y:n},py),initializer:r})}function $E(t,e){return bp(Gv,t,e)}var aB={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1},wp=class extends lt{constructor(e,{x:n,y:r,z:o,weight:i,fill:s,stroke:a,...c}={}){let f=CE(s)&&(s="currentColor",!0),l=CE(a)&&(a="currentColor",!0);super(e,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:Ke({z:o,fill:s,stroke:a}),optional:!0},weight:{value:i,optional:!0}},fB({...c,fill:s,stroke:a},f,l),aB),f&&(this.fill=void 0),l&&(this.stroke=void 0),this.z=o}filter(e){return e}render(e,n,r,o,i){let{contours:s}=r,a=Se();return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{}).call(c=>c.selectAll().data(e).enter().append("path").call(ut,this).call(vt,this,r).attr("d",f=>a(s[f]))).node()}};function kE(t,{x:e,y:n,...r}={}){return[e,n]=oe(e,n),new wp(t,{...r,x:e,y:n})}var cB=new Set(["x","y","z","weight"]);function fB(t,e,n){let{bandwidth:o,thresholds:i}=t;return o=o===void 0?20:+o,i=i===void 0?20:typeof i?.[Symbol.iterator]=="function"?de(i):+i,jt(t,function(s,a,c,f,l,u){let p=c.weight?de(c.weight.value):null,h=c.z?.value,{z:d}=this,[m,g]=ke(this,l),{width:y,height:x}=l,{x:w,y:b}=Kr(c,f,u),_=Object.fromEntries(Object.entries(c).filter(([O])=>!cB.has(O)).map(([O,M])=>[O,{...M,value:[]}])),v=e&&[],A=n&&[],T=Wx().x(w?O=>w[O]:m).y(b?O=>b[O]:g).weight(p?O=>p[O]:1).size([y,x]).bandwidth(o),E=[];for(let O of a){let M=[];E.push(M);for(let I of h?Uu(O,h,d):[O]){let C=T.contours(I);M.push([I,C])}}let $=i;if(!($ instanceof Cu)){let O=0;for(let M of E)for(let[,I]of M){let C=I.max;C>O&&(O=C)}$=Float64Array.from({length:i-1},(M,I)=>O*100*(I+1)/i)}let S=[],k=[];for(let O of E){let M=[];S.push(M);for(let[I,C]of O)for(let N of $){M.push(k.length),k.push(C(N/100)),v&&v.push(N),A&&A.push(N);for(let L in _)_[L].value.push(c[L].value[I[0]])}}return v&&v.push(0),A&&A.push(0),{data:s,facets:S,channels:{..._,...v&&{fill:{value:v,scale:"color"}},...A&&{stroke:{value:A,scale:"color"}},contours:{value:k}}}})}function CE(t){return/^density$/i.test(t)}function RE(t,e){return DE("x",t,e)}function LE(t,e){return DE("y",t,e)}function DE(t,e,{x1:n,x2:r,y1:o,y2:i,x:s=n===void 0&&r===void 0?t==="y"?Yt:G:void 0,y:a=o===void 0&&i===void 0?t==="x"?Yt:G:void 0,fill:c,positiveFill:f="#3ca951",negativeFill:l="#4269d0",fillOpacity:u=1,positiveFillOpacity:p=u,negativeFillOpacity:h=u,stroke:d,strokeOpacity:m,z:g=Kt(d)[0],clip:y,tip:x,render:w,...b}={}){return[n,r]=NE(s,n,r),[o,i]=NE(a,o,i),n===r&&o===i&&(t==="y"?o=ni(0):n=ni(0)),{tip:x}=gr({tip:x},t==="y"?"x":"y"),ge(Rt(f)?null:Object.assign(rp(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:f,fillOpacity:p,render:Qo(w,OE(t,!0)),clip:y,...b}),{ariaLabel:"positive difference"}),Rt(l)?null:Object.assign(rp(e,{x1:n,x2:r,y1:o,y2:i,z:g,fill:l,fillOpacity:h,render:Qo(w,OE(t,!1)),clip:y,...b}),{ariaLabel:"negative difference"}),ga(e,{x:r,y:i,z:g,stroke:d,strokeOpacity:m,tip:x,clip:!0,...b}))}function NE(t,e,n){return e===void 0&&n===void 0?e=n=ni(t):e===void 0?(n=ni(n),e=t===void 0?n:ni(t)):n===void 0?(e=ni(e),n=t===void 0?e:ni(t)):(e=ni(e),n=ni(n)),[e,n]}function ni(t){let e,{value:n,label:r=Ye(n)}=nr(t);return{transform:o=>e||(e=ft(o,n)),label:r}}function OE(t,e){let n=t==="x"?"y":"x",r=`${n}1`,o=`${n}2`,i=`${t}1`,s=`${t}2`;return(a,c,f,l,u,p)=>{let{[r]:h,[o]:d}=f,m=new Float32Array(h.length),g=new Float32Array(d.length),y=l[t==="y"?"height":"width"];(e===Fg(c[t])<0?m:g).fill(y);let x=p(a,c,{...f,[o]:h,[s]:g},l,u),w=p(a,c,{...f,[r]:d,[i]:m},l,u),b=x.querySelector("g")??x,_=w.querySelector("g")??w;for(let v=0;b.firstChild;v+=2){let A=av(),T=ot("svg:clipPath",u).attr("id",A).node();T.appendChild(b.firstChild),_.childNodes[v].setAttribute("clip-path",`url(#${A})`),_.insertBefore(T,_.childNodes[v])}return w}}function Oy({geometry:t=G,...e}={}){let n=ji(r=>ft(r,t));return jt({...e,x:null,y:null,geometry:{transform:n}},(r,o,i,s,a,{projection:c})=>{let f=n(r),l=f.length,u=new Float64Array(l),p=new Float64Array(l),h=Se(c);for(let d=0;d<l;++d)[u[d],p[d]]=h.centroid(f[d]);return{data:r,facets:o,channels:{x:{value:u,scale:c==null?"x":null,source:null},y:{value:p,scale:c==null?"y":null,source:null}}}})}function FE({geometry:t=G,...e}={}){let n=ji(o=>ft(o,t)),r=ji(o=>ft(n(o),lb));return{...e,x:{transform:o=>Float64Array.from(r(o),([i])=>i)},y:{transform:o=>Float64Array.from(r(o),([,i])=>i)},geometry:{transform:n}}}var lB={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},vp=class extends lt{constructor(e,n={}){let[r,o]=Lt(n.r,3);super(e,{x:{value:n.tip?n.x:null,scale:"x",optional:!0},y:{value:n.tip?n.y:null,scale:"y",optional:!0},r:{value:r,scale:"r",filter:dn,optional:!0},geometry:{value:n.geometry,scale:"projection"}},ap(n),lB),this.r=o}render(e,n,r,o,i){let{geometry:s,r:a}=r,c=Se(i.projection??uB(n)),{r:f}=this;return $i(f)?e=[]:f!==void 0&&c.pointRadius(f),ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(l=>{l.selectAll().data(e).enter().append("path").call(ut,this).attr("d",a?u=>c.pointRadius(a[u])(s[u]):u=>c(s[u])).call(vt,this,r)}).node()}};function uB({x:t,y:e}){if(t||e)return t??=n=>n,e??=n=>n,Ds({point(n,r){this.stream.point(t(n),e(r))}})}function Ry(t,e={}){return e.tip&&e.x===void 0&&e.y===void 0?e=Oy(e):e.geometry===void 0&&(e={...e,geometry:G}),new vp(t,e)}function PE({strokeWidth:t=1.5,...e}={}){return Ry({type:"Sphere"},{strokeWidth:t,...e})}function qE({strokeOpacity:t=.1,...e}={}){return Ry(gb(),{strokeOpacity:t,...e})}var cf=.5,ff=0;function BE(t={fill:"count"},{binWidth:e,...n}={}){let{z:r}=n;return e=e===void 0?20:Ct(e),t=Rw(t,n),Qr(t,"fill")&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol="hexagon"),n.r===void 0&&!Qr(t,"r")&&(n.r=e/2),jt(n,(o,i,s,a,c,f)=>{let{x:l,y:u,z:p,fill:h,stroke:d,symbol:m}=s;if(l===void 0)throw new Error("missing channel: x");if(u===void 0)throw new Error("missing channel: y");({x:l,y:u}=Kr(s,a,f)),p=p?p.value:ft(o,r),h=h?.value,d=d?.value,m=m?.value;let g=Fu(t,{z:p,fill:h,stroke:d,symbol:m}),y=p&&[],x=h&&[],w=d&&[],b=m&&[],_=[],v=[],A=[],T=-1;for(let k of t)k.initialize(o);for(let k of i){let O=[];for(let M of t)M.scope("facet",k);for(let[M,I]of Hr(k,g))for(let{index:C,extent:N}of pB(o,I,l,u,e)){O.push(++T),v.push(N.x),A.push(N.y),p&&y.push(g===p?M:p[C[0]]),h&&x.push(g===h?M:h[C[0]]),d&&w.push(g===d?M:d[C[0]]),m&&b.push(g===m?M:m[C[0]]);for(let L of t)L.reduce(C,N)}_.push(O)}let E=s.x.scale,$=s.y.scale,S={x:{value:v,source:a[E]?{value:Mt(v,a[E].invert),scale:E}:null},y:{value:A,source:a[$]?{value:Mt(A,a[$].invert),scale:$}:null},...p&&{z:{value:y}},...h&&{fill:{value:x,scale:"auto"}},...d&&{stroke:{value:w,scale:"auto"}},...m&&{symbol:{value:b,scale:"auto"}},...Object.fromEntries(t.map(({name:k,output:O})=>[k,{scale:"auto",label:O.label,radius:k==="r"?e/2:void 0,value:O.transform()}]))};return{data:o,facets:_,channels:S}})}function pB(t,e,n,r,o){let i=o*(1.5/Sw),s=new Map;for(let a of e){let c=n[a],f=r[a];if(isNaN(c)||isNaN(f))continue;let l=Math.round(f=(f-ff)/i),u=Math.round(c=(c-cf)/o-(l&1)/2),p=f-l;if(Math.abs(p)*3>1){let m=c-u,g=u+(c<u?-1:1)/2,y=l+(f<l?-1:1),x=c-g,w=f-y;m*m+p*p>x*x+w*w&&(u=g+(l&1?1:-1)/2,l=y)}let h=`${u},${l}`,d=s.get(h);d===void 0&&(d={index:[],extent:{data:t,x:(u+(l&1)/2)*o+cf,y:l*i+ff}},s.set(h,d)),d.index.push(a)}return s.values()}var hB={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function zE(t){return new _p(t)}var _p=class extends lt{constructor({binWidth:e=20,clip:n=!0,...r}={}){super(Oi,void 0,{clip:n,...r},hB),this.binWidth=Ct(e)}render(e,n,r,o,i){let{binWidth:s}=this,{marginTop:a,marginRight:c,marginBottom:f,marginLeft:l,width:u,height:p}=o,h=l-cf,d=u-c-cf,m=a-ff,g=p-f-ff,y=s/2,x=y*Aw,w=x/2,b=y*2,_=x*1.5,v=Math.floor(h/b),A=Math.ceil(d/b),T=Math.floor((m+w)/_),E=Math.ceil((g-w)/_)+1,$=`m0,${is(-x)}l${is(y)},${is(w)}v${is(x)}l${is(-y)},${is(w)}`,S=$;for(let k=T;k<E;++k)for(let O=v;O<A;++O)S+=`M${is(O*b+(k&1)*y)},${is(k*_)}${$}`;return ot("svg:g",i).datum(0).call(mt,this,o,i).call(pt,this,{},ee+cf,ee+ff).call(k=>k.append("path").call(ut,this).call(vt,this,r).attr("d",S)).node()}};function is(t){return Math.round(t*1e3)/1e3}var dB={ariaLabel:"image",fill:null,stroke:null};function mB(t){return/^\.*\//.test(t)}function gB(t){return/^(blob|data|file|http|https):/i.test(t)}function yB(t){return typeof t=="string"&&(mB(t)||gB(t))?[void 0,t]:[t,void 0]}var Mp=class extends lt{constructor(e,n={}){let{x:r,y:o,r:i,width:s,height:a,rotate:c,src:f,preserveAspectRatio:l,crossOrigin:u,frameAnchor:p,imageRendering:h}=n;i==null&&(i=void 0),i===void 0&&s===void 0&&a===void 0?s=a=16:s===void 0&&a!==void 0?s=a:a===void 0&&s!==void 0&&(a=s);let[d,m]=yB(f),[g,y]=Lt(i),[x,w]=Lt(s,y!==void 0?y*2:void 0),[b,_]=Lt(a,y!==void 0?y*2:void 0),[v,A]=Lt(c,0);super(e,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:g,scale:"r",filter:dn,optional:!0},width:{value:x,filter:dn,optional:!0},height:{value:b,filter:dn,optional:!0},rotate:{value:v,optional:!0},src:{value:d,optional:!0}},ap(n),dB),this.src=m,this.width=w,this.rotate=A,this.height=_,this.r=y,this.preserveAspectRatio=Xt(l,"xMidYMid"),this.crossOrigin=se(u),this.frameAnchor=Wr(p),this.imageRendering=Xt(h,"auto")}render(e,n,r,o,i){let{x:s,y:a}=n,{x:c,y:f,width:l,height:u,r:p,rotate:h,src:d}=r,{r:m,width:g,height:y,rotate:x}=this,[w,b]=ke(this,o);return ot("svg:g",i).call(mt,this,o,i).call(pt,this,{x:c&&s,y:f&&a}).call(_=>_.selectAll().data(e).enter().append("image").call(ut,this).attr("x",YE(c,l,p,w,g,m)).attr("y",YE(f,u,p,b,y,m)).attr("width",l?v=>l[v]:g!==void 0?g:p?v=>p[v]*2:m*2).attr("height",u?v=>u[v]:y!==void 0?y:p?v=>p[v]*2:m*2).attr("transform",h?v=>`rotate(${h[v]})`:x?`rotate(${x})`:null).attr("transform-origin",h||x?xr`${c?v=>c[v]:w}px ${f?v=>f[v]:b}px`:null).call(st,"href",d?v=>d[v]:this.src).call(st,"preserveAspectRatio",this.preserveAspectRatio).call(st,"crossorigin",this.crossOrigin).call(st,"image-rendering",this.imageRendering).call(st,"clip-path",p?v=>`circle(${p[v]}px)`:m!==void 0?`circle(${m}px)`:null).call(vt,this,r)).node()}};function YE(t,e,n,r,o,i){return e&&t?s=>t[s]-e[s]/2:e?s=>r-e[s]/2:t&&o!==void 0?s=>t[s]-o/2:o!==void 0?r-o/2:n&&t?s=>t[s]-n[s]:n?s=>r-n[s]:t?s=>t[s]-i:r-i}function UE(t,{x:e,y:n,...r}={}){return r.frameAnchor===void 0&&([e,n]=oe(e,n)),new Mp(t,{...r,x:e,y:n})}function xB(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,l,u,p,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,l=Math.sqrt(-2*Math.log(f)),h=(2.30753+l*.27061)/(1+l*(.99229+l*.04481))-l,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),l=Math.exp(e*a)/e,u=Math.exp(n*c)/n,g=l+u,t<l/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-lf(e)-lf(n)+lf(e+n);s<10;s++){if(h===0||h===1)return h;if(p=bB(h,e,n)-t,l=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),u=p/l,h-=l=u/(1-.5*Math.min(1,u*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+l)),h>=1&&(h=.5*(h+l+1)),Math.abs(l)<r*h&&s>0)break}return h}function bB(t,e,n){var r=t===0||t===1?0:Math.exp(lf(e+n)-lf(e)-lf(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?!1:t<(e+1)/(e+n+2)?r*jE(t,e,n)/e:1-r*jE(1-t,n,e)/n}function jE(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,l,u,p,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(l=2*o,u=o*(n-o)*t/((a+l)*(e+l)),f=1+u*f,Math.abs(f)<r&&(f=r),c=1+u/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,u=-(e+o)*(i+o)*t/((e+l)*(s+l)),f=1+u*f,Math.abs(f)<r&&(f=r),c=1+u/c,Math.abs(c)<r&&(c=r),f=1/f,p=f*c,h*=p,!(Math.abs(p-1)<3e-7));o++);return h}function lf(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function XE(t,e){var n=xB(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}var wB={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1},Ly=class extends lt{constructor(e,n={}){let{x:r,y:o,z:i,ci:s=.95,precision:a=4}=n;if(super(e,{x:{value:r,scale:"x"},y:{value:o,scale:"y"},z:{value:Ke(n),optional:!0}},n,wB),this.z=i,this.ci=+s,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${s}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(e,n,r,o,i){let{x:s,y:a,z:c}=r,{ci:f}=this;return ot("svg:g",i).call(mt,this,o,i).call(pt,this,n).call(l=>l.selectAll().data(c?Uu(e,c,this.z):[e]).enter().call(u=>u.append("path").attr("fill","none").call(ut,this).call(na,this,{...r,fill:null,fillOpacity:null}).attr("d",p=>this._renderLine(p,s,a)).call(f&&!Xo(this.fill)?p=>p.select(vB).attr("stroke","none").call(ut,this).call(na,this,{...r,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",h=>this._renderBand(h,s,a)):()=>{}))).node()}};function vB(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(sn.svg,"path"),this)}var Vv=class extends Ly{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=kt(e,l=>r[l]),c=Dy(e,r,n),f=WE(e,r,n,(1-o)/2,c);return xc().y(l=>l).x0(l=>f(l,-1)).x1(l=>f(l,1))(ie(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=kt(e,a=>r[a]),s=Dy(e,r,n);return`M${s(o)},${o}L${s(i)},${i}`}},Wv=class extends Ly{constructor(e,n){super(e,n)}_renderBand(e,n,r){let{ci:o,precision:i}=this,[s,a]=kt(e,l=>n[l]),c=Dy(e,n,r),f=WE(e,n,r,(1-o)/2,c);return xc().x(l=>l).y0(l=>f(l,-1)).y1(l=>f(l,1))(ie(s,a-i/2,i).concat(a))}_renderLine(e,n,r){let[o,i]=kt(e,a=>n[a]),s=Dy(e,n,r);return`M${o},${s(o)}L${i},${s(i)}`}};function GE(t,{y:e=Yt,x:n=G,stroke:r,fill:o=Rt(r)?"currentColor":r,...i}={}){return new Vv(t,tf({...i,x:n,y:e,fill:o,stroke:r}))}function VE(t,{x:e=Yt,y:n=G,stroke:r,fill:o=Rt(r)?"currentColor":r,...i}={}){return new Wv(t,Jc({...i,x:e,y:n,fill:o,stroke:r}))}function Dy(t,e,n){let r=0,o=0,i=0,s=0;for(let l of t){let u=e[l],p=n[l];r+=u,o+=p,i+=u*p,s+=u*u}let a=t.length,c=(a*i-r*o)/(a*s-r*r),f=(o-c*r)/a;return l=>c*l+f}function WE(t,e,n,r,o){let i=Pe(t,l=>e[l])/t.length,s=0,a=0;for(let l of t)s+=(e[l]-i)**2,a+=(n[l]-o(e[l]))**2;let c=Math.sqrt(a/(t.length-2)),f=XE(r,t.length-2);return(l,u)=>{let p=o(l),h=c*Math.sqrt(1/t.length+(l-i)**2/s);return p+u*f*h}}function Sp({path:t=G,delimiter:e,frameAnchor:n,treeLayout:r=Fs,treeSort:o,treeSeparation:i,treeAnchor:s,treeFilter:a,...c}={}){s=By(s),o=ZE(o),a!=null&&(a=Qv(a)),n===void 0&&(n=s.frameAnchor);let f=KE(e),l=iT(c,Qv),[u,p]=$e(),[h,d]=$e();return{x:u,y:h,frameAnchor:n,...me(c,(m,g)=>{let y=f(ft(m,t)),x=p([]),w=d([]),b=-1,_=[],v=[],A=Nm().path($=>y[$]),T=vn(m)?$=>$.data=m[$.data]:$=>$.data=m.get($.data),E=r();E.nodeSize&&E.nodeSize([1,1]),E.separation&&i!==void 0&&E.separation(i??ku);for(let $ of l)$[Py]=$[rT]([]);for(let $ of g){let S=[],k=A($.filter(O=>y[O]!=null)).each(T);o!=null&&k.sort(o),E(k);for(let O of k.descendants())if(!(a!=null&&!a(O))){S.push(++b),_[b]=O.data,s.position(O,b,x,w);for(let M of l)M[Py][b]=M[oT](O)}v.push(S)}return{data:_,facets:v}}),...Object.fromEntries(l)}}function qy({path:t=G,delimiter:e,curve:n="bump-x",stroke:r="#555",strokeWidth:o=1.5,strokeOpacity:i=.5,treeLayout:s=Fs,treeSort:a,treeSeparation:c,treeAnchor:f,treeFilter:l,...u}={}){f=By(f),a=ZE(a),l!=null&&(l=QE(l)),u={curve:n,stroke:r,strokeWidth:o,strokeOpacity:i,...u};let p=KE(e),h=iT(u,QE),[d,m]=$e(),[g,y]=$e(),[x,w]=$e(),[b,_]=$e();return{x1:d,x2:g,y1:x,y2:b,...me(u,(v,A)=>{let T=p(ft(v,t)),E=m([]),$=y([]),S=w([]),k=_([]),O=-1,M=[],I=[],C=Nm().path(L=>T[L]),N=s();N.nodeSize&&N.nodeSize([1,1]),N.separation&&c!==void 0&&N.separation(c??ku);for(let L of h)L[Py]=L[rT]([]);for(let L of A){let R=[],D=C(L.filter(F=>T[F]!=null)).each(F=>F.data=v[F.data]);a!=null&&D.sort(a),N(D);for(let{source:F,target:P}of D.links())if(!(l!=null&&!l(P,F))){R.push(++O),M[O]=P.data,f.position(F,O,E,S),f.position(P,O,$,k);for(let V of h)V[Py][O]=V[oT](P,F)}I.push(R)}return{data:M,facets:I}}),...Object.fromEntries(h)}}function By(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return _B;case"right":return MB}throw new Error(`invalid tree anchor: ${t}`)}var _B={frameAnchor:"left",dx:6,position({x:t,y:e},n,r,o){r[n]=e,o[n]=-t}},MB={frameAnchor:"right",dx:-6,position({x:t,y:e},n,r,o){r[n]=-e,o[n]=-t}};function ZE(t){return t==null||typeof t=="function"?t:`${t}`.trim().toLowerCase().startsWith("node:")?HE(Qv(t)):HE(SB(t))}function HE(t){return(e,n)=>Te(t(e),t(n))}function SB(t){return e=>e.data?.[t]}function KE(t="/"){if(t=`${t}`,t==="/")return n=>n;if(t.length!==1)throw new Error("delimiter must be exactly one character");let e=t.charCodeAt(0);return n=>n.map(r=>AB(r,e))}var Hv=92,JE=47;function AB(t,e){if(e===Hv)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,o=t.length;r<o;++r){switch(t.charCodeAt(r)){case Hv:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,r-1)+t.slice(r),--r,--o):t=t.slice(0,r)+"/"+t.slice(r+1);break;case JE:n?(t=t.slice(0,r)+"\\\\"+t.slice(r),r+=2,o+=2):(t=t.slice(0,r)+"\\"+t.slice(r),++r,++o);break}n=!1}return t}function EB(t){let e=!1;for(let n=0,r=t.length;n<r;++n){switch(t.charCodeAt(n)){case Hv:if(!e){e=!0;continue}case JE:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--r);break}e=!1}return t}function tT(t){return Ie(t)&&typeof t.node=="function"}function TB(t){return Ie(t)&&typeof t.link=="function"}function Qv(t){if(tT(t))return t.node;if(t=`${t}`.trim().toLowerCase(),!!t.startsWith("node:")){switch(t){case"node:name":return Kv;case"node:path":return Zv;case"node:internal":return eT;case"node:external":return nT;case"node:depth":return Jv;case"node:height":return t_}throw new Error(`invalid node value: ${t}`)}}function QE(t){if(tT(t))return t.node;if(TB(t))return t.link;if(t=`${t}`.trim().toLowerCase(),!(!t.startsWith("node:")&&!t.startsWith("parent:"))){switch(t){case"parent:name":return Fy(Kv);case"parent:path":return Fy(Zv);case"parent:depth":return Fy(Jv);case"parent:height":return Fy(t_);case"node:name":return Kv;case"node:path":return Zv;case"node:internal":return eT;case"node:external":return nT;case"node:depth":return Jv;case"node:height":return t_}throw new Error(`invalid link value: ${t}`)}}function Zv(t){return t.id}function Kv(t){return IB(t.id)}function Jv(t){return t.depth}function t_(t){return t.height}function eT(t){return!!t.children}function nT(t){return!t.children}function Fy(t){return(e,n)=>n==null?void 0:t(n)}function IB(t){let e=t.length;for(;--e>0&&!$B(t,e););return EB(t.slice(e+1))}function $B(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}var rT=2,oT=3,Py=4;function iT(t,e){let n=[];for(let r in t){let o=t[r],i=e(o);i!==void 0&&n.push([r,...$e(o),i])}return n}function e_(t,{fill:e,stroke:n,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,marker:l,markerStart:u=l,markerEnd:p=l,dot:h=Rt(u)&&Rt(p),text:d="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:y,dy:x,textAnchor:w,treeLayout:b=Fs,textLayout:_=b===Fs||b===Cm?"mirrored":"normal",tip:v,...A}={}){if(y===void 0&&(y=By(A.treeAnchor).dx),w!==void 0)throw new Error("textAnchor is not a configurable tree option");_=be(_,"textLayout",["mirrored","normal"]);function T(E){return to(t,Sp({treeLayout:b,text:d,fill:e===void 0?"currentColor":e,stroke:m,dx:y,dy:x,title:g,...E,...A}))}return ge(My(t,qy({treeLayout:b,markerStart:u,markerEnd:p,stroke:n!==void 0?n:e===void 0?"node:internal":e,strokeWidth:r,strokeOpacity:o,strokeLinejoin:i,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:c,strokeDashoffset:f,...A})),h?or(t,Sp({treeLayout:b,fill:e===void 0?"node:internal":e,title:g,tip:v,...A})):null,d!=null?_==="mirrored"?[T({textAnchor:"start",treeFilter:"node:external"}),T({textAnchor:"end",treeFilter:"node:internal",dx:-y})]:T():null)}function sT(t,e){return e_(t,{...e,treeLayout:Cm})}var cT={ariaLabel:"waffle"},Ap=class extends ua{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Qo(i,fT("x"))},cT),this.unit=Math.max(0,n),this.gap=+r,this.round=lT(o),this.multiple=uT(s)}},Ep=class extends pa{constructor(e,{unit:n=1,gap:r=1,round:o,render:i,multiple:s,...a}={}){super(e,{...a,render:Qo(i,fT("y"))},cT),this.unit=Math.max(0,n),this.gap=+r,this.round=lT(o),this.multiple=uT(s)}};function fT(t){return function(e,n,r,o,i){let{unit:s,gap:a,rx:c,ry:f,round:l}=this,{document:u}=i,p=r.channels[`${t}1`].value,h=r.channels[`${t}2`].value,d=this[t==="y"?"_width":"_height"](n,r,o),m=this[t==="y"?"_x":"_y"](n,r,o),g=s*CB(n.scales[t]),{multiple:y=Math.max(1,Math.floor(Math.sqrt(d/g)))}=this,x=Math.min(d/y,g*y),w=g*y,b=t==="y"?([S,k])=>[S*x,-k*w]:([S,k])=>[k*w,S*x],_=(d-y*x)/2,v=typeof m=="function"?S=>m(S)+_:m+_,A=n[t](0),T=g7(),E=u.createElementNS(sn.svg,"pattern");E.setAttribute("width",t==="y"?x:w),E.setAttribute("height",t==="y"?w:x),E.setAttribute("patternUnits","userSpaceOnUse");let $=E.appendChild(u.createElementNS(sn.svg,"rect"));return $.setAttribute("x",a/2),$.setAttribute("y",a/2),$.setAttribute("width",(t==="y"?x:w)-a),$.setAttribute("height",(t==="y"?w:x)-a),c!=null&&$.setAttribute("rx",c),f!=null&&$.setAttribute("ry",f),ot("svg:g",i).call(mt,this,o,i).call(this._transform,this,n).call(S=>S.selectAll().data(e).enter().append(()=>E.cloneNode(!0)).attr("id",k=>`${T}-${k}`).select("rect").call(ut,this).call(vt,this,r)).call(S=>S.selectAll().data(e).enter().append("path").attr("transform",t==="y"?xr`translate(${v},${A})`:xr`translate(${A},${v})`).attr("d",k=>`M${n_(l(p[k]/s),l(h[k]/s),y).map(b).join("L")}Z`).attr("fill",k=>`url(#${T}-${k})`).attr("stroke",this.stroke==null?null:k=>`url(#${T}-${k})`)).node()}}function n_(t,e,n){if(t<0||e<0){let r=Math.ceil(-Math.min(t,e)/n);return n_(t+r*n,e+r*n,n).map(([o,i])=>[o,i-r])}return e<t?n_(e,t,n):[[0,Math.ceil(t/n)],[Math.floor(t%n),Math.ceil(t/n)],[Math.floor(t%n),Math.floor(t/n)+t%1],[Math.ceil(t%n),Math.floor(t/n)+t%1],...t%n>n-1?[]:[[Math.ceil(t%n),Math.floor(t/n)],[n,Math.floor(t/n)]],[n,Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)+e%1],[Math.floor(e%n),Math.floor(e/n)+e%1],...e%n<1?[]:[[Math.floor(e%n),Math.ceil(e/n)],[0,Math.ceil(e/n)]]]}function lT(t){if(t===void 0||t===!1)return Number;if(t===!0)return Math.round;if(typeof t!="function")throw new Error(`invalid round: ${t}`);return t}function uT(t){return t===void 0?void 0:Math.max(1,Math.floor(t))}function CB({domain:t,range:e}){return aT(e)/aT(t)}function aT(t){let[e,n]=kt(t);return n-e}function pT(t,e={}){return Yo(e)||(e={...e,y:Yt,x2:G}),new Ap(t,Zi(Uc(Hi(e))))}function hT(t,e={}){return Yo(e)||(e={...e,x:Yt,y2:G}),new Ep(t,Ki(jc(Qi(e))))}var ST=R9(MT(),1);var PB=({marginLeft:t})=>[1,t],qB=({width:t,marginRight:e})=>[-1,t-e],BB=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],zB=({marginTop:t})=>[1,t],YB=({height:t,marginBottom:e})=>[-1,t-e],UB=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function AT(t){return typeof t=="string"?{anchor:t}:t}function ET(t={},e={}){arguments.length===1&&([t,e]=IT(t));let{anchor:n="left",padding:r=1,r:o=e.r}=AT(t);switch(`${n}`.toLowerCase()){case"left":n=PB;break;case"right":n=qB;break;case"middle":n=BB;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return $T("x","y",n,Ct(r),o,e)}function TT(t={},e={}){arguments.length===1&&([t,e]=IT(t));let{anchor:n="bottom",padding:r=1,r:o=e.r}=AT(t);switch(`${n}`.toLowerCase()){case"top":n=zB;break;case"bottom":n=YB;break;case"middle":n=UB;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return $T("y","x",n,Ct(r),o,e)}function IT(t){let{anchor:e,padding:n,...r}=t,{r:o}=r;return[{anchor:e,padding:n,r:o},r]}function $T(t,e,n,r,o,i){if(o!=null&&typeof o!="number"){let{channels:s,sort:a,reverse:c}=i;s=Ou(s),s?.r===void 0&&(i={...i,channels:{...s,r:{value:o,scale:"r"}}}),a===void 0&&c===void 0&&(i.sort={channel:"-r"})}return jt(i,function(s,a,c,f,l,u){let{[e]:p,r:h}=c;if(!c[e])throw new Error(`missing channel: ${e}`);({[e]:p}=Kr(c,f,u));let d=h?void 0:o!==void 0?Ct(o):this.r!==void 0?this.r:3;h&&(h=ft(h.value,f[h.scale]||G,Float64Array));let[m,g]=n(l),y=m?XB:jB,x=new Float64Array(p.length),w=h?b=>h[b]:()=>d;for(let b of a){let _=(0,ST.default)();b=b.filter(h?A=>Mc(p[A])&&dn(h[A]):A=>Mc(p[A]));let v=new Float64Array(2*b.length+2);for(let A of b){let T=w(A),E=m?T+r:0,$=p[A]-T,S=p[A]+T,k=2;_.queryInterval($-r,S+r,([,,M])=>{let I=x[M]-E,C=p[A]-p[M],N=r+(h?h[A]+h[M]:2*d),L=Math.sqrt(N*N-C*C);v[k++]=I-L,v[k++]=I+L});let O=v.slice(0,k);m&&(O=O.filter(M=>M>=0));t:for(let M of O.sort(y)){for(let I=0;I<k;I+=2)if(v[I]+1e-6<M&&M<v[I+1]-1e-6)continue t;x[A]=M+E;break}_.insert([$,S,A])}}m||(m=1);for(let b of a)for(let _ of b)x[_]=x[_]*m+g;return{data:s,facets:a,channels:{[t]:{value:x,source:null},[e]:{value:p,source:c[e]},...h&&{r:{value:h,source:c.r}}}}})}function jB(t,e){return Math.abs(t)-Math.abs(e)}function XB(t,e){return t-e}function kT(t,e){return arguments.length===1&&({basis:t,...e}=t),rf(Uy(t),e)}function NT(t,e){return arguments.length===1&&({basis:t,...e}=t),of(Uy(t),e)}function Uy(t){if(t===void 0)return CT;if(typeof t=="function")return jy(Ic(t));if(/^p\d{2}$/i.test(t))return df(Tc(t));switch(`${t}`.toLowerCase()){case"deviation":return WB;case"first":return CT;case"last":return VB;case"max":return HB;case"mean":return QB;case"median":return ZB;case"min":return KB;case"sum":return JB;case"extent":return GB}throw new Error(`invalid basis: ${t}`)}function jy(t){return{mapIndex(e,n,r){let o=+t(e,n);for(let i of e)r[i]=n[i]===null?NaN:n[i]/o}}}function df(t){return jy((e,n)=>t(e,r=>n[r]))}var GB={mapIndex(t,e,n){let[r,o]=kt(t,s=>e[s]),i=o-r;for(let s of t)n[s]=e[s]===null?NaN:(e[s]-r)/i}},CT=jy((t,e)=>{for(let n=0;n<t.length;++n){let r=e[t[n]];if(Ht(r))return r}}),VB=jy((t,e)=>{for(let n=t.length-1;n>=0;--n){let r=e[t[n]];if(Ht(r))return r}}),WB={mapIndex(t,e,n){let r=wo(t,i=>e[i]),o=Xn(t,i=>e[i]);for(let i of t)n[i]=e[i]===null?NaN:o?(e[i]-r)/o:0}},HB=df(Tt),QB=df(wo),ZB=df(ur),KB=df(Ft),JB=df(Pe);function OT(t,e){return LT("x",t,e)}function RT(t,e){return LT("y",t,e)}function LT(t,e,n={}){let r,o=1;if(typeof e=="number")o=e,r=(f,l)=>+f+l;else{if(typeof e=="string"){let f=e.startsWith("-")?-1:1;[e,o]=wg(e.replace(/^[+-]/,"")),o*=f}e=Cc(e),r=(f,l)=>e.offset(f,l)}let i=`${t}1`,s=`${t}2`,a=_n({[i]:f=>f.map(l=>r(l,o)),[s]:f=>f},n),c=a[s].transform;return a[s].transform=()=>{let f=c(),[l,u]=kt(f);return f.domain=o<0?[l,r(u,o)]:[r(l,o),u],f},a}function DT(t,e={}){if(typeof t=="string")switch(t.toLowerCase()){case"first":return $p(e);case"last":return Cp(e)}if(typeof t=="function")return ss(null,t,e);let n,r;for(n in t){if(r!==void 0)throw new Error("ambiguous selector; multiple inputs");r=tz(t[n])}if(r===void 0)throw new Error(`invalid selector: ${t}`);return ss(n,r,e)}function tz(t){if(typeof t=="function")return t;switch(`${t}`.toLowerCase()){case"min":return c_;case"max":return f_}throw new Error(`unknown selector: ${t}`)}function $p(t){return ss(null,ez,t)}function Cp(t){return ss(null,nz,t)}function Xy(t){return ss("x",c_,t)}function Gy(t){return ss("y",c_,t)}function Vy(t){return ss("x",f_,t)}function Wy(t){return ss("y",f_,t)}function*ez(t){yield t[0]}function*nz(t){yield t[t.length-1]}function*c_(t,e){yield dd(t,n=>e[n])}function*f_(t,e){yield ws(t,n=>e[n])}function ss(t,e,n){if(t!=null){if(n[t]==null)throw new Error(`missing channel: ${t}`);t=n[t]}let r=Ke(n);return me(n,(o,i)=>{let s=ft(o,r),a=ft(o,t),c=[];for(let f of i){let l=[];for(let u of s?De(f,p=>s[p]).values():[f])for(let p of e(u,a))l.push(p);c.push(l)}return{data:o,facets:c}})}lt.prototype.plot=function({marks:t=[],...e}={}){return Kc({...e,marks:[...t,this]})};var rz=new Map([["style","style"],["width","width"],["height","height"],["margin","margin"],["marginLeft","marginLeft"],["marginRight","marginRight"],["marginTop","marginTop"],["marginBottom","marginBottom"],["align","align"],["aspectRatio","aspectRatio"],["axis","axis"],["inset","inset"],["grid","grid"],["label","label"],["padding","padding"],["xScale","x.type"],["xDomain","x.domain"],["xRange","x.range"],["xNice","x.nice"],["xInset","x.inset"],["xInsetLeft","x.insetLeft"],["xInsetRight","x.insetRight"],["xClamp","x.clamp"],["xRound","x.round"],["xAlign","x.align"],["xPadding","x.padding"],["xPaddingInner","x.paddingInner"],["xPaddingOuter","x.paddingOuter"],["xAxis","x.axis"],["xTicks","x.ticks"],["xTickSize","x.tickSize"],["xTickSpacing","x.tickSpacing"],["xTickPadding","x.tickPadding"],["xTickFormat","x.tickFormat"],["xTickRotate","x.tickRotate"],["xGrid","x.grid"],["xLine","x.line"],["xLabel","x.label"],["xLabelAnchor","x.labelAnchor"],["xLabelArrow","x.labelArrow"],["xLabelOffset","x.labelOffset"],["xFontVariant","x.fontVariant"],["xAriaLabel","x.ariaLabel"],["xAriaDescription","x.ariaDescription"],["xPercent","x.percent"],["xReverse","x.reverse"],["xZero","x.zero"],["xBase","x.base"],["xExponent","x.exponent"],["xConstant","x.constant"],["yScale","y.type"],["yDomain","y.domain"],["yRange","y.range"],["yNice","y.nice"],["yInset","y.inset"],["yInsetTop","y.insetTop"],["yInsetBottom","y.insetBottom"],["yClamp","y.clamp"],["yRound","y.round"],["yAlign","y.align"],["yPadding","y.padding"],["yPaddingInner","y.paddingInner"],["yPaddingOuter","y.paddingOuter"],["yAxis","y.axis"],["yTicks","y.ticks"],["yTickSize","y.tickSize"],["yTickSpacing","y.tickSpacing"],["yTickPadding","y.tickPadding"],["yTickFormat","y.tickFormat"],["yTickRotate","y.tickRotate"],["yGrid","y.grid"],["yLine","y.line"],["yLabel","y.label"],["yLabelAnchor","y.labelAnchor"],["yLabelArrow","y.labelArrow"],["yLabelOffset","y.labelOffset"],["yFontVariant","y.fontVariant"],["yAriaLabel","y.ariaLabel"],["yAriaDescription","y.ariaDescription"],["yPercent","y.percent"],["yReverse","y.reverse"],["yZero","y.zero"],["yBase","y.base"],["yExponent","y.exponent"],["yConstant","y.constant"],["facetMargin","facet.margin"],["facetMarginTop","facet.marginTop"],["facetMarginBottom","facet.marginBottom"],["facetMarginLeft","facet.marginLeft"],["facetMarginRight","facet.marginRight"],["facetGrid","facet.grid"],["facetLabel","facet.label"],["fxDomain","fx.domain"],["fxRange","fx.range"],["fxInset","fx.inset"],["fxInsetLeft","fx.insetLeft"],["fxInsetRight","fx.insetRight"],["fxRound","fx.round"],["fxAlign","fx.align"],["fxPadding","fx.padding"],["fxPaddingInner","fx.paddingInner"],["fxPaddingOuter","fx.paddingOuter"],["fxAxis","fx.axis"],["fxTicks","fx.ticks"],["fxTickSize","fx.tickSize"],["fxTickSpacing","fx.tickSpacing"],["fxTickPadding","fx.tickPadding"],["fxTickFormat","fx.tickFormat"],["fxTickRotate","fx.tickRotate"],["fxGrid","fx.grid"],["fxLine","fx.line"],["fxLabel","fx.label"],["fxLabelAnchor","fx.labelAnchor"],["fxLabelOffset","fx.labelOffset"],["fxFontVariant","fx.fontVariant"],["fxAriaLabel","fx.ariaLabel"],["fxAriaDescription","fx.ariaDescription"],["fxReverse","fx.reverse"],["fyDomain","fy.domain"],["fyRange","fy.range"],["fyInset","fy,inset"],["fyInsetTop","fy.insetTop"],["fyInsetBottom","fy.insetBottom"],["fyRound","fy.round"],["fyAlign","fy.align"],["fyPadding","fy.padding"],["fyPaddingInner","fy.paddingInner"],["fyPaddingOuter","fy.paddingOuter"],["fyAxis","fy.axis"],["fyTicks","fy.ticks"],["fyTickSize","fy.tickSize"],["fyTickSpacing","fy.tickSpacing"],["fyTickPadding","fy.tickPadding"],["fyTickFormat","fy.tickFormat"],["fyTickRotate","fy.tickRotate"],["fyGrid","fy.grid"],["fyLine","fy.line"],["fyLabel","fy.label"],["fyLabelAnchor","fy.labelAnchor"],["fyLabelOffset","fy.labelOffset"],["fyFontVariant","fy.fontVariant"],["fyAriaLabel","fy.ariaLabel"],["fyAriaDescription","fy.ariaDescription"],["fyReverse","fy.reverse"],["colorScale","color.type"],["colorDomain","color.domain"],["colorRange","color.range"],["colorClamp","color.clamp"],["colorN","color.n"],["colorNice","color.nice"],["colorScheme","color.scheme"],["colorInterpolate","color.interpolate"],["colorPivot","color.pivot"],["colorSymmetric","color.symmetric"],["colorLabel","color.label"],["colorPercent","color.percent"],["colorReverse","color.reverse"],["colorZero","color.zero"],["colorTickFormat","color.tickFormat"],["colorBase","color.base"],["colorExponent","color.exponent"],["colorConstant","color.constant"],["opacityScale","opacity.type"],["opacityDomain","opacity.domain"],["opacityRange","opacity.range"],["opacityClamp","opacity.clamp"],["opacityNice","opacity.nice"],["opacityLabel","opacity.label"],["opacityPercent","opacity.percent"],["opacityReverse","opacity.reverse"],["opacityZero","opacity.zero"],["opacityTickFormat","opacity.tickFormat"],["opacityBase","opacity.base"],["opacityExponent","opacity.exponent"],["opacityConstant","opacity.constant"],["symbolScale","symbol.type"],["symbolDomain","symbol.domain"],["symbolRange","symbol.range"],["rScale","r.type"],["rDomain","r.domain"],["rRange","r.range"],["rClamp","r.clamp"],["rNice","r.nice"],["rLabel","r.label"],["rPercent","r.percent"],["rZero","r.zero"],["rBase","r.base"],["rExponent","r.exponent"],["rConstant","r.constant"],["lengthScale","length.type"],["lengthDomain","length.domain"],["lengthRange","length.range"],["lengthClamp","length.clamp"],["lengthNice","length.nice"],["lengthPercent","length.percent"],["lengthZero","length.zero"],["lengthBase","length.base"],["lengthExponent","length.exponent"],["lengthConstant","length.constant"],["projectionType","projection.type"],["projectionParallels","projection.parallels"],["projectionPrecision","projection.precision"],["projectionRotate","projection.rotate"],["projectionDomain","projection.domain"],["projectionInset","projection.inset"],["projectionInsetLeft","projection.insetLeft"],["projectionInsetRight","projection.insetRight"],["projectionInsetTop","projection.insetTop"],["projectionInsetBottom","projection.insetBottom"],["projectionClip","projection.clip"]]);function oz(t,e,n){for(let r=0;r<e.length;++r){let o=e[r];r===e.length-1?t[o]=n:t=t[o]||(t[o]={})}}function FT(t,e,n){for(let r in t){let o=rz.get(r);if(o==null)throw new Error(`Unrecognized plot attribute: ${r}`);let i=t[r];typeof i=="symbol"?n.push(r):i!==void 0&&oz(e,o.split("."),i)}}var iz=new Set(["frame","hexgrid","sphere","graticule"]),sz=new Map([["first",$p],["last",Cp],["maxX",Vy],["maxY",Wy],["minX",Xy],["minY",Gy],["nearest",Gi],["nearestX",Vi],["nearestXY",Zo]]);async function qT(t){let e={marks:[]},n=[],{attributes:r,marks:o}=t;FT(r,e,n);let i=[];for(let a of o)for(let{type:c,data:f,options:l}of a.plotSpecs()){let{select:u,...p}=l,h=sz.get(u)?.(p)??p,d=iz.has(c)?[h]:[f,h];e.marks.push(l_[c](...d)),i.push(a.index)}cz(e,t);let s=Kc(e);fz(s,i),az(t,s,r,n);for(let a of t.interactors)await a.init(s);return s}function az(t,e,n,r){r.forEach(o=>{let i=n[o];if(i===oi){if(!o.endsWith("Domain"))throw new Error(`Unsupported fixed attribute: ${o}`);let s=o.slice(0,-6),a=e.scale(s);a?.domain&&t.setAttribute(o,n[`${s}Reverse`]?a.domain.slice().reverse():a.domain)}else throw new Error(`Unrecognized symbol: ${i}`)})}function cz(t,e){let{marks:n}=e;Hy("x",t,n),Hy("y",t,n),Hy("fx",t,n),Hy("fy",t,n)}function Hy(t,e,n){let r=e[t]||{};if(r.axis===null||r.label!==void 0)return;let o=n.map(f=>f.channelField(t)?.field);if(o.every(f=>f==null))return;let i,s,a;for(let f=0;f<o.length;++f){let{column:l,label:u}=o[f]||{};l===void 0&&u===void 0||(i===void 0&&s===void 0?(i=l,s=u,a=lz(n[f].data,t)||"number"):s!==u?s=void 0:i!==l&&(i=void 0))}let c=s||i;if(c!==void 0){if((a==="number"||a==="date")&&(t==="x"||t==="y")){r.percent&&(c=`${c} (%)`);let f=(t==="x"?1:-1)*(r.reverse?-1:1);t==="x"||r.labelAnchor==="center"?c=t==="x"==f<0?`\u2190 ${c}`:`${c} \u2192`:c=`${f<0?"\u2191 ":"\u2193 "}${c}`}e[t]={...r,label:c}}}function fz(t,e){let n=t.querySelectorAll('g[aria-label="facet"]');if(n.length)for(let r of n)PT(r,e);else PT(t,e)}function PT(t,e){let n=-1;for(let r of t.children){let o=r.getAttribute("aria-label")||"";r.nodeName==="style"||o.includes("-axis")||o.includes("-grid")||r.setAttribute("data-index",e[++n])}}function lz(t,e){if(!t)return;let{columns:n}=t,r=n[e]??n[e+"1"]??n[e+"2"];if(r){for(let o of r)if(o!=null)return o instanceof Date?"date":typeof o}}var uz={width:640,marginLeft:40,marginRight:20,marginTop:20,marginBottom:30},u_=class{constructor(e){this.attributes={...uz},this.listeners=null,this.interactors=[],this.legends=[],this.marks=[],this.markset=null,this.element=e||document.createElement("div"),this.element.setAttribute("class","plot"),this.element.style.display="flex",this.element.value=this,this.params=new Map,this.synch=ix()}margins(){return{left:this.getAttribute("marginLeft"),top:this.getAttribute("marginTop"),bottom:this.getAttribute("marginBottom"),right:this.getAttribute("marginRight")}}innerWidth(){let{left:e,right:n}=this.margins();return this.getAttribute("width")-e-n}innerHeight(e=400){let{top:n,bottom:r}=this.margins(),o=this.getAttribute("height");return o==null&&(o=pz(this,n,r)||e,this.setAttribute("height",o,{silent:!0})),o-n-r}pending(e){this.synch.pending(e)}update(e){return this.synch.ready(e)&&!this.pendingRender&&(this.pendingRender=!0,requestAnimationFrame(()=>this.render())),this.synch.promise}async render(){this.pendingRender=!1;let e=await qT(this),n=this.legends.flatMap(({legend:r,include:o})=>{let i=r.init(e);return o?i:[]});this.element.replaceChildren(e,...n),this.synch.resolve()}getAttribute(e){return this.attributes[e]}setAttribute(e,n,r){return Yf(this.attributes[e],n)?(n===void 0?delete this.attributes[e]:this.attributes[e]=n,r?.silent||this.listeners?.get(e)?.forEach(o=>o(e,n)),!0):!1}addAttributeListener(e,n){let r=this.listeners||(this.listeners=new Map);return r.has(e)||r.set(e,new Set),r.get(e).add(n),this}removeAttributeListener(e,n){return this.listeners?.get(e)?.delete(n)}addParams(e,n){let{params:r}=this;for(let o of n)r.has(o)?r.get(o).push(e):(r.set(o,[e]),o.addEventListener("value",()=>Promise.allSettled(r.get(o).map(i=>i.initialize()))))}addMark(e){return e.setPlot(this,this.marks.length),this.marks.push(e),this.markset=null,this}get markSet(){return this.markset||(this.markset=new Set(this.marks))}addInteractor(e){return this.interactors.push(e),this}addLegend(e,n=!0){e.setPlot(this),this.legends.push({legend:e,include:n})}};function pz(t,e,n){let r=t.getAttribute("aspectRatio");if(r==null)return;let o=t.getAttribute("xDomain"),i=t.getAttribute("yDomain");if(!o||!i)return;let s=Math.abs(o[1]-o[0]);return Math.abs(i[1]-i[0])*t.innerWidth()/(r*s)+e+n}function Qy(t){return typeof t!="string"?!1:(t=t.toLowerCase().trim(),t==="none"||t==="currentcolor"||t.startsWith("url(")&&t.endsWith(")")||t.startsWith("var(")&&t.endsWith(")")||Tn(t)!==null)}var hz=new Set(["order","sort","label","anchor","curve","tension","marker","markerStart","markerMid","markerEnd","textAnchor","lineAnchor","lineHeight","textOverflow","monospace","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","frameAnchor","strokeLinejoin","strokeLinecap","strokeMiterlimit","strokeDasharray","strokeDashoffset","mixBlendMode","shapeRendering","imageRendering","preserveAspectRatio","interpolate","crossOrigin","paintOrder","pointerEvents","target","select"]);function BT(t){return hz.has(t)}var dz=new Set(["asterisk","circle","cross","diamond","diamond2","hexagon","plus","square","square2","star","times","triangle","triangle2","wye"]);function zT(t){return dz.has(`${t}`.toLowerCase())}var YT=t=>t==="stroke"||t==="fill",mz=t=>/opacity$/i.test(t),gz=t=>t==="symbol",yz=(t,e)=>t!=="sort"&&t!=="tip"&&e!=null&&!Array.isArray(e),p_=(t,e)=>({channel:t,field:e,as:e instanceof bn?e.column:t}),h_=(t,e)=>({channel:t,value:e}),Zy=t=>Array.isArray(t),Ue=class extends wf{constructor(e,n,r,o={}){super(n?.options?.filterBy),this.type=e,this.reqs=o,this.source=n,Zy(this.source)&&(this.data=jn(this.source));let i=this.channels=[],s=this.detail=new Set,a=this.params=new Set,c=(f,l)=>{let u=typeof l;if(f==="channels")for(let p in l)s.add(p),c(p,l[p]);else if(u==="function"&&l[xf]){let p=l(this,f);for(let h in p)c(h,p[h])}else if(u==="string")BT(f)||YT(f)&&Qy(l)||gz(f)&&zT(l)?i.push(h_(f,l)):i.push(p_(f,qh(l)));else if(mo(l))if(Array.isArray(l.columns))i.push(p_(f,l)),a.add(l);else{let p=h_(f,l.value);i.push(p),l.addEventListener("value",h=>(p.value=h,this.update()))}else u==="object"&&yz(f,l)?i.push(p_(f,l)):l!==void 0&&i.push(h_(f,l))};for(let f in r)c(f,r[f])}setPlot(e,n){this.plot=e,this.index=n,e.addParams(this,this.params),this.source?.table&&this.queryPending()}hasOwnData(){return this.source==null||Zy(this.source)}hasFieldInfo(){return!!this._fieldInfo}channel(e){return this.channels.find(n=>n.channel===e)}channelField(e,{exact:n=!1}={}){let r=n?this.channel(e):this.channels.find(o=>o.channel.startsWith(e));return r?.field?r:null}fields(){if(this.hasOwnData())return null;let{source:{table:e},channels:n,reqs:r}=this,o=new Map;for(let{channel:i,field:s}of n){if(!s)continue;let a=s.stats?.stats||[],c=s.stats?.column??s,f=o.get(c)??o.set(c,new Set).get(c);a.forEach(l=>f.add(l)),r[i]?.forEach(l=>f.add(l))}return Array.from(o,([i,s])=>({table:e,column:i,stats:s}))}fieldInfo(e){let n=Object.fromEntries(e.map(r=>[r.column,r]));for(let r of this.channels){let{field:o}=r;o&&Object.assign(r,n[o.stats?.column??o])}return this._fieldInfo=!0,this}query(e=[]){if(this.hasOwnData())return null;let{channels:n,source:{table:r}}=this;return kp(n,r).where(e)}queryPending(){return this.plot.pending(this),this}queryResult(e){return this.data=jn(e),this}update(){return this.plot.update(this)}plotSpecs(){let{type:e,data:n,detail:r,channels:o}=this;return d_(e,r,o,n)}};function tn(t,e){let n=e?.[t.as]??t.as;return Object.hasOwn(t,"value")?t.value:YT(t.channel)?{value:n,scale:"color"}:mz(t.channel)?{value:n,scale:"opacity"}:n}function kp(t,e,n=[]){let r=yt.from({source:e}),o=new Set,i=!1;for(let s of t){let{channel:a,field:c,as:f}=s;if(!n.includes(a)){if(a==="orderby")r.orderby(s.value);else if(c){if(c.aggregate)i=!0;else{if(o.has(f))continue;o.add(f)}r.select({[f]:c})}}}return i&&r.groupby(Array.from(o)),r}function d_(t,e,n,r,o={}){let{numRows:i,values:s,columns:a}=r??{},c={};for(let u of n){let p=e.has(u.channel)?c:o;p[u.channel]=tn(u,a)}return e.size&&(o.channels=c),[{type:t,data:s??(r?{length:i}:null),options:o}]}function xa(t,e){let{plot:n}=t,r=n.getAttribute(`${e}Scale`);if(!r){let{type:i}=t.channelField(e);r=i==="date"?"time":"linear"}let o={type:r};switch(r){case"log":o.base=n.getAttribute(`${e}Base`)??10;break;case"pow":o.exponent=n.getAttribute(`${e}Exponent`)??1;break;case"symlog":o.constant=n.getAttribute(`${e}Constant`)??1;break}return Bf(o)}function qn(t,e,n,r,o=1,i){let{field:s}=t.channelField(e);i=i??s;let{type:a,apply:c,sqlApply:f}=xa(t,e),l=!!t.plot.getAttribute(`${e}Reverse`),[u,p]=r.map(x=>c(x)),h=f(i),d=a==="time"||a==="utc"?h:i,m=p===u?0:(n-o)/(p-u),g=m!==1?` * ${m}::DOUBLE`:"";return[l?Y`(${p} - ${h}::DOUBLE)${g}`:Y`(${h}::DOUBLE - ${u})${g}`,d]}var m_={x:["min","max"]},g_={y:["min","max"]},Ky={...m_,...g_};function UT(t,e,n,r,o){let{plot:i}=t,s=i.getAttribute(r),a=i.getAttribute(o);if(Array.isArray(s)&&!s[Ne])return s;{let{column:c,min:f,max:l}=t.channelField(n),u=y_(e,c)||(a?Co().domain([f,l]).nice().domain():[f,l]);return s!==oi&&(u[Ne]=!0),i.setAttribute(r,u,{silent:!0}),u}}function io(t,e){return UT(t,e,"x","xDomain","xNice")}function so(t,e){return UT(t,e,"y","yDomain","yNice")}function y_(t,e){if(!t)return;let n,r,o=(i,s)=>{if(i==="BETWEEN"&&`${s.field}`===e){let{range:a}=s;a&&(n==null||a[0]<n)&&(n=a[0]),a&&(r==null||a[1]>r)&&(r=a[1])}};return Array.isArray(t)?t.forEach(i=>i.visit?.(o)):t.visit&&t.visit(o),n!=null&&r!=null&&n!==r?[n,r]:void 0}var x_=class extends Ue{constructor(e,n,r){let o=e.endsWith("X")?"y":e.endsWith("Y")?"x":null,i=o?{[o]:["min","max"]}:void 0;super(e,n,r,i),this.dim=o}query(e=[]){let{plot:n,dim:r,source:o}=this,{optimize:i=!0}=o.options||{},s=super.query(e);if(!r)return s;let a=r==="x"?"y":"x",c=this.channelField(a,{exact:!0})?.as,{field:f,as:l,type:u,min:p,max:h}=this.channelField(r);if(i&&(u==="date"||u==="number")&&c){let m=r==="x"?n.innerWidth():n.innerHeight(),[g,y]=y_(e,f)||[p,h],[x]=qn(this,r,m,[g,y],1,l),w=s.select().map(b=>b.as).filter(b=>b!==l&&b!==c);return xz(s,x,l,c,w)}else return s.orderby(f)}};function xz(t,e,n,r,o=[]){let i=Y`FLOOR(${e})::INTEGER`,s=a=>yt.from(t).select(a).groupby(i,o);return yt.union(s([{[n]:ui(n),[r]:Uh(r,n)},...o]),s([{[n]:li(n),[r]:jh(r,n)},...o]),s([{[n]:Uh(n,r),[r]:ui(r)},...o]),s([{[n]:jh(n,r),[r]:li(r)},...o])).orderby(o,n)}function jT(t,e=[]){return new e.constructor(t)}function XT(t,e,n){let r=jT(t,n),o=n.length;for(let i=0;i<o;++i)r[e[i]]=n[i];return r}function GT(t,e,n,r,o,i,s){let a=n.length,c=t*e,f=o.map(h=>r[h]),l={},u=[],p=new Int32Array(a);if(i?.length){let h=i.map(m=>r[m]),d={};for(let m=0;m<a;++m){let g=h.map(y=>y[m]);p[m]=d[g]??=u.push(g)-1}for(let m=0;m<i.length;++m)l[i[m]]=u.map(g=>g[m])}else u.push([]);if(s){let h=n.map(g=>g%t),d=n.map(g=>Math.floor(g/t)),m=u.map(()=>[]);for(let g=0;g<a;++g)m[p[g]].push(g);o.forEach((g,y)=>{let x=f[y];l[g]=u.map((w,b)=>s(m[b],t,e,h,d,x))})}else o.forEach((h,d)=>{let m=f[d],g=l[h]=u.map(()=>jT(c,m));for(let y=0;y<a;++y)g[p[y]][n[y]]=m[y]});return{numRows:u.length,columns:l}}function Np(t){let e=1/0,n=-1/0;return t.forEach(r=>{let o=r.length;for(let i=0;i<o;++i){let s=r[i];s<e&&(e=s),s>n&&(n=s)}}),Number.isFinite(e)&&Number.isFinite(n)?[e,n]:[0,1]}function VT(t){let e=new rn;return t.forEach(n=>{let r=n.length;for(let o=0;o<r;++o)e.add(n[o])}),Array.from(e).sort(ht)}function ae(t,e){return $a(t)?(t.addEventListener("value",e),t.value):t}function Op(t,e=!1){let n=new Float64Array(5),r=new Float64Array(4);bz(n,r,t);let o=Float64Array.of(0,r[1]-n[1]*r[0],r[2]-n[2]*r[0],r[3]-n[3]*r[0],-n[4]*r[0]),i=1+n[1]+n[2]+n[3]+n[4],s=(r[0]+r[1]+r[2]+r[3])/i,a=(o[1]+o[2]+o[3]+o[4])/i;return{sigma:t,negative:e,a:n,b_causal:r,b_anticausal:o,sum_causal:s,sum_anticausal:a}}function bz(t,e,n){let o=Float64Array.of(.84,1.8675,.84,-1.8675,-.34015,-.1299,-.34015,.1299),i=Math.exp(-1.783/n),s=Math.exp(-1.723/n),a=.6318/n,c=1.997/n,f=Float64Array.of(-i*Math.cos(a),i*Math.sin(a),-i*Math.cos(-a),i*Math.sin(-a),-s*Math.cos(c),s*Math.sin(c),-s*Math.cos(-c),s*Math.sin(-c)),l=n*2.5066282746310007,u=Float64Array.of(o[0],o[1],0,0,0,0,0,0),p=Float64Array.of(1,0,f[0],f[1],0,0,0,0,0,0),h,d;for(d=2;d<8;d+=2){for(u[d]=f[d]*u[d-2]-f[d+1]*u[d-1],u[d+1]=f[d]*u[d-1]+f[d+1]*u[d-2],h=d-2;h>0;h-=2)u[h]+=f[d]*u[h-2]-f[d+1]*u[h-1],u[h+1]+=f[d]*u[h-1]+f[d+1]*u[h-2];for(h=0;h<=d;h+=2)u[h]+=o[d]*p[h]-o[d+1]*p[h+1],u[h+1]+=o[d]*p[h+1]+o[d+1]*p[h];for(p[d+2]=f[d]*p[d]-f[d+1]*p[d+1],p[d+3]=f[d]*p[d+1]+f[d+1]*p[d],h=d;h>0;h-=2)p[h]+=f[d]*p[h-2]-f[d+1]*p[h-1],p[h+1]+=f[d]*p[h-1]+f[d+1]*p[h-2]}for(d=0;d<4;++d)h=d<<1,e[d]=u[h]/l,t[d+1]=p[h+2]}function WT(t,e,n,[r,o]){let i=new Float64Array(Math.max(r,o)),s=new Float64Array(Math.max(r,o)),a=new Float64Array(5),c=new Float64Array(n.length);for(let f=0,l=0;f<o;++f,l+=r){let u=c.subarray(l);Jy(t,n.subarray(l),r,1,i,s,a,u)}for(let f=0;f<r;++f){let l=c.subarray(f);Jy(e,l,o,r,i,s,a,l)}return c}function Jy(t,e,n,r=1,o=new Float64Array(n),i=new Float64Array(n),s=new Float64Array(5),a=o,c=wz){let f=r*2,l=r*3,u=r*4,p=r*n,h,d;for(c(o,e,n,r,t.b_causal,3,t.a,4,t.sum_causal,s,t.sigma),d=4,h=u;d<n;++d,h+=r)o[d]=t.b_causal[0]*e[h]+t.b_causal[1]*e[h-r]+t.b_causal[2]*e[h-f]+t.b_causal[3]*e[h-l]-t.a[1]*o[d-1]-t.a[2]*o[d-2]-t.a[3]*o[d-3]-t.a[4]*o[d-4];for(c(i,e,n,-r,t.b_anticausal,4,t.a,4,t.sum_anticausal,s,t.sigma),d=4,h=p-r*5;d<n;++d,h-=r)i[d]=t.b_anticausal[1]*e[h+r]+t.b_anticausal[2]*e[h+f]+t.b_anticausal[3]*e[h+l]+t.b_anticausal[4]*e[h+u]-t.a[1]*i[d-1]-t.a[2]*i[d-2]-t.a[3]*i[d-3]-t.a[4]*i[d-4];if(t.negative)for(d=0,h=0;d<n;++d,h+=r)a[h]=o[d]+i[n-d-1];else for(d=0,h=0;d<n;++d,h+=r)a[h]=Math.max(0,o[d]+i[n-d-1]);return a}function wz(t,e,n,r,o,i,s,a,c,f,l,u=.5){let p=Math.abs(r)*n,h=r<0?p+r:0,d,m,g;for(m=0;m<=a;++m)for(f[m]=m<=i?o[m]:0,g=1;g<=a&&g<=m;++g)f[m]-=s[g]*f[m-g];for(g=0;g<a;++g)for(t[g]=0,m=1;m<=g;++m)d=h+r*m,d>=0&&d<p&&(t[g]+=f[g-m]*e[d]);let y=e[h],x=Math.ceil(l*10);for(m=0;m<x;++m){for(g=0;g<a;++g)t[g]+=f[g]*y;if(c-=Math.abs(f[0]),c<=u)break;for(f[a]=m+a<=i?o[m+a]:0,g=1;g<=a;++g)f[a]-=s[g]*f[a-g];for(g=0;g<a;++g)f[g]=f[g+1]}}var ri="density",br=class extends Ue{constructor(e,n,r){let{bandwidth:o=0,interpolate:i="none",pixelSize:s=1,pad:a=1,width:c,height:f,...l}=r,u=vz(l);super(e,n,l,Ky),this.densityMap=u,this.bandwidth=ae(o,p=>(this.bandwidth=p,this.grids?this.convolve().update():null)),this.interpolate=ae(i,p=>(this.interpolate=p,this.requestUpdate())),this.pixelSize=ae(s,p=>(this.pixelSize=p,this.requestUpdate())),this.pad=ae(a,p=>(this.pad=p,this.requestUpdate())),this.width=ae(c,p=>(this.width=p,this.requestUpdate())),this.height=ae(f,p=>(this.height=p,this.requestUpdate()))}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.requestUpdate()};e.addAttributeListener("xDomain",r),e.addAttributeListener("yDomain",r),super.setPlot(e,n)}get filterIndexable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ne]&&!n[Ne]}query(e=[]){let{interpolate:n,pad:r,channels:o,densityMap:i,source:s}=this,[a,c]=this.extentX=io(this,e),[f,l]=this.extentY=so(this,e),[u,p]=this.bins=this.binDimensions(),[h,d]=qn(this,"x",u,[a,c],r),[m,g]=qn(this,"y",p,[f,l],r),y=r?[_e(d,[+a,+c]),_e(g,[+f,+l])]:[ms(+a,d),ds(d,+c),ms(+f,g),ds(g,+l)],x=yt.from(s.table).where(e.concat(y)),w=this.groupby=[],b={};for(let v of o)if(Object.hasOwn(v,"field")){let{as:A,channel:T,field:E}=v;E.aggregate?(b[T]=E,i[T]=!0):T==="weight"?b[ri]=ar(E):T!=="x"&&T!=="y"&&(x.select({[A]:E}),w.push(A))}let _=this.aggr=Object.keys(b);if(b.density&&_.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(_.length||(_.push(ri),b.density=En()),n==="linear"){if(_.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b.density)throw new Error("Linear binning not applicable to custom aggregates.");return Sz(x,h,m,b[ri],u,w)}else return Mz(x,h,m,b,u,w)}binDimensions(){let{plot:e,pixelSize:n,width:r,height:o}=this;return[r??Math.round(e.innerWidth()/n),o??Math.round(e.innerHeight()/n)]}queryResult(e){let[n,r]=this.bins,o=_z(this.interpolate),{columns:i}=jn(e);return this.grids0=GT(n,r,i.index,i,this.aggr,this.groupby,o),this.convolve()}convolve(){let{aggr:e,bandwidth:n,bins:r,grids0:o,plot:i}=this;if(this.grids=o,n>0){let s=e.length===1?e[0]:e.includes(ri)?ri:null;if(!s)return console.warn("No compatible grid found for smoothing."),this;let a=o.columns[s],c=i.innerWidth(),f=i.innerHeight(),[l,u]=r,p=a.some(m=>m.some(g=>g<0)),h=Op(n*(l-1)/c,p),d=Op(n*(u-1)/f,p);this.grids={numRows:o.numRows,columns:{...o.columns,[s]:a.map(m=>WT(h,d,m,r))}}}return this}};function vz(t){let e={};for(let n in t)t[n]==="density"&&(delete t[n],e[n]=!0);return e}function _z(t="none"){if(typeof t=="function")return t;switch(t.toLowerCase()){case"none":case"linear":return;case"nearest":return mp;case"barycentric":return dp();case"random-walk":return gp()}throw new Error(`invalid interpolate: ${t}`)}function Mz(t,e,n,r,o,i){return t.select({index:Y`FLOOR(${e})::INTEGER + FLOOR(${n})::INTEGER * ${o}`,...r}).groupby("index",i)}function Sz(t,e,n,r,o,i){let s=r?.column?`* ${r.column}`:"",a=(p,h)=>t.clone().select({xp:e,yp:n,i:p,w:h}),c=a(Y`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${o}`,Y`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(Y`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${o}`,Y`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),l=a(Y`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${o}`,Y`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),u=a(Y`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${o}`,Y`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,f,l,u)).select({index:"i",density:ar("w")},i).groupby("index",i).having(Ff("density",0))}var b_=class extends br{constructor(e,n){let{thresholds:r=10,...o}=n;super("geo",e,{bandwidth:20,interpolate:"linear",pixelSize:2,...o}),this.thresholds=ae(r,i=>(this.thresholds=i,this.grids?this.contours().update():null))}convolve(){return super.convolve().contours()}contours(){let{bins:e,densityMap:n,grids:r,thresholds:o,plot:i}=this,{numRows:s,columns:a}=r,c=o,f;if(Array.isArray(c))f=c;else{let[,S]=Np(a.density);f=Array.from({length:c-1},(k,O)=>S*(O+1)/c)}(n.fill||n.stroke)&&this.plot.getAttribute("colorScale")!=="log"&&this.plot.setAttribute("colorZero",!0);let[l,u]=e,[p,h]=i.getAttribute("xDomain"),[d,m]=i.getAttribute("yDomain"),g=(h-p)/l,y=(m-d)/u,x=+p,w=+d,b=S=>x+S*g,_=S=>w+S*y,v=vi().size(e),A=this.contourData=Array(s*f.length),{density:T,...E}=a,$=Object.entries(E);for(let S=0,k=0;S<s;++S){let O=T[S],M=$.reduce((I,[C,N])=>(I[C]=N[S],I),{});for(let I=0;I<f.length;++I,++k)A[k]=Object.assign(Az(v.contour(O,f[I]),b,_),M)}return this}plotSpecs(){let{type:e,channels:n,densityMap:r,contourData:o}=this,i={};for(let s of n){let{channel:a}=s;a!=="x"&&a!=="y"&&(i[a]=tn(s))}for(let s in r)r[s]&&(i[s]=tn({channel:s,as:"value"}));return[{type:e,data:o,options:i}]}};function Az(t,e,n){function r(s){s.forEach(o)}function o(s){s.forEach(i)}function i(s){s[0]=e(s[0]),s[1]=n(s[1])}return t.coordinates.forEach(r),t}function Rp(t){return Array.from({length:t},(e,n)=>n)}function t1(t,e){let n=e.reduce((o,i,s)=>(o[i]=s,o),{}),r=Rp(t.length);return r.sort((o,i)=>n[t[o]]-n[t[i]]),r}function e1(t,e){if(typeof document<"u"){let n=document.createElement("canvas");return n.setAttribute("width",t),n.setAttribute("height",e),n}throw new Error("Can not create a canvas instance.")}function HT(t=1){let e=255*t|0;return(n,r,o)=>{for(let i=0,s=0;i<o;++i)for(let a=0;a<r;++a,s+=4)n[s+3]=e}}function QT(t){let{apply:e}=t;return(n,r,o,i)=>{for(let s=0,a=0;s<o;++s)for(let c=0,f=(o-s-1)*r;c<r;++c,a+=4)n[a+3]=255*e(i[c+f])|0}}function ZT(t={}){let{r:e=0,g:n=0,b:r=0,opacity:o=1}=typeof t=="string"?ye(t):t,i=new Uint8ClampedArray([e,n,r,255*o|0]);return(s,a,c)=>{for(let f=0,l=0;f<c;++f)for(let u=0;u<a;++u,l+=4)s[l+0]=i[0],s[l+1]=i[1],s[l+2]=i[2],s[l+3]=i[3]}}function KT(t){let{domain:e,range:n}=t,r=Object.create(null),o=new Uint8ClampedArray(4*e.length),i=e.length-1,s=n.length;for(let a=0;a<=i;++a){let c=n[a%s],{r:f,g:l,b:u,opacity:p=1}=typeof c=="string"?ye(c):c,h=a<<2;o[h+0]=f,o[h+1]=l,o[h+2]=u,o[h+3]=255*p|0,r[e[a]]=h}return(a,c,f,l)=>{if(l.map)for(let u=0,p=0;u<f;++u)for(let h=0,d=(f-u-1)*c;h<c;++h,p+=4){let m=r[l[h+d]];a[p+0]=o[m+0],a[p+1]=o[m+1],a[p+2]=o[m+2],a[p+3]=o[m+3]}else{let u=r[l];for(let p=0,h=0;p<f;++p)for(let d=0;d<c;++d,h+=4)a[h+0]=o[u+0],a[h+1]=o[u+1],a[h+2]=o[u+2],a[h+3]=o[u+3]}}}function JT(t,e,n){let{interpolate:r}=e,o=new Uint8ClampedArray(4*t),i=t-1;for(let s=0;s<=i;++s){let a=r(s/i),{r:c,g:f,b:l,opacity:u=1}=typeof a=="string"?ye(a):a,p=s<<2;o[p+0]=c,o[p+1]=f,o[p+2]=l,o[p+3]=255*u|0}return(s,a,c,f)=>{for(let l=0,u=0;l<c;++l)for(let p=0,h=(c-l-1)*a;p<a;++p,u+=4){let d=i*n(f[p+h])<<2;s[u+0]=o[d+0],s[u+1]=o[d+1],s[u+2]=o[d+2],s[u+3]=o[d+3]}}}var mf=class extends br{constructor(e,n){super("image",e,n),this.image=null}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=$z(this,r,o),{alpha:l,alphaProp:u,color:p,colorProp:h}=v_(this),d=s[u]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?t1(m,this.plot.getAttribute("colorDomain")):Rp(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(p?.(f.data,r,o,m[g[x]]),l?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}},w_=class extends mf{constructor(e,n){super(e,{bandwidth:20,interpolate:"linear",pixelSize:2,...n})}};function v_(t){let{aggr:e,densityMap:n,groupby:r,plot:o}=t,i=e.includes(ri),s=e.includes("fillOpacity"),a=t.channel("fill"),c=t.channel("fillOpacity");if(e.length>2||i&&s)throw new Error("Invalid raster encodings. Try dropping an aggregate?");if(r.includes(c?.as))throw new Error("Raster fillOpacity must be an aggregate or constant.");let f=n.fill||e.includes("fill")?"grid":r.includes(a?.as)?"group":Qy(a?.value)?a.value:i&&o.getAttribute("colorScheme")?"grid":void 0,l=n.fillOpacity||e.includes("fillOpacity")?"grid":typeof c?.value=="number"?c.value:i&&f!=="grid"?"grid":void 0;if(f!=="grid"&&l!=="grid")throw new Error("Raster mark missing density values.");let u=a?.as??(f==="grid"?ri:null),p=c?.as??(l==="grid"?ri:null),h=f!=="grid"&&f!=="group"?ZT(f):Tz(t,u),d=l!=="grid"?HT(l):Ez(t,p);return{alphaProp:p,colorProp:u,alpha:d,color:h}}function Ez(t,e){let{plot:n,grids:r}=t,o=n.getAttribute("opacityDomain"),i=o===oi,s=o?.[Ne],a=!i&&!s&&o||Np(r.columns[e]);(i||s||!o)&&(i||(a[Ne]=!0),n.setAttribute("opacityDomain",a));let c=zi({opacity:{type:n.getAttribute("opacityScale"),domain:a,clamp:n.getAttribute("opacityClamp"),nice:n.getAttribute("opacityNice"),reverse:n.getAttribute("opacityReverse"),zero:n.getAttribute("opacityZero"),base:n.getAttribute("opacityBase"),exponent:n.getAttribute("opacityExponent"),constant:n.getAttribute("opacityConstant")}});return QT(c)}function Tz(t,e){let{plot:n,grids:r}=t,o=r.columns[e],i=!o[0]?.map,s=i||Array.isArray(o[0]),a=n.getAttribute("colorDomain"),c=a===oi,f=a?.[Ne],l=!c&&!f&&a||(i?o.slice().sort(ht):s?VT(o):Np(o));(c||f||!a)&&(c||(l[Ne]=!0),n.setAttribute("colorDomain",l));let u=zi({color:{type:n.getAttribute("colorScale"),domain:l,range:n.getAttribute("colorRange"),clamp:n.getAttribute("colorClamp"),n:n.getAttribute("colorN"),nice:n.getAttribute("colorNice"),reverse:n.getAttribute("colorReverse"),scheme:n.getAttribute("colorScheme"),interpolate:n.getAttribute("colorInterpolate"),pivot:n.getAttribute("colorPivot"),symmetric:n.getAttribute("colorSymmetric"),zero:n.getAttribute("colorZero"),base:n.getAttribute("colorBase"),exponent:n.getAttribute("colorExponent"),constant:n.getAttribute("colorConstant")}});if(s)return KT(u);{let p=zi({x:{type:Iz(u.type),domain:u.domain,reverse:u.reverse,range:[0,1],clamp:u.clamp,base:u.base,exponent:u.exponent,constant:u.constant}});return JT(1024,u,p.apply)}}function Iz(t){return t.endsWith("symlog")?"symlog":t.endsWith("log")?"log":t.endsWith("pow")?"pow":t.endsWith("sqrt")?"sqrt":t==="diverging"?"linear":t}function $z(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=e1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}var __=class extends mf{constructor(e,n){let{normalize:r=!0,...o}=n;super(e,o),this.normalize=ae(r,i=>(this.normalize=i,this.requestUpdate()))}query(e=[]){let{channels:n,normalize:r,source:o,pad:i}=this,[s,a]=this.bins=this.binDimensions(),[c]=qn(this,"x",s,io(this,e),i),[f]=qn(this,"y",a,so(this,e),i),l=yt.from(o.table).where(Cz(this,e));this.aggr=["density"];let u=this.groupby=[],p=[];for(let h of n)if(Object.hasOwn(h,"field")){let{channel:d,field:m}=h;d==="z"?(l.select({[d]:m}),p.push("z")):d!=="x"&&d!=="y"&&(l.select({[d]:m}),u.push(d))}return kz(l,c,f,p,s,a,u,r)}};function Cz(t,e){if(Array.isArray(e)&&!e.length)return e;let{column:n}=t.channelField("x"),{column:r}=t.channelField("y"),o=s=>{let a=`${s.field}`;return s.op!=="BETWEEN"||a!==n&&a!==r},i=s=>s.op==="AND"?Un(s.children.filter(a=>o(a))):s;return Array.isArray(e)?e.filter(s=>o(s)).map(s=>i(s)):i(e)}function kz(t,e,n,r,o,i,s=[],a=!0){t.select({x:Y`FLOOR(${e})::INTEGER`,y:Y`FLOOR(${n})::INTEGER`});let c=s.concat(r),f=c.length?`PARTITION BY ${c.join(", ")} `:"",l=yt.from(t).select(c,{x0:"x",y0:"y",dx:Y`(lead(x) OVER sw - x)`,dy:Y`(lead(y) OVER sw - y)`}).window({sw:Y`${f}ORDER BY x ASC`}).qualify(Un(Y`(x0 < ${o} OR x0 + dx < ${o})`,Y`(y0 < ${i} OR y0 + dy < ${i})`,Y`(x0 > 0 OR x0 + dx > 0)`,Y`(y0 > 0 OR y0 + dy > 0)`)),u=yt.select({x:Y`GREATEST(MAX(ABS(dx)), MAX(ABS(dy)))`}).from("pairs"),p=yt.select({i:Y`UNNEST(range((${u})))::INTEGER`}),h=yt.unionAll(yt.select(c,{x:Y`x0 + i`,y:Y`y0 + ROUND(i * dy / dx::FLOAT)::INTEGER`}).from("pairs","indices").where(Y`ABS(dy) <= ABS(dx) AND i < ABS(dx)`),yt.select(c,{x:Y`x0 + ROUND(SIGN(dy) * i * dx / dy::FLOAT)::INTEGER`,y:Y`y0 + SIGN(dy) * i`}).from("pairs","indices").where(Y`ABS(dy) > ABS(dx) AND i < ABS(dy)`),yt.select(c,{x:"x0",y:"y0"}).from("pairs").where(Df("dx"))),d=["x"].concat(c).join(", "),m=yt.from("raster").select(c,"x","y",a?{w:Y`1.0 / COUNT(*) OVER (PARTITION BY ${d})`}:null).where(Un(_e("x",[0,o],!0),_e("y",[0,i],!0)));return yt.with({pairs:l,indices:p,raster:h,points:m}).from("points").select(s,{index:Y`x + y * ${o}::INTEGER`,density:a?ar("w"):En()}).groupby("index",s)}var M_=class extends Ue{constructor(e,n,r){let{bins:o=1024,bandwidth:i=20,...s}=r,a=e.endsWith("X")?"y":"x";super(e,n,s,a==="x"?m_:g_),this.dim=a,this.bins=ae(o,c=>(this.bins=c,this.requestUpdate())),this.bandwidth=ae(i,c=>(this.bandwidth=c,this.grid?this.convolve().update():null))}get filterIndexable(){let e=this.dim==="x"?"xDomain":"yDomain",n=this.plot.getAttribute(e);return n&&!n[Ne]}query(e=[]){if(this.hasOwnData())throw new Error("Density1DMark requires a data source");let{bins:n,channels:r,dim:o,source:{table:i}}=this,s=this.extent=(o==="x"?io:so)(this,e),[a,c]=qn(this,o,n,s),f=kp(r,i,[o]).where(e.concat(_e(c,s))),l=this.channelField("weight")?"weight":null;return Nz(f,a,l)}queryResult(e){let{columns:{index:n,density:r}}=jn(e);return this.grid=XT(this.bins,n,r),this.convolve()}convolve(){let{bins:e,bandwidth:n,dim:r,grid:o,plot:i,extent:[s,a]}=this,c=o.some(w=>w<0),f=r==="x"?i.innerWidth():i.innerHeight(),l=Op(n*(e-1)/f,c),u=Jy(l,o,e),p=r==="x"?"y":"x",h=this.channelField(r).as,d=+s,m=(a-d)/(e-1),g=1/m,y=new Float64Array(e),x=new Float64Array(e);for(let w=0;w<e;++w)y[w]=d+w*m,x[w]=u[w]*g;return this.data={numRows:e,columns:{[h]:y,[p]:x}},this}plotSpecs(){let{type:e,data:{numRows:n,columns:r},channels:o,dim:i}=this,s=i==="x"?{y:r.y}:{x:r.x};for(let a of o)s[a.channel]=tn(a,r);return[{type:e,data:{length:n},options:s}]}};function Nz(t,e,n){let r=n?`* ${n}`:"",o=t.clone().select({p:e,i:Y`FLOOR(p)::INTEGER`,w:Y`(FLOOR(p) + 1 - p)${r}`}),i=t.clone().select({p:e,i:Y`FLOOR(p)::INTEGER + 1`,w:Y`(p - FLOOR(p))${r}`});return yt.from(yt.unionAll(o,i)).select({index:"i",density:ar("w")}).groupby("index").having(L1("density",0))}var S_=class extends br{constructor(e,n){let{type:r="dot",...o}=n;super(r,e,{bandwidth:20,interpolate:"linear",pad:0,pixelSize:2,...o})}convolve(){super.convolve();let{bins:e,pad:n,extentX:r,extentY:o}=this,[i,s]=e,a=xa(this,"x"),c=xa(this,"y"),[f,l]=r.map(g=>a.apply(g)),[u,p]=o.map(g=>c.apply(g)),h=(l-f)/(i-n),d=(p-u)/(s-n),m=n?0:.5;return this.data=Oz(this.grids,e,f,u,h,d,a.invert,c.invert,m),this}plotSpecs(){let{type:e,channels:n,densityMap:r,data:{numRows:o,columns:i}}=this,s={};for(let a of n){let{channel:c}=a;s[c]=c==="x"||c==="y"?i[c]:tn(a,i)}for(let a in r)r[a]&&(s[a]=i.density);return[{type:e,data:{length:o},options:s}]}};function Oz(t,e,n,r,o,i,s,a,c){let f=1/(o*i),[l,u]=e,p=l*u,h=p*t.numRows,d=new Float64Array(h),m=new Float64Array(h),g=new Float64Array(h),y={x:d,y:m,density:g},{density:x,...w}=t.columns;for(let _ in w)y[_]=new w[_].constructor(h);let b=0;for(let _=0;_<t.numRows;++_){for(let A in w)y[A].fill(w[A][_],b,b+p);let v=x[_];for(let A=0,T=0;T<u;++T)for(let E=0;E<l;++E,++b,++A)d[b]=s(n+(E+c)*o),m[b]=a(r+(T+c)*i),g[b]=v[A]*f}return{numRows:h,columns:y}}function Rz(t,e,n){var r=1e-8,o=e-1,i=n-1,s=0,a,c,f,l,u,p,h,d,m,g,y;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(f=t<.5?t:1-t,l=Math.sqrt(-2*Math.log(f)),h=(2.30753+l*.27061)/(1+l*(.99229+l*.04481))-l,t<.5&&(h=-h),d=(h*h-3)/6,m=2/(1/(2*e-1)+1/(2*n-1)),g=h*Math.sqrt(d+m)/m-(1/(2*n-1)-1/(2*e-1))*(d+5/6-2/(3*m)),h=e/(e+n*Math.exp(2*g))):(a=Math.log(e/(e+n)),c=Math.log(n/(e+n)),l=Math.exp(e*a)/e,u=Math.exp(n*c)/n,g=l+u,t<l/g?h=Math.pow(e*g*t,1/e):h=1-Math.pow(n*g*(1-t),1/n)),y=-gf(e)-gf(n)+gf(e+n);s<10;s++){if(h===0||h===1)return h;if(p=Lz(h,e,n)-t,l=Math.exp(o*Math.log(h)+i*Math.log(1-h)+y),u=p/l,h-=l=u/(1-.5*Math.min(1,u*(o/h-i/(1-h)))),h<=0&&(h=.5*(h+l)),h>=1&&(h=.5*(h+l+1)),Math.abs(l)<r*h&&s>0)break}return h}function Lz(t,e,n){var r=t===0||t===1?0:Math.exp(gf(e+n)-gf(e)-gf(n)+e*Math.log(t)+n*Math.log(1-t));return t<0||t>1?0:t<(e+1)/(e+n+2)?r*t9(t,e,n)/e:1-r*t9(1-t,n,e)/n}function t9(t,e,n){var r=1e-30,o=1,i=e+n,s=e+1,a=e-1,c=1,f=1-i*t/s,l,u,p,h;for(Math.abs(f)<r&&(f=r),f=1/f,h=f;o<=100&&(l=2*o,u=o*(n-o)*t/((a+l)*(e+l)),f=1+u*f,Math.abs(f)<r&&(f=r),c=1+u/c,Math.abs(c)<r&&(c=r),f=1/f,h*=f*c,u=-(e+o)*(i+o)*t/((e+l)*(s+l)),f=1+u*f,Math.abs(f)<r&&(f=r),c=1+u/c,Math.abs(c)<r&&(c=r),f=1/f,p=f*c,h*=p,!(Math.abs(p-1)<3e-7));o++);return h}function gf(t){var e=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,o,i,s;for(s=(i=o=t)+5.5,s-=(o+.5)*Math.log(s);e<6;e++)r+=n[e]/++i;return Math.log(2.506628274631*r/o)-s}function e9(t,e){var n=Rz(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}function n9(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}var A_=class extends Ue{constructor(e,n,r){let o=e.endsWith("X")?"y":"x",{ci:i=.95,...s}=r;super(e,n,s),this.dim=o,this.field=this.channelField(o).field,this.channels=this.channels.filter(a=>a.channel!==o),this.ci=ae(i,a=>(this.ci=a,this.update()))}query(e=[]){let{channels:n,field:r,source:{table:o}}=this,i=n.concat([{field:F1(r),as:"__avg__"},{field:En(r),as:"__n__"},{field:P1(r),as:"__sd__"}]);return kp(i,o).where(e)}queryResult(e){return this.data=jn(e),this}plotSpecs(){let{type:e,dim:n,detail:r,data:o,ci:i,channels:s}=this,a=Math.SQRT2*n9(i),{columns:{__avg__:c,__sd__:f,__n__:l}}=o,u={[`${n}1`]:c.map((p,h)=>p-a*f[h]/Math.sqrt(l[h])),[`${n}2`]:c.map((p,h)=>p+a*f[h]/Math.sqrt(l[h]))};return d_(e,r,s,o,u)}};var Dz="geom",E_=class extends Ue{constructor(e,n={},r){!Zy(e)&&!n?.geometry&&(n.geometry=V1(Dz)),super("geo",e,n,r)}queryResult(e){super.queryResult(e);let n=this.channelField("geometry")?.as;if(n){let{columns:r}=this.data;typeof r[n][0]=="string"&&(r[n]=r[n].map(o=>JSON.parse(o)))}return this}};var T_=class extends Ue{constructor(e,n){let{type:r="hexagon",binWidth:o=20,...i}=n;super(r,e,{r:o/2,clip:!0,...i},Ky),this.binWidth=ae(o,s=>(this.binWidth=s,this.requestUpdate()))}get filterIndexable(){let e=this.plot.getAttribute("xDomain"),n=this.plot.getAttribute("yDomain");return e&&n&&!e[Ne]&&!n[Ne]}query(e=[]){if(this.hasOwnData())return null;let{plot:n,binWidth:r,channels:o,source:i}=this,s,a,c=new Set,f={};for(let b of o)if(b.channel!=="orderby"){if(b.channel==="x")s=b;else if(b.channel==="y")a=b;else if(Object.hasOwn(b,"field")){let{as:_,field:v}=b;f[_]=v,v.aggregate||c.add(_)}}let[l,u]=io(this,e),[p,h]=so(this,e),d=.5-n.getAttribute("marginLeft"),m=0-n.getAttribute("marginTop"),g=`${r}::DOUBLE`,y=`${r*(1.5/Math.sqrt(3))}::DOUBLE`,x=`${n.innerWidth()/(u-l)}::DOUBLE`,w=`${n.innerHeight()/(h-p)}::DOUBLE`;return yt.select({[s.as]:Y`${l}::DOUBLE + ((_x + 0.5 * (_y & 1)) * ${g} + ${d})::DOUBLE / ${x}`,[a.as]:Y`${h}::DOUBLE - (_y * ${y} + ${m})::DOUBLE / ${w}`,...f}).groupby("_x","_y",...c).from(yt.select({_py:Y`(${w} * (${h}::DOUBLE - ${a.field}) - ${m}) / ${y}`,_pj:Y`ROUND(_py)::INTEGER`,_px:Y`(${x} * (${s.field} - ${l}::DOUBLE) - ${d}) / ${g} - 0.5 * (_pj & 1)`,_pi:Y`ROUND(_px)::INTEGER`,_tt:Y`ABS(_py-_pj) * 3 > 1 AND (_px-_pi)**2 + (_py-_pj)**2 > (_px - _pi - 0.5 * CASE WHEN _px < _pi THEN -1 ELSE 1 END)**2 + (_py - _pj - CASE WHEN _py < _pj THEN -1 ELSE 1 END)**2`,_x:Y`CASE WHEN _tt THEN (_pi + (CASE WHEN _px < _pi THEN -0.5 ELSE 0.5 END) + (CASE WHEN _pj & 1 <> 0 THEN 0.5 ELSE -0.5 END))::INTEGER ELSE _pi END`,_y:Y`CASE WHEN _tt THEN (_pj + CASE WHEN _py < _pj THEN -1 ELSE 1 END)::INTEGER ELSE _pj END`},"*").from(i.table).where(hs(s.field),hs(a.field),e))}};var I_=class extends br{constructor(e,n){let{origin:r=[0,0],dim:o="xy",...i}=n;super("image",e,i),this.image=null,this.origin=r,this.tileX=o.toLowerCase().includes("x"),this.tileY=o.toLowerCase().includes("y")}setPlot(e,n){let r=()=>{this.hasFieldInfo()&&this.rasterize()};e.addAttributeListener("schemeColor",r),super.setPlot(e,n)}requestQuery(){return this.requestTiles()}query(e=[]){return this._filter=e,null}tileQuery(e){let{interpolate:n,pad:r,channels:o,densityMap:i,source:s}=this,[[a,c],[f,l]]=e,[u,p]=this.bins,[h,d]=qn(this,"x",u,[a,c],r),[m,g]=qn(this,"y",p,[f,l],r),y=r?[_e(d,[+a,+c]),_e(g,[+f,+l])]:[ms(+a,d),ds(d,+c),ms(+f,g),ds(g,+l)],x=yt.from(s.table).where(y),w=this.groupby=[],b={};for(let v of o)if(Object.hasOwn(v,"field")){let{as:A,channel:T,field:E}=v;E.aggregate?(b[T]=E,i[T]=!0):T==="weight"?b.density=ar(E):T!=="x"&&T!=="y"&&(x.select({[A]:E}),w.push(A))}let _=this.aggr=Object.keys(b);if(b.density&&_.length>1)throw new Error("Weight option can not be used with custom aggregates.");if(_.length||(_.push("density"),b.density=En()),n==="linear"){if(_.length>1)throw new Error("Linear binning not applicable to multiple aggregates.");if(!b.density)throw new Error("Linear binning not applicable to custom aggregates.");return zz(x,h,m,b.density,u,w)}else return Bz(x,h,m,b,u,w)}async requestTiles(){let e=J1();this.prefetch&&e.cancel(this.prefetch);let{pad:n,tileX:r,tileY:o,origin:[i,s]}=this,[a,c]=this.bins=this.binDimensions(),[f,l]=io(this,this._filter),[u,p]=so(this,this._filter),h=l-f,d=p-u,m=Math.floor((f-i)*(a-n)/h),g=Math.floor((u-s)*(c-n)/d),y=(S,k)=>[[i+S*h,i+(S+1)*h],[s+k*d,s+(k+1)*d]],x=Math.floor((f-i)/h),w=r?r9((l-i)/h):x,b=Math.floor((u-s)/d),_=o?r9((p-s)/d):b,v=[];for(let S=x;S<=w;++S)for(let k=b;k<=_;++k)v.push([S,k]);let A=v.map(([S,k])=>e.query(this.tileQuery(y(S,k)))),T=[];if(r)for(let S=b;S<=_;++S)T.push([w+1,S]),T.push([x-1,S]);if(o){let S=r?x-1:x,k=r?w+1:w;for(let O=S;O<=k;++O)T.push([O,_+1]),T.push([O,b-1])}this.prefetch=T.map(([S,k])=>e.prefetch(this.tileQuery(y(S,k))));let E=await Promise.all(A),$=Fz(a,c,m,g,v,E);this.grids0={numRows:$.length,columns:{density:[$]}},this.convolve().update()}convolve(){return super.convolve().rasterize()}rasterize(){let{bins:e,grids:n}=this,[r,o]=e,{numRows:i,columns:s}=n,{canvas:a,ctx:c,img:f}=qz(this,r,o),{alpha:l,alphaProp:u,color:p,colorProp:h}=v_(this),d=s[u]??[],m=s[h]??[],g=i>1&&h&&this.groupby?.includes(h)?t1(m,this.plot.getAttribute("colorDomain")):Rp(i);return this.data={numRows:i,columns:{src:Array.from({length:i},(y,x)=>(p?.(f.data,r,o,m[g[x]]),l?.(f.data,r,o,d[g[x]]),c.putImageData(f,0,0),a.toDataURL()))}},this}plotSpecs(){let{type:e,plot:n,data:{numRows:r,columns:o}}=this,i={src:o.src,width:n.innerWidth(),height:n.innerHeight(),preserveAspectRatio:"none",imageRendering:this.channel("imageRendering")?.value,frameAnchor:"middle"};return[{type:e,data:{length:r},options:i}]}};function Fz(t,e,n,r,o,i){let s=new Float64Array(t*e);return i.forEach((a,c)=>{let[f,l]=o[c],u=f*t-n,p=l*e-r;Pz(t,e,s,a,u,p)}),s}function Pz(t,e,n,r,o,i){let s=r.numRows;if(s===0)return;let a=r.getChild("index").toArray(),c=r.getChild("density").toArray();for(let f=0;f<s;++f){let l=a[f],u=o+l%t,p=i+Math.floor(l/t);0<=u&&u<t&&0<=p&&p<e&&(n[u+p*t]=c[f])}}function qz(t,e,n){if(!t.image||t.image.w!==e||t.image.h!==n){let r=e1(e,n),o=r.getContext("2d",{willReadFrequently:!0}),i=o.getImageData(0,0,e,n);t.image={canvas:r,ctx:o,img:i,w:e,h:n}}return t.image}function Bz(t,e,n,r,o,i){return t.select({index:Y`FLOOR(${e})::INTEGER + FLOOR(${n})::INTEGER * ${o}`,...r}).groupby("index",i)}function zz(t,e,n,r,o,i){let s=r.column?`* ${r.column}`:"",a=(p,h)=>t.clone().select({xp:e,yp:n,i:p,w:h}),c=a(Y`FLOOR(xp)::INTEGER + FLOOR(yp)::INTEGER * ${o}`,Y`(FLOOR(xp)::INTEGER + 1 - xp) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),f=a(Y`FLOOR(xp)::INTEGER + (FLOOR(yp)::INTEGER + 1) * ${o}`,Y`(FLOOR(xp)::INTEGER + 1 - xp) * (yp - FLOOR(yp)::INTEGER)${s}`),l=a(Y`FLOOR(xp)::INTEGER + 1 + FLOOR(yp)::INTEGER * ${o}`,Y`(xp - FLOOR(xp)::INTEGER) * (FLOOR(yp)::INTEGER + 1 - yp)${s}`),u=a(Y`FLOOR(xp)::INTEGER + 1 + (FLOOR(yp)::INTEGER + 1) * ${o}`,Y`(xp - FLOOR(xp)::INTEGER) * (yp - FLOOR(yp)::INTEGER)${s}`);return yt.from(yt.unionAll(c,f,l,u)).select({index:"i",density:ar("w")},i).groupby("index",i).having(Ff("density",0))}function r9(t){let e=Math.floor(t);return e===t?e-1:e}var C_=class extends Ue{constructor(e,n){let{ci:r=.95,precision:o=4,...i}=n;super("line",e,i);let s=()=>this.modelFit?this.confidenceBand().update():null;this.ci=ae(r,a=>(this.ci=a,s())),this.precision=ae(o,a=>(this.precision=a,s()))}query(e=[]){let n=this.channelField("x").as,r=this.channelField("y").as,o=Array.from(new Set(["stroke","z","fx","fy"].flatMap(i=>this.channelField(i)?.as||[])));return yt.from(super.query(e)).select({intercept:q1(r,n),slope:B1(r,n),n:z1(r,n),ssy:Y1(r,n),ssx:U1(r,n),xm:j1(r,n),x0:Xh(ui(n).where(hs(r))),x1:Xh(li(n).where(hs(r)))}).select(o).groupby(o)}queryResult(e){return this.modelFit=jn(e),this.lineData=Yz(this.modelFit),this.confidenceBand()}confidenceBand(){let{ci:e,modelFit:n,precision:r,plot:o}=this,i=o.innerWidth();return this.areaData=e?Uz(n,e,r,i):null,this}plotSpecs(){let{lineData:e,areaData:n,channels:r,ci:o}=this,i=e.columns,s=o?n.columns:{},a={x:i.x,y:i.y},c={x:s.x,y1:s.y1,y2:s.y2,fillOpacity:.1};for(let f of r)switch(f.channel){case"x":case"y":case"fill":break;case"tip":c.tip=tn(f,s);break;case"stroke":a.stroke=tn(f,i),c.fill=tn(f,s);break;case"strokeOpacity":a.strokeOpacity=tn(f,i);break;case"fillOpacity":c.fillOpacity=tn(f,s);break;default:a[f.channel]=tn(f,i),c[f.channel]=tn(f,s);break}return[...o?[{type:"areaY",data:{length:n.numRows},options:c}]:[],{type:"line",data:{length:e.numRows},options:a}]}};function $_(t,e){if(t.concat)return t.concat(e);let n=new t.constructor(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function Yz(t){let{x0:e=[],x1:n=[],xm:r,intercept:o,slope:i,n:s,ssx:a,ssy:c,...f}=t.columns,l=(h,d)=>o[d]+h*i[d],u=$_(e,n),p=$_(e.map(l),n.map(l));for(let h in f)f[h]=$_(f[h],f[h]);return{numRows:u.length,columns:{x:u,y:p,...f}}}function Uz(t,e,n,r){let o=t.numRows,{x0:i,x1:s,xm:a,intercept:c,slope:f,n:l,ssx:u,ssy:p,...h}=t.columns,d=Object.keys(h),m={x:[],y1:[],y2:[]};d.forEach(g=>m[g]=[]);for(let g=0;g<o;++g){let y=n*(s[g]-i[g])/r,x=e9((1-e)/2,l[g]-2)*Math.sqrt(p[g]/(l[g]-2));ie(i[g],s[g]-y/2,y).concat(s[g]).forEach(w=>{let b=c[g]+w*f[g],_=x*Math.sqrt(1/l[g]+(w-a[g])**2/u[g]);m.x.push(w),m.y1.push(b-_),m.y2.push(b+_),d.forEach(v=>m[v].push(h[v][g]))})}return{numRows:m.x.length,columns:m}}function o9(t){let e=t.toLowerCase(),n=t.length,r="";for(let o=0;o<n;++o)r+=(t[o]!==e[o]?"-":"")+e[o];return r}function yf(t){let e={};for(let n in t)e[o9(n)]=t[n];return e}function jz(t){let{channels:e}=t,n=new Set,r=!1,o=!1;for(let i of e){let{channel:s,field:a,as:c}=i;if(s==="orderby")r=!0;else if(a)if(a.aggregate)o=!0;else{if(n.has(c))continue;n.add(c)}}return!r&&o&&n.size&&t.channels.push({channel:"orderby",value:Array.from(n)}),t}var k_=class{constructor(e,{selection:n,channels:r={}}){this.mark=jz(e),this.selection=n;let o=Object.entries(yf(r));this.channels=o.length?o:[["opacity",.2]],this.selection.addEventListener("value",bf(()=>this.update()))}init(e){this.svg=e;let n=this.values=[],r=this.mark.index,o=this.nodes=e.querySelectorAll(`[data-index="${r}"] > *`),{channels:i}=this;for(let s=0;s<o.length;++s){let a=o[s];n.push(i.map(c=>a.getAttribute(c[0])))}return this.update()}async update(){let{svg:e,nodes:n,channels:r,values:o,mark:i,selection:s}=this;if(!e)return;let a=await Xz(i,s);for(let c=0;c<n.length;++c){let f=n[c],l=o[c],u=f.__data__,p=a(Array.isArray(u)?u[0]:u);for(let h=0;h<r.length;++h){let[d,m]=r[h];f.setAttribute(d,p?l[h]:m)}}}};async function Xz(t,e){let n=e?.predicate(t);if(!n||n.length===0)return()=>!0;let r=t.filterBy?.predicate(t,!0),o={__:Un(n)},i=t.query(r);(i.queries||[i]).forEach(c=>{c.groupby().length?c.select(o):c.$select(o)});let s=await t.coordinator.query(i),a=s.getChild?.("__");return s.numRows||s.length?a?c=>a.at(c):c=>s[c].__:()=>!1}function N_(t){let e=t.on,n=!0;function r(o){n=!1,o(),n=!0}return t.reset=(...o)=>{r(()=>t.clear(...o))},t.moveSilent=(...o)=>{r(()=>t.move(...o))},t.on=(...o)=>{if(o.length>1&&o[1]){let i=o[1];o[1]=(...s)=>n&&i(...s)}return e(...o)},t}function i9(){return N_(Ux())}function s9(){return N_(zx())}function a9(){return N_(Yx())}function Lp(t,e){return t===e||t&&e&&Math.abs(t[0]-e[0])<1e-12&&Math.abs(t[1]-e[1])<1e-12||!1}function ao(t,e){let n=t.channelField(e)?.field;return n?.basis||n}function Dp(t,e,n=1){return e.invert(n*Math.floor(t/n))}function n1(){let t=this,e=t.getScreenCTM,n;t.getScreenCTM=()=>t.isConnected?n=e.call(t):n}var Fp=class{constructor(e,{channel:n,selection:r,field:o=void 0,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.channel=n,this.pixelSize=i||1,this.selection=r,this.peers=s,this.field=o||ao(e,n),this.style=a&&yf(a),this.brush=n==="y"?a9():s9(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[0,1]))}publish(e){let n;e&&(n=e.map(r=>Dp(r,this.scale,this.pixelSize)).sort((r,o)=>r-o)),Lp(n,this.value)||(this.value=n,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(n)))}clause(e){let{mark:n,pixelSize:r,field:o,scale:i}=this;return jf(o,e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scale:i,pixelSize:r})}init(e,n){let{brush:r,channel:o,style:i}=this;this.scale=e.scale(o);let s=e.scale("x").range,a=e.scale("y").range;r.extent([[Ft(s),Ft(a)],[Tt(s),Tt(a)]]);let c=this.value?.map(this.scale.apply).sort(ht),f=bt(e).selectAll('g[aria-label="facet"]');if(n=f.size()?f:bt(n??e),this.g=n.append("g").attr("class",`interval-${o}`).each(n1).call(r).call(r.moveSilent,c),i){let l=this.g.selectAll("rect.selection");for(let u in i)l.attr(u,i[u])}e.addEventListener("pointerenter",l=>{l.buttons||this.activate()})}};var O_=class{constructor(e,{selection:n,xfield:r,yfield:o,pixelSize:i=1,peers:s=!0,brush:a}){this.mark=e,this.pixelSize=i||1,this.selection=n,this.peers=s,this.xfield=r||ao(e,"x"),this.yfield=o||ao(e,"y"),this.style=a&&yf(a),this.brush=i9(),this.brush.on("brush end",({selection:c})=>this.publish(c))}reset(){this.value=void 0,this.g&&this.brush.reset(this.g)}activate(){this.selection.activate(this.clause(this.value||[[0,1],[0,1]]))}publish(e){let{value:n,pixelSize:r,xscale:o,yscale:i}=this,s,a;if(e){let[c,f]=e;s=[c[0],f[0]].map(l=>Dp(l,o,r)).sort(ht),a=[c[1],f[1]].map(l=>Dp(l,i,r)).sort(ht)}(!Lp(s,n?.[0])||!Lp(a,n?.[1]))&&(this.value=e?[s,a]:void 0,this.g.call(this.brush.moveSilent,e),this.selection.update(this.clause(this.value)))}clause(e){let{mark:n,pixelSize:r,xfield:o,yfield:i,xscale:s,yscale:a}=this;return rx([o,i],e,{source:this,clients:this.peers?n.plot.markSet:new Set().add(n),scales:[s,a],pixelSize:r})}init(e){let{brush:n,style:r}=this,o=this.xscale=e.scale("x"),i=this.yscale=e.scale("y"),s=o.range,a=i.range;n.extent([[Ft(s),Ft(a)],[Tt(s),Tt(a)]]);let c=bt(e).selectAll('g[aria-label="facet"]'),f=c.size()?c:bt(e);if(this.g=f.append("g").attr("class","interval-xy").each(n1).call(n),r){let l=this.g.selectAll("rect.selection");for(let u in r)l.attr(u,r[u])}if(this.value){let[l,u]=this.value[0].map(o.apply).sort(ht),[p,h]=this.value[1].map(i.apply).sort(ht);this.g.call(n.moveSilent,[[l,p],[u,h]])}e.addEventListener("pointerenter",l=>{l.buttons||this.activate()})}};var R_=class{constructor(e,{selection:n,pointer:r,channels:o,fields:i,maxRadius:s=40}){this.mark=e,this.selection=n,this.clients=new Set().add(e),this.pointer=r,this.channels=o||(r==="x"?["x"]:r==="y"?["y"]:["x","y"]),this.fields=i||this.channels.map(a=>ao(e,[a])),this.maxRadius=s,this.valueIndex=-1}clause(e){let{clients:n,fields:r}=this,o={source:this,clients:n};return r.length>1?Uf(r,e&&[e],o):nx(r[0],e?.[0],o)}init(e){let n=this,{mark:r,channels:o,selection:i,maxRadius:s}=this,{data:{columns:a}}=r,c=o.map(x=>r.channelField(x).as),f=!ex(i),l=bt(e).selectAll('g[aria-label="facet"]'),u=l.size()?l:bt(e),p=e.scale("x").apply,h=e.scale("y").apply,d=Array.from(a[r.channelField("x").as],p),m=Array.from(a[r.channelField("y").as],h),g=this.pointer==="y"?.01:1,y=this.pointer==="x"?.01:1;u.on("pointerenter pointerdown pointermove",function(x){let[w,b]=Xe(x,this),_=Gz(d,m,w,b,g,y,s);if(_!==this.valueIndex){this.valueIndex=_;let v=_<0?void 0:c.map(A=>a[A][_]);i.update(f?!v||v.length>1?v:v[0]:n.clause(v))}}),!f&&(u.on("pointerleave",()=>{i.update(n.clause(void 0))}),e.addEventListener("pointerenter",x=>{if(!x.buttons){let w=this.channels.map(()=>0);i.activate(this.clause(w))}}))}};function Gz(t,e,n,r,o,i,s){let a=s*s,c=-1;for(let f=0;f<t.length;++f){let l=o*(t[f]-n),u=i*(e[f]-r),p=l*l+u*u;p<=a&&(a=p,c=f)}return c}var c9=(t,e)=>t-e,D_=class{constructor(e,{x:n=new pi,y:r=new pi,xfield:o,yfield:i,zoom:s=!0,panx:a=!0,pany:c=!0}){this.mark=e,this.xsel=n,this.ysel=r,this.xfield=o||ao(e,"x"),this.yfield=i||ao(e,"y"),this.zoom=L_(s,[0,1/0],[1,1]),this.panx=this.xsel&&a,this.pany=this.ysel&&c;let{plot:f}=e;a&&this.xsel.addEventListener("value",l=>{f.setAttribute("xDomain",l)&&f.update()}),c&&this.ysel.addEventListener("value",l=>{f.setAttribute("yDomain",l)&&f.update()})}publish(e){if(this.panx){let n=Vz(e,this.xscale);this.xsel.update(this.clause(n,this.xfield,this.xscale))}if(this.pany){let n=Wz(e,this.yscale);this.ysel.update(this.clause(n,this.yfield,this.yscale))}}clause(e,n,r){return jf(n,e,{source:this,clients:this.mark.plot.markSet,scale:r})}init(e){if(this.svg=e,this.initialized)return;this.initialized=!0;let{panx:n,pany:r,mark:{plot:{element:o}},xsel:i,ysel:s}=this;this.xscale=e.scale("x"),this.yscale=e.scale("y");let a=this.xscale.range.slice().sort(c9),c=this.yscale.range.slice().sort(c9),f=L_(n,[-1/0,1/0],a),l=L_(r,[-1/0,1/0],c),u=sw().extent([[a[0],c[0]],[a[1],c[1]]]).scaleExtent(this.zoom).translateExtent([[f[0],l[0]],[f[1],l[1]]]).on("start",()=>{this.xscale=this.svg.scale("x"),this.yscale=this.svg.scale("y")}).on("end",()=>o.__zoom=new Nn(1,0,0)).on("zoom",({transform:p})=>this.publish(p));if(bt(o).call(u),n||r){let p=!1;o.addEventListener("pointerenter",h=>{if(!p&&(p=!0,!h.buttons)){if(n){let{xscale:d,xfield:m}=this;i.activate(this.clause(d.domain,m,d))}if(r){let{yscale:d,yfield:m}=this;s.activate(this.clause(d.domain,m,d))}}}),o.addEventListener("pointerleave",()=>p=!1)}}};function L_(t,e,n){return t?Array.isArray(t)?t:e:n}function Vz(t,e){return e.range.map(t.invertX,t).map(e.invert,e)}function Wz(t,e){return e.range.map(t.invertY,t).map(e.invert,e)}var Pp=class{constructor(e,{selection:n,channels:r,peers:o=!0}){this.value=null,this.mark=e,this.selection=n,this.peers=o;let i=this.fields=[],s=this.as=[];r.forEach(a=>{let c=a==="color"?["color","fill","stroke"]:a==="x"?["x","x1","x2"]:a==="y"?["y","y1","y2"]:[a];for(let f=0;f<c.length;++f){let l=e.channelField(c[f],{exact:!0});if(l){i.push(l.field?.basis||l.field),s.push(l.as);return}}throw new Error(`Missing channel: ${a}`)})}clause(e){let{fields:n,mark:r}=this;return Uf(n,e,{source:this,clients:this.peers?r.plot.markSet:new Set().add(r)})}init(e,n,r){let{mark:o,as:i,selection:s}=this,{data:{columns:a={}}={}}=o;r??=f=>i.map(l=>{let u=f.__data__;return a[l][Array.isArray(u)?u[0]:u]}),n??=`[data-index="${o.index}"]`;let c=new Set(e.querySelectorAll(n));e.addEventListener("pointerdown",f=>{let l=s.single?s.value:this.value,u=f.target,p=null;if(Hz(c,u)){let h=r(u);(f.shiftKey||f.metaKey)&&l?.length?(p=l.filter(d=>F_(d,h)),p.length===l.length&&p.push(h)):l?.length===1&&!F_(l[0],h)?p=null:p=[h]}this.value=p,Qz(l,p)&&s.update(this.clause(p))}),e.addEventListener("pointerenter",f=>{f.buttons||this.selection.activate(this.clause([this.fields.map(()=>0)]))})}};function Hz(t,e){return t.has(e)||t.has(e.parentNode)||t.has(e.parentNode?.parentNode)}function Qz(t,e){return t==null||e==null?t!=null||e!=null:t.length!==e.length||t.some((n,r)=>F_(n,e[r]))}function F_(t,e){let n=t.length;if(e.length!==n)return!0;for(let r=0;r<n;++r)if(t[r]!==e[r])return!0;return!1}var l9=":scope > div, :scope > span",r1="swatch",f9="ramp",P_=class{constructor(e,n){let{as:r,field:o,...i}=n;this.channel=e,this.options=i,this.type=null,this.handler=null,this.selection=r,this.field=o,this.legend=null,this.element=document.createElement("div"),this.element.setAttribute("class","legend"),Object.defineProperty(this.element,"value",{value:this})}setPlot(e){this.plot=e}init(e){let n=Zz(this,e);return this.element.replaceChildren(n),this.element}update(){if(!this.legend)return;let{selection:e,handler:n}=this,{single:r,value:o}=e,i=r?o:e.valueFor(n),s=i&&i.length?new Set(i.map(c=>c[0])):null,a=this.legend.querySelectorAll(l9);for(let c of a){let f=s?s.has(c.__data__):!0;c.style.opacity=f?1:.2}}};function Zz(t,e){let{channel:n,plot:r,selection:o}=t,i=e.scale(n),s=i.type==="ordinal"?r1:f9,a={label:r.getAttribute(`${n}Label`)??null,...t.options},c=s===r1?a:a.label?{tickSize:2,...a}:{tickSize:2,marginTop:1,height:29,...a},f=e.legend(n,c);t.legend=f;let l=!!o;if(l&&s===f9){let u=c.width??240,p=eY(i,u);p?f.scale=function(h){return h==="x"?{range:[0,u]}:h==="y"?{range:[-10,0]}:h===n?p:void 0}:l=!1}if(l){let u=Kz(t,s);s===r1?(u.init(f,l9,p=>[p.__data__]),t.update()):u.init(f,f.querySelector("g:last-of-type"))}return f}function Kz(t,e){let{channel:n,handler:r,selection:o}=t;if(r)return r;let i=Jz(t);return e===r1?(t.handler=new Pp(i,{selection:o,channels:[n],peers:!1}),o.addEventListener("value",()=>t.update())):t.handler=new Fp(i,{selection:o,channel:n,brush:{fill:"none",stroke:"currentColor"},peers:!1}),t.handler}function Jz(t){let{channel:e,plot:n}=t,r=t.field??tY(n.marks,e)??"value";if(r){let o={field:r};return{plot:n,channelField:i=>e===i?o:void 0}}}function tY(t,e){let n=e==="color"?["fill","stroke"]:e==="opacity"?["opacity","fillOpacity","strokeOpacity"]:null;if(n==null)return null;for(let r=t.length-1;r>-1;--r)for(let o of n){let i=t[r].channelField(o,{exact:!0});if(i)return i.field}return null}function eY(t,e){let{apply:n,invert:r,interpolate:o,...i}=t,s=t.type;s.startsWith("diverging-")&&(s=s.slice(11));let a;switch(s){case"log":case"pow":case"sqrt":case"symlog":a=s;break;case"threshold":case"quantize":case"quantile":return console.warn(`Legends do not yet support ${s} scales.`),null;default:a="linear"}return zi({x:{...i,type:a,range:[0,e]}})}function o1(t,e,n=0,r=Math.LN10){let o,i=Math.ceil(Math.log(e)/r),s=Math.max(n,Math.pow(10,Math.round(Math.log(t)/r)-i));for(;Math.ceil(t/s)>e;)s*=10;let a=[5,2];for(let c=0,f=a.length;c<f;++c)o=s/a[c],o>=n&&t/o<=e&&(s=o);return s}function u9(t,e,n){let{step:r,steps:o,minstep:i=0,nice:s=!0}=n;if(s!==!1){let a=e-t,c=Math.LN10;r=r||o1(a,o||25,i,c);let f=Math.log(r),l=f>=0?0:~~(-f/c)+1,u=Math.pow(10,-l-1);f=Math.floor(t/r+u)*r,t=t<f?f-r:f,e=Math.ceil(e/r)*r,o=Math.round((e-t)/r)}return{min:t,max:e,steps:o}}var m9="year",p9="month",h9="day",i1="hour",s1="minute",a1="second",nY="millisecond",Bp=1e3,zp=Bp*60,Yp=zp*60,c1=Yp*24,rY=c1*7,d9=c1*30,g9=c1*365,qp=[[a1,1,Bp],[a1,5,5*Bp],[a1,15,15*Bp],[a1,30,30*Bp],[s1,1,zp],[s1,5,5*zp],[s1,15,15*zp],[s1,30,30*zp],[i1,1,Yp],[i1,3,3*Yp],[i1,6,6*Yp],[i1,12,12*Yp],[h9,1,c1],[h9,7,rY],[p9,1,d9],[p9,3,3*d9],[m9,1,g9]];function y9(t,e,n){let r=e-t,o=r/n,i=fr(s=>s[2]).right(qp,o);return i===qp.length?{interval:m9,step:o1(r/g9,n)}:i?(i=qp[o/qp[i-1][2]<qp[i][2]/o?i-1:i],{interval:i[0],step:i[1]}):{interval:nY,step:o1(r,n,1)}}var oY=new Set(["rectY-x","rectX-y","rect-x","rect-y","ruleY-x","ruleX-y"]);function iY(t,e){return oY.has(`${t.type}-${e}`)}function x9(t,e={}){let n=(r,o)=>iY(r,o)?{[`${o}1`]:q_(r,o,t,e),[`${o}2`]:q_(r,o,t,{...e,offset:1})}:{[o]:q_(r,o,t,e)};return n[xf]=!0,n}function q_(t,e,n,r){return{column:n,label:n,get columns(){return[n]},get basis(){return n},get stats(){return{column:n,stats:["min","max"]}},toString(){let{type:o,min:i,max:s}=t.channelField(e),{interval:a,steps:c,offset:f=0}=r,l=a??(o==="date"||sY(t,e)?"date":"number");if(l==="number"){let{apply:u,sqlApply:p,sqlInvert:h}=xa(t,e),d=u9(u(i),u(s),r),m=p(n),g=d.min===0?m:`(${m} - ${d.min})`,y=`${(d.max-d.min)/d.steps}::DOUBLE`,x=f?`${f} + `:"",w=`${d.min} + ${y} * (${x}FLOOR(${g} / ${y}))`;return`${h(w)}`}else{let{interval:u,step:p=1}=l==="date"?y9(i,s,c||40):r,h=f?` + INTERVAL ${f*p} ${u}`:"";return`(${G1(n,u,p)}${h})`}}}}function sY(t,e){let n=t.plot.getAttribute(`${e}Scale`);return n==="utc"||n==="time"}export{x_ as ConnectedMark,b_ as ContourMark,__ as DenseLineMark,M_ as Density1DMark,S_ as Density2DMark,A_ as ErrorBarMark,oi as Fixed,E_ as GeoMark,br as Grid2DMark,w_ as HeatmapMark,T_ as HexbinMark,k_ as Highlight,Fp as Interval1D,O_ as Interval2D,P_ as Legend,Ue as Mark,R_ as Nearest,D_ as PanZoom,u_ as Plot,mf as RasterMark,I_ as RasterTileMark,C_ as RegressionMark,Pp as Toggle,xf as Transform,Ne as Transient,x9 as bin};
|