diff --git a/scalene/scalene-gui/package.json b/scalene/scalene-gui/package.json
index 3d97b96e0..b4ec2c4e1 100644
--- a/scalene/scalene-gui/package.json
+++ b/scalene/scalene-gui/package.json
@@ -24,6 +24,7 @@
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
+ "terser-webpack-plugin": "^5.3.11",
"url": "^0.11.4",
"util": "^0.12.5",
"webpack": "^5.96.1",
diff --git a/scalene/scalene-gui/scalene-gui-bundle.js b/scalene/scalene-gui/scalene-gui-bundle.js
index 640a6c159..4f3ef8e84 100644
--- a/scalene/scalene-gui/scalene-gui-bundle.js
+++ b/scalene/scalene-gui/scalene-gui-bundle.js
@@ -1,2 +1,3 @@
/*! For license information please see scalene-gui-bundle.js.LICENSE.txt */
-(()=>{var e={90217:(e,t,n)=>{"use strict";n.r(t),n.d(t,{sendPromptToAmazon:()=>i});var r=n(6995);async function i(e){const t=document.getElementById("aws-access-key").value||localStorage.getItem("aws-access-key"),n=document.getElementById("aws-secret-key").value||localStorage.getItem("aws-secret-key"),i=document.getElementById("aws-region").value||localStorage.getItem("aws-region")||"us-east-1",a={accessKeyId:t,secretAccessKey:n},o=new r.BedrockRuntimeClient({region:i,credentials:a}),s={modelId:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",body:JSON.stringify({anthropic_version:"bedrock-2023-05-31",max_tokens:65536,messages:[{role:"user",content:[{type:"text",text:e}]}]})};try{const e=new r.InvokeModelCommand(s),t=await o.send(e),n=new Blob([t.body]),i=await n.text();return JSON.parse(i).content[0].text.trim()}catch(e){return console.error(e),`# Error: ${e.message}`}}},26026:(e,t,n)=>{"use strict";async function r(e,t,n,r){const i=`${n}/openai/deployments/${r}/chat/completions?api-version=${document.getElementById("azure-api-model-version").value}`,a=JSON.stringify({messages:[{role:"system",content:"You are a Python programming assistant who ONLY responds with blocks of commented, optimized code. You never respond with text. Just code, starting with ``` and ending with ```."},{role:"user",content:e}],user:"scalene-user"});console.log(a);const o=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","api-key":t},body:a}),s=await o.json();if(s.error&&s.error.code in{invalid_request_error:!0,model_not_found:!0,insufficient_quota:!0})return"";try{console.log(`Debugging info: Retrieved ${JSON.stringify(s.choices[0],null,4)}`)}catch{console.log(`Debugging info: Failed to retrieve data.choices from the server. data = ${JSON.stringify(s)}`)}try{return s.choices[0].message.content.replace(/^\s*[\r\n]/gm,"")}catch{return"# Query failed. See JavaScript console (in Chrome: View > Developer > JavaScript Console) for more info.\n"}}n.r(t),n.d(t,{sendPromptToAzureOpenAI:()=>r})},43270:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DownTriangle:()=>u,Explosion:()=>a,Lightning:()=>i,RightTriangle:()=>l,WhiteExplosion:()=>s,WhiteLightning:()=>o,makeBar:()=>d,makeGPUBar:()=>p,makeGPUPie:()=>f,makeMemoryBar:()=>g,makeMemoryPie:()=>h,makeSparkline:()=>m});var r=n(12672);const i="⚡",a="💥",o=`${i}`,s=`${a}`,l="►",u="▼";function c(e,t){let n=t/100*globalThis.profile.elapsed_time_sec;return`(${e}) `+t.toFixed(1)+"% ["+(0,r.time_consumed_str)(1e3*n)+"]"}function d(e,t,n,r){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",config:{view:{stroke:"transparent"}},autosize:{contains:"padding"},width:r.width,height:r.height,padding:0,data:{values:[{x:0,y:e.toFixed(1),c:c("Python",e),d:e>=20?e.toFixed(0)+"%":e>=10?e.toFixed(0):"",q:e/2},{x:0,y:t.toFixed(1),c:c("native",t),d:t>=20?t.toFixed(0)+"%":t>=10?t.toFixed(0):"",q:e+t/2},{x:0,y:n.toFixed(1),c:c("system",n),d:n>=20?n.toFixed(0)+"%":n>=10?n.toFixed(0):"",q:e+t+n/2}]},layer:[{mark:{type:"bar"},encoding:{x:{aggregate:"sum",field:"y",axis:!1,stack:"zero",scale:{domain:[0,100]}},color:{field:"c",type:"nominal",legend:!1,scale:{range:["darkblue","#6495ED","blue"]}},tooltip:[{field:"c",type:"nominal",title:"time"}]}},{mark:{type:"text",align:"center",baseline:"middle",dx:0},encoding:{x:{aggregate:"sum",field:"q",axis:!1},text:{field:"d"},color:{value:"white"},tooltip:[{field:"c",type:"nominal",title:"time"}]}}]}}function f(e,t,n){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",config:{view:{stroke:"transparent"}},autosize:{contains:"padding"},width:n.width,height:n.height,padding:0,data:{values:[{category:1,value:e.toFixed(1),c:"in use: "+e.toFixed(1)+"%"}]},mark:"arc",encoding:{theta:{field:"value",type:"quantitative",scale:{domain:[0,100]}},color:{field:"c",type:"nominal",legend:!1,scale:{range:["goldenrod","#f4e6c2"]}},tooltip:[{field:"c",type:"nominal",title:t}]}}}function p(e,t,n){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",config:{view:{stroke:"transparent"}},autosize:{contains:"padding"},width:n.width,height:n.height,padding:0,data:{values:[{x:0,y:e.toFixed(0),q:(e/2).toFixed(0),d:e>=20?e.toFixed(0)+"%":"",dd:"in use: "+e.toFixed(0)+"%"}]},layer:[{mark:{type:"bar"},encoding:{x:{aggregate:"sum",field:"y",axis:!1,scale:{domain:[0,100]}},color:{field:"dd",type:"nominal",legend:!1,scale:{range:["goldenrod","#f4e6c2"]}},tooltip:[{field:"dd",type:"nominal",title:t+":"}]}},{mark:{type:"text",align:"center",baseline:"middle",dx:0},encoding:{x:{aggregate:"sum",field:"q",axis:!1},text:{field:"d"},color:{value:"white"},tooltip:[{field:"dd",type:"nominal",title:t+":"}]}}]}}function h(e,t,n){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:n.width,height:20,padding:0,data:{values:[{category:1,value:e.toFixed(1),c:"native: "+e.toFixed(1)+"%"},{category:2,value:t.toFixed(1),c:"Python: "+t.toFixed(1)+"%"}]},mark:"arc",encoding:{theta:{field:"value",type:"quantitative",scale:{domain:[0,100]}},color:{field:"c",type:"nominal",legend:!1,scale:{range:["darkgreen","#50C878"]}},tooltip:[{field:"c",type:"nominal",title:"memory"}]}}}function g(e,t,n,i,a,o){return{$schema:"https://vega.github.io/schema/vega-lite/v5.json",config:{view:{stroke:"transparent"}},autosize:{contains:"padding"},width:o.width,height:o.height,padding:0,data:{values:[{x:0,y:n*e,c:"(Python) "+(0,r.memory_consumed_str)(n*e),d:n*e>.2*i?(0,r.memory_consumed_str)(n*e):"",q:n*e/2},{x:0,y:(1-n)*e,c:"(native) "+(0,r.memory_consumed_str)((1-n)*e),d:(1-n)*e>.2*i?(0,r.memory_consumed_str)((1-n)*e):"",q:n*e+(1-n)*e/2}]},layer:[{mark:{type:"bar"},encoding:{x:{aggregate:"sum",field:"y",axis:!1,scale:{domain:[0,i]}},color:{field:"c",type:"nominal",legend:!1,scale:{range:[a,"#50C878","green"]}}}},{mark:{type:"text",align:"center",baseline:"middle",dx:0},encoding:{x:{aggregate:"sum",field:"q",axis:!1},text:{field:"d"},color:{value:"white"}}}]}}function m(e,t,n,i=0,a){const o=e.map((e=>{let t="";return 0!=i&&(t=`; possible leak (${(0,r.memory_consumed_str)(i)}/s)`),{x:e[0],y:e[1],y_text:(0,r.memory_consumed_str)(e[1])+" (@ "+(0,r.time_consumed_str)(e[0]/1e6)+")"+t}}));let s="";return 0!=i&&(s="possible leak",a.height-=10),{$schema:"https://vega.github.io/schema/vega-lite/v5.json",data:{values:o},width:a.width,height:a.height,padding:0,title:{text:s,baseline:"line-bottom",color:"red",offset:0,lineHeight:10,orient:"bottom",fontStyle:"italic"},encoding:{x:{field:"x",type:"quantitative",title:"",axis:{tickCount:10,tickSize:0,labelExpr:""},scale:{domain:[0,t]}}},layer:[{encoding:{y:{field:"y",type:"quantitative",axis:null,scale:{domain:[0,n]}},color:{field:"c",type:"nominal",legend:null,scale:{range:["darkgreen"]}}},layer:[{mark:"line"},{transform:[{filter:{param:"hover",empty:!1}}],mark:"point"}]},{mark:"rule",encoding:{opacity:{condition:{value:.3,param:"hover",empty:!1},value:0},tooltip:[{field:"y_text",type:"nominal",title:"memory"}]},params:[{name:"hover",select:{type:"point",fields:["y"],nearest:!0,on:"mousemove"}}]}]}}},9779:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AwsCrc32:()=>o});var r=n(31635),i=n(45193),a=n(60442),o=function(){function e(){this.crc32=new a.Crc32}return e.prototype.update=function(e){(0,i.isEmptyData)(e)||this.crc32.update((0,i.convertToBuffer)(e))},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,(0,i.numToUint8)(this.crc32.digest())]}))}))},e.prototype.reset=function(){this.crc32=new a.Crc32},e}()},60442:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AwsCrc32:()=>a.AwsCrc32,Crc32:()=>s,crc32:()=>o});var r=n(31635),i=n(45193),a=n(9779);function o(e){return(new s).update(e).digest()}var s=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var i=(0,r.__values)(e),a=i.next();!a.done;a=i.next()){var o=a.value;this.checksum=this.checksum>>>8^l[255&(this.checksum^o)]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}(),l=(0,i.uint32ArrayFrom)([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117])},81713:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EMPTY_DATA_SHA_256:()=>a,SHA_256_HASH:()=>r,SHA_256_HMAC_ALGO:()=>i});var r={name:"SHA-256"},i={name:"HMAC",hash:r},a=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},97963:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>l});var r=n(36171),i=n(20928),a=n(81566),o=n(77226),s=n(45193),l=function(){function e(e){(0,a.supportsWebCrypto)((0,o.locateWindow)())?this.hash=new r.Sha256(e):this.hash=new i.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update((0,s.convertToBuffer)(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}()},25147:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>r.Sha256,WebCryptoSha256:()=>i.Sha256});var r=n(97963),i=n(36171)},36171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>o});var r=n(45193),i=n(81713),a=n(77226),o=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!(0,r.isEmptyData)(e)){var t=(0,r.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,a.locateWindow)().crypto.subtle.sign(i.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,r.isEmptyData)(this.toHash)?Promise.resolve(i.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,a.locateWindow)().crypto.subtle.digest(i.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise((function(t,n){(0,a.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(e.secret),i.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))},e}()},91025:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RawSha256:()=>i});var r=n(16661),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i>>24&255,a[4*i+1]=this.state[i]>>>16&255,a[4*i+2]=this.state[i]>>>8&255,a[4*i+3]=this.state[i]>>>0&255;return a},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=0;d>>17|f<<15)^(f>>>19|f<<13)^f>>>10,h=((f=this.temp[d-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(h+this.temp[d-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&l^~s&u)|0)+(c+(r.KEY[d]+this.temp[d]|0)|0)|0,m=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&a^i&a)|0;c=u,u=l,l=s,s=o+g|0,o=a,a=i,i=n,n=g+m|0}t[0]+=n,t[1]+=i,t[2]+=a,t[3]+=o,t[4]+=s,t[5]+=l,t[6]+=u,t[7]+=c},e}()},16661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BLOCK_SIZE:()=>r,DIGEST_LENGTH:()=>i,INIT:()=>o,KEY:()=>a,MAX_HASHABLE_LENGTH:()=>s});var r=64,i=32,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=Math.pow(2,53)-1},20928:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>r.Sha256});var r=n(92342)},92342:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Sha256:()=>s});var r=n(31635),i=n(16661),a=n(91025),o=n(45193),s=function(){function e(e){this.secret=e,this.hash=new a.RawSha256,this.reset()}return e.prototype.update=function(e){if(!(0,o.isEmptyData)(e)&&!this.error)try{this.hash.update((0,o.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e.prototype.reset=function(){if(this.hash=new a.RawSha256,this.secret){this.outer=new a.RawSha256;var e=function(e){var t=(0,o.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new a.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(this.secret),t=new Uint8Array(i.BLOCK_SIZE);t.set(e);for(var n=0;n{"use strict";n.r(t),n.d(t,{supportsSecureRandom:()=>r.supportsSecureRandom,supportsSubtleCrypto:()=>r.supportsSubtleCrypto,supportsWebCrypto:()=>r.supportsWebCrypto,supportsZeroByteGCM:()=>r.supportsZeroByteGCM});var r=n(74573)},74573:(e,t,n)=>{"use strict";n.r(t),n.d(t,{supportsSecureRandom:()=>o,supportsSubtleCrypto:()=>s,supportsWebCrypto:()=>a,supportsZeroByteGCM:()=>l});var r=n(31635),i=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function a(e){return!(!o(e)||"object"!=typeof e.crypto.subtle)&&s(e.crypto.subtle)}function o(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function s(e){return e&&i.every((function(t){return"function"==typeof e[t]}))}function l(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:if(!s(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},24773:(e,t,n)=>{"use strict";n.r(t),n.d(t,{convertToBuffer:()=>a});var r=n(15424),i="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:r.fromUtf8;function a(e){return e instanceof Uint8Array?e:"string"==typeof e?i(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},45193:(e,t,n)=>{"use strict";n.r(t),n.d(t,{convertToBuffer:()=>r.convertToBuffer,isEmptyData:()=>i.isEmptyData,numToUint8:()=>a.numToUint8,uint32ArrayFrom:()=>o.uint32ArrayFrom});var r=n(24773),i=n(72384),a=n(49470),o=n(34635)},72384:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e?0===e.length:0===e.byteLength}n.r(t),n.d(t,{isEmptyData:()=>r})},49470:(e,t,n)=>{"use strict";function r(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}n.r(t),n.d(t,{numToUint8:()=>r})},34635:(e,t,n)=>{"use strict";function r(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;nr})},46499:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromUtf8:()=>r});const r=e=>(new TextEncoder).encode(e)},15424:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromUtf8:()=>r.fromUtf8,toUint8Array:()=>i.toUint8Array,toUtf8:()=>a.toUtf8});var r=n(46499),i=n(32498),a=n(2358)},32498:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toUint8Array:()=>i});var r=n(46499);const i=e=>"string"==typeof e?(0,r.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)},2358:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toUtf8:()=>r});const r=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)}},2169:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BedrockRuntime:()=>d});var r=n(31796),i=n(52046),a=n(87216),o=n(32804),s=n(43340),l=n(24266),u=n(31755);const c={ApplyGuardrailCommand:a.ApplyGuardrailCommand,ConverseCommand:o.ConverseCommand,ConverseStreamCommand:s.ConverseStreamCommand,InvokeModelCommand:l.InvokeModelCommand,InvokeModelWithResponseStreamCommand:u.InvokeModelWithResponseStreamCommand};class d extends i.BedrockRuntimeClient{}(0,r.createAggregatedClient)(c,d)},52046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BedrockRuntimeClient:()=>v,__Client:()=>p.Client});var r=n(81095),i=n(50165),a=n(48377),o=n(44130),s=n(61329),l=n(40033),u=n(78504),c=n(70649),d=n(72540),f=n(41069),p=n(31796),h=n(19772),g=n(60756),m=n(47411),y=n(52793);class v extends p.Client{constructor(...[e]){const t=(0,m.getRuntimeConfig)(e||{}),n=(0,g.resolveClientEndpointParameters)(t),p=(0,o.resolveUserAgentConfig)(n),v=(0,f.resolveRetryConfig)(p),b=(0,s.resolveRegionConfig)(v),w=(0,r.resolveHostHeaderConfig)(b),x=(0,d.resolveEndpointConfig)(w),E=(0,u.resolveEventStreamSerdeConfig)(x),S=(0,h.resolveHttpAuthSchemeConfig)(E),_=(0,y.resolveRuntimeExtensions)(S,e?.extensions||[]);super(_),this.config=_,this.middlewareStack.use((0,o.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,f.getRetryPlugin)(this.config)),this.middlewareStack.use((0,c.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,r.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,i.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,a.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,l.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config,{httpAuthSchemeParametersProvider:h.defaultBedrockRuntimeHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async e=>new l.DefaultIdentityProviderConfig({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,l.getHttpSigningPlugin)(this.config))}destroy(){super.destroy()}}},21167:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpAuthExtensionConfiguration:()=>r,resolveHttpAuthRuntimeConfig:()=>i});const r=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex((t=>t.schemeId===e.schemeId));-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}},i=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})},19772:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultBedrockRuntimeHttpAuthSchemeParametersProvider:()=>a,defaultBedrockRuntimeHttpAuthSchemeProvider:()=>o,resolveHttpAuthSchemeConfig:()=>s});var r=n(44445),i=n(40805);const a=async(e,t,n)=>({operation:(0,i.getSmithyContext)(t).operation,region:await(0,i.normalizeProvider)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),o=e=>{const t=[];return e.operation,t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},s=e=>({...(0,r.resolveAwsSdkSigV4Config)(e)})},87216:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.Command,ApplyGuardrailCommand:()=>l});var r=n(72540),i=n(32754),a=n(31796),o=n(60756),s=n(43712);class l extends(a.Command.classBuilder().ep(o.commonParams).m((function(e,t,n,a){return[(0,i.getSerdePlugin)(n,this.serialize,this.deserialize),(0,r.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]})).s("AmazonBedrockFrontendService","ApplyGuardrail",{}).n("BedrockRuntimeClient","ApplyGuardrailCommand").f(void 0,void 0).ser(s.se_ApplyGuardrailCommand).de(s.de_ApplyGuardrailCommand).build()){}},32804:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.Command,ConverseCommand:()=>u});var r=n(72540),i=n(32754),a=n(31796),o=n(60756),s=n(285),l=n(43712);class u extends(a.Command.classBuilder().ep(o.commonParams).m((function(e,t,n,a){return[(0,i.getSerdePlugin)(n,this.serialize,this.deserialize),(0,r.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]})).s("AmazonBedrockFrontendService","Converse",{}).n("BedrockRuntimeClient","ConverseCommand").f(s.ConverseRequestFilterSensitiveLog,void 0).ser(l.se_ConverseCommand).de(l.de_ConverseCommand).build()){}},43340:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.Command,ConverseStreamCommand:()=>u});var r=n(72540),i=n(32754),a=n(31796),o=n(60756),s=n(285),l=n(43712);class u extends(a.Command.classBuilder().ep(o.commonParams).m((function(e,t,n,a){return[(0,i.getSerdePlugin)(n,this.serialize,this.deserialize),(0,r.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]})).s("AmazonBedrockFrontendService","ConverseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","ConverseStreamCommand").f(s.ConverseStreamRequestFilterSensitiveLog,s.ConverseStreamResponseFilterSensitiveLog).ser(l.se_ConverseStreamCommand).de(l.de_ConverseStreamCommand).build()){}},24266:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.Command,InvokeModelCommand:()=>u});var r=n(72540),i=n(32754),a=n(31796),o=n(60756),s=n(285),l=n(43712);class u extends(a.Command.classBuilder().ep(o.commonParams).m((function(e,t,n,a){return[(0,i.getSerdePlugin)(n,this.serialize,this.deserialize),(0,r.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]})).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(s.InvokeModelRequestFilterSensitiveLog,s.InvokeModelResponseFilterSensitiveLog).ser(l.se_InvokeModelCommand).de(l.de_InvokeModelCommand).build()){}},31755:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.Command,InvokeModelWithResponseStreamCommand:()=>u});var r=n(72540),i=n(32754),a=n(31796),o=n(60756),s=n(285),l=n(43712);class u extends(a.Command.classBuilder().ep(o.commonParams).m((function(e,t,n,a){return[(0,i.getSerdePlugin)(n,this.serialize,this.deserialize),(0,r.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]})).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(s.InvokeModelWithResponseStreamRequestFilterSensitiveLog,s.InvokeModelWithResponseStreamResponseFilterSensitiveLog).ser(l.se_InvokeModelWithResponseStreamCommand).de(l.de_InvokeModelWithResponseStreamCommand).build()){}},51322:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>r.$Command,ApplyGuardrailCommand:()=>r.ApplyGuardrailCommand,ConverseCommand:()=>i.ConverseCommand,ConverseStreamCommand:()=>a.ConverseStreamCommand,InvokeModelCommand:()=>o.InvokeModelCommand,InvokeModelWithResponseStreamCommand:()=>s.InvokeModelWithResponseStreamCommand});var r=n(87216),i=n(32804),a=n(43340),o=n(24266),s=n(31755)},60756:(e,t,n)=>{"use strict";n.r(t),n.d(t,{commonParams:()=>i,resolveClientEndpointParameters:()=>r});const r=e=>({...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"bedrock"}),i={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}},87010:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultEndpointResolver:()=>s});var r=n(95417),i=n(7069),a=n(66603);const o=new i.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),s=(e,t={})=>o.get(e,(()=>(0,i.resolveEndpoint)(a.ruleSet,{endpointParams:e,logger:t.logger})));i.customEndpointFunctions.aws=r.awsEndpointFunctions},66603:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ruleSet:()=>A});const r="required",i="fn",a="argv",o="ref",s=!0,l="isSet",u="booleanEquals",c="error",d="endpoint",f="tree",p="PartitionResult",h={[r]:!1,type:"String"},g={[r]:!0,default:!1,type:"Boolean"},m={[o]:"Endpoint"},y={[i]:u,[a]:[{[o]:"UseFIPS"},!0]},v={[i]:u,[a]:[{[o]:"UseDualStack"},!0]},b={},w={[i]:"getAttr",[a]:[{[o]:p},"supportsFIPS"]},x={[i]:u,[a]:[!0,{[i]:"getAttr",[a]:[{[o]:p},"supportsDualStack"]}]},E=[y],S=[v],_=[{[o]:"Region"}],A={version:"1.0",parameters:{Region:h,UseDualStack:g,UseFIPS:g,Endpoint:h},rules:[{conditions:[{[i]:l,[a]:[m]}],rules:[{conditions:E,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{rules:[{conditions:S,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:m,properties:b,headers:b},type:d}],type:f}],type:f},{rules:[{conditions:[{[i]:l,[a]:_}],rules:[{conditions:[{[i]:"aws.partition",[a]:_,assign:p}],rules:[{conditions:[y,v],rules:[{conditions:[{[i]:u,[a]:[s,w]},x],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:b,headers:b},type:d}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}],type:f},{conditions:E,rules:[{conditions:[{[i]:u,[a]:[w,s]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:b,headers:b},type:d}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:c}],type:f},{conditions:S,rules:[{conditions:[x],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:b,headers:b},type:d}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:c}],type:f},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:b,headers:b},type:d}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:c}],type:f}]}},6995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>a.$Command,AccessDeniedException:()=>o.AccessDeniedException,ApplyGuardrailCommand:()=>a.ApplyGuardrailCommand,BedrockRuntime:()=>i.BedrockRuntime,BedrockRuntimeClient:()=>r.BedrockRuntimeClient,BedrockRuntimeServiceException:()=>s.BedrockRuntimeServiceException,ContentBlock:()=>o.ContentBlock,ContentBlockDelta:()=>o.ContentBlockDelta,ContentBlockStart:()=>o.ContentBlockStart,ConversationRole:()=>o.ConversationRole,ConverseCommand:()=>a.ConverseCommand,ConverseOutput:()=>o.ConverseOutput,ConverseRequestFilterSensitiveLog:()=>o.ConverseRequestFilterSensitiveLog,ConverseStreamCommand:()=>a.ConverseStreamCommand,ConverseStreamOutput:()=>o.ConverseStreamOutput,ConverseStreamOutputFilterSensitiveLog:()=>o.ConverseStreamOutputFilterSensitiveLog,ConverseStreamRequestFilterSensitiveLog:()=>o.ConverseStreamRequestFilterSensitiveLog,ConverseStreamResponseFilterSensitiveLog:()=>o.ConverseStreamResponseFilterSensitiveLog,DocumentFormat:()=>o.DocumentFormat,DocumentSource:()=>o.DocumentSource,GuardrailAction:()=>o.GuardrailAction,GuardrailContentBlock:()=>o.GuardrailContentBlock,GuardrailContentFilterConfidence:()=>o.GuardrailContentFilterConfidence,GuardrailContentFilterStrength:()=>o.GuardrailContentFilterStrength,GuardrailContentFilterType:()=>o.GuardrailContentFilterType,GuardrailContentPolicyAction:()=>o.GuardrailContentPolicyAction,GuardrailContentQualifier:()=>o.GuardrailContentQualifier,GuardrailContentSource:()=>o.GuardrailContentSource,GuardrailContextualGroundingFilterType:()=>o.GuardrailContextualGroundingFilterType,GuardrailContextualGroundingPolicyAction:()=>o.GuardrailContextualGroundingPolicyAction,GuardrailConverseContentBlock:()=>o.GuardrailConverseContentBlock,GuardrailConverseContentQualifier:()=>o.GuardrailConverseContentQualifier,GuardrailManagedWordType:()=>o.GuardrailManagedWordType,GuardrailPiiEntityType:()=>o.GuardrailPiiEntityType,GuardrailSensitiveInformationPolicyAction:()=>o.GuardrailSensitiveInformationPolicyAction,GuardrailStreamProcessingMode:()=>o.GuardrailStreamProcessingMode,GuardrailTopicPolicyAction:()=>o.GuardrailTopicPolicyAction,GuardrailTopicType:()=>o.GuardrailTopicType,GuardrailTrace:()=>o.GuardrailTrace,GuardrailWordPolicyAction:()=>o.GuardrailWordPolicyAction,ImageFormat:()=>o.ImageFormat,ImageSource:()=>o.ImageSource,InternalServerException:()=>o.InternalServerException,InvokeModelCommand:()=>a.InvokeModelCommand,InvokeModelRequestFilterSensitiveLog:()=>o.InvokeModelRequestFilterSensitiveLog,InvokeModelResponseFilterSensitiveLog:()=>o.InvokeModelResponseFilterSensitiveLog,InvokeModelWithResponseStreamCommand:()=>a.InvokeModelWithResponseStreamCommand,InvokeModelWithResponseStreamRequestFilterSensitiveLog:()=>o.InvokeModelWithResponseStreamRequestFilterSensitiveLog,InvokeModelWithResponseStreamResponseFilterSensitiveLog:()=>o.InvokeModelWithResponseStreamResponseFilterSensitiveLog,ModelErrorException:()=>o.ModelErrorException,ModelNotReadyException:()=>o.ModelNotReadyException,ModelStreamErrorException:()=>o.ModelStreamErrorException,ModelTimeoutException:()=>o.ModelTimeoutException,PayloadPartFilterSensitiveLog:()=>o.PayloadPartFilterSensitiveLog,PromptVariableValues:()=>o.PromptVariableValues,ResourceNotFoundException:()=>o.ResourceNotFoundException,ResponseStream:()=>o.ResponseStream,ResponseStreamFilterSensitiveLog:()=>o.ResponseStreamFilterSensitiveLog,ServiceQuotaExceededException:()=>o.ServiceQuotaExceededException,ServiceUnavailableException:()=>o.ServiceUnavailableException,StopReason:()=>o.StopReason,SystemContentBlock:()=>o.SystemContentBlock,ThrottlingException:()=>o.ThrottlingException,Tool:()=>o.Tool,ToolChoice:()=>o.ToolChoice,ToolInputSchema:()=>o.ToolInputSchema,ToolResultContentBlock:()=>o.ToolResultContentBlock,ToolResultStatus:()=>o.ToolResultStatus,Trace:()=>o.Trace,ValidationException:()=>o.ValidationException,__Client:()=>r.__Client});var r=n(52046),i=n(2169),a=n(51322),o=n(66926),s=n(37474)},37474:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BedrockRuntimeServiceException:()=>i,__ServiceException:()=>r.ServiceException});var r=n(31796);class i extends r.ServiceException{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype)}}},66926:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AccessDeniedException:()=>r.AccessDeniedException,ContentBlock:()=>r.ContentBlock,ContentBlockDelta:()=>r.ContentBlockDelta,ContentBlockStart:()=>r.ContentBlockStart,ConversationRole:()=>r.ConversationRole,ConverseOutput:()=>r.ConverseOutput,ConverseRequestFilterSensitiveLog:()=>r.ConverseRequestFilterSensitiveLog,ConverseStreamOutput:()=>r.ConverseStreamOutput,ConverseStreamOutputFilterSensitiveLog:()=>r.ConverseStreamOutputFilterSensitiveLog,ConverseStreamRequestFilterSensitiveLog:()=>r.ConverseStreamRequestFilterSensitiveLog,ConverseStreamResponseFilterSensitiveLog:()=>r.ConverseStreamResponseFilterSensitiveLog,DocumentFormat:()=>r.DocumentFormat,DocumentSource:()=>r.DocumentSource,GuardrailAction:()=>r.GuardrailAction,GuardrailContentBlock:()=>r.GuardrailContentBlock,GuardrailContentFilterConfidence:()=>r.GuardrailContentFilterConfidence,GuardrailContentFilterStrength:()=>r.GuardrailContentFilterStrength,GuardrailContentFilterType:()=>r.GuardrailContentFilterType,GuardrailContentPolicyAction:()=>r.GuardrailContentPolicyAction,GuardrailContentQualifier:()=>r.GuardrailContentQualifier,GuardrailContentSource:()=>r.GuardrailContentSource,GuardrailContextualGroundingFilterType:()=>r.GuardrailContextualGroundingFilterType,GuardrailContextualGroundingPolicyAction:()=>r.GuardrailContextualGroundingPolicyAction,GuardrailConverseContentBlock:()=>r.GuardrailConverseContentBlock,GuardrailConverseContentQualifier:()=>r.GuardrailConverseContentQualifier,GuardrailManagedWordType:()=>r.GuardrailManagedWordType,GuardrailPiiEntityType:()=>r.GuardrailPiiEntityType,GuardrailSensitiveInformationPolicyAction:()=>r.GuardrailSensitiveInformationPolicyAction,GuardrailStreamProcessingMode:()=>r.GuardrailStreamProcessingMode,GuardrailTopicPolicyAction:()=>r.GuardrailTopicPolicyAction,GuardrailTopicType:()=>r.GuardrailTopicType,GuardrailTrace:()=>r.GuardrailTrace,GuardrailWordPolicyAction:()=>r.GuardrailWordPolicyAction,ImageFormat:()=>r.ImageFormat,ImageSource:()=>r.ImageSource,InternalServerException:()=>r.InternalServerException,InvokeModelRequestFilterSensitiveLog:()=>r.InvokeModelRequestFilterSensitiveLog,InvokeModelResponseFilterSensitiveLog:()=>r.InvokeModelResponseFilterSensitiveLog,InvokeModelWithResponseStreamRequestFilterSensitiveLog:()=>r.InvokeModelWithResponseStreamRequestFilterSensitiveLog,InvokeModelWithResponseStreamResponseFilterSensitiveLog:()=>r.InvokeModelWithResponseStreamResponseFilterSensitiveLog,ModelErrorException:()=>r.ModelErrorException,ModelNotReadyException:()=>r.ModelNotReadyException,ModelStreamErrorException:()=>r.ModelStreamErrorException,ModelTimeoutException:()=>r.ModelTimeoutException,PayloadPartFilterSensitiveLog:()=>r.PayloadPartFilterSensitiveLog,PromptVariableValues:()=>r.PromptVariableValues,ResourceNotFoundException:()=>r.ResourceNotFoundException,ResponseStream:()=>r.ResponseStream,ResponseStreamFilterSensitiveLog:()=>r.ResponseStreamFilterSensitiveLog,ServiceQuotaExceededException:()=>r.ServiceQuotaExceededException,ServiceUnavailableException:()=>r.ServiceUnavailableException,StopReason:()=>r.StopReason,SystemContentBlock:()=>r.SystemContentBlock,ThrottlingException:()=>r.ThrottlingException,Tool:()=>r.Tool,ToolChoice:()=>r.ToolChoice,ToolInputSchema:()=>r.ToolInputSchema,ToolResultContentBlock:()=>r.ToolResultContentBlock,ToolResultStatus:()=>r.ToolResultStatus,Trace:()=>r.Trace,ValidationException:()=>r.ValidationException});var r=n(285)},285:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AccessDeniedException:()=>a,ContentBlock:()=>I,ContentBlockDelta:()=>K,ContentBlockStart:()=>J,ConversationRole:()=>$,ConverseOutput:()=>j,ConverseRequestFilterSensitiveLog:()=>ne,ConverseStreamOutput:()=>Q,ConverseStreamOutputFilterSensitiveLog:()=>ie,ConverseStreamRequestFilterSensitiveLog:()=>re,ConverseStreamResponseFilterSensitiveLog:()=>ae,DocumentFormat:()=>k,DocumentSource:()=>R,GuardrailAction:()=>u,GuardrailContentBlock:()=>s,GuardrailContentFilterConfidence:()=>d,GuardrailContentFilterStrength:()=>f,GuardrailContentFilterType:()=>p,GuardrailContentPolicyAction:()=>c,GuardrailContentQualifier:()=>o,GuardrailContentSource:()=>l,GuardrailContextualGroundingFilterType:()=>g,GuardrailContextualGroundingPolicyAction:()=>h,GuardrailConverseContentBlock:()=>O,GuardrailConverseContentQualifier:()=>D,GuardrailManagedWordType:()=>x,GuardrailPiiEntityType:()=>y,GuardrailSensitiveInformationPolicyAction:()=>m,GuardrailStreamProcessingMode:()=>X,GuardrailTopicPolicyAction:()=>v,GuardrailTopicType:()=>b,GuardrailTrace:()=>T,GuardrailWordPolicyAction:()=>w,ImageFormat:()=>N,ImageSource:()=>F,InternalServerException:()=>E,InvokeModelRequestFilterSensitiveLog:()=>oe,InvokeModelResponseFilterSensitiveLog:()=>se,InvokeModelWithResponseStreamRequestFilterSensitiveLog:()=>le,InvokeModelWithResponseStreamResponseFilterSensitiveLog:()=>de,ModelErrorException:()=>G,ModelNotReadyException:()=>V,ModelStreamErrorException:()=>Z,ModelTimeoutException:()=>W,PayloadPartFilterSensitiveLog:()=>ue,PromptVariableValues:()=>L,ResourceNotFoundException:()=>S,ResponseStream:()=>te,ResponseStreamFilterSensitiveLog:()=>ce,ServiceQuotaExceededException:()=>_,ServiceUnavailableException:()=>Y,StopReason:()=>H,SystemContentBlock:()=>B,ThrottlingException:()=>A,Tool:()=>q,ToolChoice:()=>U,ToolInputSchema:()=>z,ToolResultContentBlock:()=>P,ToolResultStatus:()=>M,Trace:()=>ee,ValidationException:()=>C});var r=n(31796),i=n(37474);class a extends i.BedrockRuntimeServiceException{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,a.prototype)}}const o={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"};var s;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):t._(e.$unknown[0],e.$unknown[1])}(s||(s={}));const l={INPUT:"INPUT",OUTPUT:"OUTPUT"},u={GUARDRAIL_INTERVENED:"GUARDRAIL_INTERVENED",NONE:"NONE"},c={BLOCKED:"BLOCKED"},d={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},f={HIGH:"HIGH",LOW:"LOW",MEDIUM:"MEDIUM",NONE:"NONE"},p={HATE:"HATE",INSULTS:"INSULTS",MISCONDUCT:"MISCONDUCT",PROMPT_ATTACK:"PROMPT_ATTACK",SEXUAL:"SEXUAL",VIOLENCE:"VIOLENCE"},h={BLOCKED:"BLOCKED",NONE:"NONE"},g={GROUNDING:"GROUNDING",RELEVANCE:"RELEVANCE"},m={ANONYMIZED:"ANONYMIZED",BLOCKED:"BLOCKED"},y={ADDRESS:"ADDRESS",AGE:"AGE",AWS_ACCESS_KEY:"AWS_ACCESS_KEY",AWS_SECRET_KEY:"AWS_SECRET_KEY",CA_HEALTH_NUMBER:"CA_HEALTH_NUMBER",CA_SOCIAL_INSURANCE_NUMBER:"CA_SOCIAL_INSURANCE_NUMBER",CREDIT_DEBIT_CARD_CVV:"CREDIT_DEBIT_CARD_CVV",CREDIT_DEBIT_CARD_EXPIRY:"CREDIT_DEBIT_CARD_EXPIRY",CREDIT_DEBIT_CARD_NUMBER:"CREDIT_DEBIT_CARD_NUMBER",DRIVER_ID:"DRIVER_ID",EMAIL:"EMAIL",INTERNATIONAL_BANK_ACCOUNT_NUMBER:"INTERNATIONAL_BANK_ACCOUNT_NUMBER",IP_ADDRESS:"IP_ADDRESS",LICENSE_PLATE:"LICENSE_PLATE",MAC_ADDRESS:"MAC_ADDRESS",NAME:"NAME",PASSWORD:"PASSWORD",PHONE:"PHONE",PIN:"PIN",SWIFT_CODE:"SWIFT_CODE",UK_NATIONAL_HEALTH_SERVICE_NUMBER:"UK_NATIONAL_HEALTH_SERVICE_NUMBER",UK_NATIONAL_INSURANCE_NUMBER:"UK_NATIONAL_INSURANCE_NUMBER",UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER:"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",URL:"URL",USERNAME:"USERNAME",US_BANK_ACCOUNT_NUMBER:"US_BANK_ACCOUNT_NUMBER",US_BANK_ROUTING_NUMBER:"US_BANK_ROUTING_NUMBER",US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER:"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",US_PASSPORT_NUMBER:"US_PASSPORT_NUMBER",US_SOCIAL_SECURITY_NUMBER:"US_SOCIAL_SECURITY_NUMBER",VEHICLE_IDENTIFICATION_NUMBER:"VEHICLE_IDENTIFICATION_NUMBER"},v={BLOCKED:"BLOCKED"},b={DENY:"DENY"},w={BLOCKED:"BLOCKED"},x={PROFANITY:"PROFANITY"};class E extends i.BedrockRuntimeServiceException{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,E.prototype)}}class S extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}class _ extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e}),this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,_.prototype)}}class A extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ThrottlingException",$fault:"client",...e}),this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,A.prototype)}}class C extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ValidationException",$fault:"client",...e}),this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,C.prototype)}}const T={DISABLED:"disabled",ENABLED:"enabled"},k={CSV:"csv",DOC:"doc",DOCX:"docx",HTML:"html",MD:"md",PDF:"pdf",TXT:"txt",XLS:"xls",XLSX:"xlsx"};var R;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(R||(R={}));const D={GROUNDING_SOURCE:"grounding_source",GUARD_CONTENT:"guard_content",QUERY:"query"};var O;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):t._(e.$unknown[0],e.$unknown[1])}(O||(O={}));const N={GIF:"gif",JPEG:"jpeg",PNG:"png",WEBP:"webp"};var F,P;!function(e){e.visit=(e,t)=>void 0!==e.bytes?t.bytes(e.bytes):t._(e.$unknown[0],e.$unknown[1])}(F||(F={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):t._(e.$unknown[0],e.$unknown[1])}(P||(P={}));const M={ERROR:"error",SUCCESS:"success"};var I;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.image?t.image(e.image):void 0!==e.document?t.document(e.document):void 0!==e.toolUse?t.toolUse(e.toolUse):void 0!==e.toolResult?t.toolResult(e.toolResult):void 0!==e.guardContent?t.guardContent(e.guardContent):t._(e.$unknown[0],e.$unknown[1])}(I||(I={}));const $={ASSISTANT:"assistant",USER:"user"};var L,B,U,z,q,j;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):t._(e.$unknown[0],e.$unknown[1])}(L||(L={})),function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.guardContent?t.guardContent(e.guardContent):t._(e.$unknown[0],e.$unknown[1])}(B||(B={})),function(e){e.visit=(e,t)=>void 0!==e.auto?t.auto(e.auto):void 0!==e.any?t.any(e.any):void 0!==e.tool?t.tool(e.tool):t._(e.$unknown[0],e.$unknown[1])}(U||(U={})),function(e){e.visit=(e,t)=>void 0!==e.json?t.json(e.json):t._(e.$unknown[0],e.$unknown[1])}(z||(z={})),function(e){e.visit=(e,t)=>void 0!==e.toolSpec?t.toolSpec(e.toolSpec):t._(e.$unknown[0],e.$unknown[1])}(q||(q={})),function(e){e.visit=(e,t)=>void 0!==e.message?t.message(e.message):t._(e.$unknown[0],e.$unknown[1])}(j||(j={}));const H={CONTENT_FILTERED:"content_filtered",END_TURN:"end_turn",GUARDRAIL_INTERVENED:"guardrail_intervened",MAX_TOKENS:"max_tokens",STOP_SEQUENCE:"stop_sequence",TOOL_USE:"tool_use"};class G extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ModelErrorException",$fault:"client",...e}),this.name="ModelErrorException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}}class V extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e}),this.name="ModelNotReadyException",this.$fault="client",this.$retryable={},Object.setPrototypeOf(this,V.prototype)}}class W extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e}),this.name="ModelTimeoutException",this.$fault="client",Object.setPrototypeOf(this,W.prototype)}}class Y extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e}),this.name="ServiceUnavailableException",this.$fault="server",Object.setPrototypeOf(this,Y.prototype)}}const X={ASYNC:"async",SYNC:"sync"};var K,J,Q;!function(e){e.visit=(e,t)=>void 0!==e.text?t.text(e.text):void 0!==e.toolUse?t.toolUse(e.toolUse):t._(e.$unknown[0],e.$unknown[1])}(K||(K={})),function(e){e.visit=(e,t)=>void 0!==e.toolUse?t.toolUse(e.toolUse):t._(e.$unknown[0],e.$unknown[1])}(J||(J={}));class Z extends i.BedrockRuntimeServiceException{constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e}),this.name="ModelStreamErrorException",this.$fault="client",Object.setPrototypeOf(this,Z.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}}!function(e){e.visit=(e,t)=>void 0!==e.messageStart?t.messageStart(e.messageStart):void 0!==e.contentBlockStart?t.contentBlockStart(e.contentBlockStart):void 0!==e.contentBlockDelta?t.contentBlockDelta(e.contentBlockDelta):void 0!==e.contentBlockStop?t.contentBlockStop(e.contentBlockStop):void 0!==e.messageStop?t.messageStop(e.messageStop):void 0!==e.metadata?t.metadata(e.metadata):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(Q||(Q={}));const ee={DISABLED:"DISABLED",ENABLED:"ENABLED"};var te;!function(e){e.visit=(e,t)=>void 0!==e.chunk?t.chunk(e.chunk):void 0!==e.internalServerException?t.internalServerException(e.internalServerException):void 0!==e.modelStreamErrorException?t.modelStreamErrorException(e.modelStreamErrorException):void 0!==e.validationException?t.validationException(e.validationException):void 0!==e.throttlingException?t.throttlingException(e.throttlingException):void 0!==e.modelTimeoutException?t.modelTimeoutException(e.modelTimeoutException):void 0!==e.serviceUnavailableException?t.serviceUnavailableException(e.serviceUnavailableException):t._(e.$unknown[0],e.$unknown[1])}(te||(te={}));const ne=e=>({...e,...e.messages&&{messages:e.messages.map((e=>e))},...e.system&&{system:e.system.map((e=>e))},...e.toolConfig&&{toolConfig:e.toolConfig},...e.promptVariables&&{promptVariables:r.SENSITIVE_STRING}}),re=e=>({...e,...e.messages&&{messages:e.messages.map((e=>e))},...e.system&&{system:e.system.map((e=>e))},...e.toolConfig&&{toolConfig:e.toolConfig},...e.promptVariables&&{promptVariables:r.SENSITIVE_STRING}}),ie=e=>void 0!==e.messageStart?{messageStart:e.messageStart}:void 0!==e.contentBlockStart?{contentBlockStart:e.contentBlockStart}:void 0!==e.contentBlockDelta?{contentBlockDelta:e.contentBlockDelta}:void 0!==e.contentBlockStop?{contentBlockStop:e.contentBlockStop}:void 0!==e.messageStop?{messageStop:e.messageStop}:void 0!==e.metadata?{metadata:e.metadata}:void 0!==e.internalServerException?{internalServerException:e.internalServerException}:void 0!==e.modelStreamErrorException?{modelStreamErrorException:e.modelStreamErrorException}:void 0!==e.validationException?{validationException:e.validationException}:void 0!==e.throttlingException?{throttlingException:e.throttlingException}:void 0!==e.serviceUnavailableException?{serviceUnavailableException:e.serviceUnavailableException}:void 0!==e.$unknown?{[e.$unknown[0]]:"UNKNOWN"}:void 0,ae=e=>({...e,...e.stream&&{stream:"STREAMING_CONTENT"}}),oe=e=>({...e,...e.body&&{body:r.SENSITIVE_STRING}}),se=e=>({...e,...e.body&&{body:r.SENSITIVE_STRING}}),le=e=>({...e,...e.body&&{body:r.SENSITIVE_STRING}}),ue=e=>({...e,...e.bytes&&{bytes:r.SENSITIVE_STRING}}),ce=e=>void 0!==e.chunk?{chunk:r.SENSITIVE_STRING}:void 0!==e.internalServerException?{internalServerException:e.internalServerException}:void 0!==e.modelStreamErrorException?{modelStreamErrorException:e.modelStreamErrorException}:void 0!==e.validationException?{validationException:e.validationException}:void 0!==e.throttlingException?{throttlingException:e.throttlingException}:void 0!==e.modelTimeoutException?{modelTimeoutException:e.modelTimeoutException}:void 0!==e.serviceUnavailableException?{serviceUnavailableException:e.serviceUnavailableException}:void 0!==e.$unknown?{[e.$unknown[0]]:"UNKNOWN"}:void 0,de=e=>({...e,...e.body&&{body:"STREAMING_CONTENT"}})},43712:(e,t,n)=>{"use strict";n.r(t),n.d(t,{de_ApplyGuardrailCommand:()=>p,de_ConverseCommand:()=>h,de_ConverseStreamCommand:()=>g,de_InvokeModelCommand:()=>m,de_InvokeModelWithResponseStreamCommand:()=>y,se_ApplyGuardrailCommand:()=>l,se_ConverseCommand:()=>u,se_ConverseStreamCommand:()=>c,se_InvokeModelCommand:()=>d,se_InvokeModelWithResponseStreamCommand:()=>f});var r=n(44445),i=n(40033),a=n(31796),o=n(37474),s=n(285);const l=async(e,t)=>{const n=(0,i.requestBuilder)(e,t);let r;return n.bp("/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply"),n.p("guardrailIdentifier",(()=>e.guardrailIdentifier),"{guardrailIdentifier}",!1),n.p("guardrailVersion",(()=>e.guardrailVersion),"{guardrailVersion}",!1),r=JSON.stringify((0,a.take)(e,{content:e=>(0,a._json)(e),source:[]})),n.m("POST").h({"content-type":"application/json"}).b(r),n.build()},u=async(e,t)=>{const n=(0,i.requestBuilder)(e,t);let r;return n.bp("/model/{modelId}/converse"),n.p("modelId",(()=>e.modelId),"{modelId}",!1),r=JSON.stringify((0,a.take)(e,{additionalModelRequestFields:e=>ie(e,t),additionalModelResponseFieldPaths:e=>(0,a._json)(e),guardrailConfig:e=>(0,a._json)(e),inferenceConfig:e=>K(e,t),messages:e=>J(e,t),promptVariables:e=>(0,a._json)(e),system:e=>(0,a._json)(e),toolConfig:e=>Q(e,t)})),n.m("POST").h({"content-type":"application/json"}).b(r),n.build()},c=async(e,t)=>{const n=(0,i.requestBuilder)(e,t);let r;return n.bp("/model/{modelId}/converse-stream"),n.p("modelId",(()=>e.modelId),"{modelId}",!1),r=JSON.stringify((0,a.take)(e,{additionalModelRequestFields:e=>ie(e,t),additionalModelResponseFieldPaths:e=>(0,a._json)(e),guardrailConfig:e=>(0,a._json)(e),inferenceConfig:e=>K(e,t),messages:e=>J(e,t),promptVariables:e=>(0,a._json)(e),system:e=>(0,a._json)(e),toolConfig:e=>Q(e,t)})),n.m("POST").h({"content-type":"application/json"}).b(r),n.build()},d=async(e,t)=>{const n=(0,i.requestBuilder)(e,t),r=(0,a.map)({},a.isSerializableHeaderValue,{[Te]:e[Ce]||"application/octet-stream",[Ae]:e[Ae],[Me]:e[De],[Fe]:e[ke],[Pe]:e[Re]});let o;return n.bp("/model/{modelId}/invoke"),n.p("modelId",(()=>e.modelId),"{modelId}",!1),void 0!==e.body&&(o=e.body),n.m("POST").h(r).b(o),n.build()},f=async(e,t)=>{const n=(0,i.requestBuilder)(e,t),r=(0,a.map)({},a.isSerializableHeaderValue,{[Te]:e[Ce]||"application/octet-stream",[Oe]:e[Ae],[Me]:e[De],[Fe]:e[ke],[Pe]:e[Re]});let o;return n.bp("/model/{modelId}/invoke-with-response-stream"),n.p("modelId",(()=>e.modelId),"{modelId}",!1),void 0!==e.body&&(o=e.body),n.m("POST").h(r).b(o),n.build()},p=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return v(e,t);const n=(0,a.map)({$metadata:_e(e)}),i=(0,a.expectNonNull)((0,a.expectObject)(await(0,r.parseJsonBody)(e.body,t)),"body"),o=(0,a.take)(i,{action:a.expectString,assessments:e=>fe(e,t),guardrailCoverage:a._json,outputs:a._json,usage:a._json});return Object.assign(n,o),n},h=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return v(e,t);const n=(0,a.map)({$metadata:_e(e)}),i=(0,a.expectNonNull)((0,a.expectObject)(await(0,r.parseJsonBody)(e.body,t)),"body"),o=(0,a.take)(i,{additionalModelResponseFields:e=>Se(e,t),metrics:a._json,output:e=>ae((0,r.awsExpectUnion)(e),t),stopReason:a.expectString,trace:e=>le(e,t),usage:a._json});return Object.assign(n,o),n},g=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return v(e,t);const n=(0,a.map)({$metadata:_e(e)}),r=e.body;return n.stream=O(r,t),n},m=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return v(e,t);const n=(0,a.map)({$metadata:_e(e),[Ce]:[,e.headers[Te]]}),r=await(0,a.collectBody)(e.body,t);return n.body=r,n},y=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return v(e,t);const n=(0,a.map)({$metadata:_e(e),[Ce]:[,e.headers[Ne]]}),r=e.body;return n.body=N(r,t),n},v=async(e,t)=>{const n={...e,body:await(0,r.parseJsonErrorBody)(e.body,t)},i=(0,r.loadRestJsonErrorCode)(e,n.body);switch(i){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await w(n,t);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await x(n,t);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await C(n,t);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await T(n,t);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await R(n,t);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await D(n,t);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await E(n,t);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await S(n,t);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await A(n,t);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await k(n,t);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await _(n,t);default:const r=n.body;return b({output:e,parsedBody:r,errorCode:i})}},b=(0,a.withBaseException)(o.BedrockRuntimeServiceException),w=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.AccessDeniedException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},x=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.InternalServerException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},E=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString,originalStatusCode:a.expectInt32,resourceName:a.expectString});Object.assign(n,i);const o=new s.ModelErrorException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},S=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ModelNotReadyException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},_=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString,originalMessage:a.expectString,originalStatusCode:a.expectInt32});Object.assign(n,i);const o=new s.ModelStreamErrorException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},A=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ModelTimeoutException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},C=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ResourceNotFoundException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},T=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ServiceQuotaExceededException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},k=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ServiceUnavailableException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},R=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ThrottlingException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},D=async(e,t)=>{const n=(0,a.map)({}),r=e.body,i=(0,a.take)(r,{message:a.expectString});Object.assign(n,i);const o=new s.ValidationException({$metadata:_e(e),...n});return(0,a.decorateServiceException)(o,e.body)},O=(e,t)=>t.eventStreamMarshaller.deserialize(e,(async n=>null!=n.messageStart?{messageStart:await L(n.messageStart,t)}:null!=n.contentBlockStart?{contentBlockStart:await P(n.contentBlockStart,t)}:null!=n.contentBlockDelta?{contentBlockDelta:await F(n.contentBlockDelta,t)}:null!=n.contentBlockStop?{contentBlockStop:await M(n.contentBlockStop,t)}:null!=n.messageStop?{messageStop:await B(n.messageStop,t)}:null!=n.metadata?{metadata:await I(n.metadata,t)}:null!=n.internalServerException?{internalServerException:await $(n.internalServerException,t)}:null!=n.modelStreamErrorException?{modelStreamErrorException:await U(n.modelStreamErrorException,t)}:null!=n.validationException?{validationException:await G(n.validationException,t)}:null!=n.throttlingException?{throttlingException:await H(n.throttlingException,t)}:null!=n.serviceUnavailableException?{serviceUnavailableException:await j(n.serviceUnavailableException,t)}:{$unknown:e})),N=(e,t)=>t.eventStreamMarshaller.deserialize(e,(async n=>null!=n.chunk?{chunk:await q(n.chunk,t)}:null!=n.internalServerException?{internalServerException:await $(n.internalServerException,t)}:null!=n.modelStreamErrorException?{modelStreamErrorException:await U(n.modelStreamErrorException,t)}:null!=n.validationException?{validationException:await G(n.validationException,t)}:null!=n.throttlingException?{throttlingException:await H(n.throttlingException,t)}:null!=n.modelTimeoutException?{modelTimeoutException:await z(n.modelTimeoutException,t)}:null!=n.serviceUnavailableException?{serviceUnavailableException:await j(n.serviceUnavailableException,t)}:{$unknown:e})),F=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,(0,a._json)(i)),n},P=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,(0,a._json)(i)),n},M=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,(0,a._json)(i)),n},I=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,oe(i,t)),n},$=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return x(n,t)},L=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,(0,a._json)(i)),n},B=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,ve(i,t)),n},U=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return _(n,t)},z=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return A(n,t)},q=async(e,t)=>{const n={},i=await(0,r.parseJsonBody)(e.body,t);return Object.assign(n,be(i,t)),n},j=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return k(n,t)},H=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return R(n,t)},G=async(e,t)=>{const n={...e,body:await(0,r.parseJsonBody)(e.body,t)};return D(n,t)},V=(e,t)=>(0,a.take)(e,{format:[],name:[],source:e=>W(e,t)}),W=(e,t)=>s.DocumentSource.visit(e,{bytes:e=>({bytes:t.base64Encoder(e)}),_:(e,t)=>({name:t})}),Y=(e,t)=>(0,a.take)(e,{format:[],source:e=>X(e,t)}),X=(e,t)=>s.ImageSource.visit(e,{bytes:e=>({bytes:t.base64Encoder(e)}),_:(e,t)=>({name:t})}),K=(e,t)=>(0,a.take)(e,{maxTokens:[],stopSequences:a._json,temperature:a.serializeFloat,topP:a.serializeFloat}),J=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>(0,a.take)(e,{content:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>s.ContentBlock.visit(e,{document:e=>({document:V(e,t)}),guardContent:e=>({guardContent:(0,a._json)(e)}),image:e=>({image:Y(e,t)}),text:e=>({text:e}),toolResult:e=>({toolResult:Z(e,t)}),toolUse:e=>({toolUse:re(e,t)}),_:(e,t)=>({name:t})}))(e,t))))(e,t),role:[]}))(e,t))),Q=(e,t)=>(0,a.take)(e,{toolChoice:a._json,tools:e=>te(e,t)}),Z=(e,t)=>(0,a.take)(e,{content:e=>ee(e,t),status:[],toolUseId:[]}),ee=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>s.ToolResultContentBlock.visit(e,{document:e=>({document:V(e,t)}),image:e=>({image:Y(e,t)}),json:e=>({json:ie(e,t)}),text:e=>({text:e}),_:(e,t)=>({name:t})}))(e,t))),te=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>s.Tool.visit(e,{toolSpec:e=>({toolSpec:ne(e,t)}),_:(e,t)=>({name:t})}))(e,t))),ne=(e,t)=>(0,a.take)(e,{description:[],inputSchema:e=>((e,t)=>s.ToolInputSchema.visit(e,{json:e=>({json:ie(e,t)}),_:(e,t)=>({name:t})}))(e,t),name:[]}),re=(e,t)=>(0,a.take)(e,{input:e=>ie(e,t),name:[],toolUseId:[]}),ie=(e,t)=>e,ae=(e,t)=>null!=e.message?{message:ye(e.message,t)}:{$unknown:Object.entries(e)[0]},oe=(e,t)=>(0,a.take)(e,{metrics:a._json,trace:e=>se(e,t),usage:a._json}),se=(e,t)=>(0,a.take)(e,{guardrail:e=>he(e,t)}),le=(e,t)=>(0,a.take)(e,{guardrail:e=>he(e,t)}),ue=(e,t)=>(0,a.take)(e,{format:a.expectString,name:a.expectString,source:e=>ce((0,r.awsExpectUnion)(e),t)}),ce=(e,t)=>null!=e.bytes?{bytes:t.base64Decoder(e.bytes)}:{$unknown:Object.entries(e)[0]},de=(e,t)=>(0,a.take)(e,{contentPolicy:a._json,contextualGroundingPolicy:e=>pe(e,t),invocationMetrics:a._json,sensitiveInformationPolicy:a._json,topicPolicy:a._json,wordPolicy:a._json}),fe=(e,t)=>(e||[]).filter((e=>null!=e)).map((e=>de(e,t))),pe=(e,t)=>(0,a.take)(e,{filters:e=>(e=>(e||[]).filter((e=>null!=e)).map((e=>(e=>(0,a.take)(e,{action:a.expectString,score:a.limitedParseDouble,threshold:a.limitedParseDouble,type:a.expectString}))(e))))(e)}),he=(e,t)=>(0,a.take)(e,{inputAssessment:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=de(r,t)),e)),{}))(e,t),modelOutput:a._json,outputAssessments:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=fe(r,t)),e)),{}))(e,t)}),ge=(e,t)=>(0,a.take)(e,{format:a.expectString,source:e=>me((0,r.awsExpectUnion)(e),t)}),me=(e,t)=>null!=e.bytes?{bytes:t.base64Decoder(e.bytes)}:{$unknown:Object.entries(e)[0]},ye=(e,t)=>(0,a.take)(e,{content:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>null!=e.document?{document:ue(e.document,t)}:null!=e.guardContent?{guardContent:(0,a._json)((0,r.awsExpectUnion)(e.guardContent))}:null!=e.image?{image:ge(e.image,t)}:void 0!==(0,a.expectString)(e.text)?{text:(0,a.expectString)(e.text)}:null!=e.toolResult?{toolResult:we(e.toolResult,t)}:null!=e.toolUse?{toolUse:Ee(e.toolUse,t)}:{$unknown:Object.entries(e)[0]})((0,r.awsExpectUnion)(e),t)));return n})(e,t),role:a.expectString}),ve=(e,t)=>(0,a.take)(e,{additionalModelResponseFields:e=>Se(e,t),stopReason:a.expectString}),be=(e,t)=>(0,a.take)(e,{bytes:t.base64Decoder}),we=(e,t)=>(0,a.take)(e,{content:e=>xe(e,t),status:a.expectString,toolUseId:a.expectString}),xe=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>null!=e.document?{document:ue(e.document,t)}:null!=e.image?{image:ge(e.image,t)}:null!=e.json?{json:Se(e.json,t)}:void 0!==(0,a.expectString)(e.text)?{text:(0,a.expectString)(e.text)}:{$unknown:Object.entries(e)[0]})((0,r.awsExpectUnion)(e),t)));return n},Ee=(e,t)=>(0,a.take)(e,{input:e=>Se(e,t),name:a.expectString,toolUseId:a.expectString}),Se=(e,t)=>e,_e=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ae="accept",Ce="contentType",Te="content-type",ke="guardrailIdentifier",Re="guardrailVersion",De="trace",Oe="x-amzn-bedrock-accept",Ne="x-amzn-bedrock-content-type",Fe="x-amzn-bedrock-guardrailidentifier",Pe="x-amzn-bedrock-guardrailversion",Me="x-amzn-bedrock-trace"},47411:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRuntimeConfig:()=>g});var r=n(99960),i=n(25147),a=n(81772),o=n(61329),s=n(9519),l=n(61664),u=n(70913),c=n(25441),d=n(56265),f=n(66042),p=n(31796),h=n(89124);const g=e=>{const t=(0,h.resolveDefaultsModeConfig)(e),n=()=>t().then(p.loadConfigsForDefaultMode),g=(0,f.getRuntimeConfig)(e);return{...g,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??c.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,a.createDefaultUserAgentProvider)({serviceId:g.serviceId,clientVersion:r.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??s.eventStreamSerdeProvider,maxAttempts:e?.maxAttempts??d.DEFAULT_MAX_ATTEMPTS,region:e?.region??(0,u.invalidProvider)("Region is missing"),requestHandler:l.FetchHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||d.DEFAULT_RETRY_MODE),sha256:e?.sha256??i.Sha256,streamCollector:e?.streamCollector??l.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(o.DEFAULT_USE_DUALSTACK_ENDPOINT)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(o.DEFAULT_USE_FIPS_ENDPOINT))}}},66042:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRuntimeConfig:()=>c});var r=n(44445),i=n(31796),a=n(18065),o=n(33470),s=n(14246),l=n(19772),u=n(87010);const c=e=>({apiVersion:"2023-09-30",base64Decoder:e?.base64Decoder??o.fromBase64,base64Encoder:e?.base64Encoder??o.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??u.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??l.defaultBedrockRuntimeHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new r.AwsSdkSigV4Signer}],logger:e?.logger??new i.NoOpLogger,serviceId:e?.serviceId??"Bedrock Runtime",urlParser:e?.urlParser??a.parseUrl,utf8Decoder:e?.utf8Decoder??s.fromUtf8,utf8Encoder:e?.utf8Encoder??s.toUtf8})},52793:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveRuntimeExtensions:()=>s});var r=n(95020),i=n(14065),a=n(31796),o=n(21167);const s=(e,t)=>{const n={...(0,r.getAwsRegionExtensionConfiguration)(e),...(0,a.getDefaultExtensionConfiguration)(e),...(0,i.getHttpHandlerExtensionConfiguration)(e),...(0,o.getHttpAuthExtensionConfiguration)(e)};return t.forEach((e=>e.configure(n))),{...e,...(0,r.resolveAwsRegionExtensionConfiguration)(n),...(0,a.resolveDefaultRuntimeConfig)(n),...(0,i.resolveHttpHandlerRuntimeConfig)(n),...(0,o.resolveHttpAuthRuntimeConfig)(n)}}},44445:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AWSSDKSigV4Signer:()=>i.AWSSDKSigV4Signer,AwsSdkSigV4ASigner:()=>i.AwsSdkSigV4ASigner,AwsSdkSigV4Signer:()=>i.AwsSdkSigV4Signer,NODE_SIGV4A_CONFIG_OPTIONS:()=>i.NODE_SIGV4A_CONFIG_OPTIONS,_toBool:()=>a._toBool,_toNum:()=>a._toNum,_toStr:()=>a._toStr,awsExpectUnion:()=>a.awsExpectUnion,emitWarningIfUnsupportedVersion:()=>r.emitWarningIfUnsupportedVersion,loadRestJsonErrorCode:()=>a.loadRestJsonErrorCode,loadRestXmlErrorCode:()=>a.loadRestXmlErrorCode,parseJsonBody:()=>a.parseJsonBody,parseJsonErrorBody:()=>a.parseJsonErrorBody,parseXmlBody:()=>a.parseXmlBody,parseXmlErrorBody:()=>a.parseXmlErrorBody,resolveAWSSDKSigV4Config:()=>i.resolveAWSSDKSigV4Config,resolveAwsSdkSigV4AConfig:()=>i.resolveAwsSdkSigV4AConfig,resolveAwsSdkSigV4Config:()=>i.resolveAwsSdkSigV4Config,setCredentialFeature:()=>r.setCredentialFeature,setFeature:()=>r.setFeature,state:()=>r.state,validateSigningProperties:()=>i.validateSigningProperties});var r=n(10573),i=n(60304),a=n(62755)},85122:(e,t,n)=>{"use strict";n.r(t),n.d(t,{emitWarningIfUnsupportedVersion:()=>a,state:()=>i});var r=n(65606);const i={warningEmitted:!1},a=e=>{e&&!i.warningEmitted&&parseInt(e.substring(1,e.indexOf(".")))<18&&(i.warningEmitted=!0,r.emitWarning("NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will\nno longer support Node.js 16.x on January 6, 2025.\n\nTo continue receiving updates to AWS services, bug fixes, and security\nupdates please upgrade to a supported Node.js LTS version.\n\nMore information can be found at: https://a.co/74kJMmI"))}},10573:(e,t,n)=>{"use strict";n.r(t),n.d(t,{emitWarningIfUnsupportedVersion:()=>r.emitWarningIfUnsupportedVersion,setCredentialFeature:()=>i.setCredentialFeature,setFeature:()=>a.setFeature,state:()=>r.state});var r=n(85122),i=n(40244),a=n(63415)},40244:(e,t,n)=>{"use strict";function r(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}n.r(t),n.d(t,{setCredentialFeature:()=>r})},63415:(e,t,n)=>{"use strict";function r(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}n.r(t),n.d(t,{setFeature:()=>r})},21006:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AwsSdkSigV4ASigner:()=>o});var r=n(14065),i=n(78626),a=n(77113);class o extends a.AwsSdkSigV4Signer{async sign(e,t,n){if(!r.HttpRequest.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:o,signer:s,signingRegion:l,signingRegionSet:u,signingName:c}=await(0,a.validateSigningProperties)(n),d=(await(o.sigv4aSigningRegionSet?.())??u??[l]).join(",");return await s.sign(e,{signingDate:(0,i.getSkewCorrectedDate)(o.systemClockOffset),signingRegion:d,signingService:c})}}},77113:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AWSSDKSigV4Signer:()=>l,AwsSdkSigV4Signer:()=>s,validateSigningProperties:()=>o});var r=n(14065),i=n(78626);const a=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},o=async e=>{const t=a("context",e.context),n=a("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=a("signer",n.signer),o=await i(r),s=e?.signingRegion,l=e?.signingRegionSet,u=e?.signingName;return{config:n,signer:o,signingRegion:s,signingRegionSet:l,signingName:u}};class s{async sign(e,t,n){if(!r.HttpRequest.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const a=await o(n),{config:s,signer:l}=a;let{signingRegion:u,signingName:c}=a;const d=n.context;if(d?.authSchemes?.length){const[e,t]=d.authSchemes;"sigv4a"===e?.name&&"sigv4"===t?.name&&(u=t?.signingRegion??u,c=t?.signingName??c)}return await l.sign(e,{signingDate:(0,i.getSkewCorrectedDate)(s.systemClockOffset),signingRegion:u,signingService:c})}errorHandler(e){return t=>{const n=t.ServerTime??(0,i.getDateHeader)(t.$response);if(n){const r=a("config",e.config),o=r.systemClockOffset;r.systemClockOffset=(0,i.getUpdatedSystemClockOffset)(n,r.systemClockOffset),r.systemClockOffset!==o&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=(0,i.getDateHeader)(e);if(n){const e=a("config",t.config);e.systemClockOffset=(0,i.getUpdatedSystemClockOffset)(n,e.systemClockOffset)}}}const l=s},909:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AWSSDKSigV4Signer:()=>r.AWSSDKSigV4Signer,AwsSdkSigV4ASigner:()=>i.AwsSdkSigV4ASigner,AwsSdkSigV4Signer:()=>r.AwsSdkSigV4Signer,NODE_SIGV4A_CONFIG_OPTIONS:()=>a.NODE_SIGV4A_CONFIG_OPTIONS,resolveAWSSDKSigV4Config:()=>o.resolveAWSSDKSigV4Config,resolveAwsSdkSigV4AConfig:()=>a.resolveAwsSdkSigV4AConfig,resolveAwsSdkSigV4Config:()=>o.resolveAwsSdkSigV4Config,validateSigningProperties:()=>r.validateSigningProperties});var r=n(77113),i=n(21006),a=n(1942),o=n(25669)},1942:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_SIGV4A_CONFIG_OPTIONS:()=>o,resolveAwsSdkSigV4AConfig:()=>a});var r=n(40033),i=n(10223);const a=e=>(e.sigv4aSigningRegionSet=(0,r.normalizeProvider)(e.sigv4aSigningRegionSet),e),o={environmentVariableSelector(e){if(e.AWS_SIGV4A_SIGNING_REGION_SET)return e.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((e=>e.trim()));throw new i.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(e){if(e.sigv4a_signing_region_set)return(e.sigv4a_signing_region_set??"").split(",").map((e=>e.trim()));throw new i.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0}},25669:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveAWSSDKSigV4Config:()=>s,resolveAwsSdkSigV4Config:()=>o});var r=n(10573),i=n(40033),a=n(82505);const o=e=>{let t,n=!1;e.credentials&&(n=!0,t=(0,i.memoizeIdentityProvider)(e.credentials,i.isIdentityExpired,i.doesIdentityRequireRefresh)),t||(t=e.credentialDefaultProvider?(0,i.normalizeProvider)(e.credentialDefaultProvider(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("`credentials` is missing")});const{signingEscapePath:o=!0,systemClockOffset:s=e.systemClockOffset||0,sha256:l}=e;let u;return u=e.signer?(0,i.normalizeProvider)(e.signer):e.regionInfoProvider?()=>(0,i.normalizeProvider)(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([n,r])=>{const{signingRegion:i,signingService:s}=n;e.signingRegion=e.signingRegion||i||r,e.signingName=e.signingName||s||e.serviceId;const u={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:o};return new(e.signerConstructor||a.SignatureV4)(u)})):async n=>{const r=(n=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await(0,i.normalizeProvider)(e.region)(),properties:{}},n)).signingRegion,s=n.signingName;e.signingRegion=e.signingRegion||r,e.signingName=e.signingName||s||e.serviceId;const u={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:o};return new(e.signerConstructor||a.SignatureV4)(u)},{...e,systemClockOffset:s,signingEscapePath:o,credentials:n?async()=>t().then((e=>(0,r.setCredentialFeature)(e,"CREDENTIALS_CODE","e"))):t,signer:u}},s=o},60304:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AWSSDKSigV4Signer:()=>r.AWSSDKSigV4Signer,AwsSdkSigV4ASigner:()=>r.AwsSdkSigV4ASigner,AwsSdkSigV4Signer:()=>r.AwsSdkSigV4Signer,NODE_SIGV4A_CONFIG_OPTIONS:()=>r.NODE_SIGV4A_CONFIG_OPTIONS,resolveAWSSDKSigV4Config:()=>r.resolveAWSSDKSigV4Config,resolveAwsSdkSigV4AConfig:()=>r.resolveAwsSdkSigV4AConfig,resolveAwsSdkSigV4Config:()=>r.resolveAwsSdkSigV4Config,validateSigningProperties:()=>r.validateSigningProperties});var r=n(909)},54171:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDateHeader:()=>i});var r=n(14065);const i=e=>r.HttpResponse.isInstance(e)?e.headers?.date??e.headers?.Date:void 0},60369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getSkewCorrectedDate:()=>r});const r=e=>new Date(Date.now()+e)},42153:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getUpdatedSystemClockOffset:()=>i});var r=n(98895);const i=(e,t)=>{const n=Date.parse(e);return(0,r.isClockSkewed)(n,t)?n-Date.now():t}},78626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDateHeader:()=>r.getDateHeader,getSkewCorrectedDate:()=>i.getSkewCorrectedDate,getUpdatedSystemClockOffset:()=>a.getUpdatedSystemClockOffset});var r=n(54171),i=n(60369),a=n(42153)},98895:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isClockSkewed:()=>i});var r=n(60369);const i=(e,t)=>Math.abs((0,r.getSkewCorrectedDate)(t).getTime()-e)>=3e5},22341:(e,t,n)=>{"use strict";n.r(t),n.d(t,{_toBool:()=>i,_toNum:()=>a,_toStr:()=>r});const r=e=>{if(null==e)return e;if("number"==typeof e||"bigint"==typeof e){const t=new Error(`Received number ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}if("boolean"==typeof e){const t=new Error(`Received boolean ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}return e},i=e=>{if(null==e)return e;if("string"==typeof e){const t=e.toLowerCase();if(""!==e&&"false"!==t&&"true"!==t){const t=new Error(`Received string "${e}" where a boolean was expected.`);t.name="Warning",console.warn(t)}return""!==e&&"false"!==t}return e},a=e=>{if(null==e)return e;if("string"==typeof e){const t=Number(e);if(t.toString()!==e){const t=new Error(`Received string "${e}" where a number was expected.`);return t.name="Warning",console.warn(t),e}return t}return e}},68218:(e,t,n)=>{"use strict";n.r(t),n.d(t,{collectBodyString:()=>i});var r=n(31796);const i=(e,t)=>(0,r.collectBody)(e,t).then((e=>t.utf8Encoder(e)))},62755:(e,t,n)=>{"use strict";n.r(t),n.d(t,{_toBool:()=>r._toBool,_toNum:()=>r._toNum,_toStr:()=>r._toStr,awsExpectUnion:()=>i.awsExpectUnion,loadRestJsonErrorCode:()=>a.loadRestJsonErrorCode,loadRestXmlErrorCode:()=>o.loadRestXmlErrorCode,parseJsonBody:()=>a.parseJsonBody,parseJsonErrorBody:()=>a.parseJsonErrorBody,parseXmlBody:()=>o.parseXmlBody,parseXmlErrorBody:()=>o.parseXmlErrorBody});var r=n(22341),i=n(54475),a=n(21919),o=n(15469)},54475:(e,t,n)=>{"use strict";n.r(t),n.d(t,{awsExpectUnion:()=>i});var r=n(31796);const i=e=>{if(null!=e)return"object"==typeof e&&"__type"in e&&delete e.__type,(0,r.expectUnion)(e)}},21919:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadRestJsonErrorCode:()=>o,parseJsonBody:()=>i,parseJsonErrorBody:()=>a});var r=n(68218);const i=(e,t)=>(0,r.collectBodyString)(e,t).then((e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}})),a=async(e,t)=>{const n=await i(e,t);return n.message=n.message??n.Message,n},o=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(i=e.headers,Object.keys(i).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var i;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0}},15469:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadRestXmlErrorCode:()=>l,parseXmlBody:()=>o,parseXmlErrorBody:()=>s});var r=n(31796),i=n(86454),a=n(68218);const o=(e,t)=>(0,a.collectBodyString)(e,t).then((e=>{if(e.length){const t=new i.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});let n;t.addEntity("#xD","\r"),t.addEntity("#10","\n");try{n=t.parse(e,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const a="#text",o=Object.keys(n)[0],s=n[o];return s[a]&&(s[o]=s[a],delete s[a]),(0,r.getValueFromTextNode)(s)}return{}})),s=async(e,t)=>{const n=await o(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},l=(e,t)=>void 0!==t?.Error?.Code?t.Error.Code:void 0!==t?.Code?t.Code:404==e.statusCode?"NotFound":void 0},81095:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHostHeaderPlugin:()=>s,hostHeaderMiddleware:()=>a,hostHeaderMiddlewareOptions:()=>o,resolveHostHeaderConfig:()=>i});var r=n(14065);function i(e){return e}const a=e=>t=>async n=>{if(!r.HttpRequest.isInstance(n.request))return t(n);const{request:i}=n,{handlerProtocol:a=""}=e.requestHandler.metadata||{};if(a.indexOf("h2")>=0&&!i.headers[":authority"])delete i.headers.host,i.headers[":authority"]=i.hostname+(i.port?":"+i.port:"");else if(!i.headers.host){let e=i.hostname;null!=i.port&&(e+=`:${i.port}`),i.headers.host=e}return t(n)},o={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},s=e=>({applyToStack:t=>{t.add(a(e),o)}})},50165:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getLoggerPlugin:()=>r.getLoggerPlugin,loggerMiddleware:()=>r.loggerMiddleware,loggerMiddlewareOptions:()=>r.loggerMiddlewareOptions});var r=n(77813)},77813:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getLoggerPlugin:()=>a,loggerMiddleware:()=>r,loggerMiddlewareOptions:()=>i});const r=()=>(e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:a,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=s,c=l??t.inputFilterSensitiveLog,d=u??t.outputFilterSensitiveLog,{$metadata:f,...p}=r.output;return o?.info?.({clientName:i,commandName:a,input:c(n.input),output:d(p),metadata:f}),r}catch(e){const{clientName:r,commandName:i,logger:a,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:s}=o,l=s??t.inputFilterSensitiveLog;throw a?.error?.({clientName:r,commandName:i,input:l(n.input),error:e,metadata:e.$metadata}),e}},i={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},a=e=>({applyToStack:e=>{e.add(r(),i)}})},48377:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addRecursionDetectionMiddlewareOptions:()=>s,getRecursionDetectionPlugin:()=>l,recursionDetectionMiddleware:()=>o});var r=n(14065),i=n(65606);const a="X-Amzn-Trace-Id",o=e=>t=>async n=>{const{request:o}=n;if(!r.HttpRequest.isInstance(o)||"node"!==e.runtime||o.headers.hasOwnProperty(a))return t(n);const s=i.env.AWS_LAMBDA_FUNCTION_NAME,l=i.env._X_AMZN_TRACE_ID,u=e=>"string"==typeof e&&e.length>0;return u(s)&&u(l)&&(o.headers[a]=l),t({...n,request:o})},s={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},l=e=>({applyToStack:t=>{t.add(o(e),s)}})},63684:(e,t,n)=>{"use strict";n.r(t),n.d(t,{checkFeatures:()=>a});var r=n(44445);const i=/\d{12}\.ddb/;async function a(e,t,n){const a=n.request;if("rpc-v2-cbor"===a?.headers?.["smithy-protocol"]&&(0,r.setFeature)(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();"function"==typeof n.acquireInitialRetryToken?n.constructor?.name?.includes("Adaptive")?(0,r.setFeature)(e,"RETRY_MODE_ADAPTIVE","F"):(0,r.setFeature)(e,"RETRY_MODE_STANDARD","E"):(0,r.setFeature)(e,"RETRY_MODE_LEGACY","D")}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(i)&&(0,r.setFeature)(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":(0,r.setFeature)(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":(0,r.setFeature)(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":(0,r.setFeature)(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const o=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(o?.$source){const t=o;t.accountId&&(0,r.setFeature)(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,i]of Object.entries(t.$source??{}))(0,r.setFeature)(e,n,i)}}},97287:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_UA_APP_ID:()=>i,resolveUserAgentConfig:()=>a});var r=n(40033);const i=void 0;function a(e){const t=(0,r.normalizeProvider)(e.userAgentAppId??i);return{...e,customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}}}},36883:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SPACE:()=>a,UA_ESCAPE_CHAR:()=>u,UA_NAME_ESCAPE_REGEX:()=>s,UA_NAME_SEPARATOR:()=>o,UA_VALUE_ESCAPE_REGEX:()=>l,USER_AGENT:()=>r,X_AMZ_USER_AGENT:()=>i});const r="user-agent",i="x-amz-user-agent",a=" ",o="/",s=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,l=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,u="-"},59240:(e,t,n)=>{"use strict";n.r(t),n.d(t,{encodeFeatures:()=>i});const r=1024;function i(e){let t="";for(const n in e){const i=e[n];if(!(t.length+i.length+1<=r))break;t.length?t+=","+i:t+=i}return t}},44130:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_UA_APP_ID:()=>r.DEFAULT_UA_APP_ID,getUserAgentMiddlewareOptions:()=>i.getUserAgentMiddlewareOptions,getUserAgentPlugin:()=>i.getUserAgentPlugin,resolveUserAgentConfig:()=>r.resolveUserAgentConfig,userAgentMiddleware:()=>i.userAgentMiddleware});var r=n(97287),i=n(41576)},41576:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getUserAgentMiddlewareOptions:()=>c,getUserAgentPlugin:()=>d,userAgentMiddleware:()=>l});var r=n(95417),i=n(14065),a=n(63684),o=n(36883),s=n(59240);const l=e=>(t,n)=>async l=>{const{request:c}=l;if(!i.HttpRequest.isInstance(c))return t(l);const{headers:d}=c,f=n?.userAgent?.map(u)||[],p=(await e.defaultUserAgentProvider()).map(u);await(0,a.checkFeatures)(n,e,l);const h=n;p.push(`m/${(0,s.encodeFeatures)(Object.assign({},n.__smithy_context?.features,h.__aws_sdk_context?.features))}`);const g=e?.customUserAgent?.map(u)||[],m=await e.userAgentAppId();m&&p.push(u([`app/${m}`]));const y=(0,r.getUserAgentPrefix)(),v=(y?[y]:[]).concat([...p,...f,...g]).join(o.SPACE),b=[...p.filter((e=>e.startsWith("aws-sdk-"))),...g].join(o.SPACE);return"browser"!==e.runtime?(b&&(d[o.X_AMZ_USER_AGENT]=d[o.X_AMZ_USER_AGENT]?`${d[o.USER_AGENT]} ${b}`:b),d[o.USER_AGENT]=v):d[o.X_AMZ_USER_AGENT]=v,t({...l,request:c})},u=e=>{const t=e[0].split(o.UA_NAME_SEPARATOR).map((e=>e.replace(o.UA_NAME_ESCAPE_REGEX,o.UA_ESCAPE_CHAR))).join(o.UA_NAME_SEPARATOR),n=e[1]?.replace(o.UA_VALUE_ESCAPE_REGEX,o.UA_ESCAPE_CHAR),r=t.indexOf(o.UA_NAME_SEPARATOR),i=t.substring(0,r);let a=t.substring(r+1);return"api"===i&&(a=a.toLowerCase()),[i,a,n].filter((e=>e&&e.length>0)).reduce(((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}}),"")},c={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},d=e=>({applyToStack:t=>{t.add(l(e),c)}})},24163:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAwsRegionExtensionConfiguration:()=>r,resolveAwsRegionExtensionConfiguration:()=>i});const r=e=>{let t=async()=>{if(void 0===e.region)throw new Error("Region is missing from runtimeConfig");const t=e.region;return"string"==typeof t?t:t()};return{setRegion(e){t=e},region:()=>t}},i=e=>({region:e.region()})},95020:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>i.NODE_REGION_CONFIG_FILE_OPTIONS,NODE_REGION_CONFIG_OPTIONS:()=>i.NODE_REGION_CONFIG_OPTIONS,REGION_ENV_NAME:()=>i.REGION_ENV_NAME,REGION_INI_NAME:()=>i.REGION_INI_NAME,getAwsRegionExtensionConfiguration:()=>r.getAwsRegionExtensionConfiguration,resolveAwsRegionExtensionConfiguration:()=>r.resolveAwsRegionExtensionConfiguration,resolveRegionConfig:()=>i.resolveRegionConfig});var r=n(24163),i=n(20207)},8677:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>o,NODE_REGION_CONFIG_OPTIONS:()=>a,REGION_ENV_NAME:()=>r,REGION_INI_NAME:()=>i});const r="AWS_REGION",i="region",a={environmentVariableSelector:e=>e[r],configFileSelector:e=>e[i],default:()=>{throw new Error("Region is missing")}},o={preferredFile:"credentials"}},91663:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRealRegion:()=>i});var r=n(21615);const i=e=>(0,r.isFipsRegion)(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},20207:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>r.NODE_REGION_CONFIG_FILE_OPTIONS,NODE_REGION_CONFIG_OPTIONS:()=>r.NODE_REGION_CONFIG_OPTIONS,REGION_ENV_NAME:()=>r.REGION_ENV_NAME,REGION_INI_NAME:()=>r.REGION_INI_NAME,resolveRegionConfig:()=>i.resolveRegionConfig});var r=n(8677),i=n(66277)},21615:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isFipsRegion:()=>r});const r=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},66277:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveRegionConfig:()=>a});var r=n(91663),i=n(21615);const a=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if("string"==typeof t)return(0,r.getRealRegion)(t);const e=await t();return(0,r.getRealRegion)(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!(0,i.isFipsRegion)(e)||("function"!=typeof n?Promise.resolve(!!n):n())}}}},63560:(e,t,n)=>{"use strict";n.r(t),n.d(t,{awsEndpointFunctions:()=>s});var r=n(7069),i=n(28110),a=n(26169),o=n(73205);const s={isVirtualHostableS3Bucket:i.isVirtualHostableS3Bucket,parseArn:a.parseArn,partition:o.partition};r.customEndpointFunctions.aws=s},95417:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointError:()=>s.EndpointError,awsEndpointFunctions:()=>r.awsEndpointFunctions,getUserAgentPrefix:()=>i.getUserAgentPrefix,isIpAddress:()=>a.isIpAddress,partition:()=>i.partition,resolveEndpoint:()=>o.resolveEndpoint,setPartitionInfo:()=>i.setPartitionInfo,useDefaultPartitionInfo:()=>i.useDefaultPartitionInfo});var r=n(63560),i=n(73205),a=n(42150),o=n(59996),s=n(66367)},28110:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isVirtualHostableS3Bucket:()=>a});var r=n(7069),i=n(42150);const a=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!a(t))return!1;return!0}return!(!(0,r.isValidHostLabel)(e)||e.length<3||e.length>63||e!==e.toLowerCase()||(0,i.isIpAddress)(e))}},26169:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseArn:()=>r});const r=e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,i,a,o,...s]=t;return"arn"!==n||""===r||""===i||""===s.join(":")?null:{partition:r,service:i,region:a,accountId:o,resourceId:s.map((e=>e.split("/"))).flat()}}},73205:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getUserAgentPrefix:()=>u,partition:()=>o,setPartitionInfo:()=>s,useDefaultPartitionInfo:()=>l});var r=n(4787);let i=r,a="";const o=e=>{const{partitions:t}=i;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find((e=>"aws"===e.id));if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},s=(e,t="")=>{i=e,a=t},l=()=>{s(r,"")},u=()=>a},42150:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isIpAddress:()=>r.isIpAddress});var r=n(7069)},59996:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEndpoint:()=>r.resolveEndpoint});var r=n(7069)},43090:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointError:()=>r.EndpointError});var r=n(7069)},85767:(e,t,n)=>{"use strict";n.r(t)},73904:(e,t,n)=>{"use strict";n.r(t)},7234:(e,t,n)=>{"use strict";n.r(t)},16882:(e,t,n)=>{"use strict";n.r(t)},66367:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointError:()=>r.EndpointError});var r=n(43090);n(85767),n(73904),n(7234),n(16882),n(8890)},8890:(e,t,n)=>{"use strict";n.r(t)},77226:(e,t,n)=>{"use strict";n.r(t),n.d(t,{locateWindow:()=>i});const r={};function i(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}},81772:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createDefaultUserAgentProvider:()=>a,defaultUserAgent:()=>o});var r=n(46880),i=n.n(r);const a=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window&&window?.navigator?.userAgent?i().parse(window.navigator.userAgent):void 0,a=[["aws-sdk-js",t],["ua","2.1"],[`os/${r?.os?.name||"other"}`,r?.os?.version],["lang/js"],["md/browser",`${r?.browser?.name??"unknown"}_${r?.browser?.version??"unknown"}`]];e&&a.push([`api/${e}`,t]);const o=await(n?.userAgentAppId?.());return o&&a.push([`app/${o}`]),a},o=a},22184:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONFIG_USE_DUALSTACK_ENDPOINT:()=>a,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>o,ENV_USE_DUALSTACK_ENDPOINT:()=>i,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>s});var r=n(20235);const i="AWS_USE_DUALSTACK_ENDPOINT",a="use_dualstack_endpoint",o=!1,s={environmentVariableSelector:e=>(0,r.booleanSelector)(e,i,r.SelectorType.ENV),configFileSelector:e=>(0,r.booleanSelector)(e,a,r.SelectorType.CONFIG),default:!1}},24570:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONFIG_USE_FIPS_ENDPOINT:()=>a,DEFAULT_USE_FIPS_ENDPOINT:()=>o,ENV_USE_FIPS_ENDPOINT:()=>i,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>s});var r=n(20235);const i="AWS_USE_FIPS_ENDPOINT",a="use_fips_endpoint",o=!1,s={environmentVariableSelector:e=>(0,r.booleanSelector)(e,i,r.SelectorType.ENV),configFileSelector:e=>(0,r.booleanSelector)(e,a,r.SelectorType.CONFIG),default:!1}},77918:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONFIG_USE_DUALSTACK_ENDPOINT:()=>r.CONFIG_USE_DUALSTACK_ENDPOINT,CONFIG_USE_FIPS_ENDPOINT:()=>i.CONFIG_USE_FIPS_ENDPOINT,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>r.DEFAULT_USE_DUALSTACK_ENDPOINT,DEFAULT_USE_FIPS_ENDPOINT:()=>i.DEFAULT_USE_FIPS_ENDPOINT,ENV_USE_DUALSTACK_ENDPOINT:()=>r.ENV_USE_DUALSTACK_ENDPOINT,ENV_USE_FIPS_ENDPOINT:()=>i.ENV_USE_FIPS_ENDPOINT,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>i.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,resolveCustomEndpointsConfig:()=>a.resolveCustomEndpointsConfig,resolveEndpointsConfig:()=>o.resolveEndpointsConfig});var r=n(22184),i=n(24570),a=n(93741),o=n(27392)},93741:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveCustomEndpointsConfig:()=>i});var r=n(40805);const i=e=>{const{endpoint:t,urlParser:n}=e;return{...e,tls:e.tls??!0,endpoint:(0,r.normalizeProvider)("string"==typeof t?n(t):t),isCustomEndpoint:!0,useDualstackEndpoint:(0,r.normalizeProvider)(e.useDualstackEndpoint??!1)}}},27392:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEndpointsConfig:()=>a});var r=n(40805),i=n(12621);const a=e=>{const t=(0,r.normalizeProvider)(e.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:a,urlParser:o}=e;return{...e,tls:e.tls??!0,endpoint:n?(0,r.normalizeProvider)("string"==typeof n?o(n):n):()=>(0,i.getEndpointFromRegion)({...e,useDualstackEndpoint:t,useFipsEndpoint:a}),isCustomEndpoint:!!n,useDualstackEndpoint:t}}},12621:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointFromRegion:()=>r});const r=async e=>{const{tls:t=!0}=e,n=await e.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw new Error("Invalid region in client config");const r=await e.useDualstackEndpoint(),i=await e.useFipsEndpoint(),{hostname:a}=await e.regionInfoProvider(n,{useDualstackEndpoint:r,useFipsEndpoint:i})??{};if(!a)throw new Error("Cannot resolve hostname from client config");return e.urlParser(`${t?"https:":"http:"}//${a}`)}},61329:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONFIG_USE_DUALSTACK_ENDPOINT:()=>r.CONFIG_USE_DUALSTACK_ENDPOINT,CONFIG_USE_FIPS_ENDPOINT:()=>r.CONFIG_USE_FIPS_ENDPOINT,DEFAULT_USE_DUALSTACK_ENDPOINT:()=>r.DEFAULT_USE_DUALSTACK_ENDPOINT,DEFAULT_USE_FIPS_ENDPOINT:()=>r.DEFAULT_USE_FIPS_ENDPOINT,ENV_USE_DUALSTACK_ENDPOINT:()=>r.ENV_USE_DUALSTACK_ENDPOINT,ENV_USE_FIPS_ENDPOINT:()=>r.ENV_USE_FIPS_ENDPOINT,NODE_REGION_CONFIG_FILE_OPTIONS:()=>i.NODE_REGION_CONFIG_FILE_OPTIONS,NODE_REGION_CONFIG_OPTIONS:()=>i.NODE_REGION_CONFIG_OPTIONS,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:()=>r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:()=>r.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,REGION_ENV_NAME:()=>i.REGION_ENV_NAME,REGION_INI_NAME:()=>i.REGION_INI_NAME,getRegionInfo:()=>a.getRegionInfo,resolveCustomEndpointsConfig:()=>r.resolveCustomEndpointsConfig,resolveEndpointsConfig:()=>r.resolveEndpointsConfig,resolveRegionConfig:()=>i.resolveRegionConfig});var r=n(77918),i=n(74800),a=n(69402)},54836:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>o,NODE_REGION_CONFIG_OPTIONS:()=>a,REGION_ENV_NAME:()=>r,REGION_INI_NAME:()=>i});const r="AWS_REGION",i="region",a={environmentVariableSelector:e=>e[r],configFileSelector:e=>e[i],default:()=>{throw new Error("Region is missing")}},o={preferredFile:"credentials"}},11168:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRealRegion:()=>i});var r=n(43154);const i=e=>(0,r.isFipsRegion)(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},74800:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>r.NODE_REGION_CONFIG_FILE_OPTIONS,NODE_REGION_CONFIG_OPTIONS:()=>r.NODE_REGION_CONFIG_OPTIONS,REGION_ENV_NAME:()=>r.REGION_ENV_NAME,REGION_INI_NAME:()=>r.REGION_INI_NAME,resolveRegionConfig:()=>i.resolveRegionConfig});var r=n(54836),i=n(66658)},43154:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isFipsRegion:()=>r});const r=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},66658:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveRegionConfig:()=>a});var r=n(11168),i=n(43154);const a=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if("string"==typeof t)return(0,r.getRealRegion)(t);const e=await t();return(0,r.getRealRegion)(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!(0,i.isFipsRegion)(e)||("function"!=typeof n?Promise.resolve(!!n):n())}}}},49028:(e,t,n)=>{"use strict";n.r(t)},2024:(e,t,n)=>{"use strict";n.r(t)},77053:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHostnameFromVariants:()=>r});const r=(e=[],{useFipsEndpoint:t,useDualstackEndpoint:n})=>e.find((({tags:e})=>t===e.includes("fips")&&n===e.includes("dualstack")))?.hostname},68374:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRegionInfo:()=>s});var r=n(77053),i=n(35675),a=n(49962),o=n(79391);const s=(e,{useFipsEndpoint:t=!1,useDualstackEndpoint:n=!1,signingService:s,regionHash:l,partitionHash:u})=>{const c=(0,a.getResolvedPartition)(e,{partitionHash:u}),d=e in l?e:u[c]?.endpoint??e,f={useFipsEndpoint:t,useDualstackEndpoint:n},p=(0,r.getHostnameFromVariants)(l[d]?.variants,f),h=(0,r.getHostnameFromVariants)(u[c]?.variants,f),g=(0,i.getResolvedHostname)(d,{regionHostname:p,partitionHostname:h});if(void 0===g)throw new Error(`Endpoint resolution failed for: ${{resolvedRegion:d,useFipsEndpoint:t,useDualstackEndpoint:n}}`);const m=(0,o.getResolvedSigningRegion)(g,{signingRegion:l[d]?.signingRegion,regionRegex:u[c].regionRegex,useFipsEndpoint:t});return{partition:c,signingService:s,hostname:g,...m&&{signingRegion:m},...l[d]?.signingService&&{signingService:l[d].signingService}}}},35675:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getResolvedHostname:()=>r});const r=(e,{regionHostname:t,partitionHostname:n})=>t||(n?n.replace("{region}",e):void 0)},49962:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getResolvedPartition:()=>r});const r=(e,{partitionHash:t})=>Object.keys(t||{}).find((n=>t[n].regions.includes(e)))??"aws"},79391:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getResolvedSigningRegion:()=>r});const r=(e,{signingRegion:t,regionRegex:n,useFipsEndpoint:r})=>{if(t)return t;if(r){const t=n.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),r=e.match(t);if(r)return r[0].slice(1,-1)}}},69402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRegionInfo:()=>r.getRegionInfo}),n(49028),n(2024);var r=n(68374)},6752:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getSmithyContext:()=>i});var r=n(23911);const i=e=>e[r.SMITHY_CONTEXT_KEY]||(e[r.SMITHY_CONTEXT_KEY]={})},40033:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DefaultIdentityProviderConfig:()=>c.DefaultIdentityProviderConfig,EXPIRATION_MS:()=>c.EXPIRATION_MS,HttpApiKeyAuthSigner:()=>c.HttpApiKeyAuthSigner,HttpBearerAuthSigner:()=>c.HttpBearerAuthSigner,NoAuthSigner:()=>c.NoAuthSigner,createIsIdentityExpiredFunction:()=>c.createIsIdentityExpiredFunction,createPaginator:()=>s.createPaginator,doesIdentityRequireRefresh:()=>c.doesIdentityRequireRefresh,getHttpAuthSchemeEndpointRuleSetPlugin:()=>i.getHttpAuthSchemeEndpointRuleSetPlugin,getHttpAuthSchemePlugin:()=>i.getHttpAuthSchemePlugin,getHttpSigningPlugin:()=>a.getHttpSigningPlugin,getSmithyContext:()=>r.getSmithyContext,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>i.httpAuthSchemeEndpointRuleSetMiddlewareOptions,httpAuthSchemeMiddleware:()=>i.httpAuthSchemeMiddleware,httpAuthSchemeMiddlewareOptions:()=>i.httpAuthSchemeMiddlewareOptions,httpSigningMiddleware:()=>a.httpSigningMiddleware,httpSigningMiddlewareOptions:()=>a.httpSigningMiddlewareOptions,isIdentityExpired:()=>c.isIdentityExpired,memoizeIdentityProvider:()=>c.memoizeIdentityProvider,normalizeProvider:()=>o.normalizeProvider,requestBuilder:()=>l.requestBuilder,setFeature:()=>u.setFeature});var r=n(6752),i=n(61922),a=n(55667),o=n(54367),s=n(52809),l=n(34727),u=n(52067),c=n(93927)},14761:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpAuthSchemeEndpointRuleSetPlugin:()=>a,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>i});var r=n(70909);const i={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},a=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:a=>{a.addRelativeTo((0,r.httpAuthSchemeMiddleware)(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),i)}})},50476:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpAuthSchemePlugin:()=>o,httpAuthSchemeMiddlewareOptions:()=>a});var r=n(32754),i=n(70909);const a={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:r.serializerMiddlewareOption.name},o=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo((0,i.httpAuthSchemeMiddleware)(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),a)}})},70909:(e,t,n)=>{"use strict";n.r(t),n.d(t,{httpAuthSchemeMiddleware:()=>i}),n(23911);var r=n(40805);const i=(e,t)=>(n,i)=>async a=>{const o=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,i,a.input)),s=function(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}(e.httpAuthSchemes),l=(0,r.getSmithyContext)(i),u=[];for(const n of o){const r=s.get(n.schemeId);if(!r){u.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}const a=r.identityProvider(await t.identityProviderConfigProvider(e));if(!a){u.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:o={},signingProperties:c={}}=n.propertiesExtractor?.(e,i)||{};n.identityProperties=Object.assign(n.identityProperties||{},o),n.signingProperties=Object.assign(n.signingProperties||{},c),l.selectedHttpAuthScheme={httpAuthOption:n,identity:await a(n.identityProperties),signer:r.signer};break}if(!l.selectedHttpAuthScheme)throw new Error(u.join("\n"));return n(a)}},61922:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpAuthSchemeEndpointRuleSetPlugin:()=>i.getHttpAuthSchemeEndpointRuleSetPlugin,getHttpAuthSchemePlugin:()=>a.getHttpAuthSchemePlugin,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>i.httpAuthSchemeEndpointRuleSetMiddlewareOptions,httpAuthSchemeMiddleware:()=>r.httpAuthSchemeMiddleware,httpAuthSchemeMiddlewareOptions:()=>a.httpAuthSchemeMiddlewareOptions});var r=n(70909),i=n(14761),a=n(50476)},17656:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpSigningPlugin:()=>a,httpSigningMiddlewareOptions:()=>i});var r=n(56596);const i={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},a=e=>({applyToStack:t=>{t.addRelativeTo((0,r.httpSigningMiddleware)(e),i)}})},56596:(e,t,n)=>{"use strict";n.r(t),n.d(t,{httpSigningMiddleware:()=>s});var r=n(14065),i=(n(23911),n(40805));const a=e=>e=>{throw e},o=(e,t)=>{},s=e=>(e,t)=>async n=>{if(!r.HttpRequest.isInstance(n.request))return e(n);const s=(0,i.getSmithyContext)(t).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:l={}},identity:u,signer:c}=s,d=await e({...n,request:await c.sign(n.request,u,l)}).catch((c.errorHandler||a)(l));return(c.successHandler||o)(d.response,l),d}},55667:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpSigningPlugin:()=>i.getHttpSigningPlugin,httpSigningMiddleware:()=>r.httpSigningMiddleware,httpSigningMiddlewareOptions:()=>i.httpSigningMiddlewareOptions});var r=n(56596),i=n(17656)},54367:(e,t,n)=>{"use strict";n.r(t),n.d(t,{normalizeProvider:()=>r});const r=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t}},52809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createPaginator:()=>i});const r=async(e,t,n,...r)=>await t.send(new e(n),...r);function i(e,t,n,i,o){return async function*(s,l,...u){let c,d=s.startingToken||void 0,f=!0;for(;f;){if(l[n]=d,o&&(l[o]=l[o]??s.pageSize),!(s.client instanceof e))throw new Error(`Invalid client, expected instance of ${e.name}`);c=await r(t,s.client,l,...u),yield c;const p=d;d=a(c,i),f=!(!d||s.stopOnSameToken&&d===p)}}}const a=(e,t)=>{let n=e;const r=t.split(".");for(const e of r){if(!n||"object"!=typeof n)return;n=n[e]}return n}},34727:(e,t,n)=>{"use strict";n.r(t),n.d(t,{requestBuilder:()=>r.requestBuilder});var r=n(4351)},52067:(e,t,n)=>{"use strict";function r(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}n.r(t),n.d(t,{setFeature:()=>r})},72847:(e,t,n)=>{"use strict";n.r(t),n.d(t,{collectBody:()=>i});var r=n(42357);const i=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return r.Uint8ArrayBlobAdapter.mutate(e);if(!e)return r.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const n=t.streamCollector(e);return r.Uint8ArrayBlobAdapter.mutate(await n)}},27916:(e,t,n)=>{"use strict";function r(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}n.r(t),n.d(t,{extendedEncodeURIComponent:()=>r})},4351:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RequestBuilder:()=>a.RequestBuilder,collectBody:()=>r.collectBody,extendedEncodeURIComponent:()=>i.extendedEncodeURIComponent,requestBuilder:()=>a.requestBuilder,resolvedPath:()=>o.resolvedPath});var r=n(72847),i=n(27916),a=n(21591),o=n(63351)},21591:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RequestBuilder:()=>o,requestBuilder:()=>a});var r=n(4351),i=n(14065);function a(e,t){return new o(e,t)}class o{constructor(e,t){this.input=e,this.context=t,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:e,protocol:t="https",port:n,path:r}=await this.context.endpoint();this.path=r;for(const e of this.resolvePathStack)e(this.path);return new i.HttpRequest({protocol:t,hostname:this.hostname||e,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e})),this}p(e,t,n,i){return this.resolvePathStack.push((a=>{this.path=(0,r.resolvedPath)(a,this.input,e,t,n,i)})),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}},63351:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolvedPath:()=>i});var r=n(27916);const i=(e,t,n,i,a,o)=>{if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");{const t=i();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");e=e.replace(a,o?t.split("/").map((e=>(0,r.extendedEncodeURIComponent)(e))).join("/"):(0,r.extendedEncodeURIComponent)(t))}return e}},30612:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DefaultIdentityProviderConfig:()=>r});class r{constructor(e){this.authSchemes=new Map;for(const[t,n]of Object.entries(e))void 0!==n&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}},59732:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpApiKeyAuthSigner:()=>a});var r=n(14065),i=n(23911);class a{async sign(e,t,n){if(!n)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!t.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const a=r.HttpRequest.clone(e);if(n.in===i.HttpApiKeyAuthLocation.QUERY)a.query[n.name]=t.apiKey;else{if(n.in!==i.HttpApiKeyAuthLocation.HEADER)throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");a.headers[n.name]=n.scheme?`${n.scheme} ${t.apiKey}`:t.apiKey}return a}}},20442:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpBearerAuthSigner:()=>i});var r=n(14065);class i{async sign(e,t,n){const i=r.HttpRequest.clone(e);if(!t.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return i.headers.Authorization=`Bearer ${t.token}`,i}}},54849:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpApiKeyAuthSigner:()=>r.HttpApiKeyAuthSigner,HttpBearerAuthSigner:()=>i.HttpBearerAuthSigner,NoAuthSigner:()=>a.NoAuthSigner});var r=n(59732),i=n(20442),a=n(45536)},45536:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NoAuthSigner:()=>r});class r{async sign(e,t,n){return e}}},93927:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DefaultIdentityProviderConfig:()=>r.DefaultIdentityProviderConfig,EXPIRATION_MS:()=>a.EXPIRATION_MS,HttpApiKeyAuthSigner:()=>i.HttpApiKeyAuthSigner,HttpBearerAuthSigner:()=>i.HttpBearerAuthSigner,NoAuthSigner:()=>i.NoAuthSigner,createIsIdentityExpiredFunction:()=>a.createIsIdentityExpiredFunction,doesIdentityRequireRefresh:()=>a.doesIdentityRequireRefresh,isIdentityExpired:()=>a.isIdentityExpired,memoizeIdentityProvider:()=>a.memoizeIdentityProvider});var r=n(30612),i=n(54849),a=n(91431)},91431:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EXPIRATION_MS:()=>i,createIsIdentityExpiredFunction:()=>r,doesIdentityRequireRefresh:()=>o,isIdentityExpired:()=>a,memoizeIdentityProvider:()=>s});const r=e=>t=>o(t)&&t.expiration.getTime()-Date.now()void 0!==e.expiration,s=(e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let i,a,o,s=!1;const l=async e=>{a||(a=r(e));try{i=await a,o=!0,s=!1}finally{a=void 0}return i};return void 0===t?async e=>(o&&!e?.forceRefresh||(i=await l(e)),i):async e=>(o&&!e?.forceRefresh||(i=await l(e)),s?i:n(i)?t(i)?(await l(e),i):i:(s=!0,i))}},47083:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventStreamCodec:()=>o});var r=n(60442),i=n(82281),a=n(60414);class o{constructor(e,t){this.headerMarshaller=new i.HeaderMarshaller(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage:()=>e,isEndOfStream:()=>t}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const t=this.isEndOfStream;return{getMessages:()=>e,isEndOfStream:()=>t}}encode({headers:e,body:t}){const n=this.headerMarshaller.format(e),i=n.byteLength+t.byteLength+16,a=new Uint8Array(i),o=new DataView(a.buffer,a.byteOffset,a.byteLength),s=new r.Crc32;return o.setUint32(0,i,!1),o.setUint32(4,n.byteLength,!1),o.setUint32(8,s.update(a.subarray(0,8)).digest(),!1),a.set(n,12),a.set(t,n.byteLength+12),o.setUint32(i-4,s.update(a.subarray(8,i-4)).digest(),!1),a}decode(e){const{headers:t,body:n}=(0,a.splitMessage)(e);return{headers:this.headerMarshaller.parse(t),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}}},82281:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HeaderMarshaller:()=>o});var r,i=n(68004),a=n(24494);class o{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){const t=[];for(const n of Object.keys(e)){const r=this.fromUtf8(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce(((e,t)=>e+t.byteLength),0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(o.buffer);return s.set(e.value,3),s;case"string":const l=this.fromUtf8(e.value),u=new DataView(new ArrayBuffer(3+l.byteLength));u.setUint8(0,7),u.setUint16(1,l.byteLength,!1);const c=new Uint8Array(u.buffer);return c.set(l,3),c;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(a.Int64.fromNumber(e.value.valueOf()).bytes,1),d;case"uuid":if(!m.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const f=new Uint8Array(17);return f[0]=9,f.set((0,i.fromHex)(e.value.replace(/\-/g,"")),1),f}}parse(e){const t={};let n=0;for(;n{"use strict";n.r(t),n.d(t,{Int64:()=>i});var r=n(68004);class i{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&a(t),new i(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&a(e),parseInt((0,r.toHex)(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function a(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}},19678:(e,t,n)=>{"use strict";n.r(t)},1796:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MessageDecoderStream:()=>r});class r{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.decoder.decode(e);yield t}}}},89660:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MessageEncoderStream:()=>r});class r{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=this.options.encoder.encode(e);yield t}this.options.includeEndFrame&&(yield new Uint8Array(0))}}},67178:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SmithyMessageDecoderStream:()=>r});class r{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.messageStream){const t=await this.options.deserializer(e);void 0!==t&&(yield t)}}}},82334:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SmithyMessageEncoderStream:()=>r});class r{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const e of this.options.inputStream){const t=this.options.serializer(e);yield t}}}},67709:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventStreamCodec:()=>r.EventStreamCodec,HeaderMarshaller:()=>i.HeaderMarshaller,Int64:()=>a.Int64,MessageDecoderStream:()=>o.MessageDecoderStream,MessageEncoderStream:()=>s.MessageEncoderStream,SmithyMessageDecoderStream:()=>l.SmithyMessageDecoderStream,SmithyMessageEncoderStream:()=>u.SmithyMessageEncoderStream});var r=n(47083),i=n(82281),a=n(24494),o=(n(19678),n(1796)),s=n(89660),l=n(67178),u=n(82334)},60414:(e,t,n)=>{"use strict";n.r(t),n.d(t,{splitMessage:()=>l});var r=n(60442);const i=4,a=2*i,o=4,s=a+2*o;function l({byteLength:e,byteOffset:t,buffer:n}){if(e{"use strict";n.r(t),n.d(t,{EventStreamMarshaller:()=>a});var r=n(59694),i=n(21258);class a{constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new r.EventStreamMarshaller({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){const n=o(e)?(0,i.readableStreamtoIterable)(e):e;return this.universalMarshaller.deserialize(n,t)}serialize(e,t){const n=this.universalMarshaller.serialize(e,t);return"function"==typeof ReadableStream?(0,i.iterableToReadableStream)(n):n}}const o=e=>"function"==typeof ReadableStream&&e instanceof ReadableStream},9519:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventStreamMarshaller:()=>r.EventStreamMarshaller,eventStreamSerdeProvider:()=>i.eventStreamSerdeProvider,iterableToReadableStream:()=>a.iterableToReadableStream,readableStreamtoIterable:()=>a.readableStreamtoIterable});var r=n(55710),i=n(37034),a=n(21258)},37034:(e,t,n)=>{"use strict";n.r(t),n.d(t,{eventStreamSerdeProvider:()=>i});var r=n(55710);const i=e=>new r.EventStreamMarshaller(e)},21258:(e,t,n)=>{"use strict";n.r(t),n.d(t,{iterableToReadableStream:()=>i,readableStreamtoIterable:()=>r});const r=e=>({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}}),i=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){const{done:n,value:r}=await t.next();if(n)return e.close();e.enqueue(r)}})}},13001:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEventStreamSerdeConfig:()=>r});const r=e=>({...e,eventStreamMarshaller:e.eventStreamSerdeProvider(e)})},78504:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEventStreamSerdeConfig:()=>r.resolveEventStreamSerdeConfig});var r=n(13001)},86359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventStreamMarshaller:()=>o});var r=n(67709),i=n(92964),a=n(96326);class o{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new r.EventStreamCodec(e,t),this.utfEncoder=e}deserialize(e,t){const n=(0,i.getChunkedStream)(e);return new r.SmithyMessageDecoderStream({messageStream:new r.MessageDecoderStream({inputStream:n,decoder:this.eventStreamCodec}),deserializer:(0,a.getMessageUnmarshaller)(t,this.utfEncoder)})}serialize(e,t){return new r.MessageEncoderStream({messageStream:new r.SmithyMessageEncoderStream({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}},92964:(e,t,n)=>{"use strict";function r(e){let t=0,n=0,r=null,i=null;const a=e=>{if("number"!=typeof e)throw new Error("Attempted to allocate an event message where size was not a number: "+e);t=e,n=4,r=new Uint8Array(e),new DataView(r.buffer).setUint32(0,e,!1)};return{[Symbol.asyncIterator]:async function*(){const o=e[Symbol.asyncIterator]();for(;;){const{value:e,done:s}=await o.next();if(s){if(!t)return;if(t!==n)throw new Error("Truncated event message received.");return void(yield r)}const l=e.length;let u=0;for(;ur})},96326:(e,t,n)=>{"use strict";function r(e,t){const n=i(t.deserializer,t.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(const r of e){const e=t.eventStreamCodec.decode(r),i=await n(e);void 0!==i&&(yield i)}}}}function i(e,t){return async function(n){const{value:r}=n.headers[":message-type"];if("error"===r){const e=new Error(n.headers[":error-message"].value||"UnknownError");throw e.name=n.headers[":error-code"].value,e}if("exception"===r){const r=n.headers[":exception-type"].value,i={[r]:n},a=await e(i);if(a.$unknown){const e=new Error(t(n.body));throw e.name=r,e}throw a[r]}if("event"===r){const t={[n.headers[":event-type"].value]:n},r=await e(t);if(r.$unknown)return;return r}throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}n.r(t),n.d(t,{getMessageUnmarshaller:()=>i,getUnmarshalledStream:()=>r})},59694:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EventStreamMarshaller:()=>r.EventStreamMarshaller,eventStreamSerdeProvider:()=>i.eventStreamSerdeProvider});var r=n(86359),i=n(78590)},78590:(e,t,n)=>{"use strict";n.r(t),n.d(t,{eventStreamSerdeProvider:()=>i});var r=n(86359);const i=e=>new r.EventStreamMarshaller(e)},47896:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FetchHttpHandler:()=>s,keepAliveSupport:()=>o});var r=n(14065),i=n(65901),a=n(61455);const o={supported:void 0};class s{static create(e){return"function"==typeof e?.handle?e:new s(e)}constructor(e){"function"==typeof e?this.configProvider=e().then((e=>e||{})):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===o.supported&&(o.supported=Boolean("undefined"!=typeof Request&&"keepalive"in new Request("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t}={}){this.config||(this.config=await this.configProvider);const n=this.config.requestTimeout,s=!0===this.config.keepAlive,l=this.config.credentials;if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",Promise.reject(e)}let u=e.path;const c=(0,i.buildQueryString)(e.query||{});c&&(u+=`?${c}`),e.fragment&&(u+=`#${e.fragment}`);let d="";null==e.username&&null==e.password||(d=`${e.username??""}:${e.password??""}@`);const{port:f,method:p}=e,h=`${e.protocol}//${d}${e.hostname}${f?`:${f}`:""}${u}`,g="GET"===p||"HEAD"===p?void 0:e.body,m={body:g,headers:new Headers(e.headers),method:p,credentials:l};this.config?.cache&&(m.cache=this.config.cache),g&&(m.duplex="half"),"undefined"!=typeof AbortController&&(m.signal=t),o.supported&&(m.keepalive=s),"function"==typeof this.config.requestInit&&Object.assign(m,this.config.requestInit(e));let y=()=>{};const v=new Request(h,m),b=[fetch(v).then((e=>{const t=e.headers,n={};for(const e of t.entries())n[e[0]]=e[1];return null!=e.body?{response:new r.HttpResponse({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then((t=>({response:new r.HttpResponse({headers:n,reason:e.statusText,statusCode:e.status,body:t})})))})),(0,a.requestTimeout)(n)];return t&&b.push(new Promise(((e,n)=>{const r=()=>{const e=new Error("Request aborted");e.name="AbortError",n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),y=()=>e.removeEventListener("abort",r)}else t.onabort=r}))),Promise.race(b).finally(y)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((n=>(n[e]=t,n)))}httpHandlerConfigs(){return this.config??{}}}},61664:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FetchHttpHandler:()=>r.FetchHttpHandler,keepAliveSupport:()=>r.keepAliveSupport,streamCollector:()=>i.streamCollector});var r=n(47896),i=n(8612)},61455:(e,t,n)=>{"use strict";function r(e=0){return new Promise(((t,n)=>{e&&setTimeout((()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)}),e)}))}n.r(t),n.d(t,{requestTimeout:()=>r})},8612:(e,t,n)=>{"use strict";n.r(t),n.d(t,{streamCollector:()=>r});const r=async e=>"function"==typeof Blob&&e instanceof Blob?new Uint8Array(await e.arrayBuffer()):async function(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}const a=new Uint8Array(i);let o=0;for(const e of t)a.set(e,o),o+=e.length;return a}(e)},70913:(e,t,n)=>{"use strict";n.r(t),n.d(t,{invalidFunction:()=>r.invalidFunction,invalidProvider:()=>i.invalidProvider});var r=n(90566),i=n(32423)},90566:(e,t,n)=>{"use strict";n.r(t),n.d(t,{invalidFunction:()=>r});const r=e=>()=>{throw new Error(e)}},32423:(e,t,n)=>{"use strict";n.r(t),n.d(t,{invalidProvider:()=>r});const r=e=>()=>Promise.reject(e)},43695:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isArrayBuffer:()=>r});const r=e=>"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)},70649:(e,t,n)=>{"use strict";n.r(t),n.d(t,{contentLengthMiddleware:()=>a,contentLengthMiddlewareOptions:()=>o,getContentLengthPlugin:()=>s});var r=n(14065);const i="content-length";function a(e){return t=>async n=>{const a=n.request;if(r.HttpRequest.isInstance(a)){const{body:t,headers:n}=a;if(t&&-1===Object.keys(n).map((e=>e.toLowerCase())).indexOf(i))try{const n=e(t);a.headers={...a.headers,[i]:String(n)}}catch(e){}}return t({...n,request:a})}}const o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},s=e=>({applyToStack:t=>{t.add(a(e.bodyLengthChecker),o)}})},26393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createConfigValueProvider:()=>r});const r=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?":"+r:""}${i}`}}return e}:r}},110:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointFromConfig:()=>r});const r=async e=>{}},45935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointFromInstructions:()=>s,resolveParams:()=>l});var r=n(35421),i=n(26393),a=n(110),o=n(18462);const s=async(e,t,n,r)=>{if(!n.endpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await(0,a.getEndpointFromConfig)(n.serviceId),e&&(n.endpoint=()=>Promise.resolve((0,o.toEndpointV1)(e)))}const i=await l(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(i,r)},l=async(e,t,n)=>{const a={},o=t?.getEndpointParameterInstructions?.()||{};for(const[t,r]of Object.entries(o))switch(r.type){case"staticContextParams":a[t]=r.value;break;case"contextParams":a[t]=e[r.name];break;case"clientContextParams":case"builtInParams":a[t]=await(0,i.createConfigValueProvider)(r.name,t,n)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(r))}return 0===Object.keys(o).length&&Object.assign(a,n),"s3"===String(n.serviceId).toLowerCase()&&await(0,r.resolveParamsForS3)(a),a}},18399:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointFromInstructions:()=>r.getEndpointFromInstructions,resolveParams:()=>r.resolveParams,toEndpointV1:()=>i.toEndpointV1});var r=n(45935),i=n(18462)},18462:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toEndpointV1:()=>i});var r=n(18065);const i=e=>"object"==typeof e?"url"in e?(0,r.parseUrl)(e.url):e:(0,r.parseUrl)(e)},2439:(e,t,n)=>{"use strict";n.r(t),n.d(t,{endpointMiddleware:()=>o});var r=n(40033),i=n(40805),a=n(45935);const o=({config:e,instructions:t})=>(n,o)=>async s=>{e.endpoint&&(0,r.setFeature)(o,"ENDPOINT_OVERRIDE","N");const l=await(0,a.getEndpointFromInstructions)(s.input,{getEndpointParameterInstructions:()=>t},{...e},o);o.endpointV2=l,o.authSchemes=l.properties?.authSchemes;const u=o.authSchemes?.[0];if(u){o.signing_region=u.signingRegion,o.signing_service=u.signingName;const e=(0,i.getSmithyContext)(o),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:u.signingRegion,signingRegion:u.signingRegion,signing_service:u.signingName,signingName:u.signingName,signingRegionSet:u.signingRegionSet},u.properties))}return n({...s})}},58626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{endpointMiddlewareOptions:()=>a,getEndpointPlugin:()=>o});var r=n(32754),i=n(2439);const a={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:r.serializerMiddlewareOption.name},o=(e,t)=>({applyToStack:n=>{n.addRelativeTo((0,i.endpointMiddleware)({config:e,instructions:t}),a)}})},72540:(e,t,n)=>{"use strict";n.r(t),n.d(t,{endpointMiddleware:()=>i.endpointMiddleware,endpointMiddlewareOptions:()=>a.endpointMiddlewareOptions,getEndpointFromInstructions:()=>r.getEndpointFromInstructions,getEndpointPlugin:()=>a.getEndpointPlugin,resolveEndpointConfig:()=>o.resolveEndpointConfig,resolveParams:()=>r.resolveParams,toEndpointV1:()=>r.toEndpointV1});var r=n(18399),i=n(2439),a=n(58626),o=n(42795);n(51385)},42795:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEndpointConfig:()=>o});var r=n(40805),i=n(110),a=n(18462);const o=e=>{const t=e.tls??!0,{endpoint:n}=e,o=null!=n?async()=>(0,a.toEndpointV1)(await(0,r.normalizeProvider)(n)()):void 0,s=!!n,l={...e,endpoint:o,tls:t,isCustomEndpoint:s,useDualstackEndpoint:(0,r.normalizeProvider)(e.useDualstackEndpoint??!1),useFipsEndpoint:(0,r.normalizeProvider)(e.useFipsEndpoint??!1)};let u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=(0,i.getEndpointFromConfig)(e.serviceId)),u),l}},35421:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DOT_PATTERN:()=>r.DOT_PATTERN,S3_HOSTNAME_PATTERN:()=>r.S3_HOSTNAME_PATTERN,isArnBucketName:()=>r.isArnBucketName,isDnsCompatibleBucketName:()=>r.isDnsCompatibleBucketName,resolveParamsForS3:()=>r.resolveParamsForS3});var r=n(49467)},49467:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DOT_PATTERN:()=>s,S3_HOSTNAME_PATTERN:()=>l,isArnBucketName:()=>c,isDnsCompatibleBucketName:()=>u,resolveParamsForS3:()=>r});const r=async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),c(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!u(t)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},i=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,a=/(\d+\.){3}\d+/,o=/\.\./,s=/\./,l=/^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./,u=e=>i.test(e)&&!a.test(e)&&!o.test(e),c=e=>{const[t,n,r,,,i]=e.split(":"),a="arn"===t&&e.split(":").length>=6,o=Boolean(a&&n&&r&&i);if(a&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o}},51385:(e,t,n)=>{"use strict";n.r(t)},52952:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdaptiveRetryStrategy:()=>a});var r=n(56265),i=n(21973);class a extends i.StandardRetryStrategy{constructor(e,t){const{rateLimiter:n,...i}=t??{};super(e,i),this.rateLimiter=n??new r.DefaultRateLimiter,this.mode=r.RETRY_MODES.ADAPTIVE}async retry(e,t){return super.retry(e,t,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:e=>{this.rateLimiter.updateClientSendingRate(e)}})}}},21973:(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandardRetryStrategy:()=>d});var r=n(14065),i=n(42653),a=n(56265),o=n(12634),s=n(97701),l=n(31038),u=n(99933),c=n(15901);class d{constructor(e,t){this.maxAttemptsProvider=e,this.mode=a.RETRY_MODES.STANDARD,this.retryDecider=t?.retryDecider??u.defaultRetryDecider,this.delayDecider=t?.delayDecider??l.defaultDelayDecider,this.retryQuota=t?.retryQuota??(0,s.getDefaultRetryQuota)(a.INITIAL_RETRY_TOKENS)}shouldRetry(e,t,n){return tsetTimeout(e,r)));continue}throw t.$metadata||(t.$metadata={}),t.$metadata.attempts=l,t.$metadata.totalRetryDelay=u,t}}}const f=e=>{if(!r.HttpResponse.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],i=Number(n);return Number.isNaN(i)?new Date(n).getTime()-Date.now():1e3*i}},25998:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONFIG_MAX_ATTEMPTS:()=>o,CONFIG_RETRY_MODE:()=>c,ENV_MAX_ATTEMPTS:()=>a,ENV_RETRY_MODE:()=>u,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>s,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>d,resolveRetryConfig:()=>l});var r=n(40805),i=n(56265);const a="AWS_MAX_ATTEMPTS",o="max_attempts",s={environmentVariableSelector:e=>{const t=e[a];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${a} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[o];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${o} mast be a number, got "${t}"`);return n},default:i.DEFAULT_MAX_ATTEMPTS},l=e=>{const{retryStrategy:t}=e,n=(0,r.normalizeProvider)(e.maxAttempts??i.DEFAULT_MAX_ATTEMPTS);return{...e,maxAttempts:n,retryStrategy:async()=>t||(await(0,r.normalizeProvider)(e.retryMode)()===i.RETRY_MODES.ADAPTIVE?new i.AdaptiveRetryStrategy(n):new i.StandardRetryStrategy(n))}},u="AWS_RETRY_MODE",c="retry_mode",d={environmentVariableSelector:e=>e[u],configFileSelector:e=>e[c],default:i.DEFAULT_RETRY_MODE}},97701:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDefaultRetryQuota:()=>i});var r=n(56265);const i=(e,t)=>{const n=e,i=t?.noRetryIncrement??r.NO_RETRY_INCREMENT,a=t?.retryCost??r.RETRY_COST,o=t?.timeoutRetryCost??r.TIMEOUT_RETRY_COST;let s=e;const l=e=>"TimeoutError"===e.name?o:a,u=e=>l(e)<=s;return Object.freeze({hasRetryTokens:u,retrieveRetryTokens:e=>{if(!u(e))throw new Error("No retry token available");const t=l(e);return s-=t,t},releaseRetryTokens:e=>{s+=e??i,s=Math.min(s,n)}})}},31038:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultDelayDecider:()=>i});var r=n(56265);const i=(e,t)=>Math.floor(Math.min(r.MAXIMUM_RETRY_DELAY,Math.random()*2**t*e))},41069:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdaptiveRetryStrategy:()=>r.AdaptiveRetryStrategy,CONFIG_MAX_ATTEMPTS:()=>a.CONFIG_MAX_ATTEMPTS,CONFIG_RETRY_MODE:()=>a.CONFIG_RETRY_MODE,ENV_MAX_ATTEMPTS:()=>a.ENV_MAX_ATTEMPTS,ENV_RETRY_MODE:()=>a.ENV_RETRY_MODE,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>a.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>a.NODE_RETRY_MODE_CONFIG_OPTIONS,StandardRetryStrategy:()=>i.StandardRetryStrategy,defaultDelayDecider:()=>o.defaultDelayDecider,defaultRetryDecider:()=>l.defaultRetryDecider,getOmitRetryHeadersPlugin:()=>s.getOmitRetryHeadersPlugin,getRetryAfterHint:()=>u.getRetryAfterHint,getRetryPlugin:()=>u.getRetryPlugin,omitRetryHeadersMiddleware:()=>s.omitRetryHeadersMiddleware,omitRetryHeadersMiddlewareOptions:()=>s.omitRetryHeadersMiddlewareOptions,resolveRetryConfig:()=>a.resolveRetryConfig,retryMiddleware:()=>u.retryMiddleware,retryMiddlewareOptions:()=>u.retryMiddlewareOptions});var r=n(52952),i=n(21973),a=n(25998),o=n(31038),s=n(56908),l=n(99933),u=n(34923)},81738:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isStreamingPayload:()=>r});const r=e=>e?.body instanceof ReadableStream},56908:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getOmitRetryHeadersPlugin:()=>s,omitRetryHeadersMiddleware:()=>a,omitRetryHeadersMiddlewareOptions:()=>o});var r=n(14065),i=n(56265);const a=()=>e=>async t=>{const{request:n}=t;return r.HttpRequest.isInstance(n)&&(delete n.headers[i.INVOCATION_ID_HEADER],delete n.headers[i.REQUEST_HEADER]),e(t)},o={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},s=e=>({applyToStack:e=>{e.addRelativeTo(a(),o)}})},99933:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultRetryDecider:()=>i});var r=n(42653);const i=e=>!!e&&((0,r.isRetryableByTrait)(e)||(0,r.isClockSkewError)(e)||(0,r.isThrottlingError)(e)||(0,r.isTransientError)(e))},34923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRetryAfterHint:()=>m,getRetryPlugin:()=>g,retryMiddleware:()=>c,retryMiddlewareOptions:()=>h});var r=n(14065),i=n(42653),a=n(31796),o=n(56265),s=n(12634),l=n(81738),u=n(15901);const c=e=>(t,n)=>async i=>{let c=await e.retryStrategy();const p=await e.maxAttempts();if(!d(c))return c?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",c.mode]]),c.retry(t,i);{let e=await c.acquireInitialRetryToken(n.partition_id),d=new Error,h=0,g=0;const{request:m}=i,y=r.HttpRequest.isInstance(m);for(y&&(m.headers[o.INVOCATION_ID_HEADER]=(0,s.v4)());;)try{y&&(m.headers[o.REQUEST_HEADER]=`attempt=${h+1}; max=${p}`);const{response:n,output:r}=await t(i);return c.recordSuccess(e),r.$metadata.attempts=h+1,r.$metadata.totalRetryDelay=g,{response:n,output:r}}catch(t){const r=f(t);if(d=(0,u.asSdkError)(t),y&&(0,l.isStreamingPayload)(m))throw(n.logger instanceof a.NoOpLogger?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),d;try{e=await c.refreshRetryTokenForRetry(e,r)}catch(e){throw d.$metadata||(d.$metadata={}),d.$metadata.attempts=h+1,d.$metadata.totalRetryDelay=g,d}h=e.getRetryCount();const i=e.getRetryDelay();g+=i,await new Promise((e=>setTimeout(e,i)))}}},d=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,f=e=>{const t={error:e,errorType:p(e)},n=m(e.$response);return n&&(t.retryAfterHint=n),t},p=e=>(0,i.isThrottlingError)(e)?"THROTTLING":(0,i.isTransientError)(e)?"TRANSIENT":(0,i.isServerError)(e)?"SERVER_ERROR":"CLIENT_ERROR",h={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},g=e=>({applyToStack:t=>{t.add(c(e),h)}}),m=e=>{if(!r.HttpResponse.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],i=Number(n);return Number.isNaN(i)?new Date(n):new Date(1e3*i)}},15901:(e,t,n)=>{"use strict";n.r(t),n.d(t,{asSdkError:()=>r});const r=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error(`AWS SDK error wrapper for ${e}`)},47755:(e,t,n)=>{"use strict";n.r(t),n.d(t,{deserializerMiddleware:()=>r});const r=(e,t)=>n=>async r=>{const{response:i}=await n(r);try{return{response:i,output:await t(i,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:i}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";e.message+="\n "+t,void 0!==e.$responseBodyText&&e.$response&&(e.$response.body=e.$responseBodyText)}throw e}}},32754:(e,t,n)=>{"use strict";n.r(t),n.d(t,{deserializerMiddleware:()=>r.deserializerMiddleware,deserializerMiddlewareOption:()=>i.deserializerMiddlewareOption,getSerdePlugin:()=>i.getSerdePlugin,serializerMiddleware:()=>a.serializerMiddleware,serializerMiddlewareOption:()=>i.serializerMiddlewareOption});var r=n(47755),i=n(54340),a=n(64860)},54340:(e,t,n)=>{"use strict";n.r(t),n.d(t,{deserializerMiddlewareOption:()=>a,getSerdePlugin:()=>s,serializerMiddlewareOption:()=>o});var r=n(47755),i=n(64860);const a={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},o={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function s(e,t,n){return{applyToStack:s=>{s.add((0,r.deserializerMiddleware)(e,n),a),s.add((0,i.serializerMiddleware)(e,t),o)}}}},64860:(e,t,n)=>{"use strict";n.r(t),n.d(t,{serializerMiddleware:()=>r});const r=(e,t)=>(n,r)=>async i=>{const a=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!a)throw new Error("No valid endpoint provider available.");const o=await t(i.input,{...e,endpoint:a});return n({...i,request:o})}},61671:(e,t,n)=>{"use strict";n.r(t),n.d(t,{constructStack:()=>a});const r=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const e of t)n.push(e);return n},i=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,a=()=>{let e=[],t=[],n=!1;const l=new Set,u=n=>(e.forEach((e=>{n.add(e.middleware,{...e})})),t.forEach((e=>{n.addRelativeTo(e.middleware,{...e})})),n.identifyOnResolve?.(f.identifyOnResolve()),n),c=e=>{const t=[];return e.before.forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...c(e))})),t.push(e),e.after.reverse().forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...c(e))})),t},d=(n=!1)=>{const a=[],l=[],u={};var d;return e.forEach((e=>{const t={...e,before:[],after:[]};for(const e of r(t.name,t.aliases))u[e]=t;a.push(t)})),t.forEach((e=>{const t={...e,before:[],after:[]};for(const e of r(t.name,t.aliases))u[e]=t;l.push(t)})),l.forEach((e=>{if(e.toMiddleware){const t=u[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${i(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(d=a,d.sort(((e,t)=>o[t.step]-o[e.step]||s[t.priority||"normal"]-s[e.priority||"normal"]))).map(c).reduce(((e,t)=>(e.push(...t),e)),[])},f={add:(t,n={})=>{const{name:a,override:o,aliases:s}=n,u={step:"initialize",priority:"normal",middleware:t,...n},c=r(a,s);if(c.length>0){if(c.some((e=>l.has(e)))){if(!o)throw new Error(`Duplicate middleware name '${i(a,s)}'`);for(const t of c){const n=e.findIndex((e=>e.name===t||e.aliases?.some((e=>e===t))));if(-1===n)continue;const r=e[n];if(r.step!==u.step||u.priority!==r.priority)throw new Error(`"${i(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${i(a,s)}" middleware with ${u.priority} priority in ${u.step} step.`);e.splice(n,1)}}for(const e of c)l.add(e)}e.push(u)},addRelativeTo:(e,n)=>{const{name:a,override:o,aliases:s}=n,u={middleware:e,...n},c=r(a,s);if(c.length>0){if(c.some((e=>l.has(e)))){if(!o)throw new Error(`Duplicate middleware name '${i(a,s)}'`);for(const e of c){const n=t.findIndex((t=>t.name===e||t.aliases?.some((t=>t===e))));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==u.toMiddleware||r.relation!==u.relation)throw new Error(`"${i(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${i(a,s)}" middleware ${u.relation} "${u.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of c)l.add(e)}t.push(u)},clone:()=>u(a()),use:e=>{e.applyToStack(f)},remove:n=>"string"==typeof n?(n=>{let i=!1;const a=e=>{const t=r(e.name,e.aliases);if(t.includes(n)){i=!0;for(const e of t)l.delete(e);return!1}return!0};return e=e.filter(a),t=t.filter(a),i})(n):(n=>{let i=!1;const a=e=>{if(e.middleware===n){i=!0;for(const t of r(e.name,e.aliases))l.delete(t);return!1}return!0};return e=e.filter(a),t=t.filter(a),i})(n),removeByTag:n=>{let i=!1;const a=e=>{const{tags:t,name:a,aliases:o}=e;if(t&&t.includes(n)){const e=r(a,o);for(const t of e)l.delete(t);return i=!0,!1}return!0};return e=e.filter(a),t=t.filter(a),i},concat:e=>{const t=u(a());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:u,identify:()=>d(!0).map((e=>{const t=e.step??e.relation+" "+e.toMiddleware;return i(e.name,e.aliases)+" - "+t})),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of d().map((e=>e.middleware)).reverse())e=n(e,t);return n&&console.log(f.identify()),e}};return f},o={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},s={high:3,normal:2,low:1}},14795:(e,t,n)=>{"use strict";n.r(t),n.d(t,{constructStack:()=>r.constructStack});var r=n(61671)},83052:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CredentialsProviderError:()=>i});var r=n(96014);class i extends r.ProviderError{constructor(e,t=!0){super(e,t),this.name="CredentialsProviderError",Object.setPrototypeOf(this,i.prototype)}}},96014:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ProviderError:()=>r});class r extends Error{constructor(e,t=!0){let n,i=!0;"boolean"==typeof t?(n=void 0,i=t):null!=t&&"object"==typeof t&&(n=t.logger,i=t.tryNextLink??!0),super(e),this.name="ProviderError",this.tryNextLink=i,Object.setPrototypeOf(this,r.prototype),n?.debug?.(`@smithy/property-provider ${i?"->":"(!)"} ${e}`)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}},97513:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TokenProviderError:()=>i});var r=n(96014);class i extends r.ProviderError{constructor(e,t=!0){super(e,t),this.name="TokenProviderError",Object.setPrototypeOf(this,i.prototype)}}},78062:(e,t,n)=>{"use strict";n.r(t),n.d(t,{chain:()=>i});var r=n(96014);const i=(...e)=>async()=>{if(0===e.length)throw new r.ProviderError("No providers in chain");let t;for(const n of e)try{return await n()}catch(e){if(t=e,e?.tryNextLink)continue;throw e}throw t}},72269:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromStatic:()=>r});const r=e=>()=>Promise.resolve(e)},10223:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CredentialsProviderError:()=>r.CredentialsProviderError,ProviderError:()=>i.ProviderError,TokenProviderError:()=>a.TokenProviderError,chain:()=>o.chain,fromStatic:()=>s.fromStatic,memoize:()=>l.memoize});var r=n(83052),i=n(96014),a=n(97513),o=n(78062),s=n(72269),l=n(63783)},63783:(e,t,n)=>{"use strict";n.r(t),n.d(t,{memoize:()=>r});const r=(e,t,n)=>{let r,i,a,o=!1;const s=async()=>{i||(i=e());try{r=await i,a=!0,o=!1}finally{i=void 0}return r};return void 0===t?async e=>(a&&!e?.forceRefresh||(r=await s()),r):async e=>(a&&!e?.forceRefresh||(r=await s()),o?r:n&&!n(r)?(o=!0,r):t(r)?(await s(),r):r)}},28281:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Field:()=>i});var r=n(23911);class i{constructor({name:e,kind:t=r.FieldPosition.HEADER,values:n=[]}){this.name=e,this.kind=t,this.values=n}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter((t=>t!==e))}toString(){return this.values.map((e=>e.includes(",")||e.includes(" ")?`"${e}"`:e)).join(", ")}get(){return this.values}}},99260:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Fields:()=>r});class r{constructor({fields:e=[],encoding:t="utf-8"}){this.entries={},e.forEach(this.setField.bind(this)),this.encoding=t}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter((t=>t.kind===e))}}},22927:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpHandlerExtensionConfiguration:()=>r,resolveHttpHandlerRuntimeConfig:()=>i});const r=e=>{let t=e.httpHandler;return{setHttpHandler(e){t=e},httpHandler:()=>t,updateHttpClientConfig(e,n){t.updateHttpClientConfig(e,n)},httpHandlerConfigs:()=>t.httpHandlerConfigs()}},i=e=>({httpHandler:e.httpHandler()})},9640:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHttpHandlerExtensionConfiguration:()=>r.getHttpHandlerExtensionConfiguration,resolveHttpHandlerRuntimeConfig:()=>r.resolveHttpHandlerRuntimeConfig});var r=n(22927)},83229:(e,t,n)=>{"use strict";n.r(t)},67324:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpRequest:()=>r});class r{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new r({...e,headers:{...e.headers}});var n;return t.query&&(t.query=(n=t.query,Object.keys(n).reduce(((e,t)=>{const r=n[t];return{...e,[t]:Array.isArray(r)?[...r]:r}}),{}))),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return r.clone(this)}}},4094:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpResponse:()=>r});class r{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}},14065:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Field:()=>i.Field,Fields:()=>a.Fields,HttpRequest:()=>o.HttpRequest,HttpResponse:()=>s.HttpResponse,getHttpHandlerExtensionConfiguration:()=>r.getHttpHandlerExtensionConfiguration,isValidHostname:()=>l.isValidHostname,resolveHttpHandlerRuntimeConfig:()=>r.resolveHttpHandlerRuntimeConfig});var r=n(9640),i=n(28281),a=n(99260),o=(n(83229),n(67324)),s=n(4094),l=n(38610);n(76576)},38610:(e,t,n)=>{"use strict";function r(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}n.r(t),n.d(t,{isValidHostname:()=>r})},76576:(e,t,n)=>{"use strict";n.r(t)},65901:(e,t,n)=>{"use strict";n.r(t),n.d(t,{buildQueryString:()=>i});var r=n(78611);function i(e){const t=[];for(let n of Object.keys(e).sort()){const i=e[n];if(n=(0,r.escapeUri)(n),Array.isArray(i))for(let e=0,a=i.length;e{"use strict";function r(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}n.r(t),n.d(t,{parseQueryString:()=>r})},98388:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CLOCK_SKEW_ERROR_CODES:()=>r,NODEJS_TIMEOUT_ERROR_CODES:()=>s,THROTTLING_ERROR_CODES:()=>i,TRANSIENT_ERROR_CODES:()=>a,TRANSIENT_ERROR_STATUS_CODES:()=>o});const r=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],i=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],a=["TimeoutError","RequestTimeout","RequestTimeoutException"],o=[500,502,503,504],s=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"]},42653:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isClockSkewCorrectedError:()=>o,isClockSkewError:()=>a,isRetryableByTrait:()=>i,isServerError:()=>u,isThrottlingError:()=>s,isTransientError:()=>l});var r=n(98388);const i=e=>void 0!==e.$retryable,a=e=>r.CLOCK_SKEW_ERROR_CODES.includes(e.name),o=e=>e.$metadata?.clockSkewCorrected,s=e=>429===e.$metadata?.httpStatusCode||r.THROTTLING_ERROR_CODES.includes(e.name)||1==e.$retryable?.throttling,l=e=>o(e)||r.TRANSIENT_ERROR_CODES.includes(e.name)||r.NODEJS_TIMEOUT_ERROR_CODES.includes(e?.code||"")||r.TRANSIENT_ERROR_STATUS_CODES.includes(e.$metadata?.httpStatusCode||0),u=e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!l(e)}return!1}},52364:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HeaderFormatter:()=>o,Int64:()=>l});var r,i=n(68004),a=n(14246);class o{format(e){const t=[];for(const n of Object.keys(e)){const r=(0,a.fromUtf8)(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}const n=new Uint8Array(t.reduce(((e,t)=>e+t.byteLength),0));let r=0;for(const e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);const u=new Uint8Array(o.buffer);return u.set(e.value,3),u;case"string":const c=(0,a.fromUtf8)(e.value),d=new DataView(new ArrayBuffer(3+c.byteLength));d.setUint8(0,7),d.setUint16(1,c.byteLength,!1);const f=new Uint8Array(d.buffer);return f.set(c,3),f;case"timestamp":const p=new Uint8Array(9);return p[0]=8,p.set(l.fromNumber(e.value.valueOf()).bytes,1),p;case"uuid":if(!s.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set((0,i.fromHex)(e.value.replace(/\-/g,"")),1),h}}}!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(r||(r={}));const s=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class l{constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&u(t),new l(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&u(e),parseInt((0,i.toHex)(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function u(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}},97045:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SignatureV4:()=>y});var r=n(68004),i=n(40805),a=n(78611),o=n(14246),s=n(67120),l=n(3321),u=n(3245),c=n(48859),d=n(58755),f=n(52364),p=n(79092),h=n(38737),g=n(1969),m=n(73533);class y{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:a,uriEscapePath:o=!0}){this.headerFormatter=new f.HeaderFormatter,this.service=r,this.sha256=a,this.uriEscapePath=o,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=(0,i.normalizeProvider)(n),this.credentialProvider=(0,i.normalizeProvider)(t)}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:a,signableHeaders:o,hoistableHeaders:c,signingRegion:f,signingService:p}=t,m=await this.credentialProvider();this.validateResolvedCredentials(m);const y=f??await this.regionProvider(),{longDate:w,shortDate:x}=v(n);if(r>s.MAX_PRESIGNED_TTL)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const E=(0,l.createScope)(x,y,p??this.service),S=(0,h.moveHeadersToQuery)((0,g.prepareRequest)(e),{unhoistableHeaders:a,hoistableHeaders:c});m.sessionToken&&(S.query[s.TOKEN_QUERY_PARAM]=m.sessionToken),S.query[s.ALGORITHM_QUERY_PARAM]=s.ALGORITHM_IDENTIFIER,S.query[s.CREDENTIAL_QUERY_PARAM]=`${m.accessKeyId}/${E}`,S.query[s.AMZ_DATE_QUERY_PARAM]=w,S.query[s.EXPIRES_QUERY_PARAM]=r.toString(10);const _=(0,u.getCanonicalHeaders)(S,i,o);return S.query[s.SIGNED_HEADERS_QUERY_PARAM]=b(_),S.query[s.SIGNATURE_QUERY_PARAM]=await this.getSignature(w,E,this.getSigningKey(m,y,x,p),this.createCanonicalRequest(S,_,await(0,d.getPayloadHash)(e,this.sha256))),S}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:i,signingRegion:a,signingService:o}){const u=a??await this.regionProvider(),{shortDate:c,longDate:f}=v(n),p=(0,l.createScope)(c,u,o??this.service),h=await(0,d.getPayloadHash)({headers:{},body:t},this.sha256),g=new this.sha256;g.update(e);const m=(0,r.toHex)(await g.digest()),y=[s.EVENT_ALGORITHM_IDENTIFIER,f,p,i,m,h].join("\n");return this.signString(y,{signingDate:n,signingRegion:u,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then((t=>({message:e.message,signature:t})))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:i}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=n??await this.regionProvider(),{shortDate:l}=v(t),u=new this.sha256(await this.getSigningKey(a,s,l,i));return u.update((0,o.toUint8Array)(e)),(0,r.toHex)(await u.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:a}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const c=i??await this.regionProvider(),f=(0,g.prepareRequest)(e),{longDate:h,shortDate:m}=v(t),y=(0,l.createScope)(m,c,a??this.service);f.headers[s.AMZ_DATE_HEADER]=h,o.sessionToken&&(f.headers[s.TOKEN_HEADER]=o.sessionToken);const w=await(0,d.getPayloadHash)(f,this.sha256);!(0,p.hasHeader)(s.SHA256_HEADER,f.headers)&&this.applyChecksum&&(f.headers[s.SHA256_HEADER]=w);const x=(0,u.getCanonicalHeaders)(f,r,n),E=await this.getSignature(h,y,this.getSigningKey(o,c,m,a),this.createCanonicalRequest(f,x,w));return f.headers[s.AUTH_HEADER]=`${s.ALGORITHM_IDENTIFIER} Credential=${o.accessKeyId}/${y}, SignedHeaders=${b(x)}, Signature=${E}`,f}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(0,c.getCanonicalQuery)(e)}\n${r.map((e=>`${e}:${t[e]}`)).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n){const i=new this.sha256;i.update((0,o.toUint8Array)(n));const a=await i.digest();return`${s.ALGORITHM_IDENTIFIER}\n${e}\n${t}\n${(0,r.toHex)(a)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return(0,a.escapeUri)(n).replace(/%2F/g,"/")}return e}async getSignature(e,t,n,i){const a=await this.createStringToSign(e,t,i),s=new this.sha256(await n);return s.update((0,o.toUint8Array)(a)),(0,r.toHex)(await s.digest())}getSigningKey(e,t,n,r){return(0,l.getSigningKey)(this.sha256,e,n,t,r||this.service)}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}}const v=e=>{const t=(0,m.iso8601)(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}},b=e=>Object.keys(e).sort().join(";")},67120:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ALGORITHM_IDENTIFIER:()=>S,ALGORITHM_IDENTIFIER_V4A:()=>_,ALGORITHM_QUERY_PARAM:()=>r,ALWAYS_UNSIGNABLE_HEADERS:()=>b,AMZ_DATE_HEADER:()=>f,AMZ_DATE_QUERY_PARAM:()=>a,AUTH_HEADER:()=>d,CREDENTIAL_QUERY_PARAM:()=>i,DATE_HEADER:()=>p,EVENT_ALGORITHM_IDENTIFIER:()=>A,EXPIRES_QUERY_PARAM:()=>s,GENERATED_HEADERS:()=>h,HOST_HEADER:()=>v,KEY_TYPE_IDENTIFIER:()=>k,MAX_CACHE_SIZE:()=>T,MAX_PRESIGNED_TTL:()=>R,PROXY_HEADER_PATTERN:()=>w,REGION_SET_PARAM:()=>c,SEC_HEADER_PATTERN:()=>x,SHA256_HEADER:()=>m,SIGNATURE_HEADER:()=>g,SIGNATURE_QUERY_PARAM:()=>l,SIGNED_HEADERS_QUERY_PARAM:()=>o,TOKEN_HEADER:()=>y,TOKEN_QUERY_PARAM:()=>u,UNSIGNABLE_PATTERNS:()=>E,UNSIGNED_PAYLOAD:()=>C});const r="X-Amz-Algorithm",i="X-Amz-Credential",a="X-Amz-Date",o="X-Amz-SignedHeaders",s="X-Amz-Expires",l="X-Amz-Signature",u="X-Amz-Security-Token",c="X-Amz-Region-Set",d="authorization",f=a.toLowerCase(),p="date",h=[d,f,p],g=l.toLowerCase(),m="x-amz-content-sha256",y=u.toLowerCase(),v="host",b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},w=/^proxy-/,x=/^sec-/,E=[/^proxy-/i,/^sec-/i],S="AWS4-HMAC-SHA256",_="AWS4-ECDSA-P256-SHA256",A="AWS4-HMAC-SHA256-PAYLOAD",C="UNSIGNED-PAYLOAD",T=50,k="aws4_request",R=604800},3321:(e,t,n)=>{"use strict";n.r(t),n.d(t,{clearCredentialCache:()=>c,createScope:()=>l,getSigningKey:()=>u});var r=n(68004),i=n(14246),a=n(67120);const o={},s=[],l=(e,t,n)=>`${e}/${t}/${n}/${a.KEY_TYPE_IDENTIFIER}`,u=async(e,t,n,i,l)=>{const u=await d(e,t.secretAccessKey,t.accessKeyId),c=`${n}:${i}:${l}:${(0,r.toHex)(u)}:${t.sessionToken}`;if(c in o)return o[c];for(s.push(c);s.length>a.MAX_CACHE_SIZE;)delete o[s.shift()];let f=`AWS4${t.secretAccessKey}`;for(const t of[n,i,l,a.KEY_TYPE_IDENTIFIER])f=await d(e,f,t);return o[c]=f},c=()=>{s.length=0,Object.keys(o).forEach((e=>{delete o[e]}))},d=(e,t,n)=>{const r=new e(t);return r.update((0,i.toUint8Array)(n)),r.digest()}},3245:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getCanonicalHeaders:()=>i});var r=n(67120);const i=({headers:e},t,n)=>{const i={};for(const a of Object.keys(e).sort()){if(null==e[a])continue;const o=a.toLowerCase();(o in r.ALWAYS_UNSIGNABLE_HEADERS||t?.has(o)||r.PROXY_HEADER_PATTERN.test(o)||r.SEC_HEADER_PATTERN.test(o))&&(!n||n&&!n.has(o))||(i[o]=e[a].trim().replace(/\s+/g," "))}return i}},48859:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getCanonicalQuery:()=>a});var r=n(78611),i=n(67120);const a=({query:e={}})=>{const t=[],n={};for(const a of Object.keys(e)){if(a.toLowerCase()===i.SIGNATURE_HEADER)continue;const o=(0,r.escapeUri)(a);t.push(o);const s=e[a];"string"==typeof s?n[o]=`${o}=${(0,r.escapeUri)(s)}`:Array.isArray(s)&&(n[o]=s.slice(0).reduce(((e,t)=>e.concat([`${o}=${(0,r.escapeUri)(t)}`])),[]).sort().join("&"))}return t.sort().map((e=>n[e])).filter((e=>e)).join("&")}},58755:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getPayloadHash:()=>s});var r=n(43695),i=n(68004),a=n(14246),o=n(67120);const s=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===o.SHA256_HEADER)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(0,r.isArrayBuffer)(t)){const e=new n;return e.update((0,a.toUint8Array)(t)),(0,i.toHex)(await e.digest())}return o.UNSIGNED_PAYLOAD}},79092:(e,t,n)=>{"use strict";n.r(t),n.d(t,{deleteHeader:()=>a,getHeaderValue:()=>i,hasHeader:()=>r});const r=(e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1},i=(e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return t[n]},a=(e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))e===n.toLowerCase()&&delete t[n]}},82505:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SignatureV4:()=>r.SignatureV4,clearCredentialCache:()=>u.clearCredentialCache,createScope:()=>u.createScope,getCanonicalHeaders:()=>i.getCanonicalHeaders,getCanonicalQuery:()=>a.getCanonicalQuery,getPayloadHash:()=>o.getPayloadHash,getSigningKey:()=>u.getSigningKey,moveHeadersToQuery:()=>s.moveHeadersToQuery,prepareRequest:()=>l.prepareRequest});var r=n(97045),i=n(3245),a=n(48859),o=n(58755),s=n(38737),l=n(1969),u=n(3321)},38737:(e,t,n)=>{"use strict";n.r(t),n.d(t,{moveHeadersToQuery:()=>i});var r=n(14065);const i=(e,t={})=>{const{headers:n,query:i={}}=r.HttpRequest.clone(e);for(const e of Object.keys(n)){const r=e.toLowerCase();("x-amz-"===r.slice(0,6)&&!t.unhoistableHeaders?.has(r)||t.hoistableHeaders?.has(r))&&(i[e]=n[e],delete n[e])}return{...e,headers:n,query:i}}},1969:(e,t,n)=>{"use strict";n.r(t),n.d(t,{prepareRequest:()=>a});var r=n(14065),i=n(67120);const a=e=>{e=r.HttpRequest.clone(e);for(const t of Object.keys(e.headers))i.GENERATED_HEADERS.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e}},73533:(e,t,n)=>{"use strict";n.r(t),n.d(t,{iso8601:()=>r,toDate:()=>i});const r=e=>i(e).toISOString().replace(/\.\d{3}Z$/,"Z"),i=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e},4098:(e,t,n)=>{"use strict";n.r(t),n.d(t,{NoOpLogger:()=>r});class r{trace(){}debug(){}info(){}warn(){}error(){}}},67821:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Client:()=>i});var r=n(14795);class i{constructor(e){this.config=e,this.middlewareStack=(0,r.constructStack)()}send(e,t,n){const r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n;let a;if(void 0===r&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const t=this.handlers;t.has(e.constructor)?a=t.get(e.constructor):(a=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,a))}else delete this.handlers,a=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return a(e).then((e=>e.output));a(e).then((e=>i(null,e.output)),(e=>i(e))).catch((()=>{}))}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}},12916:(e,t,n)=>{"use strict";n.r(t),n.d(t,{collectBody:()=>r.collectBody});var r=n(4351)},32249:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Command:()=>a});var r=n(14795),i=n(23911);class a{constructor(){this.middlewareStack=(0,r.constructStack)()}static classBuilder(){return new o}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:d}){for(const i of r.bind(this)(d,e,t,n))this.middlewareStack.use(i);const f=e.concat(this.middlewareStack),{logger:p}=t,h={logger:p,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:l,[i.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...c},{requestHandler:g}=t;return f.resolve((e=>g.handle(e.request,n||{})),h)}}class o{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=e=>e,this._outputFilterSensitiveLog=e=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let t;return t=class extends a{static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=t??{},e._init(this)}resolveMiddleware(n,r,i){return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}},22809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SENSITIVE_STRING:()=>r});const r="***SensitiveInformation***"},63496:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createAggregatedClient:()=>r});const r=(e,t)=>{for(const n of Object.keys(e)){const r=e[n],i=async function(e,t,n){const i=new r(e);if("function"==typeof t)this.send(i,t);else{if("function"!=typeof n)return this.send(i,t);if("object"!=typeof t)throw new Error("Expected http options but got "+typeof t);this.send(i,t||{},n)}},a=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,"");t.prototype[a]=i}}},28550:(e,t,n)=>{"use strict";n.r(t),n.d(t,{dateToUtcString:()=>o,parseEpochTimestamp:()=>g,parseRfc3339DateTime:()=>l,parseRfc3339DateTimeWithOffset:()=>c,parseRfc7231DateTime:()=>h});var r=n(93479);const i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function o(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),o=e.getUTCDate(),s=e.getUTCHours(),l=e.getUTCMinutes(),u=e.getUTCSeconds(),c=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`,f=l<10?`0${l}`:`${l}`,p=u<10?`0${u}`:`${u}`;return`${i[r]}, ${c} ${a[n]} ${t} ${d}:${f}:${p} GMT`}const s=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),l=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=s.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,i,a,o,l,u,c,d]=t,f=(0,r.strictParseShort)(C(i)),p=S(a,"month",1,12),h=S(o,"day",1,31);return m(f,p,h,{hours:l,minutes:u,seconds:c,fractionalMilliseconds:d})},u=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),c=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=u.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,i,a,o,s,l,c,d,f]=t,p=(0,r.strictParseShort)(C(i)),h=S(a,"month",1,12),g=S(o,"day",1,31),y=m(p,h,g,{hours:s,minutes:l,seconds:c,fractionalMilliseconds:d});return"Z"!=f.toUpperCase()&&y.setTime(y.getTime()-A(f)),y},d=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),f=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),p=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),h=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=d.exec(e);if(t){const[e,n,i,a,o,s,l,u]=t;return m((0,r.strictParseShort)(C(a)),b(i),S(n,"day",1,31),{hours:o,minutes:s,seconds:l,fractionalMilliseconds:u})}if(t=f.exec(e),t){const[e,n,r,i,a,o,s,l]=t;return v(m(y(i),b(r),S(n,"day",1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:l}))}if(t=p.exec(e),t){const[e,n,i,a,o,s,l,u]=t;return m((0,r.strictParseShort)(C(u)),b(n),S(i.trimLeft(),"day",1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},g=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(0,r.strictParseDouble)(e);else{if("object"!=typeof e||1!==e.tag)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=e.value}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},m=(e,t,n,r)=>{const i=t-1;return x(e,i,n),new Date(Date.UTC(e,i,n,S(r.hours,"hour",0,23),S(r.minutes,"minute",0,59),S(r.seconds,"seconds",0,60),_(r.fractionalMilliseconds)))},y=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+(0,r.strictParseShort)(C(e));return ne.getTime()-(new Date).getTime()>15768e8?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,b=e=>{const t=a.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},w=[31,28,31,30,31,30,31,31,30,31,30,31],x=(e,t,n)=>{let r=w[t];if(1===t&&E(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${a[t]} in ${e}: ${n}`)},E=e=>e%4==0&&(e%100!=0||e%400==0),S=(e,t,n,i)=>{const a=(0,r.strictParseByte)(C(e));if(ai)throw new TypeError(`${t} must be between ${n} and ${i}, inclusive`);return a},_=e=>null==e?0:1e3*(0,r.strictParseFloat32)("0."+e),A=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},C=e=>{let t=0;for(;t{"use strict";n.r(t),n.d(t,{throwDefaultError:()=>i,withBaseException:()=>a});var r=n(94384);const i=({output:e,parsedBody:t,exceptionCtor:n,errorCode:i})=>{const a=o(e),s=a.httpStatusCode?a.httpStatusCode+"":void 0,l=new n({name:t?.code||t?.Code||i||s||"UnknownError",$fault:"client",$metadata:a});throw(0,r.decorateServiceException)(l,t)},a=e=>({output:t,parsedBody:n,errorCode:r})=>{i({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},o=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]})},60666:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadConfigsForDefaultMode:()=>r});const r=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}}},52339:(e,t,n)=>{"use strict";n.r(t),n.d(t,{emitWarningIfUnsupportedVersion:()=>i});let r=!1;const i=e=>{e&&!r&&parseInt(e.substring(1,e.indexOf(".")))<16&&(r=!0)}},94384:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceException:()=>r,decorateServiceException:()=>i});class r extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,r.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const i=(e,t={})=>{Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)}));const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e}},8131:(e,t,n)=>{"use strict";n.r(t),n.d(t,{extendedEncodeURIComponent:()=>r.extendedEncodeURIComponent});var r=n(4351)},90728:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AlgorithmId:()=>r.AlgorithmId,getChecksumConfiguration:()=>i,resolveChecksumRuntimeConfig:()=>a});var r=n(23911);const i=e=>{const t=[];for(const n in r.AlgorithmId){const i=r.AlgorithmId[n];void 0!==e[i]&&t.push({algorithmId:()=>i,checksumConstructor:()=>e[i]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},a=e=>{const t={};return e.checksumAlgorithms().forEach((e=>{t[e.algorithmId()]=e.checksumConstructor()})),t}},14591:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDefaultClientConfiguration:()=>o,getDefaultExtensionConfiguration:()=>a,resolveDefaultRuntimeConfig:()=>s});var r=n(90728),i=n(64005);const a=e=>({...(0,r.getChecksumConfiguration)(e),...(0,i.getRetryConfiguration)(e)}),o=a,s=e=>({...(0,r.resolveChecksumRuntimeConfig)(e),...(0,i.resolveRetryRuntimeConfig)(e)})},57403:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDefaultClientConfiguration:()=>r.getDefaultClientConfiguration,getDefaultExtensionConfiguration:()=>r.getDefaultExtensionConfiguration,resolveDefaultRuntimeConfig:()=>r.resolveDefaultRuntimeConfig});var r=n(14591)},64005:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRetryConfiguration:()=>r,resolveRetryRuntimeConfig:()=>i});const r=e=>{let t=e.retryStrategy;return{setRetryStrategy(e){t=e},retryStrategy:()=>t}},i=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t}},53707:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getArrayIfSingleItem:()=>r});const r=e=>Array.isArray(e)?e:[e]},39430:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getValueFromTextNode:()=>r});const r=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=r(e[n]));return e}},31796:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Client:()=>r.Client,Command:()=>a.Command,LazyJsonString:()=>v.LazyJsonString,NoOpLogger:()=>b.NoOpLogger,SENSITIVE_STRING:()=>o.SENSITIVE_STRING,ServiceException:()=>f.ServiceException,StringWrapper:()=>v.StringWrapper,_json:()=>A._json,collectBody:()=>i.collectBody,convertMap:()=>w.convertMap,createAggregatedClient:()=>s.createAggregatedClient,dateToUtcString:()=>l.dateToUtcString,decorateServiceException:()=>f.decorateServiceException,emitWarningIfUnsupportedVersion:()=>d.emitWarningIfUnsupportedVersion,expectBoolean:()=>x.expectBoolean,expectByte:()=>x.expectByte,expectFloat32:()=>x.expectFloat32,expectInt:()=>x.expectInt,expectInt32:()=>x.expectInt32,expectLong:()=>x.expectLong,expectNonNull:()=>x.expectNonNull,expectNumber:()=>x.expectNumber,expectObject:()=>x.expectObject,expectShort:()=>x.expectShort,expectString:()=>x.expectString,expectUnion:()=>x.expectUnion,extendedEncodeURIComponent:()=>p.extendedEncodeURIComponent,getArrayIfSingleItem:()=>g.getArrayIfSingleItem,getDefaultClientConfiguration:()=>h.getDefaultClientConfiguration,getDefaultExtensionConfiguration:()=>h.getDefaultExtensionConfiguration,getValueFromTextNode:()=>m.getValueFromTextNode,handleFloat:()=>x.handleFloat,isSerializableHeaderValue:()=>y.isSerializableHeaderValue,limitedParseDouble:()=>x.limitedParseDouble,limitedParseFloat:()=>x.limitedParseFloat,limitedParseFloat32:()=>x.limitedParseFloat32,loadConfigsForDefaultMode:()=>c.loadConfigsForDefaultMode,logger:()=>x.logger,map:()=>w.map,parseBoolean:()=>x.parseBoolean,parseEpochTimestamp:()=>l.parseEpochTimestamp,parseRfc3339DateTime:()=>l.parseRfc3339DateTime,parseRfc3339DateTimeWithOffset:()=>l.parseRfc3339DateTimeWithOffset,parseRfc7231DateTime:()=>l.parseRfc7231DateTime,quoteHeader:()=>E.quoteHeader,resolveDefaultRuntimeConfig:()=>h.resolveDefaultRuntimeConfig,resolvedPath:()=>S.resolvedPath,serializeDateTime:()=>_.serializeDateTime,serializeFloat:()=>_.serializeFloat,splitEvery:()=>C.splitEvery,splitHeader:()=>T.splitHeader,strictParseByte:()=>x.strictParseByte,strictParseDouble:()=>x.strictParseDouble,strictParseFloat:()=>x.strictParseFloat,strictParseFloat32:()=>x.strictParseFloat32,strictParseInt:()=>x.strictParseInt,strictParseInt32:()=>x.strictParseInt32,strictParseLong:()=>x.strictParseLong,strictParseShort:()=>x.strictParseShort,take:()=>w.take,throwDefaultError:()=>u.throwDefaultError,withBaseException:()=>u.withBaseException});var r=n(67821),i=n(12916),a=n(32249),o=n(22809),s=n(63496),l=n(28550),u=n(22967),c=n(60666),d=n(52339),f=n(94384),p=n(8131),h=n(57403),g=n(53707),m=n(39430),y=n(10212),v=n(24259),b=n(4098),w=n(18845),x=n(93479),E=n(92192),S=n(29542),_=n(64650),A=n(87268),C=n(13094),T=n(28444)},10212:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isSerializableHeaderValue:()=>r});const r=e=>null!=e},24259:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LazyJsonString:()=>i,StringWrapper:()=>r});const r=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};r.prototype=Object.create(String.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(r,String);class i extends r{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(e){return e instanceof i?e:new i(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}},18845:(e,t,n)=>{"use strict";function r(e,t,n){let r,i,a;if(void 0===t&&void 0===n)r={},a=e;else{if(r=e,"function"==typeof t)return i=t,a=n,o(r,i,a);a=t}for(const e of Object.keys(a))Array.isArray(a[e])?s(r,null,a,e):r[e]=a[e];return r}n.r(t),n.d(t,{convertMap:()=>i,map:()=>r,take:()=>a});const i=e=>{const t={};for(const[n,r]of Object.entries(e||{}))t[n]=[,r];return t},a=(e,t)=>{const n={};for(const r in t)s(n,e,t,r);return n},o=(e,t,n)=>r(e,Object.entries(n).reduce(((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e)),{})),s=(e,t,n,r)=>{if(null!==t){let i=n[r];"function"==typeof i&&(i=[,i]);const[a=l,o=u,s=r]=i;return void(("function"==typeof a&&a(t[s])||"function"!=typeof a&&a)&&(e[r]=o(t[s])))}let[i,a]=n[r];if("function"==typeof a){let t;const n=void 0===i&&null!=(t=a()),o="function"==typeof i&&!!i(void 0)||"function"!=typeof i&&!!i;n?e[r]=t:o&&(e[r]=a())}else{const t=void 0===i&&null!=a,n="function"==typeof i&&!!i(a)||"function"!=typeof i&&!!i;(t||n)&&(e[r]=a)}},l=e=>null!=e,u=e=>e},93479:(e,t,n)=>{"use strict";n.r(t),n.d(t,{expectBoolean:()=>i,expectByte:()=>f,expectFloat32:()=>s,expectInt:()=>u,expectInt32:()=>c,expectLong:()=>l,expectNonNull:()=>g,expectNumber:()=>a,expectObject:()=>m,expectShort:()=>d,expectString:()=>y,expectUnion:()=>v,handleFloat:()=>A,limitedParseDouble:()=>_,limitedParseFloat:()=>C,limitedParseFloat32:()=>T,logger:()=>M,parseBoolean:()=>r,strictParseByte:()=>F,strictParseDouble:()=>b,strictParseFloat:()=>w,strictParseFloat32:()=>x,strictParseInt:()=>D,strictParseInt32:()=>O,strictParseLong:()=>R,strictParseShort:()=>N});const r=e=>{switch(e){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${e}"`)}},i=e=>{if(null!=e){if("number"==typeof e){if(0!==e&&1!==e||M.warn(P(`Expected boolean, got ${typeof e}: ${e}`)),0===e)return!1;if(1===e)return!0}if("string"==typeof e){const t=e.toLowerCase();if("false"!==t&&"true"!==t||M.warn(P(`Expected boolean, got ${typeof e}: ${e}`)),"false"===t)return!1;if("true"===t)return!0}if("boolean"==typeof e)return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},a=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&M.warn(P(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},o=Math.ceil(2**127*(2-2**-23)),s=e=>{const t=a(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>o)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},l=e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},u=l,c=e=>p(e,32),d=e=>p(e,16),f=e=>p(e,8),p=(e,t)=>{const n=l(e);if(void 0!==n&&h(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},h=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},g=(e,t)=>{if(null==e){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},m=e=>{if(null==e)return;if("object"==typeof e&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},y=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return M.warn(P(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},v=e=>{if(null==e)return;const t=m(e),n=Object.entries(t).filter((([,e])=>null!=e)).map((([e])=>e));if(0===n.length)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},b=e=>a("string"==typeof e?S(e):e),w=b,x=e=>s("string"==typeof e?S(e):e),E=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,S=e=>{const t=e.match(E);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},_=e=>"string"==typeof e?k(e):a(e),A=_,C=_,T=e=>"string"==typeof e?k(e):s(e),k=e=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}},R=e=>l("string"==typeof e?S(e):e),D=R,O=e=>c("string"==typeof e?S(e):e),N=e=>d("string"==typeof e?S(e):e),F=e=>f("string"==typeof e?S(e):e),P=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((e=>!e.includes("stackTraceWarning"))).join("\n"),M={warn:console.warn}},92192:(e,t,n)=>{"use strict";function r(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}n.r(t),n.d(t,{quoteHeader:()=>r})},29542:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolvedPath:()=>r.resolvedPath});var r=n(4351)},64650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{serializeDateTime:()=>i,serializeFloat:()=>r});const r=e=>{if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},i=e=>e.toISOString().replace(".000Z","Z")},87268:(e,t,n)=>{"use strict";n.r(t),n.d(t,{_json:()=>r});const r=e=>{if(null==e)return{};if(Array.isArray(e))return e.filter((e=>null!=e)).map(r);if("object"==typeof e){const t={};for(const n of Object.keys(e))null!=e[n]&&(t[n]=r(e[n]));return t}return e}},13094:(e,t,n)=>{"use strict";function r(e,t,n){if(n<=0||!Number.isInteger(n))throw new Error("Invalid number of delimiters ("+n+") for splitEvery.");const r=e.split(t);if(1===n)return r;const i=[];let a="";for(let e=0;er})},28444:(e,t,n)=>{"use strict";n.r(t),n.d(t,{splitHeader:()=>r});const r=e=>{const t=e.length,n=[];let r,i=!1,a=0;for(let o=0;o{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))}))}},40361:(e,t,n)=>{"use strict";n.r(t)},45157:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{HttpApiKeyAuthLocation:()=>r}),function(e){e.HEADER="header",e.QUERY="query"}(r||(r={}))},61137:(e,t,n)=>{"use strict";n.r(t)},97704:(e,t,n)=>{"use strict";n.r(t)},6934:(e,t,n)=>{"use strict";n.r(t)},89497:(e,t,n)=>{"use strict";n.r(t)},10450:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{HttpAuthLocation:()=>r}),function(e){e.HEADER="header",e.QUERY="query"}(r||(r={}))},79638:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HttpApiKeyAuthLocation:()=>i.HttpApiKeyAuthLocation,HttpAuthLocation:()=>r.HttpAuthLocation});var r=n(10450),i=n(45157);n(61137),n(97704),n(6934),n(89497)},1386:(e,t,n)=>{"use strict";n.r(t)},67932:(e,t,n)=>{"use strict";n.r(t)},26304:(e,t,n)=>{"use strict";n.r(t)},27382:(e,t,n)=>{"use strict";n.r(t)},39560:(e,t,n)=>{"use strict";n.r(t)},8468:(e,t,n)=>{"use strict";n.r(t),n(39560),n(76183),n(33276)},76183:(e,t,n)=>{"use strict";n.r(t)},33276:(e,t,n)=>{"use strict";n.r(t)},42017:(e,t,n)=>{"use strict";n.r(t)},43585:(e,t,n)=>{"use strict";n.r(t)},9134:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{EndpointURLScheme:()=>r}),function(e){e.HTTP="http",e.HTTPS="https"}(r||(r={}))},82320:(e,t,n)=>{"use strict";n.r(t)},43561:(e,t,n)=>{"use strict";n.r(t)},70827:(e,t,n)=>{"use strict";n.r(t)},27013:(e,t,n)=>{"use strict";n.r(t)},40462:(e,t,n)=>{"use strict";n.r(t),n(82320),n(43561),n(70827),n(73881),n(27013)},73881:(e,t,n)=>{"use strict";n.r(t)},75675:(e,t,n)=>{"use strict";n.r(t)},76839:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{AlgorithmId:()=>r,getChecksumConfiguration:()=>i,resolveChecksumRuntimeConfig:()=>a}),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(r||(r={}));const i=e=>{const t=[];return void 0!==e.sha256&&t.push({algorithmId:()=>r.SHA256,checksumConstructor:()=>e.sha256}),null!=e.md5&&t.push({algorithmId:()=>r.MD5,checksumConstructor:()=>e.md5}),{_checksumAlgorithms:t,addChecksumAlgorithm(e){this._checksumAlgorithms.push(e)},checksumAlgorithms(){return this._checksumAlgorithms}}},a=e=>{const t={};return e.checksumAlgorithms().forEach((e=>{t[e.algorithmId()]=e.checksumConstructor()})),t}},29208:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDefaultClientConfiguration:()=>i,resolveDefaultRuntimeConfig:()=>a});var r=n(76839);const i=e=>({...(0,r.getChecksumConfiguration)(e)}),a=e=>({...(0,r.resolveChecksumRuntimeConfig)(e)})},22358:(e,t,n)=>{"use strict";n.r(t)},72938:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AlgorithmId:()=>i.AlgorithmId,getDefaultClientConfiguration:()=>r.getDefaultClientConfiguration,resolveDefaultRuntimeConfig:()=>r.resolveDefaultRuntimeConfig});var r=n(29208),i=(n(22358),n(76839))},29138:(e,t,n)=>{"use strict";n.r(t)},12739:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{FieldPosition:()=>r}),function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(r||(r={}))},4096:(e,t,n)=>{"use strict";n.r(t)},26845:(e,t,n)=>{"use strict";n.r(t)},31828:(e,t,n)=>{"use strict";n.r(t)},7750:(e,t,n)=>{"use strict";n.r(t)},84482:(e,t,n)=>{"use strict";n.r(t),n(26845),n(31828),n(7750),n(37237)},37237:(e,t,n)=>{"use strict";n.r(t)},23911:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AlgorithmId:()=>a.AlgorithmId,EndpointURLScheme:()=>i.EndpointURLScheme,FieldPosition:()=>o.FieldPosition,HttpApiKeyAuthLocation:()=>r.HttpApiKeyAuthLocation,HttpAuthLocation:()=>r.HttpAuthLocation,IniSectionType:()=>l.IniSectionType,RequestHandlerProtocol:()=>u.RequestHandlerProtocol,SMITHY_CONTEXT_KEY:()=>s.SMITHY_CONTEXT_KEY,getDefaultClientConfiguration:()=>a.getDefaultClientConfiguration,resolveDefaultRuntimeConfig:()=>a.resolveDefaultRuntimeConfig}),n(40361);var r=n(79638),i=(n(1386),n(67932),n(26304),n(27382),n(8468),n(42017),n(43585),n(9134)),a=(n(40462),n(75675),n(72938)),o=(n(29138),n(12739)),s=(n(4096),n(84482),n(28607),n(7267)),l=(n(7867),n(25578)),u=(n(47168),n(24105),n(31722),n(8489),n(88321),n(34755),n(7773),n(3265),n(29424),n(92236));n(46001),n(73072),n(1987),n(88561),n(78119),n(19057)},28607:(e,t,n)=>{"use strict";n.r(t)},7267:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SMITHY_CONTEXT_KEY:()=>r});const r="__smithy_context"},7867:(e,t,n)=>{"use strict";n.r(t)},25578:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{IniSectionType:()=>r}),function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"}(r||(r={}))},47168:(e,t,n)=>{"use strict";n.r(t)},24105:(e,t,n)=>{"use strict";n.r(t)},31722:(e,t,n)=>{"use strict";n.r(t)},8489:(e,t,n)=>{"use strict";n.r(t)},88321:(e,t,n)=>{"use strict";n.r(t)},34755:(e,t,n)=>{"use strict";n.r(t)},7773:(e,t,n)=>{"use strict";n.r(t)},3265:(e,t,n)=>{"use strict";n.r(t)},29424:(e,t,n)=>{"use strict";n.r(t)},92236:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{RequestHandlerProtocol:()=>r}),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(r||(r={}))},46001:(e,t,n)=>{"use strict";n.r(t)},73072:(e,t,n)=>{"use strict";n.r(t)},1987:(e,t,n)=>{"use strict";n.r(t)},88561:(e,t,n)=>{"use strict";n.r(t)},78119:(e,t,n)=>{"use strict";n.r(t)},19057:(e,t,n)=>{"use strict";n.r(t)},18065:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseUrl:()=>i});var r=n(14757);const i=e=>{if("string"==typeof e)return i(new URL(e));const{hostname:t,pathname:n,port:a,protocol:o,search:s}=e;let l;return s&&(l=(0,r.parseQueryString)(s)),{hostname:t,port:a?parseInt(a):void 0,protocol:o,path:n,query:l}}},23193:(e,t,n)=>{"use strict";n.r(t),n.d(t,{alphabetByEncoding:()=>r,alphabetByValue:()=>i,bitsPerByte:()=>o,bitsPerLetter:()=>a,maxLetterValue:()=>s});const r={},i=new Array(64);for(let e=0,t="A".charCodeAt(0),n="Z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t);r[n]=e,i[e]=n}for(let e=0,t="a".charCodeAt(0),n="z".charCodeAt(0);e+t<=n;e++){const n=String.fromCharCode(e+t),a=e+26;r[n]=a,i[a]=n}for(let e=0;e<10;e++){r[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;r[t]=n,i[n]=t}r["+"]=62,i[62]="+",r["/"]=63,i[63]="/";const a=6,o=8,s=63},88893:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromBase64:()=>i});var r=n(23193);const i=e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const n=new ArrayBuffer(t),i=new DataView(n);for(let t=0;t>=r.bitsPerLetter;const o=t/4*3;n>>=a%r.bitsPerByte;const s=Math.floor(a/r.bitsPerByte);for(let e=0;e>t)}}return new Uint8Array(n)}},33470:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromBase64:()=>r.fromBase64,toBase64:()=>i.toBase64});var r=n(88893),i=n(19328)},19328:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toBase64:()=>a});var r=n(14246),i=n(23193);function a(e){let t;t="string"==typeof e?(0,r.fromUtf8)(e):e;const n="object"==typeof t&&"number"==typeof t.length,a="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!n&&!a)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let e=0;e>t]}o+="==".slice(0,4-a)}return o}},42117:(e,t,n)=>{"use strict";n.r(t),n.d(t,{calculateBodyLength:()=>i});const r="function"==typeof TextEncoder?new TextEncoder:null,i=e=>{if("string"==typeof e){if(r)return r.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)}},25441:(e,t,n)=>{"use strict";n.r(t),n.d(t,{calculateBodyLength:()=>r.calculateBodyLength});var r=n(42117)},65938:(e,t,n)=>{"use strict";n.r(t),n.d(t,{booleanSelector:()=>r});const r=(e,t,n)=>{if(t in e){if("true"===e[t])return!0;if("false"===e[t])return!1;throw new Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}}},20235:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SelectorType:()=>a.SelectorType,booleanSelector:()=>r.booleanSelector,numberSelector:()=>i.numberSelector});var r=n(65938),i=n(19663),a=n(63466)},19663:(e,t,n)=>{"use strict";n.r(t),n.d(t,{numberSelector:()=>r});const r=(e,t,n)=>{if(!(t in e))return;const r=parseInt(e[t],10);if(Number.isNaN(r))throw new TypeError(`Cannot load ${n} '${t}'. Expected number, got '${e[t]}'.`);return r}},63466:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{SelectorType:()=>r}),function(e){e.ENV="env",e.CONFIG="shared config entry"}(r||(r={}))},63401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULTS_MODE_OPTIONS:()=>r});const r=["in-region","cross-region","mobile","standard","legacy"]},89124:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveDefaultsModeConfig:()=>r.resolveDefaultsModeConfig});var r=n(48695)},48695:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveDefaultsModeConfig:()=>s});var r=n(10223),i=n(46880),a=n.n(i),o=n(63401);const s=({defaultsMode:e}={})=>(0,r.memoize)((async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(l()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${o.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${t}`)}})),l=()=>{const e="undefined"!=typeof window&&window?.navigator?.userAgent?a().parse(window.navigator.userAgent):void 0,t=e?.platform?.type;return"tablet"===t||"mobile"===t}},97461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointCache:()=>r});class r{constructor({size:e,params:t}){this.data=new Map,this.parameters=[],this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}},27567:(e,t,n)=>{"use strict";n.r(t),n.d(t,{debugId:()=>r});const r="endpoints"},19105:(e,t,n)=>{"use strict";n.r(t),n.d(t,{debugId:()=>r.debugId,toDebugString:()=>i.toDebugString});var r=n(27567),i=n(84244)},84244:(e,t,n)=>{"use strict";function r(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${r(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(r).join(", ")})`:JSON.stringify(e,null,2)}n.r(t),n.d(t,{toDebugString:()=>r})},7069:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointCache:()=>r.EndpointCache,EndpointError:()=>l.EndpointError,customEndpointFunctions:()=>o.customEndpointFunctions,isIpAddress:()=>i.isIpAddress,isValidHostLabel:()=>a.isValidHostLabel,resolveEndpoint:()=>s.resolveEndpoint});var r=n(97461),i=n(81466),a=n(18883),o=n(70468),s=n(36704),l=n(97531)},46664:(e,t,n)=>{"use strict";n.r(t),n.d(t,{booleanEquals:()=>r});const r=(e,t)=>e===t},62786:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAttr:()=>a});var r=n(97531),i=n(6305);const a=(e,t)=>(0,i.getAttrPathList)(t).reduce(((n,i)=>{if("object"!=typeof n)throw new r.EndpointError(`Index '${i}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(i)]:n[i]}),e)},6305:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAttrPathList:()=>i});var r=n(97531);const i=e=>{const t=e.split("."),n=[];for(const i of t){const t=i.indexOf("[");if(-1!==t){if(i.indexOf("]")!==i.length-1)throw new r.EndpointError(`Path: '${e}' does not end with ']'`);const a=i.slice(t+1,-1);if(Number.isNaN(parseInt(a)))throw new r.EndpointError(`Invalid array index: '${a}' in path: '${e}'`);0!==t&&n.push(i.slice(0,t)),n.push(a)}else n.push(i)}return n}},13317:(e,t,n)=>{"use strict";n.r(t),n.d(t,{booleanEquals:()=>r.booleanEquals,getAttr:()=>i.getAttr,isSet:()=>a.isSet,isValidHostLabel:()=>o.isValidHostLabel,not:()=>s.not,parseURL:()=>l.parseURL,stringEquals:()=>u.stringEquals,substring:()=>c.substring,uriEncode:()=>d.uriEncode});var r=n(46664),i=n(62786),a=n(2829),o=n(18883),s=n(19568),l=n(96989),u=n(30773),c=n(74454),d=n(13141)},81466:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isIpAddress:()=>i});const r=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),i=e=>r.test(e)||e.startsWith("[")&&e.endsWith("]")},2829:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isSet:()=>r});const r=e=>null!=e},18883:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isValidHostLabel:()=>i});const r=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),i=(e,t=!1)=>{if(!t)return r.test(e);const n=e.split(".");for(const e of n)if(!i(e))return!1;return!0}},19568:(e,t,n)=>{"use strict";n.r(t),n.d(t,{not:()=>r});const r=e=>!e},96989:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseURL:()=>o});var r=n(23911),i=n(81466);const a={[r.EndpointURLScheme.HTTP]:80,[r.EndpointURLScheme.HTTPS]:443},o=e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:i="",query:a={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:""}${i}`);return o.search=Object.entries(a).map((([e,t])=>`${e}=${t}`)).join("&"),o}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:o,hostname:s,pathname:l,protocol:u,search:c}=t;if(c)return null;const d=u.slice(0,-1);if(!Object.values(r.EndpointURLScheme).includes(d))return null;const f=(0,i.isIpAddress)(s);return{scheme:d,authority:`${o}${n.includes(`${o}:${a[d]}`)||"string"==typeof e&&e.includes(`${o}:${a[d]}`)?`:${a[d]}`:""}`,path:l,normalizedPath:l.endsWith("/")?l:`${l}/`,isIp:f}}},30773:(e,t,n)=>{"use strict";n.r(t),n.d(t,{stringEquals:()=>r});const r=(e,t)=>e===t},74454:(e,t,n)=>{"use strict";n.r(t),n.d(t,{substring:()=>r});const r=(e,t,n,r)=>t>=n||e.length{"use strict";n.r(t),n.d(t,{uriEncode:()=>r});const r=e=>encodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},36704:(e,t,n)=>{"use strict";n.r(t),n.d(t,{resolveEndpoint:()=>o});var r=n(19105),i=n(97531),a=n(52479);const o=(e,t)=>{const{endpointParams:n,logger:o}=t,{parameters:s,rules:l}=e;t.logger?.debug?.(`${r.debugId} Initial EndpointParams: ${(0,r.toDebugString)(n)}`);const u=Object.entries(s).filter((([,e])=>null!=e.default)).map((([e,t])=>[e,t.default]));if(u.length>0)for(const[e,t]of u)n[e]=n[e]??t;const c=Object.entries(s).filter((([,e])=>e.required)).map((([e])=>e));for(const e of c)if(null==n[e])throw new i.EndpointError(`Missing required parameter: '${e}'`);const d=(0,a.evaluateRules)(l,{endpointParams:n,logger:o,referenceRecord:{}});return t.logger?.debug?.(`${r.debugId} Resolved endpoint: ${(0,r.toDebugString)(d)}`),d}},70246:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointError:()=>r});class r extends Error{constructor(e){super(e),this.name="EndpointError"}}},85845:(e,t,n)=>{"use strict";n.r(t)},18195:(e,t,n)=>{"use strict";n.r(t)},85060:(e,t,n)=>{"use strict";n.r(t)},32534:(e,t,n)=>{"use strict";n.r(t)},27174:(e,t,n)=>{"use strict";n.r(t)},97531:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EndpointError:()=>r.EndpointError});var r=n(70246);n(85845),n(18195),n(85060),n(32534),n(27174),n(63526)},63526:(e,t,n)=>{"use strict";n.r(t)},88307:(e,t,n)=>{"use strict";n.r(t),n.d(t,{callFunction:()=>o});var r=n(70468),i=n(49905),a=n(22226);const o=({fn:e,argv:t},n)=>{const o=t.map((e=>["boolean","number"].includes(typeof e)?e:(0,a.evaluateExpression)(e,"arg",n))),s=e.split(".");return s[0]in r.customEndpointFunctions&&null!=s[1]?r.customEndpointFunctions[s[0]][s[1]](...o):i.endpointFunctions[e](...o)}},70468:(e,t,n)=>{"use strict";n.r(t),n.d(t,{customEndpointFunctions:()=>r});const r={}},49905:(e,t,n)=>{"use strict";n.r(t),n.d(t,{endpointFunctions:()=>i});var r=n(13317);const i={booleanEquals:r.booleanEquals,getAttr:r.getAttr,isSet:r.isSet,isValidHostLabel:r.isValidHostLabel,not:r.not,parseURL:r.parseURL,stringEquals:r.stringEquals,substring:r.substring,uriEncode:r.uriEncode}},62183:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateCondition:()=>o});var r=n(19105),i=n(97531),a=n(88307);const o=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new i.EndpointError(`'${e}' is already defined in Reference Record.`);const o=(0,a.callFunction)(t,n);return n.logger?.debug?.(`${r.debugId} evaluateCondition: ${(0,r.toDebugString)(t)} = ${(0,r.toDebugString)(o)}`),{result:""===o||!!o,...null!=e&&{toAssign:{name:e,value:o}}}}},20082:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateConditions:()=>a});var r=n(19105),i=n(62183);const a=(e=[],t)=>{const n={};for(const a of e){const{result:e,toAssign:o}=(0,i.evaluateCondition)(a,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};o&&(n[o.name]=o.value,t.logger?.debug?.(`${r.debugId} assign: ${o.name} := ${(0,r.toDebugString)(o.value)}`))}return{result:!0,referenceRecord:n}}},16075:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateEndpointRule:()=>l});var r=n(19105),i=n(20082),a=n(11398),o=n(67911),s=n(99981);const l=(e,t)=>{const{conditions:n,endpoint:l}=e,{result:u,referenceRecord:c}=(0,i.evaluateConditions)(n,t);if(!u)return;const d={...t,referenceRecord:{...t.referenceRecord,...c}},{url:f,properties:p,headers:h}=l;return t.logger?.debug?.(`${r.debugId} Resolving endpoint from template: ${(0,r.toDebugString)(l)}`),{...null!=h&&{headers:(0,a.getEndpointHeaders)(h,d)},...null!=p&&{properties:(0,o.getEndpointProperties)(p,d)},url:(0,s.getEndpointUrl)(f,d)}}},88562:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateErrorRule:()=>o});var r=n(97531),i=n(20082),a=n(22226);const o=(e,t)=>{const{conditions:n,error:o}=e,{result:s,referenceRecord:l}=(0,i.evaluateConditions)(n,t);if(s)throw new r.EndpointError((0,a.evaluateExpression)(o,"Error",{...t,referenceRecord:{...t.referenceRecord,...l}}))}},22226:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateExpression:()=>s});var r=n(97531),i=n(88307),a=n(27206),o=n(29445);const s=(e,t,n)=>{if("string"==typeof e)return(0,a.evaluateTemplate)(e,n);if(e.fn)return(0,i.callFunction)(e,n);if(e.ref)return(0,o.getReferenceValue)(e,n);throw new r.EndpointError(`'${t}': ${String(e)} is not a string, function or reference.`)}},78985:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateRules:()=>s});var r=n(97531),i=n(16075),a=n(88562),o=n(67414);const s=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=(0,i.evaluateEndpointRule)(n,t);if(e)return e}else if("error"===n.type)(0,a.evaluateErrorRule)(n,t);else{if("tree"!==n.type)throw new r.EndpointError(`Unknown endpoint rule: ${n}`);{const e=(0,o.evaluateTreeRule)(n,t);if(e)return e}}throw new r.EndpointError("Rules evaluation failed")}},27206:(e,t,n)=>{"use strict";n.r(t),n.d(t,{evaluateTemplate:()=>i});var r=n(13317);const i=(e,t)=>{const n=[],i={...t.endpointParams,...t.referenceRecord};let a=0;for(;a{"use strict";n.r(t),n.d(t,{evaluateTreeRule:()=>a});var r=n(20082),i=n(78985);const a=(e,t)=>{const{conditions:n,rules:a}=e,{result:o,referenceRecord:s}=(0,r.evaluateConditions)(n,t);if(o)return(0,i.evaluateRules)(a,{...t,referenceRecord:{...t.referenceRecord,...s}})}},11398:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointHeaders:()=>a});var r=n(97531),i=n(22226);const a=(e,t)=>Object.entries(e).reduce(((e,[n,a])=>({...e,[n]:a.map((e=>{const a=(0,i.evaluateExpression)(e,"Header value entry",t);if("string"!=typeof a)throw new r.EndpointError(`Header '${n}' value '${a}' is not a string`);return a}))})),{})},67911:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointProperties:()=>i});var r=n(63355);const i=(e,t)=>Object.entries(e).reduce(((e,[n,i])=>({...e,[n]:(0,r.getEndpointProperty)(i,t)})),{})},63355:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointProperty:()=>o});var r=n(97531),i=n(27206),a=n(67911);const o=(e,t)=>{if(Array.isArray(e))return e.map((e=>o(e,t)));switch(typeof e){case"string":return(0,i.evaluateTemplate)(e,t);case"object":if(null===e)throw new r.EndpointError(`Unexpected endpoint property: ${e}`);return(0,a.getEndpointProperties)(e,t);case"boolean":return e;default:throw new r.EndpointError("Unexpected endpoint property type: "+typeof e)}}},99981:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getEndpointUrl:()=>a});var r=n(97531),i=n(22226);const a=(e,t)=>{const n=(0,i.evaluateExpression)(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new r.EndpointError("Endpoint URL must be a string, got "+typeof n)}},29445:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getReferenceValue:()=>r});const r=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e])},52479:(e,t,n)=>{"use strict";n.r(t),n.d(t,{customEndpointFunctions:()=>r.customEndpointFunctions,evaluateRules:()=>i.evaluateRules});var r=n(70468),i=n(78985)},68004:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromHex:()=>a,toHex:()=>o});const r={},i={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),r[e]=t,i[t]=e}function a(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n{"use strict";n.r(t),n.d(t,{getSmithyContext:()=>i});var r=n(23911);const i=e=>e[r.SMITHY_CONTEXT_KEY]||(e[r.SMITHY_CONTEXT_KEY]={})},40805:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getSmithyContext:()=>r.getSmithyContext,normalizeProvider:()=>i.normalizeProvider});var r=n(26116),i=n(28947)},28947:(e,t,n)=>{"use strict";n.r(t),n.d(t,{normalizeProvider:()=>r});const r=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t}},18892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdaptiveRetryStrategy:()=>o});var r=n(17355),i=n(2816),a=n(16281);class o{constructor(e,t){this.maxAttemptsProvider=e,this.mode=r.RETRY_MODES.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new i.DefaultRateLimiter,this.standardRetryStrategy=new a.StandardRetryStrategy(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}},39366:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConfiguredRetryStrategy:()=>a});var r=n(77072),i=n(16281);class a extends i.StandardRetryStrategy{constructor(e,t=r.DEFAULT_RETRY_DELAY_BASE){super("function"==typeof e?e:async()=>e),this.computeNextBackoffDelay="number"==typeof t?()=>t:t}async refreshRetryTokenForRetry(e,t){const n=await super.refreshRetryTokenForRetry(e,t);return n.getRetryDelay=()=>this.computeNextBackoffDelay(n.getRetryCount()),n}}},2816:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DefaultRateLimiter:()=>i});var r=n(42653);class i{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise((e=>setTimeout(e,t)))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),(0,r.isThrottlingError)(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}},16281:(e,t,n)=>{"use strict";n.r(t),n.d(t,{StandardRetryStrategy:()=>s});var r=n(17355),i=n(77072),a=n(73467),o=n(651);class s{constructor(e){this.maxAttempts=e,this.mode=r.RETRY_MODES.STANDARD,this.capacity=i.INITIAL_RETRY_TOKENS,this.retryBackoffStrategy=(0,a.getDefaultRetryBackoffStrategy)(),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return(0,o.createDefaultRetryToken)({retryDelay:i.DEFAULT_RETRY_DELAY_BASE,retryCount:0})}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?i.THROTTLING_RETRY_DELAY_BASE:i.DEFAULT_RETRY_DELAY_BASE);const r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),a=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,s=this.getCapacityCost(n);return this.capacity-=s,(0,o.createDefaultRetryToken)({retryDelay:a,retryCount:e.getRetryCount()+1,retryCost:s})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(i.INITIAL_RETRY_TOKENS,this.capacity+(e.getRetryCost()??i.NO_RETRY_INCREMENT))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(`Max attempts provider could not resolve. Using default of ${r.DEFAULT_MAX_ATTEMPTS}`),r.DEFAULT_MAX_ATTEMPTS}}shouldRetry(e,t,n){return e.getRetryCount()+1=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return"TRANSIENT"===e?i.TIMEOUT_RETRY_COST:i.RETRY_COST}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}},17355:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{DEFAULT_MAX_ATTEMPTS:()=>i,DEFAULT_RETRY_MODE:()=>a,RETRY_MODES:()=>r}),function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(r||(r={}));const i=3,a=r.STANDARD},77072:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_RETRY_DELAY_BASE:()=>r,INITIAL_RETRY_TOKENS:()=>o,INVOCATION_ID_HEADER:()=>c,MAXIMUM_RETRY_DELAY:()=>i,NO_RETRY_INCREMENT:()=>u,REQUEST_HEADER:()=>d,RETRY_COST:()=>s,THROTTLING_RETRY_DELAY_BASE:()=>a,TIMEOUT_RETRY_COST:()=>l});const r=100,i=2e4,a=500,o=500,s=5,l=10,u=1,c="amz-sdk-invocation-id",d="amz-sdk-request"},73467:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDefaultRetryBackoffStrategy:()=>i});var r=n(77072);const i=()=>{let e=r.DEFAULT_RETRY_DELAY_BASE;return{computeNextBackoffDelay:t=>Math.floor(Math.min(r.MAXIMUM_RETRY_DELAY,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}}},651:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createDefaultRetryToken:()=>i});var r=n(77072);const i=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(r.MAXIMUM_RETRY_DELAY,e),getRetryCost:()=>n})},56265:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AdaptiveRetryStrategy:()=>r.AdaptiveRetryStrategy,ConfiguredRetryStrategy:()=>i.ConfiguredRetryStrategy,DEFAULT_MAX_ATTEMPTS:()=>s.DEFAULT_MAX_ATTEMPTS,DEFAULT_RETRY_DELAY_BASE:()=>l.DEFAULT_RETRY_DELAY_BASE,DEFAULT_RETRY_MODE:()=>s.DEFAULT_RETRY_MODE,DefaultRateLimiter:()=>a.DefaultRateLimiter,INITIAL_RETRY_TOKENS:()=>l.INITIAL_RETRY_TOKENS,INVOCATION_ID_HEADER:()=>l.INVOCATION_ID_HEADER,MAXIMUM_RETRY_DELAY:()=>l.MAXIMUM_RETRY_DELAY,NO_RETRY_INCREMENT:()=>l.NO_RETRY_INCREMENT,REQUEST_HEADER:()=>l.REQUEST_HEADER,RETRY_COST:()=>l.RETRY_COST,RETRY_MODES:()=>s.RETRY_MODES,StandardRetryStrategy:()=>o.StandardRetryStrategy,THROTTLING_RETRY_DELAY_BASE:()=>l.THROTTLING_RETRY_DELAY_BASE,TIMEOUT_RETRY_COST:()=>l.TIMEOUT_RETRY_COST});var r=n(18892),i=n(39366),a=n(2816),o=n(16281),s=n(17355),l=n(77072);n(87128)},87128:(e,t,n)=>{"use strict";n.r(t)},36444:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Uint8ArrayBlobAdapter:()=>i});var r=n(84068);class i extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return(0,r.transformFromString)(e,t);throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,i.prototype),e}transformToString(e="utf-8"){return(0,r.transformToString)(this,e)}}},84068:(e,t,n)=>{"use strict";n.r(t),n.d(t,{transformFromString:()=>s,transformToString:()=>o});var r=n(33470),i=n(14246),a=n(36444);function o(e,t="utf-8"){return"base64"===t?(0,r.toBase64)(e):(0,i.toUtf8)(e)}function s(e,t){return"base64"===t?a.Uint8ArrayBlobAdapter.mutate((0,r.fromBase64)(e)):a.Uint8ArrayBlobAdapter.mutate((0,i.fromUtf8)(e))}},44312:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ChecksumStream:()=>i});const r="function"==typeof ReadableStream?ReadableStream:function(){};class i extends r{}},48188:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createChecksumStream:()=>o});var r=n(33470),i=n(55163),a=n(44312);const o=({expectedChecksum:e,checksum:t,source:n,checksumSourceLocation:o,base64Encoder:s})=>{if(!(0,i.isReadableStream)(n))throw new Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);const l=s??r.toBase64;if("function"!=typeof TransformStream)throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const u=new TransformStream({start(){},async transform(e,n){t.update(e),n.enqueue(e)},async flush(n){const r=await t.digest(),i=l(r);if(e!==i){const t=new Error(`Checksum mismatch: expected "${e}" but received "${i}" in response header "${o}".`);n.error(t)}else n.terminate()}});n.pipeThrough(u);const c=u.readable;return Object.setPrototypeOf(c,a.ChecksumStream.prototype),c}},41125:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAwsChunkedEncodingStream:()=>r});const r=(e,t)=>{const{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:a,streamHasher:o}=t,s=void 0!==n&&void 0!==r&&void 0!==i&&void 0!==a&&void 0!==o,l=s?o(i,e):void 0,u=e.getReader();return new ReadableStream({async pull(e){const{value:t,done:i}=await u.read();if(i){if(e.enqueue("0\r\n"),s){const t=n(await l);e.enqueue(`${a}:${t}\r\n`),e.enqueue("\r\n")}e.close()}else e.enqueue(`${(r(t)||0).toString(16)}\r\n${t}\r\n`)}})}},7769:(e,t,n)=>{"use strict";async function r(e,t){let n=0;const r=[],i=e.getReader();let a=!1;for(;!a;){const{done:e,value:o}=await i.read();if(o&&(r.push(o),n+=o?.byteLength??0),n>=t)break;a=e}i.releaseLock();const o=new Uint8Array(Math.min(t,n));let s=0;for(const e of r){if(e.byteLength>o.byteLength-s){o.set(e.subarray(0,o.byteLength-s),s);break}o.set(e,s),s+=e.length}return o}n.r(t),n.d(t,{headStream:()=>r})},42357:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ChecksumStream:()=>c.ChecksumStream,Uint8ArrayBlobAdapter:()=>r.Uint8ArrayBlobAdapter,createChecksumStream:()=>u.createChecksumStream,getAwsChunkedEncodingStream:()=>i.getAwsChunkedEncodingStream,headStream:()=>s.headStream,isReadableStream:()=>l.isReadableStream,sdkStreamMixin:()=>a.sdkStreamMixin,splitStream:()=>o.splitStream});var r=n(36444),i=n(41125),a=n(23880),o=n(67231),s=n(7769),l=n(55163),u=n(48188),c=n(44312)},23880:(e,t,n)=>{"use strict";n.r(t),n.d(t,{sdkStreamMixin:()=>u});var r=n(61664),i=n(33470),a=n(68004),o=n(14246),s=n(55163);const l="The stream has already been transformed.",u=e=>{if(!c(e)&&!(0,s.isReadableStream)(e))throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`);let t=!1;const n=async()=>{if(t)throw new Error(l);return t=!0,await(0,r.streamCollector)(e)};return Object.assign(e,{transformToByteArray:n,transformToString:async e=>{const t=await n();if("base64"===e)return(0,i.toBase64)(t);if("hex"===e)return(0,a.toHex)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,o.toUtf8)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(l);if(t=!0,c(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if((0,s.isReadableStream)(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},c=e=>"function"==typeof Blob&&e instanceof Blob},67231:(e,t,n)=>{"use strict";async function r(e){return"function"==typeof e.stream&&(e=e.stream()),e.tee()}n.r(t),n.d(t,{splitStream:()=>r})},55163:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isReadableStream:()=>r});const r=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream)},34915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{escapeUriPath:()=>i});var r=n(72531);const i=e=>e.split("/").map(r.escapeUri).join("/")},72531:(e,t,n)=>{"use strict";n.r(t),n.d(t,{escapeUri:()=>r});const r=e=>encodeURIComponent(e).replace(/[!'()*]/g,i),i=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`},78611:(e,t,n)=>{"use strict";n.r(t),n.d(t,{escapeUri:()=>r.escapeUri,escapeUriPath:()=>i.escapeUriPath});var r=n(72531),i=n(34915)},42637:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromUtf8:()=>r});const r=e=>(new TextEncoder).encode(e)},14246:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromUtf8:()=>r.fromUtf8,toUint8Array:()=>i.toUint8Array,toUtf8:()=>a.toUtf8});var r=n(42637),i=n(74424),a=n(65792)},74424:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toUint8Array:()=>i});var r=n(42637);const i=e=>"string"==typeof e?(0,r.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)},65792:(e,t,n)=>{"use strict";n.r(t),n.d(t,{toUtf8:()=>r});const r=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)}},67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=s(e),o=a[0],l=a[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),c=0,d=l>0?o-4:o;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;su?u:s+o));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;function s(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("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,a,o=[],s=t;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},46880:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,l=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===s)return 0;o-=1}else if(l[0][o]1?i-1:0),o=1;o0){var o=Object.keys(n),l=s.default.find(o,(function(e){return t.isOS(e)}));if(l){var u=this.satisfies(n[l]);if(void 0!==u)return u}var c=s.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var d=this.satisfies(n[c]);if(void 0!==d)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},48287:(e,t,n)=>{"use strict";const r=n(67526),i=n(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=s(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||K(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.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)}function c(e){if("number"!=typeof e)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 d(e){return c(e),s(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),n=s(t);for(let r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return r?-1:V(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+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)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){let a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let r=-1;for(a=n;as&&(n=s-l),a=n;a>=0;a--){let n=!0;for(let r=0;ri&&(r=i):r=i;const a=t.length;let o;for(r>a/2&&(r=a/2),o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(a=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=o}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const s=Math.min(a,o),u=this.slice(r,i),c=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function k(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r,i){q(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function M(e,t,n,r,i){q(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function I(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(e,t,n,r,a){return t=+t,n>>>=0,a||I(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,a){return t=+t,n>>>=0,a||I(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,a=0;for(;++a=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||F(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||F(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);F(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!r){const r=Math.pow(2,8*n-1);F(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return $(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return $(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function q(e,t,n,r,i,a){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,a)}function j(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new B.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("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=z(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(e,t){let n;t=t||1/0;const r=e.length;let i=null;const a=[];for(let o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function W(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Q(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},86454:(e,t,n)=>{"use strict";const r=n(43918),i=n(32923),a=n(8904);e.exports={XMLParser:i,XMLValidator:r,XMLBuilder:a}},35334:(e,t)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let a=0;a{"use strict";const r=n(35334),i={allowBooleanAttributes:!1,unpairedTags:[]};function a(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function o(e,t){const n=t;for(;t5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},i,t);const n=[];let l=!1,u=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)v+=e[i];if(v=v.trim(),"/"===v[v.length-1]&&(v=v.substring(0,v.length-1),i--),d=v,!r.isName(d)){let t;return t=0===v.trim().length?"Invalid space after '<'.":"Tag '"+v+"' is an invalid name.",h("InvalidTag",t,m(e,i))}const b=c(e,i);if(!1===b)return h("InvalidAttr","Attributes for '"+v+"' have open quote.",m(e,i));let w=b.value;if(i=b.index,"/"===w[w.length-1]){const n=i-w.length;w=w.substring(0,w.length-1);const r=f(w,t);if(!0!==r)return h(r.err.code,r.err.msg,m(e,n+r.err.line));l=!0}else if(y){if(!b.tagClosed)return h("InvalidTag","Closing tag '"+v+"' doesn't have proper closing.",m(e,i));if(w.trim().length>0)return h("InvalidTag","Closing tag '"+v+"' can't have attributes or invalid starting.",m(e,g));if(0===n.length)return h("InvalidTag","Closing tag '"+v+"' has not been opened.",m(e,g));{const t=n.pop();if(v!==t.tagName){let n=m(e,t.tagStartPos);return h("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+v+"'.",m(e,g))}0==n.length&&(u=!0)}}else{const r=f(w,t);if(!0!==r)return h(r.err.code,r.err.msg,m(e,i-w.length+r.err.line));if(!0===u)return h("InvalidXml","Multiple possible root nodes found.",m(e,i));-1!==t.unpairedTags.indexOf(v)||n.push({tagName:v,tagStartPos:g}),l=!0}for(i++;i0)||h("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};const l='"',u="'";function c(e,t){let n="",r="",i=!1;for(;t"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function f(e,t){const n=r.getAllMatches(e,d),i={};for(let e=0;e{"use strict";const r=n(12788),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function a(e){this.options=Object.assign({},i,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=o,this.options.format?(this.indentate=s,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function o(e,t,n){const r=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}function s(e){return this.options.indentBy.repeat(e)}function l(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}a.prototype.build=function(e){return this.options.preserveOrder?r(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},a.prototype.j2x=function(e,t){let n="",r="";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(void 0===e[i])this.isAttribute(i)&&(r+="");else if(null===e[i])this.isAttribute(i)?r+="":"?"===i[0]?r+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)r+=this.buildTextValNode(e[i],i,"",t);else if("object"!=typeof e[i]){const a=this.isAttribute(i);if(a)n+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){let t=this.options.tagValueProcessor(i,""+e[i]);r+=this.replaceEntitiesValue(t)}else r+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){const n=e[i].length;let a="",o="";for(let s=0;s"+e+i}},a.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>${e}`,t},a.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+``+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+""+t+this.tagEndChar}},a.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t{function t(e,o,s,l){let u="",c=!1;for(let d=0;d`,c=!1;continue}if(p===o.commentPropName){u+=l+`\x3c!--${f[p][0][o.textNodeName]}--\x3e`,c=!0;continue}if("?"===p[0]){const e=r(f[":@"],o),t="?xml"===p?"":l;let n=f[p][0][o.textNodeName];n=0!==n.length?" "+n:"",u+=t+`<${p}${n}${e}?>`,c=!0;continue}let g=l;""!==g&&(g+=o.indentBy);const m=l+`<${p}${r(f[":@"],o)}`,y=t(f[p],o,h,g);-1!==o.unpairedTags.indexOf(p)?o.suppressUnpairedNode?u+=m+">":u+=m+"/>":y&&0!==y.length||!o.suppressEmptyNode?y&&y.endsWith(">")?u+=m+`>${y}${l}${p}>`:(u+=m+">",y&&""!==l&&(y.includes("/>")||y.includes(""))?u+=l+o.indentBy+y+l:u+=y,u+=`${p}>`):u+=m+"/>",c=!0}return u}function n(e){const t=Object.keys(e);for(let n=0;n0&&t.processEntities)for(let n=0;n0&&(r="\n"),t(e,n,"",r)}},9400:(e,t,n)=>{const r=n(35334);function i(e,t){let n="";for(;t"===e[t]){if(f?"-"===e[t-1]&&"-"===e[t-2]&&(f=!1,r--):r--,0===r)break}else"["===e[t]?d=!0:p+=e[t];else{if(d&&o(e,t))t+=7,[entityName,val,t]=i(e,t+1),-1===val.indexOf("&")&&(n[c(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(d&&s(e,t))t+=8;else if(d&&l(e,t))t+=8;else if(d&&u(e,t))t+=9;else{if(!a)throw new Error("Invalid DOCTYPE");f=!0}r++,p=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}},50460:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},17680:(e,t,n)=>{"use strict";const r=n(35334),i=n(23832),a=n(9400),o=n(17983);function s(e){const t=Object.keys(e);for(let n=0;n0)){o||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,i,a);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?w(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function u(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const c=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(e,t,n){if(!this.options.ignoreAttributes&&"string"==typeof e){const n=r.getAllMatches(e,c),i=n.length,a={};for(let e=0;e",s,"Closing Tag is not closed.");let i=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=i.indexOf(":");-1!==e&&(i=i.substr(e+1))}this.options.transformTagName&&(i=this.options.transformTagName(i)),n&&(r=this.saveTextToParentTag(r,n,o));const a=o.substring(o.lastIndexOf(".")+1);if(i&&-1!==this.options.unpairedTags.indexOf(i))throw new Error(`Unpaired tag can not be used as closing tag: ${i}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=o.lastIndexOf("."),o=o.substring(0,l),n=this.tagsNodeStack.pop(),r="",s=t}else if("?"===e[s+1]){let t=v(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,o),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new i(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,o,t.tagName)),this.addChild(n,e,o)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=y(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const i=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,o),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}s=t}else if("!D"===e.substr(s+1,2)){const t=a(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=y(e,"]]>",s,"CDATA is not closed.")-2,i=e.substring(s+9,t);r=this.saveTextToParentTag(r,n,o);let a=this.parseTextData(i,n.tagname,o,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,a),s=t+2}else{let a=v(e,s,this.options.removeNSPrefix),l=a.tagName;const u=a.rawTagName;let c=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,o,!1));const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),l!==t.tagname&&(o+=o?"."+l:l),this.isItStopNode(this.options.stopNodes,o,l)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===l[l.length-1]?(l=l.substr(0,l.length-1),o=o.substr(0,o.length-1),c=l):c=c.substr(0,c.length-1),s=a.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))s=a.closeIndex;else{const n=this.readStopNodeData(e,u,f+1);if(!n)throw new Error(`Unexpected end of ${u}`);s=n.i,t=n.tagContent}const r=new i(l);l!==c&&d&&(r[":@"]=this.buildAttributesMap(c,o,l)),t&&(t=this.parseTextData(t,l,o,!0,d,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,o)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),o=o.substr(0,o.length-1),c=l):c=c.substr(0,c.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const e=new i(l);l!==c&&d&&(e[":@"]=this.buildAttributesMap(c,o,l)),this.addChild(n,e,o),o=o.substr(0,o.lastIndexOf("."))}else{const e=new i(l);this.tagsNodeStack.push(n),l!==c&&d&&(e[":@"]=this.buildAttributesMap(c,o,l)),this.addChild(n,e,o),n=e}r="",s=f}}else r+=e[s];return t.child};function p(e,t,n){const r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const h=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function g(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function m(e,t,n){const r="*."+n;for(const n in e){const i=e[n];if(r===i||t===i)return!0}return!1}function y(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function v(e,t,n,r=">"){const i=function(e,t,n=">"){let r,i="";for(let a=t;a",n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,0===i))return{tagContent:e.substring(r,n),i:a};n=a}else if("?"===e[n+1])n=y(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=y(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=y(e,"]]>",n,"StopNode is not closed.")-2;else{const r=v(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex)}}function w(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&o(e,n)}return r.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"Â¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=s,this.parseXml=f,this.parseTextData=l,this.resolveNameSpace=u,this.buildAttributesMap=d,this.isItStopNode=m,this.replaceEntitiesValue=h,this.readStopNodeData=b,this.saveTextToParentTag=g,this.addChild=p}}},32923:(e,t,n)=>{const{buildOptions:r}=n(50460),i=n(17680),{prettify:a}=n(75629),o=n(43918);e.exports=class{constructor(e){this.externalEntities={},this.options=r(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=o.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new i(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:a(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},75629:(e,t)=>{"use strict";function n(e,t,o){let s;const l={};for(let u=0;u0&&(l[t.textNodeName]=s):void 0!==s&&(l[t.textNodeName]=s),l}function r(e){const t=Object.keys(e);for(let e=0;e{"use strict";e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},251:(e,t)=>{t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<>1,c=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=u}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*g}},65606:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,l=[],u=!1,c=-1;function d(){u&&s&&(u=!1,s.length?l=s.concat(l):c=-1,l.length&&f())}function f(){if(!u){var e=o(d);u=!0;for(var t=l.length;t;){for(s=l,l=[];++c1)for(var n=1;n{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,i={}){if(i=Object.assign({},r,i),!e||"string"!=typeof e)return e;let a=e.trim();if(void 0!==i.skipLike&&i.skipLike.test(a))return e;if(i.hex&&t.test(a))return Number.parseInt(a,16);{const t=n.exec(a);if(t){const n=t[1],r=t[2];let s=(o=t[3])&&-1!==o.indexOf(".")?("."===(o=o.replace(/0+$/,""))?o="0":"."===o[0]?o="0"+o:"."===o[o.length-1]&&(o=o.substr(0,o.length-1)),o):o;const l=t[4]||t[6];if(!i.leadingZeros&&r.length>0&&n&&"."!==a[2])return e;if(!i.leadingZeros&&r.length>0&&!n&&"."!==a[1])return e;{const t=Number(a),o=""+t;return-1!==o.search(/[eE]/)||l?i.eNotation?t:e:-1!==a.indexOf(".")?"0"===o&&""===s||o===s||n&&o==="-"+s?t:e:r?s===o||n+s===o?t:e:a===o||a===n+o?t:e}}return e}var o}},84729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(51636);function i(e){var t,n=(0,r.default)(e.transform),i=1/0,a=i,o=-i,s=-i;function l(e){(e=n(e))[0]o&&(o=e[0]),e[1]s&&(s=e[1])}function u(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,l=e.length;++ro&&(o=t[0]),t[1]s&&(s=t[1])})),e.objects)u(e.objects[t]);return[i,a,o,s]}},78200:(e,t,n)=>{"use strict";function r(e,t){for(var n=0,r=e.length;n>>1;e[i]r})},80658:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a,object:()=>s});var r=n(35258),i=n(51636);function a(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return o(e,t)}))}:o(e,t)}function o(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,a=s(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function s(e,t){var n=(0,i.default)(e.transform),a=e.arcs;function o(e,t){t.length&&t.pop();for(var i=a[e<0?~e:e],o=0,s=i.length;o{"use strict";function r(e){return e}n.r(t),n.d(t,{default:()=>r})},12196:(e,t,n)=>{"use strict";n.r(t),n.d(t,{bbox:()=>r.default,feature:()=>i.default,merge:()=>o.default,mergeArcs:()=>o.mergeArcs,mesh:()=>a.default,meshArcs:()=>a.meshArcs,neighbors:()=>s.default,quantize:()=>l.default,transform:()=>u.default,untransform:()=>c.default});var r=n(84729),i=n(80658),a=n(35623),o=n(92264),s=n(76747),l=n(10157),u=n(51636),c=n(56953)},92264:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a,mergeArcs:()=>o});var r=n(80658),i=n(59391);function a(e){return(0,r.object)(e,o.apply(this,arguments))}function o(e,t){var n={},a=[],o=[];function s(e){e.forEach((function(t){t.forEach((function(t){(n[t=t<0?~t:t]||(n[t]=[])).push(e)}))})),a.push(e)}function l(t){return function(e){for(var t,n=-1,r=e.length,i=e[r-1],a=0;++n1)for(var o,s,u=1,c=l(a[0]);uc&&(s=a[0],a[0]=a[u],a[u]=s,c=o);return a})).filter((function(e){return e.length>0}))}}},35623:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a,meshArcs:()=>o});var r=n(80658),i=n(59391);function a(e){return(0,r.object)(e,o.apply(this,arguments))}function o(e,t,n){var r,a,o;if(arguments.length>1)r=function(e,t,n){var r,i=[],a=[];function o(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:r})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(l)}(t.arcs)}}(t),a.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(a=0,r=new Array(o=e.arcs.length);a{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(78200);function i(e){var t={},n=e.map((function(){return[]}));function i(e,n){e.forEach((function(e){e<0&&(e=~e);var r=t[e];r?r.push(n):t[e]=[n]}))}function a(e,t){e.forEach((function(e){i(e,t)}))}var o={LineString:i,MultiLineString:a,Polygon:a,MultiPolygon:function(e,t){e.forEach((function(e){a(e,t)}))}};for(var s in e.forEach((function e(t,n){"GeometryCollection"===t.type?t.geometries.forEach((function(t){e(t,n)})):t.type in o&&o[t.type](t.arcs,n)})),t)for(var l=t[s],u=l.length,c=0;c{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(84729),i=n(56953);function a(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)u=e.bbox;else{if(!((n=Math.floor(t))>=2))throw new Error("n must be ≥2");var n,a=(u=e.bbox||(0,r.default)(e))[0],o=u[1],s=u[2],l=u[3];t={scale:[s-a?(s-a)/(n-1):1,l-o?(l-o)/(n-1):1],translate:[a,o]}}var u,c,d=(0,i.default)(t),f=e.objects,p={};function h(e){return d(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in f)p[c]=g(f[c]);return{type:"Topology",bbox:u,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,n=0,r=1,i=e.length,a=new Array(i);for(a[0]=d(e[0],0);++n{"use strict";function r(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}n.r(t),n.d(t,{default:()=>r})},59391:(e,t,n)=>{"use strict";function r(e,t){var n={},r={},i={},a=[],o=-1;function s(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach((function(e){n[e<0?~e:e]=1})),a.push(i)}}return t.forEach((function(n,r){var i,a=e.arcs[n<0?~n:n];a.length<3&&!a[1][0]&&!a[1][1]&&(i=t[++o],t[o]=n,t[r]=i)})),t.forEach((function(t){var n,a,o=function(t){var n,r=e.arcs[t<0?~t:t],i=r[0];return e.transform?(n=[0,0],r.forEach((function(e){n[0]+=e[0],n[1]+=e[1]}))):n=r[r.length-1],t<0?[n,i]:[i,n]}(t),s=o[0],l=o[1];if(n=i[s])if(delete i[n.end],n.push(t),n.end=l,a=r[l]){delete r[a.start];var u=a===n?n:n.concat(a);r[u.start=n.start]=i[u.end=a.end]=u}else r[n.start]=i[n.end]=n;else if(n=r[l])if(delete r[n.start],n.unshift(t),n.start=s,a=i[s]){delete i[a.end];var c=a===n?n:a.concat(n);r[c.start=a.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[t]).start=s]=i[n.end=l]=n})),s(i,r),s(r,i),t.forEach((function(e){n[e<0?~e:e]||a.push([e])})),a}n.r(t),n.d(t,{default:()=>r})},51636:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(94644);function i(e){if(null==e)return r.default;var t,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,r){r||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*i+o,c[1]=(n+=e[1])*a+s;l{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(94644);function i(e){if(null==e)return r.default;var t,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,r){r||(t=n=0);var l=2,u=e.length,c=new Array(u),d=Math.round((e[0]-o)/i),f=Math.round((e[1]-s)/a);for(c[0]=d-t,t=d,c[1]=f-n,n=f;l{"use strict";n.r(t),n.d(t,{NIL:()=>s.default,parse:()=>d.default,stringify:()=>c.default,v1:()=>r.default,v3:()=>i.default,v4:()=>a.default,v5:()=>o.default,validate:()=>u.default,version:()=>l.default});var r=n(47661),i=n(4523),a=n(18562),o=n(86449),s=n(62805),l=n(69870),u=n(66382),c=n(38823),d=n(78537)},90278:(e,t,n)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,r,a,o){return i((s=i(i(t,e),i(r,o)))<<(l=a)|s>>>32-l,n);var s,l}function o(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function s(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function u(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}n.r(t),n.d(t,{default:()=>c});const c=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n>5]>>>i%32&255,a=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<{"use strict";n.r(t),n.d(t,{default:()=>r});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}},62805:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r="00000000-0000-0000-0000-000000000000"},78537:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(66382);const i=function(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},13469:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},43407:(e,t,n)=>{"use strict";let r;n.r(t),n.d(t,{default:()=>a});const i=new Uint8Array(16);function a(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}},59761:(e,t,n)=>{"use strict";function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function i(e,t){return e<>>32-t}n.r(t),n.d(t,{default:()=>a});const a=function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n>>0;d=c,c=u,u=i(l,30)>>>0,l=o,o=s}n[0]=n[0]+o>>>0,n[1]=n[1]+l>>>0,n[2]=n[2]+u>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+d>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}},38823:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o,unsafeStringify:()=>a});var r=n(66382);const i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));function a(e,t=0){return i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]}const o=function(e,t=0){const n=a(e,t);if(!(0,r.default)(n))throw TypeError("Stringified UUID is invalid");return n}},47661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(43407),i=n(38823);let a,o,s=0,l=0;const u=function(e,t,n){let u=t&&n||0;const c=t||new Array(16);let d=(e=e||{}).node||a,f=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==f){const t=e.random||(e.rng||r.default)();null==d&&(d=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==f&&(f=o=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:l+1;const g=p-s+(h-l)/1e4;if(g<0&&void 0===e.clockseq&&(f=f+1&16383),(g<0||p>s)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,l=h,o=f,p+=122192928e5;const m=(1e4*(268435455&p)+h)%4294967296;c[u++]=m>>>24&255,c[u++]=m>>>16&255,c[u++]=m>>>8&255,c[u++]=255&m;const y=p/4294967296*1e4&268435455;c[u++]=y>>>8&255,c[u++]=255&y,c[u++]=y>>>24&15|16,c[u++]=y>>>16&255,c[u++]=f>>>8|128,c[u++]=255&f;for(let e=0;e<6;++e)c[u+e]=d[e];return t||(0,i.unsafeStringify)(c)}},4523:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(90312),i=n(90278);const a=(0,r.default)("v3",48,i.default)},90312:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DNS:()=>a,URL:()=>o,default:()=>s});var r=n(38823),i=n(78537);const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function s(e,t,n){function s(e,a,o,s){var l;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(91943),i=n(43407),a=n(38823);const o=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const o=(e=e||{}).random||(e.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return(0,a.unsafeStringify)(o)}},86449:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(90312),i=n(59761);const a=(0,r.default)("v5",80,i.default)},66382:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(13469);const i=function(e){return"string"==typeof e&&r.default.test(e)}},69870:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(66382);const i=function(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},14958:(e,t,n)=>{"use strict";function r(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}n.r(t),n.d(t,{canvas:()=>r,domCanvas:()=>r,image:()=>i});const i=()=>"undefined"!=typeof Image?Image:null},37788:(e,t,n)=>{"use strict";n.r(t),n.d(t,{crossfilter:()=>f,resolvefilter:()=>p});var r=n(61388),i=n(24988),a=n(26372);const o=e=>new Uint8Array(e),s=e=>new Uint16Array(e),l=e=>new Uint32Array(e);function u(e,t,n){const r=(t<257?o:t<65537?s:l)(e);return n&&r.set(n),r}function c(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),(0,r.permute)(e,t)}(h,c),s)d=t,f=e,t=Array(s+u),e=l(s+u),function(e,t,n,r,i,a,o,s,l){let u,c=0,d=0;for(u=0;c0)for(p=0;pe,size:()=>n}}function f(e){i.Transform.call(this,function(){let e=8,t=[],n=l(0),r=u(0,e),i=u(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,a=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=u(t,e,r),i=u(t,e))}}}(),e),this._indices=null,this._dims=null}function p(e){i.Transform.call(this,null,e)}f.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}}]},(0,a.inherits)(f,i.Transform,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},a=this._dims=[],o=r.length;let s,l,u=0;for(;u{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,a=t.stamp,o=r.length;let s,l,u=0;for(n.filters=0,l=0;lp)for(m=p,y=Math.min(d,h);mh)for(m=Math.max(d,h),y=f;mc)for(p=c,h=Math.min(l,d);pd)for(p=Math.max(l,d),h=u;ps[e]&n?null:o[e];return a.filter(a.MOD,u),i&i-1?(a.filter(a.ADD,(e=>{const t=s[e]&n;return!t&&t^l[e]&n?o[e]:null})),a.filter(a.REM,(e=>!(s[e]&n)||l[e]&n?null:o[e]))):(a.filter(a.ADD,u),a.filter(a.REM,(e=>(s[e]&n)===i?o[e]:null))),a.filter(a.SOURCE,(e=>u(e._index)))}})},24988:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Dataflow:()=>z,EventStream:()=>T,MultiPulse:()=>$,Operator:()=>_,Parameters:()=>x,Pulse:()=>F,Transform:()=>j,UniqueList:()=>o,asyncCallback:()=>s,changeset:()=>b,definition:()=>G,derive:()=>h,ingest:()=>p,isChangeSet:()=>v,isTuple:()=>c,rederive:()=>g,replace:()=>m,stableCompare:()=>y,transform:()=>V,transforms:()=>H,tupleid:()=>d});var r=n(26372),i=n(83418),a=n(40300);function o(e){const t=e||r.identity,n=[],i={};return n.add=e=>{const r=t(e);return i[r]||(i[r]=1,n.push(e)),n},n.remove=e=>{const r=t(e);if(i[r]){i[r]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function s(e,t){try{await t(e)}catch(t){e.error(t)}}const l=Symbol("vega_id");let u=1;function c(e){return!(!e||!d(e))}function d(e){return e[l]}function f(e,t){return e[l]=t,e}function p(e){const t=e===Object(e)?e:{data:e};return d(t)?t:f(t,u++)}function h(e){return g(e,p({}))}function g(e,t){for(const n in e)t[n]=e[n];return t}function m(e,t){return f(t,d(e))}function y(e,t){return e?t?(n,r)=>e(n,r)||d(t(n))-d(t(r)):(t,n)=>e(t,n)||d(t)-d(n):null}function v(e){return e&&e.constructor===b}function b(){const e=[],t=[],n=[],i=[],a=[];let o=null,s=!1;return{constructor:b,insert(t){const n=(0,r.array)(t),i=n.length;for(let t=0;t{m(e)&&(u[d(e)]=-1)}));for(f=0,h=e.length;f0&&(b(y,m,g.value),r.modifies(m));for(f=0,h=a.length;f{m(e)&&u[d(e)]>0&&b(e,g.field,g.value)})),r.modifies(g.field);if(s)r.mod=t.length||i.length?l.filter((e=>u[d(e)]>0)):l.slice();else for(v in c)r.mod.push(c[v]);return(o||null==o&&(t.length||i.length))&&r.clean(!0),r}}}const w="_:mod:_";function x(){Object.defineProperty(this,w,{writable:!0,value:{}})}x.prototype={set(e,t,n,i){const a=this,o=a[e],s=a[w];return null!=t&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(a[e]=n,s[e]=(0,r.isArray)(n)?1+n.length:-1),a},modified(e,t){const n=this[w];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if((0,r.isArray)(e)){for(let t=0;t=0?t+1{r instanceof _?(r!==this&&(t&&r.targets().add(this),o.push(r)),a.push({op:r,name:e,index:n})):i.set(e,n,r)};for(s in e)if(l=e[s],"pulse"===s)(0,r.array)(l).forEach((e=>{e instanceof _?e!==this&&(e.targets().add(this),o.push(e)):(0,r.error)("Pulse parameters must be operator instances.")})),this.source=l;else if((0,r.isArray)(l))for(i.set(s,-1,Array(u=l.length)),c=0;c{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=k();return this.targets().add(k(null,null,(0,r.debounce)(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(k(null,null,(()=>n=!0))),t.targets().add(k(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=r.truthy,this._targets=null}};const R={skip:!0};function D(e,t,n,i,a,o){const s=(0,r.extend)({},o,R);let l,u;(0,r.isFunction)(n)||(n=(0,r.constant)(n)),void 0===i?l=t=>e.touch(n(t)):(0,r.isFunction)(i)?(u=new _(null,i,a,!1),l=t=>{u.evaluate(t);const r=n(t),i=u.value;v(i)?e.pulse(r,i,o):e.update(r,i,s)}):l=t=>e.update(n(t),i,s),t.apply(l)}function O(e,t,n,i,a,o){if(void 0===i)t.targets().add(n);else{const s=o||{},l=new _(null,function(e,t){return t=(0,r.isFunction)(t)?t:(0,r.constant)(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,i),a,!1);l.modified(s.force),l.rank=t.rank,t.targets().add(l),n&&(l.skip(!0),l.value=n.value,l.targets().add(n),e.connect(n,[l]))}}const N={};function F(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function P(e,t){const n=[];return(0,r.visitArray)(e,t,(e=>n.push(e))),n}function M(e,t){const n={};return e.visit(t,(e=>{n[d(e)]=1})),e=>n[d(e)]?null:e}function I(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function $(e,t,n,r){const i=this;let a=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(a|=i.ADD),e.changed(i.REM)&&(a|=i.REM),e.changed(i.MOD)&&(a|=i.MOD)}this.changes=a}function L(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}F.prototype={StopPropagation:N,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new F(this.dataflow).init(this,e)},clone(){const e=this.fork(7);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(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new F(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(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){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,M(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return(0,r.isArray)(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?(0,r.isArray)(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=I(n.addF,t)),2&e&&(n.remF=I(n.remF,t)),4&e&&(n.modF=I(n.modF,t)),16&e&&(n.srcF=I(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=P(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=P(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=P(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(16&e)return(0,r.visitArray)(n.source,n.srcF,i),n;1&e&&(0,r.visitArray)(n.add,n.addF,i),2&e&&(0,r.visitArray)(n.rem,n.remF,i),4&e&&(0,r.visitArray)(n.mod,n.modF,i);const a=n.source;if(8&e&&a){const e=n.add.length+n.mod.length;e===a.length||(e?(0,r.visitArray)(a,M(n,5),i):(0,r.visitArray)(a,n.srcF,i))}return n}},(0,r.inherits)($,F,{fork(e){const t=new F(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?(0,r.isArray)(e)?e.some((e=>n[e])):n[e]:0},filter(){(0,r.error)("MultiPulse does not support filtering.")},materialize(){(0,r.error)("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let a=0;if(e&n.SOURCE)for(;at&&(a=n-1>>1,i=e[a],r(o,i)<0);)e[n]=i,n=a;return e[n]=o}function z(){this.logger((0,r.logger)()),this.logLevel(r.Error),this._clock=0,this._rank=0,this._locale=(0,a.defaultLocale)();try{this._loader=(0,i.loader)()}catch(e){}this._touched=o(r.id),this._input={},this._pulse=null,this._heap=function(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:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,a=e[t];let o,s=1+(t<<1);for(;s=0&&(s=o),e[t]=e[s],s=1+((t=s)<<1);e[t]=a,U(e,r,t,n)}(t,0,e)):r=n,r}}}(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function q(e){return function(){return this._log[e].apply(this,arguments)}}function j(e,t){_.call(this,e,null,t)}z.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:q("error"),warn:q("warn"),info:q("info"),debug:q("debug"),logLevel:q("level"),cleanThreshold:1e4,add:function(e,t,n,i){let a,o=1;return e instanceof _?a=e:e&&e.prototype instanceof _?a=new e:(0,r.isFunction)(e)?a=new _(null,e):(o=0,a=new _(e,t)),this.rank(a),o&&(i=n,n=t),n&&this.connect(a,a.parameters(n,i)),this.touch(a),a},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=i[a]),n===e&&(0,r.error)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||B);const r=new F(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},touch:function(e,t){const n=t||B;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||B;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:b,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return(0,i.read)(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const i=this,a=i._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(i);a.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(r.truthy).insert(o.data||[])),a.done(),o},request:async function(e,t){const n=this;let r,a=0;try{r=await n.loader().load(e,{context:"dataflow",response:(0,i.responseType)(t&&t.type)});try{r=n.parse(r,t)}catch(t){a=-2,n.warn("Data ingestion failed",e,t)}}catch(t){a=-1,n.warn("Loading failed",e,t)}return{data:r,status:a}},events:function(e,t,n,i){const a=this,o=k(n,i),s=function(e){e.dataflow=a;try{o.receive(e)}catch(e){a.error(e)}finally{a.run()}};let l;l="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):(0,r.array)(e);const u=l.length;for(let e=0;ei._enqueue(e,!0))),i._touched=o(r.id);let u,c,d,f=0;try{for(;i._heap.size()>0;)u=i._heap.pop(),u.rank===u.qrank?(c=u.run(i._getPulse(u,e)),c.then?c=await c:c.async&&(a.push(c.async),c=N),c!==N&&u._targets&&u._targets.forEach((e=>i._enqueue(e))),++f):i._enqueue(u,!0)}catch(e){i._heap.clear(),d=e}if(i._input={},i._pulse=null,i.debug(`Pulse ${l}: ${f} operators`),d&&(i._postrun=[],i.error(d)),i._postrun.length){const e=i._postrun.sort(((e,t)=>t.priority-e.priority));i._postrun=[];for(let t=0;ti.runAsync(null,(()=>{e.forEach((e=>{try{e(i)}catch(e){i.error(e)}}))})))),i},run:function(e,t,n){return this._pulse?L(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==N&&(e.source=t.source),e)}(this._pulse,n&&n.pulse)}},(0,r.inherits)(j,_,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const H={};function G(e){const t=V(e);return t&&t.Definition||null}function V(e){return e=e&&e.toLowerCase(),(0,r.hasOwnProperty)(H,e)?H[e]:null}},47990:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_ACTIONS:()=>Ue,default:()=>Je,guessMode:()=>Ye,vega:()=>$e,vegaLite:()=>Le,version:()=>Ie});var r,i=n(48487),a=n.n(i),o=n(77390),s=n(48196),l=n(78405),u=n(73706),c=n(80632),d=n(41570),f=n(65606),p=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),h=Object.prototype.hasOwnProperty;function g(e,t){return h.call(e,t)}function m(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&t<=57))return!1;n++}return!0}function b(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function w(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function x(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[u-1]))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&&void 0===d&&(void 0===l[f]?d=s.slice(0,u).join("/"):u==c-1&&(d=t.path),void 0!==d&&p(t,0,e,d)),u++,Array.isArray(l)){if("-"===f)f=l.length;else{if(n&&!v(f))throw new _("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",a,t,e);v(f)&&(f=~~f)}if(u>=c){if(n&&"add"===t.op&&f>l.length)throw new _("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);if(!1===(o=T[t.op].call(t,l,f,e)).test)throw new _("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return o}}else if(u>=c){if(!1===(o=C[t.op].call(t,l,f,e)).test)throw new _("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return o}if(l=l[f],n&&u0)throw new _('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new _("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new _("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&x(e.value))throw new _("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,a=r.split("/").length;if(i!==a+1&&i!==a)throw new _("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new _("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var o=N([{op:"_get",path:e.from,value:void 0}],n);if(o&&"OPERATION_PATH_UNRESOLVABLE"===o.name)throw new _("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function N(e,t,n){try{if(!Array.isArray(e))throw new _("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)D(y(t),y(e),n||!0);else{n=n||O;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function B(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var a=m(t),o=m(e),s=!1,l=o.length-1;l>=0;l--){var u=e[d=o[l]];if(!g(t,d)||void 0===t[d]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+b(d),value:y(u)}),n.push({op:"remove",path:r+"/"+b(d)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var c=t[d];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?B(u,c,n,r+"/"+b(d),i):u!==c&&(i&&n.push({op:"test",path:r+"/"+b(d),value:y(u)}),n.push({op:"replace",path:r+"/"+b(d),value:y(c)}))}}if(s||a.length!=o.length)for(l=0;ln?"object"!=typeof n?e:n:t}Object.assign({},P,H,{JsonPatchError:S,deepClone:y,escapePathComponent:b,unescapePathComponent:w});var W,Y,X,K,J,Q,Z,ee,te,ne,re,ie,ae,oe,se,le,ue,ce,de,fe,pe,he,ge,me,ye,ve,be,we,xe,Ee,Se,_e={exports:{}};function Ae(){if(Y)return W;Y=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return W={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function Ce(){if(K)return X;K=1;const e="object"==typeof f&&f.env&&f.env.NODE_DEBUG&&/\bsemver\b/i.test(f.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return X=e}function Te(){return J||(J=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Ae(),a=Ce(),o=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[d,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=c++;a(e,i,t),u[e]=i,l[i]=t,o[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("COERCERTLFULL",l[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_e,_e.exports)),_e.exports}function ke(){if(te)return ee;te=1;const e=Ce(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Ae(),{safeRe:r,t:i}=Te(),a=V(),{compareIdentifiers:o}=function(){if(Z)return Q;Z=1;const e=/^[0-9]+$/,t=(t,n)=>{const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:tt(n,e)}}();class s{constructor(o,l){if(l=a(l),o instanceof s){if(o.loose===!!l.loose&&o.includePrerelease===!!l.includePrerelease)return o;o=o.version}else if("string"!=typeof o)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",o,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const u=o.trim().match(l.loose?r[i.LOOSE]:r[i.FULL]);if(!u)throw new TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+u[1],this.minor=+u[2],this.patch=+u[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");u[4]?this.prerelease=u[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===o(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ee=s}function Re(){if(re)return ne;re=1;const e=ke();return ne=(t,n,r)=>new e(t,r).compare(new e(n,r))}function De(){if(xe)return we;xe=1;const e=/\s+/g;class t{constructor(n,a){if(a=r(a),n instanceof t)return n.loose===!!a.loose&&n.includePrerelease===!!a.includePrerelease?n:new t(n.raw,a);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const o=this.options.loose,g=o?s[l.HYPHENRANGELOOSE]:s[l.HYPHENRANGE];e=e.replace(g,T(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(s[l.COMPARATORTRIM],u),a("comparator trim",e),e=e.replace(s[l.TILDETRIM],c),a("tilde trim",e),e=e.replace(s[l.CARETTRIM],d),a("caret trim",e);let m=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));o&&(m=m.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(s[l.COMPARATORLOOSE]))))),a("range list",m);const v=new Map,b=m.map((e=>new i(e,this.options)));for(const e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return n.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>m(t,n)&&e.set.some((e=>m(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}for(let t=0;t=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}})),r=V(),i=function(){if(be)return ve;be=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),o("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==a[1]?a[1]:"","="===this.operator&&(this.operator=""),a[2]?this.semver=new s(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(o("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):!((r=n(r)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(a(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(a(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}ve=t;const n=V(),{safeRe:r,t:i}=Te(),a=function(){if(ye)return me;ye=1;const e=function(){if(ae)return ie;ae=1;const e=Re();return ie=(t,n,r)=>0===e(t,n,r)}(),t=function(){if(se)return oe;se=1;const e=Re();return oe=(t,n,r)=>0!==e(t,n,r)}(),n=function(){if(ue)return le;ue=1;const e=Re();return le=(t,n,r)=>e(t,n,r)>0}(),r=function(){if(de)return ce;de=1;const e=Re();return ce=(t,n,r)=>e(t,n,r)>=0}(),i=function(){if(pe)return fe;pe=1;const e=Re();return fe=(t,n,r)=>e(t,n,r)<0}(),a=function(){if(ge)return he;ge=1;const e=Re();return he=(t,n,r)=>e(t,n,r)<=0}();return me=(o,s,l,u)=>{switch(s){case"===":return"object"==typeof o&&(o=o.version),"object"==typeof l&&(l=l.version),o===l;case"!==":return"object"==typeof o&&(o=o.version),"object"==typeof l&&(l=l.version),o!==l;case"":case"=":case"==":return e(o,l,u);case"!=":return t(o,l,u);case">":return n(o,l,u);case">=":return r(o,l,u);case"<":return i(o,l,u);case"<=":return a(o,l,u);default:throw new TypeError(`Invalid operator: ${s}`)}}}(),o=Ce(),s=ke(),l=De();return ve}(),a=Ce(),o=ke(),{safeRe:s,t:l,comparatorTrimReplace:u,tildeTrimReplace:c,caretTrimReplace:d}=Te(),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:p}=Ae(),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},y=(e,t)=>(a("comp",e,t),e=x(e,t),a("caret",e),e=b(e,t),a("tildes",e),e=S(e,t),a("xrange",e),e=A(e,t),a("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const n=t.loose?s[l.TILDELOOSE]:s[l.TILDE];return e.replace(n,((t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),v(n)?s="":v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?s[l.CARETLOOSE]:s[l.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,o,s)=>{let l;return a("caret",e,t,n,i,o,s),v(n)?l="":v(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(o)?l="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),l="0"===n?"0"===i?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",l),l}))},S=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>_(e,t))).join(" ")),_=(e,t)=>{e=e.trim();const n=t.loose?s[l.XRANGELOOSE]:s[l.XRANGE];return e.replace(n,((n,r,i,o,s,l)=>{a("xRange",e,n,r,i,o,s,l);const u=v(i),c=u||v(o),d=c||v(s),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(c&&(o=0),s=0,">"===r?(r=">=",c?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",c?i=+i+1:o=+o+1),"<"===r&&(l="-0"),n=`${r+i}.${o}.${s}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",n),n}))},A=(e,t)=>(a("replaceStars",e,t),e.trim().replace(s[l.STAR],"")),C=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),T=e=>(t,n,r,i,a,o,s,l,u,c,d,f)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(c)?`<${+u+1}.0.0-0`:v(d)?`<${u}.${+c+1}.0-0`:f?`<=${u}.${c}.${d}-${f}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return we}var Oe=function(){if(Se)return Ee;Se=1;const e=De();return Ee=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},Ee}(),Ne=G(Oe),Fe='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function Pe(e,...t){for(const n of t)Me(e,n);return e}function Me(e,t){for(const n of Object.keys(t))(0,o.writeConfig)(e,n,t[n],!0)}const Ie="6.28.0",$e=o;let Le=l;const Be="undefined"!=typeof window?window:void 0;void 0===Le&&Be?.vl?.compile&&(Le=Be.vl);const Ue={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ze={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"},qe={vega:"Vega","vega-lite":"Vega-Lite"},je={vega:$e.version,"vega-lite":Le?Le.version:"not available"},He={vega:e=>e,"vega-lite":(e,t)=>Le.compile(e,{config:t}).spec},Ge='\n',Ve="chart-wrapper";function We(e,t,n,r){const i=`${t}`,a=`
${n}`,o=window.open("");o.document.write(i+e+a),o.document.title=`${qe[r]} JSON Source`}function Ye(e,t){if(e.$schema){const n=(0,u.default)(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${qe[n.library]}, but mode argument sets ${qe[t]??t}.`);const r=n.library;return Ne(je[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${qe[r]} ${n.version}, but the current version of ${qe[r]} is v${je[r]}.`),r}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":t??"vega"}function Xe(e){return!(!e||!("load"in e))}function Ke(e){return Xe(e)?e:$e.loader(e)}async function Je(e,t,n={}){let r,i;(0,o.isString)(t)?(i=Ke(n.loader),r=JSON.parse(await i.load(t))):r=t;const l=function(e){const t=e.usermeta?.embedOptions??{};return(0,o.isString)(t.defaultStyle)&&(t.defaultStyle=!1),t}(r),f=l.loader;i&&!f||(i=Ke(n.loader??f));const p=await Qe(l,i),h=await Qe(n,i),g={...Pe(h,p),config:(0,o.mergeConfig)(h.config??{},p.config??{})};return await async function(e,t,n={},r){const i=n.theme?(0,o.mergeConfig)(c[n.theme],n.config??{}):n.config,l=(0,o.isBoolean)(n.actions)?n.actions:Pe({},Ue,n.actions??{}),f={...ze,...n.i18n},p=n.renderer??"canvas",h=n.logLevel??$e.Warn,g=n.downloadFileName??"visualization",m="string"==typeof e?document.querySelector(e):e;if(!m)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:r}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(m);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?Fe.toString():n.defaultStyle,r.appendChild(t)}}const y=Ye(t,n.mode);let v=He[y](t,i);if("vega-lite"===y&&v.$schema){const e=(0,u.default)(v.$schema);Ne(je.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${je.vega}.`)}m.classList.add("vega-embed"),l&&m.classList.add("has-actions"),m.innerHTML="";let b=m;if(l){const e=document.createElement("div");e.classList.add(Ve),m.appendChild(e),b=e}const w=n.patch;if(w&&(v=w instanceof Function?w(v):D(v,w,!0,!1).newDocument),n.formatLocale&&$e.formatLocale(n.formatLocale),n.timeFormatLocale&&$e.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const e in n.expressionFunctions){const t=n.expressionFunctions[e];"fn"in t?$e.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&$e.expressionFunction(e,t)}const{ast:x}=n,E=$e.parse(v,"vega-lite"===y?{}:i,{ast:x}),S=new(n.viewClass||$e.View)(E,{loader:r,logLevel:h,renderer:p,...x?{expr:$e.expressionInterpreter??n.expr??s.expressionInterpreter}:{}});if(S.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(b.classList.add("fit-x"),b.classList.remove("fit-y")):"fit-y"==n?(b.classList.remove("fit-x"),b.classList.add("fit-y")):"fit"==n?b.classList.add("fit-x","fit-y"):b.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const{loader:e,tooltip:t}=n,r=e&&!Xe(e)?e?.baseURL:void 0,i="function"==typeof t?t:new d.Handler({baseURL:r,...!0===t?{}:t}).call;S.tooltip(i)}let _,{hover:A}=n;if(void 0===A&&(A="vega"===y),A){const{hoverSet:e,updateSet:t}="boolean"==typeof A?{}:A;S.hover(e,t)}if(n&&(null!=n.width&&S.width(n.width),null!=n.height&&S.height(n.height),null!=n.padding&&S.padding(n.padding)),await S.initialize(b,n.bind).runAsync(),!1!==l){let e=m;if(!1!==n.defaultStyle||n.forceActionsMenu){const t=document.createElement("details");t.title=f.CLICK_TO_VIEW_ACTIONS,m.append(t),e=t;const n=document.createElement("summary");n.innerHTML=Ge,t.append(n),_=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",_)}const r=document.createElement("div");if(e.append(r),r.classList.add("vega-actions"),!0===l||!1!==l.export)for(const e of["svg","png"])if(!0===l||!0===l.export||l.export[e]){const t=f[`${e.toUpperCase()}_ACTION`],i=document.createElement("a"),a=(0,o.isObject)(n.scaleFactor)?n.scaleFactor[e]:n.scaleFactor;i.text=t,i.href="#",i.target="_blank",i.download=`${g}.${e}`,i.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await S.toImageURL(e,a);this.href=n})),r.append(i)}if(!0===l||!1!==l.source){const e=document.createElement("a");e.text=f.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){We(a()(t),n.sourceHeader??"",n.sourceFooter??"",y),e.preventDefault()})),r.append(e)}if("vega-lite"===y&&(!0===l||!1!==l.compiled)){const e=document.createElement("a");e.text=f.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){We(a()(v),n.sourceHeader??"",n.sourceFooter??"","vega"),e.preventDefault()})),r.append(e)}if(!0===l||!1!==l.editor){const e=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=f.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let a=40;e.addEventListener("message",(function t(n){n.source===r&&(a=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){a<=0||(r.postMessage(n,i),setTimeout(e,250),a-=1)}),250)}(window,e,{config:i,mode:w?"vega":y,renderer:p,spec:a()(w?v:t)}),n.preventDefault()})),r.append(o)}}return{view:S,spec:t,vgSpec:v,finalize:function(){_&&document.removeEventListener("click",_),S.finalize()},embedOptions:n}}(e,r,g,i)}async function Qe(e,t){const n=(0,o.isString)(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=(0,o.isString)(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...r?{patch:r}:{},...n?{config:n}:{}}}},73784:(e,t,n)=>{"use strict";n.r(t),n.d(t,{axisticks:()=>l,datajoin:()=>u,encode:()=>d,legendentries:()=>f,linkpath:()=>y,pie:()=>E,scale:()=>A,sortitems:()=>R,stack:()=>P});var r=n(24988),i=n(14588),a=n(26372),o=n(61388),s=n(82226);function l(e){r.Transform.call(this,null,e)}function u(e){r.Transform.call(this,null,e)}function c(){return(0,r.ingest)({})}function d(e){r.Transform.call(this,null,e)}function f(e){r.Transform.call(this,[],e)}(0,a.inherits)(l,r.Transform,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),a=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=this.value,s=e.scale,l=null==e.count?e.values?e.values.length:10:e.count,u=(0,i.tickCount)(s,l,e.minstep),c=e.format||(0,i.tickFormat)(n,s,u,e.formatSpecifier,e.formatType,!!e.values),d=e.values?(0,i.validTicks)(s,e.values,u):(0,i.tickValues)(s,u);return o&&(a.rem=o),o=d.map(((e,t)=>(0,r.ingest)({index:t/(d.length-1||1),value:e,label:c(e)}))),e.extra&&o.length&&o.push((0,r.ingest)({index:-1,extra:{value:o[0].value},label:""})),a.source=o,a.add=o,this.value=o,a}}),(0,a.inherits)(u,r.Transform,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=e.item||c,s=e.key||r.tupleid,l=this.value;return(0,a.isArray)(i.encode)&&(i.encode=null),l&&(e.modified("key")||t.modified(s))&&(0,a.error)("DataJoin does not support modified key function or fields."),l||(t=t.addAll(),this.value=l=function(e){const t=(0,a.fastmap)().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(s)),t.visit(t.ADD,(e=>{const t=s(e);let n=l.get(t);n?n.exit?(l.empty--,i.add.push(n)):i.mod.push(n):(n=o(e),l.set(t,n),i.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=s(e),n=l.get(t);n&&(n.datum=e,i.mod.push(n))})),t.visit(t.REM,(e=>{const t=s(e),n=l.get(t);e!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++l.empty)})),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&l.empty>n.cleanThreshold)&&n.runAfter(l.clean),i}}),(0,a.inherits)(d,r.Transform,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if((0,a.isArray)(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var s="enter"===o,l=i.update||a.falsy,u=i.enter||a.falsy,c=i.exit||a.falsy,d=(o&&!s?i[o]:l)||a.falsy;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{u(t,e),l(t,e)})),n.modifies(u.output),n.modifies(l.output),d!==a.falsy&&d!==l&&(t.visit(t.ADD,(t=>{d(t,e)})),n.modifies(d.output))),t.changed(t.REM)&&c!==a.falsy&&(t.visit(t.REM,(t=>{c(t,e)})),n.modifies(c.output)),s||d!==a.falsy){const i=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(i,(t=>{const i=u(t,e)||r;(d(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(u.output)):t.visit(i,(t=>{(d(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(d.output)}return n.changed()?n:t.StopPropagation}}),(0,a.inherits)(f,r.Transform,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,o,s,l,u,c=t.dataflow.locale(),d=t.fork(t.NO_SOURCE|t.NO_FIELDS),f=this.value,p=e.type||i.SymbolLegend,h=e.scale,g=+e.limit,m=(0,i.tickCount)(h,null==e.count?5:e.count,e.minstep),y=!!e.values||p===i.SymbolLegend,v=e.format||(0,i.labelFormat)(c,h,m,p,e.formatSpecifier,e.formatType,y),b=e.values||(0,i.labelValues)(h,m);return f&&(d.rem=f),p===i.SymbolLegend?(g&&b.length>g?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),f=b.slice(0,g-1),u=!0):f=b,(0,a.isFunction)(s=e.size)?(e.values||0!==h(f[0])||(f=f.slice(1)),l=f.reduce(((t,n)=>Math.max(t,s(n,e))),0)):s=(0,a.constant)(l=s||8),f=f.map(((t,n)=>(0,r.ingest)({index:n,label:v(t,n,f),value:t,offset:l,size:s(t,e)}))),u&&(u=b[f.length],f.push((0,r.ingest)({index:f.length,label:`…${b.length-f.length} entries`,value:u,offset:l,size:s(u,e)})))):p===i.GradientLegend?(n=h.domain(),o=(0,i.scaleFraction)(h,n[0],(0,a.peek)(n)),b.length<3&&!e.values&&n[0]!==(0,a.peek)(n)&&(b=[n[0],(0,a.peek)(n)]),f=b.map(((e,t)=>(0,r.ingest)({index:t,label:v(e,t,b),value:e,perc:o(e)})))):(s=b.length-1,o=(0,i.labelFraction)(h),f=b.map(((e,t)=>(0,r.ingest)({index:t,label:v(e,t,b),value:e,perc:t?o(e):0,perc2:t===s?1:o(b[t+1])})))),d.source=f,d.add=f,this.value=f,d}});const p=e=>e.source.x,h=e=>e.source.y,g=e=>e.target.x,m=e=>e.target.y;function y(e){r.Transform.call(this,{},e)}y.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"}]},(0,a.inherits)(y,r.Transform,{transform(e,t){var n=e.sourceX||p,r=e.sourceY||h,i=e.targetX||g,o=e.targetY||m,s=e.as||"path",l=e.orient||"vertical",u=e.shape||"line",c=x.get(u+"-"+l)||x.get(u);return c||(0,a.error)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[s]=c(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(s)}});const v=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,b=(e,t,n,r)=>{var i=n-e,a=r-t,o=Math.hypot(i,a)/2;return"M"+e+","+t+"A"+o+","+o+" "+180*Math.atan2(a,i)/Math.PI+" 0 1 "+n+","+r},w=(e,t,n,r)=>{const i=n-e,a=r-t,o=.2*(i+a),s=.2*(a-i);return"M"+e+","+t+"C"+(e+o)+","+(t+s)+" "+(n+s)+","+(r-o)+" "+n+","+r},x=(0,a.fastmap)({line:v,"line-radial":(e,t,n,r)=>v(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:b,"arc-radial":(e,t,n,r)=>b(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:w,"curve-radial":(e,t,n,r)=>w(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*a+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*o+","+t*s+"L"+r*o+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*a+"C"+l*i+","+l*a+" "+l*o+","+l*s+" "+r*o+","+r*s}});function E(e){r.Transform.call(this,null,e)}function S(e){return(0,i.isContinuous)(e)&&e!==i.Sequential}E.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"]}]},(0,a.inherits)(E,r.Transform,{transform(e,t){var n,r,i,s=e.as||["startAngle","endAngle"],l=s[0],u=s[1],c=e.field||a.one,d=e.startAngle||0,f=null!=e.endAngle?e.endAngle:2*Math.PI,p=t.source,h=p.map(c),g=h.length,m=d,y=(f-d)/(0,o.sum)(h),v=(0,o.range)(g);for(e.sort&&v.sort(((e,t)=>h[e]-h[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+(0,a.stringValue)(t)),t}function T(e,t,n){return(0,a.isFunction)(e)&&(t||n)?(0,i.interpolateRange)(e,k(t||[0,1],n)):e}function k(e,t){return t?e.slice().reverse():e}function R(e){r.Transform.call(this,null,e)}(0,a.inherits)(A,r.Transform,{transform(e,t){var n=t.dataflow,r=this.value,l=function(e){var t,n=e.type,r="";return n===i.Sequential?i.Sequential+"-"+i.Linear:(function(e){const t=e.type;return(0,i.isContinuous)(t)&&t!==i.Time&&t!==i.UTC&&(e.scheme||e.range&&e.range.length&&e.range.every(a.isString))}(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?i.Sequential+"-":3===t?i.Diverging+"-":""),(r+n||i.Linear).toLowerCase())}(e);for(l in r&&l===r.type||(this.value=r=(0,i.scale)(l)()),e)if(!_[l]){if("padding"===l&&S(r.type))continue;(0,a.isFunction)(r[l])?r[l](e[l]):n.warn("Unsupported scale property: "+l)}return function(e,t,n){var r=e.type,o=t.round||!1,l=t.range;if(null!=t.rangeStep)l=function(e,t,n){e!==i.Band&&e!==i.Point&&(0,a.error)("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,o=e===i.Point?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*(0,i.bandSpace)(n,o,r)]}(r,t,n);else if(t.scheme&&(l=function(e,t,n){var r,o,s=t.schemeExtent;return(0,a.isArray)(t.scheme)?o=(0,i.interpolateColors)(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),(o=(0,i.scheme)(r))||(0,a.error)(`Unrecognized scheme name: ${t.scheme}`)),n=e===i.Threshold?n+1:e===i.BinOrdinal?n-1:e===i.Quantile||e===i.Quantize?+t.schemeCount||5:n,(0,i.isInterpolating)(e)?T(o,s,t.reverse):(0,a.isFunction)(o)?(0,i.quantizeInterpolator)(T(o,s),n):e===i.Ordinal?o:o.slice(0,n)}(r,t,n),(0,a.isFunction)(l))){if(e.interpolator)return e.interpolator(l);(0,a.error)(`Scale type ${r} does not support interpolating color schemes.`)}if(l&&(0,i.isInterpolating)(r))return e.interpolator((0,i.interpolateColors)(k(l,t.reverse),t.interpolate,t.interpolateGamma));l&&t.interpolate&&e.interpolate?e.interpolate((0,i.interpolate)(t.interpolate,t.interpolateGamma)):(0,a.isFunction)(e.round)?e.round(o):(0,a.isFunction)(e.rangeRound)&&e.interpolate(o?s.interpolateRound:s.interpolate),l&&e.range(k(l,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!(0,a.isArray)(r)){const t=e.domain(),n=t[0],i=(0,a.peek)(t),s=r.step;let l=null==r.start?n:r.start,u=null==r.stop?i:r.stop;s||(0,a.error)("Scale bins parameter missing step property."),li&&(u=s*Math.floor(i/s)),r=(0,o.range)(l,u+s/2,s)}return r?e.bins=r:e.bins&&delete e.bins,e.type===i.BinOrdinal&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain()),n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(C(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var o,s,l=t.domain,u=e.type,c=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===i.Linear||t===i.Pow||t===i.Sqrt)}(e);if(!l)return 0;if((c||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(o=(l=l.slice()).length-1||1,c&&(l[0]>0&&(l[0]=0),l[o]<0&&(l[o]=0)),null!=t.domainMin&&(l[0]=t.domainMin),null!=t.domainMax&&(l[o]=t.domainMax),null!=t.domainMid)){const e=(s=t.domainMid)>l[o]?o+1:se(l);if(null==t)p.push(e.slice());else for(i={},a=0,o=e.length;af&&(f=d),n&&c.sort(n)}return p.max=f,p}(t.source,e.groupby,d,f),i=0,o=n.length,s=n.max;i{"use strict";n.r(t),n.d(t,{parseSelector:()=>m});const r="view",i="[",a="]",o="{",s="}",l=":",u=",",c="@",d=">",f=/[[\]{}]/,p={"*":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};let h,g;function m(e,t,n){return h=t||r,g=n||p,v(e.trim()).map(b)}function y(e,t,n,r,i){const a=e.length;let o,s=0;for(;t=0?--s:r&&r.indexOf(o)>=0&&++s}return t}function v(e){const t=[],n=e.length;let r=0,l=0;for(;l' after between selector: "+e;n=n.map(b);const o=b(e.slice(1).trim());return o.between?{between:n,stream:o}:(o.between=n,o)}(e):function(e){const t={source:h},n=[];let r,d,p=[0,0],m=0,v=0,b=e.length,w=0;if(e[b-1]===s){if(w=e.lastIndexOf(o),!(w>=0))throw"Unmatched right brace: "+e;try{p=function(e){const t=e.split(u);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(w+1,b-1))}catch(t){throw"Invalid throttle specification: "+e}b=(e=e.slice(0,w).trim()).length,w=0}if(!b)throw e;if(e[0]===c&&(m=++w),r=y(e,w,l),r1?(t.type=n[1],m?t.markname=n[0].slice(1):(x=n[0],g[x]?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)),null!=d&&(t.filter=d),p[0]&&(t.throttle=p[0]),p[1]&&(t.debounce=p[1]),t}(e)}},21720:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ASTNode:()=>m,ArrayExpression:()=>l,BinaryExpression:()=>u,CallExpression:()=>c,ConditionalExpression:()=>d,Identifier:()=>s,Literal:()=>a,LogicalExpression:()=>f,MemberExpression:()=>p,ObjectExpression:()=>h,Property:()=>o,RawCode:()=>i,UnaryExpression:()=>g,codegenExpression:()=>Ge,constants:()=>je,functions:()=>He,parseExpression:()=>qe});var r=n(26372);const i="RawCode",a="Literal",o="Property",s="Identifier",l="ArrayExpression",u="BinaryExpression",c="CallExpression",d="ConditionalExpression",f="LogicalExpression",p="MemberExpression",h="ObjectExpression",g="UnaryExpression";function m(e){this.type=e}var y,v,b,w,x;m.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case l:return e.elements;case u:case f:return[e.left,e.right];case c:return[e.callee].concat(e.arguments);case d:return[e.test,e.consequent,e.alternate];case p:return[e.object,e.property];case h:return e.properties;case o:return[e.key,e.value];case g:return[e.argument];default:return[]}}(this),n=0,r=t.length;n",y[_]="Identifier",y[A]="Keyword",y[C]="Null",y[T]="Numeric",y[k]="Punctuator",y[R]="String",y[9]="RegularExpression";var D="ArrayExpression",O="BinaryExpression",N="CallExpression",F="ConditionalExpression",P="Identifier",M="Literal",I="LogicalExpression",$="MemberExpression",L="ObjectExpression",B="Property",U="UnaryExpression",z="Unexpected token %0",q="Unexpected number",j="Unexpected string",H="Unexpected identifier",G="Unexpected reserved word",V="Unexpected end of input",W="Invalid regular expression",Y="Invalid regular expression: missing /",X="Octal literals are not allowed in strict mode.",K="Duplicate data property in object literal not allowed in strict mode",J="ILLEGAL",Q="Disabled.",Z=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]"),ee=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 te(e,t){if(!e)throw new Error("ASSERT: "+t)}function ne(e){return e>=48&&e<=57}function re(e){return"0123456789abcdefABCDEF".includes(e)}function ie(e){return"01234567".includes(e)}function ae(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function oe(e){return 10===e||13===e||8232===e||8233===e}function se(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&Z.test(String.fromCharCode(e))}function le(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&ee.test(String.fromCharCode(e))}const ue={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 ce(){for(;b1114111||"}"!==e)&&Ae({},z,J),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function pe(){var e,t;for(e=v.charCodeAt(b++),t=String.fromCharCode(e),92===e&&(117!==v.charCodeAt(b)&&Ae({},z,J),++b,(e=de("u"))&&"\\"!==e&&se(e.charCodeAt(0))||Ae({},z,J),t=e);b>>="===(r=v.substr(b,4))?{type:k,value:r,start:i,end:b+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:k,value:n,start:i,end:b+=3}:o===(t=n.substr(0,2))[1]&&"+-<>&|".includes(o)||"=>"===t?{type:k,value:t,start:i,end:b+=2}:("//"===t&&Ae({},z,J),"<>=!+-*%&|^/".includes(o)?(++b,{type:k,value:o,start:i,end:b}):void Ae({},z,J))}function ge(){var e,t,n;if(te(ne((n=v[b]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=b,e="","."!==n){if(e=v[b++],n=v[b],"0"===e){if("x"===n||"X"===n)return++b,function(e){let t="";for(;b=w)return{type:S,start:b,end:b};const e=v.charCodeAt(b);return se(e)?(t=b,n=92===v.charCodeAt(b)?pe():function(){var e,t;for(e=b++;b(te(t=0&&Ae({},W,n),{value:n,literal:t}}(),o=function(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";Ae({},W)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){Ae({},W)}try{return new RegExp(e,t)}catch(e){return null}}(i.value,a.value),{literal:i.literal+a.literal,value:o,regex:{pattern:i.value,flags:a.value},start:r,end:b})),ve()):Ce(ye())}return n}function Pe(){const e=[];if(Te("("),!ke(")"))for(;b":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}return t}function Ue(){var e,t;return e=function(){var e,t,n,r,i,a,o,s,l,u;if(e=x,l=Le(),0===(i=Be(r=x)))return l;for(r.prec=i,ye(),t=[e,x],a=[l,r,o=Le()];(i=Be(x))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,l=a.pop(),t.pop(),n=be(s,l,o),a.push(n);(r=ye()).prec=i,a.push(r),t.push(x),n=Le(),a.push(n)}for(n=a[u=a.length-1],t.pop();u>1;)t.pop(),n=be(a[u-1].value,a[u-2],n),u-=2;return n}(),ke("?")&&(ye(),t=Ue(),Te(":"),e=function(e,t,n){const r=new m(F);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,Ue())),e}function ze(){const e=Ue();if(ke(","))throw new Error(Q);return e}function qe(e){b=0,w=(v=e).length,x=null,ve();const t=ze();if(x.type!==S)throw new Error("Unexpect token after expression.");return t}var je={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 He(e){function t(t,n,r){return i=>function(t,n,r,i){let a=e(n[0]);return r&&(a=r+"("+a+")",0===r.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",i="String",a="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(t){t.length<3&&(0,r.error)("Missing arguments to clamp function."),t.length>3&&(0,r.error)("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",i,0),lower:t("toLowerCase",i,0),substring:t("substring",i),split:t("split",i),trim:t("trim",i,0),regexp:a,test:t("test",a),if:function(t){t.length<3&&(0,r.error)("Missing arguments to if function."),t.length>3&&(0,r.error)("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function Ge(e){const t=(e=e||{}).allowed?(0,r.toSet)(e.allowed):{},n=e.forbidden?(0,r.toSet)(e.forbidden):{},i=e.constants||je,a=(e.functions||He)(f),o=e.globalvar,s=e.fieldvar,l=(0,r.isFunction)(o)?o:e=>`${o}["${e}"]`;let u={},c={},d=0;function f(e){if((0,r.isString)(e))return e;const t=p[e.type];return null==t&&(0,r.error)("Unsupported type: "+e.type),t(e)}const p={Literal:e=>e.raw,Identifier:e=>{const a=e.name;return d>0?a:(0,r.hasOwnProperty)(n,a)?(0,r.error)("Illegal identifier: "+a):(0,r.hasOwnProperty)(i,a)?i[a]:(0,r.hasOwnProperty)(t,a)?a:(u[a]=1,l(a))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(d+=1);const r=f(e.property);return n===s&&(c[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(d-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&(0,r.error)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,i=(0,r.hasOwnProperty)(a,t)&&a[t];return i||(0,r.error)("Unrecognized function: "+t),(0,r.isFunction)(i)?i(n):i+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{d+=1;const t=f(e.key);return d-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(u),fields:Object.keys(c)};return u={},c={},t}return h.functions=a,h.constants=i,h}},65294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{force:()=>d});var r=n(24988),i=n(26372),a=n(14310);const o={center:a.forceCenter,collide:a.forceCollide,nbody:a.forceManyBody,link:a.forceLink,x:a.forceX,y:a.forceY},s="forces",l=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],u=["static","iterations"],c=["x","y","vx","vy"];function d(e){r.Transform.call(this,null,e)}function f(e,t,n,r){var a,o,u,c,d=(0,i.array)(t.forces);for(a=0,o=l.length;at(e,n):t)}d.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:c}]},(0,i.inherits)(d,r.Transform,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),s=e.modified(l),c=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(s||t.changed(t.MOD))&&f(i,e,0,t)):(this.value=i=function(e,t){const n=(0,a.forceSimulation)(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),f(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),s||o||e.modified(u)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/c)),e.static)for(i.stop();--c>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,l=0,u=t.length;l{"use strict";n.r(t),n.d(t,{defaultLocale:()=>E,locale:()=>x,numberFormatDefaultLocale:()=>h,numberFormatLocale:()=>p,resetDefaultLocale:()=>S,resetNumberFormatDefaultLocale:()=>f,resetTimeFormatDefaultLocale:()=>y,timeFormatDefaultLocale:()=>b,timeFormatLocale:()=>v});var r=n(61388),i=n(4710),a=n(71652),o=n(26372),s=n(98090);function l(e){const t={};return n=>t[n]||(t[n]=e(n))}function u(e){const t=l(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=(0,i.formatSpecifier)(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=t(n),a=t(".1f")(1)[1],e=>{const t=r(e),n=t.indexOf(a);if(n<0)return t;let i=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(t,n);const o=in;)if("0"!==t[i]){++i;break}return t.slice(0,i)+o}}return t(n);var r,a},formatSpan(e,a,o,s){s=(0,i.formatSpecifier)(null==s?",f":s);const l=(0,r.tickStep)(e,a,o),u=Math.max(Math.abs(e),Math.abs(a));let c;if(null==s.precision)switch(s.type){case"s":return isNaN(c=(0,i.precisionPrefix)(l,u))||(s.precision=c),n(s,u);case"":case"e":case"g":case"p":case"r":isNaN(c=(0,i.precisionRound)(l,u))||(s.precision=c-("e"===s.type));break;case"f":case"%":isNaN(c=(0,i.precisionFixed)(l))||(s.precision=c-2*("%"===s.type))}return t(s)}}}let c,d;function f(){return c=u({format:i.format,formatPrefix:i.formatPrefix})}function p(e){return u((0,i.formatLocale)(e))}function h(e){return arguments.length?c=p(e):c}function g(e,t,n){n=n||{},(0,o.isObject)(n)||(0,o.error)(`Invalid time multi-format specifier: ${n}`);const r=t(a.SECONDS),i=t(a.MINUTES),s=t(a.HOURS),l=t(a.DATE),u=t(a.WEEK),c=t(a.MONTH),d=t(a.QUARTER),f=t(a.YEAR),p=e(n[a.MILLISECONDS]||".%L"),h=e(n[a.SECONDS]||":%S"),g=e(n[a.MINUTES]||"%I:%M"),m=e(n[a.HOURS]||"%I %p"),y=e(n[a.DATE]||n[a.DAY]||"%a %d"),v=e(n[a.WEEK]||"%b %d"),b=e(n[a.MONTH]||"%B"),w=e(n[a.QUARTER]||"%B"),x=e(n[a.YEAR]||"%Y");return e=>(r(e)(0,o.isString)(e)?t(e):g(t,a.timeInterval,e),utcFormat:e=>(0,o.isString)(e)?n(e):g(n,a.utcInterval,e),timeParse:l(e.parse),utcParse:l(e.utcParse)}}function y(){return d=m({format:s.timeFormat,parse:s.timeParse,utcFormat:s.utcFormat,utcParse:s.utcParse})}function v(e){return m((0,s.timeFormatLocale)(e))}function b(e){return arguments.length?d=v(e):d}f(),y();const w=(e,t)=>(0,o.extend)({},e,t);function x(e,t){const n=e?p(e):h(),r=t?v(t):b();return w(n,r)}function E(e,t){const n=arguments.length;return n&&2!==n&&(0,o.error)("defaultLocale expects either zero or two arguments."),n?w(h(e),b(t)):w(h(),b())}function S(){return f(),y(),E()}},31926:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DataPrefix:()=>D,IndexPrefix:()=>O,ScalePrefix:()=>N,SignalPrefix:()=>F,bandspace:()=>ge,bandwidth:()=>me,codeGenerator:()=>Be,codegenParams:()=>Le,containerSize:()=>Ne,contrast:()=>J,copy:()=>ye,data:()=>h,dataVisitor:()=>P,dayAbbrevFormat:()=>R,dayFormat:()=>k,debug:()=>Y,domain:()=>ve,encode:()=>y,expressionFunction:()=>Ue,format:()=>b,functionContext:()=>Pe,geoArea:()=>U,geoBounds:()=>z,geoCentroid:()=>q,geoScale:()=>j,geoShape:()=>Se,inScope:()=>H,indata:()=>g,indataVisitor:()=>M,indexof:()=>ce,info:()=>W,invert:()=>be,join:()=>ue,lastindexof:()=>de,luminance:()=>K,merge:()=>Q,modify:()=>ne,monthAbbrevFormat:()=>T,monthFormat:()=>C,parseExpression:()=>ze,pathShape:()=>_e,pinchAngle:()=>ie,pinchDistance:()=>re,pluck:()=>oe,range:()=>we,replace:()=>pe,reverse:()=>he,scale:()=>xe,scaleGradient:()=>Ee,scaleVisitor:()=>I,screen:()=>De,setdata:()=>m,slice:()=>fe,timeFormat:()=>w,timeParse:()=>E,treeAncestors:()=>ke,treePath:()=>Te,utcFormat:()=>x,utcParse:()=>S,warn:()=>V,windowSize:()=>Oe});var r=n(26372),i=n(21720),a=n(14588),o=n(51300),s=n(72090),l=n(24988),u=n(84636),c=n(76187),d=n(48872),f=n(71652),p=n(61388);function h(e){const t=this.context.data[e];return t?t.values.value:[]}function g(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}function m(e,t){const n=this.context.dataflow,i=this.context.data[e].input;return n.pulse(i,n.changeset().remove(r.truthy).insert(t)),1}function y(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e}const v=e=>function(t,n){const r=this.context.dataflow.locale();return null===t?"null":r[e](n)(t)},b=v("format"),w=v("timeFormat"),x=v("utcFormat"),E=v("timeParse"),S=v("utcParse"),_=new Date(2e3,0,1);function A(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(_.setYear(2e3),_.setMonth(e),_.setDate(t),w.call(this,_,n)):""}function C(e){return A.call(this,e,1,"%B")}function T(e){return A.call(this,e,1,"%b")}function k(e){return A.call(this,0,2+e,"%A")}function R(e){return A.call(this,0,2+e,"%a")}const D=":",O="@",N="%",F="$";function P(e,t,n,a){t[0].type!==i.Literal&&(0,r.error)("First argument to data functions must be a string literal.");const o=t[0].value,s=D+o;if(!(0,r.hasOwnProperty)(s,a))try{a[s]=n.getData(o).tuplesRef()}catch(e){}}function M(e,t,n,a){t[0].type!==i.Literal&&(0,r.error)("First argument to indata must be a string literal."),t[1].type!==i.Literal&&(0,r.error)("Second argument to indata must be a string literal.");const o=t[0].value,s=t[1].value,l=O+s;(0,r.hasOwnProperty)(l,a)||(a[l]=n.getData(o).indataRef(n,s))}function I(e,t,n,r){if(t[0].type===i.Literal)$(n,r,t[0].value);else for(e in n.scales)$(n,r,e)}function $(e,t,n){const i=N+n;if(!(0,r.hasOwnProperty)(t,i))try{t[i]=e.scaleRef(n)}catch(e){}}function L(e,t){if((0,r.isFunction)(e))return e;if((0,r.isString)(e)){const n=t.scales[e];return n&&(0,a.isRegisteredScale)(n.value)?n.value:void 0}}function B(e,t){return function(n,r,i){if(n){const t=L(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const U=B("area",o.geoArea),z=B("bounds",o.geoBounds),q=B("centroid",o.geoCentroid);function j(e,t){const n=L(e,(t||this).context);return n&&n.scale()}function H(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function G(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function V(){return G(this.context.dataflow,"warn",arguments)}function W(){return G(this.context.dataflow,"info",arguments)}function Y(){return G(this.context.dataflow,"debug",arguments)}function X(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function K(e){const t=(0,s.rgb)(e);return.2126*X(t.r)+.7152*X(t.g)+.0722*X(t.b)}function J(e,t){const n=K(e),r=K(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Q(){const e=[].slice.call(arguments);return e.unshift({}),(0,r.extend)(...e)}function Z(e,t){return e===t||e!=e&&t!=t||((0,r.isArray)(e)?!(!(0,r.isArray)(t)||e.length!==t.length)&&function(e,t){for(let n=0,r=e.length;nee(e,t)}function ne(e,t,n,i,a,o){const s=this.context.dataflow,u=this.context.data[e],c=u.input,d=s.stamp();let f,p,h=u.changes;if(!1===s._trigger||!(c.value.length||t||i))return 0;if((!h||h.stamp{u.modified=!0,s.pulse(c,h).run()}),!0,1)),n&&(f=!0===n?r.truthy:(0,r.isArray)(n)||(0,l.isTuple)(n)?n:te(n),h.remove(f)),t&&h.insert(t),i&&(f=te(i),c.value.some(f)?h.remove(f):h.insert(i)),a)for(p in o)h.modify(a,p,o[p]);return 1}function re(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function ie(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const ae={};function oe(e,t){const n=ae[t]||(ae[t]=(0,r.field)(t));return(0,r.isArray)(e)?e.map(n):n(e)}function se(e){return(0,r.isArray)(e)||ArrayBuffer.isView(e)?e:null}function le(e){return se(e)||((0,r.isString)(e)?e:null)}function ue(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rs.stop(f(t),e(t)))),s}function Se(e,t,n){const r=L(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}function _e(e){let t=null;return function(n){return n?(0,u.pathRender)(n,t=t||(0,u.pathParse)(e)):e}}const Ae=e=>e.data;function Ce(e,t){const n=h.call(t,e);return n.root&&n.root.lookup||{}}function Te(e,t,n){const r=Ce(e,this),i=r[t],a=r[n];return i&&a?i.path(a).map(Ae):void 0}function ke(e,t){const n=Ce(e,this)[t];return n?n.ancestors().map(Ae):void 0}const Re=()=>"undefined"!=typeof window&&window||null;function De(){const e=Re();return e?e.screen:{}}function Oe(){const e=Re();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Ne(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function Fe(e,t,n){if(!e)return[];const[i,a]=e,o=(new u.Bounds).set(i[0],i[1],a[0],a[1]),s=n||this.context.dataflow.scenegraph().root;return(0,u.intersect)(s,o,function(e){let t=null;if(e){const n=(0,r.array)(e.marktype),i=(0,r.array)(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!i.length||i.some((t=>e.name===t)))}return t}(t))}const Pe={random:()=>(0,d.random)(),cumulativeNormal:d.cumulativeNormal,cumulativeLogNormal:d.cumulativeLogNormal,cumulativeUniform:d.cumulativeUniform,densityNormal:d.densityNormal,densityLogNormal:d.densityLogNormal,densityUniform:d.densityUniform,quantileNormal:d.quantileNormal,quantileLogNormal:d.quantileLogNormal,quantileUniform:d.quantileUniform,sampleNormal:d.sampleNormal,sampleLogNormal:d.sampleLogNormal,sampleUniform:d.sampleUniform,isArray:r.isArray,isBoolean:r.isBoolean,isDate:r.isDate,isDefined:e=>void 0!==e,isNumber:r.isNumber,isObject:r.isObject,isRegExp:r.isRegExp,isString:r.isString,isTuple:l.isTuple,isValid:e=>null!=e&&e==e,toBoolean:r.toBoolean,toDate:e=>(0,r.toDate)(e),toNumber:r.toNumber,toString:r.toString,indexof:ce,join:ue,lastindexof:de,replace:pe,reverse:he,slice:fe,flush:r.flush,lerp:r.lerp,merge:Q,pad:r.pad,peek:r.peek,pluck:oe,span:r.span,inrange:r.inrange,truncate:r.truncate,rgb:s.rgb,lab:s.lab,hcl:s.hcl,hsl:s.hsl,luminance:K,contrast:J,sequence:p.range,format:b,utcFormat:x,utcParse:S,utcOffset:f.utcOffset,utcSequence:f.utcSequence,timeFormat:w,timeParse:E,timeOffset:f.timeOffset,timeSequence:f.timeSequence,timeUnitSpecifier:f.timeUnitSpecifier,monthFormat:C,monthAbbrevFormat:T,dayFormat:k,dayAbbrevFormat:R,quarter:r.quarter,utcquarter:r.utcquarter,week:f.week,utcweek:f.utcweek,dayofyear:f.dayofyear,utcdayofyear:f.utcdayofyear,warn:V,info:W,debug:Y,extent:e=>(0,r.extent)(e),inScope:H,intersect:Fe,clampRange:r.clampRange,pinchDistance:re,pinchAngle:ie,screen:De,containerSize:Ne,windowSize:Oe,bandspace:ge,setdata:m,pathShape:_e,panLinear:r.panLinear,panLog:r.panLog,panPow:r.panPow,panSymlog:r.panSymlog,zoomLinear:r.zoomLinear,zoomLog:r.zoomLog,zoomPow:r.zoomPow,zoomSymlog:r.zoomSymlog,encode:y,modify:ne,lassoAppend:function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const a=(e=(0,r.array)(e))[e.length-1];return void 0===a||Math.hypot(a[0]-t,a[1]-n)>i?[...e,[t,n]]:e},lassoPath:function(e){return(0,r.array)(e).reduce(((t,n,r)=>{let[i,a]=n;return t+(0==r?`M ${i},${a} `:r===e.length-1?" Z":`L ${i},${a} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:a}=n,o=(new u.Bounds).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)eo.x2&&(o.x2=e),no.y2&&(o.y2=n);return o.translate(r,i),Fe([[o.x1,o.y1],[o.x2,o.y2]],e,a).filter((e=>function(e,t,n){let r=0;for(let i=0,a=n.length-1;it!=s>t&&e<(o-l)*(t-u)/(s-u)+l&&r++}return 1&r}(e.x,e.y,t)))}},Me=["view","item","group","xy","x","y"],Ie="this.",$e={},Le={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${(0,r.stringValue)(F+e)}]`,functions:function(e){const t=(0,i.functions)(e);Me.forEach((e=>t[e]="event.vega."+e));for(const e in Pe)t[e]=Ie+e;return(0,r.extend)(t,function(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=I,n._range=I,n._scale=I;const a=t=>"_["+(t.type===i.Literal?(0,r.stringValue)(N+t.value):(0,r.stringValue)(N)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${a(e[0])})`,_range:e=>`${a(e[0])}.range()`,_scale:t=>`${a(t[0])}(${e(t[1])})`}}(e,Pe,$e)),t},constants:i.constants,visitors:$e},Be=(0,i.codegenExpression)(Le);function Ue(e,t,n){return 1===arguments.length?Pe[e]:(Pe[e]=t,n&&($e[e]=n),Be&&(Be.functions[e]=Ie+e),this)}function ze(e,t){const n={};let a;try{e=(0,r.isString)(e)?e:(0,r.stringValue)(e)+"",a=(0,i.parseExpression)(e)}catch(t){(0,r.error)("Expression parse error: "+e)}a.visit((e=>{if(e.type!==i.CallExpression)return;const r=e.callee.name,a=Le.visitors[r];a&&a(r,e.arguments,t,n)}));const o=Be(a);return o.globals.forEach((e=>{const i=F+e;!(0,r.hasOwnProperty)(n,i)&&t.getSignal(e)&&(n[i]=t.signalRef(e))})),{$expr:(0,r.extend)({code:o.code},t.options.ast?{ast:a}:null),$fields:o.fields,$params:n}}Ue("bandwidth",me,I),Ue("copy",ye,I),Ue("domain",ve,I),Ue("range",we,I),Ue("invert",be,I),Ue("scale",xe,I),Ue("gradient",Ee,I),Ue("geoArea",U,I),Ue("geoBounds",z,I),Ue("geoCentroid",q,I),Ue("geoShape",Se,I),Ue("geoScale",j,I),Ue("indata",g,M),Ue("data",h,P),Ue("treePath",Te,P),Ue("treeAncestors",ke,P),Ue("vlSelectionTest",c.selectionTest,c.selectionVisitor),Ue("vlSelectionIdTest",c.selectionIdTest,c.selectionVisitor),Ue("vlSelectionResolve",c.selectionResolve,c.selectionVisitor),Ue("vlSelectionTuples",c.selectionTuples)},35886:(e,t,n)=>{"use strict";n.r(t),n.d(t,{contour:()=>k,geojson:()=>O,geopath:()=>N,geopoint:()=>F,geoshape:()=>P,graticule:()=>M,heatmap:()=>I,isocontour:()=>v,kde2d:()=>A,projection:()=>L});var r=n(24988),i=n(26372),a=n(61388),o=n(48872),s=n(63316),l=n(51300),u=n(72090),c=n(14958);function d(){}const f=[[],[[[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 p(){var e=1,t=1,n=s;function r(e,t){return t.map((t=>a(e,t)))}function a(r,i){var a=[],s=[];return function(n,r,i){var a,s,l,u,c,d,p=[],h=[];for(a=s=-1,u=n[0]>=r,f[u<<1].forEach(g);++a=r,f[l|u<<1].forEach(g);for(f[0|u].forEach(g);++s=r,c=n[s*e]>=r,f[u<<1|c<<2].forEach(g);++a=r,d=c,c=n[s*e+a+1]>=r,f[l|u<<1|c<<2|d<<3].forEach(g);f[u|c<<3].forEach(g)}for(a=-1,c=n[s*e]>=r,f[c<<2].forEach(g);++a=r,f[c<<2|d<<3].forEach(g);function g(e){var t,n,r=[e[0][0]+a,e[0][1]+s],l=[e[1][0]+a,e[1][1]+s],u=o(r),c=o(l);(t=h[u])?(n=p[c])?(delete h[t.end],delete p[n.start],t===n?(t.ring.push(l),i(t.ring)):p[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(l),h[t.end=c]=t):(t=p[c])?(n=h[u])?(delete p[t.start],delete h[n.end],t===n?(t.ring.push(l),i(t.ring)):p[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete p[t.start],t.ring.unshift(r),p[t.start=u]=t):p[u]=h[c]={start:u,end:c,ring:[r,l]}}f[c<<3].forEach(g)}(r,i,(e=>{n(e,r,i),function(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var a,o=n[0],s=n[1],l=0|o,u=0|s,c=r[u*e+l];o>0&&o0&&s=0&&o>=0||(0,i.error)("invalid size"),e=a,t=o,r},r.smooth=function(e){return arguments.length?(n=e?s:d,r):n===s},r}function h(e,t){for(var n,r=-1,i=t.length;++rr!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(i=-i)}return i}function m(e,t,n){var r,i,a,o;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],a=n[r],o=t[r],i<=a&&a<=o||o<=a&&a<=i)}function y(e,t,n){return function(r){var o=(0,i.extent)(r),s=n?Math.min(o[0],0):o[0],l=o[1],u=l-s,c=t?(0,a.tickStep)(s,l,e):u/(e+1);return(0,a.range)(s+c,l,c)}}function v(e){r.Transform.call(this,null,e)}function b(e,t,n,r,i){const a=e.x1||0,o=e.y1||0,s=t*n<0;function l(e){e.forEach(u)}function u(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-a)*t+r,e[1]=(e[1]-o)*n+i}return function(e){return e.coordinates.forEach(l),e}}function w(e,t,n){const r=e>=0?e:(0,o.bandwidthNRD)(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function x(e){return(0,i.isFunction)(e)?e:(0,i.constant)(+e)}function E(){var e=e=>e[0],t=e=>e[1],n=i.one,r=[-1,-1],o=960,s=500,l=2;function u(i,u){const c=w(r[0],i,e)>>l,d=w(r[1],i,t)>>l,f=c?c+2:0,p=d?d+2:0,h=2*f+(o>>l),g=2*p+(s>>l),m=new Float32Array(h*g),y=new Float32Array(h*g);let v=m;i.forEach((r=>{const i=f+(+e(r)>>l),a=p+(+t(r)>>l);i>=0&&i=0&&a0&&d>0?(S(h,g,m,y,c),_(h,g,y,m,d),S(h,g,m,y,c),_(h,g,y,m,d),S(h,g,m,y,c),_(h,g,y,m,d)):c>0?(S(h,g,m,y,c),S(h,g,y,m,c),S(h,g,m,y,c),v=y):d>0&&(_(h,g,m,y,d),_(h,g,y,m,d),_(h,g,m,y,d),v=y);const b=u?Math.pow(2,-2*l):1/(0,a.sum)(v);for(let e=0,t=h*g;e>l),y2:p+(s>>l)}}return u.x=function(t){return arguments.length?(e=x(t),u):e},u.y=function(e){return arguments.length?(t=x(e),u):t},u.weight=function(e){return arguments.length?(n=x(e),u):n},u.size=function(e){if(!arguments.length)return[o,s];var t=+e[0],n=+e[1];return t>=0&&n>=0||(0,i.error)("invalid size"),o=t,s=n,u},u.cellSize=function(e){return arguments.length?((e=+e)>=1||(0,i.error)("invalid cell size"),l=Math.floor(Math.log(e)/Math.LN2),u):1<=i&&(t>=a&&(s-=n[t-a+o*e]),r[t-i+o*e]=s/Math.min(t+1,e-1+a-t,a))}function _(e,t,n,r,i){const a=1+(i<<1);for(let o=0;o=i&&(s>=a&&(l-=n[o+(s-a)*e]),r[o+(s-i)*e]=l/Math.min(s+1,t-1+a-s,a))}function A(e){r.Transform.call(this,null,e)}v.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"}]},(0,i.inherits)(v,r.Transform,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=t.materialize(t.SOURCE).source,s=e.field||i.identity,l=p().smooth(!1!==e.smooth),u=e.thresholds||function(e,t,n){const r=y(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>(0,a.max)(t(e).values))))}(o,s,e),c=null===e.as?null:e.as||"contour",d=[];return o.forEach((t=>{const n=s(t),a=l.size([n.width,n.height])(n.values,(0,i.isArray)(u)?u:u(n.values));!function(e,t,n,r){let a=r.scale||t.scale,o=r.translate||t.translate;if((0,i.isFunction)(a)&&(a=a(n,r)),(0,i.isFunction)(o)&&(o=o(n,r)),(1===a||null==a)&&!o)return;const s=((0,i.isNumber)(a)?a:a[0])||1,l=((0,i.isNumber)(a)?a:a[1])||1,u=o&&o[0]||0,c=o&&o[1]||0;e.forEach(b(t,s,l,u,c))}(a,n,t,e),a.forEach((e=>{d.push((0,r.rederive)(t,(0,r.ingest)(null!=c?{[c]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=d,n}}),A.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"}]};const C=["x","y","weight","size","cellSize","bandwidth"];function T(e,t){return C.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function k(e){r.Transform.call(this,null,e)}(0,i.inherits)(A,r.Transform,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,a=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=function(e,t){var n,r,i,a,o,s,l=[],u=e=>e(a);if(null==t)l.push(e);else for(n={},r=0,i=e.length;r(0,r.ingest)(function(e,t){for(let n=0;nr.push(u(e)))),s&&l&&(t.visit(c,(e=>{var t=s(e),n=l(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&a.push([t,n])})),r=r.concat({type:R,geometry:{type:"MultiPoint",coordinates:a}})),this.value={type:D,features:r}}}),N.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"}]},(0,i.inherits)(N,r.Transform,{transform(e,t){var n=t.fork(t.ALL),r=this.value,a=e.field||i.identity,o=e.as||"path",l=n.SOURCE;!r||e.modified()?(this.value=r=(0,s.getProjectionPath)(e.projection),n.materialize().reflow()):l=a===i.identity||t.modified(a.fields)?n.ADD_MOD:n.ADD;const u=function(e,t){const n=e.pointRadius();return e.context(null),null!=t&&e.pointRadius(t),n}(r,e.pointRadius);return n.visit(l,(e=>e[o]=r(a(e)))),r.pointRadius(u),n.modifies(o)}}),F.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"]}]},(0,i.inherits)(F,r.Transform,{transform(e,t){var n,r=e.projection,i=e.fields[0],a=e.fields[1],o=e.as||["x","y"],s=o[0],l=o[1];function u(e){const t=r([i(e),a(e)]);t?(e[s]=t[0],e[l]=t[1]):(e[s]=void 0,e[l]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(n=t.modified(i.fields)||t.modified(a.fields),t.visit(n?t.ADD_MOD:t.ADD,u)),t.modifies(o)}}),P.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"}]},(0,i.inherits)(P,r.Transform,{transform(e,t){var n=t.fork(t.ALL),r=this.value,a=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),a=e.pointRadius(n)(t(r));return e.pointRadius(i),a};return r.context=t=>(e.context(t),r),r}((0,s.getProjectionPath)(e.projection),e.field||(0,i.field)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[a]=r)),n.modifies(a)}}),M.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}]},(0,i.inherits)(M,r.Transform,{transform(e,t){var n,a=this.value,o=this.generator;if(!a.length||e.modified())for(const t in e)(0,i.isFunction)(o[t])&&o[t](e[t]);return n=o(),a.length?t.mod.push((0,r.replace)(a[0],n)):t.add.push((0,r.ingest)(n)),a[0]=n,t}}),I.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"}]},(0,i.inherits)(I,r.Transform,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,o=e.field||i.identity,s=function(e,t){let n;return(0,i.isFunction)(e)?(n=n=>e(n,t),n.dep=$(e)):e?n=(0,i.constant)(e):(n=e=>e.$value/e.$max||0,n.dep=!0),n}(e.opacity,e),l=function(e,t){let n;return(0,i.isFunction)(e)?(n=n=>(0,u.rgb)(e(n,t)),n.dep=$(e)):n=(0,i.constant)((0,u.rgb)(e||"#888")),n}(e.color,e),d=e.as||"image",f={$x:0,$y:0,$value:0,$max:r?(0,a.max)(n.map((e=>(0,a.max)(o(e).values)))):0};return n.forEach((e=>{const t=o(e),n=(0,i.extend)({},e,f);r||(n.$max=(0,a.max)(t.values||[])),e[d]=function(e,t,n,r){const a=e.width,o=e.height,s=e.x1||0,l=e.y1||0,u=e.x2||a,d=e.y2||o,f=e.values,p=f?e=>f[e]:i.zero,h=(0,c.canvas)(u-s,d-l),g=h.getContext("2d"),m=g.getImageData(0,0,u-s,d-l),y=m.data;for(let e=l,i=0;e{null!=e[t]&&B(n,t,e[t])}))):s.projectionProperties.forEach((t=>{e.modified(t)&&B(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return 1===(e=(0,i.array)(e)).length?e[0]:{type:D,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===D?e.features:(0,i.array)(e).filter((e=>null!=e)).map((e=>e.type===R?e:{type:R,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}})},91434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nest:()=>s,pack:()=>p,partition:()=>g,stratify:()=>m,tree:()=>b,treelinks:()=>w,treemap:()=>S});var r=n(24988),i=n(26372),a=n(37750);function o(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function s(e){r.Transform.call(this,null,e)}s.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const l=e=>e.values;function u(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,a=e[r++],o={},s={};let l,u,c,d=-1;for(;++de.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function c(e){r.Transform.call(this,null,e)}(0,i.inherits)(s,r.Transform,{transform(e,t){t.source||(0,i.error)("Nest transform requires an upstream data source.");var n=e.generate,s=e.modified(),c=t.clone(),d=this.value;return(!d||s||t.changed())&&(d&&d.each((e=>{e.children&&(0,r.isTuple)(e.data)&&c.rem.push(e.data)})),this.value=d=(0,a.hierarchy)({values:(0,i.array)(e.keys).reduce(((e,t)=>(e.key(t),e)),u()).entries(c.source)},l),n&&d.each((e=>{e.children&&(e=(0,r.ingest)(e.data),c.add.push(e),c.source.push(e))})),o(d,r.tupleid,r.tupleid)),c.source.root=d,c}});const d=(e,t)=>e.parent===t.parent?1:2;(0,i.inherits)(c,r.Transform,{transform(e,t){t.source&&t.source.root||(0,i.error)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),a=this.fields,o=t.source.root,s=e.as||a;e.field?o.sum(e.field):o.count(),e.sort&&o.sort((0,r.stableCompare)(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,a=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let a=0;as[(0,r.tupleid)(e)]=1)),a.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&s[(0,r.tupleid)(t)]&&s[(0,r.tupleid)(n)]&&o.add.push((0,r.ingest)({source:n,target:t}))})),this.value=o.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>s[(0,r.tupleid)(e)]=1)),n.forEach((e=>{(s[(0,r.tupleid)(e.source)]||s[(0,r.tupleid)(e.target)])&&o.mod.push(e)}))),o}});const x={binary:a.treemapBinary,dice:a.treemapDice,slice:a.treemapSlice,slicedice:a.treemapSliceDice,squarify:a.treemapSquarify,resquarify:a.treemapResquarify},E=["x0","y0","x1","y1","depth","children"];function S(e){c.call(this,e)}S.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:E.length,default:E}]},(0,i.inherits)(S,c,{layout(){const e=(0,a.treemap)();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{(0,i.hasOwnProperty)(x,t)?e.tile(x[t]):(0,i.error)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:E})},48196:(e,t,n)=>{"use strict";n.r(t),n.d(t,{expressionInterpreter:()=>p});var r={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},i={"*":(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)=>ee<=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<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},a={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const o=Array.prototype.slice,s=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,o.call(t,1))};var l={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:(e,t,n,r,i,a,o)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,a||0,o||0),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 s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const u=["view","item","group","xy","x","y"],c=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&c.add(setImmediate);const d={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:r[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!c.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||l[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>i[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>a[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(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,c.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function f(e,t,n,r,i,a){const o=e=>d[e.type](o,e);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=r,o.event=i,o.item=a,u.forEach((e=>o.fn[e]=function(){return i.vega[e](...arguments)})),o(e)}var p={operator(e,t){const n=t.ast,r=e.functions;return e=>f(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>f(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>f(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return f(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,a="group"===n||"image"===n||"rect"===n;return(e,t)=>{const o=e.datum;let s,l=0;for(const n in r)s=f(r[n].ast,i,t,o,void 0,e),e[n]!==s&&(e[n]=s,l=1);return"rule"!==n&&function(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)}(e,r,a),l}}}},43308:(e,t,n)=>{"use strict";n.r(t),n.d(t,{label:()=>C});var r=n(84636),i=n(14958),a=n(24988),o=n(26372);const s=4278190080;function l(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function u(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;"group"===i?t.forEach((t=>{t.items.forEach((t=>u(e,t.items,n)))})):r.Marks[i].draw(e,{items:n?t.map(c):t})}function c(e){const t=(0,a.rederive)(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const d=31,f=new Uint32Array(33),p=new Uint32Array(33);p[0]=0,f[0]=~p[0];for(let e=1;e<=32;++e)p[e]=p[e-1]<<1|1,f[e]=~p[e];function h(e,t,n,r,i,a){let o=n/2;return e-o<0||e+o>i||t-(o=r/2)<0||t+o>a}function g(e,t,n,r,i,a,o,s){const l=i*a/(2*r),u=e(t-l),c=e(t+l),d=e(n-(a/=2)),f=e(n+a);return o.outOfBounds(u,d,c,f)||o.getRange(u,d,c,f)||s&&s.getRange(u,d,c,f)}const m=[-1,-1,1,1],y=[-1,1,-1,1],v=["right","center","left"],b=["bottom","middle","top"];function w(e,t,n,r,i,a,o,s,l,u,c,d){return!(i.outOfBounds(e,n,t,r)||(d&&a||i).getRange(e,n,t,r))}const x={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},E={naive:function(e,t,n,i){const a=e.width,o=e.height;return function(e){const t=e.datum.datum.items[i].items,n=t.length,s=e.datum.fontSize,l=r.textMetrics.width(e.datum,e.datum.text);let u,c,d,f,p,h,g,m=0;for(let r=0;r=m&&(m=g,e.x=p,e.y=h);return p=l/2,h=s/2,u=e.x-p,c=e.x+p,d=e.y-h,f=e.y+h,e.align="center",u<0&&c<=a?e.align="left":0<=u&&a=1;)f=(p+m)/2,g(e,c,d,u,i,f,s,l)?m=f:p=f;if(p>r)return[c,d,p,!0]}}return function(t){const l=t.datum.datum.items[i].items,c=l.length,d=t.datum.fontSize,f=r.textMetrics.width(t.datum,t.datum.text);let p,m,y,v,b,w,x,E,S,_,A,C,T,k,R,D,O,N=n?d:0,F=!1,P=!1,M=0;for(let r=0;rm&&(O=p,p=m,m=O),y>v&&(O=y,y=v,v=O),S=e(p),A=e(m),_=~~((S+A)/2),C=e(y),k=e(v),T=~~((C+k)/2),x=_;x>=S;--x)for(E=T;E>=C;--E)D=u(x,E,N,f,d),D&&([t.x,t.y,N,F]=D);for(x=_;x<=A;++x)for(E=T;E<=k;++E)D=u(x,E,N,f,d),D&&([t.x,t.y,N,F]=D);F||n||(R=Math.abs(m-p+v-y),b=(p+m)/2,w=(y+v)/2,R>=M&&!h(b,w,f,d,a,o)&&!g(e,b,w,d,f,d,s,null)&&(M=R,t.x=b,t.y=w,P=!0))}return!(!F&&!P||(b=f/2,w=d/2,s.setRange(e(t.x-b),e(t.y-w),e(t.x+b),e(t.y+w)),t.align="center",t.baseline="middle",0))}},floodfill:function(e,t,n,i){const a=e.width,o=e.height,s=t[0],l=t[1],u=e.bitmap();return function(t){const c=t.datum.datum.items[i].items,d=c.length,f=t.datum.fontSize,p=r.textMetrics.width(t.datum,t.datum.text),v=[];let b,w,x,E,S,_,A,C,T,k,R,D,O=n?f:0,N=!1,F=!1,P=0;for(let r=0;r=1;)R=(T+k)/2,g(e,S,_,f,p,R,s,l)?k=R:T=R;T>O&&(t.x=S,t.y=_,O=T,N=!0)}}N||n||(D=Math.abs(w-b+E-x),S=(b+w)/2,_=(x+E)/2,D>=P&&!h(S,_,p,f,a,o)&&!g(e,S,_,f,p,f,s,null)&&(P=D,t.x=S,t.y=_,F=!0))}return!(!N&&!F||(S=p/2,_=f/2,s.setRange(e(t.x-S),e(t.y-_),e(t.x+S),e(t.y+_)),t.align="center",t.baseline="middle",0))}}};function S(e,t,n,a,o,c,h,g,m,y,S){if(!e.length)return e;const _=Math.max(a.length,o.length),A=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(T,k,g,m),O=null===y||y===1/0,N=R&&"naive"===S;var F;let P=-1,M=-1;const I=e.map((e=>{const t=O?r.textMetrics.width(e,e.text):void 0;return P=Math.max(P,t),M=Math.max(M,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:D(e),textWidth:t}}));y=null===y||y===1/0?Math.max(P,M)+Math.max(...a):y;const $=function(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),a=~~((t+2*n+r)/r),o=e=>~~((e+n)/r);return o.invert=e=>e*r-n,o.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+32)/32));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>5]&1<<(i&d)},set:(t,n)=>{const i=n*e+t;r(i>>>5,1<<(i&d))},clear:(t,n)=>{const r=n*e+t;i(r>>>5,~(1<<(r&d)))},getRange:(t,r,i,a)=>{let o,s,l,u,c=a;for(;c>=r;--c)if(o=c*e+t,s=c*e+i,l=o>>>5,u=s>>>5,l===u){if(n[l]&f[o&d]&p[1+(s&d)])return!0}else{if(n[l]&f[o&d])return!0;if(n[u]&p[1+(s&d)])return!0;for(let e=l+1;e{let o,s,l,u,c;for(;n<=a;++n)if(o=n*e+t,s=n*e+i,l=o>>>5,u=s>>>5,l===u)r(l,f[o&d]&p[1+(s&d)]);else for(r(l,f[o&d]),r(u,p[1+(s&d)]),c=l+1;c{let o,s,l,u,c;for(;n<=a;++n)if(o=n*e+t,s=n*e+r,l=o>>>5,u=s>>>5,l===u)i(l,p[o&d]|f[1+(s&d)]);else for(i(l,p[o&d]),i(u,f[1+(s&d)]),c=l+1;cn<0||r<0||a>=t||i>=e}}(i,a),o.ratio=r,o.padding=n,o.width=e,o.height=t,o}(t[0],t[1],y);let L;if(!N){n&&I.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));L=c.length||r?function(e,t,n,r,a){const o=e.width,c=e.height,d=r||a,f=(0,i.canvas)(o,c).getContext("2d"),p=(0,i.canvas)(o,c).getContext("2d"),h=d&&(0,i.canvas)(o,c).getContext("2d");n.forEach((e=>u(f,e,!1))),u(p,t,!1),d&&u(h,t,!0);const g=l(f,o,c),m=l(p,o,c),y=d&&l(h,o,c),v=e.bitmap(),b=d&&e.bitmap();let w,x,E,S,_,A,C,T;for(x=0;xn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}($,h&&I)}const B=R?E[S]($,L,h,m):function(e,t,n,i){const a=e.width,o=e.height,s=t[0],l=t[1],u=i.length;return function(t){const c=t.boundary,d=t.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>a||c[3]>o)return!1;let f,p,h,g,m,y,x,E,S,_,A,C,T,k,R,D=t.textWidth??0;for(let a=0;a>>2&3)-1,h=0===f&&0===p||i[a]<0,g=f&&p?Math.SQRT1_2:1,m=i[a]<0?-1:1,y=c[1+f]+i[a]*f*g,A=c[4+p]+m*d*p/2+i[a]*p*g,E=A-d/2,S=A+d/2,C=e(y),k=e(E),R=e(S),!D){if(!w(C,C,k,R,s,l,0,0,0,0,0,h))continue;D=r.textMetrics.width(t.datum,t.datum.text)}if(_=y+m*D*f/2,y=_-D/2,x=_+D/2,C=e(y),T=e(x),w(C,T,k,R,s,l,0,0,0,0,0,h))return t.x=f?f*m<0?x:y:_,t.y=p?p*m<0?S:E:A,t.align=v[f*m+1],t.baseline=b[p*m+1],s.setRange(C,k,T,R),!0}return!1}}($,L,C,A);return I.forEach((e=>e.opacity=+B(e))),I}const _=["x","y","opacity","align","baseline"],A=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function C(e){a.Transform.call(this,null,e)}C.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:A},{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:_.length,default:_}]},(0,o.inherits)(C,a.Transform,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(){const n=e.sort;return(0,o.isFunction)(n)&&t.modified(n.fields)}()))return;e.size&&2===e.size.length||(0,o.error)("Size parameter should be specified as a [width, height] array.");const r=e.as||_;return S(t.materialize(t.SOURCE).source||[],e.size,e.sort,(0,o.array)(null==e.offset?1:e.offset),(0,o.array)(e.anchor||A),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,void 0===e.padding?0:e.padding,e.method||"naive").forEach((e=>{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}})},54814:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COUNTING_OPS:()=>c,MULTIDOMAIN_SORT_OP_INDEX:()=>o,SHARED_DOMAIN_OPS:()=>h,SUM_OPS:()=>p,isAggregateOp:()=>u,isArgmaxDef:()=>l,isArgminDef:()=>s,isCountingAggregateOp:()=>d,isMinMaxOp:()=>f});var r=n(26372),i=n(79989);const a={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},o={count:1,min:1,max:1};function s(e){return(0,i.hasProperty)(e,"argmin")}function l(e){return(0,i.hasProperty)(e,"argmax")}function u(e){return(0,r.isString)(e)&&(0,r.hasOwnProperty)(a,e)}const c=new Set(["count","valid","missing","distinct"]);function d(e){return(0,r.isString)(e)&&c.has(e)}function f(e){return(0,r.isString)(e)&&(0,i.contains)(["min","max"],e)}const p=new Set(["count","sum","distinct","valid","missing"]),h=new Set(["mean","average","median","q1","q3","min","max"])},65032:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AXIS_CONFIGS:()=>p,AXIS_PARTS:()=>s,AXIS_PROPERTIES:()=>f,AXIS_PROPERTY_TYPE:()=>l,COMMON_AXIS_PROPERTIES_INDEX:()=>u,CONDITIONAL_AXIS_PROP_INDEX:()=>a,isAxisProperty:()=>d,isConditionalAxisValue:()=>o});var r=n(79989),i=n(26372);const a={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 o(e){return e?.condition}const s=["domain","grid","labels","ticks","title"],l={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"},u={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},c={...u,style:1,labelExpr:1,encoding:1};function d(e){return(0,i.hasOwnProperty)(c,e)}const f=(0,r.keys)(c),p=(0,r.keys)({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})},19664:(e,t,n)=>{"use strict";n.r(t),n.d(t,{autoMaxBins:()=>f,binToString:()=>s,isBinParams:()=>c,isBinned:()=>u,isBinning:()=>l,isParameterExtent:()=>d});var r=n(26372),i=n(95290),a=n(79543),o=n(79989);function s(e){return(0,r.isBoolean)(e)&&(e=(0,a.normalizeBin)(e,void 0)),"bin"+(0,o.keys)(e).map((t=>d(e[t])?(0,o.varName)(`_${t}_${(0,o.entries)(e[t])}`):(0,o.varName)(`_${t}_${e[t]}`))).join("")}function l(e){return!0===e||c(e)&&!e.binned}function u(e){return"binned"===e||c(e)&&!0===e.binned}function c(e){return(0,r.isObject)(e)}function d(e){return(0,o.hasProperty)(e,"param")}function f(e){switch(e){case i.ROW:case i.COLUMN:case i.SIZE:case i.COLOR:case i.FILL:case i.STROKE:case i.STROKEWIDTH:case i.OPACITY:case i.FILLOPACITY:case i.STROKEOPACITY:case i.SHAPE:return 6;case i.STROKEDASH:return 4;default:return 10}}},95290:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ANGLE:()=>T,CHANNELS:()=>Q,COLOR:()=>E,COLUMN:()=>o,DESCRIPTION:()=>U,DETAIL:()=>M,FACET:()=>s,FACET_CHANNELS:()=>K,FILL:()=>S,FILLOPACITY:()=>R,GEOPOSITION_CHANNELS:()=>V,HREF:()=>L,KEY:()=>I,LATITUDE:()=>v,LATITUDE2:()=>w,LONGITUDE:()=>b,LONGITUDE2:()=>x,NONPOSITION_CHANNELS:()=>Ie,NONPOSITION_SCALE_CHANNELS:()=>tt,OFFSET_SCALE_CHANNELS:()=>He,OPACITY:()=>k,ORDER:()=>P,POLAR_POSITION_SCALE_CHANNELS:()=>ze,POLAR_POSITION_SCALE_CHANNEL_INDEX:()=>Ue,POSITION_SCALE_CHANNELS:()=>Le,RADIUS:()=>h,RADIUS2:()=>g,ROW:()=>a,SCALE_CHANNELS:()=>at,SECONDARY_RANGE_CHANNEL:()=>de,SHAPE:()=>A,SINGLE_DEF_CHANNELS:()=>se,SINGLE_DEF_UNIT_CHANNELS:()=>le,SIZE:()=>C,STROKE:()=>_,STROKEDASH:()=>N,STROKEOPACITY:()=>D,STROKEWIDTH:()=>O,TEXT:()=>F,THETA:()=>m,THETA2:()=>y,TOOLTIP:()=>$,UNIT_CHANNELS:()=>we,URL:()=>B,X:()=>l,X2:()=>c,XOFFSET:()=>f,Y:()=>u,Y2:()=>d,YOFFSET:()=>p,getMainChannelFromOffsetChannel:()=>be,getMainRangeChannel:()=>pe,getOffsetChannel:()=>ye,getOffsetScaleChannel:()=>ve,getPositionChannelFromLatLong:()=>H,getPositionScaleChannel:()=>qe,getSecondaryRangeChannel:()=>ge,getSizeChannel:()=>me,getVgPositionChannel:()=>he,isChannel:()=>ce,isColorChannel:()=>Y,isGeoPositionChannel:()=>G,isNonPositionScaleChannel:()=>nt,isPolarPositionChannel:()=>q,isScaleChannel:()=>ot,isSecondaryRangeChannel:()=>fe,isSingleDefUnitChannel:()=>ue,isXorY:()=>Be,isXorYOffset:()=>Ge,rangeType:()=>dt,supportLegend:()=>rt,supportMark:()=>st});var r=n(26372),i=n(79989);const a="row",o="column",s="facet",l="x",u="y",c="x2",d="y2",f="xOffset",p="yOffset",h="radius",g="radius2",m="theta",y="theta2",v="latitude",b="longitude",w="latitude2",x="longitude2",E="color",S="fill",_="stroke",A="shape",C="size",T="angle",k="opacity",R="fillOpacity",D="strokeOpacity",O="strokeWidth",N="strokeDash",F="text",P="order",M="detail",I="key",$="tooltip",L="href",B="url",U="description",z={theta:1,theta2:1,radius:1,radius2:1};function q(e){return(0,r.hasOwnProperty)(z,e)}const j={longitude:1,longitude2:1,latitude:1,latitude2:1};function H(e){switch(e){case v:return"y";case w:return"y2";case b:return"x";case x:return"x2"}}function G(e){return(0,r.hasOwnProperty)(j,e)}const V=(0,i.keys)(j),W={x:1,y:1,x2:1,y2:1,...z,...j,xOffset:1,yOffset:1,color:1,fill:1,stroke: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 Y(e){return e===E||e===S||e===_}const X={row:1,column:1,facet:1},K=(0,i.keys)(X),J={...W,...X},Q=(0,i.keys)(J),{order:Z,detail:ee,tooltip:te,...ne}=J,{row:re,column:ie,facet:ae,...oe}=ne,se=(0,i.keys)(ne),le=(0,i.keys)(oe);function ue(e){return(0,r.hasOwnProperty)(oe,e)}function ce(e){return(0,r.hasOwnProperty)(J,e)}const de=[c,d,w,x,y,g];function fe(e){return pe(e)!==e}function pe(e){switch(e){case c:return l;case d:return u;case w:return v;case x:return b;case y:return m;case g:return h}return e}function he(e){if(q(e))switch(e){case m:return"startAngle";case y:return"endAngle";case h:return"outerRadius";case g:return"innerRadius"}return e}function ge(e){switch(e){case l:return c;case u:return d;case v:return w;case b:return x;case m:return y;case h:return g}}function me(e){switch(e){case l:case c:return"width";case u:case d:return"height"}}function ye(e){switch(e){case l:return"xOffset";case u:return"yOffset";case c:return"x2Offset";case d:return"y2Offset";case m:return"thetaOffset";case h:return"radiusOffset";case y:return"theta2Offset";case g:return"radius2Offset"}}function ve(e){switch(e){case l:return"xOffset";case u:return"yOffset"}}function be(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const we=(0,i.keys)(W),{x:xe,y:Ee,x2:Se,y2:_e,xOffset:Ae,yOffset:Ce,latitude:Te,longitude:ke,latitude2:Re,longitude2:De,theta:Oe,theta2:Ne,radius:Fe,radius2:Pe,...Me}=W,Ie=(0,i.keys)(Me),$e={x:1,y:1},Le=(0,i.keys)($e);function Be(e){return(0,r.hasOwnProperty)($e,e)}const Ue={theta:1,radius:1},ze=(0,i.keys)(Ue);function qe(e){return"width"===e?l:u}const je={xOffset:1,yOffset:1},He=(0,i.keys)(je);function Ge(e){return(0,r.hasOwnProperty)(je,e)}const{text:Ve,tooltip:We,href:Ye,url:Xe,description:Ke,detail:Je,key:Qe,order:Ze,...et}=Me,tt=(0,i.keys)(et);function nt(e){return(0,r.hasOwnProperty)(Me,e)}function rt(e){switch(e){case E:case S:case _:case C:case A:case k:case O:case N:return!0;case R:case D:case T:return!1}}const it={...$e,...Ue,...je,...et},at=(0,i.keys)(it);function ot(e){return(0,r.hasOwnProperty)(it,e)}function st(e,t){return function(e){switch(e){case E:case S:case _:case U:case M:case I:case $:case L:case P:case k:case R:case D:case O:case s:case a:case o:return lt;case l:case u:case f:case p:case v:case b:return ct;case c:case d:case w:case x:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case C:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case N:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case A:return{point:"always",geoshape:"always"};case F:return{text:"always"};case T:return{point:"always",square:"always",text:"always"};case B:return{image:"always"};case m:case h:return{text:"always",arc:"always"};case y:case g:return{arc:"always"}}}(e)[t]}const lt={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:ut,...ct}=lt;function dt(e){switch(e){case l:case u:case m:case h:case f:case p:case C:case T:case O:case k:case R:case D:case c:case d:case y:case g:return;case s:case a:case o:case A:case N:case F:case $:case L:case B:case U:return"discrete";case E:case S:case _:return"flexible";case v:case b:case w:case x:case M:case I:case P:return}}},79543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{binRequiresRange:()=>be,channelCompatibility:()=>he,channelDefType:()=>F,defaultTitle:()=>ie,defaultTitleFormatter:()=>Q,defaultType:()=>oe,functionalTitleFormatter:()=>J,getBandPosition:()=>_,getBandSize:()=>A,getFieldDef:()=>se,getFieldOrDatumDef:()=>le,getFormatMixins:()=>ae,getGuide:()=>re,hasBandEnd:()=>C,hasConditionalFieldDef:()=>R,hasConditionalFieldOrDatumDef:()=>D,hasConditionalValueDef:()=>O,initChannelDef:()=>ue,initFieldDef:()=>de,initFieldOrDatumDef:()=>ce,isConditionalDef:()=>k,isConditionalParameter:()=>w,isContinuousFieldOrDatumDef:()=>M,isCount:()=>X,isDatumDef:()=>P,isDiscrete:()=>W,isDiscretizing:()=>Y,isFieldDef:()=>N,isFieldOrDatumDef:()=>L,isFieldOrDatumDefForTimeFormat:()=>ge,isMarkPropFieldOrDatumDef:()=>j,isNumericDataDef:()=>$,isOrderOnlyDef:()=>T,isPositionFieldOrDatumDef:()=>q,isRepeatRef:()=>x,isScaleFieldDef:()=>z,isSortableFieldDef:()=>S,isStringFieldOrDatumDef:()=>H,isTimeFieldDef:()=>me,isTypedFieldDef:()=>B,isUnbinnedQuantitativeFieldOrDatumDef:()=>I,isValueDef:()=>U,normalizeBin:()=>fe,resetTitleFormatter:()=>te,setTitleFormatter:()=>ee,title:()=>ne,toFieldDefBase:()=>E,toStringFieldDef:()=>G,valueArray:()=>ve,valueExpr:()=>ye,verbalTitleFormatter:()=>K,vgField:()=>V});var r=n(26372),i=n(54814),a=n(19664),o=n(95290),s=n(15058),l=n(6032),u=n(20032),c=n(3802),d=n(20916),f=n(75028),p=n(31179),h=n(46681),g=n(51894),m=n(96598),y=n(99273),v=n(79989),b=n(5711);function w(e){return(0,v.hasProperty)(e,"param")}function x(e){return!(0,r.isString)(e)&&(0,v.hasProperty)(e,"repeat")}function E(e){const{field:t,timeUnit:n,bin:r,aggregate:i}=e;return{...n?{timeUnit:n}:{},...r?{bin:r}:{},...i?{aggregate:i}:{},field:t}}function S(e){return(0,v.hasProperty)(e,"sort")}function _({fieldDef:e,fieldDef2:t,markDef:n,config:r}){if(L(e)&&void 0!==e.bandPosition)return e.bandPosition;if(N(e)){const{timeUnit:i,bin:o}=e;if(i&&!t)return(0,s.getMarkConfig)("timeUnitBandPosition",n,r);if((0,a.isBinning)(o))return.5}}function A({channel:e,fieldDef:t,fieldDef2:n,markDef:r,config:i,scaleType:l,useVlSizeChannel:u}){const c=(0,o.getSizeChannel)(e),d=(0,s.getMarkPropOrConfig)(u?"size":c,r,i,{vgChannel:c});if(void 0!==d)return d;if(N(t)){const{timeUnit:e,bin:o}=t;if(e&&!n)return{band:(0,s.getMarkConfig)("timeUnitBandSize",r,i)};if((0,a.isBinning)(o)&&!(0,p.hasDiscreteDomain)(l))return{band:1}}return(0,f.isRectBasedMark)(r.type)?l?(0,p.hasDiscreteDomain)(l)?i[r.type]?.discreteBandSize||{band:1}:i[r.type]?.continuousBandSize:i[r.type]?.discreteBandSize:void 0}function C(e,t,n,r){return!!((0,a.isBinning)(e.bin)||e.timeUnit&&B(e)&&"temporal"===e.type)&&void 0!==_({fieldDef:e,fieldDef2:t,markDef:n,config:r})}function T(e){return(0,v.hasProperty)(e,"sort")&&!(0,v.hasProperty)(e,"field")}function k(e){return(0,v.hasProperty)(e,"condition")}function R(e){const t=e?.condition;return!!t&&!(0,r.isArray)(t)&&N(t)}function D(e){const t=e?.condition;return!!t&&!(0,r.isArray)(t)&&L(t)}function O(e){const t=e?.condition;return!!t&&((0,r.isArray)(t)||U(t))}function N(e){return(0,v.hasProperty)(e,"field")||"count"===e?.aggregate}function F(e){return e?.type}function P(e){return(0,v.hasProperty)(e,"datum")}function M(e){return B(e)&&!W(e)||$(e)}function I(e){return B(e)&&"quantitative"===e.type&&!e.bin||$(e)}function $(e){return P(e)&&(0,r.isNumber)(e.datum)}function L(e){return N(e)||P(e)}function B(e){return e&&((0,v.hasProperty)(e,"field")||"count"===e.aggregate)&&(0,v.hasProperty)(e,"type")}function U(e){return(0,v.hasProperty)(e,"value")}function z(e){return(0,v.hasProperty)(e,"scale")||(0,v.hasProperty)(e,"sort")}function q(e){return(0,v.hasProperty)(e,"axis")||(0,v.hasProperty)(e,"stack")||(0,v.hasProperty)(e,"impute")}function j(e){return(0,v.hasProperty)(e,"legend")}function H(e){return(0,v.hasProperty)(e,"format")||(0,v.hasProperty)(e,"formatType")}function G(e){return(0,v.omit)(e,["legend","axis","header","scale"])}function V(e,t={}){let n=e.field;const r=t.prefix;let o=t.suffix,s="";if(X(e))n=(0,v.internalField)("count");else{let r;if(!t.nofn)if(function(e){return(0,v.hasProperty)(e,"op")}(e))r=e.op;else{const{bin:l,aggregate:u,timeUnit:c}=e;(0,a.isBinning)(l)?(r=(0,a.binToString)(l),o=(t.binSuffix??"")+(t.suffix??"")):u?(0,i.isArgmaxDef)(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):(0,i.isArgminDef)(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):r=String(u):c&&!(0,m.isBinnedTimeUnit)(c)&&(r=(0,m.timeUnitToString)(c),o=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}r&&(n=n?`${r}_${n}`:r)}return o&&(n=`${n}_${o}`),r&&(n=`${r}_${n}`),t.forAs?(0,v.removePathFromField)(n):t.expr?(0,v.flatAccessWithDatum)(n,t.expr)+s:(0,v.replacePathInField)(n)+s}function W(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return N(e)&&!!e.bin;case"temporal":return!1}throw new Error(d.message.invalidFieldType(e.type))}function Y(e){return z(e)&&(0,p.isContinuousToDiscrete)(e.scale?.type)}function X(e){return"count"===e.aggregate}function K(e,t){const{field:n,bin:r,timeUnit:o,aggregate:s}=e;if("count"===s)return t.countTitle;if((0,a.isBinning)(r))return`${n} (binned)`;if(o&&!(0,m.isBinnedTimeUnit)(o)){const e=(0,m.normalizeTimeUnit)(o)?.unit;if(e)return`${n} (${(0,m.getTimeUnitParts)(e).join("-")})`}else if(s)return(0,i.isArgmaxDef)(s)?`${n} for max ${s.argmax}`:(0,i.isArgminDef)(s)?`${n} for min ${s.argmin}`:`${(0,v.titleCase)(s)} of ${n}`;return n}function J(e){const{aggregate:t,bin:n,timeUnit:r,field:o}=e;if((0,i.isArgmaxDef)(t))return`${o} for argmax(${t.argmax})`;if((0,i.isArgminDef)(t))return`${o} for argmin(${t.argmin})`;const s=r&&!(0,m.isBinnedTimeUnit)(r)?(0,m.normalizeTimeUnit)(r):void 0,l=t||s?.unit||s?.maxbins&&"timeunit"||(0,a.isBinning)(n)&&"bin";return l?`${l.toUpperCase()}(${o})`:o}const Q=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return J(e);default:return K(e,t)}};let Z=Q;function ee(e){Z=e}function te(){ee(Q)}function ne(e,t,{allowDisabling:n,includeDefault:r=!0}){const i=re(e)?.title;if(!N(e))return i??e.title;const a=e,o=r?ie(a,t):void 0;return n?(0,v.getFirstDefined)(i,a.title,o):i??a.title??o}function re(e){return q(e)&&e.axis?e.axis:j(e)&&e.legend?e.legend:(0,g.isFacetFieldDef)(e)&&e.header?e.header:void 0}function ie(e,t){return Z(e,t)}function ae(e){if(H(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const t=re(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function oe(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(S(e)&&(0,r.isArray)(e.sort))return"ordinal";const{aggregate:n,bin:a,timeUnit:o}=e;if(o)return"temporal";if(a||n&&!(0,i.isArgmaxDef)(n)&&!(0,i.isArgminDef)(n))return"quantitative";if(z(e)&&e.scale?.type)switch(p.SCALE_CATEGORY_INDEX[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function se(e){return N(e)?e:R(e)?e.condition:void 0}function le(e){return L(e)?e:D(e)?e.condition:void 0}function ue(e,t,n,i={}){if((0,r.isString)(e)||(0,r.isNumber)(e)||(0,r.isBoolean)(e)){const n=(0,r.isString)(e)?"string":(0,r.isNumber)(e)?"number":"boolean";return d.warn(d.message.primitiveChannelDef(t,n,e)),{value:e}}return L(e)?ce(e,t,n,i):D(e)?{...e,condition:ce(e.condition,t,n,i)}:e}function ce(e,t,n,i){if(H(e)){const{format:r,formatType:a,...o}=e;if((0,l.isCustomFormatType)(a)&&!n.customFormatTypes)return d.warn(d.message.customFormatTypeNotAllowed(t)),ce(o,t,n,i)}else{const r=q(e)?"axis":j(e)?"legend":(0,g.isFacetFieldDef)(e)?"header":null;if(r&&e[r]){const{format:a,formatType:o,...s}=e[r];if((0,l.isCustomFormatType)(o)&&!n.customFormatTypes)return d.warn(d.message.customFormatTypeNotAllowed(t)),ce({...e,[r]:s},t,n,i)}}return N(e)?de(e,t,i):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=(0,r.isNumber)(n)?"quantitative":(0,r.isString)(n)?"nominal":(0,u.isDateTime)(n)?"temporal":void 0,{...e,type:t}}(e)}function de(e,t,{compositeMark:n=!1}={}){const{aggregate:s,timeUnit:l,bin:u,field:c}=e,f={...e};if(n||!s||(0,i.isAggregateOp)(s)||(0,i.isArgmaxDef)(s)||(0,i.isArgminDef)(s)||(d.warn(d.message.invalidAggregate(s)),delete f.aggregate),l&&(f.timeUnit=(0,m.normalizeTimeUnit)(l)),c&&(f.field=`${c}`),(0,a.isBinning)(u)&&(f.bin=fe(u,t)),(0,a.isBinned)(u)&&!(0,o.isXorY)(t)&&d.warn(d.message.channelShouldNotBeUsedForBinned(t)),B(f)){const{type:e}=f,t=(0,y.getFullName)(e);e!==t&&(f.type=t),"quantitative"!==e&&(0,i.isCountingAggregateOp)(s)&&(d.warn(d.message.invalidFieldTypeForCountAggregate(e,s)),f.type="quantitative")}else if(!(0,o.isSecondaryRangeChannel)(t)){const e=oe(f,t);f.type=e}if(B(f)){const{compatible:e,warning:n}=he(f,t)||{};!1===e&&d.warn(n)}if(S(f)&&(0,r.isString)(f.sort)){const{sort:e}=f;if((0,h.isSortByChannel)(e))return{...f,sort:{encoding:e}};const t=e.substring(1);if("-"===e.charAt(0)&&(0,h.isSortByChannel)(t))return{...f,sort:{encoding:t,order:"descending"}}}if((0,g.isFacetFieldDef)(f)){const{header:e}=f;if(e){const{orient:t,...n}=e;if(t)return{...f,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}}return f}function fe(e,t){return(0,r.isBoolean)(e)?{maxbins:(0,a.autoMaxBins)(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:(0,a.autoMaxBins)(t)}}const pe={compatible:!0};function he(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case o.ROW:case o.COLUMN:case o.FACET:return W(e)?pe:{compatible:!1,warning:d.message.channelShouldBeDiscrete(t)};case o.X:case o.Y:case o.XOFFSET:case o.YOFFSET:case o.COLOR:case o.FILL:case o.STROKE:case o.TEXT:case o.DETAIL:case o.KEY:case o.TOOLTIP:case o.HREF:case o.URL:case o.ANGLE:case o.THETA:case o.RADIUS:case o.DESCRIPTION:return pe;case o.LONGITUDE:case o.LONGITUDE2:case o.LATITUDE:case o.LATITUDE2:return n!==y.QUANTITATIVE?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:pe;case o.OPACITY:case o.FILLOPACITY:case o.STROKEOPACITY:case o.STROKEWIDTH:case o.SIZE:case o.THETA2:case o.RADIUS2:case o.X2:case o.Y2:return"nominal"!==n||e.sort?pe:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case o.SHAPE:case o.STROKEDASH:return W(e)||Y(e)?pe:{compatible:!1,warning:d.message.channelShouldBeDiscreteOrDiscretizing(t)};case o.ORDER:return"nominal"!==e.type||"sort"in e?pe:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}function ge(e){const{formatType:t}=ae(e);return"time"===t||!t&&me(e)}function me(e){return e&&("temporal"===e.type||N(e)&&!!e.timeUnit)}function ye(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:a}){const o=t&&(0,m.normalizeTimeUnit)(t)?.unit;let s,l=o||"temporal"===n;return(0,c.isExprRef)(e)?s=e.expr:(0,b.isSignalRef)(e)?s=e.signal:(0,u.isDateTime)(e)?(l=!0,s=(0,u.dateTimeToExpr)(e)):((0,r.isString)(e)||(0,r.isNumber)(e))&&l&&(s=`datetime(${(0,v.stringify)(e)})`,(0,m.isLocalSingleTimeUnit)(o)&&((0,r.isNumber)(e)&&e<1e4||(0,r.isString)(e)&&isNaN(Date.parse(e)))&&(s=(0,u.dateTimeToExpr)({[o]:e}))),s?i&&l?`time(${s})`:s:a?void 0:(0,v.stringify)(e)}function ve(e,t){const{type:n}=e;return t.map((t=>{const r=ye(t,{timeUnit:N(e)&&!(0,m.isBinnedTimeUnit)(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function be(e,t){return(0,a.isBinning)(e.bin)?(0,o.isScaleChannel)(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}},5593:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleAxes:()=>g,assembleAxis:()=>p,assembleAxisSignals:()=>h});var r=n(26372),i=n(65032),a=n(95290),o=n(79543),s=n(76447),l=n(79989),u=n(5711),c=n(15058),d=n(95370);function f(e,t,n,r){var i,a;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(a=e.encode[t]).update??(a.update={}),e.encode[t].update[n]=r}function p(e,t,n,a={header:!1}){const{disable:p,orient:h,scale:g,labelExpr:m,title:y,zindex:v,...b}=e.combine();if(!p){for(const e in b){const n=e,a=i.AXIS_PROPERTY_TYPE[n],o=b[n];if(a&&a!==t&&"both"!==a)delete b[n];else if((0,i.isConditionalAxisValue)(o)){const{condition:e,...t}=o,a=(0,r.array)(e),s=i.CONDITIONAL_AXIS_PROP_INDEX[n];if(s){const{vgProp:e,part:r}=s;f(b,r,e,[...a.map((e=>{const{test:t,...n}=e;return{test:(0,d.expression)(null,t),...n}})),t]),delete b[n]}else if(null===s){const e={signal:a.map((e=>{const{test:t,...n}=e;return`${(0,d.expression)(null,t)} ? ${(0,c.exprFromValueRefOrSignalRef)(n)} : `})).join("")+(0,c.exprFromValueRefOrSignalRef)(t)};b[n]=e}}else if((0,u.isSignalRef)(o)){const e=i.CONDITIONAL_AXIS_PROP_INDEX[n];if(e){const{vgProp:t,part:r}=e;f(b,r,t,o),delete b[n]}}(0,l.contains)(["labelAlign","labelBaseline"],n)&&null===b[n]&&delete b[n]}if("grid"===t){if(!b.grid)return;if(b.encode){const{grid:e}=b.encode;b.encode={...e?{grid:e}:{}},(0,l.isEmpty)(b.encode)&&delete b.encode}return{scale:g,orient:h,...b,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:(0,l.getFirstDefined)(v,0)}}{if(!a.header&&e.mainExtracted)return;if(void 0!==m){let e=m;b.encode?.labels?.update&&(0,u.isSignalRef)(b.encode.labels.update.text)&&(e=(0,l.replaceAll)(m,"datum.label",b.encode.labels.update.text.signal)),f(b,"labels","text",{signal:e})}if(null===b.labelAlign&&delete b.labelAlign,b.encode){for(const t of i.AXIS_PARTS)e.hasAxisPart(t)||delete b.encode[t];(0,l.isEmpty)(b.encode)&&delete b.encode}const t=function(e,t){if(e)return(0,r.isArray)(e)&&!(0,s.isText)(e)?e.map((e=>(0,o.defaultTitle)(e,t))).join(", "):e}(y,n);return{scale:g,orient:h,grid:!1,...t?{title:t}:{},...b,...!1===n.aria?{aria:!1}:{},zindex:(0,l.getFirstDefined)(v,0)}}}}function h(e){const{axes:t}=e.component,n=[];for(const r of a.POSITION_SCALE_CHANNELS)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function g(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>p(e,"grid",t))),...r.map((e=>p(e,"grid",t))),...n.map((e=>p(e,"main",t))),...r.map((e=>p(e,"main",t)))].filter((e=>e))}},33434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AXIS_COMPONENT_PROPERTIES:()=>l,AxisComponent:()=>u});var r=n(65032),i=n(79989),a=n(5711),o=n(96159);const s={disable:1,gridScale:1,scale:1,...r.COMMON_AXIS_PROPERTIES_INDEX,labelExpr:1,encode:1},l=(0,i.keys)(s);class u extends o.Split{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new u((0,i.duplicate)(this.explicit),(0,i.duplicate)(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return(0,a.isSignalRef)(this.explicit.orient)}}},22115:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getAxisConfig:()=>d,getAxisConfigStyle:()=>c,getAxisConfigs:()=>u});var r=n(26372),i=n(31179),a=n(79989),o=n(5711),s=n(15058);function l(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},l=new Set([...(0,a.keys)(i),...(0,a.keys)(o)]),u={};for(const t of l.values())u[t]={signal:`${r.signal} === "${e}" ? ${(0,s.signalOrStringValue)(i[t])} : ${(0,s.signalOrStringValue)(o[t])}`};return u}return t[e]}))])}function u(e,t,n,r){const s="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:(0,i.isQuantitative)(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],u="x"===e?"axisX":"axisY",d=(0,o.isSignalRef)(n)?"axisOrient":`axis${(0,a.titleCase)(n)}`,f=[...s,...s.map((e=>u+e.substr(4)))],p=["axis",d,u];return{vlOnlyAxisConfig:l(f,r,e,n),vgAxisConfig:l(p,r,e,n),axisConfigStyle:c([...p,...f],r)}}function c(e,t){const n=[{}];for(const i of e){let e=t[i]?.style;if(e){e=(0,r.array)(e);for(const r of e)n.push(t.style[r])}}return Object.assign.apply(null,n)}function d(e,t,n,r={}){const i=(0,s.getStyleConfig)(e,n,t);if(void 0!==i)return{configFrom:"style",configValue:i};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==r[t]?.[e])return{configFrom:t,configValue:r[t][e]};return{}}},57807:(e,t,n)=>{"use strict";n.r(t),n.d(t,{labels:()=>o});var r=n(95290),i=n(79543),a=n(6032);function o(e,t,n){const{encoding:o,config:s}=e,l=(0,i.getFieldOrDatumDef)(o[t])??(0,i.getFieldOrDatumDef)(o[(0,r.getSecondaryRangeChannel)(t)]),u=e.axis(t)||{},{format:c,formatType:d}=u;if((0,a.isCustomFormatType)(d))return{text:(0,a.formatCustomType)({fieldOrDatumDef:l,field:"datum.value",format:c,formatType:d,config:s}),...n};if(void 0===c&&void 0===d&&s.customFormatTypes){if("quantitative"===(0,i.channelDefType)(l)){if((0,i.isPositionFieldOrDatumDef)(l)&&"normalize"===l.stack&&s.normalizedNumberFormatType)return{text:(0,a.formatCustomType)({fieldOrDatumDef:l,field:"datum.value",format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,config:s}),...n};if(s.numberFormatType)return{text:(0,a.formatCustomType)({fieldOrDatumDef:l,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}),...n}}if("temporal"===(0,i.channelDefType)(l)&&s.timeFormatType&&(0,i.isFieldDef)(l)&&!l.timeUnit)return{text:(0,a.formatCustomType)({fieldOrDatumDef:l,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s}),...n}}return n}},32134:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseLayerAxes:()=>b,parseUnitAxes:()=>y});var r=n(65032),i=n(95290),a=n(79543),o=n(79989),s=n(5711),l=n(15058),u=n(16039),c=n(91387),d=n(96159),f=n(33434),p=n(22115),h=n(57807),g=n(43852),m=n(6032);function y(e){return i.POSITION_SCALE_CHANNELS.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[_(n,e)]),t)),{})}const v={bottom:"top",top:"bottom",left:"right",right:"left"};function b(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const i of(0,o.keys)(r.component.axes))n.axis[i]=(0,c.parseGuideResolve)(e.component.resolve,i),"shared"===n.axis[i]&&(t[i]=w(t[i],r.component.axes[i]),t[i]||(n.axis[i]="independent",delete t[i]))}for(const a of i.POSITION_SCALE_CHANNELS){for(const i of e.children)if(i.component.axes[a]){if("independent"===n.axis[a]){t[a]=(t[a]??[]).concat(i.component.axes[a]);for(const e of i.component.axes[a]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!(0,s.isSignalRef)(t)){if(r[t]>0&&!n){const n=v[t];r[t]>r[n]&&e.set("orient",n,!1)}r[t]++}}}delete i.component.axes[a]}if("independent"===n.axis[a]&&t[a]&&t[a].length>1)for(const[e,n]of(t[a]||[]).entries())e>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}function w(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return(0,l.mergeTitleComponent)(e,t);case"gridScale":return{explicit:e.explicit,value:(0,o.getFirstDefined)(e.value,t.value)}}return(0,d.defaultTieBreaker)(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function E(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===((0,s.isSignalRef)(n.labelAngle)?n.labelAngle:(0,o.normalizeAngle)(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===(0,g.getFieldDefTitle)(r,i))return!0}return e===n[t]}const S=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function _(e,t){let n=t.axis(e);const i=new f.AxisComponent,l=(0,a.getFieldOrDatumDef)(t.encoding[e]),{mark:c,config:d}=t,y=n?.orient||d["x"===e?"axisX":"axisY"]?.orient||d.axis?.orient||(0,g.defaultOrient)(e),v=t.getScaleComponent(e).get("type"),b=(0,p.getAxisConfigs)(e,v,y,t.config),w=void 0!==n?!n:(0,p.getAxisConfig)("disable",d.style,n?.style,b).configValue;if(i.set("disable",w,void 0!==n),w)return i;n=n||{};const x=(0,g.getLabelAngle)(l,n,e,d.style,b),_=(0,m.guideFormatType)(n.formatType,l,v),A=(0,m.guideFormat)(l,l.type,n.format,n.formatType,d,!0),C={fieldOrDatumDef:l,axis:n,channel:e,model:t,scaleType:v,orient:y,labelAngle:x,format:A,formatType:_,mark:c,config:d};for(const a of f.AXIS_COMPONENT_PROPERTIES){const o=a in g.axisRules?g.axisRules[a](C):(0,r.isAxisProperty)(a)?n[a]:void 0,l=void 0!==o,u=E(o,a,n,t,e);if(l&&u)i.set(a,o,u);else{const{configValue:e,configFrom:t}=(0,r.isAxisProperty)(a)&&"values"!==a?(0,p.getAxisConfig)(a,d.style,n.style,b):{},c=void 0!==e;l&&!c?i.set(a,o,u):("vgAxisConfig"!==t||S.has(a)&&c||(0,r.isConditionalAxisValue)(e)||(0,s.isSignalRef)(e))&&i.set(a,e,!1)}}const T=n.encoding??{},k=r.AXIS_PARTS.reduce(((n,r)=>{if(!i.hasAxisPart(r))return n;const a=(0,u.guideEncodeEntry)(T[r]??{},t),s="labels"===r?h.labels(t,e,a):a;return void 0===s||(0,o.isEmpty)(s)||(n[r]={update:s}),n}),{});return(0,o.isEmpty)(k)||i.set("encode",k,!!n.encoding||void 0!==n.labelAngle),i}},43852:(e,t,n)=>{"use strict";n.r(t),n.d(t,{axisRules:()=>h,defaultGrid:()=>g,defaultLabelAlign:()=>w,defaultLabelBaseline:()=>b,defaultLabelFlush:()=>x,defaultLabelOverlap:()=>E,defaultOrient:()=>S,defaultTickCount:()=>_,defaultTickMinStep:()=>A,defaultZindex:()=>k,getFieldDefTitle:()=>C,getLabelAngle:()=>y,gridScale:()=>m,normalizeAngleExpr:()=>v,values:()=>T});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(31179),l=n(96598),u=n(99273),c=n(79989),d=n(5711),f=n(15058),p=n(22115);const h={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??g(n,e),gridScale:({model:e,channel:t})=>m(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||w(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||b(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??x(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??E(t.type,n,(0,o.isFieldDef)(t)&&!!t.timeUnit,(0,o.isFieldDef)(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const a="x"===e?"width":"y"===e?"height":void 0,o=a?t.getSizeSignalRef(a):void 0;return n.tickCount??_({fieldOrDatumDef:r,scaleType:i,size:o,values:n.values})},tickMinStep:A,title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=C(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),a="x"===n?"x2":"y2",s=t.fieldDef(a);return(0,f.mergeTitleFieldDefs)(i?[(0,o.toFieldDefBase)(i)]:[],(0,o.isFieldDef)(s)?[(0,o.toFieldDefBase)(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>T(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??k(n,t)};function g(e,t){return!(0,s.hasDiscreteDomain)(e)&&(0,o.isFieldDef)(t)&&!(0,i.isBinning)(t?.bin)&&!(0,i.isBinned)(t?.bin)}function m(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function y(e,t,n,r,i){const s=t?.labelAngle;if(void 0!==s)return(0,d.isSignalRef)(s)?s:(0,c.normalizeAngle)(s);{const{configValue:s}=(0,p.getAxisConfig)("labelAngle",r,t?.style,i);return void 0!==s?(0,c.normalizeAngle)(s):n!==a.X||!(0,c.contains)([u.NOMINAL,u.ORDINAL],e.type)||(0,o.isFieldDef)(e)&&e.timeUnit?void 0:270}}function v(e){return`(((${e.signal} % 360) + 360) % 360)`}function b(e,t,n,r){if(void 0!==e){if("x"===n){if((0,d.isSignalRef)(e)){const n=v(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${(0,d.isSignalRef)(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{"use strict";n.r(t),n.d(t,{buildModel:()=>u});var r=n(20916),i=n(24777),a=n(73799),o=n(33828),s=n(51878),l=n(92649);function u(e,t,n,u,c){if((0,i.isFacetSpec)(e))return new o.FacetModel(e,t,n,c);if((0,i.isLayerSpec)(e))return new s.LayerModel(e,t,n,u,c);if((0,i.isUnitSpec)(e))return new l.UnitModel(e,t,n,u,c);if((0,i.isAnyConcatSpec)(e))return new a.ConcatModel(e,t,n,c);throw new Error(r.message.invalidSpec(e))}},15058:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BIN_RANGE_DELIMITER:()=>u,applyMarkConfig:()=>y,conditionalSignalRefOrValue:()=>f,exprFromSignalRefOrValue:()=>h,exprFromValueRefOrSignalRef:()=>g,getMarkConfig:()=>w,getMarkPropOrConfig:()=>b,getMarkStyleConfig:()=>x,getStyleConfig:()=>E,getStyles:()=>v,mergeTitle:()=>A,mergeTitleComponent:()=>C,mergeTitleFieldDefs:()=>_,signalOrStringValue:()=>m,signalOrValueRef:()=>p,signalOrValueRefWithCondition:()=>c,signalRefOrValue:()=>d,sortParams:()=>S});var r=n(26372),i=n(79543),a=n(3802),o=n(76447),s=n(79989),l=n(5711);const u=" – ";function c(e){const t=(0,r.isArray)(e.condition)?e.condition.map(f):f(e.condition);return{...d(e),condition:t}}function d(e){if((0,a.isExprRef)(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function f(e){if((0,a.isExprRef)(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function p(e){if((0,a.isExprRef)(e)){const{expr:t,...n}=e;return{signal:t,...n}}return(0,l.isSignalRef)(e)?e:void 0!==e?{value:e}:void 0}function h(e){return(0,l.isSignalRef)(e)?e.signal:(0,r.stringValue)(e)}function g(e){return(0,l.isSignalRef)(e)?e.signal:(0,r.stringValue)(e.value)}function m(e){return(0,l.isSignalRef)(e)?e.signal:null==e?null:(0,r.stringValue)(e)}function y(e,t,n){for(const r of n){const n=w(r,t.markDef,t.config);void 0!==n&&(e[r]=p(n))}return e}function v(e){return[].concat(e.type,e.style??[])}function b(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:a}=r;return i&&(0,s.hasProperty)(t,i)?t[i]:void 0!==t[e]?t[e]:!a||i&&i!==e?w(e,t,n,r):void 0}function w(e,t,n,{vgChannel:r}={}){const i=x(e,t,n.style);return(0,s.getFirstDefined)(r?i:void 0,i,r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function x(e,t,n){return E(e,v(t),n)}function E(e,t,n){let i;t=(0,r.array)(t);for(const r of t){const t=n[r];(0,s.hasProperty)(t,e)&&(i=t[e])}return i}function S(e,t){return(0,r.array)(e).reduce(((e,n)=>(e.field.push((0,i.vgField)(n,t)),e.order.push(n.sort??"ascending"),e)),{field:[],order:[]})}function _(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if((0,s.deepEqual)(t,e))return;n.push(e)})),n}function A(e,t){return(0,s.deepEqual)(e,t)||!t?e:e?[...(0,r.array)(e),...(0,r.array)(t)].join(", "):t}function C(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if(((0,o.isText)(n)||(0,l.isSignalRef)(n))&&((0,o.isText)(r)||(0,l.isSignalRef)(r)))return{explicit:e.explicit,value:A(n,r)};if((0,o.isText)(n)||(0,l.isSignalRef)(n))return{explicit:e.explicit,value:n};if((0,o.isText)(r)||(0,l.isSignalRef)(r))return{explicit:e.explicit,value:r};if(!((0,o.isText)(n)||(0,l.isSignalRef)(n)||(0,o.isText)(r)||(0,l.isSignalRef)(r)))return{explicit:e.explicit,value:_(n,r)};throw new Error("It should never reach here")}},48166:(e,t,n)=>{"use strict";n.r(t),n.d(t,{compile:()=>g});var r=n(26372),i=n(95290),a=n(79543),o=n(24007),s=n(20916),l=n(59621),u=n(54778),c=n(48110),d=n(79989),f=n(36598),p=n(81458),h=n(80449);function g(e,t={}){t.logger&&s.set(t.logger),t.fieldTitle&&a.setTitleFormatter(t.fieldTitle);try{const n=(0,o.initConfig)((0,r.mergeConfig)(t.config,e.config)),a=(0,l.normalize)(e,n),g=(0,f.buildModel)(a,null,"",void 0,n);g.parse(),(0,h.optimizeDataflow)(g.component.data,g);const m=function(e,t,n={},r){const i=e.config?(0,o.stripAndRedirectConfig)(e.config):void 0,a=[].concat(e.assembleSelectionData([]),(0,p.assembleRootData)(e.component.data,n)),s=e.assembleProjections(),l=e.assembleTitle(),c=e.assembleGroupStyle(),d=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter((e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:h,...g}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...g,...l?{title:l}:{},...c?{style:c}:{},...d?{encode:{update:d}}:{},data:a,...s.length>0?{projections:s}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...(0,u.assembleParameterSignals)(h)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}(g,function(e,t,n,a){const o=a.component.layoutSize.get("width"),l=a.component.layoutSize.get("height");if(void 0===t?(t={type:"pad"},a.hasAxisOrientSignalRef()&&(t.resize=!0)):(0,r.isString)(t)&&(t={type:t}),o&&l&&(0,c.isFitType)(t.type))if("step"===o&&"step"===l)s.warn(s.message.droppingFit()),t.type="pad";else if("step"===o||"step"===l){const e="step"===o?"width":"height";s.warn(s.message.droppingFit((0,i.getPositionScaleChannel)(e)));const n="width"===e?"height":"width";t.type=(0,c.getFitType)(n)}return{...1===(0,d.keys)(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...(0,c.extractTopLevelProperties)(n,!1),...(0,c.extractTopLevelProperties)(e,!0)}}(e,a.autosize,n,g),e.datasets,e.usermeta);return{spec:m,normalized:a}}finally{t.logger&&s.reset(),t.fieldTitle&&a.resetTitleFormatter()}}},73799:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConcatModel:()=>d});var r=n(20916),i=n(24777),a=n(79989),o=n(36598),s=n(80219),l=n(6871),u=n(27588),c=n(7302);class d extends c.Model{constructor(e,t,n,i){super(e,"concat",t,n,i,e.resolve),"shared"!==e.resolve?.axis?.x&&"shared"!==e.resolve?.axis?.y||r.warn(r.message.CONCAT_CANNOT_SHARE_AXIS),this.children=this.getChildren(e).map(((e,t)=>(0,o.buildModel)(e,this,this.getName(`concat_${t}`),void 0,i)))}parseData(){this.component.data=(0,s.parseData)(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of(0,a.keys)(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return(0,i.isVConcatSpec)(e)?e.vconcat:(0,i.isHConcatSpec)(e)?e.hconcat:e.concat}parseLayoutSize(){(0,u.parseConcatLayoutSize)(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=(0,l.assembleLayoutSignals)(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}},69687:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AggregateNode:()=>p});var r=n(54814),i=n(95290),a=n(79543),o=n(20916),s=n(31179),l=n(79989),u=n(7302),c=n(74686),d=n(75028),f=n(62277);class p extends c.DataFlowNode{clone(){return new p(null,new Set(this.dimensions),(0,l.duplicate)(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const o={},c=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:l,field:p}=e;if(l)if("count"===l)o["*"]??(o["*"]={}),o["*"].count=new Set([(0,a.vgField)(e,{forAs:!0})]);else{if((0,r.isArgminDef)(l)||(0,r.isArgmaxDef)(l)){const e=(0,r.isArgminDef)(l)?"argmin":"argmax",t=l[e];o[t]??(o[t]={}),o[t][e]=new Set([(0,a.vgField)({op:e,field:t},{forAs:!0})])}else o[p]??(o[p]={}),o[p][l]=new Set([(0,a.vgField)(e,{forAs:!0})]);(0,i.isScaleChannel)(n)&&"unaggregated"===t.scaleDomain(n)&&(o[p]??(o[p]={}),o[p].min=new Set([(0,a.vgField)({field:p,aggregate:"min"},{forAs:!0})]),o[p].max=new Set([(0,a.vgField)({field:p,aggregate:"max"},{forAs:!0})]))}else!function(e,t,n,r){const o=(0,u.isUnitModel)(r)?r.encoding[(0,i.getSecondaryRangeChannel)(t)]:void 0;if((0,a.isTypedFieldDef)(n)&&(0,u.isUnitModel)(r)&&(0,a.hasBandEnd)(n,o,r.markDef,r.config)){e.add((0,a.vgField)(n,{})),e.add((0,a.vgField)(n,{suffix:"end"}));const{mark:o,markDef:s,config:l}=r,u=(0,a.getBandPosition)({fieldDef:n,markDef:s,config:l});(0,d.isRectBasedMark)(o)&&.5!==u&&(0,i.isXorY)(t)&&(e.add((0,a.vgField)(n,{suffix:f.OFFSETTED_RECT_START_SUFFIX})),e.add((0,a.vgField)(n,{suffix:f.OFFSETTED_RECT_END_SUFFIX}))),n.bin&&(0,a.binRequiresRange)(n,t)&&e.add((0,a.vgField)(n,{binSuffix:"range"}))}else if((0,i.isGeoPositionChannel)(t)){const n=(0,i.getPositionChannelFromLatLong)(t);e.add(r.getName(n))}else e.add((0,a.vgField)(n));(0,a.isScaleFieldDef)(n)&&(0,s.isFieldRange)(n.scale?.range)&&e.add(n.scale.range.field)}(c,n,e,t)})),c.size+(0,l.keys)(o).length===0?null:new p(e,c,o)):null}static makeFromTransform(e,t){var n;const r=new Set,i={};for(const e of t.aggregate){const{op:t,field:r,as:o}=e;t&&("count"===t?(i["*"]??(i["*"]={}),i["*"].count=new Set([o||(0,a.vgField)(e,{forAs:!0})])):(i[r]??(i[r]={}),(n=i[r])[t]??(n[t]=new Set),i[r][t].add(o||(0,a.vgField)(e,{forAs:!0}))))}for(const e of t.groupby??[])r.add(e);return r.size+(0,l.keys)(i).length===0?null:new p(e,r,i)}merge(e){return(0,l.setEqual)(this.dimensions,e.dimensions)?(function(e,t){for(const n of(0,l.keys)(t)){const r=t[n];for(const t of(0,l.keys)(r))n in e?e[n][t]=new Set([...e[n][t]??[],...r[t]]):e[n]={[t]:r[t]}}}(this.measures,e.measures),!0):(o.debug("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...(0,l.keys)(this.measures)])}producedFields(){const e=new Set;for(const t of(0,l.keys)(this.measures))for(const n of(0,l.keys)(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${(0,l.hash)({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of(0,l.keys)(this.measures))for(const i of(0,l.keys)(this.measures[r]))for(const a of this.measures[r][i])n.push(a),e.push(i),t.push("*"===r?null:(0,l.replacePathInField)(r));return{type:"aggregate",groupby:[...this.dimensions].map(l.replacePathInField),ops:e,fields:t,as:n}}}},81458:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleFacetData:()=>P,assembleRootData:()=>M});var r=n(89081),i=n(69687),a=n(89153),o=n(77524),s=n(74686),l=n(97872),u=n(96578),c=n(69151),d=n(68860),f=n(78825),p=n(75138),h=n(4821),g=n(30366),m=n(13995),y=n(58211),v=n(65340),b=n(3297),w=n(47628),x=n(56123),E=n(63186),S=n(55320),_=n(40763),A=n(6799),C=n(38380),T=n(56948),k=n(79351),R=n(455),D=n(89764),O=n(62277),N=n(51422);function F(e){let t=0;return function n(F,P){if(F instanceof R.SourceNode&&!F.isGenerator&&!(0,r.isUrlData)(F.data)&&(e.push(P),P={name:null,source:P.name,transform:[]}),F instanceof g.ParseNode&&(F.parent instanceof R.SourceNode&&!P.source?(P.format={...P.format,parse:F.assembleFormatParse()},P.transform.push(...F.assembleTransforms(!0))):P.transform.push(...F.assembleTransforms())),F instanceof c.FacetNode)return P.name||(P.name="data_"+t++),!P.source||P.transform.length>0?(e.push(P),F.data=P.name):F.data=P.source,void e.push(...F.assemble());switch((F instanceof v.GraticuleNode||F instanceof k.SequenceNode||F instanceof f.FilterInvalidNode||F instanceof d.FilterNode||F instanceof o.CalculateNode||F instanceof y.GeoPointNode||F instanceof i.AggregateNode||F instanceof S.LookupNode||F instanceof N.WindowTransformNode||F instanceof x.JoinAggregateTransformNode||F instanceof h.FoldTransformNode||F instanceof p.FlattenTransformNode||F instanceof l.DensityTransformNode||F instanceof E.LoessTransformNode||F instanceof _.QuantileTransformNode||F instanceof A.RegressionTransformNode||F instanceof b.IdentifierNode||F instanceof T.SampleTransformNode||F instanceof C.PivotTransformNode||F instanceof u.ExtentTransformNode)&&P.transform.push(F.assemble()),(F instanceof a.BinNode||F instanceof O.TimeUnitNode||F instanceof w.ImputeNode||F instanceof D.StackNode||F instanceof m.GeoJSONNode)&&P.transform.push(...F.assemble()),F instanceof s.OutputNode&&(P.source&&0===P.transform.length?F.setSource(P.source):F.parent instanceof s.OutputNode?F.setSource(P.name):(P.name||(P.name="data_"+t++),F.setSource(P.name),1===F.numChildren()&&(e.push(P),P={name:null,source:P.name,transform:[]}))),F.numChildren()){case 0:F instanceof s.OutputNode&&(!P.source||P.transform.length>0)&&e.push(P);break;case 1:n(F.children[0],P);break;default:{P.name||(P.name="data_"+t++);let r=P.name;!P.source||P.transform.length>0?e.push(P):r=P.source;for(const e of F.children)n(e,{name:null,source:r,transform:[]});break}}}}function P(e){const t=[],n=F(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}function M(e,t){const n=[],r=F(n);let i=0;for(const t of e.sources){t.hasName()||(t.dataName="source_"+i++);const e=t.assemble();r(t,e)}for(const e of n)0===e.transform.length&&delete e.transform;let a=0;for(const[e,t]of n.entries())0!==(t.transform??[]).length||t.source||n.splice(a++,0,n.splice(e,1)[0]);for(const t of n)for(const n of t.transform??[])"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource());for(const e of n)e.name in t&&(e.values=t[e.name]);return n}},89153:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BinNode:()=>g,getBinSignalName:()=>p});var r=n(26372),i=n(19664),a=n(79543),o=n(79989),s=n(6032),l=n(7302),u=n(83937),c=n(74686);function d(e,t,n,r){if((0,a.binRequiresRange)(t,n)){const i=(0,l.isUnitModel)(e)?e.axis(n)??e.legend(n)??{}:{},o=(0,a.vgField)(t,{expr:"datum"}),u=(0,a.vgField)(t,{expr:"datum",binSuffix:"end"});return{formulaAs:(0,a.vgField)(t,{binSuffix:"range",forAs:!0}),formula:(0,s.binFormatExpression)(o,u,i.format,i.formatType,r)}}return{}}function f(e,t){return`${(0,i.binToString)(e)}_${t}`}function p(e,t,n){const r=f((0,a.normalizeBin)(n,void 0)??{},t);return e.getName(`${r}_bins`)}function h(e,t,n){let o,s;o=function(e){return"as"in e}(e)?(0,r.isString)(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[(0,a.vgField)(e,{forAs:!0}),(0,a.vgField)(e,{binSuffix:"end",forAs:!0})];const l={...(0,a.normalizeBin)(t,void 0)},c=f(l,e.field),{signal:d,extentSignal:p}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,c);if((0,i.isParameterExtent)(l.extent)){const e=l.extent;s=(0,u.parseSelectionExtent)(n,e.param,e),delete l.extent}return{key:c,binComponent:{bin:l,field:e.field,as:[o],...d?{signal:d}:{},...p?{extentSignal:p}:{},...s?{span:s}:{}}}}class g extends c.DataFlowNode{clone(){return new g(null,(0,o.duplicate)(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if((0,a.isTypedFieldDef)(n)&&(0,i.isBinning)(n.bin)){const{key:i,binComponent:a}=h(n,n.bin,t);e[i]={...a,...e[i],...d(t,n,r,t.config)}}return e}),{});return(0,o.isEmpty)(n)?null:new g(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=h(t,t.bin,n);return new g(e,{[r]:i})}merge(e,t){for(const n of(0,o.keys)(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=(0,o.unique)([...this.bins[n].as,...e.bins[n].as],o.hash)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set((0,o.vals)(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set((0,o.vals)(this.bins).map((e=>e.field)))}hash(){return`Bin ${(0,o.hash)(this.bins)}`}assemble(){return(0,o.vals)(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,{extent:s,...l}=e.bin,u={type:"bin",field:(0,o.replacePathInField)(e.field),as:n,signal:e.signal,...(0,i.isParameterExtent)(s)?{extent:null}:{extent:s},...e.span?{span:{signal:`span(${e.span})`}}:{},...l};!s&&e.extentSignal&&(t.push({type:"extent",field:(0,o.replacePathInField)(e.field),signal:e.extentSignal}),u.extent={signal:e.extentSignal}),t.push(u);for(const e of r)for(let r=0;r<2;r++)t.push({type:"formula",expr:(0,a.vgField)({field:n[r]},{expr:"datum"}),as:e[r]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}},77524:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CalculateNode:()=>u,sortArrayIndexField:()=>c});var r=n(79543),i=n(4976),a=n(46681),o=n(79989),s=n(74686),l=n(62135);class u extends s.DataFlowNode{clone(){return new u(null,(0,o.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=(0,l.getDependentFields)(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef(((t,n)=>{if((0,r.isScaleFieldDef)(t)&&(0,a.isSortArray)(t.sort)){const{field:r,timeUnit:a}=t,o=t.sort,s=o.map(((e,t)=>`${(0,i.fieldFilterExpression)({field:r,timeUnit:a,equal:e})} ? ${t} : `)).join("")+o.length;e=new u(e,{calculate:s,as:c(t,n,{forAs:!0})})}})),e}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 ${(0,o.hash)(this.transform)}`}}function c(e,t,n){return(0,r.vgField)(e,{prefix:t,suffix:"sort_index",...n})}},74686:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DataFlowNode:()=>a,OutputNode:()=>o});var r=n(20916),i=n(79989);class a{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.includes(e)?r.warn(r.message.ADD_SAME_CHILD_TWICE):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this);const n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}}class o extends a{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${(0,i.uniqueId)()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}},97872:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DensityTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"];const 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 ${(0,r.hash)(this.transform)}`}assemble(){const{density:e,...t}=this.transform,n={type:"kde",field:e,...t};return n.resolve=this.transform.resolve,n}}},62135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDependentFields:()=>o});var r=n(21720);function i(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...i(e.object)),t.push(...i(e.property))),t)}function a(e){return"MemberExpression"===e.object.type?a(e.object):"datum"===e.object.name}function o(e){const t=(0,r.parseExpression)(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&a(e)&&n.add(i(e).slice(1).join("."))})),n}},96578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ExtentTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${(0,r.hash)(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}},69151:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FacetNode:()=>m});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(20916),l=n(31179),u=n(46681),c=n(79989),d=n(5711),f=n(10078),p=n(63760),h=n(77524),g=n(74686);class m extends g.DataFlowNode{constructor(e,t,n,s){super(e),this.model=t,this.name=n,this.data=s;for(const e of a.FACET_CHANNELS){const n=t.facet[e];if(n){const{bin:a,sort:s}=n;this[e]={name:t.getName(`${e}_domain`),fields:[(0,o.vgField)(n),...(0,i.isBinning)(a)?[(0,o.vgField)(n,{binSuffix:"end"})]:[]],...(0,u.isSortField)(s)?{sortField:s}:(0,r.isArray)(s)?{sortIndexField:(0,h.sortArrayIndexField)(n,e)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of a.FACET_CHANNELS)this[t]&&(e+=` ${t.charAt(0)}:${(0,c.hash)(this[t])}`);return e}get fields(){const e=[];for(const t of a.FACET_CHANNELS)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){const e=new Set(this.fields);for(const t of a.FACET_CHANNELS)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of a.POSITION_SCALE_CHANNELS){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if((0,l.hasDiscreteDomain)(r)&&(0,d.isVgRangeStep)(i)){const n=(0,p.assembleDomain)(this.childModel,t),r=(0,p.getFieldFromDomain)(n);r?e[t]=r:s.warn(s.message.unknownField(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x",facet:void 0}[e],i=[],a=[],s=[];r&&n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),a.push("max")):(i.push(n[r]),a.push("distinct")),s.push(`distinct_${n[r]}`));const{sortField:l,sortIndexField:c}=this[e];if(l){const{op:e=u.DEFAULT_SORT_OP,field:t}=l;i.push(t),a.push(e),s.push((0,o.vgField)(l,{forAs:!0}))}else c&&(i.push(c),a.push("max"),s.push(c));return{name:this[e].name,source:t??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...i.length?{fields:i,ops:a,as:s}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(const e of f.HEADER_CHANNELS){for(const t of f.HEADER_TYPES){const r=(n[e]&&n[e][t])??[];for(const t of r)if(t.axes?.length>0){i[e]=!0;break}}if(i[e]){const n=`length(data("${this.facet.name}"))`,i="row"===e?t?{signal:`ceil(${n} / ${t})`}:1:t?{signal:`min(${n}, ${t})`}:{signal:n};r.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:i}]})}}const{row:a,column:o}=i;return(a||o)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,e)),r}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;const r=[].concat(n.x??[],n.y??[]),i=r.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:r,ops:i}]})}for(const r of[a.COLUMN,a.ROW])this[r]&&e.push(this.assembleRowColumnHeaderData(r,t,n));if(o){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}},68860:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FilterNode:()=>s});var r=n(79989),i=n(95370),a=n(74686),o=n(62135);class s extends a.DataFlowNode{clone(){return new s(null,this.model,(0,r.duplicate)(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=(0,i.expression)(this.model,this.filter,this),this._dependentFields=(0,o.getDependentFields)(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}},78825:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FilterInvalidNode:()=>u,isValidFiniteNumberExpr:()=>c});var r=n(95290),i=n(79543),a=n(79989),o=n(59845),s=n(74686),l=n(54814);class u extends s.DataFlowNode{clone(){return new u(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t,n){const{config:i,markDef:s}=t,{marks:c,scales:d}=n;if("include-invalid-values"===c&&"include-invalid-values"===d)return null;const f=t.reduceFieldDef(((e,n,a)=>{const u=(0,r.isScaleChannel)(a)&&t.getScaleComponent(a);if(u){const t=u.get("type"),{aggregate:r}=n,c=(0,o.getScaleInvalidDataMode)({scaleChannel:a,markDef:s,config:i,scaleType:t,isCountAggregate:(0,l.isCountingAggregateOp)(r)});"show"!==c&&"always-valid"!==c&&(e[n.field]=n)}return e}),{});return(0,a.keys)(f).length?new u(e,f):null}dependentFields(){return new Set((0,a.keys)(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${(0,a.hash)(this.filter)}`}assemble(){const e=(0,a.keys)(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=(0,i.vgField)(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (${c(r)}))`):"quantitative"===n.type&&e.push(c(r))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function c(e){return`isValid(${e}) && isFinite(+${e})`}},75138:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FlattenTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(this.parent,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((e,t)=>i[t]??e))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${(0,r.hash)(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}},4821:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FoldTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"key",n[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${(0,r.hash)(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}},30366:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ParseNode:()=>S,getImplicitFromEncoding:()=>x,getImplicitFromFilterTransform:()=>w,getImplicitFromSelection:()=>E});var r=n(26372),i=n(54814),a=n(95290),o=n(79543),s=n(89081),l=n(20032),u=n(20916),c=n(90386),d=n(75028),f=n(4976),p=n(46681),h=n(79989),g=n(15058),m=n(7302),y=n(96159),v=n(74686);function b(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function w(e){const t={};return(0,c.forEachLeaf)(e.filter,(e=>{if((0,f.isFieldPredicate)(e)){let n=null;(0,f.isFieldEqualPredicate)(e)?n=(0,g.signalRefOrValue)(e.equal):(0,f.isFieldLTEPredicate)(e)?n=(0,g.signalRefOrValue)(e.lte):(0,f.isFieldLTPredicate)(e)?n=(0,g.signalRefOrValue)(e.lt):(0,f.isFieldGTPredicate)(e)?n=(0,g.signalRefOrValue)(e.gt):(0,f.isFieldGTEPredicate)(e)?n=(0,g.signalRefOrValue)(e.gte):(0,f.isFieldRangePredicate)(e)?n=e.range[0]:(0,f.isFieldOneOfPredicate)(e)&&(n=(e.oneOf??e.in)[0]),n&&((0,l.isDateTime)(n)?t[e.field]="date":(0,r.isNumber)(n)?t[e.field]="number":(0,r.isString)(n)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function x(e){const t={};function n(e){(0,o.isFieldOrDatumDefForTimeFormat)(e)?t[e.field]="date":"quantitative"===e.type&&(0,i.isMinMaxOp)(e.aggregate)?t[e.field]="number":(0,h.accessPathDepth)(e.field)>1?e.field in t||(t[e.field]="flatten"):(0,o.isScaleFieldDef)(e)&&(0,p.isSortField)(e.sort)&&(0,h.accessPathDepth)(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if(((0,m.isUnitModel)(e)||(0,m.isFacetModel)(e))&&e.forEachFieldDef(((t,r)=>{if((0,o.isTypedFieldDef)(t))n(t);else{const i=(0,a.getMainRangeChannel)(r),o=e.fieldDef(i);n({...t,type:o.type})}})),(0,m.isUnitModel)(e)){const{mark:n,markDef:r,encoding:i}=e;if((0,d.isPathMark)(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];(0,o.isFieldDef)(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}function E(e){const t={};if((0,m.isUnitModel)(e)&&e.component.selection)for(const n of(0,h.keys)(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&(0,h.accessPathDepth)(e.field)>1&&(t[e.field]="flatten")}return t}class S extends v.DataFlowNode{clone(){return new S(null,(0,h.duplicate)(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${(0,h.hash)(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!(0,s.isGenerator)(i)&&i?.format?.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of(0,h.keys)(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:u.warn(u.message.differentParse(e,n[e],t.value)))}for(const e of(0,h.keys)(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:u.warn(u.message.differentParse(e,t[e],n)))}const i=new y.Split(t,n);r.copyAll(i);const a={};for(const e of(0,h.keys)(i.combine())){const t=i.get(e);null!==t&&(a[e]=t)}return 0===(0,h.keys)(a).length||r.parseNothing?null:new S(e,a)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of(0,h.keys)(this._parse)){const n=this._parse[t];1===(0,h.accessPathDepth)(t)&&(e[t]=n)}return e}producedFields(){return new Set((0,h.keys)(this._parse))}dependentFields(){return new Set((0,h.keys)(this._parse))}assembleTransforms(e=!1){return(0,h.keys)(this._parse).filter((t=>!e||(0,h.accessPathDepth)(t)>1)).map((e=>{const t=function(e,t){const n=(0,h.accessPathWithDatum)(e);return"number"===t?`toNumber(${n})`:"boolean"===t?`toBoolean(${n})`:"string"===t?`toString(${n})`:"date"===t?`toDate(${n})`:"flatten"===t?n:t.startsWith("date:")?`timeParse(${n},'${b(t.slice(5,t.length))}')`:t.startsWith("utc:")?`utcParse(${n},'${b(t.slice(4,t.length))}')`:(u.warn(u.message.unrecognizedParse(t)),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:(0,h.removePathFromField)(e)}:null})).filter((e=>null!==e))}}},13995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GeoJSONNode:()=>u});var r=n(26372),i=n(95290),a=n(79543),o=n(99273),s=n(79989),l=n(74686);class u extends l.DataFlowNode{clone(){return new u(null,(0,s.duplicate)(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[i.LONGITUDE,i.LATITUDE],[i.LONGITUDE2,i.LATITUDE2]]){const i=r.map((e=>{const n=(0,a.getFieldOrDatumDef)(t.encoding[e]);return(0,a.isFieldDef)(n)?n.field:(0,a.isDatumDef)(n)?{expr:`${n.datum}`}:(0,a.isValueDef)(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new u(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(i.SHAPE)){const r=t.typedFieldDef(i.SHAPE);r.type===o.GEOJSON&&(e=new u(e,null,r.field,t.getName("geojson_"+n++)))}return e}constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}dependentFields(){const e=(this.fields??[]).filter(r.isString);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${(0,s.hash)(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}]}}},58211:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GeoPointNode:()=>l});var r=n(26372),i=n(95290),a=n(79543),o=n(79989),s=n(74686);class l extends s.DataFlowNode{clone(){return new l(null,this.projection,(0,o.duplicate)(this.fields),(0,o.duplicate)(this.as))}constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[i.LONGITUDE,i.LATITUDE],[i.LONGITUDE2,i.LATITUDE2]]){const r=n.map((e=>{const n=(0,a.getFieldOrDatumDef)(t.encoding[e]);return(0,a.isFieldDef)(n)?n.field:(0,a.isDatumDef)(n)?{expr:`${n.datum}`}:(0,a.isValueDef)(n)?{expr:`${n.value}`}:void 0})),o=n[0]===i.LONGITUDE2?"2":"";(r[0]||r[1])&&(e=new l(e,t.projectionName(),r,[t.getName(`x${o}`),t.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(r.isString))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${(0,o.hash)(this.fields)} ${(0,o.hash)(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}},65340:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraticuleNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${(0,r.hash)(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}},3297:(e,t,n)=>{"use strict";n.r(t),n.d(t,{IdentifierNode:()=>a});var r=n(84847),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([r.SELECTION_ID])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:r.SELECTION_ID}}}},47628:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ImputeNode:()=>l});var r=n(79543),i=n(98348),a=n(65393),o=n(79989),s=n(74686);class l extends s.DataFlowNode{clone(){return new l(null,(0,o.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new l(e,t)}static makeFromEncoding(e,t){const n=t.encoding,a=n.x,o=n.y;if((0,r.isFieldDef)(a)&&(0,r.isFieldDef)(o)){const r=a.impute?a:o.impute?o:void 0;if(void 0===r)return;const s=a.impute?o:o.impute?a:void 0,{method:u,value:c,frame:d,keyvals:f}=r.impute,p=(0,i.pathGroupingFields)(t.mark,n);return new l(e,{impute:r.field,key:s.field,...u?{method:u}:{},...void 0!==c?{value:c}:{},...d?{frame:d}:{},...void 0!==f?{keyvals:f}:{},...p.length?{groupby:p}:{}})}return null}hash(){return`Impute ${(0,o.hash)(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:s=[null,null]}=this.transform,l={type:"impute",field:e,key:t,...n?{keyvals:(0,a.isImputeSequence)(n)?this.processSequence(n):n}:{},method:"value",...i?{groupby:i}:{},value:r&&"value"!==r?null:o};return r&&"value"!==r?[l,{type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:s,ignorePeers:!1,...i?{groupby:i}:{}},{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]:[l]}}},95848:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AncestorParse:()=>i});var r=n(96159);class i extends r.Split{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}},56123:(e,t,n)=>{"use strict";n.r(t),n.d(t,{JoinAggregateTransformNode:()=>o});var r=n(79543),i=n(79989),a=n(74686);class o extends a.DataFlowNode{clone(){return new o(null,(0,i.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=(0,i.unique)(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??(0,r.vgField)(e)}hash(){return`JoinAggregateTransform ${(0,i.hash)(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==r?{groupby:r}:{}}}}},94808:(e,t,n)=>{"use strict";n.r(t),n.d(t,{makeJoinAggregateFromFacet:()=>s});var r=n(79543),i=n(46681),a=n(33828),o=n(56123);function s(e,t){const{row:n,column:s}=t;if(n&&s){let t=null;for(const l of[n,s])if((0,i.isSortField)(l.sort)){const{field:n,op:s=i.DEFAULT_SORT_OP}=l.sort;e=t=new o.JoinAggregateTransformNode(e,{joinaggregate:[{op:s,field:n,as:(0,a.facetSortFieldName)(l,l.sort,{forAs:!0})}],groupby:[(0,r.vgField)(l)]})}return t}return null}},63186:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LoessTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${(0,r.hash)(this.transform)}`}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}},55320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LookupNode:()=>d});var r=n(26372),i=n(20916),a=n(65393),o=n(79989),s=n(74686),l=n(80219),u=n(455),c=n(89081);class d extends s.DataFlowNode{clone(){return new d(null,(0,o.duplicate)(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,r){const f=t.component.data.sources,{from:p}=n;let h=null;if((0,a.isLookupData)(p)){let e=(0,l.findSource)(p.data,f);e||(e=new u.SourceNode(p.data),f.push(e));const n=t.getName(`lookup_${r}`);h=new s.OutputNode(e,n,c.DataSourceType.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=h}else if((0,a.isLookupSelection)(p)){const e=p.param;let r;n={as:e,...n};try{r=t.getSelectionComponent((0,o.varName)(e),e)}catch(t){throw new Error(i.message.cannotLookupVariableParameter(e))}if(h=r.materialized,!h)throw new Error(i.message.noSameUnitLookup(e))}return new d(e,n,h.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,r.array)(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${(0,o.hash)({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:(0,r.array)(this.transform.as)}:{}};else{let t=this.transform.as;(0,r.isString)(t)||(i.warn(i.message.NO_FIELDS_NEEDS_AS),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}},80449:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FACET_SCALE_PREFIX:()=>o,MAX_OPTIMIZATION_RUNS:()=>s,checkLinks:()=>l,optimizeDataflow:()=>d});var r=n(20916),i=n(72398),a=n(10646);const o="scale_",s=5;function l(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!l(t.children))return!1}return!0}function u(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function c(e,t,n){let r=e.sources,a=!1;return a=u(new i.RemoveUnnecessaryOutputNodes,r)||a,a=u(new i.RemoveUnnecessaryIdentifierNodes(t),r)||a,r=r.filter((e=>e.numChildren()>0)),a=u(new i.RemoveUnusedSubtrees,r)||a,r=r.filter((e=>e.numChildren()>0)),n||(a=u(new i.MoveParseUp,r)||a,a=u(new i.MergeBins(t),r)||a,a=u(new i.RemoveDuplicateTimeUnits,r)||a,a=u(new i.MergeParse,r)||a,a=u(new i.MergeAggregates,r)||a,a=u(new i.MergeTimeUnits,r)||a,a=u(new i.MergeIdenticalNodes,r)||a,a=u(new i.MergeOutputs,r)||a),e.sources=r,a}function d(e,t){l(e.sources);let n=0,i=0;for(let r=0;r{"use strict";n.r(t),n.d(t,{BottomUpOptimizer:()=>c,Optimizer:()=>u,TopDownOptimizer:()=>d,isDataSourceNode:()=>l});var r,i=n(65340),a=n(79351),o=n(455),s=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};function l(e){return e instanceof o.SourceNode||e instanceof i.GraticuleNode||e instanceof a.SequenceNode}class u{constructor(){r.set(this,void 0),s(this,r,!1,"f")}setModified(){s(this,r,!0,"f")}get modifiedFlag(){return function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}(this,r,"f")}}r=new WeakMap;class c extends u{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class d extends u{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}},72398:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MergeAggregates:()=>S,MergeBins:()=>_,MergeIdenticalNodes:()=>g,MergeOutputs:()=>A,MergeParse:()=>w,MergeTimeUnits:()=>E,MoveParseUp:()=>b,RemoveDuplicateTimeUnits:()=>y,RemoveUnnecessaryIdentifierNodes:()=>m,RemoveUnnecessaryOutputNodes:()=>v,RemoveUnusedSubtrees:()=>x});var r=n(79989),i=n(93794),a=n(69687),o=n(89153),s=n(74686),l=n(69151),u=n(68860),c=n(30366),d=n(3297),f=n(11259),p=n(455),h=n(62277);class g extends f.TopDownOptimizer{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class m extends f.TopDownOptimizer{constructor(e){super(),this.requiresSelectionId=e&&(0,i.requiresSelectionId)(e)}run(e){e instanceof d.IdentifierNode&&(this.requiresSelectionId&&((0,f.isDataSourceNode)(e.parent)||e.parent instanceof a.AggregateNode||e.parent instanceof c.ParseNode)||(this.setModified(),e.remove()))}}class y extends f.Optimizer{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof h.TimeUnitNode&&(n=e.producedFields(),(0,r.hasIntersection)(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class v extends f.TopDownOptimizer{constructor(){super()}run(e){e instanceof s.OutputNode&&!e.isRequired()&&(this.setModified(),e.remove())}}class b extends f.BottomUpOptimizer{run(e){if(!((0,f.isDataSourceNode)(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof c.ParseNode)if(e instanceof c.ParseNode)this.setModified(),e.merge(t);else{if((0,r.fieldIntersection)(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class w extends f.BottomUpOptimizer{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof c.ParseNode));if(e.numChildren()>1&&n.length>=1){const i={},a=new Set;for(const e of n){const t=e.parse;for(const e of(0,r.keys)(t))e in i?i[e]!==t[e]&&a.add(e):i[e]=t[e]}for(const e of a)delete i[e];if(!(0,r.isEmpty)(i)){this.setModified();const n=new c.ParseNode(e,i);for(const a of t){if(a instanceof c.ParseNode)for(const e of(0,r.keys)(i))delete a.parse[e];e.removeChild(a),a.parent=n,a instanceof c.ParseNode&&0===(0,r.keys)(a.parse).length&&a.remove()}}}}}class x extends f.BottomUpOptimizer{run(e){e instanceof s.OutputNode||e.numChildren()>0||e instanceof l.FacetNode||e instanceof p.SourceNode||(this.setModified(),e.remove())}}class E extends f.BottomUpOptimizer{run(e){const t=e.children.filter((e=>e instanceof h.TimeUnitNode)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class S extends f.BottomUpOptimizer{run(e){const t=e.children.filter((e=>e instanceof a.AggregateNode)),n={};for(const e of t){const t=(0,r.hash)(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of(0,r.keys)(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class _ extends f.BottomUpOptimizer{constructor(e){super(),this.model=e}run(e){const t=!((0,f.isDataSourceNode)(e)||e instanceof u.FilterNode||e instanceof c.ParseNode||e instanceof d.IdentifierNode),n=[],i=[];for(const a of e.children)a instanceof o.BinNode&&(t&&!(0,r.fieldIntersection)(e.producedFields(),a.dependentFields())?n.push(a):i.push(a));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof o.BinNode?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class A extends f.BottomUpOptimizer{run(e){const t=[...e.children];if(!(0,r.some)(t,(e=>e instanceof s.OutputNode))||e.numChildren()<=1)return;const n=[];let i;for(const r of t)if(r instanceof s.OutputNode){let t=r;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof s.OutputNode))break;t=e}n.push(...t.children),i?(e.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=t,this.setModified()):i=t}else n.push(r);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=i}}}},80219:(e,t,n)=>{"use strict";n.r(t),n.d(t,{findSource:()=>H,parseData:()=>V,parseTransformArray:()=>G});var r=n(95848),i=n(89081),a=n(37761),o=n(20916),s=n(75028),l=n(65393),u=n(79989),c=n(15058),d=n(7302),f=n(93794),p=n(83937),h=n(69687),g=n(89153),m=n(77524),y=n(74686),v=n(97872),b=n(96578),w=n(69151),x=n(68860),E=n(78825),S=n(75138),_=n(4821),A=n(30366),C=n(13995),T=n(58211),k=n(65340),R=n(3297),D=n(47628),O=n(56123),N=n(94808),F=n(63186),P=n(55320),M=n(38380),I=n(40763),$=n(6799),L=n(56948),B=n(79351),U=n(455),z=n(89764),q=n(62277),j=n(51422);function H(e,t){for(const n of t){const t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,a=t.format?.feature;if(r&&a)continue;const o=e.format?.feature;if((o||a)&&o!==a)continue;const s=t.format?.mesh;if(!r&&!s||r===s)if((0,i.isInlineData)(e)&&(0,i.isInlineData)(t)){if((0,u.deepEqual)(e.values,t.values))return n}else if((0,i.isUrlData)(e)&&(0,i.isUrlData)(t)){if(e.url===t.url)return n}else if((0,i.isNamedData)(e)&&e.name===n.dataName)return n}return null}function G(e,t,n){let r=0;for(const i of t.transforms){let a,s;if((0,l.isCalculate)(i))s=e=new m.CalculateNode(e,i),a="derived";else if((0,l.isFilter)(i)){const r=(0,A.getImplicitFromFilterTransform)(i);s=e=A.ParseNode.makeWithAncestors(e,{},r,n)??e,e=new x.FilterNode(e,t,i.filter)}else if((0,l.isBin)(i))s=e=g.BinNode.makeFromTransform(e,i,t),a="number";else if((0,l.isTimeUnit)(i))a="date",void 0===n.getWithExplicit(i.field).value&&(e=new A.ParseNode(e,{[i.field]:a}),n.set(i.field,a,!1)),s=e=q.TimeUnitNode.makeFromTransform(e,i);else if((0,l.isAggregate)(i))s=e=h.AggregateNode.makeFromTransform(e,i),a="number",(0,f.requiresSelectionId)(t)&&(e=new R.IdentifierNode(e));else if((0,l.isLookup)(i))s=e=P.LookupNode.make(e,t,i,r++),a="derived";else if((0,l.isWindow)(i))s=e=new j.WindowTransformNode(e,i),a="number";else if((0,l.isJoinAggregate)(i))s=e=new O.JoinAggregateTransformNode(e,i),a="number";else if((0,l.isStack)(i))s=e=z.StackNode.makeFromTransform(e,i),a="derived";else if((0,l.isFold)(i))s=e=new _.FoldTransformNode(e,i),a="derived";else if((0,l.isExtent)(i))s=e=new b.ExtentTransformNode(e,i),a="derived";else if((0,l.isFlatten)(i))s=e=new S.FlattenTransformNode(e,i),a="derived";else if((0,l.isPivot)(i))s=e=new M.PivotTransformNode(e,i),a="derived";else if((0,l.isSample)(i))e=new L.SampleTransformNode(e,i);else if((0,l.isImpute)(i))s=e=D.ImputeNode.makeFromTransform(e,i),a="derived";else if((0,l.isDensity)(i))s=e=new v.DensityTransformNode(e,i),a="derived";else if((0,l.isQuantile)(i))s=e=new I.QuantileTransformNode(e,i),a="derived";else if((0,l.isRegression)(i))s=e=new $.RegressionTransformNode(e,i),a="derived";else{if(!(0,l.isLoess)(i)){o.warn(o.message.invalidTransformIgnored(i));continue}s=e=new F.LoessTransformNode(e,i),a="derived"}if(s&&void 0!==a)for(const e of s.producedFields()??[])n.set(e,a,!1)}return e}function V(e){let t=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new U.SourceNode({values:[]});return t.push(e),e}const n=H(e.data,t);if(n)return(0,i.isGenerator)(e.data)||(n.data.format=(0,u.mergeDeep)({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new U.SourceNode(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:o}=e.component.data,l=e.data,y=l&&((0,i.isGenerator)(l)||(0,i.isUrlData)(l)||(0,i.isInlineData)(l))||!e.parent?new r.AncestorParse:e.parent.component.data.ancestorParse.clone();(0,i.isGenerator)(l)?((0,i.isSequenceGenerator)(l)?t=new B.SequenceNode(t,l.sequence):(0,i.isGraticuleGenerator)(l)&&(t=new k.GraticuleNode(t,l.graticule)),y.parseNothing=!0):null===l?.format?.parse&&(y.parseNothing=!0),t=A.ParseNode.makeExplicit(t,e,y)??t,t=new R.IdentifierNode(t);const v=e.parent&&(0,d.isLayerModel)(e.parent);((0,d.isUnitModel)(e)||(0,d.isFacetModel)(e))&&v&&(t=g.BinNode.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=G(t,e,y));const b=(0,A.getImplicitFromSelection)(e),x=(0,A.getImplicitFromEncoding)(e);t=A.ParseNode.makeWithAncestors(t,{},{...b,...x},y)??t,(0,d.isUnitModel)(e)&&(t=C.GeoJSONNode.parseAll(t,e),t=T.GeoPointNode.parseAll(t,e)),((0,d.isUnitModel)(e)||(0,d.isFacetModel)(e))&&(v||(t=g.BinNode.makeFromEncoding(t,e)??t),t=q.TimeUnitNode.makeFromEncoding(t,e)??t,t=m.CalculateNode.parseAllForSortIndex(t,e));const S=t=W(i.DataSourceType.Raw,e,t);if((0,d.isUnitModel)(e)){const n=h.AggregateNode.makeFromEncoding(t,e);n&&(t=n,(0,f.requiresSelectionId)(e)&&(t=new R.IdentifierNode(t))),t=D.ImputeNode.makeFromEncoding(t,e)??t,t=z.StackNode.makeFromEncoding(t,e)??t}let _,O;if((0,d.isUnitModel)(e)){const{markDef:n,mark:r,config:o}=e,l=(0,c.getMarkPropOrConfig)("invalid",n,o),{marks:u,scales:d}=O=(0,a.getDataSourcesForHandlingInvalidValues)({invalid:l,isPath:(0,s.isPathMark)(r)});u!==d&&"include-invalid-values"===d&&(_=t=W(i.DataSourceType.PreFilterInvalid,e,t)),"exclude-invalid-values"===u&&(t=E.FilterInvalidNode.make(t,e,O)??t)}const F=t=W(i.DataSourceType.Main,e,t);let P;if((0,d.isUnitModel)(e)&&O){const{marks:n,scales:r}=O;"include-invalid-values"===n&&"exclude-invalid-values"===r&&(t=E.FilterInvalidNode.make(t,e,O)??t,P=t=W(i.DataSourceType.PostFilterInvalid,e,t))}(0,d.isUnitModel)(e)&&(0,p.materializeSelections)(e,F);let M=null;if((0,d.isFacetModel)(e)){const r=e.getName("facet");t=(0,N.makeJoinAggregateFromFacet)(t,e.facet)??t,M=new w.FacetNode(t,e,r,F.getSource()),n[r]=M}return{...e.component.data,outputNodes:n,outputNodeRefCounts:o,raw:S,main:F,facetRoot:M,ancestorParse:y,preFilterInvalid:_,postFilterInvalid:P}}function W(e,t,n){const{outputNodes:r,outputNodeRefCounts:i}=t.component.data,a=t.getDataName(e),o=new y.OutputNode(n,a,e,i);return r[a]=o,o}},38380:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PivotTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=(0,r.unique)((this.transform.groupby??[]).concat(e),(e=>e))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${(0,r.hash)(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==r?{limit:r}:{},...void 0!==i?{op:i}:{},...void 0!==n?{groupby:n}:{}}}}},40763:(e,t,n)=>{"use strict";n.r(t),n.d(t,{QuantileTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"prob",n[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${(0,r.hash)(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}},6799:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RegressionTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=(0,r.duplicate)(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${(0,r.hash)(this.transform)}`}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}},56948:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SampleTransformNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,(0,r.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${(0,r.hash)(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}},79351:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SequenceNode:()=>a});var r=n(79989),i=n(74686);class a extends i.DataFlowNode{clone(){return new a(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${(0,r.hash)(this.params)}`}assemble(){return{type:"sequence",...this.params}}}},455:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SourceNode:()=>o});var r=n(89081),i=n(79989),a=n(74686);class o extends a.DataFlowNode{constructor(e){let t;if(super(null),e??(e={name:"source"}),(0,r.isGenerator)(e)||(t=e.format?{...(0,i.omit)(e.format,["parse"])}:{}),(0,r.isInlineData)(e))this._data={values:e.values};else if((0,r.isUrlData)(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];(0,i.contains)(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else(0,r.isSphereGenerator)(e)?this._data={values:[{type:"Sphere"}]}:((0,r.isNamedData)(e)||(0,r.isGenerator)(e))&&(this._data={});this._generator=(0,r.isGenerator)(e),e.name&&(this._name=e.name),t&&!(0,i.isEmpty)(t)&&(this._data.format=t)}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(e){this._name=e}set parent(e){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:[]}}}},89764:(e,t,n)=>{"use strict";n.r(t),n.d(t,{StackNode:()=>u});var r=n(26372),i=n(79543),a=n(79989),o=n(15058),s=n(74686),l=n(78825);class u extends s.DataFlowNode{clone(){return new u(null,(0,a.duplicate)(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(e,t){const{stack:n,groupby:i,as:o,offset:s="zero"}=t,l=[],c=[];if(void 0!==t.sort)for(const e of t.sort)l.push(e.field),c.push((0,a.getFirstDefined)(e.order,"ascending"));const d={field:l,order:c};let f;return f=function(e){return(0,r.isArray)(e)&&e.every((e=>(0,r.isString)(e)))&&e.length>1}(o)?o:(0,r.isString)(o)?[o,`${o}_end`]:[`${t.stack}_start`,`${t.stack}_end`],new u(e,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:s,sort:d,facetby:[],as:f})}static makeFromEncoding(e,t){const n=t.stack,{encoding:a}=t;if(!n)return null;const{groupbyChannels:s,fieldChannel:l,offset:c,impute:d}=n,f=s.map((e=>{const t=a[e];return(0,i.getFieldDef)(t)})).filter((e=>!!e)),p=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=t.fieldDef,r=(0,i.vgField)(n);return r&&e.push(r),e}),[])}(t),h=t.encoding.order;let g;if((0,r.isArray)(h)||(0,i.isFieldDef)(h))g=(0,o.sortParams)(h);else{const e=(0,i.isOrderOnlyDef)(h)?h.sort:"y"===l?"descending":"ascending";g=p.reduce(((t,n)=>(t.field.includes(n)||(t.field.push(n),t.order.push(e)),t)),{field:[],order:[]})}return new u(e,{dimensionFieldDefs:f,stackField:t.vgField(l),facetby:[],stackby:p,sort:g,offset:c,impute:d,as:[t.vgField(l,{suffix:"start",forAs:!0}),t.vgField(l,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${(0,a.hash)(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[(0,i.vgField)(e,{binSuffix:"mid"})]:[(0,i.vgField)(e,{}),(0,i.vgField)(e,{binSuffix:"end"})]:[(0,i.vgField)(e)])).flat():n??[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:n,stackField:r,stackby:a,sort:o,offset:s,impute:u,as:c}=this._stack;if(u)for(const o of n){const{bandPosition:n=.5,bin:s}=o;if(s){const t=(0,i.vgField)(o,{expr:"datum"}),r=(0,i.vgField)(o,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${(0,l.isValidFiniteNumberExpr)(t)} ? ${n}*${t}+${1-n}*${r} : ${t}`,as:(0,i.vgField)(o,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:r,groupby:[...a,...t],key:(0,i.vgField)(o,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:c,offset:s}),e}}},10646:(e,t,n)=>{"use strict";n.r(t),n.d(t,{moveFacetDown:()=>d});var r=n(89081),i=n(69687),a=n(74686),o=n(69151),s=n(56123),l=n(80449),u=n(89764),c=n(51422);function d(e){if(e instanceof o.FacetNode)if(1!==e.numChildren()||e.children[0]instanceof a.OutputNode){const n=e.model.component.data.main;f(n);const r=(t=e,function e(n){if(!(n instanceof o.FacetNode)){const r=n.clone();if(r instanceof a.OutputNode){const e=l.FACET_SCALE_PREFIX+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof i.AggregateNode||r instanceof u.StackNode||r instanceof c.WindowTransformNode||r instanceof s.JoinAggregateTransformNode)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),d=e.children.map(r).flat();for(const e of d)e.parent=n}else{const t=e.children[0];(t instanceof i.AggregateNode||t instanceof u.StackNode||t instanceof c.WindowTransformNode||t instanceof s.JoinAggregateTransformNode)&&t.addDimensions(e.fields),t.swapWithParent(),d(e)}else e.children.map(d);var t}function f(e){if(e instanceof a.OutputNode&&e.type===r.DataSourceType.Main&&1===e.numChildren()){const t=e.children[0];t instanceof o.FacetNode||(t.swapWithParent(),f(e))}}},62277:(e,t,n)=>{"use strict";n.r(t),n.d(t,{OFFSETTED_RECT_END_SUFFIX:()=>h,OFFSETTED_RECT_START_SUFFIX:()=>p,TimeUnitNode:()=>f});var r=n(79543),i=n(96598),a=n(79989),o=n(7302),s=n(74686),l=n(75028),u=n(95290);function c(e){return void 0!==e.as}function d(e){return`${e}_end`}class f extends s.DataFlowNode{clone(){return new f(null,(0,a.duplicate)(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,s)=>{const{field:c,timeUnit:d}=n;if(d){let f;if((0,i.isBinnedTimeUnit)(d)){if((0,o.isUnitModel)(t)){const{mark:e,markDef:a,config:o}=t,s=(0,r.getBandPosition)({fieldDef:n,markDef:a,config:o});((0,l.isRectBasedMark)(e)||s)&&(f={timeUnit:(0,i.normalizeTimeUnit)(d),field:c})}}else f={as:(0,r.vgField)(n,{forAs:!0}),field:c,timeUnit:d};if((0,o.isUnitModel)(t)){const{mark:e,markDef:i,config:a}=t,o=(0,r.getBandPosition)({fieldDef:n,markDef:i,config:a});(0,l.isRectBasedMark)(e)&&(0,u.isXorY)(s)&&.5!==o&&(f.rectBandPosition=o)}f&&(e[(0,a.hash)(f)]=f)}return e}),{});return(0,a.isEmpty)(n)?null:new f(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...r}={...t},o={...r,timeUnit:(0,i.normalizeTimeUnit)(n)};return new f(e,{[(0,a.hash)(o)]:o})}merge(e){this.timeUnits={...this.timeUnits};for(const t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of(0,a.entries)(this.timeUnits)){const i=c(r)?r.as:`${r.field}_end`;e.has(i)||(t[n]=r)}this.timeUnits=t}producedFields(){return new Set((0,a.vals)(this.timeUnits).map((e=>c(e)?e.as:d(e.field))))}dependentFields(){return new Set((0,a.vals)(this.timeUnits).map((e=>e.field)))}hash(){return`TimeUnit ${(0,a.hash)(this.timeUnits)}`}assemble(){const e=[];for(const t of(0,a.vals)(this.timeUnits)){const{rectBandPosition:n}=t,r=(0,i.normalizeTimeUnit)(t.timeUnit);if(c(t)){const{field:o,as:s}=t,{unit:l,utc:u,...c}=r,d=[s,`${s}_end`];e.push({field:(0,a.replacePathInField)(o),type:"timeunit",...l?{units:(0,i.getTimeUnitParts)(l)}:{},...u?{timezone:"utc"}:{},...c,as:d}),e.push(...m(d,n,r))}else if(t){const{field:i}=t,a=i.replaceAll("\\.","."),o=g({timeUnit:r,field:a}),s=d(a);e.push({type:"formula",expr:o,as:s}),e.push(...m([a,s],n,r))}}return e}}const p="offsetted_rect_start",h="offsetted_rect_end";function g({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:a}=e,o=(0,i.getSmallestTimeUnitPart)(r),{part:s,step:l}=(0,i.getDateTimePartAndStep)(o,e.step);return`${a?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-l:l})`}function m([e,t],n,r){if(void 0!==n&&.5!==n){const i=`datum['${e}']`,a=`datum['${t}']`;return[{type:"formula",expr:y([g({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${p}`},{type:"formula",expr:y([i,a],n+.5),as:`${e}_${h}`}]}return[]}function y([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}},51422:(e,t,n)=>{"use strict";n.r(t),n.d(t,{WindowTransformNode:()=>s});var r=n(54814),i=n(79543),a=n(79989),o=n(74686);class s extends o.DataFlowNode{clone(){return new s(null,(0,a.duplicate)(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=(0,a.unique)(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach((t=>e.add(t.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??(0,i.vgField)(e)}hash(){return`WindowTransform ${(0,a.hash)(this.transform)}`}assemble(){const e=[],t=[],n=[],i=[];for(const r of this.transform.window)t.push(r.op),n.push(this.getDefaultName(r)),i.push(void 0===r.param?null:r.param),e.push(void 0===r.field?null:r.field);const a=this.transform.frame,o=this.transform.groupby;if(a&&null===a[0]&&null===a[1]&&t.every((e=>(0,r.isAggregateOp)(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==o?{groupby:o}:{}};const s=[],l=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort)s.push(e.field),l.push(e.order??"ascending");const u={field:s,order:l},c=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:u,...void 0!==c?{ignorePeers:c}:{},...void 0!==o?{groupby:o}:{},...void 0!==a?{frame:a}:{}}}}},33828:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FacetModel:()=>T,facetSortFieldName:()=>C});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(3802),l=n(20916),u=n(31179),c=n(46681),d=n(51894),f=n(79989),p=n(5711),h=n(36598),g=n(81458),m=n(77524),y=n(80219),v=n(51885),b=n(18020),w=n(10078),x=n(99354),E=n(27588),S=n(7302),_=n(63760),A=n(52128);function C(e,t,n){return(0,o.vgField)(t,{suffix:`by_${(0,o.vgField)(e)}`,...n})}class T extends S.ModelWithField{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=(0,h.buildModel)(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!(0,d.isFacetMapping)(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=(0,f.keys)(e),n={};for(const r of t){if(![a.ROW,a.COLUMN].includes(r)){l.warn(l.message.incompatibleChannel(r,"facet"));break}const t=e[r];if(void 0===t.field){l.warn(l.message.emptyFieldDef(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const n=(0,o.initFieldDef)(e,t);return n.header?n.header=(0,s.replaceExprRef)(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return(0,f.hasProperty)(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=(0,y.parseData)(this),this.child.parseData()}parseLayoutSize(){(0,E.parseChildrenLayoutSize)(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),(0,x.parseFacetHeaders)(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const t of a.FACET_CHANNELS)for(const n of w.HEADER_TYPES){const r=this.component.layoutHeaders[t],i=r[n],{facetFieldDef:a}=r;if(a){const n=(0,b.getHeaderProperty)("titleOrient",a.header,this.config,t);if(["right","bottom"].includes(n)){const r=(0,b.getHeaderChannel)(t,n);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[r]="end"}}if(i?.[0]){const i="row"===t?"height":"width",a="header"===n?"headerBand":"footerBand";"facet"===t||this.child.component.layoutSize.get(i)||(e[a]??(e[a]={}),e[a][t]=.5),r.title&&(e.offset??(e.offset={}),e.offset["row"===t?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let r="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(r="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof T))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof T?{...this.channelHasField("column")?{encode:{update:{columns:{field:(0,o.vgField)(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof T){if(this.child.channelHasField("column")){const r=(0,o.vgField)(this.child.facet.column);e.push(r),t.push("distinct"),n.push(`distinct_${r}`)}}else for(const r of a.POSITION_SCALE_CHANNELS){const i=this.child.component.scales[r];if(i&&!i.merged){const a=i.get("type"),o=i.get("range");if((0,u.hasDiscreteDomain)(a)&&(0,p.isVgRangeStep)(o)){const i=(0,_.assembleDomain)(this.child,r),a=(0,_.getFieldFromDomain)(i);a?(e.push(a),t.push("distinct"),n.push(`distinct_${a}`)):l.warn(l.message.unknownField(r))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:s}=this.facet,{fields:l,ops:u,as:d}=this.getCardinalityAggregateForChild(),f=[];for(const e of a.FACET_CHANNELS){const t=this.facet[e];if(t){f.push((0,o.vgField)(t));const{bin:a,sort:p}=t;if((0,i.isBinning)(a)&&f.push((0,o.vgField)(t,{binSuffix:"end"})),(0,c.isSortField)(p)){const{field:e,op:r=c.DEFAULT_SORT_OP}=p,i=C(t,p);n&&s?(l.push(i),u.push("max"),d.push(i)):(l.push(e),u.push(r),d.push(i))}else if((0,r.isArray)(p)){const n=(0,m.sortArrayIndexField)(t,e);l.push(n),u.push("max"),d.push(n)}}}const p=!!n&&!!s;return{name:e,data:t,groupby:f,...p||l.length>0?{aggregate:{...p?{cross:p}:{},...l.length?{fields:l,ops:u,as:d}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,n=t[e];return n?(0,c.isSortField)(n.sort)?[C(n,n.sort,{expr:"datum"})]:(0,r.isArray)(n.sort)?[(0,m.sortArrayIndexField)(n,e,{expr:"datum"})]:[(0,o.vgField)(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[((0,c.isSortField)(e)?e.order:!(0,r.isArray)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return(0,v.assembleLabelTitle)(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const r of w.HEADER_CHANNELS)if(e[r]){const i=(0,b.getHeaderProperty)("labelOrient",e[r]?.header,t,r);if(n[r].includes(i))return(0,v.assembleLabelTitle)(e[r],r,t)}}assembleMarks(){const{child:e}=this,t=this.component.data.facetRoot,n=(0,g.assembleFacetData)(t),r=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),o=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:a.FACET_CHANNELS.map((e=>this.facetSortFields(e))).flat(),order:a.FACET_CHANNELS.map((e=>this.facetSortOrder(e))).flat()},...n.length>0?{data:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup((0,A.assembleFacetSignals)(this,[]))}]}getMapping(){return this.facet}}},6032:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BIN_RANGE_DELIMITER:()=>g,binFormatExpression:()=>A,formatCustomType:()=>v,formatSignalRef:()=>m,guideFormat:()=>b,guideFormatType:()=>w,isCustomFormatType:()=>p,numberFormat:()=>x,timeFormat:()=>E,timeFormatExpression:()=>C});var r=n(26372),i=n(19664),a=n(79543),o=n(4976),s=n(31179),l=n(96598),u=n(99273),c=n(79989),d=n(5711),f=n(42104);function p(e){return e&&"number"!==e&&"time"!==e}function h(e,t,n){return`${e}(${t}${n?`, ${(0,c.stringify)(n)}`:""})`}const g=" – ";function m({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:o,config:u}){if(p(n))return v({fieldOrDatumDef:e,format:t,formatType:n,expr:r,config:u});const c=y(e,r,o),d=(0,a.channelDefType)(e);if(void 0===t&&void 0===n&&u.customFormatTypes){if("quantitative"===d){if(o&&u.normalizedNumberFormatType)return v({fieldOrDatumDef:e,format:u.normalizedNumberFormat,formatType:u.normalizedNumberFormatType,expr:r,config:u});if(u.numberFormatType)return v({fieldOrDatumDef:e,format:u.numberFormat,formatType:u.numberFormatType,expr:r,config:u})}if("temporal"===d&&u.timeFormatType&&(0,a.isFieldDef)(e)&&void 0===e.timeUnit)return v({fieldOrDatumDef:e,format:u.timeFormat,formatType:u.timeFormatType,expr:r,config:u})}if((0,a.isFieldOrDatumDefForTimeFormat)(e)){const n=C({field:c,timeUnit:(0,a.isFieldDef)(e)?(0,l.normalizeTimeUnit)(e.timeUnit)?.unit:void 0,format:t,formatType:u.timeFormatType,rawTimeFormat:u.timeFormat,isUTCScale:(0,a.isScaleFieldDef)(e)&&e.scale?.type===s.ScaleType.UTC});return n?{signal:n}:void 0}return t=x({type:d,specifiedFormat:t,config:u,normalizeStack:o}),(0,a.isFieldDef)(e)&&(0,i.isBinning)(e.bin)?{signal:A(c,(0,a.vgField)(e,{expr:r,binSuffix:"end"}),t,n,u)}:t||"quantitative"===(0,a.channelDefType)(e)?{signal:`${S(c,t)}`}:{signal:`isValid(${c}) ? ${c} : ""+${c}`}}function y(e,t,n){return(0,a.isFieldDef)(e)?n?`${(0,a.vgField)(e,{expr:t,suffix:"end"})}-${(0,a.vgField)(e,{expr:t,suffix:"start"})}`:(0,a.vgField)(e,{expr:t}):(0,f.datumDefToExpr)(e)}function v({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:o,config:s,field:l}){return l??(l=y(e,r,o)),"datum.value"!==l&&(0,a.isFieldDef)(e)&&(0,i.isBinning)(e.bin)?{signal:A(l,(0,a.vgField)(e,{expr:r,binSuffix:"end"}),t,n,s)}:{signal:h(n,l,t)}}function b(e,t,n,i,o,s){if(!(0,r.isString)(i)||!p(i)){if(void 0===n&&void 0===i&&o.customFormatTypes&&"quantitative"===(0,a.channelDefType)(e)){if(o.normalizedNumberFormatType&&(0,a.isPositionFieldOrDatumDef)(e)&&"normalize"===e.stack)return;if(o.numberFormatType)return}if((0,a.isPositionFieldOrDatumDef)(e)&&"normalize"===e.stack&&o.normalizedNumberFormat)return x({type:"quantitative",config:o,normalizeStack:!0});if((0,a.isFieldOrDatumDefForTimeFormat)(e)){const t=(0,a.isFieldDef)(e)?(0,l.normalizeTimeUnit)(e.timeUnit)?.unit:void 0;if(void 0===t&&o.customFormatTypes&&o.timeFormatType)return;return E({specifiedFormat:n,timeUnit:t,config:o,omitTimeFormatConfig:s})}return x({type:t,specifiedFormat:n,config:o})}}function w(e,t,n){return e&&((0,d.isSignalRef)(e)||"number"===e||"time"===e)?e:(0,a.isFieldOrDatumDefForTimeFormat)(t)&&"time"!==n&&"utc"!==n?(0,a.isFieldDef)(t)&&(0,l.normalizeTimeUnit)(t?.timeUnit)?.utc?"utc":"time":void 0}function x({type:e,specifiedFormat:t,config:n,normalizeStack:i}){return(0,r.isString)(t)?t:e===u.QUANTITATIVE?i?n.normalizedNumberFormat:n.numberFormat:void 0}function E({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:r}){return e||(t?{signal:(0,l.timeUnitSpecifierExpression)(t)}:r?void 0:n.timeFormat)}function S(e,t){return`format(${e}, "${t||""}")`}function _(e,t,n,i){return p(n)?h(n,e,t):S(e,((0,r.isString)(t)?t:void 0)??i.numberFormat)}function A(e,t,n,r,i){if(void 0===n&&void 0===r&&i.customFormatTypes&&i.numberFormatType)return A(e,t,i.numberFormat,i.numberFormatType,i);const a=_(e,n,r,i),s=_(t,n,r,i);return`${(0,o.fieldValidPredicate)(e,!1)} ? "null" : ${a} + "${g}" + ${s}`}function C({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:a,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:`${o?"utc":"time"}Format(${e}, '${n=(0,r.isString)(n)?n:a}')`:(0,l.formatExpression)(t,e,o)}},16039:(e,t,n)=>{"use strict";n.r(t),n.d(t,{guideEncodeEntry:()=>o});var r=n(79989),i=n(15058),a=n(49144);function o(e,t){return(0,r.keys)(e).reduce(((n,r)=>({...n,...(0,a.wrapCondition)({model:t,channelDef:e[r],vgChannel:r,mainRefFn:e=>(0,i.signalOrValueRef)(e.value),invalidValueRef:void 0})})),{})}},51885:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleHeaderGroup:()=>E,assembleHeaderGroups:()=>b,assembleHeaderProperties:()=>C,assembleLabelTitle:()=>x,assembleLayoutTitleBand:()=>A,assembleTitleGroup:()=>m,defaultHeaderGuideAlign:()=>y,defaultHeaderGuideBaseline:()=>v,getLayoutTitleBand:()=>_});var r=n(26372),i=n(95290),a=n(79543),o=n(41028),s=n(46681),l=n(51894),u=n(79989),c=n(43852),d=n(77524),f=n(6032),p=n(7302),h=n(18020),g=n(10078);function m(e,t){const 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:a,titleAngle:s,titleOrient:l}=(0,h.getHeaderProperties)(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),c=(0,h.getHeaderChannel)(t,l),d=(0,u.normalizeAngle)(s);return{name:`${t}-title`,type:"group",role:`${c}-title`,title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...v(d,c),...y(c,d,a),...C(r,i,t,o.HEADER_TITLE_PROPERTIES,o.HEADER_TITLE_PROPERTIES_MAP)}}}function y(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=(0,c.defaultLabelAlign)(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function v(e,t){const n=(0,c.defaultLabelBaseline)(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function b(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of g.HEADER_TYPES)if(n[i])for(const a of n[i]){const o=E(e,t,i,n,a);null!=o&&r.push(o)}return r}function w(e,t){const{sort:n}=e;return(0,s.isSortField)(n)?{field:(0,a.vgField)(n,{expr:"datum"}),order:n.order??"ascending"}:(0,r.isArray)(n)?{field:(0,d.sortArrayIndexField)(e,t,{expr:"datum"}),order:"ascending"}:{field:(0,a.vgField)(e,{expr:"datum"}),order:n??"ascending"}}function x(e,t,n){const{format:r,formatType:i,labelAngle:s,labelAnchor:l,labelOrient:c,labelExpr:d}=(0,h.getHeaderProperties)(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),p=(0,f.formatSignalRef)({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,g=(0,h.getHeaderChannel)(t,c);return{text:{signal:d?(0,u.replaceAll)((0,u.replaceAll)(d,"datum.label",p),"datum.value",(0,a.vgField)(e,{expr:"parent"})):p},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...v(s,g),...y(g,s,l),...C(n,e,t,o.HEADER_LABEL_PROPERTIES,o.HEADER_LABEL_PROPERTIES_MAP)}}function E(e,t,n,r,i){if(i){let a=null;const{facetFieldDef:o}=r,s=e.config?e.config:void 0;if(o&&i.labels){const{labelOrient:e}=(0,h.getHeaderProperties)(["labelOrient"],o.header,s,t);("row"===t&&!(0,u.contains)(["top","bottom"],e)||"column"===t&&!(0,u.contains)(["left","right"],e))&&(a=x(o,t,s))}const c=(0,p.isFacetModel)(e)&&!(0,l.isFacetMapping)(e.facet),d=i.axes,f=d?.length>0;if(a||f){const s="row"===t?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:w(o,t)}:{},...f&&c?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...a?{title:a}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...f?{axes:d}:{}}}}return null}const S={column:{start:0,end:1},row:{start:1,end:0}};function _(e,t){return S[t][e]}function A(e,t){const n={};for(const r of i.FACET_CHANNELS){const i=e[r];if(i?.facetFieldDef){const{titleAnchor:e,titleOrient:a}=(0,h.getHeaderProperties)(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),o=(0,h.getHeaderChannel)(r,a),s=_(e,o);void 0!==s&&(n[o]=s)}}return(0,u.isEmpty)(n)?void 0:n}function C(e,t,n,r,i){const a={};for(const o of r){if(!i[o])continue;const r=(0,h.getHeaderProperty)(o,t?.header,e,n);void 0!==r&&(a[i[o]]=r)}return a}},18020:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHeaderChannel:()=>i,getHeaderProperties:()=>o,getHeaderProperty:()=>a});var r=n(79989);function i(e,t){return(0,r.contains)(["top","bottom"],t)?"column":(0,r.contains)(["left","right"],t)||"row"===e?"row":"column"}function a(e,t,n,i){const a="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return(0,r.getFirstDefined)((t||{})[e],a[e],n.header[e])}function o(e,t,n,r){const i={};for(const o of e){const e=a(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}},10078:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HEADER_CHANNELS:()=>r,HEADER_TYPES:()=>i});const r=["row","column"],i=["header","footer"]},99354:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getHeaderType:()=>d,parseFacetHeaders:()=>f});var r=n(26372),i=n(95290),a=n(79543),o=n(79989),s=n(5711),l=n(5593),u=n(91387),c=n(18020);function d(e){return"top"===e||"left"===e||(0,s.isSignalRef)(e)?"header":"footer"}function f(e){for(const t of i.FACET_CHANNELS)p(e,t);g(e,"x"),g(e,"y")}function p(e,t){const{facet:n,config:i,child:s,component:l}=e;if(e.channelHasField(t)){const u=n[t],d=(0,c.getHeaderProperty)("title",null,i,t);let f=(0,a.title)(u,i,{allowDisabling:!0,includeDefault:void 0===d||!!d});s.component.layoutHeaders[t].title&&(f=(0,r.isArray)(f)?f.join(", "):f,f+=` / ${s.component.layoutHeaders[t].title}`,s.component.layoutHeaders[t].title=null);const p=(0,c.getHeaderProperty)("labelOrient",u.header,i,t),g=null!==u.header&&(0,o.getFirstDefined)(u.header?.labels,i.header.labels,!0),m=(0,o.contains)(["bottom","right"],p)?"footer":"header";l.layoutHeaders[t]={title:null!==u.header?f:null,facetFieldDef:u,[m]:"facet"===t?[]:[h(e,t,g)]}}}function h(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function g(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=(0,u.parseGuideResolve)(i,t),"shared"===i.axis[t]){const i="x"===t?"column":"row",a=r[i];for(const r of n.component.axes[t]){const t=d(r.get("orient"));a[t]??(a[t]=[h(e,i,!1)]);const n=(0,l.assembleAxis)(r,"main",e.config,{header:!0});n&&a[t][0].axes.push(n),r.mainExtracted=!0}}}}},59845:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScaleInvalidDataMode:()=>s,shouldBreakPath:()=>l});var r=n(75028),i=n(31179),a=n(15058),o=n(96430);function s({markDef:e,config:t,scaleChannel:n,scaleType:s,isCountAggregate:l}){if(!s||!(0,i.hasContinuousDomain)(s)||l)return"always-valid";const u=(0,o.normalizeInvalidDataMode)((0,a.getMarkPropOrConfig)("invalid",e,t),{isPath:(0,r.isPathMark)(e.type)}),c=t.scale?.invalid?.[n];return void 0!==c?"show":u}function l(e){return"break-paths-filter-domains"===e||"break-paths-show-domains"===e}},37761:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getDataSourcesForHandlingInvalidValues:()=>a,getScaleDataSourceForHandlingInvalidValues:()=>o});var r=n(89081),i=n(96430);function a({invalid:e,isPath:t}){switch((0,i.normalizeInvalidDataMode)(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 o(e){const{marks:t,scales:n}=a(e);return t===n?r.DataSourceType.Main:"include-invalid-values"===n?r.DataSourceType.PreFilterInvalid:r.DataSourceType.PostFilterInvalid}},96430:(e,t,n)=>{"use strict";function r(e,{isPath:t}){return void 0===e||"break-paths-show-path-domains"===e?t?"break-paths-show-domains":"filter":null===e?"show":e}n.r(t),n.d(t,{normalizeInvalidDataMode:()=>r})},51878:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LayerModel:()=>m});var r=n(26372),i=n(20916),a=n(24777),o=n(79989),s=n(5593),l=n(32134),u=n(80219),c=n(6871),d=n(27588),f=n(86985),p=n(7302),h=n(52128),g=n(92649);class m extends p.Model{constructor(e,t,n,r,o){super(e,"layer",t,n,o,e.resolve,e.view);const s={...r,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if((0,a.isLayerSpec)(e))return new m(e,this,this.getName(`layer_${t}`),s,o);if((0,a.isUnitSpec)(e))return new g.UnitModel(e,this,this.getName(`layer_${t}`),s,o);throw new Error(i.message.invalidSpec(e))}))}parseData(){this.component.data=(0,u.parseData)(this);for(const e of this.children)e.parseData()}parseLayoutSize(){(0,d.parseLayerLayoutSize)(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of(0,o.keys)(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){(0,l.parseLayerAxes)(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),(0,s.assembleAxisSignals)(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),(0,c.assembleLayoutSignals)(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleGroupStyle(){const e=new Set;for(const t of this.children)for(const n of(0,r.array)(t.assembleGroupStyle()))e.add(n);const t=Array.from(e);return t.length>1?t:1===t.length?t[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return(0,h.assembleLayerSelectionMarks)(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),(0,f.assembleLegends)(this))}}},6871:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleLayoutSignals:()=>u,sizeExpr:()=>f,sizeSignals:()=>c});var r=n(24007),i=n(31179),a=n(79989),o=n(5711),s=n(15058),l=n(7302);function u(e){return[...c(e,"width"),...c(e,"height"),...c(e,"childWidth"),...c(e,"childHeight")]}function c(e,t){const n="width"===t?"x":"y",a=e.component.layoutSize.get(t);if(!a||"merged"===a)return[];const s=e.getSizeSignalRef(t).signal;if("step"===a){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),a=t.get("range");if((0,i.hasDiscreteDomain)(r)&&(0,o.isVgRangeStep)(a)){const r=e.scaleName(n);return(0,l.isFacetModel)(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[d(r,a)]:[d(r,a),{name:s,update:f(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==a){const t=s.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${(0,r.getViewConfigContinuousSize)(e.config.view,t?"width":"height")}`;return[{name:s,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:s,value:a}]}function d(e,t){const n=`${e}_step`;return(0,o.isSignalRef)(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function f(e,t,n){const r=t.get("type"),i=t.get("padding"),o=(0,a.getFirstDefined)(t.get("paddingOuter"),i);let l=t.get("paddingInner");return l="band"===r?void 0!==l?l:i:1,`bandspace(${n}, ${(0,s.signalOrStringValue)(l)}, ${(0,s.signalOrStringValue)(o)}) * ${e}_step`}},19492:(e,t,n)=>{"use strict";function r(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}n.r(t),n.d(t,{getSizeTypeFromLayoutSizeType:()=>r})},81693:(e,t,n)=>{"use strict";n.r(t),n.d(t,{initLayoutSize:()=>s});var r=n(95290),i=n(79543),a=n(20916),o=n(89820);function s({encoding:e,size:t}){for(const n of r.POSITION_SCALE_CHANNELS){const s=(0,r.getSizeChannel)(n);(0,o.isStep)(t[s])&&(0,i.isContinuousFieldOrDatumDef)(e[n])&&(delete t[s],a.warn(a.message.stepDropped(s)))}return t}},27588:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseChildrenLayoutSize:()=>p,parseConcatLayoutSize:()=>f,parseLayerLayoutSize:()=>d,parseUnitLayoutSize:()=>g});var r=n(95290),i=n(24007),a=n(31179),o=n(89820),s=n(5711),l=n(91387),u=n(96159),c=n(19492);function d(e){p(e),h(e,"width"),h(e,"height")}function f(e){p(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";h(e,t),h(e,n)}function p(e){for(const t of e.children)t.parseLayoutSize()}function h(e,t){const n=(0,c.getSizeTypeFromLayoutSizeType)(t),i=(0,r.getPositionScaleChannel)(n),a=e.component.resolve,o=e.component.layoutSize;let s;for(const t of e.children){const r=t.component.layoutSize.getWithExplicit(n),o=a.scale[i]??(0,l.defaultScaleResolve)(i,e);if("independent"===o&&"step"===r.value){s=void 0;break}if(s){if("independent"===o&&s.value!==r.value){s=void 0;break}s=(0,u.mergeValuesWithExplicit)(s,r,n,"")}else s=r}if(s){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function g(e){const{size:t,component:n}=e;for(const i of r.POSITION_SCALE_CHANNELS){const a=(0,r.getSizeChannel)(i);if(t[a]){const e=t[a];n.layoutSize.set(a,(0,o.isStep)(e)?"step":e,!0)}else{const t=m(e,a);n.layoutSize.set(a,t,!1)}}}function m(e,t){const n="width"===t?"x":"y",r=e.config,l=e.getScaleComponent(n);if(l){const e=l.get("type"),n=l.get("range");if((0,a.hasDiscreteDomain)(e)){const e=(0,i.getViewConfigDiscreteSize)(r.view,t);return(0,s.isVgRangeStep)(n)||(0,o.isStep)(e)?"step":e}return(0,i.getViewConfigContinuousSize)(r.view,t)}if(e.hasProjection||"arc"===e.mark)return(0,i.getViewConfigContinuousSize)(r.view,t);{const e=(0,i.getViewConfigDiscreteSize)(r.view,t);return(0,o.isStep)(e)?e.step:e}}},86985:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleLegend:()=>l,assembleLegends:()=>s});var r=n(54116),i=n(79989),a=n(5711),o=n(16182);function s(e){const t=e.component.legends,n={};for(const r of(0,i.keys)(t)){const a=e.getScaleComponent(r),s=(0,i.stringify)(a.get("domains"));if(n[s])for(const e of n[s])(0,o.mergeLegendComponent)(e,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return(0,i.vals)(n).flat().map((t=>l(t,e.config))).filter((e=>void 0!==e))}function l(e,t){const{disable:n,labelExpr:o,selections:s,...l}=e.combine();if(!n){if(!1===t.aria&&null==l.aria&&(l.aria=!1),l.encode?.symbols){const e=l.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||l.stroke||(e.stroke={value:"transparent"});for(const t of r.LEGEND_SCALE_CHANNELS)l[t]&&delete e[t]}if(l.title||delete l.title,void 0!==o){let e=o;l.encode?.labels?.update&&(0,a.isSignalRef)(l.encode.labels.update.text)&&(e=(0,i.replaceAll)(o,"datum.label",l.encode.labels.update.text.signal)),function(e,t,n,r){var i,a;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(a=e.encode[t]).update??(a.update={}),e.encode[t].update.text=r}(l,"labels",0,{signal:e})}return l}}},46602:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LEGEND_COMPONENT_PROPERTIES:()=>s,LegendComponent:()=>l});var r=n(54116),i=n(79989),a=n(96159);const o={...r.COMMON_LEGEND_PROPERTY_INDEX,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},s=(0,i.keys)(o);class l extends a.Split{}},33375:(e,t,n)=>{"use strict";n.r(t),n.d(t,{entries:()=>m,getFirstConditionValue:()=>v,gradient:()=>h,labels:()=>g,legendEncodeRules:()=>f,symbols:()=>p});var r=n(26372),i=n(95290),a=n(79543),o=n(75028),s=n(79989),l=n(15058),u=n(6032),c=n(55792),d=n(93794);const f={symbols:p,gradient:h,labels:g,entries:m};function p(e,{fieldOrDatumDef:t,model:n,channel:u,legendCmpt:d,legendType:f}){if("symbol"!==f)return;const{markDef:p,encoding:h,config:g,mark:m}=n,b=p.filled&&"trail"!==m;let x={...(0,l.applyMarkConfig)({},n,o.FILL_STROKE_CONFIG),...c.color(n,{filled:b})};const E=d.get("symbolOpacity")??g.legend.symbolOpacity,S=d.get("symbolFillColor")??g.legend.symbolFillColor,_=d.get("symbolStrokeColor")??g.legend.symbolStrokeColor,A=void 0===E?y(h.opacity)??p.opacity:void 0;if(x.fill)if("fill"===u||b&&u===i.COLOR)delete x.fill;else if((0,s.hasProperty)(x.fill,"field"))S?delete x.fill:(x.fill=(0,l.signalOrValueRef)(g.legend.symbolBaseFillColor??"black"),x.fillOpacity=(0,l.signalOrValueRef)(A??1));else if((0,r.isArray)(x.fill)){const e=v(h.fill??h.color)??p.fill??(b&&p.color);e&&(x.fill=(0,l.signalOrValueRef)(e))}if(x.stroke)if("stroke"===u||!b&&u===i.COLOR)delete x.stroke;else if((0,s.hasProperty)(x.stroke,"field")||_)delete x.stroke;else if((0,r.isArray)(x.stroke)){const e=(0,s.getFirstDefined)(v(h.stroke||h.color),p.stroke,b?p.color:void 0);e&&(x.stroke={value:e})}if(u!==i.OPACITY){const e=(0,a.isFieldDef)(t)&&w(0,d,t);e?x.opacity=[{test:e,...(0,l.signalOrValueRef)(A??1)},(0,l.signalOrValueRef)(g.legend.unselectedOpacity)]:A&&(x.opacity=(0,l.signalOrValueRef)(A))}return x={...x,...e},(0,s.isEmpty)(x)?void 0:x}function h(e,{model:t,legendType:n,legendCmpt:r}){if("gradient"!==n)return;const{config:i,markDef:a,encoding:o}=t;let u={};const c=void 0===(r.get("gradientOpacity")??i.legend.gradientOpacity)?y(o.opacity)||a.opacity:void 0;return c&&(u.opacity=(0,l.signalOrValueRef)(c)),u={...u,...e},(0,s.isEmpty)(u)?void 0:u}function g(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},l=n.config,c=(0,a.isFieldDef)(t)?w(0,i,t):void 0,d=c?[{test:c,value:1},{value:l.legend.unselectedOpacity}]:void 0,{format:f,formatType:p}=o;let h;(0,u.isCustomFormatType)(p)?h=(0,u.formatCustomType)({fieldOrDatumDef:t,field:"datum.value",format:f,formatType:p,config:l}):void 0===f&&void 0===p&&l.customFormatTypes&&("quantitative"===t.type&&l.numberFormatType?h=(0,u.formatCustomType)({fieldOrDatumDef:t,field:"datum.value",format:l.numberFormat,formatType:l.numberFormatType,config:l}):"temporal"===t.type&&l.timeFormatType&&(0,a.isFieldDef)(t)&&void 0===t.timeUnit&&(h=(0,u.formatCustomType)({fieldOrDatumDef:t,field:"datum.value",format:l.timeFormat,formatType:l.timeFormatType,config:l})));const g={...d?{opacity:d}:{},...h?{text:h}:{},...e};return(0,s.isEmpty)(g)?void 0:g}function m(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}function y(e){return b(e,((e,t)=>Math.max(e,t.value)))}function v(e){return b(e,((e,t)=>(0,s.getFirstDefined)(e,t.value)))}function b(e,t){return(0,a.hasConditionalValueDef)(e)?(0,r.array)(e.condition).reduce(t,e.value):(0,a.isValueDef)(e)?e.value:void 0}function w(e,t,n){const i=t.get("selections");if(!i?.length)return;const a=(0,r.stringValue)(n.field);return i.map((e=>`(!length(data(${(0,r.stringValue)((0,s.varName)(e)+d.STORE)})) || (${e}[${a}] && indexof(${e}[${a}], datum.value) >= 0))`)).join(" || ")}},16182:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeLegendComponent:()=>x,parseLegend:()=>v,parseLegendForChannel:()=>w});var r=n(95290),i=n(79543),a=n(54116),o=n(96598),s=n(99273),l=n(79989),u=n(15058),c=n(16039),d=n(7302),f=n(91387),p=n(46608),h=n(96159),g=n(46602),m=n(33375),y=n(55516);function v(e){const t=(0,d.isUnitModel)(e)?function(e){const{encoding:t}=e,n={};for(const o of[r.COLOR,...a.LEGEND_SCALE_CHANNELS]){const a=(0,i.getFieldOrDatumDef)(t[o]);a&&e.getScaleComponent(o)&&(o===r.SHAPE&&(0,i.isFieldDef)(a)&&a.type===s.GEOJSON||(n[o]=w(e,o)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){v(r);for(const i of(0,l.keys)(r.component.legends))n.legend[i]=(0,f.parseGuideResolve)(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=x(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of(0,l.keys)(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function b(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===t&&e===r?.title)return!0}return e===(n||{})[t]}function w(e,t){let n=e.legend(t);const{markDef:r,encoding:a,config:s}=e,u=s.legend,d=new g.LegendComponent({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));(0,p.parseInteractiveLegend)(e,t,d);const f=void 0!==n?!n:u.disable;if(d.set("disable",f,void 0!==n),f)return d;n=n||{};const h=e.getScaleComponent(t).get("type"),v=(0,i.getFieldOrDatumDef)(a[t]),w=(0,i.isFieldDef)(v)?(0,o.normalizeTimeUnit)(v.timeUnit)?.unit:void 0,x=n.orient||s.legend.orient||"right",E=(0,y.getLegendType)({legend:n,channel:t,timeUnit:w,scaleType:h}),S={legend:n,channel:t,model:e,markDef:r,encoding:a,fieldOrDatumDef:v,legendConfig:u,config:s,scaleType:h,orient:x,legendType:E,direction:(0,y.getDirection)({legend:n,legendType:E,orient:x,legendConfig:u})};for(const r of g.LEGEND_COMPONENT_PROPERTIES){if("gradient"===E&&r.startsWith("symbol")||"symbol"===E&&r.startsWith("gradient"))continue;const i=r in y.legendRules?y.legendRules[r](S):n[r];if(void 0!==i){const a=b(i,r,n,e.fieldDef(t));(a||void 0===s.legend[r])&&d.set(r,i,a)}}const _=n?.encoding??{},A=d.get("selections"),C={},T={fieldOrDatumDef:v,model:e,channel:t,legendCmpt:d,legendType:E};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=(0,c.guideEncodeEntry)(_[t]??{},e),r=t in m.legendEncodeRules?m.legendEncodeRules[t](n,T):n;void 0===r||(0,l.isEmpty)(r)||(C[t]={...A?.length&&(0,i.isFieldDef)(v)?{name:`${(0,l.varName)(v.field)}_legend_${t}`}:{},...A?.length?{interactive:!!A}:{},update:r})}return(0,l.isEmpty)(C)||d.set("encode",C,!!n?.encoding),d}function x(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const n of g.LEGEND_COMPONENT_PROPERTIES){const r=(0,h.mergeValuesWithExplicit)(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return r=e,"circle"===(a=t).value?a:r;case"title":return(0,u.mergeTitleComponent)(e,t);case"type":return i=!0,(0,h.makeImplicit)("symbol")}var r,a;return(0,h.defaultTieBreaker)(e,t,n,"legend")}));e.setWithExplicit(n,r)}return i&&(e.implicit?.encode?.gradient&&(0,l.deleteNestedProperty)(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&(0,l.deleteNestedProperty)(e.explicit,["encode","gradient"])),e}},55516:(e,t,n)=>{"use strict";n.r(t),n.d(t,{clipHeight:()=>h,defaultDirection:()=>v,defaultGradientLength:()=>b,defaultLabelOverlap:()=>x,defaultSymbolType:()=>p,defaultType:()=>m,getDirection:()=>y,getLegendType:()=>g,legendRules:()=>d,values:()=>f});var r=n(26372),i=n(95290),a=n(79543),o=n(31179),s=n(79989),l=n(5711),u=n(6032),c=n(33375);const d={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return(0,u.guideFormat)(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return(0,u.guideFormatType)(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??b(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??x(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??p(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>(0,a.title)(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if((0,i.isColorChannel)(n)&&(0,o.isContinuousToContinuous)(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>f(t,e)};function f(e,t){const n=e.values;return(0,r.isArray)(n)?(0,a.valueArray)(t,n):(0,l.isSignalRef)(n)?n:void 0}function p(e,t,n,r){if("shape"!==t){const e=(0,c.getFirstConditionValue)(n)??r;if(e)return e}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 h(e){if("gradient"===e)return 20}function g(e){const{legend:t}=e;return(0,s.getFirstDefined)(t.type,m(e))}function m({channel:e,timeUnit:t,scaleType:n}){if((0,i.isColorChannel)(e)){if((0,s.contains)(["quarter","month","day"],t))return"symbol";if((0,o.isContinuousToContinuous)(n))return"gradient"}return"symbol"}function y({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??v(n,t)}function v(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}function b({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:l,gradientVerticalMinLength:u}=e;if((0,o.isContinuousToContinuous)(i))return"horizontal"===n?"top"===r||"bottom"===r?w(t,"width",s,a):s:w(t,"height",u,l)}function w(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function x(e){if((0,s.contains)(["quantile","threshold","log","symlog"],e))return"greedy"}},56017:(e,t,n)=>{"use strict";n.r(t),n.d(t,{arc:()=>i});var r=n(55792);const i={vgMark:"arc",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...r.pointPosition("x",e,{defaultPos:"mid"}),...r.pointPosition("y",e,{defaultPos:"mid"}),...r.rectPosition(e,"radius"),...r.rectPosition(e,"theta")})}},26052:(e,t,n)=>{"use strict";n.r(t),n.d(t,{area:()=>i});var r=n(55792);const i={vgMark:"area",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...r.pointOrRangePosition("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...r.pointOrRangePosition("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...r.defined(e)})}},47880:(e,t,n)=>{"use strict";n.r(t),n.d(t,{bar:()=>i});var r=n(55792);const i={vgMark:"rect",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...r.rectPosition(e,"x"),...r.rectPosition(e,"y")})}},57543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{aria:()=>c,description:()=>f});var r=n(26372),i=n(79989),a=n(15058),o=n(5711),s=n(49144),l=n(22449),u=n(14607);function c(e){const{markDef:t,config:n}=e,r=(0,a.getMarkPropOrConfig)("aria",t,n);return!1===r?{}:{...r?{aria:r}:{},...d(e),...f(e)}}function d(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const s=(0,a.getMarkPropOrConfig)("ariaRoleDescription",n,i);return null!=s?{ariaRoleDescription:{value:s}}:(0,r.hasOwnProperty)(o.VG_MARK_INDEX,t)?{}:{ariaRoleDescription:{value:t}}}function f(e){const{encoding:t,markDef:n,config:r,stack:o}=e,c=t.description;if(c)return(0,s.wrapCondition)({model:e,channelDef:c,vgChannel:"description",mainRefFn:t=>(0,l.textRef)(t,e.config),invalidValueRef:void 0});const d=(0,a.getMarkPropOrConfig)("description",n,r);if(null!=d)return{description:(0,a.signalOrValueRef)(d)};if(!1===r.aria)return{};const f=(0,u.tooltipData)(t,o,r);return(0,i.isEmpty)(f)?void 0:{description:{signal:(0,i.entries)(f).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}},96975:(e,t,n)=>{"use strict";n.r(t),n.d(t,{baseEncodeEntry:()=>m,color:()=>s.color,nonPosition:()=>l.nonPosition,pointOrRangePosition:()=>p.pointOrRangePosition,pointPosition:()=>f.pointPosition,rangePosition:()=>p.rangePosition,rectPosition:()=>h.rectPosition,text:()=>u.text,tooltip:()=>c.tooltip});var r=n(79989),i=n(5711),a=n(15058),o=n(57543),s=n(62663),l=n(34796),u=n(22449),c=n(14607),d=n(27536),f=n(47274),p=n(80261),h=n(24900);const g=new Set(["aria","width","height"]);function m(e,t){const{fill:n,stroke:r}="include"===t.color?(0,s.color)(e):{};return{...v(e.markDef,t),...y("fill",n),...y("stroke",r),...(0,l.nonPosition)("opacity",e),...(0,l.nonPosition)("fillOpacity",e),...(0,l.nonPosition)("strokeOpacity",e),...(0,l.nonPosition)("strokeWidth",e),...(0,l.nonPosition)("strokeDash",e),...(0,d.zindex)(e),...(0,c.tooltip)(e),...(0,u.text)(e,"href"),...(0,o.aria)(e)}}function y(e,t){return t?{[e]:t}:{}}function v(e,t){return i.VG_MARK_CONFIGS.reduce(((n,i)=>(!g.has(i)&&(0,r.hasProperty)(e,i)&&"ignore"!==t[i]&&(n[i]=(0,a.signalOrValueRef)(e[i])),n)),{})}},62663:(e,t,n)=>{"use strict";n.r(t),n.d(t,{color:()=>s});var r=n(20916),i=n(79989),a=n(15058),o=n(34796);function s(e,t={filled:void 0}){const{markDef:n,encoding:s,config:l}=e,{type:u}=n,c=t.filled??(0,a.getMarkPropOrConfig)("filled",n,l),d=(0,i.contains)(["bar","point","circle","square","geoshape"],u)?"transparent":void 0,f=(0,a.getMarkPropOrConfig)(!0===c?"color":void 0,n,l,{vgChannel:"fill"})??l.mark[!0===c&&"color"]??d,p=(0,a.getMarkPropOrConfig)(!1===c?"color":void 0,n,l,{vgChannel:"stroke"})??l.mark[!1===c&&"color"],h=c?"fill":"stroke",g={...f?{fill:(0,a.signalOrValueRef)(f)}:{},...p?{stroke:(0,a.signalOrValueRef)(p)}:{}};return n.color&&(c?n.fill:n.stroke)&&r.warn(r.message.droppingColor("property",{fill:"fill"in n,stroke:"stroke"in n})),{...g,...(0,o.nonPosition)("color",e,{vgChannel:h,defaultValue:c?f:p}),...(0,o.nonPosition)("fill",e,{defaultValue:s.fill?f:void 0}),...(0,o.nonPosition)("stroke",e,{defaultValue:s.stroke?p:void 0})}}},49144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{wrapCondition:()=>s});var r=n(26372),i=n(79543),a=n(95370),o=n(83937);function s({model:e,channelDef:t,vgChannel:n,invalidValueRef:s,mainRefFn:l}){const u=(0,i.isConditionalDef)(t)&&t.condition;let c=[];u&&(c=(0,r.array)(u).map((t=>{const n=l(t);if((0,i.isConditionalParameter)(t)){const{param:r,empty:i}=t;return{test:(0,o.parseSelectionPredicate)(e,{param:r,empty:i}),...n}}return{test:(0,a.expression)(e,t.test),...n}}))),void 0!==s&&c.push(s);const d=l(t);return void 0!==d&&c.push(d),c.length>1||1===c.length&&Boolean(c[0].test)?{[n]:c}:1===c.length?{[n]:c[0]}:{}}},13853:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defined:()=>l,valueIfDefined:()=>u});var r=n(54814),i=n(95290),a=n(4976),o=n(15058),s=n(59845);function l(e){const{config:t,markDef:n}=e,o=new Set;if(e.forEachFieldDef(((a,l)=>{let u;if(!(0,i.isScaleChannel)(l)||!(u=e.getScaleType(l)))return;const c=(0,r.isCountingAggregateOp)(a.aggregate),d=(0,s.getScaleInvalidDataMode)({scaleChannel:l,markDef:n,config:t,scaleType:u,isCountAggregate:c});if((0,s.shouldBreakPath)(d)){const t=e.vgField(l,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});t&&o.add(t)}})),o.size>0)return{defined:{signal:[...o].map((e=>(0,a.fieldValidPredicate)(e,!0))).join(" && ")}}}function u(e,t){if(void 0!==t)return{[e]:(0,o.signalOrValueRef)(t)}}},55792:(e,t,n)=>{"use strict";n.r(t),n.d(t,{aria:()=>r.aria,baseEncodeEntry:()=>i.baseEncodeEntry,color:()=>a.color,defined:()=>o.defined,nonPosition:()=>s.nonPosition,pointOrRangePosition:()=>u.pointOrRangePosition,pointPosition:()=>l.pointPosition,rangePosition:()=>u.rangePosition,rectPosition:()=>c.rectPosition,text:()=>d.text,tooltip:()=>f.tooltip,tooltipRefForEncoding:()=>f.tooltipRefForEncoding,valueIfDefined:()=>o.valueIfDefined});var r=n(57543),i=n(96975),a=n(62663),o=n(13853),s=n(34796),l=n(47274),u=n(80261),c=n(24900),d=n(22449),f=n(14607)},91463:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getConditionalValueRefForIncludingInvalidValue:()=>c});var r=n(54814),i=n(79543),a=n(68278),o=n(4976),s=n(5711),l=n(59845),u=n(71390);function c({scaleChannel:e,channelDef:t,scale:n,scaleName:a,markDef:s,config:u}){const c=n?.get("type"),f=(0,i.getFieldDef)(t),p=(0,r.isCountingAggregateOp)(f?.aggregate),h=(0,l.getScaleInvalidDataMode)({scaleChannel:e,markDef:s,config:u,scaleType:c,isCountAggregate:p});if(f&&"show"===h){const t=u.scale.invalid?.[e]??"zero-or-min";return{test:(0,o.fieldValidPredicate)((0,i.vgField)(f,{expr:"datum"}),!1),...d(t,n,a)}}}function d(e,t,n){if((0,a.isScaleInvalidDataIncludeAsValue)(e)){const{value:t}=e;return(0,s.isSignalRef)(t)?{signal:t.signal}:{value:t}}return(0,u.scaledZeroOrMinOrMax)({scale:t,scaleName:n,mode:"zeroOrMin"})}},34796:(e,t,n)=>{"use strict";n.r(t),n.d(t,{nonPosition:()=>l});var r=n(79543),i=n(15058),a=n(49144),o=n(42104),s=n(91463);function l(e,t,n={}){const{markDef:l,encoding:u,config:c}=t,{vgChannel:d}=n;let{defaultRef:f,defaultValue:p}=n;const h=u[e];void 0===f&&(p??(p=(0,i.getMarkPropOrConfig)(e,l,c,{vgChannel:d,ignoreVgConfig:!(0,r.isConditionalDef)(h)})),void 0!==p&&(f=(0,i.signalOrValueRef)(p)));const g={markDef:l,config:c,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},m=(0,s.getConditionalValueRefForIncludingInvalidValue)({...g,scaleChannel:e,channelDef:h});return(0,a.wrapCondition)({model:t,channelDef:h,vgChannel:d??e,invalidValueRef:m,mainRefFn:t=>o.midPoint({...g,channel:e,channelDef:t,stack:null,defaultRef:f})})}},43301:(e,t,n)=>{"use strict";n.r(t),n.d(t,{positionOffset:()=>a});var r=n(15058),i=n(42104);function a({channel:e,markDef:t,encoding:n={},model:a,bandPosition:o}){const s=`${e}Offset`,l=t[s],u=n[s];if(("xOffset"===s||"yOffset"===s)&&u)return{offsetType:"encoding",offset:(0,i.midPoint)({channel:s,channelDef:u,markDef:t,config:a?.config,scaleName:a.scaleName(s),scale:a.getScaleComponent(s),stack:null,defaultRef:(0,r.signalOrValueRef)(l),bandPosition:o})};const c=t[s];return c?{offsetType:"visual",offset:c}:{}}},9513:(e,t,n)=>{"use strict";n.r(t),n.d(t,{vgAlignedPositionChannel:()=>u});var r=n(95290),i=n(20916),a=n(5711),o=n(15058);const s={left:"x",center:"xc",right:"x2"},l={top:"y",middle:"yc",bottom:"y2"};function u(e,t,n,u="middle"){if("radius"===e||"theta"===e)return(0,r.getVgPositionChannel)(e);const c="x"===e?"align":"baseline",d=(0,o.getMarkPropOrConfig)(c,t,n);let f;return(0,a.isSignalRef)(d)?(i.warn(i.message.rangeMarkAlignmentCannotBeExpression(c)),f=void 0):f=d,"x"===e?s[f||("top"===u?"left":"center")]:l[f||u]}},47274:(e,t,n)=>{"use strict";n.r(t),n.d(t,{pointPosition:()=>u,pointPositionDefaultRef:()=>d,positionRef:()=>c});var r=n(95290),i=n(79543),a=n(15058),o=n(43301),s=n(42104),l=n(71390);function u(e,t,{defaultPos:n,vgChannel:i}){const{encoding:a,markDef:s,config:l,stack:u}=t,f=a[e],p=a[(0,r.getSecondaryRangeChannel)(e)],h=t.scaleName(e),g=t.getScaleComponent(e),{offset:m,offsetType:y}=(0,o.positionOffset)({channel:e,markDef:s,encoding:a,model:t,bandPosition:.5}),v=d({model:t,defaultPos:n,channel:e,scaleName:h,scale:g}),b=!f&&(0,r.isXorY)(e)&&(a.latitude||a.longitude)?{field:t.getName(e)}:c({channel:e,channelDef:f,channel2Def:p,markDef:s,config:l,scaleName:h,scale:g,stack:u,offset:m,defaultRef:v,bandPosition:"encoding"===y?0:void 0});return b?{[i||e]:b}:void 0}function c(e){const{channel:t,channelDef:n,scaleName:r,stack:a,offset:o,markDef:l}=e;if((0,i.isFieldOrDatumDef)(n)&&a&&t===a.fieldChannel){if((0,i.isFieldDef)(n)){let e=n.bandPosition;if(void 0!==e||"text"!==l.type||"radius"!==t&&"theta"!==t||(e=.5),void 0!==e)return s.interpolatedSignalRef({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:e,offset:o})}return s.valueRefForFieldOrDatumDef(n,r,{suffix:"end"},{offset:o})}return s.midPointRefWithPositionInvalidTest(e)}function d({model:e,defaultPos:t,channel:n,scaleName:i,scale:o}){const{markDef:l,config:u}=e;return()=>{const c=(0,r.getMainRangeChannel)(n),d=(0,r.getVgPositionChannel)(n),p=(0,a.getMarkPropOrConfig)(n,l,u,{vgChannel:d});if(void 0!==p)return s.widthHeightValueOrSignalRef(n,p);switch(t){case"zeroOrMin":return f({scaleName:i,scale:o,mode:"zeroOrMin",mainChannel:c,config:u});case"zeroOrMax":return f({scaleName:i,scale:o,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:c,config:u});case"mid":return{...e[(0,r.getSizeChannel)(n)],mult:.5}}}}function f({mainChannel:e,config:t,...n}){const r=(0,l.scaledZeroOrMinOrMax)(n),{mode:i}=n;if(r)return r;switch(e){case"radius":{if("zeroOrMin"===i)return{value:0};const{widthSignal:e,heightSignal:t}=i.zeroOrMax;return{signal:`min(${e},${t})/2`}}case"theta":return"zeroOrMin"===i?{value:0}:{signal:"2*PI"};case"x":return"zeroOrMin"===i?{value:0}:{field:{group:"width"}};case"y":return"zeroOrMin"===i?{field:{group:"height"}}:{value:0}}}},80261:(e,t,n)=>{"use strict";n.r(t),n.d(t,{pointOrRangePosition:()=>f,position2Ref:()=>h,rangePosition:()=>p});var r=n(95290),i=n(79543),a=n(20916),o=n(75028),s=n(15058),l=n(43301),u=n(9513),c=n(47274),d=n(42104);function f(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?p(e,t,{defaultPos:n,defaultPos2:r}):(0,c.pointPosition)(e,t,{defaultPos:n})}function p(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:a,config:o}=t,d=(0,r.getSecondaryRangeChannel)(e),f=(0,r.getSizeChannel)(e),p=function(e,t,n){const{encoding:i,mark:a,markDef:o,stack:u,config:d}=e,f=(0,r.getMainRangeChannel)(n),p=(0,r.getSizeChannel)(n),m=(0,r.getVgPositionChannel)(n),y=i[f],v=e.scaleName(f),b=e.getScaleComponent(f),{offset:w}=n in i||n in o?(0,l.positionOffset)({channel:n,markDef:o,encoding:i,model:e}):(0,l.positionOffset)({channel:f,markDef:o,encoding:i,model:e});if(!y&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const t=(0,r.getSizeChannel)(n),i=e.markDef[t];return null!=i?{[t]:{value:i}}:{[m]:{field:e.getName(n)}}}const x=h({channel:n,channelDef:y,channel2Def:i[n],markDef:o,config:d,scaleName:v,scale:b,stack:u,offset:w,defaultRef:void 0});return void 0!==x?{[m]:x}:g(n,o)||g(n,{[n]:(0,s.getMarkStyleConfig)(n,o,d.style),[p]:(0,s.getMarkStyleConfig)(p,o,d.style)})||g(n,d[a])||g(n,d.mark)||{[m]:(0,c.pointPositionDefaultRef)({model:e,defaultPos:t,channel:n,scaleName:v,scale:b})()}}(t,i,d),m=p[f]?(0,u.vgAlignedPositionChannel)(e,a,o):(0,r.getVgPositionChannel)(e);return{...(0,c.pointPosition)(e,t,{defaultPos:n,vgChannel:m}),...p}}function h({channel:e,channelDef:t,channel2Def:n,markDef:r,config:a,scaleName:o,scale:s,stack:l,offset:u,defaultRef:c}){return(0,i.isFieldOrDatumDef)(t)&&l&&e.charAt(0)===l.fieldChannel.charAt(0)?d.valueRefForFieldOrDatumDef(t,o,{suffix:"start"},{offset:u}):d.midPointRefWithPositionInvalidTest({channel:e,channelDef:n,scaleName:o,scale:s,stack:l,markDef:r,config:a,offset:u,defaultRef:c})}function g(e,t){const n=(0,r.getSizeChannel)(e),i=(0,r.getVgPositionChannel)(e);if(void 0!==t[i])return{[i]:d.widthHeightValueOrSignalRef(e,t[i])};if(void 0!==t[e])return{[i]:d.widthHeightValueOrSignalRef(e,t[e])};if(t[n]){const r=t[n];if(!(0,o.isRelativeBandSize)(r))return{[n]:d.widthHeightValueOrSignalRef(e,r)};a.warn(a.message.relativeBandSizeNotSupported(n))}}},24900:(e,t,n)=>{"use strict";n.r(t),n.d(t,{rectPosition:()=>x});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(24007),l=n(20916),u=n(75028),c=n(31179),d=n(5711),f=n(15058),p=n(34796),h=n(43301),g=n(9513),m=n(47274),y=n(80261),v=n(42104),b=n(79989),w=n(62277);function x(e,t){const{config:n,encoding:s,markDef:b}=e,w=b.type,x=(0,a.getSecondaryRangeChannel)(t),A=(0,a.getSizeChannel)(t),C=s[t],T=s[x],k=e.getScaleComponent(t),R=k?k.get("type"):void 0,D=b.orient,O=s[A]??s.size??(0,f.getMarkPropOrConfig)("size",b,n,{vgChannel:A}),N=(0,a.getOffsetChannel)(t),F="bar"===w&&("x"===t?"vertical"===D:"horizontal"===D)||"tick"===w&&("y"===t?"vertical"===D:"horizontal"===D);return!(0,o.isFieldDef)(C)||!((0,i.isBinning)(C.bin)||(0,i.isBinned)(C.bin)||C.timeUnit&&!T)||O&&!(0,u.isRelativeBandSize)(O)||s[N]||(0,c.hasDiscreteDomain)(R)?((0,o.isFieldOrDatumDef)(C)&&(0,c.hasDiscreteDomain)(R)||F)&&!T?function(e,t,n){const{markDef:i,encoding:s,config:c,stack:y}=n,b=i.orient,w=n.scaleName(t),x=n.getScaleComponent(t),S=(0,a.getSizeChannel)(t),_=(0,a.getSecondaryRangeChannel)(t),A=(0,a.getOffsetChannel)(t),C=n.scaleName(A),T=n.getScaleComponent((0,a.getOffsetScaleChannel)(t)),k="tick"===i.type||"horizontal"===b&&"y"===t||"vertical"===b&&"x"===t;let R;(s.size||i.size)&&(k?R=(0,p.nonPosition)("size",n,{vgChannel:S,defaultRef:(0,f.signalOrValueRef)(i.size)}):l.warn(l.message.cannotApplySizeToNonOrientedMark(i.type)));const D=!!R,O=(0,o.getBandSize)({channel:t,fieldDef:e,markDef:i,config:c,scaleType:(x||T)?.get("type"),useVlSizeChannel:k});R=R||{[S]:E(S,C||w,T||x,c,O,!!e,i.type)};const N="band"===(x||T)?.get("type")&&(0,u.isRelativeBandSize)(O)&&!D?"top":"middle",F=(0,g.vgAlignedPositionChannel)(t,i,c,N),P="xc"===F||"yc"===F,{offset:M,offsetType:I}=(0,h.positionOffset)({channel:t,markDef:i,encoding:s,model:n,bandPosition:P?.5:0}),$=v.midPointRefWithPositionInvalidTest({channel:t,channelDef:e,markDef:i,config:c,scaleName:w,scale:x,stack:y,offset:M,defaultRef:(0,m.pointPositionDefaultRef)({model:n,defaultPos:"mid",channel:t,scaleName:w,scale:x}),bandPosition:P?"encoding"===I?0:.5:(0,d.isSignalRef)(O)?{signal:`(1-${O})/2`}:(0,u.isRelativeBandSize)(O)?(1-O.band)/2:0});if(S)return{[F]:$,...R};{const e=(0,a.getVgPositionChannel)(_),t=R[S],n=M?{...t,offset:M}:t;return{[F]:$,[e]:(0,r.isArray)($)?[$[0],{...$[1],offset:n}]:{...$,offset:n}}}}(C,t,e):(0,y.rangePosition)(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function({fieldDef:e,fieldDef2:t,channel:n,model:r}){const{config:s,markDef:c,encoding:p}=r,g=r.getScaleComponent(n),m=r.scaleName(n),y=g?g.get("type"):void 0,b=g.get("reverse"),w=(0,o.getBandSize)({channel:n,fieldDef:e,markDef:c,config:s,scaleType:y}),x=r.component.axes[n]?.[0],E=x?.get("translate")??.5,A=(0,a.isXorY)(n)?(0,f.getMarkPropOrConfig)("binSpacing",c,s)??0:0,C=(0,a.getSecondaryRangeChannel)(n),T=(0,a.getVgPositionChannel)(n),k=(0,a.getVgPositionChannel)(C),R=(0,f.getMarkConfig)("minBandSize",c,s),{offset:D}=(0,h.positionOffset)({channel:n,markDef:c,encoding:p,model:r,bandPosition:0}),{offset:O}=(0,h.positionOffset)({channel:C,markDef:c,encoding:p,model:r,bandPosition:0}),N=v.binSizeExpr({fieldDef:e,scaleName:m}),F=S(n,A,b,E,D,R,N),P=S(C,A,b,E,O??D,R,N),M=(0,d.isSignalRef)(w)?{signal:`(1-${w.signal})/2`}:(0,u.isRelativeBandSize)(w)?(1-w.band)/2:.5,I=(0,o.getBandPosition)({fieldDef:e,fieldDef2:t,markDef:c,config:s});if((0,i.isBinning)(e.bin)||e.timeUnit){const t=e.timeUnit&&.5!==I;return{[k]:_({fieldDef:e,scaleName:m,bandPosition:M,offset:P,useRectOffsetField:t}),[T]:_({fieldDef:e,scaleName:m,bandPosition:(0,d.isSignalRef)(M)?{signal:`1-${M.signal}`}:1-M,offset:F,useRectOffsetField:t})}}if((0,i.isBinned)(e.bin)){const n=v.valueRefForFieldOrDatumDef(e,m,{},{offset:P});if((0,o.isFieldDef)(t))return{[k]:n,[T]:v.valueRefForFieldOrDatumDef(t,m,{},{offset:F})};if((0,i.isBinParams)(e.bin)&&e.bin.step)return{[k]:n,[T]:{signal:`scale("${m}", ${(0,o.vgField)(e,{expr:"datum"})} + ${e.bin.step})`,offset:F}}}l.warn(l.message.channelRequiredForBinned(C))}({fieldDef:C,fieldDef2:T,channel:t,model:e})}function E(e,t,n,i,a,o,c){if((0,u.isRelativeBandSize)(a)){if(!n)return{mult:a.band,field:{group:e}};{const e=n.get("type");if("band"===e){let e=`bandwidth('${t}')`;1!==a.band&&(e=`${a.band} * ${e}`);const n=(0,f.getMarkConfig)("minBandSize",{type:c},i);return{signal:n?`max(${(0,f.signalOrStringValue)(n)}, ${e})`:e}}1!==a.band&&(l.warn(l.message.cannotUseRelativeBandSizeWithNonBandScale(e)),a=void 0)}}else{if((0,d.isSignalRef)(a))return a;if(a)return{value:a}}if(n){const e=n.get("range");if((0,d.isVgRangeStep)(e)&&(0,r.isNumber)(e.step))return{value:e.step-2}}if(!o){const{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:a,tickBandPaddingInner:o}=i.scale,s=(0,b.getFirstDefined)(t,"tick"===c?o:"bar"===c?n:a);if((0,d.isSignalRef)(s))return{signal:`(1 - (${s.signal})) * ${e}`};if((0,r.isNumber)(s))return{signal:`${1-s} * ${e}`}}return{value:(0,s.getViewConfigDiscreteStep)(i.view,e)-2}}function S(e,t,n,r,i,o,s){if((0,a.isPolarPositionChannel)(e))return 0;const l="x"===e||"y2"===e,u=l?-t/2:t/2;if((0,d.isSignalRef)(n)||(0,d.isSignalRef)(i)||(0,d.isSignalRef)(r)||o){const e=(0,f.signalOrStringValue)(n),t=(0,f.signalOrStringValue)(i),a=(0,f.signalOrStringValue)(r),c=(0,f.signalOrStringValue)(o),d=o?`(${s} < ${c} ? ${l?"":"-"}0.5 * (${c} - (${s})) : ${u})`:u;return{signal:(a?`${a} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${d})`:d)}}return i=i||0,r+(n?-i-u:+i+u)}function _({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return v.interpolatedSignalRef({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:w.OFFSETTED_RECT_START_SUFFIX,endSuffix:w.OFFSETTED_RECT_END_SUFFIX}:{}})}},71390:(e,t,n)=>{"use strict";function r({scaleName:e,scale:t,mode:n}){const r=`domain('${e}')`;if(!t||!e)return;const i=`${r}[0]`,a=`peek(${r})`,o=t.domainHasZero();return"definitely"===o?{scale:e,value:0}:"maybe"===o?{signal:`scale('${e}', inrange(0, ${r}) ? 0 : ${"zeroOrMin"===n?i:a})`}:{signal:`scale('${e}', ${"zeroOrMin"===n?i:a})`}}n.r(t),n.d(t,{scaledZeroOrMinOrMax:()=>r})},22449:(e,t,n)=>{"use strict";n.r(t),n.d(t,{text:()=>s,textRef:()=>l});var r=n(79543),i=n(15058),a=n(6032),o=n(49144);function s(e,t="text"){const n=e.encoding[t];return(0,o.wrapCondition)({model:e,channelDef:n,vgChannel:t,mainRefFn:t=>l(t,e.config),invalidValueRef:void 0})}function l(e,t,n="datum"){if(e){if((0,r.isValueDef)(e))return(0,i.signalOrValueRef)(e.value);if((0,r.isFieldOrDatumDef)(e)){const{format:i,formatType:o}=(0,r.getFormatMixins)(e);return(0,a.formatSignalRef)({fieldOrDatumDef:e,format:i,formatType:o,expr:n,config:t})}}}},14607:(e,t,n)=>{"use strict";n.r(t),n.d(t,{tooltip:()=>h,tooltipData:()=>g,tooltipRefForEncoding:()=>m});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(98348),l=n(79989),u=n(5711),c=n(15058),d=n(6032),f=n(49144),p=n(22449);function h(e,t={}){const{encoding:n,markDef:i,config:a,stack:o}=e,s=n.tooltip;if((0,r.isArray)(s))return{tooltip:m({tooltip:s},o,a,t)};{const l=t.reactiveGeom?"datum.datum":"datum",d=e=>{const s=(0,p.textRef)(e,a,l);if(s)return s;if(null===e)return;let d=(0,c.getMarkPropOrConfig)("tooltip",i,a);return!0===d&&(d={content:"encoding"}),(0,r.isString)(d)?{value:d}:(0,r.isObject)(d)?(0,u.isSignalRef)(d)?d:"encoding"===d.content?m(n,o,a,t):{signal:l}:void 0};return(0,f.wrapCondition)({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:d,invalidValueRef:void 0})}}function g(e,t,n,{reactiveGeom:l}={}){const u={...n,...n.tooltipFormat},c=new Set,f=l?"datum.datum":"datum",h=[];function g(n,s){const l=(0,a.getMainRangeChannel)(s),g=(0,o.isTypedFieldDef)(n)?n:{...n,type:e[l].type},m=g.title||(0,o.defaultTitle)(g,u),y=(0,r.array)(m).join(", ").replaceAll(/"/g,'\\"');let v;if((0,a.isXorY)(s)){const t="x"===s?"x2":"y2",n=(0,o.getFieldDef)(e[t]);if((0,i.isBinned)(g.bin)&&n){const e=(0,o.vgField)(g,{expr:f}),r=(0,o.vgField)(n,{expr:f}),{format:i,formatType:a}=(0,o.getFormatMixins)(g);v=(0,d.binFormatExpression)(e,r,i,a,u),c.add(t)}}if(((0,a.isXorY)(s)||s===a.THETA||s===a.RADIUS)&&t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=(0,o.getFormatMixins)(g);v=(0,d.formatSignalRef)({fieldOrDatumDef:g,format:e,formatType:t,expr:f,config:u,normalizeStack:!0}).signal}v??(v=(0,p.textRef)(g,u,f).signal),h.push({channel:s,key:y,value:v})}(0,s.forEach)(e,((e,t)=>{(0,o.isFieldDef)(e)?g(e,t):(0,o.hasConditionalFieldDef)(e)&&g(e.condition,t)}));const m={};for(const{channel:e,key:t,value:n}of h)c.has(e)||m[t]||(m[t]=n);return m}function m(e,t,n,{reactiveGeom:r}={}){const i=g(e,t,n,{reactiveGeom:r}),a=(0,l.entries)(i).map((([e,t])=>`"${e}": ${t}`));return a.length>0?{signal:`{${a.join(", ")}}`}:void 0}},42104:(e,t,n)=>{"use strict";n.r(t),n.d(t,{binSizeExpr:()=>w,datumDefToExpr:()=>y,interpolatedSignalRef:()=>b,midPoint:()=>x,midPointRefWithPositionInvalidTest:()=>m,valueRefForFieldOrDatumDef:()=>v,widthHeightValueOrSignalRef:()=>E});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(20032),l=n(3802),u=n(20916),c=n(31179),d=n(99273),f=n(79989),p=n(5711),h=n(15058),g=n(91463);function m(e){const{channel:t,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=e,l=(0,a.getMainRangeChannel)(t),u=x(e),c=(0,g.getConditionalValueRefForIncludingInvalidValue)({scaleChannel:l,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return void 0!==c?[c,u]:u}function y(e){const{datum:t}=e;return(0,s.isDateTime)(t)?(0,s.dateTimeToExpr)(t):`${(0,f.stringify)(t)}`}function v(e,t,n,r){const i={};if(t&&(i.scale=t),(0,o.isDatumDef)(e)){const{datum:t}=e;(0,s.isDateTime)(t)?i.signal=(0,s.dateTimeToExpr)(t):(0,p.isSignalRef)(t)?i.signal=t.signal:(0,l.isExprRef)(t)?i.signal=t.expr:i.value=t}else i.field=(0,o.vgField)(e,n);if(r){const{offset:e,band:t}=r;e&&(i.offset=e),t&&(i.band=t)}return i}function b({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:a="end",bandPosition:s=.5}){const l=!(0,p.isSignalRef)(s)&&0{"use strict";n.r(t),n.d(t,{zindex:()=>s});var r=n(79543),i=n(75028),a=n(15058),o=n(49144);function s(e){const{encoding:t,mark:n}=e,s=t.order;return!(0,i.isPathMark)(n)&&(0,r.isValueDef)(s)?(0,o.wrapCondition)({model:e,channelDef:s,vgChannel:"zindex",mainRefFn:e=>(0,a.signalOrValueRef)(e.value),invalidValueRef:void 0}):{}}},98363:(e,t,n)=>{"use strict";n.r(t),n.d(t,{geoshape:()=>o});var r=n(79543),i=n(99273),a=n(55792);const o={vgMark:"shape",encodeEntry:e=>({...a.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&(0,r.isFieldDef)(n)&&n.type===i.GEOJSON?{field:(0,r.vgField)(n,{expr:"datum"})}:{}}]}}},24812:(e,t,n)=>{"use strict";n.r(t),n.d(t,{image:()=>i});var r=n(55792);const i={vgMark:"image",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...r.rectPosition(e,"x"),...r.rectPosition(e,"y"),...r.text(e,"url")})}},55823:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultFilled:()=>p,initMarkdef:()=>f});var r=n(19664),i=n(79543),a=n(98348),o=n(3802),s=n(20916),l=n(75028),u=n(99273),c=n(79989),d=n(15058);function f(e,t,n){const f=(0,o.replaceExprRef)(e),p=(0,d.getMarkPropOrConfig)("orient",f,n);if(f.orient=function(e,t,n){switch(e){case l.POINT:case l.CIRCLE:case l.SQUARE:case l.TEXT:case l.RECT:case l.IMAGE:return}const{x:a,y:o,x2:s,y2:c}=t;switch(e){case l.BAR:if((0,i.isFieldDef)(a)&&((0,r.isBinned)(a.bin)||(0,i.isFieldDef)(o)&&o.aggregate&&!a.aggregate))return"vertical";if((0,i.isFieldDef)(o)&&((0,r.isBinned)(o.bin)||(0,i.isFieldDef)(a)&&a.aggregate&&!o.aggregate))return"horizontal";if(c||s){if(n)return n;if(!s)return((0,i.isFieldDef)(a)&&a.type===u.QUANTITATIVE&&!(0,r.isBinning)(a.bin)||(0,i.isNumericDataDef)(a))&&(0,i.isFieldDef)(o)&&(0,r.isBinned)(o.bin)?"horizontal":"vertical";if(!c)return((0,i.isFieldDef)(o)&&o.type===u.QUANTITATIVE&&!(0,r.isBinning)(o.bin)||(0,i.isNumericDataDef)(o))&&(0,i.isFieldDef)(a)&&(0,r.isBinned)(a.bin)?"vertical":"horizontal"}case l.RULE:if(s&&(!(0,i.isFieldDef)(a)||!(0,r.isBinned)(a.bin))&&c&&(!(0,i.isFieldDef)(o)||!(0,r.isBinned)(o.bin)))return;case l.AREA:if(c)return(0,i.isFieldDef)(o)&&(0,r.isBinned)(o.bin)?"horizontal":"vertical";if(s)return(0,i.isFieldDef)(a)&&(0,r.isBinned)(a.bin)?"vertical":"horizontal";if(e===l.RULE){if(a&&!o)return"vertical";if(o&&!a)return"horizontal"}case l.LINE:case l.TICK:{const t=(0,i.isUnbinnedQuantitativeFieldOrDatumDef)(a),r=(0,i.isUnbinnedQuantitativeFieldOrDatumDef)(o);if(n)return n;if(t&&!r)return"tick"!==e?"horizontal":"vertical";if(!t&&r)return"tick"!==e?"vertical":"horizontal";if(t&&r)return"vertical";{const e=(0,i.isTypedFieldDef)(a)&&a.type===u.TEMPORAL,t=(0,i.isTypedFieldDef)(o)&&o.type===u.TEMPORAL;if(e&&!t)return"vertical";if(!e&&t)return"horizontal"}return}}return"vertical"}(f.type,t,p),void 0!==p&&p!==f.orient&&s.warn(s.message.orientOverridden(f.orient,p)),"bar"===f.type&&f.orient){const e=(0,d.getMarkPropOrConfig)("cornerRadiusEnd",f,n);if(void 0!==e){const n="horizontal"===f.orient&&t.x2||"vertical"===f.orient&&t.y2?["cornerRadius"]:l.BAR_CORNER_RADIUS_INDEX[f.orient];for(const t of n)f[t]=e;void 0!==f.cornerRadiusEnd&&delete f.cornerRadiusEnd}}const h=(0,d.getMarkPropOrConfig)("opacity",f,n),g=(0,d.getMarkPropOrConfig)("fillOpacity",f,n);return void 0===h&&void 0===g&&(f.opacity=function(e,t){if((0,c.contains)([l.POINT,l.TICK,l.CIRCLE,l.SQUARE],e)&&!(0,a.isAggregate)(t))return.7}(f.type,t)),void 0===(0,d.getMarkPropOrConfig)("cursor",f,n)&&(f.cursor=function(e,t,n){return t.href||e.href||(0,d.getMarkPropOrConfig)("href",e,n)?"pointer":e.cursor}(f,t,n)),f}function p(e,t,{graticule:n}){if(n)return!1;const r=(0,d.getMarkConfig)("filled",e,t),i=e.type;return(0,c.getFirstDefined)(r,i!==l.POINT&&i!==l.LINE&&i!==l.RULE)}},99519:(e,t,n)=>{"use strict";n.r(t),n.d(t,{line:()=>i,trail:()=>a});var r=n(55792);const i={vgMark:"line",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...r.pointPosition("x",e,{defaultPos:"mid"}),...r.pointPosition("y",e,{defaultPos:"mid"}),...r.nonPosition("size",e,{vgChannel:"strokeWidth"}),...r.defined(e)})},a={vgMark:"trail",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...r.pointPosition("x",e,{defaultPos:"mid"}),...r.pointPosition("y",e,{defaultPos:"mid"}),...r.nonPosition("size",e),...r.defined(e)})}},60288:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getSort:()=>C,parseMarkGroups:()=>S});var r=n(26372),i=n(79543),a=n(89081),o=n(98348),s=n(75028),l=n(79989),u=n(5711),c=n(15058),d=n(56017),f=n(26052),p=n(47880),h=n(98363),g=n(24812),m=n(99519),y=n(91539),v=n(69895),b=n(95035),w=n(8674),x=n(48116);const E={arc:d.arc,area:f.area,bar:p.bar,circle:y.circle,geoshape:h.geoshape,image:g.image,line:m.line,point:y.point,rect:v.rect,rule:b.rule,square:y.square,text:w.text,tick:x.tick,trail:m.trail};function S(e){if((0,l.contains)([s.LINE,s.AREA,s.TRAIL],e.mark)){const t=(0,o.pathGroupingFields)(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:_+e.requestDataName(a.DataSourceType.Main),data:e.requestDataName(a.DataSourceType.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:T(e,{fromPrefix:_})}]}(e,t)}else if(e.mark===s.BAR){const t=u.VG_CORNERRADIUS_CHANNELS.some((t=>(0,c.getMarkPropOrConfig)(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=T(e,{fromPrefix:A}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),o=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let s,d;"x"===e.stack.fieldChannel?(s={...(0,l.pick)(t.encode.update,["y","yc","y2","height",...u.VG_CORNERRADIUS_CHANNELS]),x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}},d={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...(0,l.omit)(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...(0,l.pick)(t.encode.update,["x","xc","x2","width"]),y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}},d={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...(0,l.omit)(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const n of u.VG_CORNERRADIUS_CHANNELS){const r=(0,c.getMarkConfig)(n,e.markDef,e.config);t.encode.update[n]?(s[n]=t.encode.update[n],delete t.encode.update[n]):r&&(s[n]=(0,c.signalOrValueRef)(r)),r&&(t.encode.update[n]={value:0})}const f=[];if(e.stack.groupbyChannels?.length>0)for(const t of e.stack.groupbyChannels){const n=e.fieldDef(t),r=(0,i.vgField)(n);r&&f.push(r),(n?.bin||n?.timeUnit)&&f.push((0,i.vgField)(n,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return{...n,[r]:t.encode.update[r]};{const t=(0,c.getMarkConfig)(r,e.markDef,e.config);return void 0!==t?{...n,[r]:(0,c.signalOrValueRef)(t)}:n}}),s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(a.DataSourceType.Main),name:A+e.requestDataName(a.DataSourceType.Main),groupby:f,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:d},marks:[t]}]}]}(e)}return T(e)}const _="faceted_path_",A="stack_group_";function C(e){const{encoding:t,stack:n,mark:a,markDef:o,config:u}=e,d=t.order;if(!(!(0,r.isArray)(d)&&(0,i.isValueDef)(d)&&(0,l.isNullOrFalse)(d.value)||!d&&(0,l.isNullOrFalse)((0,c.getMarkPropOrConfig)("order",o,u)))){if(((0,r.isArray)(d)||(0,i.isFieldDef)(d))&&!n)return(0,c.sortParams)(d,{expr:"datum"});if((0,s.isPathMark)(a)){const e="horizontal"===o.orient?"y":"x",n=t[e];if((0,i.isFieldDef)(n))return{field:e}}}}function T(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=(0,l.getFirstDefined)(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!(!t?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),u=(0,c.getStyles)(r),d=i.key,f=C(e),p=function(e){if(!e.component.selection)return null;const t=(0,l.keys)(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=(0,l.keys)(r.component.selection).length,r=r.parent;return n?{interactive:t>0||"geoshape"===e.mark||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}(e),h=(0,c.getMarkPropOrConfig)("aria",r,o),g=E[n].postEncodingTransform?E[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:E[n].vgMark,...s?{clip:s}:{},...u?{style:u}:{},...d?{key:d.field}:{},...f?{sort:f}:{},...p||{},...!1===h?{aria:h}:{},from:{data:t.fromPrefix+e.requestDataName(a.DataSourceType.Main)},encode:{update:E[n].encodeEntry(e)},...g?{transform:g}:{}}]}},91539:(e,t,n)=>{"use strict";n.r(t),n.d(t,{circle:()=>s,point:()=>o,shapeMixins:()=>a,square:()=>l});var r=n(55792);function i(e,t){const{config:n}=e;return{...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...r.pointPosition("x",e,{defaultPos:"mid"}),...r.pointPosition("y",e,{defaultPos:"mid"}),...r.nonPosition("size",e),...r.nonPosition("angle",e),...a(e,0,t)}}function a(e,t,n){return n?{shape:{value:n}}:r.nonPosition("shape",e)}const o={vgMark:"symbol",encodeEntry:e=>i(e)},s={vgMark:"symbol",encodeEntry:e=>i(e,"circle")},l={vgMark:"symbol",encodeEntry:e=>i(e,"square")}},69895:(e,t,n)=>{"use strict";n.r(t),n.d(t,{rect:()=>i});var r=n(55792);const i={vgMark:"rect",encodeEntry:e=>({...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...r.rectPosition(e,"x"),...r.rectPosition(e,"y")})}},95035:(e,t,n)=>{"use strict";n.r(t),n.d(t,{rule:()=>i});var r=n(55792);const i={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...r.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...r.pointOrRangePosition("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...r.pointOrRangePosition("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...r.nonPosition("size",e,{vgChannel:"strokeWidth"})}:{}}}},8674:(e,t,n)=>{"use strict";n.r(t),n.d(t,{text:()=>a});var r=n(15058),i=n(55792);const a={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...i.baseEncodeEntry(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...i.pointPosition("x",e,{defaultPos:"mid"}),...i.pointPosition("y",e,{defaultPos:"mid"}),...i.text(e),...i.nonPosition("size",e,{vgChannel:"fontSize"}),...i.nonPosition("angle",e),...i.valueIfDefined("align",o(e.markDef,0,t)),...i.valueIfDefined("baseline",s(e.markDef,0,t)),...i.pointPosition("radius",e,{defaultPos:null}),...i.pointPosition("theta",e,{defaultPos:null})}}};function o(e,t,n){if(void 0===(0,r.getMarkPropOrConfig)("align",e,n))return"center"}function s(e,t,n){if(void 0===(0,r.getMarkPropOrConfig)("baseline",e,n))return"middle"}},48116:(e,t,n)=>{"use strict";n.r(t),n.d(t,{tick:()=>a});var r=n(15058),i=n(55792);const a={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,a=n.orient,o="horizontal"===a?"x":"y",s="horizontal"===a?"y":"x",l="horizontal"===a?"height":"width";return{...i.baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...i.rectPosition(e,o),...i.pointPosition(s,e,{defaultPos:"mid",vgChannel:"y"===s?"yc":"xc"}),[l]:(0,r.signalOrValueRef)((0,r.getMarkPropOrConfig)("thickness",n,t))}}}},7302:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Model:()=>M,ModelWithField:()=>I,NameMap:()=>D,isConcatModel:()=>F,isFacetModel:()=>N,isLayerModel:()=>P,isUnitModel:()=>O});var r=n(95290),i=n(79543),a=n(89081),o=n(98348),s=n(3802),l=n(20916),u=n(31179),c=n(24777),d=n(89820),f=n(76447),p=n(65393),h=n(79989),g=n(5711),m=n(5593),y=n(15058),v=n(51885),b=n(10078),w=n(6871),x=n(19492),E=n(86985),S=n(16182),_=n(85013),A=n(98066),C=n(39276),T=n(63760),k=n(9021),R=n(96159);class D{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function O(e){return"unit"===e?.type}function N(e){return"facet"===e?.type}function F(e){return"concat"===e?.type}function P(e){return"layer"===e?.type}class M{constructor(e,t,n,r,i,a,o){this.type=t,this.parent=n,this.config=i,this.correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=(0,s.replaceExprRef)(o),this.name=e.name??r,this.title=(0,f.isText)(e.title)?{text:e.title}:e.title?(0,s.replaceExprRef)(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new D,this.projectionNameMap=n?n.projectionNameMap:new D,this.signalNameMap=n?n.signalNameMap:new D,this.data=e.data,this.description=e.description,this.transforms=(0,p.normalizeTransform)(e.transform??[]),this.layout="layer"===t||"unit"===t?{}:(0,d.extractCompositionLayout)(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:(0,c.isFacetSpec)(e)||n?.component.data.isFaceted&&void 0===e.data},layoutSize:new R.Split,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?(0,h.duplicate)(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(){(0,k.parseScales)(this)}parseProjection(){(0,A.parseProjection)(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){(0,S.parseLegend)(this)}assembleEncodeFromView(e){const{style:t,...n}=e,r={};for(const e of(0,h.keys)(n)){const t=n[e];void 0!==t&&(r[e]=(0,y.signalOrValueRef)(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=(0,y.signalOrValueRef)(this.description)),"unit"!==this.type&&"layer"!==this.type)?(0,h.isEmpty)(t)?void 0:t:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...t}}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:r}=this,i=(0,v.assembleLayoutTitleBand)(n.layoutHeaders,r);return{padding:e,...this.assembleDefaultLayout(),...t,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of r.FACET_CHANNELS)e[n].title&&t.push((0,v.assembleTitleGroup)(this,n));for(const e of b.HEADER_CHANNELS)t=t.concat((0,v.assembleHeaderGroups)(this,e));return t}assembleAxes(){return(0,m.assembleAxes)(this.component.axes,this.config)}assembleLegends(){return(0,E.assembleLegends)(this)}assembleProjections(){return(0,_.assembleProjections)(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},n={...(0,f.extractTitleConfig)(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return(0,h.contains)(["unit","layer"],this.type)?(0,h.contains)(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),(0,h.isEmpty)(n)?void 0:n}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||N(this.parent)?(0,C.assembleScales)(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const a=this.assembleLegends();return a.length>0&&(t.legends=a),t}getName(e){return(0,h.varName)((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(a.DataSourceType[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(N(this.parent)){const t=(0,x.getSizeTypeFromLayoutSizeType)(e),n=(0,r.getPositionScaleChannel)(t),a=this.component.scales[n];if(a&&!a.merged){const e=a.get("type"),t=a.get("range");if((0,u.hasDiscreteDomain)(e)&&(0,g.isVgRangeStep)(t)){const e=a.get("name"),t=(0,T.assembleDomain)(this,n),r=(0,T.getFieldFromDomain)(t);if(r){const t=(0,i.vgField)({aggregate:"distinct",field:r},{expr:"datum"});return{signal:(0,w.sizeExpr)(e,a,t)}}return l.warn(l.message.unknownField(n)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):(0,r.isChannel)(e)&&(0,r.isScaleChannel)(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const t=this.getScaleComponent(e);return t?t.get("type"):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(l.message.selectionNotFound(t));return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((e=>e.hasOrientSignalRef()))||this.component.axes.y?.some((e=>e.hasOrientSignalRef()))}}class I extends M{vgField(e,t={}){const n=this.fieldDef(e);if(n)return(0,i.vgField)(n,t)}reduceFieldDef(e,t){return(0,o.reduce)(this.getMapping(),((t,n,r)=>{const a=(0,i.getFieldDef)(n);return a?e(t,a,r):t}),t)}forEachFieldDef(e,t){(0,o.forEach)(this.getMapping(),((t,n)=>{const r=(0,i.getFieldDef)(t);r&&e(r,n)}),t)}}},95370:(e,t,n)=>{"use strict";n.r(t),n.d(t,{expression:()=>s});var r=n(26372),i=n(4976),a=n(79989),o=n(83937);function s(e,t,n){return(0,a.logicalExpr)(t,(t=>(0,r.isString)(t)?t:(0,i.isSelectionPredicate)(t)?(0,o.parseSelectionPredicate)(e,t,n):(0,i.fieldFilterExpression)(t)))}},85013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleProjectionForModel:()=>l,assembleProjections:()=>o,assembleProjectionsForModelAndChildren:()=>s});var r=n(79989),i=n(5711),a=n(7302);function o(e){return(0,a.isLayerModel)(e)||(0,a.isConcatModel)(e)?s(e):l(e)}function s(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),l(e))}function l(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:a}=n;if(t.data){const o={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},s=t.data.reduce(((t,n)=>{const a=(0,i.isSignalRef)(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return(0,r.contains)(t,a)||t.push(a),t}),[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:a,size:o,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}return[{name:a,translate:{signal:"[width / 2, height / 2]"},...n}]}},51494:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ProjectionComponent:()=>i});var r=n(96159);class i extends r.Split{constructor(e,t,n,r){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}},98066:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseProjection:()=>p});var r=n(26372),i=n(95290),a=n(79543),o=n(89081),s=n(3802),l=n(15176),u=n(99273),c=n(79989),d=n(7302),f=n(51494);function p(e){e.component.projection=(0,d.isUnitModel)(e)?function(e){if(e.hasProjection){const t=(0,s.replaceExprRef)(e.specifiedProjection),n=!(t&&(null!=t.scale||null!=t.translate)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,l=n?function(e){const t=[],{encoding:n}=e;for(const r of[[i.LONGITUDE,i.LATITUDE],[i.LONGITUDE2,i.LATITUDE2]])((0,a.getFieldOrDatumDef)(n[r[0]])||(0,a.getFieldOrDatumDef)(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(i.SHAPE)&&e.typedFieldDef(i.SHAPE).type===u.GEOJSON&&t.push({signal:e.getName(`geojson_${t.length}`)}),0===t.length&&t.push(e.requestDataName(o.DataSourceType.Main)),t}(e):void 0,c=new f.ProjectionComponent(e.projectionName(!0),{...(0,s.replaceExprRef)(e.config.projection),...t},r,l);return c.get("type")||c.set("type","equalEarth",!1),c}}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)p(t);const n=(0,c.every)(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=(0,c.every)(l.PROJECTION_PROPERTIES,(n=>!(0,r.hasOwnProperty)(e.explicit,n)&&!(0,r.hasOwnProperty)(t.explicit,n)||!!((0,r.hasOwnProperty)(e.explicit,n)&&(0,r.hasOwnProperty)(t.explicit,n)&&(0,c.deepEqual)(e.get(n),t.get(n)))));if((0,c.deepEqual)(e.size,t.size)){if(n)return e;if((0,c.deepEqual)(e.explicit,{}))return t;if((0,c.deepEqual)(t.explicit,{}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new f.ProjectionComponent(n,t.specifiedProjection,t.size,(0,c.duplicate)(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}}(e)}},91387:(e,t,n)=>{"use strict";n.r(t),n.d(t,{defaultScaleResolve:()=>o,parseGuideResolve:()=>s});var r=n(95290),i=n(20916),a=n(7302);function o(e,t){if((0,a.isFacetModel)(t))return"theta"===e?"independent":"shared";if((0,a.isLayerModel)(t))return"shared";if((0,a.isConcatModel)(t))return(0,r.isXorY)(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function s(e,t){const n=e.scale[t],a=(0,r.isXorY)(t)?"axis":"legend";return"independent"===n?("shared"===e[a][t]&&i.warn(i.message.independentScaleMeansIndependentGuide(t)),"independent"):e[a][t]||"shared"}},39276:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleScaleRange:()=>f,assembleScales:()=>c,assembleScalesForModel:()=>d});var r=n(26372),i=n(95290),a=n(79989),o=n(5711),s=n(7302),l=n(52128),u=n(63760);function c(e){return(0,s.isLayerModel)(e)||(0,s.isConcatModel)(e)?e.children.reduce(((e,t)=>e.concat(c(t))),d(e)):d(e)}function d(e){return(0,a.keys)(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:a,type:o,selectionExtent:s,domains:c,range:d,reverse:p,...h}=i,g=f(i.range,a,n,e),m=(0,u.assembleDomain)(e,n),y=s?(0,l.assembleSelectionScaleDomain)(e,s,r,m):null;return t.push({name:a,type:o,...m?{domain:m}:{},...y?{domainRaw:y}:{},range:g,...void 0!==p?{reverse:p}:{},...h}),t}),[])}function f(e,t,n,a){if((0,i.isXorY)(n)){if((0,o.isVgRangeStep)(e))return{step:{signal:`${t}_step`}}}else if((0,r.isObject)(e)&&(0,o.isDataRefDomain)(e))return{...e,data:a.lookupDataSource(e.data)};return e}},39621:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ScaleComponent:()=>s});var r=n(26372),i=n(31179),a=n(79989),o=n(96159);class s extends o.Split{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainHasZero(){const e=this.get("type");if((0,a.contains)([i.ScaleType.LOG,i.ScaleType.TIME,i.ScaleType.UTC],e))return"definitely-not";const t=this.get("zero");if(!0===t||void 0===t&&(0,a.contains)([i.ScaleType.LINEAR,i.ScaleType.SQRT,i.ScaleType.POW],e))return"definitely";const n=this.get("domains");if(n.length>0){let e=!1,t=!1,i=!1;for(const a of n){if((0,r.isArray)(a)){const n=a[0],i=a[a.length-1];if((0,r.isNumber)(n)&&(0,r.isNumber)(i)){if(n<=0&&i>=0){e=!0;continue}t=!0;continue}}i=!0}if(e)return"definitely";if(t&&!i)return"definitely-not"}return"maybe"}}},63760:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleDomain:()=>I,canUseUnaggregatedDomain:()=>N,domainSort:()=>O,getFieldFromDomain:()=>M,mergeDomains:()=>P,parseDomainForChannel:()=>C,parseScaleDomain:()=>A});var r=n(26372),i=n(54814),a=n(19664),o=n(95290),s=n(79543),l=n(89081),u=n(20916),c=n(75028),d=n(31179),f=n(46681),p=n(96598),h=n(79989),g=n(5711),m=n(15058),y=n(89153),v=n(77524),b=n(80449),w=n(62277),x=n(37761),E=n(7302),S=n(77547),_=n(96159);function A(e){(0,E.isUnitModel)(e)?function(e){const t=e.component.scales;for(const n of h.keys(t)){const r=C(e,n);if(t[n].setWithExplicit("domains",r),D(e,n),e.component.data.isFaceted){let t=e;for(;!(0,E.isFacetModel)(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of r.value)(0,g.isDataRefDomain)(e)&&(e.data=b.FACET_SCALE_PREFIX+e.data.replace(b.FACET_SCALE_PREFIX,""))}}}(e):function(e){for(const t of e.children)A(t);const t=e.component.scales;for(const n of h.keys(t)){let r,i=null;for(const t of e.children){const e=t.component.scales[n];if(e){r=void 0===r?e.getWithExplicit("domains"):(0,_.mergeValuesWithExplicit)(r,e.getWithExplicit("domains"),"domains","scale",F);const t=e.get("selectionExtent");i&&t&&i.param!==t.param&&u.warn(u.message.NEEDS_SAME_SELECTION),i=t}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}(e)}function C(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=function(e,t,n,r){if("unaggregated"===e){const{valid:e,reason:r}=N(t,n);if(!e)return void u.warn(r)}else if(void 0===e&&r.useUnaggregatedDomain){const{valid:e}=N(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),"x"===t&&(0,s.getFieldOrDatumDef)(r.x2)?(0,s.getFieldOrDatumDef)(r.x)?(0,_.mergeValuesWithExplicit)(k(n,i,e,"x"),k(n,i,e,"x2"),"domain","scale",F):k(n,i,e,"x2"):"y"===t&&(0,s.getFieldOrDatumDef)(r.y2)?(0,s.getFieldOrDatumDef)(r.y)?(0,_.mergeValuesWithExplicit)(k(n,i,e,"y"),k(n,i,e,"y2"),"domain","scale",F):k(n,i,e,"y2"):k(n,i,e,t)}function T(e,t,n){const r=(0,p.normalizeTimeUnit)(n)?.unit;return"temporal"===t||r?function(e,t,n){return e.map((e=>({signal:`{data: ${(0,s.valueExpr)(e,{timeUnit:n,type:t})}}`})))}(e,t,r):[e]}function k(e,t,n,i){const{encoding:u,markDef:f,mark:p,config:v,stack:b}=n,E=(0,s.getFieldOrDatumDef)(u[i]),{type:A}=E,C=E.timeUnit,R=(0,x.getScaleDataSourceForHandlingInvalidValues)({invalid:(0,m.getMarkConfig)("invalid",f,v),isPath:(0,c.isPathMark)(p)});if((0,d.isDomainUnionWith)(t)){const r=k(e,void 0,n,i),a=T(t.unionWith,A,C);return(0,_.makeExplicit)([...a,...r.value])}if((0,g.isSignalRef)(t))return(0,_.makeExplicit)([t]);if(t&&"unaggregated"!==t&&!(0,d.isParameterDomain)(t))return(0,_.makeExplicit)(T(t,A,C));if(b&&i===b.fieldChannel){if("normalize"===b.offset)return(0,_.makeImplicit)([[0,1]]);const e=n.requestDataName(R);return(0,_.makeImplicit)([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const D=(0,o.isScaleChannel)(i)&&(0,s.isFieldDef)(E)?O(n,i,e):void 0;if((0,s.isDatumDef)(E)){const e=T([E.datum],A,C);return(0,_.makeImplicit)(e)}const N=E;if("unaggregated"===t){const{field:e}=E;return(0,_.makeImplicit)([{data:n.requestDataName(R),field:(0,s.vgField)({field:e,aggregate:"min"})},{data:n.requestDataName(R),field:(0,s.vgField)({field:e,aggregate:"max"})}])}if((0,a.isBinning)(N.bin)){if((0,d.hasDiscreteDomain)(e))return"bin-ordinal"===e?(0,_.makeImplicit)([]):(0,_.makeImplicit)([{data:h.isBoolean(D)?n.requestDataName(R):n.requestDataName(l.DataSourceType.Raw),field:n.vgField(i,(0,s.binRequiresRange)(N,i)?{binSuffix:"range"}:{}),sort:!0!==D&&(0,r.isObject)(D)?D:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=N;if((0,a.isBinning)(e)){const t=(0,y.getBinSignalName)(n,N.field,e);return(0,_.makeImplicit)([new S.SignalRefWrapper((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return(0,_.makeImplicit)([{data:n.requestDataName(R),field:n.vgField(i,{})}])}}if(N.timeUnit&&h.contains(["time","utc"],e)){const e=u[(0,o.getSecondaryRangeChannel)(i)];if((0,s.hasBandEnd)(N,e,f,v)){const t=n.requestDataName(R),r=(0,s.getBandPosition)({fieldDef:N,fieldDef2:e,markDef:f,config:v}),a=(0,c.isRectBasedMark)(p)&&.5!==r&&(0,o.isXorY)(i);return(0,_.makeImplicit)([{data:t,field:n.vgField(i,a?{suffix:w.OFFSETTED_RECT_START_SUFFIX}:{})},{data:t,field:n.vgField(i,{suffix:a?w.OFFSETTED_RECT_END_SUFFIX:"end"})}])}}return D?(0,_.makeImplicit)([{data:h.isBoolean(D)?n.requestDataName(R):n.requestDataName(l.DataSourceType.Raw),field:n.vgField(i),sort:D}]):(0,_.makeImplicit)([{data:n.requestDataName(R),field:n.vgField(i)}])}function R(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":f.DEFAULT_SORT_OP),...r?{field:h.replacePathInField(r)}:{},...i?{order:i}:{}}}function D(e,t){const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,o=(0,d.isParameterDomain)(r)?r:void 0,s=(0,a.isBinParams)(i)&&(0,a.isParameterExtent)(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function O(e,t,n){if(!(0,d.hasDiscreteDomain)(n))return;const r=e.fieldDef(t),a=r.sort;if((0,f.isSortArray)(a))return{op:"min",field:(0,v.sortArrayIndexField)(r,t),order:"ascending"};const{stack:o}=e,l=o?new Set([...o.groupbyFields,...o.stackBy.map((e=>e.fieldDef.field))]):void 0;if((0,f.isSortField)(a))return R(a,o&&!l.has(a.field));if((0,f.isSortByEncoding)(a)){const{encoding:t,order:n}=a,r=e.fieldDef(t),{aggregate:u,field:c}=r,d=o&&!l.has(c);if((0,i.isArgminDef)(u)||(0,i.isArgmaxDef)(u))return R({field:(0,s.vgField)(r),order:n},d);if((0,i.isAggregateOp)(u)||!u)return R({op:u,field:c,order:n},d)}else{if("descending"===a)return{op:"min",field:e.vgField(t),order:"descending"};if(h.contains(["ascending",void 0],a))return!0}}function N(e,t){const{aggregate:n,type:a}=e;return n?(0,r.isString)(n)&&!i.SHARED_DOMAIN_OPS.has(n)?{valid:!1,reason:u.message.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===a&&"log"===t?{valid:!1,reason:u.message.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:u.message.unaggregateDomainHasNoEffectForRawField(e)}}function F(e,t,n,r){return e.explicit&&t.explicit&&u.warn(u.message.mergeConflictingDomainProperty(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function P(e){const t=h.unique(e.map((e=>{if((0,g.isDataRefDomain)(e)){const{sort:t,...n}=e;return n}return e})),h.hash),n=h.unique(e.map((e=>{if((0,g.isDataRefDomain)(e)){const t=e.sort;return void 0===t||h.isBoolean(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),h.hash);if(0===t.length)return;if(1===t.length){const t=e[0];if((0,g.isDataRefDomain)(t)&&n.length>0){let e=n[0];if(n.length>1){u.warn(u.message.MORE_THAN_ONE_SORT);const t=n.filter((e=>(0,r.isObject)(e)&&"op"in e&&"min"!==e.op));e=!n.every((e=>(0,r.isObject)(e)&&"op"in e))||1!==t.length||t[0]}else if((0,r.isObject)(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}const a=h.unique(n.map((e=>h.isBoolean(e)||!("op"in e)||(0,r.isString)(e.op)&&(0,r.hasOwnProperty)(i.MULTIDOMAIN_SORT_OP_INDEX,e.op)?e:(u.warn(u.message.domainSortDropped(e)),!0))),h.hash);let o;1===a.length?o=a[0]:a.length>1&&(u.warn(u.message.MORE_THAN_ONE_SORT),o=!0);const s=h.unique(e.map((e=>(0,g.isDataRefDomain)(e)?e.data:null)),(e=>e));return 1===s.length&&null!==s[0]?{data:s[0],fields:t.map((e=>e.field)),...o?{sort:o}:{}}:{fields:t,...o?{sort:o}:{}}}function M(e){if((0,g.isDataRefDomain)(e)&&(0,r.isString)(e.field))return e.field;if((0,g.isDataRefUnionedDomain)(e)){let t;for(const n of e.fields)if((0,g.isDataRefDomain)(n)&&(0,r.isString)(n.field))if(t){if(t!==n.field)return u.warn(u.message.FACETED_INDEPENDENT_DIFFERENT_SOURCES),t}else t=n.field;return u.warn(u.message.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES),t}if((0,g.isFieldRefUnionDomain)(e)){u.warn(u.message.FACETED_INDEPENDENT_SAME_SOURCE);const t=e.fields[0];return(0,r.isString)(t)?t:void 0}}function I(e,t){return P(e.component.scales[t].get("domains").map((t=>((0,g.isDataRefDomain)(t)&&(t.data=e.lookupDataSource(t.data)),t))))}},9021:(e,t,n)=>{"use strict";n.r(t),n.d(t,{parseScaleCore:()=>v,parseScales:()=>y});var r=n(95290),i=n(79543),a=n(98348),o=n(75028),s=n(31179),l=n(99273),u=n(79989),c=n(7302),d=n(91387),f=n(96159),p=n(39621),h=n(63760),g=n(70585),m=n(78540);function y(e,{ignoreRange:t}={}){v(e),(0,h.parseScaleDomain)(e);for(const t of s.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES)(0,g.parseScaleProperty)(e,t);t||(0,g.parseScaleRange)(e)}function v(e){(0,c.isUnitModel)(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:s}=e,u={};for(const c of r.SCALE_CHANNELS){const d=(0,i.getFieldOrDatumDef)(t[c]);if(d&&n===o.GEOSHAPE&&c===r.SHAPE&&d.type===l.GEOJSON)continue;let f=d&&d.scale;if(d&&null!==f&&!1!==f){f??(f={});const n=(0,a.channelHasNestedOffsetScale)(t,c),r=(0,m.scaleType)(f,c,d,s,n);u[c]=new p.ScaleComponent(e.scaleName(`${c}`,!0),{value:r,explicit:f.type===r})}}return u}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){v(n);for(const a of(0,u.keys)(n.component.scales))if((t=i.scale)[a]??(t[a]=(0,d.defaultScaleResolve)(a,e)),"shared"===i.scale[a]){const e=r[a],t=n.component.scales[a].getWithExplicit("type");e?(0,s.scaleCompatible)(e.value,t.value)?r[a]=(0,f.mergeValuesWithExplicit)(e,t,"type","scale",b):(i.scale[a]="independent",delete r[a]):r[a]=t}}for(const t of(0,u.keys)(r)){const i=e.scaleName(t,!0),a=r[t];n[t]=new p.ScaleComponent(i,a);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const b=(0,f.tieBreakByComparing)(((e,t)=>(0,s.scaleTypePrecedence)(e)-(0,s.scaleTypePrecedence)(t)))},70585:(e,t,n)=>{"use strict";n.r(t),n.d(t,{bins:()=>E,interpolate:()=>S,nice:()=>_,padding:()=>A,paddingInner:()=>C,paddingOuter:()=>T,parseNonUnitScaleProperty:()=>x,parseScaleProperty:()=>v,parseScaleRange:()=>w,reverse:()=>k,scaleRules:()=>b,zero:()=>R});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(20032),l=n(98348),u=n(20916),c=n(31179),d=n(79989),f=n(5711),p=n(89153),h=n(7302),g=n(77547),m=n(96159),y=n(76387);function v(e,t){(0,h.isUnitModel)(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:f,specifiedScales:p}=e;for(const h of(0,d.keys)(n)){const g=p[h],m=n[h],y=e.getScaleComponent(h),v=(0,o.getFieldOrDatumDef)(i[h]),w=g[t],x=y.get("type"),E=y.get("padding"),S=y.get("paddingInner"),_=(0,c.scaleTypeSupportProperty)(x,t),A=(0,c.channelScalePropertyIncompatability)(h,t);if(void 0!==w&&(_?A&&u.warn(A):u.warn(u.message.scalePropertyNotWorkWithScaleType(x,t,h))),_&&void 0===A)if(void 0!==w){const e=v.timeUnit,n=v.type;switch(t){case"domainMax":case"domainMin":(0,s.isDateTime)(g[t])||"temporal"===n||e?m.set(t,{signal:(0,o.valueExpr)(g[t],{type:n,timeUnit:e})},!0):m.set(t,g[t],!0);break;default:m.copyKeyFromObject(t,g)}}else{const n=d.hasProperty(b,t)?b[t]({model:e,channel:h,fieldOrDatumDef:v,scaleType:x,scalePadding:E,scalePaddingInner:S,domain:g.domain,domainMin:g.domainMin,domainMax:g.domainMax,markDef:f,config:r,hasNestedOffsetScale:(0,l.channelHasNestedOffsetScale)(i,h),hasSecondaryRangeChannel:!!i[(0,a.getSecondaryRangeChannel)(h)]}):r.scale[t];void 0!==n&&m.set(t,n,!1)}}}(e,t):x(e,t)}const b={bins:({model:e,fieldOrDatumDef:t})=>(0,o.isFieldDef)(t)?E(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>S(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:a})=>_(e,t,n,r,i,a),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>A(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:a})=>C(e,t,n.type,r,i.scale,a),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:a})=>T(e,t,n,r,i.scale,a),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>k(t,(0,o.isFieldDef)(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:a,hasSecondaryRangeChannel:o})=>R(e,t,n,r,i,a.scale,o)};function w(e){(0,h.isUnitModel)(e)?(0,y.parseUnitScaleRange)(e):x(e,"range")}function x(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?w(n):v(n,t);for(const r of(0,d.keys)(n)){let i;for(const n of e.children){const e=n.component.scales[r];if(e){const n=e.getWithExplicit(t);i=(0,m.mergeValuesWithExplicit)(i,n,t,"scale",(0,m.tieBreakByComparing)(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0)))}}n[r].setWithExplicit(t,i)}}function E(e,t){const n=t.bin;if((0,i.isBinning)(n)){const r=(0,p.getBinSignalName)(e,t.field,n);return new g.SignalRefWrapper((()=>e.getSignalName(r)))}if((0,i.isBinned)(n)&&(0,i.isBinParams)(n)&&void 0!==n.step)return{step:n.step}}function S(e,t){if((0,d.contains)([a.COLOR,a.FILL,a.STROKE],e)&&"nominal"!==t)return"hcl"}function _(e,t,n,i,s,l){if(!((0,o.getFieldDef)(l)?.bin||(0,r.isArray)(n)||null!=s||null!=i||d.contains([c.ScaleType.TIME,c.ScaleType.UTC],e)))return!!(0,a.isXorY)(t)||void 0}function A(e,t,n,r,i,s){if((0,a.isXorY)(e)){if((0,c.isContinuousToContinuous)(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!(0,o.isFieldDef)(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return s.continuousBandSize}if(t===c.ScaleType.POINT)return n.pointPadding}}function C(e,t,n,r,i,o=!1){if(void 0===e){if((0,a.isXorY)(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r,tickBandPaddingInner:a,bandWithNestedOffsetPaddingInner:s}=i;return o?s:(0,d.getFirstDefined)(e,"bar"===n?t:"tick"===n?a:r)}return(0,a.isXorYOffset)(t)&&r===c.ScaleType.BAND?i.offsetBandPaddingInner:void 0}}function T(e,t,n,r,i,o=!1){if(void 0===e)if((0,a.isXorY)(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=i;if(o)return t;if(n===c.ScaleType.BAND)return(0,d.getFirstDefined)(e,(0,f.isSignalRef)(r)?{signal:`${r.signal}/2`}:r/2)}else if((0,a.isXorYOffset)(t)){if(n===c.ScaleType.POINT)return.5;if(n===c.ScaleType.BAND)return i.offsetBandPaddingOuter}}function k(e,t,n,r){return"x"===n&&void 0!==r.xReverse?(0,c.hasContinuousDomain)(e)&&"descending"===t?(0,f.isSignalRef)(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse:!(!(0,c.hasContinuousDomain)(e)||"descending"!==t)||void 0}function R(e,t,n,i,s,l,u){if(n&&"unaggregated"!==n&&(0,c.hasContinuousDomain)(s)){if((0,r.isArray)(n)){const e=n[0],t=n[n.length-1];if((0,r.isNumber)(e)&&e<=0&&(0,r.isNumber)(t)&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!(0,c.isContinuousToDiscrete)(s))return!0;if((!(0,o.isFieldDef)(t)||!t.bin)&&d.contains([...a.POSITION_SCALE_CHANNELS,...a.POLAR_POSITION_SCALE_CHANNELS],e)){const{orient:t,type:n}=i;return(!(0,d.contains)(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e))&&(!(!(0,d.contains)(["bar","area"],n)||u)||l?.zero)}return!1}},76387:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MAX_SIZE_RANGE_STEP_RATIO:()=>N,RANGE_PROPERTIES:()=>E,defaultContinuousToDiscreteCount:()=>D,interpolateRange:()=>O,parseRangeForChannel:()=>A,parseUnitScaleRange:()=>S});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(24007),l=n(89081),u=n(98348),c=n(20916),d=n(31179),f=n(89820),p=n(99273),h=n(79989),g=n(5711),m=n(15058),y=n(89153),v=n(77547),b=n(96159),w=n(96598),x=n(7302);const E=["range","scheme"];function S(e){const t=e.component.scales;for(const n of a.SCALE_CHANNELS){const r=t[n];if(!r)continue;const i=A(n,e);r.setWithExplicit("range",i)}}function _(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:o,field:s}=n,l=(0,a.getSizeChannel)(t),u=e.getName(l);if((0,r.isObject)(o)&&o.binned&&void 0!==o.step)return new v.SignalRefWrapper((()=>{const n=e.scaleName(t),r=`(domain("${n}")[1] - domain("${n}")[0]) / ${o.step}`;return`${e.getSignalName(u)} / (${r})`}));if((0,i.isBinning)(o)){const t=(0,y.getBinSignalName)(e,s,o);return new v.SignalRefWrapper((()=>{const n=e.getSignalName(t),r=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(u)} / (${r})`}))}}}function A(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const i of E)if(void 0!==n[i]){const o=(0,d.scaleTypeSupportProperty)(s,i),f=(0,d.channelScalePropertyIncompatability)(e,i);if(o)if(f)c.warn(f);else switch(i){case"range":{const i=n.range;if((0,r.isArray)(i)){if((0,a.isXorY)(e))return(0,b.makeExplicit)(i.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return v.SignalRefWrapper.fromName(r,n)}return e})))}else if((0,r.isObject)(i))return(0,b.makeExplicit)({data:t.requestDataName(l.DataSourceType.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}});return(0,b.makeExplicit)(i)}case"scheme":return(0,b.makeExplicit)((u=n[i],(0,d.isExtendedScheme)(u)?{scheme:u.name,...h.omit(u,["name"])}:{scheme:u}))}else c.warn(c.message.scalePropertyNotWorkWithScaleType(s,i,e))}var u;const p=e===a.X||"xOffset"===e?"width":"height",m=i[p];if((0,f.isStep)(m))if((0,a.isXorY)(e))if((0,d.hasDiscreteDomain)(s)){const n=T(m,t,e);if(n)return(0,b.makeExplicit)({step:n})}else c.warn(c.message.stepDropped(p));else if((0,a.isXorYOffset)(e)){const n=e===a.XOFFSET?"x":"y";if("band"===t.getScaleComponent(n).get("type")){const e=k(m,s);if(e)return(0,b.makeExplicit)(e)}}const{rangeMin:y,rangeMax:S}=n,A=function(e,t){const{size:n,config:i,mark:s,encoding:l}=t,{type:u}=(0,o.getFieldOrDatumDef)(l[e]),p=t.getScaleComponent(e).get("type"),{domain:m,domainMid:y}=t.specifiedScales[e];switch(e){case a.X:case a.Y:if(h.contains(["point","band"],p)){const r=R(e,n,i.view);if((0,f.isStep)(r))return{step:T(r,t,e)}}return C(e,t,p);case a.XOFFSET:case a.YOFFSET:return function(e,t,n){const r=e===a.XOFFSET?"x":"y",i=t.getScaleComponent(r);if(!i)return C(r,t,n,{center:!0});const s=i.get("type"),l=t.scaleName(r),{markDef:u,config:c}=t;if("band"===s){const e=R(r,t.size,t.config.view);if((0,f.isStep)(e)){const t=k(e,n);if(t)return t}return[0,{signal:`bandwidth('${l}')`}]}{const n=t.encoding[r];if((0,o.isFieldDef)(n)&&n.timeUnit){const e=(0,w.durationExpr)(n.timeUnit,(e=>`scale('${l}', ${e})`)),r=t.config.scale.bandWithNestedOffsetPaddingInner,i=(0,o.getBandPosition)({fieldDef:n,markDef:u,config:c})-.5,a=0!==i?` + ${i}`:"";return r?[{signal:`${(0,g.isSignalRef)(r)?`${r.signal}/2`+a:`${r/2+i}`} * (${e})`},{signal:`${(0,g.isSignalRef)(r)?`(1 - ${r.signal}/2)`+a:`${1-r/2+i}`} * (${e})`}]:[0,{signal:e}]}return h.never(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}(e,t,p);case a.SIZE:{const a=function(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(c.message.incompatibleChannel("size",e))}(s,i),o=function(e,t,n,i){const a={x:_(n,"x"),y:_(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=F(t,a,i.view);return(0,r.isNumber)(e)?e-1:new v.SignalRefWrapper((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const e=F(t,a,i.view);return(0,r.isNumber)(e)?Math.pow(N*e,2):new v.SignalRefWrapper((()=>`pow(${N} * ${e.signal}, 2)`))}}throw new Error(c.message.incompatibleChannel("size",e))}(s,n,t,i);return(0,d.isContinuousToDiscrete)(p)?O(a,o,D(p,i,m,e)):[a,o]}case a.THETA:return[0,2*Math.PI];case a.ANGLE:return[0,360];case a.RADIUS:return[0,new v.SignalRefWrapper((()=>`min(${t.getSignalName((0,x.isFacetModel)(t.parent)?"child_width":"width")},${t.getSignalName((0,x.isFacetModel)(t.parent)?"child_height":"height")})/2`))];case a.STROKEWIDTH:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case a.STROKEDASH:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case a.SHAPE:return"symbol";case a.COLOR:case a.FILL:case a.STROKE:return"ordinal"===p?"nominal"===u?"category":"ordinal":void 0!==y?"diverging":"rect"===s||"geoshape"===s?"heatmap":"ramp";case a.OPACITY:case a.FILLOPACITY:case a.STROKEOPACITY:return[i.scale.minOpacity,i.scale.maxOpacity]}}(e,t);return(void 0!==y||void 0!==S)&&(0,d.scaleTypeSupportProperty)(s,"rangeMin")&&(0,r.isArray)(A)&&2===A.length?(0,b.makeExplicit)([y??A[0],S??A[1]]):(0,b.makeImplicit)(A)}function C(e,t,n,{center:r}={}){const i=(0,a.getSizeChannel)(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===a.Y&&(0,d.hasContinuousDomain)(n)?r?[v.SignalRefWrapper.fromName((e=>`${s(e)}/2`),o),v.SignalRefWrapper.fromName((e=>`-${s(e)}/2`),o)]:[v.SignalRefWrapper.fromName(s,o),0]:r?[v.SignalRefWrapper.fromName((e=>`-${s(e)}/2`),o),v.SignalRefWrapper.fromName((e=>`${s(e)}/2`),o)]:[0,v.SignalRefWrapper.fromName(s,o)]}function T(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),s=(0,a.getOffsetScaleChannel)(n),l=r[s];if("offset"===(0,f.getStepFor)({step:e,offsetIsDiscrete:(0,o.isFieldOrDatumDef)(l)&&(0,p.isDiscrete)(l.type)})&&(0,u.channelHasFieldOrDatum)(r,s)){const n=t.getScaleComponent(s);let r=`domain('${t.scaleName(s)}').length`;"band"===n.get("type")&&(r=`bandspace(${r}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`);const a=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${r} / (1-${(0,m.exprFromSignalRefOrValue)(a)})`}}return e.step}function k(e,t){if("offset"===(0,f.getStepFor)({step:e,offsetIsDiscrete:(0,d.hasDiscreteDomain)(t)}))return{step:e.step}}function R(e,t,n){const r=e===a.X?"width":"height";return t[r]||(0,s.getViewConfigDiscreteSize)(n,r)}function D(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&(0,r.isArray)(n)?n.length+1:(c.warn(c.message.domainRequiredForThresholdScale(i)),3)}}function O(e,t,n){const r=()=>{const r=(0,m.signalOrStringValue)(t),i=(0,m.signalOrStringValue)(e),a=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${a}, ${a})`};return(0,g.isSignalRef)(t)?new v.SignalRefWrapper(r):{signal:r()}}const N=.95;function F(e,t,n){const r=(0,f.isStep)(e.width)?e.width.step:(0,s.getViewConfigDiscreteStep)(n,"width"),i=(0,f.isStep)(e.height)?e.height.step:(0,s.getViewConfigDiscreteStep)(n,"height");return t.x||t.y?new v.SignalRefWrapper((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}},78540:(e,t,n)=>{"use strict";n.r(t),n.d(t,{scaleType:()=>d});var r=n(19664),i=n(95290),a=n(79543),o=n(20916),s=n(75028),l=n(31179),u=n(96598),c=n(79989);function d(e,t,n,d,f=!1){const p=function(e,t,n,l){switch(t.type){case"nominal":case"ordinal":{if((0,i.isColorChannel)(e)||"discrete"===(0,i.rangeType)(e))return"shape"===e&&"ordinal"===t.type&&o.warn(o.message.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if((0,i.isXorY)(e)||(0,i.isXorYOffset)(e)){if(c.contains(["rect","bar","image","rule","tick"],n.type))return"band";if(l)return"band"}else if("arc"===n.type&&e in i.POLAR_POSITION_SCALE_CHANNEL_INDEX)return"band";const r=n[(0,i.getSizeChannel)(e)];return(0,s.isRelativeBandSize)(r)||(0,a.isPositionFieldOrDatumDef)(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return(0,i.isColorChannel)(e)?"time":"discrete"===(0,i.rangeType)(e)?(o.warn(o.message.discreteChannelCannotEncode(e,"temporal")),"ordinal"):(0,a.isFieldDef)(t)&&t.timeUnit&&(0,u.normalizeTimeUnit)(t.timeUnit).utc?"utc":"time";case"quantitative":return(0,i.isColorChannel)(e)?(0,a.isFieldDef)(t)&&(0,r.isBinning)(t.bin)?"bin-ordinal":"linear":"discrete"===(0,i.rangeType)(e)?(o.warn(o.message.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(o.message.invalidFieldType(t.type))}(t,n,d,f),{type:h}=e;return(0,i.isScaleChannel)(t)?void 0!==h?(0,l.channelSupportScaleType)(t,h)?(0,a.isFieldDef)(n)&&!(0,l.scaleTypeSupportDataType)(h,n.type)?(o.warn(o.message.scaleTypeNotWorkWithFieldDef(h,p)),p):h:(o.warn(o.message.scaleTypeNotWorkWithChannel(t,h,p)),p):p:null}},52128:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleFacetSignals:()=>g,assembleInit:()=>p,assembleLayerSelectionMarks:()=>b,assembleProjection:()=>f,assembleSelectionScaleDomain:()=>w,assembleTopLevelSignals:()=>m,assembleUnitSelectionData:()=>y,assembleUnitSelectionMarks:()=>v,assembleUnitSelectionSignals:()=>h});var r=n(45948),i=n(26372),a=n(93794),o=n(20032),s=n(31179),l=n(84847),u=n(79989),c=n(7302),d=n(83937);function f(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=(0,u.replacePathInField)(i.field),i}function p(e,t=!0,n=i.identity){if((0,i.isArray)(e)){const r=e.map((e=>p(e,t,n)));return t?`[${r.join(", ")}]`:r}return(0,o.isDateTime)(e)?n(t?(0,o.dateTimeToExpr)(e):(0,o.dateTimeToTimestamp)(e)):t?n((0,u.stringify)(e)):e}function h(e,t){for(const n of(0,u.vals)(e.component.selection??{})){const r=n.name;let o=`${r}${a.TUPLE}, ${"global"===n.resolve?"true":`{unit: ${(0,a.unitName)(e)}}`}`;for(const r of a.selectionCompilers)r.defined(n)&&(r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(o=r.modifyExpr(e,n,o)));t.push({name:r+a.MODIFY,on:[{events:{signal:n.name+a.TUPLE},update:`modify(${(0,i.stringValue)(n.name+a.STORE)}, ${o})`}]})}return x(t)}function g(e,t){if(e.component.selection&&(0,u.keys)(e.component.selection).length){const n=(0,i.stringValue)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:(0,r.parseSelector)("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return x(t)}function m(e,t){let n=!1;for(const r of(0,u.vals)(e.component.selection??{})){const o=r.name,s=(0,i.stringValue)(o+a.STORE);if(0===t.filter((e=>e.name===o)).length){const e="global"===r.resolve?"union":r.resolve,n="point"===r.type?", true, true)":")";t.push({name:r.name,update:`${a.VL_SELECTION_RESOLVE}(${s}, ${(0,i.stringValue)(e)}${n}`})}n=!0;for(const n of a.selectionCompilers)n.defined(r)&&n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}return n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),x(t)}function y(e,t){const n=[...t],r=(0,a.unitName)(e,{escape:!1});for(const t of(0,u.vals)(e.component.selection??{})){const e={name:t.name+a.STORE};if(t.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:l.SELECTION_ID}}]),t.init){const n=t.project.items.map(f);e.values=t.project.hasSelectionId?t.init.map((e=>({unit:r,[l.SELECTION_ID]:p(e,!1)[0]}))):t.init.map((e=>({unit:r,fields:n,values:p(e,!1)})))}n.filter((e=>e.name===t.name+a.STORE)).length||n.push(e)}return n}function v(e,t){for(const n of(0,u.vals)(e.component.selection??{}))for(const r of a.selectionCompilers)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function b(e,t){for(const n of e.children)(0,c.isUnitModel)(n)&&(t=v(n,t));return t}function w(e,t,n,r){const a=(0,d.parseSelectionExtent)(e,t.param,t);return{signal:(0,s.hasContinuousDomain)(n.get("type"))&&(0,i.isArray)(r)&&r[0]>r[1]?`isValid(${a}) && reverse(${a})`:a}}function x(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}},75163:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(45948),i=n(26372),a=n(93794),o=n(79989),s=n(53177),l=n(72164);const u={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t)=>{t.clear&&(t.clear=(0,i.isString)(t.clear)?(0,r.parseSelector)(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(s.default.defined(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===(0,o.varName)(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));r(t,"[0, 0]"),-1===t&&r(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+a.TUPLE));r(e,"null"),l.default.defined(t)&&(e=n.findIndex((e=>e.name===t.name+l.TOGGLE)),r(e,"false"))}return n}}},93794:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MODIFY:()=>x,SELECTION_DOMAIN:()=>E,STORE:()=>b,TUPLE:()=>w,VL_SELECTION_RESOLVE:()=>S,disableDirectManipulation:()=>T,requiresSelectionId:()=>C,selectionCompilers:()=>_,unitName:()=>A});var r=n(77390),i=n(26372),a=n(95290),o=n(79989),s=n(7302),l=n(56133),u=n(34960),c=n(75163),d=n(53177),f=n(16108),p=n(95967),h=n(70439),g=n(46608),m=n(72164),y=n(65800),v=n(62539);const b="_store",w="_tuple",x="_modify",E="_selection_domain_",S="vlSelectionResolve",_=[u.default,l.default,p.default,m.default,d.default,h.default,g.default,c.default,y.default,v.default,f.default];function A(e,{escape:t}={escape:!0}){let n=t?(0,i.stringValue)(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!(0,s.isFacetModel)(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of a.FACET_CHANNELS)e[t]&&(n+=` + '__facet_${t}_' + (facet[${(0,i.stringValue)(r.vgField(t))}])`)}return n}function C(e){return(0,o.vals)(e.component.selection??{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function T(e,t){!(0,r.isString)(t.select)&&t.select.on||delete e.events,!(0,r.isString)(t.select)&&t.select.clear||delete e.clear,!(0,r.isString)(t.select)&&t.select.toggle||delete e.toggle}},53177:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(26372),i=n(93794),a=n(79989),o=n(52128),s=n(16108),l=n(95967),u=n(84847);const c={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!(0,u.isLegendBinding)(e.bind),parse:(e,t,n)=>(0,i.disableDirectManipulation)(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,l=t.project,u=t.bind,c=t.init&&t.init[0],d=s.default.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return l.items.forEach(((e,s)=>{const l=(0,a.varName)(`${i}_${e.field}`);n.filter((e=>e.name===l)).length||n.unshift({name:l,...c?{init:(0,o.assembleInit)(c[s])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${d}[${(0,r.stringValue)(e.field)}] : null`}]:[],bind:u[e.field]??u[e.channel]??u})})),n},signals:(e,t,n)=>{const r=t.name,o=t.project,s=n.find((e=>e.name===r+i.TUPLE)),u=r+l.TUPLE_FIELDS,c=o.items.map((e=>(0,a.varName)(`${r}_${e.field}`))),d=c.map((e=>`${e} !== null`)).join(" && ");return c.length&&(s.update=`${d} ? {fields: ${u}, values: [${c.join(", ")}]} : null`),delete s.value,delete s.on,n}},d=c},56133:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BRUSH:()=>g,GEO_INIT_TICK:()=>y,SCALE_TRIGGER:()=>m,default:()=>b});var r=n(77390),i=n(26372),a=n(93794),o=n(95290),s=n(20916),l=n(31179),u=n(84847),c=n(79989),d=n(7302),f=n(52128),p=n(95967),h=n(70439);const g="_brush",m="_scale_trigger",y="geo_interval_init_tick",v="_init",b={defined:e=>"interval"===e.type,parse:(e,t,n)=>{var a;if(e.hasProjection){const e={...(0,r.isObject)(n.select)?n.select:{}};e.fields=[u.SELECTION_ID],e.encodings||(e.encodings=n.value?(0,c.keys)(n.value):[o.LONGITUDE,o.LATITUDE]),n.select={type:"interval",...e}}if(t.translate&&!h.default.defined(t)){const e=`!event.item || event.item.mark.name !== ${(0,i.stringValue)(t.name+g)}`;for(const n of t.events){if(!n.between){(0,s.warn)(`${n} is not an ordered event stream for interval selections.`);continue}const t=(0,i.array)((a=n.between[0]).filter??(a.filter=[]));t.includes(e)||t.push(e)}}},signals:(e,t,n)=>{const r=t.name,s=r+a.TUPLE,u=(0,c.vals)(t.project.hasChannel).filter((e=>e.channel===o.X||e.channel===o.Y)),d=t.init?t.init[0]:null;if(n.push(...u.reduce(((n,r)=>n.concat(function(e,t,n,r){const a=!e.hasProjection,s=n.channel,u=n.signals.visual,c=(0,i.stringValue)(a?e.scaleName(s):e.projectionName()),d=e=>`scale(${c}, ${e})`,p=e.getSizeSignalRef(s===o.X?"width":"height").signal,g=`${s}(unit)`,y=t.events.reduce(((e,t)=>[...e,{events:t.between[0],update:`[${g}, ${g}]`},{events:t,update:`[${u}[0], clamp(${g}, 0, ${p})]`}]),[]);if(a){const i=n.signals.data,a=h.default.defined(t),o=e.getScaleComponent(s),p=o?o.get("type"):void 0,g=r?{init:(0,f.assembleInit)(r,!0,d)}:{value:[]};return y.push({events:{signal:t.name+m},update:(0,l.hasContinuousDomain)(p)?`[${d(`${i}[0]`)}, ${d(`${i}[1]`)}]`:"[0, 0]"}),a?[{name:i,on:[]}]:[{name:u,...g,on:y},{name:i,...r?{init:(0,f.assembleInit)(r)}:{},on:[{events:{signal:u},update:`${u}[0] === ${u}[1] ? null : invert(${c}, ${u})`}]}]}{const e=s===o.X?0:1,n=t.name+v;return[{name:u,...r?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:y}]}}(e,t,r,d&&d[r.index]))),[])),e.hasProjection){const o=(0,i.stringValue)(e.projectionName()),l=e.projectionName()+"_center",{x:c,y:f}=t.project.hasChannel,p=c&&c.signals.visual,h=f&&f.signals.visual,g=c?d&&d[c.index]:`${l}[0]`,m=f?d&&d[f.index]:`${l}[1]`,b=t=>e.getSizeSignalRef(t).signal,w=`[[${p?p+"[0]":"0"}, ${h?h+"[0]":"0"}],[${p?p+"[1]":b("width")}, ${h?h+"[1]":b("height")}]]`;!d||(n.unshift({name:r+v,init:`[scale(${o}, [${c?g[0]:g}, ${f?m[0]:m}]), scale(${o}, [${c?g[1]:g}, ${f?m[1]:m}])]`}),c&&f)||n.find((e=>e.name===l))||n.unshift({name:l,update:`invert(${o}, [${b("width")}/2, ${b("height")}/2])`});const x=`vlSelectionTuples(intersect(${w}, {markname: ${(0,i.stringValue)(e.getName("marks"))}}, unit.mark), {unit: ${(0,a.unitName)(e)}})`,E=u.map((e=>e.signals.visual));return n.concat({name:s,on:[{events:[...E.length?[{signal:E.join(" || ")}]:[],...d?[{signal:y}]:[]],update:x}]})}{if(!h.default.defined(t)){const t=r+m,a=u.map((t=>{const n=t.channel,{data:r,visual:a}=t.signals,o=(0,i.stringValue)(e.scaleName(n)),s=e.getScaleComponent(n).get("type"),u=(0,l.hasContinuousDomain)(s)?"+":"";return`(!isArray(${r}) || (${u}invert(${o}, ${a})[0] === ${u}${r}[0] && ${u}invert(${o}, ${a})[1] === ${u}${r}[1]))`}));a.length&&n.push({name:t,value:{},on:[{events:u.map((t=>({scale:e.scaleName(t.channel)}))),update:a.join(" && ")+` ? ${t} : {}`}]})}const o=u.map((e=>e.signals.data)),c=`unit: ${(0,a.unitName)(e)}, fields: ${r+p.TUPLE_FIELDS}, values`;return n.concat({name:s,...d?{init:`{${c}: ${(0,f.assembleInit)(d)}}`}:{},...o.length?{on:[{events:[{signal:o.join(" || ")}],update:`${o.join(" && ")} ? {${c}: [${o}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>((0,d.isUnitModel)(e)&&e.hasProjection&&t.init&&(n.filter((e=>e.name===y)).length||n.unshift({name:y,value:null,on:[{events:"timer{1}",update:`${y} === null ? {} : ${y}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:o,y:s}=t.project.hasChannel,l=o?.signals.visual,u=s?.signals.visual,d=`data(${(0,i.stringValue)(t.name+a.STORE)})`;if(h.default.defined(t)||!o&&!s)return n;const f={x:void 0!==o?{signal:`${l}[0]`}:{value:0},y:void 0!==s?{signal:`${u}[0]`}:{value:0},x2:void 0!==o?{signal:`${l}[1]`}:{field:{group:"width"}},y2:void 0!==s?{signal:`${u}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of(0,c.keys)(f))f[t]=[{test:`${d}.length && ${d}[0].unit === ${(0,a.unitName)(e)}`,...f[t]},{value:0}];const{fill:p,fillOpacity:m,cursor:y,...v}=t.mark,b=(0,c.keys)(v).reduce(((e,t)=>(e[t]=[{test:[void 0!==o&&`${l}[0] !== ${l}[1]`,void 0!==s&&`${u}[0] !== ${u}[1]`].filter((e=>e)).join(" && "),value:v[t]},{value:null}],e)),{}),w=y??(t.translate?"move":null);return[{name:`${r+g}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:p},fillOpacity:{value:m}},update:f}},...n,{name:r+g,type:"rect",clip:!0,encode:{enter:{...w?{cursor:{value:w}}:{},fill:{value:"transparent"}},update:{...f,...b}}}]}}},46608:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p,parseInteractiveLegend:()=>h});var r=n(77390),i=n(45948),a=n(26372),o=n(93794),s=n(20916),l=n(84847),u=n(79989),c=n(95967),d=n(72164);const f={defined:e=>{const t="global"===e.resolve&&e.bind&&(0,l.isLegendBinding)(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==l.SELECTION_ID;return t&&!n&&s.warn(s.message.LEGEND_BINDINGS_MUST_HAVE_PROJECTION),t&&n},parse:(e,t,n)=>{const s=(0,u.duplicate)(n);if(s.select=(0,a.isString)(s.select)?{type:s.select,toggle:t.toggle}:{...s.select,toggle:t.toggle},(0,o.disableDirectManipulation)(t,s),(0,r.isObject)(n.select)&&(n.select.on||n.select.clear)){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=(0,a.array)(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}const c=(0,l.isLegendStreamBinding)(t.bind)?t.bind.legend:"click",d=(0,a.isString)(c)?(0,i.parseSelector)(c,"view"):(0,a.array)(c);t.bind={legend:{merge:d}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=(0,l.isLegendStreamBinding)(t.bind)&&t.bind.legend,a=e=>t=>{const n=(0,u.duplicate)(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const o=`${(0,u.varName)(e.field)}_legend`,s=`${r}_${o}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(a(`${o}_symbols`)).concat(i.merge.map(a(`${o}_labels`))).concat(i.merge.map(a(`${o}_entries`)));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,a=n.find((e=>e.name===r+o.TUPLE)),s=r+c.TUPLE_FIELDS,f=i.items.filter((e=>e.hasLegend)).map((e=>(0,u.varName)(`${r}_${(0,u.varName)(e.field)}_legend`))),p=`${f.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${s}, values: [${f.join(", ")}]} : null`;t.events&&f.length>0?a.on.push({events:f.map((e=>({signal:e}))),update:p}):f.length>0&&(a.update=p,delete a.value,delete a.on);const h=n.find((e=>e.name===r+d.TOGGLE)),g=(0,l.isLegendStreamBinding)(t.bind)&&t.bind.legend;return h&&(t.events?h.on.push({...h.on[0],events:g}):h.on[0].events=g),n}},p=f;function h(e,t,n){const r=e.fieldDef(t)?.field;for(const i of(0,u.vals)(e.component.selection??{})){const e=i.project.hasField[r]??i.project.hasChannel[t];if(e&&f.defined(i)){const t=n.get("selections")??[];t.push(i.name),n.set("selections",t,!1),e.hasLegend=!0}}}},16108:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(20916),i=n(75028),a=n(55792);const o="voronoi",s={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(o)},marks:(e,t,n)=>{const{x:s,y:l}=t.project.hasChannel,u=e.mark;if((0,i.isPathMark)(u))return r.warn(r.message.nearestNotSupportForContinuous(u)),n;const c={name:e.getName(o),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...(0,a.tooltip)(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:s||!l?"datum.datum.x || 0":"0"},y:{expr:l||!s?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let d=0,f=!1;return n.forEach(((t,n)=>{const r=t.name??"";r===e.component.mark[0].name?d=n:r.includes(o)&&(f=!0)})),f||n.splice(d+1,0,c),n}},l=s},83937:(e,t,n)=>{"use strict";n.r(t),n.d(t,{materializeSelections:()=>h,parseSelectionExtent:()=>p,parseSelectionPredicate:()=>f,parseUnitSelection:()=>d});var r=n(45948),i=n(26372),a=n(93794),o=n(20916),s=n(79989),l=n(74686),u=n(68860),c=n(89081);function d(e,t){const n={},o=e.config.selection;if(!t||!t.length)return n;for(const l of t){const t=(0,s.varName)(l.name),u=l.select,c=(0,i.isString)(u)?u:u.type,d=(0,i.isObject)(u)?(0,s.duplicate)(u):{type:c},f=o[c];for(const e in f)"fields"!==e&&"encodings"!==e&&("mark"===e&&(d.mark={...f.mark,...d.mark}),void 0!==d[e]&&!0!==d[e]||(d[e]=(0,s.duplicate)(f[e]??d[e])));const p=n[t]={...d,name:t,type:c,init:l.value,bind:l.bind,events:(0,i.isString)(d.on)?(0,r.parseSelector)(d.on,"scope"):(0,i.array)((0,s.duplicate)(d.on))},h=(0,s.duplicate)(l);for(const t of a.selectionCompilers)t.defined(p)&&t.parse&&t.parse(e,p,h)}return n}function f(e,t,n,r="datum"){const o=(0,i.isString)(t)?t:t.param,l=(0,s.varName)(o),u=(0,i.stringValue)(l+a.STORE);let c;try{c=e.getSelectionComponent(l,o)}catch(e){return`!!${l}`}if(c.project.timeUnit){const t=n??e.component.data.raw,r=c.project.timeUnit.clone();t.parent?r.insertAsParentOf(t):t.parent=r}const d=`${c.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${u}, ${r}${"global"===c.resolve?")":`, ${(0,i.stringValue)(c.resolve)})`}`,f=`length(data(${u}))`;return!1===t.empty?`${f} && ${d}`:`!${f} || ${d}`}function p(e,t,n){const r=(0,s.varName)(t),a=n.encoding;let l,u=n.field;try{l=e.getSelectionComponent(r,t)}catch(e){return r}if(a||u){if(a&&!u){const e=l.project.items.filter((e=>e.channel===a));!e.length||e.length>1?(u=l.project.items[0].field,(0,o.warn)((e.length?"Multiple ":"No ")+`matching ${(0,i.stringValue)(a)} encoding found for selection ${(0,i.stringValue)(n.param)}. `+`Using "field": ${(0,i.stringValue)(u)}.`)):u=e[0].field}}else u=l.project.items[0].field,l.project.items.length>1&&(0,o.warn)(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${(0,i.stringValue)(u)}.`);return`${l.name}[${(0,i.stringValue)((0,s.replacePathInField)(u))}]`}function h(e,t){for(const[n,r]of(0,s.entries)(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new l.OutputNode(new u.FilterNode(t,e,{param:n}),i,c.DataSourceType.Lookup,e.component.data.outputNodeRefCounts)}}},34960:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(26372),i=n(93794),a=n(84847),o=n(79989),s=n(56133),l=n(95967);const u={defined:e=>"point"===e.type,signals:(e,t,n)=>{const u=t.name,c=u+l.TUPLE_FIELDS,d=t.project,f="(item().isVoronoi ? datum.datum : datum)",p=(0,o.vals)(e.component.selection??{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+s.BRUSH):e),[]).map((e=>`indexof(item().mark.name, '${e}') < 0`)).join(" && "),h="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(p?` && ${p}`:"");let g=`unit: ${(0,i.unitName)(e)}, `;t.project.hasSelectionId?g+=`${a.SELECTION_ID}: ${f}[${(0,r.stringValue)(a.SELECTION_ID)}]`:g+=`fields: ${c}, values: [${d.items.map((t=>{const n=e.fieldDef(t.channel);return n?.bin?`[${f}[${(0,r.stringValue)(e.vgField(t.channel,{}))}], ${f}[${(0,r.stringValue)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${f}[${(0,r.stringValue)(t.field)}]`})).join(", ")}]`;const m=t.events;return n.concat([{name:u+i.TUPLE,on:m?[{events:m,update:`${h} ? {${g}} : null`,force:!0}]:[]}])}}},95967:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SelectionProjectionComponent:()=>p,TUPLE_FIELDS:()=>f,default:()=>h});var r=n(26372),i=n(95290),a=n(20916),o=n(31179),s=n(84847),l=n(79989),u=n(62277),c=n(52128),d=n(96598);const f="_tuple_fields";class p{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const h={defined:()=>!0,parse:(e,t,n)=>{const c=t.name,f=t.project??(t.project=new p),h={},g={},m=new Set,y=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=(0,l.varName)(`${c}_${n}`);for(let e=1;m.has(r);e++)r=(0,l.varName)(`${c}_${n}_${e}`);return m.add(r),{[t]:r}},v=t.type,b=e.config.selection[v],w=void 0!==n.value?(0,r.array)(n.value):null;let{fields:x,encodings:E}=(0,r.isObject)(n.select)?n.select:{};if(!x&&!E&&w)for(const e of w)if((0,r.isObject)(e))for(const t of(0,l.keys)(e))(0,i.isSingleDefUnitChannel)(t)?(E||(E=[])).push(t):"interval"===v?(a.warn(a.message.INTERVAL_INITIALIZED_WITH_POS),E=b.encodings):(x??(x=[])).push(t);x||E||(E=b.encodings,"fields"in b&&(x=b.fields));for(const t of E??[]){const n=e.fieldDef(t);if(n){let r=n.field;if(n.aggregate){a.warn(a.message.cannotProjectAggregate(t,n.aggregate));continue}if(!r){a.warn(a.message.cannotProjectOnChannelWithoutField(t));continue}if(n.timeUnit&&!(0,d.isBinnedTimeUnit)(n.timeUnit)){r=e.vgField(t);const i={timeUnit:n.timeUnit,as:r,field:n.field};g[(0,l.hash)(i)]=i}if(!h[r]){const a={field:r,channel:t,type:"interval"===v&&(0,i.isScaleChannel)(t)&&(0,o.hasContinuousDomain)(e.getScaleComponent(t).get("type"))?"R":n.bin?"R-RE":"E",index:f.items.length};a.signals={...y(a,"data"),...y(a,"visual")},f.items.push(h[r]=a),f.hasField[r]=h[r],f.hasSelectionId=f.hasSelectionId||r===s.SELECTION_ID,(0,i.isGeoPositionChannel)(t)?(a.geoChannel=t,a.channel=(0,i.getPositionChannelFromLatLong)(t),f.hasChannel[a.channel]=h[r]):f.hasChannel[t]=h[r]}}else a.warn(a.message.cannotProjectOnChannelWithoutField(t))}for(const e of x??[]){if(f.hasField[e])continue;const t={type:"E",field:e,index:f.items.length};t.signals={...y(t,"data")},f.items.push(t),f.hasField[e]=t,f.hasSelectionId=f.hasSelectionId||e===s.SELECTION_ID}w&&(t.init=w.map((e=>f.items.map((t=>(0,r.isObject)(e)?void 0!==e[t.geoChannel||t.channel]?e[t.geoChannel||t.channel]:e[t.field]:e))))),(0,l.isEmpty)(g)||(f.timeUnit=new u.TimeUnitNode(null,g))},signals:(e,t,n)=>{const r=t.name+f;return n.filter((e=>e.name===r)).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(c.assembleProjection)})}}},70439:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c,domain:()=>d});var r=n(26372),i=n(93794),a=n(95290),o=n(20916),s=n(31179),l=n(7302),u=n(79989);const c={defined:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!(0,a.isScaleChannel)(i))continue;const l=e.getScaleComponent(i),u=l?l.get("type"):void 0;"sequential"==u&&o.warn(o.message.SEQUENTIAL_SCALE_DEPRECATED),l&&(0,s.hasContinuousDomain)(u)?(l.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)):o.warn(o.message.SCALE_BINDINGS_CONTINUOUS)}},topLevelSignals:(e,t,n)=>{const a=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||f(e)||0===a.length)return n;const o=n.find((e=>e.name===t.name));let s=o.update;if(s.includes(i.VL_SELECTION_RESOLVE))o.update=`{${a.map((e=>`${(0,r.stringValue)((0,u.replacePathInField)(e.field))}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of a){const t=`${(0,r.stringValue)((0,u.replacePathInField)(e.field))}: ${e.signals.data}`;s.includes(t)||(s=`${s.substring(0,s.length-1)}, ${t}}`)}o.update=s}return n.concat(a.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!f(e))for(const e of t.scales){const t=n.find((t=>t.name===e.signals.data));t.push="outer",delete t.value,delete t.update}return n}};function d(e,t){return`domain(${(0,r.stringValue)(e.scaleName(t))})`}function f(e){return e.parent&&(0,l.isLayerModel)(e.parent)&&(!e.parent.parent??f(e.parent.parent))}},72164:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TOGGLE:()=>i,default:()=>a});var r=n(93794);const i="_toggle",a={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+i,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+r.TUPLE,a=t.name+i;return`${a} ? null : ${n}, `+("global"===t.resolve?`${a} ? null : true, `:`${a} ? null : {unit: ${(0,r.unitName)(e)}}, `)+`${a} ? ${n} : null`}}},65800:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(45948),i=n(95290),a=n(56133),o=n(70439);const s="_translate_anchor",l="_translate_delta",u={defined:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const u=t.name,d=o.default.defined(t),f=u+s,{x:p,y:h}=t.project.hasChannel;let g=(0,r.parseSelector)(t.translate,"scope");return d||(g=g.map((e=>(e.between[0].markname=u+a.BRUSH,e)))),n.push({name:f,value:{},on:[{events:g.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==p?`, extent_x: ${d?(0,o.domain)(e,i.X):`slice(${p.signals.visual})`}`:"")+(void 0!==h?`, extent_y: ${d?(0,o.domain)(e,i.Y):`slice(${h.signals.visual})`}`:"")+"}"}]},{name:u+l,value:{},on:[{events:g,update:`{x: ${f}.x - x(unit), y: ${f}.y - y(unit)}`}]}),void 0!==p&&c(e,t,p,"width",n),void 0!==h&&c(e,t,h,"height",n),n}};function c(e,t,n,r,a){const u=t.name,c=u+s,d=u+l,f=n.channel,p=o.default.defined(t),h=a.find((e=>e.name===n.signals[p?"data":"visual"])),g=e.getSizeSignalRef(r).signal,m=e.getScaleComponent(f),y=m&&m.get("type"),v=m&&m.get("reverse"),b=p?f===i.X?v?"":"-":v?"-":"":"",w=`${c}.extent_${f}`,x=`${p&&m?"log"===y?"panLog":"symlog"===y?"panSymlog":"pow"===y?"panPow":"panLinear":"panLinear"}(${w}, ${b}${d}.${f} / ${p?`${g}`:`span(${w})`}${p?"pow"===y?`, ${m.get("exponent")??1}`:"symlog"===y?`, ${m.get("constant")??1}`:"":""})`;h.on.push({events:{signal:d},update:p?x:`clampRange(${x}, 0, ${g})`})}},62539:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(45948),i=n(26372),a=n(95290),o=n(56133),s=n(70439);const l="_zoom_anchor",u="_zoom_delta",c={defined:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const c=t.name,f=s.default.defined(t),p=c+u,{x:h,y:g}=t.project.hasChannel,m=(0,i.stringValue)(e.scaleName(a.X)),y=(0,i.stringValue)(e.scaleName(a.Y));let v=(0,r.parseSelector)(t.zoom,"scope");return f||(v=v.map((e=>(e.markname=c+o.BRUSH,e)))),n.push({name:c+l,on:[{events:v,update:f?"{"+[m?`x: invert(${m}, x(unit))`:"",y?`y: invert(${y}, y(unit))`:""].filter((e=>e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:p,on:[{events:v,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==h&&d(e,t,h,"width",n),void 0!==g&&d(e,t,g,"height",n),n}};function d(e,t,n,r,i){const a=t.name,o=n.channel,c=s.default.defined(t),d=i.find((e=>e.name===n.signals[c?"data":"visual"])),f=e.getSizeSignalRef(r).signal,p=e.getScaleComponent(o),h=p&&p.get("type"),g=c?(0,s.domain)(e,o):d.name,m=a+u,y=`${c&&p?"log"===h?"zoomLog":"symlog"===h?"zoomSymlog":"pow"===h?"zoomPow":"zoomLinear":"zoomLinear"}(${g}, ${a}${l}.${o}, ${m}${c?"pow"===h?`, ${p.get("exponent")??1}`:"symlog"===h?`, ${p.get("constant")??1}`:"":""})`;d.on.push({events:{signal:m},update:c?y:`clampRange(${y}, 0, ${f})`})}},77547:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SignalRefWrapper:()=>r});class r{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new r((()=>e(t)))}}},96159:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Split:()=>a,defaultTieBreaker:()=>u,makeExplicit:()=>o,makeImplicit:()=>s,mergeValuesWithExplicit:()=>c,tieBreakByComparing:()=>l});var r=n(20916),i=n(79989);class a{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new a((0,i.duplicate)(this.explicit),(0,i.duplicate)(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return(0,i.getFirstDefined)(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:t,explicit:n}){void 0!==t&&this.set(e,t,n)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:n}){void 0!==t[e]?this.set(e,t[e],!0):void 0!==n[e]&&this.set(e,n[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of(0,i.keys)(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function o(e){return{explicit:!0,value:e}}function s(e){return{explicit:!1,value:e}}function l(e){return(t,n,r,i)=>{const a=e(t.value,n.value);return a>0?t:a<0?n:u(t,n,r,i)}}function u(e,t,n,i){return e.explicit&&t.explicit&&r.warn(r.message.mergeConflictingProperty(n,i,e.value,t.value)),e}function c(e,t,n,r,a=u){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:(0,i.deepEqual)(e.value,t.value)?e:a(e,t,n,r)}},92649:(e,t,n)=>{"use strict";n.r(t),n.d(t,{UnitModel:()=>T});var r=n(26372),i=n(65032),a=n(95290),o=n(79543),s=n(89081),l=n(98348),u=n(3802),c=n(75028),d=n(84847),f=n(89820),p=n(68889),h=n(79989),g=n(5593),m=n(32134),y=n(15058),v=n(80219),b=n(6871),w=n(81693),x=n(27588),E=n(55823),S=n(60288),_=n(7302),A=n(52128),C=n(83937);class T extends _.ModelWithField{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,(0,f.isFrameMixins)(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const a=(0,c.isMarkDef)(e.mark)?{...e.mark}:{type:e.mark},o=a.type;void 0===a.filled&&(a.filled=(0,E.defaultFilled)(a,i,{graticule:e.data&&(0,s.isGraticuleGenerator)(e.data)}));const u=this.encoding=(0,l.initEncoding)(e.encoding||{},o,a.filled,i);this.markDef=(0,E.initMarkdef)(a,u,i),this.size=(0,w.initLayoutSize)({encoding:u,size:(0,f.isFrameMixins)(e)?{...r,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:r}),this.stack=(0,p.stack)(this.markDef,u),this.specifiedScales=this.initScales(o,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter((e=>(0,d.isSelectionParameter)(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===c.GEOSHAPE,n=e&&a.GEOPOSITION_CHANNELS.some((t=>(0,o.isFieldOrDatumDef)(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return a.SCALE_CHANNELS.reduce(((e,n)=>{const r=(0,o.getFieldOrDatumDef)(t[n]);return r&&(e[n]=this.initScale(r.scale??{})),e}),{})}initScale(e){const{domain:t,range:n}=e,i=(0,u.replaceExprRef)(e);return(0,r.isArray)(t)&&(i.domain=t.map(y.signalRefOrValue)),(0,r.isArray)(n)&&(i.range=n.map(y.signalRefOrValue)),i}initAxes(e){return a.POSITION_SCALE_CHANNELS.reduce(((t,n)=>{const r=e[n];if((0,o.isFieldOrDatumDef)(r)||n===a.X&&(0,o.isFieldOrDatumDef)(e.x2)||n===a.Y&&(0,o.isFieldOrDatumDef)(e.y2)){const e=(0,o.isFieldOrDatumDef)(r)?r.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=(0,h.keys)(e),n={};for(const r of t){const t=e[r];n[r]=(0,i.isConditionalAxisValue)(t)?(0,y.signalOrValueRefWithCondition)(t):(0,y.signalRefOrValue)(t)}return n}initLegends(e){return a.NONPOSITION_SCALE_CHANNELS.reduce(((t,n)=>{const r=(0,o.getFieldOrDatumDef)(e[n]);if(r&&(0,a.supportLegend)(n)){const e=r.legend;t[n]=e?(0,u.replaceExprRef)(e):e}return t}),{})}parseData(){this.component.data=(0,v.parseData)(this)}parseLayoutSize(){(0,x.parseUnitLayoutSize)(this)}parseSelections(){this.component.selection=(0,C.parseUnitSelection)(this,this.selection)}parseMarkGroup(){this.component.mark=(0,S.parseMarkGroups)(this)}parseAxesAndHeaders(){this.component.axes=(0,m.parseUnitAxes)(this)}assembleSelectionTopLevelSignals(e){return(0,A.assembleTopLevelSignals)(this,e)}assembleSignals(){return[...(0,g.assembleAxisSignals)(this),...(0,A.assembleUnitSelectionSignals)(this,[])]}assembleSelectionData(e){return(0,A.assembleUnitSelectionData)(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return(0,b.assembleLayoutSignals)(this)}assembleMarks(){let e=this.component.mark??[];return this.parent&&(0,_.isLayerModel)(this.parent)||(e=(0,A.assembleUnitSelectionMarks)(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return void 0!==e?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return l.channelHasField(this.encoding,e)}fieldDef(e){const t=this.encoding[e];return(0,o.getFieldDef)(t)}typedFieldDef(e){const t=this.fieldDef(e);return(0,o.isTypedFieldDef)(t)?t:null}}},88655:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CompositeMarkNormalizer:()=>a});var r=n(75028),i=n(68859);class a{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!(0,i.isUnitSpec)(e)&&(0,r.getMarkType)(e.mark)===this.name}}},67982:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BOXPLOT:()=>d,BOXPLOT_PARTS:()=>f,boxPlotNormalizer:()=>p,getBoxPlotType:()=>h,normalizeBoxPlot:()=>g});var r=n(26372),i=n(15058),a=n(98348),o=n(20916),s=n(75028),l=n(79989),u=n(88655),c=n(867);const d="boxplot",f=["box","median","outliers","rule","ticks"],p=new u.CompositeMarkNormalizer(d,g);function h(e){return(0,r.isNumber)(e)?"tukey":e}function g(e,{config:t}){e={...e,encoding:(0,a.normalizeEncoding)(e.encoding,t)};const{mark:n,encoding:u,params:f,projection:p,...g}=e,y=(0,s.isMarkDef)(n)?n:{type:n};f&&o.warn(o.message.selectionNotSupported("boxplot"));const v=y.extent??t.boxplot.extent,b=(0,i.getMarkPropOrConfig)("size",y,t),w=y.invalid,x=h(v),{bins:E,timeUnits:S,transform:_,continuousAxisChannelDef:A,continuousAxis:C,groupby:T,aggregate:k,encodingWithoutContinuousAxis:R,ticksOrient:D,boxOrient:O,customTooltipWithoutAggregatedField:N}=function(e,t,n){const r=(0,c.compositeMarkOrient)(e,d),{continuousAxisChannelDef:i,continuousAxis:o}=(0,c.compositeMarkContinuousAxis)(e,r,d),s=i.field,u=(0,l.removePathFromField)(s),f=h(t),p=[...m(s),{op:"median",field:s,as:`mid_box_${u}`},{op:"min",field:s,as:("min-max"===f?"lower_whisker_":"min_")+u},{op:"max",field:s,as:("min-max"===f?"upper_whisker_":"max_")+u}],g="min-max"===f||"tukey"===f?[]:[{calculate:`datum["upper_box_${u}"] - datum["lower_box_${u}"]`,as:`iqr_${u}`},{calculate:`min(datum["upper_box_${u}"] + datum["iqr_${u}"] * ${t}, datum["max_${u}"])`,as:`upper_whisker_${u}`},{calculate:`max(datum["lower_box_${u}"] - datum["iqr_${u}"] * ${t}, datum["min_${u}"])`,as:`lower_whisker_${u}`}],{[o]:y,...v}=e.encoding,{customTooltipWithoutAggregatedField:b,filteredEncoding:w}=(0,c.filterTooltipWithAggregatedField)(v),{bins:x,timeUnits:E,aggregate:S,groupby:_,encoding:A}=(0,a.extractTransformsFromEncoding)(w,n),C="vertical"===r?"horizontal":"vertical",T=r;return{bins:x,timeUnits:E,transform:[...x,...E,{aggregate:[...S,...p],groupby:_},...g],groupby:_,aggregate:S,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:A,ticksOrient:C,boxOrient:T,customTooltipWithoutAggregatedField:b}}(e,v,t),F=(0,l.removePathFromField)(A.field),{color:P,size:M,...I}=R,$=e=>(0,c.makeCompositeAggregatePartFactory)(y,C,A,e,t.boxplot),L=$(I),B=$(R),U=((0,r.isObject)(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",z=$({...I,...M?{size:M}:{},color:{condition:{test:`datum['lower_box_${A.field}'] >= datum['upper_box_${A.field}']`,...P||{value:U}}}}),q=(0,c.getCompositeMarkTooltip)([{fieldPrefix:"min-max"===x?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===x?"lower_whisker_":"min_",titlePrefix:"Min"}],A,R),j={type:"tick",color:"black",opacity:1,orient:D,invalid:w,aria:!1},H="min-max"===x?q:(0,c.getCompositeMarkTooltip)([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],A,R),G=[...L({partName:"rule",mark:{type:"rule",invalid:w,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:H}),...L({partName:"rule",mark:{type:"rule",invalid:w,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:H}),...L({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:H}),...L({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:H})],V=[..."tukey"!==x?G:[],...B({partName:"box",mark:{type:"bar",...b?{size:b}:{},orient:O,invalid:w,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:q}),...z({partName:"median",mark:{type:"tick",invalid:w,...(0,r.isObject)(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...b?{size:b}:{},orient:D,aria:!1},positionPrefix:"mid_box",extraEncoding:q})];if("min-max"===x)return{...g,transform:(g.transform??[]).concat(_),layer:V};const W=`datum["lower_box_${A.field}"]`,Y=`datum["upper_box_${A.field}"]`,X=`(${Y} - ${W})`,K=`${W} - ${v} * ${X}`,J=`${Y} + ${v} * ${X}`,Q=`datum["${A.field}"]`,Z={joinaggregate:m(A.field),groupby:T},ee={transform:[{filter:`(${K} <= ${Q}) && (${Q} <= ${J})`},{aggregate:[{op:"min",field:A.field,as:`lower_whisker_${F}`},{op:"max",field:A.field,as:`upper_whisker_${F}`},{op:"min",field:`lower_box_${A.field}`,as:`lower_box_${F}`},{op:"max",field:`upper_box_${A.field}`,as:`upper_box_${F}`},...k],groupby:T}],layer:G},{tooltip:te,...ne}=I,{scale:re,axis:ie}=A,ae=(0,c.getTitle)(A),oe=(0,l.omit)(ie,["title"]),se=(0,c.partLayerMixins)(y,"outliers",t.boxplot,{transform:[{filter:`(${Q} < ${K}) || (${Q} > ${J})`}],mark:"point",encoding:{[C]:{field:A.field,type:A.type,...void 0!==ae?{title:ae}:{},...void 0!==re?{scale:re}:{},...(0,l.isEmpty)(oe)?{}:{axis:oe}},...ne,...P?{color:P}:{},...N?{tooltip:N}:{}}})[0];let le;const ue=[...E,...S,Z];return se?le={transform:ue,layer:[se,ee]}:(le=ee,le.transform.unshift(...ue)),{...g,layer:[le,{transform:_,layer:V}]}}function m(e){const t=(0,l.removePathFromField)(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}},867:(e,t,n)=>{"use strict";n.r(t),n.d(t,{compositeMarkContinuousAxis:()=>g,compositeMarkOrient:()=>y,filterTooltipWithAggregatedField:()=>c,getCompositeMarkTooltip:()=>d,getTitle:()=>f,makeCompositeAggregatePartFactory:()=>p,partLayerMixins:()=>h});var r=n(26372),i=n(79543),a=n(98348),o=n(20916),s=n(75028),l=n(79989),u=n(5711);function c(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,a;if((0,r.isArray)(t)){for(const e of t)e.aggregate?(i||(i=[]),i.push(e)):(a||(a=[]),a.push(e));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:a=t;return(0,r.isArray)(a)&&1===a.length&&(a=a[0]),{customTooltipWithoutAggregatedField:a,filteredEncoding:n}}function d(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const o=e.map((({fieldPrefix:e,titlePrefix:n})=>{const i=r?` of ${f(t)}`:"";return{field:e+t.field,type:t.type,title:(0,u.isSignalRef)(n)?{signal:`${n}"${escape(i)}"`}:n+i}})),s=(0,a.fieldDefs)(n).map(i.toStringFieldDef);return{tooltip:[...o,...(0,l.unique)(s,l.hash)]}}function f(e){const{title:t,field:n}=e;return(0,l.getFirstDefined)(t,n)}function p(e,t,n,i,a){const{scale:o,axis:s}=n;return({partName:l,mark:u,positionPrefix:c,endPositionPrefix:d,extraEncoding:p={}})=>{const g=f(n);return h(e,l,a,{mark:u,encoding:{[t]:{field:`${c}_${n.field}`,type:n.type,...void 0!==g?{title:g}:{},...void 0!==o?{scale:o}:{},...void 0!==s?{axis:s}:{}},...(0,r.isString)(d)?{[`${t}2`]:{field:`${d}_${n.field}`}}:{},...i,...p}})}}function h(e,t,n,i){const{clip:a,color:o,opacity:l}=e,u=e.type;return e[t]||void 0===e[t]&&n[t]?[{...i,mark:{...n[t],...a?{clip:a}:{},...o?{color:o}:{},...l?{opacity:l}:{},...(0,s.isMarkDef)(i.mark)?i.mark:{type:i.mark},style:`${u}-${String(t)}`,...(0,r.isBoolean)(e[t])?{}:e[t]}}]:[]}function g(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",a=r[i],o=r[`${i}2`],s=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:m(a,n),continuousAxisChannelDef2:m(o,n),continuousAxisChannelDefError:m(s,n),continuousAxisChannelDefError2:m(l,n),continuousAxis:i}}function m(e,t){if(e?.aggregate){const{aggregate:n,...r}=e;return n!==t&&o.warn(o.message.errorBarContinuousAxisHasCustomizedAggregate(n,t)),r}return e}function y(e,t){const{mark:n,encoding:r}=e,{x:a,y:o}=r;if((0,s.isMarkDef)(n)&&n.orient)return n.orient;if((0,i.isContinuousFieldOrDatumDef)(a)){if((0,i.isContinuousFieldOrDatumDef)(o)){const e=(0,i.isFieldDef)(a)&&a.aggregate,n=(0,i.isFieldDef)(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return(0,i.isFieldOrDatumDefForTimeFormat)(o)&&!(0,i.isFieldOrDatumDefForTimeFormat)(a)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if((0,i.isContinuousFieldOrDatumDef)(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}},52365:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ERRORBAND:()=>l,ERRORBAND_PARTS:()=>u,errorBandNormalizer:()=>c,normalizeErrorBand:()=>d});var r=n(98348),i=n(20916),a=n(88655),o=n(867),s=n(55833);const l="errorband",u=["band","borders"],c=new a.CompositeMarkNormalizer(l,d);function d(e,{config:t}){e={...e,encoding:(0,r.normalizeEncoding)(e.encoding,t)};const{transform:n,continuousAxisChannelDef:a,continuousAxis:u,encodingWithoutContinuousAxis:c,markDef:d,outerSpec:f,tooltipEncoding:p}=(0,s.errorBarParams)(e,l,t),h=d,g=(0,o.makeCompositeAggregatePartFactory)(h,u,a,c,t.errorband),m=void 0!==e.encoding.x&&void 0!==e.encoding.y;let y={type:m?"area":"rect"},v={type:m?"line":"rule"};const b={...h.interpolate?{interpolate:h.interpolate}:{},...h.tension&&h.interpolate?{tension:h.tension}:{}};return m?(y={...y,...b,ariaRoleDescription:"errorband"},v={...v,...b,aria:!1}):h.interpolate?i.warn(i.message.errorBand1DNotSupport("interpolate")):h.tension&&i.warn(i.message.errorBand1DNotSupport("tension")),{...f,transform:n,layer:[...g({partName:"band",mark:y,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:p}),...g({partName:"borders",mark:v,positionPrefix:"lower",extraEncoding:p}),...g({partName:"borders",mark:v,positionPrefix:"upper",extraEncoding:p})]}}},55833:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ERRORBAR:()=>c,ERRORBAR_PARTS:()=>d,errorBarNormalizer:()=>f,errorBarParams:()=>h,normalizeErrorBar:()=>p});var r=n(79543),i=n(98348),a=n(20916),o=n(75028),s=n(79989),l=n(88655),u=n(867);const c="errorbar",d=["ticks","rule"],f=new l.CompositeMarkNormalizer(c,p);function p(e,{config:t}){e={...e,encoding:(0,i.normalizeEncoding)(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:a,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:l,outerSpec:d,tooltipEncoding:f}=h(e,c,t);delete o.size;const p=(0,u.makeCompositeAggregatePartFactory)(l,a,r,o,t.errorbar),g=l.thickness,m=l.size,y={type:"tick",orient:s,aria:!1,...void 0!==g?{thickness:g}:{},...void 0!==m?{size:m}:{}},v=[...p({partName:"ticks",mark:y,positionPrefix:"lower",extraEncoding:f}),...p({partName:"ticks",mark:y,positionPrefix:"upper",extraEncoding:f}),...p({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==g?{size:g}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:f})];return{...d,transform:n,...v.length>1?{layer:v}:{...v[0]}}}function h(e,t,n){const{mark:l,encoding:c,params:d,projection:f,...p}=e,h=(0,o.isMarkDef)(l)?l:{type:l};d&&a.warn(a.message.selectionNotSupported(t));const{orient:m,inputType:y}=function(e,t){const{encoding:n}=e;if(function(e){return((0,r.isFieldOrDatumDef)(e.x)||(0,r.isFieldOrDatumDef)(e.y))&&!(0,r.isFieldOrDatumDef)(e.x2)&&!(0,r.isFieldOrDatumDef)(e.y2)&&!(0,r.isFieldOrDatumDef)(e.xError)&&!(0,r.isFieldOrDatumDef)(e.xError2)&&!(0,r.isFieldOrDatumDef)(e.yError)&&!(0,r.isFieldOrDatumDef)(e.yError2)}(n))return{orient:(0,u.compositeMarkOrient)(e,t),inputType:"raw"};const i=function(e){return(0,r.isFieldOrDatumDef)(e.x2)||(0,r.isFieldOrDatumDef)(e.y2)}(n),a=function(e){return(0,r.isFieldOrDatumDef)(e.xError)||(0,r.isFieldOrDatumDef)(e.xError2)||(0,r.isFieldOrDatumDef)(e.yError)||(0,r.isFieldOrDatumDef)(e.yError2)}(n),o=n.x,s=n.y;if(i){if(a)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,i=n.y2;if((0,r.isFieldOrDatumDef)(e)&&(0,r.isFieldOrDatumDef)(i))throw new Error(`${t} cannot have both x2 and y2`);if((0,r.isFieldOrDatumDef)(e)){if((0,r.isContinuousFieldOrDatumDef)(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if((0,r.isFieldOrDatumDef)(i)){if((0,r.isContinuousFieldOrDatumDef)(s))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")}{const e=n.xError,i=n.xError2,a=n.yError,l=n.yError2;if((0,r.isFieldOrDatumDef)(i)&&!(0,r.isFieldOrDatumDef)(e))throw new Error(`${t} cannot have xError2 without xError`);if((0,r.isFieldOrDatumDef)(l)&&!(0,r.isFieldOrDatumDef)(a))throw new Error(`${t} cannot have yError2 without yError`);if((0,r.isFieldOrDatumDef)(e)&&(0,r.isFieldOrDatumDef)(a))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if((0,r.isFieldOrDatumDef)(e)){if((0,r.isContinuousFieldOrDatumDef)(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if((0,r.isFieldOrDatumDef)(a)){if((0,r.isContinuousFieldOrDatumDef)(s))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")}}(e,t),{continuousAxisChannelDef:v,continuousAxisChannelDef2:b,continuousAxisChannelDefError:w,continuousAxisChannelDefError2:x,continuousAxis:E}=(0,u.compositeMarkContinuousAxis)(e,m,t),{errorBarSpecificAggregate:S,postAggregateCalculates:_,tooltipSummary:A,tooltipTitleWithFieldName:C}=function(e,t,n,i,o,l,u,c){let d=[],f=[];const p=t.field;let h,m=!1;if("raw"===l){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":c.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&a.warn(a.message.errorBarCenterIsUsedWithWrongExtent(t,n,u)),"stderr"===n||"stdev"===n)d=[{op:n,field:p,as:`extent_${p}`},{op:t,field:p,as:`center_${p}`}],f=[{calculate:`datum["center_${p}"] + datum["extent_${p}"]`,as:`upper_${p}`},{calculate:`datum["center_${p}"] - datum["extent_${p}"]`,as:`lower_${p}`}],h=[{fieldPrefix:"center_",titlePrefix:(0,s.titleCase)(t)},{fieldPrefix:"upper_",titlePrefix:g(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:g(t,n,"-")}],m=!0;else{let e,t,i;"ci"===n?(e="mean",t="ci0",i="ci1"):(e="median",t="q1",i="q3"),d=[{op:t,field:p,as:`lower_${p}`},{op:i,field:p,as:`upper_${p}`},{op:e,field:p,as:`center_${p}`}],h=[{fieldPrefix:"upper_",titlePrefix:(0,r.title)({field:p,aggregate:i,type:"quantitative"},c,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:(0,r.title)({field:p,aggregate:t,type:"quantitative"},c,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:(0,r.title)({field:p,aggregate:e,type:"quantitative"},c,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&a.warn(a.message.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent)),"aggregated-upper-lower"===l?(h=[],f=[{calculate:`datum["${n.field}"]`,as:`upper_${p}`},{calculate:`datum["${p}"]`,as:`lower_${p}`}]):"aggregated-error"===l&&(h=[{fieldPrefix:"",titlePrefix:p}],f=[{calculate:`datum["${p}"] + datum["${i.field}"]`,as:`upper_${p}`}],o?f.push({calculate:`datum["${p}"] + datum["${o.field}"]`,as:`lower_${p}`}):f.push({calculate:`datum["${p}"] - datum["${i.field}"]`,as:`lower_${p}`}));for(const e of f)h.push({fieldPrefix:e.as.substring(0,6),titlePrefix:(0,s.replaceAll)((0,s.replaceAll)(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:f,errorBarSpecificAggregate:d,tooltipSummary:h,tooltipTitleWithFieldName:m}}(h,v,b,w,x,y,t,n),{[E]:T,["x"===E?"x2":"y2"]:k,["x"===E?"xError":"yError"]:R,["x"===E?"xError2":"yError2"]:D,...O}=c,{bins:N,timeUnits:F,aggregate:P,groupby:M,encoding:I}=(0,i.extractTransformsFromEncoding)(O,n),$=[...P,...S],L="raw"!==y?[]:M,B=(0,u.getCompositeMarkTooltip)(A,v,I,C);return{transform:[...p.transform??[],...N,...F,...0===$.length?[]:[{aggregate:$,groupby:L}],..._],groupby:L,continuousAxisChannelDef:v,continuousAxis:E,encodingWithoutContinuousAxis:I,ticksOrient:"vertical"===m?"horizontal":"vertical",markDef:h,outerSpec:p,tooltipEncoding:B}}function g(e,t,n){return`${(0,s.titleCase)(e)} ${n} ${t}`}},19760:(e,t,n)=>{"use strict";n.r(t),n.d(t,{add:()=>u,getAllCompositeMarks:()=>d,remove:()=>c});var r=n(79989),i=n(88655),a=n(67982),o=n(52365),s=n(55833);const l={};function u(e,t,n){const r=new i.CompositeMarkNormalizer(e,t);l[e]={normalizer:r,parts:n}}function c(e){delete l[e]}function d(){return(0,r.keys)(l)}u(a.BOXPLOT,a.normalizeBoxPlot,a.BOXPLOT_PARTS),u(s.ERRORBAR,s.normalizeErrorBar,s.ERRORBAR_PARTS),u(o.ERRORBAND,o.normalizeErrorBand,o.ERRORBAND_PARTS)},24007:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_COLOR:()=>T,DEFAULT_FONT_SIZE:()=>C,DEFAULT_STEP:()=>x,colorSignalConfig:()=>k,defaultConfig:()=>_,defaultViewConfig:()=>E,fontConfig:()=>D,fontSizeSignalConfig:()=>R,getViewConfigContinuousSize:()=>v,getViewConfigDiscreteSize:()=>w,getViewConfigDiscreteStep:()=>b,initConfig:()=>F,isVgScheme:()=>S,stripAndRedirectConfig:()=>$});var r=n(26372),i=n(65032),a=n(15058),o=n(19760),s=n(3802),l=n(19609),u=n(41028),c=n(54116),d=n(75028),f=n(54778),p=n(31179),h=n(84847),g=n(89820),m=n(76447),y=n(79989);function v(e,t){return e[t]??e["width"===t?"continuousWidth":"continuousHeight"]}function b(e,t){const n=w(e,t);return(0,g.isStep)(n)?n.step:x}function w(e,t){const n=e[t]??e["width"===t?"discreteWidth":"discreteHeight"];return(0,y.getFirstDefined)(n,{step:e.step})}const x=20,E={continuousWidth:200,continuousHeight:200,step:x};function S(e){return(0,y.hasProperty)(e,"scheme")}const _={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:E,mark:d.defaultMarkConfig,arc:{},area:{},bar:d.defaultBarConfig,circle:{},geoshape:{},image:{},line:{},point:{},rect:d.defaultRectConfig,rule:{color:"black"},square:{},text:{color:"black"},tick:d.defaultTickConfig,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:p.defaultScaleConfig,projection:{},legend:c.defaultLegendConfig,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:h.defaultConfig,style:{},title:{},facet:{spacing:g.DEFAULT_SPACING},concat:{spacing:g.DEFAULT_SPACING},normalizedNumberFormat:".0%"},A=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],C={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},T={blue:A[0],orange:A[1],red:A[2],teal:A[3],green:A[4],yellow:A[5],purple:A[6],pink:A[7],brown:A[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 k(e={}){return{signals:[{name:"color",value:(0,r.isObject)(e)?{...T,...e}:T}],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 R(e){return{signals:[{name:"fontSize",value:(0,r.isObject)(e)?{...C,...e}:C}],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 D(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function O(e){const t=(0,y.keys)(e||{}),n={};for(const r of t){const t=e[r];n[r]=(0,i.isConditionalAxisValue)(t)?(0,a.signalOrValueRefWithCondition)(t):(0,a.signalRefOrValue)(t)}return n}const N=[...d.MARK_CONFIGS,...i.AXIS_CONFIGS,...u.HEADER_CONFIGS,"background","padding","legend","lineBreak","scale","style","title","view"];function F(e={}){const{color:t,font:n,fontSize:o,selection:l,...c}=e,f=(0,r.mergeConfig)({},(0,y.duplicate)(_),n?D(n):{},t?k(t):{},o?R(o):{},c||{});l&&(0,r.writeConfig)(f,"selection",l,!0);const p=(0,y.omit)(f,N);for(const e of["background","lineBreak","padding"])f[e]&&(p[e]=(0,a.signalRefOrValue)(f[e]));for(const e of d.MARK_CONFIGS)f[e]&&(p[e]=(0,s.replaceExprRef)(f[e]));for(const e of i.AXIS_CONFIGS)f[e]&&(p[e]=O(f[e]));for(const e of u.HEADER_CONFIGS)f[e]&&(p[e]=(0,s.replaceExprRef)(f[e]));if(f.legend&&(p.legend=(0,s.replaceExprRef)(f.legend)),f.scale){const{invalid:e,...t}=f.scale,n=(0,s.replaceExprRef)(e,{level:1});p.scale={...(0,s.replaceExprRef)(t),...(0,y.keys)(n).length>0?{invalid:n}:{}}}return f.style&&(p.style=function(e){const t=(0,y.keys)(e),n={};for(const r of t)n[r]=O(e[r]);return n}(f.style)),f.title&&(p.title=(0,s.replaceExprRef)(f.title)),f.view&&(p.view=(0,s.replaceExprRef)(f.view)),p}const P=new Set(["view",...d.PRIMITIVE_MARKS]),M=["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"],I={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...d.VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX};function $(e){e=(0,y.duplicate)(e);for(const t of M)delete e[t];if(e.axis)for(const t in e.axis)(0,i.isConditionalAxisValue)(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of l.VL_ONLY_LEGEND_CONFIG)delete e.legend[t];if(e.mark){for(const t of d.VL_ONLY_MARK_CONFIG_PROPERTIES)delete e.mark[t];e.mark.tooltip&&(0,r.isObject)(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat((0,f.assembleParameterSignals)(e.params)),delete e.params);for(const t of P){for(const n of d.VL_ONLY_MARK_CONFIG_PROPERTIES)delete e[t][n];const n=I[t];if(n)for(const r of n)delete e[t][r];L(e,t)}for(const t of(0,o.getAllCompositeMarks)())delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=(0,m.extractTitleConfig)(e.title);(0,y.isEmpty)(t)||(e.style["group-title"]={...e.style["group-title"],...t}),(0,y.isEmpty)(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),(0,y.isEmpty)(r)?delete e.title:e.title=r}(e);for(const t in e)(0,r.isObject)(e[t])&&(0,y.isEmpty)(e[t])&&delete e[t];return(0,y.isEmpty)(e)?void 0:e}function L(e,t,n,r){"view"===t&&(n="cell");const i={...r?e[t][r]:e[t],...e.style[n??t]};(0,y.isEmpty)(i)||(e.style[n??t]=i),r||delete e[t]}},89081:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DataSourceType:()=>r,isGenerator:()=>l,isGraticuleGenerator:()=>d,isInlineData:()=>o,isNamedData:()=>s,isSequenceGenerator:()=>u,isSphereGenerator:()=>c,isUrlData:()=>a});var r,i=n(79989);function a(e){return(0,i.hasProperty)(e,"url")}function o(e){return(0,i.hasProperty)(e,"values")}function s(e){return(0,i.hasProperty)(e,"name")&&!a(e)&&!o(e)&&!l(e)}function l(e){return e&&(u(e)||c(e)||d(e))}function u(e){return(0,i.hasProperty)(e,"sequence")}function c(e){return(0,i.hasProperty)(e,"sphere")}function d(e){return(0,i.hasProperty)(e,"graticule")}!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"}(r||(r={}))},20032:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DAYS:()=>c,MONTHS:()=>l,SHORT_DAYS:()=>d,SHORT_MONTHS:()=>u,dateTimeExprToExpr:()=>h,dateTimeToExpr:()=>p,dateTimeToTimestamp:()=>g,isDateTime:()=>s});var r=n(26372),i=n(20916),a=n(96598),o=n(79989);function s(e){if(e&&(0,r.isObject)(e))for(const t of a.TIMEUNIT_PARTS)if((0,o.hasProperty)(e,t))return!0;return!1}const l=["january","february","march","april","may","june","july","august","september","october","november","december"],u=l.map((e=>e.substr(0,3))),c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],d=c.map((e=>e.substr(0,3)));function f(e,t){const n=[];if(t&&void 0!==e.day&&(0,o.keys)(e).length>1&&(i.warn(i.message.droppedDay(e)),delete(e=(0,o.duplicate)(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const a=t?function(e){if((0,o.isNumeric)(e)&&(e=+e),(0,r.isNumber)(e))return e-1;{const t=e.toLowerCase(),n=l.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),a=u.indexOf(r);if(-1!==a)return a;throw new Error(i.message.invalidTimeUnit("month",e))}}(e.month):e.month;n.push(a)}else if(void 0!==e.quarter){const a=t?function(e){if((0,o.isNumeric)(e)&&(e=+e),(0,r.isNumber)(e))return e>4&&i.warn(i.message.invalidTimeUnit("quarter",e)),e-1;throw new Error(i.message.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;n.push((0,r.isNumber)(a)?3*a:`${a}*3`)}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const a=t?function(e){if((0,o.isNumeric)(e)&&(e=+e),(0,r.isNumber)(e))return e%7;{const t=e.toLowerCase(),n=c.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),a=d.indexOf(r);if(-1!==a)return a;throw new Error(i.message.invalidTimeUnit("day",e))}}(e.day):e.day;n.push((0,r.isNumber)(a)?a+1:`${a}+1`)}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function p(e){const t=f(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}function h(e){const t=f(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}function g(e){const t=f(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}},98348:(e,t,n)=>{"use strict";n.r(t),n.d(t,{channelHasField:()=>p,channelHasFieldOrDatum:()=>h,channelHasNestedOffsetScale:()=>g,extractTransformsFromEncoding:()=>y,fieldDefs:()=>x,forEach:()=>E,initEncoding:()=>b,isAggregate:()=>m,markChannelCompatible:()=>v,normalizeEncoding:()=>w,pathGroupingFields:()=>_,reduce:()=>S});var r=n(26372),i=n(54814),a=n(19664),o=n(95290),s=n(79543),l=n(20916),u=n(99273),c=n(79989),d=n(5711),f=n(96598);function p(e,t){const n=e&&e[t];return!!n&&((0,r.isArray)(n)?(0,c.some)(n,(e=>!!e.field)):(0,s.isFieldDef)(n)||(0,s.hasConditionalFieldDef)(n))}function h(e,t){const n=e&&e[t];return!!n&&((0,r.isArray)(n)?(0,c.some)(n,(e=>!!e.field)):(0,s.isFieldDef)(n)||(0,s.isDatumDef)(n)||(0,s.hasConditionalFieldOrDatumDef)(n))}function g(e,t){if((0,o.isXorY)(t)){const n=e[t];if(((0,s.isFieldDef)(n)||(0,s.isDatumDef)(n))&&((0,u.isDiscrete)(n.type)||(0,s.isFieldDef)(n)&&n.timeUnit))return h(e,(0,o.getOffsetScaleChannel)(t))}return!1}function m(e){return(0,c.some)(o.CHANNELS,(t=>{if(p(e,t)){const n=e[t];if((0,r.isArray)(n))return(0,c.some)(n,(e=>!!e.aggregate));{const e=(0,s.getFieldDef)(n);return e&&!!e.aggregate}}return!1}))}function y(e,t){const n=[],r=[],l=[],c=[],d={};return E(e,((p,h)=>{if((0,s.isFieldDef)(p)){const{field:g,aggregate:m,bin:y,timeUnit:v,...b}=p;if(m||v||y){const e=(0,s.getGuide)(p),w=e?.title;let x=(0,s.vgField)(p,{forAs:!0});const E={...w?[]:{title:(0,s.title)(p,t,{allowDisabling:!0})},...b,field:x};if(m){let e;if((0,i.isArgmaxDef)(m)?(e="argmax",x=(0,s.vgField)({op:"argmax",field:m.argmax},{forAs:!0}),E.field=`${x}.${g}`):(0,i.isArgminDef)(m)?(e="argmin",x=(0,s.vgField)({op:"argmin",field:m.argmin},{forAs:!0}),E.field=`${x}.${g}`):"boxplot"!==m&&"errorbar"!==m&&"errorband"!==m&&(e=m),e){const t={op:e,as:x};g&&(t.field=g),c.push(t)}}else if(n.push(x),(0,s.isTypedFieldDef)(p)&&(0,a.isBinning)(y)){if(r.push({bin:y,field:g,as:x}),n.push((0,s.vgField)(p,{binSuffix:"end"})),(0,s.binRequiresRange)(p,h)&&n.push((0,s.vgField)(p,{binSuffix:"range"})),(0,o.isXorY)(h)){const e={field:`${x}_end`};d[`${h}2`]=e}E.bin="binned",(0,o.isSecondaryRangeChannel)(h)||(E.type=u.QUANTITATIVE)}else if(v&&!(0,f.isBinnedTimeUnit)(v)){l.push({timeUnit:v,field:g,as:x});const e=(0,s.isTypedFieldDef)(p)&&p.type!==u.TEMPORAL&&"time";e&&(h===o.TEXT||h===o.TOOLTIP?E.formatType=e:(0,o.isNonPositionScaleChannel)(h)?E.legend={formatType:e,...E.legend}:(0,o.isXorY)(h)&&(E.axis={formatType:e,...E.axis}))}d[h]=E}else n.push(g),d[h]=e[h]}else d[h]=e[h]})),{bins:r,timeUnits:l,aggregate:c,groupby:n,encoding:d}}function v(e,t,n){const r=(0,o.supportMark)(t,n);if(!r)return!1;if("binned"===r){const n=e[t===o.X2?o.X:o.Y];return!!((0,s.isFieldDef)(n)&&(0,s.isFieldDef)(e[t])&&(0,a.isBinned)(n.bin))}return!0}function b(e,t,n,i){const a={};for(const t of(0,c.keys)(e))(0,o.isChannel)(t)||l.warn(l.message.invalidEncodingChannel(t));for(let c of o.UNIT_CHANNELS){if(!e[c])continue;const f=e[c];if((0,o.isXorYOffset)(c)){const e=(0,o.getMainChannelFromOffsetChannel)(c),t=a[e];if((0,s.isFieldDef)(t)&&(0,u.isContinuous)(t.type)&&(0,s.isFieldDef)(f)&&!t.timeUnit){l.warn(l.message.offsetNestedInsideContinuousPositionScaleDropped(e));continue}}if("angle"!==c||"arc"!==t||e.theta||(l.warn(l.message.REPLACE_ANGLE_WITH_THETA),c=o.THETA),v(e,c,t)){if(c===o.SIZE&&"line"===t){const t=(0,s.getFieldDef)(e[c]);if(t?.aggregate){l.warn(l.message.LINE_WITH_VARYING_SIZE);continue}}if(c===o.COLOR&&(n?"fill"in e:"stroke"in e))l.warn(l.message.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(c===o.DETAIL||c===o.ORDER&&!(0,r.isArray)(f)&&!(0,s.isValueDef)(f)||c===o.TOOLTIP&&(0,r.isArray)(f)){if(f){if(c===o.ORDER){const t=e[c];if((0,s.isOrderOnlyDef)(t)){a[c]=t;continue}}a[c]=(0,r.array)(f).reduce(((e,t)=>((0,s.isFieldDef)(t)?e.push((0,s.initFieldDef)(t,c)):l.warn(l.message.emptyFieldDef(t,c)),e)),[])}}else{if(c===o.TOOLTIP&&null===f)a[c]=null;else if(!((0,s.isFieldDef)(f)||(0,s.isDatumDef)(f)||(0,s.isValueDef)(f)||(0,s.isConditionalDef)(f)||(0,d.isSignalRef)(f))){l.warn(l.message.emptyFieldDef(f,c));continue}a[c]=(0,s.initChannelDef)(f,c,i)}}else l.warn(l.message.incompatibleChannel(c,t))}return a}function w(e,t){const n={};for(const r of(0,c.keys)(e)){const i=(0,s.initChannelDef)(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function x(e){const t=[];for(const n of(0,c.keys)(e))if(p(e,n)){const i=e[n],a=(0,r.array)(i);for(const e of a)(0,s.isFieldDef)(e)?t.push(e):(0,s.hasConditionalFieldDef)(e)&&t.push(e.condition)}return t}function E(e,t,n){if(e)for(const i of(0,c.keys)(e)){const a=e[i];if((0,r.isArray)(a))for(const e of a)t.call(n,e,i);else t.call(n,a,i)}}function S(e,t,n,i){return e?(0,c.keys)(e).reduce(((n,a)=>{const o=e[a];return(0,r.isArray)(o)?o.reduce(((e,n)=>t.call(i,e,n,a)),n):t.call(i,n,o,a)}),n):n}function _(e,t){return(0,c.keys)(t).reduce(((n,i)=>{switch(i){case o.X:case o.Y:case o.HREF:case o.DESCRIPTION:case o.URL:case o.X2:case o.Y2:case o.XOFFSET:case o.YOFFSET:case o.THETA:case o.THETA2:case o.RADIUS:case o.RADIUS2:case o.LATITUDE:case o.LONGITUDE:case o.LATITUDE2:case o.LONGITUDE2:case o.TEXT:case o.SHAPE:case o.ANGLE:case o.TOOLTIP:return n;case o.ORDER:if("line"===e||"trail"===e)return n;case o.DETAIL:case o.KEY:{const e=t[i];if((0,r.isArray)(e)||(0,s.isFieldDef)(e))for(const t of(0,r.array)(e))t.aggregate||n.push((0,s.vgField)(t,{}));return n}case o.SIZE:if("trail"===e)return n;case o.COLOR:case o.FILL:case o.STROKE:case o.OPACITY:case o.FILLOPACITY:case o.STROKEOPACITY:case o.STROKEDASH:case o.STROKEWIDTH:{const e=(0,s.getFieldDef)(t[i]);return e&&!e.aggregate&&n.push((0,s.vgField)(e,{})),n}}}),[])}},3802:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isExprRef:()=>a,replaceExprRef:()=>o});var r=n(15058),i=n(79989);function a(e){return(0,i.hasProperty)(e,"expr")}function o(e,{level:t}={level:0}){const n=(0,i.keys)(e||{}),a={};for(const i of n)a[i]=0===t?(0,r.signalRefOrValue)(e[i]):o(e[i],{level:t-1});return a}},19609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{VL_ONLY_LEGEND_CONFIG:()=>r});const r=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"]},41028:(e,t,n)=>{"use strict";n.r(t),n.d(t,{HEADER_CONFIGS:()=>l,HEADER_LABEL_PROPERTIES:()=>s,HEADER_LABEL_PROPERTIES_MAP:()=>a,HEADER_TITLE_PROPERTIES:()=>o,HEADER_TITLE_PROPERTIES_MAP:()=>i});var r=n(79989);const i={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"},a={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"},o=(0,r.keys)(i),s=(0,r.keys)(a),l=(0,r.keys)({header:1,headerRow:1,headerColumn:1,headerFacet:1})},78405:(e,t,n)=>{"use strict";n.r(t),n.d(t,{accessPathDepth:()=>o.accessPathDepth,accessPathWithDatum:()=>o.accessPathWithDatum,compile:()=>i.compile,contains:()=>o.contains,deepEqual:()=>o.deepEqual,deleteNestedProperty:()=>o.deleteNestedProperty,duplicate:()=>o.duplicate,entries:()=>o.entries,every:()=>o.every,fieldIntersection:()=>o.fieldIntersection,flatAccessWithDatum:()=>o.flatAccessWithDatum,getFirstDefined:()=>o.getFirstDefined,hasIntersection:()=>o.hasIntersection,hasProperty:()=>o.hasProperty,hash:()=>o.hash,internalField:()=>o.internalField,isBoolean:()=>o.isBoolean,isEmpty:()=>o.isEmpty,isEqual:()=>o.isEqual,isInternalField:()=>o.isInternalField,isNullOrFalse:()=>o.isNullOrFalse,isNumeric:()=>o.isNumeric,keys:()=>o.keys,logicalExpr:()=>o.logicalExpr,mergeDeep:()=>o.mergeDeep,never:()=>o.never,normalize:()=>a.normalize,normalizeAngle:()=>o.normalizeAngle,omit:()=>o.omit,pick:()=>o.pick,prefixGenerator:()=>o.prefixGenerator,removePathFromField:()=>o.removePathFromField,replaceAll:()=>o.replaceAll,replacePathInField:()=>o.replacePathInField,resetIdCounter:()=>o.resetIdCounter,setEqual:()=>o.setEqual,some:()=>o.some,stringify:()=>o.stringify,titleCase:()=>o.titleCase,unique:()=>o.unique,uniqueId:()=>o.uniqueId,vals:()=>o.vals,varName:()=>o.varName,version:()=>s});var r=n(67383),i=n(48166),a=n(59621),o=n(79989);const s=r.version},68278:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isScaleInvalidDataIncludeAsValue:()=>i});var r=n(26372);function i(e){return(0,r.isObject)(e)&&"value"in e}},54116:(e,t,n)=>{"use strict";n.r(t),n.d(t,{COMMON_LEGEND_PROPERTY_INDEX:()=>o,LEGEND_PROPERTIES:()=>s,LEGEND_SCALE_CHANNELS:()=>i,defaultLegendConfig:()=>a});var r=n(79989);const i=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],a={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},o={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},s=(0,r.keys)(o)},20916:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LocalLogger:()=>u,debug:()=>m,error:()=>p,info:()=>g,message:()=>a,reset:()=>f,set:()=>d,warn:()=>h,wrap:()=>c});var r,i=n(26372),a=n(87039),o=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const s=(0,i.logger)(i.Warn);let l=s;class u{constructor(){this.warns=[],this.infos=[],this.debugs=[],r.set(this,i.Warn)}level(e){return e?(function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(this,r,e,"f"),this):o(this,r,"f")}warn(...e){return o(this,r,"f")>=i.Warn&&this.warns.push(...e),this}info(...e){return o(this,r,"f")>=i.Info&&this.infos.push(...e),this}debug(...e){return o(this,r,"f")>=i.Debug&&this.debugs.push(...e),this}error(...e){if(o(this,r,"f")>=i.Error)throw Error(...e);return this}}function c(e){return()=>{l=new u,e(l),f()}}function d(e){return l=e,l}function f(){return l=s,l}function p(...e){l.error(...e)}function h(...e){l.warn(...e)}function g(...e){l.info(...e)}function m(...e){l.debug(...e)}r=new WeakMap},87039:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ADD_SAME_CHILD_TWICE:()=>k,CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:()=>ee,CONCAT_CANNOT_SHARE_AXIS:()=>A,FACETED_INDEPENDENT_DIFFERENT_SOURCES:()=>ye,FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES:()=>ve,FACETED_INDEPENDENT_SAME_SOURCE:()=>be,FIT_NON_SINGLE:()=>o,INTERVAL_INITIALIZED_WITH_POS:()=>E,INVALID_CHANNEL_FOR_AXIS:()=>we,LEGEND_BINDINGS_MUST_HAVE_PROJECTION:()=>v,LINE_WITH_VARYING_SIZE:()=>j,MORE_THAN_ONE_SORT:()=>me,NEEDS_SAME_SELECTION:()=>x,NO_FIELDS_NEEDS_AS:()=>D,REPLACE_ANGLE_WITH_THETA:()=>F,SCALE_BINDINGS_CONTINUOUS:()=>m,SEQUENTIAL_SCALE_DEPRECATED:()=>y,cannotApplySizeToNonOrientedMark:()=>oe,cannotLookupVariableParameter:()=>b,cannotProjectAggregate:()=>f,cannotProjectOnChannelWithoutField:()=>d,cannotStackRangedMark:()=>xe,cannotUseRelativeBandSizeWithNonBandScale:()=>ne,cannotUseScalePropertyWithNonColor:()=>te,channelRequiredForBinned:()=>De,channelShouldBeDiscrete:()=>W,channelShouldBeDiscreteOrDiscretizing:()=>Y,channelShouldNotBeUsedForBinned:()=>Oe,columnsNotSupportByRowCol:()=>_,containerSizeNonSingle:()=>s,containerSizeNotCompatibleWithAutosize:()=>l,customFormatTypeNotAllowed:()=>O,differentParse:()=>T,discreteChannelCannotEncode:()=>K,domainRequiredForThresholdScale:()=>Ne,domainSortDropped:()=>ge,droppedDay:()=>Ae,droppingColor:()=>U,droppingFit:()=>u,emptyFieldDef:()=>q,errorBand1DNotSupport:()=>Re,errorBarCenterAndExtentAreNotNeeded:()=>Ce,errorBarCenterIsUsedWithWrongExtent:()=>Te,errorBarContinuousAxisHasCustomizedAggregate:()=>ke,facetChannelDropped:()=>X,incompatibleChannel:()=>H,independentScaleMeansIndependentGuide:()=>he,invalidAggregate:()=>L,invalidEncodingChannel:()=>V,invalidFieldType:()=>I,invalidFieldTypeForCountAggregate:()=>$,invalidSpec:()=>a,invalidTimeUnit:()=>_e,invalidTransformIgnored:()=>R,lineWithRange:()=>Q,mergeConflictingDomainProperty:()=>pe,mergeConflictingProperty:()=>fe,missingFieldType:()=>B,nearestNotSupportForContinuous:()=>p,noSameUnitLookup:()=>w,noSuchRepeatedValue:()=>S,offsetEncodingScaleIgnored:()=>G,offsetNestedInsideContinuousPositionScaleDropped:()=>P,orientOverridden:()=>Z,primitiveChannelDef:()=>M,projectionOverridden:()=>N,rangeMarkAlignmentCannotBeExpression:()=>J,relativeBandSizeNotSupported:()=>z,scalePropertyNotWorkWithScaleType:()=>ue,scaleTypeNotWorkWithChannel:()=>se,scaleTypeNotWorkWithFieldDef:()=>le,scaleTypeNotWorkWithMark:()=>ce,selectionNotFound:()=>g,selectionNotSupported:()=>h,stackNonLinearScale:()=>Ee,stackNonSummativeAggregate:()=>Se,stepDropped:()=>de,unaggregateDomainHasNoEffectForRawField:()=>re,unaggregateDomainWithNonSharedDomainOp:()=>ie,unaggregatedDomainWithLogScale:()=>ae,unknownField:()=>c,unrecognizedParse:()=>C});var r=n(95290),i=n(79989);function a(e){return`Invalid specification ${(0,i.stringify)(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const o='Autosize "fit" only works for single views and layered views.';function s(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function l(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function u(e){return e?`Dropping "fit-${e}" because spec has discrete ${(0,r.getSizeChannel)(e)}.`:'Dropping "fit" because spec has discrete size.'}function c(e){return`Unknown field for ${e}. Cannot calculate view size.`}function d(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function f(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function p(e){return`The "nearest" transform is not supported for ${e} marks.`}function h(e){return`Selection not supported for ${e} yet.`}function g(e){return`Cannot find a selection named "${e}".`}const m="Scale bindings are currently only supported for scales with unbinned, continuous domains.",y="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",v="Legend bindings are only supported for selections over an individual field or encoding channel.";function b(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function w(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const x="The same selection must be used to override scale domains in a layered view.",E='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function S(e){return`Unknown repeated value "${e}".`}function _(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const A="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function C(e){return`Unrecognized parse "${e}".`}function T(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const k="Attempt to add the same child twice.";function R(e){return`Ignoring an invalid transform: ${(0,i.stringify)(e)}.`}const D='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 O(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function N(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${(0,i.stringify)(t)} is overridden by a child projection ${(0,i.stringify)(n)}.`}const F="Arc marks uses theta channel rather than angle, replacing angle with theta.";function P(e){return`${e}Offset dropped because ${e} is continuous`}function M(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${(0,i.stringify)(n)}}.`}function I(e){return`Invalid field type "${e}".`}function $(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function L(e){return`Invalid aggregation operator "${e}".`}function B(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function U(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function z(e){return`Position range does not support relative band size for ${e}.`}function q(e,t){return`Dropping ${(0,i.stringify)(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const j="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function H(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function G(e){return`${e} encoding has no scale, so specified scale is ignored.`}function V(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function W(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Y(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function X(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function K(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function J(e){return`The ${e} for range marks cannot be an expression`}function Q(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 Z(e,t){return`Specified orient "${e}" overridden with "${t}".`}const ee="Custom domain scale cannot be unioned with default field-based domain.";function te(e){return`Cannot use the scale property "${e}" with non-color channel.`}function ne(e){return`Cannot use the relative band size with ${e} scale.`}function re(e){return`Using unaggregated domain with raw field has no effect (${(0,i.stringify)(e)}).`}function ie(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ae(e){return`Unaggregated domain is currently unsupported for log scale (${(0,i.stringify)(e)}).`}function oe(e){return`Cannot apply size to non-oriented mark "${e}".`}function se(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function le(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function ue(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function ce(e,t){return`Scale type "${t}" does not work with mark "${e}".`}function de(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}function fe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${(0,i.stringify)(n)} and ${(0,i.stringify)(r)}). Using ${(0,i.stringify)(n)}.`}function pe(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${(0,i.stringify)(n)} and ${(0,i.stringify)(r)}). Using the union of the two domains.`}function he(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 ge(e){return`Dropping sort property ${(0,i.stringify)(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const me="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",ye="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.",ve="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.",be="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.",we="Invalid channel for axis.";function xe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Ee(e){return`Stack is applied to a non-linear scale (${e}).`}function Se(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function _e(e,t){return`Invalid ${e}: ${(0,i.stringify)(t)}.`}function Ae(e){return`Dropping day from datetime ${(0,i.stringify)(e)} as day cannot be combined with other units.`}function Ce(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Te(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function ke(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function Re(e){return`1D error band does not support ${e}.`}function De(e){return`Channel ${e} is required for "binned" bin.`}function Oe(e){return`Channel ${e} should not be used with "binned" bin.`}function Ne(e){return`Domain for ${e} is required for threshold scale.`}},90386:(e,t,n)=>{"use strict";n.r(t),n.d(t,{forEachLeaf:()=>s,isLogicalAnd:()=>a,isLogicalNot:()=>o,isLogicalOr:()=>i,normalizeLogicalComposition:()=>l});var r=n(79989);function i(e){return(0,r.hasProperty)(e,"or")}function a(e){return(0,r.hasProperty)(e,"and")}function o(e){return(0,r.hasProperty)(e,"not")}function s(e,t){if(o(e))s(e.not,t);else if(a(e))for(const n of e.and)s(n,t);else if(i(e))for(const n of e.or)s(n,t);else t(e)}function l(e,t){return o(e)?{not:l(e.not,t)}:a(e)?{and:e.and.map((e=>l(e,t)))}:i(e)?{or:e.or.map((e=>l(e,t)))}:t(e)}},75028:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ARC:()=>o,AREA:()=>s,BAR:()=>l,BAR_CORNER_RADIUS_INDEX:()=>I,CIRCLE:()=>y,FILL_CONFIG:()=>k,FILL_STROKE_CONFIG:()=>R,GEOSHAPE:()=>b,IMAGE:()=>u,LINE:()=>c,MARK_CONFIGS:()=>P,Mark:()=>a,PATH_MARKS:()=>x,POINT:()=>d,PRIMITIVE_MARKS:()=>_,RECT:()=>f,RULE:()=>p,SQUARE:()=>v,STROKE_CONFIG:()=>T,TEXT:()=>h,TICK:()=>g,TRAIL:()=>m,VL_ONLY_MARK_CONFIG_PROPERTIES:()=>D,VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX:()=>N,defaultBarConfig:()=>L,defaultMarkConfig:()=>F,defaultRectConfig:()=>$,defaultTickConfig:()=>B,getMarkType:()=>U,isMark:()=>w,isMarkDef:()=>A,isPathMark:()=>E,isPrimitiveMark:()=>C,isRectBasedMark:()=>S,isRelativeBandSize:()=>M});var r=n(26372),i=n(79989);const a={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"},o=a.arc,s=a.area,l=a.bar,u=a.image,c=a.line,d=a.point,f=a.rect,p=a.rule,h=a.text,g=a.tick,m=a.trail,y=a.circle,v=a.square,b=a.geoshape;function w(e){return(0,r.hasOwnProperty)(a,e)}const x=["line","area","trail"];function E(e){return["line","area","trail"].includes(e)}function S(e){return["rect","bar","image","arc","tick"].includes(e)}const _=new Set((0,i.keys)(a));function A(e){return(0,i.hasProperty)(e,"type")}function C(e){const t=A(e)?e.type:e;return _.has(t)}const T=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],k=["fill","fillOpacity"],R=[...T,...k],D=(0,i.keys)({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),O=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],N={area:["line","point"],bar:O,rect:O,line:["point"],tick:["bandSize","thickness",...O]},F={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},P=(0,i.keys)({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});function M(e){return(0,i.hasProperty)(e,"band")}const I={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},L={...$,binSpacing:1},B={...$,thickness:1};function U(e){return A(e)?e.type:e}},52362:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CoreNormalizer:()=>w});var r=n(26372),i=n(95290),a=n(79543),o=n(67982),s=n(52365),l=n(55833),u=n(98348),c=n(20916),d=n(51894),f=n(56811),p=n(31070),h=n(68859),g=n(79989),m=n(5711),y=n(8232),v=n(95741),b=n(56349);class w extends f.SpecMapper{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[o.boxPlotNormalizer,l.errorBarNormalizer,s.errorBandNormalizer,new y.PathOverlayNormalizer,new b.RuleForRangedLineNormalizer]}map(e,t){if((0,h.isUnitSpec)(e)){const n=(0,u.channelHasField)(e.encoding,i.ROW),r=(0,u.channelHasField)(e.encoding,i.COLUMN),a=(0,u.channelHasField)(e.encoding,i.FACET);if(n||r||a)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:r}=t,i=(0,v.replaceRepeaterInEncoding)(e.encoding,t.repeater),a={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{},...i?{encoding:i}:{}};if(n||r)return this.mapUnitWithParentEncodingOrProjection(a,t);const o=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(a,t.config))return e.run(a,t,o);return a}mapRepeat(e,t){return(0,p.isLayerRepeatSpec)(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:r,...i}=e,{row:a,column:o,layer:s}=n,{repeater:l={},repeaterPrefix:u=""}=t;return a||o?this.mapRepeat({...e,repeat:{...a?{row:a}:{},...o?{column:o}:{}},spec:{repeat:{layer:s},spec:r}},t):{...i,layer:s.map((e=>{const n={...l,layer:e},i=`${(r.name?`${r.name}_`:"")+u}child__layer_${(0,g.varName)(e)}`,a=this.mapLayerOrUnit(r,{...t,repeater:n,repeaterPrefix:i});return a.name=i,a}))}}mapNonLayerRepeat(e,t){const{repeat:n,spec:i,data:a,...o}=e;!(0,r.isArray)(n)&&e.columns&&(e=(0,g.omit)(e,["columns"]),c.warn(c.message.columnsNotSupportByRowCol("repeat")));const s=[],{repeater:l={},repeaterPrefix:u=""}=t,d=!(0,r.isArray)(n)&&n.row||[l?l.row:null],f=!(0,r.isArray)(n)&&n.column||[l?l.column:null],p=(0,r.isArray)(n)&&n||[l?l.repeat:null];for(const e of p)for(const a of d)for(const o of f){const c={repeat:e,row:a,column:o,layer:l.layer},d=(i.name?`${i.name}_`:"")+u+"child__"+((0,r.isArray)(n)?`${(0,g.varName)(e)}`:(n.row?`row_${(0,g.varName)(a)}`:"")+(n.column?`column_${(0,g.varName)(o)}`:"")),f=this.map(i,{...t,repeater:c,repeaterPrefix:d});f.name=d,s.push((0,g.omit)(f,["data"]))}const h=(0,r.isArray)(n)?e.columns:n.column?n.column.length:1;return{data:i.data??a,align:"all",...o,columns:h,concat:s}}mapFacet(e,t){const{facet:n}=e;return(0,d.isFacetMapping)(n)&&e.columns&&(e=(0,g.omit)(e,["columns"]),c.warn(c.message.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:a,config:o}=t,s=E({parentProjection:a,projection:r}),l=x({parentEncoding:i,encoding:(0,v.replaceRepeaterInEncoding)(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...l?{encoding:l}:{}},{config:o})}mapFacetedUnit(e,t){const{row:n,column:r,facet:i,...a}=e.encoding,{mark:o,width:s,projection:l,height:u,view:c,params:d,encoding:f,...p}=e,{facetMapping:h,layout:g}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},t),m=(0,v.replaceRepeaterInEncoding)(a,t.repeater);return this.mapFacet({...p,...g,facet:h,spec:{...s?{width:s}:{},...u?{height:u}:{},...c?{view:c}:{},...l?{projection:l}:{},mark:o,encoding:m,...d?{params:d}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:r,facet:a}=e;if(n||r){a&&c.warn(c.message.facetChannelDropped([...n?[i.ROW]:[],...r?[i.COLUMN]:[]]));const t={},o={};for(const n of[i.ROW,i.COLUMN]){const r=e[n];if(r){const{align:e,center:i,spacing:a,columns:s,...l}=r;t[n]=l;for(const e of["align","center","spacing"])void 0!==r[e]&&(o[e]??(o[e]={}),o[e][n]=r[e])}}return{facetMapping:t,layout:o}}{const{align:e,center:n,spacing:r,columns:i,...o}=a;return{facetMapping:(0,v.replaceRepeaterInFacet)(o,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...r?{spacing:r}:{},...i?{columns:i}:{}}}}}mapLayer(e,{parentEncoding:t,parentProjection:n,...r}){const{encoding:i,projection:a,...o}=e,s={...r,parentEncoding:x({parentEncoding:t,encoding:i,layer:!0}),parentProjection:E({parentProjection:n,projection:a})};return super.mapLayer({...o,...e.name?{name:[s.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{}},s)}}function x({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const o=new Set([...(0,g.keys)(e),...(0,g.keys)(t)]);for(const s of o){const o=t[s],l=e[s];if((0,a.isFieldOrDatumDef)(o)){const e={...l,...o};i[s]=e}else(0,a.hasConditionalFieldOrDatumDef)(o)?i[s]={...o,condition:{...l,...o.condition}}:o||null===o?i[s]=o:(n||(0,a.isValueDef)(l)||(0,m.isSignalRef)(l)||(0,a.isFieldOrDatumDef)(l)||(0,r.isArray)(l))&&(i[s]=l)}}else i=t;return!i||(0,g.isEmpty)(i)?void 0:i}function E(e){const{parentProjection:t,projection:n}=e;return t&&n&&c.warn(c.message.projectionOverridden({parentProjection:t,projection:n})),n??t}},59621:(e,t,n)=>{"use strict";n.r(t),n.d(t,{normalize:()=>d,normalizeAutoSize:()=>m});var r=n(26372),i=n(24007),a=n(20916),o=n(24777),s=n(79989),l=n(52362),u=n(9405),c=n(9794);function d(e,t){void 0===t&&(t=(0,i.initConfig)(e.config));const n=function(e,t={}){const n={config:t};return h.map(f.map(p.map(e,n),n),n)}(e,t),{width:r,height:a}=e,o=m(n,{width:r,height:a,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const f=new l.CoreNormalizer,p=new u.SelectionCompatibilityNormalizer,h=new c.TopLevelSelectionsNormalizer;function g(e){return(0,r.isString)(e)?{type:e}:e??{}}function m(e,t,n){let{width:r,height:i}=t;const l=(0,o.isUnitSpec)(e)||(0,o.isLayerSpec)(e),u={};l?"container"==r&&"container"==i?(u.type="fit",u.contains="padding"):"container"==r?(u.type="fit-x",u.contains="padding"):"container"==i&&(u.type="fit-y",u.contains="padding"):("container"==r&&(a.warn(a.message.containerSizeNonSingle("width")),r=void 0),"container"==i&&(a.warn(a.message.containerSizeNonSingle("height")),i=void 0));const c={type:"pad",...u,...n?g(n.autosize):{},...g(e.autosize)};if("fit"!==c.type||l||(a.warn(a.message.FIT_NON_SINGLE),c.type="pad"),"container"==r&&"fit"!=c.type&&"fit-x"!=c.type&&a.warn(a.message.containerSizeNotCompatibleWithAutosize("width")),"container"==i&&"fit"!=c.type&&"fit-y"!=c.type&&a.warn(a.message.containerSizeNotCompatibleWithAutosize("height")),!(0,s.deepEqual)(c,{type:"pad"}))return c}},8232:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PathOverlayNormalizer:()=>h});var r=n(26372),i=n(98348),a=n(75028),o=n(68859),s=n(68889),l=n(79989),u=n(55823);function c(e){const{point:t,line:n,...r}=e;return(0,l.keys)(r).length>1?r:r.type}function d(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:(0,l.omit)(e[t],["point","line"])});return e}function f(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?(0,r.isObject)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?(0,r.isObject)(t.point)?t.point:{}:void 0}function p(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class h{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if((0,o.isUnitSpec)(e)){const{mark:n,encoding:r}=e,i=(0,a.isMarkDef)(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!f(i,t[i.type],r);case"area":return!!f(i,t[i.type],r)||!!p(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{params:o,projection:h,mark:g,name:m,encoding:y,...v}=e,b=(0,i.normalizeEncoding)(y,r),w=(0,a.isMarkDef)(g)?g:{type:g},x=f(w,r[w.type],b),E="area"===w.type&&p(w,r[w.type]),S=[{name:m,...o?{params:o}:{},mark:c({..."area"===w.type&&void 0===w.opacity&&void 0===w.fillOpacity?{opacity:.7}:{},...w}),encoding:(0,l.omit)(b,["shape"])}],_=(0,s.stack)((0,u.initMarkdef)(w,b,r),b);let A=b;if(_){const{fieldChannel:e,offset:t}=_;A={...b,[e]:{...b[e],...t?{stack:t}:{}}}}return A=(0,l.omit)(A,["y2","x2"]),E&&S.push({...h?{projection:h}:{},mark:{type:"line",...(0,l.pick)(w,["clip","interpolate","tension","tooltip"]),...E},encoding:A}),x&&S.push({...h?{projection:h}:{},mark:{type:"point",opacity:1,filled:!0,...(0,l.pick)(w,["clip","tooltip"]),...x},encoding:A}),n({...v,layer:S},{...t,config:d(r)})}}},95741:(e,t,n)=>{"use strict";n.r(t),n.d(t,{replaceRepeaterInEncoding:()=>c,replaceRepeaterInFacet:()=>u});var r=n(26372),i=n(79543),a=n(20916),o=n(46681),s=n(51894),l=n(79989);function u(e,t){return t?(0,s.isFacetMapping)(e)?g(e,t):f(e,t):e}function c(e,t){return t?g(e,t):e}function d(e,t,n){const r=t[e];return(0,i.isRepeatRef)(r)?r.repeat in n?{...t,[e]:n[r.repeat]}:void a.warn(a.message.noSuchRepeatedValue(r.repeat)):t}function f(e,t){if(void 0!==(e=d("field",e,t))){if(null===e)return null;if((0,i.isSortableFieldDef)(e)&&(0,o.isSortField)(e.sort)){const n=d("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function p(e,t){if((0,i.isFieldDef)(e))return f(e,t);{const n=d("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function h(e,t){if(!(0,i.isFieldOrDatumDef)(e)){if((0,i.hasConditionalFieldOrDatumDef)(e)){const n=p(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=p(e,t);if(n)return n;if((0,i.isConditionalDef)(e))return{condition:e.condition}}}function g(e,t){const n={};for(const i in e)if((0,l.hasProperty)(e,i)){const a=e[i];if((0,r.isArray)(a))n[i]=a.map((e=>h(e,t))).filter((e=>e));else{const e=h(a,t);void 0!==e&&(n[i]=e)}}return n}},56349:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RuleForRangedLineNormalizer:()=>c});var r=n(26372),i=n(19664),a=n(95290),o=n(79543),s=n(20916),l=n(75028),u=n(68859);class c{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if((0,u.isUnitSpec)(e)){const{encoding:t,mark:n}=e;if("line"===n||(0,l.isMarkDef)(n)&&"line"===n.type)for(const e of a.SECONDARY_RANGE_CHANNEL){const n=t[(0,a.getMainRangeChannel)(e)];if(t[e]&&((0,o.isFieldDef)(n)&&!(0,i.isBinned)(n.bin)||(0,o.isDatumDef)(n)))return!0}}return!1}run(e,t,n){const{encoding:i,mark:a}=e;return s.warn(s.message.lineWithRange(!!i.x2,!!i.y2)),n({...e,mark:(0,r.isObject)(a)?{...a,type:"rule"}:"rule"},t)}}},9405:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SelectionCompatibilityNormalizer:()=>c});var r=n(26372),i=n(19664),a=n(79543),o=n(90386),s=n(56811),l=n(65393),u=n(79989);class c extends s.SpecMapper{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=d(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=d(e,t)).encoding){const n={};for(const[r,i]of(0,u.entries)(e.encoding))n[r]=f(i,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...r}=e;return n?{...r,params:(0,u.entries)(n).map((([e,n])=>{const{init:r,bind:i,empty:a,...o}=n;"single"===o.type?(o.type="point",o.toggle=!1):"multi"===o.type&&(o.type="point"),t.emptySelections[e]="none"!==a;for(const n of(0,u.vals)(t.selectionPredicates[e]??{}))n.empty="none"!==a;return{name:e,value:r,select:o,bind:i}}))}:e}}function d(e,t){const{transform:n,...r}=e;return n?{...r,transform:n.map((e=>{if((0,l.isFilter)(e))return{filter:h(e,t)};if((0,l.isBin)(e)&&(0,i.isBinParams)(e.bin))return{...e,bin:p(e.bin)};if((0,l.isLookup)(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}))}:e}function f(e,t){const n=(0,u.duplicate)(e);if((0,a.isFieldDef)(n)&&(0,i.isBinParams)(n.bin)&&(n.bin=p(n.bin)),(0,a.isScaleFieldDef)(n)&&n.scale?.domain?.selection){const{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if((0,a.isConditionalDef)(n))if((0,r.isArray)(n.condition))n.condition=n.condition.map((e=>{const{selection:n,param:r,test:i,...a}=e;return r?e:{...a,test:h(e,t)}}));else{const{selection:e,param:r,test:i,...a}=f(n.condition,t);n.condition=r?n.condition:{...a,test:h(n.condition,t)}}return n}function p(e){const t=e.extent;if(t?.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function h(e,t){const n=e=>(0,o.normalizeLogicalComposition)(e,(e=>{var n;const r={param:e,empty:t.emptySelections[e]??!0};return(n=t.selectionPredicates)[e]??(n[e]=[]),t.selectionPredicates[e].push(r),r}));return e.selection?n(e.selection):(0,o.normalizeLogicalComposition)(e.test||e.filter,(e=>e.selection?n(e.selection):e))}},9794:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TopLevelSelectionsNormalizer:()=>s});var r=n(26372),i=n(84847),a=n(24777),o=n(56811);class s extends o.SpecMapper{map(e,t){const n=t.selections??[];if(e.params&&!(0,a.isUnitSpec)(e)){const t=[];for(const r of e.params)(0,i.isSelectionParameter)(r)?n.push(r):t.push(r);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){const n=t.selections;if(!n||!n.length)return e;const i=(t.path??[]).concat(e.name),a=[];for(const t of n)if(t.views&&t.views.length)for(const n of t.views)((0,r.isString)(n)&&(n===e.name||i.includes(n))||(0,r.isArray)(n)&&n.map((e=>i.indexOf(e))).every(((e,t,n)=>-1!==e&&(0===t||e>n[t-1]))))&&a.push(t);else a.push(t);return a.length&&(e.params=a),e}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=s.prototype[e];s.prototype[e]=function(e,n){return t.call(this,e,l(e,n))}}function l(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}},54778:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assembleParameterSignals:()=>i});var r=n(84847);function i(e){const t=[];for(const n of e||[]){if((0,r.isSelectionParameter)(n))continue;const{expr:e,bind:i,...a}=n;if(i&&e){const n={...a,bind:i,init:e};t.push(n)}else{const n={...a,...e?{update:e}:{},...i?{bind:i}:{}};t.push(n)}}return t}},4976:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fieldFilterExpression:()=>w,fieldValidPredicate:()=>x,isFieldEqualPredicate:()=>c,isFieldGTEPredicate:()=>h,isFieldGTPredicate:()=>p,isFieldLTEPredicate:()=>f,isFieldLTPredicate:()=>d,isFieldOneOfPredicate:()=>m,isFieldPredicate:()=>v,isFieldRangePredicate:()=>g,isFieldValidPredicate:()=>y,isSelectionPredicate:()=>u,normalizePredicate:()=>E});var r=n(26372),i=n(79543),a=n(3802),o=n(96598),s=n(79989),l=n(5711);function u(e){return(0,s.hasProperty)(e,"param")}function c(e){return!!e?.field&&void 0!==e.equal}function d(e){return!!e?.field&&void 0!==e.lt}function f(e){return!!e?.field&&void 0!==e.lte}function p(e){return!!e?.field&&void 0!==e.gt}function h(e){return!!e?.field&&void 0!==e.gte}function g(e){if(e?.field){if((0,r.isArray)(e.range)&&2===e.range.length)return!0;if((0,l.isSignalRef)(e.range))return!0}return!1}function m(e){return!!e?.field&&((0,r.isArray)(e.oneOf)||(0,r.isArray)(e.in))}function y(e){return!!e?.field&&void 0!==e.valid}function v(e){return m(e)||c(e)||g(e)||d(e)||p(e)||f(e)||h(e)}function b(e,t){return(0,i.valueExpr)(e,{timeUnit:t,wrapTime:!0})}function w(e,t=!0){const{field:n}=e,r=(0,o.normalizeTimeUnit)(e.timeUnit),{unit:u,binned:v}=r||{},w=(0,i.vgField)(e,{expr:"datum"}),E=u?`time(${v?w:(0,o.fieldExpr)(u,n)})`:w;if(c(e))return`${E}===${b(e.equal,u)}`;if(d(e))return`${E}<${b(e.lt,u)}`;if(p(e))return`${E}>${b(e.gt,u)}`;if(f(e))return`${E}<=${b(e.lte,u)}`;if(h(e))return`${E}>=${b(e.gte,u)}`;if(m(e))return`indexof([${(S=e.oneOf,_=u,S.map((e=>b(e,_)))).join(",")}], ${E}) !== -1`;if(y(e))return x(E,e.valid);if(g(e)){const{range:n}=(0,a.replaceExprRef)(e),r=(0,l.isSignalRef)(n)?{signal:`${n.signal}[0]`}:n[0],i=(0,l.isSignalRef)(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==i&&t)return"inrange("+E+", ["+b(r,u)+", "+b(i,u)+"])";const o=[];return null!==r&&o.push(`${E} >= ${b(r,u)}`),null!==i&&o.push(`${E} <= ${b(i,u)}`),o.length>0?o.join(" && "):"true"}var S,_;throw new Error(`Invalid field predicate: ${(0,s.stringify)(e)}`)}function x(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function E(e){return v(e)&&e.timeUnit?{...e,timeUnit:(0,o.normalizeTimeUnit)(e.timeUnit)}:e}},15176:(e,t,n)=>{"use strict";n.r(t),n.d(t,{PROJECTION_PROPERTIES:()=>r});const r=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"]},31179:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CONTINUOUS_DOMAIN_SCALES:()=>v,CONTINUOUS_TO_CONTINUOUS_SCALES:()=>g,CONTINUOUS_TO_DISCRETE_SCALES:()=>y,DISCRETE_DOMAIN_SCALES:()=>b,NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES:()=>B,QUANTITATIVE_SCALES:()=>h,SCALE_CATEGORY_INDEX:()=>u,SCALE_PROPERTIES:()=>O,SCALE_TYPES:()=>c,ScaleType:()=>l,TIME_SCALE_TYPES:()=>w,channelScalePropertyIncompatability:()=>z,channelSupportScaleType:()=>j,defaultScaleConfig:()=>A,hasContinuousDomain:()=>E,hasDiscreteDomain:()=>x,isContinuousToContinuous:()=>S,isContinuousToDiscrete:()=>_,isDomainUnionWith:()=>k,isExtendedScheme:()=>C,isFieldRange:()=>R,isParameterDomain:()=>T,isQuantitative:()=>m,scaleCompatible:()=>d,scaleTypePrecedence:()=>p,scaleTypeSupportDataType:()=>q,scaleTypeSupportProperty:()=>U});var r=n(26372),i=n(95290),a=n(20916),o=n(99273),s=n(79989);const l={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},u={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"},c=(0,s.keys)(u);function d(e,t){const n=u[e],r=u[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const f={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 p(e){return f[e]}const h=new Set(["linear","log","pow","sqrt","symlog"]),g=new Set([...h,"time","utc"]);function m(e){return h.has(e)}const y=new Set(["quantile","quantize","threshold"]),v=new Set([...g,...y,"sequential","identity"]),b=new Set(["ordinal","bin-ordinal","point","band"]),w=new Set(["time","utc"]);function x(e){return b.has(e)}function E(e){return v.has(e)}function S(e){return g.has(e)}function _(e){return y.has(e)}const A={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};function C(e){return!(0,r.isString)(e)&&(0,s.hasProperty)(e,"name")}function T(e){return(0,s.hasProperty)(e,"param")}function k(e){return(0,s.hasProperty)(e,"unionWith")}function R(e){return(0,r.isObject)(e)&&"field"in e}const D={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},O=(0,s.keys)(D),{type:N,domain:F,range:P,rangeMax:M,rangeMin:I,scheme:$,...L}=D,B=(0,s.keys)(L);function U(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 S(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return S(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return S(e);case"nice":return S(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return E(e)&&!(0,s.contains)(["log","time","utc","threshold","quantile"],e)}}function z(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return(0,i.isColorChannel)(e)?void 0:a.message.cannotUseScalePropertyWithNonColor(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 q(e,t){return(0,s.contains)([o.ORDINAL,o.NOMINAL],t)?void 0===e||x(e):t===o.TEMPORAL?(0,s.contains)([l.TIME,l.UTC,void 0],e):t!==o.QUANTITATIVE||m(e)||_(e)||void 0===e}function j(e,t,n=!1){if(!i.isScaleChannel(e))return!1;switch(e){case i.X:case i.Y:case i.XOFFSET:case i.YOFFSET:case i.THETA:case i.RADIUS:return!!S(t)||"band"===t||"point"===t&&!n;case i.SIZE:case i.STROKEWIDTH:case i.OPACITY:case i.FILLOPACITY:case i.STROKEOPACITY:case i.ANGLE:return S(t)||_(t)||(0,s.contains)(["band","point","ordinal"],t);case i.COLOR:case i.FILL:case i.STROKE:return"band"!==t;case i.STROKEDASH:case i.SHAPE:return"ordinal"===t||_(t)}}},84847:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SELECTION_ID:()=>i,defaultConfig:()=>a,isLegendBinding:()=>o,isLegendStreamBinding:()=>s,isSelectionParameter:()=>l});var r=n(26372);const i="_vgsid_",a={point:{on:"click",fields:[i],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 o(e){return"legend"===e||!!e?.legend}function s(e){return o(e)&&(0,r.isObject)(e)}function l(e){return!!e?.select}},46681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_SORT_OP:()=>a,isSortArray:()=>c,isSortByChannel:()=>s,isSortByEncoding:()=>l,isSortField:()=>u});var r=n(26372),i=n(79989);const a="min",o={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 s(e){return(0,r.hasOwnProperty)(o,e)}function l(e){return(0,i.hasProperty)(e,"encoding")}function u(e){return e&&("count"===e.op||(0,i.hasProperty)(e,"field"))}function c(e){return e&&(0,r.isArray)(e)}},89820:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_SPACING:()=>c,extractCompositionLayout:()=>f,getStepFor:()=>s,isFrameMixins:()=>u,isStep:()=>l});var r=n(26372),i=n(79989),a=n(53429),o=n(51894);function s({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function l(e){return(0,i.hasProperty)(e,"step")}function u(e){return(0,i.hasProperty)(e,"view")||(0,i.hasProperty)(e,"width")||(0,i.hasProperty)(e,"height")}const c=20,d=(0,i.keys)({align:1,bounds:1,center:1,columns:1,spacing:1});function f(e,t,n){const i=n[t],s={},{spacing:l,columns:u}=i;void 0!==l&&(s.spacing=l),void 0!==u&&((0,o.isFacetSpec)(e)&&!(0,o.isFacetMapping)(e.facet)||(0,a.isConcatSpec)(e))&&(s.columns=u),(0,a.isVConcatSpec)(e)&&(s.columns=1);for(const t of d)if(void 0!==e[t])if("spacing"===t){const n=e[t];s[t]=(0,r.isNumber)(n)?n:{row:n.row??l,column:n.column??l}}else s[t]=e[t];return s}},53429:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isAnyConcatSpec:()=>i,isConcatSpec:()=>a,isHConcatSpec:()=>s,isVConcatSpec:()=>o});var r=n(79989);function i(e){return o(e)||s(e)||a(e)}function a(e){return(0,r.hasProperty)(e,"concat")}function o(e){return(0,r.hasProperty)(e,"vconcat")}function s(e){return(0,r.hasProperty)(e,"hconcat")}},51894:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isFacetFieldDef:()=>a,isFacetMapping:()=>i,isFacetSpec:()=>o});var r=n(79989);function i(e){return(0,r.hasProperty)(e,"row")||(0,r.hasProperty)(e,"column")}function a(e){return(0,r.hasProperty)(e,"header")}function o(e){return(0,r.hasProperty)(e,"facet")}},24777:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isAnyConcatSpec:()=>r.isAnyConcatSpec,isFacetSpec:()=>i.isFacetSpec,isHConcatSpec:()=>r.isHConcatSpec,isLayerSpec:()=>a.isLayerSpec,isRepeatSpec:()=>o.isRepeatSpec,isUnitSpec:()=>s.isUnitSpec,isVConcatSpec:()=>r.isVConcatSpec});var r=n(53429),i=n(51894),a=n(42524),o=n(31070),s=n(68859)},42524:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isLayerSpec:()=>i});var r=n(79989);function i(e){return(0,r.hasProperty)(e,"layer")}},56811:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SpecMapper:()=>u});var r=n(20916),i=n(53429),a=n(51894),o=n(42524),s=n(31070),l=n(68859);class u{map(e,t){return(0,a.isFacetSpec)(e)?this.mapFacet(e,t):(0,s.isRepeatSpec)(e)?this.mapRepeat(e,t):(0,i.isHConcatSpec)(e)?this.mapHConcat(e,t):(0,i.isVConcatSpec)(e)?this.mapVConcat(e,t):(0,i.isConcatSpec)(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if((0,o.isLayerSpec)(e))return this.mapLayer(e,t);if((0,l.isUnitSpec)(e))return this.mapUnit(e,t);throw new Error(r.message.invalidSpec(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...r}=e;return{...r,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}},31070:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isLayerRepeatSpec:()=>o,isRepeatSpec:()=>a});var r=n(26372),i=n(79989);function a(e){return(0,i.hasProperty)(e,"repeat")}function o(e){return!(0,r.isArray)(e.repeat)&&(0,i.hasProperty)(e.repeat,"layer")}},48110:(e,t,n)=>{"use strict";n.r(t),n.d(t,{extractTopLevelProperties:()=>l,getFitType:()=>o,isFitType:()=>a});var r=n(95290),i=n(15058);function a(e){return["fit","fit-x","fit-y"].includes(e)}function o(e){return e?`fit-${(0,r.getPositionScaleChannel)(e)}`:"fit"}const s=["background","padding"];function l(e,t){const n={};for(const t of s)e&&void 0!==e[t]&&(n[t]=(0,i.signalRefOrValue)(e[t]));return t&&(n.params=e.params),n}},68859:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isUnitSpec:()=>i});var r=n(79989);function i(e){return(0,r.hasProperty)(e,"mark")}},68889:(e,t,n)=>{"use strict";n.r(t),n.d(t,{STACKABLE_MARKS:()=>p,STACK_BY_DEFAULT_MARKS:()=>h,isStackOffset:()=>f,stack:()=>y});var r=n(26372),i=n(54814),a=n(95290),o=n(79543),s=n(98348),l=n(20916),u=n(75028),c=n(31179);const d={zero:1,center:1,normalize:1};function f(e){return(0,r.hasOwnProperty)(d,e)}const p=new Set([u.ARC,u.BAR,u.AREA,u.RULE,u.POINT,u.CIRCLE,u.SQUARE,u.LINE,u.TEXT,u.TICK]),h=new Set([u.BAR,u.AREA,u.ARC]);function g(e){return(0,o.isFieldDef)(e)&&"quantitative"===(0,o.channelDefType)(e)&&!e.bin}function m(e,t,{orient:n,type:r}){const i="x"===t?"y":"radius",a="x"===t&&["bar","area"].includes(r),s=e[t],l=e[i];if((0,o.isFieldDef)(s)&&(0,o.isFieldDef)(l))if(g(s)&&g(l)){if(s.stack)return t;if(l.stack)return i;const e=(0,o.isFieldDef)(s)&&!!s.aggregate;if(e!==((0,o.isFieldDef)(l)&&!!l.aggregate))return e?t:i;if(a){if("vertical"===n)return i;if("horizontal"===n)return t}}else{if(g(s))return t;if(g(l))return i}else{if(g(s)){if(a&&"vertical"===n)return;return t}if(g(l)){if(a&&"horizontal"===n)return;return i}}}function y(e,t){const n=(0,u.isMarkDef)(e)?e:{type:e},d=n.type;if(!p.has(d))return null;const g=m(t,"x",n)||m(t,"theta",n);if(!g)return null;const y=t[g],v=(0,o.isFieldDef)(y)?(0,o.vgField)(y,{}):void 0,b=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(g),w=[],x=new Set;if(t[b]){const e=t[b],n=(0,o.isFieldDef)(e)?(0,o.vgField)(e,{}):void 0;n&&n!==v&&(w.push(b),x.add(n))}const E="x"===b?"xOffset":"yOffset",S=t[E],_=(0,o.isFieldDef)(S)?(0,o.vgField)(S,{}):void 0;_&&_!==v&&(w.push(E),x.add(_));const A=a.NONPOSITION_CHANNELS.reduce(((e,n)=>{if("tooltip"!==n&&(0,s.channelHasField)(t,n)){const i=t[n];for(const t of(0,r.array)(i)){const r=(0,o.getFieldDef)(t);if(r.aggregate)continue;const i=(0,o.vgField)(r,{});i&&x.has(i)||e.push({channel:n,fieldDef:r})}}return e}),[]);let C;return void 0!==y.stack?C=(0,r.isBoolean)(y.stack)?y.stack?"zero":null:y.stack:h.has(d)&&(C="zero"),C&&f(C)?(0,s.isAggregate)(t)&&0===A.length?null:(y?.scale?.type&&y?.scale?.type!==c.ScaleType.LINEAR&&y?.stack&&l.warn(l.message.stackNonLinearScale(y.scale.type)),(0,o.isFieldOrDatumDef)(t[(0,a.getSecondaryRangeChannel)(g)])?(void 0!==y.stack&&l.warn(l.message.cannotStackRangedMark(g)),null):((0,o.isFieldDef)(y)&&y.aggregate&&!i.SUM_OPS.has(y.aggregate)&&l.warn(l.message.stackNonSummativeAggregate(y.aggregate)),{groupbyChannels:w,groupbyFields:x,fieldChannel:g,impute:null!==y.impute&&(0,u.isPathMark)(d),stackBy:A,offset:C})):null}},96598:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BINNED_TIMEUNIT_INDEX:()=>f,LOCAL_MULTI_TIMEUNIT_INDEX:()=>d,LOCAL_SINGLE_TIMEUNIT_INDEX:()=>s,TIMEUNIT_PARTS:()=>l,UTC_MULTI_TIMEUNIT_INDEX:()=>g,UTC_SINGLE_TIMEUNIT_INDEX:()=>c,VEGALITE_TIMEFORMAT:()=>v,containsTimeUnit:()=>x,durationExpr:()=>T,fieldExpr:()=>E,formatExpression:()=>_,getDateTimePartAndStep:()=>D,getLocalTimeUnitFromUTCTimeUnit:()=>y,getSmallestTimeUnitPart:()=>w,getTimeUnitParts:()=>b,isBinnedTimeUnit:()=>p,isBinnedTimeUnitString:()=>h,isDatePart:()=>R,isLocalSingleTimeUnit:()=>u,isUTCTimeUnit:()=>m,normalizeTimeUnit:()=>A,timeUnitSpecifierExpression:()=>S,timeUnitToString:()=>C});var r=n(26372),i=n(20032),a=n(79989),o=n(77390);const s={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},l=(0,a.keys)(s);function u(e){return(0,o.hasOwnProperty)(s,e)}const c={utcyear:1,utcquarter:1,utcmonth:1,utcweek:1,utcday:1,utcdayofyear:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1},d={yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,yearweek:1,yearweekday:1,yearweekdayhours:1,yearweekdayhoursminutes:1,yearweekdayhoursminutesseconds:1,yeardayofyear:1,quartermonth:1,monthdate:1,monthdatehours:1,monthdatehoursminutes:1,monthdatehoursminutesseconds:1,weekday:1,weekdayhours:1,weekdayhoursminutes:1,weekdayhoursminutesseconds:1,dayhours:1,dayhoursminutes:1,dayhoursminutesseconds:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},f={binnedyear:1,binnedyearquarter:1,binnedyearquartermonth:1,binnedyearmonth:1,binnedyearmonthdate:1,binnedyearmonthdatehours:1,binnedyearmonthdatehoursminutes:1,binnedyearmonthdatehoursminutesseconds:1,binnedyearweek:1,binnedyearweekday:1,binnedyearweekdayhours:1,binnedyearweekdayhoursminutes:1,binnedyearweekdayhoursminutesseconds:1,binnedyeardayofyear:1,binnedutcyear:1,binnedutcyearquarter:1,binnedutcyearquartermonth:1,binnedutcyearmonth:1,binnedutcyearmonthdate:1,binnedutcyearmonthdatehours:1,binnedutcyearmonthdatehoursminutes:1,binnedutcyearmonthdatehoursminutesseconds:1,binnedutcyearweek:1,binnedutcyearweekday:1,binnedutcyearweekdayhours:1,binnedutcyearweekdayhoursminutes:1,binnedutcyearweekdayhoursminutesseconds:1,binnedutcyeardayofyear:1};function p(e){return(0,r.isObject)(e)?e.binned:h(e)}function h(e){return e&&e.startsWith("binned")}const g={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcyearweek:1,utcyearweekday:1,utcyearweekdayhours:1,utcyearweekdayhoursminutes:1,utcyearweekdayhoursminutesseconds:1,utcyeardayofyear:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utcmonthdatehoursminutes:1,utcmonthdatehoursminutesseconds:1,utcweekday:1,utcweekdayhours:1,utcweekdayhoursminutes:1,utcweekdayhoursminutesseconds:1,utcdayhours:1,utcdayhoursminutes:1,utcdayhoursminutesseconds:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1};function m(e){return e.startsWith("utc")}function y(e){return e.substring(3)}const v={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function b(e){return l.filter((t=>x(e,t)))}function w(e){const t=b(e);return t[t.length-1]}function x(e,t){const n=e.indexOf(t);return!(n<0||n>0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function E(e,t,{end:n}={end:!1}){const r=(0,a.accessPathWithDatum)(t),o=m(e)?"utc":"";let s;const u={};for(const t of l)x(e,t)&&(u[t]="quarter"===(c=t)?`(${o}quarter(${r})-1)`:`${o}${c}(${r})`,s=t);var c;return n&&(u[s]+="+1"),(0,i.dateTimeExprToExpr)(u)}function S(e){if(!e)return;const t=b(e);return`timeUnitSpecifier(${(0,a.stringify)(t)}, ${(0,a.stringify)(v)})`}function _(e,t,n){if(!e)return;const r=S(e);return`${n||m(e)?"utc":"time"}Format(${t}, ${r})`}function A(e){if(!e)return;let t;return(0,r.isString)(e)?t=h(e)?{unit:e.substring(6),binned:!0}:{unit:e}:(0,r.isObject)(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),m(t.unit)&&(t.utc=!0,t.unit=y(t.unit)),t}function C(e){const{utc:t,...n}=A(e);return n.unit?(t?"utc":"")+(0,a.keys)(n).map((e=>(0,a.varName)(`${"unit"===e?"":`_${e}_`}${n[e]}`))).join(""):(t?"utc":"")+"timeunit"+(0,a.keys)(n).map((e=>(0,a.varName)(`_${e}_${n[e]}`))).join("")}function T(e,t=e=>e){const n=A(e),r=w(n.unit);if(r&&"day"!==r){const e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:a,part:o}=D(r,n.step),s={...e,[o]:+e[o]+a};return`${t((0,i.dateTimeToExpr)(s))} - ${t((0,i.dateTimeToExpr)(e))}`}}const k={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function R(e){return(0,o.hasOwnProperty)(k,e)}function D(e,t=1){if(R(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:3*t};case"week":return{part:"date",step:7*t}}}},76447:(e,t,n)=>{"use strict";n.r(t),n.d(t,{extractTitleConfig:()=>a,isText:()=>o});var r=n(26372),i=n(79989);function a(e){const{anchor:t,frame:n,offset:r,orient:a,angle:o,limit:s,color:l,subtitleColor:u,subtitleFont:c,subtitleFontSize:d,subtitleFontStyle:f,subtitleFontWeight:p,subtitleLineHeight:h,subtitlePadding:g,...m}=e,y={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...a?{orient:a}:{},...void 0!==o?{angle:o}:{},...void 0!==s?{limit:s}:{}},v={...u?{subtitleColor:u}:{},...c?{subtitleFont:c}:{},...d?{subtitleFontSize:d}:{},...f?{subtitleFontStyle:f}:{},...p?{subtitleFontWeight:p}:{},...h?{subtitleLineHeight:h}:{},...g?{subtitlePadding:g}:{}};return{titleMarkConfig:{...m,...l?{fill:l}:{}},subtitleMarkConfig:(0,i.pick)(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:y,subtitle:v}}function o(e){return(0,r.isString)(e)||(0,r.isArray)(e)&&(0,r.isString)(e[0])}},65393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{isAggregate:()=>_,isBin:()=>x,isCalculate:()=>w,isDensity:()=>f,isExtent:()=>T,isFilter:()=>o,isFlatten:()=>b,isFold:()=>C,isImpute:()=>E,isImputeSequence:()=>s,isJoinAggregate:()=>v,isLoess:()=>g,isLookup:()=>l,isLookupData:()=>u,isLookupSelection:()=>c,isPivot:()=>d,isQuantile:()=>p,isRegression:()=>h,isSample:()=>m,isStack:()=>A,isTimeUnit:()=>S,isWindow:()=>y,normalizeTransform:()=>k});var r=n(90386),i=n(4976),a=n(79989);function o(e){return(0,a.hasProperty)(e,"filter")}function s(e){return(0,a.hasProperty)(e,"stop")}function l(e){return(0,a.hasProperty)(e,"lookup")}function u(e){return(0,a.hasProperty)(e,"data")}function c(e){return(0,a.hasProperty)(e,"param")}function d(e){return(0,a.hasProperty)(e,"pivot")}function f(e){return(0,a.hasProperty)(e,"density")}function p(e){return(0,a.hasProperty)(e,"quantile")}function h(e){return(0,a.hasProperty)(e,"regression")}function g(e){return(0,a.hasProperty)(e,"loess")}function m(e){return(0,a.hasProperty)(e,"sample")}function y(e){return(0,a.hasProperty)(e,"window")}function v(e){return(0,a.hasProperty)(e,"joinaggregate")}function b(e){return(0,a.hasProperty)(e,"flatten")}function w(e){return(0,a.hasProperty)(e,"calculate")}function x(e){return(0,a.hasProperty)(e,"bin")}function E(e){return(0,a.hasProperty)(e,"impute")}function S(e){return(0,a.hasProperty)(e,"timeUnit")}function _(e){return(0,a.hasProperty)(e,"aggregate")}function A(e){return(0,a.hasProperty)(e,"stack")}function C(e){return(0,a.hasProperty)(e,"fold")}function T(e){return(0,a.hasProperty)(e,"extent")&&!(0,a.hasProperty)(e,"density")&&!(0,a.hasProperty)(e,"regression")}function k(e){return e.map((e=>o(e)?{filter:(0,r.normalizeLogicalComposition)(e.filter,i.normalizePredicate)}:e))}},99273:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GEOJSON:()=>p,NOMINAL:()=>f,ORDINAL:()=>c,QUANTITATIVE:()=>u,TEMPORAL:()=>d,TYPES:()=>h,Type:()=>a,getFullName:()=>g,isContinuous:()=>s,isDiscrete:()=>l,isType:()=>o});var r=n(26372),i=n(79989);const a={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function o(e){return(0,r.hasOwnProperty)(a,e)}function s(e){return"quantitative"===e||"temporal"===e}function l(e){return"ordinal"===e||"nominal"===e}const u=a.quantitative,c=a.ordinal,d=a.temporal,f=a.nominal,p=a.geojson,h=(0,i.keys)(a);function g(e){if(e)switch(e=e.toLowerCase()){case"q":case u:return"quantitative";case"t":case d:return"temporal";case"o":case c:return"ordinal";case"n":case f:return"nominal";case p:return"geojson"}}},79989:(e,t,n)=>{"use strict";n.r(t),n.d(t,{accessPathDepth:()=>$,accessPathWithDatum:()=>O,contains:()=>d,deepEqual:()=>W,deleteNestedProperty:()=>R,duplicate:()=>a,entries:()=>A,every:()=>p,fieldIntersection:()=>x,flatAccessWithDatum:()=>N,getFirstDefined:()=>L,hasIntersection:()=>b,hasProperty:()=>X,hash:()=>u,internalField:()=>q,isBoolean:()=>C,isEmpty:()=>E,isEqual:()=>y,isInternalField:()=>j,isNullOrFalse:()=>c,isNumeric:()=>G,keys:()=>S,logicalExpr:()=>k,mergeDeep:()=>h,never:()=>o,normalizeAngle:()=>H,omit:()=>l,pick:()=>s,prefixGenerator:()=>w,removePathFromField:()=>I,replaceAll:()=>M,replacePathInField:()=>P,resetIdCounter:()=>z,setEqual:()=>v,some:()=>f,stringify:()=>Y,titleCase:()=>D,unique:()=>m,uniqueId:()=>U,vals:()=>_,varName:()=>T});var r=n(26372),i=n(90386);const a=structuredClone;function o(e){throw new Error(e)}function s(e,t){const n={};for(const i of t)(0,r.hasOwnProperty)(e,i)&&(n[i]=e[i]);return n}function l(e,t){const n={...e};for(const e of t)delete n[e];return n}function u(e){if((0,r.isNumber)(e))return e;const t=(0,r.isString)(e)?e:Y(e);if(t.length<250)return t;let n=0;for(let e=0;e0===t?e:`[${e}]`)),i=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of i)t.add(e)}return t}function x(e,t){return void 0===e||void 0===t||b(w(e),w(t))}function E(e){return 0===S(e).length}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>Y(e))).join(",")})`};const S=Object.keys,_=Object.values,A=Object.entries;function C(e){return!0===e||!1===e}function T(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function k(e,t){return(0,i.isLogicalNot)(e)?`!(${k(e.not,t)})`:(0,i.isLogicalAnd)(e)?`(${e.and.map((e=>k(e,t))).join(") && (")})`:(0,i.isLogicalOr)(e)?`(${e.or.map((e=>k(e,t))).join(") || (")})`:t(e)}function R(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&R(e[n],t)&&delete e[n],E(e)}function D(e){return e.charAt(0).toUpperCase()+e.substr(1)}function O(e,t="datum"){const n=(0,r.splitAccessPath)(e),i=[];for(let e=1;e<=n.length;e++){const a=`[${n.slice(0,e).map(r.stringValue).join("][")}]`;i.push(`${t}${a}`)}return i.join(" && ")}function N(e,t="datum"){return`${t}[${(0,r.stringValue)((0,r.splitAccessPath)(e).join("."))}]`}function F(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function P(e){return`${(0,r.splitAccessPath)(e).map(F).join("\\.")}`}function M(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function I(e){return`${(0,r.splitAccessPath)(e).join(".")}`}function $(e){return e?(0,r.splitAccessPath)(e).length:0}function L(...e){return e.find((e=>void 0!==e))}let B=42;function U(e){const t=++B;return e?String(e)+t:t}function z(){B=42}function q(e){return j(e)?e:`__${e}`}function j(e){return e.startsWith("__")}function H(e){if(void 0!==e)return(e%360+360)%360}function G(e){return!!(0,r.isNumber)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const V=Object.getPrototypeOf(structuredClone({}));function W(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){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;0!=r--;)if(!W(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!W(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)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!==V.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==V.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(!W(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Y(e){const t=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i="[",r=0;r{"use strict";n.r(t),n.d(t,{VG_CORNERRADIUS_CHANNELS:()=>f,VG_MARK_CONFIGS:()=>c,VG_MARK_INDEX:()=>d,isDataRefDomain:()=>u,isDataRefUnionedDomain:()=>s,isFieldRefUnionDomain:()=>l,isSignalRef:()=>a,isVgRangeStep:()=>o});var r=n(26372),i=n(79989);function a(e){return(0,i.hasProperty)(e,"signal")}function o(e){return(0,i.hasProperty)(e,"step")}function s(e){return!(0,r.isArray)(e)&&(0,i.hasProperty)(e,"fields")&&!(0,i.hasProperty)(e,"data")}function l(e){return!(0,r.isArray)(e)&&(0,i.hasProperty)(e,"fields")&&(0,i.hasProperty)(e,"data")}function u(e){return!(0,r.isArray)(e)&&(0,i.hasProperty)(e,"field")&&(0,i.hasProperty)(e,"data")}const c=(0,i.keys)({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}),d={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},f=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"]},83418:(e,t,n)=>{"use strict";n.r(t),n.d(t,{format:()=>k,formats:()=>R,inferType:()=>x,inferTypes:()=>E,loader:()=>N,read:()=>O,responseType:()=>D,typeParsers:()=>v});var r=n(26372),i=n(84112),a=n(12196),o=n(40300);const s=/^(data:|([A-Za-z]+:)?\/\/)/,l=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,u=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function c(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function d(e,t){t=(0,r.extend)({},this.options,t);const n=this.fileAccess,i={href:null};let a,o,c;const d=l.test(e.replace(u,""));null!=e&&"string"==typeof e&&d||(0,r.error)("Sanitize failure, invalid URI: "+(0,r.stringValue)(e));const f=s.test(e);return(c=t.baseURL)&&!f&&(e.startsWith("/")||c.endsWith("/")||(e="/"+e),e=c+e),o=(a=e.startsWith("file://"))||"file"===t.mode||"http"!==t.mode&&!f&&n,a?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function f(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):p}async function p(){(0,r.error)("No file system access.")}function h(e){return e?async function(t,n){const i=(0,r.extend)({},this.options.http,n),a=n&&n.response,o=await e(t,i);return o.ok?(0,r.isFunction)(o[a])?o[a]():o.text():(0,r.error)(o.status+""+o.statusText)}:g}async function g(){(0,r.error)("No HTTP fetch method available.")}const m=e=>null!=e&&e==e,y=e=>!(Number.isNaN(+e)||e instanceof Date),v={boolean:r.toBoolean,integer:r.toNumber,number:r.toNumber,date:r.toDate,string:r.toString,unknown:r.identity},b=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>y(e)&&Number.isInteger(+e),y,e=>!Number.isNaN(Date.parse(e))],w=["boolean","integer","number","date"];function x(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=b.length,i=b.map(((e,t)=>t+1));for(let a,o,s=0,l=0;s0===e?t:e),0)-1]}function E(e,t){return t.reduce(((t,n)=>(t[n]=x(e,n),t)),{})}function S(e){const t=function(t,n){const i={delimiter:e};return _(t,n?(0,r.extend)(n,i):i)};return t.responseType="text",t}function _(e,t){return t.header&&(e=t.header.map(r.stringValue).join(t.delimiter)+"\n"+e),(0,i.dsvFormat)(t.delimiter).parse(e+"")}function A(e,t){const n=t&&t.property?(0,r.field)(t.property):r.identity;return!(0,r.isObject)(e)||(i=e,"function"==typeof Buffer&&(0,r.isFunction)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){return!(0,r.isArray)(e)&&(0,r.isIterable)(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}_.responseType="text",A.responseType="json";const C={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function T(e,t){let n,i,o,s;return e=A(e,t),t&&t.feature?(n=a.feature,o=t.feature):t&&t.mesh?(n=a.mesh,o=t.mesh,s=C[t.filter]):(0,r.error)("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[o])?n(e,i,s):(0,r.error)("Invalid TopoJSON object: "+o),i&&i.features||[i]}T.responseType="json";const k={dsv:_,csv:S(","),tsv:S("\t"),json:A,topojson:T};function R(e,t){return arguments.length>1?(k[e]=t,this):(0,r.hasOwnProperty)(k,e)?k[e]:null}function D(e){const t=R(e);return t&&t.responseType||"text"}function O(e,t,n,i){const a=R((t=t||{}).type||"json");return a||(0,r.error)("Unknown data format type: "+t.type),e=a(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=(0,o.timeFormatDefaultLocale)();n=n||i.timeParse,r=r||i.utcParse;let a,s,l,u,c,d,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=E(e,f)),f=Object.keys(t);const p=f.map((e=>{const i=t[e];let a,o;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return a=i.split(/:(.+)?/,2),o=a[1],("'"===o[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1)),("utc"===a[0]?r:n)(o);if(!v[i])throw Error("Illegal format pattern: "+e+":"+i);return v[i]}));for(l=0,c=e.length,d=f.length;l({options:t||{},sanitize:d,load:c,fileAccess:!1,file:f(null),http:h(e)})}("undefined"!=typeof fetch&&fetch)},36808:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AxisDomainRole:()=>x,AxisGridRole:()=>E,AxisLabelRole:()=>S,AxisRole:()=>w,AxisTickRole:()=>_,AxisTitleRole:()=>A,DataScope:()=>Tn,FrameRole:()=>v,LegendEntryRole:()=>k,LegendLabelRole:()=>D,LegendRole:()=>C,LegendSymbolRole:()=>O,LegendTitleRole:()=>N,MarkRole:()=>y,Scope:()=>fr,ScopeRole:()=>b,config:()=>yr,parse:()=>vr,signal:()=>X,signalUpdates:()=>ve,stream:()=>de});var r=n(26372),i=n(31926),a=n(45948),o=n(14588),s=n(24988);function l(e){return(0,r.isObject)(e)?e:{type:e||"pad"}}const u=e=>+e||0,c=e=>({top:e,bottom:e,left:e,right:e});function d(e){return(0,r.isObject)(e)?e.signal?e:{top:u(e.top),bottom:u(e.bottom),left:u(e.left),right:u(e.right)}:c(u(e))}const f=e=>(0,r.isObject)(e)&&!(0,r.isArray)(e)?(0,r.extend)({},e):{value:e};function p(e,t,n,i){return null!=n?((0,r.isObject)(n)&&!(0,r.isArray)(n)||(0,r.isArray)(n)&&n.length&&(0,r.isObject)(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function h(e,t,n){for(const n in t)p(e,n,t[n]);for(const t in n)p(e,t,n[t],"update")}function g(e,t,n){for(const i in t)n&&(0,r.hasOwnProperty)(n,i)||(e[i]=(0,r.extend)(e[i]||{},t[i]));return e}function m(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const y="mark",v="frame",b="scope",w="axis",x="axis-domain",E="axis-grid",S="axis-label",_="axis-tick",A="axis-title",C="legend",T="legend-band",k="legend-entry",R="legend-gradient",D="legend-label",O="legend-symbol",N="legend-title",F="title",P="title-text",M="title-subtitle";function I(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const $=e=>(0,r.isString)(e)?(0,r.stringValue)(e):e.signal?`(${e.signal})`:z(e);function L(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:(0,r.stringValue)(e)));for(;t.length&&null==(0,r.peek)(t);)t.pop();return t.unshift($(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?B("hcl",e.h,e.c,e.l):e.h||e.s?B("hsl",e.h,e.s,e.l):e.l||e.a?B("lab",e.l,e.a,e.b):e.r||e.g||e.b?B("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?z(e.field):void 0!==e.value?(0,r.stringValue)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=$(e.scale);return null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+U(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0")),t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${U(e.exponent)})`),null!=e.mult&&(t+=`*${U(e.mult)}`),null!=e.offset&&(t+=`+${U(e.offset)}`),e.round&&(t=`round(${t})`),t}const B=(e,t,n,r)=>`(${e}(${[t,n,r].map(L).join(",")})+'')`;function U(e){return(0,r.isObject)(e)?"("+L(e)+")":e}function z(e){return q((0,r.isObject)(e)?e:{datum:e})}function q(e){let t,n,i;if(e.signal)t="datum",i=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?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):(0,r.error)("Invalid field reference: "+(0,r.stringValue)(e));return e.signal||(i=(0,r.isString)(i)?(0,r.splitAccessPath)(i).map(r.stringValue).join("]["):q(i)),t+"["+i+"]"}function j(e,t,n,i,a,o){const s={};(o=o||{}).encoders={$encode:s},e=function(e,t,n,i,a){const o={},s={};let l,u,c,d;for(u in u="lineBreak","text"!==t||null==a[u]||m(u,e)||I(o,u,a[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),d=n===v?a.group:n===y?(0,r.extend)({},a.mark,a[t]):null,d)c=m(u,e)||("fill"===u||"stroke"===u)&&(m("fill",e)||m("stroke",e)),c||I(o,u,d[u]);for(u in(0,r.array)(i).forEach((t=>{const n=a.style&&a.style[t];for(const t in n)m(t,e)||I(o,t,n[t])})),e=(0,r.extend)({},e),o)d=o[u],d.signal?(l=l||{})[u]=d:s[u]=d;return e.enter=(0,r.extend)(s,e.enter),l&&(e.update=(0,r.extend)(l,e.update)),e}(e,t,n,i,a.config);for(const n in e)s[n]=H(e[n],t,o,a);return o}function H(e,t,n,i){const a={},o={};for(const t in e)null!=e[t]&&(a[t]=G((s=e[t],(0,r.isArray)(s)?function(e){let t="";return e.forEach((e=>{const n=L(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===(0,r.peek)(t)&&(t+="null"),t}(s):L(s)),i,n,o));var s;return{$expr:{marktype:t,channels:a},$fields:Object.keys(o),$output:Object.keys(e)}}function G(e,t,n,a){const o=(0,i.parseExpression)(e,t);return o.$fields.forEach((e=>a[e]=1)),(0,r.extend)(n,o.$params),o.$expr}const V="outer",W=["value","update","init","react","bind"];function Y(e,t){(0,r.error)(e+' for "outer" push: '+(0,r.stringValue)(t))}function X(e,t){const n=e.name;if(e.push===V)t.signals[n]||Y("No prior signal definition",n),W.forEach((t=>{void 0!==e[t]&&Y("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function K(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function J(e,t,n,r){return new K(e,t,n,r)}function Q(e,t){return J("operator",e,t)}function Z(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function ee(e,t){return t?{$field:e,$name:t}:{$field:e}}const te=ee("key");function ne(e,t){return{$compare:e,$order:t}}function re(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const ie="scope",ae="view";function oe(e){return e&&e.signal}function se(e){if(oe(e))return!0;if((0,r.isObject)(e))for(const t in e)if(se(e[t]))return!0;return!1}function le(e,t){return null!=e?e:t}function ue(e){return e&&e.signal||e}const ce="timer";function de(e,t){return(e.merge?fe:e.stream?pe:e.type?he:(0,r.error)("Invalid stream specification: "+(0,r.stringValue)(e)))(e,t)}function fe(e,t){const n=ge({merge:e.merge.map((e=>de(e,t)))},e,t);return t.addStream(n).id}function pe(e,t){const n=ge({stream:de(e.stream,t)},e,t);return t.addStream(n).id}function he(e,t){let n;var r;e.type===ce?(n=t.event(ce,e.throttle),e={between:e.between,filter:e.filter}):n=t.event((r=e.source)===ie?ae:r||ae,e.type);const i=ge({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function ge(e,t,n){let a=t.between;return a&&(2!==a.length&&(0,r.error)('Stream "between" parameter must have 2 entries: '+(0,r.stringValue)(t)),e.between=[de(a[0],n),de(a[1],n)]),a=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&a.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===ie&&a.push("inScope(event.item)"),a.length&&(e.filter=(0,i.parseExpression)("("+a.join(")&&(")+")",n).$expr),null!=(a=t.throttle)&&(e.throttle=+a),null!=(a=t.debounce)&&(e.debounce=+a),t.consume&&(e.consume=!0),e}const me={code:"_.$value",ast:{type:"Identifier",value:"value"}};function ye(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}function ve(e,t){const n=t.getSignal(e.name);let o=e.update;e.init&&(o?(0,r.error)("Signals can not include both init and update expressions."):(o=e.init,n.initonly=!0)),o&&(o=(0,i.parseExpression)(o,t),n.update=o.$expr,n.params=o.$params),e.on&&e.on.forEach((e=>function(e,t,n){const o=e.encode,s={target:n};let l=e.events,u=e.update,c=[];l||(0,r.error)("Signal update missing events specification."),(0,r.isString)(l)&&(l=(0,a.parseSelector)(l,t.isSubscope()?ie:ae)),l=(0,r.array)(l).filter((e=>e.signal||e.scale?(c.push(e),0):1)),c.length>1&&(c=[ye(c)]),l.length&&c.push(l.length>1?{merge:l}:l[0]),null!=o&&(u&&(0,r.error)("Signal encode and update are mutually exclusive."),u="encode(item(),"+(0,r.stringValue)(o)+")"),s.update=(0,r.isString)(u)?(0,i.parseExpression)(u,t):null!=u.expr?(0,i.parseExpression)(u.expr,t):null!=u.value?u.value:null!=u.signal?{$expr:me,$params:{$value:t.signalRef(u.signal)}}:(0,r.error)("Invalid signal update specification."),e.force&&(s.options={force:!0}),c.forEach((e=>t.addUpdate((0,r.extend)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):de(e,t)}}(e,t),s))))}(e,t,n.id)))}const be=e=>(t,n,r)=>J(e,n,t||void 0,r),we=be("aggregate"),xe=be("axisticks"),Ee=be("bound"),Se=be("collect"),_e=be("compare"),Ae=be("datajoin"),Ce=be("encode"),Te=be("expression"),ke=be("facet"),Re=be("field"),De=be("key"),Oe=be("legendentries"),Ne=be("load"),Fe=be("mark"),Pe=be("multiextent"),Me=be("multivalues"),Ie=be("overlap"),$e=be("params"),Le=be("prefacet"),Be=be("projection"),Ue=be("proxy"),ze=be("relay"),qe=be("render"),je=be("scale"),He=be("sieve"),Ge=be("sortitems"),Ve=be("viewlayout"),We=be("values");let Ye=0;const Xe={min:"min",max:"max",count:"sum"};function Ke(e,t){const n=t.getScale(e.name).params;let i;for(i in n.domain=et(e.domain,e,t),null!=e.range&&(n.range=lt(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=Je(e.type||e),null!=e.gamma&&(t.interpolateGamma=Je(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e,t){return e.signal?t.signalRef(e.signal):(0,r.isObject)(e)?{interval:Je(e.interval),step:Je(e.step)}:Je(e)}(e.nice,t)),null!=e.bins&&(n.bins=function(e,t){return e.signal||(0,r.isArray)(e)?Qe(e,t):t.objectProperty(e)}(e.bins,t)),e)(0,r.hasOwnProperty)(n,i)||"name"===i||(n[i]=Je(e[i],t))}function Je(e,t){return(0,r.isObject)(e)?e.signal?t.signalRef(e.signal):(0,r.error)("Unsupported object: "+(0,r.stringValue)(e)):e}function Qe(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>Je(e,t)))}function Ze(e){(0,r.error)("Can not find data set: "+(0,r.stringValue)(e))}function et(e,t,n){if(e)return e.signal?n.signalRef(e.signal):((0,r.isArray)(e)?tt:e.fields?rt:nt)(e,t,n);null==t.domainMin&&null==t.domainMax||(0,r.error)("No scale domain defined for domainMin/domainMax to override.")}function tt(e,t,n){return e.map((e=>Je(e,n)))}function nt(e,t,n){const r=n.getData(e.data);return r||Ze(e.data),(0,o.isDiscrete)(t.type)?r.valuesRef(n,e.field,at(e.sort,!1)):(0,o.isQuantile)(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function rt(e,t,n){const i=e.data,a=e.fields.reduce(((e,t)=>(t=(0,r.isString)(t)?{data:i,field:t}:(0,r.isArray)(t)||t.signal?function(e,t){const n="_:vega:_"+Ye++,i=Se({});if((0,r.isArray)(e))i.value={$ingest:e};else if(e.signal){const a="setdata("+(0,r.stringValue)(n)+","+e.signal+")";i.params.input=t.signalRef(a)}return t.addDataPipeline(n,[i,He({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return((0,o.isDiscrete)(t.type)?it:(0,o.isQuantile)(t.type)?ot:st)(e,n,a)}function it(e,t,n){const r=at(e.sort,!0);let i,a;const o=n.map((e=>{const n=t.getData(e.data);return n||Ze(e.data),n.countsRef(t,e.field,r)})),s={groupby:te,pulse:o};r&&(i=r.op||"count",a=r.field?re(i,r.field):"count",s.ops=[Xe[i]],s.fields=[t.fieldRef(a)],s.as=[a]),i=t.add(we(s));const l=t.add(Se({pulse:Z(i)}));return a=t.add(We({field:te,sort:t.sortRef(r),pulse:Z(l)})),Z(a)}function at(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!Xe[e.op]&&(0,r.error)("Multiple domain scales can not be sorted using "+e.op):(0,r.error)("No field provided for sort aggregate op: "+e.op):(0,r.isObject)(e)?e.field="key":e={field:"key"}),e}function ot(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||Ze(e.data),n.domainRef(t,e.field)}));return Z(t.add(Me({values:r})))}function st(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||Ze(e.data),n.extentRef(t,e.field)}));return Z(t.add(Pe({extents:r})))}function lt(e,t,n){const i=t.config.range;let a=e.range;if(a.signal)return t.signalRef(a.signal);if((0,r.isString)(a)){if(i&&(0,r.hasOwnProperty)(i,a))return lt(e=(0,r.extend)({},e,{range:i[a]}),t,n);"width"===a?a=[0,{signal:"width"}]:"height"===a?a=(0,o.isDiscrete)(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,r.error)("Unrecognized scale range value: "+(0,r.stringValue)(a))}else{if(a.scheme)return n.scheme=(0,r.isArray)(a.scheme)?Qe(a.scheme,t):Je(a.scheme,t),a.extent&&(n.schemeExtent=Qe(a.extent,t)),void(a.count&&(n.schemeCount=Je(a.count,t)));if(a.step)return void(n.rangeStep=Je(a.step,t));if((0,o.isDiscrete)(e.type)&&!(0,r.isArray)(a))return et(a,e,t);(0,r.isArray)(a)||(0,r.error)("Unsupported range type: "+(0,r.stringValue)(a))}return a.map((e=>((0,r.isArray)(e)?Qe:Je)(e,t)))}function ut(e,t,n){return(0,r.isArray)(e)?e.map((e=>ut(e,t,n))):(0,r.isObject)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:(0,r.error)("Unsupported parameter object: "+(0,r.stringValue)(e)):e}const ct="top",dt="left",ft="right",pt="bottom",ht="center",gt="vertical",mt="start",yt="end",vt="index",bt="label",wt="offset",xt="perc",Et="perc2",St="value",_t="guide-label",At="guide-title",Ct="group-title",Tt="group-subtitle",kt="symbol",Rt="gradient",Dt="discrete",Ot="size",Nt=[Ot,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ft={name:1,style:1,interactive:1},Pt={value:0},Mt={value:1},It="group",$t="rect",Lt="rule",Bt="symbol",Ut="text";function zt(e){return e.type=It,e.interactive=e.interactive||!1,e}function qt(e,t){const n=(n,r)=>le(e[n],le(t[n],r));return n.isVertical=n=>gt===le(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>le(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>le(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>le(e.columns,le(t.columns,+n.isVertical(!0))),n}function jt(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Ht(e,t,n){return`item.anchor === '${mt}' ? ${e} : item.anchor === '${yt}' ? ${t} : ${n}`}const Gt=Ht((0,r.stringValue)(dt),(0,r.stringValue)(ft),(0,r.stringValue)(ht));function Vt(e,t){return t?e?(0,r.isObject)(e)?Object.assign({},e,{offset:Vt(e.offset,t)}):{value:e,offset:t}:t:e}function Wt(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=g(e.encode,t,Ft)):e.interactive=!1,e}function Yt(e,t,n,i){const a=qt(e,n),o=a.isVertical(),s=a.gradientThickness(),l=a.gradientLength();let u,c,d,p,g;o?(c=[0,1],d=[0,0],p=s,g=l):(c=[0,0],d=[1,0],p=l,g=s);const m={enter:u={opacity:Pt,x:Pt,y:Pt,width:f(p),height:f(g)},update:(0,r.extend)({},u,{opacity:Mt,fill:{gradient:t,start:c,stop:d}}),exit:{opacity:Pt}};return h(m,{stroke:a("gradientStrokeColor"),strokeWidth:a("gradientStrokeWidth")},{opacity:a("gradientOpacity")}),Wt({type:$t,role:R,encode:m},i)}function Xt(e,t,n,i,a){const o=qt(e,n),s=o.isVertical(),l=o.gradientThickness(),u=o.gradientLength();let c,d,p,g,m="";s?(c="y",p="y2",d="x",g="width",m="1-"):(c="x",p="x2",d="y",g="height");const y={opacity:Pt,fill:{scale:t,field:St}};y[c]={signal:m+"datum."+xt,mult:u},y[d]=Pt,y[p]={signal:m+"datum."+Et,mult:u},y[g]=f(l);const v={enter:y,update:(0,r.extend)({},y,{opacity:Mt}),exit:{opacity:Pt}};return h(v,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Wt({type:$t,role:T,key:St,from:a,encode:v},i)}const Kt=`datum.${xt}<=0?"${dt}":datum.${xt}>=1?"${ft}":"${ht}"`,Jt=`datum.${xt}<=0?"${pt}":datum.${xt}>=1?"${ct}":"middle"`;function Qt(e,t,n,r){const i=qt(e,t),a=i.isVertical(),o=f(i.gradientThickness()),s=i.gradientLength();let l,u,c,d,p=i("labelOverlap"),g="";const m={enter:l={opacity:Pt},update:u={opacity:Mt,text:{field:bt}},exit:{opacity:Pt}};return h(m,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:le(e.labelLimit,t.gradientLabelLimit)}),a?(l.align={value:"left"},l.baseline=u.baseline={signal:Jt},c="y",d="x",g="1-"):(l.align=u.align={signal:Kt},l.baseline={value:"top"},c="x",d="y"),l[c]=u[c]={signal:g+"datum."+xt,mult:s},l[d]=u[d]=o,o.offset=le(e.labelOffset,t.gradientLabelOffset)||0,p=p?{separation:i("labelSeparation"),method:p,order:"datum."+vt}:void 0,Wt({type:Ut,role:D,style:_t,key:St,from:r,encode:m,overlap:p},n)}function Zt(e,t,n,r,i){const a=qt(e,t),o=n.entries,s=!(!o||!o.interactive),l=o?o.name:void 0,u=a("clipHeight"),c=a("symbolOffset"),d={data:"value"},p=`(${i}) ? datum.${wt} : datum.${Ot}`,m=u?f(u):{field:Ot},y=`datum.${vt}`,v=`max(1, ${i})`;let w,x,E,S,_;m.mult=.5,w={enter:x={opacity:Pt,x:{signal:p,mult:.5,offset:c},y:m},update:E={opacity:Mt,x:x.x,y:x.y},exit:{opacity:Pt}};let A=null,C=null;e.fill||(A=t.symbolBaseFillColor,C=t.symbolBaseStrokeColor),h(w,{fill:a("symbolFillColor",A),shape:a("symbolType"),size:a("symbolSize"),stroke:a("symbolStrokeColor",C),strokeDash:a("symbolDash"),strokeDashOffset:a("symbolDashOffset"),strokeWidth:a("symbolStrokeWidth")},{opacity:a("symbolOpacity")}),Nt.forEach((t=>{e[t]&&(E[t]=x[t]={scale:e[t],field:St})}));const T=Wt({type:Bt,role:O,key:St,from:d,clip:!!u||void 0,encode:w},n.symbols),k=f(c);k.offset=a("labelOffset"),w={enter:x={opacity:Pt,x:{signal:p,offset:k},y:m},update:E={opacity:Mt,text:{field:bt},x:x.x,y:x.y},exit:{opacity:Pt}},h(w,{align:a("labelAlign"),baseline:a("labelBaseline"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontStyle:a("labelFontStyle"),fontWeight:a("labelFontWeight"),limit:a("labelLimit")});const R=Wt({type:Ut,role:D,style:_t,key:St,from:d,encode:w},n.labels);return w={enter:{noBound:{value:!u},width:Pt,height:u?f(u):Pt,opacity:Pt},exit:{opacity:Pt},update:E={opacity:Mt,row:{signal:null},column:{signal:null}}},a.isVertical(!0)?(S=`ceil(item.mark.items.length / ${v})`,E.row.signal=`${y}%${S}`,E.column.signal=`floor(${y} / ${S})`,_={field:["row",y]}):(E.row.signal=`floor(${y} / ${v})`,E.column.signal=`${y} % ${v}`,_={field:y}),E.column.signal=`(${i})?${E.column.signal}:${y}`,zt({role:b,from:r={facet:{data:r,name:"value",groupby:vt}},encode:g(w,o,Ft),marks:[T,R],name:l,interactive:s,sort:_})}const en='item.orient === "left"',tn='item.orient === "right"',nn=`(${en} || ${tn})`,rn=`datum.vgrad && ${nn}`,an=Ht('"top"','"bottom"','"middle"'),on=`datum.vgrad && ${tn} ? (${Ht('"right"','"left"','"center"')}) : (${nn} && !(datum.vgrad && ${en})) ? "left" : ${Gt}`,sn=`item._anchor || (${nn} ? "middle" : "start")`,ln=`${rn} ? (${en} ? -90 : 90) : 0`,un=`${nn} ? (datum.vgrad ? (${tn} ? "bottom" : "top") : ${an}) : "top"`;function cn(e,t){let n;return(0,r.isObject)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+dn(e.path)+")":e.sphere&&(n="geoShape("+dn(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function dn(e){return(0,r.isObject)(e)&&e.signal?e.signal:(0,r.stringValue)(e)}function fn(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===It?b:t||y}function pn(e){return{marktype:e.type,name:e.name||void 0,role:e.role||fn(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function hn(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function gn(e,t){const n=(0,s.definition)(e.type);n||(0,r.error)("Unrecognized transform type: "+(0,r.stringValue)(e.type));const i=J(n.type.toLowerCase(),null,mn(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function mn(e,t,n){const r={},i=e.params.length;for(let a=0;abn(e,t,n)))):bn(e,i,n)}(e,t,n):"projection"===i?n.projectionRef(t[e.name]):e.array&&!oe(a)?a.map((t=>vn(e,t,n))):vn(e,a,n):void(e.required&&(0,r.error)("Missing required "+(0,r.stringValue)(t.type)+" parameter: "+(0,r.stringValue)(e.name)))}function vn(e,t,n){const a=e.type;if(oe(t))return Sn(a)?(0,r.error)("Expression references can not be signals."):_n(a)?n.fieldRef(t):An(a)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||_n(a);return r&&wn(t)?n.exprRef(t.expr,t.as):r&&xn(t)?ee(t.field,t.as):Sn(a)?(0,i.parseExpression)(t,n):En(a)?Z(n.getData(t).values):_n(a)?ee(t):An(a)?n.compareRef(t):t}}function bn(e,t,n){const i=e.params.length;let a;for(let n=0;ne&&e.expr,xn=e=>e&&e.field,En=e=>"data"===e,Sn=e=>"expr"===e,_n=e=>"field"===e,An=e=>"compare"===e;function Cn(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Z(t.getData(e.data).output)}function Tn(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function kn(e){return(0,r.isString)(e)?e:null}function Rn(e,t,n){const r=re(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",d=(0,i.parseExpression)(c,t);u.update=d.$expr,u.params=d.$params}function Nn(e,t){const n=fn(e),i=e.type===It,a=e.from&&e.from.facet,o=e.overlap;let s,l,u,c,d,f,p,h=e.layout||n===b||n===v;const g=n===y||h||a,m=function(e,t,n){let i,a,o,s,l;return e?(i=e.facet)&&(t||(0,r.error)("Only group marks can be faceted."),null!=i.field?s=l=Cn(i,n):(e.data?l=Z(n.getData(e.data).aggregate):(o=gn((0,r.extend)({type:"aggregate",groupby:(0,r.array)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Cn(i,n),s=l=Z(n.add(o))),a=n.keyRef(i.groupby,!0))):s=Z(n.add(Se(null,[{}]))),s||(s=Cn(e,n)),{key:a,pulse:s,parent:l}}(e.from,i,t);l=t.add(Ae({key:m.key||(e.key?ee(e.key):void 0),pulse:m.pulse,clean:!i}));const w=Z(l);l=u=t.add(Se({pulse:w})),l=t.add(Fe({markdef:pn(e),interactive:hn(e.interactive,t),clip:cn(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Z(l)}));const x=Z(l);l=c=t.add(Ce(j(e.encode,e.type,n,e.style,t,{mod:!1,pulse:x}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=gn(e,t),i=n.metadata;(i.generates||i.changes)&&(0,r.error)("Mark transforms should not generate new data."),i.nomod||(c.params.mod=!0),n.params.pulse=Z(l),t.add(l=n)})),e.sort&&(l=t.add(Ge({sort:t.compareRef(e.sort),pulse:Z(l)})));const E=Z(l);(a||h)&&(h=t.add(Ve({layout:t.objectProperty(e.layout),legends:t.legends,mark:x,pulse:E})),f=Z(h));const S=t.add(Ee({mark:x,pulse:f||E}));p=Z(S),i&&(g&&(s=t.operators,s.pop(),h&&s.pop()),t.pushState(E,f||p,w),a?function(e,t,n){const i=e.from.facet,a=i.name,o=Cn(i,t);let s;i.name||(0,r.error)("Facet must have a name: "+(0,r.stringValue)(i)),i.data||(0,r.error)("Facet must reference a data set: "+(0,r.stringValue)(i)),i.field?s=t.add(Le({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(ke({key:t.keyRef(i.groupby),group:Z(t.proxy(n.parent)),pulse:o})):(0,r.error)("Facet must specify groupby or field: "+(0,r.stringValue)(i));const l=t.fork(),u=l.add(Se()),c=l.add(He({pulse:Z(u)}));l.addData(a,new Tn(l,u,u,c)),l.addSignal("parent",null),s.params.subflow={$subflow:l.parse(e).toRuntime()}}(e,t,m):g?function(e,t,n){const r=t.add(Le({pulse:n.pulse})),i=t.fork();i.add(He()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),g&&(h&&s.push(h),s.push(S))),o&&(p=function(e,t,n){const r=e.method,i=e.bound,a=e.separation,o={separation:oe(a)?n.signalRef(a.signal):a,method:oe(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),i){const e=i.tolerance;o.boundTolerance=oe(e)?n.signalRef(e.signal):+e,o.boundScale=n.scaleRef(i.scale),o.boundOrient=i.orient}return Z(n.add(Ie(o)))}(o,p,t));const _=t.add(qe({pulse:p})),A=t.add(He({pulse:Z(_)},void 0,t.parent()));null!=e.name&&(d=e.name,t.addData(d,new Tn(t,u,_,A)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&(0,r.error)("Marks only support modify triggers."),On(e,t,d)})))}function Fn(e,t,n){const r={enter:{},update:{}};return h(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 Pn(e,t,n){return t[e]?`scale("${t[e]}",datum)`:jt(e,n[0].encode)}Tn.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let a=t[0],o=null,s=1;for(a&&"load"===a.type&&(a=t[1]),e.add(t[0]);se===pt||e===ct,Un=(e,t,n)=>oe(e)?Wn(e.signal,t,n):e===dt||e===ct?t:n,zn=(e,t,n)=>oe(e)?Gn(e.signal,t,n):Bn(e)?t:n,qn=(e,t,n)=>oe(e)?Vn(e.signal,t,n):Bn(e)?n:t,jn=(e,t,n)=>oe(e)?Yn(e.signal,t,n):e===ct?{value:t}:{value:n},Hn=(e,t,n)=>oe(e)?Xn(e.signal,t,n):e===ft?{value:t}:{value:n},Gn=(e,t,n)=>Kn(`${e} === '${ct}' || ${e} === '${pt}'`,t,n),Vn=(e,t,n)=>Kn(`${e} !== '${ct}' && ${e} !== '${pt}'`,t,n),Wn=(e,t,n)=>Qn(`${e} === '${dt}' || ${e} === '${ct}'`,t,n),Yn=(e,t,n)=>Qn(`${e} === '${ct}'`,t,n),Xn=(e,t,n)=>Qn(`${e} === '${ft}'`,t,n),Kn=(e,t,n)=>(t=null!=t?f(t):t,n=null!=n?f(n):n,Jn(t)&&Jn(n)?{signal:`${e} ? (${t=t?t.signal||(0,r.stringValue)(t.value):null}) : (${n=n?n.signal||(0,r.stringValue)(n.value):null})`}:[(0,r.extend)({test:e},t)].concat(n||[])),Jn=e=>null==e||1===Object.keys(e).length,Qn=(e,t,n)=>({signal:`${e} ? (${er(t)}) : (${er(n)})`}),Zn=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${dt}' ? (${er(r)}) : `:"")+(null!=n?`${e} === '${pt}' ? (${er(n)}) : `:"")+(null!=i?`${e} === '${ft}' ? (${er(i)}) : `:"")+(null!=t?`${e} === '${ct}' ? (${er(t)}) : `:"")+"(null)"}),er=e=>oe(e)?e.signal:null==e?null:(0,r.stringValue)(e),tr=(e,t)=>0===t?0:oe(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},nr=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function rr(e,t,n,i){let a;if(t&&(0,r.hasOwnProperty)(t,e))return t[e];if((0,r.hasOwnProperty)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":a="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":a=e[5].toLowerCase()+e.slice(6)}return i[At][a]}if(e.startsWith("label")){switch(e){case"labelColor":a="fill";break;case"labelFont":case"labelFontSize":a=e[5].toLowerCase()+e.slice(6)}return i[_t][a]}return null}function ir(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function ar(e,t){return{scale:e.scale,range:t}}function or(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function sr(e,t){const n=function(e,t){var n,i,a,o=t.config,s=o.style,l=o.axis,u="band"===t.scaleType(e.scale)&&o.axisBand,c=e.orient;if(oe(c)){const e=ir([o.axisX,o.axisY]),t=ir([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(a of(n={},e))n[a]=zn(c,rr(a,o.axisX,l,s),rr(a,o.axisY,l,s));for(a of(i={},t))i[a]=Zn(c.signal,rr(a,o.axisTop,l,s),rr(a,o.axisBottom,l,s),rr(a,o.axisLeft,l,s),rr(a,o.axisRight,l,s))}else n=c===ct||c===pt?o.axisX:o.axisY,i=o["axis"+c[0].toUpperCase()+c.slice(1)];return n||i||u?(0,r.extend)({},l,n,i,u):l}(e,t),i=e.encode||{},a=i.axis||{},o=a.name||void 0,s=a.interactive,l=a.style,u=qt(e,n),c=function(e){const t=e("tickBand");let n,i,a=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},(0,r.isObject)(a)||(a={signal:`(${t.signal}) === 'extent' ? 0 : ${a}`})):"extent"===t?(n=1,i=!0,a=0):(n=.5,i=!1):(n=e("bandPosition"),i=e("tickExtra")),{extra:i,band:n,offset:a}}(u),d={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=e.title},p=Z(t.add(Se({},[d]))),y=Z(t.add(xe({scale:t.scaleRef(e.scale),extra:t.property(c.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)}))),v=[];let b;return d.grid&&v.push(function(e,t,n,i,a){const o=qt(e,t),s=e.orient,l=e.gridScale,u=Un(s,1,-1),c=function(e,t){if(1===t);else if((0,r.isObject)(e)){let n=e=(0,r.extend)({},e);for(;null!=n.mult;){if(!(0,r.isObject)(n.mult))return n.mult=oe(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=(0,r.extend)({},n.mult)}n.mult=t}else e=oe(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,u);let d,f,p;const g={enter:d={opacity:Pt},update:p={opacity:Mt},exit:f={opacity:Pt}};h(g,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const m={scale:e.scale,field:St,band:a.band,extra:a.extra,offset:a.offset,round:o("tickRound")},y=zn(s,{signal:"height"},{signal:"width"}),v=l?{scale:l,range:0,mult:u,offset:c}:{value:0,offset:c},b=l?{scale:l,range:1,mult:u,offset:c}:(0,r.extend)(y,{mult:u,offset:c});return d.x=p.x=zn(s,m,v),d.y=p.y=qn(s,m,v),d.x2=p.x2=qn(s,b),d.y2=p.y2=zn(s,b),f.x=zn(s,m),f.y=qn(s,m),Wt({type:Lt,role:E,key:St,from:i,encode:g},n)}(e,n,i.grid,y,c)),d.ticks&&(b=u("tickSize"),v.push(function(e,t,n,r,i,a){const o=qt(e,t),s=e.orient,l=Un(s,-1,1);let u,c,d;const p={enter:u={opacity:Pt},update:d={opacity:Mt},exit:c={opacity:Pt}};h(p,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const g=f(i);g.mult=l;const m={scale:e.scale,field:St,band:a.band,extra:a.extra,offset:a.offset,round:o("tickRound")};return d.y=u.y=zn(s,Pt,m),d.y2=u.y2=zn(s,g),c.x=zn(s,m),d.x=u.x=qn(s,Pt,m),d.x2=u.x2=qn(s,g),c.y=qn(s,m),Wt({type:Lt,role:_,key:St,from:r,encode:p},n)}(e,n,i.ticks,y,b,c))),d.labels&&(b=d.ticks?b:0,v.push(function(e,t,n,r,i,a){const o=qt(e,t),s=e.orient,l=e.scale,u=Un(s,-1,1),c=ue(o("labelFlush")),d=ue(o("labelFlushOffset")),p=o("labelAlign"),g=o("labelBaseline");let m,y=0===c||!!c;const v=f(i);v.mult=u,v.offset=f(o("labelPadding")||0),v.offset.mult=u;const b={scale:l,field:St,band:.5,offset:Vt(a.offset,o("labelOffset"))},w=zn(s,y?or(l,c,'"left"','"right"','"center"'):{value:"center"},Hn(s,"left","right")),x=zn(s,jn(s,"bottom","top"),y?or(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),E=or(l,c,`-(${d})`,d,0);y=y&&d;const _={opacity:Pt,x:zn(s,b,v),y:qn(s,b,v)},A={enter:_,update:m={opacity:Mt,text:{field:bt},x:_.x,y:_.y,align:w,baseline:x},exit:{opacity:Pt,x:_.x,y:_.y}};h(A,{dx:!p&&y?zn(s,E):null,dy:!g&&y?qn(s,E):null}),h(A,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:p,baseline:g});const C=o("labelBound");let T=o("labelOverlap");return T=T||C?{separation:o("labelSeparation"),method:T,order:"datum.index",bound:C?{scale:l,orient:s,tolerance:C}:null}:void 0,m.align!==w&&(m.align=nr(m.align,w)),m.baseline!==x&&(m.baseline=nr(m.baseline,x)),Wt({type:Ut,role:S,style:_t,key:St,from:r,encode:A,overlap:T},n)}(e,n,i.labels,y,b,c))),d.domain&&v.push(function(e,t,n,r){const i=qt(e,t),a=e.orient;let o,s;const l={enter:o={opacity:Pt},update:s={opacity:Mt},exit:{opacity:Pt}};h(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const u=ar(e,0),c=ar(e,1);return o.x=s.x=zn(a,u,Pt),o.x2=s.x2=zn(a,c),o.y=s.y=qn(a,u,Pt),o.y2=s.y2=qn(a,c),Wt({type:Lt,role:x,from:r,encode:l},n)}(e,n,i.domain,p)),d.title&&v.push(function(e,t,n,i){const a=qt(e,t),o=e.orient,s=Un(o,-1,1);let l,u;const c={enter:l={opacity:Pt,anchor:f(a("titleAnchor",null)),align:{signal:Gt}},update:u=(0,r.extend)({},l,{opacity:Mt,text:f(e.title)}),exit:{opacity:Pt}},d={signal:`lerp(range("${e.scale}"), ${Ht(0,1,.5)})`};return u.x=zn(o,d),u.y=qn(o,d),l.angle=zn(o,Pt,tr(s,90)),l.baseline=zn(o,jn(o,pt,ct),{value:pt}),u.angle=l.angle,u.baseline=l.baseline,h(c,{fill:a("titleColor"),fillOpacity:a("titleOpacity"),font:a("titleFont"),fontSize:a("titleFontSize"),fontStyle:a("titleFontStyle"),fontWeight:a("titleFontWeight"),limit:a("titleLimit"),lineHeight:a("titleLineHeight")},{align:a("titleAlign"),angle:a("titleAngle"),baseline:a("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=nr(f(e),n.update[t]),!1):!m(t,r),a=i(e("titleX"),"x"),o=i(e("titleY"),"y");n.enter.auto=o===a?f(o):zn(t,f(o),f(a))}(a,o,c,n),c.update.align=nr(c.update.align,l.align),c.update.angle=nr(c.update.angle,l.angle),c.update.baseline=nr(c.update.baseline,l.baseline),Wt({type:Ut,role:A,style:At,from:i,encode:c},n)}(e,n,i.title,p)),Nn(zt({role:w,from:p,encode:g(lr(u,e),a,Ft),marks:v,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:l}),t)}function lr(e,t){const n={enter:{},update:{}};return h(n,{orient:e("orient"),offset:e("offset")||0,position:le(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 ur(e,t,n){const a=(0,r.array)(e.signals),s=(0,r.array)(e.scales);return n||a.forEach((e=>X(e,t))),(0,r.array)(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=ut(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=ut(n[e],e,t));t.addProjection(e.name,r)}(e,t))),s.forEach((e=>function(e,t){const n=e.type||"linear";(0,o.isValidScaleType)(n)||(0,r.error)("Unrecognized scale type: "+(0,r.stringValue)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),(0,r.array)(e.data).forEach((e=>function(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(gn(e,t))})),e.on&&e.on.forEach((n=>{On(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const i=[];let a,o,s,l,u,c=null,d=!1,f=!1;for(e.values?oe(e.values)||se(e.format)?(i.push(Ln(t,e)),i.push(c=$n())):i.push(c=$n({$ingest:e.values,$format:e.format})):e.url?se(e.url)||se(e.format)?(i.push(Ln(t,e)),i.push(c=$n())):i.push(c=$n({$request:e.url,$format:e.format})):e.source&&(c=a=(0,r.array)(e.source).map((e=>Z(t.getData(e).output))),i.push(null)),o=0,s=n.length;oKe(e,t))),(n||a).forEach((e=>ve(e,t))),(0,r.array)(e.axes).forEach((e=>sr(e,t))),(0,r.array)(e.marks).forEach((e=>Nn(e,t))),(0,r.array)(e.legends).forEach((e=>function(e,t){const n=t.config.legend,a=e.encode||{},s=qt(e,n),l=a.legend||{},u=l.name||void 0,c=l.interactive,d=l.style,f={};let p,m,y,v=0;Nt.forEach((t=>e[t]?(f[t]=e[t],v=v||e[t]):0)),v||(0,r.error)("Missing valid scale for legend.");const b=function(e,t){let n=e.type||kt;return e.type||1!==function(e){return Nt.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=(0,o.isContinuous)(t)?Rt:(0,o.isDiscretizing)(t)?Dt:kt),n!==Rt?n:(0,o.isDiscretizing)(t)?Dt:Rt}(e,t.scaleType(v)),w={title:null!=e.title,scales:f,type:b,vgrad:"symbol"!==b&&s.isVertical()},x=Z(t.add(Se(null,[w]))),E=Z(t.add(Oe(m={type:b,scale:t.scaleRef(v),count:t.objectProperty(s("tickCount")),limit:t.property(s("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return b===Rt?(y=[Yt(e,v,n,a.gradient),Qt(e,n,a.labels,E)],m.count=m.count||t.signalRef(`max(2,2*floor((${ue(s.gradientLength())})/100))`)):b===Dt?y=[Xt(e,v,n,a.gradient,E),Qt(e,n,a.labels,E)]:(p=function(e,t){const n=qt(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),y=[Zt(e,n,a,E,ue(p.columns))],m.size=function(e,t,n){const r=ue(Pn("size",e,n)),a=ue(Pn("strokeWidth",e,n)),o=ue(function(e,t,n){return jt("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r.fontSize}(0,t,n)}(n[1].encode,t,_t));return(0,i.parseExpression)(`max(ceil(sqrt(${r})+${a}),${o})`,t)}(e,t,y[0].marks)),y=[zt({role:k,from:x,encode:{enter:{x:{value:0},y:{value:0}}},marks:y,layout:p,interactive:c})],w.title&&y.push(function(e,t,n,r){const i=qt(e,t),a={enter:{opacity:Pt},update:{opacity:Mt,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Pt}};return h(a,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:sn},angle:{signal:ln},align:{signal:on},baseline:{signal:un},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")}),Wt({type:Ut,role:N,style:At,from:r,encode:a},n)}(e,n,a.title,x)),Nn(zt({role:C,from:x,encode:g(Fn(s,e,n),l,Ft),marks:y,aria:s("aria"),description:s("description"),zindex:s("zindex"),name:u,interactive:c,style:d}),t)}(e,t))),e.title&&function(e,t){const n=qt(e=(0,r.isString)(e)?{text:e}:e,t.config.title),i=e.encode||{},a=i.group||{},o=a.name||void 0,s=a.interactive,l=a.style,u=[],c=Z(t.add(Se(null,[{}])));u.push(function(e,t,n,r){const i={value:0},a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return h(a,{text:e.text,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")}),Wt({type:Ut,role:P,style:Ct,from:r,encode:a},n)}(e,n,function(e){const t=e.encode;return t&&t.title||(0,r.extend)({name:e.name,interactive:e.interactive,style:e.style},t)}(e),c)),e.subtitle&&u.push(function(e,t,n,r){const i={value:0},a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return h(a,{text:e.subtitle,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")}),Wt({type:Ut,role:M,style:Tt,from:r,encode:a},n)}(e,n,i.subtitle,c)),Nn(zt({role:F,from:c,encode:In(n,a),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:l}),t)}(e.title,t),t.parseLambdas(),t}const cr=e=>g({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function dr(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function fr(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 pr(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}function hr(e){return((0,r.isArray)(e)?gr:mr)(e)}function gr(e){const t=e.length;let n="[";for(let i=0;i0?",":"")+((0,r.isObject)(t)?t.signal||hr(t):(0,r.stringValue)(t))}return n+"]"}function mr(e){let t,n,i="{",a=0;for(t in e)n=e[t],i+=(++a>1?",":"")+(0,r.stringValue)(t)+":"+((0,r.isObject)(n)?n.signal||hr(n):(0,r.stringValue)(n));return i+"}"}function yr(){const e="sans-serif",t="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,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:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,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:i,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:r,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 vr(e,t,n){return(0,r.isObject)(e)||(0,r.error)("Input Vega specification must be an object."),function(e,t){const n=t.config,i=Z(t.root=t.add(Q())),a=function(e,t){const n=n=>le(e[n],t[n]),i=[dr("background",n("background")),dr("autosize",l(n("autosize"))),dr("padding",d(n("padding"))),dr("width",n("width")||0),dr("height",n("height")||0)],a=i.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return(0,r.array)(e.signals).forEach((e=>{(0,r.hasOwnProperty)(a,e.name)?e=(0,r.extend)(a[e.name],e):i.push(e),o[e.name]=e})),(0,r.array)(t.signals).forEach((e=>{(0,r.hasOwnProperty)(o,e.name)||(0,r.hasOwnProperty)(a,e.name)||i.push(e)})),i}(e,n);a.forEach((e=>X(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Se()),s=t.add(Ce(j(cr(e.encode),It,v,e.style,t,{pulse:Z(o)}))),u=t.add(Ve({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Z(s)}));t.operators.pop(),t.pushState(Z(s),Z(u),null),ur(e,t,a),t.operators.push(u);let c=t.add(Ee({mark:i,pulse:Z(u)}));return c=t.add(qe({pulse:Z(c)})),c=t.add(He({pulse:Z(c)})),t.addData("root",new Tn(t,o,o,c)),t}(e,new fr(t=(0,r.mergeConfig)(yr(),t,e.config),n)).toRuntime()}fr.prototype=pr.prototype={parse(e){return ur(e,this)},fork(){return new pr(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){const t=e instanceof K?Z(e):e;return this.add(Ue({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;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}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(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(Z(this.add(He({pulse:e})))),this._parent.push(t),this._lookup.push(n?Z(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,r.peek)(this._parent)},encode(){return(0,r.peek)(this._encode)},lookup(){return(0,r.peek)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if((0,r.isString)(e))return ee(e,t);e.signal||(0,r.error)("Unsupported field reference: "+(0,r.stringValue)(e));const n=e.signal;let i=this.field[n];if(!i){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=i=Z(this.add(Re(e)))}return i},compareRef(e){let t=!1;const n=e=>oe(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,i=(0,r.array)(e.field).map(n),a=(0,r.array)(e.order).map(n);return t?Z(this.add(_e({fields:i,orders:a}))):ne(i,a)},keyRef(e,t){let n=!1;const i=this.signals;return e=(0,r.array)(e).map((e=>oe(e)?(n=!0,Z(i[e.signal])):e)),n?Z(this.add(De({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=re(e.op,e.field),n=e.order||"ascending";return n.signal?Z(this.add(_e({fields:t,orders:this.signalRef(n.signal)}))):ne(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return(0,r.hasOwnProperty)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&(0,r.error)("Duplicate signal name: "+(0,r.stringValue)(e));const n=t instanceof K?t:this.add(Q(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||(0,r.error)("Unrecognized signal name: "+(0,r.stringValue)(e)),this.signals[e]},signalRef(e){return this.signals[e]?Z(this.signals[e]):((0,r.hasOwnProperty)(this.lambdas,e)||(this.lambdas[e]=this.add(Q(null))),Z(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t{"use strict";n.r(t),n.d(t,{getProjectionPath:()=>u,projection:()=>l,projectionProperties:()=>s});var r=n(51300),i=n(96108),a=n(14588);const o=(0,r.geoPath)(),s=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function l(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(c[e]=function(e,t){return function n(){const i=t();return i.type=e,i.path=(0,r.geoPath)().projection(i),i.copy=i.copy||function(){const e=n();return s.forEach((t=>{i[t]&&e[t](i[t]())})),e.path.pointRadius(i.path.pointRadius()),e},(0,a.registerScale)(i)}}(e,t),this):c[e]||null}function u(e){return e&&e.path||o}const c={albers:r.geoAlbers,albersusa:r.geoAlbersUsa,azimuthalequalarea:r.geoAzimuthalEqualArea,azimuthalequidistant:r.geoAzimuthalEquidistant,conicconformal:r.geoConicConformal,conicequalarea:r.geoConicEqualArea,conicequidistant:r.geoConicEquidistant,equalEarth:r.geoEqualEarth,equirectangular:r.geoEquirectangular,gnomonic:r.geoGnomonic,identity:r.geoIdentity,mercator:r.geoMercator,mollweide:i.geoMollweide,naturalEarth1:r.geoNaturalEarth1,orthographic:r.geoOrthographic,stereographic:r.geoStereographic,transversemercator:r.geoTransverseMercator};for(const e in c)l(e,c[e])},62804:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loess:()=>s,regression:()=>u});var r=n(48872),i=n(24988),a=n(26372);function o(e,t){var n,r,i,a,o,s,l=[],u=function(e){return e(a)};if(null==t)l.push(e);else for(n={},r=0,i=e.length;r{(0,r.regressionLoess)(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(c,d),p=e.as||[(0,a.accessorName)(e.x),(0,a.accessorName)(e.y)],h=l[c],g=[];let m=e.extent;(0,a.hasOwnProperty)(l,c)||(0,a.error)("Invalid regression method: "+c),null!=m&&"log"===c&&m[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),m=null),s.forEach((n=>{if(n.length<=f)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const o=h(n,e.x,e.y,d);if(e.params)return void g.push((0,i.ingest)({keys:n.dims,coef:o.coef,rSquared:o.rSquared}));const s=m||(0,a.extent)(n,e.x),l=e=>{const t={};for(let e=0;el([e,o.predict(e)]))):(0,r.sampleCurve)(o.predict,s,25,200).forEach(l)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=g}return n}})},96056:(e,t,n)=>{"use strict";n.r(t),n.d(t,{context:()=>p});var r=n(26372),i=n(24988);const a=(0,r.toSet)(["rule"]),o=(0,r.toSet)(["group","image","rect"]);function s(e){return(e+"").toLowerCase()}function l(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var u={operator:(e,t)=>l(e,["_"],t.code),parameter:(e,t)=>l(e,["datum","_"],t.code),event:(e,t)=>l(e,["event"],t.code),handler:(e,t)=>l(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:i}=t;let s="var o=item,datum=o.datum,m=0,$;";for(const e in i){const t="o["+(0,r.stringValue)(e)+"]";s+=`$=${i[e].code};if(${t}!==$)${t}=$,m=1;`}return s+=function(e,t){let n="";return a[t]||(e.x2&&(e.x?(o[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?(o[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}(i,n),s+="return m;",l(e,["item","_"],s)},codegen:{get(e){const t=`[${e.map(r.stringValue).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let a,o;return e.path?(a=`a${e.path}`,o=`b${e.path}`):((n=n||{})["f"+r]=e,a=`this.f${r}(a)`,o=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(a,o,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function c(e,t,n){if(!e||!(0,r.isObject)(e))return e;for(let i,a=0,o=d.length;ae&&e.$tupleid?i.tupleid:e));return t.fn[n]||(t.fn[n]=(0,r.compare)(a,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const a=t.fork().parse(n),o=a.get(n.operators[0].id),s=a.signals.parent;return s&&s.set(i),o.detachSubflow=()=>t.detach(a),o}}},{key:"$tupleid",parse:function(){return i.tupleid}}];const f={skip:!0};function p(e,t,n,r){return new h(e,t,n,r)}function h(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||u,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function g(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)}h.prototype=g.prototype={fork(){const e=new g(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const 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){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),"collect"===s(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 i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=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[s(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:function(e){const 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((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;"operator"!==s(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||(0,r.error)("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const i in e){const a=e[i];t[i]=(0,r.isArray)(a)?a.map((e=>c(e,n,t))):c(a,n,t)}return t},parseStream:function(e){var t,n=this,i=null!=e.filter?n.eventExpression(e.filter):void 0,a=null!=e.stream?n.get(e.stream):void 0;e.source?a=n.events(e.source,e.type,i):e.merge&&(a=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),a=a.between(t[0],t[1])),e.filter&&(a=a.filter(i)),null!=e.throttle&&(a=a.throttle(+e.throttle)),null!=e.debounce&&(a=a.debounce(+e.debounce)),null==a&&(0,r.error)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&a.consume(!0),n.stream(e,a)},parseUpdate:function(e){var t,n=this,i=(0,r.isObject)(i=e.source)?i.$ref:i,a=n.get(i),o=e.update,s=void 0;a||(0,r.error)("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(s=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,a,t,o,s)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,i=e.data,a=e.signals;Object.keys(a||{}).forEach((e=>{n.update(t.signals[e],a[e],f)})),Object.keys(i||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(r.truthy).insert(i[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}}},14588:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Band:()=>A,BinOrdinal:()=>C,DiscreteLegend:()=>ue,Diverging:()=>b,GradientLegend:()=>ce,Identity:()=>c,Linear:()=>d,Log:()=>f,Ordinal:()=>S,Point:()=>_,Pow:()=>p,Quantile:()=>w,Quantize:()=>x,Sequential:()=>v,Sqrt:()=>h,SymbolLegend:()=>le,Symlog:()=>g,Threshold:()=>E,Time:()=>m,UTC:()=>y,bandSpace:()=>u,domainCaption:()=>De,interpolate:()=>ne,interpolateColors:()=>Q,interpolateRange:()=>J,isContinuous:()=>j,isDiscrete:()=>H,isDiscretizing:()=>G,isInterpolating:()=>Y,isLogarithmic:()=>V,isQuantile:()=>X,isRegisteredScale:()=>B,isTemporal:()=>W,isValidScaleType:()=>z,labelFormat:()=>Se,labelFraction:()=>Re,labelValues:()=>xe,quantizeInterpolator:()=>Z,registerScale:()=>L,scale:()=>U,scaleCopy:()=>ee,scaleFraction:()=>te,scaleImplicit:()=>a.scaleImplicit,scheme:()=>se,tickCount:()=>he,tickFormat:()=>ye,tickValues:()=>me,validTicks:()=>ge});var r=n(26372),i=n(61388),a=n(71303),o=n(82226),s=n(71864),l=n(71652);function u(e,t,n){const r=e-t+2*n;return e?r>0?r:1:0}const c="identity",d="linear",f="log",p="pow",h="sqrt",g="symlog",m="time",y="utc",v="sequential",b="diverging",w="quantile",x="quantize",E="threshold",S="ordinal",_="point",A="band",C="bin-ordinal",T="continuous",k="discrete",R="discretizing",D="interpolating",O="temporal";function N(){const e=(0,a.scaleOrdinal)().unknown(void 0),t=e.domain,n=e.range;let r,o,s=[0,1],l=!1,c=0,d=0,f=.5;function p(){const e=t().length,a=s[1]g+r*e));return n(a?m.reverse():m)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),p()):t()},e.range=function(e){return arguments.length?(s=[+e[0],+e[1]],p()):s.slice()},e.rangeRound=function(e){return s=[+e[0],+e[1]],l=!0,p()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(e){return arguments.length?(l=!!e,p()):l},e.padding=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),c=d,p()):c},e.paddingInner=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),p()):c},e.paddingOuter=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),p()):d},e.align=function(e){return arguments.length?(f=Math.max(0,Math.min(1,e)),p()):f},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=s[1]s[1-r])?void 0:(u=Math.max(0,(0,i.bisectRight)(a,f)-1),c=f===p?u:(0,i.bisectRight)(a,p)-1,f-a[u]>o+1e-10&&++u,r&&(d=u,u=l-c,c=l-d),u>c?void 0:t().slice(u,c+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return N().domain(t()).range(s).round(l).paddingInner(c).paddingOuter(d).align(f)},p()}function F(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return F(t())},e}var P=Array.prototype.map;const M=Array.prototype.slice,I=new Map,$=Symbol("vega_scale");function L(e){return e[$]=!0,e}function B(e){return e&&!0===e[$]}function U(e,t,n){return arguments.length>1?(I.set(e,function(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[a]<=l&&(u<0&&(u=a),r=a);if(!(u<0))return s=e.invertExtent(n[u]),l=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,L(n)};return i.metadata=(0,r.toSet)((0,r.array)(n)),i}(e,t,n)),this):z(e)?I.get(e):void 0}function z(e){return I.has(e)}function q(e,t){const n=I.get(e);return n&&n.metadata[t]}function j(e){return q(e,T)}function H(e){return q(e,k)}function G(e){return q(e,R)}function V(e){return q(e,f)}function W(e){return q(e,O)}function Y(e){return q(e,D)}function X(e){return q(e,w)}U(c,a.scaleIdentity),U(d,a.scaleLinear,T),U(f,a.scaleLog,[T,f]),U(p,a.scalePow,T),U(h,a.scaleSqrt,T),U(g,a.scaleSymlog,T),U(m,a.scaleTime,[T,O]),U(y,a.scaleUtc,[T,O]),U(v,a.scaleSequential,[T,D]),U(`${v}-${d}`,a.scaleSequential,[T,D]),U(`${v}-${f}`,a.scaleSequentialLog,[T,D,f]),U(`${v}-${p}`,a.scaleSequentialPow,[T,D]),U(`${v}-${h}`,a.scaleSequentialSqrt,[T,D]),U(`${v}-${g}`,a.scaleSequentialSymlog,[T,D]),U(`${b}-${d}`,a.scaleDiverging,[T,D]),U(`${b}-${f}`,a.scaleDivergingLog,[T,D,f]),U(`${b}-${p}`,a.scaleDivergingPow,[T,D]),U(`${b}-${h}`,a.scaleDivergingSqrt,[T,D]),U(`${b}-${g}`,a.scaleDivergingSymlog,[T,D]),U(w,a.scaleQuantile,[R,w]),U(x,a.scaleQuantize,R),U(E,a.scaleThreshold,R),U(C,(function e(){let t=[],n=[];function o(e){return null==e||e!=e?void 0:n[((0,i.bisect)(t,e)-1)%n.length]}return o.domain=function(e){return arguments.length?(t=function(e){return P.call(e,r.toNumber)}(e),o):t.slice()},o.range=function(e){return arguments.length?(n=M.call(e),o):n.slice()},o.tickFormat=function(e,n){return(0,a.tickFormat)(t[0],(0,r.peek)(t),null==e?10:e,n)},o.copy=function(){return e().domain(o.domain()).range(o.range())},o}),[k,R]),U(S,a.scaleOrdinal,k),U(A,N,k),U(_,(function(){return F(N().paddingInner(1))}),k);const K=["clamp","base","constant","exponent"];function J(e,t){const n=t[0],i=(0,r.peek)(t)-n;return function(t){return e(n+t*i)}}function Q(e,t,n){return o.piecewise(ne(t||"rgb",n),e)}function Z(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?s[t](e[t]()):0)),s):(0,r.constant)(.5)}function ne(e,t){const n=o[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}const re={accent:s.schemeAccent,category10:s.schemeCategory10,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:s.schemeDark2,observable10:s.schemeObservable10,paired:s.schemePaired,pastel1:s.schemePastel1,pastel2:s.schemePastel2,set1:s.schemeSet1,set2:s.schemeSet2,set3:s.schemeSet3,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function ie(e){if((0,r.isArray)(e))return e;const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(oe[e]=t,this):oe[e]}ae(re,ie),ae({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"},(e=>Q(ie(e))));const le="symbol",ue="discrete",ce="gradient",de=e=>(0,r.isArray)(e)?e.map((e=>String(e))):String(e),fe=(e,t)=>e[1]-t[1],pe=(e,t)=>t[1]-e[1];function he(e,t,n){let i;return(0,r.isNumber)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor((0,r.span)(e.domain())/n||1)+1))),(0,r.isObject)(t)&&(i=t.step,t=t.interval),(0,r.isString)(t)&&(t=e.type===m?(0,l.timeInterval)(t):e.type==y?(0,l.utcInterval)(t):(0,r.error)("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function ge(e,t,n){let i=e.range(),a=i[0],o=(0,r.peek)(i),s=fe;if(a>o&&(i=o,o=a,a=i,s=pe),a=Math.floor(a),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>a<=e[1]&&e[1]<=o)).sort(s).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],(0,r.peek)(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function me(e,t){return e.bins?ge(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function ye(e,t,n,r,i,a){const o=t.type;let s=de;if(o===m||i===m)s=e.timeFormat(r);else if(o===y||i===y)s=e.utcFormat(r);else if(V(o)){const i=e.formatFloat(r);if(a||t.bins)s=i;else{const e=ve(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function ve(e,t,n){const r=me(e,t),i=e.base(),a=Math.log(i),o=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/a));return t*ibe[e.type]||e.bins;function Se(e,t,n,r,i,a,o){const s=we[t.type]&&a!==m&&a!==y?function(e,t,n){const r=t[we[t.type]](),i=r.length;let a,o=i>1?r[1]-r[0]:r[0];for(a=1;a(t,n,r)=>{const i=Ae(r[n+1],Ae(r.max,1/0)),a=ke(t,e),o=ke(i,e);return a&&o?a+" – "+o:o?"< "+o:"≥ "+a},Ae=(e,t)=>null!=e?e:t,Ce=e=>(t,n)=>n?e(t):null,Te=e=>t=>e(t),ke=(e,t)=>Number.isFinite(e)?t(e):null;function Re(e){const t=e.domain(),n=t.length-1;let i=+t[0],a=+(0,r.peek)(t),o=a-i;if(e.type===E){const e=n?o/n:.1;i-=e,a+=e,o=a-i}return e=>(e-i)/o}function De(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),a=function(e,t,n,i){const a=i||t.type;return(0,r.isString)(n)&&W(a)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||a!==m?n||a!==y?Se(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}(e,t,n.format,n.formatType);if(G(t.type)){const e=xe(t).slice(1).map(a),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(H(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>i?e.slice(0,i-2).map(a).join(", ")+", ending with "+e.slice(-1).map(a):e.map(a).join(", ")}`}{const e=t.domain();return`values from ${a(e[0])} to ${a((0,r.peek)(e))}`}}},84636:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>ce,CanvasHandler:()=>Yn,CanvasRenderer:()=>er,Gradient:()=>h,GroupItem:()=>fe,Handler:()=>An,HybridHandler:()=>Gr,HybridRenderer:()=>Hr,Item:()=>de,Marks:()=>un,RenderType:()=>Xr,Renderer:()=>Tn,ResourceLoader:()=>pe,SVGHandler:()=>nr,SVGRenderer:()=>kr,SVGStringRenderer:()=>zr,Scenegraph:()=>yn,boundClip:()=>ri,boundContext:()=>Pe,boundItem:()=>cn,boundMark:()=>fn,boundStroke:()=>me,domChild:()=>xn,domClear:()=>En,domCreate:()=>bn,domFind:()=>wn,font:()=>en,fontFamily:()=>Zt,fontSize:()=>Yt,intersect:()=>Qr,intersectBoxLine:()=>Ge,intersectPath:()=>ze,intersectPoint:()=>qe,intersectRule:()=>He,lineHeight:()=>Xt,markup:()=>wr,multiLineOffset:()=>Jt,path:()=>a.path,pathCurves:()=>m,pathEqual:()=>oi,pathParse:()=>E,pathRectangle:()=>V,pathRender:()=>F,pathSymbols:()=>$,pathTrail:()=>W,point:()=>_n,renderModule:()=>Jr,resetSVGClipId:()=>le,resetSVGDefIds:()=>si,sceneEqual:()=>ai,sceneFromJSON:()=>gn,scenePickVisit:()=>rt,sceneToJSON:()=>hn,sceneVisit:()=>nt,sceneZOrder:()=>tt,serializeXML:()=>xr,setHybridRendererOptions:()=>jr,textMetrics:()=>qt});var r=n(26372),i=n(76588),a=n(20066),o=n(14958),s=n(83418),l=n(14588);let u=0;const c="p_";function d(e){return e&&e.gradient}function f(e,t,n){const r=e.gradient;let i=e.id,a="radial"===r?c:"";return i||(i=e.id="gradient_"+u++,"radial"===r?(e.x1=p(e.x1,.5),e.y1=p(e.y1,.5),e.r1=p(e.r1,0),e.x2=p(e.x2,.5),e.y2=p(e.y2,.5),e.r2=p(e.r2,.5),a=c):(e.x1=p(e.x1,0),e.y1=p(e.y1,0),e.x2=p(e.x2,1),e.y2=p(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+a+i+")"}function p(e,t){return null!=e?e:t}function h(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const g={basis:{curve:i.curveBasis},"basis-closed":{curve:i.curveBasisClosed},"basis-open":{curve:i.curveBasisOpen},bundle:{curve:i.curveBundle,tension:"beta",value:.85},cardinal:{curve:i.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:i.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:i.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:i.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:i.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:i.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:i.curveLinear},"linear-closed":{curve:i.curveLinearClosed},monotone:{horizontal:i.curveMonotoneY,vertical:i.curveMonotoneX},natural:{curve:i.curveNatural},step:{curve:i.curveStep},"step-after":{curve:i.curveStepAfter},"step-before":{curve:i.curveStepBefore}};function m(e,t,n){var i=(0,r.hasOwnProperty)(g,e)&&g[e],a=null;return i&&(a=i.curve||i[t||"vertical"],i.tension&&null!=n&&(a=a[i.tension](n))),a}const y={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},v=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,b=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,w=/^((\s+,?\s*)|(,\s*))/,x=/^[01]/;function E(e){const t=[];return(e.match(v)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=y[r],a=function(e,t,n){const r=[];for(let i=0;t&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=f/n,y=d/n,v=-d/r,b=f/r,w=m*s+y*l,x=v*s+b*l,E=m*e+y*t,C=v*e+b*t;let k=1/((E-w)*(E-w)+(C-x)*(C-x))-.25;k<0&&(k=0);let D=Math.sqrt(k);a==i&&(D=-D);const O=.5*(w+E)-D*(C-x),N=.5*(x+C)+D*(E-w),F=Math.atan2(x-N,w-O);let P=Math.atan2(C-N,E-O)-F;P<0&&1===a?P+=A:P>0&&0===a&&(P-=A);const M=Math.ceil(Math.abs(P/(_+.001))),I=[];for(let e=0;e+e}function G(e,t,n){return Math.max(t,Math.min(e,n))}function V(){var e=U,t=z,n=q,r=j,i=H(0),o=i,s=i,l=i,u=null;function c(c,d,f){var p,h=null!=d?d:+e.call(this,c),g=null!=f?f:+t.call(this,c),m=+n.call(this,c),y=+r.call(this,c),v=Math.min(m,y)/2,b=G(+i.call(this,c),0,v),w=G(+o.call(this,c),0,v),x=G(+s.call(this,c),0,v),E=G(+l.call(this,c),0,v);if(u||(u=p=(0,a.path)()),b<=0&&w<=0&&x<=0&&E<=0)u.rect(h,g,m,y);else{var S=h+m,_=g+y;u.moveTo(h+b,g),u.lineTo(S-w,g),u.bezierCurveTo(S-B*w,g,S,g+B*w,S,g+w),u.lineTo(S,_-E),u.bezierCurveTo(S,_-B*E,S-B*E,_,S-E,_),u.lineTo(h+x,_),u.bezierCurveTo(h+B*x,_,h,_-B*x,h,_-x),u.lineTo(h,g+b),u.bezierCurveTo(h,g+B*b,h+B*b,g,h+b,g),u.closePath()}if(p)return u=null,p+""||null}return c.x=function(t){return arguments.length?(e=H(t),c):e},c.y=function(e){return arguments.length?(t=H(e),c):t},c.width=function(e){return arguments.length?(n=H(e),c):n},c.height=function(e){return arguments.length?(r=H(e),c):r},c.cornerRadius=function(e,t,n,r){return arguments.length?(i=H(e),o=null!=t?H(t):i,l=null!=n?H(n):i,s=null!=r?H(r):o,c):i},c.context=function(e){return arguments.length?(u=null==e?null:e,c):u},c}function W(){var e,t,n,r,i,o,s,l,u=null;function c(e,t,n){const r=n/2;if(i){var a=s-t,c=e-o;if(a||c){var d=Math.hypot(a,c),f=(a/=d)*l,p=(c/=d)*l,h=Math.atan2(c,a);u.moveTo(o-f,s-p),u.lineTo(e-a*r,t-c*r),u.arc(e,t,r,h-Math.PI,h),u.lineTo(o+f,s+p),u.arc(o,s,l,h,h+Math.PI)}else u.arc(e,t,r,0,A);u.closePath()}else i=1;o=e,s=t,l=r}function d(o){var s,l,d,f=o.length,p=!1;for(null==u&&(u=d=(0,a.path)()),s=0;s<=f;++s)!(se.x||0,K=e=>e.y||0,J=e=>!(!1===e.defined),Q=(0,i.arc)().startAngle((e=>e.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),Z=(0,i.area)().x(X).y1(K).y0((e=>(e.y||0)+(e.height||0))).defined(J),ee=(0,i.area)().y(K).x1(X).x0((e=>(e.x||0)+(e.width||0))).defined(J),te=(0,i.line)().x(X).y(K).defined(J),ne=V().x(X).y(K).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>Y(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>Y(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>Y(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>Y(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),re=(0,i.symbol)().type((e=>$(e.shape||"circle"))).size((e=>Y(e.size,64))),ie=W().x(X).y(K).defined(J).size((e=>e.size||1));function ae(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function oe(e,t,n,r){return ne.context(e)(t,n,r)}var se=1;function le(){se=1}function ue(e,t,n){var i=t.clip,a=e._defs,o=t.clip_id||(t.clip_id="clip"+se++),s=a.clipping[o]||(a.clipping[o]={id:o});return(0,r.isFunction)(i)?s.path=i(null):ae(n)?s.path=oe(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function ce(e){this.clear(),e&&this.union(e)}function de(e){this.mark=e,this.bounds=this.bounds||new ce}function fe(e){de.call(this,e),this.items=this.items||[]}ce.prototype={clone(){return new ce(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 nthis.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){const 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:a,y2:o}=this,s=Math.cos(e),l=Math.sin(e),u=t-t*s+n*l,c=n-t*l-n*s;return[s*r-l*i+u,l*r+s*i+c,s*r-l*o+u,l*r+s*o+c,s*a-l*i+u,l*a+s*i+c,s*a-l*o+u,l*a+s*o+c]},union(e){return e.x1this.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=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.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,r.inherits)(fe,de);class pe{constructor(e){this._pending=0,this._loader=e||(0,s.loader)()}pending(){return this._pending}sanitizeURL(e){const t=this;return he(t),t._loader.sanitize(e,{context:"href"}).then((e=>(ge(t),e))).catch((()=>(ge(t),null)))}loadImage(e){const t=this,n=(0,o.image)();return he(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const i=e.href;if(!i||!n)throw{url:i};const a=new n,o=(0,r.hasOwnProperty)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(a.crossOrigin=o),a.onload=()=>ge(t),a.onerror=()=>ge(t),a.src=i,a})).catch((e=>(ge(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))}ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}}function he(e){e._pending+=1}function ge(e){e._pending-=1}function me(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}const ye=A-1e-8;let ve,be,we,xe,Ee,Se,_e,Ae;const Ce=(e,t)=>ve.add(e,t),Te=(e,t)=>Ce(be=e,we=t),ke=e=>Ce(e,ve.y1),Re=e=>Ce(ve.x1,e),De=(e,t)=>Ee*e+_e*t,Oe=(e,t)=>Se*e+Ae*t,Ne=(e,t)=>Ce(De(e,t),Oe(e,t)),Fe=(e,t)=>Te(De(e,t),Oe(e,t));function Pe(e,t){return ve=e,t?(xe=t*S,Ee=Ae=Math.cos(xe),Se=Math.sin(xe),_e=-Se):(Ee=Ae=1,xe=Se=_e=0),Me}const Me={beginPath(){},closePath(){},moveTo:Fe,lineTo:Fe,rect(e,t,n,r){xe?(Ne(e+n,t),Ne(e+n,t+r),Ne(e,t+r),Fe(e,t)):(Ce(e+n,t+r),Te(e,t))},quadraticCurveTo(e,t,n,r){const i=De(e,t),a=Oe(e,t),o=De(n,r),s=Oe(n,r);Ie(be,i,o,ke),Ie(we,a,s,Re),Te(o,s)},bezierCurveTo(e,t,n,r,i,a){const o=De(e,t),s=Oe(e,t),l=De(n,r),u=Oe(n,r),c=De(i,a),d=Oe(i,a);$e(be,o,l,c,ke),$e(we,s,u,d,Re),Te(c,d)},arc(e,t,n,r,i,a){if(r+=xe,i+=xe,be=n*Math.cos(i)+e,we=n*Math.sin(i)+t,Math.abs(i-r)>ye)Ce(e-n,t-n),Ce(e+n,t+n);else{const o=r=>Ce(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,l;if(o(r),o(i),i!==r)if((r%=A)<0&&(r+=A),(i%=A)<0&&(i+=A),ii;++l,s-=_)o(s);else for(s=r-r%_+_,l=0;l<4&&s1e-14?(l=o*o+s*a,l>=0&&(l=Math.sqrt(l),u=(-o+l)/a,c=(-o-l)/a)):u=.5*s/o,0m)return!1;p>g&&(g=p)}else if(d>0){if(p0&&(e.globalAlpha=n,e.fillStyle=Ke(e,t,t.fill),!0)}var Qe=[];function Ze(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&(n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=Ke(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||Qe),e.lineDashOffset=t.strokeDashOffset||0),!0)}function et(e,t){return e.zindex-t.zindex||e.index-t.index}function tt(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,a=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===a)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function it(e){return function(t,n,r){nt(n,(n=>{r&&!r.intersects(n.bounds)||ot(e,t,n,n)}))}}function at(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||ot(e,t,n.items[0],n.items)}}function ot(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(Ve(t,n),n.fill&&Je(t,n,i)&&t.fill(),n.stroke&&Ze(t,n,i)&&t.stroke()))}function st(e){return e=e||r.truthy,function(t,n,r,i,a,o){return r*=t.pixelRatio,i*=t.pixelRatio,rt(n,(n=>{const s=n.bounds;if((!s||s.contains(a,o))&&s)return e(t,n,r,i,a,o)?n:void 0}))}}function lt(e,t){return function(n,r,i,a){var o,s,l=Array.isArray(r)?r[0]:r,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(o=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(u&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a))}}function ut(e){return st(lt(e))}function ct(e,t){return"translate("+e+","+t+")"}function dt(e){return"rotate("+e+")"}function ft(e){return ct(e.x||0,e.y||0)}function pt(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,a=n.angle||0;e.translate(r,i),a&&e.rotate(a*=S),e.beginPath(),t(e,n),a&&e.rotate(-a),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return ct(e.x||0,e.y||0)+(e.angle?" "+dt(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Pe(e,n.angle),n),me(e,n).translate(n.x||0,n.y||0)},draw:it(r),pick:ut(r),isect:n||ze(r)}}var ht=pt("arc",(function(e,t){return Q.context(e)(t)}));function gt(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=lt(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(Pe(e),r),me(e,r[0]))},draw:at(r),pick:function(e,t,n,r,a,o){var s=t.items,l=t.bounds;return!s||!s.length||l&&!l.contains(a,o)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:qe,tip:n}}var mt=gt("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?ee:Z).curve(m(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",o=e.length,s=1/0;--o>=0;)!1!==e[o].defined&&(r=Math.abs(e[o][a]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function bt(e,t){const n=vt(t);e("d",oe(null,t,n,n))}function wt(e,t,n,r){const i=vt(t);e.beginPath(),oe(e,t,(n||0)+i,(r||0)+i)}const xt=lt(wt),Et=lt(wt,!1),St=lt(wt,!0);var _t={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",ft(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const i=t.x||0,a=t.y||0,o=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(wt(e,t,i,a),Ve(e,t),t.fill&&Je(e,t,s)&&e.fill(),t.stroke&&!o&&Ze(e,t,s)&&e.stroke()),e.save(),e.translate(i,a),t.clip&&yt(e,t),n&&n.translate(-i,-a),nt(t,(t=>{("group"===t.marktype||null==r||r.includes(t.marktype))&&this.draw(e,t,n,r)})),n&&n.translate(i,a),e.restore(),o&&t.stroke&&s&&(wt(e,t,i,a),Ve(e,t),Ze(e,t,s)&&e.stroke())}))},pick:function(e,t,n,r,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;const o=n*e.pixelRatio,s=r*e.pixelRatio;return rt(t,(l=>{let u,c,d;const f=l.bounds;if(f&&!f.contains(i,a))return;c=l.x||0,d=l.y||0;const p=c+(l.width||0),h=d+(l.height||0),g=l.clip;if(g&&(ip||ah))return;if(e.save(),e.translate(c,d),c=i-c,d=a-d,g&&ae(l)&&!St(e,l,o,s))return e.restore(),null;const m=l.strokeForeground,y=!1!==t.interactive;return y&&m&&l.stroke&&Et(e,l,o,s)?(e.restore(),l):(u=rt(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,d)?this.pick(e,n,r,c,d):null)),!u&&y&&(l.fill||!m&&l.stroke)&&xt(e,l,o,s)&&(u=l),e.restore(),u||null)}))},isect:je,content:function(e,t,n){e("clip-path",t.clip?ue(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),bt(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?bt(e,t):e("d","")}},At={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Ct(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((t=>{e.image=t,e.image.url=e.url}))),n}function Tt(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function kt(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Rt(e,t){return"center"===e?t/2:"right"===e?t:0}function Dt(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Ot={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=Ct(t,n),i=Tt(t,r),a=kt(t,r),o=(t.x||0)-Rt(t.align,i),s=(t.y||0)-Dt(t.baseline,a);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",At["xmlns:xlink"],"xlink:href"),e("transform",ct(o,s)),e("width",i),e("height",a),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=Tt(t,n),i=kt(t,n),a=(t.x||0)-Rt(t.align,r),o=(t.y||0)-Dt(t.baseline,i);return e.set(a,o,a+r,o+i)},draw:function(e,t,n){nt(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=Ct(t,this);let i=Tt(t,r),a=kt(t,r);if(0===i||0===a)return;let o,s,l,u,c=(t.x||0)-Rt(t.align,i),d=(t.y||0)-Dt(t.baseline,a);!1!==t.aspect&&(s=r.width/r.height,l=t.width/t.height,s==s&&l==l&&s!==l&&(l=0;)if(!1!==e[a].defined&&(n=e[a].x-t[0])*n+(r=e[a].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&$t(e,t,r)&&(Ve(e,t),e.stroke())}}))},pick:st((function(e,t,n,r){return!!e.isPointInStroke&&$t(e,t,1)&&e.isPointInStroke(n,r)})),isect:He},Bt=pt("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),Ut=pt("symbol",(function(e,t){return re.context(e)(t)}),qe);const zt=(0,r.lruCache)();var qt={height:Yt,measureWidth:Vt,estimateWidth:Ht,width:Ht,canvas:jt};function jt(e){qt.width=e&&Be?Vt:Ht}function Ht(e,t){return Gt(Qt(e,t),Yt(e))}function Gt(e,t){return~~(.8*e.length*t)}function Vt(e,t){return Yt(e)<=0||!(t=Qt(e,t))?0:Wt(t,en(e))}function Wt(e,t){const n=`(${t}) ${e}`;let r=zt.get(n);return void 0===r&&(Be.font=t,r=Be.measureText(e).width,zt.set(n,r)),r}function Yt(e){return null!=e.fontSize?+e.fontSize||0:11}function Xt(e){return null!=e.lineHeight?e.lineHeight:Yt(e)+2}function Kt(e){return t=e.lineBreak&&e.text&&!(0,r.isArray)(e.text)?e.text.split(e.lineBreak):e.text,(0,r.isArray)(t)?t.length>1?t:t[0]:t;var t}function Jt(e){const t=Kt(e);return((0,r.isArray)(t)?t.length-1:0)*Xt(e)}function Qt(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(qt.width===Vt){const t=en(e);return e=>Wt(e,t)}if(qt.width===Ht){const t=Yt(e);return e=>Gt(e,t)}return t=>qt.width(e,t)}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:l=i;return a+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,qt.width(t,n))),0)):i=qt.width(t,f),"center"===o?c-=i/2:"right"===o&&(c-=i),e.set(c+=l,d+=u,c+i,d+a),t.angle&&!n)e.rotate(t.angle*S,l,u);else if(2===n)return e.rotatedPoints(t.angle*S,l,u);return e}var sn={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+tn(t),a=an(t),o=a.x1,s=a.y1,l=t.angle||0;e("text-anchor",nn[t.align]||"start"),l?(n=ct(o,s)+" "+dt(l),(r||i)&&(n+=" "+ct(r,i))):n=ct(o+r,s+i),e("transform",n)},bound:on,draw:function(e,t,n){nt(t,(t=>{var i,a,o,s,l,u,c,d=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===d||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=en(t),e.textAlign=t.align||"left",a=(i=an(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*S),a=o=0),a+=t.dx||0,o+=(t.dy||0)+tn(t),u=Kt(t),Ve(e,t),(0,r.isArray)(u))for(l=Xt(t),s=0;s=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),un={arc:ht,area:mt,group:_t,image:Ot,line:Nt,path:Pt,rect:It,rule:Lt,shape:Bt,symbol:Ut,text:sn,trail:ln};function cn(e,t,n){var r=un[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new ce),e,n)}var dn={mark:null};function fn(e,t,n){var r,i,a,o,s=un[e.marktype],l=s.bound,u=e.items,c=u&&u.length;if(s.nested)return c?a=u[0]:(dn.mark=e,a=dn),o=cn(a,l,n),t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new ce,c)for(r=0,i=u.length;rt;)e.removeChild(n[--r]);return e}function Sn(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function _n(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}class An{constructor(e,t){this._active=null,this._handlers={},this._loader=e||(0,s.loader)(),this._tooltip=t||Cn}initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1}handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n}eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=bn(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))}handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,a,o=e&&e.mark;if(o&&(i=un[o.marktype]).tip){for((a=_n(t,n))[0]-=r[0],a[1]-=r[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(o.items,a)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}}getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,a=i.width(),o=i.height();let s=i.x1+r[0]+n.left,l=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,l+=e.y||0;return{x:s,y:l,width:a,height:o,left:s,top:l,right:s+a,bottom:l+o}}}function Cn(e,t,n,r){e.element().setAttribute("title",r||"")}class Tn{constructor(e){this._el=null,this._bgcolor=null,this._loader=new pe(e)}initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this}dirty(){}render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)}_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const kn="dragenter",Rn="dragleave",Dn="dragover",On="pointerdown",Nn="pointermove",Fn="pointerout",Pn="pointerover",Mn="mousedown",In="mousemove",$n="mouseout",Ln="mouseover",Bn="click",Un="mousewheel",zn="touchstart",qn="touchmove",jn="touchend",Hn=["keydown","keypress","keyup",kn,Rn,Dn,On,"pointerup",Nn,Fn,Pn,Mn,"mouseup",In,$n,Ln,Bn,"dblclick","wheel",Un,zn,qn,jn],Gn=Nn,Vn=$n,Wn=Bn;class Yn extends An{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Hn,this.pointermove=Qn([Nn,In],[Pn,Ln],[Fn,$n]),this.dragover=Qn([Dn],[kn],[Rn]),this.pointerout=Zn([Fn,$n]),this.dragleave=Zn([Rn])}initialize(e,t,n){return this._canvas=e&&wn(e,"canvas"),[Bn,Mn,On,Nn,Fn,Rn].forEach((e=>Kn(this,e))),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(Un,e)}pointerdown(e){this._down=this._active,this.fire(On,e)}mousedown(e){this._down=this._active,this.fire(Mn,e)}click(e){this._down===this._active&&(this.fire(Bn,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(zn,e,!0)}touchmove(e){this.fire(qn,e,!0)}touchend(e){this.fire(jn,e,!0),this._touch=null}fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===Wn&&r&&r.href?this.handleHref(t,r,r.href):e!==Gn&&e!==Vn||this.handleTooltip(t,r,e!==Vn),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this}pickEvent(e){const t=_n(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,r,i){const a=this.context();return un[e.marktype].pick.call(this,a,e,t,n,r,i)}}const Xn=e=>e===zn||e===qn||e===jn?[zn,qn,jn]:[e];function Kn(e,t){Xn(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function Jn(e,t,n){t.forEach((t=>e.fire(t,n)))}function Qn(e,t,n){return function(r){const i=this._active,a=this.pickEvent(r);a===i||(i&&i.exit||Jn(this,n,r),this._active=a,Jn(this,t,r)),Jn(this,e,r)}}function Zn(e){return function(t){Jn(this,e,t),this._active=null}}class er extends Tn{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new ce,this._tempb=new ce}initialize(e,t,n,r,i,a){return this._options=a||{},this._canvas=this._options.externalContext?null:(0,o.canvas)(1,1,this._options.type),e&&this._canvas&&(En(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,t,n,r,i)}resize(e,t,n,i){if(super.resize(e,t,n,i),this._canvas)!function(e,t,n,r,i,a){const o="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),l=o?"undefined"!=typeof window&&window.devicePixelRatio||1:i;e.width=t*l,e.height=n*l;for(const e in a)s[e]=a[e];o&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=l,s.setTransform(l,0,0,l,l*r[0],l*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||(0,r.error)("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.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(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){const n=this.context(),r=this._origin,i=this._width,a=this._height,o=this._dirty,s=tr(r,i,a);n.save();const l=this._redraw||o.empty()?(this._redraw=!1,s.expand(1)):function(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}(n,s.intersect(o),r);return this.clear(-r[0],-r[1],i,a),this.draw(n,e,l,t),n.restore(),o.clear(),this}draw(e,t,n,i){if("group"!==t.marktype&&null!=i&&!i.includes(t.marktype))return;const a=un[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),(0,r.isFunction)(n)?(e.beginPath(),n(e),e.clip()):yt(e,t.group)}(e,t),a.draw.call(this,e,t,n,i),t.clip&&e.restore()}clear(e,t,n,r){const i=this._options,a=this.context();"pdf"===i.type||i.externalContext||a.clearRect(e,t,n,r),null!=this._bgcolor&&(a.fillStyle=this._bgcolor,a.fillRect(e,t,n,r))}}const tr=(e,t,n)=>(new ce).set(0,0,t,n).translate(-e[0],-e[1]);class nr extends An{constructor(e,t){super(e,t);const n=this;n._hrefHandler=rr(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=rr(n,((e,t)=>{n.handleTooltip(e,t,e.type!==Vn)}))}initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(Wn,this._hrefHandler),r.removeEventListener(Gn,this._tooltipHandler),r.removeEventListener(Vn,this._tooltipHandler)),this._svg=r=e&&wn(e,"svg"),r&&(r.addEventListener(Wn,this._hrefHandler),r.addEventListener(Gn,this._tooltipHandler),r.addEventListener(Vn,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:rr(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this}off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}}const rr=(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)},ir="aria-hidden",ar="aria-label",or="role",sr="aria-roledescription",lr="graphics-object",ur="graphics-symbol",cr=(e,t,n)=>({[or]:e,[sr]:t,[ar]:n||void 0}),dr=(0,r.toSet)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),fr={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?yr(e):null,i=e.context,a=i.scales[t.scale].value,o=i.dataflow.locale(),s=a.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(r?` titled '${r}'`:"")+` for a ${(0,l.isDiscrete)(s)?"discrete":s} scale`+` with ${(0,l.domainCaption)(o,a,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?yr(e):null,i=`${t.type||""} legend`.trim(),a=t.scales,o=Object.keys(a),s=e.context,u=s.scales[a[o[0]]].value,c=s.dataflow.locale();return((d=i).length?d[0].toUpperCase()+d.slice(1):d)+(n?` titled '${n}'`:"")+` for ${function(e){return(e=e.map((e=>e+("fill"===e||"stroke"===e?" color":"")))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+(0,r.peek)(e)}(o)}`+` with ${(0,l.domainCaption)(c,u,e)}`;var d}},"title-text":{desc:"title",caption:e=>`Title text '${mr(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${mr(e)}'`}},pr={ariaRole:or,ariaRoleDescription:sr,description:ar};function hr(e,t){const n=!1===t.aria;if(e(ir,n||void 0),n||null==t.description)for(const t in pr)e(pr[t],void 0);else{const n=t.mark.marktype;e(ar,t.description),e(or,t.ariaRole||("group"===n?lr:ur)),e(sr,t.ariaRoleDescription||`${n} mark`)}}function gr(e){return!1===e.aria?{[ir]:!0}:dr[e.role]?null:fr[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return cr(t.role||ur,t.desc,n.description||r(n))}catch(e){return null}}(e,fr[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return cr(n?lr:ur,`${t} mark container`,e.description)}(e)}function mr(e){return(0,r.array)(e.text).join(" ")}function yr(e){try{return(0,r.array)((0,r.peek)(e.items).items[0].text).join(" ")}catch(e){return null}}const vr=e=>(e+"").replace(/&/g,"&").replace(//g,">"),br=e=>vr(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g,"
").replace(/\r/g,"
");function wr(){let e="",t="",n="";const r=[],i=()=>t=n="",a=(e,n)=>(null!=n&&(t+=` ${e}="${br(n)}"`),o),o={open(s){(a=>{t&&(e+=`${t}>${n}`,i()),r.push(a)})(s),t="<"+s;for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c${n}${a}>`:"/>"):`${a}>`,i(),o},attr:a,text:e=>(n+=vr(e),o),toString:()=>e};return o}const xr=e=>Er(wr(),e)+"";function Er(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t{e.dirty=t}))),r.zdirty||(n.exit?(a.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(a,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=a.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(a,n._svg,n):(this._dirtyAll=!1,Rr(n,t)),n._update=t)));return!this._dirtyAll}mark(e,t,n,r){if(!this.isDirty(t))return t._svg;const i=this._svg,a=t.marktype,o=un[a],s=!1===t.interactive?"none":null,l="g"===o.tag,u=Nr(t,e,n,"g",i);if("group"!==a&&null!=r&&!r.includes(a))return En(u,0),t._svg;u.setAttribute("class",Sn(t));const c=gr(t);for(const e in c)Br(u,e,c[e]);l||Br(u,"pointer-events",s),Br(u,"clip-path",t.clip?ue(this,t,t.group):null);let d=null,f=0;const p=e=>{const t=this.isDirty(e),n=Nr(e,u,d,o.tag,i);t&&(this._update(o,n,e),l&&function(e,t,n,r){t=t.lastChild.previousSibling;let i,a=0;nt(n,(n=>{i=e.mark(t,n,i,r),++a})),En(t,1+a)}(this,n,e,r)),d=n,++f};return o.nested?t.items.length&&p(t.items[0]):nt(t,p),En(u,f),u}_update(e,t,n){Fr=t,Pr=t.__values__,hr(Ir,n),e.attr(Ir,n,this);const r=Mr[e.type];r&&r.call(this,e,t,n),Fr&&this.style(Fr,n)}style(e,t){if(null!=t){for(const n in Sr){let r="font"===n?Zt(t):t[n];if(r===Pr[n])continue;const i=Sr[n];null==r?e.removeAttribute(i):(d(r)&&(r=f(r,this._defs.gradient,Ur())),e.setAttribute(i,r+"")),Pr[n]=r}for(const n in _r)$r(e,_r[n],t[n])}}defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=xn(e,1,"defs",Tr)),r=Dr(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=xn(e,1,"defs",Tr)),r=Or(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):En(n,r))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function Rr(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function Dr(e,t,n){let r,i,a;if("radial"===t.gradient){let r=xn(e,n++,"pattern",Tr);Lr(r,{id:c+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=xn(r,0,"rect",Tr),Lr(r,{width:1,height:1,fill:`url(${Ur()}#${t.id})`}),Lr(e=xn(e,n++,"radialGradient",Tr),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else Lr(e=xn(e,n++,"linearGradient",Tr),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r1&&e.previousSibling!=t}(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}let Fr=null,Pr=null;const Mr={group(e,t,n){const r=Fr=t.childNodes[2];Pr=r.__values__,e.foreground(Ir,n,this),Pr=t.__values__,Fr=t.childNodes[1],e.content(Ir,n,this);const i=Fr=t.childNodes[0];e.background(Ir,n,this);const a=!1===n.mark.interactive?"none":null;if(a!==Pr.events&&(Br(r,"pointer-events",a),Br(i,"pointer-events",a),Pr.events=a),n.strokeForeground&&n.stroke){const e=n.fill;Br(r,"display",null),this.style(i,n),Br(i,"stroke",null),e&&(n.fill=null),Pr=r.__values__,this.style(r,n),e&&(n.fill=e),Fr=null}else Br(r,"display","none")},image(e,t,n){!1===n.smooth?($r(t,"image-rendering","optimizeSpeed"),$r(t,"image-rendering","pixelated")):$r(t,"image-rendering",null)},text(e,t,n){const i=Kt(n);let a,o,s,l;(0,r.isArray)(i)?(o=i.map((e=>Qt(n,e))),a=o.join("\n"),a!==Pr.text&&(En(t,0),s=t.ownerDocument,l=Xt(n),o.forEach(((e,r)=>{const i=bn(s,"tspan",Tr);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",l)),t.appendChild(i)})),Pr.text=a)):(o=Qt(n,i),o!==Pr.text&&(t.textContent=o,Pr.text=o)),Br(t,"font-family",Zt(n)),Br(t,"font-size",Yt(n)+"px"),Br(t,"font-style",n.fontStyle),Br(t,"font-variant",n.fontVariant),Br(t,"font-weight",n.fontWeight)}};function Ir(e,t,n){t!==Pr[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(Fr,e,t,n):Br(Fr,e,t),Pr[e]=t)}function $r(e,t,n){n!==Pr[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),Pr[t]=n)}function Lr(e,t){for(const n in t)Br(e,n,t[n])}function Br(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function Ur(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class zr extends Tn{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const t=wr();t.open("svg",(0,r.extend)({},At,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",Ar,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this}mark(e,t){const n=un[t.marktype],i=n.tag,a=[hr,n.attr];e.open("g",{class:Sn(t),"clip-path":t.clip?ue(this,t,t.group):null},gr(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null});const o=o=>{const s=this.href(o);if(s&&e.open("a",s),e.open(i,this.attr(t,o,a,"g"!==i?i:null)),"text"===i){const t=Kt(o);if((0,r.isArray)(t)){const n={x:0,dy:Xt(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),s&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):nt(t,o),e.close()}href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null}attr(e,t,n,r){const i={},a=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(a,t,this))):n(a,t,this),r&&function(e,t,n,r,i){let a;if(null==t)return e;if("bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(a=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(e["font-family"]=Zt(t),e["font-size"]=Yt(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in Sr){let r=t[n];const a=Sr[n];("transparent"!==r||"fill"!==a&&"stroke"!==a)&&null!=r&&(d(r)&&(r=f(r,i.gradient,"")),e[a]=r)}for(const e in _r){const n=t[e];null!=n&&(a=a||[],a.push(`${_r[e]}: ${n};`))}a&&(e.style=a.join(" "))}(i,t,e,r,this._defs),i}defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:c+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!qr.svgMarkTypes.includes(e)));this._svgRenderer.render(e,qr.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,r){return super.resize(e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this}background(e){return qr.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class Gr extends Yn{constructor(e,t){super(e,t)}initialize(e,t,n){const r=xn(xn(e,0,"div"),qr.svgOnTop?0:1,"div");return super.initialize(r,t,n)}}const Vr="canvas",Wr="hybrid",Yr="none",Xr={Canvas:Vr,PNG:"png",SVG:"svg",Hybrid:Wr,None:Yr},Kr={};function Jr(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Kr[e]=t,this):Kr[e]}function Qr(e,t,n){const i=[],a=(new ce).union(t),o=e.marktype;return o?Zr(e,a,n,i):"group"===o?ei(e,a,n,i):(0,r.error)("Intersect scene must be mark node or group item.")}function Zr(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,a=e.marktype,o=i.length;let s=0;if("group"===a)for(;s=0;r--)if(i[r]!=a[r])return!1;for(r=i.length-1;r>=0;r--)if(!ai(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function oi(e,t){return ai(E(e),E(t))}function si(){le(),u=0}},73706:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}},76187:(e,t,n)=>{"use strict";n.r(t),n.d(t,{selectionIdTest:()=>T,selectionResolve:()=>R,selectionTest:()=>S,selectionTuples:()=>k,selectionVisitor:()=>F});var r=n(61388),i=n(26372),a=n(21720);const o=Symbol("vega_selection_getter");function s(e){return e.getter&&e.getter[o]||(e.getter=(0,i.field)(e.field),e.getter[o]=!0),e.getter}const l="intersect",u="union",c="vlMulti",d="vlPoint",f="or",p="and",h="_vgsid_",g=(0,i.field)(h),m="E",y="R",v="R-E",b="R-LE",w="R-RE",x="index:unit";function E(e,t){for(var n,r,a=t.fields,o=t.values,l=a.length,u=0;u(0,i.extend)(t.fields?{values:t.fields.map((t=>s(t)(e.datum)))}:{[h]:g(e.datum)},t)))}function R(e,t,n,r){for(var a,o,s,l,m,y,v,b,w,x,E,S,_=this.context.data[e],A=_?_.values.value:[],C={},T={},k={},R=A.length,O=0;O(e[o[n].field]=t,e)),{}))}else m=h,y=g(a),(b=(v=C[m]||(C[m]={}))[l]||(v[l]=[])).push(y),n&&(b=T[l]||(T[l]=[])).push({[h]:y});return t=t||u,C[h]?C[h]=D[`${h}_${t}`](...Object.values(C[h])):Object.keys(C).forEach((e=>{C[e]=Object.keys(C[e]).map((t=>C[e][t])).reduce(((n,r)=>void 0===n?r:D[`${k[e]}_${t}`](n,r)))})),A=Object.keys(T),n&&A.length&&(C[r?d:c]=t===u?{[f]:A.reduce(((e,t)=>(e.push(...T[t]),e)),[])}:{[p]:A.map((e=>({[f]:T[e]})))}),C}var D={[`${h}_union`]:r.union,[`${h}_intersect`]:r.intersection,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;nt.indexOf(e)>=0)):t},R_union:function(e,t){var n=(0,i.toNumber)(t[0]),r=(0,i.toNumber)(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};const O=":",N="@";function F(e,t,n,r){t[0].type!==a.Literal&&(0,i.error)("First argument to selection functions must be a string literal.");const o=t[0].value,s=t.length>=2&&(0,i.peek)(t).value,u="unit",c=N+u,d=O+o;s!==l||(0,i.hasOwnProperty)(r,c)||(r[c]=n.getData(o).indataRef(n,u)),(0,i.hasOwnProperty)(r,d)||(r[d]=n.getData(o).tuplesRef())}},48872:(e,t,n)=>{"use strict";n.r(t),n.d(t,{bandwidthNRD:()=>s,bin:()=>l,bootstrapCI:()=>d,cumulativeLogNormal:()=>C,cumulativeNormal:()=>w,cumulativeUniform:()=>N,densityLogNormal:()=>A,densityNormal:()=>b,densityUniform:()=>O,dotbin:()=>f,quantileLogNormal:()=>T,quantileNormal:()=>x,quantileUniform:()=>F,quantiles:()=>a,quartiles:()=>o,random:()=>u,randomInteger:()=>h,randomKDE:()=>S,randomLCG:()=>p,randomLogNormal:()=>k,randomMixture:()=>R,randomNormal:()=>E,randomUniform:()=>P,regressionConstant:()=>M,regressionExp:()=>q,regressionLinear:()=>U,regressionLoess:()=>X,regressionLog:()=>z,regressionPoly:()=>G,regressionPow:()=>j,regressionQuad:()=>H,sampleCurve:()=>Z,sampleLogNormal:()=>_,sampleNormal:()=>v,sampleUniform:()=>D,setRandom:()=>c});var r=n(61388);function*i(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function a(e,t,n){const a=Float64Array.from(i(e,n));return a.sort(r.ascending),t.map((e=>(0,r.quantileSorted)(a,e)))}function o(e,t){return a(e,[.25,.5,.75],t)}function s(e,t){const n=e.length,i=(0,r.deviation)(e,t),a=o(e,t),s=(a[2]-a[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(a[0])||1)*Math.pow(n,-.2)}function l(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let a,o,s,l,u,c,d=e.extent[0],f=e.extent[1];const p=e.span||f-d||Math.abs(d)||1;if(e.step)a=e.step;else if(e.steps){for(l=p/t,u=0,c=e.steps.length;ut;)a*=n;for(u=0,c=i.length;u=s&&p/l<=t&&(a=l)}l=Math.log(a);const h=l>=0?0:1+~~(-l/r),g=Math.pow(n,-h-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(d/a+g)*a,d=de);const i=e.length,a=new Float64Array(i);let o,s=0,l=1,u=r(e[0]),c=u,d=u+t;for(;l=d){for(c=(u+c)/2;s>1);io;)e[i--]=e[a]}a=o,o=r}return e}(a,t+t/4):a}function p(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function h(e,t){let n,r,i;null==t&&(t=e,e=0);const a={min(e){return arguments.length?(n=e||0,i=r-n,a):n},max(e){return arguments.length?(r=e||0,i=r-n,a):r},sample:()=>n+Math.floor(i*u()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return a.min(e).max(t)}const g=Math.sqrt(2*Math.PI),m=Math.SQRT2;let y=NaN;function v(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,a=0;if(y==y)i=y,y=NaN;else{do{i=2*u()-1,a=2*u()-1,n=i*i+a*a}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,y=a*r}return e+i*t}function b(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*g)}function w(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let a;if(i>37)a=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,a=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,a/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,a=e/t/2.506628274631)}return r>0?1-a:a}function x(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*m*function(e){let t,n=-Math.log((1-e)*(1+e));return n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0,t*e}(2*e-1)}function E(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>v(n,r),pdf:e=>b(e,n,r),cdf:e=>w(e,n,r),icdf:e=>x(e,n,r)};return i.mean(e).stdev(t)}function S(e,t){const n=E();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=s(e)),i):t},sample:()=>e[~~(u()*r)]+t*n.sample(),pdf(i){let a=0,o=0;for(;o_(n,r),pdf:e=>A(e,n,r),cdf:e=>C(e,n,r),icdf:e=>T(e,n,r)};return i.mean(e).stdev(t)}function R(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n