md2x 0.7.3 → 0.7.4
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/README.md +6 -2
- package/dist/chunks/chunk-FXZD57XY.js +532 -0
- package/dist/index.js +1 -1
- package/dist/md2x.js +7 -5
- package/dist/renderer/live-runtime-canvas.js +24 -0
- package/dist/renderer/live-runtime-core.js +14 -0
- package/dist/renderer/live-runtime-dot.js +27 -0
- package/dist/renderer/live-runtime-html.js +14 -0
- package/dist/renderer/live-runtime-infographic.js +593 -0
- package/dist/renderer/live-runtime-md2x.js +24 -0
- package/dist/renderer/live-runtime-mermaid.js +14 -0
- package/dist/renderer/live-runtime-svg.js +14 -0
- package/dist/renderer/live-runtime-vega.js +218 -0
- package/dist/renderer/puppeteer-render.html +9 -1
- package/dist/renderer/puppeteer-runtime-core.js +14 -0
- package/dist/types/node/src/host/index.d.ts +2 -0
- package/dist/types/node/src/host/node-exporter.d.ts +16 -10
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/render.d.ts +12 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-RLHZRADD.js +0 -1391
- package/dist/renderer/puppeteer-render-worker.js +0 -830
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";(()=>{var g9=Object.create;var rb=Object.defineProperty;var y9=Object.getOwnPropertyDescriptor;var x9=Object.getOwnPropertyNames;var b9=Object.getPrototypeOf,v9=Object.prototype.hasOwnProperty;var w9=(e,t)=>()=>(e&&(t=e(e=0)),t);var ib=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sn=(e,t)=>{for(var n in t)rb(e,n,{get:t[n],enumerable:!0})},E9=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of x9(t))!v9.call(e,i)&&i!==n&&rb(e,i,{get:()=>t[i],enumerable:!(r=y9(t,i))||r.enumerable});return e};var S9=(e,t,n)=>(n=e!=null?g9(b9(e)):{},E9(t||!e||!e.__esModule?rb(n,"default",{value:e,enumerable:!0}):n,e));var UR=ib(hm=>{"use strict";x();hm.byteLength=A9;hm.toByteArray=C9;hm.fromByteArray=M9;var Ri=[],br=[],_9=typeof Uint8Array<"u"?Uint8Array:Array,ob="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ts=0,zR=ob.length;Ts<zR;++Ts)Ri[Ts]=ob[Ts],br[ob.charCodeAt(Ts)]=Ts;var Ts,zR;br[45]=62;br[95]=63;function BR(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function A9(e){var t=BR(e),n=t[0],r=t[1];return(n+r)*3/4-r}function k9(e,t,n){return(t+n)*3/4-n}function C9(e){var t,n=BR(e),r=n[0],i=n[1],o=new _9(k9(e,r,i)),a=0,s=i>0?r-4:r,u;for(u=0;u<s;u+=4)t=br[e.charCodeAt(u)]<<18|br[e.charCodeAt(u+1)]<<12|br[e.charCodeAt(u+2)]<<6|br[e.charCodeAt(u+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return i===2&&(t=br[e.charCodeAt(u)]<<2|br[e.charCodeAt(u+1)]>>4,o[a++]=t&255),i===1&&(t=br[e.charCodeAt(u)]<<10|br[e.charCodeAt(u+1)]<<4|br[e.charCodeAt(u+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function F9(e){return Ri[e>>18&63]+Ri[e>>12&63]+Ri[e>>6&63]+Ri[e&63]}function R9(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(F9(r));return i.join("")}function M9(e){for(var t,n=e.length,r=n%3,i=[],o=16383,a=0,s=n-r;a<s;a+=o)i.push(R9(e,a,a+o>s?s:a+o));return r===1?(t=e[n-1],i.push(Ri[t>>2]+Ri[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(Ri[t>>10]+Ri[t>>4&63]+Ri[t<<2&63]+"=")),i.join("")}});var qR=ib(ab=>{x();ab.read=function(e,t,n,r,i){var o,a,s=i*8-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=a*256+e[t+f],f+=d,c-=8);if(o===0)o=1-l;else{if(o===u)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-l}return(h?-1:1)*a*Math.pow(2,o-r)};ab.write=function(e,t,n,r,i,o){var a,s,u,l=o*8-i-1,c=(1<<l)-1,f=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?t+=d/u:t+=d*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a=a+f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=s&255,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+h]=a&255,h+=p,a/=256,l-=8);e[n+h-p]|=m*128}});var oM=ib(bl=>{"use strict";x();var sb=UR(),yl=qR(),jR=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;bl.Buffer=z;bl.SlowBuffer=I9;bl.INSPECT_MAX_BYTES=50;var pm=2147483647;bl.kMaxLength=pm;z.TYPED_ARRAY_SUPPORT=$9();!z.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function $9(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(z.prototype,"parent",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.buffer}});Object.defineProperty(z.prototype,"offset",{enumerable:!0,get:function(){if(z.isBuffer(this))return this.byteOffset}});function yo(e){if(e>pm)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,z.prototype),t}function z(e,t,n){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return fb(e)}return YR(e,t,n)}z.poolSize=8192;function YR(e,t,n){if(typeof e=="string")return D9(e,t);if(ArrayBuffer.isView(e))return N9(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Mi(e,ArrayBuffer)||e&&Mi(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mi(e,SharedArrayBuffer)||e&&Mi(e.buffer,SharedArrayBuffer)))return lb(e,t,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return z.from(r,t,n);let i=O9(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return z.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}z.from=function(e,t,n){return YR(e,t,n)};Object.setPrototypeOf(z.prototype,Uint8Array.prototype);Object.setPrototypeOf(z,Uint8Array);function VR(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function T9(e,t,n){return VR(e),e<=0?yo(e):t!==void 0?typeof n=="string"?yo(e).fill(t,n):yo(e).fill(t):yo(e)}z.alloc=function(e,t,n){return T9(e,t,n)};function fb(e){return VR(e),yo(e<0?0:db(e)|0)}z.allocUnsafe=function(e){return fb(e)};z.allocUnsafeSlow=function(e){return fb(e)};function D9(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!z.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=XR(e,t)|0,r=yo(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function ub(e){let t=e.length<0?0:db(e.length)|0,n=yo(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function N9(e){if(Mi(e,Uint8Array)){let t=new Uint8Array(e);return lb(t.buffer,t.byteOffset,t.byteLength)}return ub(e)}function lb(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return t===void 0&&n===void 0?r=new Uint8Array(e):n===void 0?r=new Uint8Array(e,t):r=new Uint8Array(e,t,n),Object.setPrototypeOf(r,z.prototype),r}function O9(e){if(z.isBuffer(e)){let t=db(e.length)|0,n=yo(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||pb(e.length)?yo(0):ub(e);if(e.type==="Buffer"&&Array.isArray(e.data))return ub(e.data)}function db(e){if(e>=pm)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+pm.toString(16)+" bytes");return e|0}function I9(e){return+e!=e&&(e=0),z.alloc(+e)}z.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==z.prototype};z.compare=function(t,n){if(Mi(t,Uint8Array)&&(t=z.from(t,t.offset,t.byteLength)),Mi(n,Uint8Array)&&(n=z.from(n,n.offset,n.byteLength)),!z.isBuffer(t)||!z.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;let r=t.length,i=n.length;for(let o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==n[o]){r=t[o],i=n[o];break}return r<i?-1:i<r?1:0};z.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};z.concat=function(t,n){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return z.alloc(0);let r;if(n===void 0)for(n=0,r=0;r<t.length;++r)n+=t[r].length;let i=z.allocUnsafe(n),o=0;for(r=0;r<t.length;++r){let a=t[r];if(Mi(a,Uint8Array))o+a.length>i.length?(z.isBuffer(a)||(a=z.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(z.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function XR(e,t){if(z.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Mi(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return cb(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return iM(e).length;default:if(i)return r?-1:cb(e).length;t=(""+t).toLowerCase(),i=!0}}z.byteLength=XR;function P9(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Y9(this,t,n);case"utf8":case"utf-8":return QR(this,t,n);case"ascii":return G9(this,t,n);case"latin1":case"binary":return H9(this,t,n);case"base64":return j9(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V9(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}z.prototype._isBuffer=!0;function Ds(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}z.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<t;n+=2)Ds(this,n,n+1);return this};z.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<t;n+=4)Ds(this,n,n+3),Ds(this,n+1,n+2);return this};z.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<t;n+=8)Ds(this,n,n+7),Ds(this,n+1,n+6),Ds(this,n+2,n+5),Ds(this,n+3,n+4);return this};z.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?QR(this,0,t):P9.apply(this,arguments)};z.prototype.toLocaleString=z.prototype.toString;z.prototype.equals=function(t){if(!z.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:z.compare(this,t)===0};z.prototype.inspect=function(){let t="",n=bl.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};jR&&(z.prototype[jR]=z.prototype.inspect);z.prototype.compare=function(t,n,r,i,o){if(Mi(t,Uint8Array)&&(t=z.from(t,t.offset,t.byteLength)),!z.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),n<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;let a=o-i,s=r-n,u=Math.min(a,s),l=this.slice(i,o),c=t.slice(n,r);for(let f=0;f<u;++f)if(l[f]!==c[f]){a=l[f],s=c[f];break}return a<s?-1:s<a?1:0};function KR(e,t,n,r,i){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,pb(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t=="string"&&(t=z.from(t,r)),z.isBuffer(t))return t.length===0?-1:WR(e,t,n,r,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):WR(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function WR(e,t,n,r,i){let o=1,a=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,s/=2,n/=2}function u(c,f){return o===1?c[f]:c.readUInt16BE(f*o)}let l;if(i){let c=-1;for(l=n;l<a;l++)if(u(e,l)===u(t,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===s)return c*o}else c!==-1&&(l-=l-c),c=-1}else for(n+s>a&&(n=a-s),l=n;l>=0;l--){let c=!0;for(let f=0;f<s;f++)if(u(e,l+f)!==u(t,f)){c=!1;break}if(c)return l}return-1}z.prototype.includes=function(t,n,r){return this.indexOf(t,n,r)!==-1};z.prototype.indexOf=function(t,n,r){return KR(this,t,n,r,!0)};z.prototype.lastIndexOf=function(t,n,r){return KR(this,t,n,r,!1)};function L9(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let o=t.length;r>o/2&&(r=o/2);let a;for(a=0;a<r;++a){let s=parseInt(t.substr(a*2,2),16);if(pb(s))return a;e[n+a]=s}return a}function z9(e,t,n,r){return mm(cb(t,e.length-n),e,n,r)}function B9(e,t,n,r){return mm(J9(t),e,n,r)}function U9(e,t,n,r){return mm(iM(t),e,n,r)}function q9(e,t,n,r){return mm(Z9(t,e.length-n),e,n,r)}z.prototype.write=function(t,n,r,i){if(n===void 0)i="utf8",r=this.length,n=0;else if(r===void 0&&typeof n=="string")i=n,r=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-n;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return L9(this,t,n,r);case"utf8":case"utf-8":return z9(this,t,n,r);case"ascii":case"latin1":case"binary":return B9(this,t,n,r);case"base64":return U9(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q9(this,t,n,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j9(e,t,n){return t===0&&n===e.length?sb.fromByteArray(e):sb.fromByteArray(e.slice(t,n))}function QR(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=n){let u,l,c,f;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],(u&192)===128&&(f=(o&31)<<6|u&63,f>127&&(a=f));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(f=(o&15)<<12|(u&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(f=(o&15)<<18|(u&63)<<12|(l&63)<<6|c&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=s}return W9(r)}var GR=4096;function W9(e){let t=e.length;if(t<=GR)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=GR));return n}function G9(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function H9(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Y9(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let o=t;o<n;++o)i+=e7[e[o]];return i}function V9(e,t,n){let r=e.slice(t,n),i="";for(let o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}z.prototype.slice=function(t,n){let r=this.length;t=~~t,n=n===void 0?r:~~n,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<t&&(n=t);let i=this.subarray(t,n);return Object.setPrototypeOf(i,z.prototype),i};function Lt(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}z.prototype.readUintLE=z.prototype.readUIntLE=function(t,n,r){t=t>>>0,n=n>>>0,r||Lt(t,n,this.length);let i=this[t],o=1,a=0;for(;++a<n&&(o*=256);)i+=this[t+a]*o;return i};z.prototype.readUintBE=z.prototype.readUIntBE=function(t,n,r){t=t>>>0,n=n>>>0,r||Lt(t,n,this.length);let i=this[t+--n],o=1;for(;n>0&&(o*=256);)i+=this[t+--n]*o;return i};z.prototype.readUint8=z.prototype.readUInt8=function(t,n){return t=t>>>0,n||Lt(t,1,this.length),this[t]};z.prototype.readUint16LE=z.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||Lt(t,2,this.length),this[t]|this[t+1]<<8};z.prototype.readUint16BE=z.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||Lt(t,2,this.length),this[t]<<8|this[t+1]};z.prototype.readUint32LE=z.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};z.prototype.readUint32BE=z.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};z.prototype.readBigUInt64LE=ga(function(t){t=t>>>0,xl(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&_f(t,this.length-8);let i=n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});z.prototype.readBigUInt64BE=ga(function(t){t=t>>>0,xl(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&_f(t,this.length-8);let i=n*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r;return(BigInt(i)<<BigInt(32))+BigInt(o)});z.prototype.readIntLE=function(t,n,r){t=t>>>0,n=n>>>0,r||Lt(t,n,this.length);let i=this[t],o=1,a=0;for(;++a<n&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*n)),i};z.prototype.readIntBE=function(t,n,r){t=t>>>0,n=n>>>0,r||Lt(t,n,this.length);let i=n,o=1,a=this[t+--i];for(;i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*n)),a};z.prototype.readInt8=function(t,n){return t=t>>>0,n||Lt(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};z.prototype.readInt16LE=function(t,n){t=t>>>0,n||Lt(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};z.prototype.readInt16BE=function(t,n){t=t>>>0,n||Lt(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};z.prototype.readInt32LE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};z.prototype.readInt32BE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};z.prototype.readBigInt64LE=ga(function(t){t=t>>>0,xl(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&_f(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});z.prototype.readBigInt64BE=ga(function(t){t=t>>>0,xl(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&_f(t,this.length-8);let i=(n<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r)});z.prototype.readFloatLE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),yl.read(this,t,!0,23,4)};z.prototype.readFloatBE=function(t,n){return t=t>>>0,n||Lt(t,4,this.length),yl.read(this,t,!1,23,4)};z.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||Lt(t,8,this.length),yl.read(this,t,!0,52,8)};z.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||Lt(t,8,this.length),yl.read(this,t,!1,52,8)};function Gn(e,t,n,r,i,o){if(!z.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}z.prototype.writeUintLE=z.prototype.writeUIntLE=function(t,n,r,i){if(t=+t,n=n>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Gn(this,t,n,r,s,0)}let o=1,a=0;for(this[n]=t&255;++a<r&&(o*=256);)this[n+a]=t/o&255;return n+r};z.prototype.writeUintBE=z.prototype.writeUIntBE=function(t,n,r,i){if(t=+t,n=n>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Gn(this,t,n,r,s,0)}let o=r-1,a=1;for(this[n+o]=t&255;--o>=0&&(a*=256);)this[n+o]=t/a&255;return n+r};z.prototype.writeUint8=z.prototype.writeUInt8=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,1,255,0),this[n]=t&255,n+1};z.prototype.writeUint16LE=z.prototype.writeUInt16LE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2};z.prototype.writeUint16BE=z.prototype.writeUInt16BE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2};z.prototype.writeUint32LE=z.prototype.writeUInt32LE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4};z.prototype.writeUint32BE=z.prototype.writeUInt32BE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function JR(e,t,n,r,i){rM(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o=o>>8,e[n++]=o,o=o>>8,e[n++]=o,o=o>>8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a=a>>8,e[n++]=a,a=a>>8,e[n++]=a,a=a>>8,e[n++]=a,n}function ZR(e,t,n,r,i){rM(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o=o>>8,e[n+6]=o,o=o>>8,e[n+5]=o,o=o>>8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a=a>>8,e[n+2]=a,a=a>>8,e[n+1]=a,a=a>>8,e[n]=a,n+8}z.prototype.writeBigUInt64LE=ga(function(t,n=0){return JR(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});z.prototype.writeBigUInt64BE=ga(function(t,n=0){return ZR(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});z.prototype.writeIntLE=function(t,n,r,i){if(t=+t,n=n>>>0,!i){let u=Math.pow(2,8*r-1);Gn(this,t,n,r,u-1,-u)}let o=0,a=1,s=0;for(this[n]=t&255;++o<r&&(a*=256);)t<0&&s===0&&this[n+o-1]!==0&&(s=1),this[n+o]=(t/a>>0)-s&255;return n+r};z.prototype.writeIntBE=function(t,n,r,i){if(t=+t,n=n>>>0,!i){let u=Math.pow(2,8*r-1);Gn(this,t,n,r,u-1,-u)}let o=r-1,a=1,s=0;for(this[n+o]=t&255;--o>=0&&(a*=256);)t<0&&s===0&&this[n+o+1]!==0&&(s=1),this[n+o]=(t/a>>0)-s&255;return n+r};z.prototype.writeInt8=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1};z.prototype.writeInt16LE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2};z.prototype.writeInt16BE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2};z.prototype.writeInt32LE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4};z.prototype.writeInt32BE=function(t,n,r){return t=+t,n=n>>>0,r||Gn(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};z.prototype.writeBigInt64LE=ga(function(t,n=0){return JR(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});z.prototype.writeBigInt64BE=ga(function(t,n=0){return ZR(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function eM(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function tM(e,t,n,r,i){return t=+t,n=n>>>0,i||eM(e,t,n,4,34028234663852886e22,-34028234663852886e22),yl.write(e,t,n,r,23,4),n+4}z.prototype.writeFloatLE=function(t,n,r){return tM(this,t,n,!0,r)};z.prototype.writeFloatBE=function(t,n,r){return tM(this,t,n,!1,r)};function nM(e,t,n,r,i){return t=+t,n=n>>>0,i||eM(e,t,n,8,17976931348623157e292,-17976931348623157e292),yl.write(e,t,n,r,52,8),n+8}z.prototype.writeDoubleLE=function(t,n,r){return nM(this,t,n,!0,r)};z.prototype.writeDoubleBE=function(t,n,r){return nM(this,t,n,!1,r)};z.prototype.copy=function(t,n,r,i){if(!z.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n<i-r&&(i=t.length-n+r);let o=i-r;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),n),o};z.prototype.fill=function(t,n,r,i){if(typeof t=="string"){if(typeof n=="string"?(i=n,n=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!z.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n=n>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let o;if(typeof t=="number")for(o=n;o<r;++o)this[o]=t;else{let a=z.isBuffer(t)?t:z.from(t,i),s=a.length;if(s===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-n;++o)this[o+n]=a[o%s]}return this};var gl={};function hb(e,t,n){gl[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}hb("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);hb("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);hb("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=HR(String(n)):typeof n=="bigint"&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=HR(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);function HR(e){let t="",n=e.length,r=e[0]==="-"?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function X9(e,t,n){xl(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&_f(t,e.length-(n+1))}function rM(e,t,n,r,i,o){if(e>n||e<t){let a=typeof t=="bigint"?"n":"",s;throw o>3?t===0||t===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${t}${a} and <= ${n}${a}`,new gl.ERR_OUT_OF_RANGE("value",s,e)}X9(r,i,o)}function xl(e,t){if(typeof e!="number")throw new gl.ERR_INVALID_ARG_TYPE(t,"number",e)}function _f(e,t,n){throw Math.floor(e)!==e?(xl(e,n),new gl.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new gl.ERR_BUFFER_OUT_OF_BOUNDS:new gl.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var K9=/[^+/0-9A-Za-z-_]/g;function Q9(e){if(e=e.split("=")[0],e=e.trim().replace(K9,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function cb(e,t){t=t||1/0;let n,r=e.length,i=null,o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function J9(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Z9(e,t){let n,r,i,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function iM(e){return sb.toByteArray(Q9(e))}function mm(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Mi(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function pb(e){return e!==e}var e7=(function(){let e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function ga(e){return typeof BigInt>"u"?t7:e}function t7(){throw new Error("BigInt not supported")}});var mb,A,x=w9(()=>{"use strict";mb=S9(oM(),1),A=mb.Buffer;globalThis.Buffer=mb.Buffer});x();x();x();x();var n7=/("(?:[^\\"]|\\.)*")|[:,]/g;function Af(e,t={}){let n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),r=n===""?1/0:t.maxLength===void 0?80:t.maxLength,{replacer:i}=t;return(function o(a,s,u){a&&typeof a.toJSON=="function"&&(a=a.toJSON());let l=JSON.stringify(a,i);if(l===void 0)return l;let c=r-s.length-u;if(l.length<=c){let f=l.replace(n7,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(i!=null&&(a=JSON.parse(l),i=void 0),typeof a=="object"&&a!==null){let f=s+n,d=[],h=0,p,m;if(Array.isArray(a)){p="[",m="]";let{length:g}=a;for(;h<g;h++)d.push(o(a[h],f,h===g-1?0:1)||"null")}else{p="{",m="}";let g=Object.keys(a),{length:y}=g;for(;h<y;h++){let b=g[h],v=`${JSON.stringify(b)}: `,w=o(a[b],f,v.length+(h===y-1?0:1));w!==void 0&&d.push(v+w)}}if(d.length>0)return[p,n+d.join(`,
|
|
2
|
+
${f}`),m].join(`
|
|
3
|
+
${s}`)}return l})(e,"",0)}var wk={};Sn(wk,{Bounds:()=>ft,CanvasHandler:()=>Ka,CanvasRenderer:()=>oc,DATE:()=>Rn,DAY:()=>Jt,DAYOFYEAR:()=>Ni,Dataflow:()=>Ra,Debug:()=>cM,DisallowedObjectProperties:()=>Cf,Error:()=>xm,EventStream:()=>Il,Gradient:()=>Jw,GroupItem:()=>ph,HOURS:()=>Vn,Handler:()=>sh,HybridHandler:()=>N0,HybridRenderer:()=>lh,Info:()=>lM,Item:()=>hh,MILLISECONDS:()=>Ar,MINUTES:()=>Xn,MONTH:()=>Zt,Marks:()=>Tn,MultiPulse:()=>Xm,None:()=>uM,Operator:()=>ze,Parameters:()=>ld,Pulse:()=>Ro,QUARTER:()=>Fn,RenderType:()=>Lo,Renderer:()=>yu,ResourceLoader:()=>v0,SECONDS:()=>sr,SVGHandler:()=>M0,SVGRenderer:()=>uh,SVGStringRenderer:()=>D0,Scenegraph:()=>ah,TIME_UNITS:()=>Om,Transform:()=>N,View:()=>VA,WEEK:()=>Et,Warn:()=>bm,YEAR:()=>Bt,accessor:()=>dn,accessorFields:()=>Rt,accessorName:()=>Ke,array:()=>J,ascending:()=>vo,bandwidthNRD:()=>Zm,bin:()=>Iv,bootstrapCI:()=>Pv,boundClip:()=>SE,boundContext:()=>mh,boundItem:()=>Hw,boundMark:()=>UD,boundStroke:()=>Hi,changeset:()=>$o,clampRange:()=>Eb,codegenExpression:()=>Q1,compare:()=>$f,constant:()=>tt,cumulativeLogNormal:()=>og,cumulativeNormal:()=>dd,cumulativeUniform:()=>lg,dayofyear:()=>lv,debounce:()=>Tf,defaultLocale:()=>od,definition:()=>Km,densityLogNormal:()=>ig,densityNormal:()=>eg,densityUniform:()=>ug,domChild:()=>Nt,domClear:()=>$r,domCreate:()=>Wa,domFind:()=>gE,dotbin:()=>Lv,error:()=>O,expressionFunction:()=>mt,extend:()=>he,extent:()=>_n,extentIndex:()=>Sb,falsy:()=>xo,fastmap:()=>xa,field:()=>zt,flush:()=>_b,font:()=>U0,fontFamily:()=>xh,fontSize:()=>Yi,format:()=>qm,formatLocale:()=>id,formats:()=>Rv,hasOwnProperty:()=>ee,id:()=>vl,identity:()=>ct,inferType:()=>R$,inferTypes:()=>M$,ingest:()=>Ce,inherits:()=>W,inrange:()=>ba,interpolate:()=>Xd,interpolateColors:()=>Zl,interpolateRange:()=>o0,intersect:()=>EE,intersectBoxLine:()=>tc,intersectPath:()=>nE,intersectPoint:()=>rE,intersectRule:()=>MD,isArray:()=>I,isBoolean:()=>Gr,isDate:()=>Hr,isFunction:()=>de,isIterable:()=>Ab,isNumber:()=>ke,isObject:()=>Q,isRegExp:()=>Em,isString:()=>Z,isTuple:()=>Hs,key:()=>Df,lerp:()=>kb,lineHeight:()=>Va,loader:()=>Nl,locale:()=>Bm,logger:()=>Ns,lruCache:()=>Cb,markup:()=>wE,merge:()=>Fb,mergeConfig:()=>bo,multiLineOffset:()=>B0,one:()=>$i,pad:()=>Rb,panLinear:()=>gb,panLog:()=>yb,panPow:()=>xb,panSymlog:()=>bb,parse:()=>z4,parseExpression:()=>Oc,parseSelector:()=>fi,path:()=>Ks,pathCurves:()=>Zw,pathEqual:()=>yN,pathParse:()=>gu,pathRectangle:()=>kD,pathRender:()=>nc,pathSymbols:()=>AD,pathTrail:()=>CD,peek:()=>ve,point:()=>bh,projection:()=>jh,quantileLogNormal:()=>ag,quantileNormal:()=>hd,quantileUniform:()=>cg,quantiles:()=>Qm,quantizeInterpolator:()=>a0,quarter:()=>vb,quartiles:()=>Jm,random:()=>Mn,randomInteger:()=>pj,randomKDE:()=>ng,randomLCG:()=>hj,randomLogNormal:()=>zv,randomMixture:()=>Bv,randomNormal:()=>tg,randomUniform:()=>Uv,read:()=>$v,regressionConstant:()=>fg,regressionExp:()=>jv,regressionLinear:()=>hg,regressionLoess:()=>Hv,regressionLog:()=>qv,regressionPoly:()=>Gv,regressionPow:()=>Wv,regressionQuad:()=>pg,renderModule:()=>vh,repeat:()=>kf,resetDefaultLocale:()=>A$,resetSVGDefIds:()=>ZY,responseType:()=>Mv,runtimeContext:()=>ry,sampleCurve:()=>Ll,sampleLogNormal:()=>rg,sampleNormal:()=>fd,sampleUniform:()=>sg,scale:()=>Fe,sceneEqual:()=>_E,sceneFromJSON:()=>jD,scenePickVisit:()=>E0,sceneToJSON:()=>qD,sceneVisit:()=>ei,sceneZOrder:()=>iE,scheme:()=>Kd,serializeXML:()=>oN,setHybridRendererOptions:()=>XY,setRandom:()=>fj,span:()=>wo,splitAccessPath:()=>vr,stringValue:()=>G,textMetrics:()=>Kn,timeBin:()=>bv,timeFloor:()=>hv,timeFormatLocale:()=>Gs,timeInterval:()=>ko,timeOffset:()=>mv,timeSequence:()=>yv,timeUnitSpecifier:()=>sv,timeUnits:()=>Im,toBoolean:()=>Nf,toDate:()=>Of,toNumber:()=>yt,toSet:()=>$t,toString:()=>If,transform:()=>Ov,transforms:()=>Mo,truncate:()=>Mb,truthy:()=>Mt,tupleid:()=>ue,typeParsers:()=>kv,utcFloor:()=>pv,utcInterval:()=>Co,utcOffset:()=>gv,utcSequence:()=>xv,utcdayofyear:()=>fv,utcquarter:()=>wb,utcweek:()=>dv,version:()=>goe,visitArray:()=>Eo,week:()=>cv,writeConfig:()=>ya,zero:()=>Wr,zoomLinear:()=>Ff,zoomLog:()=>Rf,zoomPow:()=>wl,zoomSymlog:()=>Mf});x();x();function dn(e,t,n){return e.fields=t||[],e.fname=n,e}function Ke(e){return e==null?null:e.fname}function Rt(e){return e==null?null:e.fields}function sM(e){return e.length===1?r7(e[0]):i7(e)}var r7=e=>function(t){return t[e]},i7=e=>{let t=e.length;return function(n){for(let r=0;r<t;++r)n=n[e[r]];return n}};function O(e){throw Error(e)}function vr(e){let t=[],n=e.length,r=null,i=0,o="",a,s,u;e=e+"";function l(){t.push(o+e.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=e[s],u==="\\")o+=e.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||O("Access path missing open bracket: "+e),i>0&&l(),i=0,a=s+1)}return i&&O("Access path missing closing bracket: "+e),r&&O("Access path missing closing quote: "+e),s>a&&(s++,l()),t}function zt(e,t,n){let r=vr(e);return e=r.length===1?r[0]:e,dn((n&&n.get||sM)(r),[e],t||e)}var vl=zt("id"),ct=dn(e=>e,[],"identity"),Wr=dn(()=>0,[],"zero"),$i=dn(()=>1,[],"one"),Mt=dn(()=>!0,[],"true"),xo=dn(()=>!1,[],"false"),Cf=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function o7(e,t,n){let r=[t].concat([].slice.call(n));console[e].apply(console,r)}var uM=0,xm=1,bm=2,lM=3,cM=4;function Ns(e,t,n=o7){let r=e||uM;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=xm&&n(t||"error","ERROR",arguments),this},warn(){return r>=bm&&n(t||"warn","WARN",arguments),this},info(){return r>=lM&&n(t||"log","INFO",arguments),this},debug(){return r>=cM&&n(t||"log","DEBUG",arguments),this}}}var I=Array.isArray;function Q(e){return e===Object(e)}var aM=e=>e!=="__proto__";function bo(...e){return e.reduce((t,n)=>{for(let r in n)if(r==="signals")t.signals=a7(t.signals,n.signals);else{let i=r==="legend"?{layout:1}:r==="style"?!0:null;ya(t,r,n[r],i)}return t},{})}function ya(e,t,n,r){if(!aM(t))return;let i,o;if(Q(n)&&!I(n)){o=Q(e[t])?e[t]:e[t]={};for(i in n)r&&(r===!0||r[i])?ya(o,i,n[i]):aM(i)&&(o[i]=n[i])}else e[t]=n}function a7(e,t){if(e==null)return t;let n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return t.forEach(i),e.forEach(i),r}function ve(e){return e[e.length-1]}function yt(e){return e==null||e===""?null:+e}var fM=e=>t=>e*Math.exp(t),dM=e=>t=>Math.log(e*t),hM=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),pM=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,ym=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function vm(e,t,n,r){let i=n(e[0]),o=n(ve(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function gb(e,t){return vm(e,t,yt,ct)}function yb(e,t){var n=Math.sign(e[0]);return vm(e,t,dM(n),fM(n))}function xb(e,t,n){return vm(e,t,ym(n),ym(1/n))}function bb(e,t,n){return vm(e,t,hM(n),pM(n))}function wm(e,t,n,r,i){let o=r(e[0]),a=r(ve(e)),s=t!=null?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ff(e,t,n){return wm(e,t,n,yt,ct)}function Rf(e,t,n){let r=Math.sign(e[0]);return wm(e,t,n,dM(r),fM(r))}function wl(e,t,n,r){return wm(e,t,n,ym(r),ym(1/r))}function Mf(e,t,n,r){return wm(e,t,n,hM(r),pM(r))}function vb(e){return 1+~~(new Date(e).getMonth()/3)}function wb(e){return 1+~~(new Date(e).getUTCMonth()/3)}function J(e){return e!=null?I(e)?e:[e]:[]}function Eb(e,t,n){let r=e[0],i=e[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function de(e){return typeof e=="function"}var s7="descending";function $f(e,t,n){n=n||{},t=J(t)||[];let r=[],i=[],o={},a=n.comparator||u7;return J(e).forEach((s,u)=>{s!=null&&(r.push(t[u]===s7?-1:1),i.push(s=de(s)?s:zt(s,null,n)),(Rt(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:dn(a(i,r),Object.keys(o))}var vo=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),u7=(e,t)=>e.length===1?l7(e[0],t[0]):c7(e,t,e.length),l7=(e,t)=>function(n,r){return vo(e(n),e(r))*t},c7=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=e[s],a=vo(o(r),o(i));return a*t[s]});function tt(e){return de(e)?e:()=>e}function Tf(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function he(e){for(let t,n,r=1,i=arguments.length;r<i;++r){t=arguments[r];for(n in t)e[n]=t[n]}return e}function _n(e,t){let n=0,r,i,o,a;if(e&&(r=e.length))if(t==null){for(i=e[n];n<r&&(i==null||i!==i);i=e[++n]);for(o=a=i;n<r;++n)i=e[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=t(e[n]);n<r&&(i==null||i!==i);i=t(e[++n]));for(o=a=i;n<r;++n)i=t(e[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function Sb(e,t){let n=e.length,r=-1,i,o,a,s,u;if(t==null){for(;++r<n;)if(o=e[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=t(e[r],r,e),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t(e[r],r,e),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}function ee(e,t){return Object.hasOwn(e,t)}var gm={};function xa(e){let t={},n;function r(o){return ee(t,o)&&t[o]!==gm}let i={size:0,empty:0,object:t,has:r,get(o){return r(o)?t[o]:void 0},set(o,a){return r(o)||(++i.size,t[o]===gm&&--i.empty),t[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,t[o]=gm),this},clear(){i.size=i.empty=0,i.object=t={}},test(o){return arguments.length?(n=o,i):n},clean(){let o={},a=0;for(let s in t){let u=t[s];u!==gm&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=t=o}};return e&&Object.keys(e).forEach(o=>{i.set(o,e[o])}),i}function _b(e,t,n,r,i,o){if(!n&&n!==0)return o;let a=+n,s=e[0],u=ve(e),l;u<s&&(l=s,s=u,u=l),l=Math.abs(t-s);let c=Math.abs(u-t);return l<c&&l<=a?r:c<=a?i:o}function W(e,t,n){let r=e.prototype=Object.create(t.prototype);return Object.defineProperty(r,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),he(r,n)}function ba(e,t,n,r){let i=t[0],o=t[t.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=e:i<e)&&(r?e<=o:e<o)}function Gr(e){return typeof e=="boolean"}function Hr(e){return Object.prototype.toString.call(e)==="[object Date]"}function Ab(e){return e&&de(e[Symbol.iterator])}function ke(e){return typeof e=="number"}function Em(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Z(e){return typeof e=="string"}function Df(e,t,n){e&&(e=t?J(e).map(s=>s.replace(/\\(.)/g,"$1")):J(e));let r=e&&e.length,i=n&&n.get||sM,o=s=>i(t?[s]:vr(s)),a;if(!r)a=function(){return""};else if(r===1){let s=o(e[0]);a=function(u){return""+s(u)}}else{let s=e.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return dn(a,e,"key")}function kb(e,t){let n=e[0],r=ve(e),i=+t;return i?i===1?r:n+i*(r-n):n}var f7=1e4;function Cb(e){e=+e||f7;let t,n,r,i=()=>{t={},n={},r=0},o=(a,s)=>(++r>e&&(n=t,t={},r=1),t[a]=s);return i(),{clear:i,has:a=>ee(t,a)||ee(n,a),get:a=>ee(t,a)?t[a]:ee(n,a)?o(a,n[a]):void 0,set:(a,s)=>ee(t,a)?t[a]=s:o(a,s)}}function Fb(e,t,n,r){let i=t.length,o=n.length;if(!o)return t;if(!i)return n;let a=r||new t.constructor(i+o),s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=e(t[s],n[u])>0?n[u++]:t[s++];for(;s<i;++s,++l)a[l]=t[s];for(;u<o;++u,++l)a[l]=n[u];return a}function kf(e,t){let n="";for(;--t>=0;)n+=e;return n}function Rb(e,t,n,r){let i=n||" ",o=e+"",a=t-o.length;return a<=0?o:r==="left"?kf(i,a)+o:r==="center"?kf(i,~~(a/2))+o+kf(i,Math.ceil(a/2)):o+kf(i,a)}function wo(e){return e&&ve(e)-e[0]||0}function G(e){return I(e)?`[${e.map(t=>t===null?"null":G(t))}]`:Q(e)||Z(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function Nf(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}var d7=e=>ke(e)||Hr(e)?e:Date.parse(e);function Of(e,t){return t=t||d7,e==null||e===""?null:t(e)}function If(e){return e==null||e===""?null:e+""}function $t(e){let t={},n=e.length;for(let r=0;r<n;++r)t[e[r]]=!0;return t}function Mb(e,t,n,r){let i=r??"\u2026",o=e+"",a=o.length,s=Math.max(0,t-i.length);return a<=t?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Eo(e,t,n){if(e)if(t){let r=e.length;for(let i=0;i<r;++i){let o=t(e[i]);o&&n(o,i,e)}}else e.forEach(n)}x();x();x();x();var mM={},$b={},Tb=34,Pf=10,Db=13;function yM(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function h7(e,t){var n=yM(e);return function(r,i){return t(n(r),i,e)}}function gM(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function Hn(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function p7(e){return e<0?"-"+Hn(-e,6):e>9999?"+"+Hn(e,6):Hn(e,4)}function m7(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":p7(e.getUTCFullYear(),4)+"-"+Hn(e.getUTCMonth()+1,2)+"-"+Hn(e.getUTCDate(),2)+(i?"T"+Hn(t,2)+":"+Hn(n,2)+":"+Hn(r,2)+"."+Hn(i,3)+"Z":r?"T"+Hn(t,2)+":"+Hn(n,2)+":"+Hn(r,2)+"Z":n||t?"T"+Hn(t,2)+":"+Hn(n,2)+"Z":"")}function Nb(e){var t=new RegExp('["'+e+`
|
|
4
|
+
\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,m=i(f,function(g,y){if(h)return h(g,y-1);p=g,h=d?h7(g,d):yM(g)});return m.columns=p||[],m}function i(f,d){var h=[],p=f.length,m=0,g=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Pf&&--p,f.charCodeAt(p-1)===Db&&--p;function w(){if(b)return $b;if(v)return v=!1,mM;var _,S=m,k;if(f.charCodeAt(S)===Tb){for(;m++<p&&f.charCodeAt(m)!==Tb||f.charCodeAt(++m)===Tb;);return(_=m)>=p?b=!0:(k=f.charCodeAt(m++))===Pf?v=!0:k===Db&&(v=!0,f.charCodeAt(m)===Pf&&++m),f.slice(S+1,_-1).replace(/""/g,'"')}for(;m<p;){if((k=f.charCodeAt(_=m++))===Pf)v=!0;else if(k===Db)v=!0,f.charCodeAt(m)===Pf&&++m;else if(k!==n)continue;return f.slice(S,_)}return b=!0,f.slice(S,p)}for(;(y=w())!==$b;){for(var E=[];y!==mM&&y!==$b;)E.push(y),y=w();d&&(E=d(E,g++))==null||h.push(E)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function a(f,d){return d==null&&(d=gM(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
|
|
5
|
+
`)}function s(f,d){return d==null&&(d=gM(f)),o(f,d).join(`
|
|
6
|
+
`)}function u(f){return f.map(l).join(`
|
|
7
|
+
`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?m7(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}x();x();x();x();function Ob(e){return e}function Sm(e){if(e==null)return Ob;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],a=e.translate[1];return function(s,u){u||(t=n=0);var l=2,c=s.length,f=new Array(c);for(f[0]=(t+=s[0])*r+o,f[1]=(n+=s[1])*i+a;l<c;)f[l]=s[l],++l;return f}}x();x();function xM(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function Ib(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return bM(e,n)})}:bM(e,t)}function bM(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,o=_m(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:o}:r==null?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function _m(e,t){var n=Sm(e.transform),r=e.arcs;function i(c,f){f.length&&f.pop();for(var d=r[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&xM(f,p)}function o(c){return n(c)}function a(c){for(var f=[],d=0,h=c.length;d<h;++d)i(c[d],f);return f.length<2&&f.push(f[0]),f}function s(c){for(var f=a(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(s)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=a(c.arcs);break;case"MultiLineString":d=c.arcs.map(a);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}x();x();function Pb(e,t){var n={},r={},i={},o=[],a=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++a],t[a]=l,t[c]=d)}),t.forEach(function(l){var c=s(l),f=c[0],d=c[1],h,p;if(h=i[f])if(delete i[h.end],h.push(l),h.end=d,p=r[d]){delete r[p.start];var m=p===h?h:h.concat(p);r[m.start=h.start]=i[m.end=p.end]=m}else r[h.start]=i[h.end]=h;else if(h=r[d])if(delete r[h.start],h.unshift(l),h.start=f,p=i[f]){delete i[p.end];var g=p===h?h:p.concat(h);r[g.start=p.start]=i[g.end=h.end]=g}else r[h.start]=i[h.end]=h;else h=[l],r[h.start=f]=i[h.end=d]=h});function s(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(i,r),u(r,i),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function Lb(e){return _m(e,vM.apply(this,arguments))}function vM(e,t,n){var r,i,o;if(arguments.length>1)r=g7(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:Pb(e,r)}}function g7(e,t,n){var r=[],i=[],o;function a(f){var d=f<0?~f:f;(i[d]||(i[d]=[])).push({i:f,g:o})}function s(f){f.forEach(a)}function u(f){f.forEach(s)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":s(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),i.forEach(n==null?function(f){r.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&r.push(f[0].i)}),r}x();x();x();x();x();x();x();x();x();function hn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}x();x();function zb(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function or(e){let t,n,r;e.length!==2?(t=hn,n=(s,u)=>hn(e(s),u),r=(s,u)=>e(s)-u):(t=e===hn||e===zb?e:b7,n=e,r=e);function i(s,u,l=0,c=s.length){if(l<c){if(t(u,u)!==0)return c;do{let f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(t(u,u)!==0)return c;do{let f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){let f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function b7(){return 0}x();function Lf(e){return e===null?NaN:+e}function*wM(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 EM=or(hn),Os=EM.right,Bb=EM.left,v7=or(Lf).center,Yr=Os;x();x();function Ub(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of e)(s=t(s,++a,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Am(e,t){let n=Ub(e,t);return n&&Math.sqrt(n)}x();var nt=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],a=t+o,s=Math.abs(t)<Math.abs(o)?t-(a-o):o-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){let t=this._partials,n=this._n,r,i,o,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}};x();var El=class extends Map{constructor(t,n=AM){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(qb(this,t))}has(t){return super.has(qb(this,t))}set(t,n){return super.set(SM(this,t),n)}delete(t){return super.delete(_M(this,t))}},So=class extends Set{constructor(t,n=AM){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(qb(this,t))}add(t){return super.add(SM(this,t))}delete(t){return super.delete(_M(this,t))}};function qb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function SM({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function _M({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function AM(e){return e!==null&&typeof e=="object"?e.valueOf():e}x();x();function km(e,t){return Array.from(t,n=>e[n])}function kM(e=hn){if(e===hn)return jb;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 jb(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}x();var w7=Math.sqrt(50),E7=Math.sqrt(10),S7=Math.sqrt(2);function Cm(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=w7?10:o>=E7?5:o>=S7?2:1,s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/l<e&&++s,u/l>t&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*l<e&&++s,u*l>t&&--u),u<s&&.5<=n&&n<2?Cm(e,t,n*2):[s,u,l]}function Is(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,o,a]=r?Cm(t,e,n):Cm(e,t,n);if(!(o>=i))return[];let s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function zf(e,t,n){return t=+t,e=+e,n=+n,Cm(e,t,n)[2]}function An(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?zf(t,e,n):zf(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}x();x();function wr(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}x();function Ps(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}x();function Fm(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?jb:kM(i);r>n;){if(r-n>600){let u=r-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(r,Math.floor(t+(u-l)*f/u+d));Fm(e,t,h,p,i)}let o=e[t],a=n,s=r;for(Bf(e,n,t),i(e[r],o)>0&&Bf(e,n,r);a<s;){for(Bf(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?Bf(e,n,s):(++s,Bf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Bf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ls(e,t,n){if(e=Float64Array.from(wM(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ps(e);if(t>=1)return wr(e);var r,i=(r-1)*t,o=Math.floor(i),a=wr(Fm(e,o).subarray(0,o+1)),s=Ps(e.subarray(o+1));return a+(s-a)*(i-o)}}function Uf(e,t,n=Lf){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),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}x();function Rm(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}x();function Sl(e,t){return Ls(e,.5,t)}x();function*A7(e){for(let t of e)yield*t}function _l(e){return Array.from(A7(e))}x();function xt(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}x();function Al(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}x();function Mm(e,...t){e=new So(e),t=t.map(k7);e:for(let n of e)for(let r of t)if(!r.has(n)){e.delete(n);continue e}return e}function k7(e){return e instanceof So?e:new So(e)}x();function $m(...e){let t=new So;for(let n of e)for(let r of n)t.add(r);return t}x();x();x();x();x();function CM(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function zs(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 Ti(e){return e=zs(Math.abs(e)),e?e[1]:NaN}x();function FM(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}x();function RM(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}x();var C7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ar(e){if(!(t=C7.exec(e)))throw new Error("invalid format: "+e);var t;return new Tm({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]})}ar.prototype=Tm.prototype;function Tm(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+""}Tm.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};x();function MM(e){e: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 e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}x();x();var Wb;function $M(e,t){var n=zs(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Wb=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+zs(e,Math.max(0,t+o-1))[0]}x();function Gb(e,t){var n=zs(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 Hb={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:CM,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)=>Gb(e*100,t),r:Gb,s:$M,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};x();function Yb(e){return e}var TM=Array.prototype.map,DM=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function qf(e){var t=e.grouping===void 0||e.thousands===void 0?Yb:FM(TM.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?Yb:RM(TM.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=ar(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,v=f.precision,w=f.trim,E=f.type;E==="n"?(b=!0,E="g"):Hb[E]||(v===void 0&&(v=12),w=!0,E="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",S=m==="$"?r:/[%p]/.test(E)?a:"",k=Hb[E],C=/[defgprs%]/.test(E);v=v===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function M(R){var P=_,D=S,$,F,T;if(E==="c")D=k(R)+D,R="";else{R=+R;var L=R<0||1/R<0;if(R=isNaN(R)?u:k(Math.abs(R),v),w&&(R=MM(R)),L&&+R==0&&p!=="+"&&(L=!1),P=(L?p==="("?p:s:p==="-"||p==="("?"":p)+P,D=(E==="s"?DM[8+Wb/3]:"")+D+(L&&p==="("?")":""),C){for($=-1,F=R.length;++$<F;)if(T=R.charCodeAt($),48>T||T>57){D=(T===46?i+R.slice($+1):R.slice($))+D,R=R.slice(0,$);break}}}b&&!g&&(R=t(R,1/0));var q=P.length+R.length+D.length,U=q<y?new Array(y-q+1).join(d):"";switch(b&&g&&(R=t(U+R,U.length?y-D.length:1/0),U=""),h){case"<":R=P+R+D+U;break;case"=":R=P+U+R+D;break;case"^":R=U.slice(0,q=U.length>>1)+P+R+D+U.slice(q);break;default:R=U+P+R+D;break}return o(R)}return M.toString=function(){return f+""},M}function c(f,d){var h=l((f=ar(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Ti(d)/3)))*3,m=Math.pow(10,-p),g=DM[8+p/3];return function(y){return h(m*y)+g}}return{format:l,formatPrefix:c}}var Dm,va,kl;Vb({thousands:",",grouping:[3],currency:["$",""]});function Vb(e){return Dm=qf(e),va=Dm.format,kl=Dm.formatPrefix,Dm}x();function jf(e){return Math.max(0,-Ti(Math.abs(e)))}x();function Wf(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ti(t)/3)))*3-Ti(Math.abs(e)))}x();function Gf(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ti(t)-Ti(e))+1}x();x();x();var Xb=new Date,Kb=new Date;function Ye(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 a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{let u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return u;let l;do u.push(l=new Date(+o)),t(o,s),e(o);while(l<o&&o<a);return u},i.filter=o=>Ye(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(Xb.setTime(+o),Kb.setTime(+a),e(Xb),e(Kb),Math.floor(n(Xb,Kb))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}x();var Vr=Ye(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Vr.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ye(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Vr);var NM=Vr.range;x();var pn=Ye(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),OM=pn.range;x();var wa=Ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),F7=wa.range,Ea=Ye(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),R7=Ea.range;x();var Sa=Ye(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()),M7=Sa.range,_a=Ye(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),$7=_a.range;x();var Yn=Ye(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),T7=Yn.range,Er=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),D7=Er.range,Nm=Ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),N7=Nm.range;x();function qs(e){return Ye(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 Sr=qs(0),Cl=qs(1),PM=qs(2),LM=qs(3),Aa=qs(4),zM=qs(5),BM=qs(6),UM=Sr.range,O7=Cl.range,I7=PM.range,P7=LM.range,L7=Aa.range,z7=zM.range,B7=BM.range;function js(e){return Ye(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 _r=js(0),Fl=js(1),qM=js(2),jM=js(3),ka=js(4),WM=js(5),GM=js(6),HM=_r.range,U7=Fl.range,q7=qM.range,j7=jM.range,W7=ka.range,G7=WM.range,H7=GM.range;x();var _o=Ye(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()),Y7=_o.range,Ao=Ye(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()),V7=Ao.range;x();var kn=Ye(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());kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(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 X7=kn.range,Cn=Ye(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());Cn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ye(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 K7=Cn.range;x();function VM(e,t,n,r,i,o){let a=[[pn,1,1e3],[pn,5,5*1e3],[pn,15,15*1e3],[pn,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 s(l,c,f){let d=c<l;d&&([l,c]=[c,l]);let h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){let d=Math.abs(c-l)/f,h=or(([,,g])=>g).right(a,d);if(h===a.length)return e.every(An(l/31536e6,c/31536e6,f));if(h===0)return Vr.every(Math.max(An(l,c,f),1));let[p,m]=a[d/a[h-1][2]<a[h][2]/d?h-1:h];return p.every(m)}return[s,u]}var[Qb,Jb]=VM(Cn,Ao,_r,Nm,_a,Ea),[Zb,ev]=VM(kn,_o,Sr,Yn,Sa,wa);var Bt="year",Fn="quarter",Zt="month",Et="week",Rn="date",Jt="day",Ni="dayofyear",Vn="hours",Xn="minutes",sr="seconds",Ar="milliseconds",Om=[Bt,Fn,Zt,Et,Rn,Jt,Ni,Vn,Xn,sr,Ar],tv=Om.reduce((e,t,n)=>(e[t]=1+n,e),{});function Im(e){let t=J(e).slice(),n={};return t.length||O("Missing time unit."),t.forEach(i=>{ee(tv,i)?n[i]=1:O(`Invalid time unit: ${i}.`)}),(n[Et]||n[Jt]?1:0)+(n[Fn]||n[Zt]||n[Rn]?1:0)+(n[Ni]?1:0)>1&&O(`Incompatible time units: ${e}`),t.sort((i,o)=>tv[i]-tv[o]),t}var J7={[Bt]:"%Y ",[Fn]:"Q%q ",[Zt]:"%b ",[Rn]:"%d ",[Et]:"W%U ",[Jt]:"%a ",[Ni]:"%j ",[Vn]:"%H:00",[Xn]:"00:%M",[sr]:":%S",[Ar]:".%L",[`${Bt}-${Zt}`]:"%Y-%m ",[`${Bt}-${Zt}-${Rn}`]:"%Y-%m-%d ",[`${Vn}-${Xn}`]:"%H:%M"};function sv(e,t){let n=he({},J7,t),r=Im(e),i=r.length,o="",a=0,s,u;for(a=0;a<i;)for(s=r.length;s>a;--s)if(u=r.slice(a,s).join("-"),n[u]!=null){o+=n[u],a=s;break}return o.trim()}var Ws=new Date;function uv(e){return Ws.setFullYear(e),Ws.setMonth(0),Ws.setDate(1),Ws.setHours(0,0,0,0),Ws}function lv(e){return QM(new Date(e))}function cv(e){return nv(new Date(e))}function QM(e){return Yn.count(uv(e.getFullYear())-1,e)}function nv(e){return Sr.count(uv(e.getFullYear())-1,e)}function rv(e){return uv(e).getDay()}function Z7(e,t,n,r,i,o,a){if(0<=e&&e<100){let s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function fv(e){return JM(new Date(e))}function dv(e){return iv(new Date(e))}function JM(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return Er.count(t-1,e)}function iv(e){let t=Date.UTC(e.getUTCFullYear(),0,1);return _r.count(t-1,e)}function ov(e){return Ws.setTime(Date.UTC(e,0,1)),Ws.getUTCDay()}function eU(e,t,n,r,i,o,a){if(0<=e&&e<100){let s=new Date(Date.UTC(-1,t,n,r,i,o,a));return s.setUTCFullYear(n.y),s}return new Date(Date.UTC(e,t,n,r,i,o,a))}function ZM(e,t,n,r,i){let o=t||1,a=ve(e),s=(y,b,v)=>(v=v||y,tU(n[v],r[v],y===a&&o,b)),u=new Date,l=$t(e),c=l[Bt]?s(Bt):tt(2012),f=l[Zt]?s(Zt):l[Fn]?s(Fn):Wr,d=l[Et]&&l[Jt]?s(Jt,1,Et+Jt):l[Et]?s(Et,1):l[Jt]?s(Jt,1):l[Rn]?s(Rn,1):l[Ni]?s(Ni,1):$i,h=l[Vn]?s(Vn):Wr,p=l[Xn]?s(Xn):Wr,m=l[sr]?s(sr):Wr,g=l[Ar]?s(Ar):Wr;return function(y){u.setTime(+y);let b=c(u);return i(b,f(u),d(u,b),h(u),p(u),m(u),g(u))}}function tU(e,t,n,r){let i=n<=1?e:r?(o,a)=>r+n*Math.floor((e(o,a)-r)/n):(o,a)=>n*Math.floor(e(o,a)/n);return t?(o,a)=>t(i(o,a),a):i}function Rl(e,t,n){return t+e*7-(n+6)%7}var nU={[Bt]:e=>e.getFullYear(),[Fn]:e=>Math.floor(e.getMonth()/3),[Zt]:e=>e.getMonth(),[Rn]:e=>e.getDate(),[Vn]:e=>e.getHours(),[Xn]:e=>e.getMinutes(),[sr]:e=>e.getSeconds(),[Ar]:e=>e.getMilliseconds(),[Ni]:e=>QM(e),[Et]:e=>nv(e),[Et+Jt]:(e,t)=>Rl(nv(e),e.getDay(),rv(t)),[Jt]:(e,t)=>Rl(1,e.getDay(),rv(t))},rU={[Fn]:e=>3*e,[Et]:(e,t)=>Rl(e,0,rv(t))};function hv(e,t){return ZM(e,t||1,nU,rU,Z7)}var iU={[Bt]:e=>e.getUTCFullYear(),[Fn]:e=>Math.floor(e.getUTCMonth()/3),[Zt]:e=>e.getUTCMonth(),[Rn]:e=>e.getUTCDate(),[Vn]:e=>e.getUTCHours(),[Xn]:e=>e.getUTCMinutes(),[sr]:e=>e.getUTCSeconds(),[Ar]:e=>e.getUTCMilliseconds(),[Ni]:e=>JM(e),[Et]:e=>iv(e),[Jt]:(e,t)=>Rl(1,e.getUTCDay(),ov(t)),[Et+Jt]:(e,t)=>Rl(iv(e),e.getUTCDay(),ov(t))},oU={[Fn]:e=>3*e,[Et]:(e,t)=>Rl(e,0,ov(t))};function pv(e,t){return ZM(e,t||1,iU,oU,eU)}var aU={[Bt]:kn,[Fn]:_o.every(3),[Zt]:_o,[Et]:Sr,[Rn]:Yn,[Jt]:Yn,[Ni]:Yn,[Vn]:Sa,[Xn]:wa,[sr]:pn,[Ar]:Vr},sU={[Bt]:Cn,[Fn]:Ao.every(3),[Zt]:Ao,[Et]:_r,[Rn]:Er,[Jt]:Er,[Ni]:Er,[Vn]:_a,[Xn]:Ea,[sr]:pn,[Ar]:Vr};function ko(e){return aU[e]}function Co(e){return sU[e]}function e$(e,t,n){return e?e.offset(t,n):void 0}function mv(e,t,n){return e$(ko(e),t,n)}function gv(e,t,n){return e$(Co(e),t,n)}function t$(e,t,n,r){return e?e.range(t,n,r):void 0}function yv(e,t,n,r){return t$(ko(e),t,n,r)}function xv(e,t,n,r){return t$(Co(e),t,n,r)}var Vf=1e3,Xf=Vf*60,Kf=Xf*60,Pm=Kf*24,uU=Pm*7,XM=Pm*30,av=Pm*365,n$=[Bt,Zt,Rn,Vn,Xn,sr,Ar],Qf=n$.slice(0,-1),Jf=Qf.slice(0,-1),Zf=Jf.slice(0,-1),lU=Zf.slice(0,-1),cU=[Bt,Et],KM=[Bt,Zt],r$=[Bt],Yf=[[Qf,1,Vf],[Qf,5,5*Vf],[Qf,15,15*Vf],[Qf,30,30*Vf],[Jf,1,Xf],[Jf,5,5*Xf],[Jf,15,15*Xf],[Jf,30,30*Xf],[Zf,1,Kf],[Zf,3,3*Kf],[Zf,6,6*Kf],[Zf,12,12*Kf],[lU,1,Pm],[cU,1,uU],[KM,1,XM],[KM,3,3*XM],[r$,1,av]];function bv(e){let t=e.extent,n=e.maxbins||40,r=Math.abs(wo(t))/n,i=or(s=>s[2]).right(Yf,r),o,a;return i===Yf.length?(o=r$,a=An(t[0]/av,t[1]/av,n)):i?(i=Yf[r/Yf[i-1][2]<Yf[i][2]/r?i-1:i],o=i[0],a=i[1]):(o=n$,a=Math.max(An(t[0],t[1],n),1)),{units:o,step:a}}x();x();x();function vv(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 wv(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 ed(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ml(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,l=td(i),c=nd(i),f=td(o),d=nd(o),h=td(a),p=nd(a),m=td(s),g=nd(s),y=td(u),b=nd(u),v={a:L,A:q,b:U,B:oe,c:null,d:l$,e:l$,f:DU,g:jU,G:GU,H:MU,I:$U,j:TU,L:p$,m:NU,M:OU,p:pe,q:fe,Q:d$,s:h$,S:IU,u:PU,U:LU,V:zU,w:BU,W:UU,x:null,X:null,y:qU,Y:WU,Z:HU,"%":f$},w={a:we,A:He,b:Ee,B:cn,c:null,d:c$,e:c$,f:KU,g:aq,G:uq,H:YU,I:VU,j:XU,L:g$,m:QU,M:JU,p:$s,q:ma,Q:d$,s:h$,S:ZU,u:eq,U:tq,V:nq,w:rq,W:iq,x:null,X:null,y:oq,Y:sq,Z:lq,"%":f$},E={a:M,A:R,b:P,B:D,c:$,d:s$,e:s$,f:kU,g:a$,G:o$,H:u$,I:u$,j:EU,L:AU,m:wU,M:SU,p:C,q:vU,Q:FU,s:RU,S:_U,u:mU,U:gU,V:yU,w:pU,W:xU,x:F,X:T,y:a$,Y:o$,Z:bU,"%":CU};v.x=_(n,v),v.X=_(r,v),v.c=_(t,v),w.x=_(n,w),w.X=_(r,w),w.c=_(t,w);function _(ae,Se){return function(_e){var K=[],Qt=-1,Le=0,Pt=ae.length,fn,go,LR;for(_e instanceof Date||(_e=new Date(+_e));++Qt<Pt;)ae.charCodeAt(Qt)===37&&(K.push(ae.slice(Le,Qt)),(go=i$[fn=ae.charAt(++Qt)])!=null?fn=ae.charAt(++Qt):go=fn==="e"?" ":"0",(LR=Se[fn])&&(fn=LR(_e,go)),K.push(fn),Le=Qt+1);return K.push(ae.slice(Le,Qt)),K.join("")}}function S(ae,Se){return function(_e){var K=ed(1900,void 0,1),Qt=k(K,ae,_e+="",0),Le,Pt;if(Qt!=_e.length)return null;if("Q"in K)return new Date(K.Q);if("s"in K)return new Date(K.s*1e3+("L"in K?K.L:0));if(Se&&!("Z"in K)&&(K.Z=0),"p"in K&&(K.H=K.H%12+K.p*12),K.m===void 0&&(K.m="q"in K?K.q:0),"V"in K){if(K.V<1||K.V>53)return null;"w"in K||(K.w=1),"Z"in K?(Le=wv(ed(K.y,0,1)),Pt=Le.getUTCDay(),Le=Pt>4||Pt===0?Fl.ceil(Le):Fl(Le),Le=Er.offset(Le,(K.V-1)*7),K.y=Le.getUTCFullYear(),K.m=Le.getUTCMonth(),K.d=Le.getUTCDate()+(K.w+6)%7):(Le=vv(ed(K.y,0,1)),Pt=Le.getDay(),Le=Pt>4||Pt===0?Cl.ceil(Le):Cl(Le),Le=Yn.offset(Le,(K.V-1)*7),K.y=Le.getFullYear(),K.m=Le.getMonth(),K.d=Le.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Pt="Z"in K?wv(ed(K.y,0,1)).getUTCDay():vv(ed(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Pt+5)%7:K.w+K.U*7-(Pt+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,wv(K)):vv(K)}}function k(ae,Se,_e,K){for(var Qt=0,Le=Se.length,Pt=_e.length,fn,go;Qt<Le;){if(K>=Pt)return-1;if(fn=Se.charCodeAt(Qt++),fn===37){if(fn=Se.charAt(Qt++),go=E[fn in i$?Se.charAt(Qt++):fn],!go||(K=go(ae,_e,K))<0)return-1}else if(fn!=_e.charCodeAt(K++))return-1}return K}function C(ae,Se,_e){var K=l.exec(Se.slice(_e));return K?(ae.p=c.get(K[0].toLowerCase()),_e+K[0].length):-1}function M(ae,Se,_e){var K=h.exec(Se.slice(_e));return K?(ae.w=p.get(K[0].toLowerCase()),_e+K[0].length):-1}function R(ae,Se,_e){var K=f.exec(Se.slice(_e));return K?(ae.w=d.get(K[0].toLowerCase()),_e+K[0].length):-1}function P(ae,Se,_e){var K=y.exec(Se.slice(_e));return K?(ae.m=b.get(K[0].toLowerCase()),_e+K[0].length):-1}function D(ae,Se,_e){var K=m.exec(Se.slice(_e));return K?(ae.m=g.get(K[0].toLowerCase()),_e+K[0].length):-1}function $(ae,Se,_e){return k(ae,t,Se,_e)}function F(ae,Se,_e){return k(ae,n,Se,_e)}function T(ae,Se,_e){return k(ae,r,Se,_e)}function L(ae){return a[ae.getDay()]}function q(ae){return o[ae.getDay()]}function U(ae){return u[ae.getMonth()]}function oe(ae){return s[ae.getMonth()]}function pe(ae){return i[+(ae.getHours()>=12)]}function fe(ae){return 1+~~(ae.getMonth()/3)}function we(ae){return a[ae.getUTCDay()]}function He(ae){return o[ae.getUTCDay()]}function Ee(ae){return u[ae.getUTCMonth()]}function cn(ae){return s[ae.getUTCMonth()]}function $s(ae){return i[+(ae.getUTCHours()>=12)]}function ma(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var Se=_(ae+="",v);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=S(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=_(ae+="",w);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=S(ae+="",!0);return Se.toString=function(){return ae},Se}}}var i$={"-":"",_:" ",0:"0"},Ut=/^\s*\d+/,fU=/^%/,dU=/[\\^$*+?|[\]().{}]/g;function De(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 hU(e){return e.replace(dU,"\\$&")}function td(e){return new RegExp("^(?:"+e.map(hU).join("|")+")","i")}function nd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function pU(e,t,n){var r=Ut.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mU(e,t,n){var r=Ut.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gU(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yU(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xU(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function o$(e,t,n){var r=Ut.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function a$(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bU(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 vU(e,t,n){var r=Ut.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wU(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function s$(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function EU(e,t,n){var r=Ut.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function u$(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function SU(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function _U(e,t,n){var r=Ut.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function AU(e,t,n){var r=Ut.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function kU(e,t,n){var r=Ut.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function CU(e,t,n){var r=fU.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function FU(e,t,n){var r=Ut.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function RU(e,t,n){var r=Ut.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function l$(e,t){return De(e.getDate(),t,2)}function MU(e,t){return De(e.getHours(),t,2)}function $U(e,t){return De(e.getHours()%12||12,t,2)}function TU(e,t){return De(1+Yn.count(kn(e),e),t,3)}function p$(e,t){return De(e.getMilliseconds(),t,3)}function DU(e,t){return p$(e,t)+"000"}function NU(e,t){return De(e.getMonth()+1,t,2)}function OU(e,t){return De(e.getMinutes(),t,2)}function IU(e,t){return De(e.getSeconds(),t,2)}function PU(e){var t=e.getDay();return t===0?7:t}function LU(e,t){return De(Sr.count(kn(e)-1,e),t,2)}function m$(e){var t=e.getDay();return t>=4||t===0?Aa(e):Aa.ceil(e)}function zU(e,t){return e=m$(e),De(Aa.count(kn(e),e)+(kn(e).getDay()===4),t,2)}function BU(e){return e.getDay()}function UU(e,t){return De(Cl.count(kn(e)-1,e),t,2)}function qU(e,t){return De(e.getFullYear()%100,t,2)}function jU(e,t){return e=m$(e),De(e.getFullYear()%100,t,2)}function WU(e,t){return De(e.getFullYear()%1e4,t,4)}function GU(e,t){var n=e.getDay();return e=n>=4||n===0?Aa(e):Aa.ceil(e),De(e.getFullYear()%1e4,t,4)}function HU(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+De(t/60|0,"0",2)+De(t%60,"0",2)}function c$(e,t){return De(e.getUTCDate(),t,2)}function YU(e,t){return De(e.getUTCHours(),t,2)}function VU(e,t){return De(e.getUTCHours()%12||12,t,2)}function XU(e,t){return De(1+Er.count(Cn(e),e),t,3)}function g$(e,t){return De(e.getUTCMilliseconds(),t,3)}function KU(e,t){return g$(e,t)+"000"}function QU(e,t){return De(e.getUTCMonth()+1,t,2)}function JU(e,t){return De(e.getUTCMinutes(),t,2)}function ZU(e,t){return De(e.getUTCSeconds(),t,2)}function eq(e){var t=e.getUTCDay();return t===0?7:t}function tq(e,t){return De(_r.count(Cn(e)-1,e),t,2)}function y$(e){var t=e.getUTCDay();return t>=4||t===0?ka(e):ka.ceil(e)}function nq(e,t){return e=y$(e),De(ka.count(Cn(e),e)+(Cn(e).getUTCDay()===4),t,2)}function rq(e){return e.getUTCDay()}function iq(e,t){return De(Fl.count(Cn(e)-1,e),t,2)}function oq(e,t){return De(e.getUTCFullYear()%100,t,2)}function aq(e,t){return e=y$(e),De(e.getUTCFullYear()%100,t,2)}function sq(e,t){return De(e.getUTCFullYear()%1e4,t,4)}function uq(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ka(e):ka.ceil(e),De(e.getUTCFullYear()%1e4,t,4)}function lq(){return"+0000"}function f$(){return"%"}function d$(e){return+e}function h$(e){return Math.floor(+e/1e3)}var $l,Tl,Lm,Dl,zm;Ev({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 Ev(e){return $l=Ml(e),Tl=$l.format,Lm=$l.parse,Dl=$l.utcFormat,zm=$l.utcParse,$l}function rd(e){let t={};return n=>t[n]||(t[n]=e(n))}function cq(e,t){return n=>{let r=e(n),i=r.indexOf(t);if(i<0)return r;let o=fq(r,i),a=o<r.length?r.slice(o):"";for(;--o>i;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+a}}function fq(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function b$(e){let t=rd(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){let i=ar(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return cq(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,o,a){a=ar(a??",f");let s=An(r,i,o),u=Math.max(Math.abs(r),Math.abs(i)),l;if(a.precision==null)switch(a.type){case"s":return isNaN(l=Wf(s,u))||(a.precision=l),n(a,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=Gf(s,u))||(a.precision=l-(a.type==="e"));break}case"f":case"%":{isNaN(l=jf(s))||(a.precision=l-(a.type==="%")*2);break}}return t(a)}}}var Sv;v$();function v$(){return Sv=b$({format:va,formatPrefix:kl})}function w$(e){return b$(qf(e))}function id(e){return arguments.length?Sv=w$(e):Sv}function x$(e,t,n){n=n||{},Q(n)||O(`Invalid time multi-format specifier: ${n}`);let r=t(sr),i=t(Xn),o=t(Vn),a=t(Rn),s=t(Et),u=t(Zt),l=t(Fn),c=t(Bt),f=e(n[Ar]||".%L"),d=e(n[sr]||":%S"),h=e(n[Xn]||"%I:%M"),p=e(n[Vn]||"%I %p"),m=e(n[Rn]||n[Jt]||"%a %d"),g=e(n[Et]||"%b %d"),y=e(n[Zt]||"%B"),b=e(n[Fn]||"%B"),v=e(n[Bt]||"%Y");return w=>(r(w)<w?f:i(w)<w?d:o(w)<w?h:a(w)<w?p:u(w)<w?s(w)<w?m:g:c(w)<w?l(w)<w?y:b:v)(w)}function E$(e){let t=rd(e.format),n=rd(e.utcFormat);return{timeFormat:r=>Z(r)?t(r):x$(t,ko,r),utcFormat:r=>Z(r)?n(r):x$(n,Co,r),timeParse:rd(e.parse),utcParse:rd(e.utcParse)}}var _v;S$();function S$(){return _v=E$({format:Tl,parse:Lm,utcFormat:Dl,utcParse:zm})}function _$(e){return E$(Ml(e))}function Gs(e){return arguments.length?_v=_$(e):_v}var Av=(e,t)=>he({},e,t);function Bm(e,t){let n=e?w$(e):id(),r=t?_$(t):Gs();return Av(n,r)}function od(e,t){let n=arguments.length;return n&&n!==2&&O("defaultLocale expects either zero or two arguments."),n?Av(id(e),Gs(t)):Av(id(),Gs())}function A$(){return v$(),S$(),od()}var dq=/^(data:|([A-Za-z]+:)?\/\/)/,hq=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,pq=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,k$="file://";function mq(e){return t=>({options:t||{},sanitize:yq,load:gq,fileAccess:!1,file:xq(),http:vq})}async function gq(e,t){let n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t?.http)}async function yq(e,t){t=he({},this.options,t);let n=this.fileAccess,r={href:null},i,o,a,s=hq.test(e.replace(pq,""));(e==null||typeof e!="string"||!s)&&O("Sanitize failure, invalid URI: "+G(e));let u=dq.test(e);return(a=t.baseURL)&&!u&&(!e.startsWith("/")&&!a.endsWith("/")&&(e="/"+e),e=a+e),o=(i=e.startsWith(k$))||t.mode==="file"||t.mode!=="http"&&!u&&n,i?e=e.slice(k$.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function xq(e){return bq}async function bq(){O("No file system access.")}async function vq(e,t){let n=he({},this.options.http,t),r=t&&t.response,i=await fetch(e,n);return i.ok?de(i[r])?i[r]():i.text():O(i.status+""+i.statusText)}var wq=e=>e!=null&&e===e,Eq=e=>e==="true"||e==="false"||e===!0||e===!1,Sq=e=>!Number.isNaN(Date.parse(e)),F$=e=>!Number.isNaN(+e)&&!(e instanceof Date),_q=e=>F$(e)&&Number.isInteger(+e),kv={boolean:Nf,integer:yt,number:yt,date:Of,string:If,unknown:ct},Um=[Eq,_q,F$,Sq],Aq=["boolean","integer","number","date"];function R$(e,t){if(!e||!e.length)return"unknown";let n=e.length,r=Um.length,i=Um.map((o,a)=>a+1);for(let o=0,a=0,s,u;o<n;++o)for(u=t?e[o][t]:e[o],s=0;s<r;++s)if(i[s]&&wq(u)&&!Um[s](u)&&(i[s]=0,++a,a===Um.length))return"string";return Aq[i.reduce((o,a)=>o===0?a:o,0)-1]}function M$(e,t){return t.reduce((n,r)=>(n[r]=R$(e,r),n),{})}function C$(e){let t=function(n,r){let i={delimiter:e};return Cv(n,r?he(r,i):i)};return t.responseType="text",t}function Cv(e,t){return t.header&&(e=t.header.map(G).join(t.delimiter)+`
|
|
8
|
+
`+e),Nb(t.delimiter).parse(e+"")}Cv.responseType="text";function kq(e){return typeof A=="function"&&de(A.isBuffer)?A.isBuffer(e):!1}function Fv(e,t){let n=t&&t.property?zt(t.property):ct;return Q(e)&&!kq(e)?Cq(n(e),t):n(JSON.parse(e))}Fv.responseType="json";function Cq(e,t){return!I(e)&&Ab(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}var Fq={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function $$(e,t){let n,r,i,o;return e=Fv(e,t),t&&t.feature?(n=Ib,i=t.feature):t&&t.mesh?(n=Lb,i=t.mesh,o=Fq[t.filter]):O("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):O("Invalid TopoJSON object: "+i),r&&r.features||[r]}$$.responseType="json";var qm={dsv:Cv,csv:C$(","),tsv:C$(" "),json:Fv,topojson:$$};function Rv(e,t){return arguments.length>1?(qm[e]=t,this):ee(qm,e)?qm[e]:null}function Mv(e){let t=Rv(e);return t&&t.responseType||"text"}function $v(e,t,n,r){t=t||{};let i=Rv(t.type||"json");return i||O("Unknown data format type: "+t.type),e=i(e,t),t.parse&&Rq(e,t.parse,n,r),ee(e,"columns")&&delete e.columns,e}function Rq(e,t,n,r){if(!e.length)return;let i=Gs();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),a,s,u,l,c,f;t==="auto"&&(t=M$(e,o)),o=Object.keys(t);let d=o.map(h=>{let p=t[h],m,g;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return m=p.split(/:(.+)?/,2),g=m[1],(g[0]==="'"&&g[g.length-1]==="'"||g[0]==='"'&&g[g.length-1]==='"')&&(g=g.slice(1,-1)),(m[0]==="utc"?r:n)(g);if(!kv[p])throw Error("Illegal format pattern: "+h+":"+p);return kv[p]});for(u=0,c=e.length,f=o.length;u<c;++u)for(a=e[u],l=0;l<f;++l)s=o[l],a[s]=d[l](a[s])}var Nl=mq();function Hm(e){let t=e||ct,n=[],r={};return n.add=i=>{let o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{let o=t(i);if(r[o]){r[o]=0;let a=n.indexOf(i);a>=0&&n.splice(a,1)}return n},n}async function ud(e,t){try{await t(e)}catch(n){e.error(n)}}var L$=Symbol("vega_id"),Mq=1;function Hs(e){return!!(e&&ue(e))}function ue(e){return e[L$]}function z$(e,t){return e[L$]=t,e}function Ce(e){let t=e===Object(e)?e:{data:e};return ue(t)?t:z$(t,Mq++)}function Ym(e){return Ys(e,Ce({}))}function Ys(e,t){for(let n in e)t[n]=e[n];return t}function Vm(e,t){return z$(t,ue(e))}function Ii(e,t){return e?t?(n,r)=>e(n,r)||ue(t(n))-ue(t(r)):(n,r)=>e(n,r)||ue(n)-ue(r):null}function Dv(e){return e&&e.constructor===$o}function $o(){let e=[],t=[],n=[],r=[],i=[],o=null,a=!1;return{constructor:$o,insert(s){let u=J(s),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(s){let u=de(s)?r:t,l=J(s),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(s,u,l){let c={field:u,value:tt(l)};return de(s)?(c.filter=s,i.push(c)):(c.tuple=s,n.push(c)),this},encode(s,u){return de(s)?i.push({filter:s,field:u}):n.push({tuple:s,field:u}),this},clean(s){return o=s,this},reflow(){return a=!0,this},pulse(s,u){let l={},c={},f,d,h,p,m,g;for(f=0,d=u.length;f<d;++f)l[ue(u[f])]=1;for(f=0,d=t.length;f<d;++f)m=t[f],l[ue(m)]=-1;for(f=0,d=r.length;f<d;++f)p=r[f],u.forEach(b=>{p(b)&&(l[ue(b)]=-1)});for(f=0,d=e.length;f<d;++f)m=e[f],g=ue(m),l[g]?l[g]=1:s.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)m=u[f],l[ue(m)]<0&&s.rem.push(m);function y(b,v,w){w?b[v]=w(b):s.encode=v,a||(c[ue(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=l[ue(m)],g>0&&(y(m,p,h.value),s.modifies(p));for(f=0,d=i.length;f<d;++f)h=i[f],p=h.filter,u.forEach(b=>{p(b)&&l[ue(b)]>0&&y(b,h.field,h.value)}),s.modifies(h.field);if(a)s.mod=t.length||r.length?u.filter(b=>l[ue(b)]>0):u.slice();else for(g in c)s.mod.push(c[g]);return(o||o==null&&(t.length||r.length))&&s.clean(!0),s}}}var Wm="_:mod:_";function ld(){Object.defineProperty(this,Wm,{writable:!0,value:{}})}ld.prototype={set(e,t,n,r){let i=this,o=i[e],a=i[Wm];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=I(n)?1+n.length:-1),i},modified(e,t){let n=this[Wm];if(arguments.length){if(I(e)){for(let r=0;r<e.length;++r)if(n[e[r]])return!0;return!1}}else{for(let r in n)if(n[r])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Wm]={},this}};var $q=0,Tq="pulse",Dq=new ld,Nq=1,Oq=2;function ze(e,t,n,r){this.id=++$q,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,r)}function T$(e){return function(t){let n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}ze.prototype={targets(){return this._targets||(this._targets=Hm(vl))},set(e){return this.value!==e?(this.value=e,1):0},skip:T$(Nq),modified:T$(Oq),parameters(e,t,n){t=t!==!1;let r=this._argval=this._argval||new ld,i=this._argops=this._argops||[],o=[],a,s,u,l,c=(f,d,h)=>{h instanceof ze?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(a in e)if(s=e[a],a===Tq)J(s).forEach(f=>{f instanceof ze?f!==this&&(f.targets().add(this),o.push(f)):O("Pulse parameters must be operator instances.")}),this.source=s;else if(I(s))for(r.set(a,-1,Array(u=s.length)),l=0;l<u;++l)c(a,l,s[l]);else c(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(e){let t=this._argval||Dq,n=this._argops,r,i,o,a;if(n){let s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===e,t.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){let e=this._argops,t,n,r,i;if(e)for(t=0,n=e.length;t<n;++t)r=e[t],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){let t=this._update;if(t){let n=this.marshall(e.stamp),r=t.call(this,n,e);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function Iq(e,t,n,r){let i=1,o;return e instanceof ze?o=e:e&&e.prototype instanceof ze?o=new e:de(e)?o=new ze(null,e):(i=0,o=new ze(e,t)),this.rank(o),i&&(r=n,n=t),n&&this.connect(o,o.parameters(n,r)),this.touch(o),o}function Pq(e,t){let n=e.rank,r=t.length;for(let i=0;i<r;++i)if(n<t[i].rank){this.rerank(e);return}}var Lq=0;function Il(e,t,n){this.id=++Lq,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Ca(e,t,n){return new Il(e,t,n)}Il.prototype={_filter:Mt,_apply:ct,targets(){return this._targets||(this._targets=Hm(vl))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){let t=this.value=this._apply(e),n=this._targets,r=n?n.length:0;for(let i=0;i<r;++i)n[i].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){let t=Ca(e);return this.targets().add(t),t},apply(e){let t=Ca(null,e);return this.targets().add(t),t},merge(){let e=Ca();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{let n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){let t=Ca();return this.targets().add(Ca(null,null,Tf(e,n=>{let r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Ca(null,null,()=>n=!0)),t.targets().add(Ca(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Mt,this._targets=null}};function zq(e,t,n,r){let i=this,o=Ca(n,r),a=function(l){l.dataflow=i;try{o.receive(l)}catch(c){i.error(c)}finally{i.run()}},s;typeof e=="string"&&typeof document<"u"?s=document.querySelectorAll(e):s=J(e);let u=s.length;for(let l=0;l<u;++l)s[l].addEventListener(t,a);return o}function Bq(e,t){let n=this.locale();return $v(e,t,n.timeParse,n.utcParse)}function Uq(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function qq(e,t){let n=this,r=0,i;try{i=await n.loader().load(e,{context:"dataflow",response:Mv(t&&t.type)});try{i=n.parse(i,t)}catch(o){r=-2,n.warn("Data ingestion failed",e,o)}}catch(o){r=-1,n.warn("Loading failed",e,o)}return{data:i,status:r}}async function jq(e,t,n){let r=this,i=r._pending||Wq(r);i.requests+=1;let o=await r.request(t,n);return r.pulse(e,r.changeset().remove(Mt).insert(o.data||[])),i.done(),o}function Wq(e){let t,n=new Promise(r=>t=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}var Gq={skip:!0};function Hq(e,t,n,r,i){return(e instanceof ze?Vq:Yq)(this,e,t,n,r,i),this}function Yq(e,t,n,r,i,o){let a=he({},o,Gq),s,u;de(n)||(n=tt(n)),r===void 0?s=l=>e.touch(n(l)):de(r)?(u=new ze(null,r,i,!1),s=l=>{u.evaluate(l);let c=n(l),f=u.value;Dv(f)?e.pulse(c,f,o):e.update(c,f,a)}):s=l=>e.update(n(l),r,a),t.apply(s)}function Vq(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{let a=o||{},s=new ze(null,Xq(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}function Xq(e,t){return t=de(t)?t:tt(t),e?function(n,r){let i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function Kq(e){e.rank=++this._rank}function Qq(e){let t=[e],n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&O("Cycle detected in dataflow graph.")}var Gm={},Oi=1,Fa=2,Fo=4,Jq=Oi|Fa,D$=Oi|Fo,Ol=Oi|Fa|Fo,N$=8,ad=16,O$=32,I$=64;function Ro(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Tv(e,t){let n=[];return Eo(e,t,r=>n.push(r)),n}function P$(e,t){let n={};return e.visit(t,r=>{n[ue(r)]=1}),r=>n[ue(r)]?null:r}function jm(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}Ro.prototype={StopPropagation:Gm,ADD:Oi,REM:Fa,MOD:Fo,ADD_REM:Jq,ADD_MOD:D$,ALL:Ol,REFLOW:N$,SOURCE:ad,NO_SOURCE:O$,NO_FIELDS:I$,fork(e){return new Ro(this.dataflow).init(this,e)},clone(){let e=this.fork(Ol);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(Ol|ad)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ro(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){let n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&I$)&&(n.fields=e.fields),t&Oi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Fa?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Fo?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&O$?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){let t=e||Ol;return t&Oi&&this.add.length||t&Fa&&this.rem.length||t&Fo&&this.mod.length},reflow(e){if(e)return this.fork(Ol).reflow();let t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Fo,P$(this,Oi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){let t=this.fields||(this.fields={});return I(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){let n=this.fields;return(t||this.mod.length)&&n?arguments.length?I(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){let n=this;return e&Oi&&(n.addF=jm(n.addF,t)),e&Fa&&(n.remF=jm(n.remF,t)),e&Fo&&(n.modF=jm(n.modF,t)),e&ad&&(n.srcF=jm(n.srcF,t)),n},materialize(e){e=e||Ol;let t=this;return e&Oi&&t.addF&&(t.add=Tv(t.add,t.addF),t.addF=null),e&Fa&&t.remF&&(t.rem=Tv(t.rem,t.remF),t.remF=null),e&Fo&&t.modF&&(t.mod=Tv(t.mod,t.modF),t.modF=null),e&ad&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){let n=this,r=t;if(e&ad)return Eo(n.source,n.srcF,r),n;e&Oi&&Eo(n.add,n.addF,r),e&Fa&&Eo(n.rem,n.remF,r),e&Fo&&Eo(n.mod,n.modF,r);let i=n.source;if(e&N$&&i){let o=n.add.length+n.mod.length;o===i.length||(o?Eo(i,P$(n,D$),r):Eo(i,n.srcF,r))}return n}};function Xm(e,t,n,r){let i=this,o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let a of n)if(a.stamp===t){if(a.fields){let s=i.fields||(i.fields={});for(let u in a.fields)s[u]=1}a.changed(i.ADD)&&(o|=i.ADD),a.changed(i.REM)&&(o|=i.REM),a.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}W(Xm,Ro,{fork(e){let t=new Ro(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){let t=this,n=t.fields;return n&&t.changes&t.MOD?I(e)?e.some(r=>n[r]):n[e]:0},filter(){O("MultiPulse does not support filtering.")},materialize(){O("MultiPulse does not support materialization.")},visit(e,t){let n=this,r=n.pulses,i=r.length,o=0;if(e&n.SOURCE)for(;o<i;++o)r[o].visit(e,t);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(e,t);return n}});async function Zq(e,t,n){let r=this,i=[];if(r._pulse)return B$(r);if(r._pending&&await r._pending,t&&await ud(r,t),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;let o=++r._clock;r._pulse=new Ro(r,o,e),r._touched.forEach(c=>r._enqueue(c,!0)),r._touched=Hm(vl);let a=0,s,u,l;try{for(;r._heap.size()>0;){if(s=r._heap.pop(),s.rank!==s.qrank){r._enqueue(s,!0);continue}u=s.run(r._getPulse(s,e)),u.then?u=await u:u.async&&(i.push(u.async),u=Gm),u!==Gm&&s._targets&&s._targets.forEach(c=>r._enqueue(c)),++a}}catch(c){r._heap.clear(),l=c}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${a} operators`),l&&(r._postrun=[],r.error(l)),r._postrun.length){let c=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;f<c.length;++f)await ud(r,c[f].callback)}return n&&await ud(r,n),i.length&&Promise.all(i).then(c=>r.runAsync(null,()=>{c.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function ej(e,t,n){for(;this._running;)await this._running;let r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function tj(e,t,n){return this._pulse?B$(this):(this.evaluate(e,t,n),this)}function nj(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function B$(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function rj(e,t){let n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function ij(e,t){let n=e.source,r=this._clock;return n&&I(n)?new Xm(this,r,n.map(i=>i.pulse),t):this._input[e.id]||oj(this._pulse,n&&n.pulse)}function oj(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Gm&&(e.source=t.source),e)}var Nv={skip:!1,force:!1};function aj(e,t){let n=t||Nv;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function sj(e,t,n){let r=n||Nv;return(e.set(t)||r.force)&&this.touch(e,r),this}function uj(e,t,n){this.touch(e,n||Nv);let r=new Ro(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function lj(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),U$(t,0,t.length-1,e)),pop:()=>{let n=t.pop(),r;return t.length?(r=t[0],t[0]=n,cj(t,0,e)):r=n,r}}}function U$(e,t,n,r){let i,o,a=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(a,i)<0){e[n]=i,n=o;continue}break}return e[n]=a}function cj(e,t,n){let r=t,i=e.length,o=e[t],a=(t<<1)+1,s;for(;a<i;)s=a+1,s<i&&n(e[a],e[s])>=0&&(a=s),e[t]=e[a],t=a,a=(t<<1)+1;return e[t]=o,U$(e,r,t,n)}function Ra(){this.logger(Ns()),this.logLevel(xm),this._clock=0,this._rank=0,this._locale=od();try{this._loader=Nl()}catch{}this._touched=Hm(vl),this._input={},this._pulse=null,this._heap=lj((e,t)=>e.qrank-t.qrank),this._postrun=[]}function sd(e){return function(){return this._log[e].apply(this,arguments)}}Ra.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:sd("error"),warn:sd("warn"),info:sd("info"),debug:sd("debug"),logLevel:sd("level"),cleanThreshold:1e4,add:Iq,connect:Pq,rank:Kq,rerank:Qq,pulse:uj,touch:aj,update:sj,changeset:$o,ingest:Uq,parse:Bq,preload:jq,request:qq,events:zq,on:Hq,evaluate:Zq,run:tj,runAsync:ej,runAfter:nj,_enqueue:rj,_getPulse:ij};function N(e,t){ze.call(this,e,null,t)}W(N,ze,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){let t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});var Mo={};function Km(e){let t=Ov(e);return t&&t.Definition||null}function Ov(e){return e=e&&e.toLowerCase(),ee(Mo,e)?Mo[e]:null}var w2={};Sn(w2,{aggregate:()=>Ma,bin:()=>Qv,collect:()=>Jv,compare:()=>Z$,countpattern:()=>Zv,cross:()=>e2,density:()=>t2,dotbin:()=>r2,expression:()=>iT,extent:()=>i2,facet:()=>gg,field:()=>oT,filter:()=>a2,flatten:()=>s2,fold:()=>u2,formula:()=>l2,generate:()=>aT,impute:()=>c2,joinaggregate:()=>f2,kde:()=>d2,key:()=>sT,load:()=>uT,lookup:()=>h2,multiextent:()=>lT,multivalues:()=>cT,params:()=>fT,pivot:()=>p2,prefacet:()=>dT,project:()=>m2,proxy:()=>hT,quantile:()=>g2,relay:()=>pT,sample:()=>y2,sequence:()=>x2,sieve:()=>mT,subflow:()=>o2,timeunit:()=>b2,tupleindex:()=>yT,values:()=>xT,window:()=>v2});x();x();function*W$(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function Qm(e,t,n){let r=Float64Array.from(W$(e,n));return r.sort(hn),t.map(i=>Uf(r,i))}function Jm(e,t){return Qm(e,[.25,.5,.75],t)}function Zm(e,t){let n=e.length,r=Am(e,t),i=Jm(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Iv(e){let t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2],o=e.extent[0],a=e.extent[1],s,u,l,c,f,d,h=e.span||a-o||Math.abs(o)||1;if(e.step)s=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);s=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/r),l=e.minstep||0,s=Math.max(l,Math.pow(n,Math.round(Math.log(h)/r)-u));Math.ceil(h/s)>t;)s*=n;for(f=0,d=i.length;f<d;++f)c=s/i[f],c>=l&&h/c<=t&&(s=c)}c=Math.log(s);let p=c>=0?0:~~(-c/r)+1,m=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/s+m)*s,o=o<c?c-s:c,a=Math.ceil(a/s)*s),{start:o,stop:a===o?o+s:a,step:s}}var Mn=Math.random;function fj(e){Mn=e}function Pv(e,t,n,r){if(!e.length)return[void 0,void 0];let i=Float64Array.from(W$(e,r)),o=i.length,a=t,s,u,l,c;for(l=0,c=Array(a);l<a;++l){for(s=0,u=0;u<o;++u)s+=i[~~(Mn()*o)];c[l]=s/o}return c.sort(hn),[Ls(c,n/2),Ls(c,1-n/2)]}function Lv(e,t,n,r){r=r||(d=>d);let i=e.length,o=new Float64Array(i),a=0,s=1,u=r(e[0]),l=u,c=u+t,f;for(;s<i;++s){if(f=r(e[s]),f>=c){for(l=(u+l)/2;a<s;++a)o[a]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;a<s;++a)o[a]=l;return n?dj(o,t+t/4):o}function dj(e,t){let n=e.length,r=0,i=1,o,a;for(;e[r]===e[i];)++i;for(;i<n;){for(o=i+1;e[i]===e[o];)++o;if(e[i]-e[i-1]<t){for(a=i+(r+o-i-i>>1);a<i;)e[a++]=e[i];for(;a>i;)e[a--]=e[r]}r=i,i=o}return e}function hj(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function pj(e,t){t==null&&(t=e,e=0);let n,r,i,o={min(a){return arguments.length?(n=a||0,i=r-n,o):n},max(a){return arguments.length?(r=a||0,i=r-n,o):r},sample(){return n+Math.floor(i*Mn())},pdf(a){return a===Math.floor(a)&&a>=n&&a<r?1/i:0},cdf(a){let s=Math.floor(a);return s<n?0:s>=r?1:(s-n+1)/i},icdf(a){return a>=0&&a<=1?n-1+Math.floor(a*i):NaN}};return o.min(e).max(t)}var G$=Math.sqrt(2*Math.PI),mj=Math.SQRT2,cd=NaN;function fd(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(cd===cd)n=cd,cd=NaN;else{do n=Mn()*2-1,r=Mn()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,cd=r*o}return e+n*t}function eg(e,t,n){n=n??1;let r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*G$)}function dd(e,t,n){t=t||0,n=n??1;let r=(e-t)/n,i=Math.abs(r),o;if(i>37)o=0;else{let a=Math.exp(-i*i/2),s;i<7.07106781186547?(s=.0352624965998911*i+.700383064443688,s=s*i+6.37396220353165,s=s*i+33.912866078383,s=s*i+112.079291497871,s=s*i+221.213596169931,s=s*i+220.206867912376,o=a*s,s=.0883883476483184*i+1.75566716318264,s=s*i+16.064177579207,s=s*i+86.7807322029461,s=s*i+296.564248779674,s=s*i+637.333633378831,s=s*i+793.826512519948,s=s*i+440.413735824752,o=o/s):(s=i+.65,s=i+4/s,s=i+3/s,s=i+2/s,s=i+1/s,o=a/s/2.506628274631)}return r>0?1-o:o}function hd(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*mj*gj(2*e-1)}function gj(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}function tg(e,t){let n,r,i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>fd(n,r),pdf:o=>eg(o,n,r),cdf:o=>dd(o,n,r),icdf:o=>hd(o,n,r)};return i.mean(e).stdev(t)}function ng(e,t){let n=tg(),r=0,i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Zm(e)),i):t},sample(){return e[~~(Mn()*r)]+t*n.sample()},pdf(o){let a=0,s=0;for(;s<r;++s)a+=n.pdf((o-e[s])/t);return a/t/r},cdf(o){let a=0,s=0;for(;s<r;++s)a+=n.cdf((o-e[s])/t);return a/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(e)}function rg(e,t){return e=e||0,t=t??1,Math.exp(e+fd()*t)}function ig(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;let r=(Math.log(e)-t)/n;return Math.exp(-.5*r*r)/(n*G$*e)}function og(e,t,n){return dd(Math.log(e),t,n)}function ag(e,t,n){return Math.exp(hd(e,t,n))}function zv(e,t){let n,r,i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>rg(n,r),pdf:o=>ig(o,n,r),cdf:o=>og(o,n,r),icdf:o=>ag(o,n,r)};return i.mean(e).stdev(t)}function Bv(e,t){let n=0,r;function i(a){let s=[],u=0,l;for(l=0;l<n;++l)u+=s[l]=a[l]==null?1:+a[l];for(l=0;l<n;++l)s[l]/=u;return s}let o={weights(a){return arguments.length?(r=i(t=a||[]),o):t},distributions(a){return arguments.length?(a?(n=a.length,e=a):(n=0,e=[]),o.weights(t)):e},sample(){let a=Mn(),s=e[n-1],u=r[0],l=0;for(;l<n-1;u+=r[++l])if(a<u){s=e[l];break}return s.sample()},pdf(a){let s=0,u=0;for(;u<n;++u)s+=r[u]*e[u].pdf(a);return s},cdf(a){let s=0,u=0;for(;u<n;++u)s+=r[u]*e[u].cdf(a);return s},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function sg(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Mn()}function ug(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function lg(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function cg(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Uv(e,t){let n,r,i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>sg(n,r),pdf:o=>ug(o,n,r),cdf:o=>lg(o,n,r),icdf:o=>cg(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function fg(e,t,n){let r=0,i=0;for(let o of e){let a=n(o);t(o)==null||a==null||isNaN(a)||(r+=(a-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function pd(e,t,n,r){let i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function dg(e,t,n,r){e=e.filter(h=>{let p=t(h),m=n(h);return p!=null&&(p=+p)>=p&&m!=null&&(m=+m)>=m}),r&&e.sort((h,p)=>t(h)-t(p));let i=e.length,o=new Float64Array(i),a=new Float64Array(i),s=0,u=0,l=0,c,f,d;for(d of e)o[s]=c=+t(d),a[s]=f=+n(d),++s,u+=(c-u)/s,l+=(f-l)/s;for(s=0;s<i;++s)o[s]-=u,a[s]-=l;return[o,a,u,l]}function md(e,t,n,r){let i=-1,o,a;for(let s of e)o=t(s),a=n(s),o!=null&&(o=+o)>=o&&a!=null&&(a=+a)>=a&&r(o,a,++i)}function Pl(e,t,n,r,i){let o=0,a=0;return md(e,t,n,(s,u)=>{let l=u-i(s),c=u-r;o+=l*l,a+=c*c}),1-o/a}function hg(e,t,n){let r=0,i=0,o=0,a=0,s=0;md(e,t,n,(c,f)=>{++s,r+=(c-r)/s,i+=(f-i)/s,o+=(c*f-o)/s,a+=(c*c-a)/s});let u=pd(r,i,o,a),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Pl(e,t,n,i,l)}}function qv(e,t,n){let r=0,i=0,o=0,a=0,s=0;md(e,t,n,(c,f)=>{++s,c=Math.log(c),r+=(c-r)/s,i+=(f-i)/s,o+=(c*f-o)/s,a+=(c*c-a)/s});let u=pd(r,i,o,a),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Pl(e,t,n,i,l)}}function jv(e,t,n){let[r,i,o,a]=dg(e,t,n),s=0,u=0,l=0,c=0,f=0,d,h,p;md(e,t,n,(b,v)=>{d=r[f++],h=Math.log(v),p=d*v,s+=(v*h-s)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});let[m,g]=pd(u/a,s/a,l/a,c/a),y=b=>Math.exp(m+g*(b-o));return{coef:[Math.exp(m-g*o),g],predict:y,rSquared:Pl(e,t,n,a,y)}}function Wv(e,t,n){let r=0,i=0,o=0,a=0,s=0,u=0;md(e,t,n,(f,d)=>{let h=Math.log(f),p=Math.log(d);++u,r+=(h-r)/u,i+=(p-i)/u,o+=(h*p-o)/u,a+=(h*h-a)/u,s+=(d-s)/u});let l=pd(r,i,o,a),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Pl(e,t,n,s,c)}}function pg(e,t,n){let[r,i,o,a]=dg(e,t,n),s=r.length,u=0,l=0,c=0,f=0,d=0,h,p,m,g;for(h=0;h<s;)p=r[h],m=i[h++],g=p*p,u+=(g-u)/h,l+=(g*p-l)/h,c+=(g*g-c)/h,f+=(p*m-f)/h,d+=(g*m-d)/h;let y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,w=(f*y-d*l)/b,E=-v*u,_=S=>(S=S-o,v*S*S+w*S+E+a);return{coef:[E-w*o+v*o*o+a,w-2*v*o,v],predict:_,rSquared:Pl(e,t,n,a,_)}}function Gv(e,t,n,r){if(r===0)return fg(e,t,n);if(r===1)return hg(e,t,n);if(r===2)return pg(e,t,n);let[i,o,a,s]=dg(e,t,n),u=i.length,l=[],c=[],f=r+1,d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d)*o[p];for(l.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<u;++p)m+=Math.pow(i[p],d+h);g[h]=m}c.push(g)}c.push(l);let y=xj(c),b=v=>{v-=a;let w=s+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)w+=y[d]*Math.pow(v,d);return w};return{coef:yj(f,y,-a,s),predict:b,rSquared:Pl(e,t,n,s,b)}}function yj(e,t,n,r){let i=Array(e),o,a,s,u;for(o=0;o<e;++o)i[o]=0;for(o=e-1;o>=0;--o)for(s=t[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}function xj(e){let t=e.length-1,n=[],r,i,o,a,s;for(r=0;r<t;++r){for(a=r,i=r+1;i<t;++i)Math.abs(e[r][i])>Math.abs(e[r][a])&&(a=i);for(o=r;o<t+1;++o)s=e[o][r],e[o][r]=e[o][a],e[o][a]=s;for(i=r+1;i<t;++i)for(o=t;o>=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o<t;++o)s+=e[o][i]*n[o];n[i]=(e[t][i]-s)/e[i][i]}return n}var q$=2,j$=1e-12;function Hv(e,t,n,r){let[i,o,a,s]=dg(e,t,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=q$;){let p=[0,l-1];for(let g=0;g<u;++g){let y=i[g],b=p[0],v=p[1],w=y-i[b]>i[v]-y?b:v,E=0,_=0,S=0,k=0,C=0,M=1/Math.abs(i[w]-y||1);for(let D=b;D<=v;++D){let $=i[D],F=o[D],T=bj(Math.abs(y-$)*M)*d[D],L=$*T;E+=T,_+=L,S+=F*T,k+=F*L,C+=$*L}let[R,P]=pd(_/E,S/E,k/E,C/E);c[g]=R+P*y,f[g]=Math.abs(o[g]-c[g]),vj(i,g+1,p)}if(h===q$)break;let m=Sl(f);if(Math.abs(m)<j$)break;for(let g=0,y,b;g<u;++g)y=f[g]/(6*m),d[g]=y>=1?j$:(b=1-y*y)*b}return wj(i,c,a,s)}function bj(e){return(e=1-e*e*e)*e*e}function vj(e,t,n){let r=e[t],i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function wj(e,t,n,r){let i=e.length,o=[],a=0,s=0,u=[],l;for(;a<i;++a)l=e[a]+n,u[0]===l?u[1]+=(t[a]-u[1])/++s:(s=0,u[1]+=r,u=[l,t[a]],o.push(u));return u[1]+=r,o}var Ej=.5*Math.PI/180;function Ll(e,t,n,r){n=n||25,r=Math.max(n,r||200);let i=m=>[m,e(m)],o=t[0],a=t[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let m=1;m<r;++m)l.push(i(o+m/n*s));return l.push(i(a)),l}else{c.push(i(a));for(let m=n;--m>0;)c.push(i(o+m/n*s))}let f=l[0],d=c[c.length-1],h=1/s,p=Sj(f[1],c);for(;d;){let m=i((f[0]+d[0])/2);m[0]-f[0]>=u&&_j(f,m,d,h,p)>Ej?c.push(m):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function Sj(e,t){let n=e,r=e,i=t.length;for(let o=0;o<i;++o){let a=t[o][1];a<n&&(n=a),a>r&&(r=a)}return 1/(r-n)}function _j(e,t,n,r,i){let o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Aj(e){return t=>{let n=e.length,r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}}function Xv(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:Aj(e)}function V$(e,t,n){return n||e+(t?"_"+t:"")}var Yv=()=>{},kj={init:Yv,add:Yv,rem:Yv,idx:0},gd={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},xd=Object.keys(gd).filter(e=>e!=="__count__");function Cj(e,t){return(n,r)=>he({name:e,aggregate_param:r,out:n||e},kj,t)}[...xd,"__count__"].forEach(e=>{gd[e]=Cj(e,gd[e])});function X$(e,t,n){return gd[e](n,t)}function K$(e,t){return e.idx-t.idx}function Fj(e){let t={};e.forEach(r=>t[r.name]=r);let n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=gd[i]())})};return e.forEach(n),Object.values(t).sort(K$)}function Rj(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function Mj(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function $j(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function Tj(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function Q$(e,t){let n=t||ct,r=Fj(e),i=e.slice().sort(K$);function o(a){this._ops=r,this._out=i,this.cell=a,this.init()}return o.prototype.init=Rj,o.prototype.add=Mj,o.prototype.rem=$j,o.prototype.set=Tj,o.prototype.get=n,o.fields=e.map(a=>a.out),o}function Kv(e){this._key=e?zt(e):ue,this.reset()}var en=Kv.prototype;en.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};en.add=function(e){this._add.push(e)};en.rem=function(e){this._rem.push(e)};en.values=function(){if(this._get=null,this._rem.length===0)return this._add;let e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={},s,u,l;for(s=0;s<i;++s)a[n(t[s])]=1;for(s=0,u=0;s<r;++s)a[n(l=e[s])]?a[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o};en.distinct=function(e){let t=this.values(),n={},r=t.length,i=0,o;for(;--r>=0;)o=e(t[r])+"",ee(n,o)||(n[o]=1,++i);return i};en.extent=function(e){if(this._get!==e||!this._ext){let t=this.values(),n=Sb(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};en.argmin=function(e){return this.extent(e)[0]||{}};en.argmax=function(e){return this.extent(e)[1]||{}};en.min=function(e){let t=this.extent(e)[0];return t!=null?e(t):void 0};en.max=function(e){let t=this.extent(e)[1];return t!=null?e(t):void 0};en.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Jm(this.values(),e),this._get=e),this._q};en.q1=function(e){return this.quartile(e)[0]};en.q2=function(e){return this.quartile(e)[1]};en.q3=function(e){return this.quartile(e)[2]};en.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=Pv(this.values(),1e3,.05,e),this._get=e),this._ci};en.ci0=function(e){return this.ci(e)[0]};en.ci1=function(e){return this.ci(e)[1]};function Ma(e){N.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Ma.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:xd},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};W(Ma,N,{transform(e,t){let n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){let e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(s){let u,l,c,f;for(u in s)for(c=s[u].tuple,l=0;l<i;++l)r[l][f=c[n[l]]]=f}o(e._prev),o(t);function a(s,u,l){let c=n[l],f=r[l++];for(let d in f){let h=s?s+"|"+d:d;u[c]=f[d],l<i?a(h,u,l):t[h]||e.cell(h,u)}}a("",{},0)},init(e){let t=this._inputs=[],n=this._outputs=[],r={};function i(b){let v=J(Rt(b)),w=v.length,E=0,_;for(;E<w;++E)r[_=v[E]]||(r[_]=1,t.push(_))}this._dims=J(e.groupby),this._dnames=this._dims.map(b=>{let v=Ke(b);return i(b),n.push(v),v}),this.cellkey=e.key?e.key:Xv(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];let o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],u=e.as||[],l=o.length,c={},f,d,h,p,m,g,y;for(l!==a.length&&O("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=a[y],h=s[y]||null,f==null&&d!=="count"&&O("Null aggregate field specified."),m=Ke(f),g=V$(d,m,u[y]),n.push(g),d==="count"){this._counts.push(g);continue}p=c[m],p||(i(f),p=c[m]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(X$(d,h,g))}return this._measures=this._measures.map(b=>Q$(b,b.field)),Object.create(null)},cellkey:Xv(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){let n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){let r=this._measures,i=r.length;n.agg=Array(i);for(let o=0;o<i;++o)n.agg[o]=new r[o](n)}return n.store&&(n.data=new Kv),n},newtuple(e,t){let n=this._dnames,r=this._dims,i=r.length,o={};for(let a=0;a<i;++a)o[n[a]]=r[a](e);return t?Vm(t.tuple,o):Ce(o)},clean(){let e=this.value;for(let t in e)e[t].num===0&&delete e[t]},add(e){let t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);let r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].add(r[i].get(e),e)},rem(e){let t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);let r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].rem(r[i].get(e),e)},celltuple(e){let t=e.tuple,n=this._counts;e.store&&e.data.values();for(let r=0,i=n.length;r<i;++r)t[n[r]]=e.num;if(!this._countOnly){let r=e.agg;for(let i=0,o=r.length;i<o;++i)r[i].set(t)}return t},changes(e){let t=this._adds,n=this._mods,r=this._prev,i=this._drop,o=e.add,a=e.rem,s=e.mod,u,l,c,f;if(r)for(l in r)u=r[l],(!i||u.num)&&a.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&i?a:s).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});var Dj=1e-14;function Qv(e){N.call(this,null,e)}Qv.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};W(Qv,N,{transform(e,t){let n=e.interval!==!1,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],s=a[0],u=a[1],l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Rt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{let f=r(c);c[s]=f,c[u]=f==null?null:i+o*(1+(f-i)/o)}:c=>c[s]=r(c)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;let t=e.field,n=Iv(e),r=n.step,i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,a,s;(a=e.anchor)!=null&&(s=a-(i+r*Math.floor((a-i)/r)),i+=s,o+=s);let u=function(l){let c=yt(t(l));return c==null?null:c<i?-1/0:c>o?1/0:(c=Math.max(i,Math.min(c,o-r)),i+r*Math.floor(Dj+(c-i)/r))};return u.start=i,u.stop=n.stop,u.step=r,this.value=dn(u,Rt(t),e.name||"bin_"+Ke(t))}});function J$(e,t,n){let r=e,i=t||[],o=n||[],a={},s=0;return{add:u=>o.push(u),remove:u=>a[r(u)]=++s,size:()=>i.length,data:(u,l)=>(s&&(i=i.filter(c=>!a[r(c)]),a={},s=0),l&&u&&i.sort(u),o.length&&(i=u?Fb(u,i,o.sort(u)):i.concat(o),o=[]),i)}}function Jv(e){N.call(this,[],e)}Jv.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};W(Jv,N,{transform(e,t){let n=t.fork(t.ALL),r=J$(ue,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(Ii(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function Z$(e){ze.call(this,null,Nj,e)}W(Z$,ze);function Nj(e){return this.value&&!e.modified()?this.value:$f(e.fields,e.orders)}function Zv(e){N.call(this,null,e)}Zv.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function Oj(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}W(Zv,N,{transform(e,t){let n=f=>d=>{for(var h=Oj(s(d),e.case,o)||[],p,m=0,g=h.length;m<g;++m)a.test(p=h[m])||f(p)},r=this._parameterCheck(e,t),i=this._counts,o=this._match,a=this._stop,s=e.field,u=e.as||["text","count"],l=n(f=>i[f]=1+(i[f]||0)),c=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){let n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS),s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=Ce({}),u[i]=s,u[o]=l,a.add.push(u)):l===0?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(t)}});function e2(e){N.call(this,null,e)}e2.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};W(e2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter"),s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=Ij(s,i,o,e.filter||Mt)):n.mod=s,n.source=this.value,n.modifies(r)}});function Ij(e,t,n,r){for(var i=[],o={},a=e.length,s=0,u,l;s<a;++s)for(o[t]=l=e[s],u=0;u<a;++u)o[n]=e[u],r(o)&&(i.push(Ce(o)),o={},o[t]=l);return i}var H$={kde:ng,mixture:Bv,normal:tg,lognormal:zv,uniform:Uv},Pj="distributions",Y$="function",Lj="field";function eT(e,t){let n=e[Y$];ee(H$,n)||O("Unknown distribution function: "+n);let r=H$[n]();for(let i in e)i===Lj?r.data((e.from||t()).map(e[i])):i===Pj?r[i](e[i].map(o=>eT(o,t))):typeof r[i]===Y$&&r[i](e[i]);return r}function t2(e){N.call(this,null,e)}var tT=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],zj={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:tT},{name:"weights",type:"number",array:!0}]};t2.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:tT.concat(zj)},{name:"as",type:"string",array:!0,default:["value","density"]}]};W(t2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=eT(e.distribution,Bj(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200,a=e.method||"pdf";a!=="pdf"&&a!=="cdf"&&O("Invalid density method: "+a),!e.extent&&!r.data&&O("Missing density extent parameter."),a=r[a];let s=e.as||["value","density"],u=e.extent||_n(r.data()),l=Ll(a,u,i,o).map(c=>{let f={};return f[s[0]]=c[0],f[s[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Bj(e){return()=>e.materialize(e.SOURCE).source}function nT(e,t){return e?e.map((n,r)=>t[r]||Ke(n)):null}function n2(e,t,n){let r=[],i=f=>f(u),o,a,s,u,l,c;if(t==null)r.push(e.map(n));else for(o={},a=0,s=e.length;a<s;++a)u=e[a],l=t.map(i),c=o[l],c||(o[l]=c=[],c.dims=l,r.push(c)),c.push(n(u));return r}var rT="bin";function r2(e){N.call(this,null,e)}r2.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:rT}]};var Uj=(e,t)=>wo(_n(e,t))/30;W(r2,N,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;let n=t.materialize(t.SOURCE).source,r=n2(t.source,e.groupby,ct),i=e.smooth||!1,o=e.field,a=e.step||Uj(n,o),s=Ii((p,m)=>o(p)-o(m)),u=e.as||rT,l=r.length,c=1/0,f=-1/0,d=0,h;for(;d<l;++d){let p=r[d].sort(s);h=-1;for(let m of Lv(p,a,i,o))m<c&&(c=m),m>f&&(f=m),p[++h][u]=m}return this.value={start:c,stop:f,step:a},t.reflow(!0).modifies(u)}});function iT(e){ze.call(this,null,qj,e),this.modified(!0)}W(iT,ze);function qj(e){let t=e.expr;return this.value&&!e.modified("expr")?this.value:dn(n=>t(n,e),Rt(t),Ke(t))}function i2(e){N.call(this,[void 0,void 0],e)}i2.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};W(i2,N,{transform(e,t){let n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field"),o=n[0],a=n[1];if((i||o==null)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,s=>{let u=yt(r(s));u!=null&&(u<o&&(o=u),u>a&&(a=u))}),!Number.isFinite(o)||!Number.isFinite(a)){let s=Ke(r);s&&(s=` for field "${s}"`),t.dataflow.warn(`Infinite extent${s}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}});function o2(e,t){ze.call(this,e),this.parent=t,this.count=0}W(o2,ze,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function gg(e){N.call(this,{},e),this._keys=xa();let t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;r<i;++r)n(t[r],r,t)}}W(gg,N,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){let i=this.value,o=ee(i,e)&&i[e],a,s;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(s=r||(s=this._group[e])&&s.tuple,a=n.dataflow,o=new o2(n.fork(n.NO_SOURCE),this),a.add(o).connect(t(a,e,s)),i[e]=o,this.activate(o)),o},clean(){let e=this.value,t=0;for(let n in e)if(e[n].count===0){let r=e[n].detachSubflow;r&&r(),delete e[n],++t}if(t){let n=this._targets.filter(r=>r&&r.count>0);this.initTargets(n)}},initTargets(e){let t=this._targets,n=t.length,r=e?e.length:0,i=0;for(;i<r;++i)t[i]=e[i];for(;i<n&&t[i]!=null;++i)t[i]=null;t.active=r},transform(e,t){let n=t.dataflow,r=e.key,i=e.subflow,o=this._keys,a=e.modified("key"),s=u=>this.subflow(u,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{let l=ue(u),c=o.get(l);c!==void 0&&(o.delete(l),s(c).rem(u))}),t.visit(t.ADD,u=>{let l=r(u);o.set(ue(u),l),s(l).add(u)}),a||t.modified(r.fields)?t.visit(t.MOD,u=>{let l=ue(u),c=o.get(l),f=r(u);c===f?s(f).mod(u):(o.set(l,f),s(c).rem(u),s(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{s(o.get(ue(u))).mod(u)}),a&&t.visit(t.REFLOW,u=>{let l=ue(u),c=o.get(l),f=r(u);c!==f&&(o.set(l,f),s(c).rem(u),s(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function oT(e){ze.call(this,null,jj,e)}W(oT,ze);function jj(e){return this.value&&!e.modified()?this.value:I(e.name)?J(e.name).map(t=>zt(t)):zt(e.name,e.as)}function a2(e){N.call(this,xa(),e)}a2.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};W(a2,N,{transform(e,t){let n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,u=e.expr,l=!0;t.visit(t.REM,f=>{let d=ue(f);r.has(d)?r.delete(d):a.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):r.set(ue(f),1)});function c(f){let d=ue(f),h=u(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),a.push(f)):l&&h&&!p&&s.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function s2(e){N.call(this,[],e)}s2.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};W(s2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=nT(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,s=>{let u=r.map(p=>p(s)),l=u.reduce((p,m)=>Math.max(p,m.length),0),c=0,f,d,h;for(;c<l;++c){for(d=Ym(s),f=0;f<a;++f)d[i[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}});function u2(e){N.call(this,[],e)}u2.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};W(u2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=r.map(Ke),o=e.as||["key","value"],a=o[0],s=o[1],u=r.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Ym(l),f[a]=i[c],f[s]=r[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function l2(e){N.call(this,null,e)}l2.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};W(l2,N,{transform(e,t){let n=e.expr,r=e.as,i=e.modified(),o=e.initonly?t.ADD:i?t.SOURCE:t.modified(n.fields)||t.modified(r)?t.ADD_MOD:t.ADD;return i&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(r),t.visit(o,a=>a[r]=n(a,e))}});function aT(e){N.call(this,[],e)}W(aT,N,{transform(e,t){let n=t.fork(t.ALL),r=e.generator,i=this.value,o=e.size-i.length,a,s,u;if(o>0){for(a=[];--o>=0;)a.push(u=Ce(r(e))),i.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(a):a}else s=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(s):s,i=i.slice(-o);return n.source=this.value=i,n}});var mg={value:"value",median:Sl,mean:Rm,min:Ps,max:wr},Wj=[];function c2(e){N.call(this,[],e)}c2.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function Gj(e){var t=e.method||mg.value,n;if(mg[t]==null)O("Unrecognized imputation method: "+t);else return t===mg.value?(n=e.value!==void 0?e.value:0,()=>n):mg[t]}function Hj(e){let t=e.field;return n=>n?t(n):NaN}W(c2,N,{transform(e,t){var n=t.fork(t.ALL),r=Gj(e),i=Hj(e),o=Ke(e.field),a=Ke(e.key),s=(e.groupby||[]).map(Ke),u=Yj(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,m,g,y,b,v,w,E;for(g=0,v=u.length;g<v;++g)for(d=u[g],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(m=u.domain[b],E={_impute:!0},y=0,w=p.length;y<w;++y)E[s[y]]=p[y];E[a]=m,E[o]=Number.isNaN(h)?h=r(d,i):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function Yj(e,t,n,r){var i=y=>y(g),o=[],a=r?r.slice():[],s={},u={},l,c,f,d,h,p,m,g;for(a.forEach((y,b)=>s[y]=b+1),d=0,m=e.length;d<m;++d)g=e[d],p=n(g),h=s[p]||(s[p]=a.push(p)),c=(l=t?t.map(i):Wj)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=g;return o.domain=a,o}function f2(e){Ma.call(this,e)}f2.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:xd},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};W(f2,Ma,{transform(e,t){let n=this,r=e.modified(),i;return n.value&&(r||t.modified(n._inputs,!0))?(i=n.value=r?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{he(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){let e=this._adds,t=this._mods,n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(e[n]),e[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function d2(e){N.call(this,null,e)}d2.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};W(d2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=n2(r,e.groupby,e.field),o=(e.groupby||[]).map(Ke),a=e.bandwidth,s=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[],c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;s!=="pdf"&&s!=="cdf"&&O("Invalid density method: "+s),e.resolve==="shared"&&(c||(c=_n(r,e.field)),f=d=e.steps||d),i.forEach(h=>{let p=ng(h,a)[s],m=e.counts?h.length:1,g=c||_n(h);Ll(p,g,f,d).forEach(y=>{let b={};for(let v=0;v<o.length;++v)b[o[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*m,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function sT(e){ze.call(this,null,Vj,e)}W(sT,ze);function Vj(e){return this.value&&!e.modified()?this.value:Df(e.fields,e.flat)}function uT(e){N.call(this,[],e),this._pending=null}W(uT,N,{transform(e,t){let n=t.dataflow;return this._pending?Vv(this,t,this._pending):Xj(e)?t.StopPropagation:e.values?Vv(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(i=>(this._pending=J(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>Vv(this,t,J(r.data)))}});function Xj(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Vv(e,t,n){n.forEach(Ce);let r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function h2(e){N.call(this,{},e)}h2.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};W(h2,N,{transform(e,t){let n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,a=e.modified(),s=n.length,u=a?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return i?(d=i.length,s>1&&!c&&O('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==s*d&&O('The "as" parameter has too few output field names.'),c=c||i.map(Ke),f=function(p){for(var m=0,g=0,y,b;m<s;++m)if(b=r.get(n[m](p)),b==null)for(y=0;y<d;++y,++g)p[c[g]]=o;else for(y=0;y<d;++y,++g)p[c[g]]=i[y](b)}):(c||O("Missing output field names."),f=function(p){for(var m=0,g;m<s;++m)g=r.get(n[m](p)),p[c[m]]=g??o}),a?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function lT(e){ze.call(this,null,Kj,e)}W(lT,ze);function Kj(e){if(this.value&&!e.modified())return this.value;let t=e.extents,n=t.length,r=1/0,i=-1/0,o,a;for(o=0;o<n;++o)a=t[o],a[0]<r&&(r=a[0]),a[1]>i&&(i=a[1]);return[r,i]}function cT(e){ze.call(this,null,Qj,e)}W(cT,ze);function Qj(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function fT(e){N.call(this,null,e)}W(fT,N,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function p2(e){Ma.call(this,e)}p2.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:xd,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};W(p2,Ma,{_transform:Ma.prototype.transform,transform(e,t){return this._transform(Jj(e,t),t)}});function Jj(e,t){let n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=Rt(n).concat(Rt(r)),a=eW(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:a.map(()=>i),fields:a.map(s=>Zj(s,n,r,o)),as:a.map(s=>s+""),modified:e.modified.bind(e)}}function Zj(e,t,n,r){return dn(i=>t(i)===e?n(i):NaN,r,e+"")}function eW(e,t,n){let r={},i=[];return n.visit(n.SOURCE,o=>{let a=e(o);r[a]||(r[a]=1,i.push(a))}),i.sort(vo),t?i.slice(0,t):i}function dT(e){gg.call(this,e)}W(dT,gg,{transform(e,t){let n=e.subflow,r=e.field,i=o=>this.subflow(ue(o),n,t,o);return(e.modified("field")||r&&t.modified(Rt(r)))&&O("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{let a=i(o);r(o).forEach(s=>a.mod(s))}),t.visit(t.ADD,o=>{let a=i(o);r(o).forEach(s=>a.add(Ce(s)))}),t.visit(t.REM,o=>{let a=i(o);r(o).forEach(s=>a.rem(s))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function m2(e){N.call(this,null,e)}m2.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};W(m2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.fields,i=nT(e.fields,e.as||[]),o=r?(s,u)=>tW(s,u,r,i):Ys,a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,s=>{let u=ue(s);n.rem.push(a[u]),a[u]=null}),t.visit(t.ADD,s=>{let u=o(s,Ce({}));a[ue(s)]=u,n.add.push(u)}),t.visit(t.MOD,s=>{n.mod.push(o(s,a[ue(s)]))}),n}});function tW(e,t,n,r){for(let i=0,o=n.length;i<o;++i)t[r[i]]=n[i](e);return t}function hT(e){N.call(this,null,e)}W(hT,N,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function g2(e){N.call(this,null,e)}g2.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};var nW=1e-14;W(g2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;let i=t.materialize(t.SOURCE).source,o=n2(i,e.groupby,e.field),a=(e.groupby||[]).map(Ke),s=[],u=e.step||.01,l=e.probs||xt(u/2,1-nW,u),c=l.length;return o.forEach(f=>{let d=Qm(f,l);for(let h=0;h<c;++h){let p={};for(let m=0;m<a.length;++m)p[a[m]]=f.dims[m];p[r[0]]=l[h],p[r[1]]=d[h],s.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=s,n}});function pT(e){N.call(this,null,e)}W(pT,N,{transform(e,t){let n,r;return this.value?r=this.value:(n=t=t.addAll(),r=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,i=>{let o=ue(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{let o=Ym(i);r[ue(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{let o=r[ue(i)];for(let a in i)o[a]=i[a],n.modifies(a);n.mod.push(o)})),n}});function y2(e){N.call(this,[],e),this.count=0}y2.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};W(y2,N,{transform(e,t){let n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((c,f)=>(c[ue(f)]=1,c),{}),a=this.value,s=this.count,u=0;function l(c){let f,d;a.length<i?a.push(c):(d=~~((s+1)*Mn()),d<a.length&&d>=u&&(f=a[d],o[ue(f)]&&n.rem.push(f),a[d]=c)),++s}if(t.rem.length&&(t.visit(t.REM,c=>{let f=ue(c);o[f]&&(o[f]=-1,n.rem.push(c)),--s}),a=a.filter(c=>o[ue(c)]!==-1)),(t.rem.length||r)&&a.length<i&&t.source&&(u=s=a.length,t.visit(t.SOURCE,c=>{o[ue(c)]||l(c)}),u=-1),r&&a.length>i){let c=a.length-i;for(let f=0;f<c;++f)o[ue(a[f])]=-1,n.rem.push(a[f]);a=a.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ue(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=a.filter(c=>!o[ue(c)])),this.count=s,this.value=n.source=a,n}});function x2(e){N.call(this,null,e)}x2.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};W(x2,N,{transform(e,t){if(this.value&&!e.modified())return;let n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=xt(e.start,e.stop,e.step||1).map(i=>{let o={};return o[r]=i,Ce(o)}),n.add=t.add.concat(this.value),n}});function mT(e){N.call(this,null,e),this.modified(!0)}W(mT,N,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function b2(e){N.call(this,null,e)}var gT=["unit0","unit1"];b2.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Om,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:gT}]};W(b2,N,{transform(e,t){let n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),a=(i?Co:ko)(o.unit).offset,s=e.as||gT,u=s[0],l=s[1],c=o.step,f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Rt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{let m=n(p),g,y;m==null?(p[u]=null,r&&(p[l]=null)):(p[u]=g=y=o(m),r&&(p[l]=y=a(g,c)),g<f&&(f=g),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(r?s:u)},_floor(e,t){let n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:bv({extent:e.extent||_n(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Im(r),a=this.value||{},s=(n?pv:hv)(o,i);return s.unit=ve(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}});function yT(e){N.call(this,xa(),e)}W(yT,N,{transform(e,t){let n=t.dataflow,r=e.field,i=this.value,o=s=>i.set(r(s),s),a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,s=>i.delete(r(s))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function xT(e){N.call(this,null,e)}W(xT,N,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ii(e.sort)):t.source).map(e.field))}});function rW(e,t,n,r){let i=yd[e](t,n);return{init:i.init||Wr,update:function(o,a){a[r]=i.next(o)}}}var yd={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{let n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){let e=yd.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{let n=t.data,r=t.compare,i=t.index;if(e<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;e=i}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||O("ntile num must be greater than zero.");let n=yd.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{let r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{let r=n.index+t,i=n.data;return r<i.length?e(i[r]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||O("nth_value nth must be greater than zero."),{next:n=>{let r=n.i0+(t-1);return r<n.i1?e(n.data[r]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{let r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{let i=r.data;return r.index<=n?t:(n=iW(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function iW(e,t,n){for(let r=t.length;n<r;++n)if(e(t[n])!=null)return n;return-1}var oW=Object.keys(yd);function bT(e){let t=J(e.ops),n=J(e.fields),r=J(e.params),i=J(e.aggregate_params),o=J(e.as),a=this.outputs=[],s=this.windows=[],u={},l={},c=[],f=[],d=!0;function h(p){J(Rt(p)).forEach(m=>u[m]=1)}h(e.sort),t.forEach((p,m)=>{let g=n[m],y=r[m],b=i[m]||null,v=Ke(g),w=V$(p,v,o[m]);if(h(g),a.push(w),ee(yd,p))s.push(rW(p,g,y,w));else{if(g==null&&p!=="count"&&O("Null aggregate field specified."),p==="count"){c.push(w);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=g,f.push(E)),E.push(X$(p,b,w))}}),(c.length||f.length)&&(this.cell=aW(f,c,d)),this.inputs=Object.keys(u)}var vT=bT.prototype;vT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};vT.update=function(e,t){let n=this.cell,r=this.windows,i=e.data,o=r&&r.length,a;if(n){for(a=e.p0;a<e.i0;++a)n.rem(i[a]);for(a=e.p1;a<e.i1;++a)n.add(i[a]);n.set(t)}for(a=0;a<o;++a)r[a].update(e,t)};function aW(e,t,n){e=e.map(u=>Q$(u,u.field));let r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new e[a](r);if(r.store)var s=r.data=new Kv;return r.add=function(u){if(r.num+=1,!n){s&&s.add(u);for(let l=0;l<i;++l)o[l].add(o[l].get(u),u)}},r.rem=function(u){if(r.num-=1,!n){s&&s.rem(u);for(let l=0;l<i;++l)o[l].rem(o[l].get(u),u)}},r.set=function(u){let l,c;for(s&&s.values(),l=0,c=t.length;l<c;++l)u[t[l]]=r.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},r.init=function(){r.num=0,s&&s.reset();for(let u=0;u<i;++u)o[u].init()},r}function v2(e){N.call(this,{},e),this._mlen=0,this._mods=[]}v2.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:oW.concat(xd)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};W(v2,N,{transform(e,t){this.stamp=t.stamp;let n=e.modified(),r=Ii(e.sort),i=Xv(e.groupby),o=s=>this.group(i(s)),a=this.state;(!a||n)&&(a=this.state=new bT(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,s=>o(s).add(s))):(t.visit(t.REM,s=>o(s).remove(s)),t.visit(t.ADD,s=>o(s).add(s)));for(let s=0,u=this._mlen;s<u;++s)sW(this._mods[s],a,r,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(a.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=J$(ue),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function sW(e,t,n,r){let i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],s=e.data(n),u=s.length,l=o?or(i):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||tt(-1)};t.init();for(let f=0;f<u;++f)uW(c,a,f,u),o&&lW(c,l),t.update(c,s[f])}function uW(e,t,n,r){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?r:Math.min(r,n+Math.abs(t[1])+1),e.index=n}function lW(e,t){let n=e.i0,r=e.i1-1,i=e.compare,o=e.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(e.i1=t.right(o,o[r]))}var NE={};Sn(NE,{bound:()=>IN,identifier:()=>DE,mark:()=>PN,overlap:()=>LN,render:()=>BN,viewlayout:()=>qN});x();x();x();x();x();function Me(e){return function(){return e}}x();var E2=Math.abs,tn=Math.atan2,$a=Math.cos,wT=Math.max,yg=Math.min,Xr=Math.sin,To=Math.sqrt,qt=1e-12,Ta=Math.PI,bd=Ta/2,xg=2*Ta;function ET(e){return e>1?0:e<-1?Ta:Math.acos(e)}function S2(e){return e>=1?bd:e<=-1?-bd:Math.asin(e)}x();x();x();var _2=Math.PI,A2=2*_2,Vs=1e-6,cW=A2-Vs;function ST(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function fW(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ST;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 Xs=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ST:fW(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,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}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 a=this._x1,s=this._y1,u=r-t,l=i-n,c=a-t,f=s-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Vs)if(!(Math.abs(f*u-l*c)>Vs)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-a,p=i-s,m=u*u+l*l,g=h*h+p*p,y=Math.sqrt(m),b=Math.sqrt(d),v=o*Math.tan((_2-Math.acos((m+d-g)/(2*y*b)))/2),w=v/b,E=v/y;Math.abs(w-1)>Vs&&this._append`L${t+w*c},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>c*p)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=t+s,c=n+u,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Vs||Math.abs(this._y1-c)>Vs)&&this._append`L${l},${c}`,r&&(d<0&&(d=d%A2+A2),d>cW?this._append`A${r},${r},0,1,${f},${t-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:d>Vs&&this._append`A${r},${r},0,${+(d>=_2)},${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 Ks(){return new Xs}Ks.prototype=Xs.prototype;function Da(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 Xs(t)}function dW(e){return e.innerRadius}function hW(e){return e.outerRadius}function pW(e){return e.startAngle}function mW(e){return e.endAngle}function gW(e){return e&&e.padAngle}function yW(e,t,n,r,i,o,a,s){var u=n-e,l=r-t,c=a-i,f=s-o,d=f*u-c*l;if(!(d*d<qt))return d=(c*(t-o)-f*(e-i))/d,[e+d*u,t+d*l]}function bg(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/To(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=n+c,m=r+f,g=(d+p)/2,y=(h+m)/2,b=p-d,v=m-h,w=b*b+v*v,E=i-o,_=d*m-p*h,S=(v<0?-1:1)*To(wT(0,E*E*w-_*_)),k=(_*v-b*S)/w,C=(-_*b-v*S)/w,M=(_*v+b*S)/w,R=(-_*b+v*S)/w,P=k-g,D=C-y,$=M-g,F=R-y;return P*P+D*D>$*$+F*F&&(k=M,C=R),{cx:k,cy:C,x01:-c,y01:-f,x11:k*(i/E-1),y11:C*(i/E-1)}}function k2(){var e=dW,t=hW,n=Me(0),r=null,i=pW,o=mW,a=gW,s=null,u=Da(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-bd,m=o.apply(this,arguments)-bd,g=E2(m-p),y=m>p;if(s||(s=c=u()),h<d&&(f=h,h=d,d=f),!(h>qt))s.moveTo(0,0);else if(g>xg-qt)s.moveTo(h*$a(p),h*Xr(p)),s.arc(0,0,h,p,m,!y),d>qt&&(s.moveTo(d*$a(m),d*Xr(m)),s.arc(0,0,d,m,p,y));else{var b=p,v=m,w=p,E=m,_=g,S=g,k=a.apply(this,arguments)/2,C=k>qt&&(r?+r.apply(this,arguments):To(d*d+h*h)),M=yg(E2(h-d)/2,+n.apply(this,arguments)),R=M,P=M,D,$;if(C>qt){var F=S2(C/d*Xr(k)),T=S2(C/h*Xr(k));(_-=F*2)>qt?(F*=y?1:-1,w+=F,E-=F):(_=0,w=E=(p+m)/2),(S-=T*2)>qt?(T*=y?1:-1,b+=T,v-=T):(S=0,b=v=(p+m)/2)}var L=h*$a(b),q=h*Xr(b),U=d*$a(E),oe=d*Xr(E);if(M>qt){var pe=h*$a(v),fe=h*Xr(v),we=d*$a(w),He=d*Xr(w),Ee;if(g<Ta)if(Ee=yW(L,q,we,He,pe,fe,U,oe)){var cn=L-Ee[0],$s=q-Ee[1],ma=pe-Ee[0],ae=fe-Ee[1],Se=1/Xr(ET((cn*ma+$s*ae)/(To(cn*cn+$s*$s)*To(ma*ma+ae*ae)))/2),_e=To(Ee[0]*Ee[0]+Ee[1]*Ee[1]);R=yg(M,(d-_e)/(Se-1)),P=yg(M,(h-_e)/(Se+1))}else R=P=0}S>qt?P>qt?(D=bg(we,He,L,q,h,P,y),$=bg(pe,fe,U,oe,h,P,y),s.moveTo(D.cx+D.x01,D.cy+D.y01),P<M?s.arc(D.cx,D.cy,P,tn(D.y01,D.x01),tn($.y01,$.x01),!y):(s.arc(D.cx,D.cy,P,tn(D.y01,D.x01),tn(D.y11,D.x11),!y),s.arc(0,0,h,tn(D.cy+D.y11,D.cx+D.x11),tn($.cy+$.y11,$.cx+$.x11),!y),s.arc($.cx,$.cy,P,tn($.y11,$.x11),tn($.y01,$.x01),!y))):(s.moveTo(L,q),s.arc(0,0,h,b,v,!y)):s.moveTo(L,q),!(d>qt)||!(_>qt)?s.lineTo(U,oe):R>qt?(D=bg(U,oe,pe,fe,d,-R,y),$=bg(L,q,we,He,d,-R,y),s.lineTo(D.cx+D.x01,D.cy+D.y01),R<M?s.arc(D.cx,D.cy,R,tn(D.y01,D.x01),tn($.y01,$.x01),!y):(s.arc(D.cx,D.cy,R,tn(D.y01,D.x01),tn(D.y11,D.x11),!y),s.arc(0,0,d,tn(D.cy+D.y11,D.cx+D.x11),tn($.cy+$.y11,$.cx+$.x11),y),s.arc($.cx,$.cy,R,tn($.y11,$.x11),tn($.y01,$.x01),!y))):s.arc(0,0,d,E,w,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ta/2;return[$a(f)*c,Xr(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Me(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Me(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Me(+c),l):n},l.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:Me(+c),l):r},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:Me(+c),l):i},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Me(+c),l):o},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Me(+c),l):a},l.context=function(c){return arguments.length?(s=c??null,l):s},l}x();x();var xbe=Array.prototype.slice;function vg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}x();function _T(e){this._context=e}_T.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 Qs(e){return new _T(e)}x();x();function wg(e){return e[0]}function Eg(e){return e[1]}function vd(e,t){var n=Me(!0),r=null,i=Qs,o=null,a=Da(s);e=typeof e=="function"?e:e===void 0?wg:Me(e),t=typeof t=="function"?t:t===void 0?Eg:Me(t);function s(u){var l,c=(u=vg(u)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:Me(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:Me(+u),s):t},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Me(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function Sg(e,t,n){var r=null,i=Me(!0),o=null,a=Qs,s=null,u=Da(l);e=typeof e=="function"?e:e===void 0?wg:Me(+e),t=typeof t=="function"?t:t===void 0?Me(0):Me(+t),n=typeof n=="function"?n:n===void 0?Eg:Me(+n);function l(f){var d,h,p,m=(f=vg(f)).length,g,y=!1,b,v=new Array(m),w=new Array(m);for(o==null&&(s=a(b=u())),d=0;d<=m;++d){if(!(d<m&&i(g=f[d],d,f))===y)if(y=!y)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(v[p],w[p]);s.lineEnd(),s.areaEnd()}y&&(v[d]=+e(g,d,f),w[d]=+t(g,d,f),s.point(r?+r(g,d,f):v[d],n?+n(g,d,f):w[d]))}if(b)return s=null,b+""||null}function c(){return vd().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),r=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Me(+f),l):e},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Me(+f),l):r},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Me(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Me(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Me(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}x();x();var AT={draw(e,t){let n=To(t/Ta);e.moveTo(n,0),e.arc(0,0,n,0,xg)}};function _g(e,t){let n=null,r=Da(i);e=typeof e=="function"?e:Me(e||AT),t=typeof t=="function"?t:Me(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Me(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Me(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}x();x();function kr(){}x();function zl(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 wd(e){this._context=e}wd.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:zl(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:zl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function C2(e){return new wd(e)}function kT(e){this._context=e}kT.prototype={areaStart:kr,areaEnd:kr,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:zl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function F2(e){return new kT(e)}x();function CT(e){this._context=e}CT.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:zl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R2(e){return new CT(e)}x();function FT(e,t){this._basis=new wd(e),this._beta=t}FT.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,a=t[n]-i,s=-1,u;++s<=n;)u=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+u*o),this._beta*t[s]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var M2=(function e(t){function n(r){return t===1?new wd(r):new FT(r,t)}return n.beta=function(r){return e(+r)},n})(.85);x();x();function Bl(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 Ag(e,t){this._context=e,this._k=(1-t)/6}Ag.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:Bl(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:Bl(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 $2=(function e(t){function n(r){return new Ag(r,t)}return n.tension=function(r){return e(+r)},n})(0);function kg(e,t){this._context=e,this._k=(1-t)/6}kg.prototype={areaStart:kr,areaEnd:kr,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:Bl(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 T2=(function e(t){function n(r){return new kg(r,t)}return n.tension=function(r){return e(+r)},n})(0);x();function Cg(e,t){this._context=e,this._k=(1-t)/6}Cg.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:Bl(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 D2=(function e(t){function n(r){return new Cg(r,t)}return n.tension=function(r){return e(+r)},n})(0);x();x();function Ed(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>qt){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>qt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function RT(e,t){this._context=e,this._alpha=t}RT.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:Ed(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 N2=(function e(t){function n(r){return t?new RT(r,t):new Ag(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);function MT(e,t){this._context=e,this._alpha=t}MT.prototype={areaStart:kr,areaEnd:kr,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:Ed(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 O2=(function e(t){function n(r){return t?new MT(r,t):new kg(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);x();function $T(e,t){this._context=e,this._alpha=t}$T.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:Ed(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 I2=(function e(t){function n(r){return t?new $T(r,t):new Cg(r,0)}return n.alpha=function(r){return e(+r)},n})(.5);x();function TT(e){this._context=e}TT.prototype={areaStart:kr,areaEnd:kr,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 P2(e){return new TT(e)}x();function DT(e){return e<0?-1:1}function NT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(DT(o)+DT(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function OT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function L2(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Fg(e){this._context=e}Fg.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:L2(this,this._t0,OT(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,L2(this,OT(this,n=NT(this,e,t)),n);break;default:L2(this,this._t0,n=NT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function IT(e){this._context=new PT(e)}(IT.prototype=Object.create(Fg.prototype)).point=function(e,t){Fg.prototype.point.call(this,t,e)};function PT(e){this._context=e}PT.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 z2(e){return new Fg(e)}function B2(e){return new IT(e)}x();function zT(e){this._context=e}zT.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=LT(e),i=LT(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(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 LT(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[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 U2(e){return new zT(e)}x();function Rg(e,t){this._context=e,this._t=t}Rg.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 q2(e){return new Rg(e,.5)}function j2(e){return new Rg(e,0)}function W2(e){return new Rg(e,1)}x();function Cr(e,t){if(typeof document<"u"&&document.createElement){let n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}var BT=()=>typeof Image<"u"?Image:null;x();x();x();function St(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Pi(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}x();var Ul=Symbol("implicit");function Js(){var e=new El,t=[],n=[],r=Ul;function i(o){let a=e.get(o);if(a===void 0){if(r!==Ul)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new El;for(let a of o)e.has(a)||e.set(a,t.push(a)-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 Js(t,n).unknown(r)},St.apply(i,arguments),i}x();x();x();var iw={};Sn(iw,{interpolate:()=>mn,interpolateArray:()=>d3,interpolateBasis:()=>Pg,interpolateBasisClosed:()=>Lg,interpolateCubehelix:()=>M3,interpolateCubehelixLong:()=>$3,interpolateDate:()=>Bg,interpolateDiscrete:()=>h3,interpolateHcl:()=>C3,interpolateHclLong:()=>F3,interpolateHsl:()=>_3,interpolateHslLong:()=>A3,interpolateHue:()=>p3,interpolateLab:()=>rw,interpolateNumber:()=>gn,interpolateNumberArray:()=>Hl,interpolateObject:()=>Ug,interpolateRgb:()=>kd,interpolateRgbBasis:()=>c3,interpolateRgbBasisClosed:()=>f3,interpolateRound:()=>Ui,interpolateString:()=>qg,interpolateTransformCss:()=>b3,interpolateTransformSvg:()=>v3,interpolateZoom:()=>E3,piecewise:()=>ou,quantize:()=>T3});x();x();x();x();x();function Do(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Na(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zi(){}var Oa=.7,tu=1/Oa,ql="\\s*([+-]?\\d+)\\s*",Sd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bW=/^#([0-9a-f]{3,8})$/,vW=new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`),wW=new RegExp(`^rgb\\(${Li},${Li},${Li}\\)$`),EW=new RegExp(`^rgba\\(${ql},${ql},${ql},${Sd}\\)$`),SW=new RegExp(`^rgba\\(${Li},${Li},${Li},${Sd}\\)$`),_W=new RegExp(`^hsl\\(${Sd},${Li},${Li}\\)$`),AW=new RegExp(`^hsla\\(${Sd},${Li},${Li},${Sd}\\)$`),UT={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};Do(zi,Ia,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qT,formatHex:qT,formatHex8:kW,formatHsl:CW,formatRgb:jT,toString:jT});function qT(){return this.rgb().formatHex()}function kW(){return this.rgb().formatHex8()}function CW(){return XT(this).formatHsl()}function jT(){return this.rgb().formatRgb()}function Ia(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bW.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?WT(t):n===3?new _t(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Mg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Mg(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=vW.exec(e))?new _t(t[1],t[2],t[3],1):(t=wW.exec(e))?new _t(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=EW.exec(e))?Mg(t[1],t[2],t[3],t[4]):(t=SW.exec(e))?Mg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_W.exec(e))?YT(t[1],t[2]/100,t[3]/100,1):(t=AW.exec(e))?YT(t[1],t[2]/100,t[3]/100,t[4]):UT.hasOwnProperty(e)?WT(UT[e]):e==="transparent"?new _t(NaN,NaN,NaN,0):null}function WT(e){return new _t(e>>16&255,e>>8&255,e&255,1)}function Mg(e,t,n,r){return r<=0&&(e=t=n=NaN),new _t(e,t,n,r)}function _d(e){return e instanceof zi||(e=Ia(e)),e?(e=e.rgb(),new _t(e.r,e.g,e.b,e.opacity)):new _t}function Fr(e,t,n,r){return arguments.length===1?_d(e):new _t(e,t,n,r??1)}function _t(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Do(_t,Fr,Na(zi,{brighter(e){return e=e==null?tu:Math.pow(tu,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new _t(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _t(eu(this.r),eu(this.g),eu(this.b),Tg(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:GT,formatHex:GT,formatHex8:FW,formatRgb:HT,toString:HT}));function GT(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}`}function FW(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}${Zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function HT(){let e=Tg(this.opacity);return`${e===1?"rgb(":"rgba("}${eu(this.r)}, ${eu(this.g)}, ${eu(this.b)}${e===1?")":`, ${e})`}`}function Tg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zs(e){return e=eu(e),(e<16?"0":"")+e.toString(16)}function YT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kr(e,t,n,r)}function XT(e){if(e instanceof Kr)return new Kr(e.h,e.s,e.l,e.opacity);if(e instanceof zi||(e=Ia(e)),!e)return new Kr;if(e instanceof Kr)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),a=NaN,s=o-i,u=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Kr(a,s,u,e.opacity)}function nu(e,t,n,r){return arguments.length===1?XT(e):new Kr(e,t,n,r??1)}function Kr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Do(Kr,nu,Na(zi,{brighter(e){return e=e==null?tu:Math.pow(tu,e),new Kr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new Kr(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 _t(G2(e>=240?e-240:e+120,i,r),G2(e,i,r),G2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Kr(VT(this.h),$g(this.s),$g(this.l),Tg(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=Tg(this.opacity);return`${e===1?"hsl(":"hsla("}${VT(this.h)}, ${$g(this.s)*100}%, ${$g(this.l)*100}%${e===1?")":`, ${e})`}`}}));function VT(e){return e=(e||0)%360,e<0?e+360:e}function $g(e){return Math.max(0,Math.min(1,e||0))}function G2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}x();x();var Dg=Math.PI/180,Ng=180/Math.PI;var Og=18,KT=.96422,QT=1,JT=.82521,ZT=4/29,jl=6/29,e3=3*jl*jl,RW=jl*jl*jl;function t3(e){if(e instanceof Bi)return new Bi(e.l,e.a,e.b,e.opacity);if(e instanceof No)return n3(e);e instanceof _t||(e=_d(e));var t=X2(e.r),n=X2(e.g),r=X2(e.b),i=H2((.2225045*t+.7168786*n+.0606169*r)/QT),o,a;return t===n&&n===r?o=a=i:(o=H2((.4360747*t+.3850649*n+.1430804*r)/KT),a=H2((.0139322*t+.0971045*n+.7141733*r)/JT)),new Bi(116*i-16,500*(o-i),200*(i-a),e.opacity)}function Pa(e,t,n,r){return arguments.length===1?t3(e):new Bi(e,t,n,r??1)}function Bi(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Do(Bi,Pa,Na(zi,{brighter(e){return new Bi(this.l+Og*(e??1),this.a,this.b,this.opacity)},darker(e){return new Bi(this.l-Og*(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=KT*Y2(t),e=QT*Y2(e),n=JT*Y2(n),new _t(V2(3.1338561*t-1.6168667*e-.4906146*n),V2(-.9787684*t+1.9161415*e+.033454*n),V2(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function H2(e){return e>RW?Math.pow(e,1/3):e/e3+ZT}function Y2(e){return e>jl?e*e*e:e3*(e-ZT)}function V2(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function X2(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function MW(e){if(e instanceof No)return new No(e.h,e.c,e.l,e.opacity);if(e instanceof Bi||(e=t3(e)),e.a===0&&e.b===0)return new No(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ng;return new No(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ru(e,t,n,r){return arguments.length===1?MW(e):new No(e,t,n,r??1)}function No(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function n3(e){if(isNaN(e.h))return new Bi(e.l,0,0,e.opacity);var t=e.h*Dg;return new Bi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Do(No,ru,Na(zi,{brighter(e){return new No(this.h,this.c,this.l+Og*(e??1),this.opacity)},darker(e){return new No(this.h,this.c,this.l-Og*(e??1),this.opacity)},rgb(){return n3(this).rgb()}}));x();var a3=-.14861,K2=1.78277,Q2=-.29227,Ig=-.90649,Ad=1.97294,r3=Ad*Ig,i3=Ad*K2,o3=K2*Q2-Ig*a3;function $W(e){if(e instanceof iu)return new iu(e.h,e.s,e.l,e.opacity);e instanceof _t||(e=_d(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(o3*r+r3*t-i3*n)/(o3+r3-i3),o=r-i,a=(Ad*(n-i)-Q2*o)/Ig,s=Math.sqrt(a*a+o*o)/(Ad*i*(1-i)),u=s?Math.atan2(a,o)*Ng-120:NaN;return new iu(u<0?u+360:u,s,i,e.opacity)}function Wl(e,t,n,r){return arguments.length===1?$W(e):new iu(e,t,n,r??1)}function iu(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Do(iu,Wl,Na(zi,{brighter(e){return e=e==null?tu:Math.pow(tu,e),new iu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new iu(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Dg,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new _t(255*(t+n*(a3*r+K2*i)),255*(t+n*(Q2*r+Ig*i)),255*(t+n*(Ad*r)),this.opacity)}}));x();x();function J2(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function Pg(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],a=r>0?e[r-1]:2*i-o,s=r<t-1?e[r+2]:2*o-i;return J2((n-r/t)*t,a,i,o,s)}}x();function Lg(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],a=e[(r+1)%t],s=e[(r+2)%t];return J2((n-r/t)*t,i,o,a,s)}}x();x();var Gl=e=>()=>e;function s3(e,t){return function(n){return e+n*t}}function TW(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 La(e,t){var n=t-e;return n?s3(e,n>180||n<-180?n-360*Math.round(n/360):n):Gl(isNaN(e)?t:e)}function u3(e){return(e=+e)==1?rt:function(t,n){return n-t?TW(t,n,e):Gl(isNaN(t)?n:t)}}function rt(e,t){var n=t-e;return n?s3(e,n):Gl(isNaN(e)?t:e)}var kd=(function e(t){var n=u3(t);function r(i,o){var a=n((i=Fr(i)).r,(o=Fr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=rt(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r})(1);function l3(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Fr(t[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=e(r),i=e(i),o=e(o),s.opacity=1,function(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var c3=l3(Pg),f3=l3(Lg);x();x();function Hl(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 zg(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function d3(e,t){return(zg(t)?Hl:Z2)(e,t)}function Z2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=mn(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}x();function Bg(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}x();function gn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}x();function Ug(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]=mn(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}x();var tw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ew=new RegExp(tw.source,"g");function DW(e){return function(){return e}}function NW(e){return function(t){return e(t)+""}}function qg(e,t){var n=tw.lastIndex=ew.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(e=e+"",t=t+"";(r=tw.exec(e))&&(i=ew.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:gn(r,i)})),n=ew.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?NW(u[0].x):DW(t):(t=u.length,function(l){for(var c=0,f;c<t;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function mn(e,t){var n=typeof t,r;return t==null||n==="boolean"?Gl(t):(n==="number"?gn:n==="string"?(r=Ia(t))?(t=r,kd):qg:t instanceof Ia?kd:t instanceof Date?Bg:zg(t)?Hl:Array.isArray(t)?Z2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ug:gn)(e,t)}x();function h3(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}x();function p3(e,t){var n=La(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}x();function Ui(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}x();x();x();var m3=180/Math.PI,jg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nw(e,t,n,r,i,o){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*m3,skewX:Math.atan(u)*m3,scaleX:a,scaleY:s}}var Wg;function g3(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jg:nw(t.a,t.b,t.c,t.d,t.e,t.f)}function y3(e){return e==null?jg:(Wg||(Wg=document.createElementNS("http://www.w3.org/2000/svg","g")),Wg.setAttribute("transform",e),(e=Wg.transform.baseVal.consolidate())?(e=e.matrix,nw(e.a,e.b,e.c,e.d,e.e,e.f)):jg)}function x3(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,d,h,p){if(l!==f||c!==d){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:gn(l,f)},{i:m-2,x:gn(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function a(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:gn(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,d){l!==c?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:gn(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:gn(l,f)},{i:m-2,x:gn(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,d),a(l.rotate,c.rotate,f,d),s(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,m=d.length,g;++p<m;)f[(g=d[p]).i]=g.x(h);return f.join("")}}}var b3=x3(g3,"px, ","px)","deg)"),v3=x3(y3,", ",")",")");x();var OW=1e-12;function w3(e){return((e=Math.exp(e))+1/e)/2}function IW(e){return((e=Math.exp(e))-1/e)/2}function PW(e){return((e=Math.exp(2*e))-1)/(e+1)}var E3=(function e(t,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],f=a[1],d=a[2],h=c-s,p=f-u,m=h*h+p*p,g,y;if(m<OW)y=Math.log(d/l)/t,g=function(S){return[s+S*h,u+S*p,l*Math.exp(t*S*y)]};else{var b=Math.sqrt(m),v=(d*d-l*l+r*m)/(2*l*n*b),w=(d*d-l*l-r*m)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(w*w+1)-w);y=(_-E)/t,g=function(S){var k=S*y,C=w3(E),M=l/(n*b)*(C*PW(t*k+E)-IW(E));return[s+M*h,u+M*p,l*C/w3(t*k+E)]}}return g.duration=y*1e3*t/Math.SQRT2,g}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return e(a,s,u)},i})(Math.SQRT2,2,4);x();function S3(e){return function(t,n){var r=e((t=nu(t)).h,(n=nu(n)).h),i=rt(t.s,n.s),o=rt(t.l,n.l),a=rt(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=o(s),t.opacity=a(s),t+""}}}var _3=S3(La),A3=S3(rt);x();function rw(e,t){var n=rt((e=Pa(e)).l,(t=Pa(t)).l),r=rt(e.a,t.a),i=rt(e.b,t.b),o=rt(e.opacity,t.opacity);return function(a){return e.l=n(a),e.a=r(a),e.b=i(a),e.opacity=o(a),e+""}}x();function k3(e){return function(t,n){var r=e((t=ru(t)).h,(n=ru(n)).h),i=rt(t.c,n.c),o=rt(t.l,n.l),a=rt(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=o(s),t.opacity=a(s),t+""}}}var C3=k3(La),F3=k3(rt);x();function R3(e){return(function t(n){n=+n;function r(i,o){var a=e((i=Wl(i)).h,(o=Wl(o)).h),s=rt(i.s,o.s),u=rt(i.l,o.l),l=rt(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=t,r})(1)}var M3=R3(La),$3=R3(rt);x();function ou(e,t){t===void 0&&(t=e,e=mn);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(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}x();function T3(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}x();function ow(e){return function(){return e}}x();function Yl(e){return+e}var D3=[0,1];function nn(e){return e}function aw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ow(isNaN(t)?NaN:.5)}function LW(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zW(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=aw(i,r),o=n(a,o)):(r=aw(r,i),o=n(o,a)),function(s){return o(r(s))}}function BW(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=aw(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var u=Yr(e,s,1,r)-1;return o[u](i[u](s))}}function qi(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function au(){var e=D3,t=D3,n=mn,r,i,o,a=nn,s,u,l;function c(){var d=Math.min(e.length,t.length);return a!==nn&&(a=LW(e[0],e[d-1])),s=d>2?BW:zW,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?o:(u||(u=s(e.map(r),t,n)))(r(a(d)))}return f.invert=function(d){return a(i((l||(l=s(t,e.map(r),gn)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Yl),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Ui,c()},f.clamp=function(d){return arguments.length?(a=d?!0:nn,c()):a!==nn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,c()}}function Cd(){return au()(nn,nn)}x();function Vl(e,t,n,r){var i=An(e,t,n),o;switch(r=ar(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Wf(i,a))&&(r.precision=o),kl(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Gf(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=jf(i))&&(r.precision=o-(r.type==="%")*2);break}}return va(r)}function ur(e){var t=e.domain;return e.ticks=function(n){var r=t();return Is(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Vl(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,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=zf(a,s,n),l===u)return r[i]=a,r[o]=s,t(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return e},e}function Fd(){var e=Cd();return e.copy=function(){return qi(e,Fd())},St.apply(e,arguments),ur(e)}function Rd(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,Yl),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Rd(e).unknown(t)},e=arguments.length?Array.from(e,Yl):[0,1],ur(n)}x();x();function Md(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),e[n]=t.floor(i),e[r]=t.ceil(o),e}function N3(e){return Math.log(e)}function O3(e){return Math.exp(e)}function UW(e){return-Math.log(-e)}function qW(e){return-Math.exp(-e)}function jW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function WW(e){return e===10?jW:e===Math.E?Math.exp:t=>Math.pow(e,t)}function GW(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 I3(e){return(t,n)=>-e(-t,n)}function $d(e){let t=e(N3,O3),n=t.domain,r=10,i,o;function a(){return i=GW(r),o=WW(r),n()[0]<0?(i=I3(i),o=I3(o),e(UW,qW)):e(N3,O3),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{let u=n(),l=u[0],c=u[u.length-1],f=c<l;f&&([l,c]=[c,l]);let d=i(l),h=i(c),p,m,g=s==null?10:+s,y=[];if(!(r%1)&&h-d<g){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<r;++p)if(m=d<0?p/o(-d):p*o(d),!(m<l)){if(m>c)break;y.push(m)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/o(-d):p*o(d),!(m<l)){if(m>c)break;y.push(m)}y.length*2<g&&(y=Is(l,c,g))}else y=Is(d,h,Math.min(h-d,g)).map(o);return f?y.reverse():y},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=ar(u)).precision==null&&(u.trim=!0),u=va(u)),s===1/0)return u;let l=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=l?u(c):""}},t.nice=()=>n(Md(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function Td(){let e=$d(au()).domain([1,10]);return e.copy=()=>qi(e,Td()).base(e.base()),St.apply(e,arguments),e}x();function P3(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function L3(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Dd(e){var t=1,n=e(P3(t),L3(t));return n.constant=function(r){return arguments.length?e(P3(t=+r),L3(t)):t},ur(n)}function Nd(){var e=Dd(au());return e.copy=function(){return qi(e,Nd()).constant(e.constant())},St.apply(e,arguments)}x();function z3(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function HW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function YW(e){return e<0?-e*e:e*e}function Od(e){var t=e(nn,nn),n=1;function r(){return n===1?e(nn,nn):n===.5?e(HW,YW):e(z3(n),z3(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ur(t)}function Xl(){var e=Od(au());return e.copy=function(){return qi(e,Xl()).exponent(e.exponent())},St.apply(e,arguments),e}function sw(){return Xl.apply(null,arguments).exponent(.5)}x();function Id(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a<s;)n[a-1]=Uf(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[Yr(n,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(hn),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Id().domain(e).range(t).unknown(r)},St.apply(o,arguments)}x();function Pd(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Yr(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*t-(u-n)*e)/(n+1);return a}return a.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,r[0]]:l>=n?[r[n-1],t]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Pd().domain([e,t]).range(i).unknown(o)},St.apply(ur(a),arguments)}x();function Ld(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Yr(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 a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Ld().domain(e).range(t).unknown(n)},St.apply(i,arguments)}x();function VW(e){return new Date(e)}function XW(e){return e instanceof Date?+e:+new Date(+e)}function Gg(e,t,n,r,i,o,a,s,u,l){var c=Cd(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),w=l("%Y");function E(_){return(u(_)<_?h:s(_)<_?p:a(_)<_?m:o(_)<_?g:r(_)<_?i(_)<_?y:b:n(_)<_?v:w)(_)}return c.invert=function(_){return new Date(f(_))},c.domain=function(_){return arguments.length?d(Array.from(_,XW)):d().map(VW)},c.ticks=function(_){var S=d();return e(S[0],S[S.length-1],_??10)},c.tickFormat=function(_,S){return S==null?E:l(S)},c.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=t(S[0],S[S.length-1],_??10)),_?d(Md(S,_)):c},c.copy=function(){return qi(c,Gg(e,t,n,r,i,o,a,s,u,l))},c}function Hg(){return St.apply(Gg(Zb,ev,kn,_o,Sr,Yn,Sa,wa,pn,Tl).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}x();function Yg(){return St.apply(Gg(Qb,Jb,Cn,Ao,_r,Er,_a,Ea,pn,Dl).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}x();function Vg(){var e=0,t=1,n,r,i,o,a=nn,s=!1,u;function l(f){return f==null||isNaN(f=+f)?u:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(a=f,l):a};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,a=f(h,p),l):[a(0),a(1)]}}return l.range=c(mn),l.rangeRound=c(Ui),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),l}}function Oo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Kl(){var e=ur(Vg()(nn));return e.copy=function(){return Oo(e,Kl())},Pi.apply(e,arguments)}function Xg(){var e=$d(Vg()).domain([1,10]);return e.copy=function(){return Oo(e,Xg()).base(e.base())},Pi.apply(e,arguments)}function Kg(){var e=Dd(Vg());return e.copy=function(){return Oo(e,Kg()).constant(e.constant())},Pi.apply(e,arguments)}function zd(){var e=Od(Vg());return e.copy=function(){return Oo(e,zd()).exponent(e.exponent())},Pi.apply(e,arguments)}function uw(){return zd.apply(null,arguments).exponent(.5)}x();function Qg(){var e=0,t=.5,n=1,r=1,i,o,a,s,u,l=nn,c,f=!1,d;function h(m){return isNaN(m=+m)?d:(m=.5+((m=+c(m))-o)*(r*m<r*o?s:u),l(f?Math.max(0,Math.min(1,m)):m))}h.domain=function(m){return arguments.length?([e,t,n]=m,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h):[e,t,n]},h.clamp=function(m){return arguments.length?(f=!!m,h):f},h.interpolator=function(m){return arguments.length?(l=m,h):l};function p(m){return function(g){var y,b,v;return arguments.length?([y,b,v]=g,l=ou(m,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(mn),h.rangeRound=p(Ui),h.unknown=function(m){return arguments.length?(d=m,h):d},function(m){return c=m,i=m(e),o=m(t),a=m(n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function Bd(){var e=ur(Qg()(nn));return e.copy=function(){return Oo(e,Bd())},Pi.apply(e,arguments)}function Jg(){var e=$d(Qg()).domain([.1,1,10]);return e.copy=function(){return Oo(e,Jg()).base(e.base())},Pi.apply(e,arguments)}function Zg(){var e=Dd(Qg());return e.copy=function(){return Oo(e,Zg()).constant(e.constant())},Pi.apply(e,arguments)}function Ud(){var e=Od(Qg());return e.copy=function(){return Oo(e,Ud()).exponent(e.exponent())},Pi.apply(e,arguments)}function lw(){return Ud.apply(null,arguments).exponent(.5)}x();x();x();function At(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 cw=At("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");x();var fw=At("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");x();var dw=At("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");x();var hw=At("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");x();var pw=At("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");x();var mw=At("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");x();var gw=At("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");x();var yw=At("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");x();var xw=At("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");x();var bw=At("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function qd(e,t,n){let r=e-t+n*2;return e?r>0?r:1:0}var QW="identity",uu="linear",ji="log",Ql="pow",Jl="sqrt",jd="symlog",za="time",Ba="utc",Qr="sequential",lu="diverging",su="quantile",Wd="quantize",Gd="threshold",t0="ordinal",n0="point",ww="band",r0="bin-ordinal",Tt="continuous",Hd="discrete",Yd="discretizing",Rr="interpolating",Ew="temporal";function JW(e){return function(t){let n=t[0],r=t[1],i;return r<n&&(i=n,n=r,r=i),[e.invert(n),e.invert(r)]}}function ZW(e){return function(t){let n=e.range(),r=t[0],i=t[1],o=-1,a,s,u,l;for(i<r&&(s=r,r=i,i=s),u=0,l=n.length;u<l;++u)n[u]>=r&&n[u]<=i&&(o<0&&(o=u),a=u);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[a]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function Sw(){let e=Js().unknown(void 0),t=e.domain,n=e.range,r=[0,1],i,o,a=!1,s=0,u=0,l=.5;delete e.unknown;function c(){let f=t().length,d=r[1]<r[0],h=r[1-d],p=qd(f,s,u),m=r[d-0];i=(h-m)/(p||1),a&&(i=Math.floor(i)),m+=(h-m-i*(f-s))*l,o=i*(1-s),a&&(m=Math.round(m),o=Math.round(o));let g=xt(f).map(y=>m+i*y);return n(d?g.reverse():g)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],c()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],a=!0,c()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(a=!!f,c()):a},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),s=u,c()):s},e.paddingInner=function(f){return arguments.length?(s=Math.max(0,Math.min(1,f)),c()):s},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;let d=r[1]<r[0],h=d?n().reverse():n(),p=h.length-1,m=+f[0],g=+f[1],y,b,v;if(!(m!==m||g!==g)&&(g<m&&(v=m,m=g,g=v),!(g<h[0]||m>r[1-d])))return y=Math.max(0,Os(h,m)-1),b=m===g?y:Os(h,g)-1,m-h[y]>o+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){let d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Sw().domain(t()).range(r).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function j3(e){let t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return j3(t())},e}function eG(){return j3(Sw().paddingInner(1))}var tG=Array.prototype.map;function nG(e){return tG.call(e,yt)}var rG=Array.prototype.slice;function W3(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(Yr(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=nG(r),n):e.slice()},n.range=function(r){return arguments.length?(t=rG.call(r),n):t.slice()},n.tickFormat=function(r,i){return Vl(e[0],ve(e),r??10,i)},n.copy=function(){return W3().domain(n.domain()).range(n.range())},n}var e0=new Map,G3=Symbol("vega_scale");function _w(e){return e[G3]=!0,e}function Aw(e){return e&&e[G3]===!0}function iG(e,t,n){let r=function(){let o=t();return o.invertRange||(o.invertRange=o.invert?JW(o):o.invertExtent?ZW(o):void 0),o.type=e,_w(o)};return r.metadata=$t(J(n)),r}function Fe(e,t,n){return arguments.length>1?(e0.set(e,iG(e,t,n)),this):kw(e)?e0.get(e):void 0}Fe(QW,Rd);Fe(uu,Fd,Tt);Fe(ji,Td,[Tt,ji]);Fe(Ql,Xl,Tt);Fe(Jl,sw,Tt);Fe(jd,Nd,Tt);Fe(za,Hg,[Tt,Ew]);Fe(Ba,Yg,[Tt,Ew]);Fe(Qr,Kl,[Tt,Rr]);Fe(`${Qr}-${uu}`,Kl,[Tt,Rr]);Fe(`${Qr}-${ji}`,Xg,[Tt,Rr,ji]);Fe(`${Qr}-${Ql}`,zd,[Tt,Rr]);Fe(`${Qr}-${Jl}`,uw,[Tt,Rr]);Fe(`${Qr}-${jd}`,Kg,[Tt,Rr]);Fe(`${lu}-${uu}`,Bd,[Tt,Rr]);Fe(`${lu}-${ji}`,Jg,[Tt,Rr,ji]);Fe(`${lu}-${Ql}`,Ud,[Tt,Rr]);Fe(`${lu}-${Jl}`,lw,[Tt,Rr]);Fe(`${lu}-${jd}`,Zg,[Tt,Rr]);Fe(su,Id,[Yd,su]);Fe(Wd,Pd,Yd);Fe(Gd,Ld,Yd);Fe(r0,W3,[Hd,Yd]);Fe(t0,Js,Hd);Fe(ww,Sw,Hd);Fe(n0,eG,Hd);function kw(e){return e0.has(e)}function cu(e,t){let n=e0.get(e);return n&&n.metadata[t]}function Vd(e){return cu(e,Tt)}function Ua(e){return cu(e,Hd)}function i0(e){return cu(e,Yd)}function Cw(e){return cu(e,ji)}function oG(e){return cu(e,Ew)}function Fw(e){return cu(e,Rr)}function Rw(e){return cu(e,su)}var aG=["clamp","base","constant","exponent"];function o0(e,t){let n=t[0],r=ve(t)-n;return function(i){return e(n+i*r)}}function Zl(e,t,n){return ou(Xd(t||"rgb",n),e)}function a0(e,t){let n=new Array(t),r=t+1;for(let i=0;i<t;)n[i]=e(++i/r);return n}function s0(e,t,n){let r=n-t,i,o,a;return!r||!Number.isFinite(r)?tt(.5):(i=(o=e.type).indexOf("-"),o=i<0?o:o.slice(i+1),a=Fe(o)().domain([t,n]).range([0,1]),aG.forEach(s=>e[s]?a[s](e[s]()):0),a)}function Xd(e,t){let n=iw[sG(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function sG(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}var uG={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},lG={accent:fw,category10:cw,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:dw,observable10:hw,paired:pw,pastel1:mw,pastel2:gw,set1:yw,set2:xw,set3:bw,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function H3(e){if(I(e))return e;let t=e.length/6|0,n=new Array(t);for(let r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function Y3(e,t){for(let n in e)Kd(n,t(e[n]))}var B3={};Y3(lG,H3);Y3(uG,e=>Zl(H3(e)));function Kd(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(B3[e]=t,this):B3[e]}var Qd="symbol",cG="discrete",V3="gradient",fG=e=>I(e)?e.map(t=>String(t)):String(e),dG=(e,t)=>e[1]-t[1],hG=(e,t)=>t[1]-e[1];function u0(e,t,n){let r;return ke(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(wo(e.domain())/n||1)+1))),Q(t)&&(r=t.step,t=t.interval),Z(t)&&(t=e.type===za?ko(t):e.type==Ba?Co(t):O("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function Mw(e,t,n){let r=e.range(),i=r[0],o=ve(r),a=dG;if(i>o&&(r=o,o=i,i=r,a=hG),i=Math.floor(i),o=Math.ceil(o),t=t.map(s=>[s,e(s)]).filter(s=>i<=s[1]&&s[1]<=o).sort(a).map(s=>s[0]),n>0&&t.length>1){let s=[t[0],ve(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=s)}return t}function l0(e,t){return e.bins?Mw(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function $w(e,t,n,r,i,o){let a=t.type,s=fG;if(a===za||i===za)s=e.timeFormat(r);else if(a===Ba||i===Ba)s=e.utcFormat(r);else if(Cw(a)){let u=e.formatFloat(r);if(o||t.bins)s=u;else{let l=X3(t,n,!1);s=c=>l(c)?u(c):""}}else if(t.tickFormat){let u=t.domain();s=e.formatSpan(u[0],u[u.length-1],n,r)}else r&&(s=e.format(r));return s}function X3(e,t,n){let r=l0(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=u=>{let l=u/Math.pow(i,Math.round(Math.log(u)/o));return l*i<i-.5&&(l*=i),l<=a};return n?r.filter(s):s}var vw={[su]:"quantiles",[Wd]:"thresholds",[Gd]:"domain"},K3={[su]:"quantiles",[Wd]:"domain"};function Tw(e,t){return e.bins?gG(e.bins):e.type===ji?X3(e,t,!0):vw[e.type]?mG(e[vw[e.type]]()):l0(e,t)}function pG(e,t,n){let r=t[K3[t.type]](),i=r.length,o=i>1?r[1]-r[0]:r[0],a;for(a=1;a<i;++a)o=Math.min(o,r[a]-r[a-1]);return e.formatSpan(0,o,30,n)}function mG(e){let t=[-1/0].concat(e);return t.max=1/0,t}function gG(e){let t=e.slice(0,-1);return t.max=ve(e),t}var yG=e=>vw[e.type]||e.bins;function Dw(e,t,n,r,i,o,a){let s=K3[t.type]&&o!==za&&o!==Ba?pG(e,t,i):$w(e,t,n,i,o,a);return r===Qd&&yG(t)?xG(s):r===cG?bG(s):vG(s)}var xG=e=>(t,n,r)=>{let i=U3(r[n+1],U3(r.max,1/0)),o=q3(t,e),a=q3(i,e);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},U3=(e,t)=>e??t,bG=e=>(t,n)=>n?e(t):null,vG=e=>t=>e(t),q3=(e,t)=>Number.isFinite(e)?t(e):null;function Q3(e){let t=e.domain(),n=t.length-1,r=+t[0],i=+ve(t),o=i-r;if(e.type===Gd){let a=n?o/n:.1;r-=a,i+=a,o=i-r}return a=>(a-r)/o}function wG(e,t,n,r){let i=r||t.type;return Z(n)&&oG(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===za?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===Ba?e.utcFormat("%A, %d %B %Y, %X UTC"):Dw(e,t,5,null,n,r,!0)}function Nw(e,t,n){n=n||{};let r=Math.max(3,n.maxlen||7),i=wG(e,t,n.format,n.formatType);if(i0(t.type)){let o=Tw(t).slice(1).map(i),a=o.length;return`${a} boundar${a===1?"y":"ies"}: ${o.join(", ")}`}else if(Ua(t.type)){let o=t.domain(),a=o.length,s=a>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${a} value${a===1?"":"s"}: ${s}`}else{let o=t.domain();return`values from ${i(o[0])} to ${i(ve(o))}`}}var ED=0;function EG(){ED=0}var b0="p_";function Qw(e){return e&&e.gradient}function SD(e,t,n){let r=e.gradient,i=e.id,o=r==="radial"?b0:"";return i||(i=e.id="gradient_"+ED++,r==="radial"?(e.x1=Wi(e.x1,.5),e.y1=Wi(e.y1,.5),e.r1=Wi(e.r1,0),e.x2=Wi(e.x2,.5),e.y2=Wi(e.y2,.5),e.r2=Wi(e.r2,.5),o=b0):(e.x1=Wi(e.x1,0),e.y1=Wi(e.y1,0),e.x2=Wi(e.x2,1),e.y2=Wi(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function Wi(e,t){return e??t}function Jw(e,t){var n=[],r;return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}var J3={basis:{curve:C2},"basis-closed":{curve:F2},"basis-open":{curve:R2},bundle:{curve:M2,tension:"beta",value:.85},cardinal:{curve:$2,tension:"tension",value:0},"cardinal-open":{curve:D2,tension:"tension",value:0},"cardinal-closed":{curve:T2,tension:"tension",value:0},"catmull-rom":{curve:N2,tension:"alpha",value:.5},"catmull-rom-closed":{curve:O2,tension:"alpha",value:.5},"catmull-rom-open":{curve:I2,tension:"alpha",value:.5},linear:{curve:Qs},"linear-closed":{curve:P2},monotone:{horizontal:B2,vertical:z2},natural:{curve:U2},step:{curve:q2},"step-after":{curve:W2},"step-before":{curve:j2}};function Zw(e,t,n){var r=ee(J3,e)&&J3[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}var SG={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},_G=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,AG=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,kG=/^((\s+,?\s*)|(,\s*))/,CG=/^[01]/;function gu(e){let t=[];return(e.match(_G)||[]).forEach(r=>{let i=r[0],o=i.toLowerCase(),a=SG[o],s=FG(o,a,r.slice(1).trim()),u=s.length;if(u<a||u&&u%a!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([i,...s.slice(0,a)]),u!==a){o==="m"&&(i=i==="M"?"L":"l");for(let l=a;l<u;l+=a)t.push([i,...s.slice(l,l+a)])}}),t}function FG(e,t,n){let r=[];for(let i=0;t&&i<n.length;)for(let o=0;o<t;++o){let a=e==="a"&&(o===3||o===4)?CG:AG,s=n.slice(i).match(a);if(s===null)throw Error("Invalid SVG path, incorrect parameter type");i+=s[0].length,r.push(+s[0]);let u=n.slice(i).match(kG);u!==null&&(i+=u[0].length)}return r}var Ya=Math.PI/180,RG=1e-14,fu=Math.PI/2,Gi=Math.PI*2,ec=Math.sqrt(3)/2,Ow={},Iw={},_D=[].join;function MG(e,t,n,r,i,o,a,s,u){let l=_D.call(arguments);if(Ow[l])return Ow[l];let c=a*Ya,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),r=Math.abs(r);let h=d*(s-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(s-e)*.5,m=h*h/(n*n)+p*p/(r*r);m>1&&(m=Math.sqrt(m),n*=m,r*=m);let g=d/n,y=f/n,b=-f/r,v=d/r,w=g*s+y*u,E=b*s+v*u,_=g*e+y*t,S=b*e+v*t,C=1/((_-w)*(_-w)+(S-E)*(S-E))-.25;C<0&&(C=0);let M=Math.sqrt(C);o==i&&(M=-M);let R=.5*(w+_)-M*(S-E),P=.5*(E+S)+M*(_-w),D=Math.atan2(E-P,w-R),F=Math.atan2(S-P,_-R)-D;F<0&&o===1?F+=Gi:F>0&&o===0&&(F-=Gi);let T=Math.ceil(Math.abs(F/(fu+.001))),L=[];for(let q=0;q<T;++q){let U=D+q*F/T,oe=D+(q+1)*F/T;L[q]=[R,P,U,oe,n,r,f,d]}return Ow[l]=L}function $G(e){let t=_D.call(e);if(Iw[t])return Iw[t];var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7];let c=l*a,f=-u*s,d=u*a,h=l*s,p=Math.cos(i),m=Math.sin(i),g=Math.cos(o),y=Math.sin(o),b=.5*(o-i),v=Math.sin(b*.5),w=8/3*v*v/Math.sin(b),E=n+p-w*m,_=r+m+w*p,S=n+g,k=r+y,C=S+w*y,M=k-w*g;return Iw[t]=[c*E+f*_,d*E+h*_,c*C+f*M,d*C+h*M,c*S+f*k,d*S+h*k]}var Mr=["l",0,0,0,0,0,0,0];function TG(e,t,n){let r=Mr[0]=e[0];if(r==="a"||r==="A")Mr[1]=t*e[1],Mr[2]=n*e[2],Mr[3]=e[3],Mr[4]=e[4],Mr[5]=e[5],Mr[6]=t*e[6],Mr[7]=n*e[7];else if(r==="h"||r==="H")Mr[1]=t*e[1];else if(r==="v"||r==="V")Mr[1]=n*e[1];else for(var i=1,o=e.length;i<o;++i)Mr[i]=(i%2==1?t:n)*e[i];return Mr}function nc(e,t,n,r,i,o){var a,s=null,u=0,l=0,c=0,f=0,d,h,p,m,g=0,y=0;n==null&&(n=0),r==null&&(r=0),i==null&&(i=1),o==null&&(o=i),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(a=t[b],(i!==1||o!==1)&&(a=TG(a,i,o)),a[0]){case"l":u+=a[1],l+=a[2],e.lineTo(u+n,l+r);break;case"L":u=a[1],l=a[2],e.lineTo(u+n,l+r);break;case"h":u+=a[1],e.lineTo(u+n,l+r);break;case"H":u=a[1],e.lineTo(u+n,l+r);break;case"v":l+=a[1],e.lineTo(u+n,l+r);break;case"V":l=a[1],e.lineTo(u+n,l+r);break;case"m":u+=a[1],l+=a[2],g=u,y=l,e.moveTo(u+n,l+r);break;case"M":u=a[1],l=a[2],g=u,y=l,e.moveTo(u+n,l+r);break;case"c":d=u+a[5],h=l+a[6],c=u+a[3],f=l+a[4],e.bezierCurveTo(u+a[1]+n,l+a[2]+r,c+n,f+r,d+n,h+r),u=d,l=h;break;case"C":u=a[5],l=a[6],c=a[3],f=a[4],e.bezierCurveTo(a[1]+n,a[2]+r,c+n,f+r,u+n,l+r);break;case"s":d=u+a[3],h=l+a[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+r,u+a[1]+n,l+a[2]+r,d+n,h+r),c=u+a[1],f=l+a[2],u=d,l=h;break;case"S":d=a[3],h=a[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+r,a[1]+n,a[2]+r,d+n,h+r),u=d,l=h,c=a[1],f=a[2];break;case"q":d=u+a[3],h=l+a[4],c=u+a[1],f=l+a[2],e.quadraticCurveTo(c+n,f+r,d+n,h+r),u=d,l=h;break;case"Q":d=a[3],h=a[4],e.quadraticCurveTo(a[1]+n,a[2]+r,d+n,h+r),u=d,l=h,c=a[1],f=a[2];break;case"t":d=u+a[1],h=l+a[2],s[0].match(/[QqTt]/)===null?(c=u,f=l):s[0]==="t"?(c=2*u-p,f=2*l-m):s[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,m=f,e.quadraticCurveTo(c+n,f+r,d+n,h+r),u=d,l=h,c=u+a[1],f=l+a[2];break;case"T":d=a[1],h=a[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+r,d+n,h+r),u=d,l=h;break;case"a":Z3(e,u+n,l+r,[a[1],a[2],a[3],a[4],a[5],a[6]+u+n,a[7]+l+r]),u+=a[6],l+=a[7];break;case"A":Z3(e,u+n,l+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),u=a[6],l=a[7];break;case"z":case"Z":u=g,l=y,e.closePath();break}s=a}}function Z3(e,t,n,r){let i=MG(r[5],r[6],r[0],r[1],r[3],r[4],r[2],t,n);for(let o=0;o<i.length;++o){let a=$G(i[o]);e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}var eD=.5773502691896257,tD={circle:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Gi)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/2.5;e.moveTo(-n,-r),e.lineTo(-n,r),e.lineTo(-r,r),e.lineTo(-r,n),e.lineTo(r,n),e.lineTo(r,r),e.lineTo(n,r),e.lineTo(n,-r),e.lineTo(r,-r),e.lineTo(r,-n),e.lineTo(-r,-n),e.lineTo(-r,-r),e.closePath()}},diamond:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/7,i=n/2.5,o=n/8;e.moveTo(-r,n),e.lineTo(r,n),e.lineTo(r,-o),e.lineTo(i,-o),e.lineTo(0,-n),e.lineTo(-i,-o),e.lineTo(-r,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n,i=r-n*eD,o=n/4;e.moveTo(0,-r-i),e.lineTo(-o,r-i),e.lineTo(o,r-i),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n,i=r-n*eD;e.moveTo(0,-r-i),e.lineTo(-n,r-i),e.lineTo(n,r-i),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n;e.moveTo(0,-r),e.lineTo(-n,r),e.lineTo(n,r),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n;e.moveTo(0,r),e.lineTo(-n,-r),e.lineTo(n,-r),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n;e.moveTo(r,0),e.lineTo(-r,-n),e.lineTo(-r,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,r=ec*n;e.moveTo(-r,0),e.lineTo(r,-n),e.lineTo(r,n),e.closePath()}},stroke:{draw:function(e,t){let n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function AD(e){return ee(tD,e)?tD[e]:DG(e)}var Pw={};function DG(e){if(!ee(Pw,e)){let t=gu(e);Pw[e]={draw:function(n,r){nc(n,t,0,0,Math.sqrt(r)/2)}}}return Pw[e]}var qa=.448084975506;function NG(e){return e.x}function OG(e){return e.y}function IG(e){return e.width}function PG(e){return e.height}function Io(e){return typeof e=="function"?e:()=>+e}function c0(e,t,n){return Math.max(t,Math.min(e,n))}function kD(){var e=NG,t=OG,n=IG,r=PG,i=Io(0),o=i,a=i,s=i,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),m=d??+t.call(this,c),g=+n.call(this,c),y=+r.call(this,c),b=Math.min(g,y)/2,v=c0(+i.call(this,c),0,b),w=c0(+o.call(this,c),0,b),E=c0(+a.call(this,c),0,b),_=c0(+s.call(this,c),0,b);if(u||(u=h=Ks()),v<=0&&w<=0&&E<=0&&_<=0)u.rect(p,m,g,y);else{var S=p+g,k=m+y;u.moveTo(p+v,m),u.lineTo(S-w,m),u.bezierCurveTo(S-qa*w,m,S,m+qa*w,S,m+w),u.lineTo(S,k-_),u.bezierCurveTo(S,k-qa*_,S-qa*_,k,S-_,k),u.lineTo(p+E,k),u.bezierCurveTo(p+qa*E,k,p,k-qa*E,p,k-E),u.lineTo(p,m+v),u.bezierCurveTo(p,m+qa*v,p+qa*v,m,p+v,m),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Io(c),l):e},l.y=function(c){return arguments.length?(t=Io(c),l):t},l.width=function(c){return arguments.length?(n=Io(c),l):n},l.height=function(c){return arguments.length?(r=Io(c),l):r},l.cornerRadius=function(c,f,d,h){return arguments.length?(i=Io(c),o=f!=null?Io(f):i,s=d!=null?Io(d):i,a=h!=null?Io(h):o,l):i},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function CD(){var e,t,n,r,i=null,o,a,s,u;function l(f,d,h){let p=h/2;if(o){var m=s-d,g=f-a;if(m||g){var y=Math.hypot(m,g),b=(m/=y)*u,v=(g/=y)*u,w=Math.atan2(g,m);i.moveTo(a-b,s-v),i.lineTo(f-m*p,d-g*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(a+b,s+v),i.arc(a,s,u,w,w+Math.PI)}else i.arc(f,d,p,0,Gi);i.closePath()}else o=1;a=f,s=d,u=p}function c(f){var d,h=f.length,p,m=!1,g;for(i==null&&(i=g=Ks()),d=0;d<=h;++d)!(d<h&&r(p=f[d],d,f))===m&&(m=!m)&&(o=0),m&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(g)return i=null,g+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(r=f,c):r},c.context=function(f){return arguments.length?(f==null?i=null:i=f,c):i},c}function ch(e,t){return e??t}var fh=e=>e.x||0,dh=e=>e.y||0,LG=e=>e.width||0,zG=e=>e.height||0,BG=e=>(e.x||0)+(e.width||0),UG=e=>(e.y||0)+(e.height||0),qG=e=>e.startAngle||0,jG=e=>e.endAngle||0,WG=e=>e.padAngle||0,GG=e=>e.innerRadius||0,HG=e=>e.outerRadius||0,YG=e=>e.cornerRadius||0,VG=e=>ch(e.cornerRadiusTopLeft,e.cornerRadius)||0,XG=e=>ch(e.cornerRadiusTopRight,e.cornerRadius)||0,KG=e=>ch(e.cornerRadiusBottomRight,e.cornerRadius)||0,QG=e=>ch(e.cornerRadiusBottomLeft,e.cornerRadius)||0,JG=e=>ch(e.size,64),ZG=e=>e.size||1,O0=e=>e.defined!==!1,eH=e=>AD(e.shape||"circle"),tH=k2().startAngle(qG).endAngle(jG).padAngle(WG).innerRadius(GG).outerRadius(HG).cornerRadius(YG),nH=Sg().x(fh).y1(dh).y0(UG).defined(O0),rH=Sg().y(dh).x1(fh).x0(BG).defined(O0),iH=vd().x(fh).y(dh).defined(O0),oH=kD().x(fh).y(dh).width(LG).height(zG).cornerRadius(VG,XG,KG,QG),aH=_g().type(eH).size(JG),sH=CD().x(fh).y(dh).defined(O0).size(ZG);function eE(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function uH(e,t){return tH.context(e)(t)}function lH(e,t){let n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?rH:nH).curve(Zw(r,n.orient,n.tension)).context(e)(t)}function cH(e,t){let n=t[0],r=n.interpolate||"linear";return iH.curve(Zw(r,n.orient,n.tension)).context(e)(t)}function ac(e,t,n,r){return oH.context(e)(t,n,r)}function fH(e,t){return(t.mark.shape||t.shape).context(e)(t)}function dH(e,t){return aH.context(e)(t)}function hH(e,t){return sH.context(e)(t)}var FD=1;function pH(){FD=1}function tE(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+FD++),a=i.clipping[o]||(i.clipping[o]={id:o});return de(r)?a.path=r(null):eE(n)?a.path=ac(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function ft(e){this.clear(),e&&this.union(e)}ft.prototype={clone(){return new ft(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),u=Math.sin(e),l=t-t*s+n*u,c=n-t*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function hh(e){this.mark=e,this.bounds=this.bounds||new ft}function ph(e){hh.call(this,e),this.items=this.items||[]}W(ph,hh);var v0=class{constructor(t){this._pending=0,this._loader=t||Nl()}pending(){return this._pending}sanitizeURL(t){let n=this;return nD(n),n._loader.sanitize(t,{context:"href"}).then(r=>(Jd(n),r)).catch(()=>(Jd(n),null))}loadImage(t){let n=this,r=BT();return nD(n),n._loader.sanitize(t,{context:"image"}).then(i=>{let o=i.href;if(!o||!r)throw{url:o};let a=new r,s=ee(i,"crossOrigin")?i.crossOrigin:"anonymous";return s!=null&&(a.crossOrigin=s),a.onload=()=>Jd(n),a.onerror=()=>Jd(n),a.src=o,a}).catch(i=>(Jd(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){let t=this;return new Promise(n=>{function r(i){t.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}};function nD(e){e._pending+=1}function Jd(e){e._pending-=1}function Hi(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){let r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?mH(t,r):0))}return e}function mH(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}var gH=Gi-1e-8,I0,f0,d0,pu,qw,h0,jw,Ww,ja=(e,t)=>I0.add(e,t),p0=(e,t)=>ja(f0=e,d0=t),rD=e=>ja(e,I0.y1),iD=e=>ja(I0.x1,e),du=(e,t)=>qw*e+jw*t,hu=(e,t)=>h0*e+Ww*t,Lw=(e,t)=>ja(du(e,t),hu(e,t)),zw=(e,t)=>p0(du(e,t),hu(e,t));function mh(e,t){return I0=e,t?(pu=t*Ya,qw=Ww=Math.cos(pu),h0=Math.sin(pu),jw=-h0):(qw=Ww=1,pu=h0=jw=0),yH}var yH={beginPath(){},closePath(){},moveTo:zw,lineTo:zw,rect(e,t,n,r){pu?(Lw(e+n,t),Lw(e+n,t+r),Lw(e,t+r),zw(e,t)):(ja(e+n,t+r),p0(e,t))},quadraticCurveTo(e,t,n,r){let i=du(e,t),o=hu(e,t),a=du(n,r),s=hu(n,r);oD(f0,i,a,rD),oD(d0,o,s,iD),p0(a,s)},bezierCurveTo(e,t,n,r,i,o){let a=du(e,t),s=hu(e,t),u=du(n,r),l=hu(n,r),c=du(i,o),f=hu(i,o);aD(f0,a,u,c,rD),aD(d0,s,l,f,iD),p0(c,f)},arc(e,t,n,r,i,o){if(r+=pu,i+=pu,f0=n*Math.cos(i)+e,d0=n*Math.sin(i)+t,Math.abs(i-r)>gH)ja(e-n,t-n),ja(e+n,t+n);else{let a=l=>ja(n*Math.cos(l)+e,n*Math.sin(l)+t),s,u;if(a(r),a(i),i!==r)if(r=r%Gi,r<0&&(r+=Gi),i=i%Gi,i<0&&(i+=Gi),i<r&&(o=!o,s=r,r=i,i=s),o)for(i-=Gi,s=r-r%fu,u=0;u<4&&s>i;++u,s-=fu)a(s);else for(s=r-r%fu+fu,u=0;u<4&&s<i;++u,s=s+fu)a(s)}}};function oD(e,t,n,r){let i=(e-t)/(e+n-2*t);0<i&&i<1&&r(e+(t-e)*i)}function aD(e,t,n,r,i){let o=r-e+3*t-3*n,a=e+n-2*t,s=e-t,u=0,l=0,c;Math.abs(o)>RG?(c=a*a+s*o,c>=0&&(c=Math.sqrt(c),u=(-a+c)/o,l=(-a-c)/o)):u=.5*s/a,0<u&&u<1&&i(sD(u,e,t,n,r)),0<l&&l<1&&i(sD(l,e,t,n,r))}function sD(e,t,n,r,i){let o=1-e,a=o*o,s=e*e;return a*o*t+3*a*e*n+3*o*s*r+s*e*i}var Ha=(Ha=Cr(1,1))?Ha.getContext("2d"):null,Gw=new ft;function nE(e){return function(t,n){if(!Ha)return!0;e(Ha,t),Gw.clear().union(t.bounds).intersect(n).round();let{x1:r,y1:i,x2:o,y2:a}=Gw;for(let s=i;s<=a;++s)for(let u=r;u<=o;++u)if(Ha.isPointInPath(u,s))return!0;return!1}}function rE(e,t){return t.contains(e.x||0,e.y||0)}function RD(e,t){let n=e.x||0,r=e.y||0,i=e.width||0,o=e.height||0;return t.intersects(Gw.set(n,r,n+i,r+o))}function MD(e,t){let n=e.x||0,r=e.y||0,i=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:r;return tc(t,n,r,i,o)}function tc(e,t,n,r,i){let{x1:o,y1:a,x2:s,y2:u}=e,l=r-t,c=i-n,f=0,d=1,h,p,m,g;for(g=0;g<4;++g){if(g===0&&(h=-l,p=-(o-t)),g===1&&(h=l,p=s-t),g===2&&(h=-c,p=-(a-n)),g===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(m=p/h,h<0){if(m>d)return!1;m>f&&(f=m)}else if(h>0){if(m<f)return!1;m<d&&(d=m)}}return!0}function rc(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Jr(e,t){return e??t}function uD(e,t){let n=t.length;for(let r=0;r<n;++r)e.addColorStop(t[r].offset,t[r].color);return e}function xH(e,t,n){let r=n.width(),i=n.height(),o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+Jr(t.x1,.5)*r,n.y1+Jr(t.y1,.5)*i,Math.max(r,i)*Jr(t.r1,0),n.x1+Jr(t.x2,.5)*r,n.y1+Jr(t.y2,.5)*i,Math.max(r,i)*Jr(t.r2,.5));else{let a=Jr(t.x1,0),s=Jr(t.y1,0),u=Jr(t.x2,1),l=Jr(t.y2,0);if(a===u||s===l||r===i)o=e.createLinearGradient(n.x1+a*r,n.y1+s*i,n.x1+u*r,n.y1+l*i);else{let c=Cr(Math.ceil(r),Math.ceil(i)),f=c.getContext("2d");return f.scale(r,i),f.fillStyle=uD(f.createLinearGradient(a,s,u,l),t.stops),f.fillRect(0,0,r,i),e.createPattern(c,"no-repeat")}}return uD(o,t.stops)}function $D(e,t,n){return Qw(n)?xH(e,n,t.bounds):n}function w0(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=$D(e,t,t.fill),!0):!1}var bH=[];function ic(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=$D(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||bH),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function vH(e,t){return e.zindex-t.zindex||e.index-t.index}function iE(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i<o;++i)r=t[i],r.index=i,r.zindex&&n.push(r);return e.zdirty=!1,e.zitems=n.sort(vH)}function ei(e,t){var n=e.items,r,i;if(!n||!n.length)return;let o=iE(e);if(o&&o.length){for(r=0,i=n.length;r<i;++r)n[r].zindex||t(n[r]);n=o}for(r=0,i=n.length;r<i;++r)t(n[r])}function E0(e,t){var n=e.items,r,i;if(!n||!n.length)return null;let o=iE(e);for(o&&o.length&&(n=o),i=n.length;--i>=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function oE(e){return function(t,n,r){ei(n,i=>{(!r||r.intersects(i.bounds))&&TD(e,t,i,i)})}}function wH(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&TD(e,t,n.items[0],n.items)}}function TD(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(rc(t,n),n.fill&&w0(t,n,i)&&t.fill(),n.stroke&&ic(t,n,i)&&t.stroke()))}function P0(e){return e=e||Mt,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,E0(n,s=>{let u=s.bounds;if(!(u&&!u.contains(o,a)||!u)&&e(t,s,r,i,o,a))return s})}}function gh(e,t){return function(n,r,i,o){var a=Array.isArray(r)?r[0]:r,s=t??a.fill,u=a.stroke&&n.isPointInStroke,l,c;return u&&(l=a.strokeWidth,c=a.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,r)?!1:s&&n.isPointInPath(i,o)||u&&n.isPointInStroke(i,o)}}function aE(e){return P0(gh(e))}function mu(e,t){return"translate("+e+","+t+")"}function sE(e){return"rotate("+e+")"}function EH(e,t){return"scale("+e+","+t+")"}function DD(e){return mu(e.x||0,e.y||0)}function SH(e){return mu(e.x||0,e.y||0)+(e.angle?" "+sE(e.angle):"")}function _H(e){return mu(e.x||0,e.y||0)+(e.angle?" "+sE(e.angle):"")+(e.scaleX||e.scaleY?" "+EH(e.scaleX||1,e.scaleY||1):"")}function uE(e,t,n){function r(a,s){a("transform",SH(s)),a("d",t(null,s))}function i(a,s){return t(mh(a,s.angle),s),Hi(a,s).translate(s.x||0,s.y||0)}function o(a,s){var u=s.x||0,l=s.y||0,c=s.angle||0;a.translate(u,l),c&&a.rotate(c*=Ya),a.beginPath(),t(a,s),c&&a.rotate(-c),a.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:oE(o),pick:aE(o),isect:n||nE(o)}}var AH=uE("arc",uH);function kH(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,a,s;--i>=0;)e[i].defined!==!1&&(s=Math.abs(e[i][r]-n),s<o&&(o=s,a=e[i]));return a}function CH(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),r=e.length,i,o,a;--r>=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],a=i*i+o*o,a<n))return e[r];return null}function FH(e,t){for(var n=e.length,r,i,o;--n>=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o<r*r))return e[n];return null}function lE(e,t,n){function r(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function i(u,l){var c=l.items;return c.length===0?u:(t(mh(u),c),Hi(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}let a=gh(o);function s(u,l,c,f,d,h){var p=l.items,m=l.bounds;return!p||!p.length||m&&!m.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,a(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:r,bound:i,draw:wH(o),pick:s,isect:rE,tip:n}}var RH=lE("area",lH,kH);function MH(e,t){var n=t.clip;e.save(),de(n)?(e.beginPath(),n(e),e.clip()):ND(e,t.group)}function ND(e,t){e.beginPath(),eE(t)?ac(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function OD(e){let t=Jr(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function $H(e,t){e("transform",DD(t))}function ID(e,t){let n=OD(t);e("d",ac(null,t,n,n))}function TH(e,t){e("class","background"),e("aria-hidden",!0),ID(e,t)}function DH(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?ID(e,t):e("d","")}function NH(e,t,n){let r=t.clip?tE(n,t,t):null;e("clip-path",r)}function OH(e,t){if(!t.clip&&t.items){let n=t.items,r=n.length;for(let i=0;i<r;++i)e.union(n[i].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Hi(e,t),e.translate(t.x||0,t.y||0)}function ih(e,t,n,r){let i=OD(t);e.beginPath(),ac(e,t,(n||0)+i,(r||0)+i)}var IH=gh(ih),PH=gh(ih,!1),LH=gh(ih,!0);function zH(e,t,n,r){ei(t,i=>{let o=i.x||0,a=i.y||0,s=i.strokeForeground,u=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&u&&(ih(e,i,o,a),rc(e,i),i.fill&&w0(e,i,u)&&e.fill(),i.stroke&&!s&&ic(e,i,u)&&e.stroke()),e.save(),e.translate(o,a),i.clip&&ND(e,i),n&&n.translate(-o,-a),ei(i,l=>{(l.marktype==="group"||r==null||r.includes(l.marktype))&&this.draw(e,l,n,r)}),n&&n.translate(o,a),e.restore(),s&&i.stroke&&u&&(ih(e,i,o,a),rc(e,i),ic(e,i,u)&&e.stroke())})}function BH(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;let a=n*e.pixelRatio,s=r*e.pixelRatio;return E0(t,u=>{let l,c,f,d=u.bounds;if(d&&!d.contains(i,o))return;c=u.x||0,f=u.y||0;let h=c+(u.width||0),p=f+(u.height||0),m=u.clip;if(m&&(i<c||i>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,m&&eE(u)&&!LH(e,u,a,s))return e.restore(),null;let g=u.strokeForeground,y=t.interactive!==!1;return y&&g&&u.stroke&&PH(e,u,a,s)?(e.restore(),u):(l=E0(u,b=>UH(b,c,f)?this.pick(b,n,r,c,f):null),!l&&y&&(u.fill||!g&&u.stroke)&&IH(e,u,a,s)&&(l=u),e.restore(),l||null)})}function UH(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var qH={type:"group",tag:"g",nested:!1,attr:$H,bound:OH,draw:zH,pick:BH,isect:RD,content:NH,background:TH,foreground:DH},oh={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function cE(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(r=>{e.image=r,e.image.url=e.url})),n}function fE(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function dE(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function L0(e,t){return e==="center"?t/2:e==="right"?t:0}function z0(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function jH(e,t,n){let r=cE(t,n),i=fE(t,r),o=dE(t,r),a=(t.x||0)-L0(t.align,i),s=(t.y||0)-z0(t.baseline,o),u=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",u,oh["xmlns:xlink"],"xlink:href"),e("transform",mu(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function WH(e,t){let n=t.image,r=fE(t,n),i=dE(t,n),o=(t.x||0)-L0(t.align,r),a=(t.y||0)-z0(t.baseline,i);return e.set(o,a,o+r,a+i)}function GH(e,t,n){ei(t,r=>{if(n&&!n.intersects(r.bounds))return;let i=cE(r,this),o=fE(r,i),a=dE(r,i);if(o===0||a===0)return;let s=(r.x||0)-L0(r.align,o),u=(r.y||0)-z0(r.baseline,a),l,c,f,d;r.aspect!==!1&&(c=i.width/i.height,f=r.width/r.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(a-d)/2,a=d):(d=a*c,s+=(o-d)/2,o=d))),(i.complete||i.toDataURL)&&(rc(e,r),e.globalAlpha=(l=r.opacity)!=null?l:1,e.imageSmoothingEnabled=r.smooth!==!1,e.drawImage(i,s,u,o,a))})}var HH={type:"image",tag:"image",nested:!1,attr:jH,bound:WH,draw:GH,pick:P0(),isect:Mt,get:cE,xOffset:L0,yOffset:z0},YH=lE("line",cH,CH);function VH(e,t){var n=t.scaleX||1,r=t.scaleY||1;(n!==1||r!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",_H(t)),e("d",t.path)}function m0(e,t){var n=t.path;if(n==null)return!0;var r=t.x||0,i=t.y||0,o=t.scaleX||1,a=t.scaleY||1,s=(t.angle||0)*Ya,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=gu(n)).path=n),s&&e.rotate&&e.translate?(e.translate(r,i),e.rotate(s),nc(e,u,0,0,o,a),e.rotate(-s),e.translate(-r,-i)):nc(e,u,r,i,o,a)}function XH(e,t){return m0(mh(e,t.angle),t)?e.set(0,0,0,0):Hi(e,t,!0)}var KH={type:"path",tag:"path",nested:!1,attr:VH,bound:XH,draw:oE(m0),pick:aE(m0),isect:nE(m0)};function QH(e,t){e("d",ac(null,t))}function JH(e,t){var n,r;return Hi(e.set(n=t.x||0,r=t.y||0,n+t.width||0,r+t.height||0),t)}function lD(e,t){e.beginPath(),ac(e,t)}var ZH={type:"rect",tag:"path",nested:!1,attr:QH,bound:JH,draw:oE(lD),pick:aE(lD),isect:RD};function eY(e,t){e("transform",DD(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function tY(e,t){var n,r;return Hi(e.set(n=t.x||0,r=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:r),t)}function PD(e,t,n){var r,i,o,a;return t.stroke&&ic(e,t,n)?(r=t.x||0,i=t.y||0,o=t.x2!=null?t.x2:r,a=t.y2!=null?t.y2:i,e.beginPath(),e.moveTo(r,i),e.lineTo(o,a),!0):!1}function nY(e,t,n){ei(t,r=>{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&PD(e,r,i)&&(rc(e,r),e.stroke())}})}function rY(e,t,n,r){return e.isPointInStroke?PD(e,t,1)&&e.isPointInStroke(n,r):!1}var iY={type:"rule",tag:"line",nested:!1,attr:eY,bound:tY,draw:nY,pick:P0(rY),isect:MD},oY=uE("shape",fH),aY=uE("symbol",dH,rE),cD=Cb(),Kn={height:Yi,measureWidth:hE,estimateWidth:S0,width:S0,canvas:LD};LD(!0);function LD(e){Kn.width=e&&Ha?hE:S0}function S0(e,t){return zD(Xa(e,t),Yi(e))}function zD(e,t){return~~(.8*e.length*t)}function hE(e,t){return Yi(e)<=0||!(t=Xa(e,t))?0:BD(t,U0(e))}function BD(e,t){let n=`(${t}) ${e}`,r=cD.get(n);return r===void 0&&(Ha.font=t,r=Ha.measureText(e).width,cD.set(n,r)),r}function Yi(e){return e.fontSize!=null?+e.fontSize||0:11}function Va(e){return e.lineHeight!=null?e.lineHeight:Yi(e)+2}function sY(e){return I(e)?e.length>1?e:e[0]:e}function yh(e){return sY(e.lineBreak&&e.text&&!I(e.text)?e.text.split(e.lineBreak):e.text)}function B0(e){let t=yh(e);return(I(t)?t.length-1:0)*Va(e)}function Xa(e,t){let n=t==null?"":(t+"").trim();return e.limit>0&&n.length?lY(e,n):n}function uY(e){if(Kn.width===hE){let t=U0(e);return n=>BD(n,t)}else if(Kn.width===S0){let t=Yi(e);return n=>zD(n,t)}else return t=>Kn.width(e,t)}function lY(e,t){var n=+e.limit,r=uY(e);if(r(t)<n)return t;var i=e.ellipsis||"\u2026",o=e.dir==="rtl",a=0,s=t.length,u;if(n-=r(i),o){for(;a<s;)u=a+s>>>1,r(t.slice(u))>n?a=u+1:s=u;return i+t.slice(a)}else{for(;a<s;)u=1+(a+s>>>1),r(t.slice(0,u))<n?a=u:s=u-1;return t.slice(0,a)+i}}function xh(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function U0(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Yi(e)+"px "+xh(e,t)}function pE(e){var t=e.baseline,n=Yi(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Va(e):t==="line-bottom"?.29*n-.5*Va(e):0)}var cY={left:"start",center:"middle",right:"end"},th=new ft;function q0(e){var t=e.x||0,n=e.y||0,r=e.radius||0,i;return r&&(i=(e.theta||0)-fu,t+=r*Math.cos(i),n+=r*Math.sin(i)),th.x1=t,th.y1=n,th}function fY(e,t){var n=t.dx||0,r=(t.dy||0)+pE(t),i=q0(t),o=i.x1,a=i.y1,s=t.angle||0,u;e("text-anchor",cY[t.align]||"start"),s?(u=mu(o,a)+" "+sE(s),(n||r)&&(u+=" "+mu(n,r))):u=mu(o+n,a+r),e("transform",u)}function mE(e,t,n){var r=Kn.height(t),i=t.align,o=q0(t),a=o.x1,s=o.y1,u=t.dx||0,l=(t.dy||0)+pE(t)-Math.round(.8*r),c=yh(t),f;if(I(c)?(r+=Va(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Kn.width(t,h)),0)):f=Kn.width(t,c),i==="center"?u-=f/2:i==="right"&&(u-=f),e.set(u+=a,l+=s,u+f,l+r),t.angle&&!n)e.rotate(t.angle*Ya,a,s);else if(n===2)return e.rotatedPoints(t.angle*Ya,a,s);return e}function dY(e,t,n){ei(t,r=>{var i=r.opacity==null?1:r.opacity,o,a,s,u,l,c,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=U0(r),e.textAlign=r.align||"left",o=q0(r),a=o.x1,s=o.y1,r.angle&&(e.save(),e.translate(a,s),e.rotate(r.angle*Ya),a=s=0),a+=r.dx||0,s+=(r.dy||0)+pE(r),c=yh(r),rc(e,r),I(c))for(l=Va(r),u=0;u<c.length;++u)f=Xa(r,c[u]),r.fill&&w0(e,r,i)&&e.fillText(f,a,s),r.stroke&&ic(e,r,i)&&e.strokeText(f,a,s),s+=l;else f=Xa(r,c),r.fill&&w0(e,r,i)&&e.fillText(f,a,s),r.stroke&&ic(e,r,i)&&e.strokeText(f,a,s);r.angle&&e.restore()}})}function hY(e,t,n,r,i,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=q0(t),s=a.x1,u=a.y1,l=mE(th,t,1),c=-t.angle*Ya,f=Math.cos(c),d=Math.sin(c),h=f*i-d*o+(s-f*s+d*u),p=d*i+f*o+(u-d*s-f*u);return l.contains(h,p)}function pY(e,t){let n=mE(th,e,2);return tc(t,n[0],n[1],n[2],n[3])||tc(t,n[0],n[1],n[4],n[5])||tc(t,n[4],n[5],n[6],n[7])||tc(t,n[2],n[3],n[6],n[7])}var mY={type:"text",tag:"text",nested:!1,attr:fY,bound:mE,draw:dY,pick:P0(hY),isect:pY},gY=lE("trail",hH,FH),Tn={arc:AH,area:RH,group:qH,image:HH,line:YH,path:KH,rect:ZH,rule:iY,shape:oY,symbol:aY,text:mY,trail:gY};function Hw(e,t,n){var r=Tn[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new ft),e,n)}var fD={mark:null};function UD(e,t,n){var r=Tn[e.marktype],i=r.bound,o=e.items,a=o&&o.length,s,u,l,c;if(r.nested)return a?l=o[0]:(fD.mark=e,l=fD),c=Hw(l,i,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new ft,a)for(s=0,u=o.length;s<u;++s)t.union(Hw(o[s],i,n));return e.bounds=t}var yY=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function qD(e,t){return JSON.stringify(e,yY,t)}function jD(e){let t=typeof e=="string"?JSON.parse(e):e;return WD(t)}function WD(e){var t=e.marktype,n=e.items,r,i,o;if(n)for(i=0,o=n.length;i<o;++i)r=t?"mark":"group",n[i][r]=e,n[i].zindex&&(n[i][r].zdirty=!0),(t||r)==="group"&&WD(n[i]);return t&&UD(e),e}var ah=class{constructor(t){arguments.length?this.root=jD(t):(this.root=dD({marktype:"group",name:"root",role:"frame"}),this.root.items=[new ph(this.root)])}toJSON(t){return qD(this.root,t||0)}mark(t,n,r){n=n||this.root.items[0];let i=dD(t,n);return n.items[r]=i,i.zindex&&(i.group.zdirty=!0),i}};function dD(e,t){let n={bounds:new ft,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Wa(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function gE(e,t){t=t.toLowerCase();for(var n=e.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===t)return n[r]}function Nt(e,t,n,r){var i=e.childNodes[t],o;return(!i||i.tagName.toLowerCase()!==n.toLowerCase())&&(o=i||null,i=Wa(e.ownerDocument,n,r),e.insertBefore(i,o)),i}function $r(e,t){for(var n=e.childNodes,r=n.length;r>t;)e.removeChild(n[--r]);return e}function GD(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function bh(e,t){let n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function xY(e,t,n,r){var i=e&&e.mark,o,a;if(i&&(o=Tn[i.marktype]).tip){for(a=bh(t,n),a[0]-=r[0],a[1]-=r[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=o.tip(i.items,a)}return e}var sh=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||Nl(),this._tooltip=n||bY}initialize(t,n,r){return this._el=t,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,r){for(let i=t?t.length:0;--i>=0;)if(t[i].type===n&&(!r||t[i].handler===r))return i;return-1}handlers(t){let n=this._handlers,r=[];if(t)r.push(...n[this.eventName(t)]);else for(let i in n)r.push(...n[i]);return r}eventName(t){let n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{let o=new MouseEvent(t.type,t),a=Wa(null,"a");for(let s in i)a.setAttribute(s,i[s]);a.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,r){if(n&&n.tooltip!=null){n=xY(n,t,this.canvas(),this._origin);let i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,i)}}getItemBoundingClientRect(t){let n=this.canvas();if(!n)return;let r=n.getBoundingClientRect(),i=this._origin,o=t.bounds,a=o.width(),s=o.height(),u=o.x1+i[0]+r.left,l=o.y1+i[1]+r.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:a,height:s,left:u,top:l,right:u+a,bottom:l+s}}};function bY(e,t,n,r){e.element().setAttribute("title",r||"")}var yu=class{constructor(t){this._el=null,this._bgcolor=null,this._loader=new v0(t)}initialize(t,n,r,i,o){return this._el=t,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,r,i){return this._width=t,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(t,n){let r=this;return r._call=function(){r._render(t,n)},r._call(),r._call=null,r}_render(){}renderAsync(t,n){let r=this.render(t,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(t,n){var r=this,i=r._loader[t](n);if(!r._ready){let o=r._call;r._ready=r._loader.ready().then(a=>{a&&o(),r._ready=null})}return i}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}},vY="keydown",wY="keypress",EY="keyup",HD="dragenter",g0="dragleave",YD="dragover",Yw="pointerdown",SY="pointerup",_0="pointermove",y0="pointerout",VD="pointerover",Vw="mousedown",_Y="mouseup",XD="mousemove",A0="mouseout",KD="mouseover",k0="click",AY="dblclick",kY="wheel",QD="mousewheel",C0="touchstart",F0="touchmove",R0="touchend",CY=[vY,wY,EY,HD,g0,YD,Yw,SY,_0,y0,VD,Vw,_Y,XD,A0,KD,k0,AY,kY,QD,C0,F0,R0],Xw=_0,nh=A0,Kw=k0,Ka=class extends sh{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=CY,this.pointermove=pD([_0,XD],[VD,KD],[y0,A0]),this.dragover=pD([YD],[HD],[g0]),this.pointerout=mD([y0,A0]),this.dragleave=mD([g0])}initialize(t,n,r){return this._canvas=t&&gE(t,"canvas"),[k0,Vw,Yw,_0,y0,g0].forEach(i=>hD(this,i)),super.initialize(t,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(QD,t)}pointerdown(t){this._down=this._active,this.fire(Yw,t)}mousedown(t){this._down=this._active,this.fire(Vw,t)}click(t){this._down===this._active&&(this.fire(k0,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(C0,t,!0)}touchmove(t){this.fire(F0,t,!0)}touchend(t){this.fire(R0,t,!0),this._touch=null}fire(t,n,r){let i=r?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===Kw&&i&&i.href?this.handleHref(n,i,i.href):(t===Xw||t===nh)&&this.handleTooltip(n,i,t!==nh),o)for(let a=0,s=o.length;a<s;++a)o[a].handler.call(this._obj,n,i)}on(t,n){let r=this.eventName(t),i=this._handlers;return this._handlerIndex(i[r],t,n)<0&&(hD(this,t),(i[r]||(i[r]=[])).push({type:t,handler:n})),this}off(t,n){let r=this.eventName(t),i=this._handlers[r],o=this._handlerIndex(i,t,n);return o>=0&&i.splice(o,1),this}pickEvent(t){let n=bh(t,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(t,n,r,i,o){let a=this.context();return Tn[t.marktype].pick.call(this,a,t,n,r,i,o)}},FY=e=>e===C0||e===F0||e===R0?[C0,F0,R0]:[e];function hD(e,t){FY(t).forEach(n=>RY(e,n))}function RY(e,t){let n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function eh(e,t,n){t.forEach(r=>e.fire(r,n))}function pD(e,t,n){return function(r){let i=this._active,o=this.pickEvent(r);o===i?eh(this,e,r):((!i||!i.exit)&&eh(this,n,r),this._active=o,eh(this,t,r),eh(this,e,r))}}function mD(e){return function(t){eh(this,e,t),this._active=null}}function MY(){return typeof window<"u"&&window.devicePixelRatio||1}function $Y(e,t,n,r,i,o){let a=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,s=e.getContext("2d"),u=a?MY():i;e.width=t*u,e.height=n*u;for(let l in o)s[l]=o[l];return a&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1]),e}var oc=class extends yu{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new ft,this._tempb=new ft}initialize(t,n,r,i,o,a){return this._options=a||{},this._canvas=this._options.externalContext?null:Cr(1,1,this._options.type),t&&this._canvas&&($r(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,r,i,o)}resize(t,n,r,i){if(super.resize(t,n,r,i),this._canvas)$Y(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{let o=this._options.externalContext;o||O("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){let n=this._tempb.clear().union(t.bounds),r=t.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(t,n){let r=this.context(),i=this._origin,o=this._width,a=this._height,s=this._dirty,u=TY(i,o,a);r.save();let l=this._redraw||s.empty()?(this._redraw=!1,u.expand(1)):DY(r,u.intersect(s),i);return this.clear(-i[0],-i[1],o,a),this.draw(r,t,l,n),r.restore(),s.clear(),this}draw(t,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;let o=Tn[n.marktype];n.clip&&MH(t,n),o.draw.call(this,t,n,r,i),n.clip&&t.restore()}clear(t,n,r,i){let o=this._options,a=this.context();o.type!=="pdf"&&!o.externalContext&&a.clearRect(t,n,r,i),this._bgcolor!=null&&(a.fillStyle=this._bgcolor,a.fillRect(t,n,r,i))}},TY=(e,t,n)=>new ft().set(0,0,t,n).translate(-e[0],-e[1]);function DY(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}var M0=class extends sh{constructor(t,n){super(t,n);let r=this;r._hrefHandler=Bw(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=Bw(r,(i,o)=>{r.handleTooltip(i,o,i.type!==nh)})}initialize(t,n,r){let i=this._svg;return i&&(i.removeEventListener(Kw,this._hrefHandler),i.removeEventListener(Xw,this._tooltipHandler),i.removeEventListener(nh,this._tooltipHandler)),this._svg=i=t&&gE(t,"svg"),i&&(i.addEventListener(Kw,this._hrefHandler),i.addEventListener(Xw,this._tooltipHandler),i.addEventListener(nh,this._tooltipHandler)),super.initialize(t,n,r)}canvas(){return this._svg}on(t,n){let r=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[r],t,n)<0){let a={type:t,handler:n,listener:Bw(this,n)};(i[r]||(i[r]=[])).push(a),this._svg&&this._svg.addEventListener(r,a.listener)}return this}off(t,n){let r=this.eventName(t),i=this._handlers[r],o=this._handlerIndex(i,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}},Bw=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)},JD="aria-hidden",yE="aria-label",xE="role",bE="aria-roledescription",ZD="graphics-object",vE="graphics-symbol",eN=(e,t,n)=>({[xE]:e,[bE]:t,[yE]:n||void 0}),NY=$t(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),gD={axis:{desc:"axis",caption:PY},legend:{desc:"legend",caption:LY},"title-text":{desc:"title",caption:e=>`Title text '${xD(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${xD(e)}'`}},yD={ariaRole:xE,ariaRoleDescription:bE,description:yE};function tN(e,t){let n=t.aria===!1;if(e(JD,n||void 0),n||t.description==null)for(let r in yD)e(yD[r],void 0);else{let r=t.mark.marktype;e(yE,t.description),e(xE,t.ariaRole||(r==="group"?ZD:vE)),e(bE,t.ariaRoleDescription||`${r} mark`)}}function nN(e){return e.aria===!1?{[JD]:!0}:NY[e.role]?null:gD[e.role]?IY(e,gD[e.role]):OY(e)}function OY(e){let t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return eN(n?ZD:vE,`${t} mark container`,e.description)}function IY(e,t){try{let n=e.items[0],r=t.caption||(()=>"");return eN(t.role||vE,t.desc,n.description||r(n))}catch{return null}}function xD(e){return J(e.text).join(" ")}function PY(e){let t=e.datum,n=e.orient,r=t.title?rN(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${Ua(s)?"discrete":s} scale with ${Nw(a,o,e)}`}function LY(e){let t=e.datum,n=t.title?rN(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return BY(r)+(n?` titled '${n}'`:"")+` for ${zY(o)} with ${Nw(u,s,e)}`}function rN(e){try{return J(ve(e.items).items[0].text).join(" ")}catch{return null}}function zY(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ve(e)}function BY(e){return e.length?e[0].toUpperCase()+e.slice(1):e}var iN=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),UY=e=>iN(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function wE(){let e="",t="",n="",r=[],i=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,i()),r.push(u)},a=(u,l)=>(l!=null&&(t+=` ${u}="${UY(l)}"`),s),s={open(u,...l){o(u),t="<"+u;for(let c of l)for(let f in c)a(f,c[f]);return s},close(){let u=r.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,i(),s},attr:a,text:u=>(n+=iN(u),s),toString:()=>e};return s}var oN=e=>aN(wE(),e)+"";function aN(e,t){if(e.open(t.tagName),t.hasAttributes()){let n=t.attributes,r=n.length;for(let i=0;i<r;++i)e.attr(n[i].name,n[i].value)}if(t.hasChildNodes()){let n=t.childNodes;for(let r of n)r.nodeType===3?e.text(r.nodeValue):aN(e,r)}return e.close()}var $0={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},T0={blend:"mix-blend-mode"},sN={fill:"none","stroke-miterlimit":10},Zd=0,bD="http://www.w3.org/2000/xmlns/",Dt=oh.xmlns,uh=class extends yu{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,r,i,o){return this._defs={},this._clearDefs(),t&&(this._svg=Nt(t,0,"svg",Dt),this._svg.setAttributeNS(bD,"xmlns",Dt),this._svg.setAttributeNS(bD,"xmlns:xlink",oh["xmlns:xlink"]),this._svg.setAttribute("version",oh.version),this._svg.setAttribute("class","marks"),$r(t,1),this._root=Nt(this._svg,Zd,"g",Dt),Ga(this._root,sN),$r(this._svg,Zd+1)),this.background(this._bgcolor),super.initialize(t,n,r,i,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,r,i){return super.resize(t,n,r,i),this._svg&&(Ga(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){let t=this._svg,n=this._bgcolor;if(!t)return null;let r;n&&(t.removeAttribute("style"),r=Nt(t,Zd,"rect",Dt),Ga(r,{width:this._width,height:this._height,fill:n}));let i=oN(t);return n&&(t.removeChild(r),this._svg.style.setProperty("background-color",n)),i}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),$r(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;let t=this._dirty;if(!t.length||!this._dirtyID)return!0;let n=++this._dirtyID,r,i,o,a,s,u,l;for(s=0,u=t.length;s<u;++s)if(r=t[s],i=r.mark,i.marktype!==o&&(o=i.marktype,a=Tn[o]),i.zdirty&&i.dirty!==n&&(this._dirtyAll=!1,vD(r,n),i.items.forEach(c=>{c.dirty=n})),!i.zdirty){if(r.exit){a.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(a,l._svg,l)):r._svg&&(l=r._svg.parentNode,l&&l.removeChild(r._svg)),r._svg=null;continue}r=a.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,vD(r,n)):this._update(a,r._svg,r),r._update=n)}return!this._dirtyAll}mark(t,n,r,i){if(!this.isDirty(n))return n._svg;let o=this._svg,a=n.marktype,s=Tn[a],u=n.interactive===!1?"none":null,l=s.tag==="g",c=wD(n,t,r,"g",o);if(a!=="group"&&i!=null&&!i.includes(a))return $r(c,0),n._svg;c.setAttribute("class",GD(n));let f=nN(n);for(let m in f)$n(c,m,f[m]);l||$n(c,"pointer-events",u),$n(c,"clip-path",n.clip?tE(this,n,n.group):null);let d=null,h=0,p=m=>{let g=this.isDirty(m),y=wD(m,c,d,s.tag,o);g&&(this._update(s,y,m),l&&WY(this,y,m,i)),d=y,++h};return s.nested?n.items.length&&p(n.items[0]):ei(n,p),$r(c,h),c}_update(t,n,r){Po=n,yn=n.__values__,tN(rh,r),t.attr(rh,r,this);let i=HY[t.type];i&&i.call(this,t,n,r),Po&&this.style(Po,r)}style(t,n){if(n!=null){for(let r in $0){let i=r==="font"?xh(n):n[r];if(i===yn[r])continue;let o=$0[r];i==null?t.removeAttribute(o):(Qw(i)&&(i=SD(i,this._defs.gradient,uN())),t.setAttribute(o,i+"")),yn[r]=i}for(let r in T0)x0(t,T0[r],n[r])}}defs(){let t=this._svg,n=this._defs,r=n.el,i=0;for(let o in n.gradient)r||(n.el=r=Nt(t,Zd+1,"defs",Dt)),i=qY(r,n.gradient[o],i);for(let o in n.clipping)r||(n.el=r=Nt(t,Zd+1,"defs",Dt)),i=jY(r,n.clipping[o],i);r&&(i===0?(t.removeChild(r),n.el=null):$r(r,i))}_clearDefs(){let t=this._defs;t.gradient={},t.clipping={}}};function vD(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function qY(e,t,n){let r,i,o;if(t.gradient==="radial"){let a=Nt(e,n++,"pattern",Dt);Ga(a,{id:b0+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),a=Nt(a,0,"rect",Dt),Ga(a,{width:1,height:1,fill:`url(${uN()}#${t.id})`}),e=Nt(e,n++,"radialGradient",Dt),Ga(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Nt(e,n++,"linearGradient",Dt),Ga(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r<i;++r)o=Nt(e,r,"stop",Dt),o.setAttribute("offset",t.stops[r].offset),o.setAttribute("stop-color",t.stops[r].color);return $r(e,r),n}function jY(e,t,n){let r;return e=Nt(e,n,"clipPath",Dt),e.setAttribute("id",t.id),t.path?(r=Nt(e,0,"path",Dt),r.setAttribute("d",t.path)):(r=Nt(e,0,"rect",Dt),Ga(r,{x:0,y:0,width:t.width,height:t.height})),$r(e,1),n+1}function WY(e,t,n,r){t=t.lastChild.previousSibling;let i,o=0;ei(n,a=>{i=e.mark(t,a,i,r),++o}),$r(t,1+o)}function wD(e,t,n,r,i){let o=e._svg,a;if(!o&&(a=t.ownerDocument,o=Wa(a,r,Dt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){let s=Wa(a,"path",Dt);o.appendChild(s),s.__data__=e;let u=Wa(a,"g",Dt);o.appendChild(u),u.__data__=e;let l=Wa(a,"path",Dt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==i||GY(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function GY(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}var Po=null,yn=null,HY={group(e,t,n){let r=Po=t.childNodes[2];yn=r.__values__,e.foreground(rh,n,this),yn=t.__values__,Po=t.childNodes[1],e.content(rh,n,this);let i=Po=t.childNodes[0];e.background(rh,n,this);let o=n.mark.interactive===!1?"none":null;if(o!==yn.events&&($n(r,"pointer-events",o),$n(i,"pointer-events",o),yn.events=o),n.strokeForeground&&n.stroke){let a=n.fill;$n(r,"display",null),this.style(i,n),$n(i,"stroke",null),a&&(n.fill=null),yn=r.__values__,this.style(r,n),a&&(n.fill=a),Po=null}else $n(r,"display","none")},image(e,t,n){n.smooth===!1?(x0(t,"image-rendering","optimizeSpeed"),x0(t,"image-rendering","pixelated")):x0(t,"image-rendering",null)},text(e,t,n){let r=yh(n),i,o,a,s;I(r)?(o=r.map(u=>Xa(n,u)),i=o.join(`
|
|
9
|
+
`),i!==yn.text&&($r(t,0),a=t.ownerDocument,s=Va(n),o.forEach((u,l)=>{let c=Wa(a,"tspan",Dt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",s)),t.appendChild(c)}),yn.text=i)):(o=Xa(n,r),o!==yn.text&&(t.textContent=o,yn.text=o)),$n(t,"font-family",xh(n)),$n(t,"font-size",Yi(n)+"px"),$n(t,"font-style",n.fontStyle),$n(t,"font-variant",n.fontVariant),$n(t,"font-weight",n.fontWeight)}};function rh(e,t,n){t!==yn[e]&&(n?YY(Po,e,t,n):$n(Po,e,t),yn[e]=t)}function x0(e,t,n){n!==yn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),yn[t]=n)}function Ga(e,t){for(let n in t)$n(e,n,t[n])}function $n(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function YY(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function uN(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}var D0=class extends yu{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){let n=wE();n.open("svg",he({},oh,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));let r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",sN,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){let r=Tn[n.marktype],i=r.tag,o=[tN,r.attr];t.open("g",{class:GD(n),"clip-path":n.clip?tE(this,n,n.group):null},nN(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});let a=s=>{let u=this.href(s);if(u&&t.open("a",u),t.open(i,this.attr(n,s,o,i!=="g"?i:null)),i==="text"){let l=yh(s);if(I(l)){let c={x:0,dy:Va(s)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Xa(s,l[f])).close()}else t.text(Xa(s,l))}else if(i==="g"){let l=s.strokeForeground,c=s.fill,f=s.stroke;l&&f&&(s.stroke=null),t.open("path",this.attr(n,s,r.background,"bgrect")).close(),t.open("g",this.attr(n,s,r.content)),ei(s,d=>this.mark(t,d)),t.close(),l&&f?(c&&(s.fill=null),s.stroke=f,t.open("path",this.attr(n,s,r.foreground,"bgrect")).close(),c&&(s.fill=c)):t.open("path",this.attr(n,s,r.foreground,"bgfore")).close()}t.close(),u&&t.close()};return r.nested?n.items&&n.items.length&&a(n.items[0]):ei(n,a),t.close()}href(t){let n=t.href,r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(t,n,r,i){let o={},a=(s,u,l,c)=>{o[c||s]=u};return Array.isArray(r)?r.forEach(s=>s(a,n,this)):r(a,n,this),i&&VY(o,n,t,i,this._defs),o}defs(t){let n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){t.open("defs");for(let o in n){let a=n[o],s=a.stops;a.gradient==="radial"?(t.open("pattern",{id:b0+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:a.x1,fy:a.y1,fr:a.r1,cx:a.x2,cy:a.y2,r:a.r2})):t.open("linearGradient",{id:o,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2});for(let u=0;u<s.length;++u)t.open("stop",{offset:s[u].offset,"stop-color":s[u].color}).close();t.close()}for(let o in r){let a=r[o];t.open("clipPath",{id:o}),a.path?t.open("path",{d:a.path}).close():t.open("rect",{x:0,y:0,width:a.width,height:a.height}).close(),t.close()}t.close()}}};function VY(e,t,n,r,i){let o;if(t==null||(r==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),r==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;r==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),r==="text"&&(e["font-family"]=xh(t),e["font-size"]=Yi(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(let a in $0){let s=t[a],u=$0[a];s==="transparent"&&(u==="fill"||u==="stroke")||s!=null&&(Qw(s)&&(s=SD(s,i.gradient,"")),e[u]=s)}for(let a in T0){let s=t[a];s!=null&&(o=o||[],o.push(`${T0[a]}: ${s};`))}return o&&(e.style=o.join(" ")),e}var Zr={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function XY(e){Zr.svgMarkTypes=e.svgMarkTypes??["text"],Zr.svgOnTop=e.svgOnTop??!0,Zr.debug=e.debug??!1}var lh=class extends yu{constructor(t){super(t),this._svgRenderer=new uh(t),this._canvasRenderer=new oc(t)}initialize(t,n,r,i,o){this._root_el=Nt(t,0,"div");let a=Nt(this._root_el,0,"div"),s=Nt(this._root_el,1,"div");return this._root_el.style.position="relative",Zr.debug||(a.style.height="100%",s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.height="100%",s.style.width="100%"),this._svgEl=Zr.svgOnTop?s:a,this._canvasEl=Zr.svgOnTop?a:s,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,r,i,o),this._svgRenderer.initialize(this._svgEl,n,r,i,o),super.initialize(t,n,r,i,o)}dirty(t){return Zr.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){let i=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!Zr.svgMarkTypes.includes(o));this._svgRenderer.render(t,Zr.svgMarkTypes),this._canvasRenderer.render(t,i)}resize(t,n,r,i){return super.resize(t,n,r,i),this._svgRenderer.resize(t,n,r,i),this._canvasRenderer.resize(t,n,r,i),this}background(t){return Zr.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}},N0=class extends Ka{constructor(t,n){super(t,n)}initialize(t,n,r){let i=Nt(Nt(t,0,"div"),Zr.svgOnTop?0:1,"div");return super.initialize(i,n,r)}},lN="canvas",cN="hybrid",fN="png",dN="svg",hN="none",Lo={Canvas:lN,PNG:fN,SVG:dN,Hybrid:cN,None:hN},xu={};xu[lN]=xu[fN]={renderer:oc,headless:oc,handler:Ka};xu[dN]={renderer:uh,headless:D0,handler:M0};xu[cN]={renderer:lh,headless:lh,handler:N0};xu[hN]={};function vh(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(xu[e]=t,this):xu[e]}function EE(e,t,n){let r=[],i=new ft().union(t),o=e.marktype;return o?pN(e,i,n,r):o==="group"?mN(e,i,n,r):O("Intersect scene must be mark node or group item.")}function pN(e,t,n,r){if(KY(e,t,n)){let i=e.items,o=e.marktype,a=i.length,s=0;if(o==="group")for(;s<a;++s)mN(i[s],t,n,r);else for(let u=Tn[o].isect;s<a;++s){let l=i[s];gN(l,t,u)&&r.push(l)}}return r}function KY(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function mN(e,t,n,r){n&&n(e.mark)&&gN(e,t,Tn.group.isect)&&r.push(e);let i=e.items,o=i&&i.length;if(o){let a=e.x||0,s=e.y||0;t.translate(-a,-s);for(let u=0;u<o;++u)pN(i[u],t,n,r);t.translate(a,s)}return r}function gN(e,t,n){let r=e.bounds;return t.encloses(r)||t.intersects(r)&&n(e,t)}var Uw=new ft;function SE(e){let t=e.clip;if(de(t))t(mh(Uw.clear()));else if(t)Uw.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Uw)}var QY=1e-9;function _E(e,t,n){return e===t?!0:n==="path"?yN(e,t):e instanceof Date&&t instanceof Date?+e==+t:ke(e)&&ke(t)?Math.abs(e-t)<=QY:!e||!t||!Q(e)&&!Q(t)?e==t:JY(e,t)}function yN(e,t){return _E(gu(e),gu(t))}function JY(e,t){var n=Object.keys(e),r=Object.keys(t),i,o;if(n.length!==r.length)return!1;for(n.sort(),r.sort(),o=n.length-1;o>=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!_E(e[i],t[i],i))return!1;return typeof e==typeof t}function ZY(){pH(),EG()}var lc="top",ti="left",ni="right",Za="bottom",eV="top-left",tV="top-right",nV="bottom-left",rV="bottom-right",CE="start",AE="middle",Dn="end",iV="x",oV="y",Y0="group",FE="axis",RE="title",aV="frame",sV="scope",ME="legend",CN="row-header",FN="row-footer",RN="row-title",MN="column-header",$N="column-footer",TN="column-title",uV="padding",lV="symbol",DN="fit",NN="fit-x",ON="fit-y",cV="pad",$E="none",j0="all",kE="each",TE="flush",Qa="column",Ja="row";function IN(e){N.call(this,null,e)}W(IN,N,{transform(e,t){let n=t.dataflow,r=e.mark,i=r.marktype,o=Tn[i],a=o.bound,s=r.bounds,u;if(o.nested)r.items.length&&n.dirty(r.items[0]),s=W0(r,a),r.items.forEach(l=>{l.bounds.clear().union(s)});else if(i===Y0||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),s.clear(),r.items.forEach(l=>s.union(W0(l,a))),r.role){case FE:case ME:case RE:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{s.union(W0(l,a))}),t.visit(t.MOD,l=>{u=u||s.alignsWith(l.bounds),n.dirty(l),s.union(W0(l,a))}),u&&(s.clear(),r.items.forEach(l=>s.union(l.bounds)));return SE(r),t.modifies("bounds")}});function W0(e,t,n){return t(e.bounds.clear(),e,n)}var xN=":vega_identifier:";function DE(e){N.call(this,0,e)}DE.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};W(DE,N,{transform(e,t){let n=fV(t.dataflow),r=e.as,i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function fV(e){return e._signals[xN]||(e._signals[xN]=e.add(0))}function PN(e){N.call(this,null,e)}W(PN,N,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,dV(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);let r=n.marktype===Y0?ph:hh;return t.visit(t.ADD,i=>r.call(i,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function dV(e){let t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function LN(e){N.call(this,null,e)}var bN={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!zN(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},zN=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),vN=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n<r;i=o,++n)if(zN(i,o=e[n].bounds,t))return!0},hV=e=>{let t=e.bounds;return t.width()>1&&t.height()>1},pV=(e,t,n)=>{var r=e.range(),i=new ft;return t===lc||t===Za?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},wN=e=>(e.forEach(t=>t.opacity=1),e),EN=(e,t)=>e.reflow(t.modified()).modifies("opacity");W(LN,N,{transform(e,t){let n=bN[e.method]||bN.parity,r=e.separation||0,i=t.materialize(t.SOURCE).source,o,a;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(wN(i),t=EN(t,e)),t;if(i=i.filter(hV),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=wN(i),t=EN(t,e),o.length>=3&&vN(o,r)){do o=n(o,r);while(o.length>=3&&vN(o,r));o.length<3&&!ve(i).opacity&&(o.length>1&&(ve(o).opacity=0),ve(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(a=pV(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(u=>{a(u)||(u.opacity=0)}));let s=o[0].mark.bounds.clear();return i.forEach(u=>{u.opacity&&s.union(u.bounds)}),t}});function BN(e){N.call(this,null,e)}W(BN,N,{transform(e,t){let n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){let r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});var xn=new ft;function uc(e,t,n){return e[t]===n?0:(e[t]=n,1)}function mV(e){var t=e.items[0].orient;return t===ti||t===ni}function gV(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function yV(e,t,n,r){var i=t.items[0],o=i.datum,a=i.translate!=null?i.translate:.5,s=i.orient,u=gV(o),l=i.range,c=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[u[2]].items[0],m=i.titlePadding,g=i.bounds,y=p&&B0(p),b=0,v=0,w,E;switch(xn.clear().union(g),g.clear(),(w=u[0])>-1&&g.union(i.items[w].bounds),(w=u[1])>-1&&g.union(i.items[w].bounds),s){case lc:b=f||0,v=-c,E=Math.max(d,Math.min(h,-g.y1)),g.add(0,-E).add(l,0),p&&G0(e,p,E,m,y,0,-1,g);break;case ti:b=-c,v=f||0,E=Math.max(d,Math.min(h,-g.x1)),g.add(-E,0).add(0,l),p&&G0(e,p,E,m,y,1,-1,g);break;case ni:b=n+c,v=f||0,E=Math.max(d,Math.min(h,g.x2)),g.add(0,0).add(E,l),p&&G0(e,p,E,m,y,1,1,g);break;case Za:b=f||0,v=r+c,E=Math.max(d,Math.min(h,g.y2)),g.add(0,0).add(l,E),p&&G0(e,p,E,m,0,0,1,g);break;default:b=i.x,v=i.y}return Hi(g.translate(b,v),i),uc(i,"x",b+a)|uc(i,"y",v+a)&&(i.bounds=xn,e.dirty(i),i.bounds=g,e.dirty(i)),i.mark.bounds.clear().union(g)}function G0(e,t,n,r,i,o,a,s){let u=t.bounds;if(t.auto){let l=a*(n+i+r),c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}s.union(u)}var SN=(e,t)=>Math.floor(Math.min(e,t)),_N=(e,t)=>Math.ceil(Math.max(e,t));function xV(e){var t=e.items,n=t.length,r=0,i,o;let a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r<n;++r)if(i=t[r],o=i.items,i.marktype===Y0)switch(i.role){case FE:case ME:case RE:break;case CN:a.rowheaders.push(...o);break;case FN:a.rowfooters.push(...o);break;case MN:a.colheaders.push(...o);break;case $N:a.colfooters.push(...o);break;case RN:a.rowtitle=o[0];break;case TN:a.coltitle=o[0];break;default:a.marks.push(...o)}return a}function bV(e){return new ft().set(0,0,e.width||0,e.height||0)}function vV(e){let t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function it(e,t,n){let r=Q(e)?e[t]:e;return r??(n!==void 0?n:0)}function AN(e){return e<0?Math.ceil(-e):0}function UN(e,t,n){var r=!n.nodirty,i=n.bounds===TE?bV:vV,o=xn.set(0,0,0,0),a=it(n.align,Qa),s=it(n.align,Ja),u=it(n.padding,Qa),l=it(n.padding,Ja),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),m=0,g=Array(d),y=Array(f),b=0,v=Array(d),w=Array(d),E=Array(d),_,S,k,C,M,R,P,D,$,F,T;for(S=0;S<c;++S)p[S]=0;for(S=0;S<f;++S)y[S]=0;for(S=0;S<d;++S)R=t[S],M=E[S]=i(R),R.x=R.x||0,v[S]=0,R.y=R.y||0,w[S]=0,k=S%c,C=~~(S/c),m=Math.max(m,P=Math.ceil(M.x2)),b=Math.max(b,D=Math.ceil(M.y2)),p[k]=Math.max(p[k],P),y[C]=Math.max(y[C],D),h[S]=u+AN(M.x1),g[S]=l+AN(M.y1),r&&e.dirty(t[S]);for(S=0;S<d;++S)S%c===0&&(h[S]=0),S<c&&(g[S]=0);if(a===kE)for(k=1;k<c;++k){for(T=0,S=k;S<d;S+=c)T<h[S]&&(T=h[S]);for(S=k;S<d;S+=c)h[S]=T+p[k-1]}else if(a===j0){for(T=0,S=0;S<d;++S)S%c&&T<h[S]&&(T=h[S]);for(S=0;S<d;++S)S%c&&(h[S]=T+m)}else for(a=!1,k=1;k<c;++k)for(S=k;S<d;S+=c)h[S]+=p[k-1];if(s===kE)for(C=1;C<f;++C){for(T=0,S=C*c,_=S+c;S<_;++S)T<g[S]&&(T=g[S]);for(S=C*c;S<_;++S)g[S]=T+y[C-1]}else if(s===j0){for(T=0,S=c;S<d;++S)T<g[S]&&(T=g[S]);for(S=c;S<d;++S)g[S]=T+b}else for(s=!1,C=1;C<f;++C)for(S=C*c,_=S+c;S<_;++S)g[S]+=y[C-1];for($=0,S=0;S<d;++S)$=h[S]+(S%c?$:0),v[S]+=$-t[S].x;for(k=0;k<c;++k)for(F=0,S=k;S<d;S+=c)F+=g[S],w[S]+=F-t[S].y;if(a&&it(n.center,Qa)&&f>1)for(S=0;S<d;++S)M=a===j0?m:p[S%c],$=M-E[S].x2-t[S].x-v[S],$>0&&(v[S]+=$/2);if(s&&it(n.center,Ja)&&c!==1)for(S=0;S<d;++S)M=s===j0?b:y[~~(S/c)],F=M-E[S].y2-t[S].y-w[S],F>0&&(w[S]+=F/2);for(S=0;S<d;++S)o.union(E[S].translate(v[S],w[S]));switch($=it(n.anchor,iV),F=it(n.anchor,oV),it(n.anchor,Qa)){case Dn:$-=o.width();break;case AE:$-=o.width()/2}switch(it(n.anchor,Ja)){case Dn:F-=o.height();break;case AE:F-=o.height()/2}for($=Math.round($),F=Math.round(F),o.clear(),S=0;S<d;++S)t[S].mark.bounds.clear();for(S=0;S<d;++S)R=t[S],R.x+=v[S]+=$,R.y+=w[S]+=F,o.union(R.mark.bounds.union(R.bounds.translate(v[S],w[S]))),r&&e.dirty(R);return o}function wV(e,t,n){var r=xV(t),i=r.marks,o=n.bounds===TE?EV:SV,a=n.offset,s=n.columns||i.length,u=s<=0?1:Math.ceil(i.length/s),l=u*s,c,f,d,h,p,m,g;let y=UN(e,i,n);y.empty()&&y.set(0,0,0,0),r.rowheaders&&(m=it(n.headerBand,Ja,null),c=H0(e,r.rowheaders,i,s,u,-it(a,"rowHeader"),SN,0,o,"x1",0,s,1,m)),r.colheaders&&(m=it(n.headerBand,Qa,null),f=H0(e,r.colheaders,i,s,s,-it(a,"columnHeader"),SN,1,o,"y1",0,1,s,m)),r.rowfooters&&(m=it(n.footerBand,Ja,null),d=H0(e,r.rowfooters,i,s,u,it(a,"rowFooter"),_N,0,o,"x2",s-1,s,1,m)),r.colfooters&&(m=it(n.footerBand,Qa,null),h=H0(e,r.colfooters,i,s,s,it(a,"columnFooter"),_N,1,o,"y2",l-s,1,s,m)),r.rowtitle&&(p=it(n.titleAnchor,Ja),g=it(a,"rowTitle"),g=p===Dn?d+g:c-g,m=it(n.titleBand,Ja,.5),kN(e,r.rowtitle,g,0,y,m)),r.coltitle&&(p=it(n.titleAnchor,Qa),g=it(a,"columnTitle"),g=p===Dn?h+g:f-g,m=it(n.titleBand,Qa,.5),kN(e,r.coltitle,g,1,y,m))}function EV(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function SV(e,t){return e.bounds[t]}function H0(e,t,n,r,i,o,a,s,u,l,c,f,d,h){var p=n.length,m=0,g=0,y,b,v,w,E,_,S,k,C;if(!p)return m;for(y=c;y<p;y+=f)n[y]&&(m=a(m,u(n[y],l)));if(!t.length)return m;for(t.length>i&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),m+=o,b=0,w=t.length;b<w;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,w=t.length;b<w;++b,y+=f){for(_=t[b],E=_.mark.bounds,v=y;v>=0&&(S=n[v])==null;v-=d);s?(k=h==null?S.x:Math.round(S.bounds.x1+h*S.bounds.width()),C=m):(k=m,C=h==null?S.y:Math.round(S.bounds.y1+h*S.bounds.height())),E.union(_.bounds.translate(k-(_.x||0),C-(_.y||0))),_.x=k,_.y=C,e.dirty(_),g=a(g,E[l])}return g}function kN(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function _V(e,t){let n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function AV(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function kV(e,t,n,r,i,o,a){let s=_V(n,t),u=AV(e,s("offset",0)),l=s("anchor",CE),c=l===Dn?1:l===AE?.5:0,f={align:kE,bounds:s("bounds",TE),columns:s("direction")==="vertical"?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case ti:f.anchor={x:Math.floor(r.x1)-u,column:Dn,y:c*(a||r.height()+2*r.y1),row:l};break;case ni:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case lc:f.anchor={y:Math.floor(i.y1)-u,row:Dn,x:c*(o||i.width()+2*i.x1),column:l};break;case Za:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case eV:f.anchor={x:u,y:u};break;case tV:f.anchor={x:o-u,y:u,column:Dn};break;case nV:f.anchor={x:u,y:a-u,row:Dn};break;case rV:f.anchor={x:o-u,y:a-u,column:Dn,row:Dn};break}return f}function CV(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,a=n.x,s=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),RV(e,n,n.items[0].items[0]),o=FV(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),r.type===lV&&MV(n.items[0].items[0].items[0].items),i!==$E&&(n.x=a=0,n.y=s=0),n.width=u,n.height=l,Hi(o.set(a,s,a+u,s+l),n),n.mark.bounds.clear().union(o),n}function FV(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function RV(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&wh(e,n,i,o);else{var a=t.items[1].items[0],s=a.anchor,u=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case ti:i+=Math.ceil(a.bounds.width())+u;break;case ni:case Za:break;default:o+=a.bounds.height()+u}switch((i||o)&&wh(e,n,i,o),a.orient){case ti:c+=sc(t,n,a,s,1,1);break;case ni:l+=sc(t,n,a,Dn,0,0)+u,c+=sc(t,n,a,s,1,1);break;case Za:l+=sc(t,n,a,s,0,0),c+=sc(t,n,a,Dn,-1,0,1)+u;break;default:l+=sc(t,n,a,s,0,0)}(l||c)&&wh(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(wh(e,n,-l,0),wh(e,a,-l,0))}}function sc(e,t,n,r,i,o,a){let s=e.datum.type!=="symbol",u=n.datum.vgrad,l=s&&(o||!u)&&!a?t.items[0]:t,c=l.bounds[i?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=i<=0?0:B0(n);return Math.round(r===CE?f:r===Dn?d-h:.5*(c-h))}function wh(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function MV(e){let t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function $V(e,t,n,r,i){var o=t.items[0],a=o.frame,s=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=s===ti||s===ni?r:n,p=0,m=0,g=0,y=0,b=0,v;if(a!==Y0?s===ti?(p=i.y2,h=i.y1):s===ni?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):s===ti&&(p=r,h=0),v=u===CE?p:u===Dn?h:(p+h)/2,d&&d.text){switch(s){case lc:case Za:b=f.bounds.height()+c;break;case ti:y=f.bounds.width()+c;break;case ni:y=-f.bounds.width()-c;break}xn.clear().union(d.bounds),xn.translate(y-(d.x||0),b-(d.y||0)),uc(d,"x",y)|uc(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(xn),d.mark.bounds.clear().union(xn),e.dirty(d)),xn.clear().union(d.bounds)}else xn.clear();switch(xn.union(f.bounds),s){case lc:m=v,g=i.y1-xn.height()-l;break;case ti:m=i.x1-xn.width()-l,g=v;break;case ni:m=i.x2+xn.width()+l,g=v;break;case Za:m=v,g=i.y2+l;break;default:m=o.x,g=o.y}return uc(o,"x",m)|uc(o,"y",g)&&(xn.translate(m,g),e.dirty(o),o.bounds.clear().union(xn),t.bounds.clear().union(xn),e.dirty(o)),o.bounds}function qN(e){N.call(this,null,e)}W(qN,N,{transform(e,t){let n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&wV(n,r,e.layout),DV(n,r,e)}),TV(e.mark.group)?t.reflow():t}});function TV(e){return e&&e.mark.role!=="legend-entry"}function DV(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),a=new ft().set(0,0,i,o),s=a.clone(),u=a.clone(),l=[],c,f,d,h,p,m;for(p=0,m=r.length;p<m;++p)switch(f=r[p],f.role){case FE:h=mV(f)?s:u,h.union(yV(e,f,i,o));break;case RE:c=f;break;case ME:l.push(CV(e,f));break;case aV:case sV:case CN:case FN:case RN:case MN:case $N:case TN:s.union(f.bounds),u.union(f.bounds);break;default:a.union(f.bounds)}if(l.length){let g={};l.forEach(y=>{d=y.orient||ni,d!==$E&&(g[d]||(g[d]=[])).push(y)});for(let y in g){let b=g[y];UN(e,b,kV(b,y,n.legends,s,u,i,o))}l.forEach(y=>{let b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===DN||n.autosize.type===NN||n.autosize.type===ON))switch(y.orient){case ti:case ni:a.add(b.x1,0).add(b.x2,0);break;case lc:case Za:a.add(0,b.y1).add(0,b.y2)}else a.union(b)})}a.union(s).union(u),c&&a.union($V(e,c,i,o,a)),t.clip&&a.set(0,0,t.width||0,t.height||0),NV(e,t,a,n)}function NV(e,t,n,r){let i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1)),d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(i.contains===uV){let p=e.padding();a-=p.left+p.right,s-=p.top+p.bottom}o===$E?(l=0,f=0,u=a,c=s):o===DN?(u=Math.max(0,a-l-d),c=Math.max(0,s-f-h)):o===NN?(u=Math.max(0,a-l-d),s=c+f+h):o===ON?(a=u+l+d,c=Math.max(0,s-f-h)):o===cV&&(a=u+l+d,s=c+f+h),e._resizeView(a,s,u,c,[l,f],i.resize)}var zE={};Sn(zE,{axisticks:()=>HN,datajoin:()=>YN,encode:()=>VN,legendentries:()=>XN,linkpath:()=>IE,pie:()=>PE,scale:()=>eO,sortitems:()=>nO,stack:()=>LE});x();function HN(e){N.call(this,null,e)}W(HN,N,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=e.count==null?e.values?e.values.length:10:e.count,s=u0(o,a,e.minstep),u=e.format||$w(n,o,s,e.formatSpecifier,e.formatType,!!e.values),l=e.values?Mw(o,e.values,s):l0(o,s);return i&&(r.rem=i),i=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&i.length&&i.push(Ce({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function YN(e){N.call(this,null,e)}function OV(){return Ce({})}function IV(e){let t=xa().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}W(YN,N,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||OV,o=e.key||ue,a=this.value;return I(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&O("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=IV(o)),t.visit(t.ADD,s=>{let u=o(s),l=a.get(u);l?l.exit?(a.empty--,r.add.push(l)):r.mod.push(l):(l=i(s),a.set(u,l),r.add.push(l)),l.datum=s,l.exit=!1}),t.visit(t.MOD,s=>{let u=o(s),l=a.get(u);l&&(l.datum=s,r.mod.push(l))}),t.visit(t.REM,s=>{let u=o(s),l=a.get(u);s===l.datum&&!l.exit&&(r.rem.push(l),l.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}});function VN(e){N.call(this,null,e)}W(VN,N,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(I(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var a=o==="enter",s=i.update||xo,u=i.enter||xo,l=i.exit||xo,c=(o&&!a?i[o]:s)||xo;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),s(f,e)}),n.modifies(u.output),n.modifies(s.output),c!==xo&&c!==s&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==xo&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),a||c!==xo){let f=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(f,d=>{let h=u(d,e)||r;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function XN(e){N.call(this,[],e)}W(XN,N,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||Qd,a=e.scale,s=+e.limit,u=u0(a,e.count==null?5:e.count,e.minstep),l=!!e.values||o===Qd,c=e.format||Dw(n,a,u,o,e.formatSpecifier,e.formatType,l),f=e.values||Tw(a,u),d,h,p,m,g;return i&&(r.rem=i),o===Qd?(s&&f.length>s?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,s-1),g=!0):i=f,de(p=e.size)?(!e.values&&a(i[0])===0&&(i=i.slice(1)),m=i.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=tt(m=p||8),i=i.map((y,b)=>Ce({index:b,label:c(y,b,i),value:y,offset:m,size:p(y,e)})),g&&(g=f[i.length],i.push(Ce({index:i.length,label:`\u2026${f.length-i.length} entries`,value:g,offset:m,size:p(g,e)})))):o===V3?(d=a.domain(),h=s0(a,d[0],ve(d)),f.length<3&&!e.values&&d[0]!==ve(d)&&(f=[d[0],ve(d)]),i=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=Q3(a),i=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),r.source=i,r.add=i,this.value=i,r}});var PV=e=>e.source.x,LV=e=>e.source.y,zV=e=>e.target.x,BV=e=>e.target.y;function IE(e){N.call(this,{},e)}IE.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};W(IE,N,{transform(e,t){var n=e.sourceX||PV,r=e.sourceY||LV,i=e.targetX||zV,o=e.targetY||BV,a=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=jN.get(u+"-"+s)||jN.get(u);return l||O("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[a]=l(n(c),r(c),i(c),o(c))}),t.reflow(e.modified()).modifies(a)}});var KN=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,UV=(e,t,n,r)=>KN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),QN=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.hypot(i,o)/2,s=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+a+","+a+" "+s+" 0 1 "+n+","+r},qV=(e,t,n,r)=>QN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),JN=(e,t,n,r)=>{let i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},jV=(e,t,n,r)=>JN(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),WV=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,GV=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,HV=(e,t,n,r)=>{let i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},YV=(e,t,n,r)=>{let i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},VV=(e,t,n,r)=>{let i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},XV=(e,t,n,r)=>{let i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),u=(t+r)/2;return"M"+t*i+","+t*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s},jN=xa({line:KN,"line-radial":UV,arc:QN,"arc-radial":qV,curve:JN,"curve-radial":jV,"orthogonal-horizontal":WV,"orthogonal-vertical":GV,"orthogonal-radial":HV,"diagonal-horizontal":YV,"diagonal-vertical":VV,"diagonal-radial":XV});function PE(e){N.call(this,null,e)}PE.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};W(PE,N,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||$i,a=e.startAngle||0,s=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=a,d=(s-a)/Al(l),h=xt(c),p,m,g;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)g=l[h[p]],m=u[h[p]],m[r]=f,m[i]=f+=g*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});var KV=5;function QV(e){let t=e.type;return!e.bins&&(t===uu||t===Ql||t===Jl)}function ZN(e){return Vd(e)&&e!==Qr}var JV=$t(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function eO(e){N.call(this,null,e),this.modified(!0)}W(eO,N,{transform(e,t){var n=t.dataflow,r=this.value,i=ZV(e);(!r||i!==r.type)&&(this.value=r=Fe(i)());for(i in e)if(!JV[i]){if(i==="padding"&&ZN(r.type))continue;de(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return oX(r,e,iX(r,e,tX(r,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function ZV(e){var t=e.type,n="",r;return t===Qr?Qr+"-"+uu:(eX(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?Qr+"-":r===3?lu+"-":""),(n+t||uu).toLowerCase())}function eX(e){let t=e.type;return Vd(t)&&t!==za&&t!==Ba&&(e.scheme||e.range&&e.range.length&&e.range.every(Z))}function tX(e,t,n){let r=nX(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,o=e.type,a=t.zero||t.zero===void 0&&QV(e),s,u;if(!i)return 0;if((a||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(s=(i=i.slice()).length-1||1,a&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[s]=t.domainMax),t.domainMid!=null)){u=t.domainMid;let l=u>i[s]?s+1:u<i[0]?0:s;l!==s&&n.warn("Scale domainMid exceeds domain min or max.",u),i.splice(l,0,u)}return ZN(o)&&t.padding&&i[0]!==ve(i)&&(i=rX(o,i,t.range,t.padding,t.exponent,t.constant)),e.domain(tO(o,i,n)),o===t0&&e.unknown(t.domainImplicit?Ul:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&u0(e,t.nice)||null),i.length}function nX(e,t,n){return t?(e.domain(tO(e.type,t,n)),t.length):-1}function rX(e,t,n,r,i,o){var a=Math.abs(ve(n)-n[0]),s=a/(a-2*r),u=e===ji?Rf(t,null,s):e===Jl?wl(t,null,s,.5):e===Ql?wl(t,null,s,i||1):e===jd?Mf(t,null,s,o||1):Ff(t,null,s);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function tO(e,t,n){if(Cw(e)){var r=Math.abs(t.reduce((i,o)=>i+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+G(t))}return t}function iX(e,t,n){let r=t.bins;if(r&&!I(r)){let i=e.domain(),o=i[0],a=ve(i),s=r.step,u=r.start==null?o:r.start,l=r.stop==null?a:r.stop;s||O("Scale bins parameter missing step property."),u<o&&(u=s*Math.ceil(o/s)),l>a&&(l=s*Math.floor(a/s)),r=xt(u,l+s/2,s)}return r?e.bins=r:e.bins&&delete e.bins,e.type===r0&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function oX(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=aX(r,t,n);else if(t.scheme&&(o=sX(r,t,n),de(o))){if(e.interpolator)return e.interpolator(o);O(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&Fw(r))return e.interpolator(Zl(OE(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Xd(t.interpolate,t.interpolateGamma)):de(e.round)?e.round(i):de(e.rangeRound)&&e.interpolate(i?Ui:mn),o&&e.range(OE(o,t.reverse))}function aX(e,t,n){e!==ww&&e!==n0&&O("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===n0?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*qd(n,i,r)]}function sX(e,t,n){var r=t.schemeExtent,i,o;return I(t.scheme)?o=Zl(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=Kd(i),o||O(`Unrecognized scheme name: ${t.scheme}`)),n=e===Gd?n+1:e===r0?n-1:e===su||e===Wd?+t.schemeCount||KV:n,Fw(e)?WN(o,r,t.reverse):de(o)?a0(WN(o,r),n):e===t0?o:o.slice(0,n)}function WN(e,t,n){return de(e)&&(t||n)?o0(e,OE(t||[0,1],n)):e}function OE(e,t){return t?e.slice().reverse():e}function nO(e){N.call(this,null,e)}W(nO,N,{transform(e,t){let n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Ii(e.sort)),this.modified(n),t}});var GN="zero",rO="center",iO="normalize",oO=["y0","y1"];function LE(e){N.call(this,null,e)}LE.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:GN,values:[GN,rO,iO]},{name:"as",type:"string",array:!0,length:2,default:oO}]};W(LE,N,{transform(e,t){var n=e.as||oO,r=n[0],i=n[1],o=Ii(e.sort),a=e.field||$i,s=e.offset===rO?uX:e.offset===iO?lX:cX,u,l,c,f;for(u=fX(t.source,e.groupby,o,a),l=0,c=u.length,f=u.max;l<c;++l)s(u[l],f,a,r,i);return t.reflow(e.modified()).modifies(n)}});function uX(e,t,n,r,i){for(var o=(t-e.sum)/2,a=e.length,s=0,u;s<a;++s)u=e[s],u[r]=o,u[i]=o+=Math.abs(n(u))}function lX(e,t,n,r,i){for(var o=1/e.sum,a=0,s=e.length,u=0,l=0,c;u<s;++u)c=e[u],c[r]=a,c[i]=a=o*(l+=Math.abs(n(c)))}function cX(e,t,n,r,i){for(var o=0,a=0,s=e.length,u=0,l,c;u<s;++u)c=e[u],l=+n(c),l<0?(c[r]=a,c[i]=a+=l):(c[r]=o,c[i]=o+=l)}function fX(e,t,n,r){var i=[],o=m=>m(c),a,s,u,l,c,f,d,h,p;if(t==null)i.push(e.slice());else for(a={},s=0,u=e.length;s<u;++s)c=e[s],f=t.map(o),d=a[f],d||(a[f]=d=[],i.push(d)),d.push(c);for(f=0,p=0,l=i.length;f<l;++f){for(d=i[f],s=0,h=0,u=d.length;s<u;++s)h+=Math.abs(r(d[s]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return i.max=p,i}var r_={};Sn(r_,{contour:()=>XS,geojson:()=>QS,geopath:()=>JS,geopoint:()=>ZS,geoshape:()=>e_,graticule:()=>t_,heatmap:()=>n_,isocontour:()=>YS,kde2d:()=>VS,projection:()=>mI});x();x();x();x();x();var ie=1e-6,bu=1e-12,ye=Math.PI,qe=ye/2,cc=ye/4,bt=ye*2,je=180/ye,ge=ye/180,me=Math.abs,Tr=Math.atan,dt=Math.atan2,re=Math.cos,Eh=Math.ceil,V0=Math.exp;var X0=Math.hypot,vu=Math.log,K0=Math.pow,ne=Math.sin,bn=Math.sign||function(e){return e>0?1:e<0?-1:0},We=Math.sqrt,fc=Math.tan;function Q0(e){return e>1?0:e<-1?ye:Math.acos(e)}function Qe(e){return e>1?qe:e<-1?-qe:Math.asin(e)}x();function Je(){}x();function J0(e,t){e&&sO.hasOwnProperty(e.type)&&sO[e.type](e,t)}var aO={Feature:function(e,t){J0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)J0(n[r].geometry,t)}},sO={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){BE(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)BE(n[r],t,0)},Polygon:function(e,t){uO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)uO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)J0(n[r],t)}};function BE(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 uO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)BE(e[n],t,1);t.polygonEnd()}function Qn(e,t){e&&aO.hasOwnProperty(e.type)?aO[e.type](e,t):J0(e,t)}var Sh=new nt,Z0=new nt,lO,cO,UE,qE,jE,ri={point:Je,lineStart:Je,lineEnd:Je,polygonStart:function(){Sh=new nt,ri.lineStart=dX,ri.lineEnd=hX},polygonEnd:function(){var e=+Sh;Z0.add(e<0?bt+e:e),this.lineStart=this.lineEnd=this.point=Je},sphere:function(){Z0.add(bt)}};function dX(){ri.point=pX}function hX(){fO(lO,cO)}function pX(e,t){ri.point=fO,lO=e,cO=t,e*=ge,t*=ge,UE=e,qE=re(t=t/2+cc),jE=ne(t)}function fO(e,t){e*=ge,t*=ge,t=t/2+cc;var n=e-UE,r=n>=0?1:-1,i=r*n,o=re(t),a=ne(t),s=jE*a,u=qE*o+s*re(i),l=s*r*ne(i);Sh.add(dt(l,u)),UE=e,qE=o,jE=a}function WE(e){return Z0=new nt,Qn(e,ri),Z0*2}x();x();function wu(e){return[dt(e[1],e[0]),Qe(e[2])]}function Dr(e){var t=e[0],n=e[1],r=re(n);return[r*re(t),r*ne(t),ne(n)]}function _h(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function zo(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 e1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ah(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Eu(e){var t=We(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var st,Jn,ht,cr,Su,mO,gO,dc,kh,es,Uo,Bo={point:GE,lineStart:dO,lineEnd:hO,polygonStart:function(){Bo.point=xO,Bo.lineStart=mX,Bo.lineEnd=gX,kh=new nt,ri.polygonStart()},polygonEnd:function(){ri.polygonEnd(),Bo.point=GE,Bo.lineStart=dO,Bo.lineEnd=hO,Sh<0?(st=-(ht=180),Jn=-(cr=90)):kh>ie?cr=90:kh<-ie&&(Jn=-90),Uo[0]=st,Uo[1]=ht},sphere:function(){st=-(ht=180),Jn=-(cr=90)}};function GE(e,t){es.push(Uo=[st=e,ht=e]),t<Jn&&(Jn=t),t>cr&&(cr=t)}function yO(e,t){var n=Dr([e*ge,t*ge]);if(dc){var r=zo(dc,n),i=[r[1],-r[0],0],o=zo(i,r);Eu(o),o=wu(o);var a=e-Su,s=a>0?1:-1,u=o[0]*je*s,l,c=me(a)>180;c^(s*Su<u&&u<s*e)?(l=o[1]*je,l>cr&&(cr=l)):(u=(u+360)%360-180,c^(s*Su<u&&u<s*e)?(l=-o[1]*je,l<Jn&&(Jn=l)):(t<Jn&&(Jn=t),t>cr&&(cr=t))),c?e<Su?lr(st,e)>lr(st,ht)&&(ht=e):lr(e,ht)>lr(st,ht)&&(st=e):ht>=st?(e<st&&(st=e),e>ht&&(ht=e)):e>Su?lr(st,e)>lr(st,ht)&&(ht=e):lr(e,ht)>lr(st,ht)&&(st=e)}else es.push(Uo=[st=e,ht=e]);t<Jn&&(Jn=t),t>cr&&(cr=t),dc=n,Su=e}function dO(){Bo.point=yO}function hO(){Uo[0]=st,Uo[1]=ht,Bo.point=GE,dc=null}function xO(e,t){if(dc){var n=e-Su;kh.add(me(n)>180?n+(n>0?360:-360):n)}else mO=e,gO=t;ri.point(e,t),yO(e,t)}function mX(){ri.lineStart()}function gX(){xO(mO,gO),ri.lineEnd(),me(kh)>ie&&(st=-(ht=180)),Uo[0]=st,Uo[1]=ht,dc=null}function lr(e,t){return(t-=e)<0?t+360:t}function yX(e,t){return e[0]-t[0]}function pO(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function HE(e){var t,n,r,i,o,a,s;if(cr=ht=-(st=Jn=1/0),es=[],Qn(e,Bo),n=es.length){for(es.sort(yX),t=1,r=es[0],o=[r];t<n;++t)i=es[t],pO(r,i[0])||pO(r,i[1])?(lr(r[0],i[1])>lr(r[0],r[1])&&(r[1]=i[1]),lr(i[0],r[1])>lr(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(s=lr(r[1],i[0]))>a&&(a=s,st=i[0],ht=r[1])}return es=Uo=null,st===1/0||Jn===1/0?[[NaN,NaN],[NaN,NaN]]:[[st,Jn],[ht,cr]]}x();var Ch,t1,n1,r1,i1,o1,a1,s1,YE,VE,XE,wO,EO,Nn,On,In,ii={sphere:Je,point:KE,lineStart:bO,lineEnd:vO,polygonStart:function(){ii.lineStart=vX,ii.lineEnd=wX},polygonEnd:function(){ii.lineStart=bO,ii.lineEnd=vO}};function KE(e,t){e*=ge,t*=ge;var n=re(t);Fh(n*re(e),n*ne(e),ne(t))}function Fh(e,t,n){++Ch,n1+=(e-n1)/Ch,r1+=(t-r1)/Ch,i1+=(n-i1)/Ch}function bO(){ii.point=xX}function xX(e,t){e*=ge,t*=ge;var n=re(t);Nn=n*re(e),On=n*ne(e),In=ne(t),ii.point=bX,Fh(Nn,On,In)}function bX(e,t){e*=ge,t*=ge;var n=re(t),r=n*re(e),i=n*ne(e),o=ne(t),a=dt(We((a=On*o-In*i)*a+(a=In*r-Nn*o)*a+(a=Nn*i-On*r)*a),Nn*r+On*i+In*o);t1+=a,o1+=a*(Nn+(Nn=r)),a1+=a*(On+(On=i)),s1+=a*(In+(In=o)),Fh(Nn,On,In)}function vO(){ii.point=KE}function vX(){ii.point=EX}function wX(){SO(wO,EO),ii.point=KE}function EX(e,t){wO=e,EO=t,e*=ge,t*=ge,ii.point=SO;var n=re(t);Nn=n*re(e),On=n*ne(e),In=ne(t),Fh(Nn,On,In)}function SO(e,t){e*=ge,t*=ge;var n=re(t),r=n*re(e),i=n*ne(e),o=ne(t),a=On*o-In*i,s=In*r-Nn*o,u=Nn*i-On*r,l=X0(a,s,u),c=Qe(l),f=l&&-c/l;YE.add(f*a),VE.add(f*s),XE.add(f*u),t1+=c,o1+=c*(Nn+(Nn=r)),a1+=c*(On+(On=i)),s1+=c*(In+(In=o)),Fh(Nn,On,In)}function QE(e){Ch=t1=n1=r1=i1=o1=a1=s1=0,YE=new nt,VE=new nt,XE=new nt,Qn(e,ii);var t=+YE,n=+VE,r=+XE,i=X0(t,n,r);return i<bu&&(t=o1,n=a1,r=s1,t1<ie&&(t=n1,n=r1,r=i1),i=X0(t,n,r),i<bu)?[NaN,NaN]:[dt(n,t)*je,Qe(r/i)*je]}x();x();x();function Rh(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 JE(e,t){return me(e)>ye&&(e-=Math.round(e/bt)*bt),[e,t]}JE.invert=JE;function ZE(e,t,n){return(e%=bt)?t||n?Rh(AO(e),kO(t,n)):AO(e):t||n?kO(t,n):JE}function _O(e){return function(t,n){return t+=e,me(t)>ye&&(t-=Math.round(t/bt)*bt),[t,n]}}function AO(e){var t=_O(e);return t.invert=_O(-e),t}function kO(e,t){var n=re(e),r=ne(e),i=re(t),o=ne(t);function a(s,u){var l=re(u),c=re(s)*l,f=ne(s)*l,d=ne(u),h=d*n+c*r;return[dt(f*i-h*o,c*n-d*r),Qe(h*i+f*o)]}return a.invert=function(s,u){var l=re(u),c=re(s)*l,f=ne(s)*l,d=ne(u),h=d*i-f*o;return[dt(f*i+d*o,c*n+h*r),Qe(h*n-c*r)]},a}function CO(e){e=ZE(e[0]*ge,e[1]*ge,e.length>2?e[2]*ge:0);function t(n){return n=e(n[0]*ge,n[1]*ge),n[0]*=je,n[1]*=je,n}return t.invert=function(n){return n=e.invert(n[0]*ge,n[1]*ge),n[0]*=je,n[1]*=je,n},t}function RO(e,t,n,r,i,o){if(n){var a=re(t),s=ne(t),u=r*n;i==null?(i=t+r*bt,o=t-u/2):(i=FO(a,i),o=FO(a,o),(r>0?i<o:i>o)&&(i+=r*bt));for(var l,c=i;r>0?c>o:c<o;c-=u)l=wu([a,-s*re(c),-s*ne(c)]),e.point(l[0],l[1])}}function FO(e,t){t=Dr(t),t[0]-=e,Eu(t);var n=Q0(-t[1]);return((-t[2]<0?-n:n)+bt-ie)%bt}x();x();x();function u1(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Je,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}x();x();function hc(e,t){return me(e[0]-t[0])<ie&&me(e[1]-t[1])<ie}function l1(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 c1(e,t,n,r,i){var o=[],a=[],s,u;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],y=p[m],b;if(hc(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),s=0;s<m;++s)i.point((g=p[s])[0],g[1]);i.lineEnd();return}y[0]+=2*ie}o.push(b=new l1(g,p,null,!0)),a.push(b.o=new l1(g,null,b,!1)),o.push(b=new l1(y,p,null,!1)),a.push(b.o=new l1(y,null,b,!0))}}),!!o.length){for(a.sort(t),MO(o),MO(a),s=0,u=a.length;s<u;++s)a[s].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(s=0,u=c.length;s<u;++s)i.point((f=c[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(c=d.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);i.lineEnd()}}}function MO(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}}x();function eS(e){return me(e[0])<=ye?e[0]:bn(e[0])*((me(e[0])+ye)%bt-ye)}function $O(e,t){var n=eS(t),r=t[1],i=ne(r),o=[ne(n),-re(n),0],a=0,s=0,u=new nt;i===1?r=qe+ie:i===-1&&(r=-qe-ie);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=eS(h),m=h[1]/2+cc,g=ne(m),y=re(m),b=0;b<d;++b,p=w,g=_,y=S,h=v){var v=f[b],w=eS(v),E=v[1]/2+cc,_=ne(E),S=re(E),k=w-p,C=k>=0?1:-1,M=C*k,R=M>ye,P=g*_;if(u.add(dt(P*C*ne(M),y*S+P*re(M))),a+=R?k+C*bt:k,R^p>=n^w>=n){var D=zo(Dr(h),Dr(v));Eu(D);var $=zo(o,D);Eu($);var F=(R^k>=0?-1:1)*Qe($[2]);(r>F||r===F&&(D[0]||D[1]))&&(s+=R^k>=0?1:-1)}}return(a<-ie||a<ie&&u<-bu)^s&1}function f1(e,t,n,r){return function(i){var o=t(i),a=u1(),s=t(a),u=!1,l,c,f,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,c=_l(c);var w=$O(l,r);c.length?(u||(i.polygonStart(),u=!0),c1(c,_X,w,n,i)):w&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),c=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(w,E){e(w,E)&&i.point(w,E)}function p(w,E){o.point(w,E)}function m(){d.point=p,o.lineStart()}function g(){d.point=h,o.lineEnd()}function y(w,E){f.push([w,E]),s.point(w,E)}function b(){s.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),s.lineEnd();var w=s.clean(),E=a.result(),_,S=E.length,k,C,M;if(f.pop(),l.push(f),f=null,!!S){if(w&1){if(C=E[0],(k=C.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),_=0;_<k;++_)i.point((M=C[_])[0],M[1]);i.lineEnd()}return}S>1&&w&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(SX))}}return d}}function SX(e){return e.length>1}function _X(e,t){return((e=e.x)[0]<0?e[1]-qe-ie:qe-e[1])-((t=t.x)[0]<0?t[1]-qe-ie:qe-t[1])}var tS=f1(function(){return!0},AX,CX,[-ye,-qe]);function AX(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,a){var s=o>0?ye:-ye,u=me(o-t);me(u-ye)<ie?(e.point(t,n=(n+a)/2>0?qe:-qe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(o,n),i=0):r!==s&&u>=ye&&(me(t-r)<ie&&(t-=r*ie),me(o-s)<ie&&(o-=s*ie),n=kX(t,n,o,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=o,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function kX(e,t,n,r){var i,o,a=ne(e-n);return me(a)>ie?Tr((ne(t)*(o=re(r))*ne(n)-ne(r)*(i=re(t))*ne(e))/(i*o*a)):(t+r)/2}function CX(e,t,n,r){var i;if(e==null)i=n*qe,r.point(-ye,i),r.point(0,i),r.point(ye,i),r.point(ye,0),r.point(ye,-i),r.point(0,-i),r.point(-ye,-i),r.point(-ye,0),r.point(-ye,i);else if(me(e[0]-t[0])>ie){var o=e[0]<t[0]?ye:-ye;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}x();function TO(e){var t=re(e),n=2*ge,r=t>0,i=me(t)>ie;function o(c,f,d,h){RO(h,e,n,d,c,f)}function a(c,f){return re(c)*re(f)>t}function s(c){var f,d,h,p,m;return{lineStart:function(){p=h=!1,m=1},point:function(g,y){var b=[g,y],v,w=a(g,y),E=r?w?0:l(g,y):w?l(g+(g<0?ye:-ye),y):0;if(!f&&(p=h=w)&&c.lineStart(),w!==h&&(v=u(f,b),(!v||hc(f,v)||hc(b,v))&&(b[2]=1)),w!==h)m=0,w?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(i&&f&&r^w){var _;!(E&d)&&(_=u(b,f,!0))&&(m=0,r?(c.lineStart(),c.point(_[0][0],_[0][1]),c.point(_[1][0],_[1][1]),c.lineEnd()):(c.point(_[1][0],_[1][1]),c.lineEnd(),c.lineStart(),c.point(_[0][0],_[0][1],3)))}w&&(!f||!hc(f,b))&&c.point(b[0],b[1]),f=b,h=w,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return m|(p&&h)<<1}}}function u(c,f,d){var h=Dr(c),p=Dr(f),m=[1,0,0],g=zo(h,p),y=_h(g,g),b=g[0],v=y-b*b;if(!v)return!d&&c;var w=t*y/v,E=-t*b/v,_=zo(m,g),S=Ah(m,w),k=Ah(g,E);e1(S,k);var C=_,M=_h(S,C),R=_h(C,C),P=M*M-R*(_h(S,S)-1);if(!(P<0)){var D=We(P),$=Ah(C,(-M-D)/R);if(e1($,S),$=wu($),!d)return $;var F=c[0],T=f[0],L=c[1],q=f[1],U;T<F&&(U=F,F=T,T=U);var oe=T-F,pe=me(oe-ye)<ie,fe=pe||oe<ie;if(!pe&&q<L&&(U=L,L=q,q=U),fe?pe?L+q>0^$[1]<(me($[0]-F)<ie?L:q):L<=$[1]&&$[1]<=q:oe>ye^(F<=$[0]&&$[0]<=T)){var we=Ah(C,(-M+D)/R);return e1(we,S),[$,wu(we)]}}}function l(c,f){var d=r?e:ye-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return f1(a,s,o,r?[0,-e]:[-ye,e-ye])}x();x();function DO(e,t,n,r,i,o){var a=e[0],s=e[1],u=t[0],l=t[1],c=0,f=1,d=u-a,h=l-s,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=r-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=o-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=a+c*d,e[1]=s+c*h),f<1&&(t[0]=a+f*d,t[1]=s+f*h),!0}}}}}var Mh=1e9,d1=-Mh;function $h(e,t,n,r){function i(l,c){return e<=l&&l<=n&&t<=c&&c<=r}function o(l,c,f,d){var h=0,p=0;if(l==null||(h=a(l,f))!==(p=a(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function a(l,c){return me(l[0]-e)<ie?c>0?0:3:me(l[0]-n)<ie?c>0?2:1:me(l[1]-t)<ie?c>0?1:0:c>0?3:2}function s(l,c){return u(l.x,c.x)}function u(l,c){var f=a(l,1),d=a(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=u1(),d,h,p,m,g,y,b,v,w,E,_,S={point:k,lineStart:P,lineEnd:D,polygonStart:M,polygonEnd:R};function k(F,T){i(F,T)&&c.point(F,T)}function C(){for(var F=0,T=0,L=h.length;T<L;++T)for(var q=h[T],U=1,oe=q.length,pe=q[0],fe,we,He=pe[0],Ee=pe[1];U<oe;++U)fe=He,we=Ee,pe=q[U],He=pe[0],Ee=pe[1],we<=r?Ee>r&&(He-fe)*(r-we)>(Ee-we)*(e-fe)&&++F:Ee<=r&&(He-fe)*(r-we)<(Ee-we)*(e-fe)&&--F;return F}function M(){c=f,d=[],h=[],_=!0}function R(){var F=C(),T=_&&F,L=(d=_l(d)).length;(T||L)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),L&&c1(d,s,F,o,l),l.polygonEnd()),c=l,d=h=p=null}function P(){S.point=$,h&&h.push(p=[]),E=!0,w=!1,b=v=NaN}function D(){d&&($(m,g),y&&w&&f.rejoin(),d.push(f.result())),S.point=k,w&&c.lineEnd()}function $(F,T){var L=i(F,T);if(h&&p.push([F,T]),E)m=F,g=T,y=L,E=!1,L&&(c.lineStart(),c.point(F,T));else if(L&&w)c.point(F,T);else{var q=[b=Math.max(d1,Math.min(Mh,b)),v=Math.max(d1,Math.min(Mh,v))],U=[F=Math.max(d1,Math.min(Mh,F)),T=Math.max(d1,Math.min(Mh,T))];DO(q,U,e,t,n,r)?(w||(c.lineStart(),c.point(q[0],q[1])),c.point(U[0],U[1]),L||c.lineEnd(),_=!1):L&&(c.lineStart(),c.point(F,T),_=!1)}b=F,v=T,w=L}return S}}x();function NO(e,t,n){var r=xt(e,t-ie,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function OO(e,t,n){var r=xt(e,t-ie,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function h1(){var e,t,n,r,i,o,a,s,u=10,l=u,c=90,f=360,d,h,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return xt(Eh(r/c)*c,n,c).map(p).concat(xt(Eh(s/f)*f,a,f).map(m)).concat(xt(Eh(t/u)*u,e,u).filter(function(v){return me(v%c)>ie}).map(d)).concat(xt(Eh(o/l)*l,i,l).filter(function(v){return me(v%f)>ie}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(m(a).slice(1),p(n).reverse().slice(1),m(s).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(r=+v[0][0],n=+v[1][0],s=+v[0][1],a=+v[1][1],r>n&&(v=r,r=n,n=v),s>a&&(v=s,s=a,a=v),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],i=+v[1][1],t>e&&(v=t,t=e,e=v),o>i&&(v=o,o=i,i=v),y.precision(g)):[[t,o],[e,i]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(g=+v,d=NO(o,i,90),h=OO(t,e,g),p=NO(s,a,90),m=OO(r,n,g),y):g},y.extentMajor([[-180,-90+ie],[180,90-ie]]).extentMinor([[-180,-80-ie],[180,80+ie]])}x();x();var ts=e=>e;x();var nS=new nt,rS=new nt,IO,PO,iS,oS,ns={point:Je,lineStart:Je,lineEnd:Je,polygonStart:function(){ns.lineStart=FX,ns.lineEnd=MX},polygonEnd:function(){ns.lineStart=ns.lineEnd=ns.point=Je,nS.add(me(rS)),rS=new nt},result:function(){var e=nS/2;return nS=new nt,e}};function FX(){ns.point=RX}function RX(e,t){ns.point=LO,IO=iS=e,PO=oS=t}function LO(e,t){rS.add(oS*e-iS*t),iS=e,oS=t}function MX(){LO(IO,PO)}var aS=ns;x();var pc=1/0,p1=pc,Th=-pc,m1=Th,$X={point:TX,lineStart:Je,lineEnd:Je,polygonStart:Je,polygonEnd:Je,result:function(){var e=[[pc,p1],[Th,m1]];return Th=m1=-(p1=pc=1/0),e}};function TX(e,t){e<pc&&(pc=e),e>Th&&(Th=e),t<p1&&(p1=t),t>m1&&(m1=t)}var mc=$X;x();var sS=0,uS=0,Dh=0,g1=0,y1=0,gc=0,lS=0,cS=0,Nh=0,UO,qO,Vi,Xi,oi={point:_u,lineStart:zO,lineEnd:BO,polygonStart:function(){oi.lineStart=OX,oi.lineEnd=IX},polygonEnd:function(){oi.point=_u,oi.lineStart=zO,oi.lineEnd=BO},result:function(){var e=Nh?[lS/Nh,cS/Nh]:gc?[g1/gc,y1/gc]:Dh?[sS/Dh,uS/Dh]:[NaN,NaN];return sS=uS=Dh=g1=y1=gc=lS=cS=Nh=0,e}};function _u(e,t){sS+=e,uS+=t,++Dh}function zO(){oi.point=DX}function DX(e,t){oi.point=NX,_u(Vi=e,Xi=t)}function NX(e,t){var n=e-Vi,r=t-Xi,i=We(n*n+r*r);g1+=i*(Vi+e)/2,y1+=i*(Xi+t)/2,gc+=i,_u(Vi=e,Xi=t)}function BO(){oi.point=_u}function OX(){oi.point=PX}function IX(){jO(UO,qO)}function PX(e,t){oi.point=jO,_u(UO=Vi=e,qO=Xi=t)}function jO(e,t){var n=e-Vi,r=t-Xi,i=We(n*n+r*r);g1+=i*(Vi+e)/2,y1+=i*(Xi+t)/2,gc+=i,i=Xi*e-Vi*t,lS+=i*(Vi+e),cS+=i*(Xi+t),Nh+=i*3,_u(Vi=e,Xi=t)}var fS=oi;x();function x1(e){this._context=e}x1.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,bt);break}}},result:Je};x();var hS=new nt,dS,WO,GO,Oh,Ih,b1={point:Je,lineStart:function(){b1.point=LX},lineEnd:function(){dS&&HO(WO,GO),b1.point=Je},polygonStart:function(){dS=!0},polygonEnd:function(){dS=null},result:function(){var e=+hS;return hS=new nt,e}};function LX(e,t){b1.point=HO,WO=Oh=e,GO=Ih=t}function HO(e,t){Oh-=e,Ih-=t,hS.add(We(Oh*Oh+Ih*Ih)),Oh=e,Ih=t}var pS=b1;x();var YO,v1,VO,XO,yc=class{constructor(t){this._append=t==null?KO:zX(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!==VO||this._append!==v1){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`,VO=r,v1=this._append,XO=this._,this._=i}this._+=XO;break}}}result(){let t=this._;return this._="",t.length?t:null}};function KO(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zX(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return KO;if(t!==YO){let n=10**t;YO=t,v1=function(i){let o=1;this._+=i[0];for(let a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return v1}function w1(e,t){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Qn(s,i(o))),o.result()}return a.area=function(s){return Qn(s,i(aS)),aS.result()},a.measure=function(s){return Qn(s,i(pS)),pS.result()},a.bounds=function(s){return Qn(s,i(mc)),mc.result()},a.centroid=function(s){return Qn(s,i(fS)),fS.result()},a.projection=function(s){return arguments.length?(i=s==null?(e=null,ts):(e=s).stream,a):e},a.context=function(s){return arguments.length?(o=s==null?(t=null,new yc(n)):new x1(t=s),typeof r!="function"&&o.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{let u=Math.floor(s);if(!(u>=0))throw new RangeError(`invalid digits: ${s}`);n=u}return t===null&&(o=new yc(n)),a},a.projection(e).digits(n).context(t)}x();x();x();x();x();function Au(e){return function(t){var n=new mS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function mS(){}mS.prototype={constructor:mS,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()}};x();function gS(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Qn(n,e.stream(mc)),t(mc.result()),r!=null&&e.clipExtent(r),e}function ku(e,t,n){return gS(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,u=+t[0][1]+(o-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,u])},n)}function xc(e,t,n){return ku(e,[[0,0],t],n)}function bc(e,t,n){return gS(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];e.scale(150*o).translate([a,s])},n)}function vc(e,t,n){return gS(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([a,s])},n)}x();var QO=16,BX=re(30*ge);function yS(e,t){return+t?qX(e,t):UX(e)}function UX(e){return Au({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function qX(e,t){function n(r,i,o,a,s,u,l,c,f,d,h,p,m,g){var y=l-r,b=c-i,v=y*y+b*b;if(v>4*t&&m--){var w=a+d,E=s+h,_=u+p,S=We(w*w+E*E+_*_),k=Qe(_/=S),C=me(me(_)-1)<ie||me(o-f)<ie?(o+f)/2:dt(E,w),M=e(C,k),R=M[0],P=M[1],D=R-r,$=P-i,F=b*D-y*$;(F*F/v>t||me((y*D+b*$)/v-.5)>.3||a*d+s*h+u*p<BX)&&(n(r,i,o,a,s,u,R,P,C,w/=S,E/=S,_,m,g),g.point(R,P),n(R,P,C,w,E,_,l,c,f,d,h,p,m,g))}}return function(r){var i,o,a,s,u,l,c,f,d,h,p,m,g={point:y,lineStart:b,lineEnd:w,polygonStart:function(){r.polygonStart(),g.lineStart=E},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(k,C){k=e(k,C),r.point(k[0],k[1])}function b(){f=NaN,g.point=v,r.lineStart()}function v(k,C){var M=Dr([k,C]),R=e(k,C);n(f,d,c,h,p,m,f=R[0],d=R[1],c=k,h=M[0],p=M[1],m=M[2],QO,r),r.point(f,d)}function w(){g.point=y,r.lineEnd()}function E(){b(),g.point=_,g.lineEnd=S}function _(k,C){v(i=k,C),o=f,a=d,s=h,u=p,l=m,g.point=v}function S(){n(f,d,c,h,p,m,o,a,i,s,u,l,QO,r),g.lineEnd=w,w()}return g}}var jX=Au({point:function(e,t){this.stream.point(e*ge,t*ge)}});function WX(e){return Au({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function GX(e,t,n,r,i){function o(a,s){return a*=r,s*=i,[t+e*a,n-e*s]}return o.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*i]},o}function JO(e,t,n,r,i,o){if(!o)return GX(e,t,n,r,i);var a=re(o),s=ne(o),u=a*e,l=s*e,c=a/e,f=s/e,d=(s*n-a*t)/e,h=(s*t+a*n)/e;function p(m,g){return m*=r,g*=i,[u*m-l*g+t,n-l*m-u*g]}return p.invert=function(m,g){return[r*(c*m-f*g+d),i*(h-f*m-c*g)]},p}function pt(e){return E1(function(){return e})()}function E1(e){var t,n=150,r=480,i=250,o=0,a=0,s=0,u=0,l=0,c,f=0,d=1,h=1,p=null,m=tS,g=null,y,b,v,w=ts,E=.5,_,S,k,C,M;function R(F){return k(F[0]*ge,F[1]*ge)}function P(F){return F=k.invert(F[0],F[1]),F&&[F[0]*je,F[1]*je]}R.stream=function(F){return C&&M===F?C:C=jX(WX(c)(m(_(w(M=F)))))},R.preclip=function(F){return arguments.length?(m=F,p=void 0,$()):m},R.postclip=function(F){return arguments.length?(w=F,g=y=b=v=null,$()):w},R.clipAngle=function(F){return arguments.length?(m=+F?TO(p=F*ge):(p=null,tS),$()):p*je},R.clipExtent=function(F){return arguments.length?(w=F==null?(g=y=b=v=null,ts):$h(g=+F[0][0],y=+F[0][1],b=+F[1][0],v=+F[1][1]),$()):g==null?null:[[g,y],[b,v]]},R.scale=function(F){return arguments.length?(n=+F,D()):n},R.translate=function(F){return arguments.length?(r=+F[0],i=+F[1],D()):[r,i]},R.center=function(F){return arguments.length?(o=F[0]%360*ge,a=F[1]%360*ge,D()):[o*je,a*je]},R.rotate=function(F){return arguments.length?(s=F[0]%360*ge,u=F[1]%360*ge,l=F.length>2?F[2]%360*ge:0,D()):[s*je,u*je,l*je]},R.angle=function(F){return arguments.length?(f=F%360*ge,D()):f*je},R.reflectX=function(F){return arguments.length?(d=F?-1:1,D()):d<0},R.reflectY=function(F){return arguments.length?(h=F?-1:1,D()):h<0},R.precision=function(F){return arguments.length?(_=yS(S,E=F*F),$()):We(E)},R.fitExtent=function(F,T){return ku(R,F,T)},R.fitSize=function(F,T){return xc(R,F,T)},R.fitWidth=function(F,T){return bc(R,F,T)},R.fitHeight=function(F,T){return vc(R,F,T)};function D(){var F=JO(n,0,0,d,h,f).apply(null,t(o,a)),T=JO(n,r-F[0],i-F[1],d,h,f);return c=ZE(s,u,l),S=Rh(t,T),k=Rh(c,S),_=yS(S,E),$()}function $(){return C=M=null,R}return function(){return t=e.apply(this,arguments),R.invert=t.invert&&P,D()}}function wc(e){var t=0,n=ye/3,r=E1(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ge,n=o[1]*ge):[t*je,n*je]},i}x();function ZO(e){var t=re(e);function n(r,i){return[r*t,ne(i)/t]}return n.invert=function(r,i){return[r/t,Qe(i*t)]},n}function eI(e,t){var n=ne(e),r=(n+ne(t))/2;if(me(r)<ie)return ZO(e);var i=1+n*(2*r-n),o=We(i)/r;function a(s,u){var l=We(i-2*r*ne(u))/r;return[l*ne(s*=r),o-l*re(s)]}return a.invert=function(s,u){var l=o-u,c=dt(s,me(l))*bn(l);return l*r<0&&(c-=ye*bn(s)*bn(l)),[c/r,Qe((i-(s*s+l*l)*r*r)/(2*r))]},a}function rs(){return wc(eI).scale(155.424).center([0,33.6442])}function Ph(){return rs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}x();function HX(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 xS(){var e,t,n=Ph(),r,i=rs().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=rs().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,r.point(h,p),u||(o.point(h,p),u)||(s.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),m=(d[0]-p[0])/h,g=(d[1]-p[1])/h;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?i:g>=.166&&g<.234&&m>=-.214&&m<-.115?a:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=HX([n.stream(t=d),i.stream(d),a.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),a.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),a.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],m=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,m-.238*h],[p+.455*h,m+.238*h]]).stream(l),o=i.translate([p-.307*h,m+.201*h]).clipExtent([[p-.425*h+ie,m+.12*h+ie],[p-.214*h-ie,m+.234*h-ie]]).stream(l),s=a.translate([p-.205*h,m+.212*h]).clipExtent([[p-.214*h+ie,m+.166*h+ie],[p-.115*h-ie,m+.234*h-ie]]).stream(l),f()},c.fitExtent=function(d,h){return ku(c,d,h)},c.fitSize=function(d,h){return xc(c,d,h)},c.fitWidth=function(d,h){return bc(c,d,h)},c.fitHeight=function(d,h){return vc(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}x();x();function S1(e){return function(t,n){var r=re(t),i=re(n),o=e(r*i);return o===1/0?[2,0]:[o*i*ne(t),o*ne(n)]}}function Ki(e){return function(t,n){var r=We(t*t+n*n),i=e(r),o=ne(i),a=re(i);return[dt(t*o,r*a),Qe(r&&n*o/r)]}}var bS=S1(function(e){return We(2/(1+e))});bS.invert=Ki(function(e){return 2*Qe(e/2)});function vS(){return pt(bS).scale(124.75).clipAngle(180-.001)}x();var wS=S1(function(e){return(e=Q0(e))&&e/ne(e)});wS.invert=Ki(function(e){return e});function ES(){return pt(wS).scale(79.4188).clipAngle(180-.001)}x();x();function Ec(e,t){return[e,vu(fc((qe+t)/2))]}Ec.invert=function(e,t){return[e,2*Tr(V0(t))-qe]};function SS(){return _S(Ec).scale(961/bt)}function _S(e){var t=pt(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,s,u,l;t.scale=function(f){return arguments.length?(r(f),c()):r()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?a=s=u=l=null:(a=+f[0][0],s=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):a==null?null:[[a,s],[u,l]]};function c(){var f=ye*r(),d=t(CO(t.rotate()).invert([0,0]));return o(a==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Ec?[[Math.max(d[0]-f,a),s],[Math.min(d[0]+f,u),l]]:[[a,Math.max(d[1]-f,s)],[u,Math.min(d[1]+f,l)]])}return c()}function _1(e){return fc((qe+e)/2)}function tI(e,t){var n=re(e),r=e===t?ne(e):vu(n/re(t))/vu(_1(t)/_1(e)),i=n*K0(_1(e),r)/r;if(!r)return Ec;function o(a,s){i>0?s<-qe+ie&&(s=-qe+ie):s>qe-ie&&(s=qe-ie);var u=i/K0(_1(s),r);return[u*ne(r*a),i-u*re(r*a)]}return o.invert=function(a,s){var u=i-s,l=bn(r)*We(a*a+u*u),c=dt(a,me(u))*bn(u);return u*r<0&&(c-=ye*bn(a)*bn(u)),[c/r,2*Tr(K0(i/l,1/r))-qe]},o}function AS(){return wc(tI).scale(109.5).parallels([30,30])}x();x();function Sc(e,t){return[e,t]}Sc.invert=Sc;function kS(){return pt(Sc).scale(152.63)}function nI(e,t){var n=re(e),r=e===t?ne(e):(n-re(t))/(t-e),i=n/r+e;if(me(r)<ie)return Sc;function o(a,s){var u=i-s,l=r*a;return[u*ne(l),i-u*re(l)]}return o.invert=function(a,s){var u=i-s,l=dt(a,me(u))*bn(u);return u*r<0&&(l-=ye*bn(a)*bn(u)),[l/r,i-bn(r)*We(a*a+u*u)]},o}function CS(){return wc(nI).scale(131.154).center([0,13.9389])}x();var Lh=1.340264,zh=-.081106,Bh=893e-6,Uh=.003796,A1=We(3)/2,YX=12;function FS(e,t){var n=Qe(A1*ne(t)),r=n*n,i=r*r*r;return[e*re(n)/(A1*(Lh+3*zh*r+i*(7*Bh+9*Uh*r))),n*(Lh+zh*r+i*(Bh+Uh*r))]}FS.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,a,s,u;o<YX&&(s=n*(Lh+zh*r+i*(Bh+Uh*r))-t,u=Lh+3*zh*r+i*(7*Bh+9*Uh*r),n-=a=s/u,r=n*n,i=r*r*r,!(me(a)<bu));++o);return[A1*e*(Lh+3*zh*r+i*(7*Bh+9*Uh*r))/re(n),Qe(ne(n)/A1)]};function RS(){return pt(FS).scale(177.158)}x();function MS(e,t){var n=re(t),r=re(e)*n;return[n*ne(e)/r,ne(t)/r]}MS.invert=Ki(Tr);function $S(){return pt(MS).scale(144.049).clipAngle(60)}x();function TS(){var e=1,t=0,n=0,r=1,i=1,o=0,a,s,u=null,l,c,f,d=1,h=1,p=Au({point:function(w,E){var _=v([w,E]);this.stream.point(_[0],_[1])}}),m=ts,g,y;function b(){return d=e*r,h=e*i,g=y=null,v}function v(w){var E=w[0]*d,_=w[1]*h;if(o){var S=_*a-E*s;E=E*a+_*s,_=S}return[E+t,_+n]}return v.invert=function(w){var E=w[0]-t,_=w[1]-n;if(o){var S=_*a+E*s;E=E*a-_*s,_=S}return[E/d,_/h]},v.stream=function(w){return g&&y===w?g:g=p(m(y=w))},v.postclip=function(w){return arguments.length?(m=w,u=l=c=f=null,b()):m},v.clipExtent=function(w){return arguments.length?(m=w==null?(u=l=c=f=null,ts):$h(u=+w[0][0],l=+w[0][1],c=+w[1][0],f=+w[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(w){return arguments.length?(e=+w,b()):e},v.translate=function(w){return arguments.length?(t=+w[0],n=+w[1],b()):[t,n]},v.angle=function(w){return arguments.length?(o=w%360*ge,s=ne(o),a=re(o),b()):o*je},v.reflectX=function(w){return arguments.length?(r=w?-1:1,b()):r<0},v.reflectY=function(w){return arguments.length?(i=w?-1:1,b()):i<0},v.fitExtent=function(w,E){return ku(v,w,E)},v.fitSize=function(w,E){return xc(v,w,E)},v.fitWidth=function(w,E){return bc(v,w,E)},v.fitHeight=function(w,E){return vc(v,w,E)},v}x();function DS(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}DS.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-t)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(me(i)>ie&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function NS(){return pt(DS).scale(175.295)}x();function OS(e,t){return[re(t)*ne(e),ne(t)]}OS.invert=Ki(Qe);function IS(){return pt(OS).scale(249.5).clipAngle(90+ie)}x();function PS(e,t){var n=re(t),r=1+re(e)*n;return[n*ne(e)/r,ne(t)/r]}PS.invert=Ki(function(e){return 2*Tr(e)});function LS(){return pt(PS).scale(250).clipAngle(142)}x();function zS(e,t){return[vu(fc((qe+t)/2)),-e]}zS.invert=function(e,t){return[-t,2*Tr(V0(e))-qe]};function BS(){var e=_S(zS),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)}x();x();var rI=Math.abs;var C1=Math.cos;var qh=Math.sin;var iI=1e-6;var is=Math.PI,k1=is/2,RMe=is/4;var US=oI(2),MMe=oI(is),$Me=is*2,TMe=180/is,DMe=is/180;function qS(e){return e>1?k1:e<-1?-k1:Math.asin(e)}function oI(e){return e>0?Math.sqrt(e):0}x();function VX(e,t){var n=e*qh(t),r=30,i;do t-=i=(t+qh(t)-n)/(1+C1(t));while(rI(i)>iI&&--r>0);return t/2}function XX(e,t,n){function r(i,o){return[e*i*C1(o=VX(n,o)),t*qh(o)]}return r.invert=function(i,o){return o=qS(o/t),[i/(e*C1(o)),qS((2*o+qh(2*o))/n)]},r}var aI=XX(US/k1,US,is);function jS(){return pt(aI).scale(169.529)}var KX=w1(),R1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function QX(e,t){return function n(){let r=t();return r.type=e,r.path=w1().projection(r),r.copy=r.copy||function(){let i=n();return R1.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},_w(r)}}function jh(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(F1[e]=QX(e,t),this):F1[e]||null}function WS(e){return e&&e.path||KX}var F1={albers:Ph,albersusa:xS,azimuthalequalarea:vS,azimuthalequidistant:ES,conicconformal:AS,conicequalarea:rs,conicequidistant:CS,equalEarth:RS,equirectangular:kS,gnomonic:$S,identity:TS,mercator:SS,mollweide:jS,naturalEarth1:NS,orthographic:IS,stereographic:LS,transversemercator:BS};for(let e in F1)jh(e,F1[e]);function JX(){}var qo=[[],[[[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 lI(){var e=1,t=1,n=s;function r(u,l){return l.map(c=>i(u,c))}function i(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),ZX(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,m;h<p;++h)if(eK((m=c[h])[0],d)!==-1){m.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,p,m,g,y,b;for(h=p=-1,g=u[0]>=l,qo[g<<1].forEach(v);++h<e-1;)m=g,g=u[h+1]>=l,qo[m|g<<1].forEach(v);for(qo[g<<0].forEach(v);++p<t-1;){for(h=-1,g=u[p*e+e]>=l,y=u[p*e]>=l,qo[g<<1|y<<2].forEach(v);++h<e-1;)m=g,g=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,qo[m|g<<1|y<<2|b<<3].forEach(v);qo[g|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,qo[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,qo[y<<2|b<<3].forEach(v);qo[y<<3].forEach(v);function v(w){var E=[w[0][0]+h,w[0][1]+p],_=[w[1][0]+h,w[1][1]+p],S=a(E),k=a(_),C,M;(C=d[S])?(M=f[k])?(delete d[C.end],delete f[M.start],C===M?(C.ring.push(_),c(C.ring)):f[C.start]=d[M.end]={start:C.start,end:M.end,ring:C.ring.concat(M.ring)}):(delete d[C.end],C.ring.push(_),d[C.end=k]=C):(C=f[k])?(M=d[S])?(delete f[C.start],delete d[M.end],C===M?(C.ring.push(_),c(C.ring)):f[M.start]=d[C.end]={start:M.start,end:C.end,ring:M.ring.concat(C.ring)}):(delete f[C.start],C.ring.unshift(E),f[C.start=S]=C):f[S]=d[k]={start:S,end:k,ring:[E,_]}}}function a(u){return u[0]*2+u[1]*(e+1)*4}function s(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,m=h|0,g,y=l[m*e+p];d>0&&d<e&&p===d&&(g=l[m*e+p-1],f[0]=d+(c-g)/(y-g)-.5),h>0&&h<t&&m===h&&(g=l[(m-1)*e+p],f[1]=h+(c-g)/(y-g)-.5)})}return r.contour=i,r.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||O("invalid size"),e=l,t=c,r},r.smooth=function(u){return arguments.length?(n=u?s:JX,r):n===s},r}function ZX(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}function eK(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=tK(e,t[n]))return i;return 0}function tK(e,t){for(var n=t[0],r=t[1],i=-1,o=0,a=e.length,s=a-1;o<a;s=o++){var u=e[o],l=u[0],c=u[1],f=e[s],d=f[0],h=f[1];if(nK(u,f,t))return 0;c>r!=h>r&&n<(d-l)*(r-c)/(h-c)+l&&(i=-i)}return i}function nK(e,t,n){var r;return rK(e,t,n)&&iK(e[r=+(e[0]===t[0])],n[r],t[r])}function rK(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function iK(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function cI(e,t,n){return function(r){var i=_n(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=t?An(o,a,e):s/(e+1);return xt(o+u,a,u)}}function YS(e){N.call(this,null,e)}YS.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};W(YS,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||ct,o=lI().smooth(e.smooth!==!1),a=e.thresholds||oK(r,i,e),s=e.as===null?null:e.as||"contour",u=[];return r.forEach(l=>{let c=i(l),f=o.size([c.width,c.height])(c.values,I(a)?a:a(c.values));aK(f,c,l,e),f.forEach(d=>{u.push(Ys(l,Ce(s!=null?{[s]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function oK(e,t,n){let r=cI(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>wr(t(i).values)))}function aK(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(de(i)&&(i=i(n,r)),de(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;let a=(ke(i)?i:i[0])||1,s=(ke(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(fI(t,a,s,u,l))}function fI(e,t,n,r,i){let o=e.x1||0,a=e.y1||0,s=t*n<0;function u(f){f.forEach(l)}function l(f){s&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-a)*n+i}return function(f){return f.coordinates.forEach(u),f}}function sI(e,t,n){let r=e>=0?e:Zm(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function GS(e){return de(e)?e:tt(+e)}function dI(){var e=u=>u[0],t=u=>u[1],n=$i,r=[-1,-1],i=960,o=500,a=2;function s(u,l){let c=sI(r[0],u,e)>>a,f=sI(r[1],u,t)>>a,d=c?c+2:0,h=f?f+2:0,p=2*d+(i>>a),m=2*h+(o>>a),g=new Float32Array(p*m),y=new Float32Array(p*m),b=g;u.forEach(w=>{let E=d+(+e(w)>>a),_=h+(+t(w)>>a);E>=0&&E<p&&_>=0&&_<m&&(g[E+_*p]+=+n(w))}),c>0&&f>0?(_c(p,m,g,y,c),Ac(p,m,y,g,f),_c(p,m,g,y,c),Ac(p,m,y,g,f),_c(p,m,g,y,c),Ac(p,m,y,g,f)):c>0?(_c(p,m,g,y,c),_c(p,m,y,g,c),_c(p,m,g,y,c),b=y):f>0&&(Ac(p,m,g,y,f),Ac(p,m,y,g,f),Ac(p,m,g,y,f),b=y);let v=l?Math.pow(2,-2*a):1/Al(b);for(let w=0,E=p*m;w<E;++w)b[w]*=v;return{values:b,scale:1<<a,width:p,height:m,x1:d,y1:h,x2:d+(i>>a),y2:h+(o>>a)}}return s.x=function(u){return arguments.length?(e=GS(u),s):e},s.y=function(u){return arguments.length?(t=GS(u),s):t},s.weight=function(u){return arguments.length?(n=GS(u),s):n},s.size=function(u){if(!arguments.length)return[i,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||O("invalid size"),i=l,o=c,s},s.cellSize=function(u){return arguments.length?((u=+u)>=1||O("invalid cell size"),a=Math.floor(Math.log(u)/Math.LN2),s):1<<a},s.bandwidth=function(u){return arguments.length?(u=J(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&O("invalid bandwidth"),r=u,s):r},s}function _c(e,t,n,r,i){let o=(i<<1)+1;for(let a=0;a<t;++a)for(let s=0,u=0;s<e+i;++s)s<e&&(u+=n[s+a*e]),s>=i&&(s>=o&&(u-=n[s-o+a*e]),r[s-i+a*e]=u/Math.min(s+1,e-1+o-s,o))}function Ac(e,t,n,r,i){let o=(i<<1)+1;for(let a=0;a<e;++a)for(let s=0,u=0;s<t+i;++s)s<t&&(u+=n[a+s*e]),s>=i&&(s>=o&&(u-=n[a+(s-o)*e]),r[a+(s-i)*e]=u/Math.min(s+1,t-1+o-s,o))}function VS(e){N.call(this,null,e)}VS.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};var sK=["x","y","weight","size","cellSize","bandwidth"];function hI(e,t){return sK.forEach(n=>t[n]!=null?e[n](t[n]):0),e}W(VS,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=uK(r,e.groupby),o=(e.groupby||[]).map(Ke),a=hI(dI(),e),s=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=i.map(c=>Ce(l({[s]:a(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function uK(e,t){var n=[],r=c=>c(s),i,o,a,s,u,l;if(t==null)n.push(e);else for(i={},o=0,a=e.length;o<a;++o)s=e[o],u=t.map(r),l=i[u],l||(i[u]=l=[],l.dims=u,n.push(l)),l.push(s);return n}function XS(e){N.call(this,null,e)}XS.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};W(XS,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=lI().smooth(e.smooth!==!1),i=e.values,o=e.thresholds||cI(e.count||10,e.nice,!!i),a=e.size,s,u;return i||(i=t.materialize(t.SOURCE).source,s=hI(dI(),e)(i,!0),u=fI(s,s.scale||1,s.scale||1,0,0),a=[s.width,s.height],i=s.values),o=I(o)?o:o(i),i=r.size(a)(i,o),u&&i.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(i||[]).map(Ce),n}});var HS="Feature",KS="FeatureCollection",lK="MultiPoint";function QS(e){N.call(this,null,e)}QS.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};W(QS,N,{transform(e,t){var n=this._features,r=this._points,i=e.fields,o=i&&i[0],a=i&&i[1],s=e.geojson||!i&&ct,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Rt(s))||o&&t.modified(Rt(o))||a&&t.modified(Rt(a)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=r=[]),s&&t.visit(u,c=>n.push(s(c))),o&&a&&(t.visit(u,c=>{var f=o(c),d=a(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:HS,geometry:{type:lK,coordinates:r}})),this.value={type:KS,features:n}}});function JS(e){N.call(this,null,e)}JS.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};W(JS,N,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||ct,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=WS(e.projection),n.materialize().reflow()):a=i===ct||t.modified(i.fields)?n.ADD_MOD:n.ADD;let s=cK(r,e.pointRadius);return n.visit(a,u=>u[o]=r(i(u))),r.pointRadius(s),n.modifies(o)}});function cK(e,t){let n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function ZS(e){N.call(this,null,e)}ZS.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};W(ZS,N,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],a=o[0],s=o[1],u;function l(c){let f=n([r(c),i(c)]);f?(c[a]=f[0],c[s]=f[1]):(c[a]=void 0,c[s]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(r.fields)||t.modified(i.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function e_(e){N.call(this,null,e)}e_.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};W(e_,N,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=fK(WS(e.projection),e.field||zt("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,a=>a[i]=r),n.modifies(i)}});function fK(e,t,n){let r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),a=e.pointRadius(n)(t(i));return e.pointRadius(o),a};return r.context=i=>(e.context(i),r),r}function t_(e){N.call(this,[],e),this.generator=h1()}t_.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};W(t_,N,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(let o in e)de(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(Vm(n[0],i)):t.add.push(Ce(i)),n[0]=i,t}});function n_(e){N.call(this,null,e)}n_.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};W(n_,N,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||ct,o=hK(e.opacity,e),a=dK(e.color,e),s=e.as||"image",u={$x:0,$y:0,$value:0,$max:r?wr(n.map(l=>wr(i(l).values))):0};return n.forEach(l=>{let c=i(l),f=he({},l,u);r||(f.$max=wr(c.values||[])),l[s]=pK(c,f,a.dep?a:tt(a(f)),o.dep?o:tt(o(f)))}),t.reflow(!0).modifies(s)}});function dK(e,t){let n;return de(e)?(n=r=>Fr(e(r,t)),n.dep=pI(e)):n=tt(Fr(e||"#888")),n}function hK(e,t){let n;return de(e)?(n=r=>e(r,t),n.dep=pI(e)):e?n=tt(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function pI(e){if(!de(e))return!1;let t=$t(Rt(e));return t.$x||t.$y||t.$value||t.$max}function pK(e,t,n,r){let i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,u=e.x2||i,l=e.y2||o,c=e.values,f=c?g=>c[g]:Wr,d=Cr(u-a,l-s),h=d.getContext("2d"),p=h.getImageData(0,0,u-a,l-s),m=p.data;for(let g=s,y=0;g<l;++g){t.$y=g-s;for(let b=a,v=g*i;b<u;++b,y+=4){t.$x=b-a,t.$value=f(b+v);let w=n(t);m[y+0]=w.r,m[y+1]=w.g,m[y+2]=w.b,m[y+3]=~~(255*r(t))}}return h.putImageData(p,0,0),d}function mI(e){N.call(this,null,e),this.modified(!0)}W(mI,N,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=gK(e.type),R1.forEach(r=>{e[r]!=null&&uI(n,r,e[r])})):R1.forEach(r=>{e.modified(r)&&uI(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&mK(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function mK(e,t){let n=yK(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function gK(e){let t=jh((e||"mercator").toLowerCase());return t||O("Unrecognized projection type: "+e),t()}function uI(e,t,n){de(e[t])&&e[t](n)}function yK(e){return e=J(e),e.length===1?e[0]:{type:KS,features:e.reduce((t,n)=>t.concat(xK(n)),[])}}function xK(e){return e.type===KS?e.features:J(e).filter(t=>t!=null).map(t=>t.type===HS?t:{type:HS,geometry:t})}var y_={};Sn(y_,{force:()=>g_});x();x();x();function i_(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,a=n.length,s,u=0,l=0;for(o=0;o<a;++o)s=n[o],u+=s.x,l+=s.y;for(u=(u/a-e)*r,l=(l/a-t)*r,o=0;o<a;++o)s=n[o],s.x-=u,s.y-=l}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}x();x();x();x();function gI(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return yI(this.cover(t,n),t,n,e)}function yI(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,m,g,y,b;if(!o)return e._root=a,e;for(;o.length;)if((m=t>=(f=(s+l)/2))?s=f:l=f,(g=n>=(d=(u+c)/2))?u=d:c=d,i=o,!(o=o[y=g<<1|m]))return i[y]=a,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return a.next=o,i?i[y]=a:e._root=a,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(m=t>=(f=(s+l)/2))?s=f:l=f,(g=n>=(d=(u+c)/2))?u=d:c=d;while((y=g<<1|m)===(b=(p>=d)<<1|h>=f));return i[b]=o,i[y]=a,e}function xI(e){var t,n,r=e.length,i,o,a=new Array(r),s=new Array(r),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,s[n]=o,i<u&&(u=i),i>c&&(c=i),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<r;++n)yI(this,a[n],s[n],e[n]);return this}x();function bI(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var a=i-n||1,s=this._root,u,l;n>e||e>=i||r>t||t>=o;)switch(l=(t<r)<<1|e<n,u=new Array(4),u[l]=s,s=u,a*=2,l){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}x();function vI(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}x();function wI(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}x();x();function jt(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function EI(e,t,n){var r,i=this._x0,o=this._y0,a,s,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,m;for(h&&d.push(new jt(h,i,o,c,f)),n==null?n=1/0:(i=e-n,o=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(a=p.x0)>c||(s=p.y0)>f||(u=p.x1)<i||(l=p.y1)<o))if(h.length){var g=(a+u)/2,y=(s+l)/2;d.push(new jt(h[3],g,y,u,l),new jt(h[2],a,y,g,l),new jt(h[1],g,s,u,y),new jt(h[0],a,s,g,y)),(m=(t>=y)<<1|e>=g)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),w=b*b+v*v;if(w<n){var E=Math.sqrt(n=w);i=e-E,o=t-E,c=e+E,f=t+E,r=h.data}}return r}x();function SI(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,a=this._x0,s=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,m,g,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(a+u)/2))?a=d:u=d,(m=f>=(h=(s+l)/2))?s=h:l=h,t=n,!(n=n[g=m<<1|p]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,y=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[g]=o:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function _I(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}x();function AI(){return this._root}x();function kI(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}x();function CI(e){var t=[],n,r=this._root,i,o,a,s,u;for(r&&t.push(new jt(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,a=n.y0,s=n.x1,u=n.y1)&&r.length){var l=(o+s)/2,c=(a+u)/2;(i=r[3])&&t.push(new jt(i,l,c,s,u)),(i=r[2])&&t.push(new jt(i,o,c,l,u)),(i=r[1])&&t.push(new jt(i,l,a,s,c)),(i=r[0])&&t.push(new jt(i,o,a,l,c))}return this}x();function FI(e){var t=[],n=[],r;for(this._root&&t.push(new jt(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,a=r.x0,s=r.y0,u=r.x1,l=r.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&t.push(new jt(o,a,s,c,f)),(o=i[1])&&t.push(new jt(o,c,s,u,f)),(o=i[2])&&t.push(new jt(o,a,f,c,l)),(o=i[3])&&t.push(new jt(o,c,f,u,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}x();function RI(e){return e[0]}function MI(e){return arguments.length?(this._x=e,this):this._x}x();function $I(e){return e[1]}function TI(e){return arguments.length?(this._y=e,this):this._y}function Cu(e,t,n){var r=new o_(t??RI,n??$I,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function o_(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function DI(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Pn=Cu.prototype=o_.prototype;Pn.copy=function(){var e=new o_(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=DI(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=DI(r));return e};Pn.add=gI;Pn.addAll=xI;Pn.cover=bI;Pn.data=vI;Pn.extent=wI;Pn.find=EI;Pn.remove=SI;Pn.removeAll=_I;Pn.root=AI;Pn.size=kI;Pn.visit=CI;Pn.visitAfter=FI;Pn.x=MI;Pn.y=TI;x();function kt(e){return function(){return e}}x();function ai(e){return(e()-.5)*1e-6}function bK(e){return e.x+e.vx}function vK(e){return e.y+e.vy}function a_(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=kt(e==null?1:+e));function a(){for(var l,c=t.length,f,d,h,p,m,g,y=0;y<o;++y)for(f=Cu(t,bK,vK).visitAfter(s),l=0;l<c;++l)d=t[l],m=n[d.index],g=m*m,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,w,E,_,S){var k=v.data,C=v.r,M=m+C;if(k){if(k.index>d.index){var R=h-k.x-k.vx,P=p-k.y-k.vy,D=R*R+P*P;D<M*M&&(R===0&&(R=ai(r),D+=R*R),P===0&&(P=ai(r),D+=P*P),D=(M-(D=Math.sqrt(D)))/D*i,d.vx+=(R*=D)*(M=(C*=C)/(g+C)),d.vy+=(P*=D)*M,k.vx-=R*(M=1-M),k.vy-=P*M)}return}return w>h+M||_<h-M||E>p+M||S<p-M}}function s(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return a.initialize=function(l,c){t=l,r=c,u()},a.iterations=function(l){return arguments.length?(o=+l,a):o},a.strength=function(l){return arguments.length?(i=+l,a):i},a.radius=function(l){return arguments.length?(e=typeof l=="function"?l:kt(+l),u(),a):e},a}x();function wK(e){return e.index}function NI(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function s_(e){var t=wK,n=f,r,i=kt(30),o,a,s,u,l,c=1;e==null&&(e=[]);function f(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function d(g){for(var y=0,b=e.length;y<c;++y)for(var v=0,w,E,_,S,k,C,M;v<b;++v)w=e[v],E=w.source,_=w.target,S=_.x+_.vx-E.x-E.vx||ai(l),k=_.y+_.vy-E.y-E.vy||ai(l),C=Math.sqrt(S*S+k*k),C=(C-o[v])/C*g*r[v],S*=C,k*=C,_.vx-=S*(M=u[v]),_.vy-=k*M,E.vx+=S*(M=1-M),E.vy+=k*M}function h(){if(a){var g,y=a.length,b=e.length,v=new Map(a.map((E,_)=>[t(E,_,a),E])),w;for(g=0,s=new Array(y);g<b;++g)w=e[g],w.index=g,typeof w.source!="object"&&(w.source=NI(v,w.source)),typeof w.target!="object"&&(w.target=NI(v,w.target)),s[w.source.index]=(s[w.source.index]||0)+1,s[w.target.index]=(s[w.target.index]||0)+1;for(g=0,u=new Array(b);g<b;++g)w=e[g],u[g]=s[w.source.index]/(s[w.source.index]+s[w.target.index]);r=new Array(b),p(),o=new Array(b),m()}}function p(){if(a)for(var g=0,y=e.length;g<y;++g)r[g]=+n(e[g],g,e)}function m(){if(a)for(var g=0,y=e.length;g<y;++g)o[g]=+i(e[g],g,e)}return d.initialize=function(g,y){a=g,l=y,h()},d.links=function(g){return arguments.length?(e=g,h(),d):e},d.id=function(g){return arguments.length?(t=g,d):t},d.iterations=function(g){return arguments.length?(c=+g,d):c},d.strength=function(g){return arguments.length?(n=typeof g=="function"?g:kt(+g),p(),d):n},d.distance=function(g){return arguments.length?(i=typeof g=="function"?g:kt(+g),m(),d):i},d}x();x();x();x();var EK={value:()=>{}};function II(){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 M1(n)}function M1(e){this._=e}function SK(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}})}M1.prototype=II.prototype={constructor:M1,on:function(e,t){var n=this._,r=SK(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=_K(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=OI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=OI(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 M1(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 _K(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function OI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=EK,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var u_=II;x();x();var kc=0,Gh=0,Wh=0,LI=1e3,$1,Hh,T1=0,Fu=0,D1=0,Yh=typeof performance=="object"&&performance.now?performance:Date,zI=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xh(){return Fu||(zI(AK),Fu=Yh.now()+D1)}function AK(){Fu=0}function Vh(){this._call=this._time=this._next=null}Vh.prototype=N1.prototype={constructor:Vh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Xh():+n)+(t==null?0:+t),!this._next&&Hh!==this&&(Hh?Hh._next=this:$1=this,Hh=this),this._call=e,this._time=n,l_()},stop:function(){this._call&&(this._call=null,this._time=1/0,l_())}};function N1(e,t,n){var r=new Vh;return r.restart(e,t,n),r}function BI(){Xh(),++kc;for(var e=$1,t;e;)(t=Fu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--kc}function PI(){Fu=(T1=Yh.now())+D1,kc=Gh=0;try{BI()}finally{kc=0,CK(),Fu=0}}function kK(){var e=Yh.now(),t=e-T1;t>LI&&(D1-=t,T1=e)}function CK(){for(var e,t=$1,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:$1=n);Hh=e,l_(r)}function l_(e){if(!kc){Gh&&(Gh=clearTimeout(Gh));var t=e-Fu;t>24?(e<1/0&&(Gh=setTimeout(PI,e-Yh.now()-D1)),Wh&&(Wh=clearInterval(Wh))):(Wh||(T1=Yh.now(),Wh=setInterval(kK,LI)),kc=1,zI(PI))}}x();function c_(e,t,n){var r=new Vh,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Xh():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(e,t,n),r)}x();function UI(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}function qI(e){return e.x}function jI(e){return e.y}var FK=10,RK=Math.PI*(3-Math.sqrt(5));function f_(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=N1(f),l=u_("tick","end"),c=UI();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<r&&(u.stop(),l.call("end",t))}function d(m){var g,y=e.length,b;m===void 0&&(m=1);for(var v=0;v<m;++v)for(n+=(o-n)*i,s.forEach(function(w){w(n)}),g=0;g<y;++g)b=e[g],b.fx==null?b.x+=b.vx*=a:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=a:(b.y=b.fy,b.vy=0);return t}function h(){for(var m=0,g=e.length,y;m<g;++m){if(y=e[m],y.index=m,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=FK*Math.sqrt(.5+m),v=m*RK;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(m){return m.initialize&&m.initialize(e,c),m}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(m){return arguments.length?(e=m,h(),s.forEach(p),t):e},alpha:function(m){return arguments.length?(n=+m,t):n},alphaMin:function(m){return arguments.length?(r=+m,t):r},alphaDecay:function(m){return arguments.length?(i=+m,t):+i},alphaTarget:function(m){return arguments.length?(o=+m,t):o},velocityDecay:function(m){return arguments.length?(a=1-m,t):1-a},randomSource:function(m){return arguments.length?(c=m,s.forEach(p),t):c},force:function(m,g){return arguments.length>1?(g==null?s.delete(m):s.set(m,p(g)),t):s.get(m)},find:function(m,g,y){var b=0,v=e.length,w,E,_,S,k;for(y==null?y=1/0:y*=y,b=0;b<v;++b)S=e[b],w=m-S.x,E=g-S.y,_=w*w+E*E,_<y&&(k=S,y=_);return k},on:function(m,g){return arguments.length>1?(l.on(m,g),t):l.on(m)}}}function d_(){var e,t,n,r,i=kt(-30),o,a=1,s=1/0,u=.81;function l(h){var p,m=e.length,g=Cu(e,qI,jI).visitAfter(f);for(r=h,p=0;p<m;++p)t=e[p],g.visit(d)}function c(){if(e){var h,p=e.length,m;for(o=new Array(p),h=0;h<p;++h)m=e[h],o[m.index]=+i(m,h,e)}}function f(h){var p=0,m,g,y=0,b,v,w;if(h.length){for(b=v=w=0;w<4;++w)(m=h[w])&&(g=Math.abs(m.value))&&(p+=m.value,y+=g,b+=g*m.x,v+=g*m.y);h.x=b/y,h.y=v/y}else{m=h,m.x=m.data.x,m.y=m.data.y;do p+=o[m.data.index];while(m=m.next)}h.value=p}function d(h,p,m,g){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=g-p,w=y*y+b*b;if(v*v/u<w)return w<s&&(y===0&&(y=ai(n),w+=y*y),b===0&&(b=ai(n),w+=b*b),w<a&&(w=Math.sqrt(a*w)),t.vx+=y*h.value*r/w,t.vy+=b*h.value*r/w),!0;if(h.length||w>=s)return;(h.data!==t||h.next)&&(y===0&&(y=ai(n),w+=y*y),b===0&&(b=ai(n),w+=b*b),w<a&&(w=Math.sqrt(a*w)));do h.data!==t&&(v=o[h.data.index]*r/w,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(i=typeof h=="function"?h:kt(+h),c(),l):i},l.distanceMin=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.distanceMax=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}x();function h_(e){var t=kt(.1),n,r,i;typeof e!="function"&&(e=kt(e==null?0:+e));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(i[u]-c.x)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),a(),o):t},o.x=function(s){return arguments.length?(e=typeof s=="function"?s:kt(+s),a(),o):e},o}x();function p_(e){var t=kt(.1),n,r,i;typeof e!="function"&&(e=kt(e==null?0:+e));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(i[u]-c.y)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),a(),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:kt(+s),a(),o):e},o}var WI={center:i_,collide:a_,nbody:d_,link:s_,x:h_,y:p_},Kh="forces",m_=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],MK=["static","iterations"],GI=["x","y","vx","vy"];function g_(e){N.call(this,null,e)}g_.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:GI}]};W(g_,N,{transform(e,t){var n=this.value,r=t.changed(t.ADD_REM),i=e.modified(m_),o=e.iterations||300;if(n?(r&&(t.modifies("index"),n.nodes(t.source)),(i||t.changed(t.MOD))&&HI(n,e,0,t)):(this.value=n=TK(t.source,e),n.on("tick",$K(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies("index")),i||r||e.modified(MK)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){let n=t.dataflow;for(let s=this._argops,u=0,l=s.length,c;u<l;++u)if(c=s[u],!(c.name!==Kh||c.op._argval.force!=="link")){for(var r=c.op._argops,i=0,o=r.length,a;i<o;++i)if(r[i].name==="links"&&(a=r[i].op.source)){n.pulse(a,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(GI)}});function $K(e,t){return()=>e.touch(t).run()}function TK(e,t){let n=f_(e),r=n.stop,i=n.restart,o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),HI(n,t,!0).on("end",()=>o=!0)}function HI(e,t,n,r){var i=J(t.forces),o,a,s,u;for(o=0,a=m_.length;o<a;++o)s=m_[o],s!==Kh&&t.modified(s)&&e[s](t[s]);for(o=0,a=i.length;o<a;++o)u=Kh+o,s=n||t.modified(Kh,o)?NK(i[o]):r&&DK(i[o],r)?e.force(u):null,s&&e.force(u,s);for(a=e.numForces||0;o<a;++o)e.force(Kh+o,null);return e.numForces=i.length,e}function DK(e,t){var n,r;for(n in e)if(de(r=e[n])&&t.modified(Rt(r)))return 1;return 0}function NK(e){var t,n;ee(WI,e.force)||O("Unrecognized force: "+e.force),t=WI[e.force]();for(n in e)de(t[n])&&OK(t[n],e[n],e);return t}function OK(e,t,n){e(de(t)?r=>t(r,n):t)}var V_={};Sn(V_,{nest:()=>U_,pack:()=>q_,partition:()=>j_,stratify:()=>W_,tree:()=>G_,treelinks:()=>H_,treemap:()=>Y_});x();x();x();function IK(e,t){return e.parent===t.parent?1:2}function PK(e){return e.reduce(LK,0)/e.length}function LK(e,t){return e+t.x}function zK(e){return 1+e.reduce(BK,0)}function BK(e,t){return Math.max(e,t.y)}function UK(e){for(var t;t=e.children;)e=t[0];return e}function qK(e){for(var t;t=e.children;)e=t[t.length-1];return e}function x_(){var e=IK,t=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(d){var h=d.children;h?(d.x=PK(h),d.y=zK(h)):(d.x=a?s+=e(d,a):0,d.y=0,a=d)});var u=UK(o),l=qK(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.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}x();x();function jK(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 YI(){return this.eachAfter(jK)}x();function VI(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}x();function XI(e,t){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}x();function KI(e,t){for(var n=this,r=[n],i=[],o,a,s,u=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)e.call(t,n,++u,this);return this}x();function QI(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}x();function JI(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})}x();function ZI(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}x();function e5(e){for(var t=this,n=WK(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 WK(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}x();function t5(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}x();function n5(){return Array.from(this)}x();function r5(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}x();function i5(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}x();function*o5(){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 Cc(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=YK)):t===void 0&&(t=HK);for(var n=new jo(e),r,i=[n],o,a,s,u;r=i.pop();)if((a=t(r.data))&&(u=(a=Array.from(a)).length))for(r.children=a,s=u-1;s>=0;--s)i.push(o=a[s]=new jo(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(b_)}function GK(){return Cc(this).eachBefore(VK)}function HK(e){return e.children}function YK(e){return Array.isArray(e)?e[1]:null}function VK(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function b_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function jo(e){this.data=e,this.depth=this.height=0,this.parent=null}jo.prototype=Cc.prototype={constructor:jo,count:YI,each:VI,eachAfter:KI,eachBefore:XI,find:QI,sum:JI,sort:ZI,path:e5,ancestors:t5,descendants:n5,leaves:r5,links:i5,copy:GK,[Symbol.iterator]:o5};x();x();function Fc(e){return e==null?null:v_(e)}function v_(e){if(typeof e!="function")throw new Error;return e}x();function Wo(){return 0}function os(e){return function(){return e}}x();function a5(){let e=1;return()=>(e=(1664525*e+1013904223)%4294967296)/4294967296}x();x();function s5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function u5(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}x();function l5(e,t){for(var n=0,r=(e=u5(Array.from(e),t)).length,i=[],o,a;n<r;)o=e[n],a&&c5(a,o)?++n:(a=KK(i=XK(i,o)),n=0);return a}function XK(e,t){var n,r;if(w_(t,e))return[t];for(n=0;n<e.length;++n)if(O1(t,e[n])&&w_(Qh(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(O1(Qh(e[n],e[r]),t)&&O1(Qh(e[n],t),e[r])&&O1(Qh(e[r],t),e[n])&&w_(f5(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function O1(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function c5(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function w_(e,t){for(var n=0;n<t.length;++n)if(!c5(e,t[n]))return!1;return!0}function KK(e){switch(e.length){case 1:return QK(e[0]);case 2:return Qh(e[0],e[1]);case 3:return f5(e[0],e[1],e[2])}}function QK(e){return{x:e.x,y:e.y,r:e.r}}function Qh(e,t){var n=e.x,r=e.y,i=e.r,o=t.x,a=t.y,s=t.r,u=o-n,l=a-r,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+s)/2}}function f5(e,t,n){var r=e.x,i=e.y,o=e.r,a=t.x,s=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=r-a,h=r-l,p=i-s,m=i-c,g=u-o,y=f-o,b=r*r+i*i-o*o,v=b-a*a-s*s+u*u,w=b-l*l-c*c+f*f,E=h*p-d*m,_=(p*w-m*v)/(E*2)-r,S=(m*g-p*y)/E,k=(h*v-d*w)/(E*2)-i,C=(d*y-h*g)/E,M=S*S+C*C-1,R=2*(o+_*S+k*C),P=_*_+k*k-o*o,D=-(Math.abs(M)>1e-6?(R+Math.sqrt(R*R-4*M*P))/(2*M):P/R);return{x:r+_+S*D,y:i+k+C*D,r:D}}function d5(e,t,n){var r=e.x-t.x,i,o,a=e.y-t.y,s,u,l=r*r+a*a;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(i=(l+u-o)/(2*l),s=Math.sqrt(Math.max(0,u/l-i*i)),n.x=e.x-i*r-s*a,n.y=e.y-i*a+s*r):(i=(l+o-u)/(2*l),s=Math.sqrt(Math.max(0,o/l-i*i)),n.x=t.x+i*r-s*a,n.y=t.y+i*a+s*r)):(n.x=t.x+n.r,n.y=t.y)}function h5(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function p5(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function I1(e){this._=e,this.next=null,this.previous=null}function m5(e,t){if(!(o=(e=s5(e)).length))return 0;var n,r,i,o,a,s,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;d5(r,n,i=e[2]),n=new I1(n),r=new I1(r),i=new I1(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;u<o;++u){d5(n._,r._,i=e[u]),i=new I1(i),l=r.next,c=n.previous,f=r._.r,d=n._.r;do if(f<=d){if(h5(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(h5(c._,i._)){n=c,n.next=r,r.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=p5(n);(i=i.next)!==r;)(s=p5(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=l5(n,t),u=0;u<o;++u)n=e[u],n.x-=i.x,n.y-=i.y;return i.r}function JK(e){return Math.sqrt(e.value)}function S_(){var e=null,t=1,n=1,r=Wo;function i(o){let a=a5();return o.x=t/2,o.y=n/2,e?o.eachBefore(g5(e)).eachAfter(E_(r,.5,a)).eachBefore(y5(1)):o.eachBefore(g5(JK)).eachAfter(E_(Wo,1,a)).eachAfter(E_(r,o.r/Math.min(t,n),a)).eachBefore(y5(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=Fc(o),i):e},i.size=function(o){return arguments.length?(t=+o[0],n=+o[1],i):[t,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:os(+o),i):r},i}function g5(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function E_(e,t,n){return function(r){if(i=r.children){var i,o,a=i.length,s=e(r)*t||0,u;if(s)for(o=0;o<a;++o)i[o].r+=s;if(u=m5(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function y5(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}x();x();function P1(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}x();function si(e,t,n,r,i){for(var o=e.children,a,s=-1,u=o.length,l=e.value&&(r-t)/e.value;++s<u;)a=o[s],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*l}function __(){var e=1,t=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=e,a.y1=t/s,a.eachBefore(o(t,s)),r&&a.eachBefore(P1),a}function o(a,s){return function(u){u.children&&si(u,u.x0,a*(u.depth+1)/s,u.x1,a*(u.depth+2)/s);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(e=+a[0],t=+a[1],i):[e,t]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}x();var ZK={depth:-1},x5={},A_={};function eQ(e){return e.id}function tQ(e){return e.parentId}function L1(){var e=eQ,t=tQ,n;function r(i){var o=Array.from(i),a=e,s=t,u,l,c,f,d,h,p,m,g=new Map;if(n!=null){let y=o.map((w,E)=>nQ(n(w,E,i))),b=y.map(b5),v=new Set(y).add("");for(let w of b)v.has(w)||(v.add(w),y.push(w),b.push(b5(w)),o.push(A_));a=(w,E)=>y[E],s=(w,E)=>b[E]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new jo(l),(p=a(l,c,i))!=null&&(p+="")&&(m=h.id=p,g.set(m,g.has(m)?x5:h)),(p=s(l,c,i))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=o[c],p=h.parent){if(d=g.get(p),!d)throw new Error("missing: "+p);if(d===x5)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===A_&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===A_);--y)h.data=null}if(f.parent=ZK,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(b_),f.parent=null,u>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Fc(i),r):e},r.parentId=function(i){return arguments.length?(t=Fc(i),r):t},r.path=function(i){return arguments.length?(n=Fc(i),r):n},r}function nQ(e){e=`${e}`;let t=e.length;return k_(e,t-1)&&!k_(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function b5(e){let t=e.length;if(t<2)return"";for(;--t>1&&!k_(e,t););return e.slice(0,t)}function k_(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}x();function rQ(e,t){return e.parent===t.parent?1:2}function C_(e){var t=e.children;return t?t[0]:e.t}function F_(e){var t=e.children;return t?t[t.length-1]:e.t}function iQ(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 oQ(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 aQ(e,t,n){return e.a.parent===t.parent?e.a:n}function z1(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}z1.prototype=Object.create(jo.prototype);function sQ(e){for(var t=new z1(e,0),n,r=[t],i,o,a,s;n=r.pop();)if(o=n._.children)for(n.children=new Array(s=o.length),a=s-1;a>=0;--a)r.push(i=n.children[a]=new z1(o[a],a)),i.parent=n;return(t.parent=new z1(null,0)).children=[t],t}function R_(){var e=rQ,t=1,n=1,r=null;function i(l){var c=sQ(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,m=p-f.x,g=t/(d.x+p+m),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){oQ(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=s(l,d,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,c,f){if(c){for(var d=l,h=l,p=c,m=d.parent.children[0],g=d.m,y=h.m,b=p.m,v=m.m,w;p=F_(p),d=C_(d),p&&d;)m=C_(m),h=F_(h),h.a=l,w=p.z+b-d.z-g+e(p._,d._),w>0&&(iQ(aQ(p,l,f),l,w),g+=w,y+=w),b+=p.m,g+=d.m,v+=m.m,y+=h.m;p&&!F_(h)&&(h.t=p,h.m+=b-y),d&&!C_(m)&&(m.t=d,m.m+=g-v,f=l)}return f}function u(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}x();x();x();function Go(e,t,n,r,i){for(var o=e.children,a,s=-1,u=o.length,l=e.value&&(i-n)/e.value;++s<u;)a=o[s],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var M_=(1+Math.sqrt(5))/2;function $_(e,t,n,r,i,o){for(var a=[],s=t.children,u,l,c=0,f=0,d=s.length,h,p,m=t.value,g,y,b,v,w,E,_;c<d;){h=i-n,p=o-r;do g=s[f++].value;while(!g&&f<d);for(y=b=g,E=Math.max(p/h,h/p)/(m*e),_=g*g*E,w=Math.max(b/_,_/y);f<d;++f){if(g+=l=s[f].value,l<y&&(y=l),l>b&&(b=l),_=g*g*E,v=Math.max(b/_,_/y),v>w){g-=l;break}w=v}a.push(u={value:g,dice:h<p,children:s.slice(c,f)}),u.dice?si(u,n,r,i,m?r+=p*g/m:o):Go(u,n,r,m?n+=h*g/m:i,o),m-=g,c=f}return a}var Jh=(function e(t){function n(r,i,o,a,s){$_(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n})(M_);function T_(){var e=Jh,t=!1,n=1,r=1,i=[0],o=Wo,a=Wo,s=Wo,u=Wo,l=Wo;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(P1),d}function f(d){var h=i[d.depth],p=d.x0+h,m=d.y0+h,g=d.x1-h,y=d.y1-h;g<p&&(p=g=(p+g)/2),y<m&&(m=y=(m+y)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=y,d.children&&(h=i[d.depth+1]=o(d)/2,p+=l(d)-h,m+=a(d)-h,g-=s(d)-h,y-=u(d)-h,g<p&&(p=g=(p+g)/2),y<m&&(m=y=(m+y)/2),e(d,p,m,g,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],r=+d[1],c):[n,r]},c.tile=function(d){return arguments.length?(e=v_(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:os(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:os(+d),c):a},c.paddingRight=function(d){return arguments.length?(s=typeof d=="function"?d:os(+d),c):s},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:os(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:os(+d),c):l},c}x();function D_(e,t,n,r,i){var o=e.children,a,s=o.length,u,l=new Array(s+1);for(l[0]=u=a=0;a<s;++a)l[a+1]=u+=o[a].value;c(0,s,e.value,t,n,r,i);function c(f,d,h,p,m,g,y){if(f>=d-1){var b=o[f];b.x0=p,b.y0=m,b.x1=g,b.y1=y;return}for(var v=l[f],w=h/2+v,E=f+1,_=d-1;E<_;){var S=E+_>>>1;l[S]<w?E=S+1:_=S}w-l[E-1]<l[E]-w&&f+1<E&&--E;var k=l[E]-v,C=h-k;if(g-p>y-m){var M=h?(p*C+g*k)/h:g;c(f,E,k,p,m,M,y),c(E,d,C,M,m,g,y)}else{var R=h?(m*C+y*k)/h:y;c(f,E,k,p,m,g,R),c(E,d,C,p,R,g,y)}}}x();function N_(e,t,n,r,i){(e.depth&1?Go:si)(e,t,n,r,i)}x();var O_=(function e(t){function n(r,i,o,a,s){if((u=r._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,m=r.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?si(l,i,o,a,m?o+=(s-o)*l.value/m:s):Go(l,i,o,m?i+=(a-i)*l.value/m:a,s),m-=l.value}else r._squarify=u=$_(t,r,i,o,a,s),u.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n})(M_);function I_(e,t,n){let r={};return e.each(i=>{let o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function U_(e){N.call(this,null,e)}U_.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};var uQ=e=>e.values;W(U_,N,{transform(e,t){t.source||O("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(a=>{a.children&&Hs(a.data)&&i.rem.push(a.data)}),this.value=o=Cc({values:J(e.keys).reduce((a,s)=>(a.key(s),a),lQ()).entries(i.source)},uQ),n&&o.each(a=>{a.children&&(a=Ce(a.data),i.add.push(a),i.source.push(a))}),I_(o,ue,ue)),i.source.root=o,i}});function lQ(){let e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;let a=i.length,s=e[o++],u={},l={},c=-1,f,d,h;for(;++c<a;)f=s(d=i[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function r(i,o){if(++o>e.length)return i;let a=[];for(let s in i)a.push({key:s,values:r(i[s],o)});return a}return t}function Ho(e){N.call(this,null,e)}var cQ=(e,t)=>e.parent===t.parent?1:2;W(Ho,N,{transform(e,t){(!t.source||!t.source.root)&&O(this.constructor.name+" transform requires a backing tree data source.");let n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(Ii(e.sort,a=>a.data)),fQ(n,this.params,e),n.separation&&n.separation(e.separation!==!1?cQ:$i);try{this.value=n(i)}catch(a){O(a)}return i.each(a=>dQ(a,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function fQ(e,t,n){for(let r,i=0,o=t.length;i<o;++i)r=t[i],r in n&&e[r](n[r])}function dQ(e,t,n){let r=e.data,i=t.length-1;for(let o=0;o<i;++o)r[n[o]]=e[t[o]];r[n[i]]=e.children?e.children.length:0}var P_=["x","y","r","depth","children"];function q_(e){Ho.call(this,e)}q_.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:P_.length,default:P_}]};W(q_,Ho,{layout:S_,params:["radius","size","padding"],fields:P_});var L_=["x0","y0","x1","y1","depth","children"];function j_(e){Ho.call(this,e)}j_.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:L_.length,default:L_}]};W(j_,Ho,{layout:__,params:["size","round","padding"],fields:L_});function W_(e){N.call(this,null,e)}W_.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};W(W_,N,{transform(e,t){t.source||O("Stratify transform requires an upstream data source.");let n=this.value,r=e.modified(),i=t.fork(t.ALL).materialize(t.SOURCE),o=!n||r||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?I_(L1().id(e.key).parentId(e.parentKey)(i.source),e.key,Mt):I_(L1()([{}]),e.key,e.key)),i.source.root=this.value=n,i}});var v5={tidy:R_,cluster:x_},z_=["x","y","depth","children"];function G_(e){Ho.call(this,e)}G_.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:z_.length,default:z_}]};W(G_,Ho,{layout(e){let t=e||"tidy";if(ee(v5,t))return v5[t]();O("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:z_});function H_(e){N.call(this,[],e)}H_.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};W(H_,N,{transform(e,t){let n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||O("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,a=>o[ue(a)]=1),r.each(a=>{let s=a.data,u=a.parent&&a.parent.data;u&&o[ue(s)]&&o[ue(u)]&&i.add.push(Ce({source:u,target:s}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,a=>o[ue(a)]=1),n.forEach(a=>{(o[ue(a.source)]||o[ue(a.target)])&&i.mod.push(a)})),i}});var w5={binary:D_,dice:si,slice:Go,slicedice:N_,squarify:Jh,resquarify:O_},B_=["x0","y0","x1","y1","depth","children"];function Y_(e){Ho.call(this,e)}Y_.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:B_.length,default:B_}]};W(Y_,Ho,{layout(){let e=T_();return e.ratio=t=>{let n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ee(w5,t)?e.tile(w5[t]):O("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:B_});var oA={};Sn(oA,{label:()=>iA});x();var X_=4278190080;function hQ(e,t){let n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function pQ(e,t,n,r,i){let o=e.width,a=e.height,s=r||i,u=Cr(o,a).getContext("2d"),l=Cr(o,a).getContext("2d"),c=s&&Cr(o,a).getContext("2d");n.forEach(k=>B1(u,k,!1)),B1(l,t,!1),s&&B1(c,t,!0);let f=K_(u,o,a),d=K_(l,o,a),h=s&&K_(c,o,a),p=e.bitmap(),m=s&&e.bitmap(),g,y,b,v,w,E,_,S;for(y=0;y<a;++y)for(g=0;g<o;++g)w=y*o+g,E=f[w]&X_,S=d[w]&X_,_=s&&h[w]&X_,(E||_||S)&&(b=e(g),v=e(y),!i&&(E||S)&&p.set(b,v),s&&(E||_)&&m.set(b,v));return[p,m]}function K_(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function B1(e,t,n){if(!t.length)return;let r=t[0].mark.marktype;r==="group"?t.forEach(i=>{i.items.forEach(o=>B1(e,o.items,n))}):Tn[r].draw(e,{items:n?t.map(mQ):t})}function mQ(e){let t=Ys(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}var Yo=5,Ln=31,Zh=32,as=new Uint32Array(Zh+1),ui=new Uint32Array(Zh+1);ui[0]=0;as[0]=~ui[0];for(let e=1;e<=Zh;++e)ui[e]=ui[e-1]<<1|1,as[e]=~ui[e];function gQ(e,t){let n=new Uint32Array(~~((e*t+Zh)/Zh));function r(o,a){n[o]|=a}function i(o,a){n[o]&=a}return{array:n,get:(o,a)=>{let s=a*e+o;return n[s>>>Yo]&1<<(s&Ln)},set:(o,a)=>{let s=a*e+o;r(s>>>Yo,1<<(s&Ln))},clear:(o,a)=>{let s=a*e+o;i(s>>>Yo,~(1<<(s&Ln)))},getRange:(o,a,s,u)=>{let l=u,c,f,d,h;for(;l>=a;--l)if(c=l*e+o,f=l*e+s,d=c>>>Yo,h=f>>>Yo,d===h){if(n[d]&as[c&Ln]&ui[(f&Ln)+1])return!0}else{if(n[d]&as[c&Ln]||n[h]&ui[(f&Ln)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(o,a,s,u)=>{let l,c,f,d,h;for(;a<=u;++a)if(l=a*e+o,c=a*e+s,f=l>>>Yo,d=c>>>Yo,f===d)r(f,as[l&Ln]&ui[(c&Ln)+1]);else for(r(f,as[l&Ln]),r(d,ui[(c&Ln)+1]),h=f+1;h<d;++h)r(h,4294967295)},clearRange:(o,a,s,u)=>{let l,c,f,d,h;for(;a<=u;++a)if(l=a*e+o,c=a*e+s,f=l>>>Yo,d=c>>>Yo,f===d)i(f,ui[l&Ln]|as[(c&Ln)+1]);else for(i(f,ui[l&Ln]),i(d,as[(c&Ln)+1]),h=f+1;h<d;++h)i(h,0)},outOfBounds:(o,a,s,u)=>o<0||a<0||u>=t||s>=e}}function yQ(e,t,n){let r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=s=>~~((s+n)/r);return a.invert=s=>s*r-n,a.bitmap=()=>gQ(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}function xQ(e,t,n,r){let i=e.width,o=e.height;return function(a){let s=a.datum.datum.items[r].items,u=s.length,l=a.datum.fontSize,c=Kn.width(a.datum,a.datum.text),f=0,d,h,p,m,g,y,b;for(let v=0;v<u;++v)d=s[v].x,p=s[v].y,h=s[v].x2===void 0?d:s[v].x2,m=s[v].y2===void 0?p:s[v].y2,g=(d+h)/2,y=(p+m)/2,b=Math.abs(h-d+m-p),b>=f&&(f=b,a.x=g,a.y=y);return g=c/2,y=l/2,d=a.x-g,h=a.x+g,p=a.y-y,m=a.y+y,a.align="center",d<0&&h<=i?a.align="left":0<=d&&i<h&&(a.align="right"),a.baseline="middle",p<0&&m<=o?a.baseline="top":0<=p&&o<m&&(a.baseline="bottom"),!0}}function U1(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function ss(e,t,n,r,i,o,a,s){let u=i*o/(r*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||s&&s.getRange(l,f,c,d)}function bQ(e,t,n,r){let i=e.width,o=e.height,a=t[0],s=t[1];function u(l,c,f,d,h){let p=e.invert(l),m=e.invert(c),g=f,y=o,b;if(!U1(p,m,d,h,i,o)&&!ss(e,p,m,h,d,g,a,s)&&!ss(e,p,m,h,d,h,a,null)){for(;y-g>=1;)b=(g+y)/2,ss(e,p,m,h,d,b,a,s)?y=b:g=b;if(g>f)return[p,m,g,!0]}}return function(l){let c=l.datum.datum.items[r].items,f=c.length,d=l.datum.fontSize,h=Kn.width(l.datum,l.datum.text),p=n?d:0,m=!1,g=!1,y=0,b,v,w,E,_,S,k,C,M,R,P,D,$,F,T,L,q;for(let U=0;U<f;++U){for(b=c[U].x,w=c[U].y,v=c[U].x2===void 0?b:c[U].x2,E=c[U].y2===void 0?w:c[U].y2,b>v&&(q=b,b=v,v=q),w>E&&(q=w,w=E,E=q),M=e(b),P=e(v),R=~~((M+P)/2),D=e(w),F=e(E),$=~~((D+F)/2),k=R;k>=M;--k)for(C=$;C>=D;--C)L=u(k,C,p,h,d),L&&([l.x,l.y,p,m]=L);for(k=R;k<=P;++k)for(C=$;C<=F;++C)L=u(k,C,p,h,d),L&&([l.x,l.y,p,m]=L);!m&&!n&&(T=Math.abs(v-b+E-w),_=(b+v)/2,S=(w+E)/2,T>=y&&!U1(_,S,h,d,i,o)&&!ss(e,_,S,d,h,d,a,null)&&(y=T,l.x=_,l.y=S,g=!0))}return m||g?(_=h/2,S=d/2,a.setRange(e(l.x-_),e(l.y-S),e(l.x+_),e(l.y+S)),l.align="center",l.baseline="middle",!0):!1}}var vQ=[-1,-1,1,1],wQ=[-1,1,-1,1];function EQ(e,t,n,r){let i=e.width,o=e.height,a=t[0],s=t[1],u=e.bitmap();return function(l){let c=l.datum.datum.items[r].items,f=c.length,d=l.datum.fontSize,h=Kn.width(l.datum,l.datum.text),p=[],m=n?d:0,g=!1,y=!1,b=0,v,w,E,_,S,k,C,M,R,P,D,$;for(let F=0;F<f;++F){for(v=c[F].x,E=c[F].y,w=c[F].x2===void 0?v:c[F].x2,_=c[F].y2===void 0?E:c[F].y2,p.push([e((v+w)/2),e((E+_)/2)]);p.length;)if([C,M]=p.pop(),!(a.get(C,M)||s.get(C,M)||u.get(C,M))){u.set(C,M);for(let T=0;T<4;++T)S=C+vQ[T],k=M+wQ[T],u.outOfBounds(S,k,S,k)||p.push([S,k]);if(S=e.invert(C),k=e.invert(M),R=m,P=o,!U1(S,k,h,d,i,o)&&!ss(e,S,k,d,h,R,a,s)&&!ss(e,S,k,d,h,d,a,null)){for(;P-R>=1;)D=(R+P)/2,ss(e,S,k,d,h,D,a,s)?P=D:R=D;R>m&&(l.x=S,l.y=k,m=R,g=!0)}}!g&&!n&&($=Math.abs(w-v+_-E),S=(v+w)/2,k=(E+_)/2,$>=b&&!U1(S,k,h,d,i,o)&&!ss(e,S,k,d,h,d,a,null)&&(b=$,l.x=S,l.y=k,y=!0))}return g||y?(S=h/2,k=d/2,a.setRange(e(l.x-S),e(l.y-k),e(l.x+S),e(l.y+k)),l.align="center",l.baseline="middle",!0):!1}}var SQ=["right","center","left"],_Q=["bottom","middle","top"];function AQ(e,t,n,r){let i=e.width,o=e.height,a=t[0],s=t[1],u=r.length;return function(l){let c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>i||c[3]>o)return!1;let d=l.textWidth??0,h,p,m,g,y,b,v,w,E,_,S,k,C,M,R;for(let P=0;P<u;++P){if(h=(n[P]&3)-1,p=(n[P]>>>2&3)-1,m=h===0&&p===0||r[P]<0,g=h&&p?Math.SQRT1_2:1,y=r[P]<0?-1:1,b=c[1+h]+r[P]*h*g,S=c[4+p]+y*f*p/2+r[P]*p*g,w=S-f/2,E=S+f/2,k=e(b),M=e(w),R=e(E),!d)if(E5(k,k,M,R,a,s,b,b,w,E,c,m))d=Kn.width(l.datum,l.datum.text);else continue;if(_=b+y*d*h/2,b=_-d/2,v=_+d/2,k=e(b),C=e(v),E5(k,C,M,R,a,s,b,v,w,E,c,m))return l.x=h?h*y<0?v:b:_,l.y=p?p*y<0?E:w:S,l.align=SQ[h*y+1],l.baseline=_Q[p*y+1],a.setRange(k,M,C,R),!0}return!1}}function E5(e,t,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}var Q_=0,J_=4,Z_=8,eA=0,tA=1,nA=2,kQ={"top-left":Q_+eA,top:Q_+tA,"top-right":Q_+nA,left:J_+eA,middle:J_+tA,right:J_+nA,"bottom-left":Z_+eA,bottom:Z_+tA,"bottom-right":Z_+nA},CQ={naive:xQ,"reduced-search":bQ,floodfill:EQ};function FQ(e,t,n,r,i,o,a,s,u,l,c){if(!e.length)return e;let f=Math.max(r.length,i.length),d=RQ(r,f),h=MQ(i,f),p=$Q(e[0].datum),m=p==="group"&&e[0].datum.items[u].marktype,g=m==="area",y=TQ(p,m,s,u),b=l===null||l===1/0,v=g&&c==="naive",w=-1,E=-1,_=e.map(M=>{let R=b?Kn.width(M,M.text):void 0;return w=Math.max(w,R),E=Math.max(E,M.fontSize),{datum:M,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(M),textWidth:R}});l=l===null||l===1/0?Math.max(w,E)+Math.max(...r):l;let S=yQ(t[0],t[1],l),k;if(!v){n&&_.sort((P,D)=>n(P.datum,D.datum));let M=!1;for(let P=0;P<h.length&&!M;++P)M=h[P]===5||d[P]<0;let R=(p&&a||g)&&e.map(P=>P.datum);k=o.length||R?pQ(S,R||[],o,M,g):hQ(S,a&&_)}let C=g?CQ[c](S,k,a,u):AQ(S,k,h,d);return _.forEach(M=>M.opacity=+C(M)),_}function RQ(e,t){let n=new Float64Array(t),r=e.length;for(let i=0;i<r;++i)n[i]=e[i]||0;for(let i=r;i<t;++i)n[i]=n[r-1];return n}function MQ(e,t){let n=new Int8Array(t),r=e.length;for(let i=0;i<r;++i)n[i]|=kQ[e[i]];for(let i=r;i<t;++i)n[i]=n[r-1];return n}function $Q(e){return e&&e.mark&&e.mark.marktype}function TQ(e,t,n,r){let i=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{let a=o.datum.items[r].items;return i(a.length?a[n==="start"?0:a.length-1]:{x:NaN,y:NaN})}:o=>{let a=o.datum.bounds;return[a.x1,(a.x1+a.x2)/2,a.x2,a.y1,(a.y1+a.y2)/2,a.y2]}:i}var rA=["x","y","opacity","align","baseline"],S5=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function iA(e){N.call(this,null,e)}iA.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:S5},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:rA.length,default:rA}]};W(iA,N,{transform(e,t){function n(o){let a=e[o];return de(a)&&t.modified(a.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&O("Size parameter should be specified as a [width, height] array.");let i=e.as||rA;return FQ(t.materialize(t.SOURCE).source||[],e.size,e.sort,J(e.offset==null?1:e.offset),J(e.anchor||S5),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{let a=o.datum;a[i[0]]=o.x,a[i[1]]=o.y,a[i[2]]=o.opacity,a[i[3]]=o.align,a[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});var lA={};Sn(lA,{loess:()=>sA,regression:()=>uA});x();function _5(e,t){var n=[],r=function(c){return c(s)},i,o,a,s,u,l;if(t==null)n.push(e);else for(i={},o=0,a=e.length;o<a;++o)s=e[o],u=t.map(r),l=i[u],l||(i[u]=l=[],l.dims=u,n.push(l)),l.push(s);return n}function sA(e){N.call(this,null,e)}sA.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};W(sA,N,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=_5(r,e.groupby),o=(e.groupby||[]).map(Ke),a=o.length,s=e.as||[Ke(e.x),Ke(e.y)],u=[];i.forEach(l=>{Hv(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{let f={};for(let d=0;d<a;++d)f[o[d]]=l.dims[d];f[s[0]]=c[0],f[s[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});var aA={constant:fg,linear:hg,log:qv,exp:jv,pow:Wv,quad:pg,poly:Gv},DQ=(e,t)=>e==="poly"?t:e==="quad"?2:1;function uA(e){N.call(this,null,e)}uA.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(aA)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};W(uA,N,{transform(e,t){let n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){let r=t.materialize(t.SOURCE).source,i=_5(r,e.groupby),o=(e.groupby||[]).map(Ke),a=e.method||"linear",s=e.order==null?3:e.order,u=DQ(a,s),l=e.as||[Ke(e.x),Ke(e.y)],c=aA[a],f=[],d=e.extent;ee(aA,a)||O("Invalid regression method: "+a),d!=null&&a==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}let m=c(h,e.x,e.y,s);if(e.params){f.push(Ce({keys:h.dims,coef:m.coef,rSquared:m.rSquared}));return}let g=d||_n(h,e.x),y=b=>{let v={};for(let w=0;w<o.length;++w)v[o[w]]=h.dims[w];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};a==="linear"||a==="constant"?g.forEach(b=>y([b,m.predict(b)])):Ll(m.predict,g,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});var dA={};Sn(dA,{voronoi:()=>fA});x();x();x();x();x();x();x();var $e=11102230246251565e-32,Ct=134217729,ep=(3+8*$e)*$e;function Ru(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=r[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,s!==0&&(i[h++]=s);f<e&&d<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d]),o=a,s!==0&&(i[h++]=s);for(;f<e;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++f],o=a,s!==0&&(i[h++]=s);for(;d<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++d],o=a,s!==0&&(i[h++]=s);return(o!==0||h===0)&&(i[h++]=o),h}function tp(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function j(e){return new Float64Array(e)}var NQ=(3+16*$e)*$e,OQ=(2+12*$e)*$e,IQ=(9+64*$e)*$e*$e,Rc=j(4),A5=j(8),k5=j(12),C5=j(16),zn=j(4);function PQ(e,t,n,r,i,o,a){let s,u,l,c,f,d,h,p,m,g,y,b,v,w,E,_,S,k,C=e-i,M=n-i,R=t-o,P=r-o;w=C*P,d=Ct*C,h=d-(d-C),p=C-h,d=Ct*P,m=d-(d-P),g=P-m,E=p*g-(w-h*m-p*m-h*g),_=R*M,d=Ct*R,h=d-(d-R),p=R-h,d=Ct*M,m=d-(d-M),g=M-m,S=p*g-(_-h*m-p*m-h*g),y=E-S,f=E-y,Rc[0]=E-(y+f)+(f-S),b=w+y,f=b-w,v=w-(b-f)+(y-f),y=v-_,f=v-y,Rc[1]=v-(y+f)+(f-_),k=b+y,f=k-b,Rc[2]=b-(k-f)+(y-f),Rc[3]=k;let D=tp(4,Rc),$=OQ*a;if(D>=$||-D>=$||(f=e-C,s=e-(C+f)+(f-i),f=n-M,l=n-(M+f)+(f-i),f=t-R,u=t-(R+f)+(f-o),f=r-P,c=r-(P+f)+(f-o),s===0&&u===0&&l===0&&c===0)||($=IQ*a+ep*Math.abs(D),D+=C*c+P*s-(R*l+M*u),D>=$||-D>=$))return D;w=s*P,d=Ct*s,h=d-(d-s),p=s-h,d=Ct*P,m=d-(d-P),g=P-m,E=p*g-(w-h*m-p*m-h*g),_=u*M,d=Ct*u,h=d-(d-u),p=u-h,d=Ct*M,m=d-(d-M),g=M-m,S=p*g-(_-h*m-p*m-h*g),y=E-S,f=E-y,zn[0]=E-(y+f)+(f-S),b=w+y,f=b-w,v=w-(b-f)+(y-f),y=v-_,f=v-y,zn[1]=v-(y+f)+(f-_),k=b+y,f=k-b,zn[2]=b-(k-f)+(y-f),zn[3]=k;let F=Ru(4,Rc,4,zn,A5);w=C*c,d=Ct*C,h=d-(d-C),p=C-h,d=Ct*c,m=d-(d-c),g=c-m,E=p*g-(w-h*m-p*m-h*g),_=R*l,d=Ct*R,h=d-(d-R),p=R-h,d=Ct*l,m=d-(d-l),g=l-m,S=p*g-(_-h*m-p*m-h*g),y=E-S,f=E-y,zn[0]=E-(y+f)+(f-S),b=w+y,f=b-w,v=w-(b-f)+(y-f),y=v-_,f=v-y,zn[1]=v-(y+f)+(f-_),k=b+y,f=k-b,zn[2]=b-(k-f)+(y-f),zn[3]=k;let T=Ru(F,A5,4,zn,k5);w=s*c,d=Ct*s,h=d-(d-s),p=s-h,d=Ct*c,m=d-(d-c),g=c-m,E=p*g-(w-h*m-p*m-h*g),_=u*l,d=Ct*u,h=d-(d-u),p=u-h,d=Ct*l,m=d-(d-l),g=l-m,S=p*g-(_-h*m-p*m-h*g),y=E-S,f=E-y,zn[0]=E-(y+f)+(f-S),b=w+y,f=b-w,v=w-(b-f)+(y-f),y=v-_,f=v-y,zn[1]=v-(y+f)+(f-_),k=b+y,f=k-b,zn[2]=b-(k-f)+(y-f),zn[3]=k;let L=Ru(T,k5,4,zn,C5);return C5[L-1]}function Mc(e,t,n,r,i,o){let a=(t-o)*(n-i),s=(e-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=NQ*l?u:-PQ(e,t,n,r,i,o,l)}x();var MNe=(7+56*$e)*$e,$Ne=(3+28*$e)*$e,TNe=(26+288*$e)*$e*$e,DNe=j(4),NNe=j(4),ONe=j(4),INe=j(4),PNe=j(4),LNe=j(4),zNe=j(4),BNe=j(4),UNe=j(4),qNe=j(8),jNe=j(8),WNe=j(8),GNe=j(4),HNe=j(8),YNe=j(8),VNe=j(8),XNe=j(12),KNe=j(192),QNe=j(192);x();var tOe=(10+96*$e)*$e,nOe=(4+48*$e)*$e,rOe=(44+576*$e)*$e*$e,iOe=j(4),oOe=j(4),aOe=j(4),sOe=j(4),uOe=j(4),lOe=j(4),cOe=j(4),fOe=j(4),dOe=j(8),hOe=j(8),pOe=j(8),mOe=j(8),gOe=j(8),yOe=j(8),xOe=j(8),bOe=j(8),vOe=j(8),wOe=j(4),EOe=j(4),SOe=j(4),_Oe=j(8),AOe=j(16),kOe=j(16),COe=j(16),FOe=j(32),ROe=j(32),MOe=j(48),$Oe=j(64),TOe=j(1152),DOe=j(1152);x();var LOe=(16+224*$e)*$e,zOe=(5+72*$e)*$e,BOe=(71+1408*$e)*$e*$e,UOe=j(4),qOe=j(4),jOe=j(4),WOe=j(4),GOe=j(4),HOe=j(4),YOe=j(4),VOe=j(4),XOe=j(4),KOe=j(4),QOe=j(24),JOe=j(24),ZOe=j(24),eIe=j(24),tIe=j(24),nIe=j(24),rIe=j(24),iIe=j(24),oIe=j(24),aIe=j(24),sIe=j(1152),uIe=j(1152),lIe=j(1152),cIe=j(1152),fIe=j(1152),dIe=j(2304),hIe=j(2304),pIe=j(3456),mIe=j(5760),gIe=j(8),yIe=j(8),xIe=j(8),bIe=j(16),vIe=j(24),wIe=j(48),EIe=j(48),SIe=j(96),_Ie=j(192),AIe=j(384),kIe=j(384),CIe=j(384),FIe=j(768);var RIe=j(96),MIe=j(96),$Ie=j(96),TIe=j(1152);var R5=Math.pow(2,-52),q1=new Uint32Array(512),Tc=class e{static from(t,n=jQ,r=WQ){let i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){let s=t[a];o[2*a]=n(s),o[2*a+1]=r(s)}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,a=t.length>>1,s=1/0,u=1/0,l=-1/0,c=-1/0;for(let C=0;C<a;C++){let M=t[2*C],R=t[2*C+1];M<s&&(s=M),R<u&&(u=R),M>l&&(l=M),R>c&&(c=R),this._ids[C]=C}let f=(s+l)/2,d=(u+c)/2,h,p,m;for(let C=0,M=1/0;C<a;C++){let R=cA(f,d,t[2*C],t[2*C+1]);R<M&&(h=C,M=R)}let g=t[2*h],y=t[2*h+1];for(let C=0,M=1/0;C<a;C++){if(C===h)continue;let R=cA(g,y,t[2*C],t[2*C+1]);R<M&&R>0&&(p=C,M=R)}let b=t[2*p],v=t[2*p+1],w=1/0;for(let C=0;C<a;C++){if(C===h||C===p)continue;let M=UQ(g,y,b,v,t[2*C],t[2*C+1]);M<w&&(m=C,w=M)}let E=t[2*m],_=t[2*m+1];if(w===1/0){for(let R=0;R<a;R++)this._dists[R]=t[2*R]-t[0]||t[2*R+1]-t[1];$c(this._ids,this._dists,0,a-1);let C=new Uint32Array(a),M=0;for(let R=0,P=-1/0;R<a;R++){let D=this._ids[R],$=this._dists[D];$>P&&(C[M++]=D,P=$)}this.hull=C.subarray(0,M),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Mc(g,y,b,v,E,_)<0){let C=p,M=b,R=v;p=m,b=E,v=_,m=C,E=M,_=R}let S=qQ(g,y,b,v,E,_);this._cx=S.x,this._cy=S.y;for(let C=0;C<a;C++)this._dists[C]=cA(t[2*C],t[2*C+1],S.x,S.y);$c(this._ids,this._dists,0,a-1),this._hullStart=h;let k=3;r[h]=n[m]=p,r[p]=n[h]=m,r[m]=n[p]=h,i[h]=0,i[p]=1,i[m]=2,o.fill(-1),o[this._hashKey(g,y)]=h,o[this._hashKey(b,v)]=p,o[this._hashKey(E,_)]=m,this.trianglesLen=0,this._addTriangle(h,p,m,-1,-1,-1);for(let C=0,M,R;C<this._ids.length;C++){let P=this._ids[C],D=t[2*P],$=t[2*P+1];if(C>0&&Math.abs(D-M)<=R5&&Math.abs($-R)<=R5||(M=D,R=$,P===h||P===p||P===m))continue;let F=0;for(let oe=0,pe=this._hashKey(D,$);oe<this._hashSize&&(F=o[(pe+oe)%this._hashSize],!(F!==-1&&F!==r[F]));oe++);F=n[F];let T=F,L;for(;L=r[T],Mc(D,$,t[2*T],t[2*T+1],t[2*L],t[2*L+1])>=0;)if(T=L,T===F){T=-1;break}if(T===-1)continue;let q=this._addTriangle(T,P,r[T],-1,-1,i[T]);i[P]=this._legalize(q+2),i[T]=q,k++;let U=r[T];for(;L=r[U],Mc(D,$,t[2*U],t[2*U+1],t[2*L],t[2*L+1])<0;)q=this._addTriangle(U,P,L,i[P],-1,i[U]),i[P]=this._legalize(q+2),r[U]=U,k--,U=L;if(T===F)for(;L=n[T],Mc(D,$,t[2*L],t[2*L+1],t[2*T],t[2*T+1])<0;)q=this._addTriangle(L,P,T,-1,i[T],i[L]),this._legalize(q+2),i[L]=q,r[T]=T,k--,T=L;this._hullStart=n[P]=T,r[T]=n[U]=P,r[P]=U,o[this._hashKey(D,$)]=P,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(k);for(let C=0,M=this._hullStart;C<k;C++)this.hull[C]=M,M=r[M];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(zQ(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:n,_halfedges:r,coords:i}=this,o=0,a=0;for(;;){let s=r[t],u=t-t%3;if(a=u+(t+2)%3,s===-1){if(o===0)break;t=q1[--o];continue}let l=s-s%3,c=u+(t+1)%3,f=l+(s+2)%3,d=n[a],h=n[t],p=n[c],m=n[f];if(BQ(i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[s]=d;let y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(s,r[a]),this._link(a,f);let b=l+(s+1)%3;o<q1.length&&(q1[o++]=b)}else{if(o===0)break;t=q1[--o]}}return a}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,a){let s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}};function zQ(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function cA(e,t,n,r){let i=e-n,o=t-r;return i*i+o*o}function BQ(e,t,n,r,i,o,a,s){let u=e-a,l=t-s,c=n-a,f=r-s,d=i-a,h=o-s,p=u*u+l*l,m=c*c+f*f,g=d*d+h*h;return u*(f*g-m*h)-l*(c*g-m*d)+p*(c*h-f*d)<0}function UQ(e,t,n,r,i,o){let a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u),h=(l*c-s*f)*d,p=(a*f-u*c)*d;return h*h+p*p}function qQ(e,t,n,r,i,o){let a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,f=u*u+l*l,d=.5/(a*l-s*u),h=e+(l*c-s*f)*d,p=t+(a*f-u*c)*d;return{x:h,y:p}}function $c(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let o=e[i],a=t[o],s=i-1;for(;s>=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{let i=n+r>>1,o=n+1,a=r;np(e,i,o),t[e[n]]>t[e[r]]&&np(e,n,r),t[e[o]]>t[e[r]]&&np(e,o,r),t[e[n]]>t[e[o]]&&np(e,n,o);let s=e[o],u=t[s];for(;;){do o++;while(t[e[o]]<u);do a--;while(t[e[a]]>u);if(a<o)break;np(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?($c(e,t,o,r),$c(e,t,n,a-1)):($c(e,t,n,a-1),$c(e,t,o,r))}}function np(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function jQ(e){return e[0]}function WQ(e){return e[1]}x();var Nr=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}};x();var us=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}};x();var rp=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,a,s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,b,v;m<y;m+=3,g+=2){let w=r[m]*2,E=r[m+1]*2,_=r[m+2]*2,S=t[w],k=t[w+1],C=t[E],M=t[E+1],R=t[_],P=t[_+1],D=C-S,$=M-k,F=R-S,T=P-k,L=(D*T-$*F)*2;if(Math.abs(L)<1e-9){if(o===void 0){o=a=0;for(let U of n)o+=t[U*2],a+=t[U*2+1];o/=n.length,a/=n.length}let q=1e9*Math.sign((o-S)*T-(a-k)*F);b=(S+R)/2-q*T,v=(k+P)/2+q*F}else{let q=1/L,U=D*D+$*$,oe=F*F+T*T;b=S+(T*U-$*oe)*q,v=k+(D*oe-F*U)*q}s[g]=b,s[g+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];i.fill(0);for(let m=0;m<n.length;++m)u=n[m],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],i[l+2]=i[c]=h-p,i[l+3]=i[c+1]=d-f}render(t){let n=t==null?t=new Nr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){let d=r[c];if(d<c)continue;let h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,m=a[h],g=a[h+1],y=a[p],b=a[p+1];this._renderSegment(m,g,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];let f=Math.floor(i[l]/3)*2,d=a[f],h=a[f+1],p=u*4,m=this._project(d,h,s[p+2],s[p+3]);m&&this._renderSegment(d,h,m[0],m[1],t)}return n&&n.value()}renderBounds(t){let n=t==null?t=new Nr: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 Nr: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 a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+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 us;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let a,s=this._regioncode(t,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(t,n),o.lineTo(r,i)):(a=this._clipSegment(t,n,r,i,s,u))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[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){e:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){yield r;break e}}}}_cell(t){let{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[t];if(a===-1)return null;let s=[],u=a;do{let l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=i[u]}while(u!==a&&u!==-1);return s}_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,a,s=n[r-2],u=n[r-1],l,c=this._regioncode(s,u),f,d=0;for(let h=0;h<r;h+=2)if(o=s,a=u,s=n[h],u=n[h+1],l=c,c=this._regioncode(s,u),l===0&&c===0)f=d,d=0,i?i.push(s,u):i=[s,u];else{let p,m,g,y,b;if(l===0){if((p=this._clipSegment(o,a,s,u,l,c))===null)continue;[m,g,y,b]=p}else{if((p=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,b,m,g]=p,f=d,d=this._edgecode(m,g),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(m,g):i=[m,g]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=d,d=this._edgecode(i[0],i[1]),f&&d&&this._edge(t,f,d,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,a){let s=o<a;for(s&&([t,n,r,i,o,a]=[r,i,t,n,a,o]);;){if(o===0&&a===0)return s?[r,i,t,n]:[t,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-t)/(r-t),u=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(t,s))for(let l=0,c=s.length,f,d=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)f=d,d=this._edgecode(s[l],s[l+1]),f&&d&&(l=this._edge(t,f,d,s,l),c=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(t,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(t,n,r,i){let o=1/0,a,s,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=t+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=this.ymax,s=t+(o=a)*r)}if(r>0){if(t>=this.xmax)return null;(a=(this.xmax-t)/r)<o&&(s=this.xmax,u=n+(o=a)*i)}else if(r<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_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 GQ=2*Math.PI,Dc=Math.pow;function HQ(e){return e[0]}function YQ(e){return e[1]}function VQ(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],a=2*t[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function XQ(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var Nc=class e{static from(t,n=HQ,r=YQ,i){return new e("length"in t?KQ(t,n,r,i):Float64Array.from(QQ(t,n,r,i)))}constructor(t){this._delaunator=new Tc(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&&VQ(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);let u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){let p=XQ(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new Tc(n)}else delete this.collinear;let r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let u=0,l=r.length;u<l;++u){let c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;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],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new rp(this,t)}*neighbors(t){let{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){let f=s.indexOf(t);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}let u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==t)return;if(l=o[l],l===-1){let f=r[(i[t]+1)%r.length];f!==c&&(yield f);return}}while(l!==u)}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:a,halfedges:s,triangles:u,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Dc(n-l[t*2],2)+Dc(r-l[t*2+1],2),d=i[t],h=d;do{let p=u[h],m=Dc(n-l[p*2],2)+Dc(r-l[p*2+1],2);if(m<f&&(f=m,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=s[h],h===-1){if(h=o[(a[t]+1)%o.length],h!==p&&Dc(n-l[h*2],2)+Dc(r-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){let n=t==null?t=new Nr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){let u=i[a];if(u<a)continue;let l=o[a]*2,c=o[u]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[c],r[c+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 Nr:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){let s=i[o],u=i[o+1];t.moveTo(s+n,u),t.arc(s,u,n,0,GQ)}return r&&r.value()}renderHull(t){let n=t==null?t=new Nr:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;t.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){let u=2*r[s];t.lineTo(i[u],i[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){let t=new us;return this.renderHull(t),t.value()}renderTriangle(t,n){let r=n==null?n=new Nr:void 0,{points:i,triangles:o}=this,a=o[t*=3]*2,s=o[t+1]*2,u=o[t+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+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 us;return this.renderTriangle(t,n),n.value()}};function KQ(e,t,n,r){let i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){let s=e[a];o[a*2]=t.call(r,s,a,e),o[a*2+1]=n.call(r,s,a,e)}return o}function*QQ(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 fA(e){N.call(this,null,e)}fA.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};var JQ=[-1e5,-1e5,1e5,1e5];W(fA,N,{transform(e,t){let n=e.as||"path",r=t.source;if(!r||!r.length)return t;let i=e.size;i=i?[0,0,i[0],i[1]]:(i=e.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:JQ;let o=this.value=Nc.from(r,e.x,e.y).voronoi(i);for(let a=0,s=r.length;a<s;++a){let u=o.cellPolygon(a);r[a][n]=u&&!eJ(u)?ZQ(u):null}return t.reflow(e.modified()).modifies(n)}});function ZQ(e){let t=e[0][0],n=e[0][1],r=e.length-1;for(;e[r][0]===t&&e[r][1]===n;--r);return"M"+e.slice(0,r+1).join("L")+"Z"}function eJ(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}var mA={};Sn(mA,{wordcloud:()=>pA});x();var hA=Math.PI/180,ip=64,j1=2048;function tJ(){var e=[256,256],t,n,r,i,o,a,s,u=M5,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(Cr()),m=sJ((e[0]>>5)*e[1]),g=null,y=l.length,b=-1,v=[],w=l.map(_=>({text:t(_),font:n(_),style:i(_),weight:o(_),rotate:a(_),size:~~(r(_)+1e-14),padding:s(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,S)=>S.size-_.size);++b<y;){var E=w[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,nJ(p,E,w,b),E.hasText&&h(m,E,g)&&(v.push(E),g?iJ(g,E):g=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var m=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(ip<<5)/m,p.height=j1/m;var g=p.getContext("2d");return g.fillStyle=g.strokeStyle="red",g.textAlign="center",{context:g,ratio:m}}function h(p,m,g){for(var y=m.x,b=m.y,v=Math.hypot(e[0],e[1]),w=u(e),E=c()<.5?1:-1,_=-E,S,k,C;(S=w(_+=E))&&(k=~~S[0],C=~~S[1],!(Math.min(Math.abs(k),Math.abs(C))>=v));)if(m.x=y+k,m.y=b+C,!(m.x+m.x0<0||m.y+m.y0<0||m.x+m.x1>e[0]||m.y+m.y1>e[1])&&(!g||!rJ(m,p,e[0]))&&(!g||oJ(m,g))){for(var M=m.sprite,R=m.width>>5,P=e[0]>>5,D=m.x-(R<<4),$=D&127,F=32-$,T=m.y1-m.y0,L=(m.y+m.y0)*P+(D>>5),q,U=0;U<T;U++){q=0;for(var oe=0;oe<=R;oe++)p[L+oe]|=q<<F|(oe<R?(q=M[U*R+oe])>>>$:0);L+=P}return m.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Mu(p),f):n},f.fontStyle=function(p){return arguments.length?(i=Mu(p),f):i},f.fontWeight=function(p){return arguments.length?(o=Mu(p),f):o},f.rotate=function(p){return arguments.length?(a=Mu(p),f):a},f.text=function(p){return arguments.length?(t=Mu(p),f):t},f.spiral=function(p){return arguments.length?(u=uJ[p]||p,f):u},f.fontSize=function(p){return arguments.length?(r=Mu(p),f):r},f.padding=function(p){return arguments.length?(s=Mu(p),f):s},f.random=function(p){return arguments.length?(c=p,f):c},f}function nJ(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(ip<<5)/o,j1/o);var a=0,s=0,u=0,l=n.length,c,f,d,h,p;for(--r;++r<l;){if(t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=i.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var m=Math.sin(t.rotate*hA),g=Math.cos(t.rotate*hA),y=c*g,b=c*m,v=d*g,w=d*m;c=Math.max(Math.abs(y+w),Math.abs(y-w))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),a+c>=ip<<5&&(a=0,s+=u,u=0),s+d>=j1)break;i.translate((a+(c>>1))/o,(s+(d>>1))/o),t.rotate&&i.rotate(t.rotate*hA),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=c,t.height=d,t.xoff=a,t.yoff=s,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=c}for(var E=i.getImageData(0,0,(ip<<5)/o,j1/o).data,_=[];--r>=0;)if(t=n[r],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)_[h]=0;if(a=t.xoff,a==null)return;s=t.yoff;var S=0,k=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var C=f*p+(h>>5),M=E[(s+p)*(ip<<5)+(a+h)<<2]?1<<31-h%32:0;_[C]|=M,S|=M}S?k=p:(t.y0++,d--,p--,s++)}t.y1=t.y0+k,t.sprite=_.slice(0,(t.y1-t.y0)*f)}}}function rJ(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),a=o&127,s=32-a,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=i;d++)if((c<<s|(d<i?(c=r[f*i+d])>>>a:0))&t[l+d])return!0;l+=n}return!1}function iJ(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function oJ(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function M5(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function aJ(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(o){var a=o<0?-1:1;switch(Math.sqrt(1+4*a*o)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function sJ(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Mu(e){return typeof e=="function"?e:function(){return e}}var uJ={archimedean:M5,rectangular:aJ},$5=["x","y","font","fontSize","fontStyle","fontWeight","angle"],lJ=["text","font","rotate","fontSize","fontStyle","fontWeight"];function pA(e){N.call(this,tJ(),e)}pA.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:$5}]};W(pA,N,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&O("Wordcloud size dimensions must be non-zero.");function n(p){let m=e[p];return de(m)&&t.modified(m.fields)}let r=e.modified();if(!(r||t.changed(t.ADD_REM)||lJ.some(n)))return;let i=t.materialize(t.SOURCE).source,o=this.value,a=e.as||$5,s=e.fontSize||14,u;if(de(s)?u=e.fontSizeRange:s=tt(s),u){let p=s,m=Fe("sqrt")().domain(_n(i,p)).range(u);s=g=>m(p(g))}i.forEach(p=>{p[a[0]]=NaN,p[a[1]]=NaN,p[a[3]]=0});let l=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(Mn).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,m,g;p<h;++p)m=l[p],g=m.datum,g[a[0]]=m.x+f,g[a[1]]=m.y+d,g[a[2]]=m.font,g[a[3]]=m.size,g[a[4]]=m.style,g[a[5]]=m.weight,g[a[6]]=m.rotate;return t.reflow(r).modifies(a)}});var xA={};Sn(xA,{crossfilter:()=>gA,resolvefilter:()=>yA});x();var cJ=e=>new Uint8Array(e),fJ=e=>new Uint16Array(e),op=e=>new Uint32Array(e);function dJ(){let e=8,t=[],n=op(0),r=W1(0,e),i=W1(0,e);return{data:()=>t,seen:()=>n=hJ(n,t.length),add(o){for(let a=0,s=t.length,u=o.length,l;a<u;++a)l=o[a],l._index=s++,t.push(l)},remove(o,a){let s=t.length,u=Array(s-o),l=t,c,f,d;for(f=0;!a[f]&&f<s;++f)u[f]=t[f],l[f]=f;for(d=f;f<s;++f)c=t[f],a[f]?l[f]=-1:(l[f]=d,r[d]=r[f],i[d]=i[f],u[d]=c,c._index=d++),r[f]=0;return t=u,l},size:()=>t.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,a){r[o]|=a},clear(o,a){r[o]&=~a},resize(o,a){let s=r.length;(o>s||a>e)&&(e=Math.max(a,e),r=W1(o,e,r),i=W1(o,e))}}}function hJ(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function W1(e,t,n){let r=(t<257?cJ:t<65537?fJ:op)(e);return n&&r.set(n),r}function T5(e,t,n){let r=1<<t;return{one:r,zero:~r,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(i,o){let a=this,s=a.bisect(a.range,i.value),u=i.index,l=s[0],c=s[1],f=u.length,d;for(d=0;d<l;++d)o[u[d]]|=r;for(d=c;d<f;++d)o[u[d]]|=r;return a}}}function D5(){let e=op(0),t=[],n=0;function r(s,u,l){if(!u.length)return[];let c=n,f=u.length,d=op(f),h=Array(f),p,m,g;for(g=0;g<f;++g)h[g]=s(u[g]),d[g]=g;if(h=pJ(h,d),c)p=t,m=e,t=Array(c+f),e=op(c+f),mJ(l,p,m,c,h,d,f,t,e);else{if(l>0)for(g=0;g<f;++g)d[g]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function i(s,u){let l=n,c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-s}function o(s){for(let u=0,l=n;u<l;++u)e[u]=s[e[u]]}function a(s,u){let l;return u?l=u.length:(u=t,l=n),[Bb(u,s[0],0,l),Os(u,s[1],0,l)]}return{insert:r,remove:i,bisect:a,reindex:o,index:()=>e,size:()=>n}}function pJ(e,t){return e.sort.call(t,(n,r)=>{let i=e[n],o=e[r];return i<o?-1:i>o?1:0}),km(e,t)}function mJ(e,t,n,r,i,o,a,s,u){let l=0,c=0,f;for(f=0;l<r&&c<a;++f)t[l]<i[c]?(s[f]=t[l],u[f]=n[l++]):(s[f]=i[c],u[f]=o[c++]+e);for(;l<r;++l,++f)s[f]=t[l],u[f]=n[l];for(;c<a;++c,++f)s[f]=i[c],u[f]=o[c]+e}function gA(e){N.call(this,dJ(),e),this._indices=null,this._dims=null}gA.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};W(gA,N,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(r=>t.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){let n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length,s=0,u,l;for(;s<a;++s)u=n[s].fname,l=i[u]||(i[u]=D5()),o.push(T5(l,s,r[s]));return this.eval(e,t)},reinit(e,t){let n=t.materialize().fork(),r=e.fields,i=e.query,o=this._indices,a=this._dims,s=this.value,u=s.curr(),l=s.prev(),c=s.all(),f=n.rem=n.add,d=n.mod,h=i.length,p={},m,g,y,b,v,w,E,_,S;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&s.add(t.add),t.mod.length)for(w={},b=t.mod,E=0,_=b.length;E<_;++E)w[b[E]._index]=1;for(E=0;E<h;++E)S=r[E],(!a[E]||e.modified("fields",E)||t.modified(S.fields))&&(y=S.fname,(m=p[y])||(o[y]=g=D5(),p[y]=m=g.insert(S,t.source,0)),a[E]=T5(g,E,i[E]).onAdd(m,u));for(E=0,_=s.data().length;E<_;++E)v[E]||(l[E]!==u[E]?f.push(E):w[E]&&u[E]!==c&&d.push(E));return s.mask=(1<<h)-1,n},eval(e,t){let n=t.materialize().fork(),r=this._dims.length,i=0;return t.rem.length&&(this.remove(e,t,n),i|=(1<<r)-1),e.modified("query")&&!e.modified("fields")&&(i|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),i|=(1<<r)-1),t.mod.length&&(this.modify(t,n),i|=(1<<r)-1),this.value.mask=i,n},insert(e,t,n){let r=t.add,i=this.value,o=this._dims,a=this._indices,s=e.fields,u={},l=n.add,c=i.size()+r.length,f=o.length,d=i.size(),h,p,m;i.resize(c,f),i.add(r);let g=i.curr(),y=i.prev(),b=i.all();for(h=0;h<f;++h)p=s[h].fname,m=u[p]||(u[p]=a[p].insert(s[h],r,d)),o[h].onAdd(m,g);for(;d<c;++d)y[d]=b,g[d]!==b&&l.push(d)},modify(e,t){let n=t.mod,r=this.value,i=r.curr(),o=r.all(),a=e.mod,s,u,l;for(s=0,u=a.length;s<u;++s)l=a[s]._index,i[l]!==o&&n.push(l)},remove(e,t,n){let r=this._indices,i=this.value,o=i.curr(),a=i.prev(),s=i.all(),u={},l=n.rem,c=t.rem,f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&l.push(h);for(h in r)r[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){let r=this._indices,i=this.value;e.runAfter(()=>{let o=i.remove(t,n);for(let a in r)r[a].reindex(o)})},update(e,t,n){let r=this._dims,i=e.query,o=t.stamp,a=r.length,s=0,u,l;for(n.filters=0,l=0;l<a;++l)e.modified("query",l)&&(u=l,++s);if(s===1)s=r[u].one,this.incrementOne(r[u],i[u],n.add,n.rem);else for(l=0,s=0;l<a;++l)e.modified("query",l)&&(s|=r[l].one,this.incrementAll(r[l],i[l],o,n.add),n.rem=n.add);return s},incrementAll(e,t,n,r){let i=this.value,o=i.seen(),a=i.curr(),s=i.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],m=e.one,g,y,b;if(f<h)for(g=f,y=Math.min(h,d);g<y;++g)b=u[g],o[b]!==n&&(s[b]=a[b],o[b]=n,r.push(b)),a[b]^=m;else if(f>h)for(g=h,y=Math.min(f,p);g<y;++g)b=u[g],o[b]!==n&&(s[b]=a[b],o[b]=n,r.push(b)),a[b]^=m;if(d>p)for(g=Math.max(f,p),y=d;g<y;++g)b=u[g],o[b]!==n&&(s[b]=a[b],o[b]=n,r.push(b)),a[b]^=m;else if(d<p)for(g=Math.max(h,d),y=p;g<y;++g)b=u[g],o[b]!==n&&(s[b]=a[b],o[b]=n,r.push(b)),a[b]^=m;e.range=t.slice()},incrementOne(e,t,n,r){let i=this.value,o=i.curr(),a=e.index(),s=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=s[0],d=s[1],h=e.one,p,m,g;if(l<f)for(p=l,m=Math.min(f,c);p<m;++p)g=a[p],o[g]^=h,n.push(g);else if(l>f)for(p=f,m=Math.min(l,d);p<m;++p)g=a[p],o[g]^=h,r.push(g);if(c>d)for(p=Math.max(l,d),m=c;p<m;++p)g=a[p],o[g]^=h,n.push(g);else if(c<d)for(p=Math.max(f,c),m=d;p<m;++p)g=a[p],o[g]^=h,r.push(g);e.range=t.slice()}});function yA(e){N.call(this,null,e)}yA.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};W(yA,N,{transform(e,t){let n=~(e.ignore||0),r=e.filter,i=r.mask;if((i&n)===0)return t.StopPropagation;let o=t.fork(t.ALL),a=r.data(),s=r.curr(),u=r.prev(),l=c=>s[c]&n?null:a[c];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,c=>{let f=s[c]&n;return!f&&f^u[c]&n?a[c]:null}),o.filter(o.REM,c=>{let f=s[c]&n;return f&&!(f^(f^u[c]&n))?a[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(s[c]&n)===i?a[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});x();x();x();var gJ="RawCode",Xo="Literal",yJ="Property",xJ="Identifier",bJ="ArrayExpression",vJ="BinaryExpression",_A="CallExpression",wJ="ConditionalExpression",EJ="LogicalExpression",SJ="MemberExpression",_J="ObjectExpression",AJ="UnaryExpression";function li(e){this.type=e}li.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=kJ(this),n=0,r=t.length;n<r;++n)if(t[n].visit(e))return 1};function kJ(e){switch(e.type){case bJ:return e.elements;case vJ:case EJ:return[e.left,e.right];case _A:return[e.callee].concat(e.arguments);case wJ:return[e.test,e.consequent,e.alternate];case SJ:return[e.object,e.property];case _J:return e.properties;case yJ:return[e.key,e.value];case AJ:return[e.argument];case xJ:case Xo:case gJ:default:return[]}}var Qi,se,B,vn,Be,Y1=1,cp=2,$u=3,ls=4,V1=5,Du=6,Zn=7,fp=8,CJ=9;Qi={};Qi[Y1]="Boolean";Qi[cp]="<end>";Qi[$u]="Identifier";Qi[ls]="Keyword";Qi[V1]="Null";Qi[Du]="Numeric";Qi[Zn]="Punctuator";Qi[fp]="String";Qi[CJ]="RegularExpression";var FJ="ArrayExpression",RJ="BinaryExpression",MJ="CallExpression",$J="ConditionalExpression",U5="Identifier",TJ="Literal",DJ="LogicalExpression",NJ="MemberExpression",OJ="ObjectExpression",IJ="Property",PJ="UnaryExpression",Wt="Unexpected token %0",LJ="Unexpected number",zJ="Unexpected string",BJ="Unexpected identifier",UJ="Unexpected reserved word",qJ="Unexpected end of input",EA="Invalid regular expression",bA="Invalid regular expression: missing /",q5="Octal literals are not allowed in strict mode.",jJ="Duplicate data property in object literal not allowed in strict mode",rn="ILLEGAL",up="Disabled.",WJ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),GJ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function X1(e,t){if(!e)throw new Error("ASSERT: "+t)}function Vo(e){return e>=48&&e<=57}function AA(e){return"0123456789abcdefABCDEF".includes(e)}function sp(e){return"01234567".includes(e)}function HJ(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function lp(e){return e===10||e===13||e===8232||e===8233}function dp(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&WJ.test(String.fromCharCode(e))}function H1(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&GJ.test(String.fromCharCode(e))}var YJ={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function j5(){for(;B<vn;){let e=se.charCodeAt(B);if(HJ(e)||lp(e))++B;else break}}function SA(e){var t,n,r,i=0;for(n=e==="u"?4:2,t=0;t<n;++t)B<vn&&AA(se[B])?(r=se[B++],i=i*16+"0123456789abcdef".indexOf(r.toLowerCase())):Ne({},Wt,rn);return String.fromCharCode(i)}function VJ(){var e,t,n,r;for(e=se[B],t=0,e==="}"&&Ne({},Wt,rn);B<vn&&(e=se[B++],!!AA(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ne({},Wt,rn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function W5(){var e,t;for(e=se.charCodeAt(B++),t=String.fromCharCode(e),e===92&&(se.charCodeAt(B)!==117&&Ne({},Wt,rn),++B,e=SA("u"),(!e||e==="\\"||!dp(e.charCodeAt(0)))&&Ne({},Wt,rn),t=e);B<vn&&(e=se.charCodeAt(B),!!H1(e));)++B,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),se.charCodeAt(B)!==117&&Ne({},Wt,rn),++B,e=SA("u"),(!e||e==="\\"||!H1(e.charCodeAt(0)))&&Ne({},Wt,rn),t+=e);return t}function XJ(){var e,t;for(e=B++;B<vn;){if(t=se.charCodeAt(B),t===92)return B=e,W5();if(H1(t))++B;else break}return se.slice(e,B)}function KJ(){var e,t,n;return e=B,t=se.charCodeAt(B)===92?W5():XJ(),t.length===1?n=$u:YJ.hasOwnProperty(t)?n=ls:t==="null"?n=V1:t==="true"||t==="false"?n=Y1:n=$u,{type:n,value:t,start:e,end:B}}function vA(){var e=B,t=se.charCodeAt(B),n,r=se[B],i,o,a;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++B,{type:Zn,value:String.fromCharCode(t),start:e,end:B};default:if(n=se.charCodeAt(B+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return B+=2,{type:Zn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:B};case 33:case 61:return B+=2,se.charCodeAt(B)===61&&++B,{type:Zn,value:se.slice(e,B),start:e,end:B}}}if(a=se.substr(B,4),a===">>>=")return B+=4,{type:Zn,value:a,start:e,end:B};if(o=a.substr(0,3),o===">>>"||o==="<<="||o===">>=")return B+=3,{type:Zn,value:o,start:e,end:B};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return B+=2,{type:Zn,value:i,start:e,end:B};if(i==="//"&&Ne({},Wt,rn),"<>=!+-*%&|^/".includes(r))return++B,{type:Zn,value:r,start:e,end:B};Ne({},Wt,rn)}function QJ(e){let t="";for(;B<vn&&AA(se[B]);)t+=se[B++];return t.length===0&&Ne({},Wt,rn),dp(se.charCodeAt(B))&&Ne({},Wt,rn),{type:Du,value:parseInt("0x"+t,16),start:e,end:B}}function JJ(e){let t="0"+se[B++];for(;B<vn&&sp(se[B]);)t+=se[B++];return(dp(se.charCodeAt(B))||Vo(se.charCodeAt(B)))&&Ne({},Wt,rn),{type:Du,value:parseInt(t,8),octal:!0,start:e,end:B}}function N5(){var e,t,n;if(n=se[B],X1(Vo(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=B,e="",n!=="."){if(e=se[B++],n=se[B],e==="0"){if(n==="x"||n==="X")return++B,QJ(t);if(sp(n))return JJ(t);n&&Vo(n.charCodeAt(0))&&Ne({},Wt,rn)}for(;Vo(se.charCodeAt(B));)e+=se[B++];n=se[B]}if(n==="."){for(e+=se[B++];Vo(se.charCodeAt(B));)e+=se[B++];n=se[B]}if(n==="e"||n==="E")if(e+=se[B++],n=se[B],(n==="+"||n==="-")&&(e+=se[B++]),Vo(se.charCodeAt(B)))for(;Vo(se.charCodeAt(B));)e+=se[B++];else Ne({},Wt,rn);return dp(se.charCodeAt(B))&&Ne({},Wt,rn),{type:Du,value:parseFloat(e),start:t,end:B}}function ZJ(){var e="",t,n,r,i,o=!1;for(t=se[B],X1(t==="'"||t==='"',"String literal must starts with a quote"),n=B,++B;B<vn;)if(r=se[B++],r===t){t="";break}else if(r==="\\")if(r=se[B++],!r||!lp(r.charCodeAt(0)))switch(r){case"u":case"x":se[B]==="{"?(++B,e+=VJ()):e+=SA(r);break;case"n":e+=`
|
|
10
|
+
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:sp(r)?(i="01234567".indexOf(r),i!==0&&(o=!0),B<vn&&sp(se[B])&&(o=!0,i=i*8+"01234567".indexOf(se[B++]),"0123".includes(r)&&B<vn&&sp(se[B])&&(i=i*8+"01234567".indexOf(se[B++]))),e+=String.fromCharCode(i)):e+=r;break}else r==="\r"&&se[B]===`
|
|
11
|
+
`&&++B;else{if(lp(r.charCodeAt(0)))break;e+=r}return t!==""&&Ne({},Wt,rn),{type:fp,value:e,octal:o,start:n,end:B}}function eZ(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";Ne({},EA)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ne({},EA)}try{return new RegExp(e,t)}catch{return null}}function tZ(){var e,t,n,r,i;for(e=se[B],X1(e==="/","Regular expression literal must start with a slash"),t=se[B++],n=!1,r=!1;B<vn;)if(e=se[B++],t+=e,e==="\\")e=se[B++],lp(e.charCodeAt(0))&&Ne({},bA),t+=e;else if(lp(e.charCodeAt(0)))Ne({},bA);else if(n)e==="]"&&(n=!1);else if(e==="/"){r=!0;break}else e==="["&&(n=!0);return r||Ne({},bA),i=t.substr(1,t.length-2),{value:i,literal:t}}function nZ(){var e,t,n;for(t="",n="";B<vn&&(e=se[B],!!H1(e.charCodeAt(0)));)++B,e==="\\"&&B<vn?Ne({},Wt,rn):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ne({},EA,n),{value:n,literal:t}}function rZ(){var e,t,n,r;return Be=null,j5(),e=B,t=tZ(),n=nZ(),r=eZ(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:B}}function iZ(e){return e.type===$u||e.type===ls||e.type===Y1||e.type===V1}function G5(){if(j5(),B>=vn)return{type:cp,start:B,end:B};let e=se.charCodeAt(B);return dp(e)?KJ():e===40||e===41||e===59?vA():e===39||e===34?ZJ():e===46?Vo(se.charCodeAt(B+1))?N5():vA():Vo(e)?N5():vA()}function er(){let e=Be;return B=e.end,Be=G5(),B=e.end,e}function H5(){let e=B;Be=G5(),B=e}function oZ(e){let t=new li(FJ);return t.elements=e,t}function O5(e,t,n){let r=new li(e==="||"||e==="&&"?DJ:RJ);return r.operator=e,r.left=t,r.right=n,r}function aZ(e,t){let n=new li(MJ);return n.callee=e,n.arguments=t,n}function sZ(e,t,n){let r=new li($J);return r.test=e,r.consequent=t,r.alternate=n,r}function kA(e){let t=new li(U5);return t.name=e,t}function ap(e){let t=new li(TJ);return t.value=e.value,t.raw=se.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function I5(e,t,n){let r=new li(NJ);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function uZ(e){let t=new li(OJ);return t.properties=e,t}function P5(e,t,n){let r=new li(IJ);return r.key=t,r.value=n,r.kind=e,r}function lZ(e,t){let n=new li(PJ);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ne(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,a)=>(X1(a<r.length,"Message reference must be in range"),r[a]));throw n=new Error(i),n.index=B,n.description=i,n}function K1(e){e.type===cp&&Ne(e,qJ),e.type===Du&&Ne(e,LJ),e.type===fp&&Ne(e,zJ),e.type===$u&&Ne(e,BJ),e.type===ls&&Ne(e,UJ),Ne(e,Wt,e.value)}function wn(e){let t=er();(t.type!==Zn||t.value!==e)&&K1(t)}function Ze(e){return Be.type===Zn&&Be.value===e}function wA(e){return Be.type===ls&&Be.value===e}function cZ(){let e=[];for(B=Be.start,wn("[");!Ze("]");)Ze(",")?(er(),e.push(null)):(e.push(Tu()),Ze("]")||wn(","));return er(),oZ(e)}function L5(){B=Be.start;let e=er();return e.type===fp||e.type===Du?(e.octal&&Ne(e,q5),ap(e)):kA(e.value)}function fZ(){var e,t,n,r;if(B=Be.start,e=Be,e.type===$u)return n=L5(),wn(":"),r=Tu(),P5("init",n,r);if(e.type===cp||e.type===Zn)K1(e);else return t=L5(),wn(":"),r=Tu(),P5("init",t,r)}function dZ(){var e=[],t,n,r,i={},o=String;for(B=Be.start,wn("{");!Ze("}");)t=fZ(),t.key.type===U5?n=t.key.name:n=o(t.key.value),r="$"+n,Object.prototype.hasOwnProperty.call(i,r)?Ne({},jJ):i[r]=!0,e.push(t),Ze("}")||wn(",");return wn("}"),uZ(e)}function hZ(){wn("(");let e=CA();return wn(")"),e}var pZ={if:1};function mZ(){var e,t,n;if(Ze("("))return hZ();if(Ze("["))return cZ();if(Ze("{"))return dZ();if(e=Be.type,B=Be.start,e===$u||pZ[Be.value])n=kA(er().value);else if(e===fp||e===Du)Be.octal&&Ne(Be,q5),n=ap(er());else{if(e===ls)throw new Error(up);e===Y1?(t=er(),t.value=t.value==="true",n=ap(t)):e===V1?(t=er(),t.value=null,n=ap(t)):Ze("/")||Ze("/=")?(n=ap(rZ()),H5()):K1(er())}return n}function gZ(){let e=[];if(wn("("),!Ze(")"))for(;B<vn&&(e.push(Tu()),!Ze(")"));)wn(",");return wn(")"),e}function yZ(){B=Be.start;let e=er();return iZ(e)||K1(e),kA(e.value)}function xZ(){return wn("."),yZ()}function bZ(){wn("[");let e=CA();return wn("]"),e}function vZ(){var e,t,n;for(e=mZ();;)if(Ze("."))n=xZ(),e=I5(".",e,n);else if(Ze("("))t=gZ(),e=aZ(e,t);else if(Ze("["))n=bZ(),e=I5("[",e,n);else break;return e}function z5(){let e=vZ();if(Be.type===Zn&&(Ze("++")||Ze("--")))throw new Error(up);return e}function G1(){var e,t;if(Be.type!==Zn&&Be.type!==ls)t=z5();else{if(Ze("++")||Ze("--"))throw new Error(up);if(Ze("+")||Ze("-")||Ze("~")||Ze("!"))e=er(),t=G1(),t=lZ(e.value,t);else{if(wA("delete")||wA("void")||wA("typeof"))throw new Error(up);t=z5()}}return t}function B5(e){let t=0;if(e.type!==Zn&&e.type!==ls)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function wZ(){var e,t,n,r,i,o,a,s,u,l;if(e=Be,u=G1(),r=Be,i=B5(r),i===0)return u;for(r.prec=i,er(),t=[e,Be],a=G1(),o=[u,r,a];(i=B5(Be))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=O5(s,u,a),o.push(n);r=er(),r.prec=i,o.push(r),t.push(Be),n=G1(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=O5(o[l-1].value,o[l-2],n),l-=2;return n}function Tu(){var e,t,n;return e=wZ(),Ze("?")&&(er(),t=Tu(),wn(":"),n=Tu(),e=sZ(e,t,n)),e}function CA(){let e=Tu();if(Ze(","))throw new Error(up);return e}function Oc(e){se=e,B=0,vn=se.length,Be=null,H5();let t=CA();if(Be.type!==cp)throw new Error("Unexpect token after expression.");return t}var FA={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function RA(e){function t(a,s,u,l){let c=e(s[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+a+(l<0?"":l===0?"()":"("+s.slice(1).map(e).join(",")+")")}function n(a,s,u){return l=>t(a,l,s,u)}let r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(a){a.length<3&&O("Missing arguments to clamp function."),a.length>3&&O("Too many arguments to clamp function.");let s=a.map(e);return"Math.max("+s[1]+", Math.min("+s[2]+","+s[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),btoa:"btoa",atob:"atob",regexp:o,test:n("test",o),if:function(a){a.length<3&&O("Missing arguments to if function."),a.length>3&&O("Too many arguments to if function.");let s=a.map(e);return"("+s[0]+"?"+s[1]+":"+s[2]+")"}}}function EZ(e){let t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function Q1(e){e=e||{};let t=e.allowed?$t(e.allowed):{},n=e.forbidden?$t(e.forbidden):{},r=e.constants||FA,i=(e.functions||RA)(f),o=e.globalvar,a=e.fieldvar,s=de(o)?o:p=>`${o}["${p}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(p=>typeof Object.prototype[p]=="function")];let u={},l={},c=0;function f(p){if(Z(p))return p;let m=d[p.type];return m==null&&O("Unsupported type: "+p.type),m(p)}let d={Literal:p=>p.raw,Identifier:p=>{let m=p.name;return c>0?m:ee(n,m)?O("Illegal identifier: "+m):ee(r,m)?r[m]:ee(t,m)?m:(u[m]=1,s(m))},MemberExpression:p=>{let m=!p.computed,g=f(p.object);m&&(c+=1);let y=f(p.property);return g===a&&(l[EZ(y)]=1),m&&(c-=1),g+(m?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&O("Illegal callee type: "+p.callee.type);let m=p.callee.name,g=p.arguments,y=ee(i,m)&&i[m];return y||O("Unrecognized function: "+m),de(y)?y(g):y+"("+g.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(let m of p.properties){let g=m.key.name;Cf.has(g)&&O("Illegal property: "+g)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{c+=1;let m=f(p.key);return c-=1,m+":"+f(p.value)}};function h(p){let m={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},m}return h.functions=i,h.constants=r,h}x();var Y5=Symbol("vega_selection_getter");function Q5(e){return(!e.getter||!e.getter[Y5])&&(e.getter=zt(e.field),e.getter[Y5]=!0),e.getter}var $A="intersect",V5="union",SZ="vlMulti",_Z="vlPoint",X5="or",AZ="and",Ji="_vgsid_",hp=zt(Ji),kZ="E",CZ="R",FZ="R-E",RZ="R-LE",MZ="R-RE",$Z="E-LT",TZ="E-LTE",DZ="E-GT",NZ="E-GTE",OZ="E-VALID",IZ="E-ONE",J1="index:unit";function K5(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,a,s;o<i;++o)if(s=n[o],a=Q5(s)(e),Hr(a)&&(a=yt(a)),Hr(r[o])&&(r[o]=yt(r[o])),I(r[o])&&Hr(r[o][0])&&(r[o]=r[o].map(yt)),s.type===kZ){if(I(r[o])?!r[o].includes(a):a!==r[o])return!1}else if(s.type===CZ){if(!ba(a,r[o]))return!1}else if(s.type===MZ){if(!ba(a,r[o],!0,!1))return!1}else if(s.type===FZ){if(!ba(a,r[o],!1,!1))return!1}else if(s.type===RZ){if(!ba(a,r[o],!1,!0))return!1}else if(s.type===$Z){if(a>=r[o])return!1}else if(s.type===TZ){if(a>r[o])return!1}else if(s.type===DZ){if(a<=r[o])return!1}else if(s.type===NZ){if(a<r[o])return!1}else if(s.type===OZ){if(a===null||isNaN(a))return!1}else if(s.type===IZ&&r[o].indexOf(a)===-1)return!1;return!0}function J5(e,t,n){for(var r=this.context.data[e],i=r?r.values.value:[],o=r?r[J1]&&r[J1].value:void 0,a=n===$A,s=i.length,u=0,l,c,f,d,h;u<s;++u)if(l=i[u],o&&a){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=K5(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=K5(t,l),a^h)return h;return s&&a}var Z5=or(hp),PZ=Z5.left,LZ=Z5.right;function eP(e,t,n){let r=this.context.data[e],i=r?r.values.value:[],o=r?r[J1]&&r[J1].value:void 0,a=n===$A,s=hp(t),u=PZ(i,s);if(u===i.length||hp(i[u])!==s)return!1;if(o&&a){if(o.size===1)return!0;if(LZ(i,s)-u<o.size)return!1}return!0}function tP(e,t){return I(e)||O("First argument to selectionTuples must be an array."),Q(t)||O("Second argument to selectionTuples must be an object."),e.map(n=>he(t.fields?{values:t.fields.map(r=>Q5(r)(n.datum))}:{[Ji]:hp(n.datum)},t))}function nP(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],a={},s={},u={},l,c,f,d,h,p,m,g,y,b,v=o.length,w=0,E,_;w<v;++w)if(l=o[w],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,_=c.length;E<_;++E)h=c[E],m=a[h.field]||(a[h.field]={}),g=m[d]||(m[d]=[]),u[h.field]=y=h.type.charAt(0),b=MA[`${y}_union`],m[d]=b(g,J(f[E]));n&&(g=s[d]||(s[d]=[]),g.push(J(f).reduce((S,k,C)=>(S[c[C].field]=k,S),{})))}else h=Ji,p=hp(l),m=a[h]||(a[h]={}),g=m[d]||(m[d]=[]),g.push(p),n&&(g=s[d]||(s[d]=[]),g.push({[Ji]:p}));if(t=t||V5,a[Ji]?a[Ji]=MA[`${Ji}_${t}`](...Object.values(a[Ji])):Object.keys(a).forEach(S=>{a[S]=Object.keys(a[S]).map(k=>a[S][k]).reduce((k,C)=>k===void 0?C:MA[`${u[S]}_${t}`](k,C))}),o=Object.keys(s),n&&o.length){let S=r?_Z:SZ;a[S]=t===V5?{[X5]:o.reduce((k,C)=>(k.push(...s[C]),k),[])}:{[AZ]:o.map(k=>({[X5]:s[k]}))}}return a}var MA={[`${Ji}_union`]:$m,[`${Ji}_intersect`]:Mm,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;n<r;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.includes(n)):t},R_union:function(e,t){var n=yt(t[0]),r=yt(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<r&&(e[1]=r),e):[n,r]},R_intersect:function(e,t){var n=yt(t[0]),r=yt(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?r<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>r&&(e[1]=r),e):[n,r]}},zZ=":",BZ="@";function Z1(e,t,n,r){t[0].type!==Xo&&O("First argument to selection functions must be a string literal.");let i=t[0].value,o=t.length>=2&&ve(t).value,a="unit",s=BZ+a,u=zZ+i;o===$A&&!ee(r,s)&&(r[s]=n.getData(i).indataRef(n,a)),ee(r,u)||(r[u]=n.getData(i).tuplesRef())}function aP(e){let t=this.context.data[e];return t?t.values.value:[]}function UZ(e,t,n){let r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function qZ(e,t){let n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(Mt).insert(t)),1}function jZ(e,t,n){if(e){let r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}var pp=e=>function(t,n){let r=this.context.dataflow.locale();return t===null?"null":r[e](n)(t)},WZ=pp("format"),sP=pp("timeFormat"),GZ=pp("utcFormat"),HZ=pp("timeParse"),YZ=pp("utcParse"),ey=new Date(2e3,0,1);function ty(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(ey.setYear(2e3),ey.setMonth(e),ey.setDate(t),sP.call(this,ey,n))}function VZ(e){return ty.call(this,e,1,"%B")}function XZ(e){return ty.call(this,e,1,"%b")}function KZ(e){return ty.call(this,0,2+e,"%A")}function QZ(e){return ty.call(this,0,2+e,"%a")}var JZ=":",ZZ="@",DA="%",uP="$";function IA(e,t,n,r){t[0].type!==Xo&&O("First argument to data functions must be a string literal.");let i=t[0].value,o=JZ+i;if(!ee(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function eee(e,t,n,r){t[0].type!==Xo&&O("First argument to indata must be a string literal."),t[1].type!==Xo&&O("Second argument to indata must be a string literal.");let i=t[0].value,o=t[1].value,a=ZZ+o;ee(a,r)||(r[a]=n.getData(i).indataRef(n,o))}function Bn(e,t,n,r){if(t[0].type===Xo)rP(n,r,t[0].value);else for(e in n.scales)rP(n,r,e)}function rP(e,t,n){let r=DA+n;if(!ee(t,r))try{t[r]=e.scaleRef(n)}catch{}}function Zi(e,t){if(Z(e)){let n=t.scales[e];return n&&Aw(n.value)?n.value:void 0}else if(de(e))return Aw(e)?e:void 0}function tee(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Bn,n._range=Bn,n._scale=Bn;let r=i=>"_["+(i.type===Xo?G(DA+i.value):G(DA)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function PA(e,t){return function(n,r,i){if(n){let o=Zi(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}var nee=PA("area",WE),ree=PA("bounds",HE),iee=PA("centroid",QE);function oee(e,t){let n=Zi(e,(t||this).context);return n&&n.scale()}function aee(e){let t=this.context.group,n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function LA(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function see(){return LA(this.context.dataflow,"warn",arguments)}function uee(){return LA(this.context.dataflow,"info",arguments)}function lee(){return LA(this.context.dataflow,"debug",arguments)}function TA(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function NA(e){let t=Fr(e),n=TA(t.r),r=TA(t.g),i=TA(t.b);return .2126*n+.7152*r+.0722*i}function cee(e,t){let n=NA(e),r=NA(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function fee(){let e=[].slice.call(arguments);return e.unshift({}),he(...e)}function lP(e,t){return e===t||e!==e&&t!==t?!0:I(e)?I(t)&&e.length===t.length?dee(e,t):!1:Q(e)&&Q(t)?cP(e,t):!1}function dee(e,t){for(let n=0,r=e.length;n<r;++n)if(!lP(e[n],t[n]))return!1;return!0}function cP(e,t){for(let n in e)if(!lP(e[n],t[n]))return!1;return!0}function iP(e){return t=>cP(e,t)}function hee(e,t,n,r,i,o){let a=this.context.dataflow,s=this.context.data[e],u=s.input,l=a.stamp(),c=s.changes,f,d;if(a._trigger===!1||!(u.value.length||t||r))return 0;if((!c||c.stamp<l)&&(s.changes=c=a.changeset(),c.stamp=l,a.runAfter(()=>{s.modified=!0,a.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Mt:I(n)||Hs(n)?n:iP(n),c.remove(f)),t&&c.insert(t),r&&(f=iP(r),u.value.some(f)?c.remove(f):c.insert(r)),i){if(de(i))throw Error("modify parameter must be a data tuple, not a function");for(d in o)c.modify(i,d,o[d])}return 1}function pee(e){let t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function mee(e){let t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}var oP={};function gee(e,t){let n=oP[t]||(oP[t]=zt(t));return I(e)?e.map(n):n(e)}function ny(e){return I(e)||ArrayBuffer.isView(e)?e:null}function zA(e){return ny(e)||(Z(e)?e:null)}function yee(e,...t){return ny(e).join(...t)}function xee(e,...t){return zA(e).indexOf(...t)}function bee(e,...t){return zA(e).lastIndexOf(...t)}function vee(e,...t){return zA(e).slice(...t)}function wee(e,t,n){return de(n)&&O("Function argument passed to replace."),!Z(t)&&!Em(t)&&O("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function Eee(e){return ny(e).slice().reverse()}function See(e){return ny(e).slice().sort(vo)}function _ee(e,t,n){return qd(e||0,t||0,n||0)}function Aee(e,t){let n=Zi(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function kee(e,t){let n=Zi(e,(t||this).context);return n?n.copy():void 0}function Cee(e,t){let n=Zi(e,(t||this).context);return n?n.domain():[]}function Fee(e,t,n){let r=Zi(e,(n||this).context);return r?I(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function Ree(e,t){let n=Zi(e,(t||this).context);return n&&n.range?n.range():[]}function Mee(e,t,n){let r=Zi(e,(n||this).context);return r?r(t):void 0}function $ee(e,t,n,r,i){e=Zi(e,(i||this).context);let o=Jw(t,n),a=e.domain(),s=a[0],u=ve(a),l=ct;return u-s?l=s0(e,s,u):e=(e.interpolator?Fe("sequential")().interpolator(e.interpolator()):Fe("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==ve(a)&&a.push(u)),a.forEach(c=>o.stop(l(c),e(c))),o}function Tee(e,t,n){let r=Zi(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Dee(e){let t=null;return function(n){return n?nc(n,t=t||gu(e)):e}}var fP=e=>e.data;function dP(e,t){let n=aP.call(t,e);return n.root&&n.root.lookup||{}}function Nee(e,t,n){let r=dP(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(fP):void 0}function Oee(e,t){let n=dP(e,this)[t];return n?n.ancestors().map(fP):void 0}var hP=()=>typeof window<"u"&&window||null;function Iee(){let e=hP();return e?e.screen:{}}function Pee(){let e=hP();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Lee(){let e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function pP(e,t,n){if(!e)return[];let[r,i]=e,o=new ft().set(r[0],r[1],i[0],i[1]),a=n||this.context.dataflow.scenegraph().root;return EE(a,o,zee(t))}function zee(e){let t=null;if(e){let n=J(e.marktype),r=J(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Bee(e,t,n,r=5){e=J(e);let i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Uee(e){return J(e).reduce((t,[n,r],i)=>t+=i==0?`M ${n},${r} `:i===e.length-1?" Z":`L ${n},${r} `,"")}function qee(e,t,n){let{x:r,y:i,mark:o}=n,a=new ft().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(let[u,l]of t)u<a.x1&&(a.x1=u),u>a.x2&&(a.x2=u),l<a.y1&&(a.y1=l),l>a.y2&&(a.y2=l);return a.translate(r,i),pP([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter(u=>jee(u.x,u.y,t))}function jee(e,t,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){let[a,s]=n[o],[u,l]=n[i];l>t!=s>t&&e<(a-u)*(t-l)/(s-l)+u&&r++}return r&1}var Ic={random(){return Mn()},cumulativeNormal:dd,cumulativeLogNormal:og,cumulativeUniform:lg,densityNormal:eg,densityLogNormal:ig,densityUniform:ug,quantileNormal:hd,quantileLogNormal:ag,quantileUniform:cg,sampleNormal:fd,sampleLogNormal:rg,sampleUniform:sg,isArray:I,isBoolean:Gr,isDate:Hr,isDefined(e){return e!==void 0},isNumber:ke,isObject:Q,isRegExp:Em,isString:Z,isTuple:Hs,isValid(e){return e!=null&&e===e},toBoolean:Nf,toDate(e){return Of(e)},toNumber:yt,toString:If,indexof:xee,join:yee,lastindexof:bee,replace:wee,reverse:Eee,sort:See,slice:vee,flush:_b,lerp:kb,merge:fee,pad:Rb,peek:ve,pluck:gee,span:wo,inrange:ba,truncate:Mb,rgb:Fr,lab:Pa,hcl:ru,hsl:nu,luminance:NA,contrast:cee,sequence:xt,format:WZ,utcFormat:GZ,utcParse:YZ,utcOffset:gv,utcSequence:xv,timeFormat:sP,timeParse:HZ,timeOffset:mv,timeSequence:yv,timeUnitSpecifier:sv,monthFormat:VZ,monthAbbrevFormat:XZ,dayFormat:KZ,dayAbbrevFormat:QZ,quarter:vb,utcquarter:wb,week:cv,utcweek:dv,dayofyear:lv,utcdayofyear:fv,warn:see,info:uee,debug:lee,extent(e){return _n(e)},inScope:aee,intersect:pP,clampRange:Eb,pinchDistance:pee,pinchAngle:mee,screen:Iee,containerSize:Lee,windowSize:Pee,bandspace:_ee,setdata:qZ,pathShape:Dee,panLinear:gb,panLog:yb,panPow:xb,panSymlog:bb,zoomLinear:Ff,zoomLog:Rf,zoomPow:wl,zoomSymlog:Mf,encode:jZ,modify:hee,lassoAppend:Bee,lassoPath:Uee,intersectLasso:qee},Wee=["view","item","group","xy","x","y"],Gee="event.vega.",mP="this.",BA={},gP={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${G(uP+e)}]`,functions:Hee,constants:FA,visitors:BA},OA=Q1(gP);function Hee(e){let t=RA(e);Wee.forEach(n=>t[n]=Gee+n);for(let n in Ic)t[n]=mP+n;return he(t,tee(e,Ic,BA)),t}function mt(e,t,n){return arguments.length===1?Ic[e]:(Ic[e]=t,n&&(BA[e]=n),OA&&(OA.functions[e]=mP+e),this)}mt("bandwidth",Aee,Bn);mt("copy",kee,Bn);mt("domain",Cee,Bn);mt("range",Ree,Bn);mt("invert",Fee,Bn);mt("scale",Mee,Bn);mt("gradient",$ee,Bn);mt("geoArea",nee,Bn);mt("geoBounds",ree,Bn);mt("geoCentroid",iee,Bn);mt("geoShape",Tee,Bn);mt("geoScale",oee,Bn);mt("indata",UZ,eee);mt("data",aP,IA);mt("treePath",Nee,IA);mt("treeAncestors",Oee,IA);mt("vlSelectionTest",J5,Z1);mt("vlSelectionIdTest",eP,Z1);mt("vlSelectionResolve",nP,Z1);mt("vlSelectionTuples",tP);function ci(e,t){let n={},r;try{e=Z(e)?e:G(e)+"",r=Oc(e)}catch{O("Expression parse error: "+e)}r.visit(o=>{if(o.type!==_A)return;let a=o.callee.name,s=gP.visitors[a];s&&s(a,o.arguments,t,n)});let i=OA(r);return i.globals.forEach(o=>{let a=uP+o;!ee(n,a)&&t.getSignal(o)&&(n[a]=t.signalRef(o))}),{$expr:he({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}x();function Yee(e){let t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}var Vee=$t(["rule"]),yP=$t(["group","image","rect"]);function Xee(e,t){let n="";return Vee[t]||(e.x2&&(e.x?(yP[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(yP[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function UA(e){return(e+"").toLowerCase()}function Kee(e){return UA(e)==="operator"}function Qee(e){return UA(e)==="collect"}function mp(e,t,n){n.endsWith(";")||(n="return("+n+");");let r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function Jee(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
|
|
12
|
+
: (u > v || v == null) && u != null ? ${r}
|
|
13
|
+
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
|
|
14
|
+
: v !== v && u === u ? ${r} : `}var Zee={operator:(e,t)=>mp(e,["_"],t.code),parameter:(e,t)=>mp(e,["datum","_"],t.code),event:(e,t)=>mp(e,["event"],t.code),handler:(e,t)=>{let n=`var datum=event.item&&event.item.datum;return ${t.code};`;return mp(e,["_","event"],n)},encode:(e,t)=>{let{marktype:n,channels:r}=t,i="var o=item,datum=o.datum,m=0,$;";for(let o in r){let a="o["+G(o)+"]";i+=`$=${r[o].code};if(${a}!==$)${a}=$,m=1;`}return i+=Xee(r,n),i+="return m;",mp(e,["item","_"],i)},codegen:{get(e){let t=`[${e.map(G).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n,r=(o,a)=>{let s=t[a],u,l;return o.path?(u=`a${o.path}`,l=`b${o.path}`):((n=n||{})["f"+a]=o,u=`this.f${a}(a)`,l=`this.f${a}(b)`),Jee(u,l,-s,s)},i=Function("a","b","var u, v; return "+e.map(r).join("")+"0;");return n?i.bind(n):i}}};function ete(e){let t=this;Kee(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function tte(e){let t=this;if(e.params){let n=t.get(e.id);n||O("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function nte(e,t){t=t||{};let n=this;for(let r in e){let i=e[r];t[r]=I(i)?i.map(o=>xP(o,n,t)):xP(i,n,t)}return t}function xP(e,t,n){if(!e||!Q(e))return e;for(let r=0,i=bP.length,o;r<i;++r)if(o=bP[r],ee(e,o.key))return o.parse(e,t,n);return e}var bP=[{key:"$ref",parse:rte},{key:"$key",parse:ote},{key:"$expr",parse:ite},{key:"$field",parse:ate},{key:"$encode",parse:ute},{key:"$compare",parse:ste},{key:"$context",parse:lte},{key:"$subflow",parse:cte},{key:"$tupleid",parse:fte}];function rte(e,t){return t.get(e.$ref)||O("Operator not defined: "+e.$ref)}function ite(e,t,n){e.$params&&t.parseParameters(e.$params,n);let r="e:"+e.$expr.code;return t.fn[r]||(t.fn[r]=dn(t.parameterExpression(e.$expr),e.$fields))}function ote(e,t){let n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=Df(e.$key,e.$flat,t.expr.codegen))}function ate(e,t){if(!e.$field)return null;let n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=zt(e.$field,e.$name,t.expr.codegen))}function ste(e,t){let n="c:"+e.$compare+"_"+e.$order,r=J(e.$compare).map(i=>i&&i.$tupleid?ue:i);return t.fn[n]||(t.fn[n]=$f(r,e.$order,t.expr.codegen))}function ute(e,t){let n=e.$encode,r={};for(let i in n){let o=n[i];r[i]=dn(t.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function lte(e,t){return t}function cte(e,t){let n=e.$subflow;return function(r,i,o){let a=t.fork().parse(n),s=a.get(n.operators[0].id),u=a.signals.parent;return u&&u.set(o),s.detachSubflow=()=>t.detach(a),s}}function fte(){return ue}function dte(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,r=e.stream!=null?t.get(e.stream):void 0,i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(o=>t.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(o=>t.get(o)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r==null&&O("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function hte(e){var t=this,n=Q(n=e.source)?n.$ref:n,r=t.get(n),i=null,o=e.update,a=void 0;r||O("Source not defined: "+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(a=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,r,i,o,a)}var pte={skip:!0};function mte(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(o=>{let a=t.signals[o];e.signals(o,a)&&(r[o]=a.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(o=>{let a=t.data[o];e.data(o,a)&&(i[o]=a.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function gte(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(o=>{n.update(t.signals[o],i[o],pte)}),Object.keys(r||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Mt).insert(r[o]))}),(e.subcontext||[]).forEach((o,a)=>{let s=t.subcontext[a];s&&s.setState(o)})}function ry(e,t,n,r){return new wP(e,t,n,r)}function wP(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||Zee,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function vP(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}wP.prototype=vP.prototype={fork(){let e=new vP(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);let t=Object.keys(e.nodes);for(let n of t)e.nodes[n]._targets=null;for(let n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){let n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),Qee(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(r.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),r.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(let o in e.data){let a=n.data[o]||(n.data[o]={});e.data[o].forEach(s=>a[s]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[UA(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Yee,parseOperator:ete,parseOperatorParameters:tte,parseParameters:nte,parseStream:dte,parseUpdate:hte,getState:mte,setState:gte};function yte(e){let t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),MP(t,e.description()))}function MP(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function xte(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}var qA="default";function bte(e){let t=e._signals.cursor||(e._signals.cursor=e.add({user:qA,item:null}));e.on(e.events("view","pointermove"),t,(n,r)=>{let i=t.value,o=i?Z(i)?i:i.user:qA,a=r.item&&r.item.cursor||null;return i&&o===i.user&&a==i.item?i:{user:o,item:a}}),e.add(null,function(n){let r=n.cursor,i=this.value;return Z(r)||(i=r.item,r=r.user),WA(e,r&&r!==qA?r:i||r),i},{cursor:t})}function WA(e,t){let n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function ay(e,t){var n=e._runtime.data;return ee(n,t)||O("Unrecognized data set: "+t),n[t]}function vte(e,t){return arguments.length<2?ay(this,e).values.value:uy.call(this,e,$o().remove(Mt).insert(t))}function uy(e,t){Dv(t)||O("Second argument to changes must be a changeset.");let n=ay(this,e);return n.modified=!0,this.pulse(n.input,t)}function wte(e,t){return uy.call(this,e,$o().insert(t))}function Ete(e,t){return uy.call(this,e,$o().remove(t))}function $P(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function TP(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function ly(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function Ste(e){var t=ly(e),n=$P(e),r=TP(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){e.error(o)}})}function _te(e,t,n){var r=e._renderer,i=r&&r.canvas(),o,a,s;return i&&(s=ly(e),a=t.changedTouches?t.changedTouches[0]:t,o=bh(a,i),o[0]-=s[0],o[1]-=s[1]),t.dataflow=e,t.item=n,t.vega=Ate(e,n,o),t}function Ate(e,t,n){let r=t?t.mark.marktype==="group"?t:t.mark.group:null;function i(a){var s=r,u;if(a){for(u=t;u;u=u.mark.group)if(u.mark.name===a){s=u;break}}return s&&s.mark&&s.mark.interactive?s:{}}function o(a){if(!a)return n;Z(a)&&(a=i(a));let s=n.slice();for(;a;)s[0]-=a.x||0,s[1]-=a.y||0,a=a.mark&&a.mark.group;return s}return{view:tt(e),item:tt(t||{}),group:i,xy:o,x:a=>o(a)[0],y:a=>o(a)[1]}}var EP="view",kte="timer",Cte="window",Fte={trap:!1};function Rte(e){let t=he({defaults:{}},e),n=(r,i)=>{i.forEach(o=>{I(r[o])&&(r[o]=$t(r[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function DP(e,t,n,r){e._eventListeners.push({type:n,sources:J(t),handler:r})}function Mte(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function iy(e,t,n){let r=e._eventConfig&&e._eventConfig[t];return r===!1||Q(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function $te(e,t,n){var r=this,i=new Il(n),o=function(l,c){r.runAsync(null,()=>{e===EP&&Mte(r,t)&&l.preventDefault(),i.receive(_te(r,l,c))})},a;if(e===kte)iy(r,"timer",t)&&r.timer(o,t);else if(e===EP)iy(r,"view",t)&&r.addEventListener(t,o,Fte);else if(e===Cte?iy(r,"window",t)&&typeof window<"u"&&(a=[window]):typeof document<"u"&&iy(r,"selector",t)&&(a=Array.from(document.querySelectorAll(e))),!a)r.warn("Can not resolve event source: "+e);else{for(var s=0,u=a.length;s<u;++s)a[s].addEventListener(t,o);DP(r,a,t,o)}return i}function SP(e){return e.item}function _P(e){return e.item.mark.source}function AP(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function Tte(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",SP),_P,AP(e)),this.on(this.events("view","pointerout",SP),_P,AP(t)),this}function Dte(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),r=this._eventListeners,i,o,a,s,u;for(i=t.length;--i>=0;)t[i].stop();for(i=r.length;--i>=0;)for(a=r[i],o=a.sources.length;--o>=0;)a.sources[o].removeEventListener(a.type,a.handler);for(e&&e.call(this,this._handler,null,null,null),i=n.length;--i>=0;)u=n[i].type,s=n[i].handler,this._handler.off(u,s);return this}function fr(e,t,n){let r=document.createElement(e);for(let i in t)r.setAttribute(i,t[i]);return n!=null&&(r.textContent=n),r}var Nte="vega-bind",Ote="vega-bind-name",Ite="vega-bind-radio";function Pte(e,t,n){if(!t)return;let r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:a=>{a!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,a)})}},r.debounce&&(i.update=Tf(r.debounce,i.update))),(r.input==null&&r.element?Lte:Bte)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function Lte(e,t,n,r){let i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),DP(r,t,i,o),e.set=a=>{t.value=a,t.dispatchEvent(zte(i))}}function zte(e){return typeof Event<"u"?new Event(e):{type:e}}function Bte(e,t,n,r){let i=r.signal(n.signal),o=fr("div",{class:Nte}),a=n.input==="radio"?o:o.appendChild(fr("label"));a.appendChild(fr("span",{class:Ote},n.name||n.signal)),t.appendChild(o);let s=Ute;switch(n.input){case"checkbox":s=qte;break;case"select":s=jte;break;case"radio":s=Wte;break;case"range":s=Gte;break}s(e,a,n,i)}function Ute(e,t,n,r){let i=fr("input");for(let o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=o=>i.value=o}function qte(e,t,n,r){let i={type:"checkbox",name:n.signal};r&&(i.checked=!0);let o=fr("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=a=>o.checked=!!a||null}function jte(e,t,n,r){let i=fr("select",{name:n.signal}),o=n.labels||[];n.options.forEach((a,s)=>{let u={value:a};sy(a,r)&&(u.selected=!0),i.appendChild(fr("option",u,(o[s]||a)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=a=>{for(let s=0,u=n.options.length;s<u;++s)if(sy(n.options[s],a)){i.selectedIndex=s;return}}}function Wte(e,t,n,r){let i=fr("span",{class:Ite}),o=n.labels||[];t.appendChild(i),e.elements=n.options.map((a,s)=>{let u={type:"radio",name:n.signal,value:a};sy(a,r)&&(u.checked=!0);let l=fr("input",u);l.addEventListener("change",()=>e.update(a));let c=fr("label",{},(o[s]||a)+"");return c.prepend(l),i.appendChild(c),l}),e.set=a=>{let s=e.elements,u=s.length;for(let l=0;l<u;++l)sy(s[l].value,a)&&(s[l].checked=!0)}}function Gte(e,t,n,r){r=r!==void 0?r:(+n.max+ +n.min)/2;let i=n.max!=null?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||An(o,i,100),s=fr("input",{type:"range",name:n.signal,min:o,max:i,step:a});s.value=r;let u=fr("span",{},+r);t.appendChild(s),t.appendChild(u);let l=()=>{u.textContent=s.value,e.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),e.elements=[s],e.set=c=>{s.value=c,u.textContent=c}}function sy(e,t){return e===t||e+""==t+""}function NP(e,t,n,r,i,o){return t=t||new r(e.loader()),t.initialize(n,$P(e),TP(e),ly(e),i,o).background(e.background())}function GA(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Hte(e,t,n,r){let i=new r(e.loader(),GA(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,ly(e),e);return t&&t.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function Yte(e,t){let n=this,r=n._renderType,i=n._eventConfig.bind,o=vh(r);e=n._el=e?jA(n,e,!0):null,yte(n),o||n.error("Unrecognized renderer type: "+r);let a=o.handler||Ka,s=e?o.renderer:o.headless;return n._renderer=s?NP(n,n._renderer,e,s):null,n._handler=Hte(n,n._handler,e,a),n._redraw=!0,e&&i!=="none"&&(t=t?n._elBind=jA(n,t,!0):e.appendChild(fr("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&i!=="container"&&(u.element=jA(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Pte(n,u.element||t,u)})),n}function jA(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(r){t=null,e.error(r)}return t}var gp=e=>+e||0,Vte=e=>({top:e,bottom:e,left:e,right:e});function kP(e){return Q(e)?{top:gp(e.top),bottom:gp(e.bottom),left:gp(e.left),right:gp(e.right)}:Vte(gp(e))}async function HA(e,t,n,r){let i=vh(t),o=i&&i.headless;return o||O("Unrecognized renderer type: "+t),await e.runAsync(),NP(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}async function Xte(e,t){e!==Lo.Canvas&&e!==Lo.SVG&&e!==Lo.PNG&&O("Unrecognized image type: "+e);let n=await HA(this,e,t);return e===Lo.SVG?Kte(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Kte(e,t){let n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Qte(e,t){return(await HA(this,Lo.Canvas,e,t)).canvas()}async function Jte(e){return(await HA(this,Lo.SVG,e)).svg()}function Zte(e,t,n){return ry(e,Mo,Ic,n).parse(t)}function ene(e){var t=this._runtime.scales;return ee(t,e)||O("Unrecognized scale or projection: "+e),t[e].value}var OP="width",IP="height",YA="padding",CP={skip:!0};function PP(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===YA?r.left+r.right:0)}function LP(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===YA?r.top+r.bottom:0)}function tne(e){var t=e._signals,n=t[OP],r=t[IP],i=t[YA];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,s=>{e._width=s.size,e._viewWidth=PP(e,s.size),o()},{size:n}),e._resizeHeight=e.add(null,s=>{e._height=s.size,e._viewHeight=LP(e,s.size),o()},{size:r});let a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}function nne(e,t,n,r,i,o){this.runAfter(a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(OP,n,CP),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(IP,r,CP),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),(a._origin[0]!==i[0]||a._origin[1]!==i[1])&&(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter(u=>u.resize())},!1,1)}function rne(e){return this._runtime.getState(e||{data:ine,signals:one,recurse:!0})}function ine(e,t){return t.modified&&I(t.input.value)&&!e.startsWith("_:vega:_")}function one(e,t){return!(e==="parent"||t instanceof Mo.proxy)}function ane(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function sne(e,t){function n(r){e({timestamp:Date.now(),elapsed:r})}this._timers.push(c_(n,t))}function une(e,t,n,r){let i=e.element();i&&i.setAttribute("title",lne(r))}function lne(e){return e==null?"":I(e)?zP(e):Q(e)&&!Hr(e)?cne(e):e+""}function cne(e){return Object.keys(e).map(t=>{let n=e[t];return t+": "+(I(n)?zP(n):BP(n))}).join(`
|
|
15
|
+
`)}function zP(e){return"["+e.map(BP).join(", ")+"]"}function BP(e){return I(e)?"[\u2026]":Q(e)&&!Hr(e)?"{\u2026}":e}function fne(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null,t=()=>{e?.();let n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function VA(e,t){let n=this;if(t=t||{},Ra.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){let o=he({},e.locale,t.locale);n.locale(Bm(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Lo.Canvas,n._scenegraph=new ah;let r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||une,n._redraw=!0,n._handler=new Ka().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Rte(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);let i=Zte(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:he({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=PP(n,n._width),n._viewHeight=LP(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,tne(n),xte(n),bte(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function oy(e,t){return ee(e._signals,t)?e._signals[t]:O("Unrecognized signal name: "+G(t))}function UP(e,t){let n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function FP(e,t,n,r){let i=UP(n,r);return i||(i=GA(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function RP(e,t,n){let r=UP(t,n);return r&&t._targets.remove(r),e}W(VA,Ra,{async evaluate(e,t,n){if(await Ra.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Ste(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&ud(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){let t=e!=null?e+"":null;return t!==this._desc&&MP(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){let r=oy(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",kP(e)):kP(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(vh(e)||O("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Ra.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(oy(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:nne,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=GA(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){let t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return FP(this,e,oy(this,e),t)},removeSignalListener(e,t){return RP(this,oy(this,e),t)},addDataListener(e,t){return FP(this,e,ay(this,e).values,t)},removeDataListener(e,t){return RP(this,ay(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){let t=WA(this,null);this._globalCursor=!!e,t&&WA(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:sne,events:$te,finalize:Dte,hover:Tte,data:vte,change:uy,insert:wte,remove:Ete,scale:ene,initialize:Yte,toImageURL:Xte,toCanvas:Qte,toSVG:Jte,getState:rne,setState:ane,_watchPixelRatio:fne});x();x();var dne="view";var hne=/[[\]{}]/,pne={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},qP,jP;function fi(e,t,n){return qP=t||dne,jP=n||pne,WP(e.trim()).map(XA)}function mne(e){return jP[e]}function yp(e,t,n,r,i){let o=e.length,a=0,s;for(;t<o;++t){if(s=e[t],!a&&s===n)return t;i&&i.includes(s)?--a:r&&r.includes(s)&&++a}return t}function WP(e){let t=[],n=e.length,r=0,i=0;for(;i<n;)i=yp(e,i,",","[{","]}"),t.push(e.substring(r,i).trim()),r=++i;if(t.length===0)throw"Empty event selector: "+e;return t}function XA(e){return e[0]==="["?gne(e):yne(e)}function gne(e){let t=e.length,n=1,r;if(n=yp(e,n,"]","[","]"),n===t)throw"Empty between selector: "+e;if(r=WP(e.substring(1,n)),r.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==">")throw"Expected '>' after between selector: "+e;r=r.map(XA);let i=XA(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function yne(e){let t={source:qP},n=[],r=[0,0],i=0,o=0,a=e.length,s=0,u,l;if(e[a-1]==="}"){if(s=e.lastIndexOf("{"),s>=0){try{r=xne(e.substring(s+1,a-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,s).trim(),a=e.length}else throw"Unmatched right brace: "+e;s=0}if(!a)throw e;if(e[0]==="@"&&(i=++s),u=yp(e,s,":"),u<a&&(n.push(e.substring(o,u).trim()),o=s=++u),s=yp(e,s,"["),s===a)n.push(e.substring(o,a).trim());else if(n.push(e.substring(o,s).trim()),l=[],o=++s,o===a)throw"Unmatched left bracket: "+e;for(;s<a;){if(s=yp(e,s,"]"),s===a)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,s).trim()),s<a-1&&e[++s]!=="[")throw"Expected left bracket: "+e;o=++s}if(!(a=n.length)||hne.test(n[a-1]))throw"Invalid event selector: "+e;return a>1?(t.type=n[1],i?t.markname=n[0].slice(1):mne(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function xne(e){let t=e.split(",");if(!e.length||t.length>2)throw e;return t.map(n=>{let r=+n;if(r!==r)throw e;return r})}function bne(e){return Q(e)?e:{type:e||"pad"}}var xp=e=>+e||0,vne=e=>({top:e,bottom:e,left:e,right:e});function wne(e){return Q(e)?e.signal?e:{top:xp(e.top),bottom:xp(e.bottom),left:xp(e.left),right:xp(e.right)}:vne(xp(e))}var Gt=e=>Q(e)&&!I(e)?he({},e):{value:e};function GP(e,t,n,r){return n!=null?(Q(n)&&!I(n)||I(n)&&n.length&&Q(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function on(e,t,n){for(let r in t)GP(e,r,t[r]);for(let r in n)GP(e,r,n[r],"update")}function qc(e,t,n){for(let r in t)n&&ee(n,r)||(e[r]=he(e[r]||{},t[r]));return e}function Lc(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}var ak="mark",sk="frame",uk="scope",Ene="axis",Sne="axis-domain",_ne="axis-grid",Ane="axis-label",kne="axis-tick",Cne="axis-title",Fne="legend",Rne="legend-band",Mne="legend-entry",$ne="legend-gradient",c4="legend-label",Tne="legend-symbol",Dne="legend-title",Nne="title",One="title-text",Ine="title-subtitle";function Pne(e,t,n,r,i){let o={},a={},s,u,l,c;u="lineBreak",t==="text"&&i[u]!=null&&!Lc(u,e)&&KA(o,u,i[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===sk?i.group:n===ak?he({},i.mark,i[t]):null;for(u in c)l=Lc(u,e)||(u==="fill"||u==="stroke")&&(Lc("fill",e)||Lc("stroke",e)),l||KA(o,u,c[u]);J(r).forEach(f=>{let d=i.style&&i.style[f];for(let h in d)Lc(h,e)||KA(o,h,d[h])}),e=he({},e);for(u in o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return e.enter=he(a,e.enter),s&&(e.update=he(s,e.update)),e}function KA(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}var f4=e=>Z(e)?G(e):e.signal?`(${e.signal})`:d4(e);function yy(e){if(e.gradient!=null)return zne(e);let t=e.signal?`(${e.signal})`:e.color?Lne(e.color):e.field!=null?d4(e.field):e.value!==void 0?G(e.value):void 0;return e.scale!=null&&(t=Bne(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${fy(e.exponent)})`),e.mult!=null&&(t+=`*${fy(e.mult)}`),e.offset!=null&&(t+=`+${fy(e.offset)}`),e.round&&(t=`round(${t})`),t}var cy=(e,t,n,r)=>`(${e}(${[t,n,r].map(yy).join(",")})+'')`;function Lne(e){return e.c?cy("hcl",e.h,e.c,e.l):e.h||e.s?cy("hsl",e.h,e.s,e.l):e.l||e.a?cy("lab",e.l,e.a,e.b):e.r||e.g||e.b?cy("rgb",e.r,e.g,e.b):null}function zne(e){let t=[e.start,e.stop,e.count].map(n=>n==null?null:G(n));for(;t.length&&ve(t)==null;)t.pop();return t.unshift(f4(e.gradient)),`gradient(${t.join(",")})`}function fy(e){return Q(e)?"("+yy(e)+")":e}function d4(e){return h4(Q(e)?e:{datum:e})}function h4(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):O("Invalid field reference: "+G(e));return e.signal||(r=Z(r)?vr(r).map(G).join("]["):h4(r)),t+"["+r+"]"}function Bne(e,t){let n=f4(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+fy(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Une(e){let t="";return e.forEach(n=>{let r=yy(n);t+=n.test?`(${n.test})?${r}:`:r}),ve(t)===":"&&(t+="null"),t}function p4(e,t,n,r,i,o){let a={};o=o||{},o.encoders={$encode:a},e=Pne(e,t,n,r,i.config);for(let s in e)a[s]=qne(e[s],t,o,i);return o}function qne(e,t,n,r){let i={},o={};for(let a in e)e[a]!=null&&(i[a]=Wne(jne(e[a]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function jne(e){return I(e)?Une(e):yy(e)}function Wne(e,t,n,r){let i=ci(e,t);return i.$fields.forEach(o=>r[o]=1),he(n,i.$params),i.$expr}var Gne="outer",Hne=["value","update","init","react","bind"];function HP(e,t){O(e+' for "outer" push: '+G(t))}function m4(e,t){let n=e.name;if(e.push===Gne)t.signals[n]||HP("No prior signal definition",n),Hne.forEach(r=>{e[r]!==void 0&&HP("Invalid property ",r)});else{let r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function ZA(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function xy(e,t,n,r){return new ZA(e,t,n,r)}function gy(e,t){return xy("operator",e,t)}function ce(e){let t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function wp(e,t){return t?{$field:e,$name:t}:{$field:e}}var ek=wp("key");function YP(e,t){return{$compare:e,$order:t}}function Yne(e,t){let n={$key:e};return t&&(n.$flat=!0),n}var Vne="ascending",Xne="descending";function Kne(e){return Q(e)?(e.order===Xne?"-":"+")+by(e.op,e.field):""}function by(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var lk="scope",tk="view";function Ot(e){return e&&e.signal}function Qne(e){return e&&e.expr}function dy(e){if(Ot(e))return!0;if(Q(e)){for(let t in e)if(dy(e[t]))return!0}return!1}function di(e,t){return e??t}function Ou(e){return e&&e.signal||e}var VP="timer";function Ep(e,t){return(e.merge?Zne:e.stream?ere:e.type?tre:O("Invalid stream specification: "+G(e)))(e,t)}function Jne(e){return e===lk?tk:e||tk}function Zne(e,t){let n=e.merge.map(i=>Ep(i,t)),r=ck({merge:n},e,t);return t.addStream(r).id}function ere(e,t){let n=Ep(e.stream,t),r=ck({stream:n},e,t);return t.addStream(r).id}function tre(e,t){let n;e.type===VP?(n=t.event(VP,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Jne(e.source),e.type);let r=ck({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function ck(e,t,n){let r=t.between;return r&&(r.length!==2&&O('Stream "between" parameter must have 2 entries: '+G(t)),e.between=[Ep(r[0],n),Ep(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(nre(t.marktype,t.markname,t.markrole)),t.source===lk&&r.push("inScope(event.item)"),r.length&&(e.filter=ci("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function nre(e,t,n){let r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}var rre={code:"_.$value",ast:{type:"Identifier",value:"value"}};function ire(e,t,n){let r=e.encode,i={target:n},o=e.events,a=e.update,s=[];o||O("Signal update missing events specification."),Z(o)&&(o=fi(o,t.isSubscope()?lk:tk)),o=J(o).filter(u=>u.signal||u.scale?(s.push(u),0):1),s.length>1&&(s=[are(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),r!=null&&(a&&O("Signal encode and update are mutually exclusive."),a="encode(item(),"+G(r)+")"),i.update=Z(a)?ci(a,t):a.expr!=null?ci(a.expr,t):a.value!=null?a.value:a.signal!=null?{$expr:rre,$params:{$value:t.signalRef(a.signal)}}:O("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach(u=>t.addUpdate(he(ore(u,t),i)))}function ore(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Ep(e,t)}}function are(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function sre(e,t){let n=t.getSignal(e.name),r=e.update;e.init&&(r?O("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=ci(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>ire(i,t,n.id))}var Ge=e=>(t,n,r)=>xy(e,n,t||void 0,r),g4=Ge("aggregate"),ure=Ge("axisticks"),y4=Ge("bound"),pi=Ge("collect"),XP=Ge("compare"),lre=Ge("datajoin"),x4=Ge("encode"),cre=Ge("expression"),fre=Ge("facet"),dre=Ge("field"),hre=Ge("key"),pre=Ge("legendentries"),mre=Ge("load"),gre=Ge("mark"),yre=Ge("multiextent"),xre=Ge("multivalues"),bre=Ge("overlap"),vre=Ge("params"),b4=Ge("prefacet"),wre=Ge("projection"),Ere=Ge("proxy"),Sre=Ge("relay"),v4=Ge("render"),_re=Ge("scale"),Pu=Ge("sieve"),Are=Ge("sortitems"),w4=Ge("viewlayout"),kre=Ge("values"),Cre=0,E4={min:"min",max:"max",count:"sum"};function Fre(e,t){let n=e.type||"linear";kw(n)||O("Unrecognized scale type: "+G(n)),t.addScale(e.name,{type:n,domain:void 0})}function Rre(e,t){let n=t.getScale(e.name).params,r;n.domain=S4(e.domain,e,t),e.range!=null&&(n.range=A4(e,t,n)),e.interpolate!=null&&zre(e.interpolate,n),e.nice!=null&&(n.nice=Lre(e.nice,t)),e.bins!=null&&(n.bins=Pre(e.bins,t));for(r in e)ee(n,r)||r==="name"||(n[r]=Or(e[r],t))}function Or(e,t){return Q(e)?e.signal?t.signalRef(e.signal):O("Unsupported object: "+G(e)):e}function hy(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Or(n,t))}function vy(e){O("Can not find data set: "+G(e))}function S4(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&O("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(I(e)?Mre:e.fields?Tre:$re)(e,t,n)}function Mre(e,t,n){return e.map(r=>Or(r,n))}function $re(e,t,n){let r=n.getData(e.data);return r||vy(e.data),Ua(t.type)?r.valuesRef(n,e.field,_4(e.sort,!1)):Rw(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function Tre(e,t,n){let r=e.data,i=e.fields.reduce((o,a)=>(a=Z(a)?{data:r,field:a}:I(a)||a.signal?Dre(a,n):a,o.push(a),o),[]);return(Ua(t.type)?Nre:Rw(t.type)?Ore:Ire)(e,n,i)}function Dre(e,t){let n="_:vega:_"+Cre++,r=pi({});if(I(e))r.value={$ingest:e};else if(e.signal){let i="setdata("+G(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,Pu({})]),{data:n,field:"data"}}function Nre(e,t,n){let r=_4(e.sort,!0),i,o,a=n.map(l=>{let c=t.getData(l.data);return c||vy(l.data),c.countsRef(t,l.field,r)}),s={groupby:ek,pulse:a};r&&(i=r.op||"count",o=r.field?by(i,r.field):"count",s.ops=[E4[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(g4(s));let u=t.add(pi({pulse:ce(i)}));return o=t.add(kre({field:ek,sort:t.sortRef(r),pulse:ce(u)})),ce(o)}function _4(e,t){return e&&(!e.field&&!e.op?Q(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?O("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!E4[e.op]&&O("Multiple domain scales can not be sorted using "+e.op)),e}function Ore(e,t,n){let r=n.map(i=>{let o=t.getData(i.data);return o||vy(i.data),o.domainRef(t,i.field)});return ce(t.add(xre({values:r})))}function Ire(e,t,n){let r=n.map(i=>{let o=t.getData(i.data);return o||vy(i.data),o.extentRef(t,i.field)});return ce(t.add(yre({extents:r})))}function Pre(e,t){return e.signal||I(e)?hy(e,t):t.objectProperty(e)}function Lre(e,t){return e.signal?t.signalRef(e.signal):Q(e)?{interval:Or(e.interval),step:Or(e.step)}:Or(e)}function zre(e,t){t.interpolate=Or(e.type||e),e.gamma!=null&&(t.interpolateGamma=Or(e.gamma))}function A4(e,t,n){let r=t.config.range,i=e.range;if(i.signal)return t.signalRef(i.signal);if(Z(i)){if(r&&ee(r,i))return e=he({},e,{range:r[i]}),A4(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=Ua(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:O("Unrecognized scale range value: "+G(i))}else if(i.scheme){n.scheme=I(i.scheme)?hy(i.scheme,t):Or(i.scheme,t),i.extent&&(n.schemeExtent=hy(i.extent,t)),i.count&&(n.schemeCount=Or(i.count,t));return}else if(i.step){n.rangeStep=Or(i.step,t);return}else{if(Ua(e.type)&&!I(i))return S4(i,e,t);I(i)||O("Unsupported range type: "+G(i))}return i.map(o=>(I(o)?hy:Or)(o,t))}function Bre(e,t){let n=t.config.projection||{},r={};for(let i in e)i!=="name"&&(r[i]=nk(e[i],i,t));for(let i in n)r[i]==null&&(r[i]=nk(n[i],i,t));t.addProjection(e.name,r)}function nk(e,t,n){return I(e)?e.map(r=>nk(r,t,n)):Q(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:O("Unsupported parameter object: "+G(e)):e}var mi="top",jc="left",Wc="right",cs="bottom",k4="center",Ure="vertical",qre="start",jre="middle",Wre="end",rk="index",fk="label",Gre="offset",Uc="perc",Hre="perc2",Ir="value",_p="guide-label",dk="guide-title",Yre="group-title",Vre="group-subtitle",KP="symbol",py="gradient",ik="discrete",ok="size",Xre="shape",Kre="fill",Qre="stroke",Jre="strokeWidth",Zre="strokeDash",eie="opacity",hk=[ok,Xre,Kre,Qre,Jre,Zre,eie],Ap={name:1,style:1,interactive:1},Te={value:0},Pr={value:1},wy="group",C4="rect",pk="rule",tie="symbol",Lu="text";function Sp(e){return e.type=wy,e.interactive=e.interactive||!1,e}function tr(e,t){let n=(r,i)=>di(e[r],di(t[r],i));return n.isVertical=r=>Ure===di(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>di(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>di(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>di(e.columns,di(t.columns,+n.isVertical(!0))),n}function F4(e,t){let n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function nie(e,t,n){let r=t.config.style[n];return r&&r[e]}function Ey(e,t,n){return`item.anchor === '${qre}' ? ${e} : item.anchor === '${Wre}' ? ${t} : ${n}`}var mk=Ey(G(jc),G(Wc),G(k4));function rie(e){let t=e("tickBand"),n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Q(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function R4(e,t){return t?e?Q(e)?Object.assign({},e,{offset:R4(e.offset,t)}):{value:e,offset:t}:t:e}function dr(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=qc(e.encode,t,Ap)):e.interactive=!1,e}function iie(e,t,n,r){let i=tr(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength(),u,l,c,f,d;o?(l=[0,1],c=[0,0],f=a,d=s):(l=[0,0],c=[1,0],f=s,d=a);let h={enter:u={opacity:Te,x:Te,y:Te,width:Gt(f),height:Gt(d)},update:he({},u,{opacity:Pr,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Te}};return on(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),dr({type:C4,role:$ne,encode:h},r)}function oie(e,t,n,r,i){let o=tr(e,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength(),l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");let p={opacity:Te,fill:{scale:t,field:Ir}};p[l]={signal:h+"datum."+Uc,mult:u},p[c]=Te,p[f]={signal:h+"datum."+Hre,mult:u},p[d]=Gt(s);let m={enter:p,update:he({},p,{opacity:Pr}),exit:{opacity:Te}};return on(m,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),dr({type:C4,role:Rne,key:Ir,from:i,encode:m},r)}var aie=`datum.${Uc}<=0?"${jc}":datum.${Uc}>=1?"${Wc}":"${k4}"`,sie=`datum.${Uc}<=0?"${cs}":datum.${Uc}>=1?"${mi}":"${jre}"`;function QP(e,t,n,r){let i=tr(e,t),o=i.isVertical(),a=Gt(i.gradientThickness()),s=i.gradientLength(),u=i("labelOverlap"),l,c,f,d,h="",p={enter:l={opacity:Te},update:c={opacity:Pr,text:{field:fk}},exit:{opacity:Te}};return on(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:di(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:sie},f="y",d="x",h="1-"):(l.align=c.align={signal:aie},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Uc,mult:s},l[d]=c[d]=a,a.offset=di(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:i("labelSeparation"),method:u,order:"datum."+rk}:void 0,dr({type:Lu,role:c4,style:_p,key:Ir,from:r,encode:p,overlap:u},n)}function uie(e,t,n,r,i){let o=tr(e,t),a=n.entries,s=!!(a&&a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${Gre} : datum.${ok}`,h=l?Gt(l):{field:ok},p=`datum.${rk}`,m=`max(1, ${i})`,g,y,b,v,w;h.mult=.5,g={enter:y={opacity:Te,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Pr,x:y.x,y:y.y},exit:{opacity:Te}};let E=null,_=null;e.fill||(E=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),on(g,{fill:o("symbolFillColor",E),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),hk.forEach(M=>{e[M]&&(b[M]=y[M]={scale:e[M],field:Ir})});let S=dr({type:tie,role:Tne,key:Ir,from:f,clip:l?!0:void 0,encode:g},n.symbols),k=Gt(c);k.offset=o("labelOffset"),g={enter:y={opacity:Te,x:{signal:d,offset:k},y:h},update:b={opacity:Pr,text:{field:fk},x:y.x,y:y.y},exit:{opacity:Te}},on(g,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});let C=dr({type:Lu,role:c4,style:_p,key:Ir,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!l},width:Te,height:l?Gt(l):Te,opacity:Te},exit:{opacity:Te},update:b={opacity:Pr,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v=`ceil(item.mark.items.length / ${m})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,w={field:["row",p]}):(b.row.signal=`floor(${p} / ${m})`,b.column.signal=`${p} % ${m}`,w={field:p}),b.column.signal=`(${i})?${b.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:rk}},Sp({role:uk,from:r,encode:qc(g,a,Ap),marks:[S,C],name:u,interactive:s,sort:w})}function lie(e,t){let n=tr(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}var gk='item.orient === "left"',yk='item.orient === "right"',Sy=`(${gk} || ${yk})`,cie=`datum.vgrad && ${Sy}`,fie=Ey('"top"','"bottom"','"middle"'),die=Ey('"right"','"left"','"center"'),hie=`datum.vgrad && ${yk} ? (${die}) : (${Sy} && !(datum.vgrad && ${gk})) ? "left" : ${mk}`,pie=`item._anchor || (${Sy} ? "middle" : "start")`,mie=`${cie} ? (${gk} ? -90 : 90) : 0`,gie=`${Sy} ? (datum.vgrad ? (${yk} ? "bottom" : "top") : ${fie}) : "top"`;function yie(e,t,n,r){let i=tr(e,t),o={enter:{opacity:Te},update:{opacity:Pr,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Te}};return on(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:pie},angle:{signal:mie},align:{signal:hie},baseline:{signal:gie},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),dr({type:Lu,role:Dne,style:dk,from:r,encode:o},n)}function xie(e,t){let n;return Q(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+JP(e.path)+")":e.sphere&&(n="geoShape("+JP(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function JP(e){return Q(e)&&e.signal?e.signal:G(e)}function M4(e){let t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===wy?uk:t||ak}function bie(e){return{marktype:e.type,name:e.name||void 0,role:e.role||M4(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function vie(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function xk(e,t){let n=Km(e.type);n||O("Unrecognized transform type: "+G(e.type));let r=xy(n.type.toLowerCase(),null,$4(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function $4(e,t,n){let r={},i=e.params.length;for(let o=0;o<i;++o){let a=e.params[o];r[a.name]=wie(a,t,n)}return r}function wie(e,t,n){let r=e.type,i=t[e.name];if(r==="index")return Eie(e,t,n);if(i===void 0){e.required&&O("Missing required "+G(t.type)+" parameter: "+G(e.name));return}else{if(r==="param")return Sie(e,t,n);if(r==="projection")return n.projectionRef(t[e.name])}return e.array&&!Ot(i)?i.map(o=>ZP(e,o,n)):ZP(e,i,n)}function ZP(e,t,n){let r=e.type;if(Ot(t))return t4(r)?O("Expression references can not be signals."):QA(r)?n.fieldRef(t):n4(r)?n.compareRef(t):n.signalRef(t.signal);{let i=e.expr||QA(r);return i&&_ie(t)?n.exprRef(t.expr,t.as):i&&Aie(t)?wp(t.field,t.as):t4(r)?ci(t,n):kie(r)?ce(n.getData(t).values):QA(r)?wp(t):n4(r)?n.compareRef(t):t}}function Eie(e,t,n){return Z(t.from)||O('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Sie(e,t,n){let r=t[e.name];return e.array?(I(r)||O("Expected an array of sub-parameters. Instead: "+G(r)),r.map(i=>e4(e,i,n))):e4(e,r,n)}function e4(e,t,n){let r=e.params.length,i;for(let a=0;a<r;++a){i=e.params[a];for(let s in i.key)if(i.key[s]!==t[s]){i=null;break}if(i)break}i||O("Unsupported parameter: "+G(t));let o=he($4(i,t,n),i.key);return ce(n.add(vre(o)))}var _ie=e=>e&&e.expr,Aie=e=>e&&e.field,kie=e=>e==="data",t4=e=>e==="expr",QA=e=>e==="field",n4=e=>e==="compare";function Cie(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||O("Only group marks can be faceted."),r.field!=null?a=s=my(r,n):(e.data?s=ce(n.getData(e.data).aggregate):(o=xk(he({type:"aggregate",groupby:J(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=my(r,n),a=s=ce(n.add(o))),i=n.keyRef(r.groupby,!0))):a=ce(n.add(pi(null,[{}]))),a||(a=my(e,n)),{key:i,pulse:a,parent:s}}function my(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ce(t.getData(e.data).output)}function Iu(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}Iu.fromEntries=function(e,t){let n=t.length,r=t[n-1],i=t[n-2],o=t[0],a=null,s=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);s<n;++s)t[s].params.pulse=ce(t[s-1]),e.add(t[s]),t[s].type==="aggregate"&&(a=t[s]);return new Iu(e,o,i,r,a)};function T4(e){return Z(e)?e:null}function r4(e,t,n){let r=by(n.op,n.field),i;if(t.ops){for(let o=0,a=t.as.length;o<a;++o)if(t.as[o]===r)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((i=n.op.signal)?e.signalRef(i):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(r))}function bp(e,t,n,r,i,o,a){let s=t[n]||(t[n]={}),u=Kne(o),l=T4(i),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=s[l]),!c){let d=o?{field:ek,pulse:t.countsRef(e,i,o)}:{field:e.fieldRef(i),pulse:ce(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(xy(r,void 0,d)),a&&(t.index[i]=f),c=ce(f),l!=null&&(s[l]=c)}return c}Iu.prototype={countsRef(e,t,n){let r=this,i=r.counts||(r.counts={}),o=T4(t),a,s,u;return o!=null&&(e=r.scope,a=i[o]),a?n&&n.field&&r4(e,a.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ce(r.output)},n&&n.field&&r4(e,u,n),s=e.add(g4(u)),a=e.add(pi({pulse:ce(s)})),a={agg:s,ref:ce(a)},o!=null&&(i[o]=a)),a.ref},tuplesRef(){return ce(this.values)},extentRef(e,t){return bp(e,this,"extent","extent",t,!1)},domainRef(e,t){return bp(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return bp(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return bp(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return bp(e,this,"indata","tupleindex",t,!0,!0)}};function Fie(e,t,n){let r=e.from.facet,i=r.name,o=my(r,t),a;r.name||O("Facet must have a name: "+G(r)),r.data||O("Facet must reference a data set: "+G(r)),r.field?a=t.add(b4({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(fre({key:t.keyRef(r.groupby),group:ce(t.proxy(n.parent)),pulse:o})):O("Facet must specify groupby or field: "+G(r));let s=t.fork(),u=s.add(pi()),l=s.add(Pu({pulse:ce(u)}));s.addData(i,new Iu(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}function Rie(e,t,n){let r=t.add(b4({pulse:n.pulse})),i=t.fork();i.add(Pu()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}function D4(e,t,n){let r=e.remove,i=e.insert,o=e.toggle,a=e.modify,s=e.values,u=t.add(gy()),l="if("+e.trigger+',modify("'+n+'",'+[i,r,o,a,s].map(f=>f??"null").join(",")+"),0)",c=ci(l,t);u.update=c.$expr,u.params=c.$params}function _y(e,t){let n=M4(e),r=e.type===wy,i=e.from&&e.from.facet,o=e.overlap,a=e.layout||n===uk||n===sk,s,u,l,c,f,d,h,p=n===ak||a||i,m=Cie(e.from,r,t);u=t.add(lre({key:m.key||(e.key?wp(e.key):void 0),pulse:m.pulse,clean:!r}));let g=ce(u);u=l=t.add(pi({pulse:g})),u=t.add(gre({markdef:bie(e),interactive:vie(e.interactive,t),clip:xie(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ce(u)}));let y=ce(u);u=c=t.add(x4(p4(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(_=>{let S=xk(_,t),k=S.metadata;(k.generates||k.changes)&&O("Mark transforms should not generate new data."),k.nomod||(c.params.mod=!0),S.params.pulse=ce(u),t.add(u=S)}),e.sort&&(u=t.add(Are({sort:t.compareRef(e.sort),pulse:ce(u)})));let b=ce(u);(i||a)&&(a=t.add(w4({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ce(a));let v=t.add(y4({mark:y,pulse:d||b}));h=ce(v),r&&(p&&(s=t.operators,s.pop(),a&&s.pop()),t.pushState(b,d||h,g),i?Fie(e,t,m):p?Rie(e,t,m):t.parse(e),t.popState(),p&&(a&&s.push(a),s.push(v))),o&&(h=Mie(o,h,t));let w=t.add(v4({pulse:h})),E=t.add(Pu({pulse:ce(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Iu(t,l,w,E)),e.on&&e.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&O("Marks only support modify triggers."),D4(_,t,f)}))}function Mie(e,t,n){let r=e.method,i=e.bound,o=e.separation,a={separation:Ot(o)?n.signalRef(o.signal):o,method:Ot(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(a.sort=n.compareRef({field:e.order})),i){let s=i.tolerance;a.boundTolerance=Ot(s)?n.signalRef(s.signal):+s,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return ce(n.add(bre(a)))}function $ie(e,t){let n=t.config.legend,r=e.encode||{},i=tr(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={},c=0,f,d,h;hk.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||O("Missing valid scale for legend.");let p=Tie(e,t.scaleType(c)),m={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&i.isVertical()},g=ce(t.add(pi(null,[m]))),y={enter:{x:{value:0},y:{value:0}}},b=ce(t.add(pre(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===py?(h=[iie(e,c,n,r.gradient),QP(e,n,r.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Ou(i.gradientLength())})/100))`)):p===ik?h=[oie(e,c,n,r.gradient,b),QP(e,n,r.labels,b)]:(f=lie(e,n),h=[uie(e,n,r,b,Ou(f.columns))],d.size=Oie(e,t,h[0].marks)),h=[Sp({role:Mne,from:g,encode:y,marks:h,layout:f,interactive:s})],m.title&&h.push(yie(e,n,r.title,g)),_y(Sp({role:Fne,from:g,encode:qc(Nie(i,e,n),o,Ap),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),t)}function Tie(e,t){let n=e.type||KP;return!e.type&&Die(e)===1&&(e.fill||e.stroke)&&(n=Vd(t)?py:i0(t)?ik:KP),n!==py?n:i0(t)?ik:py}function Die(e){return hk.reduce((t,n)=>t+(e[n]?1:0),0)}function Nie(e,t,n){let r={enter:{},update:{}};return on(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function Oie(e,t,n){let r=Ou(i4("size",e,n)),i=Ou(i4("strokeWidth",e,n)),o=Ou(Iie(n[1].encode,t,_p));return ci(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function i4(e,t,n){return t[e]?`scale("${t[e]}",datum)`:F4(e,n[0].encode)}function Iie(e,t,n){return F4("fontSize",e)||nie("fontSize",t,n)}var Pie=`item.orient==="${jc}"?-90:item.orient==="${Wc}"?90:0`;function Lie(e,t){e=Z(e)?{text:e}:e;let n=tr(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l={},c=ce(t.add(pi(null,[l])));return u.push(Uie(e,n,zie(e),c)),e.subtitle&&u.push(qie(e,n,r.subtitle,c)),_y(Sp({role:Nne,from:c,encode:Bie(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}function zie(e){let t=e.encode;return t&&t.title||he({name:e.name,interactive:e.interactive,style:e.style},t)}function Bie(e,t){let n={enter:{},update:{}};return on(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:mk},angle:{signal:Pie},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),qc(n,t,Ap)}function Uie(e,t,n,r){let i={value:0},o=e.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return on(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),dr({type:Lu,role:One,style:Yre,from:r,encode:a},n)}function qie(e,t,n,r){let i={value:0},o=e.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return on(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),dr({type:Lu,role:Ine,style:Vre,from:r,encode:a},n)}function jie(e,t){let n=[];e.transform&&e.transform.forEach(r=>{n.push(xk(r,t))}),e.on&&e.on.forEach(r=>{D4(r,t,e.name)}),t.addDataPipeline(e.name,Wie(e,t,n))}function Wie(e,t,n){let r=[],i=null,o=!1,a=!1,s,u,l,c,f;for(e.values?Ot(e.values)||dy(e.format)?(r.push(o4(t,e)),r.push(i=Nu())):r.push(i=Nu({$ingest:e.values,$format:e.format})):e.url?dy(e.url)||dy(e.format)?(r.push(o4(t,e)),r.push(i=Nu())):r.push(i=Nu({$request:e.url,$format:e.format})):e.source&&(i=s=J(e.source).map(d=>ce(t.getData(d).output)),r.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!i&&!f.source&&r.push(i=Nu()),r.push(c),f.generates&&(a=!0),f.modifies&&!a&&(o=!0),f.source?i=c:f.changes&&(i=null);return s&&(l=s.length-1,r[0]=Sre({derive:o,pulse:l?s:s[0]}),(o||l)&&r.splice(1,0,Nu())),i||r.push(Nu()),r.push(Pu({})),r}function Nu(e){let t=pi({},e);return t.metadata={source:!0},t}function o4(e,t){return mre({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}var N4=e=>e===cs||e===mi,Ay=(e,t,n)=>Ot(e)?Vie(e.signal,t,n):e===jc||e===mi?t:n,Ht=(e,t,n)=>Ot(e)?Hie(e.signal,t,n):N4(e)?t:n,hi=(e,t,n)=>Ot(e)?Yie(e.signal,t,n):N4(e)?n:t,O4=(e,t,n)=>Ot(e)?Xie(e.signal,t,n):e===mi?{value:t}:{value:n},Gie=(e,t,n)=>Ot(e)?Kie(e.signal,t,n):e===Wc?{value:t}:{value:n},Hie=(e,t,n)=>I4(`${e} === '${mi}' || ${e} === '${cs}'`,t,n),Yie=(e,t,n)=>I4(`${e} !== '${mi}' && ${e} !== '${cs}'`,t,n),Vie=(e,t,n)=>bk(`${e} === '${jc}' || ${e} === '${mi}'`,t,n),Xie=(e,t,n)=>bk(`${e} === '${mi}'`,t,n),Kie=(e,t,n)=>bk(`${e} === '${Wc}'`,t,n),I4=(e,t,n)=>(t=t!=null?Gt(t):t,n=n!=null?Gt(n):n,a4(t)&&a4(n)?(t=t?t.signal||G(t.value):null,n=n?n.signal||G(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[he({test:e},t)].concat(n||[])),a4=e=>e==null||Object.keys(e).length===1,bk=(e,t,n)=>({signal:`${e} ? (${zc(t)}) : (${zc(n)})`}),Qie=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${jc}' ? (${zc(r)}) : `:"")+(n!=null?`${e} === '${cs}' ? (${zc(n)}) : `:"")+(i!=null?`${e} === '${Wc}' ? (${zc(i)}) : `:"")+(t!=null?`${e} === '${mi}' ? (${zc(t)}) : `:"")+"(null)"}),zc=e=>Ot(e)?e.signal:e==null?null:G(e),Jie=(e,t)=>t===0?0:Ot(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Bc=(e,t)=>{let n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Pc(e,t,n,r){let i;if(t&&ee(t,e))return t[e];if(ee(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[dk][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[_p][i]}return null}function s4(e){let t={};for(let n of e)if(n)for(let r in n)t[r]=1;return Object.keys(t)}function Zie(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,a=e.orient,s,u,l;if(Ot(a)){let f=s4([n.axisX,n.axisY]),d=s4([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);s={};for(l of f)s[l]=Ht(a,Pc(l,n.axisX,i,r),Pc(l,n.axisY,i,r));u={};for(l of d)u[l]=Qie(a.signal,Pc(l,n.axisTop,i,r),Pc(l,n.axisBottom,i,r),Pc(l,n.axisLeft,i,r),Pc(l,n.axisRight,i,r))}else s=a===mi||a===cs?n.axisX:n.axisY,u=n["axis"+a[0].toUpperCase()+a.slice(1)];return s||u||o?he({},i,s,u,o):i}function eoe(e,t,n,r){let i=tr(e,t),o=e.orient,a,s,u={enter:a={opacity:Te},update:s={opacity:Pr},exit:{opacity:Te}};on(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});let l=u4(e,0),c=u4(e,1);return a.x=s.x=Ht(o,l,Te),a.x2=s.x2=Ht(o,c),a.y=s.y=hi(o,l,Te),a.y2=s.y2=hi(o,c),dr({type:pk,role:Sne,from:r,encode:u},n)}function u4(e,t){return{scale:e.scale,range:t}}function toe(e,t,n,r,i){let o=tr(e,t),a=e.orient,s=e.gridScale,u=Ay(a,1,-1),l=noe(e.offset,u),c,f,d,h={enter:c={opacity:Te},update:d={opacity:Pr},exit:f={opacity:Te}};on(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});let p={scale:e.scale,field:Ir,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},m=Ht(a,{signal:"height"},{signal:"width"}),g=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:he(m,{mult:u,offset:l});return c.x=d.x=Ht(a,p,g),c.y=d.y=hi(a,p,g),c.x2=d.x2=hi(a,y),c.y2=d.y2=Ht(a,y),f.x=Ht(a,p),f.y=hi(a,p),dr({type:pk,role:_ne,key:Ir,from:r,encode:h},n)}function noe(e,t){if(t!==1)if(!Q(e))e=Ot(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=he({},e);for(;n.mult!=null;)if(Q(n.mult))n=n.mult=he({},n.mult);else return n.mult=Ot(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function roe(e,t,n,r,i,o){let a=tr(e,t),s=e.orient,u=Ay(s,-1,1),l,c,f,d={enter:l={opacity:Te},update:f={opacity:Pr},exit:c={opacity:Te}};on(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});let h=Gt(i);h.mult=u;let p={scale:e.scale,field:Ir,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=Ht(s,Te,p),f.y2=l.y2=Ht(s,h),c.x=Ht(s,p),f.x=l.x=hi(s,Te,p),f.x2=l.x2=hi(s,h),c.y=hi(s,p),dr({type:pk,role:kne,key:Ir,from:r,encode:d},n)}function JA(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function ioe(e,t,n,r,i,o){let a=tr(e,t),s=e.orient,u=e.scale,l=Ay(s,-1,1),c=Ou(a("labelFlush")),f=Ou(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline"),p=c===0||!!c,m,g=Gt(i);g.mult=l,g.offset=Gt(a("labelPadding")||0),g.offset.mult=l;let y={scale:u,field:Ir,band:.5,offset:R4(o.offset,a("labelOffset"))},b=Ht(s,p?JA(u,c,'"left"','"right"','"center"'):{value:"center"},Gie(s,"left","right")),v=Ht(s,O4(s,"bottom","top"),p?JA(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),w=JA(u,c,`-(${f})`,f,0);p=p&&f;let E={opacity:Te,x:Ht(s,y,g),y:hi(s,y,g)},_={enter:E,update:m={opacity:Pr,text:{field:fk},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:Te,x:E.x,y:E.y}};on(_,{dx:!d&&p?Ht(s,w):null,dy:!h&&p?hi(s,w):null}),on(_,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});let S=a("labelBound"),k=a("labelOverlap");return k=k||S?{separation:a("labelSeparation"),method:k,order:"datum.index",bound:S?{scale:u,orient:s,tolerance:S}:null}:void 0,m.align!==b&&(m.align=Bc(m.align,b)),m.baseline!==v&&(m.baseline=Bc(m.baseline,v)),dr({type:Lu,role:Ane,style:_p,key:Ir,from:r,encode:_,overlap:k},n)}function ooe(e,t,n,r){let i=tr(e,t),o=e.orient,a=Ay(o,-1,1),s,u,l={enter:s={opacity:Te,anchor:Gt(i("titleAnchor",null)),align:{signal:mk}},update:u=he({},s,{opacity:Pr,text:Gt(e.title)}),exit:{opacity:Te}},c={signal:`lerp(range("${e.scale}"), ${Ey(0,1,.5)})`};return u.x=Ht(o,c),u.y=hi(o,c),s.angle=Ht(o,Te,Jie(a,90)),s.baseline=Ht(o,O4(o,cs,mi),{value:cs}),u.angle=s.angle,u.baseline=s.baseline,on(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),aoe(i,o,l,n),l.update.align=Bc(l.update.align,s.align),l.update.angle=Bc(l.update.angle,s.angle),l.update.baseline=Bc(l.update.baseline,s.baseline),dr({type:Lu,role:Cne,style:dk,from:r,encode:l},n)}function aoe(e,t,n,r){let i=(s,u)=>s!=null?(n.update[u]=Bc(Gt(s),n.update[u]),!1):!Lc(u,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?Gt(a):Ht(t,Gt(a),Gt(o))}function soe(e,t){let n=Zie(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=tr(e,n),l=rie(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ce(t.add(pi({},[c]))),d=ce(t.add(ure({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[],p;return c.grid&&h.push(toe(e,n,r.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(roe(e,n,r.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(ioe(e,n,r.labels,d,p,l))),c.domain&&h.push(eoe(e,n,r.domain,f)),c.title&&h.push(ooe(e,n,r.title,f)),_y(Sp({role:Ene,from:f,encode:qc(uoe(u,e),i,Ap),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),t)}function uoe(e,t){let n={enter:{},update:{}};return on(n,{orient:e("orient"),offset:e("offset")||0,position:di(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function P4(e,t,n){let r=J(e.signals),i=J(e.scales);return n||r.forEach(o=>m4(o,t)),J(e.projections).forEach(o=>Bre(o,t)),i.forEach(o=>Fre(o,t)),J(e.data).forEach(o=>jie(o,t)),i.forEach(o=>Rre(o,t)),(n||r).forEach(o=>sre(o,t)),J(e.axes).forEach(o=>soe(o,t)),J(e.marks).forEach(o=>_y(o,t)),J(e.legends).forEach(o=>$ie(o,t)),e.title&&Lie(e.title,t),t.parseLambdas(),t}var loe=e=>qc({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function coe(e,t){let n=t.config,r=ce(t.root=t.add(gy())),i=foe(e,n);i.forEach(l=>m4(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;let o=t.add(pi()),a=t.add(x4(p4(loe(e.encode),wy,sk,e.style,t,{pulse:ce(o)}))),s=t.add(w4({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:ce(a)}));t.operators.pop(),t.pushState(ce(a),ce(s),null),P4(e,t,i),t.operators.push(s);let u=t.add(y4({mark:r,pulse:ce(s)}));return u=t.add(v4({pulse:ce(u)})),u=t.add(Pu({pulse:ce(u)})),t.addData("root",new Iu(t,o,o,u)),t}function vp(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function foe(e,t){let n=a=>di(e[a],t[a]),r=[vp("background",n("background")),vp("autosize",bne(n("autosize"))),vp("padding",wne(n("padding"))),vp("width",n("width")||0),vp("height",n("height")||0)],i=r.reduce((a,s)=>(a[s.name]=s,a),{}),o={};return J(e.signals).forEach(a=>{ee(i,a.name)?a=he(i[a.name],a):r.push(a),o[a.name]=a}),J(t.signals).forEach(a=>{!ee(o,a.name)&&!ee(i,a.name)&&r.push(a)}),r}function L4(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function l4(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}L4.prototype=l4.prototype={parse(e){return P4(e,this)},fork(){return new l4(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){let t=e instanceof ZA?ce(e):e;return this.add(Ere({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let a,s;r&&(a=r.data||(r.data={}),s=a[i]||(a[i]=[]),s.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(let r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(ce(this.add(Pu({pulse:e})))),this._parent.push(t),this._lookup.push(n?ce(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ve(this._parent)},encode(){return ve(this._encode)},lookup(){return ve(this._lookup)},markpath(){let e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Z(e))return wp(e,t);e.signal||O("Unsupported field reference: "+G(e));let n=e.signal,r=this.field[n];if(!r){let i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=ce(this.add(dre(i)))}return r},compareRef(e){let t=!1,n=o=>Ot(o)?(t=!0,this.signalRef(o.signal)):Qne(o)?(t=!0,this.exprRef(o.expr)):o,r=J(e.field).map(n),i=J(e.order).map(n);return t?ce(this.add(XP({fields:r,orders:i}))):YP(r,i)},keyRef(e,t){let n=!1,r=o=>Ot(o)?(n=!0,ce(i[o.signal])):o,i=this.signals;return e=J(e).map(r),n?ce(this.add(hre({fields:e,flat:t}))):Yne(e,t)},sortRef(e){if(!e)return e;let t=by(e.op,e.field),n=e.order||Vne;return n.signal?ce(this.add(XP({fields:t,orders:this.signalRef(n.signal)}))):YP(t,n)},event(e,t){let n=e+":"+t;if(!this.events[n]){let r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return ee(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&O("Duplicate signal name: "+G(e));let n=t instanceof ZA?t:this.add(gy(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||O("Unrecognized signal name: "+G(e)),this.signals[e]},signalRef(e){return this.signals[e]?ce(this.signals[e]):(ee(this.lambdas,e)||(this.lambdas[e]=this.add(gy(null))),ce(this.lambdas[e]))},parseLambdas(){let e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){let r=e[t],i=ci(r,this),o=this.lambdas[r];o.params=i.$params,o.update=i.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!Q(e)?e:this.signalRef(e.signal||vk(e))},exprRef(e,t){let n={expr:ci(e,this)};return t&&(n.expr.$name=t),ce(this.add(cre(n)))},addBinding(e,t){this.bindings||O("Nested signals do not support binding: "+G(e)),this.bindings.push(he({signal:e},t))},addScaleProj(e,t){ee(this.scales,e)&&O("Duplicate scale or projection name: "+G(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,_re(t))},addProjection(e,t){this.addScaleProj(e,wre(t))},getScale(e){return this.scales[e]||O("Unrecognized scale name: "+G(e)),this.scales[e]},scaleRef(e){return ce(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return ee(this.data,e)&&O("Duplicate data set name: "+G(e)),this.data[e]=t},getData(e){return this.data[e]||O("Undefined data set name: "+G(e)),this.data[e]},addDataPipeline(e,t){return ee(this.data,e)&&O("Duplicate data set name: "+G(e)),this.addData(e,Iu.fromEntries(this,t))}};function vk(e){return(I(e)?doe:hoe)(e)}function doe(e){let t=e.length,n="[";for(let r=0;r<t;++r){let i=e[r];n+=(r>0?",":"")+(Q(i)?i.signal||vk(i):G(i))}return n+"]"}function hoe(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+G(r)+":"+(Q(i)?i.signal||vk(i):G(i));return t+"}"}function poe(){let e="sans-serif",r="#4c78a8",i="#000",o="#888",a="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:a},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:a,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:a,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function z4(e,t,n){return Q(e)||O("Input Vega specification must be an object."),t=bo(poe(),t,e.config),coe(e,new L4(t,n)).toRuntime()}var moe="6.2.0";he(Mo,w2,NE,zE,r_,y_,oA,V_,lA,dA,mA,xA);var goe=moe;x();function yoe(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var xoe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},boe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},voe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e},woe=Array.prototype.slice,zu=(e,t,n)=>{let r=n?n(t[0]):t[0];return r[e].apply(r,woe.call(t,1))},Eoe=(e,t=0,n=1,r=0,i=0,o=0,a=0)=>Z(e)?new Date(e):new Date(e,t,n,r,i,o,a),Soe={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:Eoe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return zu("join",arguments)},indexof:function(){return zu("indexOf",arguments)},lastindexof:function(){return zu("lastIndexOf",arguments)},slice:function(){return zu("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(vo),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return zu("substring",arguments,String)},split:function(){return zu("split",arguments,String)},replace:function(){return zu("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)},_oe=["view","item","group","xy","x","y"],Ek=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Ek.add(setImmediate);var Aoe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{let n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:xoe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{let n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);let i=e(t.property);if(n&&(e.memberDepth-=1),Ek.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{let n=t.arguments,r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||Soe[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>boe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>voe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,r)=>{e.memberDepth+=1;let i=e(r.key);e.memberDepth-=1;let o=e(r.value);return Cf.has(i)?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):Ek.has(o)?console.error(`Prevented interpretation of method "${i}" which could lead to insecure code execution`):n[i]=o,n},{})};function kp(e,t,n,r,i,o){let a=s=>Aoe[s.type](a,s);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,_oe.forEach(s=>a.fn[s]=(...u)=>i.vega[s](...u)),a(e)}var Gc={operator(e,t){let n=t.ast,r=e.functions;return i=>kp(n,r,i)},parameter(e,t){let n=t.ast,r=e.functions;return(i,o)=>kp(n,r,o,i)},event(e,t){let n=t.ast,r=e.functions;return i=>kp(n,r,void 0,void 0,i)},handler(e,t){let n=t.ast,r=e.functions;return(i,o)=>{let a=o.item&&o.item.datum;return kp(n,r,i,a,o)}},encode(e,t){let{marktype:n,channels:r}=t,i=e.functions,o=n==="group"||n==="image"||n==="rect";return(a,s)=>{let u=a.datum,l=0,c;for(let f in r)c=kp(r[f].ast,i,s,u,void 0,a),a[f]!==c&&(a[f]=c,l=1);return n!=="rule"&&yoe(a,r,o),l}}};var eR={};Sn(eR,{accessPathDepth:()=>tf,accessPathWithDatum:()=>LC,accessWithDatumToUnescapedPath:()=>Ue,compile:()=>Ohe,contains:()=>Ae,deepEqual:()=>mr,deleteNestedProperty:()=>Ny,duplicate:()=>xe,entries:()=>ms,every:()=>OC,fieldIntersection:()=>PC,flatAccessWithDatum:()=>Z6,getFirstDefined:()=>vt,hasIntersection:()=>IC,hasProperty:()=>Y,hash:()=>Re,internalField:()=>rL,isBoolean:()=>Tp,isEmpty:()=>Ve,isEqual:()=>Roe,isInternalField:()=>iL,isNullOrFalse:()=>Pk,isNumeric:()=>cx,keys:()=>H,logicalExpr:()=>Rp,mergeDeep:()=>Q6,never:()=>K6,normalize:()=>tz,normalizeAngle:()=>Dp,omit:()=>gr,pick:()=>Zc,prefixGenerator:()=>Lk,removePathFromField:()=>gf,replaceAll:()=>ju,replacePathInField:()=>zr,resetIdCounter:()=>$oe,setEqual:()=>J6,some:()=>ef,stringify:()=>Pe,titleCase:()=>Hp,unescapeSingleQuoteAndPathDot:()=>eL,unique:()=>no,uniqueId:()=>nL,vals:()=>Ft,varName:()=>ot,version:()=>Lhe});x();var koe="6.4.1",Coe={version:koe};function TC(e){return Y(e,"or")}function DC(e){return Y(e,"and")}function NC(e){return Y(e,"not")}function Ty(e,t){if(NC(e))Ty(e.not,t);else if(DC(e))for(let n of e.and)Ty(n,t);else if(TC(e))for(let n of e.or)Ty(n,t);else t(e)}function Xc(e,t){return NC(e)?{not:Xc(e.not,t)}:DC(e)?{and:e.and.map(n=>Xc(n,t))}:TC(e)?{or:e.or.map(n=>Xc(n,t))}:t(e)}var xe=structuredClone;function K6(e){throw new Error(e)}function Zc(e,t){let n={};for(let r of t)ee(e,r)&&(n[r]=e[r]);return n}function gr(e,t){let n={...e};for(let r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Pe(e)).join(",")})`};function Re(e){if(ke(e))return e;let t=Z(e)?e:Pe(e);if(t.length<250)return t;let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return n}function Pk(e){return e===!1||e===null}function Ae(e,t){return e.includes(t)}function ef(e,t){let n=0;for(let[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function OC(e,t){let n=0;for(let[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function Q6(e,...t){for(let n of t)Foe(e,n??{});return e}function Foe(e,t){for(let n of H(t))ya(e,n,t[n],!0)}function no(e,t){let n=[],r={},i;for(let o of e)i=t(o),!(i in r)&&(r[i]=1,n.push(o));return n}function Roe(e,t){let n=H(e),r=H(t);if(n.length!==r.length)return!1;for(let i of n)if(e[i]!==t[i])return!1;return!0}function J6(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function IC(e,t){for(let n of e)if(t.has(n))return!0;return!1}function Lk(e){let t=new Set;for(let n of e){let i=vr(n).map((a,s)=>s===0?a:`[${a}]`),o=i.map((a,s)=>i.slice(0,s+1).join(""));for(let a of o)t.add(a)}return t}function PC(e,t){return e===void 0||t===void 0?!0:IC(Lk(e),Lk(t))}function Ve(e){return H(e).length===0}var H=Object.keys,Ft=Object.values,ms=Object.entries;function Tp(e){return e===!0||e===!1}function ot(e){let t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Rp(e,t){return NC(e)?`!(${Rp(e.not,t)})`:DC(e)?`(${e.and.map(n=>Rp(n,t)).join(") && (")})`:TC(e)?`(${e.or.map(n=>Rp(n,t)).join(") || (")})`:t(e)}function Ny(e,t){if(t.length===0)return!0;let n=t.shift();return n in e&&Ny(e[n],t)&&delete e[n],Ve(e)}function Hp(e){return e.charAt(0).toUpperCase()+e.substr(1)}function LC(e,t="datum"){let n=vr(e),r=[];for(let i=1;i<=n.length;i++){let o=`[${n.slice(0,i).map(G).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function Z6(e,t="datum"){return`${t}[${G(vr(e).join("."))}]`}function Ue(e){return`datum['${e.replaceAll("'","\\'")}']`}function eL(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function Moe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function zr(e){return`${vr(e).map(Moe).join("\\.")}`}function ju(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function gf(e){return`${vr(e).join(".")}`}function tf(e){return e?vr(e).length:0}function vt(...e){return e.find(t=>t!==void 0)}var tL=42;function nL(e){let t=++tL;return e?String(e)+t:t}function $oe(){tL=42}function rL(e){return iL(e)?e:`__${e}`}function iL(e){return e.startsWith("__")}function Dp(e){if(e!==void 0)return(e%360+360)%360}function cx(e){return ke(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}var B4=Object.getPrototypeOf(structuredClone({}));function mr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!mr(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let o of e.entries())if(!t.has(o[0]))return!1;for(let o of e.entries())if(!mr(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==B4.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==B4.toString)return e.toString()===t.toString();let i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let o=i[r];if(!mr(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pe(e){let t=[];return(function n(r){if(r?.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?`${r}`:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;i<r.length;i++)i&&(o+=","),o+=n(r[i])||"null";return`${o}]`}if(r===null)return"null";if(t.includes(r))throw new TypeError("Converting circular structure to JSON");let a=t.push(r)-1,s=Object.keys(r).sort();for(o="",i=0;i<s.length;i++){let u=s[i],l=n(r[u]);l&&(o&&(o+=","),o+=`${JSON.stringify(u)}:${l}`)}return t.splice(a,1),`{${o}}`})(e)}function Y(e,t){return Q(e)&&ee(e,t)&&e[t]!==void 0}var Jo="row",Zo="column",fx="facet",at="x",Kt="y",Si="x2",uo="y2",Ss="xOffset",yf="yOffset",_i="radius",la="radius2",Ur="theta",ca="theta2",Ai="latitude",ki="longitude",Ci="latitude2",Br="longitude2",_s="time",nr="color",lo="fill",co="stroke",rr="shape",fa="size",el="angle",da="opacity",As="fillOpacity",ks="strokeOpacity",Cs="strokeWidth",Fs="strokeDash",Yp="text",nf="order",Vp="detail",dx="key",Wu="tooltip",hx="href",px="url",mx="description",Toe={x:1,y:1,x2:1,y2:1},oL={theta:1,theta2:1,radius:1,radius2:1};function aL(e){return ee(oL,e)}var zC={longitude:1,longitude2:1,latitude:1,latitude2:1};function sL(e){switch(e){case Ai:return"y";case Ci:return"y2";case ki:return"x";case Br:return"x2"}}function uL(e){return ee(zC,e)}var Doe=H(zC),BC={...Toe,...oL,...zC,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Kc(e){return e===nr||e===lo||e===co}var lL={row:1,column:1,facet:1},Lr=H(lL),UC={...BC,...lL},Noe=H(UC),{order:jPe,detail:WPe,tooltip:GPe,...Ooe}=UC,{row:HPe,column:YPe,facet:VPe,...Ioe}=Ooe;function Poe(e){return ee(Ioe,e)}function cL(e){return ee(UC,e)}var Loe=[Si,uo,Ci,Br,ca,la];function fL(e){return tl(e)!==e}function tl(e){switch(e){case Si:return at;case uo:return Kt;case Ci:return Ai;case Br:return ki;case ca:return Ur;case la:return _i}return e}function gs(e){if(aL(e))switch(e){case Ur:return"startAngle";case ca:return"endAngle";case _i:return"outerRadius";case la:return"innerRadius"}return e}function fo(e){switch(e){case at:return Si;case Kt:return uo;case Ai:return Ci;case ki:return Br;case Ur:return ca;case _i:return la}}function ir(e){switch(e){case at:case Si:return"width";case Kt:case uo:return"height"}}function dL(e){switch(e){case at:return"xOffset";case Kt:return"yOffset";case Si:return"x2Offset";case uo:return"y2Offset";case Ur:return"thetaOffset";case _i:return"radiusOffset";case ca:return"theta2Offset";case la:return"radius2Offset"}}function qC(e){switch(e){case at:return"xOffset";case Kt:return"yOffset"}}function zoe(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}var Boe=H(BC),{x:XPe,y:KPe,x2:QPe,y2:JPe,xOffset:ZPe,yOffset:e4e,latitude:t4e,longitude:n4e,latitude2:r4e,longitude2:i4e,theta:o4e,theta2:a4e,radius:s4e,radius2:u4e,...jC}=BC,Uoe=H(jC),WC={x:1,y:1},ha=H(WC);function wt(e){return ee(WC,e)}var GC={theta:1,radius:1},qoe=H(GC);function gx(e){return e==="width"?at:Kt}var hL={xOffset:1,yOffset:1};function Xp(e){return ee(hL,e)}var joe={time:1};function Sk(e){return e in joe}var{text:l4e,tooltip:c4e,href:f4e,url:d4e,description:h4e,detail:p4e,key:m4e,order:g4e,...pL}=jC,Woe=H(pL);function Goe(e){return ee(jC,e)}function Hoe(e){switch(e){case nr:case lo:case co:case fa:case rr:case da:case Cs:case Fs:return!0;case As:case ks:case el:case _s:return!1}}var mL={...WC,...GC,...hL,...pL},HC=H(mL);function ho(e){return ee(mL,e)}function Yoe(e,t){return Xoe(e)[t]}var gL={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:y4e,...Voe}=gL;function Xoe(e){switch(e){case nr:case lo:case co:case mx:case Vp:case dx:case Wu:case hx:case nf:case da:case As:case ks:case Cs:case fx:case Jo:case Zo:return gL;case at:case Kt:case Ss:case yf:case Ai:case ki:case _s:return Voe;case Si:case uo:case Ci:case Br:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case fa:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Fs:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case rr:return{point:"always",geoshape:"always"};case Yp:return{text:"always"};case el:return{point:"always",square:"always",text:"always"};case px:return{image:"always"};case Ur:return{text:"always",arc:"always"};case _i:return{text:"always",arc:"always"};case ca:case la:return{arc:"always"}}}function _k(e){switch(e){case at:case Kt:case Ur:case _i:case Ss:case yf:case fa:case el:case Cs:case da:case As:case ks:case _s:case Si:case uo:case ca:case la:return;case fx:case Jo:case Zo:case rr:case Fs:case Yp:case Wu:case hx:case px:case mx:return"discrete";case nr:case lo:case co:return"flexible";case Ai:case ki:case Ci:case Br:case Vp:case dx:case nf:return}}var Koe={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Qoe={count:1,min:1,max:1};function na(e){return Y(e,"argmin")}function Rs(e){return Y(e,"argmax")}function YC(e){return Z(e)&&ee(Koe,e)}var Joe=new Set(["count","valid","missing","distinct"]);function yx(e){return Z(e)&&Joe.has(e)}function Zoe(e){return Z(e)&&Ae(["min","max"],e)}var eae=new Set(["count","sum","distinct","valid","missing"]),tae=new Set(["mean","average","median","q1","q3","min","max"]);function yL(e){return Gr(e)&&(e=Rx(e,void 0)),`bin${H(e).map(t=>xx(e[t])?ot(`_${t}_${ms(e[t])}`):ot(`_${t}_${e[t]}`)).join("")}`}function Xe(e){return e===!0||nl(e)&&!e.binned}function an(e){return e==="binned"||nl(e)&&e.binned===!0}function nl(e){return Q(e)}function xx(e){return Y(e,"param")}function U4(e){switch(e){case Jo:case Zo:case fa:case nr:case lo:case co:case Cs:case da:case As:case ks:case rr:return 6;case Fs:return 4;default:return 10}}function Kp(e){return Y(e,"expr")}function sn(e,{level:t}={level:0}){let n=H(e||{}),r={};for(let i of n)r[i]=t===0?pr(e[i]):sn(e[i],{level:t-1});return r}function xL(e){let{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:a,color:s,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=e,g={...m,...s?{fill:s}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...a!==void 0?{limit:a}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Zc(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:g,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function ds(e){return Z(e)||I(e)&&Z(e[0])}function le(e){return Y(e,"signal")}function rl(e){return Y(e,"step")}function nae(e){return I(e)?!1:Y(e,"fields")&&!Y(e,"data")}function rae(e){return I(e)?!1:Y(e,"fields")&&Y(e,"data")}function Qo(e){return I(e)?!1:Y(e,"field")&&Y(e,"data")}var iae={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},oae=H(iae),aae={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},zk=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],sae=" \u2013 ";function bL(e){let t=I(e.condition)?e.condition.map(q4):q4(e.condition);return{...pr(e),condition:t}}function pr(e){if(Kp(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function q4(e){if(Kp(e)){let{expr:t,...n}=e;return{signal:t,...n}}return e}function et(e){if(Kp(e)){let{expr:t,...n}=e;return{signal:t,...n}}return le(e)?e:e!==void 0?{value:e}:void 0}function uae(e){return le(e)?e.signal:G(e)}function j4(e){return le(e)?e.signal:G(e.value)}function yi(e){return le(e)?e.signal:e==null?null:G(e)}function lae(e,t,n){for(let r of n){let i=oo(r,t.markDef,t.config);i!==void 0&&(e[r]=et(i))}return e}function vL(e){return[].concat(e.type,e.style??[])}function Ie(e,t,n,r={}){let{vgChannel:i,ignoreVgConfig:o}=r;return i&&Y(t,i)?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:oo(e,t,n,r)}function oo(e,t,n,{vgChannel:r}={}){let i=Bk(e,t,n.style);return vt(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function Bk(e,t,n){return wL(e,vL(t),n)}function wL(e,t,n){t=J(t);let r;for(let i of t){let o=n[i];Y(o,e)&&(r=o[e])}return r}function EL(e,t){return J(e).reduce((n,r)=>(n.field.push(te(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function SL(e,t){let n=[...e];return t.forEach(r=>{for(let i of n)if(mr(i,r))return;n.push(r)}),n}function _L(e,t){return mr(e,t)||!t?e:e?[...J(e),...J(t)].join(", "):t}function AL(e,t){let n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((ds(n)||le(n))&&(ds(r)||le(r)))return{explicit:e.explicit,value:_L(n,r)};if(ds(n)||le(n))return{explicit:e.explicit,value:n};if(ds(r)||le(r))return{explicit:e.explicit,value:r};if(!ds(n)&&!le(n)&&!ds(r)&&!le(r))return{explicit:e.explicit,value:SL(n,r)};throw new Error("It should never reach here")}function VC(e){return`Invalid specification ${Pe(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}var cae='Autosize "fit" only works for single views and layered views.';function W4(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function G4(e){let t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function H4(e){return e?`Dropping "fit-${e}" because spec has discrete ${ir(e)}.`:'Dropping "fit" because spec has discrete size.'}function XC(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Y4(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function fae(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function dae(e){return`The "nearest" transform is not supported for ${e} marks.`}function kL(e){return`Selection not supported for ${e} yet.`}function hae(e){return`Cannot find a selection named "${e}".`}var pae="Scale bindings are currently only supported for scales with unbinned, continuous domains.",mae="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",gae="Legend bindings are only supported for selections over an individual field or encoding channel.";function yae(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function xae(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}var bae="The same selection must be used to override scale domains in a layered view.",vae='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function wae(e){return`Unknown repeated value "${e}".`}function V4(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}var Eae="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",KC="Animation involving facet, layer, or concat is currently unsupported.";function Sae(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${G(e)}.`}function _ae(e,t,n,r){return`${e.length?"Multiple ":"No "}matching ${G(t)} encoding found for selection ${G(n.param)}. Using "field": ${G(r)}.`}var Aae="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function kae(e){return`Unrecognized parse "${e}".`}function X4(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}var Cae="Attempt to add the same child twice.";function Fae(e){return`Ignoring an invalid transform: ${Pe(e)}.`}var Rae='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function K4(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Mae(e){let{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Pe(t)} is overridden by a child projection ${Pe(n)}.`}var $ae="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Tae(e){return`${e}Offset dropped because ${e} is continuous`}function Dae(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Pe(n)}}.`}function CL(e){return`Invalid field type "${e}".`}function Nae(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Oae(e){return`Invalid aggregation operator "${e}".`}function FL(e,t){let{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function Iae(e){return`Position range does not support relative band size for ${e}.`}function Uk(e,t){return`Dropping ${Pe(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}var Pae="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function bx(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Lae(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function zae(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Bae(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Uae(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Ak(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function qae(e){return`The ${e} for range marks cannot be an expression`}function jae(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Wae(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Gae(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Hae(e){return`Cannot use the relative band size with ${e} scale.`}function Yae(e){return`Using unaggregated domain with raw field has no effect (${Pe(e)}).`}function Vae(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Xae(e){return`Unaggregated domain is currently unsupported for log scale (${Pe(e)}).`}function Kae(e){return`Cannot apply size to non-oriented mark "${e}".`}function Qae(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Jae(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function RL(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function ML(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Zae(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Pe(n)} and ${Pe(r)}). Using ${Pe(n)}.`}function ese(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Pe(n)} and ${Pe(r)}). Using the union of the two domains.`}function tse(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function nse(e){return`Dropping sort property ${Pe(e)} as unioned domains only support boolean or op "count", "min", and "max".`}var Q4="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",rse="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",ise="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",ose="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function ase(e){return`Cannot stack "${e}" if there is already "${e}2".`}function sse(e){return`Stack is applied to a non-linear scale (${e}).`}function use(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Oy(e,t){return`Invalid ${e}: ${Pe(t)}.`}function lse(e){return`Dropping day from datetime ${Pe(e)} as day cannot be combined with other units.`}function cse(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function fse(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function dse(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function J4(e){return`1D error band does not support ${e}.`}function $L(e){return`Channel ${e} is required for "binned" bin.`}function hse(e){return`Channel ${e} should not be used with "binned" bin.`}function pse(e){return`Domain for ${e} is required for threshold scale.`}var TL=Ns(bm),Gu=TL;function mse(e){return Gu=e,Gu}function gse(){return Gu=TL,Gu}function QC(...e){Gu.error(...e)}function X(...e){Gu.warn(...e)}function yse(...e){Gu.debug(...e)}function il(e){if(e&&Q(e)){for(let t of ZC)if(Y(e,t))return!0}return!1}var DL=["january","february","march","april","may","june","july","august","september","october","november","december"],xse=DL.map(e=>e.substr(0,3)),NL=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],bse=NL.map(e=>e.substr(0,3));function vse(e){if(cx(e)&&(e=+e),ke(e))return e>4&&X(Oy("quarter",e)),e-1;throw new Error(Oy("quarter",e))}function wse(e){if(cx(e)&&(e=+e),ke(e))return e-1;{let t=e.toLowerCase(),n=DL.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=xse.indexOf(r);if(i!==-1)return i;throw new Error(Oy("month",e))}}function Ese(e){if(cx(e)&&(e=+e),ke(e))return e%7;{let t=e.toLowerCase(),n=NL.indexOf(t);if(n!==-1)return n;let r=t.substr(0,3),i=bse.indexOf(r);if(i!==-1)return i;throw new Error(Oy("day",e))}}function JC(e,t){let n=[];if(t&&e.day!==void 0&&H(e).length>1&&(X(lse(e)),e=xe(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){let r=t?wse(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){let r=t?vse(e.quarter):e.quarter;n.push(ke(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){let r=t?Ese(e.day):e.day;n.push(ke(r)?r+1:`${r}+1`)}else n.push(1);for(let r of["hours","minutes","seconds","milliseconds"]){let i=e[r];n.push(typeof i>"u"?0:i)}return n}function Hu(e){let n=JC(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Sse(e){let n=JC(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function _se(e){let t=JC(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}var OL={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},ZC=H(OL);function Ase(e){return ee(OL,e)}function ol(e){return Q(e)?e.binned:IL(e)}function IL(e){return e?.startsWith("binned")}function eF(e){return e.startsWith("utc")}function kse(e){return e.substring(3)}var Cse={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function vx(e){return ZC.filter(t=>LL(e,t))}function PL(e){let t=vx(e);return t[t.length-1]}function LL(e,t){let n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Fse(e,t,{end:n}={end:!1}){let r=LC(t),i=eF(e)?"utc":"";function o(u){return u==="quarter"?`(${i}quarter(${r})-1)`:`${i}${u}(${r})`}let a,s={};for(let u of ZC)LL(e,u)&&(s[u]=o(u),a=u);return n&&(s[a]+="+1"),Sse(s)}function zL(e){if(!e)return;let t=vx(e);return`timeUnitSpecifier(${Pe(t)}, ${Pe(Cse)})`}function Rse(e,t,n){if(!e)return;let r=zL(e);return`${n||eF(e)?"utc":"time"}Format(${t}, ${r})`}function Vt(e){if(!e)return;let t;return Z(e)?IL(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Q(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),eF(t.unit)&&(t.utc=!0,t.unit=kse(t.unit)),t}function Mse(e){let{utc:t,...n}=Vt(e);return n.unit?(t?"utc":"")+H(n).map(r=>ot(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):`${t?"utc":""}timeunit${H(n).map(r=>ot(`_${r}_${n[r]}`)).join("")}`}function BL(e,t=n=>n){let n=Vt(e),r=PL(n.unit);if(r&&r!=="day"){let i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:a}=UL(r,n.step),s={...i,[a]:+i[a]+o};return`${t(Hu(s))} - ${t(Hu(i))}`}}var $se={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Tse(e){return ee($se,e)}function UL(e,t=1){if(Tse(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Dse(e){return Y(e,"param")}function tF(e){return!!e?.field&&e.equal!==void 0}function nF(e){return!!e?.field&&e.lt!==void 0}function rF(e){return!!e?.field&&e.lte!==void 0}function iF(e){return!!e?.field&&e.gt!==void 0}function oF(e){return!!e?.field&&e.gte!==void 0}function aF(e){if(e?.field){if(I(e.range)&&e.range.length===2)return!0;if(le(e.range))return!0}return!1}function sF(e){return!!e?.field&&(I(e.oneOf)||I(e.in))}function Nse(e){return!!e?.field&&e.valid!==void 0}function qL(e){return sF(e)||tF(e)||aF(e)||nF(e)||iF(e)||rF(e)||oF(e)}function eo(e,t){return Mx(e,{timeUnit:t,wrapTime:!0})}function Ose(e,t){return e.map(n=>eo(n,t))}function jL(e,t=!0){let{field:n}=e,r=Vt(e.timeUnit),{unit:i,binned:o}=r||{},a=te(e,{expr:"datum"}),s=i?`time(${o?a:Fse(i,n)})`:a;if(tF(e))return`${s}===${eo(e.equal,i)}`;if(nF(e)){let u=e.lt;return`${s}<${eo(u,i)}`}else if(iF(e)){let u=e.gt;return`${s}>${eo(u,i)}`}else if(rF(e)){let u=e.lte;return`${s}<=${eo(u,i)}`}else if(oF(e)){let u=e.gte;return`${s}>=${eo(u,i)}`}else{if(sF(e))return`indexof([${Ose(e.oneOf,i).join(",")}], ${s}) !== -1`;if(Nse(e))return wx(s,e.valid);if(aF(e)){let{range:u}=sn(e),l=le(u)?{signal:`${u.signal}[0]`}:u[0],c=le(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return`inrange(${s}, [${eo(l,i)}, ${eo(c,i)}])`;let f=[];return l!==null&&f.push(`${s} >= ${eo(l,i)}`),c!==null&&f.push(`${s} <= ${eo(c,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Pe(e)}`)}function wx(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Ise(e){return qL(e)&&e.timeUnit?{...e,timeUnit:Vt(e.timeUnit)}:e}var Qp={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Pse(e){return e==="quantitative"||e==="temporal"}function uF(e){return e==="ordinal"||e==="nominal"}var Yu=Qp.quantitative,lF=Qp.ordinal,rf=Qp.temporal,cF=Qp.nominal,xf=Qp.geojson;function Lse(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Yu:return"quantitative";case"t":case rf:return"temporal";case"o":case lF:return"ordinal";case"n":case cF:return"nominal";case xf:return"geojson"}}var un={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},qk={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function zse(e,t){let n=qk[e],r=qk[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}var Bse={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Z4(e){return Bse[e]}var WL=new Set(["linear","log","pow","sqrt","symlog"]),GL=new Set([...WL,"time","utc"]);function HL(e){return WL.has(e)}var YL=new Set(["quantile","quantize","threshold"]),Use=new Set([...GL,...YL,"sequential","identity"]),qse=new Set(["ordinal","bin-ordinal","point","band"]);function Xt(e){return qse.has(e)}function bi(e){return Use.has(e)}function ro(e){return GL.has(e)}function of(e){return YL.has(e)}var jse={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Wse(e){return!Z(e)&&Y(e,"name")}function VL(e){return Y(e,"param")}function Gse(e){return Y(e,"unionWith")}function Hse(e){return Q(e)&&"field"in e}var Yse={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:x4e,domain:b4e,range:v4e,rangeMax:w4e,rangeMin:E4e,scheme:S4e,...Vse}=Yse,Xse=H(Vse);function jk(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return ro(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return ro(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return ro(e);case"nice":return ro(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return bi(e)&&!Ae(["log","time","utc","threshold","quantile"],e)}}function XL(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Kc(e)?void 0:Gae(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Kse(e,t){return Ae([lF,cF],t)?e===void 0||Xt(e):t===rf?Ae([un.TIME,un.UTC,void 0],e):t===Yu?HL(e)||of(e)||e===void 0:!0}function Qse(e,t,n=!1){if(!ho(e))return!1;switch(e){case at:case Kt:case Ss:case yf:case Ur:case _i:return ro(t)||t==="band"?!0:t==="point"?!n:!1;case _s:return Ae(["linear","band"],t);case fa:case Cs:case da:case As:case ks:case el:return ro(t)||of(t)||Ae(["band","point","ordinal"],t);case nr:case lo:case co:return t!=="band";case Fs:case rr:return t==="ordinal"||of(t)}}function Jse(e){return Q(e)&&"value"in e}var Wn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},KL=Wn.arc,Ex=Wn.area,Sx=Wn.bar,Zse=Wn.image,_x=Wn.line,Ax=Wn.point,eue=Wn.rect,Iy=Wn.rule,QL=Wn.text,fF=Wn.tick,tue=Wn.trail,dF=Wn.circle,hF=Wn.square,JL=Wn.geoshape;function Ms(e){return["line","area","trail"].includes(e)}function Np(e){return["rect","bar","image","arc","tick"].includes(e)}var nue=new Set(H(Wn));function ao(e){return Y(e,"type")}var rue=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],iue=["fill","fillOpacity"],oue=[...rue,...iue],aue={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},e6=H(aue),kk=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],sue={area:["line","point"],bar:kk,rect:kk,line:["point"],tick:["bandSize","thickness",...kk]},uue={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},lue={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},ZL=H(lue);function Vu(e){return Y(e,"band")}var cue={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},fue=5,pF={binSpacing:0,continuousBandSize:fue,minBandSize:.25,timeUnitBandPosition:.5},due={...pF,binSpacing:1},hue={...pF,thickness:1};function pue(e){return ao(e)?e.type:e}function e8(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function mF({markDef:e,config:t,scaleChannel:n,scaleType:r,isCountAggregate:i}){if(!r||!bi(r)||i)return"always-valid";let o=e8(Ie("invalid",e,t),{isPath:Ms(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":o}function mue(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function t8({scaleName:e,scale:t,mode:n}){let r=`domain('${e}')`;if(!t||!e)return;let i=`${r}[0]`,o=`peek(${r})`,a=t.domainHasZero();return a==="definitely"?{scale:e,value:0}:a==="maybe"?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?i:o})`}}function n8({scaleChannel:e,channelDef:t,scale:n,scaleName:r,markDef:i,config:o}){let a=n?.get("type"),s=wi(t),u=yx(s?.aggregate),l=mF({scaleChannel:e,markDef:i,config:o,scaleType:a,isCountAggregate:u});if(s&&l==="show"){let c=o.scale.invalid?.[e]??"zero-or-min";return{test:wx(te(s,{expr:"datum"}),!1),...gue(c,n,r)}}}function gue(e,t,n){if(Jse(e)){let{value:r}=e;return le(r)?{signal:r.signal}:{value:r}}return t8({scale:t,scaleName:n,mode:"zeroOrMin"})}function gF(e){let{channel:t,channelDef:n,markDef:r,scale:i,scaleName:o,config:a}=e,s=tl(t),u=yF(e),l=n8({scaleChannel:s,channelDef:n,scale:i,scaleName:o,markDef:r,config:a});return l!==void 0?[l,u]:u}function yue(e){let{datum:t}=e;return il(t)?Hu(t):`${Pe(t)}`}function Bu(e,t,n,r){let i={};if(t&&(i.scale=t),po(e)){let{datum:o}=e;il(o)?i.signal=Hu(o):le(o)?i.signal=o.signal:Kp(o)?i.signal=o.expr:i.value=o}else i.field=te(e,n);if(r){let{offset:o,band:a}=r;o&&(i.offset=o),a&&(i.band=a)}return i}function Py({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:a=.5}){let s=!le(a)&&0<a&&a<1?"datum":void 0,u=te(t,{expr:s,suffix:i}),l=n!==void 0?te(n,{expr:s}):te(t,{suffix:o,expr:s}),c={};if(a===0||a===1){c.scale=e;let f=a===0?u:l;c.field=f}else{let f=le(a)?`(1-${a.signal}) * ${u} + ${a.signal} * ${l}`:`${1-a} * ${u} + ${a} * ${l}`;c.signal=`scale("${e}", ${f})`}return r&&(c.offset=r),c}function xue({scaleName:e,fieldDef:t}){let n=te(t,{expr:"datum"}),r=te(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${r}) - scale("${e}", ${n}))`}function yF({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l,bandPosition:c}){if(t){if(be(t)){let f=a?.get("type");if(jn(t)){c??=ys({fieldDef:t,fieldDef2:n,markDef:r,config:i});let{bin:d,timeUnit:h,type:p}=t;if(Xe(d)||c&&h&&p===rf)return s?.impute?Bu(t,o,{binSuffix:"mid"},{offset:u}):c&&!Xt(f)?Py({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Bu(t,o,nm(t,e)?{binSuffix:"range"}:{},{offset:u});if(an(d)){if(V(n))return Py({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});X($L(e===at?Si:uo))}}return Bu(t,o,Xt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(vi(t)){let f=t.value,d=u?{offset:u}:{};return{...Mp(e,f),...d}}}return de(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Mp(e,t){return Ae(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:Ae(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:et(t)}function Xu(e){return e&&e!=="number"&&e!=="time"}function r8(e,t,n){return`${e}(${t}${n?`, ${Pe(n)}`:""})`}function xF({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:i,config:o}){if(Xu(n))return xi({fieldOrDatumDef:e,format:t,formatType:n,expr:r,config:o});let a=i8(e,r,i),s=af(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(s==="quantitative"){if(i&&o.normalizedNumberFormatType)return xi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:r,config:o});if(o.numberFormatType)return xi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:r,config:o})}if(s==="temporal"&&o.timeFormatType&&V(e)&&e.timeUnit===void 0)return xi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:r,config:o})}function u(l){return V(l)?Vt(l.timeUnit)||{}:{unit:void 0,utc:void 0}}if(uf(e)){let{unit:l,utc:c}=u(e),f=vue({field:a,timeUnit:l,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:c||al(e)&&e.scale?.type===un.UTC});return f?{signal:f}:void 0}if(t=Wk({type:s,specifiedFormat:t,config:o,normalizeStack:i}),V(e)&&Xe(e.bin)){let l=te(e,{expr:r,binSuffix:"end"});return{signal:Jp(a,l,t,n,o)}}else return t||af(e)==="quantitative"?{signal:`${s8(a,t)}`}:{signal:`isValid(${a}) ? ${a} : ""+${a}`}}function i8(e,t,n){return V(e)?n?`${te(e,{expr:t,suffix:"end"})}-${te(e,{expr:t,suffix:"start"})}`:te(e,{expr:t}):yue(e)}function xi({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:i,config:o,field:a}){if(a??=i8(e,r,i),a!=="datum.value"&&V(e)&&Xe(e.bin)){let s=te(e,{expr:r,binSuffix:"end"});return{signal:Jp(a,s,t,n,o)}}return{signal:r8(n,a,t)}}function o8(e,t,n,r,i,o){if(!(Z(r)&&Xu(r))&&!(n===void 0&&r===void 0&&i.customFormatTypes&&af(e)==="quantitative"&&(i.normalizedNumberFormatType&&sf(e)&&e.stack==="normalize"||i.numberFormatType))){if(sf(e)&&e.stack==="normalize"&&i.normalizedNumberFormat)return Wk({type:"quantitative",config:i,normalizeStack:!0});if(uf(e)){let a=V(e)?Vt(e.timeUnit)?.unit:void 0;return a===void 0&&i.customFormatTypes&&i.timeFormatType?void 0:bue({specifiedFormat:n,timeUnit:a,config:i,omitTimeFormatConfig:o})}return Wk({type:t,specifiedFormat:n,config:i})}}function a8(e,t,n){if(e&&(le(e)||e==="number"||e==="time"))return e;if(uf(t)&&n!=="time"&&n!=="utc")return V(t)&&Vt(t?.timeUnit)?.utc?"utc":"time"}function Wk({type:e,specifiedFormat:t,config:n,normalizeStack:r}){if(Z(t))return t;if(e===Yu)return r?n.normalizedNumberFormat:n.numberFormat}function bue({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:r}){return e||(t?{signal:zL(t)}:r?void 0:n.timeFormat)}function s8(e,t){return`format(${e}, "${t||""}")`}function t6(e,t,n,r){return Xu(n)?r8(n,e,t):s8(e,(Z(t)?t:void 0)??r.numberFormat)}function Jp(e,t,n,r,i){if(n===void 0&&r===void 0&&i.customFormatTypes&&i.numberFormatType)return Jp(e,t,i.numberFormat,i.numberFormatType,i);let o=t6(e,n,r,i),a=t6(t,n,r,i);return`${wx(e,!1)} ? "null" : ${o} + "${sae}" + ${a}`}function vue({field:e,timeUnit:t,format:n,formatType:r,rawTimeFormat:i,isUTCScale:o}){return!t||n?!t&&r?`${r}(${e}, ${Pe(n)})`:(n=Z(n)?n:i,`${o?"utc":"time"}Format(${e}, ${Pe(n)})`):Rse(t,e,o)}var kx="min",wue={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function n6(e){return ee(wue,e)}function Eue(e){return Y(e,"encoding")}function ea(e){return e&&(e.op==="count"||Y(e,"field"))}function u8(e){return e&&I(e)}function Zp(e){return Y(e,"row")||Y(e,"column")}function bF(e){return Y(e,"header")}function Cx(e){return Y(e,"facet")}function Sue(e){return Y(e,"param")}function _ue(e){return!Z(e)&&Y(e,"repeat")}function r6(e){let{field:t,timeUnit:n,bin:r,aggregate:i}=e;return{...n?{timeUnit:n}:{},...r?{bin:r}:{},...i?{aggregate:i}:{},field:t}}function vF(e){return Y(e,"sort")}function ys({fieldDef:e,fieldDef2:t,markDef:n,config:r}){if(be(e)&&e.bandPosition!==void 0)return e.bandPosition;if(V(e)){let{timeUnit:i,bin:o}=e;if(i&&!t)return oo("timeUnitBandPosition",n,r);if(Xe(o))return .5}}function l8({channel:e,fieldDef:t,fieldDef2:n,markDef:r,config:i,scaleType:o,useVlSizeChannel:a}){let s=ir(e),u=Ie(a?"size":s,r,i,{vgChannel:s});if(u!==void 0)return u;if(V(t)){let{timeUnit:l,bin:c}=t;if(l&&!n)return{band:oo("timeUnitBandSize",r,i)};if(Xe(c)&&!Xt(o))return{band:1}}if(Np(r.type))return o?Xt(o)?i[r.type]?.discreteBandSize||{band:1}:i[r.type]?.continuousBandSize:i[r.type]?.discreteBandSize}function c8(e,t,n,r){return Xe(e.bin)||e.timeUnit&&jn(e)&&e.type==="temporal"?ys({fieldDef:e,fieldDef2:t,markDef:n,config:r})!==void 0:!1}function f8(e){return Y(e,"sort")&&!Y(e,"field")}function em(e){return Y(e,"condition")}function Fx(e){let t=e?.condition;return!!t&&!I(t)&&V(t)}function tm(e){let t=e?.condition;return!!t&&!I(t)&&be(t)}function Aue(e){let t=e?.condition;return!!t&&(I(t)||vi(t))}function V(e){return Y(e,"field")||e?.aggregate==="count"}function af(e){return e?.type}function po(e){return Y(e,"datum")}function hs(e){return jn(e)&&!zy(e)||Ly(e)}function i6(e){return jn(e)&&e.type==="quantitative"&&!e.bin||Ly(e)}function Ly(e){return po(e)&&ke(e.datum)}function be(e){return V(e)||po(e)}function jn(e){return e&&(Y(e,"field")||e.aggregate==="count")&&Y(e,"type")}function vi(e){return Y(e,"value")}function al(e){return Y(e,"scale")||Y(e,"sort")}function sf(e){return Y(e,"axis")||Y(e,"stack")||Y(e,"impute")}function d8(e){return Y(e,"legend")}function h8(e){return Y(e,"format")||Y(e,"formatType")}function kue(e){return gr(e,["legend","axis","header","scale"])}function Cue(e){return Y(e,"op")}function te(e,t={}){let n=e.field,r=t.prefix,i=t.suffix,o="";if(Rue(e))n=rL("count");else{let a;if(!t.nofn)if(Cue(e))a=e.op;else{let{bin:s,aggregate:u,timeUnit:l}=e;Xe(s)?(a=yL(s),i=(t.binSuffix??"")+(t.suffix??"")):u?Rs(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):na(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):a=String(u):l&&!ol(l)&&(a=Mse(l),i=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}a&&(n=n?`${a}_${n}`:a)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),t.forAs?gf(n):t.expr?Z6(n,t.expr)+o:zr(n)+o}function zy(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return V(e)&&!!e.bin;case"temporal":return!1}throw new Error(CL(e.type))}function Fue(e){return al(e)&&of(e.scale?.type)}function Rue(e){return e.aggregate==="count"}function Mue(e,t){let{field:n,bin:r,timeUnit:i,aggregate:o}=e;if(o==="count")return t.countTitle;if(Xe(r))return`${n} (binned)`;if(i&&!ol(i)){let a=Vt(i)?.unit;if(a)return`${n} (${vx(a).join("-")})`}else if(o)return Rs(o)?`${n} for max ${o.argmax}`:na(o)?`${n} for min ${o.argmin}`:`${Hp(o)} of ${n}`;return n}function $ue(e){let{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(Rs(t))return`${i} for argmax(${t.argmax})`;if(na(t))return`${i} for argmin(${t.argmin})`;let o=r&&!ol(r)?Vt(r):void 0,a=t||o?.unit||o?.maxbins&&"timeunit"||Xe(n)&&"bin";return a?`${a.toUpperCase()}(${i})`:i}var p8=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return $ue(e);default:return Mue(e,t)}},m8=p8;function g8(e){m8=e}function Tue(){g8(p8)}function Qc(e,t,{allowDisabling:n,includeDefault:r=!0}){let i=wF(e)?.title;if(!V(e))return i??e.title;let o=e,a=r?EF(o,t):void 0;return n?vt(i,o.title,a):i??o.title??a}function wF(e){if(sf(e)&&e.axis)return e.axis;if(d8(e)&&e.legend)return e.legend;if(bF(e)&&e.header)return e.header}function EF(e,t){return m8(e,t)}function By(e){if(h8(e)){let{format:t,formatType:n}=e;return{format:t,formatType:n}}else{let t=wF(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function Due(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(vF(e)&&I(e.sort))return"ordinal";let{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Rs(n)&&!na(n))return"quantitative";if(al(e)&&e.scale?.type)switch(qk[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function wi(e){if(V(e))return e;if(Fx(e))return e.condition}function It(e){if(be(e))return e;if(tm(e))return e.condition}function y8(e,t,n,r={}){if(Z(e)||ke(e)||Gr(e)){let i=Z(e)?"string":ke(e)?"number":"boolean";return X(Dae(t,i,e)),{value:e}}return be(e)?Uy(e,t,n,r):tm(e)?{...e,condition:Uy(e.condition,t,n,r)}:e}function Uy(e,t,n,r){if(h8(e)){let{format:i,formatType:o,...a}=e;if(Xu(o)&&!n.customFormatTypes)return X(K4(t)),Uy(a,t,n,r)}else{let i=sf(e)?"axis":d8(e)?"legend":bF(e)?"header":null;if(i&&e[i]){let{format:o,formatType:a,...s}=e[i];if(Xu(a)&&!n.customFormatTypes)return X(K4(t)),Uy({...e,[i]:s},t,n,r)}}return V(e)?SF(e,t,r):Nue(e)}function Nue(e){let t=e.type;if(t)return e;let{datum:n}=e;return t=ke(n)?"quantitative":Z(n)?"nominal":il(n)?"temporal":void 0,{...e,type:t}}function SF(e,t,{compositeMark:n=!1}={}){let{aggregate:r,timeUnit:i,bin:o,field:a}=e,s={...e};if(!n&&r&&!YC(r)&&!Rs(r)&&!na(r)&&(X(Oae(r)),delete s.aggregate),i&&(s.timeUnit=Vt(i)),a&&(s.field=`${a}`),Xe(o)&&(s.bin=Rx(o,t)),an(o)&&!wt(t)&&X(hse(t)),jn(s)){let{type:u}=s,l=Lse(u);u!==l&&(s.type=l),u!=="quantitative"&&yx(r)&&(X(Nae(u,r)),s.type="quantitative")}else if(!fL(t)){let u=Due(s,t);s.type=u}if(jn(s)){let{compatible:u,warning:l}=Oue(s,t)||{};u===!1&&X(l)}if(vF(s)&&Z(s.sort)){let{sort:u}=s;if(n6(u))return{...s,sort:{encoding:u}};let l=u.substring(1);if(u.charAt(0)==="-"&&n6(l))return{...s,sort:{encoding:l,order:"descending"}}}if(bF(s)){let{header:u}=s;if(u){let{orient:l,...c}=u;if(l)return{...s,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return s}function Rx(e,t){return Gr(e)?{maxbins:U4(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:U4(t)}:e}var Hc={compatible:!0};function Oue(e,t){let n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Jo:case Zo:case fx:return zy(e)?Hc:{compatible:!1,warning:zae(t)};case at:case Kt:case Ss:case yf:case nr:case lo:case co:case Yp:case Vp:case dx:case Wu:case hx:case px:case el:case Ur:case _i:case mx:return Hc;case ki:case Br:case Ai:case Ci:return n!==Yu?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Hc;case da:case As:case ks:case Cs:case fa:case ca:case la:case Si:case uo:case _s:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Hc;case rr:case Fs:return!zy(e)&&!Fue(e)?{compatible:!1,warning:Bae(t)}:Hc;case nf:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Hc}}function uf(e){let{formatType:t}=By(e);return t==="time"||!t&&Iue(e)}function Iue(e){return e&&(e.type==="temporal"||V(e)&&!!e.timeUnit)}function Mx(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){let o=t&&Vt(t)?.unit,a=o||n==="temporal",s;return Kp(e)?s=e.expr:le(e)?s=e.signal:il(e)?(a=!0,s=Hu(e)):(Z(e)||ke(e))&&a&&(s=`datetime(${Pe(e)})`,Ase(o)&&(ke(e)&&e<1e4||Z(e)&&isNaN(Date.parse(e)))&&(s=Hu({[o]:e}))),s?r&&a?`time(${s})`:s:i?void 0:Pe(e)}function x8(e,t){let{type:n}=e;return t.map(r=>{let i=V(e)&&!ol(e.timeUnit)?e.timeUnit:void 0,o=Mx(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function nm(e,t){return Xe(e.bin)?ho(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}var o6={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function rm(e){return e?.condition}var b8=["domain","grid","labels","ticks","title"],Pue={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},v8={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Lue={...v8,style:1,labelExpr:1,encoding:1};function a6(e){return ee(Lue,e)}var zue={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},w8=H(zue);function pa(e){return Y(e,"mark")}var lf=class{name;run;constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return pa(t)?pue(t.mark)===this.name:!1}};function Uu(e,t){let n=e?.[t];return n?I(n)?ef(n,r=>!!r.field):V(n)||Fx(n):!1}function E8(e,t){let n=e?.[t];return n?I(n)?ef(n,r=>!!r.field):V(n)||po(n)||tm(n):!1}function S8(e,t){if(wt(t)){let n=e[t];if((V(n)||po(n))&&(uF(n.type)||V(n)&&n.timeUnit)){let r=qC(t);return E8(e,r)}}return!1}function _8(e){return ef(Noe,t=>{if(Uu(e,t)){let n=e[t];if(I(n))return ef(n,r=>!!r.aggregate);{let r=wi(n);return r&&!!r.aggregate}}return!1})}function A8(e,t){let n=[],r=[],i=[],o=[],a={};return _F(e,(s,u)=>{if(V(s)){let{field:l,aggregate:c,bin:f,timeUnit:d,...h}=s;if(c||d||f){let m=wF(s)?.title,g=te(s,{forAs:!0}),y={...m?[]:{title:Qc(s,t,{allowDisabling:!0})},...h,field:g};if(c){let b;if(Rs(c)?(b="argmax",g=te({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${g}.${l}`):na(c)?(b="argmin",g=te({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${g}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){let v={op:b,as:g};l&&(v.field=l),o.push(v)}}else if(n.push(g),jn(s)&&Xe(f)){if(r.push({bin:f,field:l,as:g}),n.push(te(s,{binSuffix:"end"})),nm(s,u)&&n.push(te(s,{binSuffix:"range"})),wt(u)){let b={field:`${g}_end`};a[`${u}2`]=b}y.bin="binned",fL(u)||(y.type=Yu)}else if(d&&!ol(d)){i.push({timeUnit:d,field:l,as:g});let b=jn(s)&&s.type!==rf&&"time";b&&(u===Yp||u===Wu?y.formatType=b:Goe(u)?y.legend={formatType:b,...y.legend}:wt(u)&&(y.axis={formatType:b,...y.axis}))}a[u]=y}else n.push(l),a[u]=e[u]}else a[u]=e[u]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function Bue(e,t,n){let r=Yoe(t,n);if(r){if(r==="binned"){let i=e[t===Si?at:Kt];return!!(V(i)&&V(e[t])&&an(i.bin))}}else return!1;return!0}function Uue(e,t,n,r){let i={};for(let o of H(e))cL(o)||X(Lae(o));for(let o of Boe){if(!e[o])continue;let a=e[o];if(Xp(o)){let s=zoe(o),u=i[s];if(V(u)&&Pse(u.type)&&V(a)&&!u.timeUnit){X(Tae(s));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(X($ae),o=Ur),!Bue(e,o,t)){X(bx(o,t));continue}if(o===fa&&t==="line"&&wi(e[o])?.aggregate){X(Pae);continue}if(o===nr&&(n?"fill"in e:"stroke"in e)){X(FL("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Vp||o===nf&&!I(a)&&!vi(a)||o===Wu&&I(a)){if(a){if(o===nf){let s=e[o];if(f8(s)){i[o]=s;continue}}i[o]=J(a).reduce((s,u)=>(V(u)?s.push(SF(u,o)):X(Uk(u,o)),s),[])}}else{if(o===Wu&&a===null)i[o]=null;else if(!V(a)&&!po(a)&&!vi(a)&&!em(a)&&!le(a)){X(Uk(a,o));continue}i[o]=y8(a,o,r)}}return i}function $x(e,t){let n={};for(let r of H(e)){let i=y8(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function que(e){let t=[];for(let n of H(e))if(Uu(e,n)){let r=e[n],i=J(r);for(let o of i)V(o)?t.push(o):Fx(o)&&t.push(o.condition)}return t}function _F(e,t,n){if(e)for(let r of H(e)){let i=e[r];if(I(i))for(let o of i)t.call(n,o,r);else t.call(n,i,r)}}function jue(e,t,n,r){return e?H(e).reduce((i,o)=>{let a=e[o];return I(a)?a.reduce((s,u)=>t.call(r,s,u,o),i):t.call(r,i,a,o)},n):n}function k8(e,t){return H(t).reduce((n,r)=>{switch(r){case at:case Kt:case hx:case mx:case px:case Si:case uo:case Ss:case yf:case Ur:case ca:case _i:case la:case _s:case Ai:case ki:case Ci:case Br:case Yp:case rr:case el:case Wu:return n;case nf:if(e==="line"||e==="trail")return n;case Vp:case dx:{let i=t[r];if(I(i)||V(i))for(let o of J(i))o.aggregate||n.push(te(o,{}));return n}case fa:if(e==="trail")return n;case nr:case lo:case co:case da:case As:case ks:case Fs:case Cs:{let i=wi(t[r]);return i&&!i.aggregate&&n.push(te(i,{})),n}}},[])}function Wue(e){let{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(I(t)){for(let o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return I(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function Gk(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};let i=e.map(({fieldPrefix:a,titlePrefix:s})=>{let u=r?` of ${AF(t)}`:"";return{field:a+t.field,type:t.type,title:le(s)?{signal:`${s}"${escape(u)}"`}:s+u}}),o=que(n).map(kue);return{tooltip:[...i,...no(o,Re)]}}function AF(e){let{title:t,field:n}=e;return vt(t,n)}function kF(e,t,n,r,i){let{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{let d=AF(n);return C8(e,s,i,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...a!==void 0?{axis:a}:{}},...Z(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...r,...f}})}}function C8(e,t,n,r){let{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...a?{opacity:a}:{},...ao(r.mark)?r.mark:{type:r.mark},style:`${s}-${String(t)}`,...Gr(e[t])?{}:e[t]}}]:[]}function F8(e,t,n){let{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],a=r[`${i}2`],s=r[`${i}Error`],u=r[`${i}Error2`];return{continuousAxisChannelDef:ky(o,n),continuousAxisChannelDef2:ky(a,n),continuousAxisChannelDefError:ky(s,n),continuousAxisChannelDefError2:ky(u,n),continuousAxis:i}}function ky(e,t){if(e?.aggregate){let{aggregate:n,...r}=e;return n!==t&&X(dse(n,t)),r}else return e}function R8(e,t){let{mark:n,encoding:r}=e,{x:i,y:o}=r;if(ao(n)&&n.orient)return n.orient;if(hs(i)){if(hs(o)){let a=V(i)&&i.aggregate,s=V(o)&&o.aggregate;if(!a&&s===t)return"vertical";if(!s&&a===t)return"horizontal";if(a===t&&s===t)throw new Error("Both x and y cannot have aggregate");return uf(o)&&!uf(i)?"horizontal":"vertical"}return"horizontal"}else{if(hs(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}var qy="boxplot",Gue=["box","median","outliers","rule","ticks"],Hue=new lf(qy,$8);function M8(e){return ke(e)?"tukey":e}function $8(e,{config:t}){e={...e,encoding:$x(e.encoding,t)};let{mark:n,encoding:r,params:i,projection:o,...a}=e,s=ao(n)?n:{type:n};i&&X(kL("boxplot"));let u=s.extent??t.boxplot.extent,l=Ie("size",s,t),c=s.invalid,f=M8(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:m,continuousAxis:g,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:w,boxOrient:E,customTooltipWithoutAggregatedField:_}=Yue(e,u,t),S=gf(m.field),{color:k,size:C,...M}=v,R=go=>kF(s,g,m,go,t.boxplot),P=R(M),D=R(v),$=(Q(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",F=R({...M,...C?{size:C}:{},color:{condition:{test:`${Ue(`lower_box_${m.field}`)} >= ${Ue(`upper_box_${m.field}`)}`,...k||{value:$}}}}),T=Gk([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],m,v),L={type:"tick",color:"black",opacity:1,orient:w,invalid:c,aria:!1},q=f==="min-max"?T:Gk([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,v),U=[...P({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:q}),...P({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:q}),...P({partName:"ticks",mark:L,positionPrefix:"lower_whisker",extraEncoding:q}),...P({partName:"ticks",mark:L,positionPrefix:"upper_whisker",extraEncoding:q})],oe=[...f!=="tukey"?U:[],...D({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...F({partName:"median",mark:{type:"tick",invalid:c,...Q(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...a,transform:(a.transform??[]).concat(p),layer:oe};let pe=Ue(`lower_box_${m.field}`),fe=Ue(`upper_box_${m.field}`),we=`(${fe} - ${pe})`,He=`${pe} - ${u} * ${we}`,Ee=`${fe} + ${u} * ${we}`,cn=Ue(m.field),$s={joinaggregate:T8(m.field),groupby:y},ma={transform:[{filter:`(${He} <= ${cn}) && (${cn} <= ${Ee})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${S}`},{op:"max",field:m.field,as:`upper_whisker_${S}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${S}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${S}`},...b],groupby:y}],layer:U},{tooltip:ae,...Se}=M,{scale:_e,axis:K}=m,Qt=AF(m),Le=C8(s,"outliers",t.boxplot,{transform:[{filter:`(${cn} < ${He}) || (${cn} > ${Ee})`}],mark:"point",encoding:{[g]:{field:m.field,type:m.type,...Qt!==void 0?{title:Qt}:{},..._e!==void 0?{scale:_e}:{},...K!==void 0?{axis:K}:{}},...Se,...k?{color:k}:{},..._?{tooltip:_}:{}}})[0],Pt,fn=[...d,...h,$s];return Le?Pt={transform:fn,layer:[Le,ma]}:(Pt=ma,Pt.transform.unshift(...fn)),{...a,layer:[Pt,{transform:p,layer:oe}]}}function T8(e){let t=gf(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Yue(e,t,n){let r=R8(e,qy),{continuousAxisChannelDef:i,continuousAxis:o}=F8(e,r,qy),a=i.field,s=gf(a),u=M8(t),l=[...T8(a),{op:"median",field:a,as:`mid_box_${s}`},{op:"min",field:a,as:(u==="min-max"?"lower_whisker_":"min_")+s},{op:"max",field:a,as:(u==="min-max"?"upper_whisker_":"max_")+s}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${Ue(`upper_box_${s}`)} - ${Ue(`lower_box_${s}`)}`,as:`iqr_${s}`},{calculate:`min(${Ue(`upper_box_${s}`)} + ${Ue(`iqr_${s}`)} * ${t}, ${Ue(`max_${s}`)})`,as:`upper_whisker_${s}`},{calculate:`max(${Ue(`lower_box_${s}`)} - ${Ue(`iqr_${s}`)} * ${t}, ${Ue(`min_${s}`)})`,as:`lower_whisker_${s}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Wue(d),{bins:m,timeUnits:g,aggregate:y,groupby:b,encoding:v}=A8(p,n),w=r==="vertical"?"horizontal":"vertical",E=r,_=[...m,...g,{aggregate:[...y,...l],groupby:b},...c];return{bins:m,timeUnits:g,transform:_,groupby:b,aggregate:y,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:w,boxOrient:E,customTooltipWithoutAggregatedField:h}}var CF="errorbar",Vue=["ticks","rule"],Xue=new lf(CF,D8);function D8(e,{config:t}){e={...e,encoding:$x(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:l}=N8(e,CF,t);delete o.size;let c=kF(s,i,r,o,t.errorbar),f=s.thickness,d=s.size,h={type:"tick",orient:a,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Kue(e,t){let{encoding:n}=e;if(Que(n))return{orient:R8(e,t),inputType:"raw"};let r=Jue(n),i=Zue(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);let s=n.x2,u=n.y2;if(be(s)&&be(u))throw new Error(`${t} cannot have both x2 and y2`);if(be(s)){if(hs(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(be(u)){if(hs(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{let s=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(be(u)&&!be(s))throw new Error(`${t} cannot have xError2 without xError`);if(be(c)&&!be(l))throw new Error(`${t} cannot have yError2 without yError`);if(be(s)&&be(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(be(s)){if(hs(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(be(l)){if(hs(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Que(e){return(be(e.x)||be(e.y))&&!be(e.x2)&&!be(e.y2)&&!be(e.xError)&&!be(e.xError2)&&!be(e.yError)&&!be(e.yError2)}function Jue(e){return be(e.x2)||be(e.y2)}function Zue(e){return be(e.xError)||be(e.xError2)||be(e.yError)||be(e.yError2)}function N8(e,t,n){let{mark:r,encoding:i,params:o,projection:a,...s}=e,u=ao(r)?r:{type:r};o&&X(kL(t));let{orient:l,inputType:c}=Kue(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:m}=F8(e,l,t),{errorBarSpecificAggregate:g,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=ele(u,f,d,h,p,c,t,n),{[m]:w,[m==="x"?"x2":"y2"]:E,[m==="x"?"xError":"yError"]:_,[m==="x"?"xError2":"yError2"]:S,...k}=i,{bins:C,timeUnits:M,aggregate:R,groupby:P,encoding:D}=A8(k,n),$=[...R,...g],F=c!=="raw"?[]:P,T=Gk(b,f,D,v);return{transform:[...s.transform??[],...C,...M,...$.length===0?[]:[{aggregate:$,groupby:F}],...y],groupby:F,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:D,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:s,tooltipEncoding:T}}function ele(e,t,n,r,i,o,a,s){let u=[],l=[],c=t.field,f,d=!1;if(o==="raw"){let h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":s.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&X(fse(h,p,a)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${Ue(`center_${c}`)} + ${Ue(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${Ue(`center_${c}`)} - ${Ue(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Hp(h)},{fieldPrefix:"upper_",titlePrefix:s6(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:s6(h,p,"-")}],d=!0;else{let m,g,y;p==="ci"?(m="mean",g="ci0",y="ci1"):(m="median",g="q1",y="q3"),u=[{op:g,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:m,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Qc({field:c,aggregate:y,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Qc({field:c,aggregate:g,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Qc({field:c,aggregate:m,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&X(cse(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:Ue(n.field),as:`upper_${c}`},{calculate:Ue(c),as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${Ue(c)} + ${Ue(r.field)}`,as:`upper_${c}`}],i?l.push({calculate:`${Ue(c)} + ${Ue(i.field)}`,as:`lower_${c}`}):l.push({calculate:`${Ue(c)} - ${Ue(r.field)}`,as:`lower_${c}`}));for(let h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:ju(ju(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function s6(e,t,n){return`${Hp(e)} ${n} ${t}`}var FF="errorband",tle=["band","borders"],nle=new lf(FF,O8);function O8(e,{config:t}){e={...e,encoding:$x(e.encoding,t)};let{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=N8(e,FF,t),l=a,c=kF(l,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0,d={type:f?"area":"rect"},h={type:f?"line":"rule"},p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?X(J4("interpolate")):l.tension&&X(J4("tension")),{...s,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}var I8={};function RF(e,t,n){let r=new lf(e,t);I8[e]={normalizer:r,parts:n}}function rle(){return H(I8)}RF(qy,$8,Gue);RF(CF,D8,Vue);RF(FF,O8,tle);var ile=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],P8={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},L8={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},ole=H(P8),ale=H(L8),sle={header:1,headerRow:1,headerColumn:1,headerFacet:1},z8=H(sle),B8=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ule={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},lle={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Ei="_vgsid_",cle={point:{on:"click",fields:[Ei],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function MF(e){return e==="legend"||!!e?.legend}function Ck(e){return MF(e)&&Q(e)}function $F(e){return!!e?.select}function U8(e){let t=[];for(let n of e||[]){if($F(n))continue;let{expr:r,bind:i,...o}=n;if(i&&r){let a={...o,bind:i,init:r};t.push(a)}else{let a={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(a)}}return t}function fle(e){return Tx(e)||DF(e)||TF(e)}function TF(e){return Y(e,"concat")}function Tx(e){return Y(e,"vconcat")}function DF(e){return Y(e,"hconcat")}function q8({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function so(e){return Y(e,"step")}function u6(e){return Y(e,"view")||Y(e,"width")||Y(e,"height")}var l6=20,dle={align:1,bounds:1,center:1,columns:1,spacing:1},hle=H(dle);function ple(e,t,n){let r=n[t],i={},{spacing:o,columns:a}=r;o!==void 0&&(i.spacing=o),a!==void 0&&(Cx(e)&&!Zp(e.facet)||TF(e))&&(i.columns=a),Tx(e)&&(i.columns=1);for(let s of hle)if(e[s]!==void 0)if(s==="spacing"){let u=e[s];i[s]=ke(u)?u:{row:u.row??o,column:u.column??o}}else i[s]=e[s];return i}function Hk(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Yk(e,t){let n=jy(e,t);return so(n)?n.step:j8}function jy(e,t){let n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return vt(n,{step:e.step})}var j8=20,mle={continuousWidth:300,continuousHeight:300,step:j8},gle={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:mle,mark:uue,arc:{},area:{},bar:due,circle:{},geoshape:{},image:{},line:{},point:{},rect:pF,rule:{color:"black"},square:{},text:{color:"black"},tick:hue,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:jse,projection:{},legend:ule,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:cle,style:{},title:{},facet:{spacing:l6},concat:{spacing:l6},normalizedNumberFormat:".0%"},Ko=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],c6={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},f6={blue:Ko[0],orange:Ko[1],red:Ko[2],teal:Ko[3],green:Ko[4],yellow:Ko[5],purple:Ko[6],pink:Ko[7],brown:Ko[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function yle(e={}){return{signals:[{name:"color",value:Q(e)?{...f6,...e}:f6}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function xle(e){return{signals:[{name:"fontSize",value:Q(e)?{...c6,...e}:c6}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function ble(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function W8(e){let t=H(e||{}),n={};for(let r of t){let i=e[r];n[r]=rm(i)?bL(i):pr(i)}return n}function vle(e){let t=H(e),n={};for(let r of t)n[r]=W8(e[r]);return n}var wle=[...ZL,...w8,...z8,"background","padding","legend","lineBreak","scale","style","title","view"];function G8(e={}){let{color:t,font:n,fontSize:r,selection:i,...o}=e,a=bo({},xe(gle),n?ble(n):{},t?yle(t):{},r?xle(r):{},o||{});i&&ya(a,"selection",i,!0);let s=gr(a,wle);for(let u of["background","lineBreak","padding"])a[u]&&(s[u]=pr(a[u]));for(let u of ZL)a[u]&&(s[u]=sn(a[u]));for(let u of w8)a[u]&&(s[u]=W8(a[u]));for(let u of z8)a[u]&&(s[u]=sn(a[u]));if(a.legend&&(s.legend=sn(a.legend)),a.scale){let{invalid:u,...l}=a.scale,c=sn(u,{level:1});s.scale={...sn(l),...H(c).length>0?{invalid:c}:{}}}return a.style&&(s.style=vle(a.style)),a.title&&(s.title=sn(a.title)),a.view&&(s.view=sn(a.view)),s}var Ele=new Set(["view",...nue]),Sle=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],_le={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...sue};function Ale(e){e=xe(e);for(let t of Sle)delete e[t];if(e.axis)for(let t in e.axis)rm(e.axis[t])&&delete e.axis[t];if(e.legend)for(let t of ile)delete e.legend[t];if(e.mark){for(let t of e6)delete e.mark[t];e.mark.tooltip&&Q(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(U8(e.params)),delete e.params);for(let t of Ele){for(let r of e6)delete e[t][r];let n=_le[t];if(n)for(let r of n)delete e[t][r];Cle(e,t)}for(let t of rle())delete e[t];kle(e);for(let t in e)Q(e[t])&&Ve(e[t])&&delete e[t];return Ve(e)?void 0:e}function kle(e){let{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=xL(e.title);Ve(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ve(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ve(r)?delete e.title:e.title=r}function Cle(e,t,n,r){let i=e[t];t==="view"&&(n="cell");let o={...i,...e.style[n??t]};Ve(o)||(e.style[n??t]=o),delete e[t]}function Dx(e){return Y(e,"layer")}function Fle(e){return Y(e,"repeat")}function Rle(e){return!I(e.repeat)&&Y(e.repeat,"layer")}var Op=class{map(t,n){return Cx(t)?this.mapFacet(t,n):Fle(t)?this.mapRepeat(t,n):DF(t)?this.mapHConcat(t,n):Tx(t)?this.mapVConcat(t,n):TF(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Dx(t))return this.mapLayer(t,n);if(pa(t))return this.mapUnit(t,n);throw new Error(VC(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){let{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}},Mle={zero:1,center:1,normalize:1};function $le(e){return ee(Mle,e)}var Tle=new Set([KL,Sx,Ex,Iy,Ax,dF,hF,_x,QL,fF]),Dle=new Set([Sx,Ex,KL]);function Yc(e){return V(e)&&af(e)==="quantitative"&&!e.bin}function d6(e,t,{orient:n,type:r}){let i=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(r),a=e[t],s=e[i];if(V(a)&&V(s))if(Yc(a)&&Yc(s)){if(a.stack)return t;if(s.stack)return i;let u=V(a)&&!!a.aggregate,l=V(s)&&!!s.aggregate;if(u!==l)return u?t:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(Yc(a))return t;if(Yc(s))return i}else{if(Yc(a))return o&&n==="vertical"?void 0:t;if(Yc(s))return o&&n==="horizontal"?void 0:i}}function Nle(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function H8(e,t){let n=ao(e)?e:{type:e},r=n.type;if(!Tle.has(r))return null;let i=d6(t,"x",n)||d6(t,"theta",n);if(!i)return null;let o=t[i],a=V(o)?te(o,{}):void 0,s=Nle(i),u=[],l=new Set;if(t[s]){let m=t[s],g=V(m)?te(m,{}):void 0;g&&g!==a&&(u.push(s),l.add(g))}let c=s==="x"?"xOffset":"yOffset",f=t[c],d=V(f)?te(f,{}):void 0;d&&d!==a&&(u.push(c),l.add(d));let h=Uoe.reduce((m,g)=>{if(g!=="tooltip"&&Uu(t,g)){let y=t[g];for(let b of J(y)){let v=wi(b);if(v.aggregate)continue;let w=te(v,{});(!w||!l.has(w))&&m.push({channel:g,fieldDef:v})}}return m},[]),p;return o.stack!==void 0?Gr(o.stack)?p=o.stack?"zero":null:p=o.stack:Dle.has(r)&&(p="zero"),!p||!$le(p)||_8(t)&&h.length===0?null:(o?.scale?.type&&o?.scale?.type!==un.LINEAR&&o?.stack&&X(sse(o.scale.type)),be(t[fo(i)])?(o.stack!==void 0&&X(ase(i)),null):(V(o)&&o.aggregate&&!eae.has(o.aggregate)&&X(use(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:i,impute:o.impute===null?!1:Ms(r),stackBy:h,offset:p}))}function Y8(e,t,n){let r=sn(e),i=Ie("orient",r,n);if(r.orient=Lle(r.type,t,i),i!==void 0&&i!==r.orient&&X(Wae(r.orient,i)),r.type==="bar"&&r.orient){let u=Ie("cornerRadiusEnd",r,n);if(u!==void 0){let l=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:cue[r.orient];for(let c of l)r[c]=u;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}let o=Ie("opacity",r,n),a=Ie("fillOpacity",r,n);return o===void 0&&a===void 0&&(r.opacity=Ile(r.type,t)),Ie("cursor",r,n)===void 0&&(r.cursor=Ole(r,t,n)),r}function Ole(e,t,n){return t.href||e.href||Ie("href",e,n)?"pointer":e.cursor}var V8=.7;function Ile(e,t){if(Ae([Ax,fF,dF,hF],e)&&!_8(t))return V8}function Ple(e,t,{graticule:n}){if(n)return!1;let r=oo("filled",e,t),i=e.type;return vt(r,i!==Ax&&i!==_x&&i!==Iy)}function Lle(e,t,n){switch(e){case Ax:case dF:case hF:case eue:case Zse:return}let{x:r,y:i,x2:o,y2:a}=t;switch(e){case QL:case Sx:if(V(r)&&(an(r.bin)||V(i)&&i.aggregate&&!r.aggregate))return"vertical";if(V(i)&&(an(i.bin)||V(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(V(r)&&r.type===Yu&&!Xe(r.bin)||Ly(r))&&V(i)&&an(i.bin)?"horizontal":"vertical";if(!a)return(V(i)&&i.type===Yu&&!Xe(i.bin)||Ly(i))&&V(r)&&an(r.bin)?"vertical":"horizontal"}case Iy:if(o&&!(V(r)&&an(r.bin))&&a&&!(V(i)&&an(i.bin)))return;case Ex:if(a)return V(i)&&an(i.bin)?"horizontal":"vertical";if(o)return V(r)&&an(r.bin)?"vertical":"horizontal";if(e===Iy){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case _x:case fF:{let s=i6(r),u=i6(i);if(n)return n;if(s&&!u)return e!=="tick"?"horizontal":"vertical";if(!s&&u)return e!=="tick"?"vertical":"horizontal";if(s&&u)return"vertical";{let l=jn(r)&&r.type===rf,c=jn(i)&&i.type===rf;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function zle(e){let{point:t,line:n,...r}=e;return H(r).length>1?r:r.type}function Ble(e){for(let t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:gr(e[t],["point","line"])});return e}function Fk(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Q(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Q(t.point)?t.point:{}:void 0}function h6(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}var Vk=class{name="path-overlay";hasMatchingType(t,n){if(pa(t)){let{mark:r,encoding:i}=t,o=ao(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!Fk(o,n[o.type],i);case"area":return!!Fk(o,n[o.type],i)||!!h6(o,n[o.type])}}return!1}run(t,n,r){let{config:i}=n,{params:o,projection:a,mark:s,name:u,encoding:l,...c}=t,f=$x(l,i),d=ao(s)?s:{type:s},h=Fk(d,i[d.type],f),p=d.type==="area"&&h6(d,i[d.type]),m=[{name:u,...o?{params:o}:{},mark:zle({...d.type==="area"&&Ie("opacity",d,i)==null&&Ie("fillOpacity",d,i)==null?{opacity:V8}:{},...d}),encoding:gr(f,["shape"])}],g=H8(Y8(d,f,i),f),y=f;if(g){let{fieldChannel:b,offset:v}=g;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=gr(y,["y2","x2"]),p&&m.push({...a?{projection:a}:{},mark:{type:"line",...Zc(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&m.push({...a?{projection:a}:{},mark:{type:"point",opacity:1,filled:!0,...Zc(d,["clip","tooltip"]),...h},encoding:y}),r({...c,layer:m},{...n,config:Ble(i)})}};function Ule(e,t){return t?Zp(e)?K8(e,t):X8(e,t):e}function Rk(e,t){return t?K8(e,t):e}function Xk(e,t,n){let r=t[e];if(_ue(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};X(wae(r.repeat));return}return t}function X8(e,t){if(e=Xk("field",e,t),e!==void 0){if(e===null)return null;if(vF(e)&&ea(e.sort)){let n=Xk("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function p6(e,t){if(V(e))return X8(e,t);{let n=Xk("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function m6(e,t){if(be(e)){let n=p6(e,t);if(n)return n;if(em(e))return{condition:e.condition}}else{if(tm(e)){let n=p6(e.condition,t);if(n)return{...e,condition:n};{let{condition:r,...i}=e;return i}}return e}}function K8(e,t){let n={};for(let r in e)if(Y(e,r)){let i=e[r];if(I(i))n[r]=i.map(o=>m6(o,t)).filter(o=>o);else{let o=m6(i,t);o!==void 0&&(n[r]=o)}}return n}var Kk=class{name="RuleForRangedLine";hasMatchingType(t){if(pa(t)){let{encoding:n,mark:r}=t;if(r==="line"||ao(r)&&r.type==="line")for(let i of Loe){let o=tl(i),a=n[o];if(n[i]&&(V(a)&&!an(a.bin)||po(a)))return!0}}return!1}run(t,n,r){let{encoding:i,mark:o}=t;return X(jae(!!i.x2,!!i.y2)),r({...t,mark:Q(o)?{...o,type:"rule"}:"rule"},n)}},Qk=class extends Op{nonFacetUnitNormalizers=[Hue,Xue,nle,new Vk,new Kk];map(t,n){if(pa(t)){let r=Uu(t.encoding,Jo),i=Uu(t.encoding,Zo),o=Uu(t.encoding,fx);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){let{parentEncoding:r,parentProjection:i}=n,o=Rk(t.encoding,n.repeater),a={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(a,n);let s=this.mapLayerOrUnit.bind(this);for(let u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(a,n.config))return u.run(a,n,s);return a}mapRepeat(t,n){return Rle(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){let{repeat:r,spec:i,...o}=t,{row:a,column:s,layer:u}=r,{repeater:l={},repeaterPrefix:c=""}=n;return a||s?this.mapRepeat({...t,repeat:{...a?{row:a}:{},...s?{column:s}:{}},spec:{repeat:{layer:u},spec:i}},n):{...o,layer:u.map(f=>{let d={...l,layer:f},h=`${(i.name?`${i.name}_`:"")+c}child__layer_${ot(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){let{repeat:r,spec:i,data:o,...a}=t;!I(r)&&t.columns&&(t=gr(t,["columns"]),X(V4("repeat")));let s=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!I(r)&&r.row||[u?u.row:null],f=!I(r)&&r.column||[u?u.column:null],d=I(r)&&r||[u?u.repeat:null];for(let p of d)for(let m of c)for(let g of f){let y={repeat:p,row:m,column:g,layer:u.layer},b=`${(i.name?`${i.name}_`:"")+l}child__${I(r)?`${ot(p)}`:(r.row?`row_${ot(m)}`:"")+(r.column?`column_${ot(g)}`:"")}`,v=this.map(i,{...n,repeater:y,repeaterPrefix:b});v.name=b,s.push(gr(v,["data"]))}let h=I(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...a,columns:h,concat:s}}mapFacet(t,n){let{facet:r}=t;return Zp(r)&&t.columns&&(t=gr(t,["columns"]),X(V4("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){let{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:a,config:s}=n,u=y6({parentProjection:a,projection:i}),l=g6({parentEncoding:o,encoding:Rk(r,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:s})}mapFacetedUnit(t,n){let{row:r,column:i,facet:o,...a}=t.encoding,{mark:s,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:m,layout:g}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),y=Rk(a,n.repeater);return this.mapFacet({...p,...g,facet:m,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:s,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){let{row:r,column:i,facet:o}=t;if(r||i){o&&X(Uae([...r?[Jo]:[],...i?[Zo]:[]]));let a={},s={};for(let u of[Jo,Zo]){let l=t[u];if(l){let{align:c,center:f,spacing:d,columns:h,...p}=l;a[u]=p;for(let m of["align","center","spacing"])l[m]!==void 0&&(s[m]??={},s[m][u]=l[m])}}return{facetMapping:a,layout:s}}else{let{align:a,center:s,spacing:u,columns:l,...c}=o;return{facetMapping:Ule(c,n.repeater),layout:{...a?{align:a}:{},...s?{center:s}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){let{encoding:o,projection:a,...s}=t,u={...i,parentEncoding:g6({parentEncoding:n,encoding:o,layer:!0}),parentProjection:y6({parentProjection:r,projection:a})};return super.mapLayer({...s,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}};function g6({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){let i=new Set([...H(e),...H(t)]);for(let o of i){let a=t[o],s=e[o];if(be(a)){let u={...s,...a};r[o]=u}else tm(a)?r[o]={...a,condition:{...s,...a.condition}}:a||a===null?r[o]=a:(n||vi(s)||le(s)||be(s)||I(s))&&(r[o]=s)}}else r=t;return!r||Ve(r)?void 0:r}function y6(e){let{parentProjection:t,projection:n}=e;return t&&n&&X(Mae({parentProjection:t,projection:n})),n??t}function NF(e){return Y(e,"filter")}function qle(e){return Y(e,"stop")}function Q8(e){return Y(e,"lookup")}function jle(e){return Y(e,"data")}function Wle(e){return Y(e,"param")}function Gle(e){return Y(e,"pivot")}function Hle(e){return Y(e,"density")}function Yle(e){return Y(e,"quantile")}function Vle(e){return Y(e,"regression")}function Xle(e){return Y(e,"loess")}function Kle(e){return Y(e,"sample")}function Qle(e){return Y(e,"window")}function Jle(e){return Y(e,"joinaggregate")}function Zle(e){return Y(e,"flatten")}function ece(e){return Y(e,"calculate")}function J8(e){return Y(e,"bin")}function tce(e){return Y(e,"impute")}function nce(e){return Y(e,"timeUnit")}function rce(e){return Y(e,"aggregate")}function ice(e){return Y(e,"stack")}function oce(e){return Y(e,"fold")}function ace(e){return Y(e,"extent")&&!Y(e,"density")&&!Y(e,"regression")}function sce(e){return e.map(t=>NF(t)?{filter:Xc(t.filter,Ise)}:t)}var Jk=class extends Op{map(t,n){return n.emptySelections??={},n.selectionPredicates??={},t=x6(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=x6(t,n),t.encoding){let r={};for(let[i,o]of ms(t.encoding))r[i]=Z8(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){let{selection:r,...i}=t;return r?{...i,params:ms(r).map(([o,a])=>{let{init:s,bind:u,empty:l,...c}=a;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=l!=="none";for(let f of Ft(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:s,select:c,bind:u}})}:t}};function x6(e,t){let{transform:n,...r}=e;if(n){let i=n.map(o=>{if(NF(o))return{filter:Zk(o,t)};if(J8(o)&&nl(o.bin))return{...o,bin:ez(o.bin)};if(Q8(o)){let{selection:a,...s}=o.from;return a?{...o,from:{param:a,...s}}:o}return o});return{...r,transform:i}}return e}function Z8(e,t){let n=xe(e);if(V(n)&&nl(n.bin)&&(n.bin=ez(n.bin)),al(n)&&n.scale?.domain?.selection){let{selection:r,...i}=n.scale.domain;n.scale.domain={...i,...r?{param:r}:{}}}if(em(n))if(I(n.condition))n.condition=n.condition.map(r=>{let{selection:i,param:o,test:a,...s}=r;return o?r:{...s,test:Zk(r,t)}});else{let{selection:r,param:i,test:o,...a}=Z8(n.condition,t);n.condition=i?n.condition:{...a,test:Zk(n.condition,t)}}return n}function ez(e){let t=e.extent;if(t?.selection){let{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function Zk(e,t){let n=r=>Xc(r,i=>{let o=t.emptySelections[i]??!0,a={param:i,empty:o};return t.selectionPredicates[i]??=[],t.selectionPredicates[i].push(a),a});return e.selection?n(e.selection):Xc(e.test||e.filter,r=>r.selection?n(r.selection):r)}var Ip=class extends Op{map(t,n){let r=n.selections??[];if(t.params&&!pa(t)){let i=[];for(let o of t.params)$F(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){let r=n.selections;if(!r||!r.length)return t;let i=(n.path??[]).concat(t.name),o=[];for(let a of r)if(!a.views||!a.views.length)o.push(a);else for(let s of a.views)(Z(s)&&(s===t.name||i.includes(s))||I(s)&&s.map(u=>i.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&o.push(a);return o.length&&(t.params=o),t}};for(let e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){let t=Ip.prototype[e];Ip.prototype[e]=function(n,r){return t.call(this,n,uce(n,r))}}function uce(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function tz(e,t){t===void 0&&(t=G8(e.config));let n=dce(e,t),{width:r,height:i}=e,o=hce(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}var lce=new Qk,cce=new Jk,fce=new Ip;function dce(e,t={}){let n={config:t};return fce.map(lce.map(cce.map(e,n),n),n)}function b6(e){return Z(e)?{type:e}:e??{}}function hce(e,t,n){let{width:r,height:i}=t,o=pa(e)||Dx(e),a={};o?r=="container"&&i=="container"?(a.type="fit",a.contains="padding"):r=="container"?(a.type="fit-x",a.contains="padding"):i=="container"&&(a.type="fit-y",a.contains="padding"):(r=="container"&&(X(W4("width")),r=void 0),i=="container"&&(X(W4("height")),i=void 0));let s={type:"pad",...a,...n?b6(n.autosize):{},...b6(e.autosize)};if(s.type==="fit"&&!o&&(X(cae),s.type="pad"),r=="container"&&!(s.type=="fit"||s.type=="fit-x")&&X(G4("width")),i=="container"&&!(s.type=="fit"||s.type=="fit-y")&&X(G4("height")),!mr(s,{type:"pad"}))return s}function pce(e){return["fit","fit-x","fit-y"].includes(e)}function mce(e){return e?`fit-${gx(e)}`:"fit"}var gce=["background","padding"];function v6(e,t){let n={};for(let r of gce)e&&e[r]!==void 0&&(n[r]=pr(e[r]));return t&&(n.params=e.params),n}var ra=class e{explicit;implicit;constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new e(xe(this.explicit),xe(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return vt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(let n of H(t.combine())){let r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}};function to(e){return{explicit:!0,value:e}}function hr(e){return{explicit:!1,value:e}}function nz(e){return(t,n,r,i)=>{let o=e(t.value,n.value);return o>0?t:o<0?n:Nx(t,n,r,i)}}function Nx(e,t,n,r){return e.explicit&&t.explicit&&X(Zae(n,r,e.value,t.value)),e}function xs(e,t,n,r,i=Nx){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:mr(e.value,t.value)?e:i(e,t,n,r)}var eC=class extends ra{explicit;implicit;parseNothing;constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){let t=super.clone();return t.parseNothing=this.parseNothing,t}};function cf(e){return Y(e,"url")}function Pp(e){return Y(e,"values")}function rz(e){return Y(e,"name")&&!cf(e)&&!Pp(e)&&!ps(e)}function ps(e){return e&&(iz(e)||oz(e)||OF(e))}function iz(e){return Y(e,"sequence")}function oz(e){return Y(e,"sphere")}function OF(e){return Y(e,"graticule")}var lt;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(lt||(lt={}));function az({invalid:e,isPath:t}){switch(e8(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function yce(e){let{marks:t,scales:n}=az(e);return t===n?lt.Main:n==="include-invalid-values"?lt.PreFilterInvalid:lt.PostFilterInvalid}var Oe=class{debugName;_children=[];_parent=null;_hash;constructor(t,n){this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){X(Cae);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){let n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(let n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){let n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){let t=this._parent,n=t.parent;for(let i of this._children)i.parent=t;this._children=[],t.removeChild(this);let r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}},En=class extends Oe{type;refCounts;_source;_name;clone(){let t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${nL()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}};function Mk(e){return e.as!==void 0}function w6(e){return`${e}_end`}var bs=class e extends Oe{timeUnits;clone(){return new e(null,xe(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){let r=n.reduceFieldDef((i,o,a)=>{let{field:s,timeUnit:u}=o;if(u){let l;if(ol(u)){if(ut(n)){let{mark:c,markDef:f,config:d}=n,h=ys({fieldDef:o,markDef:f,config:d});(Np(c)||h)&&(l={timeUnit:Vt(u),field:s})}}else l={as:te(o,{forAs:!0}),field:s,timeUnit:u};if(ut(n)){let{mark:c,markDef:f,config:d}=n,h=ys({fieldDef:o,markDef:f,config:d});Np(c)&&wt(a)&&h!==.5&&(l.rectBandPosition=h)}l&&(i[Re(l)]=l)}return i},{});return Ve(r)?null:new e(t,r)}static makeFromTransform(t,n){let{timeUnit:r,...i}={...n},o=Vt(r),a={...i,timeUnit:o};return new e(t,{[Re(a)]:a})}merge(t){this.timeUnits={...this.timeUnits};for(let n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(let n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){let n={};for(let[r,i]of ms(this.timeUnits)){let o=Mk(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(Ft(this.timeUnits).map(t=>Mk(t)?t.as:w6(t.field)))}dependentFields(){return new Set(Ft(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Re(this.timeUnits)}`}assemble(){let t=[];for(let n of Ft(this.timeUnits)){let{rectBandPosition:r}=n,i=Vt(n.timeUnit);if(Mk(n)){let{field:o,as:a}=n,{unit:s,utc:u,...l}=i,c=[a,`${a}_end`];t.push({field:zr(o),type:"timeunit",...s?{units:vx(s)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...E6(c,r,i))}else if(n){let{field:o}=n,a=eL(o),s=sz({timeUnit:i,field:a}),u=w6(a);t.push({type:"formula",expr:s,as:u}),t.push(...E6([a,u],r,i))}}return t}},Ox="offsetted_rect_start",Ix="offsetted_rect_end";function sz({timeUnit:e,field:t,reverse:n}){let{unit:r,utc:i}=e,o=PL(r),{part:a,step:s}=UL(o,e.step);return`${i?"utcOffset":"timeOffset"}('${a}', ${Ue(t)}, ${n?-s:s})`}function E6([e,t],n,r){if(n!==void 0&&n!==.5){let i=Ue(e),o=Ue(t);return[{type:"formula",expr:S6([sz({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${Ox}`},{type:"formula",expr:S6([i,o],n+.5),as:`${e}_${Ix}`}]}return[]}function S6([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}var im="_tuple_fields",tC=class{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}},xce={defined:()=>!0,parse:(e,t,n)=>{let r=t.name,i=t.project??=new tC,o={},a={},s=new Set,u=(p,m)=>{let g=m==="visual"?p.channel:p.field,y=ot(`${r}_${g}`);for(let b=1;s.has(y);b++)y=ot(`${r}_${g}_${b}`);return s.add(y),{[m]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?J(n.value):null,{fields:d,encodings:h}=Q(n.select)?n.select:{};if(!d&&!h&&f){for(let p of f)if(Q(p))for(let m of H(p))Poe(m)?(h||(h=[])).push(m):l==="interval"?(X(vae),h=c.encodings):(d??=[]).push(m)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(let p of h??[]){let m=e.fieldDef(p);if(m){let g=m.field;if(m.aggregate){X(fae(p,m.aggregate));continue}else if(!g){X(Y4(p));continue}if(m.timeUnit&&!ol(m.timeUnit)){g=e.vgField(p);let y={timeUnit:m.timeUnit,as:g,field:m.field};a[Re(y)]=y}if(!o[g]){let y=l==="interval"&&ho(p)&&bi(e.getScaleComponent(p).get("type"))?"R":m.bin?"R-RE":"E",b={field:g,channel:p,type:y,index:i.items.length};b.signals={...u(b,"data"),...u(b,"visual")},i.items.push(o[g]=b),i.hasField[g]=o[g],i.hasSelectionId=i.hasSelectionId||g===Ei,uL(p)?(b.geoChannel=p,b.channel=sL(p),i.hasChannel[b.channel]=o[g]):i.hasChannel[p]=o[g]}}else X(Y4(p))}for(let p of d??[]){if(i.hasField[p])continue;let m={type:"E",field:p,index:i.items.length};m.signals={...u(m,"data")},i.items.push(m),i.hasField[p]=m,i.hasSelectionId=i.hasSelectionId||p===Ei}f&&(t.init=f.map(p=>i.items.map(m=>Q(p)?p[m.geoChannel||m.channel]!==void 0?p[m.geoChannel||m.channel]:p[m.field]:p))),Ve(a)||(i.timeUnit=new bs(null,a))},signals:(e,t,n)=>{let r=t.name+im;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(fz)})}},uz="_curr",Dy="anim_value",Vc="anim_clock",nC="eased_anim_clock",lz="min_extent",cz="max_range_extent",$k="last_tick_at",Tk="is_playing",bce=1/60*1e3,vce=(e,t)=>[{name:nC,update:Vc},{name:`${e}_domain`,init:`domain('${t}')`},{name:lz,init:`extent(${e}_domain)[0]`},{name:cz,init:`extent(range('${t}'))[1]`},{name:Dy,update:`invert('${t}', ${nC})`}],wce={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(io(t)&&(n=n.concat([{name:Vc,init:"0",on:[{events:{type:"timer",throttle:bce},update:`${Tk} ? (${Vc} + (now() - ${$k}) > ${cz} ? 0 : ${Vc} + (now() - ${$k})) : ${Vc}`}]},{name:$k,init:"now()",on:[{events:[{signal:Vc},{signal:Tk}],update:"now()"}]},{name:Tk,init:"true"}])),n),signals:(e,t,n)=>{let r=t.name,i=r+im,o=t.project,a="(item().isVoronoi ? datum.datum : datum)",s=Ft(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Jc):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${s?` && ${s}`:""}`,l=`unit: ${qu(e)}, `;if(t.project.hasSelectionId)l+=`${Ei}: ${a}[${G(Ei)}]`;else if(io(t))l+=`fields: ${i}, values: [${Dy} ? ${Dy} : ${lz}]`;else{let c=o.items.map(f=>e.fieldDef(f.channel)?.bin?`[${a}[${G(e.vgField(f.channel,{}))}], ${a}[${G(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${a}[${G(f.field)}]`).join(", ");l+=`fields: ${i}, values: [${c}]`}if(io(t))return n.concat(vce(t.name,e.scaleName(_s)),[{name:r+oa,on:[{events:[{signal:nC},{signal:Dy}],update:`{${l}}`,force:!0}]}]);{let c=t.events;return n.concat([{name:r+oa,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function fz(e){let{signals:t,hasLegend:n,index:r,...i}=e;return i.field=zr(i.field),i}function Ku(e,t=!0,n=ct){if(I(e)){let r=e.map(i=>Ku(i,t,n));return t?`[${r.join(", ")}]`:r}else if(il(e))return n(t?Hu(e):_se(e));return t?n(Pe(e)):e}function Ece(e,t){for(let n of Ft(e.component.selection??{})){let r=n.name,i=`${r}${oa}, ${n.resolve==="global"?"true":`{unit: ${qu(e)}}`}`;for(let o of Px)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+Xce,on:[{events:{signal:n.name+oa},update:`modify(${G(n.name+Qu)}, ${i})`}]})}return IF(t)}function Sce(e,t){if(e.component.selection&&H(e.component.selection).length){let n=G(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:fi("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return IF(t)}function _ce(e,t){let n=!1;for(let r of Ft(e.component.selection??{})){let i=r.name,o=G(i+Qu);if(t.filter(s=>s.name===i).length===0){let s=r.resolve==="global"?"union":r.resolve,u=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${Rz}(${o}, ${G(s)}${u}`})}n=!0;for(let s of Px)s.defined(r)&&s.topLevelSignals&&(t=s.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),IF(t)}function Ace(e,t){let n=[],r=[],i=qu(e,{escape:!1});for(let o of Ft(e.component.selection??{})){let a={name:o.name+Qu};if(o.project.hasSelectionId&&(a.transform=[{type:"collect",sort:{field:Ei}}]),o.init){let u=o.project.items.map(fz);a.values=o.project.hasSelectionId?o.init.map(l=>({unit:i,[Ei]:Ku(l,!1)[0]})):o.init.map(l=>({unit:i,fields:u,values:Ku(l,!1)}))}if([...n,...t].filter(u=>u.name===o.name+Qu).length||n.push(a),io(o)&&t.length){let u=e.lookupDataSource(e.getDataName(lt.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);let f={name:l.name+uz,source:l.name,transform:[c]};r.push(f)}}}return n.concat(t,r)}function dz(e,t){for(let n of Ft(e.component.selection??{}))for(let r of Px)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function kce(e,t){for(let n of e.children)ut(n)&&(t=dz(n,t));return t}function Cce(e,t,n,r){let i=Nz(e,t.param,t);return{signal:bi(n.get("type"))&&I(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function IF(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}var ta={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{let n=t.scales=[];for(let r of t.project.items){let i=r.channel;if(!ho(i))continue;let o=e.getScaleComponent(i),a=o?o.get("type"):void 0;if(a=="sequential"&&X(mae),!o||!bi(a)){X(pae);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{let r=t.scales.filter(a=>n.filter(s=>s.name===a.signals.data).length===0);if(!e.parent||iC(e)||r.length===0)return n;let i=n.find(a=>a.name===t.name),o=i.update;if(o.includes(Rz))i.update=`{${r.map(a=>`${G(zr(a.field))}: ${a.signals.data}`).join(", ")}}`;else{for(let a of r){let s=`${G(zr(a.field))}: ${a.signals.data}`;o.includes(s)||(o=`${o.substring(0,o.length-1)}, ${s}}`)}i.update=o}return n.concat(r.map(a=>({name:a.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!iC(e))for(let r of t.scales){let i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function rC(e,t){return`domain(${G(e.scaleName(t))})`}function iC(e){return e.parent&&vf(e.parent)&&(!e.parent.parent||iC(e.parent.parent))}var Jc="_brush",hz="_scale_trigger",Cp="geo_interval_init_tick",pz="_init",Fce="_center",Rce={defined:e=>e.type==="interval",parse:(e,t,n)=>{if(e.hasProjection){let r={...Q(n.select)?n.select:{}};r.fields=[Ei],r.encodings||(r.encodings=n.value?H(n.value):[ki,Ai]),n.select={type:"interval",...r}}if(t.translate&&!ta.defined(t)){let r=`!event.item || event.item.mark.name !== ${G(t.name+Jc)}`;for(let i of t.events){if(!i.between){X(`${i} is not an ordered event stream for interval selections.`);continue}let o=J(i.between[0].filter??=[]);o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{let r=t.name,i=r+oa,o=Ft(t.project.hasChannel).filter(s=>s.channel===at||s.channel===Kt),a=t.init?t.init[0]:null;if(n.push(...o.reduce((s,u)=>s.concat(Mce(e,t,u,a?.[u.index])),[])),e.hasProjection){let s=G(e.projectionName()),u=e.projectionName()+Fce,{x:l,y:c}=t.project.hasChannel,f=l?.signals.visual,d=c?.signals.visual,h=l?a?.[l.index]:`${u}[0]`,p=c?a?.[c.index]:`${u}[1]`,m=E=>e.getSizeSignalRef(E).signal,g=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:m("width")}, ${d?`${d}[1]`:m("height")}]]`;a&&(n.unshift({name:r+pz,init:`[scale(${s}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${s}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(_=>_.name===u)||n.unshift({name:u,update:`invert(${s}, [${m("width")}/2, ${m("height")}/2])`})));let y=`intersect(${g}, {markname: ${G(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${qu(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,w=o.map(E=>E.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...a?[{signal:Cp}]:[]],update:v}]})}else{if(!ta.defined(t)){let l=r+hz,c=o.map(f=>{let d=f.channel,{data:h,visual:p}=f.signals,m=G(e.scaleName(d)),g=e.getScaleComponent(d).get("type"),y=bi(g)?"+":"";return`(!isArray(${h}) || (${y}invert(${m}, ${p})[0] === ${y}${h}[0] && ${y}invert(${m}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:`${c.join(" && ")} ? ${l} : {}`}]})}let s=o.map(l=>l.signals.data),u=`unit: ${qu(e)}, fields: ${r+im}, values`;return n.concat({name:i,...a?{init:`{${u}: ${Ku(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${u}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(ut(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===Cp).length||n.unshift({name:Cp,value:null,on:[{events:"timer{1}",update:`${Cp} === null ? {} : ${Cp}`}]})),n),marks:(e,t,n)=>{let r=t.name,{x:i,y:o}=t.project.hasChannel,a=i?.signals.visual,s=o?.signals.visual,u=`data(${G(t.name+Qu)})`;if(ta.defined(t)||!i&&!o)return n;let l={x:i!==void 0?{signal:`${a}[0]`}:{value:0},y:o!==void 0?{signal:`${s}[0]`}:{value:0},x2:i!==void 0?{signal:`${a}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${s}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(let g of H(l))l[g]=[{test:`${u}.length && ${u}[0].unit === ${qu(e)}`,...l[g]},{value:0}];let{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=H(h).reduce((g,y)=>(g[y]=[{test:[i!==void 0&&`${a}[0] !== ${a}[1]`,o!==void 0&&`${s}[0] !== ${s}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],g),{}),m=d??(t.translate?"move":null);return[{name:`${r+Jc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:r+Jc,type:"rect",clip:!0,encode:{enter:{...m?{cursor:{value:m}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function Mce(e,t,n,r){let i=!e.hasProjection,o=n.channel,a=n.signals.visual,s=G(i?e.scaleName(o):e.projectionName()),u=d=>`scale(${s}, ${d})`,l=e.getSizeSignalRef(o===at?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${a}[0], clamp(${c}, 0, ${l})]`}],[]);if(i){let d=n.signals.data,h=ta.defined(t),p=e.getScaleComponent(o),m=p?p.get("type"):void 0,g=r?{init:Ku(r,!0,u)}:{value:[]};return f.push({events:{signal:t.name+hz},update:bi(m)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:a,...g,on:f},{name:d,...r?{init:Ku(r)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}else{let d=o===at?0:1,h=t.name+pz,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:a,...p,on:f}]}}function bf({model:e,channelDef:t,vgChannel:n,invalidValueRef:r,mainRefFn:i}){let o=em(t)&&t.condition,a=[];o&&(a=J(o).map(l=>{let c=i(l);if(Sue(l)){let{param:f,empty:d}=l;return{test:Dz(e,{param:f,empty:d}),...c}}else return{test:Hy(e,l.test),...c}})),r!==void 0&&a.push(r);let s=i(t);return s!==void 0&&a.push(s),a.length>1||a.length===1&&a[0].test?{[n]:a}:a.length===1?{[n]:a[0]}:{}}function PF(e,t="text"){let n=e.encoding[t];return bf({model:e,channelDef:n,vgChannel:t,mainRefFn:r=>LF(r,e.config),invalidValueRef:void 0})}function LF(e,t,n="datum"){if(e){if(vi(e))return et(e.value);if(be(e)){let{format:r,formatType:i}=By(e);return xF({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function mz(e,t={}){let{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(I(a))return{tooltip:_6({tooltip:a},o,i,t)};{let s=t.reactiveGeom?"datum.datum":"datum";return bf({model:e,channelDef:a,vgChannel:"tooltip",mainRefFn:l=>{let c=yz(l,i,s);if(c)return c;if(l===null)return;let f=Ie("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),Z(f))return{value:f};if(Q(f))return le(f)?f:f.content==="encoding"?_6(n,o,i,t):{signal:s}},invalidValueRef:void 0})}}function gz(e,t,n,{reactiveGeom:r}={}){let i={...n,...n.tooltipFormat},o=new Set,a=r?"datum.datum":"datum",s=[];function u(c,f){let d=tl(f),h=jn(c)?c:{...c,type:e[d].type},p=h.title||EF(h,i),m=J(p).join(", ").replaceAll(/"/g,'\\"'),g;if(wt(f)){let y=f==="x"?"x2":"y2",b=wi(e[y]);if(an(h.bin)&&b){let v=te(h,{expr:a}),w=te(b,{expr:a}),{format:E,formatType:_}=By(h);g=Jp(v,w,E,_,i),o.add(y)}}if((wt(f)||f===Ur||f===_i)&&t&&t.fieldChannel===f&&t.offset==="normalize"){let{format:y,formatType:b}=By(h);g=xF({fieldOrDatumDef:h,format:y,formatType:b,expr:a,config:i,normalizeStack:!0}).signal}g??=yz(h,i,a).signal,s.push({channel:f,key:m,value:g})}_F(e,(c,f)=>{V(c)?u(c,f):Fx(c)&&u(c.condition,f)});let l={};for(let{channel:c,key:f,value:d}of s)!o.has(c)&&!l[f]&&(l[f]=d);return l}function _6(e,t,n,{reactiveGeom:r}={}){let i=gz(e,t,n,{reactiveGeom:r}),o=ms(i).map(([a,s])=>`"${a}": ${s}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function yz(e,t,n="datum"){if(V(e)&&uF(e.type)&&!Y(e,"format")){let r=`datum["${e.field}"]`;return{signal:`isValid(${r}) ? isArray(${r}) ? join(${r}, '\\n') : ${r} : ""+${r}`}}return LF(e,t,n)}function $ce(e){let{markDef:t,config:n}=e,r=Ie("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...Tce(e),...Dce(e)}}function Tce(e){let{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};let i=Ie("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:ee(aae,t)?{}:{ariaRoleDescription:{value:t}}}function Dce(e){let{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return bf({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>LF(u,e.config),invalidValueRef:void 0});let a=Ie("description",n,r);if(a!=null)return{description:et(a)};if(r.aria===!1)return{};let s=gz(t,i,r);if(!Ve(s))return{description:{signal:ms(s).filter(([u])=>!u.startsWith("_")).map(([u,l])=>[u,l.replaceAll("\\n"," ")]).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function ln(e,t,n={}){let{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n,{defaultRef:s,defaultValue:u}=n,l=i[e];s===void 0&&(u??=Ie(e,r,o,{vgChannel:a,ignoreVgConfig:!em(l)}),u!==void 0&&(s=et(u)));let c={markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=n8({...c,scaleChannel:e,channelDef:l});return bf({model:t,channelDef:l,vgChannel:a??e,invalidValueRef:f,mainRefFn:h=>yF({...c,channel:e,channelDef:h,stack:null,defaultRef:s})})}function xz(e,t={filled:void 0}){let{markDef:n,encoding:r,config:i}=e,{type:o}=n,a=t.filled??Ie("filled",n,i),s=Ae(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Ie(a===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[a===!0&&"color"]??s,l=Ie(a===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[a===!1&&"color"],c=a?"fill":"stroke",f={...u?{fill:et(u)}:{},...l?{stroke:et(l)}:{}};return n.color&&(a?n.fill:n.stroke)&&X(FL("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...ln("color",e,{vgChannel:c,defaultValue:a?u:l}),...ln("fill",e,{defaultValue:r.fill?u:void 0}),...ln("stroke",e,{defaultValue:r.stroke?l:void 0})}}function Nce(e){let{encoding:t,mark:n}=e,r=t.order;return!Ms(n)&&vi(r)?bf({model:e,channelDef:r,vgChannel:"zindex",mainRefFn:i=>et(i.value),invalidValueRef:void 0}):{}}function ff({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){let o=`${e}Offset`,a=t[o],s=n[o];if((o==="xOffset"||o==="yOffset")&&s)return{offsetType:"encoding",offset:yF({channel:o,channelDef:s,markDef:t,config:r?.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:et(a),bandPosition:i})};let u=t[o];return u?{offsetType:"visual",offset:u}:{}}function Un(e,t,{defaultPos:n,vgChannel:r}){let{encoding:i,markDef:o,config:a,stack:s}=t,u=i[e],l=i[fo(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=ff({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=zF({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),m=!u&&wt(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:Oce({channel:e,channelDef:u,channel2Def:l,markDef:o,config:a,scaleName:c,scale:f,stack:s,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return m?{[r||e]:m}:void 0}function Oce(e){let{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:a}=e;if(be(n)&&i&&t===i.fieldChannel){if(V(n)){let s=n.bandPosition;if(s===void 0&&a.type==="text"&&(t==="radius"||t==="theta")&&(s=.5),s!==void 0)return Py({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:s,offset:o})}return Bu(n,r,{suffix:"end"},{offset:o})}return gF(e)}function zF({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){let{markDef:o,config:a}=e;return()=>{let s=tl(n),u=gs(n),l=Ie(n,o,a,{vgChannel:u});if(l!==void 0)return Mp(n,l);switch(t){case"zeroOrMin":return A6({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:s,config:a});case"zeroOrMax":return A6({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:s,config:a});case"mid":return{...e[ir(n)],mult:.5}}}}function A6({mainChannel:e,config:t,...n}){let r=t8(n),{mode:i}=n;if(r)return r;switch(e){case"radius":{if(i==="zeroOrMin")return{value:0};let{widthSignal:o,heightSignal:a}=i.zeroOrMax;return{signal:`min(${o},${a})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}var Ice={left:"x",center:"xc",right:"x2"},Pce={top:"y",middle:"yc",bottom:"y2"};function bz(e,t,n,r="middle"){if(e==="radius"||e==="theta")return gs(e);let i=e==="x"?"align":"baseline",o=Ie(i,t,n),a;return le(o)?(X(qae(i)),a=void 0):a=o,e==="x"?Ice[a||(r==="top"?"left":"center")]:Pce[a||r]}function Wy(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?vz(e,t,{defaultPos:n,defaultPos2:r}):Un(e,t,{defaultPos:n})}function vz(e,t,{defaultPos:n,defaultPos2:r}){let{markDef:i,config:o}=t,a=fo(e),s=ir(e),u=Lce(t,r,a),l=u[s]?bz(e,i,o):gs(e);return{...Un(e,t,{defaultPos:n,vgChannel:l}),...u}}function Lce(e,t,n){let{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,u=tl(n),l=ir(n),c=gs(n),f=r[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in r||n in o?ff({channel:n,markDef:o,encoding:r,model:e}):ff({channel:u,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){let g=ir(n),y=e.markDef[g];return y!=null?{[g]:{value:y}}:{[c]:{field:e.getName(n)}}}let m=zce({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});return m!==void 0?{[c]:m}:Cy(n,o)||Cy(n,{[n]:Bk(n,o,s.style),[l]:Bk(l,o,s.style)})||Cy(n,s[i])||Cy(n,s.mark)||{[c]:zF({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function zce({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){return be(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0)?Bu(t,o,{suffix:"start"},{offset:u}):gF({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}function Cy(e,t){let n=ir(e),r=gs(e);if(t[r]!==void 0)return{[r]:Mp(e,t[r])};if(t[e]!==void 0)return{[r]:Mp(e,t[e])};if(t[n]){let i=t[n];if(Vu(i))X(Iae(n));else return{[n]:Mp(e,i)}}}function ia(e,t){let{config:n,encoding:r,markDef:i}=e,o=i.type,a=fo(t),s=ir(t),u=r[t],l=r[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=i.orient,h=r[s]??r.size??Ie("size",i,n,{vgChannel:s}),p=dL(t),m=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return V(u)&&(Xe(u.bin)||an(u.bin)||u.timeUnit&&!l)&&!(h&&!Vu(h))&&!r[p]&&!Xt(f)?qce({fieldDef:u,fieldDef2:l,channel:t,model:e}):(be(u)&&Xt(f)||m)&&!l?Uce(u,t,e):vz(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Bce(e,t,n,r,i,o,a){if(Vu(i))if(n){let u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;i.band!==1&&(l=`${i.band} * ${l}`);let c=oo("minBandSize",{type:a},r);return{signal:c?`max(${yi(c)}, ${l})`:l}}else i.band!==1&&(X(Hae(u)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(le(i))return i;if(i)return{value:i}}if(n){let u=n.get("range");if(rl(u)&&ke(u.step))return{value:u.step-2}}if(!o){let{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=r.scale,d=vt(u,a==="tick"?f:a==="bar"?l:c);if(le(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(ke(d))return{signal:`${1-d} * ${e}`}}return{value:Yk(r.view,e)-2}}function Uce(e,t,n){let{markDef:r,encoding:i,config:o,stack:a}=n,s=r.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=ir(t),f=fo(t),d=dL(t),h=n.scaleName(d),p=n.getScaleComponent(qC(t)),m=r.type==="tick"||s==="horizontal"&&t==="y"||s==="vertical"&&t==="x",g;(i.size||r.size)&&(m?g=ln("size",n,{vgChannel:c,defaultRef:et(r.size)}):X(Kae(r.type)));let y=!!g,b=l8({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(l||p)?.get("type"),useVlSizeChannel:m});g=g||{[c]:Bce(c,h||u,p||l,o,b,!!e,r.type)};let v=(l||p)?.get("type")==="band"&&Vu(b)&&!y?"top":"middle",w=bz(t,r,o,v),E=w==="xc"||w==="yc",{offset:_,offsetType:S}=ff({channel:t,markDef:r,encoding:i,model:n,bandPosition:E?.5:0}),k=gF({channel:t,channelDef:e,markDef:r,config:o,scaleName:u,scale:l,stack:a,offset:_,defaultRef:zF({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?S==="encoding"?0:.5:le(b)?{signal:`(1-${b})/2`}:Vu(b)?(1-b.band)/2:0});if(c)return{[w]:k,...g};{let C=gs(f),M=g[c],R=_?{...M,offset:_}:M;return{[w]:k,[C]:I(k)?[k[0],{...k[1],offset:R}]:{...k,offset:R}}}}function k6(e,t,n,r,i,o,a){if(aL(e))return 0;let s=e==="x"||e==="y2",u=s?-t/2:t/2;if(le(n)||le(i)||le(r)||o){let l=yi(n),c=yi(i),f=yi(r),d=yi(o),p=o?`(${a} < ${d} ? ${s?"":"-"}0.5 * (${d} - (${a})) : ${u})`:u,m=f?`${f} + `:"",g=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:m+g+y}}else return i=i||0,r+(n?-i-u:+i+u)}function qce({fieldDef:e,fieldDef2:t,channel:n,model:r}){let{config:i,markDef:o,encoding:a}=r,s=r.getScaleComponent(n),u=r.scaleName(n),l=s?s.get("type"):void 0,c=s.get("reverse"),f=l8({channel:n,fieldDef:e,markDef:o,config:i,scaleType:l}),h=r.component.axes[n]?.[0]?.get("translate")??.5,p=wt(n)?Ie("binSpacing",o,i)??0:0,m=fo(n),g=gs(n),y=gs(m),b=oo("minBandSize",o,i),{offset:v}=ff({channel:n,markDef:o,encoding:a,model:r,bandPosition:0}),{offset:w}=ff({channel:m,markDef:o,encoding:a,model:r,bandPosition:0}),E=xue({fieldDef:e,scaleName:u}),_=k6(n,p,c,h,v,b,E),S=k6(m,p,c,h,w??v,b,E),k=le(f)?{signal:`(1-${f.signal})/2`}:Vu(f)?(1-f.band)/2:.5,C=ys({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(Xe(e.bin)||e.timeUnit){let M=e.timeUnit&&C!==.5;return{[y]:C6({fieldDef:e,scaleName:u,bandPosition:k,offset:S,useRectOffsetField:M}),[g]:C6({fieldDef:e,scaleName:u,bandPosition:le(k)?{signal:`1-${k.signal}`}:1-k,offset:_,useRectOffsetField:M})}}else if(an(e.bin)){let M=Bu(e,u,{},{offset:S});if(V(t))return{[y]:M,[g]:Bu(t,u,{},{offset:_})};if(nl(e.bin)&&e.bin.step)return{[y]:M,[g]:{signal:`scale("${u}", ${te(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}X($L(m))}function C6({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return Py({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:Ox,endSuffix:Ix}:{}})}var jce=new Set(["aria","width","height"]);function qr(e,t){let{fill:n=void 0,stroke:r=void 0}=t.color==="include"?xz(e):{};return{...Wce(e.markDef,t),...F6("fill",n),...F6("stroke",r),...ln("opacity",e),...ln("fillOpacity",e),...ln("strokeOpacity",e),...ln("strokeWidth",e),...ln("strokeDash",e),...Nce(e),...mz(e),...PF(e,"href"),...$ce(e)}}function F6(e,t){return t?{[e]:t}:{}}function Wce(e,t){return oae.reduce((n,r)=>(!jce.has(r)&&Y(e,r)&&t[r]!=="ignore"&&(n[r]=et(e[r])),n),{})}function BF(e){let{config:t,markDef:n}=e,r=new Set;if(e.forEachFieldDef((i,o)=>{let a;if(!ho(o)||!(a=e.getScaleType(o)))return;let s=yx(i.aggregate),u=mF({scaleChannel:o,markDef:n,config:t,scaleType:a,isCountAggregate:s});if(mue(u)){let l=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});l&&r.add(l)}}),r.size>0)return{defined:{signal:[...r].map(o=>wx(o,!0)).join(" && ")}}}function R6(e,t){if(t!==void 0)return{[e]:et(t)}}var Dk="voronoi",wz={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(let n of t.events)n.markname=e.getName(Dk)},marks:(e,t,n)=>{let{x:r,y:i}=t.project.hasChannel,o=e.mark;if(Ms(o))return X(dae(o)),n;let a={name:e.getName(Dk),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...mz(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]},s=0,u=!1;return n.forEach((l,c)=>{let f=l.name??"";f===e.component.mark[0].name?s=c:f.includes(Dk)&&(u=!0)}),u||n.splice(s+1,0,a),n}},Ez={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!MF(e.bind),parse:(e,t,n)=>Mz(t,n),topLevelSignals:(e,t,n)=>{let r=t.name,i=t.project,o=t.bind,a=t.init?.[0],s=wz.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((u,l)=>{let c=ot(`${r}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...a?{init:Ku(a[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${G(u.field)}] : null`}]:[],bind:o[u.field]??o[u.channel]??o})}),n},signals:(e,t,n)=>{let r=t.name,i=t.project,o=n.find(l=>l.name===r+oa),a=r+im,s=i.items.map(l=>ot(`${r}_${l.field}`)),u=s.map(l=>`${l} !== null`).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},Gy="_toggle",Sz={defined:e=>e.type==="point"&&!io(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Gy,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{let n=t.name+oa,r=t.name+Gy;return`${r} ? null : ${n}, ${t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${qu(e)}}, `}${r} ? ${n} : null`}},Gce={defined:e=>e.clear!==void 0&&e.clear!==!1&&!io(e),parse:(e,t)=>{t.clear&&(t.clear=Z(t.clear)?fi(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(Ez.defined(t))for(let r of t.project.items){let i=n.findIndex(o=>o.name===ot(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(let i of t.project.items){let o=n.findIndex(a=>a.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){let a=n.findIndex(s=>s.name===i.signals.data);r(a,"null")}}else{let i=n.findIndex(o=>o.name===t.name+oa);r(i,"null"),Sz.defined(t)&&(i=n.findIndex(o=>o.name===t.name+Gy),r(i,"false"))}return n}},_z={defined:e=>{let t=e.resolve==="global"&&e.bind&&MF(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Ei;return t&&!n&&X(gae),t&&n},parse:(e,t,n)=>{let r=xe(n);if(r.select=Z(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},Mz(t,r),Q(n.select)&&(n.select.on||n.select.clear)){let a='event.item && indexof(event.item.mark.role, "legend") < 0';for(let s of t.events)s.filter=J(s.filter??[]),s.filter.includes(a)||s.filter.push(a)}let i=Ck(t.bind)?t.bind.legend:"click",o=Z(i)?fi(i,"view"):J(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{let r=t.name,i=Ck(t.bind)&&t.bind.legend,o=a=>s=>{let u=xe(s);return u.markname=a,u};for(let a of t.project.items){if(!a.hasLegend)continue;let s=`${ot(a.field)}_legend`,u=`${r}_${s}`;if(n.filter(c=>c.name===u).length===0){let c=i.merge.map(o(`${s}_symbols`)).concat(i.merge.map(o(`${s}_labels`))).concat(i.merge.map(o(`${s}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{let r=t.name,i=t.project,o=n.find(d=>d.name===r+oa),a=r+im,s=i.items.filter(d=>d.hasLegend).map(d=>ot(`${r}_${ot(d.field)}_legend`)),l=`${s.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map(d=>({signal:d})),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);let c=n.find(d=>d.name===r+Gy),f=Ck(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Hce(e,t,n){let r=e.fieldDef(t)?.field;for(let i of Ft(e.component.selection??{})){let o=i.project.hasField[r]??i.project.hasChannel[t];if(o&&_z.defined(i)){let a=n.get("selections")??[];a.push(i.name),n.set("selections",a,!1),o.hasLegend=!0}}}var Az="_translate_anchor",kz="_translate_delta",Yce={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{let r=t.name,i=ta.defined(t),o=r+Az,{x:a,y:s}=t.project.hasChannel,u=fi(t.translate,"scope");return i||(u=u.map(l=>(l.between[0].markname=r+Jc,l))),n.push({name:o,value:{},on:[{events:u.map(l=>l.between[0]),update:`{x: x(unit), y: y(unit)${a!==void 0?`, extent_x: ${i?rC(e,at):`slice(${a.signals.visual})`}`:""}${s!==void 0?`, extent_y: ${i?rC(e,Kt):`slice(${s.signals.visual})`}`:""}}`}]},{name:r+kz,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),a!==void 0&&M6(e,t,a,"width",n),s!==void 0&&M6(e,t,s,"height",n),n}};function M6(e,t,n,r,i){let o=t.name,a=o+Az,s=o+kz,u=n.channel,l=ta.defined(t),c=i.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(u),h=d?.get("type"),p=d?.get("reverse"),m=l?u===at?p?"":"-":p?"-":"":"",g=`${a}.extent_${u}`,y=`${m}${s}.${u} / ${l?`${f}`:`span(${g})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${b}(${g}, ${y}${v})`;c.on.push({events:{signal:s},update:l?w:`clampRange(${w}, 0, ${f})`})}var Cz="_zoom_anchor",Fz="_zoom_delta",Vce={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{let r=t.name,i=ta.defined(t),o=r+Fz,{x:a,y:s}=t.project.hasChannel,u=G(e.scaleName(at)),l=G(e.scaleName(Kt)),c=fi(t.zoom,"scope");return i||(c=c.map(f=>(f.markname=r+Jc,f))),n.push({name:r+Cz,on:[{events:c,update:i?`{${[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),a!==void 0&&$6(e,t,a,"width",n),s!==void 0&&$6(e,t,s,"height",n),n}};function $6(e,t,n,r,i){let o=t.name,a=n.channel,s=ta.defined(t),u=i.find(b=>b.name===n.signals[s?"data":"visual"]),l=e.getSizeSignalRef(r).signal,c=e.getScaleComponent(a),f=c?.get("type"),d=s?rC(e,a):u.name,h=o+Fz,p=`${o}${Cz}.${a}`,m=!s||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",g=s?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${m}(${d}, ${p}, ${h}${g})`;u.on.push({events:{signal:h},update:s?y:`clampRange(${y}, 0, ${l})`})}var Qu="_store",oa="_tuple",Xce="_modify",Rz="vlSelectionResolve",Px=[wce,Rce,xce,Sz,Ez,ta,_z,Gce,Yce,Vce,wz];function Kce(e){let t=e.parent;for(;t&&!yr(t);)t=t.parent;return t}function qu(e,{escape:t}={escape:!0}){let n=t?G(e.name):e.name,r=Kce(e);if(r){let{facet:i}=r;for(let o of Lr)i[o]&&(n+=` + '__facet_${o}_' + (facet[${G(r.vgField(o))}])`)}return n}function UF(e){return Ft(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function Mz(e,t){(Z(t.select)||!t.select.on)&&delete e.events,(Z(t.select)||!t.select.clear)&&delete e.clear,(Z(t.select)||!t.select.toggle)&&delete e.toggle}function io(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}function oC(e){let t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...oC(e.object)),t.push(...oC(e.property))),t)}function $z(e){return e.object.type==="MemberExpression"?$z(e.object):e.object.name==="datum"}function Tz(e){let t=Oc(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&$z(r)&&n.add(oC(r).slice(1).join("."))}),n}var df=class e extends Oe{model;filter;expr;_dependentFields;clone(){return new e(null,this.model,xe(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=Hy(this.model,this.filter,this),this._dependentFields=Tz(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}};function Qce(e,t){let n={},r=e.config.selection;if(!t||!t.length)return n;let i=0;for(let o of t){let a=ot(o.name),s=o.select,u=Z(s)?s:s.type,l=Q(s)?xe(s):{type:u},c=r[u];for(let h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=xe(c[h]??l[h])));let f=n[a]={...l,name:a,type:u,init:o.value,bind:o.bind,events:Z(l.on)?fi(l.on,"scope"):J(xe(l.on))};if(io(f)&&(i++,i>1)){delete n[a];continue}let d=xe(o);for(let h of Px)h.defined(f)&&h.parse&&h.parse(e,f,d)}return i>1&&X(Eae),n}function Dz(e,t,n,r="datum"){let i=Z(t)?t:t.param,o=ot(i),a=G(o+Qu),s;try{s=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(s.project.timeUnit){let d=n??e.component.data.raw,h=s.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}let u=s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=s.resolve==="global"?")":`, ${G(s.resolve)})`,c=`${u}${a}, ${r}${l}`,f=`length(data(${a}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function Nz(e,t,n){let r=ot(t),i=n.encoding,o=n.field,a;try{a=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=a.project.items[0].field,a.project.items.length>1&&X(Sae(o));else if(i&&!o){let s=a.project.items.filter(u=>u.channel===i);!s.length||s.length>1?(o=a.project.items[0].field,X(_ae(s,i,n,o))):o=s[0].field}return`${a.name}[${G(zr(o))}]`}function Jce(e,t){for(let[n,r]of ms(e.component.selection??{})){let i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new En(new df(t,e,{param:n}),i,lt.Lookup,e.component.data.outputNodeRefCounts)}}function Hy(e,t,n){return Rp(t,r=>Z(r)?r:Dse(r)?Dz(e,r,n):jL(r))}function Zce(e,t){if(e)return I(e)&&!ds(e)?e.map(n=>EF(n,t)).join(", "):e}function Nk(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function Fp(e,t,n,r={header:!1}){let{disable:i,orient:o,scale:a,labelExpr:s,title:u,zindex:l,...c}=e.combine();if(!i){for(let f in c){let d=f,h=Pue[d],p=c[d];if(h&&h!==t&&h!=="both")delete c[d];else if(rm(p)){let{condition:m,...g}=p,y=J(m),b=o6[d];if(b){let{vgProp:v,part:w}=b,E=[...y.map(_=>{let{test:S,...k}=_;return{test:Hy(null,S),...k}}),g];Nk(c,w,v,E),delete c[d]}else if(b===null){let v={signal:y.map(w=>{let{test:E,..._}=w;return`${Hy(null,E)} ? ${j4(_)} : `}).join("")+j4(g)};c[d]=v}}else if(le(p)){let m=o6[d];if(m){let{vgProp:g,part:y}=m;Nk(c,y,g,p),delete c[d]}}Ae(["labelAlign","labelBaseline"],d)&&c[d]===null&&delete c[d]}if(t==="grid"){if(!c.grid)return;if(c.encode){let{grid:f}=c.encode;c.encode={...f?{grid:f}:{}},Ve(c.encode)&&delete c.encode}return{scale:a,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:vt(l,0)}}else{if(!r.header&&e.mainExtracted)return;if(s!==void 0){let d=s;c.encode?.labels?.update&&le(c.encode.labels.update.text)&&(d=ju(s,"datum.label",c.encode.labels.update.text.signal)),Nk(c,"labels","text",{signal:d})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(let d of b8)e.hasAxisPart(d)||delete c.encode[d];Ve(c.encode)&&delete c.encode}let f=Zce(u,n);return{scale:a,orient:o,grid:!1,...f?{title:f}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:vt(l,0)}}}}function Oz(e){let{axes:t}=e.component,n=[];for(let r of ha)if(t[r]){for(let i of t[r])if(!i.get("disable")&&!i.get("gridScale")){let o=r==="x"?"height":"width",a=e.getSizeSignalRef(o).signal;o!==a&&n.push({name:o,update:a})}}return n}function efe(e,t){let{x:n=[],y:r=[]}=e;return[...n.map(i=>Fp(i,"grid",t)),...r.map(i=>Fp(i,"grid",t)),...n.map(i=>Fp(i,"main",t)),...r.map(i=>Fp(i,"main",t))].filter(i=>i)}function T6(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){let o=n==="x"?"bottom":"left",a=t[n==="x"?"axisBottom":"axisLeft"]||{},s=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...H(a),...H(s)]),l={};for(let c of u.values())l[c]={signal:`${r.signal} === "${o}" ? ${yi(a[c])} : ${yi(s[c])}`};return l}return t[i]})])}function tfe(e,t,n,r){let i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:HL(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",a=le(n)?"axisOrient":`axis${Hp(n)}`,s=[...i,...i.map(l=>o+l.substr(4))],u=["axis",a,o];return{vlOnlyAxisConfig:T6(s,r,e,n),vgAxisConfig:T6(u,r,e,n),axisConfigStyle:nfe([...u,...s],r)}}function nfe(e,t){let n=[{}];for(let r of e){let i=t[r]?.style;if(i){i=J(i);for(let o of i)n.push(t.style[o])}}return Object.assign.apply(null,n)}function aC(e,t,n,r={}){let i=wL(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(let o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(r[o]?.[e]!==void 0)return{configFrom:o,configValue:r[o][e]};return{}}var D6={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??rfe(n,e),gridScale:({model:e,channel:t})=>ife(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||Pz(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||Iz(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??afe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??sfe(t.type,n,V(t)&&!!t.timeUnit,V(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{let o=e==="x"?"width":e==="y"?"height":void 0,a=o?t.getSizeSignalRef(o):void 0;return n.tickCount??lfe({fieldOrDatumDef:r,scaleType:i,size:a,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??cfe({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;let r=Lz(t,n);if(r!==void 0)return r;let i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",a=t.fieldDef(o);return SL(i?[r6(i)]:[],V(a)?[r6(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>ffe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??dfe(n,t)};function rfe(e,t){return!Xt(e)&&V(t)&&!Xe(t?.bin)&&!an(t?.bin)}function ife(e,t){let n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function ofe(e,t,n,r,i){let o=t?.labelAngle;if(o!==void 0)return le(o)?o:Dp(o);{let{configValue:a}=aC("labelAngle",r,t?.style,i);return a!==void 0?Dp(a):n===at&&Ae([cF,lF],e.type)&&!(V(e)&&e.timeUnit)?270:void 0}}function sC(e){return`(((${e.signal} % 360) + 360) % 360)`}function Iz(e,t,n,r){if(e!==void 0)if(n==="x"){if(le(e)){let i=sC(e),o=le(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(le(t)){let i=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${i} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(le(e)){let i=sC(e),o=le(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${i} <= 45 || 315 <= ${i} || (135 <= ${i} && ${i} <= 225) ? ${r?'"middle"':"null"} : (45 <= ${i} && ${i} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return r?"middle":null;if(le(t)){let i=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${i} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function Pz(e,t,n){if(e===void 0)return;let r=n==="x",i=r?0:90,o=r?"bottom":"left";if(le(e)){let a=sC(e),s=le(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${i?`(${a} + 90)`:a} % 180 === 0) ? ${r?null:'"center"'} :(${i} < ${a} && ${a} < ${180+i}) === ${s} ? "left" : "right"`}}if((e+i)%180===0)return r?null:"center";if(le(t)){let a=i<e&&e<180+i?"===":"!==";return{signal:`${`${t.signal} ${a} "${o}"`} ? "left" : "right"`}}return(i<e&&e<180+i)==(t===o)?"left":"right"}function afe(e,t){if(t==="x"&&Ae(["quantitative","temporal"],e))return!0}function sfe(e,t,n,r){if(n&&!Q(r)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function ufe(e){return e==="x"?"bottom":"left"}function lfe({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){if(!r&&!Xt(t)&&t!=="log"){if(V(e)){if(Xe(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&Ae(["month","hours","day","quarter"],Vt(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function cfe({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(V(t)){let{timeUnit:n}=t;if(n){let r=BL(n);if(r)return{signal:r}}}}function Lz(e,t){let n=t==="x"?"x2":"y2",r=e.fieldDef(t),i=e.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;if(o&&a)return _L(o,a);if(o)return o;if(a)return a;if(o!==void 0)return o;if(a!==void 0)return a}function ffe(e,t){let n=e.values;if(I(n))return x8(t,n);if(le(n))return n}function dfe(e,t){return e==="rect"&&zy(t)?1:0}var Lp=class e extends Oe{transform;_dependentFields;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=Tz(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((r,i)=>{if(al(r)&&u8(r.sort)){let{field:o,timeUnit:a}=r,s=r.sort,u=s.map((l,c)=>`${jL({field:o,timeUnit:a,equal:l})} ? ${c} : `).join("")+s.length;t=new e(t,{calculate:u,as:hf(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Re(this.transform)}`}};function hf(e,t,n){return te(e,{prefix:t,suffix:"sort_index",...n})}function Lx(e,t){return Ae(["top","bottom"],t)?"column":Ae(["left","right"],t)||e==="row"?"row":"column"}function pf(e,t,n,r){let i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return vt((t||{})[e],i[e],n.header[e])}function zx(e,t,n,r){let i={};for(let o of e){let a=pf(o,t||{},n,r);a!==void 0&&(i[o]=a)}return i}var qF=["row","column"],jF=["header","footer"];function hfe(e,t){let n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=zx(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),u=Lx(t,s),l=Dp(a);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...Bz(l,u),...zz(u,l,o),...Uz(r,i,t,ole,P8)}}}function zz(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}let r=Pz(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function Bz(e,t){let n=Iz(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function pfe(e,t){let n=e.component.layoutHeaders[t],r=[];for(let i of jF)if(n[i])for(let o of n[i]){let a=gfe(e,t,i,n,o);a!=null&&r.push(a)}return r}function mfe(e,t){let{sort:n}=e;return ea(n)?{field:te(n,{expr:"datum"}),order:n.order??"ascending"}:I(n)?{field:hf(e,t,{expr:"datum"}),order:"ascending"}:{field:te(e,{expr:"datum"}),order:n??"ascending"}}function uC(e,t,n){let{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=zx(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=xF({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=Lx(t,s);return{text:{signal:u?ju(ju(u,"datum.label",l),"datum.value",te(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...Bz(o,c),...zz(c,o,a),...Uz(n,e,t,ale,L8)}}function gfe(e,t,n,r,i){if(i){let o=null,{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){let{labelOrient:f}=zx(["labelOrient"],a.header,s,t);(t==="row"&&!Ae(["top","bottom"],f)||t==="column"&&!Ae(["left","right"],f))&&(o=uC(a,t,s))}let u=yr(e)&&!Zp(e.facet),l=i.axes,c=l?.length>0;if(o||c){let f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:mfe(a,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}var yfe={column:{start:0,end:1},row:{start:1,end:0}};function xfe(e,t){return yfe[t][e]}function bfe(e,t){let n={};for(let r of Lr){let i=e[r];if(i?.facetFieldDef){let{titleAnchor:o,titleOrient:a}=zx(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),s=Lx(r,a),u=xfe(o,s);u!==void 0&&(n[s]=u)}}return Ve(n)?void 0:n}function Uz(e,t,n,r,i){let o={};for(let a of r){if(!i[a])continue;let s=pf(a,t?.header,e,n);s!==void 0&&(o[i[a]]=s)}return o}function WF(e){return[...Fy(e,"width"),...Fy(e,"height"),...Fy(e,"childWidth"),...Fy(e,"childHeight")]}function Fy(e,t){let n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(r==null||r==="merged")return[];let i=e.getSizeSignalRef(t).signal;if(r==="step"){let o=e.getScaleComponent(n);if(o){let a=o.get("type"),s=o.get("range");if(Xt(a)&&rl(s)){let u=e.scaleName(n);return yr(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[N6(u,s)]:[N6(u,s),{name:i,update:qz(u,o,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){let o=i.endsWith("width"),a=o?"containerSize()[0]":"containerSize()[1]",s=Hk(e.config.view,o?"width":"height"),u=`isFinite(${a}) ? ${a} : ${s}`;return[{name:i,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:i,value:r}]}function N6(e,t){let n=`${e}_step`;return le(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function qz(e,t,n){let r=t.get("type"),i=t.get("padding"),o=vt(t.get("paddingOuter"),i),a=t.get("paddingInner");return a=r==="band"?a!==void 0?a:i:1,`bandspace(${n}, ${yi(a)}, ${yi(o)}) * ${e}_step`}function jz(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function Wz(e,t){return H(e).reduce((n,r)=>({...n,...bf({model:t,channelDef:e[r],vgChannel:r,mainRefFn:i=>et(i.value),invalidValueRef:void 0})}),{})}function Gz(e,t){if(yr(t))return e==="theta"?"independent":"shared";if(vf(t))return"shared";if(XF(t))return wt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function GF(e,t){let n=e.scale[t],r=wt(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&X(tse(t)),"independent"):e[r][t]||"shared"}var vfe={...lle,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Hz=H(vfe),lC=class extends ra{},O6={symbols:wfe,gradient:Efe,labels:Sfe,entries:_fe};function wfe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;let{markDef:a,encoding:s,config:u,mark:l}=n,c=a.filled&&l!=="trail",f={...lae({},n,oue),...xz(n,{filled:c})},d=i.get("symbolOpacity")??u.legend.symbolOpacity,h=i.get("symbolFillColor")??u.legend.symbolFillColor,p=i.get("symbolStrokeColor")??u.legend.symbolStrokeColor,m=d===void 0?Yz(s.opacity)??a.opacity:void 0;if(f.fill){if(r==="fill"||c&&r===nr)delete f.fill;else if(Y(f.fill,"field"))h?delete f.fill:(f.fill=et(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=et(m??1));else if(I(f.fill)){let g=cC(s.fill??s.color)??a.fill??(c&&a.color);g&&(f.fill=et(g))}}if(f.stroke){if(r==="stroke"||!c&&r===nr)delete f.stroke;else if(Y(f.stroke,"field")||p)delete f.stroke;else if(I(f.stroke)){let g=vt(cC(s.stroke||s.color),a.stroke,c?a.color:void 0);g&&(f.stroke={value:g})}}if(r!==da){let g=V(t)&&Xz(n,i,t);g?f.opacity=[{test:g,...et(m??1)},et(u.legend.unselectedOpacity)]:m&&(f.opacity=et(m))}return f={...f,...e},Ve(f)?void 0:f}function Efe(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;let{config:i,markDef:o,encoding:a}=t,s={},l=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?Yz(a.opacity)||o.opacity:void 0;return l&&(s.opacity=et(l)),s={...s,...e},Ve(s)?void 0:s}function Sfe(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){let o=n.legend(r)||{},a=n.config,s=V(t)?Xz(n,i,t):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o,f;Xu(c)?f=xi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:a}):l===void 0&&c===void 0&&a.customFormatTypes&&(t.type==="quantitative"&&a.numberFormatType?f=xi({fieldOrDatumDef:t,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):t.type==="temporal"&&a.timeFormatType&&V(t)&&t.timeUnit===void 0&&(f=xi({fieldOrDatumDef:t,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));let d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ve(d)?void 0:d}function _fe(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function Yz(e){return Vz(e,(t,n)=>Math.max(t,n.value))}function cC(e){return Vz(e,(t,n)=>vt(t,n.value))}function Vz(e,t){if(Aue(e))return J(e.condition).reduce(t,e.value);if(vi(e))return e.value}function Xz(e,t,n){let r=t.get("selections");if(!r?.length)return;let i=G(n.field);return r.map(o=>`(!length(data(${G(ot(o)+Qu)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}var I6={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{let{format:r,formatType:i}=t;return o8(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{let{formatType:r}=e;return a8(r,t,n)},gradientLength:e=>{let{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??$fe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Tfe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??kfe(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Qc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Kc(n)&&ro(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Afe(t,e)};function Afe(e,t){let n=e.values;if(I(n))return x8(t,n);if(le(n))return n}function kfe(e,t,n,r){if(t!=="shape"){let i=cC(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Cfe(e){let{legend:t}=e;return vt(t.type,Ffe(e))}function Ffe({channel:e,timeUnit:t,scaleType:n}){if(Kc(e)){if(Ae(["quarter","month","day"],t))return"symbol";if(ro(n))return"gradient"}return"symbol"}function Rfe({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??Mfe(n,t)}function Mfe(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function $fe({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){let{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=e;if(ro(i))return n==="horizontal"?r==="top"||r==="bottom"?P6(t,"width",a,o):a:P6(t,"height",u,s)}function P6(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function Tfe(e){if(Ae(["quantile","threshold","log","symlog"],e))return"greedy"}function Kz(e){let t=ut(e)?Dfe(e):Pfe(e);return e.component.legends=t,t}function Dfe(e){let{encoding:t}=e,n={};for(let r of[nr,...B8]){let i=It(t[r]);!i||!e.getScaleComponent(r)||r===rr&&V(i)&&i.type===xf||(n[r]=Ife(e,r))}return n}function Nfe(e,t){let n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Ofe(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===r?.title)return!0}return e===(n||{})[t]}function Ife(e,t){let n=e.legend(t),{markDef:r,encoding:i,config:o}=e,a=o.legend,s=new lC({},Nfe(e,t));Hce(e,t,s);let u=n!==void 0?!n:a.disable;if(s.set("disable",u,n!==void 0),u)return s;n=n||{};let l=e.getScaleComponent(t).get("type"),c=It(i[t]),f=V(c)?Vt(c.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=Cfe({legend:n,channel:t,timeUnit:f,scaleType:l}),p=Rfe({legend:n,legendType:h,orient:d,legendConfig:a}),m={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:l,orient:d,legendType:h,direction:p};for(let w of Hz){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;let E=w in I6?I6[w](m):n[w];if(E!==void 0){let _=Ofe(E,w,n,e.fieldDef(t));(_||o.legend[w]===void 0)&&s.set(w,E,_)}}let g=n?.encoding??{},y=s.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:h};for(let w of["labels","legend","title","symbols","gradient","entries"]){let E=Wz(g[w]??{},e),_=w in O6?O6[w](E,v):E;_!==void 0&&!Ve(_)&&(b[w]={...y?.length&&V(c)?{name:`${ot(c.field)}_legend_${w}`}:{},...y?.length?{interactive:!0}:{},update:y?.length?{..._,cursor:{value:"pointer"}}:_})}return Ve(b)||s.set("encode",b,!!n?.encoding),s}function Pfe(e){let{legends:t,resolve:n}=e.component;for(let r of e.children){Kz(r);for(let i of H(r.component.legends))n.legend[i]=GF(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=Qz(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(let r of H(t))for(let i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function Qz(e,t){if(!e)return t.clone();let n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(let o of Hz){let a=xs(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",(s,u)=>{switch(o){case"symbolType":return Lfe(s,u);case"title":return AL(s,u);case"type":return i=!0,hr("symbol")}return Nx(s,u,o,"legend")});e.setWithExplicit(o,a)}return i&&(e.implicit?.encode?.gradient&&Ny(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&Ny(e.explicit,["encode","gradient"])),e}function Lfe(e,t){return t.value==="circle"?t:e}function zfe(e,t,n,r){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=r}function Jz(e){let t=e.component.legends,n={};for(let i of H(t)){let o=e.getScaleComponent(i),a=Pe(o.get("domains"));if(n[a])for(let s of n[a])Qz(s,t[i])||n[a].push(t[i]);else n[a]=[t[i].clone()]}return Ft(n).flat().map(i=>Bfe(i,e.config)).filter(i=>i!==void 0)}function Bfe(e,t){let{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),o.encode?.symbols){let a=o.encode.symbols.update;a.fill&&a.fill.value!=="transparent"&&!a.stroke&&!o.stroke&&(a.stroke={value:"transparent"});for(let s of B8)o[s]&&delete a[s]}if(o.title||delete o.title,r!==void 0){let a=r;o.encode?.labels?.update&&le(o.encode.labels.update.text)&&(a=ju(r,"datum.label",o.encode.labels.update.text.signal)),zfe(o,"labels","text",{signal:a})}return o}}function Ufe(e){return vf(e)||XF(e)?qfe(e):Zz(e)}function qfe(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),Zz(e))}function Zz(e){let t=e.component.projection;if(!t||t.merged)return[];let n=t.combine(),{name:r}=n;if(t.data){let i={signal:`[${t.size.map(a=>a.signal).join(", ")}]`},o=t.data.reduce((a,s)=>{let u=le(s)?s.signal:`data('${e.lookupDataSource(s)}')`;return Ae(a,u)||a.push(u),a},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}var jfe=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"],Yy=class extends ra{specifiedProjection;size;data;merged=!1;constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i}get isFit(){return!!this.data}};function eB(e){e.component.projection=ut(e)?Wfe(e):Yfe(e)}function Wfe(e){if(e.hasProjection){let t=sn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?Gfe(e):void 0,o=new Yy(e.projectionName(!0),{...sn(e.config.projection),...t},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function Gfe(e){let t=[],{encoding:n}=e;for(let r of[[ki,Ai],[Br,Ci]])(It(n[r[0]])||It(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(rr)&&e.typedFieldDef(rr).type===xf&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(lt.Main)),t}function Hfe(e,t){let n=OC(jfe,i=>!!(!ee(e.explicit,i)&&!ee(t.explicit,i)||ee(e.explicit,i)&&ee(t.explicit,i)&&mr(e.get(i),t.get(i))));if(mr(e.size,t.size)){if(n)return e;if(mr(e.explicit,{}))return t;if(mr(t.explicit,{}))return e}return null}function Yfe(e){if(e.children.length===0)return;let t;for(let r of e.children)eB(r);let n=OC(e.children,r=>{let i=r.component.projection;if(i)if(t){let o=Hfe(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){let r=e.projectionName(!0),i=new Yy(r,t.specifiedProjection,t.size,xe(t.data));for(let o of e.children){let a=o.component.projection;a&&(a.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(a.get("name"),r),a.merged=!0)}return i}}function Vfe(e,t,n,r){if(nm(t,n)){let i=ut(e)?e.axis(n)??e.legend(n)??{}:{},o=te(t,{expr:"datum"}),a=te(t,{expr:"datum",binSuffix:"end"});return{formulaAs:te(t,{binSuffix:"range",forAs:!0}),formula:Jp(o,a,i.format,i.formatType,r)}}return{}}function tB(e,t){return`${yL(e)}_${t}`}function Xfe(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function HF(e,t,n){let r=Rx(n,void 0)??{},i=tB(r,t);return e.getName(`${i}_bins`)}function Kfe(e){return"as"in e}function L6(e,t,n){let r,i;Kfe(e)?r=Z(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[te(e,{forAs:!0}),te(e,{binSuffix:"end",forAs:!0})];let o={...Rx(t,void 0)},a=tB(o,e.field),{signal:s,extentSignal:u}=Xfe(n,a);if(xx(o.extent)){let c=o.extent;i=Nz(n,c.param,c),delete o.extent}let l={bin:o,field:e.field,as:[r],...s?{signal:s}:{},...u?{extentSignal:u}:{},...i?{span:i}:{}};return{key:a,binComponent:l}}var vs=class e extends Oe{bins;clone(){return new e(null,xe(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){let r=n.reduceFieldDef((i,o,a)=>{if(jn(o)&&Xe(o.bin)){let{key:s,binComponent:u}=L6(o,o.bin,n);i[s]={...u,...i[s],...Vfe(n,o,a,n.config)}}return i},{});return Ve(r)?null:new e(t,r)}static makeFromTransform(t,n,r){let{key:i,binComponent:o}=L6(n,n.bin,r);return new e(t,{[i]:o})}merge(t,n){for(let r of H(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=no([...this.bins[r].as,...t.bins[r].as],Re)):this.bins[r]=t.bins[r];for(let r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(Ft(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Ft(this.bins).map(t=>t.field))}hash(){return`Bin ${Re(this.bins)}`}assemble(){return Ft(this.bins).flatMap(t=>{let n=[],[r,...i]=t.as,{extent:o,...a}=t.bin,s={type:"bin",field:zr(t.field),as:r,signal:t.signal,...xx(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...a};!o&&t.extentSignal&&(n.push({type:"extent",field:zr(t.field),signal:t.extentSignal}),s.extent={signal:t.extentSignal}),n.push(s);for(let u of i)for(let l=0;l<2;l++)n.push({type:"formula",expr:te({field:r[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}};function Qfe(e,t,n,r){let i=ut(r)?r.encoding[fo(t)]:void 0;if(jn(n)&&ut(r)&&c8(n,i,r.markDef,r.config)){e.add(te(n,{})),e.add(te(n,{suffix:"end"}));let{mark:o,markDef:a,config:s}=r,u=ys({fieldDef:n,markDef:a,config:s});Np(o)&&u!==.5&&wt(t)&&(e.add(te(n,{suffix:Ox})),e.add(te(n,{suffix:Ix}))),n.bin&&nm(n,t)&&e.add(te(n,{binSuffix:"range"}))}else if(uL(t)){let o=sL(t);e.add(r.getName(o))}else e.add(te(n));return al(n)&&Hse(n.scale?.range)&&e.add(n.scale.range.field),e}function Jfe(e,t){for(let n of H(t)){let r=t[n];for(let i of H(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}var aa=class e extends Oe{dimensions;measures;clone(){return new e(null,new Set(this.dimensions),xe(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(a=>{a.aggregate&&(r=!0)});let i={},o=new Set;return!r||(n.forEachFieldDef((a,s)=>{let{aggregate:u,field:l}=a;if(u)if(u==="count")i["*"]??={},i["*"].count=new Set([te(a,{forAs:!0})]);else{if(na(u)||Rs(u)){let c=na(u)?"argmin":"argmax",f=u[c];i[f]??={},i[f][c]=new Set([te({op:c,field:f},{forAs:!0})])}else i[l]??={},i[l][u]=new Set([te(a,{forAs:!0})]);ho(s)&&n.scaleDomain(s)==="unaggregated"&&(i[l]??={},i[l].min=new Set([te({field:l,aggregate:"min"},{forAs:!0})]),i[l].max=new Set([te({field:l,aggregate:"max"},{forAs:!0})]))}else Qfe(o,s,a,n)}),o.size+H(i).length===0)?null:new e(t,o,i)}static makeFromTransform(t,n){let r=new Set,i={};for(let o of n.aggregate){let{op:a,field:s,as:u}=o;a&&(a==="count"?(i["*"]??={},i["*"].count=new Set([u||te(o,{forAs:!0})])):(i[s]??={},i[s][a]??=new Set,i[s][a].add(u||te(o,{forAs:!0}))))}for(let o of n.groupby??[])r.add(o);return r.size+H(i).length===0?null:new e(t,r,i)}merge(t){return J6(this.dimensions,t.dimensions)?(Jfe(this.measures,t.measures),!0):(yse("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...H(this.measures)])}producedFields(){let t=new Set;for(let n of H(this.measures))for(let r of H(this.measures[n])){let i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${Re({dimensions:this.dimensions,measures:this.measures})}`}assemble(){let t=[],n=[],r=[];for(let o of H(this.measures))for(let a of H(this.measures[o]))for(let s of this.measures[o][a])r.push(s),t.push(a),n.push(o==="*"?null:zr(o));return{type:"aggregate",groupby:[...this.dimensions].map(zr),ops:t,fields:n,as:r}}},ws=class extends Oe{model;name;data;column;row;facet;childModel;constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(let o of Lr){let a=n.facet[o];if(a){let{bin:s,sort:u}=a;this[o]={name:n.getName(`${o}_domain`),fields:[te(a),...Xe(s)?[te(a,{binSuffix:"end"})]:[]],...ea(u)?{sortField:u}:I(u)?{sortIndexField:hf(a,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(let n of Lr)this[n]&&(t+=` ${n.charAt(0)}:${Re(this[n])}`);return t}get fields(){let t=[];for(let n of Lr)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){let t=new Set(this.fields);for(let n of Lr)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){let t={};for(let n of ha){let r=this.childModel.component.scales[n];if(r&&!r.merged){let i=r.get("type"),o=r.get("range");if(Xt(i)&&rl(o)){let a=Bx(this.childModel,n),s=VF(a);s?t[n]=s:X(XC(n))}}}return t}assembleRowColumnHeaderData(t,n,r){let i={row:"y",column:"x",facet:void 0}[t],o=[],a=[],s=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),a.push("max")):(o.push(r[i]),a.push("distinct")),s.push(`distinct_${r[i]}`));let{sortField:u,sortIndexField:l}=this[t];if(u){let{op:c=kx,field:f}=u;o.push(f),a.push(c),s.push(te(u,{forAs:!0}))}else l&&(o.push(l),a.push("max"),s.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:a,as:s}:{}}]}}assembleFacetHeaderData(t){let{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(let u of qF){for(let l of jF){let c=r[u]?.[l]??[];for(let f of c)if(f.axes?.length>0){o[u]=!0;break}}if(o[u]){let l=`length(data("${this.facet.name}"))`,c=u==="row"?n?{signal:`ceil(${l} / ${n})`}:1:n?{signal:`min(${l}, ${n})`}:{signal:l};i.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:c}]})}}let{row:a,column:s}=o;return(a||s)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){let t=[],n=null,r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:a}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;let s=[].concat(r.x??[],r.y??[]),u=s.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:s,ops:u}]})}for(let s of[Zo,Jo])this[s]&&t.push(this.assembleRowColumnHeaderData(s,n,r));if(a){let s=this.assembleFacetHeaderData(r);s&&t.push(...s)}return t}};function z6(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Zfe(e,t){let n=LC(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){let r=z6(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){let r=z6(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return X(kae(t)),null}function ede(e){let t={};return Ty(e.filter,n=>{if(qL(n)){let r=null;tF(n)?r=pr(n.equal):rF(n)?r=pr(n.lte):nF(n)?r=pr(n.lt):iF(n)?r=pr(n.gt):oF(n)?r=pr(n.gte):aF(n)?r=n.range[0]:sF(n)&&(r=(n.oneOf??n.in)[0]),r&&(il(r)?t[n.field]="date":ke(r)?t[n.field]="number":Z(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function tde(e){let t={};function n(r){uf(r)?t[r.field]="date":r.type==="quantitative"&&Zoe(r.aggregate)?t[r.field]="number":tf(r.field)>1?r.field in t||(t[r.field]="flatten"):al(r)&&ea(r.sort)&&tf(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((ut(e)||yr(e))&&e.forEachFieldDef((r,i)=>{if(jn(r))n(r);else{let o=tl(i),a=e.fieldDef(o);n({...r,type:a.type})}}),ut(e)){let{mark:r,markDef:i,encoding:o}=e;if(Ms(r)&&!e.encoding.order){let a=i.orient==="horizontal"?"y":"x",s=o[a];V(s)&&s.type==="quantitative"&&!(s.field in t)&&(t[s.field]="number")}}return t}function nde(e){let t={};if(ut(e)&&e.component.selection)for(let n of H(e.component.selection)){let r=e.component.selection[n];for(let i of r.project.items)!i.channel&&tf(i.field)>1&&(t[i.field]="flatten")}return t}var qn=class e extends Oe{_parse;clone(){return new e(null,xe(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Re(this._parse)}`}static makeExplicit(t,n,r){let i={},o=n.data;return!ps(o)&&o?.format?.parse&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(let s of H(r)){let u=i.getWithExplicit(s);u.value!==void 0&&(u.explicit||u.value===r[s]||u.value==="derived"||r[s]==="flatten"?delete r[s]:X(X4(s,r[s],u.value)))}for(let s of H(n)){let u=i.get(s);u!==void 0&&(u===n[s]?delete n[s]:X(X4(s,n[s],u)))}let o=new ra(n,r);i.copyAll(o);let a={};for(let s of H(o.combine())){let u=o.get(s);u!==null&&(a[s]=u)}return H(a).length===0||i.parseNothing?null:new e(t,a)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){let t={};for(let n of H(this._parse)){let r=this._parse[n];tf(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(H(this._parse))}dependentFields(){return new Set(H(this._parse))}assembleTransforms(t=!1){return H(this._parse).filter(n=>t?tf(n)>1:!0).map(n=>{let r=Zfe(n,this._parse[n]);return r?{type:"formula",expr:r,as:gf(n)}:null}).filter(n=>n!==null)}},Es=class e extends Oe{clone(){return new e(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Ei])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ei}}},zp=class e extends Oe{params;clone(){return new e(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Re(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}},Bp=class e extends Oe{params;clone(){return new e(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Re(this.params)}`}assemble(){return{type:"sequence",...this.params}}},sa=class extends Oe{_data;_name;_generator;constructor(t){super(null),t??={name:"source"};let n;if(ps(t)||(n=t.format?{...gr(t.format,["parse"])}:{}),Pp(t))this._data={values:t.values};else if(cf(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];Ae(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else oz(t)?this._data={values:[{type:"Sphere"}]}:(rz(t)||ps(t))&&(this._data={});this._generator=ps(t),t.name&&(this._name=t.name),n&&!Ve(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}};function YF(e){return e instanceof sa||e instanceof zp||e instanceof Bp}var Up=class{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}},ua=class extends Up{getNodeDepths(t,n,r){r.set(t,n);for(let i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){let r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(let i of r)this.run(i[0]);return this.modifiedFlag}},qp=class extends Up{optimize(t){this.run(t);for(let n of t.children)this.optimize(n);return this.modifiedFlag}},fC=class extends qp{mergeNodes(t,n){let r=n.shift();for(let i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){let n=t.children.map(i=>i.hash()),r={};for(let i=0;i<n.length;i++)r[n[i]]===void 0?r[n[i]]=[t.children[i]]:r[n[i]].push(t.children[i]);for(let i of H(r))r[i].length>1&&(this.setModified(),this.mergeNodes(t,r[i]))}},dC=class extends qp{requiresSelectionId;constructor(t){super(),this.requiresSelectionId=t&&UF(t)}run(t){t instanceof Es&&(this.requiresSelectionId&&(YF(t.parent)||t.parent instanceof aa||t.parent instanceof qn)||(this.setModified(),t.remove()))}},hC=class extends Up{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof bs&&(r=t.producedFields(),IC(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(let i of t.children)this.run(i,new Set([...n,...r]))}},pC=class extends qp{constructor(){super()}run(t){t instanceof En&&!t.isRequired()&&(this.setModified(),t.remove())}},mC=class extends ua{run(t){if(!YF(t)&&!(t.numChildren()>1)){for(let n of t.children)if(n instanceof qn)if(t instanceof qn)this.setModified(),t.merge(n);else{if(PC(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}},gC=class extends ua{run(t){let n=[...t.children],r=t.children.filter(i=>i instanceof qn);if(t.numChildren()>1&&r.length>=1){let i={},o=new Set;for(let a of r){let s=a.parse;for(let u of H(s))u in i?i[u]!==s[u]&&o.add(u):i[u]=s[u]}for(let a of o)delete i[a];if(!Ve(i)){this.setModified();let a=new qn(t,i);for(let s of n){if(s instanceof qn)for(let u of H(i))delete s.parse[u];t.removeChild(s),s.parent=a,s instanceof qn&&H(s.parse).length===0&&s.remove()}}}}},yC=class extends ua{run(t){t instanceof En||t.numChildren()>0||t instanceof ws||t instanceof sa||(this.setModified(),t.remove())}},xC=class extends ua{run(t){let n=t.children.filter(i=>i instanceof bs),r=n.pop();for(let i of n)this.setModified(),r.merge(i)}},bC=class extends ua{run(t){let n=t.children.filter(i=>i instanceof aa),r={};for(let i of n){let o=Re(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(let i of H(r)){let o=r[i];if(o.length>1){let a=o.pop();for(let s of o)a.merge(s)&&(t.removeChild(s),s.parent=a,s.remove(),this.setModified())}}}},vC=class extends ua{model;constructor(t){super(),this.model=t}run(t){let n=!(YF(t)||t instanceof df||t instanceof qn||t instanceof Es),r=[],i=[];for(let o of t.children)o instanceof vs&&(n&&!PC(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){let o=r.pop();for(let a of r)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof vs?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){let o=i.pop();for(let a of i)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}},wC=class extends ua{run(t){let n=[...t.children];if(!ef(n,a=>a instanceof En)||t.numChildren()<=1)return;let i=[],o;for(let a of n)if(a instanceof En){let s=a;for(;s.numChildren()===1;){let[u]=s.children;if(u instanceof En)s=u;else break}i.push(...s.children),o?(t.removeChild(a),a.parent=o.parent,o.parent.removeChild(o),o.parent=s,this.setModified()):o=s}else i.push(a);if(i.length){this.setModified();for(let a of i)a.parent.removeChild(a),a.parent=o}}},Ju=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=no(this.transform.groupby.concat(t),n=>n)}dependentFields(){let t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??te(t)}hash(){return`JoinAggregateTransform ${Re(this.transform)}`}assemble(){let t=[],n=[],r=[];for(let o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);let i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}},jp=class e extends Oe{filter;clone(){return new e(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,r){let{config:i,markDef:o}=n,{marks:a,scales:s}=r;if(a==="include-invalid-values"&&s==="include-invalid-values")return null;let u=n.reduceFieldDef((l,c,f)=>{let d=ho(f)&&n.getScaleComponent(f);if(d){let h=d.get("type"),{aggregate:p}=c,m=mF({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:yx(p)});m!=="show"&&m!=="always-valid"&&(l[c.field]=c)}return l},{});return H(u).length?new e(t,u):null}dependentFields(){return new Set(H(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Re(this.filter)}`}assemble(){let t=H(this.filter).reduce((n,r)=>{let i=this.filter[r],o=te(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${EC(o)}))`):i.type==="quantitative"&&n.push(EC(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}};function EC(e){return`isValid(${e}) && isFinite(+${e})`}function rde(e){return e.stack.stackBy.reduce((t,n)=>{let r=n.fieldDef,i=te(r);return i&&t.push(i),t},[])}function ide(e){return I(e)&&e.every(t=>Z(t))&&e.length>1}var Zu=class e extends Oe{_stack;clone(){return new e(null,xe(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){let{stack:r,groupby:i,as:o,offset:a="zero"}=n,s=[],u=[];if(n.sort!==void 0)for(let f of n.sort)s.push(f.field),u.push(vt(f.order,"ascending"));let l={field:s,order:u},c;return ide(o)?c=o:Z(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new e(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:a,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){let r=n.stack,{encoding:i}=n;if(!r)return null;let{groupbyChannels:o,fieldChannel:a,offset:s,impute:u}=r,l=o.map(h=>{let p=i[h];return wi(p)}).filter(h=>!!h),c=rde(n),f=n.encoding.order,d;if(I(f)||V(f))d=EL(f);else{let h=f8(f)?f.sort:a==="y"?"descending":"ascending";d=c.reduce((p,m)=>(p.field.includes(m)||(p.field.push(m),p.order.push(h)),p),{field:[],order:[]})}return new e(t,{dimensionFieldDefs:l,stackField:n.vgField(a),facetby:[],stackby:c,sort:d,offset:s,impute:u,as:[n.vgField(a,{suffix:"start",forAs:!0}),n.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){let t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Re(this._stack)}`}getGroupbyFields(){let{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[te(i,{binSuffix:"mid"})]:[te(i,{}),te(i,{binSuffix:"end"})]:[te(i)]).flat():r??[]}assemble(){let t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:a,offset:s,impute:u,as:l}=this._stack;if(u)for(let c of r){let{bandPosition:f=.5,bin:d}=c;if(d){let h=te(c,{expr:"datum"}),p=te(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${EC(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:te(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:te(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:a,as:l,offset:s}),t}},mf=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=no(this.transform.groupby.concat(t),n=>n)}dependentFields(){let t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??te(t)}hash(){return`WindowTransform ${Re(this.transform)}`}assemble(){let t=[],n=[],r=[],i=[];for(let f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);let o=this.transform.frame,a=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>YC(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...a!==void 0?{groupby:a}:{}};let s=[],u=[];if(this.transform.sort!==void 0)for(let f of this.transform.sort)s.push(f.field),u.push(f.order??"ascending");let l={field:s,order:u},c=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...a!==void 0?{groupby:a}:{},...o!==void 0?{frame:o}:{}}}};function ode(e){function t(n){if(!(n instanceof ws)){let r=n.clone();if(r instanceof En){let i=_C+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof aa||r instanceof Zu||r instanceof mf||r instanceof Ju)&&r.addDimensions(e.fields);for(let i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function SC(e){if(e instanceof ws)if(e.numChildren()===1&&!(e.children[0]instanceof En)){let t=e.children[0];(t instanceof aa||t instanceof Zu||t instanceof mf||t instanceof Ju)&&t.addDimensions(e.fields),t.swapWithParent(),SC(e)}else{let t=e.model.component.data.main;nB(t);let n=ode(e),r=e.children.map(n).flat();for(let i of r)i.parent=t}else e.children.map(SC)}function nB(e){if(e instanceof En&&e.type===lt.Main&&e.numChildren()===1){let t=e.children[0];t instanceof ws||(t.swapWithParent(),nB(e))}}var _C="scale_",Ry=5;function AC(e){for(let t of e){for(let n of t.children)if(n.parent!==t)return!1;if(!AC(t.children))return!1}return!0}function gi(e,t){let n=!1;for(let r of t)n=e.optimize(r)||n;return n}function B6(e,t,n){let r=e.sources,i=!1;return i=gi(new pC,r)||i,i=gi(new dC(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=gi(new yC,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=gi(new mC,r)||i,i=gi(new vC(t),r)||i,i=gi(new hC,r)||i,i=gi(new gC,r)||i,i=gi(new bC,r)||i,i=gi(new xC,r)||i,i=gi(new fC,r)||i,i=gi(new wC,r)||i),e.sources=r,i}function ade(e,t){AC(e.sources);let n=0,r=0;for(let i=0;i<Ry&&B6(e,t,!0);i++)n++;e.sources.map(SC);for(let i=0;i<Ry&&B6(e,t,!1);i++)r++;AC(e.sources),Math.max(n,r)===Ry&&X(`Maximum optimization runs(${Ry}) reached.`)}var Yt=class e{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}signal;static fromName(t,n){return new e(()=>t(n))}};function rB(e){ut(e)?sde(e):ude(e)}function sde(e){let t=e.component.scales;for(let n of H(t)){let r=cde(e,n);if(t[n].setWithExplicit("domains",r),dde(e,n),e.component.data.isFaceted){let o=e;for(;!yr(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(let s of r.value)Qo(s)&&(s.data=_C+s.data.replace(_C,""))}}}function ude(e){for(let n of e.children)rB(n);let t=e.component.scales;for(let n of H(t)){let r,i=null;for(let o of e.children){let a=o.component.scales[n];if(a){r===void 0?r=a.getWithExplicit("domains"):r=xs(r,a.getWithExplicit("domains"),"domains","scale",kC);let s=a.get("selectionExtent");i&&s&&i.param!==s.param&&X(bae),i=s}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function lde(e,t,n,r){if(e==="unaggregated"){let{valid:i,reason:o}=U6(t,n);if(!i){X(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){let{valid:i}=U6(t,n);if(i)return"unaggregated"}return e}function cde(e,t){let n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=lde(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&It(r.x2)?It(r.x)?xs(fs(n,i,e,"x"),fs(n,i,e,"x2"),"domain","scale",kC):fs(n,i,e,"x2"):t==="y"&&It(r.y2)?It(r.y)?xs(fs(n,i,e,"y"),fs(n,i,e,"y2"),"domain","scale",kC):fs(n,i,e,"y2"):fs(n,i,e,t)}function fde(e,t,n){return e.map(r=>({signal:`{data: ${Mx(r,{timeUnit:n,type:t})}}`}))}function Ok(e,t,n){let r=Vt(n)?.unit;return t==="temporal"||r?fde(e,t,r):[e]}function fs(e,t,n,r){let{encoding:i,markDef:o,mark:a,config:s,stack:u}=n,l=It(i[r]),{type:c}=l,f=l.timeUnit,d=yce({invalid:oo("invalid",o,s),isPath:Ms(a)});if(Gse(t)){let m=fs(e,void 0,n,r),g=Ok(t.unionWith,c,f);return to([...g,...m.value])}else{if(le(t))return to([t]);if(t&&t!=="unaggregated"&&!VL(t))return to(Ok(t,c,f))}if(u&&r===u.fieldChannel){if(u.offset==="normalize")return hr([[0,1]]);let m=n.requestDataName(d);return hr([{data:m,field:n.vgField(r,{suffix:"start"})},{data:m,field:n.vgField(r,{suffix:"end"})}])}let h=ho(r)&&V(l)?hde(n,r,e):void 0;if(po(l)){let m=Ok([l.datum],c,f);return hr(m)}let p=l;if(t==="unaggregated"){let{field:m}=l;return hr([{data:n.requestDataName(d),field:te({field:m,aggregate:"min"})},{data:n.requestDataName(d),field:te({field:m,aggregate:"max"})}])}else if(Xe(p.bin)){if(Xt(e))return hr(e==="bin-ordinal"?[]:[{data:Tp(h)?n.requestDataName(d):n.requestDataName(lt.Raw),field:n.vgField(r,nm(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!Q(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{let{bin:m}=p;if(Xe(m)){let g=HF(n,p.field,m);return hr([new Yt(()=>{let y=n.getSignalName(g);return`[${y}.start, ${y}.stop]`})])}else return hr([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&Ae(["time","utc"],e)){let m=i[fo(r)];if(c8(p,m,o,s)){let g=n.requestDataName(d),y=ys({fieldDef:p,fieldDef2:m,markDef:o,config:s}),b=Np(a)&&y!==.5&&wt(r);return hr([{data:g,field:n.vgField(r,b?{suffix:Ox}:{})},{data:g,field:n.vgField(r,{suffix:b?Ix:"end"})}])}}return hr(h?[{data:Tp(h)?n.requestDataName(d):n.requestDataName(lt.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function Ik(e,t){let{op:n,field:r,order:i}=e;return{op:n??(t?"sum":kx),...r?{field:zr(r)}:{},...i?{order:i}:{}}}function dde(e,t){let n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,o=VL(r)?r:void 0,a=nl(i)&&xx(i.extent)?i.extent:void 0;(o||a)&&n.set("selectionExtent",o??a,!0)}function hde(e,t,n){if(!Xt(n))return;let r=e.fieldDef(t),i=r.sort;if(u8(i))return{op:"min",field:hf(r,t),order:"ascending"};let{stack:o}=e,a=o?new Set([...o.groupbyFields,...o.stackBy.map(s=>s.fieldDef.field)]):void 0;if(ea(i)){let s=o&&!a.has(i.field);return Ik(i,s)}else if(Eue(i)){let{encoding:s,order:u}=i,l=e.fieldDef(s),{aggregate:c,field:f}=l,d=o&&!a.has(f);if(na(c)||Rs(c))return Ik({field:te(l),order:u},d);if(YC(c)||!c)return Ik({op:c,field:f,order:u},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(Ae(["ascending",void 0],i))return!0}}function U6(e,t){let{aggregate:n,type:r}=e;return n?Z(n)&&!tae.has(n)?{valid:!1,reason:Vae(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:Xae(e)}:{valid:!0}:{valid:!1,reason:Yae(e)}}function kC(e,t,n,r){return e.explicit&&t.explicit&&X(ese(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function pde(e){let t=no(e.map(a=>{if(Qo(a)){let{sort:s,...u}=a;return u}return a}),Re),n=no(e.map(a=>{if(Qo(a)){let s=a.sort;return s!==void 0&&!Tp(s)&&("op"in s&&s.op==="count"&&delete s.field,s.order==="ascending"&&delete s.order),s}}).filter(a=>a!==void 0),Re);if(t.length===0)return;if(t.length===1){let a=e[0];if(Qo(a)&&n.length>0){let s=n[0];if(n.length>1){X(Q4);let u=n.filter(l=>Q(l)&&"op"in l&&l.op!=="min");n.every(l=>Q(l)&&"op"in l)&&u.length===1?s=u[0]:s=!0}else if(Q(s)&&"field"in s){let u=s.field;a.field===u&&(s=s.order?{order:s.order}:!0)}return{...a,sort:s}}return a}let r=no(n.map(a=>Tp(a)||!("op"in a)||Z(a.op)&&ee(Qoe,a.op)?a:(X(nse(a)),!0)),Re),i;r.length===1?i=r[0]:r.length>1&&(X(Q4),i=!0);let o=no(e.map(a=>Qo(a)?a.data:null),a=>a);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(s=>s.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function VF(e){if(Qo(e)&&Z(e.field))return e.field;if(nae(e)){let t;for(let n of e.fields)if(Qo(n)&&Z(n.field)){if(!t)t=n.field;else if(t!==n.field)return X(rse),t}return X(ise),t}else if(rae(e)){X(ose);let t=e.fields[0];return Z(t)?t:void 0}}function Bx(e,t){let r=e.component.scales[t].get("domains").map(i=>(Qo(i)&&(i.data=e.lookupDataSource(i.data)),i));return pde(r)}function iB(e){return vf(e)||XF(e)?e.children.reduce((t,n)=>t.concat(iB(n)),q6(e)):q6(e)}function q6(e){return H(e.component.scales).reduce((t,n)=>{let r=e.component.scales[n];if(r.merged)return t;let i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c,...f}=i,d=mde(i.range,o,n,e),h=Bx(e,n),p=s?Cce(e,s,r,h):null;return t.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function mde(e,t,n,r){if(wt(n)){if(rl(e))return{step:{signal:`${t}_step`}}}else if(Q(e)&&Qo(e))return{...e,data:r.lookupDataSource(e.data)};return e}var Vy=class extends ra{merged=!1;constructor(t,n){super({},{name:t}),this.setWithExplicit("type",n)}domainHasZero(){let t=this.get("type");if(Ae([un.LOG,un.TIME,un.UTC],t))return"definitely-not";let n=this.get("zero");if(n===!0||n===void 0&&Ae([un.LINEAR,un.SQRT,un.POW],t))return"definitely";let r=this.get("domains");if(r.length>0){let i=!1,o=!1,a=!1;for(let s of r){if(I(s)){let u=s[0],l=s[s.length-1];if(ke(u)&&ke(l))if(u<=0&&l>=0){i=!0;continue}else{o=!0;continue}}a=!0}if(i)return"definitely";if(o&&!a)return"definitely-not"}return"maybe"}},gde=["range","scheme"];function yde(e){let t=e.component.scales;for(let n of HC){let r=t[n];if(!r)continue;let i=xde(n,e);r.setWithExplicit("range",i)}}function j6(e,t){let n=e.fieldDef(t);if(n?.bin){let{bin:r,field:i}=n,o=ir(t),a=e.getName(o);if(Q(r)&&r.binned&&r.step!==void 0)return new Yt(()=>{let s=e.scaleName(t),u=`(domain("${s}")[1] - domain("${s}")[0]) / ${r.step}`;return`${e.getSignalName(a)} / (${u})`});if(Xe(r)){let s=HF(e,i,r);return new Yt(()=>{let u=e.getSignalName(s),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(a)} / (${l})`})}}}function xde(e,t){let n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(let f of gde)if(n[f]!==void 0){let d=jk(o,f),h=XL(e,f);if(!d)X(RL(o,f,e));else if(h)X(h);else switch(f){case"range":{let p=n.range;if(I(p)){if(wt(e))return to(p.map(m=>{if(m==="width"||m==="height"){let g=t.getName(m),y=t.getSignalName.bind(t);return Yt.fromName(y,g)}return m}))}else if(Q(p))return to({data:t.requestDataName(lt.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return to(p)}case"scheme":return to(bde(n[f]))}}let a=e===at||e==="xOffset"?"width":"height",s=r[a];if(so(s)){if(wt(e))if(Xt(o)){let f=aB(s,t,e);if(f)return to({step:f})}else X(ML(a));else if(Xp(e)){let f=e===Ss?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){let p=sB(s,o);if(p)return to(p)}}}let{rangeMin:u,rangeMax:l}=n,c=vde(e,t);return(u!==void 0||l!==void 0)&&jk(o,"rangeMin")&&I(c)&&c.length===2?to([u??c[0],l??c[1]]):hr(c)}function bde(e){return Wse(e)?{scheme:e.name,...gr(e,["name"])}:{scheme:e}}function oB(e,t,n,{center:r}={}){let i=ir(e),o=t.getName(i),a=t.getSignalName.bind(t);return e===Kt&&bi(n)?r?[Yt.fromName(s=>`${a(s)}/2`,o),Yt.fromName(s=>`-${a(s)}/2`,o)]:[Yt.fromName(a,o),0]:r?[Yt.fromName(s=>`-${a(s)}/2`,o),Yt.fromName(s=>`${a(s)}/2`,o)]:[0,Yt.fromName(a,o)]}function vde(e,t){let{size:n,config:r,mark:i,encoding:o}=t,{type:a}=It(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case at:case Kt:{if(Ae(["point","band"],u)){let f=uB(e,n,r.view);if(so(f))return{step:aB(f,t,e)}}return oB(e,t,u)}case Ss:case yf:return wde(e,t,u);case fa:{let f=_de(i,r),d=Ade(i,n,t,r);return of(u)?Sde(f,d,Ede(u,r,l,e)):[f,d]}case Ur:return[0,Math.PI*2];case el:return[0,360];case _i:return[0,new Yt(()=>{let f=t.getSignalName(yr(t.parent)?"child_width":"width"),d=t.getSignalName(yr(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case _s:return{step:1e3/r.scale.framesPerSecond};case Cs:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Fs:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case rr:return"symbol";case nr:case lo:case co:return u==="ordinal"?a==="nominal"?"category":"ordinal":c!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case da:case As:case ks:return[r.scale.minOpacity,r.scale.maxOpacity]}}function aB(e,t,n){let{encoding:r}=t,i=t.getScaleComponent(n),o=qC(n),a=r[o];if(q8({step:e,offsetIsDiscrete:be(a)&&uF(a.type)})==="offset"&&E8(r,o)){let u=t.getScaleComponent(o),c=`domain('${t.scaleName(o)}').length`;if(u.get("type")==="band"){let d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}let f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${c} / (1-${uae(f)})`}}else return e.step}function sB(e,t){if(q8({step:e,offsetIsDiscrete:Xt(t)})==="offset")return{step:e.step}}function wde(e,t,n){let r=e===Ss?"x":"y",i=t.getScaleComponent(r);if(!i)return oB(r,t,n,{center:!0});let o=i.get("type"),a=t.scaleName(r),{markDef:s,config:u}=t;if(o==="band"){let l=uB(r,t.size,t.config.view);if(so(l)){let c=sB(l,n);if(c)return c}return[0,{signal:`bandwidth('${a}')`}]}else{let l=t.encoding[r];if(V(l)&&l.timeUnit){let c=BL(l.timeUnit,p=>`scale('${a}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ys({fieldDef:l,markDef:s,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){let p=le(f)?`${f.signal}/2${h}`:`${f/2+d}`,m=le(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${m} * (${c})`}]}return[0,{signal:c}]}return K6(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function uB(e,t,n){let r=e===at?"width":"height",i=t[r];return i!==void 0?i:jy(n,r)}function Ede(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&I(n)?n.length+1:(X(pse(r)),3)}}function Sde(e,t,n){let r=()=>{let i=yi(t),o=yi(e),a=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${a}, ${a})`};return le(t)?new Yt(r):{signal:r()}}function _de(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(bx("size",e))}var W6=.95;function Ade(e,t,n,r){let i={x:j6(n,"x"),y:j6(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;let o=G6(t,i,r.view);return ke(o)?o-1:new Yt(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;let o=G6(t,i,r.view);return ke(o)?Math.pow(W6*o,2):new Yt(()=>`pow(${W6} * ${o.signal}, 2)`)}}throw new Error(bx("size",e))}function G6(e,t,n){let r=so(e.width)?e.width.step:Yk(n,"width"),i=so(e.height)?e.height.step:Yk(n,"height");return t.x||t.y?new Yt(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function lB(e,t){ut(e)?kde(e,t):fB(e,t)}function kde(e,t){let n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(let s of H(n)){let u=a[s],l=n[s],c=e.getScaleComponent(s),f=It(i[s]),d=u[t],h=c.get("type"),p=c.get("padding"),m=c.get("paddingInner"),g=jk(h,t),y=XL(s,t);if(d!==void 0&&(g?y&&X(y):X(RL(h,t,s))),g&&y===void 0)if(d!==void 0){let b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":il(u[t])||v==="temporal"||b?l.set(t,{signal:Mx(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{let b=Y(H6,t)?H6[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:r,hasNestedOffsetScale:S8(i,s),hasSecondaryRangeChannel:!!i[fo(s)]}):r.scale[t];b!==void 0&&l.set(t,b,!1)}}}var H6={bins:({model:e,fieldOrDatumDef:t})=>V(t)?Cde(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Fde(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>Rde(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>Mde(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>$de(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>Tde(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{let i=V(e)?e.sort:void 0;return Dde(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:a})=>Nde(e,t,n,r,i,o.scale,a)};function cB(e){ut(e)?yde(e):fB(e,"range")}function fB(e,t){let n=e.component.scales;for(let r of e.children)t==="range"?cB(r):lB(r,t);for(let r of H(n)){let i;for(let o of e.children){let a=o.component.scales[r];if(a){let s=a.getWithExplicit(t);i=xs(i,s,t,"scale",nz((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function Cde(e,t){let n=t.bin;if(Xe(n)){let r=HF(e,t.field,n);return new Yt(()=>e.getSignalName(r))}else if(an(n)&&nl(n)&&n.step!==void 0)return{step:n.step}}function Fde(e,t){if(Ae([nr,lo,co],e)&&t!=="nominal")return"hcl"}function Rde(e,t,n,r,i,o){if(!(wi(o)?.bin||I(n)||i!=null||r!=null||Ae([un.TIME,un.UTC],e)))return wt(t)?!0:void 0}function Mde(e,t,n,r,i,o){if(wt(e)){if(ro(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;let{type:a,orient:s}=i;if(a==="bar"&&!(V(r)&&(r.bin||r.timeUnit))&&(s==="vertical"&&e==="x"||s==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===un.POINT)return n.pointPadding}}function $de(e,t,n,r,i,o=!1){if(e===void 0){if(wt(t)){let{bandPaddingInner:a,barBandPaddingInner:s,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=i;return o?c:vt(a,n==="bar"?s:n==="tick"?l:u)}else if(Xp(t)&&r===un.BAND)return i.offsetBandPaddingInner}}function Tde(e,t,n,r,i,o=!1){if(e===void 0){if(wt(t)){let{bandPaddingOuter:a,bandWithNestedOffsetPaddingOuter:s}=i;if(o)return s;if(n===un.BAND)return vt(a,le(r)?{signal:`${r.signal}/2`}:r/2)}else if(Xp(t)){if(n===un.POINT)return .5;if(n===un.BAND)return i.offsetBandPaddingOuter}}}function Dde(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return bi(e)&&t==="descending"?le(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(bi(e)&&t==="descending")return!0}function Nde(e,t,n,r,i,o,a){if(!!n&&n!=="unaggregated"&&bi(i)){if(I(n)){let u=n[0],l=n[n.length-1];if(ke(u)&&u<=0&&ke(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!of(i))return!0;if(!(V(t)&&t.bin)&&Ae([...ha,...qoe],e)){let{orient:u,type:l}=r;return Ae(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:Ae(["bar","area"],l)&&!a?!0:o?.zero}return!1}function Ode(e,t,n,r,i=!1){let o=Ide(t,n,r,i),{type:a}=e;return ho(t)?a!==void 0?Qse(t,a)?V(n)&&!Kse(a,n.type)?(X(Jae(a,o)),o):a:(X(Qae(t,a,o)),o):o:null}function Ide(e,t,n,r){switch(t.type){case"nominal":case"ordinal":{if(Kc(e)||_k(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&X(Ak(e,"ordinal")),"ordinal";if(Sk(e))return"band";if(wt(e)||Xp(e)){if(Ae(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&e in GC)return"band";let i=n[ir(e)];return Vu(i)||sf(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return Kc(e)?"time":_k(e)==="discrete"?(X(Ak(e,"temporal")),"ordinal"):V(t)&&t.timeUnit&&Vt(t.timeUnit).utc?"utc":Sk(e)?"band":"time";case"quantitative":return Kc(e)?V(t)&&Xe(t.bin)?"bin-ordinal":"linear":_k(e)==="discrete"?(X(Ak(e,"quantitative")),"ordinal"):Sk(e)?"band":"linear";case"geojson":return}throw new Error(CL(t.type))}function Pde(e,{ignoreRange:t}={}){dB(e),rB(e);for(let n of Xse)lB(e,n);t||cB(e)}function dB(e){ut(e)?e.component.scales=Lde(e):e.component.scales=Bde(e)}function Lde(e){let{encoding:t,mark:n,markDef:r}=e,i={};for(let o of HC){let a=It(t[o]);if(a&&n===JL&&o===rr&&a.type===xf)continue;let s=a&&a.scale;if(a&&s!==null&&s!==!1){s??={};let u=S8(t,o),l=Ode(s,o,a,r,u);i[o]=new Vy(e.scaleName(`${o}`,!0),{value:l,explicit:s.type===l})}}return i}var zde=nz((e,t)=>Z4(e)-Z4(t));function Bde(e){let t=e.component.scales={},n={},r=e.component.resolve;for(let i of e.children){dB(i);for(let o of H(i.component.scales))if(r.scale[o]??=Gz(o,e),r.scale[o]==="shared"){let a=n[o],s=i.component.scales[o].getWithExplicit("type");a?zse(a.value,s.value)?n[o]=xs(a,s,"type","scale",zde):(r.scale[o]="independent",delete n[o]):n[o]=s}}for(let i of H(n)){let o=e.scaleName(i,!0),a=n[i];t[i]=new Vy(o,a);for(let s of e.children){let u=s.component.scales[i];u&&(s.renameScale(u.get("name"),o),u.merged=!0)}}return t}var $p=class{nameMap;constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}};function ut(e){return e?.type==="unit"}function yr(e){return e?.type==="facet"}function XF(e){return e?.type==="concat"}function vf(e){return e?.type==="layer"}var Wp=class{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(t,n,r,i,o,a,s){this.type=n,this.parent=r,this.config=o,this.parent=r,this.config=o,this.view=sn(s),this.name=t.name??i,this.title=ds(t.title)?{text:t.title}:t.title?sn(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new $p,this.projectionNameMap=r?r.projectionNameMap:new $p,this.signalNameMap=r?r.signalNameMap:new $p,this.data=t.data,this.description=t.description,this.transforms=sce(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:ple(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:Cx(t)||r?.component.data.isFaceted&&t.data===void 0},layoutSize:new ra,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?xe(a):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Pde(this)}parseProjection(){eB(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Kz(this)}assembleEncodeFromView(t){let{style:n,...r}=t,i={};for(let o of H(r)){let a=r[o];a!==void 0&&(i[o]=et(a))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=et(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ve(n)?void 0:n}assembleLayout(){if(!this.layout)return;let{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=bfe(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){let{layoutHeaders:t}=this.component,n=[];for(let r of Lr)t[r].title&&n.push(hfe(this,r));for(let r of qF)n=n.concat(pfe(this,r));return n}assembleAxes(){return efe(this.component.axes,this.config)}assembleLegends(){return Jz(this)}assembleProjections(){return Ufe(this)}assembleTitle(){let{encoding:t,...n}=this.title??{},r={...xL(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return Ae(["unit","layer"],this.type)?Ae(["middle",void 0],r.anchor)&&(r.frame??="group"):r.anchor??="start",Ve(r)?void 0:r}assembleGroup(t=[]){let n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);let r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());let i=!this.parent||yr(this.parent)?iB(this):[];i.length>0&&(n.scales=i);let o=this.assembleAxes();o.length>0&&(n.axes=o);let a=this.assembleLegends();return a.length>0&&(n.legends=a),n}getName(t){return ot((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(lt[t].toLowerCase())}requestDataName(t){let n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(yr(this.parent)){let n=jz(t),r=gx(n),i=this.component.scales[r];if(i&&!i.merged){let o=i.get("type"),a=i.get("range");if(Xt(o)&&rl(a)){let s=i.get("name"),u=Bx(this,r),l=VF(u);if(l){let c=te({aggregate:"distinct",field:l},{expr:"datum"});return{signal:qz(s,i,c)}}else return X(XC(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){let n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(cL(t)&&ho(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");let n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){let n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(hae(n));return r}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}},Xy=class extends Wp{vgField(t,n={}){let r=this.fieldDef(t);if(r)return te(r,n)}reduceFieldDef(t,n){return jue(this.getMapping(),(r,i,o)=>{let a=wi(i);return a?t(r,a,o):r},n)}forEachFieldDef(t,n){_F(this.getMapping(),(r,i)=>{let o=wi(r);o&&t(o,i)},n)}},Ky=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];let i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Re(this.transform)}`}assemble(){let{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return r.resolve=this.transform.resolve,r}},Qy=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Re(this.transform)}`}assemble(){let{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}},Jy=class e extends Oe{transform;clone(){return new e(this.parent,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,a)=>i[a]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Re(this.transform)}`}assemble(){let{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}},Zy=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Re(this.transform)}`}assemble(){let{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}},ex=class e extends Oe{fields;geojson;signal;clone(){return new e(null,xe(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(let i of[[ki,Ai],[Br,Ci]]){let o=i.map(a=>{let s=It(n.encoding[a]);return V(s)?s.field:po(s)?{expr:`${s.datum}`}:vi(s)?{expr:`${s.value}`}:void 0});(o[0]||o[1])&&(t=new e(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(rr)){let i=n.typedFieldDef(rr);i.type===xf&&(t=new e(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){let t=(this.fields??[]).filter(Z);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Re(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}},tx=class e extends Oe{projection;fields;as;clone(){return new e(null,this.projection,xe(this.fields),xe(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(let r of[[ki,Ai],[Br,Ci]]){let i=r.map(a=>{let s=It(n.encoding[a]);return V(s)?s.field:po(s)?{expr:`${s.datum}`}:vi(s)?{expr:`${s.value}`}:void 0}),o=r[0]===Br?"2":"";(i[0]||i[1])&&(t=new e(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(Z))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Re(this.fields)} ${Re(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}},Gp=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){let{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new e(t,n)}static makeFromEncoding(t,n){let r=n.encoding,i=r.x,o=r.y;if(V(i)&&V(o)){let a=i.impute?i:o.impute?o:void 0;if(a===void 0)return;let s=i.impute?o:o.impute?i:void 0,{method:u,value:l,frame:c,keyvals:f}=a.impute,d=k8(n.mark,r);return new e(t,{impute:a.field,key:s.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Re(this.transform)}`}assemble(){let{impute:t,key:n,keyvals:r,method:i,groupby:o,value:a,frame:s=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...r?{keyvals:qle(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?a:null};if(i&&i!=="value"){let l={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:s,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}},nx=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Re(this.transform)}`}assemble(){let{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}},rx=class e extends Oe{transform;secondary;clone(){return new e(null,xe(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){let o=n.component.data.sources,{from:a}=r,s=null;if(jle(a)){let u=mB(a.data,o);u||(u=new sa(a.data),o.push(u));let l=n.getName(`lookup_${i}`);s=new En(u,l,lt.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=s}else if(Wle(a)){let u=a.param;r={as:u,...r};let l;try{l=n.getSelectionComponent(ot(u),u)}catch{throw new Error(yae(u))}if(s=l.materialized,!s)throw new Error(xae(u))}return new e(t,r,s.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?J(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Re({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:J(this.transform.as)}:{}};else{let n=this.transform.as;Z(n)||(X(Rae),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}},ix=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Re(this.transform)}`}assemble(){let{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}},ox=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=xe(n);let r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Re(this.transform)}`}assemble(){let{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}},ax=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=no((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Re(this.transform)}`}assemble(){let{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}},sx=class e extends Oe{transform;clone(){return new e(null,xe(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Re(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}};function hB(e){let t=0;function n(r,i){if(r instanceof sa&&!r.isGenerator&&!cf(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof qn&&(r.parent instanceof sa&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof ws){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof zp||r instanceof Bp||r instanceof jp||r instanceof df||r instanceof Lp||r instanceof tx||r instanceof aa||r instanceof rx||r instanceof mf||r instanceof Ju||r instanceof Zy||r instanceof Jy||r instanceof Ky||r instanceof nx||r instanceof ix||r instanceof ox||r instanceof Es||r instanceof sx||r instanceof ax||r instanceof Qy)&&i.transform.push(r.assemble()),(r instanceof vs||r instanceof bs||r instanceof Gp||r instanceof Zu||r instanceof ex)&&i.transform.push(...r.assemble()),r instanceof En&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof En?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof En&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(let a of r.children)n(a,{name:null,source:o,transform:[]});break}}}return n}function Ude(e){let t=[],n=hB(t);for(let r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function qde(e,t){let n=[],r=hB(n),i=0;for(let a of e.sources){a.hasName()||(a.dataName=`source_${i++}`);let s=a.assemble();r(a,s)}for(let a of n)a.transform.length===0&&delete a.transform;let o=0;for(let[a,s]of n.entries())(s.transform??[]).length===0&&!s.source&&n.splice(o++,0,n.splice(a,1)[0]);for(let a of n)for(let s of a.transform??[])s.type==="lookup"&&(s.from=e.outputNodes[s.from].getSource());for(let a of n)a.name in t&&(a.values=t[a.name]);return n}function jde(e){return e==="top"||e==="left"||le(e)?"header":"footer"}function Wde(e){for(let t of Lr)Gde(e,t);Y6(e,"x"),Y6(e,"y")}function Gde(e,t){let{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){let a=n[t],s=pf("title",null,r,t),u=Qc(a,r,{allowDisabling:!0,includeDefault:s===void 0||!!s});i.component.layoutHeaders[t].title&&(u=I(u)?u.join(", "):u,u+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);let l=pf("labelOrient",a.header,r,t),c=a.header!==null?vt(a.header?.labels,r.header.labels,!0):!1,f=Ae(["bottom","right"],l)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[f]:t==="facet"?[]:[pB(e,t,c)]}}}function pB(e,t,n){let r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function Y6(e,t){let{child:n}=e;if(n.component.axes[t]){let{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=GF(i,t),i.axis[t]==="shared"){let o=t==="x"?"column":"row",a=r[o];for(let s of n.component.axes[t]){let u=jde(s.get("orient"));a[u]??=[pB(e,o,!1)];let l=Fp(s,"main",e.config,{header:!0});l&&a[u][0].axes.push(l),s.mainExtracted=!0}}}}function Hde(e){KF(e),ux(e,"width"),ux(e,"height")}function Yde(e){KF(e);let t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";ux(e,t),ux(e,n)}function KF(e){for(let t of e.children)t.parseLayoutSize()}function ux(e,t){let n=jz(t),r=gx(n),i=e.component.resolve,o=e.component.layoutSize,a;for(let s of e.children){let u=s.component.layoutSize.getWithExplicit(n),l=i.scale[r]??Gz(r,e);if(l==="independent"&&u.value==="step"){a=void 0;break}if(a){if(l==="independent"&&a.value!==u.value){a=void 0;break}a=xs(a,u,n,"")}else a=u}if(a){for(let s of e.children)e.renameSignal(s.getName(n),e.getName(t)),s.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Vde(e){let{size:t,component:n}=e;for(let r of ha){let i=ir(r);if(t[i]!=null&&t[i]!=null){let o=t[i];n.layoutSize.set(i,so(o)?"step":o,!0)}else{let o=Xde(e,i);n.layoutSize.set(i,o,!1)}}}function Xde(e,t){let n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){let o=i.get("type"),a=i.get("range");if(Xt(o)){let s=jy(r.view,t);return rl(a)||so(s)?"step":s}else return Hk(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return Hk(r.view,t);{let o=jy(r.view,t);return so(o)?o.step:o}}}function CC(e,t,n){return te(t,{suffix:`by_${te(e)}`,...n})}var FC=class e extends Xy{facet;child;children;constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=ZF(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Zp(t))return{facet:this.initFacetFieldDef(t,"facet")};let n=H(t),r={};for(let i of n){if(![Jo,Zo].includes(i)){X(bx(i,"facet"));break}let o=t[i];if(o.field===void 0){X(Uk(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){let r=SF(t,n);return r.header?r.header=sn(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return Y(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Ux(this),this.child.parseData()}parseLayoutSize(){KF(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Ft(this.component.selection).some(t=>io(t))&&QC(KC)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Wde(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){let t={};for(let n of Lr)for(let r of jF){let i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:a}=i;if(a){let s=pf("titleOrient",a.header,this.config,n);if(["right","bottom"].includes(s)){let u=Lx(n,s);t.titleAnchor??={},t.titleAnchor[u]="end"}}if(o?.[0]){let s=n==="row"?"height":"width",u=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(s)&&(t[u]??={},t[u][n]=.5),i.title&&(t.offset??={},t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){let{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0,i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof e))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof e?{...this.channelHasField("column")?{encode:{update:{columns:{field:te(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){let t=[],n=[],r=[];if(this.child instanceof e){if(this.child.channelHasField("column")){let i=te(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(let i of ha){let o=this.child.component.scales[i];if(o&&!o.merged){let a=o.get("type"),s=o.get("range");if(Xt(a)&&rl(s)){let u=Bx(this.child,i),l=VF(u);l?(t.push(l),n.push("distinct"),r.push(`distinct_${l}`)):X(XC(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){let{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:a,as:s}=this.getCardinalityAggregateForChild(),u=[];for(let c of Lr){let f=this.facet[c];if(f){u.push(te(f));let{bin:d,sort:h}=f;if(Xe(d)&&u.push(te(f,{binSuffix:"end"})),ea(h)){let{field:p,op:m=kx}=h,g=CC(f,h);r&&i?(o.push(g),a.push("max"),s.push(g)):(o.push(p),a.push(m),s.push(g))}else if(I(h)){let p=hf(f,c);o.push(p),a.push("max"),s.push(p)}}}let l=!!r&&!!i;return{name:t,data:n,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:a,as:s}:{}}}:{}}}facetSortFields(t){let{facet:n}=this,r=n[t];return r?ea(r.sort)?[CC(r,r.sort,{expr:"datum"})]:I(r.sort)?[hf(r,t,{expr:"datum"})]:[te(r,{expr:"datum"})]:[]}facetSortOrder(t){let{facet:n}=this,r=n[t];if(r){let{sort:i}=r;return[(ea(i)?i.order:!I(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){let{facet:t,config:n}=this;if(t.facet)return uC(t.facet,"facet",n);let r={row:["top","bottom"],column:["left","right"]};for(let i of qF)if(t[i]){let o=pf("labelOrient",t[i]?.header,n,i);if(r[i].includes(o))return uC(t[i],i,n)}}assembleMarks(){let{child:t}=this,n=this.component.data.facetRoot,r=Ude(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),a=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:Lr.map(u=>this.facetSortFields(u)).flat(),order:Lr.map(u=>this.facetSortOrder(u)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup(Sce(this,[]))}]}getMapping(){return this.facet}};function Kde(e,t){let{row:n,column:r}=t;if(n&&r){let i=null;for(let o of[n,r])if(ea(o.sort)){let{field:a,op:s=kx}=o.sort;e=i=new Ju(e,{joinaggregate:[{op:s,field:a,as:CC(o,o.sort,{forAs:!0})}],groupby:[te(o)]})}return i}return null}function mB(e,t){for(let n of t){let r=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;let i=e.format?.mesh,o=r.format?.feature;if(i&&o)continue;let a=e.format?.feature;if((a||o)&&a!==o)continue;let s=r.format?.mesh;if(!((i||s)&&i!==s)){if(Pp(e)&&Pp(r)){if(mr(e.values,r.values))return n}else if(cf(e)&&cf(r)){if(e.url===r.url)return n}else if(rz(e)&&e.name===n.dataName)return n}}return null}function Qde(e,t){if(e.data||!e.parent){if(e.data===null){let r=new sa({values:[]});return t.push(r),r}let n=mB(e.data,t);if(n)return ps(e.data)||(n.data.format=Q6({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{let r=new sa(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Jde(e,t,n){let r=0;for(let i of t.transforms){let o,a;if(ece(i))a=e=new Lp(e,i),o="derived";else if(NF(i)){let s=ede(i);a=e=qn.makeWithAncestors(e,{},s,n)??e,e=new df(e,t,i.filter)}else if(J8(i))a=e=vs.makeFromTransform(e,i,t),o="number";else if(nce(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new qn(e,{[i.field]:o}),n.set(i.field,o,!1)),a=e=bs.makeFromTransform(e,i);else if(rce(i))a=e=aa.makeFromTransform(e,i),o="number",UF(t)&&(e=new Es(e));else if(Q8(i))a=e=rx.make(e,t,i,r++),o="derived";else if(Qle(i))a=e=new mf(e,i),o="number";else if(Jle(i))a=e=new Ju(e,i),o="number";else if(ice(i))a=e=Zu.makeFromTransform(e,i),o="derived";else if(oce(i))a=e=new Zy(e,i),o="derived";else if(ace(i))a=e=new Qy(e,i),o="derived";else if(Zle(i))a=e=new Jy(e,i),o="derived";else if(Gle(i))a=e=new ax(e,i),o="derived";else if(Kle(i))e=new sx(e,i);else if(tce(i))a=e=Gp.makeFromTransform(e,i),o="derived";else if(Hle(i))a=e=new Ky(e,i),o="derived";else if(Yle(i))a=e=new ix(e,i),o="derived";else if(Vle(i))a=e=new ox(e,i),o="derived";else if(Xle(i))a=e=new nx(e,i),o="derived";else{X(Fae(i));continue}if(a&&o!==void 0)for(let s of a.producedFields()??[])n.set(s,o,!1)}return e}function Ux(e){let t=Qde(e,e.component.data.sources),{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,a=!(i&&(ps(i)||cf(i)||Pp(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new eC;ps(i)?(iz(i)?t=new Bp(t,i.sequence):OF(i)&&(t=new zp(t,i.graticule)),a.parseNothing=!0):i?.format?.parse===null&&(a.parseNothing=!0),t=qn.makeExplicit(t,e,a)??t,t=new Es(t);let s=e.parent&&vf(e.parent);(ut(e)||yr(e))&&s&&(t=vs.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Jde(t,e,a));let u=nde(e),l=tde(e);t=qn.makeWithAncestors(t,{},{...u,...l},a)??t,ut(e)&&(t=ex.parseAll(t,e),t=tx.parseAll(t,e)),(ut(e)||yr(e))&&(s||(t=vs.makeFromEncoding(t,e)??t),t=bs.makeFromEncoding(t,e)??t,t=Lp.parseAllForSortIndex(t,e));let c=t=My(lt.Raw,e,t);if(ut(e)){let g=aa.makeFromEncoding(t,e);g&&(t=g,UF(e)&&(t=new Es(t))),t=Gp.makeFromEncoding(t,e)??t,t=Zu.makeFromEncoding(t,e)??t}let f,d;if(ut(e)){let{markDef:g,mark:y,config:b}=e,v=Ie("invalid",g,b),{marks:w,scales:E}=d=az({invalid:v,isPath:Ms(y)});w!==E&&E==="include-invalid-values"&&(f=t=My(lt.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=jp.make(t,e,d)??t)}let h=t=My(lt.Main,e,t),p;if(ut(e)&&d){let{marks:g,scales:y}=d;g==="include-invalid-values"&&y==="exclude-invalid-values"&&(t=jp.make(t,e,d)??t,p=t=My(lt.PostFilterInvalid,e,t))}ut(e)&&Jce(e,h);let m=null;if(yr(e)){let g=e.getName("facet");t=Kde(t,e.facet)??t,m=new ws(t,e,g,h.getSource()),n[g]=m}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:c,main:h,facetRoot:m,ancestorParse:a,preFilterInvalid:f,postFilterInvalid:p}}function My(e,t,n){let{outputNodes:r,outputNodeRefCounts:i}=t.component.data,o=t.getDataName(e),a=new En(n,o,e,i);return r[o]=a,a}var RC=class extends Wp{children;constructor(t,n,r,i){super(t,"concat",n,r,i,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&X(Aae),this.children=this.getChildren(t).map((o,a)=>ZF(o,this,this.getName(`concat_${a}`),void 0,i))}parseData(){this.component.data=Ux(this);for(let t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(let t of this.children){t.parseSelections();for(let n of H(t.component.selection))this.component.selection[n]=t.component.selection[n]}Ft(this.component.selection).some(t=>io(t))&&QC(KC)}parseMarkGroup(){for(let t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(let t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Tx(t)?t.vconcat:DF(t)?t.hconcat:t.concat}parseLayoutSize(){Yde(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){let t=WF(this);for(let n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{let n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){let t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}};function Zde(e){return e===!1||e===null}var ehe={disable:1,gridScale:1,scale:1,...v8,labelExpr:1,encode:1},gB=H(ehe),MC=class e extends ra{explicit;implicit;mainExtracted;constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new e(xe(this.explicit),xe(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Zde(this.get(t))}hasOrientSignalRef(){return le(this.explicit.orient)}};function the(e,t,n){let{encoding:r,config:i}=e,o=It(r[t])??It(r[fo(t)]),a=e.axis(t)||{},{format:s,formatType:u}=a;if(Xu(u))return{text:xi({fieldOrDatumDef:o,field:"datum.value",format:s,formatType:u,config:i}),...n};if(s===void 0&&u===void 0&&i.customFormatTypes){if(af(o)==="quantitative"){if(sf(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:xi({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:xi({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(af(o)==="temporal"&&i.timeFormatType&&V(o)&&!o.timeUnit)return{text:xi({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function nhe(e){return ha.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[lhe(n,e)]),t),{})}var rhe={bottom:"top",top:"bottom",left:"right",right:"left"};function ihe(e){let{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(let i of e.children){i.parseAxesAndHeaders();for(let o of H(i.component.axes))n.axis[o]=GF(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=ohe(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(let i of ha){for(let o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(let a of o.component.axes[i]){let{value:s,explicit:u}=a.getWithExplicit("orient");if(!le(s)){if(r[s]>0&&!u){let l=rhe[s];r[s]>r[l]&&a.set("orient",l,!1)}r[s]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(let[o,a]of(t[i]||[]).entries())o>0&&a.get("grid")&&!a.explicit.grid&&(a.implicit.grid=!1)}}function ohe(e,t){if(e){if(e.length!==t.length)return;let n=e.length;for(let r=0;r<n;r++){let i=e[r],o=t[r];if(!!i!=!!o)return;if(i&&o){let a=i.getWithExplicit("orient"),s=o.getWithExplicit("orient");if(a.explicit&&s.explicit&&a.value!==s.value)return;e[r]=ahe(i,o)}}}else return t.map(n=>n.clone());return e}function ahe(e,t){for(let n of gB){let r=xs(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return AL(i,o);case"gridScale":return{explicit:i.explicit,value:vt(i.value,o.value)}}return Nx(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function she(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(le(n.labelAngle)?n.labelAngle:Dp(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Lz(r,i))return!0}return e===n[t]}var uhe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function lhe(e,t){let n=t.axis(e),r=new MC,i=It(t.encoding[e]),{mark:o,config:a}=t,s=n?.orient||a[e==="x"?"axisX":"axisY"]?.orient||a.axis?.orient||ufe(e),u=t.getScaleComponent(e).get("type"),l=tfe(e,u,s,t.config),c=n!==void 0?!n:aC("disable",a.style,n?.style,l).configValue;if(r.set("disable",c,n!==void 0),c)return r;n=n||{};let f=ofe(i,n,e,a.style,l),d=a8(n.formatType,i,u),h=o8(i,i.type,n.format,n.formatType,a,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:u,orient:s,labelAngle:f,format:h,formatType:d,mark:o,config:a};for(let y of gB){let b=y in D6?D6[y](p):a6(y)?n[y]:void 0,v=b!==void 0,w=she(b,y,n,t,e);if(v&&w)r.set(y,b,w);else{let{configValue:E=void 0,configFrom:_=void 0}=a6(y)&&y!=="values"?aC(y,a.style,n.style,l):{},S=E!==void 0;v&&!S?r.set(y,b,w):(_!=="vgAxisConfig"||uhe.has(y)&&S||rm(E)||le(E))&&r.set(y,E,!1)}}let m=n.encoding??{},g=b8.reduce((y,b)=>{if(!r.hasAxisPart(b))return y;let v=Wz(m[b]??{},t),w=b==="labels"?the(t,e,v):v;return w!==void 0&&!Ve(w)&&(y[b]={update:w}),y},{});return Ve(g)||r.set("encode",g,!!n.encoding||n.labelAngle!==void 0),r}function che({encoding:e,size:t}){for(let n of ha){let r=ir(n);so(t[r])&&hs(e[n])&&(delete t[r],X(ML(r)))}return t}var fhe={vgMark:"arc",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Un("x",e,{defaultPos:"mid"}),...Un("y",e,{defaultPos:"mid"}),...ia(e,"radius"),...ia(e,"theta")})},dhe={vgMark:"area",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Wy("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Wy("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...BF(e)})},hhe={vgMark:"rect",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ia(e,"x"),...ia(e,"y")})},phe={vgMark:"shape",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{let{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&V(n)&&n.type===xf?{field:te(n,{expr:"datum"})}:{}}]}},mhe={vgMark:"image",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...ia(e,"x"),...ia(e,"y"),...PF(e,"url")})},ghe={vgMark:"line",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Un("x",e,{defaultPos:"mid"}),...Un("y",e,{defaultPos:"mid"}),...ln("size",e,{vgChannel:"strokeWidth"}),...BF(e)})},yhe={vgMark:"trail",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Un("x",e,{defaultPos:"mid"}),...Un("y",e,{defaultPos:"mid"}),...ln("size",e),...BF(e)})};function QF(e,t){let{config:n}=e;return{...qr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Un("x",e,{defaultPos:"mid"}),...Un("y",e,{defaultPos:"mid"}),...ln("size",e),...ln("angle",e),...xhe(e,n,t)}}function xhe(e,t,n){return n?{shape:{value:n}}:ln("shape",e)}var bhe={vgMark:"symbol",encodeEntry:e=>QF(e)},vhe={vgMark:"symbol",encodeEntry:e=>QF(e,"circle")},whe={vgMark:"symbol",encodeEntry:e=>QF(e,"square")},Ehe={vgMark:"rect",encodeEntry:e=>({...qr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ia(e,"x"),...ia(e,"y")})},She={vgMark:"rule",encodeEntry:e=>{let{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...qr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Wy("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Wy("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ln("size",e,{vgChannel:"strokeWidth"})}}},_he={vgMark:"text",encodeEntry:e=>{let{config:t,encoding:n}=e;return{...qr(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Un("x",e,{defaultPos:"mid"}),...Un("y",e,{defaultPos:"mid"}),...PF(e),...ln("size",e,{vgChannel:"fontSize"}),...ln("angle",e),...R6("align",Ahe(e.markDef,n,t)),...R6("baseline",khe(e.markDef,n,t)),...Un("radius",e,{defaultPos:null}),...Un("theta",e,{defaultPos:null})}}};function Ahe(e,t,n){if(Ie("align",e,n)===void 0)return"center"}function khe(e,t,n){if(Ie("baseline",e,n)===void 0)return"middle"}var Che={vgMark:"rect",encodeEntry:e=>{let{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",a=r==="horizontal"?"height":"width";return{...qr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ia(e,i),...Un(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[a]:et(Ie("thickness",n,t))}}},$y={arc:fhe,area:dhe,bar:hhe,circle:vhe,geoshape:phe,image:mhe,line:ghe,point:bhe,rect:Ehe,rule:She,square:whe,text:_he,tick:Che,trail:yhe};function Fhe(e){if(Ae([_x,Ex,tue],e.mark)){let t=k8(e.mark,e.encoding);if(t.length>0)return Rhe(e,t)}else if(e.mark===Sx){let t=zk.some(n=>Ie(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Mhe(e)}return JF(e)}var V6="faceted_path_";function Rhe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:V6+e.requestDataName(lt.Main),data:e.requestDataName(lt.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:JF(e,{fromPrefix:V6})}]}var X6="stack_group_";function Mhe(e){let[t]=JF(e,{fromPrefix:X6}),n=e.scaleName(e.stack.fieldChannel),r=(l={})=>e.vgField(e.stack.fieldChannel,l),i=(l,c)=>{let f=[r({prefix:"min",suffix:"start",expr:c}),r({prefix:"max",suffix:"start",expr:c}),r({prefix:"min",suffix:"end",expr:c}),r({prefix:"max",suffix:"end",expr:c})];return`${l}(${f.map(d=>`scale('${n}',${d})`).join(",")})`},o,a;e.stack.fieldChannel==="x"?(o={...Zc(t.encode.update,["y","yc","y2","height",...zk]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...gr(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...Zc(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...gr(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(let l of zk){let c=oo(l,e.markDef,e.config);t.encode.update[l]?(o[l]=t.encode.update[l],delete t.encode.update[l]):c&&(o[l]=et(c)),c&&(t.encode.update[l]={value:0})}let s=[];if(e.stack.groupbyChannels?.length>0)for(let l of e.stack.groupbyChannels){let c=e.fieldDef(l),f=te(c);f&&s.push(f),(c?.bin||c?.timeUnit)&&s.push(te(c,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,c)=>{if(t.encode.update[c])return{...l,[c]:t.encode.update[c]};{let f=oo(c,e.markDef,e.config);return f!==void 0?{...l,[c]:et(f)}:l}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(lt.Main),name:X6+e.requestDataName(lt.Main),groupby:s,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}function $he(e){let{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!I(a)&&vi(a)&&Pk(a.value)||!a&&Pk(Ie("order",i,o)))){if((I(a)||V(a))&&!n)return EL(a,{expr:"datum"});if(Ms(r)){let s=i.orient==="horizontal"?"y":"x",u=t[s];if(V(u))return{field:s}}}}function JF(e,t={fromPrefix:""}){let{mark:n,markDef:r,encoding:i,config:o}=e,a=vt(r.clip,The(e),Dhe(e)),s=vL(r),u=i.key,l=$he(e),c=Nhe(e);c&&Object.values(e.component.selection).some(h=>h.type==="point"&&!h.bind&&h.on!=="pointerover")&&(e.markDef.cursor??="pointer");let f=Ie("aria",r,o),d=$y[n].postEncodingTransform?$y[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:$y[n].vgMark,...a?{clip:a}:{},...s?{style:s}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(lt.Main)},encode:{update:$y[n].encodeEntry(e)},...d?{transform:d}:{}}]}function The(e){let t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function Dhe(e){let t=e.component.projection;return t&&!t.isFit?!0:void 0}function Nhe(e){if(!e.component.selection)return null;let t=H(e.component.selection).length,n=t,r=e.parent;for(;r&&n===0;)n=H(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}var lx=class extends Xy{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,u6(t)?t.view:void 0);let a=ao(t.mark)?{...t.mark}:{type:t.mark},s=a.type;a.filled===void 0&&(a.filled=Ple(a,o,{graticule:t.data&&OF(t.data)}));let u=this.encoding=Uue(t.encoding||{},s,a.filled,o);this.markDef=Y8(a,u,o),this.size=che({encoding:u,size:u6(t)?{...i,...t.width!==void 0?{width:t.width}:{},...t.height!==void 0?{height:t.height}:{}}:i}),this.stack=H8(this.markDef,u),this.specifiedScales=this.initScales(s,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>$F(l)),this.alignStackOrderWithColorDomain()}get hasProjection(){let{encoding:t}=this,n=this.mark===JL,r=t&&Doe.some(i=>be(t[i]));return n||r}scaleDomain(t){let n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return HC.reduce((r,i)=>{let o=It(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){let{domain:n,range:r}=t,i=sn(t);return I(n)&&(i.domain=n.map(pr)),I(r)&&(i.range=r.map(pr)),i}initAxes(t){return ha.reduce((n,r)=>{let i=t[r];if(be(i)||r===at&&be(t.x2)||r===Kt&&be(t.y2)){let o=be(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){let n=H(t),r={};for(let i of n){let o=t[i];r[i]=rm(o)?bL(o):pr(o)}return r}initLegends(t){return Woe.reduce((n,r)=>{let i=It(t[r]);if(i&&Hoe(r)){let o=i.legend;n[r]=o&&sn(o)}return n},{})}alignStackOrderWithColorDomain(){let{color:t,fill:n,order:r,xOffset:i,yOffset:o}=this.encoding,a=n||t,s=V(a)?a:void 0,u=s?.field,l=s?.scale,c=s?.type,f=l?.domain,d=i||o,h=V(d)?d:void 0,p=`_${u}_sort_index`;if(!r&&Array.isArray(f)&&typeof u=="string"&&c==="nominal")if(h&&!h.sort)h.sort=f;else{if(!this.stack)return;let m=`indexof(${G(f)}, datum['${u}'])`,g=this.markDef?.orient==="horizontal"?"ascending":"descending";this.transforms.push({calculate:m,as:p}),this.encoding.order={field:p,type:"quantitative",sort:g}}}parseData(){this.component.data=Ux(this)}parseLayoutSize(){Vde(this)}parseSelections(){this.component.selection=Qce(this,this.selection)}parseMarkGroup(){this.component.mark=Fhe(this)}parseAxesAndHeaders(){this.component.axes=nhe(this)}assembleSelectionTopLevelSignals(t){return _ce(this,t)}assembleSignals(){return[...Oz(this),...Ece(this,[])]}assembleSelectionData(t){return Ace(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return WF(this)}correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data),"time"in this.encoding&&(t.from.data=t.from.data+uz)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t);assembleMarks(){let t=this.component.mark??[];return(!this.parent||!vf(this.parent))&&(t=dz(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){let{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Uu(this.encoding,t)}fieldDef(t){let n=this.encoding[t];return wi(n)}typedFieldDef(t){let n=this.fieldDef(t);return jn(n)?n:null}},$C=class e extends Wp{children;constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);let a={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((s,u)=>{if(Dx(s))return new e(s,this,this.getName(`layer_${u}`),a,o);if(pa(s))return new lx(s,this,this.getName(`layer_${u}`),a,o);throw new Error(VC(s))})}parseData(){this.component.data=Ux(this);for(let t of this.children)t.parseData()}parseLayoutSize(){Hde(this)}parseSelections(){this.component.selection={};for(let t of this.children){t.parseSelections();for(let n of H(t.component.selection))this.component.selection[n]=t.component.selection[n]}Ft(this.component.selection).some(t=>io(t))&&QC(KC)}parseMarkGroup(){for(let t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){ihe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),Oz(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),WF(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){let t=new Set;for(let r of this.children)for(let i of J(r.assembleGroupStyle()))t.add(i);let n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(let n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return kce(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),Jz(this))}};function ZF(e,t,n,r,i){if(Cx(e))return new FC(e,t,n,i);if(Dx(e))return new $C(e,t,n,r,i);if(pa(e))return new lx(e,t,n,r,i);if(fle(e))return new RC(e,t,n,i);throw new Error(VC(e))}function Ohe(e,t={}){t.logger&&mse(t.logger),t.fieldTitle&&g8(t.fieldTitle);try{let n=G8(bo(t.config,e.config)),r=tz(e,n),i=ZF(r,null,"",void 0,n);return i.parse(),ade(i.component.data,i),{spec:Phe(i,Ihe(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&gse(),t.fieldTitle&&Tue()}}function Ihe(e,t,n,r){let i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):Z(t)&&(t={type:t}),i&&o&&pce(t.type)){if(i==="step"&&o==="step")X(H4()),t.type="pad";else if(i==="step"||o==="step"){let a=i==="step"?"width":"height";X(H4(gx(a)));let s=a==="width"?"height":"width";t.type=mce(s)}}return{...H(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...v6(n,!1),...v6(e,!0)}}function Phe(e,t,n={},r){let i=e.config?Ale(e.config):void 0,o=qde(e.component.data,n),a=e.assembleSelectionData(o),s=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0),f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);let{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:a,...s.length>0?{projections:s}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...U8(d)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}var Lhe=Coe.version;x();function tR(e){let[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var uR={};Sn(uR,{carbong10:()=>bpe,carbong100:()=>wpe,carbong90:()=>vpe,carbonwhite:()=>xpe,dark:()=>Uhe,excel:()=>qhe,fivethirtyeight:()=>Ghe,ggplot2:()=>Hhe,googlecharts:()=>ipe,latimes:()=>Khe,powerbi:()=>ppe,quartz:()=>Qhe,urbaninstitute:()=>rpe,version:()=>Epe,vox:()=>Jhe});x();var zhe="3.0.0",Bhe={version:zhe},wf="#fff",yB="#888",Uhe={background:"#333",view:{stroke:yB},title:{color:wf,subtitleColor:wf},style:{"guide-label":{fill:wf},"guide-title":{fill:wf}},axis:{domainColor:wf,gridColor:yB,tickColor:wf}},sl="#4572a7",qhe={background:"#fff",arc:{fill:sl},area:{fill:sl},line:{stroke:sl,strokeWidth:2},path:{stroke:sl},rect:{fill:sl},shape:{stroke:sl},symbol:{fill:sl,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},ul="#30a2da",nR="#cbcbcb",jhe="#999",Whe="#333",xB="#f0f0f0",bB="#333",Ghe={arc:{fill:ul},area:{fill:ul},axis:{domainColor:nR,grid:!0,gridColor:nR,gridWidth:1,labelColor:jhe,labelFontSize:10,titleColor:Whe,tickColor:nR,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:xB,group:{fill:xB},legend:{labelColor:bB,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:bB,titleFontSize:14,titlePadding:10},line:{stroke:ul,strokeWidth:2},path:{stroke:ul,strokeWidth:.5},rect:{fill:ul},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:ul},bar:{binSpacing:2,fill:ul,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ll="#000",Hhe={group:{fill:"#e5e5e5"},arc:{fill:ll},area:{fill:ll},line:{stroke:ll},path:{stroke:ll},rect:{fill:ll},shape:{stroke:ll},symbol:{fill:ll,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Yhe=22,Vhe="normal",vB="Benton Gothic, sans-serif",wB=11.5,Xhe="normal",cl="#82c6df",rR="Benton Gothic Bold, sans-serif",EB="normal",SB=13,om={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},Khe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:rR,fontSize:Yhe,fontWeight:Vhe},arc:{fill:cl},area:{fill:cl},line:{stroke:cl,strokeWidth:2},path:{stroke:cl},rect:{fill:cl},shape:{stroke:cl},symbol:{fill:cl,size:30},axis:{labelFont:vB,labelFontSize:wB,labelFontWeight:Xhe,titleFont:rR,titleFontSize:SB,titleFontWeight:EB},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:vB,labelFontSize:wB,symbolType:"square",titleFont:rR,titleFontSize:SB,titleFontWeight:EB},range:{category:om["category-6"],diverging:om["fireandice-6"],heatmap:om["fire-7"],ordinal:om["fire-7"],ramp:om["fire-7"]}},fl="#ab5787",qx="#979797",Qhe={background:"#f9f9f9",arc:{fill:fl},area:{fill:fl},line:{stroke:fl},path:{stroke:fl},rect:{fill:fl},shape:{stroke:fl},symbol:{fill:fl,size:30},axis:{domainColor:qx,domainWidth:.5,gridWidth:.2,labelColor:qx,tickColor:qx,tickWidth:.2,titleColor:qx},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},dl="#3e5c69",Jhe={background:"#fff",arc:{fill:dl},area:{fill:dl},line:{stroke:dl},path:{stroke:dl},rect:{fill:dl},shape:{stroke:dl},symbol:{fill:dl},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},jr="#1696d2",_B="#000000",Zhe="#FFFFFF",jx="Lato",iR="Lato",epe="Lato",tpe="#DEDDDD",npe=18,am={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},rpe={background:Zhe,title:{anchor:"start",fontSize:npe,font:jx},axisX:{domain:!0,domainColor:_B,domainWidth:1,grid:!1,labelFontSize:12,labelFont:iR,labelAngle:0,tickColor:_B,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:jx},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:tpe,gridWidth:1,labelFontSize:12,labelFont:iR,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:jx,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:iR,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:jx,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:am["six-groups-cat-1"],diverging:am["diverging-colors"],heatmap:am["diverging-colors"],ordinal:am["six-groups-seq"],ramp:am["shades-blue"]},area:{fill:jr},rect:{fill:jr},line:{color:jr,stroke:jr,strokeWidth:5},trail:{color:jr,stroke:jr,strokeWidth:0,size:1},path:{stroke:jr,strokeWidth:.5},point:{filled:!0},text:{font:epe,color:jr,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:jr,stroke:null}},arc:{fill:jr},shape:{stroke:jr},symbol:{fill:jr,size:30}},hl="#3366CC",AB="#ccc",Wx="Arial, sans-serif",ipe={arc:{fill:hl},area:{fill:hl},path:{stroke:hl},rect:{fill:hl},shape:{stroke:hl},symbol:{stroke:hl},circle:{fill:hl},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Wx,fontSize:12},"guide-title":{font:Wx,fontSize:12},"group-title":{font:Wx,fontSize:12}},title:{font:Wx,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:AB,tickColor:AB,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},sR=e=>e*(1/3+1),kB=sR(9),CB=sR(10),FB=sR(12),sm="Segoe UI",RB="wf_standard-font, helvetica, arial, sans-serif",MB="#252423",um="#605E5C",$B="transparent",ope="#C8C6C4",Fi="#118DFF",ape="#12239E",spe="#E66C37",upe="#6B007B",lpe="#E044A7",cpe="#744EC2",fpe="#D9B300",dpe="#D64550",DB=Fi,NB="#DEEFFF",TB=[NB,DB],hpe=[NB,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",DB],ppe={view:{stroke:$B},background:$B,font:sm,header:{titleFont:RB,titleFontSize:FB,titleColor:MB,labelFont:sm,labelFontSize:CB,labelColor:um},axis:{ticks:!1,grid:!1,domain:!1,labelColor:um,labelFontSize:kB,titleFont:RB,titleColor:MB,titleFontSize:FB,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:ope,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Fi},line:{stroke:Fi,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:sm,fontSize:kB,fill:um},arc:{fill:Fi},area:{fill:Fi,line:!0,opacity:.6},path:{stroke:Fi},rect:{fill:Fi},point:{fill:Fi,filled:!0,size:75},shape:{stroke:Fi},symbol:{fill:Fi,strokeWidth:1.5,size:50},legend:{titleFont:sm,titleFontWeight:"bold",titleColor:um,labelFont:sm,labelFontSize:CB,labelColor:um,symbolType:"circle",symbolSize:75},range:{category:[Fi,ape,spe,upe,lpe,cpe,fpe,dpe],diverging:TB,heatmap:TB,ordinal:hpe}},oR='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',mpe='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',aR=400,Gx={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},gpe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],ype=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Hx({theme:e,background:t}){let n=["white","g10"].includes(e)?"light":"dark",r=Gx.gridBg[e],i=Gx.textPrimary[e],o=Gx.textSecondary[e],a=n==="dark"?gpe:ype,s=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:oR,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:mpe,labelFontWeight:aR,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Gx.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:oR,fill:o,fontWeight:aR},"guide-title":{font:oR,fill:o,fontWeight:aR}},range:{category:a,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}var xpe=Hx({theme:"white",background:"#ffffff"}),bpe=Hx({theme:"g10",background:"#f4f4f4"}),vpe=Hx({theme:"g90",background:"#262626"}),wpe=Hx({theme:"g100",background:"#161616"}),Epe=Bhe.version;x();var Spe="1.0.0",_pe={version:Spe};function Ape(e,t,n,r){if(I(e))return`[${e.map(i=>t(Z(i)?i:OB(i,n))).join(", ")}]`;if(Q(e)){let i="",{title:o,image:a,...s}=e;o&&(i+=`<h2>${t(o)}</h2>`),a&&(i+=`<img src="${new URL(t(a),r||location.href).href}">`);let u=Object.keys(s);if(u.length>0){i+="<table>";for(let l of u){let c=s[l];c!==void 0&&(Q(c)&&(c=OB(c,n)),i+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}i+="</table>"}return i||"{}"}return t(e)}function kpe(e){let t=[];return function(n,r){if(typeof r!="object"||r===null)return r;let i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function OB(e,t){return JSON.stringify(e,kpe(t))}var Cpe=`#vg-tooltip-element {
|
|
16
|
+
visibility: hidden;
|
|
17
|
+
padding: 8px;
|
|
18
|
+
position: fixed;
|
|
19
|
+
z-index: 1000;
|
|
20
|
+
font-family: sans-serif;
|
|
21
|
+
font-size: 11px;
|
|
22
|
+
border-radius: 3px;
|
|
23
|
+
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
|
24
|
+
/* The default theme is the light theme. */
|
|
25
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
26
|
+
border: 1px solid #d9d9d9;
|
|
27
|
+
color: black;
|
|
28
|
+
}
|
|
29
|
+
#vg-tooltip-element.visible {
|
|
30
|
+
visibility: visible;
|
|
31
|
+
}
|
|
32
|
+
#vg-tooltip-element h2 {
|
|
33
|
+
margin-top: 0;
|
|
34
|
+
margin-bottom: 10px;
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
}
|
|
37
|
+
#vg-tooltip-element table {
|
|
38
|
+
border-spacing: 0;
|
|
39
|
+
}
|
|
40
|
+
#vg-tooltip-element table tr {
|
|
41
|
+
border: none;
|
|
42
|
+
}
|
|
43
|
+
#vg-tooltip-element table tr td {
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
padding-top: 2px;
|
|
47
|
+
padding-bottom: 2px;
|
|
48
|
+
}
|
|
49
|
+
#vg-tooltip-element table tr td.key {
|
|
50
|
+
color: #808080;
|
|
51
|
+
max-width: 150px;
|
|
52
|
+
text-align: right;
|
|
53
|
+
padding-right: 4px;
|
|
54
|
+
}
|
|
55
|
+
#vg-tooltip-element table tr td.value {
|
|
56
|
+
display: block;
|
|
57
|
+
max-width: 300px;
|
|
58
|
+
max-height: 7em;
|
|
59
|
+
text-align: left;
|
|
60
|
+
}
|
|
61
|
+
#vg-tooltip-element.dark-theme {
|
|
62
|
+
background-color: rgba(32, 32, 32, 0.9);
|
|
63
|
+
border: 1px solid #f5f5f5;
|
|
64
|
+
color: white;
|
|
65
|
+
}
|
|
66
|
+
#vg-tooltip-element.dark-theme td.key {
|
|
67
|
+
color: #bfbfbf;
|
|
68
|
+
}
|
|
69
|
+
`,IB="vg-tooltip-element",Fpe={offsetX:10,offsetY:10,id:IB,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Rpe,maxDepth:2,formatTooltip:Ape,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Rpe(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function Mpe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Cpe.toString().replaceAll(IB,e)}function PB(e,t,{offsetX:n,offsetY:r}){let i=LB({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,r),o=["bottom-right","bottom-left","top-right","top-left"];for(let a of o)if(zB(i[a],t))return i[a];return i["top-left"]}function $pe(e,t,n,r,i){let{position:o,offsetX:a,offsetY:s}=i,u=e._el.getBoundingClientRect(),l=e._origin,c=Tpe(u,l,n),f=LB(c,r,a,s),d=Array.isArray(o)?o:[o];for(let h of d)if(zB(f[h],r)&&!Dpe(t,f[h],r))return f[h];return PB(t,r,i)}function Tpe(e,t,n){let r=n.isVoronoi?n.datum.bounds:n.bounds,i=e.left+t[0]+r.x1,o=e.top+t[1]+r.y1,a=n;for(;a.mark.group;)a=a.mark.group,i+=a.x??0,o+=a.y??0;let s=r.x2-r.x1,u=r.y2-r.y1;return{x1:i,x2:i+s,y1:o,y2:o+u}}function LB(e,t,n,r){let i=(e.x1+e.x2)/2,o=(e.y1+e.y2)/2,a=e.x1-t.width-n,s=i-t.width/2,u=e.x2+n,l=e.y1-t.height-r,c=o-t.height/2,f=e.y2+r;return{top:{x:s,y:l},bottom:{x:s,y:f},left:{x:a,y:c},right:{x:u,y:c},"top-left":{x:a,y:l},"top-right":{x:u,y:l},"bottom-left":{x:a,y:f},"bottom-right":{x:u,y:f}}}function zB(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Dpe(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}var Yx=class{call;options;el;constructor(t){this.options={...Fpe,...t};let n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){let r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=Mpe(n);let i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(t,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);let{x:o,y:a}=this.options.anchor==="mark"?$pe(t,n,r,this.el.getBoundingClientRect(),this.options):PB(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${a}px`,this.el.style.left=`${o}px`}},R4e=_pe.version;var Npe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ope=Object.prototype.hasOwnProperty;function kR(e,t){return Ope.call(e,t)}function CR(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)kR(e,i)&&r.push(i);return r}function xr(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function FR(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function pl(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l9(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function RR(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(RR(e[t]))return!0}else if(typeof e=="object"){for(var r=CR(e),i=r.length,o=0;o<i;o++)if(RR(e[r[o]]))return!0}}return!1}function BB(e,t){var n=[e];for(var r in t){var i=typeof t[r]=="object"?JSON.stringify(t[r],null,2):t[r];typeof i<"u"&&n.push(r+": "+i)}return n.join(`
|
|
70
|
+
`)}var c9=(function(e){Npe(t,e);function t(n,r,i,o,a){var s=this.constructor,u=e.call(this,BB(n,{name:r,index:i,operation:o,tree:a}))||this;return u.name=r,u.index=i,u.operation=o,u.tree=a,Object.setPrototypeOf(u,s.prototype),u.message=BB(n,{name:r,index:i,operation:o,tree:a}),u}return t})(Error),gt=c9,Ipe=xr,Ef={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=Xx(n,this.path);r&&(r=xr(r));var i=ml(n,{op:"remove",path:this.from}).removed;return ml(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=Xx(n,this.from);return ml(n,{op:"add",path:this.path,value:xr(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:cm(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Ppe={add:function(e,t,n){return FR(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var r=e.splice(t,1);return{newDocument:n,removed:r[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:Ef.move,copy:Ef.copy,test:Ef.test,_get:Ef._get};function Xx(e,t){if(t=="")return e;var n={op:"_get",path:t};return ml(e,n),n.value}function ml(e,t,n,r,i,o){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):Kx(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Xx(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=cm(e,t.value),a.test===!1)throw new gt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(n)throw new gt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}}else{r||(e=xr(e));var s=t.path||"",u=s.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=Kx;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=l9(h)),i&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!FR(h))throw new gt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);FR(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new gt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var a=Ppe[t.op].call(t,l,h,e);if(a.test===!1)throw new gt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(c>=f){var a=Ef[t.op].call(t,l,h,e);if(a.test===!1)throw new gt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new gt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function Jx(e,t,n,r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),n&&!Array.isArray(t))throw new gt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=xr(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=ml(e,t[a],n,!0,i,a),e=o[a].newDocument;return o.newDocument=e,o}function Lpe(e,t,n){var r=ml(e,t);if(r.test===!1)throw new gt("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument}function Kx(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))throw new gt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Ef[e.op]){if(typeof e.path!="string")throw new gt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new gt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new gt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new gt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&RR(e.value))throw new gt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new gt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new gt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},s=f9([a],n);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new gt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new gt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function f9(e,t,n){try{if(!Array.isArray(e))throw new gt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Jx(xr(t),xr(e),n||!0);else{n=n||Kx;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(i){if(i instanceof gt)return i;throw i}}function cm(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),r=Array.isArray(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!cm(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=Object.keys(e);if(o=s.length,o!==Object.keys(t).length)return!1;for(i=o;i--!==0;)if(!t.hasOwnProperty(s[i]))return!1;for(i=o;i--!==0;)if(a=s[i],!cm(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var zpe=Object.freeze({__proto__:null,JsonPatchError:gt,_areEquals:cm,applyOperation:ml,applyPatch:Jx,applyReducer:Lpe,deepClone:Ipe,getValueByPointer:Xx,validate:f9,validator:Kx});var $R=new WeakMap,Bpe=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),Upe=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function qpe(e){return $R.get(e)}function jpe(e,t){return e.observers.get(t)}function Wpe(e,t){e.observers.delete(t.callback)}function Gpe(e,t){t.unobserve()}function Hpe(e,t){var n=[],r,i=qpe(e);if(!i)i=new Bpe(e),$R.set(e,i);else{var o=jpe(i,t);r=o&&o.observer}if(r)return r;if(r={},i.value=xr(e),t){r.callback=t,r.next=null;var a=function(){MR(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return r.patches=n,r.object=e,r.unobserve=function(){MR(r),clearTimeout(r.next),Wpe(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},i.observers.set(t,new Upe(t,r)),r}function MR(e,t){t===void 0&&(t=!1);var n=$R.get(e.object);TR(n.value,e.object,e.patches,"",t),e.patches.length&&Jx(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function TR(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=CR(t),a=CR(e),s=!1,u=a.length-1;u>=0;u--){var l=a[u],c=e[l];if(kR(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?TR(c,f,n,r+"/"+pl(l),i):c!==f&&(i&&n.push({op:"test",path:r+"/"+pl(l),value:xr(c)}),n.push({op:"replace",path:r+"/"+pl(l),value:xr(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+pl(l),value:xr(c)}),n.push({op:"remove",path:r+"/"+pl(l)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!s&&o.length==a.length))for(var u=0;u<o.length;u++){var l=o[u];!kR(e,l)&&t[l]!==void 0&&n.push({op:"add",path:r+"/"+pl(l),value:xr(t[l])})}}}function Ype(e,t,n){n===void 0&&(n=!1);var r=[];return TR(e,t,r,"",n),r}var Vpe=Object.freeze({__proto__:null,compare:Ype,generate:MR,observe:Hpe,unobserve:Gpe});Object.assign({},zpe,Vpe,{JsonPatchError:c9,deepClone:xr,escapePathComponent:pl,unescapePathComponent:l9});function Xpe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lR,UB;function Kpe(){if(UB)return lR;UB=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){let r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return lR=e,lR}var cR,qB;function DR(){if(qB)return cR;qB=1;let e=Object.freeze({loose:!0}),t=Object.freeze({});return cR=r=>r?typeof r!="object"?e:r:t,cR}var Vx={exports:{}},fR,jB;function NR(){if(jB)return fR;jB=1;let e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=t-6;return fR={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},fR}var dR,WB;function Zx(){return WB||(WB=1,dR=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),dR}var GB;function OR(){return GB||(GB=1,(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=NR(),o=Zx();t=e.exports={};let a=t.re=[],s=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],c=t.t={},f=0,d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[d,r]],p=g=>{for(let[y,b]of h)g=g.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return g},m=(g,y,b)=>{let v=p(y),w=f++;o(g,w,y),c[g]=w,u[w]=y,l[w]=v,a[w]=new RegExp(y,b?"g":void 0),s[w]=new RegExp(v,b?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),m("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${d}+`),m("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),m("FULL",`^${u[c.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),m("LOOSE",`^${u[c.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),m("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[c.COERCE],!0),m("COERCERTLFULL",u[c.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Vx,Vx.exports)),Vx.exports}var hR,HB;function Qpe(){if(HB)return hR;HB=1;let e=/^[0-9]+$/,t=(r,i)=>{let o=e.test(r),a=e.test(i);return o&&a&&(r=+r,i=+i),r===i?0:o&&!a?-1:a&&!o?1:r<i?-1:1};return hR={compareIdentifiers:t,rcompareIdentifiers:(r,i)=>t(i,r)},hR}var pR,YB;function IR(){if(YB)return pR;YB=1;let e=Zx(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=NR(),{safeRe:r,t:i}=OR(),o=DR(),{compareIdentifiers:a}=Qpe();class s{constructor(l,c){if(c=o(c),l instanceof s){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let f=l.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){let h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof s)){if(typeof l=="string"&&l===this.version)return 0;l=new s(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof s||(l=new s(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof s||(l=new s(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{let f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return a(f,d)}while(++c)}compareBuild(l){l instanceof s||(l=new s(l,this.options));let c=0;do{let f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return a(f,d)}while(++c)}inc(l,c,f){if(l.startsWith("pre")){if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(c){let d=`-${c}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!d||d[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),a(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return pR=s,pR}var mR,VB;function Sf(){if(VB)return mR;VB=1;let e=IR();return mR=(n,r,i)=>new e(n,i).compare(new e(r,i)),mR}var gR,XB;function Jpe(){if(XB)return gR;XB=1;let e=Sf();return gR=(n,r,i)=>e(n,r,i)===0,gR}var yR,KB;function Zpe(){if(KB)return yR;KB=1;let e=Sf();return yR=(n,r,i)=>e(n,r,i)!==0,yR}var xR,QB;function eme(){if(QB)return xR;QB=1;let e=Sf();return xR=(n,r,i)=>e(n,r,i)>0,xR}var bR,JB;function tme(){if(JB)return bR;JB=1;let e=Sf();return bR=(n,r,i)=>e(n,r,i)>=0,bR}var vR,ZB;function nme(){if(ZB)return vR;ZB=1;let e=Sf();return vR=(n,r,i)=>e(n,r,i)<0,vR}var wR,e9;function rme(){if(e9)return wR;e9=1;let e=Sf();return wR=(n,r,i)=>e(n,r,i)<=0,wR}var ER,t9;function ime(){if(t9)return ER;t9=1;let e=Jpe(),t=Zpe(),n=eme(),r=tme(),i=nme(),o=rme();return ER=(s,u,l,c)=>{switch(u){case"===":return typeof s=="object"&&(s=s.version),typeof l=="object"&&(l=l.version),s===l;case"!==":return typeof s=="object"&&(s=s.version),typeof l=="object"&&(l=l.version),s!==l;case"":case"=":case"==":return e(s,l,c);case"!=":return t(s,l,c);case">":return n(s,l,c);case">=":return r(s,l,c);case"<":return i(s,l,c);case"<=":return o(s,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},ER}var SR,n9;function ome(){if(n9)return SR;n9=1;let e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),a("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(c){let f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new s(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(a("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new s(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}SR=t;let n=DR(),{safeRe:r,t:i}=OR(),o=ime(),a=Zx(),s=IR(),u=d9();return SR}var _R,r9;function d9(){if(r9)return _R;r9=1;let e=/\s+/g;class t{constructor(F,T){if(T=i(T),F instanceof t)return F.loose===!!T.loose&&F.includePrerelease===!!T.includePrerelease?F:new t(F.raw,T);if(F instanceof o)return this.raw=F.value,this.set=[[F]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=F.trim().replace(e," "),this.set=this.raw.split("||").map(L=>this.parseRange(L.trim())).filter(L=>L.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let L=this.set[0];if(this.set=this.set.filter(q=>!m(q[0])),this.set.length===0)this.set=[L];else if(this.set.length>1){for(let q of this.set)if(q.length===1&&g(q[0])){this.set=[q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let F=0;F<this.set.length;F++){F>0&&(this.formatted+="||");let T=this.set[F];for(let L=0;L<T.length;L++)L>0&&(this.formatted+=" "),this.formatted+=T[L].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(F){let L=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+F,q=r.get(L);if(q)return q;let U=this.options.loose,oe=U?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];F=F.replace(oe,P(this.options.includePrerelease)),a("hyphen replace",F),F=F.replace(u[l.COMPARATORTRIM],c),a("comparator trim",F),F=F.replace(u[l.TILDETRIM],f),a("tilde trim",F),F=F.replace(u[l.CARETTRIM],d),a("caret trim",F);let pe=F.split(" ").map(Ee=>b(Ee,this.options)).join(" ").split(/\s+/).map(Ee=>R(Ee,this.options));U&&(pe=pe.filter(Ee=>(a("loose invalid filter",Ee,this.options),!!Ee.match(u[l.COMPARATORLOOSE])))),a("range list",pe);let fe=new Map,we=pe.map(Ee=>new o(Ee,this.options));for(let Ee of we){if(m(Ee))return[Ee];fe.set(Ee.value,Ee)}fe.size>1&&fe.has("")&&fe.delete("");let He=[...fe.values()];return r.set(L,He),He}intersects(F,T){if(!(F instanceof t))throw new TypeError("a Range is required");return this.set.some(L=>y(L,T)&&F.set.some(q=>y(q,T)&&L.every(U=>q.every(oe=>U.intersects(oe,T)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new s(F,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(D(this.set[T],F,this.options))return!0;return!1}}_R=t;let n=Kpe(),r=new n,i=DR(),o=ome(),a=Zx(),s=IR(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=OR(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=NR(),m=$=>$.value==="<0.0.0-0",g=$=>$.value==="",y=($,F)=>{let T=!0,L=$.slice(),q=L.pop();for(;T&&L.length;)T=L.every(U=>q.intersects(U,F)),q=L.pop();return T},b=($,F)=>(a("comp",$,F),$=_($,F),a("caret",$),$=w($,F),a("tildes",$),$=k($,F),a("xrange",$),$=M($,F),a("stars",$),$),v=$=>!$||$.toLowerCase()==="x"||$==="*",w=($,F)=>$.trim().split(/\s+/).map(T=>E(T,F)).join(" "),E=($,F)=>{let T=F.loose?u[l.TILDELOOSE]:u[l.TILDE];return $.replace(T,(L,q,U,oe,pe)=>{a("tilde",$,L,q,U,oe,pe);let fe;return v(q)?fe="":v(U)?fe=`>=${q}.0.0 <${+q+1}.0.0-0`:v(oe)?fe=`>=${q}.${U}.0 <${q}.${+U+1}.0-0`:pe?(a("replaceTilde pr",pe),fe=`>=${q}.${U}.${oe}-${pe} <${q}.${+U+1}.0-0`):fe=`>=${q}.${U}.${oe} <${q}.${+U+1}.0-0`,a("tilde return",fe),fe})},_=($,F)=>$.trim().split(/\s+/).map(T=>S(T,F)).join(" "),S=($,F)=>{a("caret",$,F);let T=F.loose?u[l.CARETLOOSE]:u[l.CARET],L=F.includePrerelease?"-0":"";return $.replace(T,(q,U,oe,pe,fe)=>{a("caret",$,q,U,oe,pe,fe);let we;return v(U)?we="":v(oe)?we=`>=${U}.0.0${L} <${+U+1}.0.0-0`:v(pe)?U==="0"?we=`>=${U}.${oe}.0${L} <${U}.${+oe+1}.0-0`:we=`>=${U}.${oe}.0${L} <${+U+1}.0.0-0`:fe?(a("replaceCaret pr",fe),U==="0"?oe==="0"?we=`>=${U}.${oe}.${pe}-${fe} <${U}.${oe}.${+pe+1}-0`:we=`>=${U}.${oe}.${pe}-${fe} <${U}.${+oe+1}.0-0`:we=`>=${U}.${oe}.${pe}-${fe} <${+U+1}.0.0-0`):(a("no pr"),U==="0"?oe==="0"?we=`>=${U}.${oe}.${pe}${L} <${U}.${oe}.${+pe+1}-0`:we=`>=${U}.${oe}.${pe}${L} <${U}.${+oe+1}.0-0`:we=`>=${U}.${oe}.${pe} <${+U+1}.0.0-0`),a("caret return",we),we})},k=($,F)=>(a("replaceXRanges",$,F),$.split(/\s+/).map(T=>C(T,F)).join(" ")),C=($,F)=>{$=$.trim();let T=F.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return $.replace(T,(L,q,U,oe,pe,fe)=>{a("xRange",$,L,q,U,oe,pe,fe);let we=v(U),He=we||v(oe),Ee=He||v(pe),cn=Ee;return q==="="&&cn&&(q=""),fe=F.includePrerelease?"-0":"",we?q===">"||q==="<"?L="<0.0.0-0":L="*":q&&cn?(He&&(oe=0),pe=0,q===">"?(q=">=",He?(U=+U+1,oe=0,pe=0):(oe=+oe+1,pe=0)):q==="<="&&(q="<",He?U=+U+1:oe=+oe+1),q==="<"&&(fe="-0"),L=`${q+U}.${oe}.${pe}${fe}`):He?L=`>=${U}.0.0${fe} <${+U+1}.0.0-0`:Ee&&(L=`>=${U}.${oe}.0${fe} <${U}.${+oe+1}.0-0`),a("xRange return",L),L})},M=($,F)=>(a("replaceStars",$,F),$.trim().replace(u[l.STAR],"")),R=($,F)=>(a("replaceGTE0",$,F),$.trim().replace(u[F.includePrerelease?l.GTE0PRE:l.GTE0],"")),P=$=>(F,T,L,q,U,oe,pe,fe,we,He,Ee,cn)=>(v(L)?T="":v(q)?T=`>=${L}.0.0${$?"-0":""}`:v(U)?T=`>=${L}.${q}.0${$?"-0":""}`:oe?T=`>=${T}`:T=`>=${T}${$?"-0":""}`,v(we)?fe="":v(He)?fe=`<${+we+1}.0.0-0`:v(Ee)?fe=`<${we}.${+He+1}.0-0`:cn?fe=`<=${we}.${He}.${Ee}-${cn}`:$?fe=`<${we}.${He}.${+Ee+1}-0`:fe=`<=${fe}`,`${T} ${fe}`.trim()),D=($,F,T)=>{for(let L=0;L<$.length;L++)if(!$[L].test(F))return!1;if(F.prerelease.length&&!T.includePrerelease){for(let L=0;L<$.length;L++)if(a($[L].semver),$[L].semver!==o.ANY&&$[L].semver.prerelease.length>0){let q=$[L].semver;if(q.major===F.major&&q.minor===F.minor&&q.patch===F.patch)return!0}return!1}return!0};return _R}var AR,i9;function ame(){if(i9)return AR;i9=1;let e=d9();return AR=(n,r,i)=>{try{r=new e(r,i)}catch{return!1}return r.test(n)},AR}var sme=ame(),h9=Xpe(sme);function ume(e,t,n){let r=e.open(t),i=250,{origin:o}=new URL(t),a=40;function s(l){l.source===r&&(a=0,e.removeEventListener("message",s,!1))}e.addEventListener("message",s,!1);function u(){a<=0||(r.postMessage(n,o),setTimeout(u,i),a-=1)}setTimeout(u,i)}var lme=`.vega-embed {
|
|
71
|
+
position: relative;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
}
|
|
75
|
+
.vega-embed.has-actions {
|
|
76
|
+
padding-right: 38px;
|
|
77
|
+
}
|
|
78
|
+
.vega-embed details:not([open]) > :not(summary) {
|
|
79
|
+
display: none !important;
|
|
80
|
+
}
|
|
81
|
+
.vega-embed summary {
|
|
82
|
+
list-style: none;
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
padding: 6px;
|
|
87
|
+
z-index: 1000;
|
|
88
|
+
background: white;
|
|
89
|
+
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
|
90
|
+
color: #1b1e23;
|
|
91
|
+
border: 1px solid #aaa;
|
|
92
|
+
border-radius: 999px;
|
|
93
|
+
opacity: 0.2;
|
|
94
|
+
transition: opacity 0.4s ease-in;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
line-height: 0px;
|
|
97
|
+
}
|
|
98
|
+
.vega-embed summary::-webkit-details-marker {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
.vega-embed summary:active {
|
|
102
|
+
box-shadow: #aaa 0px 0px 0px 1px inset;
|
|
103
|
+
}
|
|
104
|
+
.vega-embed summary svg {
|
|
105
|
+
width: 14px;
|
|
106
|
+
height: 14px;
|
|
107
|
+
}
|
|
108
|
+
.vega-embed details[open] summary {
|
|
109
|
+
opacity: 0.7;
|
|
110
|
+
}
|
|
111
|
+
.vega-embed:hover summary, .vega-embed:focus-within summary {
|
|
112
|
+
opacity: 1 !important;
|
|
113
|
+
transition: opacity 0.2s ease;
|
|
114
|
+
}
|
|
115
|
+
.vega-embed .vega-actions {
|
|
116
|
+
position: absolute;
|
|
117
|
+
z-index: 1001;
|
|
118
|
+
top: 35px;
|
|
119
|
+
right: -9px;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
padding-bottom: 8px;
|
|
123
|
+
padding-top: 8px;
|
|
124
|
+
border-radius: 4px;
|
|
125
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
|
|
126
|
+
border: 1px solid #d9d9d9;
|
|
127
|
+
background: white;
|
|
128
|
+
animation-duration: 0.15s;
|
|
129
|
+
animation-name: scale-in;
|
|
130
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
|
|
131
|
+
text-align: left;
|
|
132
|
+
}
|
|
133
|
+
.vega-embed .vega-actions a {
|
|
134
|
+
padding: 8px 16px;
|
|
135
|
+
font-family: sans-serif;
|
|
136
|
+
font-size: 14px;
|
|
137
|
+
font-weight: 600;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
color: #434a56;
|
|
140
|
+
text-decoration: none;
|
|
141
|
+
}
|
|
142
|
+
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
|
|
143
|
+
background-color: #f7f7f9;
|
|
144
|
+
color: black;
|
|
145
|
+
}
|
|
146
|
+
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
|
|
147
|
+
content: "";
|
|
148
|
+
display: inline-block;
|
|
149
|
+
position: absolute;
|
|
150
|
+
}
|
|
151
|
+
.vega-embed .vega-actions::before {
|
|
152
|
+
left: auto;
|
|
153
|
+
right: 14px;
|
|
154
|
+
top: -16px;
|
|
155
|
+
border: 8px solid rgba(0, 0, 0, 0);
|
|
156
|
+
border-bottom-color: #d9d9d9;
|
|
157
|
+
}
|
|
158
|
+
.vega-embed .vega-actions::after {
|
|
159
|
+
left: auto;
|
|
160
|
+
right: 15px;
|
|
161
|
+
top: -14px;
|
|
162
|
+
border: 7px solid rgba(0, 0, 0, 0);
|
|
163
|
+
border-bottom-color: #fff;
|
|
164
|
+
}
|
|
165
|
+
.vega-embed .chart-wrapper.fit-x {
|
|
166
|
+
width: 100%;
|
|
167
|
+
}
|
|
168
|
+
.vega-embed .chart-wrapper.fit-y {
|
|
169
|
+
height: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.vega-embed-wrapper {
|
|
173
|
+
max-width: 100%;
|
|
174
|
+
overflow: auto;
|
|
175
|
+
padding-right: 14px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@keyframes scale-in {
|
|
179
|
+
from {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transform: scale(0.6);
|
|
182
|
+
}
|
|
183
|
+
to {
|
|
184
|
+
opacity: 1;
|
|
185
|
+
transform: scale(1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`;function p9(e,...t){for(let n of t)cme(e,n);return e}function cme(e,t){for(let n of Object.keys(t))ya(e,n,t[n],!0)}var fme="7.1.0",dme={version:fme},P4e=dme.version,mo=wk,fm=eR,o9=typeof window<"u"?window:void 0;fm===void 0&&o9?.vl?.compile&&(fm=o9.vl);var hme={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},pme={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},lm={vega:"Vega","vega-lite":"Vega-Lite"},Qx={vega:mo.version,"vega-lite":fm?fm.version:"not available"},mme={vega:e=>e,"vega-lite":(e,t,n)=>fm.compile(e,{config:n,logger:t}).spec},gme=`
|
|
189
|
+
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
|
190
|
+
<circle r="2" cy="8" cx="2"></circle>
|
|
191
|
+
<circle r="2" cy="8" cx="8"></circle>
|
|
192
|
+
<circle r="2" cy="8" cx="14"></circle>
|
|
193
|
+
</svg>`,yme="chart-wrapper";function xme(e){return typeof e=="function"}function a9(e,t,n,r){let i=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(i+e+o),a.document.title=`${lm[r]} JSON Source`}function bme(e,t,n){if(e.$schema){let r=tR(e.$schema);n&&n!==r.library&&t.warn(`The given visualization spec is written in ${lm[r.library]}, but mode argument sets ${lm[n]??n}.`);let i=r.library;return h9(Qx[i],`^${r.version.slice(1)}`)||t.warn(`The input spec uses ${lm[i]} ${r.version}, but the current version of ${lm[i]} is v${Qx[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":n??"vega"}function m9(e){return!!(e&&"load"in e)}function s9(e){return m9(e)?e:mo.loader(e)}function vme(e){let t=e.usermeta?.embedOptions??{};return Z(t.defaultStyle)&&(t.defaultStyle=!1),t}async function eb(e,t,n={}){let r,i;Z(t)?(i=s9(n.loader),r=JSON.parse(await i.load(t))):r=t;let o=vme(r),a=o.loader;(!i||a)&&(i=s9(n.loader??a));let s=await u9(o,i),u=await u9(n,i),l={...p9(u,s),config:bo(u.config??{},s.config??{})};return await Eme(e,r,l,i)}async function u9(e,t){let n=Z(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=Z(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...r?{patch:r}:{},...n?{config:n}:{}}}function wme(e){let t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Eme(e,t,n={},r){let i=n.theme?bo(uR[n.theme],n.config??{}):n.config,o=Gr(n.actions)?n.actions:p9({},hme,n.actions??{}),a={...pme,...n.i18n},s=n.renderer??"svg",u=n.logger??Ns(mo.Warn);n.logLevel!==void 0&&u.level(n.logLevel);let l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){let E="vega-embed-style",{root:_,rootContainer:S}=wme(c);if(!_.getElementById(E)){let k=document.createElement("style");k.id=E,k.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?lme.toString():n.defaultStyle,S.appendChild(k)}}let f=bme(t,u,n.mode),d=mme[f](t,u,i);if(f==="vega-lite"&&d.$schema){let E=tR(d.$schema);h9(Qx.vega,`^${E.version.slice(1)}`)||u.warn(`The compiled spec uses Vega ${E.version}, but current version is v${Qx.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){let E=document.createElement("div");E.classList.add(yme),c.appendChild(E),h=E}let p=n.patch;if(p&&(d=p instanceof Function?p(d):Jx(d,p,!0,!1).newDocument),n.formatLocale&&mo.formatLocale(n.formatLocale),n.timeFormatLocale&&mo.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(let E in n.expressionFunctions){let _=n.expressionFunctions[E];"fn"in _?mo.expressionFunction(E,_.fn,_.visitor):_ instanceof Function&&mo.expressionFunction(E,_)}let{ast:m}=n,g=mo.parse(d,f==="vega-lite"?{}:i,{ast:m}),y=new(n.viewClass||mo.View)(g,{loader:r,logger:u,renderer:s,...m?{expr:mo.expressionInterpreter??n.expr??Gc}:{}});if(y.addSignalListener("autosize",(E,_)=>{let{type:S}=_;S=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):S=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):S=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){let{loader:E,tooltip:_}=n,S=E&&!m9(E)?E?.baseURL:void 0,k=xme(_)?_:new Yx({baseURL:S,..._===!0?{}:_}).call;y.tooltip(k)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){let{hoverSet:E,updateSet:_}=typeof b=="boolean"?{}:b;y.hover(E,_)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(o!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){let S=document.createElement("details");S.title=a.CLICK_TO_VIEW_ACTIONS,c.append(S),E=S;let k=document.createElement("summary");k.innerHTML=gme,S.append(k),v=C=>{S.contains(C.target)||S.removeAttribute("open")},document.addEventListener("click",v)}let _=document.createElement("div");if(E.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(let S of["svg","png"])if(o===!0||o.export===!0||o.export[S]){let k=a[`${S.toUpperCase()}_ACTION`],C=document.createElement("a"),M=Q(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;C.text=k,C.href="#",C.target="_blank",C.download=`${l}.${S}`,C.addEventListener("mousedown",async function(R){R.preventDefault();let P=await y.toImageURL(S,M);this.href=P}),_.append(C)}}if(o===!0||o.source!==!1){let S=document.createElement("a");S.text=a.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(k){a9(Af(t),n.sourceHeader??"",n.sourceFooter??"",f),k.preventDefault()}),_.append(S)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){let S=document.createElement("a");S.text=a.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(k){a9(Af(d),n.sourceHeader??"",n.sourceFooter??"","vega"),k.preventDefault()}),_.append(S)}if(o===!0||o.editor!==!1){let S=n.editorUrl??"https://vega.github.io/editor/",k=document.createElement("a");k.text=a.EDITOR_ACTION,k.href="#",k.addEventListener("click",function(C){ume(window,S,{config:i,mode:p?"vega":f,renderer:s,spec:Af(p?d:t)}),C.preventDefault()}),_.append(k)}}function w(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:w,embedOptions:n}}x();x();var tb=class{constructor(t){this._initialized=!1;this.type=t}createContainer(){let t=document.createElement("div");return t.id="render-container-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),t.style.cssText="position: absolute; left: -9999px; top: -9999px;",document.body.appendChild(t),t}removeContainer(t){t&&t.parentNode&&t.parentNode.removeChild(t)}async initialize(t=null){this._initialized=!0}isInitialized(){return this._initialized}async render(t,n){throw new Error("render() must be implemented by subclass")}async mountToDom(t,n,r){let i=await this.render(t,n);if(!i||!i.base64){let a=document.createElement("div");return a.textContent=`Renderer returned empty result: ${this.type}`,r.appendChild(a),{root:a,cleanup:()=>{try{a.remove()}catch{}}}}let o=document.createElement("img");return o.style.maxWidth="100%",o.style.height="auto",o.alt=`${this.type} diagram`,o.src=`data:image/${i.format};base64,${i.base64}`,r.appendChild(o),{root:o,cleanup:()=>{try{o.remove()}catch{}}}}validateInput(t){if(!t||typeof t=="string"&&t.trim()==="")throw new Error(`Empty ${this.type} input provided`)}preprocessInput(t){return t}calculateCanvasScale(t){let r=t?.fontSize||12;return 14/16*(r/12)*4}async renderSvgToCanvas(t,n,r,i=null){return t=t.replace(/<style>/,"<style>foreignObject { overflow: visible; }"),new Promise((o,a)=>{let s=new Image;s.crossOrigin="Anonymous";let u=btoa(unescape(encodeURIComponent(t)));s.src=`data:image/svg+xml;base64,${u}`,s.onload=()=>{let l=document.createElement("canvas");l.width=n,l.height=r;let c=l.getContext("2d");i&&(c.font=`14px ${i}`),c.drawImage(s,0,0,n,r),o(l)},s.onerror=l=>{a(new Error("Failed to load SVG into image for rendering"))}})}};var nb=class extends tb{constructor(t="vega-lite"){super(t),this.mode=t}validateInput(t){if(!t)throw new Error(`Empty ${this.mode} specification provided`);return!0}preprocessInput(t){let n;if(typeof t=="string")try{n=JSON.parse(t)}catch(r){throw new Error(`Invalid JSON in ${this.mode} specification: ${r.message}`)}else n=t;if(!n||typeof n!="object")throw new Error(`Invalid ${this.mode} specification: must be an object`);return this.mode==="vega-lite"&&this.disableAutoSortRecursive(n),n}disableAutoSortRecursive(t){!t||typeof t!="object"||(t.encoding&&this.disableAutoSort(t.encoding),Array.isArray(t.layer)&&t.layer.forEach(n=>this.disableAutoSortRecursive(n)),["hconcat","vconcat","concat"].forEach(n=>{let r=t[n];Array.isArray(r)&&r.forEach(i=>this.disableAutoSortRecursive(i))}),t.facet&&(t.facet.encoding&&this.disableAutoSort(t.facet.encoding),t.spec&&this.disableAutoSortRecursive(t.spec)),t.repeat&&t.spec&&this.disableAutoSortRecursive(t.spec))}disableAutoSort(t){if(!(!t||typeof t!="object"))for(let n in t){let r=t[n];r&&typeof r=="object"&&!Array.isArray(r)&&(Object.prototype.hasOwnProperty.call(r,"sort")||(r.sort=null))}}async render(t,n){this._initialized||await this.initialize(n),this.validateInput(t);let r=this.preprocessInput(t),i=n?.fontFamily||"'SimSun', 'Times New Roman', Times, serif",o=this.createContainer();o.style.cssText="position: absolute; left: -9999px; top: -9999px; display: inline-block; background: transparent; padding: 0; margin: 0;";let a={mode:this.mode,actions:!1,renderer:"canvas",ast:!0,expr:Gc,config:{background:null,font:i,view:{stroke:null},axis:{labelFontSize:11,titleFontSize:12},legend:{labelFontSize:11,titleFontSize:12},mark:{tooltip:!0}}},s=await eb(o,r,a),u=this.calculateCanvasScale(n),l=await s.view.toCanvas(u);if(!l||l.width===0||l.height===0)throw new Error("Generated canvas is empty or invalid");let f=l.toDataURL("image/png",1).replace(/^data:image\/png;base64,/,"");return this.removeContainer(o),{base64:f,width:l.width,height:l.height,format:"png"}}};var dm=class extends nb{async mountToDom(t,n,r){this._initialized||await this.initialize(n),this.validateInput(t);let i=this.preprocessInput(t),o=n?.fontFamily||"'SimSun', 'Times New Roman', Times, serif";r.innerHTML="";let a=document.createElement("div");a.style.cssText="display: inline-block; background: transparent; padding: 0; margin: 0;",r.appendChild(a);let u={mode:this.type==="vega"?"vega":"vega-lite",actions:!1,renderer:"svg",ast:!0,expr:Gc,config:{background:null,font:o,view:{stroke:null},axis:{labelFontSize:11,titleFontSize:12},legend:{labelFontSize:11,titleFontSize:12},mark:{tooltip:!0}}},l=await eb(a,i,u),c=(async()=>{try{l?.view?.runAsync&&await l.view.runAsync()}catch{}try{document.fonts?.ready&&await document.fonts.ready}catch{}})();return{root:a,cleanup:()=>{try{l?.view?.finalize?.()}catch{}try{a.remove()}catch{}},done:c}}};x();function Sme(){return globalThis}function _me(){let e=Sme();return e.__md2x_renderer_registry__||(e.__md2x_renderer_registry__=new Map),e.__md2x_renderer_registry__}function PR(e){_me().set(e.type,e)}PR(new dm("vega-lite"));PR(new dm("vega"));})();
|
|
194
|
+
/*! Bundled license information:
|
|
195
|
+
|
|
196
|
+
ieee754/index.js:
|
|
197
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
198
|
+
|
|
199
|
+
buffer/index.js:
|
|
200
|
+
(*!
|
|
201
|
+
* The buffer module from node.js, for the browser.
|
|
202
|
+
*
|
|
203
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
204
|
+
* @license MIT
|
|
205
|
+
*)
|
|
206
|
+
|
|
207
|
+
vega-embed/build/embed.js:
|
|
208
|
+
(*!
|
|
209
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
210
|
+
* (c) 2017-2022 Joachim Wester
|
|
211
|
+
* MIT licensed
|
|
212
|
+
*)
|
|
213
|
+
(*!
|
|
214
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
215
|
+
* (c) 2017-2021 Joachim Wester
|
|
216
|
+
* MIT license
|
|
217
|
+
*)
|
|
218
|
+
*/
|