streamlit-nightly 1.53.2.dev20260125__py3-none-any.whl → 1.53.2.dev20260128__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/commands/logo.py +81 -25
- streamlit/config.py +11 -0
- streamlit/deprecation_util.py +19 -1
- streamlit/elements/arrow.py +2 -1
- streamlit/elements/lib/built_in_chart_utils.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +72 -22
- streamlit/elements/widgets/select_slider.py +123 -37
- streamlit/hello/plotting_demo.py +19 -12
- streamlit/proto/Logo_pb2.py +5 -3
- streamlit/proto/Logo_pb2.pyi +25 -1
- streamlit/proto/NewSession_pb2.py +24 -22
- streamlit/proto/NewSession_pb2.pyi +23 -1
- streamlit/proto/Slider_pb2.py +6 -6
- streamlit/proto/Slider_pb2.pyi +9 -1
- streamlit/runtime/app_session.py +19 -0
- streamlit/runtime/scriptrunner/script_runner.py +17 -0
- streamlit/runtime/scriptrunner_utils/script_run_context.py +13 -10
- streamlit/runtime/state/__init__.py +7 -1
- streamlit/runtime/state/common.py +13 -0
- streamlit/runtime/state/query_params.py +494 -6
- streamlit/runtime/state/session_state.py +178 -3
- streamlit/runtime/state/widgets.py +26 -1
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +299 -299
- streamlit/static/static/js/{ErrorOutline.esm.CIFYUdwC.js → ErrorOutline.esm.D71F8ziR.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.DWVTnTHm.js → FileDownload.esm.yTkppsJy.js} +1 -1
- streamlit/static/static/js/{FileHelper.BPYQIPd1.js → FileHelper.hUOqtbwa.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CypmvhYZ.js → FormClearHelper.DN8D_YXO.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Bi62hDTQ.js → InputInstructions.DbssY6d4.js} +1 -1
- streamlit/static/static/js/{Particles.yebG0VuV.js → Particles.BznyVdfo.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Dy9CI6w4.js → ProgressBar.C5uBOtcx.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.Btk92CPv.js → StreamlitSyntaxHighlighter.Nf1895x-.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.DBeVaFNt.js → TableChart.esm.DHKzVs3a.js} +1 -1
- streamlit/static/static/js/{Toolbar.DC2Tp-qb.js → Toolbar.CQsWYXer.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.3DnEd9BK.js → WidgetLabelHelpIconInline.6xCU76OE.js} +1 -1
- streamlit/static/static/js/{base-input.7Sj6pVk0.js → base-input.Cs-E6S71.js} +1 -1
- streamlit/static/static/js/{checkbox.CcUx3XuQ.js → checkbox.OTGupu18.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.DZuwkCqy.js → createDownloadLinkElement.DnBEQQbK.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Dw-AewlN.js → data-grid-overlay-editor.COiiMi5r.js} +1 -1
- streamlit/static/static/js/{downloader.Bsx5M2Du.js → downloader.K0GUNeuj.js} +1 -1
- streamlit/static/static/js/embed.o8HvK3mH.js +193 -0
- streamlit/static/static/js/{es6.BpAqZaR_.js → es6.BHy5pqTP.js} +2 -2
- streamlit/static/static/js/{formatNumber.DjehVPVS.js → formatNumber.BK7h0k2z.js} +1 -1
- streamlit/static/static/js/{iconPosition.D02OPE-d.js → iconPosition.2YynQUxu.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.xtstqPd7.js → iframeResizer.contentWindow.D5h3hQuU.js} +1 -1
- streamlit/static/static/js/{index.5H98WqjT.js → index.5zqfJ-in.js} +1 -1
- streamlit/static/static/js/{index.B5tD5YeV.js → index.6c-qDsD7.js} +1 -1
- streamlit/static/static/js/{index.CA0RmxJF.js → index.8MlRyIxN.js} +1 -1
- streamlit/static/static/js/{index.DSSapl3Q.js → index.BIqcOZ_u.js} +1 -1
- streamlit/static/static/js/{index.DJjSqPAx.js → index.BPdmXoYW.js} +1 -1
- streamlit/static/static/js/{index.iXzAofuY.js → index.BZ-GJVxB.js} +2 -2
- streamlit/static/static/js/{index.CKUBdVQ9.js → index.BfMPq234.js} +1 -1
- streamlit/static/static/js/{index.B8-HOwf1.js → index.Bfo1cXfC.js} +1 -1
- streamlit/static/static/js/{index.-faJDV20.js → index.Bgf49D1Z.js} +1 -1
- streamlit/static/static/js/{index.CgARjn28.js → index.Bqmx23jK.js} +1 -1
- streamlit/static/static/js/{index.D6Z9hKJY.js → index.BtRWcqZV.js} +1 -1
- streamlit/static/static/js/{index.ZIA43eTF.js → index.BtuskCwg.js} +1 -1
- streamlit/static/static/js/{index.BV6XgCij.js → index.BzTVI_BY.js} +1 -1
- streamlit/static/static/js/{index.DDu_qTm0.js → index.C2EoeVjP.js} +1 -1
- streamlit/static/static/js/{index.8FPw0_gD.js → index.C65jHNhe.js} +1 -1
- streamlit/static/static/js/{index.D6J2UPzF.js → index.C6wyTXhz.js} +1 -1
- streamlit/static/static/js/{index.CGbvkEtg.js → index.C7wst9Tm.js} +1 -1
- streamlit/static/static/js/{index.BIcJe97b.js → index.COh5V_89.js} +1 -1
- streamlit/static/static/js/index.CSPY26T2.js +1 -0
- streamlit/static/static/js/{index.CEwnDCn9.js → index.CUkhn-vu.js} +1 -1
- streamlit/static/static/js/{index.DO2T-QzF.js → index.CX0KdFyR.js} +1 -1
- streamlit/static/static/js/{index.BDlI2pRp.js → index.CYhhEdja.js} +1 -1
- streamlit/static/static/js/{index.DgLRJfs3.js → index.CZf7Go1Z.js} +1 -1
- streamlit/static/static/js/{index.DZv5AoR1.js → index.Cb03y5I8.js} +1 -1
- streamlit/static/static/js/{index.BVhVdVeE.js → index.CdsyTabv.js} +1 -1
- streamlit/static/static/js/{index.JL0uGAeJ.js → index.CgVv04GM.js} +1 -1
- streamlit/static/static/js/index.CjRU8O1O.js +2 -0
- streamlit/static/static/js/{index.BqfJJr3c.js → index.CwtpGPHA.js} +1 -1
- streamlit/static/static/js/{index.iF5zYERg.js → index.CxWzt6oi.js} +1 -1
- streamlit/static/static/js/{index.m3dn5Bai.js → index.DBPWUJsj.js} +5 -5
- streamlit/static/static/js/{index.D9RL5sRp.js → index.DJfMW0Gy.js} +1 -1
- streamlit/static/static/js/{index.BOkpEbJS.js → index.DLUSo6de.js} +1 -1
- streamlit/static/static/js/{index.S-mjkUeF.js → index.DL_yE83J.js} +1 -1
- streamlit/static/static/js/{index.BK9S5qug.js → index.DVRCyxMp.js} +1 -1
- streamlit/static/static/js/{index.D_TIyPF4.js → index.Dc5-tFdw.js} +1 -1
- streamlit/static/static/js/index.DcngUOyD.js +2 -0
- streamlit/static/static/js/{index.B9gbSNsw.js → index.Dh3PJIlq.js} +1 -1
- streamlit/static/static/js/{index.BvZbnSMC.js → index.DlgcEr0f.js} +1 -1
- streamlit/static/static/js/{index.Bo1ztye0.js → index.DxGXuhh6.js} +1 -1
- streamlit/static/static/js/{index.x1B588Xu.js → index.DxfYCrPp.js} +1 -1
- streamlit/static/static/js/{index.CyDHwK5P.js → index.HmRK3HyC.js} +1 -1
- streamlit/static/static/js/{index.DdxofXV8.js → index.TjMWsKSH.js} +3 -3
- streamlit/static/static/js/{index.Bri1T2TS.js → index.VwDKazgt.js} +1 -1
- streamlit/static/static/js/{index.BB_iwaVr.js → index.aCorc3Yt.js} +34 -34
- streamlit/static/static/js/{index.CdRwiHPm.js → index.cfuZ69LI.js} +1 -1
- streamlit/static/static/js/{index.C9v49R-a.js → index.hlAfdSqC.js} +1 -1
- streamlit/static/static/js/{index.BGTMh3Uu.js → index.iUV9rb8C.js} +1 -1
- streamlit/static/static/js/{index.XFMDBL5n.js → index.q0ceUXt6.js} +1 -1
- streamlit/static/static/js/{input.VYKyGuhi.js → input.CXGIJ7D6.js} +1 -1
- streamlit/static/static/js/{main.u5Bb3MY7.js → main.CCVkbuxC.js} +1 -1
- streamlit/static/static/js/{memory.BOMt4yAV.js → memory.CNbnYs2A.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CihlAHgl.js → number-overlay-editor.CvI6wkld.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BuqSgXpk.js → pandasStylerUtils.CFSReOTm.js} +1 -1
- streamlit/static/static/js/{sandbox.COGR4pqz.js → sandbox.Bld0L3us.js} +1 -1
- streamlit/static/static/js/{styled-components.BEf3c4IJ.js → styled-components.BoUHK6TA.js} +1 -1
- streamlit/static/static/js/{throttle.Bl-XsA9N.js → throttle.ByDFm7WV.js} +1 -1
- streamlit/static/static/js/{timepicker.B-HgBYlK.js → timepicker.CN6CUZEL.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BrQebwtE.js → toConsumableArray.DwMycSpg.js} +1 -1
- streamlit/static/static/js/uniqueId.DcCWa2cf.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.8WwISl9r.js → useBasicWidgetState.Bg0ZMUt5.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.D37LWdCR.js → useIntlLocale.DgBUDcPA.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Bb_KqJvq.js → useTextInputAutoExpand.DDBezxks.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.D1BLS5t7.js → useUpdateUiValue.Df1h6fXC.js} +1 -1
- streamlit/static/static/js/{useWaveformController.Ce0-qTws.js → useWaveformController.DbWw5MEk.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.BX2K3UVv.js → withCalculatedWidth.YaK0HIIP.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CqfGs8T2.js → withFullScreenWrapper.CcWCKoY8.js} +1 -1
- streamlit/testing/v1/element_tree.py +23 -8
- streamlit/web/bootstrap.py +5 -2
- streamlit/web/server/server_util.py +22 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/RECORD +120 -120
- streamlit/static/static/js/embed.C7by6AoE.js +0 -195
- streamlit/static/static/js/index.Bhy8EBYI.js +0 -2
- streamlit/static/static/js/index.C5ehUqNt.js +0 -2
- streamlit/static/static/js/index.m4WkwGMu.js +0 -1
- streamlit/static/static/js/uniqueId.8R4hbkYl.js +0 -1
- {streamlit_nightly-1.53.2.dev20260125.data → streamlit_nightly-1.53.2.dev20260128.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/top_level.txt +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import{a$ as M8,z as O8,aa as tt,bJ as Ua,bI as fh,c$ as R8,bE as N8}from"./index.BB_iwaVr.js";import{a as Tc,n as L8,b as P8,c as zp,t as ea,p as I8,d as B8,e as z8,i as ls,f as Up,g as _w,l as Qu,h as tx,j as jp,k as $w,m as Ro,o as xu,q as U8,r as cs,s as j8,u as q8,v as W8,w as H8}from"./threshold.CUNQbqMA.js";import{j as G8,f as G1,c as tk,b as Y8,R as qp,r as nk,k as nx,l as ix,C as rx,m as Fw,n as kw,o as Wp,p as Y1,q as Zt,a as lf,s as V8,t as X8,u as K8,v as J8,i as Q8,w as Z8,x as e9,d as t9,y as n9,z as i9,g as r9,A as dh}from"./value.DaKxGC7O.js";import{P as o9,a as s9,i as a9,b as u9,p as ox,T as l9,n as c9,t as f9,d as d9}from"./timer.BZio6gjG.js";const Khe=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:M8(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:e.shadows.tooltip,maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),Jhe=O8("div",{target:"e1ksfrck0"})(({theme:e,useContainerWidth:t,useContainerHeight:n})=>({width:t?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,zIndex:e.zIndices.popup,top:`calc(${e.iconSizes.md} + 2 * ${e.spacing.xs} + ${e.spacing.xs})`,right:0,backgroundColor:e.colors.bgColor,boxShadow:e.shadows.popover,border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:e.radii.default,a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:`${e.spacing.twoXS} ${e.spacing.twoXL}`,color:e.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:e.colors.darkenedBgMix15,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:e.spacing.xs,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.default,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix15},svg:{width:e.iconSizes.md,height:e.iconSizes.md}}}}));function Qhe(e,t){const n={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:tt(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:tt(t.fontSizes.md),titleColor:Ua(t),titleFontStyle:"normal",labelFontSize:tt(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Ua(t),labelFontStyle:"normal"},axis:{labelFontSize:tt(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Ua(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:tt(t.fontSizes.sm),titleColor:Ua(t),titleFontStyle:"normal",ticks:!1,gridColor:fh(t),domain:!1,domainWidth:1,domainColor:fh(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:tt(t.spacing.lg),labelPadding:tt(t.spacing.lg),labelSeparation:tt(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:tt(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:Ua(t),titleFontSize:tt(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:Ua(t),titlePadding:tt(t.spacing.twoXS),labelPadding:tt(t.spacing.lg),columnPadding:tt(t.spacing.sm),rowPadding:tt(t.spacing.twoXS),padding:tt(t.spacing.sm),symbolStrokeWidth:tt(t.spacing.twoXS)},range:{category:t.colors.chartCategoricalColors,diverging:t.colors.chartDivergingColors,ramp:t.colors.chartSequentialColors,heatmap:t.colors.chartSequentialColors},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:tt(t.sizes.defaultChartHeight),continuousWidth:tt(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:t.colors.chartCategoricalColors[0]},bar:{binSpacing:tt(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?R8({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function Zhe(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:tt(i.twoSm),titleFontSize:tt(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:fh(t),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:fh(t),continuousHeight:tt(t.sizes.defaultChartHeight),continuousWidth:tt(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?N8({},s,e):s}function Un(e,t,n){return e.fields=t||[],e.fname=n,e}function ut(e){return e==null?null:e.fname}function nn(e){return e==null?null:e.fields}function ik(e){return e.length===1?h9(e[0]):p9(e)}const h9=e=>function(t){return t[e]},p9=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function O(e){throw Error(e)}function Hp(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||O("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&O("Access path missing closing bracket: "+e),i&&O("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function pi(e,t,n){const i=Hp(e);return e=i.length===1?i[0]:e,Un((n&&n.get||ik)(i),[e],t||e)}const cf=pi("id"),An=Un(e=>e,[],"identity"),Oo=Un(()=>0,[],"zero"),Zu=Un(()=>1,[],"one"),gi=Un(()=>!0,[],"true"),So=Un(()=>!1,[],"false"),sx=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function g9(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const rk=0,ax=1,ok=2,sk=3,ak=4;function uk(e,t,n=g9){let i=e||rk;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=ax&&n(t||"error","ERROR",arguments),this},warn(){return i>=ok&&n(t||"warn","WARN",arguments),this},info(){return i>=sk&&n(t||"log","INFO",arguments),this},debug(){return i>=ak&&n(t||"log","DEBUG",arguments),this}}}var Z=Array.isArray;function ce(e){return e===Object(e)}const Dw=e=>e!=="__proto__";function Gp(...e){return e.reduce((t,n)=>{for(const i in n)if(i==="signals")t.signals=m9(t.signals,n.signals);else{const r=i==="legend"?{layout:1}:i==="style"?!0:null;Yp(t,i,n[i],r)}return t},{})}function Yp(e,t,n,i){if(!Dw(t))return;let r,o;if(ce(n)&&!Z(n)){o=ce(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Yp(o,r,n[r]):Dw(r)&&(o[r]=n[r])}else e[t]=n}function m9(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function Se(e){return e[e.length-1]}function en(e){return e==null||e===""?null:+e}const lk=e=>t=>e*Math.exp(t),ck=e=>t=>Math.log(e*t),fk=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),dk=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,hh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Vp(e,t,n,i){const r=n(e[0]),o=n(Se(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function hk(e,t){return Vp(e,t,en,An)}function pk(e,t){var n=Math.sign(e[0]);return Vp(e,t,ck(n),lk(n))}function gk(e,t,n){return Vp(e,t,hh(n),hh(1/n))}function mk(e,t,n){return Vp(e,t,fk(n),dk(n))}function Xp(e,t,n,i,r){const o=i(e[0]),s=i(Se(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function ux(e,t,n){return Xp(e,t,n,en,An)}function lx(e,t,n){const i=Math.sign(e[0]);return Xp(e,t,n,ck(i),lk(i))}function ph(e,t,n,i){return Xp(e,t,n,hh(i),hh(1/i))}function cx(e,t,n,i){return Xp(e,t,n,fk(i),dk(i))}function yk(e){return 1+~~(new Date(e).getMonth()/3)}function bk(e){return 1+~~(new Date(e).getUTCMonth()/3)}function re(e){return e!=null?Z(e)?e:[e]:[]}function xk(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ye(e){return typeof e=="function"}const y9="descending";function fx(e,t,n){n=n||{},t=re(t)||[];const i=[],r=[],o={},s=n.comparator||b9;return re(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===y9?-1:1),r.push(a=ye(a)?a:pi(a,null,n)),(nn(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:Un(s(r,i),Object.keys(o))}const el=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),b9=(e,t)=>e.length===1?x9(e[0],t[0]):v9(e,t,e.length),x9=(e,t)=>function(n,i){return el(e(n),e(i))*t},v9=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=el(o(i),o(r));return s*t[a]});function ln(e){return ye(e)?e:()=>e}function dx(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function me(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function mr(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function vk(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}function ue(e,t){return Object.hasOwn(e,t)}const id={};function tl(e){let t={},n;function i(o){return ue(t,o)&&t[o]!==id}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===id&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=id),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==id&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function Ek(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=Se(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function H(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),me(i,n)}function iu(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function hx(e){return typeof e=="boolean"}function Wo(e){return Object.prototype.toString.call(e)==="[object Date]"}function Ak(e){return e&&ye(e[Symbol.iterator])}function Ko(e){return typeof e=="number"}function px(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function _e(e){return typeof e=="string"}function gx(e,t,n){e&&(e=t?re(e).map(a=>a.replace(/\\(.)/g,"$1")):re(e));const i=e&&e.length,r=n&&n.get||ik,o=a=>r(t?[a]:Hp(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return Un(s,e,"key")}function wk(e,t){const n=e[0],i=Se(e),r=+t;return r?r===1?i:n+r*(i-n):n}const E9=1e4;function Ck(e){e=+e||E9;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>ue(t,s)||ue(n,s),get:s=>ue(t,s)?t[s]:ue(n,s)?o(s,n[s]):void 0,set:(s,a)=>ue(t,s)?t[s]=a:o(s,a)}}function Sk(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Vl(e,t){let n="";for(;--t>=0;)n+=e;return n}function _k(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Vl(r,s)+o:i==="center"?Vl(r,~~(s/2))+o+Vl(r,Math.ceil(s/2)):o+Vl(r,s)}function ff(e){return e&&Se(e)-e[0]||0}function ee(e){return Z(e)?`[${e.map(t=>t===null?"null":ee(t))}]`:ce(e)||_e(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function mx(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const A9=e=>Ko(e)||Wo(e)?e:Date.parse(e);function yx(e,t){return t=t||A9,e==null||e===""?null:t(e)}function bx(e){return e==null||e===""?null:e+""}function Pi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function $k(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function Fo(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var Tw={},Z0={},em=34,Cl=10,tm=13;function Fk(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function w9(e,t){var n=Fk(e);return function(i,r){return t(n(i),r,e)}}function Mw(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function Fn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function C9(e){return e<0?"-"+Fn(-e,6):e>9999?"+"+Fn(e,6):Fn(e,4)}function S9(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":C9(e.getUTCFullYear())+"-"+Fn(e.getUTCMonth()+1,2)+"-"+Fn(e.getUTCDate(),2)+(r?"T"+Fn(t,2)+":"+Fn(n,2)+":"+Fn(i,2)+"."+Fn(r,3)+"Z":i?"T"+Fn(t,2)+":"+Fn(n,2)+":"+Fn(i,2)+"Z":n||t?"T"+Fn(t,2)+":"+Fn(n,2)+"Z":"")}function _9(e){var t=new RegExp('["'+e+`
|
|
2
|
-
\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?w9(m,d):Fk(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,x=!1;f.charCodeAt(p-1)===Cl&&--p,f.charCodeAt(p-1)===tm&&--p;function v(){if(b)return Z0;if(x)return x=!1,Tw;var w,E=g,C;if(f.charCodeAt(E)===em){for(;g++<p&&f.charCodeAt(g)!==em||f.charCodeAt(++g)===em;);return(w=g)>=p?b=!0:(C=f.charCodeAt(g++))===Cl?x=!0:C===tm&&(x=!0,f.charCodeAt(g)===Cl&&++g),f.slice(E+1,w-1).replace(/""/g,'"')}for(;g<p;){if((C=f.charCodeAt(w=g++))===Cl)x=!0;else if(C===tm)x=!0,f.charCodeAt(g)===Cl&&++g;else if(C!==n)continue;return f.slice(E,w)}return b=!0,f.slice(E,p)}for(;(y=v())!==Z0;){for(var A=[];y!==Tw&&y!==Z0;)A.push(y),y=v();d&&(A=d(A,m++))==null||h.push(A)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function s(f,d){return d==null&&(d=Mw(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
|
|
3
|
-
`)}function a(f,d){return d==null&&(d=Mw(f)),o(f,d).join(`
|
|
4
|
-
`)}function u(f){return f.map(l).join(`
|
|
5
|
-
`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?S9(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function $9(e){return e}function F9(e){if(e==null)return $9;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+o,f[1]=(n+=a[1])*r+s;l<c;)f[l]=a[l],++l;return f}}function k9(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function D9(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Ow(e,n)})}:Ow(e,t)}function Ow(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=kk(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function kk(e,t){var n=F9(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&k9(f,p)}function o(c){return n(c)}function s(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=s(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=s(c.arcs);break;case"MultiLineString":d=c.arcs.map(s);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function T9(e,t){var n={},i={},r={},o=[],s=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function M9(e){return kk(e,O9.apply(this,arguments))}function O9(e,t,n){var i,r,o;if(arguments.length>1)i=R9(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:T9(e,i)}}function R9(e,t,n){var i=[],r=[],o;function s(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function N9(e,t){let n=0,i,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(i=s-r,r+=i/++n,o+=i*(s-r));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,o+=i*(a-r))}if(n>1)return o/(n-1)}function L9(e,t){const n=N9(e,t);return n&&Math.sqrt(n)}class vn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[i++]=a),t=s}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,o,s=0;if(n>0){for(s=t[--n];n>0&&(i=s,r=t[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class Rw extends Map{constructor(t,n=Mk){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(V1(this,t))}has(t){return super.has(V1(this,t))}set(t,n){return super.set(Dk(this,t),n)}delete(t){return super.delete(Tk(this,t))}}class gh extends Set{constructor(t,n=Mk){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(V1(this,t))}add(t){return super.add(Dk(this,t))}delete(t){return super.delete(Tk(this,t))}}function V1({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Dk({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function Tk({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function Mk(e){return e!==null&&typeof e=="object"?e.valueOf():e}function P9(e,t){return Array.from(t,n=>e[n])}function I9(e=Tc){if(e===Tc)return Ok;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function Ok(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Hs(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function X1(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Rk(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?Ok:I9(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));Rk(e,t,h,p,r)}const o=e[t];let s=n,a=i;for(Sl(e,n,t),r(e[i],o)>0&&Sl(e,n,i);s<a;){for(Sl(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Sl(e,n,a):(++a,Sl(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Sl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function K1(e,t,n){if(e=Float64Array.from(L8(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return X1(e);if(t>=1)return Hs(e);var i,r=(i-1)*t,o=Math.floor(r),s=Hs(Rk(e,o).subarray(0,o+1)),a=X1(e.subarray(o+1));return s+(a-s)*(r-o)}}function Nk(e,t,n=P8){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}}function B9(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function Lk(e,t){return K1(e,.5,t)}function*z9(e){for(const t of e)yield*t}function Pk(e){return Array.from(z9(e))}function Yn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++i<r;)o[i]=e+i*n;return o}function Ik(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function U9(e,...t){e=new gh(e),t=t.map(j9);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function j9(e){return e instanceof gh?e:new gh(e)}function q9(...e){const t=new gh;for(const n of e)for(const i of n)t.add(i);return t}const nm=new Date,im=new Date;function At(e,t,n,i){function r(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(e(o=new Date(+o)),o),r.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const u=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return u;let l;do u.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return u},r.filter=o=>At(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(r.count=(o,s)=>(nm.setTime(+o),im.setTime(+s),e(nm),e(im),Math.floor(n(nm,im))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const vu=At(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?At(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vu);vu.range;const Vr=1e3,ui=Vr*60,Xr=ui*60,ao=Xr*24,xx=ao*7,Nw=ao*30,rm=ao*365,Kr=At(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Vr)},(e,t)=>(t-e)/Vr,e=>e.getUTCSeconds());Kr.range;const Kp=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vr)},(e,t)=>{e.setTime(+e+t*ui)},(e,t)=>(t-e)/ui,e=>e.getMinutes());Kp.range;const Jp=At(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ui)},(e,t)=>(t-e)/ui,e=>e.getUTCMinutes());Jp.range;const Qp=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vr-e.getMinutes()*ui)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getHours());Qp.range;const Zp=At(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getUTCHours());Zp.range;const eo=At(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ui)/ao,e=>e.getDate()-1);eo.range;const Ho=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ao,e=>e.getUTCDate()-1);Ho.range;const Bk=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ao,e=>Math.floor(e/ao));Bk.range;function Aa(e){return At(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ui)/xx)}const nl=Aa(0),mh=Aa(1),W9=Aa(2),H9=Aa(3),Eu=Aa(4),G9=Aa(5),Y9=Aa(6);nl.range;mh.range;W9.range;H9.range;Eu.range;G9.range;Y9.range;function wa(e){return At(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/xx)}const il=wa(0),yh=wa(1),V9=wa(2),X9=wa(3),Au=wa(4),K9=wa(5),J9=wa(6);il.range;yh.range;V9.range;X9.range;Au.range;K9.range;J9.range;const Mc=At(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Mc.range;const Oc=At(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Oc.range;const yr=At(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());yr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});yr.range;const br=At(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());br.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});br.range;function zk(e,t,n,i,r,o){const s=[[Kr,1,Vr],[Kr,5,5*Vr],[Kr,15,15*Vr],[Kr,30,30*Vr],[o,1,ui],[o,5,5*ui],[o,15,15*ui],[o,30,30*ui],[r,1,Xr],[r,3,3*Xr],[r,6,6*Xr],[r,12,12*Xr],[i,1,ao],[i,2,2*ao],[n,1,xx],[t,1,Nw],[t,3,3*Nw],[e,1,rm]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){const d=Math.abs(c-l)/f,h=zp(([,,m])=>m).right(s,d);if(h===s.length)return e.every(ea(l/rm,c/rm,f));if(h===0)return vu.every(Math.max(ea(l,c,f),1));const[p,g]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(g)}return[a,u]}const[Q9,Z9]=zk(br,Oc,il,Bk,Zp,Jp),[eL,tL]=zk(yr,Mc,nl,eo,Qp,Kp),jt="year",Nn="quarter",rn="month",xt="week",Ln="date",Qt="day",xr="dayofyear",ei="hours",ti="minutes",mi="seconds",Ii="milliseconds",vx=[jt,Nn,rn,xt,Ln,Qt,xr,ei,ti,mi,Ii],om=vx.reduce((e,t,n)=>(e[t]=1+n,e),{});function Ex(e){const t=re(e).slice(),n={};return t.length||O("Missing time unit."),t.forEach(r=>{ue(om,r)?n[r]=1:O(`Invalid time unit: ${r}.`)}),(n[xt]||n[Qt]?1:0)+(n[Nn]||n[rn]||n[Ln]?1:0)+(n[xr]?1:0)>1&&O(`Incompatible time units: ${e}`),t.sort((r,o)=>om[r]-om[o]),t}const nL={[jt]:"%Y ",[Nn]:"Q%q ",[rn]:"%b ",[Ln]:"%d ",[xt]:"W%U ",[Qt]:"%a ",[xr]:"%j ",[ei]:"%H:00",[ti]:"00:%M",[mi]:":%S",[Ii]:".%L",[`${jt}-${rn}`]:"%Y-%m ",[`${jt}-${rn}-${Ln}`]:"%Y-%m-%d ",[`${ei}-${ti}`]:"%H:%M"};function Uk(e,t){const n=me({},nL,t),i=Ex(e),r=i.length;let o="",s=0,a,u;for(s=0;s<r;)for(a=i.length;a>s;--a)if(u=i.slice(s,a).join("-"),n[u]!=null){o+=n[u],s=a;break}return o.trim()}const Ps=new Date;function Ax(e){return Ps.setFullYear(e),Ps.setMonth(0),Ps.setDate(1),Ps.setHours(0,0,0,0),Ps}function jk(e){return Wk(new Date(e))}function qk(e){return J1(new Date(e))}function Wk(e){return eo.count(Ax(e.getFullYear())-1,e)}function J1(e){return nl.count(Ax(e.getFullYear())-1,e)}function Q1(e){return Ax(e).getDay()}function iL(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);return a.setFullYear(e),a}return new Date(e,t,n,i,r,o,s)}function Hk(e){return Yk(new Date(e))}function Gk(e){return Z1(new Date(e))}function Yk(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Ho.count(t-1,e)}function Z1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return il.count(t-1,e)}function ey(e){return Ps.setTime(Date.UTC(e,0,1)),Ps.getUTCDay()}function rL(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,o,s))}function Vk(e,t,n,i,r){const o=t||1,s=Se(e),a=(y,b,x)=>(x=x||y,oL(n[x],i[x],y===s&&o,b)),u=new Date,l=Pi(e),c=l[jt]?a(jt):ln(2012),f=l[rn]?a(rn):l[Nn]?a(Nn):Oo,d=l[xt]&&l[Qt]?a(Qt,1,xt+Qt):l[xt]?a(xt,1):l[Qt]?a(Qt,1):l[Ln]?a(Ln,1):l[xr]?a(xr,1):Zu,h=l[ei]?a(ei):Oo,p=l[ti]?a(ti):Oo,g=l[mi]?a(mi):Oo,m=l[Ii]?a(Ii):Oo;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function oL(e,t,n,i){const r=n<=1?e:i?(o,s)=>i+n*Math.floor((e(o,s)-i)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(r(o,s),s):r}function wu(e,t,n){return t+e*7-(n+6)%7}const sL={[jt]:e=>e.getFullYear(),[Nn]:e=>Math.floor(e.getMonth()/3),[rn]:e=>e.getMonth(),[Ln]:e=>e.getDate(),[ei]:e=>e.getHours(),[ti]:e=>e.getMinutes(),[mi]:e=>e.getSeconds(),[Ii]:e=>e.getMilliseconds(),[xr]:e=>Wk(e),[xt]:e=>J1(e),[xt+Qt]:(e,t)=>wu(J1(e),e.getDay(),Q1(t)),[Qt]:(e,t)=>wu(1,e.getDay(),Q1(t))},aL={[Nn]:e=>3*e,[xt]:(e,t)=>wu(e,0,Q1(t))};function Xk(e,t){return Vk(e,t||1,sL,aL,iL)}const uL={[jt]:e=>e.getUTCFullYear(),[Nn]:e=>Math.floor(e.getUTCMonth()/3),[rn]:e=>e.getUTCMonth(),[Ln]:e=>e.getUTCDate(),[ei]:e=>e.getUTCHours(),[ti]:e=>e.getUTCMinutes(),[mi]:e=>e.getUTCSeconds(),[Ii]:e=>e.getUTCMilliseconds(),[xr]:e=>Yk(e),[xt]:e=>Z1(e),[Qt]:(e,t)=>wu(1,e.getUTCDay(),ey(t)),[xt+Qt]:(e,t)=>wu(Z1(e),e.getUTCDay(),ey(t))},lL={[Nn]:e=>3*e,[xt]:(e,t)=>wu(e,0,ey(t))};function Kk(e,t){return Vk(e,t||1,uL,lL,rL)}const cL={[jt]:yr,[Nn]:Mc.every(3),[rn]:Mc,[xt]:nl,[Ln]:eo,[Qt]:eo,[xr]:eo,[ei]:Qp,[ti]:Kp,[mi]:Kr,[Ii]:vu},fL={[jt]:br,[Nn]:Oc.every(3),[rn]:Oc,[xt]:il,[Ln]:Ho,[Qt]:Ho,[xr]:Ho,[ei]:Zp,[ti]:Jp,[mi]:Kr,[Ii]:vu};function rl(e){return cL[e]}function ol(e){return fL[e]}function Jk(e,t,n){return e?e.offset(t,n):void 0}function Qk(e,t,n){return Jk(rl(e),t,n)}function Zk(e,t,n){return Jk(ol(e),t,n)}function eD(e,t,n,i){return e?e.range(t,n,i):void 0}function tD(e,t,n,i){return eD(rl(e),t,n,i)}function nD(e,t,n,i){return eD(ol(e),t,n,i)}const Xl=1e3,Kl=Xl*60,Jl=Kl*60,eg=Jl*24,dL=eg*7,Lw=eg*30,ty=eg*365,iD=[jt,rn,Ln,ei,ti,mi,Ii],Ql=iD.slice(0,-1),Zl=Ql.slice(0,-1),ec=Zl.slice(0,-1),hL=ec.slice(0,-1),pL=[jt,xt],Pw=[jt,rn],rD=[jt],_l=[[Ql,1,Xl],[Ql,5,5*Xl],[Ql,15,15*Xl],[Ql,30,30*Xl],[Zl,1,Kl],[Zl,5,5*Kl],[Zl,15,15*Kl],[Zl,30,30*Kl],[ec,1,Jl],[ec,3,3*Jl],[ec,6,6*Jl],[ec,12,12*Jl],[hL,1,eg],[pL,1,dL],[Pw,1,Lw],[Pw,3,3*Lw],[rD,1,ty]];function oD(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(ff(t))/n;let r=zp(a=>a[2]).right(_l,i),o,s;return r===_l.length?(o=rD,s=ea(t[0]/ty,t[1]/ty,n)):r?(r=_l[i/_l[r-1][2]<_l[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=iD,s=Math.max(ea(t[0],t[1],n),1)),{units:o,step:s}}function sm(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function am(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function $l(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sD(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,u=e.shortMonths,l=Fl(r),c=kl(r),f=Fl(o),d=kl(o),h=Fl(s),p=kl(s),g=Fl(a),m=kl(a),y=Fl(u),b=kl(u),x={a:P,A:B,b:I,B:Y,c:null,d:qw,e:qw,f:PL,g:YL,G:XL,H:RL,I:NL,j:LL,L:aD,m:IL,M:BL,p:le,q:oe,Q:Gw,s:Yw,S:zL,u:UL,U:jL,V:qL,w:WL,W:HL,x:null,X:null,y:GL,Y:VL,Z:KL,"%":Hw},v={a:pe,A:We,b:ge,B:Ht,c:null,d:Ww,e:Ww,f:e7,g:c7,G:d7,H:JL,I:QL,j:ZL,L:lD,m:t7,M:n7,p:ws,q:wo,Q:Gw,s:Yw,S:i7,u:r7,U:o7,V:s7,w:a7,W:u7,x:null,X:null,y:l7,Y:f7,Z:h7,"%":Hw},A={a:$,A:k,b:L,B:T,c:F,d:Uw,e:Uw,f:DL,g:zw,G:Bw,H:jw,I:jw,j:_L,L:kL,m:SL,M:$L,p:S,q:CL,Q:ML,s:OL,S:FL,u:xL,U:vL,V:EL,w:bL,W:AL,x:_,X:D,y:zw,Y:Bw,Z:wL,"%":TL};x.x=w(n,x),x.X=w(i,x),x.c=w(t,x),v.x=w(n,v),v.X=w(i,v),v.c=w(t,v);function w(V,be){return function(ve){var W=[],Rt=-1,Ie=0,Ct=V.length,Gt,Pr,Sw;for(ve instanceof Date||(ve=new Date(+ve));++Rt<Ct;)V.charCodeAt(Rt)===37&&(W.push(V.slice(Ie,Rt)),(Pr=Iw[Gt=V.charAt(++Rt)])!=null?Gt=V.charAt(++Rt):Pr=Gt==="e"?" ":"0",(Sw=be[Gt])&&(Gt=Sw(ve,Pr)),W.push(Gt),Ie=Rt+1);return W.push(V.slice(Ie,Rt)),W.join("")}}function E(V,be){return function(ve){var W=$l(1900,void 0,1),Rt=C(W,V,ve+="",0),Ie,Ct;if(Rt!=ve.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(be&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Ie=am($l(W.y,0,1)),Ct=Ie.getUTCDay(),Ie=Ct>4||Ct===0?yh.ceil(Ie):yh(Ie),Ie=Ho.offset(Ie,(W.V-1)*7),W.y=Ie.getUTCFullYear(),W.m=Ie.getUTCMonth(),W.d=Ie.getUTCDate()+(W.w+6)%7):(Ie=sm($l(W.y,0,1)),Ct=Ie.getDay(),Ie=Ct>4||Ct===0?mh.ceil(Ie):mh(Ie),Ie=eo.offset(Ie,(W.V-1)*7),W.y=Ie.getFullYear(),W.m=Ie.getMonth(),W.d=Ie.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Ct="Z"in W?am($l(W.y,0,1)).getUTCDay():sm($l(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Ct+5)%7:W.w+W.U*7-(Ct+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,am(W)):sm(W)}}function C(V,be,ve,W){for(var Rt=0,Ie=be.length,Ct=ve.length,Gt,Pr;Rt<Ie;){if(W>=Ct)return-1;if(Gt=be.charCodeAt(Rt++),Gt===37){if(Gt=be.charAt(Rt++),Pr=A[Gt in Iw?be.charAt(Rt++):Gt],!Pr||(W=Pr(V,ve,W))<0)return-1}else if(Gt!=ve.charCodeAt(W++))return-1}return W}function S(V,be,ve){var W=l.exec(be.slice(ve));return W?(V.p=c.get(W[0].toLowerCase()),ve+W[0].length):-1}function $(V,be,ve){var W=h.exec(be.slice(ve));return W?(V.w=p.get(W[0].toLowerCase()),ve+W[0].length):-1}function k(V,be,ve){var W=f.exec(be.slice(ve));return W?(V.w=d.get(W[0].toLowerCase()),ve+W[0].length):-1}function L(V,be,ve){var W=y.exec(be.slice(ve));return W?(V.m=b.get(W[0].toLowerCase()),ve+W[0].length):-1}function T(V,be,ve){var W=g.exec(be.slice(ve));return W?(V.m=m.get(W[0].toLowerCase()),ve+W[0].length):-1}function F(V,be,ve){return C(V,t,be,ve)}function _(V,be,ve){return C(V,n,be,ve)}function D(V,be,ve){return C(V,i,be,ve)}function P(V){return s[V.getDay()]}function B(V){return o[V.getDay()]}function I(V){return u[V.getMonth()]}function Y(V){return a[V.getMonth()]}function le(V){return r[+(V.getHours()>=12)]}function oe(V){return 1+~~(V.getMonth()/3)}function pe(V){return s[V.getUTCDay()]}function We(V){return o[V.getUTCDay()]}function ge(V){return u[V.getUTCMonth()]}function Ht(V){return a[V.getUTCMonth()]}function ws(V){return r[+(V.getUTCHours()>=12)]}function wo(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var be=w(V+="",x);return be.toString=function(){return V},be},parse:function(V){var be=E(V+="",!1);return be.toString=function(){return V},be},utcFormat:function(V){var be=w(V+="",v);return be.toString=function(){return V},be},utcParse:function(V){var be=E(V+="",!0);return be.toString=function(){return V},be}}}var Iw={"-":"",_:" ",0:"0"},Mt=/^\s*\d+/,gL=/^%/,mL=/[\\^$*+?|[\]().{}]/g;function Me(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function yL(e){return e.replace(mL,"\\$&")}function Fl(e){return new RegExp("^(?:"+e.map(yL).join("|")+")","i")}function kl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bL(e,t,n){var i=Mt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function xL(e,t,n){var i=Mt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function vL(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function EL(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function AL(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Bw(e,t,n){var i=Mt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function zw(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function wL(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function CL(e,t,n){var i=Mt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function SL(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Uw(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function _L(e,t,n){var i=Mt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function jw(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function $L(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function FL(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function kL(e,t,n){var i=Mt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function DL(e,t,n){var i=Mt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function TL(e,t,n){var i=gL.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function ML(e,t,n){var i=Mt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function OL(e,t,n){var i=Mt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function qw(e,t){return Me(e.getDate(),t,2)}function RL(e,t){return Me(e.getHours(),t,2)}function NL(e,t){return Me(e.getHours()%12||12,t,2)}function LL(e,t){return Me(1+eo.count(yr(e),e),t,3)}function aD(e,t){return Me(e.getMilliseconds(),t,3)}function PL(e,t){return aD(e,t)+"000"}function IL(e,t){return Me(e.getMonth()+1,t,2)}function BL(e,t){return Me(e.getMinutes(),t,2)}function zL(e,t){return Me(e.getSeconds(),t,2)}function UL(e){var t=e.getDay();return t===0?7:t}function jL(e,t){return Me(nl.count(yr(e)-1,e),t,2)}function uD(e){var t=e.getDay();return t>=4||t===0?Eu(e):Eu.ceil(e)}function qL(e,t){return e=uD(e),Me(Eu.count(yr(e),e)+(yr(e).getDay()===4),t,2)}function WL(e){return e.getDay()}function HL(e,t){return Me(mh.count(yr(e)-1,e),t,2)}function GL(e,t){return Me(e.getFullYear()%100,t,2)}function YL(e,t){return e=uD(e),Me(e.getFullYear()%100,t,2)}function VL(e,t){return Me(e.getFullYear()%1e4,t,4)}function XL(e,t){var n=e.getDay();return e=n>=4||n===0?Eu(e):Eu.ceil(e),Me(e.getFullYear()%1e4,t,4)}function KL(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Me(t/60|0,"0",2)+Me(t%60,"0",2)}function Ww(e,t){return Me(e.getUTCDate(),t,2)}function JL(e,t){return Me(e.getUTCHours(),t,2)}function QL(e,t){return Me(e.getUTCHours()%12||12,t,2)}function ZL(e,t){return Me(1+Ho.count(br(e),e),t,3)}function lD(e,t){return Me(e.getUTCMilliseconds(),t,3)}function e7(e,t){return lD(e,t)+"000"}function t7(e,t){return Me(e.getUTCMonth()+1,t,2)}function n7(e,t){return Me(e.getUTCMinutes(),t,2)}function i7(e,t){return Me(e.getUTCSeconds(),t,2)}function r7(e){var t=e.getUTCDay();return t===0?7:t}function o7(e,t){return Me(il.count(br(e)-1,e),t,2)}function cD(e){var t=e.getUTCDay();return t>=4||t===0?Au(e):Au.ceil(e)}function s7(e,t){return e=cD(e),Me(Au.count(br(e),e)+(br(e).getUTCDay()===4),t,2)}function a7(e){return e.getUTCDay()}function u7(e,t){return Me(yh.count(br(e)-1,e),t,2)}function l7(e,t){return Me(e.getUTCFullYear()%100,t,2)}function c7(e,t){return e=cD(e),Me(e.getUTCFullYear()%100,t,2)}function f7(e,t){return Me(e.getUTCFullYear()%1e4,t,4)}function d7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Au(e):Au.ceil(e),Me(e.getUTCFullYear()%1e4,t,4)}function h7(){return"+0000"}function Hw(){return"%"}function Gw(e){return+e}function Yw(e){return Math.floor(+e/1e3)}var ja,wx,fD,Cx,dD;p7({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function p7(e){return ja=sD(e),wx=ja.format,fD=ja.parse,Cx=ja.utcFormat,dD=ja.utcParse,ja}function tc(e){const t={};return n=>t[n]||(t[n]=e(n))}function g7(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=m7(i,r);const s=o<i.length?i.slice(o):"";for(;--o>r;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function m7(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function hD(e){const t=tc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=G1(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return g7(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=G1(s??",f");const a=ea(i,r,o),u=Math.max(Math.abs(i),Math.abs(r));let l;if(s.precision==null)switch(s.type){case"s":return isNaN(l=z8(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=B8(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=I8(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let ny;pD();function pD(){return ny=hD({format:tk,formatPrefix:Y8})}function gD(e){return hD(G8(e))}function bh(e){return arguments.length?ny=gD(e):ny}function Vw(e,t,n){n=n||{},ce(n)||O(`Invalid time multi-format specifier: ${n}`);const i=t(mi),r=t(ti),o=t(ei),s=t(Ln),a=t(xt),u=t(rn),l=t(Nn),c=t(jt),f=e(n[Ii]||".%L"),d=e(n[mi]||":%S"),h=e(n[ti]||"%I:%M"),p=e(n[ei]||"%I %p"),g=e(n[Ln]||n[Qt]||"%a %d"),m=e(n[xt]||"%b %d"),y=e(n[rn]||"%B"),b=e(n[Nn]||"%B"),x=e(n[jt]||"%Y");return v=>(i(v)<v?f:r(v)<v?d:o(v)<v?h:s(v)<v?p:u(v)<v?a(v)<v?g:m:c(v)<v?l(v)<v?y:b:x)(v)}function mD(e){const t=tc(e.format),n=tc(e.utcFormat);return{timeFormat:i=>_e(i)?t(i):Vw(t,rl,i),utcFormat:i=>_e(i)?n(i):Vw(n,ol,i),timeParse:tc(e.parse),utcParse:tc(e.utcParse)}}let iy;yD();function yD(){return iy=mD({format:wx,parse:fD,utcFormat:Cx,utcParse:dD})}function bD(e){return mD(sD(e))}function Rc(e){return arguments.length?iy=bD(e):iy}const ry=(e,t)=>me({},e,t);function xD(e,t){const n=e?gD(e):bh(),i=t?bD(t):Rc();return ry(n,i)}function Sx(e,t){const n=arguments.length;return n&&n!==2&&O("defaultLocale expects either zero or two arguments."),n?ry(bh(e),Rc(t)):ry(bh(),Rc())}function y7(){return pD(),yD(),Sx()}const b7=/^(data:|([A-Za-z]+:)?\/\/)/,x7=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,v7=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Xw="file://";function E7(e){return t=>({options:t||{},sanitize:w7,load:A7,fileAccess:!1,file:C7(),http:_7})}async function A7(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t?.http)}async function w7(e,t){t=me({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=x7.test(e.replace(v7,""));(e==null||typeof e!="string"||!a)&&O("Sanitize failure, invalid URI: "+ee(e));const u=b7.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(Xw))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(Xw.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(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+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function C7(e){return S7}async function S7(){O("No file system access.")}async function _7(e,t){const n=me({},this.options.http,t),i=t&&t.response,r=await fetch(e,n);return r.ok?ye(r[i])?r[i]():r.text():O(r.status+""+r.statusText)}const $7=e=>e!=null&&e===e,F7=e=>e==="true"||e==="false"||e===!0||e===!1,k7=e=>!Number.isNaN(Date.parse(e)),vD=e=>!Number.isNaN(+e)&&!(e instanceof Date),D7=e=>vD(e)&&Number.isInteger(+e),oy={boolean:mx,integer:en,number:en,date:yx,string:bx,unknown:An},rd=[F7,D7,vD,k7],T7=["boolean","integer","number","date"];function ED(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=rd.length,r=rd.map((o,s)=>s+1);for(let o=0,s=0,a,u;o<n;++o)for(u=t?e[o][t]:e[o],a=0;a<i;++a)if(r[a]&&$7(u)&&!rd[a](u)&&(r[a]=0,++s,s===rd.length))return"string";return T7[r.reduce((o,s)=>o===0?s:o,0)-1]}function AD(e,t){return t.reduce((n,i)=>(n[i]=ED(e,i),n),{})}function Kw(e){const t=function(n,i){const r={delimiter:e};return _x(n,i?me(i,r):r)};return t.responseType="text",t}function _x(e,t){return t.header&&(e=t.header.map(ee).join(t.delimiter)+`
|
|
6
|
-
`+e),_9(t.delimiter).parse(e+"")}_x.responseType="text";function M7(e){return typeof Buffer=="function"&&ye(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function $x(e,t){const n=t&&t.property?pi(t.property):An;return ce(e)&&!M7(e)?O7(n(e),t):n(JSON.parse(e))}$x.responseType="json";function O7(e,t){return!Z(e)&&Ak(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const R7={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function wD(e,t){let n,i,r,o;return e=$x(e,t),t&&t.feature?(n=D9,r=t.feature):t&&t.mesh?(n=M9,r=t.mesh,o=R7[t.filter]):O("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):O("Invalid TopoJSON object: "+r),i&&i.features||[i]}wD.responseType="json";const Bd={dsv:_x,csv:Kw(","),tsv:Kw(" "),json:$x,topojson:wD};function Fx(e,t){return arguments.length>1?(Bd[e]=t,this):ue(Bd,e)?Bd[e]:null}function CD(e){const t=Fx(e);return t&&t.responseType||"text"}function SD(e,t,n,i){t=t||{};const r=Fx(t.type||"json");return r||O("Unknown data format type: "+t.type),e=r(e,t),t.parse&&N7(e,t.parse,n,i),ue(e,"columns")&&delete e.columns,e}function N7(e,t,n,i){if(!e.length)return;const r=Rc();n=n||r.timeParse,i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,l,c,f;t==="auto"&&(t=AD(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!oy[p])throw Error("Illegal format pattern: "+h+":"+p);return oy[p]});for(u=0,c=e.length,f=o.length;u<c;++u)for(s=e[u],l=0;l<f;++l)a=o[l],s[a]=d[l](s[a])}const tg=E7();function ng(e){const t=e||An,n=[],i={};return n.add=r=>{const o=t(r);return i[o]||(i[o]=1,n.push(r)),n},n.remove=r=>{const o=t(r);if(i[o]){i[o]=0;const s=n.indexOf(r);s>=0&&n.splice(s,1)}return n},n}async function zd(e,t){try{await t(e)}catch(n){e.error(n)}}const _D=Symbol("vega_id");let L7=1;function ig(e){return!!(e&&ne(e))}function ne(e){return e[_D]}function $D(e,t){return e[_D]=t,e}function Re(e){const t=e===Object(e)?e:{data:e};return ne(t)?t:$D(t,L7++)}function kx(e){return rg(e,Re({}))}function rg(e,t){for(const n in e)t[n]=e[n];return t}function FD(e,t){return $D(t,ne(e))}function Ca(e,t){return e?t?(n,i)=>e(n,i)||ne(t(n))-ne(t(i)):(n,i)=>e(n,i)||ne(n)-ne(i):null}function kD(e){return e&&e.constructor===Sa}function Sa(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:Sa,insert(a){const u=re(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ye(a)?i:t,l=re(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:ln(l)};return ye(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ye(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[ne(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[ne(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[ne(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=ne(g),l[m]?l[m]=1:a.add.push(Re(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[ne(g)]<0&&a.rem.push(g);function y(b,x,v){v?b[x]=v(b):a.encode=x,s||(c[ne(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[ne(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[ne(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[ne(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||i.length))&&a.clean(!0),a}}}const Ud="_:mod:_";function og(){Object.defineProperty(this,Ud,{writable:!0,value:{}})}og.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[Ud];return t!=null&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(r[e]=n,s[e]=Z(n)?1+n.length:-1),r},modified(e,t){const n=this[Ud];if(arguments.length){if(Z(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Ud]={},this}};let P7=0;const I7="pulse",B7=new og,z7=1,U7=2;function He(e,t,n,i){this.id=++P7,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function Jw(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}He.prototype={targets(){return this._targets||(this._targets=ng(cf))},set(e){return this.value!==e?(this.value=e,1):0},skip:Jw(z7),modified:Jw(U7),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new og,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof He?(h!==this&&(t&&h.targets().add(this),o.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(s in e)if(a=e[s],s===I7)re(a).forEach(f=>{f instanceof He?f!==this&&(f.targets().add(this),o.push(f)):O("Pulse parameters must be operator instances.")}),this.source=a;else if(Z(a))for(i.set(s,-1,Array(u=a.length)),l=0;l<u;++l)c(s,l,a[l]);else c(s,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||B7,n=this._argops;let i,r,o,s;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],o=i.op,s=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,s);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function j7(e,t,n,i){let r=1,o;return e instanceof He?o=e:e&&e.prototype instanceof He?o=new e:ye(e)?o=new He(null,e):(r=0,o=new He(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function q7(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let W7=0;function sg(e,t,n){this.id=++W7,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function _o(e,t,n){return new sg(e,t,n)}sg.prototype={_filter:gi,_apply:An,targets(){return this._targets||(this._targets=ng(cf))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=_o(e);return this.targets().add(t),t},apply(e){const t=_o(null,e);return this.targets().add(t),t},merge(){const e=_o();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=_o();return this.targets().add(_o(null,null,dx(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(_o(null,null,()=>n=!0)),t.targets().add(_o(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=gi,this._targets=null}};function H7(e,t,n,i){const r=this,o=_o(n,i),s=function(l){l.dataflow=r;try{o.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=re(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function G7(e,t){const n=this.locale();return SD(e,t,n.timeParse,n.utcParse)}function Y7(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function V7(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:CD(t&&t.type)});try{r=n.parse(r,t)}catch(o){i=-2,n.warn("Data ingestion failed",e,o)}}catch(o){i=-1,n.warn("Loading failed",e,o)}return{data:r,status:i}}async function X7(e,t,n){const i=this,r=i._pending||K7(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(gi).insert(o.data||[])),r.done(),o}function K7(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const J7={skip:!0};function Q7(e,t,n,i,r){return(e instanceof He?eP:Z7)(this,e,t,n,i,r),this}function Z7(e,t,n,i,r,o){const s=me({},o,J7);let a,u;ye(n)||(n=ln(n)),i===void 0?a=l=>e.touch(n(l)):ye(i)?(u=new He(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;kD(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function eP(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new He(null,tP(n,i),r,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function tP(e,t){return t=ye(t)?t:ln(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function nP(e){e.rank=++this._rank}function iP(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&O("Cycle detected in dataflow graph.")}const xh={},ir=1,ko=2,jr=4,rP=ir|ko,Qw=ir|jr,qa=ir|ko|jr,Zw=8,Dl=16,eC=32,tC=64;function Go(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function um(e,t){const n=[];return Fo(e,t,i=>n.push(i)),n}function nC(e,t){const n={};return e.visit(t,i=>{n[ne(i)]=1}),i=>n[ne(i)]?null:i}function od(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Go.prototype={StopPropagation:xh,ADD:ir,REM:ko,MOD:jr,ADD_REM:rP,ADD_MOD:Qw,ALL:qa,REFLOW:Zw,SOURCE:Dl,NO_SOURCE:eC,NO_FIELDS:tC,fork(e){return new Go(this.dataflow).init(this,e)},clone(){const e=this.fork(qa);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(qa|Dl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Go(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&&!(t&tC)&&(n.fields=e.fields),t&ir?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&ko?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&jr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&eC?(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||qa;return t&ir&&this.add.length||t&ko&&this.rem.length||t&jr&&this.mod.length},reflow(e){if(e)return this.fork(qa).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(jr,nC(this,ir))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return Z(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?Z(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&ir&&(n.addF=od(n.addF,t)),e&ko&&(n.remF=od(n.remF,t)),e&jr&&(n.modF=od(n.modF,t)),e&Dl&&(n.srcF=od(n.srcF,t)),n},materialize(e){e=e||qa;const t=this;return e&ir&&t.addF&&(t.add=um(t.add,t.addF),t.addF=null),e&ko&&t.remF&&(t.rem=um(t.rem,t.remF),t.remF=null),e&jr&&t.modF&&(t.mod=um(t.mod,t.modF),t.modF=null),e&Dl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Dl)return Fo(n.source,n.srcF,i),n;e&ir&&Fo(n.add,n.addF,i),e&ko&&Fo(n.rem,n.remF,i),e&jr&&Fo(n.mod,n.modF,i);const r=n.source;if(e&Zw&&r){const o=n.add.length+n.mod.length;o===r.length||(o?Fo(r,nC(n,Qw),i):Fo(r,n.srcF,i))}return n}};function Dx(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=r.fields||(r.fields={});for(const u in s.fields)a[u]=1}s.changed(r.ADD)&&(o|=r.ADD),s.changed(r.REM)&&(o|=r.REM),s.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}H(Dx,Go,{fork(e){const t=new Go(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?Z(e)?e.some(i=>n[i]):n[e]:0},filter(){O("MultiPulse does not support filtering.")},materialize(){O("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});async function oP(e,t,n){const i=this,r=[];if(i._pulse)return DD(i);if(i._pending&&await i._pending,t&&await zd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Go(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=ng(cf);let s=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=xh),u!==xh&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++s}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${s} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await zd(i,c[f].callback)}return n&&await zd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function sP(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function aP(e,t,n){return this._pulse?DD(this):(this.evaluate(e,t,n),this)}function uP(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function DD(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function lP(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function cP(e,t){const n=e.source,i=this._clock;return n&&Z(n)?new Dx(this,i,n.map(r=>r.pulse),t):this._input[e.id]||fP(this._pulse,n&&n.pulse)}function fP(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==xh&&(e.source=t.source),e)}const Tx={skip:!1,force:!1};function dP(e,t){const n=t||Tx;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function hP(e,t,n){const i=n||Tx;return(e.set(t)||i.force)&&this.touch(e,i),this}function pP(e,t,n){this.touch(e,n||Tx);const i=new Go(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function gP(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),TD(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,mP(t,0,e)):i=n,i}}}function TD(e,t,n,i){let r,o;const s=e[n];for(;n>t;){if(o=n-1>>1,r=e[o],i(s,r)<0){e[n]=r,n=o;continue}break}return e[n]=s}function mP(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,TD(e,i,t,n)}function cu(){this.logger(uk()),this.logLevel(ax),this._clock=0,this._rank=0,this._locale=Sx();try{this._loader=tg()}catch{}this._touched=ng(cf),this._input={},this._pulse=null,this._heap=gP((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Tl(e){return function(){return this._log[e].apply(this,arguments)}}cu.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:Tl("error"),warn:Tl("warn"),info:Tl("info"),debug:Tl("debug"),logLevel:Tl("level"),cleanThreshold:1e4,add:j7,connect:q7,rank:nP,rerank:iP,pulse:pP,touch:dP,update:hP,changeset:Sa,ingest:Y7,parse:G7,preload:X7,request:V7,events:H7,on:Q7,evaluate:oP,run:aP,runAsync:sP,runAfter:uP,_enqueue:lP,_getPulse:cP};function M(e,t){He.call(this,e,null,t)}H(M,He,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Cu={};function MD(e){const t=OD(e);return t&&t.Definition||null}function OD(e){return e=e&&e.toLowerCase(),ue(Cu,e)?Cu[e]:null}function*RD(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Mx(e,t,n){const i=Float64Array.from(RD(e,n));return i.sort(Tc),t.map(r=>Nk(i,r))}function Ox(e,t){return Mx(e,[.25,.5,.75],t)}function Rx(e,t){const n=e.length,i=L9(e,t),r=Ox(e,t),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function ND(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,l,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+g)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var yi=Math.random;function yP(e){yi=e}function LD(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(RD(e,i)),o=r.length,s=t;let a,u,l,c;for(l=0,c=Array(s);l<s;++l){for(a=0,u=0;u<o;++u)a+=r[~~(yi()*o)];c[l]=a/o}return c.sort(Tc),[K1(c,n/2),K1(c,1-n/2)]}function PD(e,t,n,i){i=i||(d=>d);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;s<a;++s)o[s]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;s<a;++s)o[s]=l;return n?bP(o,t+t/4):o}function bP(e,t){const n=e.length;let i=0,r=1,o,s;for(;e[i]===e[r];)++r;for(;r<n;){for(o=r+1;e[r]===e[o];)++o;if(e[r]-e[r-1]<t){for(s=r+(i+o-r-r>>1);s<r;)e[s++]=e[r];for(;s>r;)e[s--]=e[i]}i=r,r=o}return e}function xP(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function vP(e,t){t==null&&(t=e,e=0);let n,i,r;const o={min(s){return arguments.length?(n=s||0,r=i-n,o):n},max(s){return arguments.length?(i=s||0,r=i-n,o):i},sample(){return n+Math.floor(r*yi())},pdf(s){return s===Math.floor(s)&&s>=n&&s<i?1/r:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=i?1:(a-n+1)/r},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*r):NaN}};return o.min(e).max(t)}const ID=Math.sqrt(2*Math.PI),EP=Math.SQRT2;let Ml=NaN;function ag(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(Ml===Ml)n=Ml,Ml=NaN;else{do n=yi()*2-1,i=yi()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,Ml=i*o}return e+n*t}function Nx(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*ID)}function ug(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37)o=0;else{const s=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,o=s*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,o=o/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,o=s/a/2.506628274631)}return i>0?1-o:o}function lg(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*EP*AP(2*e-1)}function AP(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Lx(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>ag(n,i),pdf:o=>Nx(o,n,i),cdf:o=>ug(o,n,i),icdf:o=>lg(o,n,i)};return r.mean(e).stdev(t)}function Px(e,t){const n=Lx();let i=0;const r={data(o){return arguments.length?(e=o,i=o?o.length:0,r.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Rx(e)),r):t},sample(){return e[~~(yi()*i)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<i;++a)s+=n.pdf((o-e[a])/t);return s/t/i},cdf(o){let s=0,a=0;for(;a<i;++a)s+=n.cdf((o-e[a])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Ix(e,t){return e=e||0,t=t??1,Math.exp(e+ag()*t)}function Bx(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*ID*e)}function zx(e,t,n){return ug(Math.log(e),t,n)}function Ux(e,t,n){return Math.exp(lg(e,t,n))}function BD(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>Ix(n,i),pdf:o=>Bx(o,n,i),cdf:o=>zx(o,n,i),icdf:o=>Ux(o,n,i)};return r.mean(e).stdev(t)}function zD(e,t){let n=0,i;function r(s){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=s[l]==null?1:+s[l];for(l=0;l<n;++l)a[l]/=u;return a}const o={weights(s){return arguments.length?(i=r(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=yi();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(s<u){a=e[l];break}return a.sample()},pdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(s);return a},cdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function jx(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*yi()}function qx(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Wx(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Hx(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function UD(e,t){let n,i;const r={min(o){return arguments.length?(n=o||0,r):n},max(o){return arguments.length?(i=o??1,r):i},sample:()=>jx(n,i),pdf:o=>qx(o,n,i),cdf:o=>Wx(o,n,i),icdf:o=>Hx(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Gx(e,t,n){let i=0,r=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(i+=(s-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function df(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function cg(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)o[a]-=u,s[a]-=l;return[o,s,u,l]}function hf(e,t,n,i){let r=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&i(o,s,++r)}function sl(e,t,n,i,r){let o=0,s=0;return hf(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function Yx(e,t,n){let i=0,r=0,o=0,s=0,a=0;hf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=df(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:sl(e,t,n,r,l)}}function jD(e,t,n){let i=0,r=0,o=0,s=0,a=0;hf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=df(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:sl(e,t,n,r,l)}}function qD(e,t,n){const[i,r,o,s]=cg(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;hf(e,t,n,(b,x)=>{d=i[f++],h=Math.log(x),p=d*x,a+=(x*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=df(u/s,a/s,l/s,c/s),y=b=>Math.exp(g+m*(b-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:sl(e,t,n,s,y)}}function WD(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;hf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,o+=(h*p-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=df(i,r,o,s),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:sl(e,t,n,a,c)}}function Vx(e,t,n){const[i,r,o,s]=cg(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,x=(d*u-f*l)/b,v=(f*y-d*l)/b,A=-x*u,w=E=>(E=E-o,x*E*E+v*E+A+s);return{coef:[A-v*o+x*o*o+s,v-2*x*o,x],predict:w,rSquared:sl(e,t,n,s,w)}}function HD(e,t,n,i){if(i===0)return Gx(e,t,n);if(i===1)return Yx(e,t,n);if(i===2)return Vx(e,t,n);const[r,o,s,a]=cg(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*o[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=CP(c),b=x=>{x-=s;let v=a+y[0]+y[1]*x+y[2]*x*x;for(d=3;d<f;++d)v+=y[d]*Math.pow(x,d);return v};return{coef:wP(f,y,-s,a),predict:b,rSquared:sl(e,t,n,a,b)}}function wP(e,t,n,i){const r=Array(e);let o,s,a,u;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],u=1,r[o]+=a,s=1;s<=o;++s)u*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*u;return r[0]+=i,r}function CP(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;i<t;++i){for(s=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][s])&&(s=r);for(o=i;o<t+1;++o)a=e[o][i],e[o][i]=e[o][s],e[o][s]=a;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,o=r+1;o<t;++o)a+=e[o][r]*n[o];n[r]=(e[t][r]-a)/e[r][r]}return n}const iC=2,rC=1e-12;function GD(e,t,n,i){const[r,o,s,a]=cg(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=iC;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],x=p[1],v=y-r[b]>r[x]-y?b:x;let A=0,w=0,E=0,C=0,S=0;const $=1/Math.abs(r[v]-y||1);for(let T=b;T<=x;++T){const F=r[T],_=o[T],D=SP(Math.abs(y-F)*$)*d[T],P=F*D;A+=D,w+=P,E+=_*D,C+=_*P,S+=F*P}const[k,L]=df(w/A,E/A,C/A,S/A);c[m]=k+L*y,f[m]=Math.abs(o[m]-c[m]),_P(r,m+1,p)}if(h===iC)break;const g=Lk(f);if(Math.abs(g)<rC)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?rC:(b=1-y*y)*b}return $P(r,c,s,a)}function SP(e){return(e=1-e*e*e)*e*e}function _P(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}function $P(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],l;for(;s<r;++s)l=e[s]+n,u[0]===l?u[1]+=(t[s]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[s]],o.push(u));return u[1]+=i,o}const FP=.5*Math.PI/180;function fg(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(o+g/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let g=n;--g>0;)c.push(r(o+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=kP(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&DP(f,g,d,h,p)>FP?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function kP(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const s=t[o][1];s<n&&(n=s),s>i&&(i=s)}return 1/(i-n)}function DP(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),s=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-s)}function TP(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function sy(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:TP(e)}function YD(e,t,n){return n||e+(t?"_"+t:"")}const lm=()=>{},MP={init:lm,add:lm,rem:lm,idx:0},Nc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},pf=Object.keys(Nc).filter(e=>e!=="__count__");function OP(e,t){return(n,i)=>me({name:e,aggregate_param:i,out:n||e},MP,t)}[...pf,"__count__"].forEach(e=>{Nc[e]=OP(e,Nc[e])});function VD(e,t,n){return Nc[e](n,t)}function XD(e,t){return e.idx-t.idx}function RP(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=Nc[r]())})};return e.forEach(n),Object.values(t).sort(XD)}function NP(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function LP(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function PP(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function IP(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function KD(e,t){const n=t||An,i=RP(e),r=e.slice().sort(XD);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=NP,o.prototype.add=LP,o.prototype.rem=PP,o.prototype.set=IP,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function Xx(e){this._key=e?pi(e):ne,this.reset()}const Wt=Xx.prototype;Wt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Wt.add=function(e){this._add.push(e)};Wt.rem=function(e){this._rem.push(e)};Wt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,l;for(a=0;a<r;++a)s[n(t[a])]=1;for(a=0,u=0;a<i;++a)s[n(l=e[a])]?s[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o};Wt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",ue(n,o)||(n[o]=1,++r);return r};Wt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=vk(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Wt.argmin=function(e){return this.extent(e)[0]||{}};Wt.argmax=function(e){return this.extent(e)[1]||{}};Wt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Wt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Wt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Ox(this.values(),e),this._get=e),this._q};Wt.q1=function(e){return this.quartile(e)[0]};Wt.q2=function(e){return this.quartile(e)[1]};Wt.q3=function(e){return this.quartile(e)[2]};Wt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=LD(this.values(),1e3,.05,e),this._get=e),this._ci};Wt.ci0=function(e){return this.ci(e)[0]};Wt.ci1=function(e){return this.ci(e)[1]};function Jo(e){M.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Jo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:pf},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};H(Jo,M,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}o(e._prev),o(t);function s(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?s(h,u,l):t[h]||e.cell(h,u)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const x=re(nn(b)),v=x.length;let A=0,w;for(;A<v;++A)i[w=x[A]]||(i[w]=1,t.push(w))}this._dims=re(e.groupby),this._dnames=this._dims.map(b=>{const x=ut(b);return r(b),n.push(x),x}),this.cellkey=e.key?e.key:sy(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,p,g,m,y;for(l!==s.length&&O("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&O("Null aggregate field specified."),g=ut(f),m=YD(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(VD(d,h,m))}return this._measures=this._measures.map(b=>KD(b,b.field)),Object.create(null)},cellkey:sy(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let o=0;o<r;++o)n.agg[o]=new i[o](n)}return n.store&&(n.data=new Xx),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let s=0;s<r;++s)o[n[s]]=i[s](e);return t?FD(t.tuple,o):Re(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,o=i.length;r<o;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,s=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&s.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?s:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const BP=1e-14;function Kx(e){M.call(this,null,e)}Kx.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};H(Kx,M,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,o=i.step,s=e.as||["bin0","bin1"],a=s[0],u=s[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(nn(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+o*(1+(f-r)/o)}:c=>c[a]=i(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=ND(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;(s=e.anchor)!=null&&(a=s-(r+i*Math.floor((s-r)/i)),r+=a,o+=a);const u=function(l){let c=en(t(l));return c==null?null:c<r?-1/0:c>o?1/0:(c=Math.max(r,Math.min(c,o-i)),r+i*Math.floor(BP+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=Un(u,nn(t),e.name||"bin_"+ut(t))}});function JD(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:u=>o.push(u),remove:u=>s[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!s[i(c)]),s={},a=0),l&&u&&r.sort(u),o.length&&(r=u?Sk(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function Jx(e){M.call(this,[],e)}Jx.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};H(Jx,M,{transform(e,t){const n=t.fork(t.ALL),i=JD(ne,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(Ca(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function QD(e){He.call(this,null,zP,e)}H(QD,He);function zP(e){return this.value&&!e.modified()?this.value:fx(e.fields,e.orders)}function Qx(e){M.call(this,null,e)}Qx.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function UP(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}H(Qx,M,{transform(e,t){const n=f=>d=>{for(var h=UP(a(d),e.case,o)||[],p,g=0,m=h.length;g<m;++g)s.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,s=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Re({}),u[r]=a,u[o]=l,s.add.push(u)):l===0?(u&&s.rem.push(u),n[a]=null,i[a]=null):u[o]!==l&&(u[o]=l,s.mod.push(u));return s.modifies(t)}});function Zx(e){M.call(this,null,e)}Zx.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};H(Zx,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=jP(a,r,o,e.filter||gi)):n.mod=a,n.source=this.value,n.modifies(i)}});function jP(e,t,n,i){for(var r=[],o={},s=e.length,a=0,u,l;a<s;++a)for(o[t]=l=e[a],u=0;u<s;++u)o[n]=e[u],i(o)&&(r.push(Re(o)),o={},o[t]=l);return r}const oC={kde:Px,mixture:zD,normal:Lx,lognormal:BD,uniform:UD},qP="distributions",sC="function",WP="field";function ZD(e,t){const n=e[sC];ue(oC,n)||O("Unknown distribution function: "+n);const i=oC[n]();for(const r in e)r===WP?i.data((e.from||t()).map(e[r])):r===qP?i[r](e[r].map(o=>ZD(o,t))):typeof i[r]===sC&&i[r](e[r]);return i}function ev(e){M.call(this,null,e)}const e3=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],HP={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:e3},{name:"weights",type:"number",array:!0}]};ev.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:e3.concat(HP)},{name:"as",type:"string",array:!0,default:["value","density"]}]};H(ev,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=ZD(e.distribution,GP(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&O("Invalid density method: "+s),!e.extent&&!i.data&&O("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||mr(i.data()),l=fg(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Re(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function GP(e){return()=>e.materialize(e.SOURCE).source}function t3(e,t){return e?e.map((n,i)=>t[i]||ut(n)):null}function tv(e,t,n){const i=[],r=f=>f(u);let o,s,a,u,l,c;if(t==null)i.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)u=e[s],l=t.map(r),c=o[l],c||(o[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const n3="bin";function nv(e){M.call(this,null,e)}nv.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:n3}]};const YP=(e,t)=>ff(mr(e,t))/30;H(nv,M,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=tv(t.source,e.groupby,An),r=e.smooth||!1,o=e.field,s=e.step||YP(n,o),a=Ca((p,g)=>o(p)-o(g)),u=e.as||n3,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of PD(p,s,r,o))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function i3(e){He.call(this,null,VP,e),this.modified(!0)}H(i3,He);function VP(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Un(n=>t(n,e),nn(t),ut(t))}function iv(e){M.call(this,[void 0,void 0],e)}iv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};H(iv,M,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if((r||o==null)&&(o=1/0,s=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=en(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=ut(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function rv(e,t){He.call(this,e),this.parent=t,this.count=0}H(rv,He,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function dg(e){M.call(this,{},e),this._keys=tl();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}H(dg,M,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=ue(r,e)&&r[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=i||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new rv(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),r[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,s=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ne(u),c=o.get(l);c!==void 0&&(o.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);o.set(ne(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ne(u),c=o.get(l),f=i(u);c===f?a(f).mod(u):(o.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(o.get(ne(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=ne(u),c=o.get(l),f=i(u);c!==f&&(o.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function r3(e){He.call(this,null,XP,e)}H(r3,He);function XP(e){return this.value&&!e.modified()?this.value:Z(e.name)?re(e.name).map(t=>pi(t)):pi(e.name,e.as)}function ov(e){M.call(this,tl(),e)}ov.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};H(ov,M,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ne(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(ne(f),1)});function c(f){const d=ne(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),o.push(f)):!h&&!p?(i.set(d,1),s.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function sv(e){M.call(this,[],e)}sv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};H(sv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t3(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=kx(a),f=0;f<s;++f)d[r[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}});function av(e){M.call(this,[],e)}av.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};H(av,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(ut),o=e.as||["key","value"],s=o[0],a=o[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=kx(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function uv(e){M.call(this,null,e)}uv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};H(uv,M,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,s=>s[i]=n(s,e))}});function o3(e){M.call(this,[],e)}H(o3,M,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;)s.push(u=Re(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=r.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-o);return n.source=this.value=r,n}});const sd={value:"value",median:Lk,mean:B9,min:X1,max:Hs},KP=[];function lv(e){M.call(this,[],e)}lv.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function JP(e){var t=e.method||sd.value,n;if(sd[t]==null)O("Unrecognized imputation method: "+t);else return t===sd.value?(n=e.value!==void 0?e.value:0,()=>n):sd[t]}function QP(e){const t=e.field;return n=>n?t(n):NaN}H(lv,M,{transform(e,t){var n=t.fork(t.ALL),i=JP(e),r=QP(e),o=ut(e.field),s=ut(e.key),a=(e.groupby||[]).map(ut),u=ZP(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,x,v,A;for(m=0,x=u.length;m<x;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],A={_impute:!0},y=0,v=p.length;y<v;++y)A[a[y]]=p[y];A[s]=g,A[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Re(A))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function ZP(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=s.push(p)),c=(l=t?t.map(r):KP)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function cv(e){Jo.call(this,e)}cv.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:pf},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};H(cv,Jo,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(r=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{me(o,r[n.cellkey(o)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function fv(e){M.call(this,null,e)}fv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};H(fv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=tv(i,e.groupby,e.field),o=(e.groupby||[]).map(ut),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&O("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=mr(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=Px(h,s)[a],g=e.counts?h.length:1,m=c||mr(h);fg(p,m,f,d).forEach(y=>{const b={};for(let x=0;x<o.length;++x)b[o[x]]=h.dims[x];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Re(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function s3(e){He.call(this,null,eI,e)}H(s3,He);function eI(e){return this.value&&!e.modified()?this.value:gx(e.fields,e.flat)}function a3(e){M.call(this,[],e),this._pending=null}H(a3,M,{transform(e,t){const n=t.dataflow;return this._pending?cm(this,t,this._pending):tI(e)?t.StopPropagation:e.values?cm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=re(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>cm(this,t,re(i.data)))}});function tI(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function cm(e,t,n){n.forEach(Re);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function dv(e){M.call(this,{},e)}dv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};H(dv,M,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&O('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&O('The "as" parameter has too few output field names.'),c=c||r.map(ut),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=o;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||O("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??o}),s?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function u3(e){He.call(this,null,nI,e)}H(u3,He);function nI(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<i&&(i=s[0]),s[1]>r&&(r=s[1]);return[i,r]}function l3(e){He.call(this,null,iI,e)}H(l3,He);function iI(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function c3(e){M.call(this,null,e)}H(c3,M,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function hv(e){Jo.call(this,e)}hv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:pf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};H(hv,Jo,{_transform:Jo.prototype.transform,transform(e,t){return this._transform(rI(e,t),t)}});function rI(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=nn(n).concat(nn(i)),s=sI(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(a=>oI(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function oI(e,t,n,i){return Un(r=>t(r)===e?n(r):NaN,i,e+"")}function sI(e,t,n){const i={},r=[];return n.visit(n.SOURCE,o=>{const s=e(o);i[s]||(i[s]=1,r.push(s))}),r.sort(el),t?r.slice(0,t):r}function f3(e){dg.call(this,e)}H(f3,dg,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(ne(o),n,t,o);return(e.modified("field")||i&&t.modified(nn(i)))&&O("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,o=>{const s=r(o);i(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=r(o);i(o).forEach(a=>s.add(Re(a)))}),t.visit(t.REM,o=>{const s=r(o);i(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>r(o).mod(o)),t.visit(t.ADD,o=>r(o).add(o)),t.visit(t.REM,o=>r(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function pv(e){M.call(this,null,e)}pv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};H(pv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t3(e.fields,e.as||[]),o=i?(a,u)=>aI(a,u,i,r):rg;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=ne(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Re({}));s[ne(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[ne(a)]))}),n}});function aI(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function d3(e){M.call(this,null,e)}H(d3,M,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function gv(e){M.call(this,null,e)}gv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const uI=1e-14;H(gv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=tv(r,e.groupby,e.field),s=(e.groupby||[]).map(ut),a=[],u=e.step||.01,l=e.probs||Yn(u/2,1-uI,u),c=l.length;return o.forEach(f=>{const d=Mx(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<s.length;++g)p[s[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Re(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function h3(e){M.call(this,null,e)}H(h3,M,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const o=ne(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=kx(r);i[ne(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[ne(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function mv(e){M.call(this,[],e),this.count=0}mv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};H(mv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[ne(f)]=1,c),{});let s=this.value,a=this.count,u=0;function l(c){let f,d;s.length<r?s.push(c):(d=~~((a+1)*yi()),d<s.length&&d>=u&&(f=s[d],o[ne(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ne(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[ne(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[ne(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[ne(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ne(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[ne(c)])),this.count=a,this.value=n.source=s,n}});function yv(e){M.call(this,null,e)}yv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};H(yv,M,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Yn(e.start,e.stop,e.step||1).map(r=>{const o={};return o[i]=r,Re(o)}),n.add=t.add.concat(this.value),n}});function p3(e){M.call(this,null,e),this.modified(!0)}H(p3,M,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function bv(e){M.call(this,null,e)}const g3=["unit0","unit1"];bv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:vx,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:g3}]};H(bv,M,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?ol:rl)(o.unit).offset,a=e.as||g3,u=a[0],l=a[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(nn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=o(g),i&&(p[l]=y=s(m,c)),m<f&&(f=m),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:oD({extent:e.extent||mr(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Ex(i),s=this.value||{},a=(n?Kk:Xk)(o,r);return a.unit=Se(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function m3(e){M.call(this,tl(),e)}H(m3,M,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=a=>r.set(i(a),a);let s=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function y3(e){M.call(this,null,e)}H(y3,M,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ca(e.sort)):t.source).map(e.field))}});function lI(e,t,n,i){const r=Lc[e](t,n);return{init:r.init||Oo,update:function(o,s){s[i]=r.next(o)}}}const Lc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Lc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||O("ntile num must be greater than zero.");const n=Lc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||O("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=cI(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function cI(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const fI=Object.keys(Lc);function b3(e){const t=re(e.ops),n=re(e.fields),i=re(e.params),r=re(e.aggregate_params),o=re(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){re(nn(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,x=ut(m),v=YD(p,x,o[g]);if(h(m),s.push(v),ue(Lc,p))a.push(lI(p,m,y,v));else{if(m==null&&p!=="count"&&O("Null aggregate field specified."),p==="count"){c.push(v);return}d=!1;let A=l[x];A||(A=l[x]=[],A.field=m,f.push(A)),A.push(VD(p,b,v))}}),(c.length||f.length)&&(this.cell=dI(f,c,d)),this.inputs=Object.keys(u)}const x3=b3.prototype;x3.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};x3.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(r[s]);for(s=e.p1;s<e.i1;++s)n.add(r[s]);n.set(t)}for(s=0;s<o;++s)i[s].update(e,t)};function dI(e,t,n){e=e.map(u=>KD(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),s=0;s<r;++s)o[s]=new e[s](i);if(i.store)var a=i.data=new Xx;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)o[l].add(o[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)o[l].rem(o[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)o[u].init()},i}function xv(e){M.call(this,{},e),this._mlen=0,this._mods=[]}xv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:fI.concat(pf)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};H(xv,M,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=Ca(e.sort),r=sy(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new b3(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)hI(this._mods[a],s,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=JD(ne),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function hI(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,s=i.frame||[null,0],a=e.data(n),u=a.length,l=o?zp(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||ln(-1)};t.init();for(let f=0;f<u;++f)pI(c,s,f,u),o&&gI(c,l),t.update(c,a[f])}function pI(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function gI(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,s=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<s&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}const mI=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Jo,bin:Kx,collect:Jx,compare:QD,countpattern:Qx,cross:Zx,density:ev,dotbin:nv,expression:i3,extent:iv,facet:dg,field:r3,filter:ov,flatten:sv,fold:av,formula:uv,generate:o3,impute:lv,joinaggregate:cv,kde:fv,key:s3,load:a3,lookup:dv,multiextent:u3,multivalues:l3,params:c3,pivot:hv,prefacet:f3,project:pv,proxy:d3,quantile:gv,relay:h3,sample:mv,sequence:yv,sieve:p3,subflow:rv,timeunit:bv,tupleindex:m3,values:y3,window:xv},Symbol.toStringTag,{value:"Module"}));function Ne(e){return function(){return e}}const aC=Math.abs,Yt=Math.atan2,Cs=Math.cos,yI=Math.max,fm=Math.min,Zi=Math.sin,js=Math.sqrt,Xt=1e-12,Su=Math.PI,vh=Su/2,v3=2*Su;function bI(e){return e>1?0:e<-1?Su:Math.acos(e)}function uC(e){return e>=1?vh:e<=-1?-vh:Math.asin(e)}function hg(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new o9(t)}function xI(e){return e.innerRadius}function vI(e){return e.outerRadius}function EI(e){return e.startAngle}function AI(e){return e.endAngle}function wI(e){return e&&e.padAngle}function CI(e,t,n,i,r,o,s,a){var u=n-e,l=i-t,c=s-r,f=a-o,d=f*u-c*l;if(!(d*d<Xt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function ad(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/js(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,x=g-h,v=b*b+x*x,A=r-o,w=d*g-p*h,E=(x<0?-1:1)*js(yI(0,A*A*v-w*w)),C=(w*x-b*E)/v,S=(-w*b-x*E)/v,$=(w*x+b*E)/v,k=(-w*b+x*E)/v,L=C-m,T=S-y,F=$-m,_=k-y;return L*L+T*T>F*F+_*_&&(C=$,S=k),{cx:C,cy:S,x01:-c,y01:-f,x11:C*(r/A-1),y11:S*(r/A-1)}}function SI(){var e=xI,t=vI,n=Ne(0),i=null,r=EI,o=AI,s=wI,a=null,u=hg(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-vh,g=o.apply(this,arguments)-vh,m=aC(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Xt))a.moveTo(0,0);else if(m>v3-Xt)a.moveTo(h*Cs(p),h*Zi(p)),a.arc(0,0,h,p,g,!y),d>Xt&&(a.moveTo(d*Cs(g),d*Zi(g)),a.arc(0,0,d,g,p,y));else{var b=p,x=g,v=p,A=g,w=m,E=m,C=s.apply(this,arguments)/2,S=C>Xt&&(i?+i.apply(this,arguments):js(d*d+h*h)),$=fm(aC(h-d)/2,+n.apply(this,arguments)),k=$,L=$,T,F;if(S>Xt){var _=uC(S/d*Zi(C)),D=uC(S/h*Zi(C));(w-=_*2)>Xt?(_*=y?1:-1,v+=_,A-=_):(w=0,v=A=(p+g)/2),(E-=D*2)>Xt?(D*=y?1:-1,b+=D,x-=D):(E=0,b=x=(p+g)/2)}var P=h*Cs(b),B=h*Zi(b),I=d*Cs(A),Y=d*Zi(A);if($>Xt){var le=h*Cs(x),oe=h*Zi(x),pe=d*Cs(v),We=d*Zi(v),ge;if(m<Su)if(ge=CI(P,B,pe,We,le,oe,I,Y)){var Ht=P-ge[0],ws=B-ge[1],wo=le-ge[0],V=oe-ge[1],be=1/Zi(bI((Ht*wo+ws*V)/(js(Ht*Ht+ws*ws)*js(wo*wo+V*V)))/2),ve=js(ge[0]*ge[0]+ge[1]*ge[1]);k=fm($,(d-ve)/(be-1)),L=fm($,(h-ve)/(be+1))}else k=L=0}E>Xt?L>Xt?(T=ad(pe,We,P,B,h,L,y),F=ad(le,oe,I,Y,h,L,y),a.moveTo(T.cx+T.x01,T.cy+T.y01),L<$?a.arc(T.cx,T.cy,L,Yt(T.y01,T.x01),Yt(F.y01,F.x01),!y):(a.arc(T.cx,T.cy,L,Yt(T.y01,T.x01),Yt(T.y11,T.x11),!y),a.arc(0,0,h,Yt(T.cy+T.y11,T.cx+T.x11),Yt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,L,Yt(F.y11,F.x11),Yt(F.y01,F.x01),!y))):(a.moveTo(P,B),a.arc(0,0,h,b,x,!y)):a.moveTo(P,B),!(d>Xt)||!(w>Xt)?a.lineTo(I,Y):k>Xt?(T=ad(I,Y,le,oe,d,-k,y),F=ad(P,B,pe,We,d,-k,y),a.lineTo(T.cx+T.x01,T.cy+T.y01),k<$?a.arc(T.cx,T.cy,k,Yt(T.y01,T.x01),Yt(F.y01,F.x01),!y):(a.arc(T.cx,T.cy,k,Yt(T.y01,T.x01),Yt(T.y11,T.x11),!y),a.arc(0,0,d,Yt(T.cy+T.y11,T.cx+T.x11),Yt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,k,Yt(F.y11,F.x11),Yt(F.y01,F.x01),!y))):a.arc(0,0,d,A,v,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Su/2;return[Cs(f)*c,Zi(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Ne(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Ne(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Ne(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Ne(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Ne(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Ne(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Ne(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function E3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function A3(e){this._context=e}A3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function vv(e){return new A3(e)}function w3(e){return e[0]}function C3(e){return e[1]}function S3(e,t){var n=Ne(!0),i=null,r=vv,o=null,s=hg(a);e=typeof e=="function"?e:e===void 0?w3:Ne(e),t=typeof t=="function"?t:t===void 0?C3:Ne(t);function a(u){var l,c=(u=E3(u)).length,f,d=!1,h;for(i==null&&(o=r(h=s())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Ne(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Ne(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Ne(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(o=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=o=null:o=r(i=u),a):i},a}function _3(e,t,n){var i=null,r=Ne(!0),o=null,s=vv,a=null,u=hg(l);e=typeof e=="function"?e:e===void 0?w3:Ne(+e),t=typeof t=="function"?t:Ne(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?C3:Ne(+n);function l(f){var d,h,p,g=(f=E3(f)).length,m,y=!1,b,x=new Array(g),v=new Array(g);for(o==null&&(a=s(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(x[p],v[p]);a.lineEnd(),a.areaEnd()}y&&(x[d]=+e(m,d,f),v[d]=+t(m,d,f),a.point(i?+i(m,d,f):x[d],n?+n(m,d,f):v[d]))}if(b)return a=null,b+""||null}function c(){return S3().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ne(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ne(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Ne(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ne(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ne(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ne(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Ne(!!f),l):r},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}const _I={draw(e,t){const n=js(t/Su);e.moveTo(n,0),e.arc(0,0,n,0,v3)}};function $I(e,t){let n=null,i=hg(r);e=typeof e=="function"?e:Ne(e||_I),t=typeof t=="function"?t:Ne(t===void 0?64:+t);function r(){let o;if(n||(n=o=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return r.type=function(o){return arguments.length?(e=typeof o=="function"?o:Ne(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Ne(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function Qo(){}function Eh(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function pg(e){this._context=e}pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Eh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Eh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function FI(e){return new pg(e)}function $3(e){this._context=e}$3.prototype={areaStart:Qo,areaEnd:Qo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Eh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kI(e){return new $3(e)}function F3(e){this._context=e}F3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Eh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DI(e){return new F3(e)}function k3(e,t){this._basis=new pg(e),this._beta=t}k3.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const TI=(function e(t){function n(i){return t===1?new pg(i):new k3(i,t)}return n.beta=function(i){return e(+i)},n})(.85);function Ah(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ev(e,t){this._context=e,this._k=(1-t)/6}Ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ah(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ah(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const MI=(function e(t){function n(i){return new Ev(i,t)}return n.tension=function(i){return e(+i)},n})(0);function Av(e,t){this._context=e,this._k=(1-t)/6}Av.prototype={areaStart:Qo,areaEnd:Qo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ah(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const OI=(function e(t){function n(i){return new Av(i,t)}return n.tension=function(i){return e(+i)},n})(0);function wv(e,t){this._context=e,this._k=(1-t)/6}wv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ah(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const RI=(function e(t){function n(i){return new wv(i,t)}return n.tension=function(i){return e(+i)},n})(0);function Cv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Xt){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Xt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function D3(e,t){this._context=e,this._alpha=t}D3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Cv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const NI=(function e(t){function n(i){return t?new D3(i,t):new Ev(i,0)}return n.alpha=function(i){return e(+i)},n})(.5);function T3(e,t){this._context=e,this._alpha=t}T3.prototype={areaStart:Qo,areaEnd:Qo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Cv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LI=(function e(t){function n(i){return t?new T3(i,t):new Av(i,0)}return n.alpha=function(i){return e(+i)},n})(.5);function M3(e,t){this._context=e,this._alpha=t}M3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Cv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const PI=(function e(t){function n(i){return t?new M3(i,t):new wv(i,0)}return n.alpha=function(i){return e(+i)},n})(.5);function O3(e){this._context=e}O3.prototype={areaStart:Qo,areaEnd:Qo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function II(e){return new O3(e)}function lC(e){return e<0?-1:1}function cC(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(lC(o)+lC(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function fC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dm(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function wh(e){this._context=e}wh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dm(this,this._t0,fC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,dm(this,fC(this,n=cC(this,e,t)),n);break;default:dm(this,this._t0,n=cC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function R3(e){this._context=new N3(e)}(R3.prototype=Object.create(wh.prototype)).point=function(e,t){wh.prototype.point.call(this,t,e)};function N3(e){this._context=e}N3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function BI(e){return new wh(e)}function zI(e){return new R3(e)}function L3(e){this._context=e}L3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=dC(e),r=dC(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function dC(e){var t,n=e.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(r[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function UI(e){return new L3(e)}function gg(e,t){this._context=e,this._t=t}gg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function jI(e){return new gg(e,.5)}function qI(e){return new gg(e,0)}function WI(e){return new gg(e,1)}function Yo(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const HI=()=>typeof Image<"u"?Image:null,ay=Symbol("implicit");function Sv(){var e=new Rw,t=[],n=[],i=ay;function r(o){let s=e.get(o);if(s===void 0){if(i!==ay)return i;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Rw;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Sv(t,n).unknown(i)},ls.apply(r,arguments),r}const P3=Math.PI/180,I3=180/Math.PI,Ch=18,B3=.96422,z3=1,U3=.82521,j3=4/29,fu=6/29,q3=3*fu*fu,GI=fu*fu*fu;function W3(e){if(e instanceof fr)return new fr(e.l,e.a,e.b,e.opacity);if(e instanceof Jr)return H3(e);e instanceof qp||(e=nk(e));var t=mm(e.r),n=mm(e.g),i=mm(e.b),r=hm((.2225045*t+.7168786*n+.0606169*i)/z3),o,s;return t===n&&n===i?o=s=r:(o=hm((.4360747*t+.3850649*n+.1430804*i)/B3),s=hm((.0139322*t+.0971045*n+.7141733*i)/U3)),new fr(116*r-16,500*(o-r),200*(r-s),e.opacity)}function Sh(e,t,n,i){return arguments.length===1?W3(e):new fr(e,t,n,i??1)}function fr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}nx(fr,Sh,ix(rx,{brighter(e){return new fr(this.l+Ch*(e??1),this.a,this.b,this.opacity)},darker(e){return new fr(this.l-Ch*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=B3*pm(t),e=z3*pm(e),n=U3*pm(n),new qp(gm(3.1338561*t-1.6168667*e-.4906146*n),gm(-.9787684*t+1.9161415*e+.033454*n),gm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function hm(e){return e>GI?Math.pow(e,1/3):e/q3+j3}function pm(e){return e>fu?e*e*e:q3*(e-j3)}function gm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function mm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function YI(e){if(e instanceof Jr)return new Jr(e.h,e.c,e.l,e.opacity);if(e instanceof fr||(e=W3(e)),e.a===0&&e.b===0)return new Jr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*I3;return new Jr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _h(e,t,n,i){return arguments.length===1?YI(e):new Jr(e,t,n,i??1)}function Jr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function H3(e){if(isNaN(e.h))return new fr(e.l,0,0,e.opacity);var t=e.h*P3;return new fr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}nx(Jr,_h,ix(rx,{brighter(e){return new Jr(this.h,this.c,this.l+Ch*(e??1),this.opacity)},darker(e){return new Jr(this.h,this.c,this.l-Ch*(e??1),this.opacity)},rgb(){return H3(this).rgb()}}));var G3=-.14861,_v=1.78277,$v=-.29227,mg=-.90649,Pc=1.97294,hC=Pc*mg,pC=Pc*_v,gC=_v*$v-mg*G3;function VI(e){if(e instanceof Gs)return new Gs(e.h,e.s,e.l,e.opacity);e instanceof qp||(e=nk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(gC*i+hC*t-pC*n)/(gC+hC-pC),o=i-r,s=(Pc*(n-r)-$v*o)/mg,a=Math.sqrt(s*s+o*o)/(Pc*r*(1-r)),u=a?Math.atan2(s,o)*I3-120:NaN;return new Gs(u<0?u+360:u,a,r,e.opacity)}function uy(e,t,n,i){return arguments.length===1?VI(e):new Gs(e,t,n,i??1)}function Gs(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}nx(Gs,uy,ix(rx,{brighter(e){return e=e==null?kw:Math.pow(kw,e),new Gs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fw:Math.pow(Fw,e),new Gs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*P3,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new qp(255*(t+n*(G3*i+_v*r)),255*(t+n*($v*i+mg*r)),255*(t+n*(Pc*i)),this.opacity)}}));function XI(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function KI(e,t){var n=Wp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function Y3(e){return function(t,n){var i=e((t=Y1(t)).h,(n=Y1(n)).h),r=Zt(t.s,n.s),o=Zt(t.l,n.l),s=Zt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const JI=Y3(Wp);var QI=Y3(Zt);function ZI(e,t){var n=Zt((e=Sh(e)).l,(t=Sh(t)).l),i=Zt(e.a,t.a),r=Zt(e.b,t.b),o=Zt(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=i(s),e.b=r(s),e.opacity=o(s),e+""}}function V3(e){return function(t,n){var i=e((t=_h(t)).h,(n=_h(n)).h),r=Zt(t.c,n.c),o=Zt(t.l,n.l),s=Zt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const eB=V3(Wp);var tB=V3(Zt);function X3(e){return(function t(n){n=+n;function i(r,o){var s=e((r=uy(r)).h,(o=uy(o)).h),a=Zt(r.s,o.s),u=Zt(r.l,o.l),l=Zt(r.opacity,o.opacity);return function(c){return r.h=s(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i})(1)}const nB=X3(Wp);var iB=X3(Zt);function Fv(e,t){t===void 0&&(t=e,e=lf);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function rB(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const oB=Object.freeze(Object.defineProperty({__proto__:null,interpolate:lf,interpolateArray:V8,interpolateBasis:X8,interpolateBasisClosed:K8,interpolateCubehelix:nB,interpolateCubehelixLong:iB,interpolateDate:J8,interpolateDiscrete:XI,interpolateHcl:eB,interpolateHclLong:tB,interpolateHsl:JI,interpolateHslLong:QI,interpolateHue:KI,interpolateLab:ZI,interpolateNumber:Q8,interpolateNumberArray:Z8,interpolateObject:e9,interpolateRgb:t9,interpolateRgbBasis:n9,interpolateRgbBasisClosed:i9,interpolateRound:Up,interpolateString:r9,interpolateTransformCss:s9,interpolateTransformSvg:a9,interpolateZoom:u9,piecewise:Fv,quantize:rB},Symbol.toStringTag,{value:"Module"}));function K3(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,_w),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return K3(e).unknown(t)},e=arguments.length?Array.from(e,_w):[0,1],Qu(n)}function J3(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),e[n]=t.floor(r),e[i]=t.ceil(o),e}function mC(e){return Math.log(e)}function yC(e){return Math.exp(e)}function sB(e){return-Math.log(-e)}function aB(e){return-Math.exp(-e)}function uB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function lB(e){return e===10?uB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function cB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function bC(e){return(t,n)=>-e(-t,n)}function kv(e){const t=e(mC,yC),n=t.domain;let i=10,r,o;function s(){return r=cB(i),o=lB(i),n()[0]<0?(r=bC(r),o=bC(o),e(sB,aB)):e(mC,yC),t}return t.base=function(a){return arguments.length?(i=+a,s()):i},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=$w(l,c,m))}else y=$w(d,h,Math.min(h-d,m)).map(o);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=G1(u)).precision==null&&(u.trim=!0),u=tk(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/o(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(J3(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function Q3(){const e=kv(tx()).domain([1,10]);return e.copy=()=>jp(e,Q3()).base(e.base()),ls.apply(e,arguments),e}function xC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Dv(e){var t=1,n=e(xC(t),vC(t));return n.constant=function(i){return arguments.length?e(xC(t=+i),vC(t)):t},Qu(n)}function Z3(){var e=Dv(tx());return e.copy=function(){return jp(e,Z3()).constant(e.constant())},ls.apply(e,arguments)}function EC(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dB(e){return e<0?-e*e:e*e}function Tv(e){var t=e(Ro,Ro),n=1;function i(){return n===1?e(Ro,Ro):n===.5?e(fB,dB):e(EC(n),EC(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Qu(t)}function Mv(){var e=Tv(tx());return e.copy=function(){return jp(e,Mv()).exponent(e.exponent())},ls.apply(e,arguments),e}function hB(){return Mv.apply(null,arguments).exponent(.5)}function eT(){var e=[],t=[],n=[],i;function r(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=Nk(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[xu(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Tc),r()},o.range=function(s){return arguments.length?(t=Array.from(s),r()):t.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return eT().domain(e).range(t).unknown(i)},ls.apply(o,arguments)}function tT(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[xu(i,u,0,n)]:o}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},s.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},s.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},s.unknown=function(u){return arguments.length&&(o=u),s},s.thresholds=function(){return i.slice()},s.copy=function(){return tT().domain([e,t]).range(r).unknown(o)},ls.apply(Qu(s),arguments)}function pB(e){return new Date(e)}function gB(e){return e instanceof Date?+e:+new Date(+e)}function Ov(e,t,n,i,r,o,s,a,u,l){var c=U8(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),v=l("%Y");function A(w){return(u(w)<w?h:a(w)<w?p:s(w)<w?g:o(w)<w?m:i(w)<w?r(w)<w?y:b:n(w)<w?x:v)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?d(Array.from(w,gB)):d().map(pB)},c.ticks=function(w){var E=d();return e(E[0],E[E.length-1],w??10)},c.tickFormat=function(w,E){return E==null?A:l(E)},c.nice=function(w){var E=d();return(!w||typeof w.range!="function")&&(w=t(E[0],E[E.length-1],w??10)),w?d(J3(E,w)):c},c.copy=function(){return jp(c,Ov(e,t,n,i,r,o,s,a,u,l))},c}function mB(){return ls.apply(Ov(eL,tL,yr,Mc,nl,eo,Qp,Kp,Kr,wx).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function yB(){return ls.apply(Ov(Q9,Z9,br,Oc,il,Ho,Zp,Jp,Kr,Cx).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yg(){var e=0,t=1,n,i,r,o,s=Ro,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:s(r===0?.5:(f=(o(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),i=o(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),l):[s(0),s(1)]}}return l.range=c(lf),l.rangeRound=c(Up),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function fs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Rv(){var e=Qu(yg()(Ro));return e.copy=function(){return fs(e,Rv())},cs.apply(e,arguments)}function nT(){var e=kv(yg()).domain([1,10]);return e.copy=function(){return fs(e,nT()).base(e.base())},cs.apply(e,arguments)}function iT(){var e=Dv(yg());return e.copy=function(){return fs(e,iT()).constant(e.constant())},cs.apply(e,arguments)}function Nv(){var e=Tv(yg());return e.copy=function(){return fs(e,Nv()).exponent(e.exponent())},cs.apply(e,arguments)}function bB(){return Nv.apply(null,arguments).exponent(.5)}function bg(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=Ro,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-o)*(i*g<i*o?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),o=c(t=+t),s=c(n=+n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,x;return arguments.length?([y,b,x]=m,l=Fv(g,[y,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=p(lf),h.rangeRound=p(Up),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),o=g(t),s=g(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function rT(){var e=Qu(bg()(Ro));return e.copy=function(){return fs(e,rT())},cs.apply(e,arguments)}function oT(){var e=kv(bg()).domain([.1,1,10]);return e.copy=function(){return fs(e,oT()).base(e.base())},cs.apply(e,arguments)}function sT(){var e=Dv(bg());return e.copy=function(){return fs(e,sT()).constant(e.constant())},cs.apply(e,arguments)}function Lv(){var e=Tv(bg());return e.copy=function(){return fs(e,Lv()).exponent(e.exponent())},cs.apply(e,arguments)}function xB(){return Lv.apply(null,arguments).exponent(.5)}function Sr(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const vB=Sr("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),EB=Sr("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),AB=Sr("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),wB=Sr("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),CB=Sr("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),SB=Sr("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),_B=Sr("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),$B=Sr("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),FB=Sr("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),kB=Sr("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Pv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const DB="identity",_u="linear",uo="log",gf="pow",mf="sqrt",xg="symlog",ta="time",na="utc",dr="sequential",al="diverging",$u="quantile",vg="quantize",Eg="threshold",Iv="ordinal",ly="point",aT="band",Bv="bin-ordinal",wt="continuous",yf="discrete",bf="discretizing",Ei="interpolating",zv="temporal";function TB(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function MB(e){return function(t){const n=e.range();let i=t[0],r=t[1],o=-1,s,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(o<0&&(o=u),s=u);if(!(o<0))return i=e.invertExtent(n[o]),r=e.invertExtent(n[s]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Uv(){const e=Sv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,o,s=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=Pv(f,a,u);let g=i[d-0];r=(h-g)/(p||1),s&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,o=r*(1-a),s&&(g=Math.round(g),o=Math.round(o));const m=Yn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,x;if(!(g!==g||m!==m)&&(m<g&&(x=g,g=m,m=x),!(m<h[0]||g>i[1-d])))return y=Math.max(0,xu(h,g)-1),b=g===m?y:xu(h,m)-1,g-h[y]>o+1e-10&&++y,d&&(x=y,y=p-b,b=p-x),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Uv().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function uT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return uT(t())},e}function OB(){return uT(Uv().paddingInner(1))}var RB=Array.prototype.map;function NB(e){return RB.call(e,en)}const LB=Array.prototype.slice;function lT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(xu(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=NB(i),n):e.slice()},n.range=function(i){return arguments.length?(t=LB.call(i),n):t.slice()},n.tickFormat=function(i,r){return W8(e[0],Se(e),i??10,r)},n.copy=function(){return lT().domain(n.domain()).range(n.range())},n}const $h=new Map,cT=Symbol("vega_scale");function fT(e){return e[cT]=!0,e}function AC(e){return e&&e[cT]===!0}function PB(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?TB(o):o.invertExtent?MB(o):void 0),o.type=e,fT(o)};return i.metadata=Pi(re(n)),i}function Oe(e,t,n){return arguments.length>1?($h.set(e,PB(e,t,n)),this):dT(e)?$h.get(e):void 0}Oe(DB,K3);Oe(_u,j8,wt);Oe(uo,Q3,[wt,uo]);Oe(gf,Mv,wt);Oe(mf,hB,wt);Oe(xg,Z3,wt);Oe(ta,mB,[wt,zv]);Oe(na,yB,[wt,zv]);Oe(dr,Rv,[wt,Ei]);Oe(`${dr}-${_u}`,Rv,[wt,Ei]);Oe(`${dr}-${uo}`,nT,[wt,Ei,uo]);Oe(`${dr}-${gf}`,Nv,[wt,Ei]);Oe(`${dr}-${mf}`,bB,[wt,Ei]);Oe(`${dr}-${xg}`,iT,[wt,Ei]);Oe(`${al}-${_u}`,rT,[wt,Ei]);Oe(`${al}-${uo}`,oT,[wt,Ei,uo]);Oe(`${al}-${gf}`,Lv,[wt,Ei]);Oe(`${al}-${mf}`,xB,[wt,Ei]);Oe(`${al}-${xg}`,sT,[wt,Ei]);Oe($u,eT,[bf,$u]);Oe(vg,tT,bf);Oe(Eg,q8,bf);Oe(Bv,lT,[yf,bf]);Oe(Iv,Sv,yf);Oe(aT,Uv,yf);Oe(ly,OB,yf);function dT(e){return $h.has(e)}function _a(e,t){const n=$h.get(e);return n&&n.metadata[t]}function jv(e){return _a(e,wt)}function Fu(e){return _a(e,yf)}function cy(e){return _a(e,bf)}function hT(e){return _a(e,uo)}function IB(e){return _a(e,zv)}function pT(e){return _a(e,Ei)}function gT(e){return _a(e,$u)}const BB=["clamp","base","constant","exponent"];function mT(e,t){const n=t[0],i=Se(t)-n;return function(r){return e(n+r*i)}}function Ag(e,t,n){return Fv(qv(t||"rgb",n),e)}function yT(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function bT(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?ln(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=Oe(o)().domain([t,n]).range([0,1]),BB.forEach(a=>e[a]?s[a](e[a]()):0),s)}function qv(e,t){const n=oB[zB(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function zB(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const UB={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"},jB={accent:EB,category10:vB,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:AB,observable10:wB,paired:CB,pastel1:SB,pastel2:_B,set1:$B,set2:FB,set3:kB,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function xT(e){if(Z(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function vT(e,t){for(const n in e)Wv(n,t(e[n]))}const wC={};vT(jB,xT);vT(UB,e=>Ag(xT(e)));function Wv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(wC[e]=t,this):wC[e]}const jd="symbol",qB="discrete",WB="gradient",HB=e=>Z(e)?e.map(t=>String(t)):String(e),GB=(e,t)=>e[1]-t[1],YB=(e,t)=>t[1]-e[1];function Hv(e,t,n){let i;return Ko(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(ff(e.domain())/n||1)+1))),ce(t)&&(i=t.step,t=t.interval),_e(t)&&(t=e.type===ta?rl(t):e.type==na?ol(t):O("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function ET(e,t,n){let i=e.range(),r=i[0],o=Se(i),s=GB;if(r>o&&(i=o,o=r,r=i,s=YB),r=Math.floor(r),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Se(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Gv(e,t){return e.bins?ET(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function AT(e,t,n,i,r,o){const s=t.type;let a=HB;if(s===ta||r===ta)a=e.timeFormat(i);else if(s===na||r===na)a=e.utcFormat(i);else if(hT(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=wT(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function wT(e,t,n){const i=Gv(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/o));return l*r<r-.5&&(l*=r),l<=s};return n?i.filter(a):a}const fy={[$u]:"quantiles",[vg]:"thresholds",[Eg]:"domain"},CT={[$u]:"quantiles",[vg]:"domain"};function ST(e,t){return e.bins?KB(e.bins):e.type===uo?wT(e,t,!0):fy[e.type]?XB(e[fy[e.type]]()):Gv(e,t)}function VB(e,t,n){const i=t[CT[t.type]](),r=i.length;let o=r>1?i[1]-i[0]:i[0],s;for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,30,n)}function XB(e){const t=[-1/0].concat(e);return t.max=1/0,t}function KB(e){const t=e.slice(0,-1);return t.max=Se(e),t}const JB=e=>fy[e.type]||e.bins;function _T(e,t,n,i,r,o,s){const a=CT[t.type]&&o!==ta&&o!==na?VB(e,t,r):AT(e,t,n,r,o,s);return i===jd&&JB(t)?QB(a):i===qB?ZB(a):ez(a)}const QB=e=>(t,n,i)=>{const r=CC(i[n+1],CC(i.max,1/0)),o=SC(t,e),s=SC(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},CC=(e,t)=>e??t,ZB=e=>(t,n)=>n?e(t):null,ez=e=>t=>e(t),SC=(e,t)=>Number.isFinite(e)?t(e):null;function tz(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Se(t),o=r-i;if(e.type===Eg){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function nz(e,t,n,i){const r=i||t.type;return _e(n)&&IB(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===ta?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===na?e.utcFormat("%A, %d %B %Y, %X UTC"):_T(e,t,5,null,n,i,!0)}function $T(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=nz(e,t,n.format,n.formatType);if(cy(t.type)){const o=ST(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(Fu(t.type)){const o=t.domain(),s=o.length,a=s>i?o.slice(0,i-2).map(r).join(", ")+", ending with "+o.slice(-1).map(r):o.map(r).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${r(o[0])} to ${r(Se(o))}`}}let FT=0;function iz(){FT=0}const Fh="p_";function Yv(e){return e&&e.gradient}function kT(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Fh:"";return r||(r=e.id="gradient_"+FT++,i==="radial"?(e.x1=er(e.x1,.5),e.y1=er(e.y1,.5),e.r1=er(e.r1,0),e.x2=er(e.x2,.5),e.y2=er(e.y2,.5),e.r2=er(e.r2,.5),o=Fh):(e.x1=er(e.x1,0),e.y1=er(e.y1,0),e.x2=er(e.x2,1),e.y2=er(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function er(e,t){return e??t}function DT(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const _C={basis:{curve:FI},"basis-closed":{curve:kI},"basis-open":{curve:DI},bundle:{curve:TI,tension:"beta",value:.85},cardinal:{curve:MI,tension:"tension",value:0},"cardinal-open":{curve:RI,tension:"tension",value:0},"cardinal-closed":{curve:OI,tension:"tension",value:0},"catmull-rom":{curve:NI,tension:"alpha",value:.5},"catmull-rom-closed":{curve:LI,tension:"alpha",value:.5},"catmull-rom-open":{curve:PI,tension:"alpha",value:.5},linear:{curve:vv},"linear-closed":{curve:II},monotone:{horizontal:zI,vertical:BI},natural:{curve:UI},step:{curve:jI},"step-after":{curve:WI},"step-before":{curve:qI}};function Vv(e,t,n){var i=ue(_C,e)&&_C[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const rz={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},oz=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,sz=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,az=/^((\s+,?\s*)|(,\s*))/,uz=/^[01]/;function ku(e){const t=[];return(e.match(oz)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=rz[o],a=lz(o,s,i.slice(1).trim()),u=a.length;if(u<s||u&&u%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,s)]),u!==s){o==="m"&&(r=r==="M"?"L":"l");for(let l=s;l<u;l+=s)t.push([r,...a.slice(l,l+s)])}}),t}function lz(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?uz:sz,a=n.slice(r).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(az);u!==null&&(r+=u[0].length)}return i}const Zo=Math.PI/180,cz=1e-14,Is=Math.PI/2,sr=Math.PI*2,Wa=Math.sqrt(3)/2;var ym={},bm={},TT=[].join;function fz(e,t,n,i,r,o,s,a,u){const l=TT.call(arguments);if(ym[l])return ym[l];const c=s*Zo,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,x=d/i,v=m*a+y*u,A=b*a+x*u,w=m*e+y*t,E=b*e+x*t;let S=1/((w-v)*(w-v)+(E-A)*(E-A))-.25;S<0&&(S=0);let $=Math.sqrt(S);o==r&&($=-$);const k=.5*(v+w)-$*(E-A),L=.5*(A+E)+$*(w-v),T=Math.atan2(A-L,v-k);let _=Math.atan2(E-L,w-k)-T;_<0&&o===1?_+=sr:_>0&&o===0&&(_-=sr);const D=Math.ceil(Math.abs(_/(Is+.001))),P=[];for(let B=0;B<D;++B){const I=T+B*_/D,Y=T+(B+1)*_/D;P[B]=[k,L,I,Y,n,i,f,d]}return ym[l]=P}function dz(e){const t=TT.call(e);if(bm[t])return bm[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7];const c=l*s,f=-u*a,d=u*s,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(o),y=Math.sin(o),b=.5*(o-r),x=Math.sin(b*.5),v=8/3*x*x/Math.sin(b),A=n+p-v*g,w=i+g+v*p,E=n+m,C=i+y,S=E+v*y,$=C-v*m;return bm[t]=[c*A+f*w,d*A+h*w,c*S+f*$,d*S+h*$,c*E+f*C,d*E+h*C]}const ri=["l",0,0,0,0,0,0,0];function hz(e,t,n){const i=ri[0]=e[0];if(i==="a"||i==="A")ri[1]=t*e[1],ri[2]=n*e[2],ri[3]=e[3],ri[4]=e[4],ri[5]=e[5],ri[6]=t*e[6],ri[7]=n*e[7];else if(i==="h"||i==="H")ri[1]=t*e[1];else if(i==="v"||i==="V")ri[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)ri[r]=(r%2==1?t:n)*e[r];return ri}function Ic(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),o==null&&(o=r),e.beginPath&&e.beginPath();for(var b=0,x=t.length;b<x;++b){switch(s=t[b],(r!==1||o!==1)&&(s=hz(s,r,o)),s[0]){case"l":u+=s[1],l+=s[2],e.lineTo(u+n,l+i);break;case"L":u=s[1],l=s[2],e.lineTo(u+n,l+i);break;case"h":u+=s[1],e.lineTo(u+n,l+i);break;case"H":u=s[1],e.lineTo(u+n,l+i);break;case"v":l+=s[1],e.lineTo(u+n,l+i);break;case"V":l=s[1],e.lineTo(u+n,l+i);break;case"m":u+=s[1],l+=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=s[1],l=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+s[5],h=l+s[6],c=u+s[3],f=l+s[4],e.bezierCurveTo(u+s[1]+n,l+s[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=s[5],l=s[6],c=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+s[3],h=l+s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+s[1]+n,l+s[2]+i,d+n,h+i),c=u+s[1],f=l+s[2],u=d,l=h;break;case"S":d=s[3],h=s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"q":d=u+s[3],h=l+s[4],c=u+s[1],f=l+s[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"t":d=u+s[1],h=l+s[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+s[1],f=l+s[2];break;case"T":d=s[1],h=s[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":$C(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+n,s[7]+l+i]),u+=s[6],l+=s[7];break;case"A":$C(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),u=s[6],l=s[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=s}}function $C(e,t,n,i){const r=fz(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const s=dz(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const FC=.5773502691896257,kC={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,sr)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n,r=i-n*FC,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n,r=i-n*FC;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Wa*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function MT(e){return ue(kC,e)?kC[e]:pz(e)}var xm={};function pz(e){if(!ue(xm,e)){const t=ku(e);xm[e]={draw:function(n,i){Ic(n,t,0,0,Math.sqrt(i)/2)}}}return xm[e]}const Co=.448084975506;function gz(e){return e.x}function mz(e){return e.y}function yz(e){return e.width}function bz(e){return e.height}function Ir(e){return typeof e=="function"?e:()=>+e}function ud(e,t,n){return Math.max(t,Math.min(e,n))}function OT(){var e=gz,t=mz,n=yz,i=bz,r=Ir(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,x=ud(+r.call(this,c),0,b),v=ud(+o.call(this,c),0,b),A=ud(+s.call(this,c),0,b),w=ud(+a.call(this,c),0,b);if(u||(u=h=ox()),x<=0&&v<=0&&A<=0&&w<=0)u.rect(p,g,m,y);else{var E=p+m,C=g+y;u.moveTo(p+x,g),u.lineTo(E-v,g),u.bezierCurveTo(E-Co*v,g,E,g+Co*v,E,g+v),u.lineTo(E,C-w),u.bezierCurveTo(E,C-Co*w,E-Co*w,C,E-w,C),u.lineTo(p+A,C),u.bezierCurveTo(p+Co*A,C,p,C-Co*A,p,C-A),u.lineTo(p,g+x),u.bezierCurveTo(p,g+Co*x,p+Co*x,g,p+x,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Ir(c),l):e},l.y=function(c){return arguments.length?(t=Ir(c),l):t},l.width=function(c){return arguments.length?(n=Ir(c),l):n},l.height=function(c){return arguments.length?(i=Ir(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Ir(c),o=f!=null?Ir(f):r,a=d!=null?Ir(d):r,s=h!=null?Ir(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function RT(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,x=(m/=y)*u,v=Math.atan2(m,g);r.moveTo(s-b,a-x),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,v-Math.PI,v),r.lineTo(s+b,a+x),r.arc(s,a,u,v,v+Math.PI)}else r.arc(f,d,p,0,sr);r.closePath()}else o=1;s=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=ox()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(o=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function xf(e,t){return e??t}const vf=e=>e.x||0,Ef=e=>e.y||0,xz=e=>e.width||0,vz=e=>e.height||0,Ez=e=>(e.x||0)+(e.width||0),Az=e=>(e.y||0)+(e.height||0),wz=e=>e.startAngle||0,Cz=e=>e.endAngle||0,Sz=e=>e.padAngle||0,_z=e=>e.innerRadius||0,$z=e=>e.outerRadius||0,Fz=e=>e.cornerRadius||0,kz=e=>xf(e.cornerRadiusTopLeft,e.cornerRadius)||0,Dz=e=>xf(e.cornerRadiusTopRight,e.cornerRadius)||0,Tz=e=>xf(e.cornerRadiusBottomRight,e.cornerRadius)||0,Mz=e=>xf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,Oz=e=>xf(e.size,64),Rz=e=>e.size||1,wg=e=>e.defined!==!1,Nz=e=>MT(e.shape||"circle"),Lz=SI().startAngle(wz).endAngle(Cz).padAngle(Sz).innerRadius(_z).outerRadius($z).cornerRadius(Fz),Pz=_3().x(vf).y1(Ef).y0(Az).defined(wg),Iz=_3().y(Ef).x1(vf).x0(Ez).defined(wg),Bz=S3().x(vf).y(Ef).defined(wg),zz=OT().x(vf).y(Ef).width(xz).height(vz).cornerRadius(kz,Dz,Tz,Mz),Uz=$I().type(Nz).size(Oz),jz=RT().x(vf).y(Ef).defined(wg).size(Rz);function Xv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function qz(e,t){return Lz.context(e)(t)}function Wz(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?Iz:Pz).curve(Vv(i,n.orient,n.tension)).context(e)(t)}function Hz(e,t){const n=t[0],i=n.interpolate||"linear";return Bz.curve(Vv(i,n.orient,n.tension)).context(e)(t)}function ul(e,t,n,i){return zz.context(e)(t,n,i)}function Gz(e,t){return(t.mark.shape||t.shape).context(e)(t)}function Yz(e,t){return Uz.context(e)(t)}function Vz(e,t){return jz.context(e)(t)}var NT=1;function Xz(){NT=1}function Kv(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+NT++),s=r.clipping[o]||(r.clipping[o]={id:o});return ye(i)?s.path=i(null):Xv(n)?s.path=ul(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function mt(e){this.clear(),e&&this.union(e)}mt.prototype={clone(){return new mt(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,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*s+l,u*i+a*s+c,a*o-u*r+l,u*o+a*r+c,a*o-u*s+l,u*o+a*s+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Cg(e){this.mark=e,this.bounds=this.bounds||new mt}function Sg(e){Cg.call(this,e),this.items=this.items||[]}H(Sg,Cg);class LT{constructor(t){this._pending=0,this._loader=t||tg()}pending(){return this._pending}sanitizeURL(t){const n=this;return DC(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Ol(n),i)).catch(()=>(Ol(n),null))}loadImage(t){const n=this,i=HI();return DC(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=ue(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>Ol(n),s.onerror=()=>Ol(n),s.src=o,s}).catch(r=>(Ol(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function DC(e){e._pending+=1}function Ol(e){e._pending-=1}function po(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?Kz(t,i):0))}return e}function Kz(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const Jz=sr-1e-8;let _g,qd,Wd,qs,dy,Hd,hy,py;const No=(e,t)=>_g.add(e,t),Gd=(e,t)=>No(qd=e,Wd=t),TC=e=>No(e,_g.y1),MC=e=>No(_g.x1,e),Bs=(e,t)=>dy*e+hy*t,zs=(e,t)=>Hd*e+py*t,vm=(e,t)=>No(Bs(e,t),zs(e,t)),Em=(e,t)=>Gd(Bs(e,t),zs(e,t));function Af(e,t){return _g=e,t?(qs=t*Zo,dy=py=Math.cos(qs),Hd=Math.sin(qs),hy=-Hd):(dy=py=1,qs=Hd=hy=0),Qz}const Qz={beginPath(){},closePath(){},moveTo:Em,lineTo:Em,rect(e,t,n,i){qs?(vm(e+n,t),vm(e+n,t+i),vm(e,t+i),Em(e,t)):(No(e+n,t+i),Gd(e,t))},quadraticCurveTo(e,t,n,i){const r=Bs(e,t),o=zs(e,t),s=Bs(n,i),a=zs(n,i);OC(qd,r,s,TC),OC(Wd,o,a,MC),Gd(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=Bs(e,t),a=zs(e,t),u=Bs(n,i),l=zs(n,i),c=Bs(r,o),f=zs(r,o);RC(qd,s,u,c,TC),RC(Wd,a,l,f,MC),Gd(c,f)},arc(e,t,n,i,r,o){if(i+=qs,r+=qs,qd=n*Math.cos(r)+e,Wd=n*Math.sin(r)+t,Math.abs(r-i)>Jz)No(e-n,t-n),No(e+n,t+n);else{const s=l=>No(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%sr,i<0&&(i+=sr),r=r%sr,r<0&&(r+=sr),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=sr,a=i-i%Is,u=0;u<4&&a>r;++u,a-=Is)s(a);else for(a=i-i%Is+Is,u=0;u<4&&a<r;++u,a=a+Is)s(a)}}};function OC(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function RC(e,t,n,i,r){const o=i-e+3*t-3*n,s=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(o)>cz?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),u=(-s+c)/o,l=(-s-c)/o)):u=.5*a/s,0<u&&u<1&&r(NC(u,e,t,n,i)),0<l&&l<1&&r(NC(l,e,t,n,i))}function NC(e,t,n,i,r){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*i+a*e*r}var Vo=(Vo=Yo(1,1))?Vo.getContext("2d"):null;const gy=new mt;function Jv(e){return function(t,n){if(!Vo)return!0;e(Vo,t),gy.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=gy;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Vo.isPointInPath(u,a))return!0;return!1}}function Qv(e,t){return t.contains(e.x||0,e.y||0)}function PT(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(gy.set(n,i,n+r,i+o))}function IT(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:i;return ru(t,n,i,r,o)}function ru(e,t,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(o-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(s-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function Du(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Si(e,t){return e??t}function LC(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Zz(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+Si(t.x1,.5)*i,n.y1+Si(t.y1,.5)*r,Math.max(i,r)*Si(t.r1,0),n.x1+Si(t.x2,.5)*i,n.y1+Si(t.y2,.5)*r,Math.max(i,r)*Si(t.r2,.5));else{const s=Si(t.x1,0),a=Si(t.y1,0),u=Si(t.x2,1),l=Si(t.y2,0);if(s===u||a===l||i===r)o=e.createLinearGradient(n.x1+s*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=Yo(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=LC(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return LC(o,t.stops)}function BT(e,t,n){return Yv(n)?Zz(e,n,t.bounds):n}function kh(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=BT(e,t,t.fill),!0):!1}var eU=[];function Tu(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=BT(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||eU),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function tU(e,t){return e.zindex-t.zindex||e.index-t.index}function Zv(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(tU)}function Bi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=Zv(e);if(o&&o.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=o}for(i=0,r=n.length;i<r;++i)t(n[i])}function Dh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=Zv(e);for(o&&o.length&&(n=o),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===o){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function e2(e){return function(t,n,i){Bi(n,r=>{(!i||i.intersects(r.bounds))&&zT(e,t,r,r)})}}function nU(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&zT(e,t,n.items[0],n.items)}}function zT(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Du(t,n),n.fill&&kh(t,n,r)&&t.fill(),n.stroke&&Tu(t,n,r)&&t.stroke()))}function $g(e){return e=e||gi,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Dh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function wf(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t??s.fill,u=s.stroke&&n.isPointInStroke,l,c;return u&&(l=s.strokeWidth,c=s.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function t2(e){return $g(wf(e))}function Ys(e,t){return"translate("+e+","+t+")"}function n2(e){return"rotate("+e+")"}function iU(e,t){return"scale("+e+","+t+")"}function UT(e){return Ys(e.x||0,e.y||0)}function rU(e){return Ys(e.x||0,e.y||0)+(e.angle?" "+n2(e.angle):"")}function oU(e){return Ys(e.x||0,e.y||0)+(e.angle?" "+n2(e.angle):"")+(e.scaleX||e.scaleY?" "+iU(e.scaleX||1,e.scaleY||1):"")}function i2(e,t,n){function i(s,a){s("transform",rU(a)),s("d",t(null,a))}function r(s,a){return t(Af(s,a.angle),a),po(s,a).translate(a.x||0,a.y||0)}function o(s,a){var u=a.x||0,l=a.y||0,c=a.angle||0;s.translate(u,l),c&&s.rotate(c*=Zo),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:e2(o),pick:t2(o),isect:n||Jv(o)}}var sU=i2("arc",qz);function aU(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=1/0,s,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<o&&(o=a,s=e[r]));return s}function uU(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,o,s;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],o=e[i].y-t[1],s=r*r+o*o,s<n))return e[i];return null}function lU(e,t){for(var n=e.length,i,r,o;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],o=i*i+r*r,i=e[n].size||1,o<i*i))return e[n];return null}function r2(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Af(u),c),po(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=wf(o);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:nU(o),pick:a,isect:Qv,tip:n}}var cU=r2("area",Wz,aU);function fU(e,t){var n=t.clip;e.save(),ye(n)?(e.beginPath(),n(e),e.clip()):jT(e,t.group)}function jT(e,t){e.beginPath(),Xv(t)?ul(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function qT(e){const t=Si(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function dU(e,t){e("transform",UT(t))}function WT(e,t){const n=qT(t);e("d",ul(null,t,n,n))}function hU(e,t){e("class","background"),e("aria-hidden",!0),WT(e,t)}function pU(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?WT(e,t):e("d","")}function gU(e,t,n){const i=t.clip?Kv(n,t,t):null;e("clip-path",i)}function mU(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),po(e,t),e.translate(t.x||0,t.y||0)}function Bc(e,t,n,i){const r=qT(t);e.beginPath(),ul(e,t,(n||0)+r,(i||0)+r)}const yU=wf(Bc),bU=wf(Bc,!1),xU=wf(Bc,!0);function vU(e,t,n,i){Bi(t,r=>{const o=r.x||0,s=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Bc(e,r,o,s),Du(e,r),r.fill&&kh(e,r,u)&&e.fill(),r.stroke&&!a&&Tu(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&jT(e,r),n&&n.translate(-o,-s),Bi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(o,s),e.restore(),a&&r.stroke&&u&&(Bc(e,r,o,s),Du(e,r),Tu(e,r,u)&&e.stroke())})}function EU(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const s=n*e.pixelRatio,a=i*e.pixelRatio;return Dh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,g&&Xv(u)&&!xU(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&bU(e,u,s,a)?(e.restore(),u):(l=Dh(u,b=>AU(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&yU(e,u,s,a)&&(l=u),e.restore(),l||null)})}function AU(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var wU={type:"group",tag:"g",nested:!1,attr:dU,bound:mU,draw:vU,pick:EU,isect:PT,content:gU,background:hU,foreground:pU},zc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function o2(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(i=>{e.image=i,e.image.url=e.url})),n}function s2(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function a2(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Fg(e,t){return e==="center"?t/2:e==="right"?t:0}function kg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function CU(e,t,n){const i=o2(t,n),r=s2(t,i),o=a2(t,i),s=(t.x||0)-Fg(t.align,r),a=(t.y||0)-kg(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,zc["xmlns:xlink"],"xlink:href"),e("transform",Ys(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function SU(e,t){const n=t.image,i=s2(t,n),r=a2(t,n),o=(t.x||0)-Fg(t.align,i),s=(t.y||0)-kg(t.baseline,r);return e.set(o,s,o+i,s+r)}function _U(e,t,n){Bi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=o2(i,this);let o=s2(i,r),s=a2(i,r);if(o===0||s===0)return;let a=(i.x||0)-Fg(i.align,o),u=(i.y||0)-kg(i.baseline,s),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(s-d)/2,s=d):(d=s*c,a+=(o-d)/2,o=d))),(r.complete||r.toDataURL)&&(Du(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var $U={type:"image",tag:"image",nested:!1,attr:CU,bound:SU,draw:_U,pick:$g(),isect:gi,get:o2,xOffset:Fg,yOffset:kg},FU=r2("line",Hz,uU);function kU(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",oU(t)),e("d",t.path)}function Yd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*Zo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=ku(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),Ic(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):Ic(e,u,i,r,o,s)}function DU(e,t){return Yd(Af(e,t.angle),t)?e.set(0,0,0,0):po(e,t,!0)}var TU={type:"path",tag:"path",nested:!1,attr:kU,bound:DU,draw:e2(Yd),pick:t2(Yd),isect:Jv(Yd)};function MU(e,t){e("d",ul(null,t))}function OU(e,t){var n,i;return po(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function PC(e,t){e.beginPath(),ul(e,t)}var RU={type:"rect",tag:"path",nested:!1,attr:MU,bound:OU,draw:e2(PC),pick:t2(PC),isect:PT};function NU(e,t){e("transform",UT(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function LU(e,t){var n,i;return po(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function HT(e,t,n){var i,r,o,s;return t.stroke&&Tu(e,t,n)?(i=t.x||0,r=t.y||0,o=t.x2!=null?t.x2:i,s=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,s),!0):!1}function PU(e,t,n){Bi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&HT(e,i,r)&&(Du(e,i),e.stroke())}})}function IU(e,t,n,i){return e.isPointInStroke?HT(e,t,1)&&e.isPointInStroke(n,i):!1}var BU={type:"rule",tag:"line",nested:!1,attr:NU,bound:LU,draw:PU,pick:$g(IU),isect:IT},zU=i2("shape",Gz),UU=i2("symbol",Yz,Qv);const IC=Ck();var Kn={height:_r,measureWidth:u2,estimateWidth:Th,width:Th,canvas:GT};GT(!0);function GT(e){Kn.width=e&&Vo?u2:Th}function Th(e,t){return YT(ts(e,t),_r(e))}function YT(e,t){return~~(.8*e.length*t)}function u2(e,t){return _r(e)<=0||!(t=ts(e,t))?0:VT(t,Dg(e))}function VT(e,t){const n=`(${t}) ${e}`;let i=IC.get(n);return i===void 0&&(Vo.font=t,i=Vo.measureText(e).width,IC.set(n,i)),i}function _r(e){return e.fontSize!=null?+e.fontSize||0:11}function es(e){return e.lineHeight!=null?e.lineHeight:_r(e)+2}function jU(e){return Z(e)?e.length>1?e:e[0]:e}function Cf(e){return jU(e.lineBreak&&e.text&&!Z(e.text)?e.text.split(e.lineBreak):e.text)}function l2(e){const t=Cf(e);return(Z(t)?t.length-1:0)*es(e)}function ts(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?WU(e,n):n}function qU(e){if(Kn.width===u2){const t=Dg(e);return n=>VT(n,t)}else if(Kn.width===Th){const t=_r(e);return n=>YT(n,t)}else return t=>Kn.width(e,t)}function WU(e,t){var n=+e.limit,i=qU(e);if(i(t)<n)return t;var r=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,u;if(n-=i(r),o){for(;s<a;)u=s+a>>>1,i(t.slice(u))>n?s=u+1:a=u;return r+t.slice(s)}else{for(;s<a;)u=1+(s+a>>>1),i(t.slice(0,u))<n?s=u:a=u-1;return t.slice(0,s)+r}}function Sf(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Dg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+_r(e)+"px "+Sf(e,t)}function c2(e){var t=e.baseline,n=_r(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*es(e):t==="line-bottom"?.29*n-.5*es(e):0)}const HU={left:"start",center:"middle",right:"end"},mc=new mt;function Tg(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Is,t+=i*Math.cos(r),n+=i*Math.sin(r)),mc.x1=t,mc.y1=n,mc}function GU(e,t){var n=t.dx||0,i=(t.dy||0)+c2(t),r=Tg(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",HU[t.align]||"start"),a?(u=Ys(o,s)+" "+n2(a),(n||i)&&(u+=" "+Ys(n,i))):u=Ys(o+n,s+i),e("transform",u)}function f2(e,t,n){var i=Kn.height(t),r=t.align,o=Tg(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+c2(t)-Math.round(.8*i),c=Cf(t),f;if(Z(c)?(i+=es(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Kn.width(t,h)),0)):f=Kn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=s,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Zo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Zo,s,a);return e}function YU(e,t,n){Bi(t,i=>{var r=i.opacity==null?1:i.opacity,o,s,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Dg(i),e.textAlign=i.align||"left",o=Tg(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Zo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+c2(i),c=Cf(i),Du(e,i),Z(c))for(l=es(i),u=0;u<c.length;++u)f=ts(i,c[u]),i.fill&&kh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Tu(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=ts(i,c),i.fill&&kh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Tu(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function VU(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Tg(t),a=s.x1,u=s.y1,l=f2(mc,t,1),c=-t.angle*Zo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),p=d*r+f*o+(u-d*a-f*u);return l.contains(h,p)}function XU(e,t){const n=f2(mc,e,2);return ru(t,n[0],n[1],n[2],n[3])||ru(t,n[0],n[1],n[4],n[5])||ru(t,n[4],n[5],n[6],n[7])||ru(t,n[2],n[3],n[6],n[7])}var KU={type:"text",tag:"text",nested:!1,attr:GU,bound:f2,draw:YU,pick:$g(VU),isect:XU},JU=r2("trail",Vz,lU),ni={arc:sU,area:cU,group:wU,image:$U,line:FU,path:TU,rect:RU,rule:BU,shape:zU,symbol:UU,text:KU,trail:JU};function my(e,t,n){var i=ni[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new mt),e,n)}var BC={mark:null};function XT(e,t,n){var i=ni[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(BC.mark=e,l=BC),c=my(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new mt,s)for(a=0,u=o.length;a<u;++a)t.union(my(o[a],r,n));return e.bounds=t}const QU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function KT(e,t){return JSON.stringify(e,QU,t)}function JT(e){const t=typeof e=="string"?JSON.parse(e):e;return QT(t)}function QT(e){var t=e.marktype,n=e.items,i,r,o;if(n)for(r=0,o=n.length;r<o;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&QT(n[r]);return t&&XT(e),e}class ZT{constructor(t){arguments.length?this.root=JT(t):(this.root=zC({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Sg(this.root)])}toJSON(t){return KT(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=zC(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function zC(e,t){const n={bounds:new mt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Lo(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function d2(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function bt(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=Lo(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function si(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function eM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Mg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function ZU(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=ni[r.marktype]).tip){for(s=Mg(t,n),s[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(r.items,s)}return e}let h2=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||tg(),this._tooltip=n||ej}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(t.type,t),s=Lo(null,"a");for(const a in r)s.setAttribute(a,r[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=ZU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=t.bounds,s=o.width(),a=o.height();let u=o.x1+r[0]+i.left,l=o.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:s,height:a,left:u,top:l,right:u+s,bottom:l+a}}};function ej(e,t,n,i){e.element().setAttribute("title",i||"")}class _f{constructor(t){this._el=null,this._bgcolor=null,this._loader=new LT(t)}initialize(t,n,i,r,o){return this._el=t,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const tj="keydown",nj="keypress",ij="keyup",tM="dragenter",Vd="dragleave",nM="dragover",yy="pointerdown",rj="pointerup",Mh="pointermove",Xd="pointerout",iM="pointerover",by="mousedown",oj="mouseup",rM="mousemove",Oh="mouseout",oM="mouseover",Rh="click",sj="dblclick",aj="wheel",sM="mousewheel",Nh="touchstart",Lh="touchmove",Ph="touchend",uj=[tj,nj,ij,tM,Vd,nM,yy,rj,Mh,Xd,iM,by,oj,rM,Oh,oM,Rh,sj,aj,sM,Nh,Lh,Ph],xy=Mh,yc=Oh,vy=Rh;class $f extends h2{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=uj,this.pointermove=jC([Mh,rM],[iM,oM],[Xd,Oh]),this.dragover=jC([nM],[tM],[Vd]),this.pointerout=qC([Xd,Oh]),this.dragleave=qC([Vd])}initialize(t,n,i){return this._canvas=t&&d2(t,"canvas"),[Rh,by,yy,Mh,Xd,Vd].forEach(r=>UC(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(sM,t)}pointerdown(t){this._down=this._active,this.fire(yy,t)}mousedown(t){this._down=this._active,this.fire(by,t)}click(t){this._down===this._active&&(this.fire(Rh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Nh,t,!0)}touchmove(t){this.fire(Lh,t,!0)}touchend(t){this.fire(Ph,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===vy&&r&&r.href?this.handleHref(n,r,r.href):(t===xy||t===yc)&&this.handleTooltip(n,r,t!==yc),o)for(let s=0,a=o.length;s<a;++s)o[s].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(UC(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&r.splice(o,1),this}pickEvent(t){const n=Mg(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,o){const s=this.context();return ni[t.marktype].pick.call(this,s,t,n,i,r,o)}}const lj=e=>e===Nh||e===Lh||e===Ph?[Nh,Lh,Ph]:[e];function UC(e,t){lj(t).forEach(n=>cj(e,n))}function cj(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function nc(e,t,n){t.forEach(i=>e.fire(i,n))}function jC(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?nc(this,e,i):((!r||!r.exit)&&nc(this,n,i),this._active=o,nc(this,t,i),nc(this,e,i))}}function qC(e){return function(t){nc(this,e,t),this._active=null}}function fj(){return typeof window<"u"&&window.devicePixelRatio||1}function dj(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?fj():r;e.width=t*u,e.height=n*u;for(const l in o)a[l]=o[l];return s&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Ih extends _f{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new mt,this._tempb=new mt}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Yo(1,1,this._options.type),t&&this._canvas&&(si(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,o)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)dj(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||O("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,a=this._dirty,u=hj(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):pj(i,u.intersect(a),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=ni[n.marktype];n.clip&&fU(t,n),o.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,i,r))}}const hj=(e,t,n)=>new mt().set(0,0,t,n).translate(-e[0],-e[1]);function pj(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}class aM extends h2{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Am(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Am(i,(r,o)=>{i.handleTooltip(r,o,r.type!==yc)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(vy,this._hrefHandler),r.removeEventListener(xy,this._tooltipHandler),r.removeEventListener(yc,this._tooltipHandler)),this._svg=r=t&&d2(t,"svg"),r&&(r.addEventListener(vy,this._hrefHandler),r.addEventListener(xy,this._tooltipHandler),r.addEventListener(yc,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const s={type:t,handler:n,listener:Am(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Am=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},uM="aria-hidden",p2="aria-label",g2="role",m2="aria-roledescription",lM="graphics-object",y2="graphics-symbol",cM=(e,t,n)=>({[g2]:e,[m2]:t,[p2]:n||void 0}),gj=Pi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),WC={axis:{desc:"axis",caption:bj},legend:{desc:"legend",caption:xj},"title-text":{desc:"title",caption:e=>`Title text '${GC(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${GC(e)}'`}},HC={ariaRole:g2,ariaRoleDescription:m2,description:p2};function fM(e,t){const n=t.aria===!1;if(e(uM,n||void 0),n||t.description==null)for(const i in HC)e(HC[i],void 0);else{const i=t.mark.marktype;e(p2,t.description),e(g2,t.ariaRole||(i==="group"?lM:y2)),e(m2,t.ariaRoleDescription||`${i} mark`)}}function dM(e){return e.aria===!1?{[uM]:!0}:gj[e.role]?null:WC[e.role]?yj(e,WC[e.role]):mj(e)}function mj(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return cM(n?lM:y2,`${t} mark container`,e.description)}function yj(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return cM(t.role||y2,t.desc,n.description||i(n))}catch{return null}}function GC(e){return re(e.text).join(" ")}function bj(e){const t=e.datum,n=e.orient,i=t.title?hM(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Fu(a)?"discrete":a} scale with ${$T(s,o,e)}`}function xj(e){const t=e.datum,n=t.title?hM(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return Ej(i)+(n?` titled '${n}'`:"")+` for ${vj(o)} with ${$T(u,a,e)}`}function hM(e){try{return re(Se(e.items).items[0].text).join(" ")}catch{return null}}function vj(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Se(e)}function Ej(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const pM=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Aj=e=>pM(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function b2(){let e="",t="",n="";const i=[],r=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},s=(u,l)=>(l!=null&&(t+=` ${u}="${Aj(l)}"`),a),a={open(u,...l){o(u),t="<"+u;for(const c of l)for(const f in c)s(f,c[f]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=pM(u),a),toString:()=>e};return a}const gM=e=>mM(b2(),e)+"";function mM(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):mM(e,i)}return e.close()}const Bh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},zh={blend:"mix-blend-mode"},yM={fill:"none","stroke-miterlimit":10},Rl=0,YC="http://www.w3.org/2000/xmlns/",yt=zc.xmlns;class x2 extends _f{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,o){return this._defs={},this._clearDefs(),t&&(this._svg=bt(t,0,"svg",yt),this._svg.setAttributeNS(YC,"xmlns",yt),this._svg.setAttributeNS(YC,"xmlns:xlink",zc["xmlns:xlink"]),this._svg.setAttribute("version",zc.version),this._svg.setAttribute("class","marks"),si(t,1),this._root=bt(this._svg,Rl,"g",yt),Po(this._root,yM),si(this._svg,Rl+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(Po(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=bt(t,Rl,"rect",yt),Po(i,{width:this._width,height:this._height,fill:n}));const r=gM(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),si(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,o,s,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==o&&(o=r.marktype,s=ni[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,VC(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){s.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(s,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=s.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,VC(i,n)):this._update(s,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=ni[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=XC(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return si(c,0),n._svg;c.setAttribute("class",eM(n));const f=dM(n);for(const g in f)dn(c,g,f[g]);l||dn(c,"pointer-events",u),dn(c,"clip-path",n.clip?Kv(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=XC(g,c,d,a.tag,o);m&&(this._update(a,y,g),l&&Sj(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):Bi(n,p),si(c,h),c}_update(t,n,i){Qr=n,Jt=n.__values__,fM(bc,i),t.attr(bc,i,this);const r=$j[t.type];r&&r.call(this,t,n,i),Qr&&this.style(Qr,i)}style(t,n){if(n!=null){for(const i in Bh){let r=i==="font"?Sf(n):n[i];if(r===Jt[i])continue;const o=Bh[i];r==null?t.removeAttribute(o):(Yv(r)&&(r=kT(r,this._defs.gradient,bM())),t.setAttribute(o,r+"")),Jt[i]=r}for(const i in zh)Kd(t,zh[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=bt(t,Rl+1,"defs",yt)),r=wj(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=bt(t,Rl+1,"defs",yt)),r=Cj(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):si(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function VC(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function wj(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=bt(e,n++,"pattern",yt);Po(s,{id:Fh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=bt(s,0,"rect",yt),Po(s,{width:1,height:1,fill:`url(${bM()}#${t.id})`}),e=bt(e,n++,"radialGradient",yt),Po(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=bt(e,n++,"linearGradient",yt),Po(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=bt(e,i,"stop",yt),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return si(e,i),n}function Cj(e,t,n){let i;return e=bt(e,n,"clipPath",yt),e.setAttribute("id",t.id),t.path?(i=bt(e,0,"path",yt),i.setAttribute("d",t.path)):(i=bt(e,0,"rect",yt),Po(i,{x:0,y:0,width:t.width,height:t.height})),si(e,1),n+1}function Sj(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;Bi(n,s=>{r=e.mark(t,s,r,i),++o}),si(t,1+o)}function XC(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Lo(s,i,yt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=Lo(s,"path",yt);o.appendChild(a),a.__data__=e;const u=Lo(s,"g",yt);o.appendChild(u),u.__data__=e;const l=Lo(s,"path",yt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||_j(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function _j(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Qr=null,Jt=null;const $j={group(e,t,n){const i=Qr=t.childNodes[2];Jt=i.__values__,e.foreground(bc,n,this),Jt=t.__values__,Qr=t.childNodes[1],e.content(bc,n,this);const r=Qr=t.childNodes[0];e.background(bc,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Jt.events&&(dn(i,"pointer-events",o),dn(r,"pointer-events",o),Jt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;dn(i,"display",null),this.style(r,n),dn(r,"stroke",null),s&&(n.fill=null),Jt=i.__values__,this.style(i,n),s&&(n.fill=s),Qr=null}else dn(i,"display","none")},image(e,t,n){n.smooth===!1?(Kd(t,"image-rendering","optimizeSpeed"),Kd(t,"image-rendering","pixelated")):Kd(t,"image-rendering",null)},text(e,t,n){const i=Cf(n);let r,o,s,a;Z(i)?(o=i.map(u=>ts(n,u)),r=o.join(`
|
|
7
|
-
`),r!==Jt.text&&(si(t,0),s=t.ownerDocument,a=es(n),o.forEach((u,l)=>{const c=Lo(s,"tspan",yt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Jt.text=r)):(o=ts(n,i),o!==Jt.text&&(t.textContent=o,Jt.text=o)),dn(t,"font-family",Sf(n)),dn(t,"font-size",_r(n)+"px"),dn(t,"font-style",n.fontStyle),dn(t,"font-variant",n.fontVariant),dn(t,"font-weight",n.fontWeight)}};function bc(e,t,n){t!==Jt[e]&&(n?Fj(Qr,e,t,n):dn(Qr,e,t),Jt[e]=t)}function Kd(e,t,n){n!==Jt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Jt[t]=n)}function Po(e,t){for(const n in t)dn(e,n,t[n])}function dn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Fj(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function bM(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class xM extends _f{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=b2();n.open("svg",me({},zc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",yM,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=ni[n.marktype],r=i.tag,o=[fM,i.attr];t.open("g",{class:eM(n),"clip-path":n.clip?Kv(this,n,n.group):null},dM(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Cf(a);if(Z(l)){const c={x:0,dy:es(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(ts(a,l[f])).close()}else t.text(ts(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),Bi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):Bi(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&kj(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Fh+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function kj(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Sf(t),e["font-size"]=_r(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in Bh){let a=t[s];const u=Bh[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Yv(a)&&(a=kT(a,r.gradient,"")),e[u]=a)}for(const s in zh){const a=t[s];a!=null&&(o=o||[],o.push(`${zh[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const $i={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function Dj(e){$i.svgMarkTypes=e.svgMarkTypes??["text"],$i.svgOnTop=e.svgOnTop??!0,$i.debug=e.debug??!1}class Ey extends _f{constructor(t){super(t),this._svgRenderer=new x2(t),this._canvasRenderer=new Ih(t)}initialize(t,n,i,r,o){this._root_el=bt(t,0,"div");const s=bt(this._root_el,0,"div"),a=bt(this._root_el,1,"div");return this._root_el.style.position="relative",$i.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=$i.svgOnTop?a:s,this._canvasEl=$i.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return $i.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!$i.svgMarkTypes.includes(o));this._svgRenderer.render(t,$i.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return $i.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class vM extends $f{constructor(t,n){super(t,n)}initialize(t,n,i){const r=bt(bt(t,0,"div"),$i.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const EM="canvas",AM="hybrid",wM="png",CM="svg",SM="none",Io={Canvas:EM,PNG:wM,SVG:CM,Hybrid:AM,None:SM},ia={};ia[EM]=ia[wM]={renderer:Ih,headless:Ih,handler:$f};ia[CM]={renderer:x2,headless:xM,handler:aM};ia[AM]={renderer:Ey,headless:Ey,handler:vM};ia[SM]={};function Og(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(ia[e]=t,this):ia[e]}function _M(e,t,n){const i=[],r=new mt().union(t),o=e.marktype;return o?$M(e,r,n,i):o==="group"?FM(e,r,n,i):O("Intersect scene must be mark node or group item.")}function $M(e,t,n,i){if(Tj(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)FM(r[a],t,n,i);else for(const u=ni[o].isect;a<s;++a){const l=r[a];kM(l,t,u)&&i.push(l)}}return i}function Tj(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function FM(e,t,n,i){n&&n(e.mark)&&kM(e,t,ni.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)$M(r[u],t,n,i);t.translate(s,a)}return i}function kM(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const wm=new mt;function DM(e){const t=e.clip;if(ye(t))t(Af(wm.clear()));else if(t)wm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(wm)}const Mj=1e-9;function v2(e,t,n){return e===t?!0:n==="path"?TM(e,t):e instanceof Date&&t instanceof Date?+e==+t:Ko(e)&&Ko(t)?Math.abs(e-t)<=Mj:!e||!t||!ce(e)&&!ce(t)?e==t:Oj(e,t)}function TM(e,t){return v2(ku(e),ku(t))}function Oj(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!v2(e[r],t[r],r))return!1;return typeof e==typeof t}function Rj(){Xz(),iz()}const Mu="top",Di="left",Ti="right",ns="bottom",Nj="top-left",Lj="top-right",Pj="bottom-left",Ij="bottom-right",E2="start",Ay="middle",hn="end",Bj="x",zj="y",Rg="group",A2="axis",w2="title",Uj="frame",jj="scope",C2="legend",MM="row-header",OM="row-footer",RM="row-title",NM="column-header",LM="column-footer",PM="column-title",qj="padding",Wj="symbol",IM="fit",BM="fit-x",zM="fit-y",Hj="pad",S2="none",ld="all",wy="each",_2="flush",Bo="column",zo="row";function UM(e){M.call(this,null,e)}H(UM,M,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=ni[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=cd(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Rg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(cd(l,s))),i.role){case A2:case C2:case w2:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(cd(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(cd(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return DM(i),t.modifies("bounds")}});function cd(e,t,n){return t(e.bounds.clear(),e,n)}const KC=":vega_identifier:";function $2(e){M.call(this,0,e)}$2.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};H($2,M,{transform(e,t){const n=Gj(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function Gj(e){return e._signals[KC]||(e._signals[KC]=e.add(0))}function jM(e){M.call(this,null,e)}H(jM,M,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,Yj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===Rg?Sg:Cg;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function Yj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function qM(e){M.call(this,null,e)}const JC={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!WM(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},WM=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),QC=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(WM(r,o=e[n].bounds,t))return!0},Vj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},Xj=(e,t,n)=>{var i=e.range(),r=new mt;return t===Mu||t===ns?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},ZC=e=>(e.forEach(t=>t.opacity=1),e),eS=(e,t)=>e.reflow(t.modified()).modifies("opacity");H(qM,M,{transform(e,t){const n=JC[e.method]||JC.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(ZC(r),t=eS(t,e)),t;if(r=r.filter(Vj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=ZC(r),t=eS(t,e),o.length>=3&&QC(o,i)){do o=n(o,i);while(o.length>=3&&QC(o,i));o.length<3&&!Se(r).opacity&&(o.length>1&&(Se(o).opacity=0),Se(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=Xj(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function HM(e){M.call(this,null,e)}H(HM,M,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Kt=new mt;function ou(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Kj(e){var t=e.items[0].orient;return t===Di||t===Ti}function Jj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function Qj(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=Jj(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=o.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&l2(p),b=0,x=0,v,A;switch(Kt.clear().union(m),m.clear(),(v=u[0])>-1&&m.union(r.items[v].bounds),(v=u[1])>-1&&m.union(r.items[v].bounds),a){case Mu:b=f||0,x=-c,A=Math.max(d,Math.min(h,-m.y1)),m.add(0,-A).add(l,0),p&&fd(e,p,A,g,y,0,-1,m);break;case Di:b=-c,x=f||0,A=Math.max(d,Math.min(h,-m.x1)),m.add(-A,0).add(0,l),p&&fd(e,p,A,g,y,1,-1,m);break;case Ti:b=n+c,x=f||0,A=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(A,l),p&&fd(e,p,A,g,y,1,1,m);break;case ns:b=f||0,x=i+c,A=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,A),p&&fd(e,p,A,g,0,0,1,m);break;default:b=r.x,x=r.y}return po(m.translate(b,x),r),ou(r,"x",b+s)|ou(r,"y",x+s)&&(r.bounds=Kt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function fd(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const tS=(e,t)=>Math.floor(Math.min(e,t)),nS=(e,t)=>Math.ceil(Math.max(e,t));function Zj(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===Rg)switch(r.role){case A2:case C2:case w2:break;case MM:s.rowheaders.push(...o);break;case OM:s.rowfooters.push(...o);break;case NM:s.colheaders.push(...o);break;case LM:s.colfooters.push(...o);break;case RM:s.rowtitle=o[0];break;case PM:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function eq(e){return new mt().set(0,0,e.width||0,e.height||0)}function tq(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Je(e,t,n){const i=ce(e)?e[t]:e;return i??(n!==void 0?n:0)}function iS(e){return e<0?Math.ceil(-e):0}function GM(e,t,n){var i=!n.nodirty,r=n.bounds===_2?eq:tq,o=Kt.set(0,0,0,0),s=Je(n.align,Bo),a=Je(n.align,zo),u=Je(n.padding,Bo),l=Je(n.padding,zo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,x=Array(d),v=Array(d),A=Array(d),w,E,C,S,$,k,L,T,F,_,D;for(E=0;E<c;++E)p[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)k=t[E],$=A[E]=r(k),k.x=k.x||0,x[E]=0,k.y=k.y||0,v[E]=0,C=E%c,S=~~(E/c),g=Math.max(g,L=Math.ceil($.x2)),b=Math.max(b,T=Math.ceil($.y2)),p[C]=Math.max(p[C],L),y[S]=Math.max(y[S],T),h[E]=u+iS($.x1),m[E]=l+iS($.y1),i&&e.dirty(t[E]);for(E=0;E<d;++E)E%c===0&&(h[E]=0),E<c&&(m[E]=0);if(s===wy)for(C=1;C<c;++C){for(D=0,E=C;E<d;E+=c)D<h[E]&&(D=h[E]);for(E=C;E<d;E+=c)h[E]=D+p[C-1]}else if(s===ld){for(D=0,E=0;E<d;++E)E%c&&D<h[E]&&(D=h[E]);for(E=0;E<d;++E)E%c&&(h[E]=D+g)}else for(s=!1,C=1;C<c;++C)for(E=C;E<d;E+=c)h[E]+=p[C-1];if(a===wy)for(S=1;S<f;++S){for(D=0,E=S*c,w=E+c;E<w;++E)D<m[E]&&(D=m[E]);for(E=S*c;E<w;++E)m[E]=D+y[S-1]}else if(a===ld){for(D=0,E=c;E<d;++E)D<m[E]&&(D=m[E]);for(E=c;E<d;++E)m[E]=D+b}else for(a=!1,S=1;S<f;++S)for(E=S*c,w=E+c;E<w;++E)m[E]+=y[S-1];for(F=0,E=0;E<d;++E)F=h[E]+(E%c?F:0),x[E]+=F-t[E].x;for(C=0;C<c;++C)for(_=0,E=C;E<d;E+=c)_+=m[E],v[E]+=_-t[E].y;if(s&&Je(n.center,Bo)&&f>1)for(E=0;E<d;++E)$=s===ld?g:p[E%c],F=$-A[E].x2-t[E].x-x[E],F>0&&(x[E]+=F/2);if(a&&Je(n.center,zo)&&c!==1)for(E=0;E<d;++E)$=a===ld?b:y[~~(E/c)],_=$-A[E].y2-t[E].y-v[E],_>0&&(v[E]+=_/2);for(E=0;E<d;++E)o.union(A[E].translate(x[E],v[E]));switch(F=Je(n.anchor,Bj),_=Je(n.anchor,zj),Je(n.anchor,Bo)){case hn:F-=o.width();break;case Ay:F-=o.width()/2}switch(Je(n.anchor,zo)){case hn:_-=o.height();break;case Ay:_-=o.height()/2}for(F=Math.round(F),_=Math.round(_),o.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)k=t[E],k.x+=x[E]+=F,k.y+=v[E]+=_,o.union(k.mark.bounds.union(k.bounds.translate(x[E],v[E]))),i&&e.dirty(k);return o}function nq(e,t,n){var i=Zj(t),r=i.marks,o=n.bounds===_2?iq:rq,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=GM(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=Je(n.headerBand,zo,null),c=dd(e,i.rowheaders,r,a,u,-Je(s,"rowHeader"),tS,0,o,"x1",0,a,1,g)),i.colheaders&&(g=Je(n.headerBand,Bo,null),f=dd(e,i.colheaders,r,a,a,-Je(s,"columnHeader"),tS,1,o,"y1",0,1,a,g)),i.rowfooters&&(g=Je(n.footerBand,zo,null),d=dd(e,i.rowfooters,r,a,u,Je(s,"rowFooter"),nS,0,o,"x2",a-1,a,1,g)),i.colfooters&&(g=Je(n.footerBand,Bo,null),h=dd(e,i.colfooters,r,a,a,Je(s,"columnFooter"),nS,1,o,"y2",l-a,1,a,g)),i.rowtitle&&(p=Je(n.titleAnchor,zo),m=Je(s,"rowTitle"),m=p===hn?d+m:c-m,g=Je(n.titleBand,zo,.5),rS(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=Je(n.titleAnchor,Bo),m=Je(s,"columnTitle"),m=p===hn?h+m:f-m,g=Je(n.titleBand,Bo,.5),rS(e,i.coltitle,m,1,y,g))}function iq(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function rq(e,t){return e.bounds[t]}function dd(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,x,v,A,w,E,C,S;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=s(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=o,b=0,v=t.length;b<v;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,v=t.length;b<v;++b,y+=f){for(w=t[b],A=w.mark.bounds,x=y;x>=0&&(E=n[x])==null;x-=d);a?(C=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),S=g):(C=g,S=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),A.union(w.bounds.translate(C-(w.x||0),S-(w.y||0))),w.x=C,w.y=S,e.dirty(w),m=s(m,A[l])}return m}function rS(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function oq(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function sq(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function aq(e,t,n,i,r,o,s){const a=oq(n,t),u=sq(e,a("offset",0)),l=a("anchor",E2),c=l===hn?1:l===Ay?.5:0,f={align:wy,bounds:a("bounds",_2),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case Di:f.anchor={x:Math.floor(i.x1)-u,column:hn,y:c*(s||i.height()+2*i.y1),row:l};break;case Ti:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case Mu:f.anchor={y:Math.floor(r.y1)-u,row:hn,x:c*(o||r.width()+2*r.x1),column:l};break;case ns:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case Nj:f.anchor={x:u,y:u};break;case Lj:f.anchor={x:o-u,y:u,column:hn};break;case Pj:f.anchor={x:u,y:s-u,row:hn};break;case Ij:f.anchor={x:o-u,y:s-u,column:hn,row:hn};break}return f}function uq(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),cq(e,n,n.items[0].items[0]),o=lq(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===Wj&&fq(n.items[0].items[0].items[0].items),r!==S2&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,po(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function lq(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function cq(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&Nl(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case Di:r+=Math.ceil(s.bounds.width())+u;break;case Ti:case ns:break;default:o+=s.bounds.height()+u}switch((r||o)&&Nl(e,n,r,o),s.orient){case Di:c+=Ha(t,n,s,a,1,1);break;case Ti:l+=Ha(t,n,s,hn,0,0)+u,c+=Ha(t,n,s,a,1,1);break;case ns:l+=Ha(t,n,s,a,0,0),c+=Ha(t,n,s,hn,-1,0,1)+u;break;default:l+=Ha(t,n,s,a,0,0)}(l||c)&&Nl(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(Nl(e,n,-l,0),Nl(e,s,-l,0))}}function Ha(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:l2(n);return Math.round(i===E2?f:i===hn?d-h:.5*(c-h))}function Nl(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function fq(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function dq(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Di||a===Ti?i:n,p=0,g=0,m=0,y=0,b=0,x;if(s!==Rg?a===Di?(p=r.y2,h=r.y1):a===Ti?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===Di&&(p=i,h=0),x=u===E2?p:u===hn?h:(p+h)/2,d&&d.text){switch(a){case Mu:case ns:b=f.bounds.height()+c;break;case Di:y=f.bounds.width()+c;break;case Ti:y=-f.bounds.width()-c;break}Kt.clear().union(d.bounds),Kt.translate(y-(d.x||0),b-(d.y||0)),ou(d,"x",y)|ou(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Kt),d.mark.bounds.clear().union(Kt),e.dirty(d)),Kt.clear().union(d.bounds)}else Kt.clear();switch(Kt.union(f.bounds),a){case Mu:g=x,m=r.y1-Kt.height()-l;break;case Di:g=r.x1-Kt.width()-l,m=x;break;case Ti:g=r.x2+Kt.width()+l,m=x;break;case ns:g=x,m=r.y2+l;break;default:g=o.x,m=o.y}return ou(o,"x",g)|ou(o,"y",m)&&(Kt.translate(g,m),e.dirty(o),o.bounds.clear().union(Kt),t.bounds.clear().union(Kt),e.dirty(o)),o.bounds}function YM(e){M.call(this,null,e)}H(YM,M,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&nq(n,i,e.layout),pq(n,i,e)}),hq(e.mark.group)?t.reflow():t}});function hq(e){return e&&e.mark.role!=="legend-entry"}function pq(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new mt().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case A2:h=Kj(f)?a:u,h.union(Qj(e,f,r,o));break;case w2:c=f;break;case C2:l.push(uq(e,f));break;case Uj:case jj:case MM:case OM:case RM:case NM:case LM:case PM:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||Ti,d!==S2&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];GM(e,b,aq(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===IM||n.autosize.type===BM||n.autosize.type===zM))switch(y.orient){case Di:case Ti:s.add(b.x1,0).add(b.x2,0);break;case Mu:case ns:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(dq(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),gq(e,t,s,n)}function gq(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===qj){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===S2?(l=0,f=0,u=s,c=a):o===IM?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===BM?(u=Math.max(0,s-l-d),a=c+f+h):o===zM?(s=u+l+d,c=Math.max(0,a-f-h)):o===Hj&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const mq=Object.freeze(Object.defineProperty({__proto__:null,bound:UM,identifier:$2,mark:jM,overlap:qM,render:HM,viewlayout:YM},Symbol.toStringTag,{value:"Module"}));function VM(e){M.call(this,null,e)}H(VM,M,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Hv(o,s,e.minstep),u=e.format||AT(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?ET(o,e.values,a):Gv(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Re({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Re({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function XM(e){M.call(this,null,e)}function yq(){return Re({})}function bq(e){const t=tl().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}H(XM,M,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||yq,o=e.key||ne,s=this.value;return Z(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&O("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=bq(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function KM(e){M.call(this,null,e)}H(KM,M,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(Z(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||So,u=r.enter||So,l=r.exit||So,c=(o&&!s?r[o]:a)||So;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==So&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==So&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==So){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function JM(e){M.call(this,[],e)}H(JM,M,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||jd,s=e.scale,a=+e.limit,u=Hv(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===jd,c=e.format||_T(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||ST(s,u),d,h,p,g,m;return r&&(i.rem=r),o===jd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ye(p=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=ln(g=p||8),r=r.map((y,b)=>Re({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Re({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):o===WB?(d=s.domain(),h=bT(s,d[0],Se(d)),f.length<3&&!e.values&&d[0]!==Se(d)&&(f=[d[0],Se(d)]),r=f.map((y,b)=>Re({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=tz(s),r=f.map((y,b)=>Re({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const xq=e=>e.source.x,vq=e=>e.source.y,Eq=e=>e.target.x,Aq=e=>e.target.y;function F2(e){M.call(this,{},e)}F2.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"}]};H(F2,M,{transform(e,t){var n=e.sourceX||xq,i=e.sourceY||vq,r=e.targetX||Eq,o=e.targetY||Aq,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=oS.get(u+"-"+a)||oS.get(u);return l||O("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const QM=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,wq=(e,t,n,i)=>QM(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),ZM=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},Cq=(e,t,n,i)=>ZM(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),e5=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},Sq=(e,t,n,i)=>e5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),_q=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,$q=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Fq=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},kq=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},Dq=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Tq=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a},oS=tl({line:QM,"line-radial":wq,arc:ZM,"arc-radial":Cq,curve:e5,"curve-radial":Sq,"orthogonal-horizontal":_q,"orthogonal-vertical":$q,"orthogonal-radial":Fq,"diagonal-horizontal":kq,"diagonal-vertical":Dq,"diagonal-radial":Tq});function k2(e){M.call(this,null,e)}k2.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"]}]};H(k2,M,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||Zu,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/Ik(l),h=Yn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Mq=5;function Oq(e){const t=e.type;return!e.bins&&(t===_u||t===gf||t===mf)}function t5(e){return jv(e)&&e!==dr}const Rq=Pi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function n5(e){M.call(this,null,e),this.modified(!0)}H(n5,M,{transform(e,t){var n=t.dataflow,i=this.value,r=Nq(e);(!i||r!==i.type)&&(this.value=i=Oe(r)());for(r in e)if(!Rq[r]){if(r==="padding"&&t5(i.type))continue;ye(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return Uq(i,e,zq(i,e,Pq(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Nq(e){var t=e.type,n="",i;return t===dr?dr+"-"+_u:(Lq(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?dr+"-":i===3?al+"-":""),(n+t||_u).toLowerCase())}function Lq(e){const t=e.type;return jv(t)&&t!==ta&&t!==na&&(e.scheme||e.range&&e.range.length&&e.range.every(_e))}function Pq(e,t,n){const i=Iq(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Oq(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return t5(o)&&t.padding&&r[0]!==Se(r)&&(r=Bq(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(i5(o,r,n)),o===Iv&&e.unknown(t.domainImplicit?ay:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Hv(e,t.nice)||null),r.length}function Iq(e,t,n){return t?(e.domain(i5(e.type,t,n)),t.length):-1}function Bq(e,t,n,i,r,o){var s=Math.abs(Se(n)-n[0]),a=s/(s-2*i),u=e===uo?lx(t,null,a):e===mf?ph(t,null,a,.5):e===gf?ph(t,null,a,r||1):e===xg?cx(t,null,a,o||1):ux(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function i5(e,t,n){if(hT(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+ee(t))}return t}function zq(e,t,n){let i=t.bins;if(i&&!Z(i)){const r=e.domain(),o=r[0],s=Se(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||O("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Yn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Bv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function Uq(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=jq(i,t,n);else if(t.scheme&&(o=qq(i,t,n),ye(o))){if(e.interpolator)return e.interpolator(o);O(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&pT(i))return e.interpolator(Ag(Cy(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(qv(t.interpolate,t.interpolateGamma)):ye(e.round)?e.round(r):ye(e.rangeRound)&&e.interpolate(r?Up:lf),o&&e.range(Cy(o,t.reverse))}function jq(e,t,n){e!==aT&&e!==ly&&O("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===ly?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Pv(n,r,i)]}function qq(e,t,n){var i=t.schemeExtent,r,o;return Z(t.scheme)?o=Ag(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=Wv(r),o||O(`Unrecognized scheme name: ${t.scheme}`)),n=e===Eg?n+1:e===Bv?n-1:e===$u||e===vg?+t.schemeCount||Mq:n,pT(e)?sS(o,i,t.reverse):ye(o)?yT(sS(o,i),n):e===Iv?o:o.slice(0,n)}function sS(e,t,n){return ye(e)&&(t||n)?mT(e,Cy(t||[0,1],n)):e}function Cy(e,t){return t?e.slice().reverse():e}function r5(e){M.call(this,null,e)}H(r5,M,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Ca(e.sort)),this.modified(n),t}});const aS="zero",o5="center",s5="normalize",a5=["y0","y1"];function D2(e){M.call(this,null,e)}D2.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:aS,values:[aS,o5,s5]},{name:"as",type:"string",array:!0,length:2,default:a5}]};H(D2,M,{transform(e,t){var n=e.as||a5,i=n[0],r=n[1],o=Ca(e.sort),s=e.field||Zu,a=e.offset===o5?Wq:e.offset===s5?Hq:Gq,u,l,c,f;for(u=Yq(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function Wq(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function Hq(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function Gq(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function Yq(e,t,n,i){var r=[],o=g=>g(c),s,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const Vq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:VM,datajoin:XM,encode:KM,legendentries:JM,linkpath:F2,pie:k2,scale:n5,sortitems:r5,stack:D2},Symbol.toStringTag,{value:"Module"}));var se=1e-6,Uh=1e-12,Ee=Math.PI,at=Ee/2,jh=Ee/4,wn=Ee*2,lt=180/Ee,xe=Ee/180,Ce=Math.abs,ll=Math.atan,bi=Math.atan2,ae=Math.cos,hd=Math.ceil,u5=Math.exp,Sy=Math.hypot,qh=Math.log,Cm=Math.pow,ie=Math.sin,li=Math.sign||function(e){return e>0?1:e<0?-1:0},Cn=Math.sqrt,T2=Math.tan;function l5(e){return e>1?0:e<-1?Ee:Math.acos(e)}function Pn(e){return e>1?at:e<-1?-at:Math.asin(e)}function Bt(){}function Wh(e,t){e&&lS.hasOwnProperty(e.type)&&lS[e.type](e,t)}var uS={Feature:function(e,t){Wh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)Wh(n[i].geometry,t)}},lS={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){_y(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)_y(n[i],t,0)},Polygon:function(e,t){cS(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)cS(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)Wh(n[i],t)}};function _y(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function cS(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)_y(e[n],t,1);t.polygonEnd()}function Gr(e,t){e&&uS.hasOwnProperty(e.type)?uS[e.type](e,t):Wh(e,t)}var Hh=new vn,Gh=new vn,c5,f5,$y,Fy,ky,vr={point:Bt,lineStart:Bt,lineEnd:Bt,polygonStart:function(){Hh=new vn,vr.lineStart=Xq,vr.lineEnd=Kq},polygonEnd:function(){var e=+Hh;Gh.add(e<0?wn+e:e),this.lineStart=this.lineEnd=this.point=Bt},sphere:function(){Gh.add(wn)}};function Xq(){vr.point=Jq}function Kq(){d5(c5,f5)}function Jq(e,t){vr.point=d5,c5=e,f5=t,e*=xe,t*=xe,$y=e,Fy=ae(t=t/2+jh),ky=ie(t)}function d5(e,t){e*=xe,t*=xe,t=t/2+jh;var n=e-$y,i=n>=0?1:-1,r=i*n,o=ae(t),s=ie(t),a=ky*s,u=Fy*o+a*ae(r),l=a*i*ie(r);Hh.add(bi(l,u)),$y=e,Fy=o,ky=s}function Qq(e){return Gh=new vn,Gr(e,vr),Gh*2}function Yh(e){return[bi(e[1],e[0]),Pn(e[2])]}function ra(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*ie(t),ie(n)]}function pd(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ou(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Sm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function gd(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Vh(e){var t=Cn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var nt,Tn,ot,Hn,Ns,h5,p5,du,xc,Do,lo,qr={point:Dy,lineStart:fS,lineEnd:dS,polygonStart:function(){qr.point=m5,qr.lineStart=Zq,qr.lineEnd=eW,xc=new vn,vr.polygonStart()},polygonEnd:function(){vr.polygonEnd(),qr.point=Dy,qr.lineStart=fS,qr.lineEnd=dS,Hh<0?(nt=-(ot=180),Tn=-(Hn=90)):xc>se?Hn=90:xc<-se&&(Tn=-90),lo[0]=nt,lo[1]=ot},sphere:function(){nt=-(ot=180),Tn=-(Hn=90)}};function Dy(e,t){Do.push(lo=[nt=e,ot=e]),t<Tn&&(Tn=t),t>Hn&&(Hn=t)}function g5(e,t){var n=ra([e*xe,t*xe]);if(du){var i=Ou(du,n),r=[i[1],-i[0],0],o=Ou(r,i);Vh(o),o=Yh(o);var s=e-Ns,a=s>0?1:-1,u=o[0]*lt*a,l,c=Ce(s)>180;c^(a*Ns<u&&u<a*e)?(l=o[1]*lt,l>Hn&&(Hn=l)):(u=(u+360)%360-180,c^(a*Ns<u&&u<a*e)?(l=-o[1]*lt,l<Tn&&(Tn=l)):(t<Tn&&(Tn=t),t>Hn&&(Hn=t))),c?e<Ns?Wn(nt,e)>Wn(nt,ot)&&(ot=e):Wn(e,ot)>Wn(nt,ot)&&(nt=e):ot>=nt?(e<nt&&(nt=e),e>ot&&(ot=e)):e>Ns?Wn(nt,e)>Wn(nt,ot)&&(ot=e):Wn(e,ot)>Wn(nt,ot)&&(nt=e)}else Do.push(lo=[nt=e,ot=e]);t<Tn&&(Tn=t),t>Hn&&(Hn=t),du=n,Ns=e}function fS(){qr.point=g5}function dS(){lo[0]=nt,lo[1]=ot,qr.point=Dy,du=null}function m5(e,t){if(du){var n=e-Ns;xc.add(Ce(n)>180?n+(n>0?360:-360):n)}else h5=e,p5=t;vr.point(e,t),g5(e,t)}function Zq(){vr.lineStart()}function eW(){m5(h5,p5),vr.lineEnd(),Ce(xc)>se&&(nt=-(ot=180)),lo[0]=nt,lo[1]=ot,du=null}function Wn(e,t){return(t-=e)<0?t+360:t}function tW(e,t){return e[0]-t[0]}function hS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function nW(e){var t,n,i,r,o,s,a;if(Hn=ot=-(nt=Tn=1/0),Do=[],Gr(e,qr),n=Do.length){for(Do.sort(tW),t=1,i=Do[0],o=[i];t<n;++t)r=Do[t],hS(i,r[0])||hS(i,r[1])?(Wn(i[0],r[1])>Wn(i[0],i[1])&&(i[1]=r[1]),Wn(r[0],i[1])>Wn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Wn(i[1],r[0]))>s&&(s=a,nt=r[0],ot=i[1])}return Do=lo=null,nt===1/0||Tn===1/0?[[NaN,NaN],[NaN,NaN]]:[[nt,Tn],[ot,Hn]]}var ic,Xh,Kh,Jh,Qh,Zh,ep,tp,Ty,My,Oy,y5,b5,pn,gn,mn,Mi={sphere:Bt,point:M2,lineStart:pS,lineEnd:gS,polygonStart:function(){Mi.lineStart=oW,Mi.lineEnd=sW},polygonEnd:function(){Mi.lineStart=pS,Mi.lineEnd=gS}};function M2(e,t){e*=xe,t*=xe;var n=ae(t);Ff(n*ae(e),n*ie(e),ie(t))}function Ff(e,t,n){++ic,Kh+=(e-Kh)/ic,Jh+=(t-Jh)/ic,Qh+=(n-Qh)/ic}function pS(){Mi.point=iW}function iW(e,t){e*=xe,t*=xe;var n=ae(t);pn=n*ae(e),gn=n*ie(e),mn=ie(t),Mi.point=rW,Ff(pn,gn,mn)}function rW(e,t){e*=xe,t*=xe;var n=ae(t),i=n*ae(e),r=n*ie(e),o=ie(t),s=bi(Cn((s=gn*o-mn*r)*s+(s=mn*i-pn*o)*s+(s=pn*r-gn*i)*s),pn*i+gn*r+mn*o);Xh+=s,Zh+=s*(pn+(pn=i)),ep+=s*(gn+(gn=r)),tp+=s*(mn+(mn=o)),Ff(pn,gn,mn)}function gS(){Mi.point=M2}function oW(){Mi.point=aW}function sW(){x5(y5,b5),Mi.point=M2}function aW(e,t){y5=e,b5=t,e*=xe,t*=xe,Mi.point=x5;var n=ae(t);pn=n*ae(e),gn=n*ie(e),mn=ie(t),Ff(pn,gn,mn)}function x5(e,t){e*=xe,t*=xe;var n=ae(t),i=n*ae(e),r=n*ie(e),o=ie(t),s=gn*o-mn*r,a=mn*i-pn*o,u=pn*r-gn*i,l=Sy(s,a,u),c=Pn(l),f=l&&-c/l;Ty.add(f*s),My.add(f*a),Oy.add(f*u),Xh+=c,Zh+=c*(pn+(pn=i)),ep+=c*(gn+(gn=r)),tp+=c*(mn+(mn=o)),Ff(pn,gn,mn)}function uW(e){ic=Xh=Kh=Jh=Qh=Zh=ep=tp=0,Ty=new vn,My=new vn,Oy=new vn,Gr(e,Mi);var t=+Ty,n=+My,i=+Oy,r=Sy(t,n,i);return r<Uh&&(t=Zh,n=ep,i=tp,Xh<se&&(t=Kh,n=Jh,i=Qh),r=Sy(t,n,i),r<Uh)?[NaN,NaN]:[bi(n,t)*lt,Pn(i/r)*lt]}function Ry(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function Ny(e,t){return Ce(e)>Ee&&(e-=Math.round(e/wn)*wn),[e,t]}Ny.invert=Ny;function v5(e,t,n){return(e%=wn)?t||n?Ry(yS(e),bS(t,n)):yS(e):t||n?bS(t,n):Ny}function mS(e){return function(t,n){return t+=e,Ce(t)>Ee&&(t-=Math.round(t/wn)*wn),[t,n]}}function yS(e){var t=mS(e);return t.invert=mS(-e),t}function bS(e,t){var n=ae(e),i=ie(e),r=ae(t),o=ie(t);function s(a,u){var l=ae(u),c=ae(a)*l,f=ie(a)*l,d=ie(u),h=d*n+c*i;return[bi(f*r-h*o,c*n-d*i),Pn(h*r+f*o)]}return s.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=ie(a)*l,d=ie(u),h=d*r-f*o;return[bi(f*r+d*o,c*n+h*i),Pn(h*n-c*i)]},s}function lW(e){e=v5(e[0]*xe,e[1]*xe,e.length>2?e[2]*xe:0);function t(n){return n=e(n[0]*xe,n[1]*xe),n[0]*=lt,n[1]*=lt,n}return t.invert=function(n){return n=e.invert(n[0]*xe,n[1]*xe),n[0]*=lt,n[1]*=lt,n},t}function cW(e,t,n,i,r,o){if(n){var s=ae(t),a=ie(t),u=i*n;r==null?(r=t+i*wn,o=t-u/2):(r=xS(s,r),o=xS(s,o),(i>0?r<o:r>o)&&(r+=i*wn));for(var l,c=r;i>0?c>o:c<o;c-=u)l=Yh([s,-a*ae(c),-a*ie(c)]),e.point(l[0],l[1])}}function xS(e,t){t=ra(t),t[0]-=e,Vh(t);var n=l5(-t[1]);return((-t[2]<0?-n:n)+wn-se)%wn}function E5(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:Bt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Jd(e,t){return Ce(e[0]-t[0])<se&&Ce(e[1]-t[1])<se}function md(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function A5(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Jd(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*se}o.push(b=new md(m,p,null,!0)),s.push(b.o=new md(m,null,b,!1)),o.push(b=new md(y,p,null,!1)),s.push(b.o=new md(y,null,b,!0))}}),!!o.length){for(s.sort(t),vS(o),vS(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function vS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function _m(e){return Ce(e[0])<=Ee?e[0]:li(e[0])*((Ce(e[0])+Ee)%wn-Ee)}function fW(e,t){var n=_m(t),i=t[1],r=ie(i),o=[ie(n),-ae(n),0],s=0,a=0,u=new vn;r===1?i=at+se:r===-1&&(i=-at-se);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=_m(h),g=h[1]/2+jh,m=ie(g),y=ae(g),b=0;b<d;++b,p=v,m=w,y=E,h=x){var x=f[b],v=_m(x),A=x[1]/2+jh,w=ie(A),E=ae(A),C=v-p,S=C>=0?1:-1,$=S*C,k=$>Ee,L=m*w;if(u.add(bi(L*S*ie($),y*E+L*ae($))),s+=k?C+S*wn:C,k^p>=n^v>=n){var T=Ou(ra(h),ra(x));Vh(T);var F=Ou(o,T);Vh(F);var _=(k^C>=0?-1:1)*Pn(F[2]);(i>_||i===_&&(T[0]||T[1]))&&(a+=k^C>=0?1:-1)}}return(s<-se||s<se&&u<-Uh)^a&1}function w5(e,t,n,i){return function(r){var o=t(r),s=E5(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=x,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=Pk(c);var v=fW(l,i);c.length?(u||(r.polygonStart(),u=!0),A5(c,hW,v,n,r)):v&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(v,A){e(v,A)&&r.point(v,A)}function p(v,A){o.point(v,A)}function g(){d.point=p,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(v,A){f.push([v,A]),a.point(v,A)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var v=a.clean(),A=s.result(),w,E=A.length,C,S,$;if(f.pop(),l.push(f),f=null,!!E){if(v&1){if(S=A[0],(C=S.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),w=0;w<C;++w)r.point(($=S[w])[0],$[1]);r.lineEnd()}return}E>1&&v&2&&A.push(A.pop().concat(A.shift())),c.push(A.filter(dW))}}return d}}function dW(e){return e.length>1}function hW(e,t){return((e=e.x)[0]<0?e[1]-at-se:at-e[1])-((t=t.x)[0]<0?t[1]-at-se:at-t[1])}const ES=w5(function(){return!0},pW,mW,[-Ee,-at]);function pW(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?Ee:-Ee,u=Ce(o-t);Ce(u-Ee)<se?(e.point(t,n=(n+s)/2>0?at:-at),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=Ee&&(Ce(t-i)<se&&(t-=i*se),Ce(o-a)<se&&(o-=a*se),n=gW(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function gW(e,t,n,i){var r,o,s=ie(e-n);return Ce(s)>se?ll((ie(t)*(o=ae(i))*ie(n)-ie(i)*(r=ae(t))*ie(e))/(r*o*s)):(t+i)/2}function mW(e,t,n,i){var r;if(e==null)r=n*at,i.point(-Ee,r),i.point(0,r),i.point(Ee,r),i.point(Ee,0),i.point(Ee,-r),i.point(0,-r),i.point(-Ee,-r),i.point(-Ee,0),i.point(-Ee,r);else if(Ce(e[0]-t[0])>se){var o=e[0]<t[0]?Ee:-Ee;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function yW(e){var t=ae(e),n=2*xe,i=t>0,r=Ce(t)>se;function o(c,f,d,h){cW(h,e,n,d,c,f)}function s(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],x,v=s(m,y),A=i?v?0:l(m,y):v?l(m+(m<0?Ee:-Ee),y):0;if(!f&&(p=h=v)&&c.lineStart(),v!==h&&(x=u(f,b),(!x||Jd(f,x)||Jd(b,x))&&(b[2]=1)),v!==h)g=0,v?(c.lineStart(),x=u(b,f),c.point(x[0],x[1])):(x=u(f,b),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(r&&f&&i^v){var w;!(A&d)&&(w=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1],3)))}v&&(!f||!Jd(f,b))&&c.point(b[0],b[1]),f=b,h=v,d=A},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=ra(c),p=ra(f),g=[1,0,0],m=Ou(h,p),y=pd(m,m),b=m[0],x=y-b*b;if(!x)return!d&&c;var v=t*y/x,A=-t*b/x,w=Ou(g,m),E=gd(g,v),C=gd(m,A);Sm(E,C);var S=w,$=pd(E,S),k=pd(S,S),L=$*$-k*(pd(E,E)-1);if(!(L<0)){var T=Cn(L),F=gd(S,(-$-T)/k);if(Sm(F,E),F=Yh(F),!d)return F;var _=c[0],D=f[0],P=c[1],B=f[1],I;D<_&&(I=_,_=D,D=I);var Y=D-_,le=Ce(Y-Ee)<se,oe=le||Y<se;if(!le&&B<P&&(I=P,P=B,B=I),oe?le?P+B>0^F[1]<(Ce(F[0]-_)<se?P:B):P<=F[1]&&F[1]<=B:Y>Ee^(_<=F[0]&&F[0]<=D)){var pe=gd(S,(-$+T)/k);return Sm(pe,E),[F,Yh(pe)]}}}function l(c,f){var d=i?e:Ee-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return w5(s,a,o,i?[0,-e]:[-Ee,e-Ee])}function bW(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var rc=1e9,yd=-rc;function C5(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,p=0;if(l==null||(h=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function s(l,c){return Ce(l[0]-e)<se?c>0?0:3:Ce(l[0]-n)<se?c>0?2:1:Ce(l[1]-t)<se?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=E5(),d,h,p,g,m,y,b,x,v,A,w,E={point:C,lineStart:L,lineEnd:T,polygonStart:$,polygonEnd:k};function C(_,D){r(_,D)&&c.point(_,D)}function S(){for(var _=0,D=0,P=h.length;D<P;++D)for(var B=h[D],I=1,Y=B.length,le=B[0],oe,pe,We=le[0],ge=le[1];I<Y;++I)oe=We,pe=ge,le=B[I],We=le[0],ge=le[1],pe<=i?ge>i&&(We-oe)*(i-pe)>(ge-pe)*(e-oe)&&++_:ge<=i&&(We-oe)*(i-pe)<(ge-pe)*(e-oe)&&--_;return _}function $(){c=f,d=[],h=[],w=!0}function k(){var _=S(),D=w&&_,P=(d=Pk(d)).length;(D||P)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&A5(d,a,_,o,l),l.polygonEnd()),c=l,d=h=p=null}function L(){E.point=F,h&&h.push(p=[]),A=!0,v=!1,b=x=NaN}function T(){d&&(F(g,m),y&&v&&f.rejoin(),d.push(f.result())),E.point=C,v&&c.lineEnd()}function F(_,D){var P=r(_,D);if(h&&p.push([_,D]),A)g=_,m=D,y=P,A=!1,P&&(c.lineStart(),c.point(_,D));else if(P&&v)c.point(_,D);else{var B=[b=Math.max(yd,Math.min(rc,b)),x=Math.max(yd,Math.min(rc,x))],I=[_=Math.max(yd,Math.min(rc,_)),D=Math.max(yd,Math.min(rc,D))];bW(B,I,e,t,n,i)?(v||(c.lineStart(),c.point(B[0],B[1])),c.point(I[0],I[1]),P||c.lineEnd(),w=!1):P&&(c.lineStart(),c.point(_,D),w=!1)}b=_,x=D,v=P}return E}}function AS(e,t,n){var i=Yn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function wS(e,t,n){var i=Yn(e,t-se,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function xW(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Yn(hd(i/c)*c,n,c).map(p).concat(Yn(hd(a/f)*f,s,f).map(g)).concat(Yn(hd(t/u)*u,e,u).filter(function(x){return Ce(x%c)>se}).map(d)).concat(Yn(hd(o/l)*l,r,l).filter(function(x){return Ce(x%f)>se}).map(h))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(i=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],i>n&&(x=i,i=n,n=x),a>s&&(x=a,a=s,s=x),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],r=+x[1][1],t>e&&(x=t,t=e,e=x),o>r&&(x=o,o=r,r=x),y.precision(m)):[[t,o],[e,r]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],f=+x[1],y):[c,f]},y.stepMinor=function(x){return arguments.length?(u=+x[0],l=+x[1],y):[u,l]},y.precision=function(x){return arguments.length?(m=+x,d=AS(o,r,90),h=wS(t,e,m),p=AS(a,s,90),g=wS(i,n,m),y):m},y.extentMajor([[-180,-90+se],[180,90-se]]).extentMinor([[-180,-80-se],[180,80+se]])}const Uc=e=>e;var $m=new vn,Ly=new vn,S5,_5,Py,Iy,Yr={point:Bt,lineStart:Bt,lineEnd:Bt,polygonStart:function(){Yr.lineStart=vW,Yr.lineEnd=AW},polygonEnd:function(){Yr.lineStart=Yr.lineEnd=Yr.point=Bt,$m.add(Ce(Ly)),Ly=new vn},result:function(){var e=$m/2;return $m=new vn,e}};function vW(){Yr.point=EW}function EW(e,t){Yr.point=$5,S5=Py=e,_5=Iy=t}function $5(e,t){Ly.add(Iy*e-Py*t),Py=e,Iy=t}function AW(){$5(S5,_5)}var Ru=1/0,np=Ru,jc=-Ru,ip=jc,rp={point:wW,lineStart:Bt,lineEnd:Bt,polygonStart:Bt,polygonEnd:Bt,result:function(){var e=[[Ru,np],[jc,ip]];return jc=ip=-(np=Ru=1/0),e}};function wW(e,t){e<Ru&&(Ru=e),e>jc&&(jc=e),t<np&&(np=t),t>ip&&(ip=t)}var By=0,zy=0,oc=0,op=0,sp=0,su=0,Uy=0,jy=0,sc=0,F5,k5,ar,ur,ai={point:oa,lineStart:CS,lineEnd:SS,polygonStart:function(){ai.lineStart=_W,ai.lineEnd=$W},polygonEnd:function(){ai.point=oa,ai.lineStart=CS,ai.lineEnd=SS},result:function(){var e=sc?[Uy/sc,jy/sc]:su?[op/su,sp/su]:oc?[By/oc,zy/oc]:[NaN,NaN];return By=zy=oc=op=sp=su=Uy=jy=sc=0,e}};function oa(e,t){By+=e,zy+=t,++oc}function CS(){ai.point=CW}function CW(e,t){ai.point=SW,oa(ar=e,ur=t)}function SW(e,t){var n=e-ar,i=t-ur,r=Cn(n*n+i*i);op+=r*(ar+e)/2,sp+=r*(ur+t)/2,su+=r,oa(ar=e,ur=t)}function SS(){ai.point=oa}function _W(){ai.point=FW}function $W(){D5(F5,k5)}function FW(e,t){ai.point=D5,oa(F5=ar=e,k5=ur=t)}function D5(e,t){var n=e-ar,i=t-ur,r=Cn(n*n+i*i);op+=r*(ar+e)/2,sp+=r*(ur+t)/2,su+=r,r=ur*e-ar*t,Uy+=r*(ar+e),jy+=r*(ur+t),sc+=r*3,oa(ar=e,ur=t)}function T5(e){this._context=e}T5.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,wn);break}}},result:Bt};var qy=new vn,Fm,M5,O5,ac,uc,qc={point:Bt,lineStart:function(){qc.point=kW},lineEnd:function(){Fm&&R5(M5,O5),qc.point=Bt},polygonStart:function(){Fm=!0},polygonEnd:function(){Fm=null},result:function(){var e=+qy;return qy=new vn,e}};function kW(e,t){qc.point=R5,M5=ac=e,O5=uc=t}function R5(e,t){ac-=e,uc-=t,qy.add(Cn(ac*ac+uc*uc)),ac=e,uc=t}let _S,ap,$S,FS;class kS{constructor(t){this._append=t==null?N5:DW(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==$S||this._append!==ap){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,$S=i,ap=this._append,FS=this._,this._=r}this._+=FS;break}}}result(){const t=this._;return this._="",t.length?t:null}}function N5(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function DW(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return N5;if(t!==_S){const n=10**t;_S=t,ap=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return ap}function L5(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),Gr(a,r(o))),o.result()}return s.area=function(a){return Gr(a,r(Yr)),Yr.result()},s.measure=function(a){return Gr(a,r(qc)),qc.result()},s.bounds=function(a){return Gr(a,r(rp)),rp.result()},s.centroid=function(a){return Gr(a,r(ai)),ai.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,Uc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new kS(n)):new T5(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new kS(n)),s},s.projection(e).digits(n).context(t)}function Ng(e){return function(t){var n=new Wy;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Wy(){}Wy.prototype={constructor:Wy,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function O2(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Gr(n,e.stream(rp)),t(rp.result()),i!=null&&e.clipExtent(i),e}function Lg(e,t,n){return O2(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function R2(e,t,n){return Lg(e,[[0,0],t],n)}function N2(e,t,n){return O2(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function L2(e,t,n){return O2(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var DS=16,TW=ae(30*xe);function TS(e,t){return+t?OW(e,t):MW(e)}function MW(e){return Ng({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function OW(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,x=y*y+b*b;if(x>4*t&&g--){var v=s+d,A=a+h,w=u+p,E=Cn(v*v+A*A+w*w),C=Pn(w/=E),S=Ce(Ce(w)-1)<se||Ce(o-f)<se?(o+f)/2:bi(A,v),$=e(S,C),k=$[0],L=$[1],T=k-i,F=L-r,_=b*T-y*F;(_*_/x>t||Ce((y*T+b*F)/x-.5)>.3||s*d+a*h+u*p<TW)&&(n(i,r,o,s,a,u,k,L,S,v/=E,A/=E,w,g,m),m.point(k,L),n(k,L,S,v,A,w,l,c,f,d,h,p,g,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:v,polygonStart:function(){i.polygonStart(),m.lineStart=A},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(C,S){C=e(C,S),i.point(C[0],C[1])}function b(){f=NaN,m.point=x,i.lineStart()}function x(C,S){var $=ra([C,S]),k=e(C,S);n(f,d,c,h,p,g,f=k[0],d=k[1],c=C,h=$[0],p=$[1],g=$[2],DS,i),i.point(f,d)}function v(){m.point=y,i.lineEnd()}function A(){b(),m.point=w,m.lineEnd=E}function w(C,S){x(r=C,S),o=f,s=d,a=h,u=p,l=g,m.point=x}function E(){n(f,d,c,h,p,g,o,s,r,a,u,l,DS,i),m.lineEnd=v,v()}return m}}var RW=Ng({point:function(e,t){this.stream.point(e*xe,t*xe)}});function NW(e){return Ng({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function LW(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function MS(e,t,n,i,r,o){if(!o)return LW(e,t,n,i,r);var s=ae(o),a=ie(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function $r(e){return P5(function(){return e})()}function P5(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=ES,m=null,y,b,x,v=Uc,A=.5,w,E,C,S,$;function k(_){return C(_[0]*xe,_[1]*xe)}function L(_){return _=C.invert(_[0],_[1]),_&&[_[0]*lt,_[1]*lt]}k.stream=function(_){return S&&$===_?S:S=RW(NW(c)(g(w(v($=_)))))},k.preclip=function(_){return arguments.length?(g=_,p=void 0,F()):g},k.postclip=function(_){return arguments.length?(v=_,m=y=b=x=null,F()):v},k.clipAngle=function(_){return arguments.length?(g=+_?yW(p=_*xe):(p=null,ES),F()):p*lt},k.clipExtent=function(_){return arguments.length?(v=_==null?(m=y=b=x=null,Uc):C5(m=+_[0][0],y=+_[0][1],b=+_[1][0],x=+_[1][1]),F()):m==null?null:[[m,y],[b,x]]},k.scale=function(_){return arguments.length?(n=+_,T()):n},k.translate=function(_){return arguments.length?(i=+_[0],r=+_[1],T()):[i,r]},k.center=function(_){return arguments.length?(o=_[0]%360*xe,s=_[1]%360*xe,T()):[o*lt,s*lt]},k.rotate=function(_){return arguments.length?(a=_[0]%360*xe,u=_[1]%360*xe,l=_.length>2?_[2]%360*xe:0,T()):[a*lt,u*lt,l*lt]},k.angle=function(_){return arguments.length?(f=_%360*xe,T()):f*lt},k.reflectX=function(_){return arguments.length?(d=_?-1:1,T()):d<0},k.reflectY=function(_){return arguments.length?(h=_?-1:1,T()):h<0},k.precision=function(_){return arguments.length?(w=TS(E,A=_*_),F()):Cn(A)},k.fitExtent=function(_,D){return Lg(k,_,D)},k.fitSize=function(_,D){return R2(k,_,D)},k.fitWidth=function(_,D){return N2(k,_,D)},k.fitHeight=function(_,D){return L2(k,_,D)};function T(){var _=MS(n,0,0,d,h,f).apply(null,t(o,s)),D=MS(n,i-_[0],r-_[1],d,h,f);return c=v5(a,u,l),E=Ry(t,D),C=Ry(c,E),w=TS(E,A),F()}function F(){return S=$=null,k}return function(){return t=e.apply(this,arguments),k.invert=t.invert&&L,T()}}function P2(e){var t=0,n=Ee/3,i=P5(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*xe,n=o[1]*xe):[t*lt,n*lt]},r}function PW(e){var t=ae(e);function n(i,r){return[i*t,ie(r)/t]}return n.invert=function(i,r){return[i/t,Pn(r*t)]},n}function IW(e,t){var n=ie(e),i=(n+ie(t))/2;if(Ce(i)<se)return PW(e);var r=1+n*(2*i-n),o=Cn(r)/i;function s(a,u){var l=Cn(r-2*i*ie(u))/i;return[l*ie(a*=i),o-l*ae(a)]}return s.invert=function(a,u){var l=o-u,c=bi(a,Ce(l))*li(l);return l*i<0&&(c-=Ee*li(a)*li(l)),[c/i,Pn((r-(a*a+l*l)*i*i)/(2*i))]},s}function up(){return P2(IW).scale(155.424).center([0,33.6442])}function I5(){return up().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function BW(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function zW(){var e,t,n=I5(),i,r=up().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=up().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(o.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=BW([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),o=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+se,g+.12*h+se],[p-.214*h-se,g+.234*h-se]]).stream(l),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+se,g+.166*h+se],[p-.115*h-se,g+.234*h-se]]).stream(l),f()},c.fitExtent=function(d,h){return Lg(c,d,h)},c.fitSize=function(d,h){return R2(c,d,h)},c.fitWidth=function(d,h){return N2(c,d,h)},c.fitHeight=function(d,h){return L2(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function B5(e){return function(t,n){var i=ae(t),r=ae(n),o=e(i*r);return o===1/0?[2,0]:[o*r*ie(t),o*ie(n)]}}function kf(e){return function(t,n){var i=Cn(t*t+n*n),r=e(i),o=ie(r),s=ae(r);return[bi(t*o,i*s),Pn(i&&n*o/i)]}}var z5=B5(function(e){return Cn(2/(1+e))});z5.invert=kf(function(e){return 2*Pn(e/2)});function UW(){return $r(z5).scale(124.75).clipAngle(180-.001)}var U5=B5(function(e){return(e=l5(e))&&e/ie(e)});U5.invert=kf(function(e){return e});function jW(){return $r(U5).scale(79.4188).clipAngle(180-.001)}function Pg(e,t){return[e,qh(T2((at+t)/2))]}Pg.invert=function(e,t){return[e,2*ll(u5(t))-at]};function qW(){return j5(Pg).scale(961/wn)}function j5(e){var t=$r(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=Ee*i(),d=t(lW(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Pg?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function bd(e){return T2((at+e)/2)}function WW(e,t){var n=ae(e),i=e===t?ie(e):qh(n/ae(t))/qh(bd(t)/bd(e)),r=n*Cm(bd(e),i)/i;if(!i)return Pg;function o(s,a){r>0?a<-at+se&&(a=-at+se):a>at-se&&(a=at-se);var u=r/Cm(bd(a),i);return[u*ie(i*s),r-u*ae(i*s)]}return o.invert=function(s,a){var u=r-a,l=li(i)*Cn(s*s+u*u),c=bi(s,Ce(u))*li(u);return u*i<0&&(c-=Ee*li(s)*li(u)),[c/i,2*ll(Cm(r/l,1/i))-at]},o}function HW(){return P2(WW).scale(109.5).parallels([30,30])}function lp(e,t){return[e,t]}lp.invert=lp;function GW(){return $r(lp).scale(152.63)}function YW(e,t){var n=ae(e),i=e===t?ie(e):(n-ae(t))/(t-e),r=n/i+e;if(Ce(i)<se)return lp;function o(s,a){var u=r-a,l=i*s;return[u*ie(l),r-u*ae(l)]}return o.invert=function(s,a){var u=r-a,l=bi(s,Ce(u))*li(u);return u*i<0&&(l-=Ee*li(s)*li(u)),[l/i,r-li(i)*Cn(s*s+u*u)]},o}function VW(){return P2(YW).scale(131.154).center([0,13.9389])}var vc=1.340264,Ec=-.081106,Ac=893e-6,wc=.003796,cp=Cn(3)/2,XW=12;function q5(e,t){var n=Pn(cp*ie(t)),i=n*n,r=i*i*i;return[e*ae(n)/(cp*(vc+3*Ec*i+r*(7*Ac+9*wc*i))),n*(vc+Ec*i+r*(Ac+wc*i))]}q5.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<XW&&(a=n*(vc+Ec*i+r*(Ac+wc*i))-t,u=vc+3*Ec*i+r*(7*Ac+9*wc*i),n-=s=a/u,i=n*n,r=i*i*i,!(Ce(s)<Uh));++o);return[cp*e*(vc+3*Ec*i+r*(7*Ac+9*wc*i))/ae(n),Pn(ie(n)/cp)]};function KW(){return $r(q5).scale(177.158)}function W5(e,t){var n=ae(t),i=ae(e)*n;return[n*ie(e)/i,ie(t)/i]}W5.invert=kf(ll);function JW(){return $r(W5).scale(144.049).clipAngle(60)}function QW(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,p=Ng({point:function(v,A){var w=x([v,A]);this.stream.point(w[0],w[1])}}),g=Uc,m,y;function b(){return d=e*i,h=e*r,m=y=null,x}function x(v){var A=v[0]*d,w=v[1]*h;if(o){var E=w*s-A*a;A=A*s+w*a,w=E}return[A+t,w+n]}return x.invert=function(v){var A=v[0]-t,w=v[1]-n;if(o){var E=w*s+A*a;A=A*s-w*a,w=E}return[A/d,w/h]},x.stream=function(v){return m&&y===v?m:m=p(g(y=v))},x.postclip=function(v){return arguments.length?(g=v,u=l=c=f=null,b()):g},x.clipExtent=function(v){return arguments.length?(g=v==null?(u=l=c=f=null,Uc):C5(u=+v[0][0],l=+v[0][1],c=+v[1][0],f=+v[1][1]),b()):u==null?null:[[u,l],[c,f]]},x.scale=function(v){return arguments.length?(e=+v,b()):e},x.translate=function(v){return arguments.length?(t=+v[0],n=+v[1],b()):[t,n]},x.angle=function(v){return arguments.length?(o=v%360*xe,a=ie(o),s=ae(o),b()):o*lt},x.reflectX=function(v){return arguments.length?(i=v?-1:1,b()):i<0},x.reflectY=function(v){return arguments.length?(r=v?-1:1,b()):r<0},x.fitExtent=function(v,A){return Lg(x,v,A)},x.fitSize=function(v,A){return R2(x,v,A)},x.fitWidth=function(v,A){return N2(x,v,A)},x.fitHeight=function(v,A){return L2(x,v,A)},x}function H5(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}H5.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(Ce(r)>se&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function ZW(){return $r(H5).scale(175.295)}function G5(e,t){return[ae(t)*ie(e),ie(t)]}G5.invert=kf(Pn);function eH(){return $r(G5).scale(249.5).clipAngle(90+se)}function Y5(e,t){var n=ae(t),i=1+ae(e)*n;return[n*ie(e)/i,ie(t)/i]}Y5.invert=kf(function(e){return 2*ll(e)});function tH(){return $r(Y5).scale(250).clipAngle(142)}function V5(e,t){return[qh(T2((at+t)/2)),-e]}V5.invert=function(e,t){return[-t,2*ll(u5(e))-at]};function nH(){var e=j5(V5),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var iH=Math.abs,Hy=Math.cos,fp=Math.sin,rH=1e-6,X5=Math.PI,Gy=X5/2,OS=oH(2);function RS(e){return e>1?Gy:e<-1?-Gy:Math.asin(e)}function oH(e){return e>0?Math.sqrt(e):0}function sH(e,t){var n=e*fp(t),i=30,r;do t-=r=(t+fp(t)-n)/(1+Hy(t));while(iH(r)>rH&&--i>0);return t/2}function aH(e,t,n){function i(r,o){return[e*r*Hy(o=sH(n,o)),t*fp(o)]}return i.invert=function(r,o){return o=RS(o/t),[r/(e*Hy(o)),RS((2*o+fp(2*o))/n)]},i}var uH=aH(OS/Gy,OS,X5);function lH(){return $r(uH).scale(169.529)}const cH=L5(),Yy=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function fH(e,t){return function n(){const i=t();return i.type=e,i.path=L5().projection(i),i.copy=i.copy||function(){const r=n();return Yy.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},fT(i)}}function I2(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(dp[e]=fH(e,t),this):dp[e]||null}function K5(e){return e&&e.path||cH}const dp={albers:I5,albersusa:zW,azimuthalequalarea:UW,azimuthalequidistant:jW,conicconformal:HW,conicequalarea:up,conicequidistant:VW,equalEarth:KW,equirectangular:GW,gnomonic:JW,identity:QW,mercator:qW,mollweide:lH,naturalEarth1:ZW,orthographic:eH,stereographic:tH,transversemercator:nH};for(const e in dp)I2(e,dp[e]);function dH(){}const Br=[[],[[[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 J5(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),hH(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(pH((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,Br[m<<1].forEach(x);++h<e-1;)g=m,m=u[h+1]>=l,Br[g|m<<1].forEach(x);for(Br[m<<0].forEach(x);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,Br[m<<1|y<<2].forEach(x);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,Br[g|m<<1|y<<2|b<<3].forEach(x);Br[m|y<<3].forEach(x)}for(h=-1,y=u[p*e]>=l,Br[y<<2].forEach(x);++h<e-1;)b=y,y=u[p*e+h+1]>=l,Br[y<<2|b<<3].forEach(x);Br[y<<3].forEach(x);function x(v){var A=[v[0][0]+h,v[0][1]+p],w=[v[1][0]+h,v[1][1]+p],E=s(A),C=s(w),S,$;(S=d[E])?($=f[C])?(delete d[S.end],delete f[$.start],S===$?(S.ring.push(w),c(S.ring)):f[S.start]=d[$.end]={start:S.start,end:$.end,ring:S.ring.concat($.ring)}):(delete d[S.end],S.ring.push(w),d[S.end=C]=S):(S=f[C])?($=d[E])?(delete f[S.start],delete d[$.end],S===$?(S.ring.push(w),c(S.ring)):f[$.start]=d[S.end]={start:$.start,end:S.end,ring:$.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(A),f[S.start=E]=S):f[E]=d[C]={start:E,end:C,ring:[A,w]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||O("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:dH,i):n===a},i}function hH(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function pH(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=gH(e,t[n]))return r;return 0}function gH(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(mH(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function mH(e,t,n){var i;return yH(e,t,n)&&bH(e[i=+(e[0]===t[0])],n[i],t[i])}function yH(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function bH(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function Q5(e,t,n){return function(i){var r=mr(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?ea(o,s,e):a/(e+1);return Yn(o+u,s,u)}}function B2(e){M.call(this,null,e)}B2.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"}]};H(B2,M,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||An,o=J5().smooth(e.smooth!==!1),s=e.thresholds||xH(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,Z(s)?s:s(c.values));vH(f,c,l,e),f.forEach(d=>{u.push(rg(l,Re(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function xH(e,t,n){const i=Q5(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Hs(t(r).values)))}function vH(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ye(r)&&(r=r(n,i)),ye(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(Ko(r)?r:r[0])||1,a=(Ko(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(Z5(t,s,a,u,l))}function Z5(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function NS(e,t,n){const i=e>=0?e:Rx(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function km(e){return ye(e)?e:ln(+e)}function eO(){var e=u=>u[0],t=u=>u[1],n=Zu,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=NS(i[0],u,e)>>s,f=NS(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>s),g=2*h+(o>>s),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(v=>{const A=d+(+e(v)>>s),w=h+(+t(v)>>s);A>=0&&A<p&&w>=0&&w<g&&(m[A+w*p]+=+n(v))}),c>0&&f>0?(Ga(p,g,m,y,c),Ya(p,g,y,m,f),Ga(p,g,m,y,c),Ya(p,g,y,m,f),Ga(p,g,m,y,c),Ya(p,g,y,m,f)):c>0?(Ga(p,g,m,y,c),Ga(p,g,y,m,c),Ga(p,g,m,y,c),b=y):f>0&&(Ya(p,g,m,y,f),Ya(p,g,y,m,f),Ya(p,g,m,y,f),b=y);const x=l?Math.pow(2,-2*s):1/Ik(b);for(let v=0,A=p*g;v<A;++v)b[v]*=x;return{values:b,scale:1<<s,width:p,height:g,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=km(u),a):e},a.y=function(u){return arguments.length?(t=km(u),a):t},a.weight=function(u){return arguments.length?(n=km(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||O("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||O("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=re(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&O("invalid bandwidth"),i=u,a):i},a}function Ga(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function Ya(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function z2(e){M.call(this,null,e)}z2.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 EH=["x","y","weight","size","cellSize","bandwidth"];function tO(e,t){return EH.forEach(n=>t[n]!=null?e[n](t[n]):0),e}H(z2,M,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=AH(i,e.groupby),o=(e.groupby||[]).map(ut),s=tO(eO(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Re(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function AH(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function U2(e){M.call(this,null,e)}U2.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};H(U2,M,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=J5().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||Q5(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=tO(eO(),e)(r,!0),u=Z5(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=Z(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Re),n}});const Vy="Feature",j2="FeatureCollection",wH="MultiPoint";function q2(e){M.call(this,null,e)}q2.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};H(q2,M,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&An,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(nn(a))||o&&t.modified(nn(o))||s&&t.modified(nn(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Vy,geometry:{type:wH,coordinates:i}})),this.value={type:j2,features:n}}});function W2(e){M.call(this,null,e)}W2.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"}]};H(W2,M,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||An,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=K5(e.projection),n.materialize().reflow()):s=r===An||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=CH(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function CH(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function H2(e){M.call(this,null,e)}H2.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"]}]};H(H2,M,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function G2(e){M.call(this,null,e)}G2.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"}]};H(G2,M,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=SH(K5(e.projection),e.field||pi("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function SH(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function Y2(e){M.call(this,[],e),this.generator=xW()}Y2.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}]};H(Y2,M,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ye(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(FD(n[0],r)):t.add.push(Re(r)),n[0]=r,t}});function V2(e){M.call(this,null,e)}V2.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"}]};H(V2,M,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||An,o=$H(e.opacity,e),s=_H(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Hs(n.map(l=>Hs(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=me({},l,u);i||(f.$max=Hs(c.values||[])),l[a]=FH(c,f,s.dep?s:ln(s(f)),o.dep?o:ln(o(f)))}),t.reflow(!0).modifies(a)}});function _H(e,t){let n;return ye(e)?(n=i=>dh(e(i,t)),n.dep=nO(e)):n=ln(dh(e||"#888")),n}function $H(e,t){let n;return ye(e)?(n=i=>e(i,t),n.dep=nO(e)):e?n=ln(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function nO(e){if(!ye(e))return!1;const t=Pi(nn(e));return t.$x||t.$y||t.$value||t.$max}function FH(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:Oo,d=Yo(u-s,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-s,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,x=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+x);const v=n(t);g[y+0]=v.r,g[y+1]=v.g,g[y+2]=v.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function iO(e){M.call(this,null,e),this.modified(!0)}H(iO,M,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=DH(e.type),Yy.forEach(i=>{e[i]!=null&&LS(n,i,e[i])})):Yy.forEach(i=>{e.modified(i)&&LS(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&kH(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function kH(e,t){const n=TH(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function DH(e){const t=I2((e||"mercator").toLowerCase());return t||O("Unrecognized projection type: "+e),t()}function LS(e,t,n){ye(e[t])&&e[t](n)}function TH(e){return e=re(e),e.length===1?e[0]:{type:j2,features:e.reduce((t,n)=>t.concat(MH(n)),[])}}function MH(e){return e.type===j2?e.features:re(e).filter(t=>t!=null).map(t=>t.type===Vy?t:{type:Vy,geometry:t})}const OH=Object.freeze(Object.defineProperty({__proto__:null,contour:U2,geojson:q2,geopath:W2,geopoint:H2,geoshape:G2,graticule:Y2,heatmap:V2,isocontour:B2,kde2d:z2,projection:iO},Symbol.toStringTag,{value:"Module"}));function RH(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function NH(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return rO(this.cover(t,n),t,n,e)}function rO(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|g]))return r[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function LH(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)rO(this,s[n],a[n],e[n]);return this}function PH(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function IH(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function BH(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function yn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function zH(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new yn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(s=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new yn(h[3],m,y,u,l),new yn(h[2],s,y,m,l),new yn(h[1],m,a,u,y),new yn(h[0],s,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),x=t-+this._y.call(null,h.data),v=b*b+x*x;if(v<n){var A=Math.sqrt(n=v);r=e-A,o=t-A,c=e+A,f=t+A,i=h.data}}return i}function UH(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(s+u)/2))?s=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function jH(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function qH(){return this._root}function WH(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function HH(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new yn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new yn(r,l,c,a,u)),(r=i[2])&&t.push(new yn(r,o,c,l,u)),(r=i[1])&&t.push(new yn(r,l,s,a,c)),(r=i[0])&&t.push(new yn(r,o,s,l,c))}return this}function GH(e){var t=[],n=[],i;for(this._root&&t.push(new yn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new yn(o,s,a,c,f)),(o=r[1])&&t.push(new yn(o,c,a,u,f)),(o=r[2])&&t.push(new yn(o,s,f,c,l)),(o=r[3])&&t.push(new yn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function YH(e){return e[0]}function VH(e){return arguments.length?(this._x=e,this):this._x}function XH(e){return e[1]}function KH(e){return arguments.length?(this._y=e,this):this._y}function X2(e,t,n){var i=new K2(t??YH,n??XH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function K2(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function PS(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var _n=X2.prototype=K2.prototype;_n.copy=function(){var e=new K2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=PS(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=PS(i));return e};_n.add=NH;_n.addAll=LH;_n.cover=PH;_n.data=IH;_n.extent=BH;_n.find=zH;_n.remove=UH;_n.removeAll=jH;_n.root=qH;_n.size=WH;_n.visit=HH;_n.visitAfter=GH;_n.x=VH;_n.y=KH;function bn(e){return function(){return e}}function Uo(e){return(e()-.5)*1e-6}function JH(e){return e.x+e.vx}function QH(e){return e.y+e.vy}function ZH(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=bn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<o;++y)for(f=X2(t,JH,QH).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(x,v,A,w,E){var C=x.data,S=x.r,$=g+S;if(C){if(C.index>d.index){var k=h-C.x-C.vx,L=p-C.y-C.vy,T=k*k+L*L;T<$*$&&(k===0&&(k=Uo(i),T+=k*k),L===0&&(L=Uo(i),T+=L*L),T=($-(T=Math.sqrt(T)))/T*r,d.vx+=(k*=T)*($=(S*=S)/(m+S)),d.vy+=(L*=T)*$,C.vx-=k*($=1-$),C.vy-=L*$)}return}return v>h+$||w<h-$||A>p+$||E<p-$}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:bn(+l),u(),s):e},s}function eG(e){return e.index}function IS(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function tG(e){var t=eG,n=f,i,r=bn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var x=0,v,A,w,E,C,S,$;x<b;++x)v=e[x],A=v.source,w=v.target,E=w.x+w.vx-A.x-A.vx||Uo(l),C=w.y+w.vy-A.y-A.vy||Uo(l),S=Math.sqrt(E*E+C*C),S=(S-o[x])/S*m*i[x],E*=S,C*=S,w.vx-=E*($=u[x]),w.vy-=C*$,A.vx+=E*($=1-$),A.vy+=C*$}function h(){if(s){var m,y=s.length,b=e.length,x=new Map(s.map((A,w)=>[t(A,w,s),A])),v;for(m=0,a=new Array(y);m<b;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=IS(x,v.source)),typeof v.target!="object"&&(v.target=IS(x,v.target)),a[v.source.index]=(a[v.source.index]||0)+1,a[v.target.index]=(a[v.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)v=e[m],u[m]=a[v.source.index]/(a[v.source.index]+a[v.target.index]);i=new Array(b),p(),o=new Array(b),g()}}function p(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:bn(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:bn(+m),g(),d):r},d}function nG(e,t,n){var i=new l9,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?c9():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const iG=1664525,rG=1013904223,BS=4294967296;function oG(){let e=1;return()=>(e=(iG*e+rG)%BS)/BS}function sG(e){return e.x}function aG(e){return e.y}var uG=10,lG=Math.PI*(3-Math.sqrt(5));function cG(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=f9(f),l=d9("tick","end"),c=oG();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var x=0;x<g;++x)for(n+=(o-n)*r,a.forEach(function(v){v(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=uG*Math.sqrt(.5+g),x=g*lG;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(o=+g,t):o},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,x=e.length,v,A,w,E,C;for(y==null?y=1/0:y*=y,b=0;b<x;++b)E=e[b],v=g-E.x,A=m-E.y,w=v*v+A*A,w<y&&(C=E,y=w);return C},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function fG(){var e,t,n,i,r=bn(-30),o,s=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=X2(e,sG,aG).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(o=new Array(p),h=0;h<p;++h)g=e[h],o[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,x,v;if(h.length){for(b=x=v=0;v<4;++v)(g=h[v])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,x+=m*g.y);h.x=b/y,h.y=x/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=o[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,x=m-p,v=y*y+b*b;if(x*x/u<v)return v<a&&(y===0&&(y=Uo(n),v+=y*y),b===0&&(b=Uo(n),v+=b*b),v<s&&(v=Math.sqrt(s*v)),t.vx+=y*h.value*i/v,t.vy+=b*h.value*i/v),!0;if(h.length||v>=a)return;(h.data!==t||h.next)&&(y===0&&(y=Uo(n),v+=y*y),b===0&&(b=Uo(n),v+=b*b),v<s&&(v=Math.sqrt(s*v)));do h.data!==t&&(x=o[h.data.index]*i/v,t.vx+=y*x,t.vy+=b*x);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:bn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function dG(e){var t=bn(.1),n,i,r;typeof e!="function"&&(e=bn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:bn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:bn(+a),s(),o):e},o}function hG(e){var t=bn(.1),n,i,r;typeof e!="function"&&(e=bn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:bn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:bn(+a),s(),o):e},o}const zS={center:RH,collide:ZH,nbody:fG,link:tG,x:dG,y:hG},lc="forces",Xy=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],pG=["static","iterations"],oO=["x","y","vx","vy"];function J2(e){M.call(this,null,e)}J2.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:oO}]};H(J2,M,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Xy),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&sO(n,e,0,t)):(this.value=n=mG(t.source,e),n.on("tick",gG(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(pG)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==lc||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(oO)}});function gG(e,t){return()=>e.touch(t).run()}function mG(e,t){const n=cG(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),sO(n,t,!0).on("end",()=>o=!0)}function sO(e,t,n,i){var r=re(t.forces),o,s,a,u;for(o=0,s=Xy.length;o<s;++o)a=Xy[o],a!==lc&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=lc+o,a=n||t.modified(lc,o)?bG(r[o]):i&&yG(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(lc+o,null);return e.numForces=r.length,e}function yG(e,t){var n,i;for(n in e)if(ye(i=e[n])&&t.modified(nn(i)))return 1;return 0}function bG(e){var t,n;ue(zS,e.force)||O("Unrecognized force: "+e.force),t=zS[e.force]();for(n in e)ye(t[n])&&xG(t[n],e[n],e);return t}function xG(e,t,n){e(ye(t)?i=>t(i,n):t)}const vG=Object.freeze(Object.defineProperty({__proto__:null,force:J2},Symbol.toStringTag,{value:"Module"}));function EG(e,t){return e.parent===t.parent?1:2}function AG(e){return e.reduce(wG,0)/e.length}function wG(e,t){return e+t.x}function CG(e){return 1+e.reduce(SG,0)}function SG(e,t){return Math.max(e,t.y)}function _G(e){for(var t;t=e.children;)e=t[0];return e}function $G(e){for(var t;t=e.children;)e=t[t.length-1];return e}function FG(){var e=EG,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=AG(h),d.y=CG(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=_G(o),l=$G(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function kG(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function DG(){return this.eachAfter(kG)}function TG(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function MG(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function OG(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function RG(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function NG(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function LG(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function PG(e){for(var t=this,n=IG(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function IG(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function BG(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function zG(){return Array.from(this)}function UG(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function jG(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*qG(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function Q2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=GG)):t===void 0&&(t=HG);for(var n=new Nu(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new Nu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(aO)}function WG(){return Q2(this).eachBefore(YG)}function HG(e){return e.children}function GG(e){return Array.isArray(e)?e[1]:null}function YG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function aO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Nu(e){this.data=e,this.depth=this.height=0,this.parent=null}Nu.prototype=Q2.prototype={constructor:Nu,count:DG,each:TG,eachAfter:OG,eachBefore:MG,find:RG,sum:NG,sort:LG,path:PG,ancestors:BG,descendants:zG,leaves:UG,links:jG,copy:WG,[Symbol.iterator]:qG};function Qd(e){return e==null?null:uO(e)}function uO(e){if(typeof e!="function")throw new Error;return e}function Us(){return 0}function eu(e){return function(){return e}}const VG=1664525,XG=1013904223,US=4294967296;function KG(){let e=1;return()=>(e=(VG*e+XG)%US)/US}function JG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function QG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function ZG(e,t){for(var n=0,i=(e=QG(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&lO(s,o)?++n:(s=tY(r=eY(r,o)),n=0);return s}function eY(e,t){var n,i;if(Dm(t,e))return[t];for(n=0;n<e.length;++n)if(xd(t,e[n])&&Dm(cc(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(xd(cc(e[n],e[i]),t)&&xd(cc(e[n],t),e[i])&&xd(cc(e[i],t),e[n])&&Dm(cO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function xd(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function lO(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Dm(e,t){for(var n=0;n<t.length;++n)if(!lO(e,t[n]))return!1;return!0}function tY(e){switch(e.length){case 1:return nY(e[0]);case 2:return cc(e[0],e[1]);case 3:return cO(e[0],e[1],e[2])}}function nY(e){return{x:e.x,y:e.y,r:e.r}}function cc(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function cO(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,p=r-a,g=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,x=b-s*s-a*a+u*u,v=b-l*l-c*c+f*f,A=h*p-d*g,w=(p*v-g*x)/(A*2)-i,E=(g*m-p*y)/A,C=(h*x-d*v)/(A*2)-r,S=(d*y-h*m)/A,$=E*E+S*S-1,k=2*(o+w*E+C*S),L=w*w+C*C-o*o,T=-(Math.abs($)>1e-6?(k+Math.sqrt(k*k-4*$*L))/(2*$):L/k);return{x:i+w+E*T,y:r+C+S*T,r:T}}function jS(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function qS(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function WS(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function vd(e){this._=e,this.next=null,this.previous=null}function iY(e,t){if(!(o=(e=JG(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;jS(i,n,r=e[2]),n=new vd(n),i=new vd(i),r=new vd(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){jS(n._,i._,r=e[u]),r=new vd(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(qS(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(qS(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=WS(n);(r=r.next)!==i;)(a=WS(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=ZG(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function rY(e){return Math.sqrt(e.value)}function oY(){var e=null,t=1,n=1,i=Us;function r(o){const s=KG();return o.x=t/2,o.y=n/2,e?o.eachBefore(HS(e)).eachAfter(Tm(i,.5,s)).eachBefore(GS(1)):o.eachBefore(HS(rY)).eachAfter(Tm(Us,1,s)).eachAfter(Tm(i,o.r/Math.min(t,n),s)).eachBefore(GS(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=Qd(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:eu(+o),r):i},r}function HS(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Tm(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=iY(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function GS(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function fO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Df(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function sY(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(fO),s}function o(s,a){return function(u){u.children&&Df(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var aY={depth:-1},YS={},Mm={};function uY(e){return e.id}function lY(e){return e.parentId}function VS(){var e=uY,t=lY,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=o.map((v,A)=>cY(n(v,A,r))),b=y.map(XS),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(XS(v)),o.push(Mm));s=(v,A)=>y[A],a=(v,A)=>b[A]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new Nu(l),(p=s(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?YS:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=o[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===YS)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Mm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Mm);--y)h.data=null}if(f.parent=aY,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(aO),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Qd(r),i):e},i.parentId=function(r){return arguments.length?(t=Qd(r),i):t},i.path=function(r){return arguments.length?(n=Qd(r),i):n},i}function cY(e){e=`${e}`;let t=e.length;return Ky(e,t-1)&&!Ky(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function XS(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Ky(e,t););return e.slice(0,t)}function Ky(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function fY(e,t){return e.parent===t.parent?1:2}function Om(e){var t=e.children;return t?t[0]:e.t}function Rm(e){var t=e.children;return t?t[t.length-1]:e.t}function dY(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function hY(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function pY(e,t,n){return e.a.parent===t.parent?e.a:n}function Zd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Zd.prototype=Object.create(Nu.prototype);function gY(e){for(var t=new Zd(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new Zd(o[s],s)),r.parent=n;return(t.parent=new Zd(null,0)).children=[t],t}function mY(){var e=fY,t=1,n=1,i=null;function r(l){var c=gY(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){hY(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,x=g.m,v;p=Rm(p),d=Om(d),p&&d;)g=Om(g),h=Rm(h),h.a=l,v=p.z+b-d.z-m+e(p._,d._),v>0&&(dY(pY(p,l,f),l,v),m+=v,y+=v),b+=p.m,m+=d.m,x+=g.m,y+=h.m;p&&!Rm(h)&&(h.t=p,h.m+=b-y),d&&!Om(g)&&(g.t=d,g.m+=m-x,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function Ig(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var dO=(1+Math.sqrt(5))/2;function hO(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,x,v,A,w;c<d;){h=r-n,p=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,A=Math.max(p/h,h/p)/(g*e),w=m*m*A,v=Math.max(b/w,w/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),w=m*m*A,x=Math.max(b/w,w/y),x>v){m-=l;break}v=x}s.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?Df(u,n,i,r,g?i+=p*m/g:o):Ig(u,n,i,g?n+=h*m/g:r,o),g-=m,c=f}return s}const pO=(function e(t){function n(i,r,o,s,a){hO(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n})(dO);function yY(){var e=pO,t=!1,n=1,i=1,r=[0],o=Us,s=Us,a=Us,u=Us,l=Us;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(fO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,p+=l(d)-h,g+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=uO(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:eu(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:eu(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:eu(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:eu(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:eu(+d),c):l},c}function bY(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=o[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var x=l[f],v=h/2+x,A=f+1,w=d-1;A<w;){var E=A+w>>>1;l[E]<v?A=E+1:w=E}v-l[A-1]<l[A]-v&&f+1<A&&--A;var C=l[A]-x,S=h-C;if(m-p>y-g){var $=h?(p*S+m*C)/h:m;c(f,A,C,p,g,$,y),c(A,d,S,$,g,m,y)}else{var k=h?(g*S+y*C)/h:y;c(f,A,C,p,g,m,k),c(A,d,S,p,k,m,y)}}}function xY(e,t,n,i,r){(e.depth&1?Ig:Df)(e,t,n,i,r)}const vY=(function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?Df(l,r,o,s,g?o+=(a-o)*l.value/g:a):Ig(l,r,o,g?r+=(s-r)*l.value/g:s,a),g-=l.value}else i._squarify=u=hO(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n})(dO);function Jy(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function Z2(e){M.call(this,null,e)}Z2.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const EY=e=>e.values;H(Z2,M,{transform(e,t){t.source||O("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&ig(s.data)&&r.rem.push(s.data)}),this.value=o=Q2({values:re(e.keys).reduce((s,a)=>(s.key(a),s),AY()).entries(r.source)},EY),n&&o.each(s=>{s.children&&(s=Re(s.data),r.add.push(s),r.source.push(s))}),Jy(o,ne,ne)),r.source.root=o,r}});function AY(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function go(e){M.call(this,null,e)}const wY=(e,t)=>e.parent===t.parent?1:2;H(go,M,{transform(e,t){(!t.source||!t.source.root)&&O(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Ca(e.sort,s=>s.data)),CY(n,this.params,e),n.separation&&n.separation(e.separation!==!1?wY:Zu);try{this.value=n(r)}catch(s){O(s)}return r.each(s=>SY(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function CY(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function SY(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const Qy=["x","y","r","depth","children"];function eE(e){go.call(this,e)}eE.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Qy.length,default:Qy}]};H(eE,go,{layout:oY,params:["radius","size","padding"],fields:Qy});const Zy=["x0","y0","x1","y1","depth","children"];function tE(e){go.call(this,e)}tE.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Zy.length,default:Zy}]};H(tE,go,{layout:sY,params:["size","round","padding"],fields:Zy});function nE(e){M.call(this,null,e)}nE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};H(nE,M,{transform(e,t){t.source||O("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?Jy(VS().id(e.key).parentId(e.parentKey)(r.source),e.key,gi):Jy(VS()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const KS={tidy:mY,cluster:FG},eb=["x","y","depth","children"];function iE(e){go.call(this,e)}iE.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:eb.length,default:eb}]};H(iE,go,{layout(e){const t=e||"tidy";if(ue(KS,t))return KS[t]();O("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:eb});function rE(e){M.call(this,[],e)}rE.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};H(rE,M,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||O("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ne(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ne(a)]&&o[ne(u)]&&r.add.push(Re({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ne(s)]=1),n.forEach(s=>{(o[ne(s.source)]||o[ne(s.target)])&&r.mod.push(s)})),r}});const JS={binary:bY,dice:Df,slice:Ig,slicedice:xY,squarify:pO,resquarify:vY},tb=["x0","y0","x1","y1","depth","children"];function oE(e){go.call(this,e)}oE.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:tb.length,default:tb}]};H(oE,go,{layout(){const e=yY();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ue(JS,t)?e.tile(JS[t]):O("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:tb});const _Y=Object.freeze(Object.defineProperty({__proto__:null,nest:Z2,pack:eE,partition:tE,stratify:nE,tree:iE,treelinks:rE,treemap:oE},Symbol.toStringTag,{value:"Module"})),Nm=4278190080;function $Y(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function FY(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=Yo(o,s).getContext("2d"),l=Yo(o,s).getContext("2d"),c=a&&Yo(o,s).getContext("2d");n.forEach(C=>eh(u,C,!1)),eh(l,t,!1),a&&eh(c,t,!0);const f=Lm(u,o,s),d=Lm(l,o,s),h=a&&Lm(c,o,s),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,x,v,A,w,E;for(y=0;y<s;++y)for(m=0;m<o;++m)v=y*o+m,A=f[v]&Nm,E=d[v]&Nm,w=a&&h[v]&Nm,(A||w||E)&&(b=e(m),x=e(y),!r&&(A||E)&&p.set(b,x),a&&(A||w)&&g.set(b,x));return[p,g]}function Lm(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function eh(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>eh(e,o.items,n))}):ni[i].draw(e,{items:n?t.map(kY):t})}function kY(e){const t=rg(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const zr=5,cn=31,Wc=32,To=new Uint32Array(Wc+1),ki=new Uint32Array(Wc+1);ki[0]=0;To[0]=~ki[0];for(let e=1;e<=Wc;++e)ki[e]=ki[e-1]<<1|1,To[e]=~ki[e];function DY(e,t){const n=new Uint32Array(~~((e*t+Wc)/Wc));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>zr]&1<<(a&cn)},set:(o,s)=>{const a=s*e+o;i(a>>>zr,1<<(a&cn))},clear:(o,s)=>{const a=s*e+o;r(a>>>zr,~(1<<(a&cn)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>zr,h=f>>>zr,d===h){if(n[d]&To[c&cn]&ki[(f&cn)+1])return!0}else{if(n[d]&To[c&cn]||n[h]&ki[(f&cn)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>zr,d=c>>>zr,f===d)i(f,To[l&cn]&ki[(c&cn)+1]);else for(i(f,To[l&cn]),i(d,ki[(c&cn)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>zr,d=c>>>zr,f===d)r(f,ki[l&cn]|To[(c&cn)+1]);else for(r(f,ki[l&cn]),r(d,To[(c&cn)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function TY(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>DY(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function MY(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=Kn.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,y,b;for(let x=0;x<u;++x)d=a[x].x,p=a[x].y,h=a[x].x2===void 0?d:a[x].x2,g=a[x].y2===void 0?p:a[x].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",p<0&&g<=o?s.baseline="top":0<=p&&o<g&&(s.baseline="bottom"),!0}}function hp(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function jo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function OY(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=o,b;if(!hp(p,g,d,h,r,o)&&!jo(e,p,g,h,d,m,s,a)&&!jo(e,p,g,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,jo(e,p,g,h,d,b,s,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Kn.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,x,v,A,w,E,C,S,$,k,L,T,F,_,D,P,B;for(let I=0;I<f;++I){for(b=c[I].x,v=c[I].y,x=c[I].x2===void 0?b:c[I].x2,A=c[I].y2===void 0?v:c[I].y2,b>x&&(B=b,b=x,x=B),v>A&&(B=v,v=A,A=B),$=e(b),L=e(x),k=~~(($+L)/2),T=e(v),_=e(A),F=~~((T+_)/2),C=k;C>=$;--C)for(S=F;S>=T;--S)P=u(C,S,p,h,d),P&&([l.x,l.y,p,g]=P);for(C=k;C<=L;++C)for(S=F;S<=_;++S)P=u(C,S,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(D=Math.abs(x-b+A-v),w=(b+x)/2,E=(v+A)/2,D>=y&&!hp(w,E,h,d,r,o)&&!jo(e,w,E,d,h,d,s,null)&&(y=D,l.x=w,l.y=E,m=!0))}return g||m?(w=h/2,E=d/2,s.setRange(e(l.x-w),e(l.y-E),e(l.x+w),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const RY=[-1,-1,1,1],NY=[-1,1,-1,1];function LY(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Kn.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,x,v,A,w,E,C,S,$,k,L,T,F;for(let _=0;_<f;++_){for(x=c[_].x,A=c[_].y,v=c[_].x2===void 0?x:c[_].x2,w=c[_].y2===void 0?A:c[_].y2,p.push([e((x+v)/2),e((A+w)/2)]);p.length;)if([S,$]=p.pop(),!(s.get(S,$)||a.get(S,$)||u.get(S,$))){u.set(S,$);for(let D=0;D<4;++D)E=S+RY[D],C=$+NY[D],u.outOfBounds(E,C,E,C)||p.push([E,C]);if(E=e.invert(S),C=e.invert($),k=g,L=o,!hp(E,C,h,d,r,o)&&!jo(e,E,C,d,h,k,s,a)&&!jo(e,E,C,d,h,d,s,null)){for(;L-k>=1;)T=(k+L)/2,jo(e,E,C,d,h,T,s,a)?L=T:k=T;k>g&&(l.x=E,l.y=C,g=k,m=!0)}}!m&&!n&&(F=Math.abs(v-x+w-A),E=(x+v)/2,C=(A+w)/2,F>=b&&!hp(E,C,h,d,r,o)&&!jo(e,E,C,d,h,d,s,null)&&(b=F,l.x=E,l.y=C,y=!0))}return m||y?(E=h/2,C=d/2,s.setRange(e(l.x-E),e(l.y-C),e(l.x+E),e(l.y+C)),l.align="center",l.baseline="middle",!0):!1}}const PY=["right","center","left"],IY=["bottom","middle","top"];function BY(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,p,g,m,y,b,x,v,A,w,E,C,S,$,k;for(let L=0;L<u;++L){if(h=(n[L]&3)-1,p=(n[L]>>>2&3)-1,g=h===0&&p===0||i[L]<0,m=h&&p?Math.SQRT1_2:1,y=i[L]<0?-1:1,b=c[1+h]+i[L]*h*m,E=c[4+p]+y*f*p/2+i[L]*p*m,v=E-f/2,A=E+f/2,C=e(b),$=e(v),k=e(A),!d)if(QS(C,C,$,k,s,a,b,b,v,A,c,g))d=Kn.width(l.datum,l.datum.text);else continue;if(w=b+y*d*h/2,b=w-d/2,x=w+d/2,C=e(b),S=e(x),QS(C,S,$,k,s,a,b,x,v,A,c,g))return l.x=h?h*y<0?x:b:w,l.y=p?p*y<0?A:v:E,l.align=PY[h*y+1],l.baseline=IY[p*y+1],s.setRange(C,$,S,k),!0}return!1}}function QS(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Pm=0,Im=4,Bm=8,zm=0,Um=1,jm=2,zY={"top-left":Pm+zm,top:Pm+Um,"top-right":Pm+jm,left:Im+zm,middle:Im+Um,right:Im+jm,"bottom-left":Bm+zm,bottom:Bm+Um,"bottom-right":Bm+jm},UY={naive:MY,"reduced-search":OY,floodfill:LY};function jY(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=qY(i,f),h=WY(r,f),p=HY(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=GY(p,g,a,u),b=l===null||l===1/0,x=m&&c==="naive";let v=-1,A=-1;const w=e.map($=>{const k=b?Kn.width($,$.text):void 0;return v=Math.max(v,k),A=Math.max(A,$.fontSize),{datum:$,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y($),textWidth:k}});l=l===null||l===1/0?Math.max(v,A)+Math.max(...i):l;const E=TY(t[0],t[1],l);let C;if(!x){n&&w.sort((L,T)=>n(L.datum,T.datum));let $=!1;for(let L=0;L<h.length&&!$;++L)$=h[L]===5||d[L]<0;const k=(p&&s||m)&&e.map(L=>L.datum);C=o.length||k?FY(E,k||[],o,$,m):$Y(E,s&&w)}const S=m?UY[c](E,C,s,u):BY(E,C,h,d);return w.forEach($=>$.opacity=+S($)),w}function qY(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function WY(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=zY[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function HY(e){return e&&e.mark&&e.mark.marktype}function GY(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const nb=["x","y","opacity","align","baseline"],gO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function sE(e){M.call(this,null,e)}sE.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:gO},{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:nb.length,default:nb}]};H(sE,M,{transform(e,t){function n(o){const s=e[o];return ye(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&O("Size parameter should be specified as a [width, height] array.");const r=e.as||nb;return jY(t.materialize(t.SOURCE).source||[],e.size,e.sort,re(e.offset==null?1:e.offset),re(e.anchor||gO),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const YY=Object.freeze(Object.defineProperty({__proto__:null,label:sE},Symbol.toStringTag,{value:"Module"}));function mO(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function aE(e){M.call(this,null,e)}aE.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};H(aE,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=mO(i,e.groupby),o=(e.groupby||[]).map(ut),s=o.length,a=e.as||[ut(e.x),ut(e.y)],u=[];r.forEach(l=>{GD(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Re(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const ib={constant:Gx,linear:Yx,log:jD,exp:qD,pow:WD,quad:Vx,poly:HD},VY=(e,t)=>e==="poly"?t:e==="quad"?2:1;function uE(e){M.call(this,null,e)}uE.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(ib)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};H(uE,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=mO(i,e.groupby),o=(e.groupby||[]).map(ut),s=e.method||"linear",a=e.order==null?3:e.order,u=VY(s,a),l=e.as||[ut(e.x),ut(e.y)],c=ib[s],f=[];let d=e.extent;ue(ib,s)||O("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Re({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||mr(h,e.x),y=b=>{const x={};for(let v=0;v<o.length;++v)x[o[v]]=h.dims[v];x[l[0]]=b[0],x[l[1]]=b[1],f.push(Re(x))};s==="linear"||s==="constant"?m.forEach(b=>y([b,g.predict(b)])):fg(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const XY=Object.freeze(Object.defineProperty({__proto__:null,loess:aE,regression:uE},Symbol.toStringTag,{value:"Module"})),to=11102230246251565e-32,Vt=134217729,KY=(3+8*to)*to;function qm(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function JY(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function Tf(e){return new Float64Array(e)}const QY=(3+16*to)*to,ZY=(2+12*to)*to,eV=(9+64*to)*to*to,Va=Tf(4),ZS=Tf(8),e_=Tf(12),t_=Tf(16),fn=Tf(4);function tV(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,p,g,m,y,b,x,v,A,w,E,C;const S=e-r,$=n-r,k=t-o,L=i-o;v=S*L,d=Vt*S,h=d-(d-S),p=S-h,d=Vt*L,g=d-(d-L),m=L-g,A=p*m-(v-h*g-p*g-h*m),w=k*$,d=Vt*k,h=d-(d-k),p=k-h,d=Vt*$,g=d-(d-$),m=$-g,E=p*m-(w-h*g-p*g-h*m),y=A-E,f=A-y,Va[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,Va[1]=x-(y+f)+(f-w),C=b+y,f=C-b,Va[2]=b-(C-f)+(y-f),Va[3]=C;let T=JY(4,Va),F=ZY*s;if(T>=F||-T>=F||(f=e-S,a=e-(S+f)+(f-r),f=n-$,l=n-($+f)+(f-r),f=t-k,u=t-(k+f)+(f-o),f=i-L,c=i-(L+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=eV*s+KY*Math.abs(T),T+=S*c+L*a-(k*l+$*u),T>=F||-T>=F))return T;v=a*L,d=Vt*a,h=d-(d-a),p=a-h,d=Vt*L,g=d-(d-L),m=L-g,A=p*m-(v-h*g-p*g-h*m),w=u*$,d=Vt*u,h=d-(d-u),p=u-h,d=Vt*$,g=d-(d-$),m=$-g,E=p*m-(w-h*g-p*g-h*m),y=A-E,f=A-y,fn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,fn[1]=x-(y+f)+(f-w),C=b+y,f=C-b,fn[2]=b-(C-f)+(y-f),fn[3]=C;const _=qm(4,Va,4,fn,ZS);v=S*c,d=Vt*S,h=d-(d-S),p=S-h,d=Vt*c,g=d-(d-c),m=c-g,A=p*m-(v-h*g-p*g-h*m),w=k*l,d=Vt*k,h=d-(d-k),p=k-h,d=Vt*l,g=d-(d-l),m=l-g,E=p*m-(w-h*g-p*g-h*m),y=A-E,f=A-y,fn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,fn[1]=x-(y+f)+(f-w),C=b+y,f=C-b,fn[2]=b-(C-f)+(y-f),fn[3]=C;const D=qm(_,ZS,4,fn,e_);v=a*c,d=Vt*a,h=d-(d-a),p=a-h,d=Vt*c,g=d-(d-c),m=c-g,A=p*m-(v-h*g-p*g-h*m),w=u*l,d=Vt*u,h=d-(d-u),p=u-h,d=Vt*l,g=d-(d-l),m=l-g,E=p*m-(w-h*g-p*g-h*m),y=A-E,f=A-y,fn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,fn[1]=x-(y+f)+(f-w),C=b+y,f=C-b,fn[2]=b-(C-f)+(y-f),fn[3]=C;const P=qm(D,e_,4,fn,t_);return t_[P-1]}function Ed(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=QY*l?u:-tV(e,t,n,i,r,o,l)}const n_=Math.pow(2,-52),Ad=new Uint32Array(512);class pp{static from(t,n=sV,i=aV){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new pp(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let S=0;S<s;S++){const $=t[2*S],k=t[2*S+1];$<a&&(a=$),k<u&&(u=k),$>l&&(l=$),k>c&&(c=k),this._ids[S]=S}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let S=0,$=1/0;S<s;S++){const k=Wm(f,d,t[2*S],t[2*S+1]);k<$&&(h=S,$=k)}const m=t[2*h],y=t[2*h+1];for(let S=0,$=1/0;S<s;S++){if(S===h)continue;const k=Wm(m,y,t[2*S],t[2*S+1]);k<$&&k>0&&(p=S,$=k)}let b=t[2*p],x=t[2*p+1],v=1/0;for(let S=0;S<s;S++){if(S===h||S===p)continue;const $=rV(m,y,b,x,t[2*S],t[2*S+1]);$<v&&(g=S,v=$)}let A=t[2*g],w=t[2*g+1];if(v===1/0){for(let k=0;k<s;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];au(this._ids,this._dists,0,s-1);const S=new Uint32Array(s);let $=0;for(let k=0,L=-1/0;k<s;k++){const T=this._ids[k],F=this._dists[T];F>L&&(S[$++]=T,L=F)}this.hull=S.subarray(0,$),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Ed(m,y,b,x,A,w)<0){const S=p,$=b,k=x;p=g,b=A,x=w,g=S,A=$,w=k}const E=oV(m,y,b,x,A,w);this._cx=E.x,this._cy=E.y;for(let S=0;S<s;S++)this._dists[S]=Wm(t[2*S],t[2*S+1],E.x,E.y);au(this._ids,this._dists,0,s-1),this._hullStart=h;let C=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,x)]=p,o[this._hashKey(A,w)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let S=0,$,k;S<this._ids.length;S++){const L=this._ids[S],T=t[2*L],F=t[2*L+1];if(S>0&&Math.abs(T-$)<=n_&&Math.abs(F-k)<=n_||($=T,k=F,L===h||L===p||L===g))continue;let _=0;for(let Y=0,le=this._hashKey(T,F);Y<this._hashSize&&(_=o[(le+Y)%this._hashSize],!(_!==-1&&_!==i[_]));Y++);_=n[_];let D=_,P;for(;P=i[D],Ed(T,F,t[2*D],t[2*D+1],t[2*P],t[2*P+1])>=0;)if(D=P,D===_){D=-1;break}if(D===-1)continue;let B=this._addTriangle(D,L,i[D],-1,-1,r[D]);r[L]=this._legalize(B+2),r[D]=B,C++;let I=i[D];for(;P=i[I],Ed(T,F,t[2*I],t[2*I+1],t[2*P],t[2*P+1])<0;)B=this._addTriangle(I,L,P,r[L],-1,r[I]),r[L]=this._legalize(B+2),i[I]=I,C--,I=P;if(D===_)for(;P=n[D],Ed(T,F,t[2*P],t[2*P+1],t[2*D],t[2*D+1])<0;)B=this._addTriangle(P,L,D,-1,r[D],r[P]),this._legalize(B+2),r[P]=B,i[D]=D,C--,D=P;this._hullStart=n[L]=D,i[D]=n[I]=L,i[L]=I,o[this._hashKey(T,F)]=L,o[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(C);for(let S=0,$=this._hullStart;S<C;S++)this.hull[S]=$,$=i[$];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(nV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=Ad[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],p=n[c],g=n[f];if(iV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===f){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<Ad.length&&(Ad[o++]=b)}else{if(o===0)break;t=Ad[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function nV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Wm(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function iV(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function rV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,p=(s*f-u*c)*d;return h*h+p*p}function oV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,p=t+(s*f-u*c)*d;return{x:h,y:p}}function au(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;Ll(e,r,o),t[e[n]]>t[e[i]]&&Ll(e,n,i),t[e[o]]>t[e[i]]&&Ll(e,o,i),t[e[n]]>t[e[o]]&&Ll(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;Ll(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(au(e,t,o,i),au(e,t,n,s-1)):(au(e,t,n,s-1),au(e,t,o,i))}}function Ll(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function sV(e){return e[0]}function aV(e){return e[1]}const i_=1e-6;class Ws{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>i_||Math.abs(this._y1-o)>i_)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class rb{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let uV=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,x;g<y;g+=3,m+=2){const v=i[g]*2,A=i[g+1]*2,w=i[g+2]*2,E=t[v],C=t[v+1],S=t[A],$=t[A+1],k=t[w],L=t[w+1],T=S-E,F=$-C,_=k-E,D=L-C,P=(T*D-F*_)*2;if(Math.abs(P)<1e-9){if(o===void 0){o=s=0;for(const I of n)o+=t[I*2],s+=t[I*2+1];o/=n.length,s/=n.length}const B=1e9*Math.sign((o-E)*D-(s-C)*_);b=(E+k)/2-B*D,x=(C+L)/2+B*_}else{const B=1/P,I=T*T+F*F,Y=_*_+D*D;b=E+(D*I-F*Y)*B,x=C+(T*Y-_*I)*B}a[m]=b,a[m+1]=x}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Ws:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=s[h],m=s[h+1],y=s[p],b=s[p+1];this._renderSegment(g,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Ws:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Ws:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new rb;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(o,s,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const lV=2*Math.PI,Xa=Math.pow;function cV(e){return e[0]}function fV(e){return e[1]}function dV(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function hV(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class lE{static from(t,n=cV,i=fV,r){return new lE("length"in t?pV(t,n,i,r):Float64Array.from(gV(t,n,i,r)))}constructor(t){this._delaunator=new pp(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&dV(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=hV(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new pp(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new uV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Xa(n-l[t*2],2)+Xa(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Xa(n-l[p*2],2)+Xa(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&Xa(n-l[h*2],2)+Xa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Ws:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Ws:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,lV)}return i&&i.value()}renderHull(t){const n=t==null?t=new Ws:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new rb;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Ws:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new rb;return this.renderTriangle(t,n),n.value()}}function pV(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*gV(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function cE(e){M.call(this,null,e)}cE.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const mV=[-1e5,-1e5,1e5,1e5];H(cE,M,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:mV;const o=this.value=lE.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!bV(u)?yV(u):null}return t.reflow(e.modified()).modifies(n)}});function yV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function bV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const xV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:cE},Symbol.toStringTag,{value:"Module"}));var Hm=Math.PI/180,fc=64,th=2048;function vV(){var e=[256,256],t,n,i,r,o,s,a,u=yO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(Yo()),g=_V((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,x=[],v=l.map(w=>({text:t(w),font:n(w),style:r(w),weight:o(w),rotate:s(w),size:~~(i(w)+1e-14),padding:a(w),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:w})).sort((w,E)=>E.size-w.size);++b<y;){var A=v[b];A.x=e[0]*(c()+.5)>>1,A.y=e[1]*(c()+.5)>>1,EV(p,A,v,b),A.hasText&&h(g,A,m)&&(x.push(A),m?wV(m,A):m=[{x:A.x+A.x0,y:A.y+A.y0},{x:A.x+A.x1,y:A.y+A.y1}],A.x-=e[0]>>1,A.y-=e[1]>>1)}return x};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(fc<<5)/g,p.height=th/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,x=Math.hypot(e[0],e[1]),v=u(e),A=c()<.5?1:-1,w=-A,E,C,S;(E=v(w+=A))&&(C=~~E[0],S=~~E[1],!(Math.min(Math.abs(C),Math.abs(S))>=x));)if(g.x=y+C,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!AV(g,p,e[0]))&&(!m||CV(g,m))){for(var $=g.sprite,k=g.width>>5,L=e[0]>>5,T=g.x-(k<<4),F=T&127,_=32-F,D=g.y1-g.y0,P=(g.y+g.y0)*L+(T>>5),B,I=0;I<D;I++){B=0;for(var Y=0;Y<=k;Y++)p[P+Y]|=B<<_|(Y<k?(B=$[I*k+Y])>>>F:0);P+=L}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Ss(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Ss(p),f):r},f.fontWeight=function(p){return arguments.length?(o=Ss(p),f):o},f.rotate=function(p){return arguments.length?(s=Ss(p),f):s},f.text=function(p){return arguments.length?(t=Ss(p),f):t},f.spiral=function(p){return arguments.length?(u=$V[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=Ss(p),f):i},f.padding=function(p){return arguments.length?(a=Ss(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function EV(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(fc<<5)/o,th/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*Hm),m=Math.cos(t.rotate*Hm),y=c*m,b=c*g,x=d*m,v=d*g;c=Math.max(Math.abs(y+v),Math.abs(y-v))+31>>5<<5,d=~~Math.max(Math.abs(b+x),Math.abs(b-x))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=fc<<5&&(s=0,a+=u,u=0),a+d>=th)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*Hm),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var A=r.getImageData(0,0,(fc<<5)/o,th/o).data,w=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)w[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var E=0,C=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var S=f*p+(h>>5),$=A[(a+p)*(fc<<5)+(s+h)<<2]?1<<31-h%32:0;w[S]|=$,E|=$}E?C=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+C,t.sprite=w.slice(0,(t.y1-t.y0)*f)}}}function AV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function wV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function CV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function yO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function SV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function _V(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Ss(e){return typeof e=="function"?e:function(){return e}}var $V={archimedean:yO,rectangular:SV};const bO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],FV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function fE(e){M.call(this,vV(),e)}fE.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:bO}]};H(fE,M,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&O("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return ye(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||FV.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||bO;let a=e.fontSize||14,u;if(ye(a)?u=e.fontSizeRange:a=ln(a),u){const p=a,g=Oe("sqrt")().domain(mr(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const l=o.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(yi).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[s[0]]=g.x+f,m[s[1]]=g.y+d,m[s[2]]=g.font,m[s[3]]=g.size,m[s[4]]=g.style,m[s[5]]=g.weight,m[s[6]]=g.rotate;return t.reflow(i).modifies(s)}});const kV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:fE},Symbol.toStringTag,{value:"Module"})),DV=e=>new Uint8Array(e),TV=e=>new Uint16Array(e),Cc=e=>new Uint32Array(e);function MV(){let e=8,t=[],n=Cc(0),i=wd(0,e),r=wd(0,e);return{data:()=>t,seen:()=>n=OV(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=wd(o,e,i),r=wd(o,e))}}}function OV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function wd(e,t,n){const i=(t<257?DV:t<65537?TV:Cc)(e);return n&&i.set(n),i}function r_(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function o_(){let e=Cc(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Cc(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=RV(h,d),c)p=t,g=e,t=Array(c+f),e=Cc(c+f),NV(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[H8(u,a[0],0,l),xu(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function RV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),P9(e,t)}function NV(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function dE(e){M.call(this,MV(),e),this._indices=null,this._dims=null}dE.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}}]};H(dE,M,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=o_()),o.push(r_(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,x,v,A,w,E;if(l.set(u),t.rem.length&&(x=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(v={},b=t.mod,A=0,w=b.length;A<w;++A)v[b[A]._index]=1;for(A=0;A<h;++A)E=i[A],(!s[A]||e.modified("fields",A)||t.modified(E.fields))&&(y=E.fname,(g=p[y])||(o[y]=m=o_(),p[y]=g=m.insert(E,t.source,0)),s[A]=r_(m,A,r[A]).onAdd(g,u));for(A=0,w=a.data().length;A<w;++A)x[A]||(l[A]!==u[A]?f.push(A):v[A]&&u[A]!==c&&d.push(A));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=s[p].insert(a[h],i,d)),o[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=p=o[h],o[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=s[p],o[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=s[p],o[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=s[p],o[m]^=h,i.push(m);e.range=t.slice()}});function hE(e){M.call(this,null,e)}hE.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};H(hE,M,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if((r&n)===0)return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const LV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:dE,resolvefilter:hE},Symbol.toStringTag,{value:"Module"})),PV="RawCode",sa="Literal",IV="Property",BV="Identifier",zV="ArrayExpression",UV="BinaryExpression",xO="CallExpression",jV="ConditionalExpression",qV="LogicalExpression",WV="MemberExpression",HV="ObjectExpression",GV="UnaryExpression";function Wi(e){this.type=e}Wi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=YV(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function YV(e){switch(e.type){case zV:return e.elements;case UV:case qV:return[e.left,e.right];case xO:return[e.callee].concat(e.arguments);case jV:return[e.test,e.consequent,e.alternate];case WV:return[e.object,e.property];case HV:return e.properties;case IV:return[e.key,e.value];case GV:return[e.argument];case BV:case sa:case PV:default:return[]}}var Fr,K,R,on,ze,Bg=1,Mf=2,aa=3,ds=4,zg=5,$a=6,kn=7,Of=8,VV=9;Fr={};Fr[Bg]="Boolean";Fr[Mf]="<end>";Fr[aa]="Identifier";Fr[ds]="Keyword";Fr[zg]="Null";Fr[$a]="Numeric";Fr[kn]="Punctuator";Fr[Of]="String";Fr[VV]="RegularExpression";var XV="ArrayExpression",KV="BinaryExpression",JV="CallExpression",QV="ConditionalExpression",vO="Identifier",ZV="Literal",eX="LogicalExpression",tX="MemberExpression",nX="ObjectExpression",iX="Property",rX="UnaryExpression",_t="Unexpected token %0",oX="Unexpected number",sX="Unexpected string",aX="Unexpected identifier",uX="Unexpected reserved word",lX="Unexpected end of input",ob="Invalid regular expression",Gm="Invalid regular expression: missing /",EO="Octal literals are not allowed in strict mode.",cX="Duplicate data property in object literal not allowed in strict mode",zt="ILLEGAL",Hc="Disabled.",fX=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]"),dX=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 Ug(e,t){if(!e)throw new Error("ASSERT: "+t)}function Wr(e){return e>=48&&e<=57}function pE(e){return"0123456789abcdefABCDEF".includes(e)}function Sc(e){return"01234567".includes(e)}function hX(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Gc(e){return e===10||e===13||e===8232||e===8233}function Rf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&fX.test(String.fromCharCode(e))}function gp(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&dX.test(String.fromCharCode(e))}const pX={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 AO(){for(;R<on;){const e=K.charCodeAt(R);if(hX(e)||Gc(e))++R;else break}}function sb(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<on&&pE(K[R])?(i=K[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):De({},_t,zt);return String.fromCharCode(r)}function gX(){var e,t,n,i;for(e=K[R],t=0,e==="}"&&De({},_t,zt);R<on&&(e=K[R++],!!pE(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&De({},_t,zt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function wO(){var e,t;for(e=K.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(K.charCodeAt(R)!==117&&De({},_t,zt),++R,e=sb("u"),(!e||e==="\\"||!Rf(e.charCodeAt(0)))&&De({},_t,zt),t=e);R<on&&(e=K.charCodeAt(R),!!gp(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),K.charCodeAt(R)!==117&&De({},_t,zt),++R,e=sb("u"),(!e||e==="\\"||!gp(e.charCodeAt(0)))&&De({},_t,zt),t+=e);return t}function mX(){var e,t;for(e=R++;R<on;){if(t=K.charCodeAt(R),t===92)return R=e,wO();if(gp(t))++R;else break}return K.slice(e,R)}function yX(){var e,t,n;return e=R,t=K.charCodeAt(R)===92?wO():mX(),t.length===1?n=aa:pX.hasOwnProperty(t)?n=ds:t==="null"?n=zg:t==="true"||t==="false"?n=Bg:n=aa,{type:n,value:t,start:e,end:R}}function Ym(){var e=R,t=K.charCodeAt(R),n,i=K[R],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:kn,value:String.fromCharCode(t),start:e,end:R};default:if(n=K.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:kn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,K.charCodeAt(R)===61&&++R,{type:kn,value:K.slice(e,R),start:e,end:R}}}if(s=K.substr(R,4),s===">>>=")return R+=4,{type:kn,value:s,start:e,end:R};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return R+=3,{type:kn,value:o,start:e,end:R};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:kn,value:r,start:e,end:R};if(r==="//"&&De({},_t,zt),"<>=!+-*%&|^/".includes(i))return++R,{type:kn,value:i,start:e,end:R};De({},_t,zt)}function bX(e){let t="";for(;R<on&&pE(K[R]);)t+=K[R++];return t.length===0&&De({},_t,zt),Rf(K.charCodeAt(R))&&De({},_t,zt),{type:$a,value:parseInt("0x"+t,16),start:e,end:R}}function xX(e){let t="0"+K[R++];for(;R<on&&Sc(K[R]);)t+=K[R++];return(Rf(K.charCodeAt(R))||Wr(K.charCodeAt(R)))&&De({},_t,zt),{type:$a,value:parseInt(t,8),octal:!0,start:e,end:R}}function s_(){var e,t,n;if(n=K[R],Ug(Wr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=K[R++],n=K[R],e==="0"){if(n==="x"||n==="X")return++R,bX(t);if(Sc(n))return xX(t);n&&Wr(n.charCodeAt(0))&&De({},_t,zt)}for(;Wr(K.charCodeAt(R));)e+=K[R++];n=K[R]}if(n==="."){for(e+=K[R++];Wr(K.charCodeAt(R));)e+=K[R++];n=K[R]}if(n==="e"||n==="E")if(e+=K[R++],n=K[R],(n==="+"||n==="-")&&(e+=K[R++]),Wr(K.charCodeAt(R)))for(;Wr(K.charCodeAt(R));)e+=K[R++];else De({},_t,zt);return Rf(K.charCodeAt(R))&&De({},_t,zt),{type:$a,value:parseFloat(e),start:t,end:R}}function vX(){var e="",t,n,i,r,o=!1;for(t=K[R],Ug(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<on;)if(i=K[R++],i===t){t="";break}else if(i==="\\")if(i=K[R++],!i||!Gc(i.charCodeAt(0)))switch(i){case"u":case"x":K[R]==="{"?(++R,e+=gX()):e+=sb(i);break;case"n":e+=`
|
|
8
|
-
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:Sc(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),R<on&&Sc(K[R])&&(o=!0,r=r*8+"01234567".indexOf(K[R++]),"0123".includes(i)&&R<on&&Sc(K[R])&&(r=r*8+"01234567".indexOf(K[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&K[R]===`
|
|
9
|
-
`&&++R;else{if(Gc(i.charCodeAt(0)))break;e+=i}return t!==""&&De({},_t,zt),{type:Of,value:e,octal:o,start:n,end:R}}function EX(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";De({},ob)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{De({},ob)}try{return new RegExp(e,t)}catch{return null}}function AX(){var e,t,n,i,r;for(e=K[R],Ug(e==="/","Regular expression literal must start with a slash"),t=K[R++],n=!1,i=!1;R<on;)if(e=K[R++],t+=e,e==="\\")e=K[R++],Gc(e.charCodeAt(0))&&De({},Gm),t+=e;else if(Gc(e.charCodeAt(0)))De({},Gm);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||De({},Gm),r=t.substr(1,t.length-2),{value:r,literal:t}}function wX(){var e,t,n;for(t="",n="";R<on&&(e=K[R],!!gp(e.charCodeAt(0)));)++R,e==="\\"&&R<on?De({},_t,zt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&De({},ob,n),{value:n,literal:t}}function CX(){var e,t,n,i;return ze=null,AO(),e=R,t=AX(),n=wX(),i=EX(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function SX(e){return e.type===aa||e.type===ds||e.type===Bg||e.type===zg}function CO(){if(AO(),R>=on)return{type:Mf,start:R,end:R};const e=K.charCodeAt(R);return Rf(e)?yX():e===40||e===41||e===59?Ym():e===39||e===34?vX():e===46?Wr(K.charCodeAt(R+1))?s_():Ym():Wr(e)?s_():Ym()}function Mn(){const e=ze;return R=e.end,ze=CO(),R=e.end,e}function SO(){const e=R;ze=CO(),R=e}function _X(e){const t=new Wi(XV);return t.elements=e,t}function a_(e,t,n){const i=new Wi(e==="||"||e==="&&"?eX:KV);return i.operator=e,i.left=t,i.right=n,i}function $X(e,t){const n=new Wi(JV);return n.callee=e,n.arguments=t,n}function FX(e,t,n){const i=new Wi(QV);return i.test=e,i.consequent=t,i.alternate=n,i}function gE(e){const t=new Wi(vO);return t.name=e,t}function dc(e){const t=new Wi(ZV);return t.value=e.value,t.raw=K.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function u_(e,t,n){const i=new Wi(tX);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function kX(e){const t=new Wi(nX);return t.properties=e,t}function l_(e,t,n){const i=new Wi(iX);return i.key=t,i.value=n,i.kind=e,i}function DX(e,t){const n=new Wi(rX);return n.operator=e,n.argument=t,n.prefix=!0,n}function De(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(Ug(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=R,n.description=r,n}function jg(e){e.type===Mf&&De(e,lX),e.type===$a&&De(e,oX),e.type===Of&&De(e,sX),e.type===aa&&De(e,aX),e.type===ds&&De(e,uX),De(e,_t,e.value)}function sn(e){const t=Mn();(t.type!==kn||t.value!==e)&&jg(t)}function Ve(e){return ze.type===kn&&ze.value===e}function Vm(e){return ze.type===ds&&ze.value===e}function TX(){const e=[];for(R=ze.start,sn("[");!Ve("]");)Ve(",")?(Mn(),e.push(null)):(e.push(ua()),Ve("]")||sn(","));return Mn(),_X(e)}function c_(){R=ze.start;const e=Mn();return e.type===Of||e.type===$a?(e.octal&&De(e,EO),dc(e)):gE(e.value)}function MX(){var e,t,n,i;if(R=ze.start,e=ze,e.type===aa)return n=c_(),sn(":"),i=ua(),l_("init",n,i);if(e.type===Mf||e.type===kn)jg(e);else return t=c_(),sn(":"),i=ua(),l_("init",t,i)}function OX(){var e=[],t,n,i,r={},o=String;for(R=ze.start,sn("{");!Ve("}");)t=MX(),t.key.type===vO?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?De({},cX):r[i]=!0,e.push(t),Ve("}")||sn(",");return sn("}"),kX(e)}function RX(){sn("(");const e=mE();return sn(")"),e}const NX={if:1};function LX(){var e,t,n;if(Ve("("))return RX();if(Ve("["))return TX();if(Ve("{"))return OX();if(e=ze.type,R=ze.start,e===aa||NX[ze.value])n=gE(Mn().value);else if(e===Of||e===$a)ze.octal&&De(ze,EO),n=dc(Mn());else{if(e===ds)throw new Error(Hc);e===Bg?(t=Mn(),t.value=t.value==="true",n=dc(t)):e===zg?(t=Mn(),t.value=null,n=dc(t)):Ve("/")||Ve("/=")?(n=dc(CX()),SO()):jg(Mn())}return n}function PX(){const e=[];if(sn("("),!Ve(")"))for(;R<on&&(e.push(ua()),!Ve(")"));)sn(",");return sn(")"),e}function IX(){R=ze.start;const e=Mn();return SX(e)||jg(e),gE(e.value)}function BX(){return sn("."),IX()}function zX(){sn("[");const e=mE();return sn("]"),e}function UX(){var e,t,n;for(e=LX();;)if(Ve("."))n=BX(),e=u_(".",e,n);else if(Ve("("))t=PX(),e=$X(e,t);else if(Ve("["))n=zX(),e=u_("[",e,n);else break;return e}function f_(){const e=UX();if(ze.type===kn&&(Ve("++")||Ve("--")))throw new Error(Hc);return e}function nh(){var e,t;if(ze.type!==kn&&ze.type!==ds)t=f_();else{if(Ve("++")||Ve("--"))throw new Error(Hc);if(Ve("+")||Ve("-")||Ve("~")||Ve("!"))e=Mn(),t=nh(),t=DX(e.value,t);else{if(Vm("delete")||Vm("void")||Vm("typeof"))throw new Error(Hc);t=f_()}}return t}function d_(e){let t=0;if(e.type!==kn&&e.type!==ds)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function jX(){var e,t,n,i,r,o,s,a,u,l;if(e=ze,u=nh(),i=ze,r=d_(i),r===0)return u;for(i.prec=r,Mn(),t=[e,ze],s=nh(),o=[u,i,s];(r=d_(ze))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=a_(a,u,s),o.push(n);i=Mn(),i.prec=r,o.push(i),t.push(ze),n=nh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=a_(o[l-1].value,o[l-2],n),l-=2;return n}function ua(){var e,t,n;return e=jX(),Ve("?")&&(Mn(),t=ua(),sn(":"),n=ua(),e=FX(e,t,n)),e}function mE(){const e=ua();if(Ve(","))throw new Error(Hc);return e}function _O(e){K=e,R=0,on=K.length,ze=null,SO();const t=mE();if(ze.type!==Mf)throw new Error("Unexpect token after expression.");return t}var $O={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 FO(e){function t(s,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,u){return l=>t(s,l,a,u)}const i="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&O("Missing arguments to clamp function."),s.length>3&&O("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:o,test:n("test",o),if:function(s){s.length<3&&O("Missing arguments to if function."),s.length>3&&O("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function qX(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function kO(e){e=e||{};const t=e.allowed?Pi(e.allowed):{},n=e.forbidden?Pi(e.forbidden):{},i=e.constants||$O,r=(e.functions||FO)(f),o=e.globalvar,s=e.fieldvar,a=ye(o)?o:p=>`${o}["${p}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(p=>typeof Object.prototype[p]=="function")];let u={},l={},c=0;function f(p){if(_e(p))return p;const g=d[p.type];return g==null&&O("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:ue(n,g)?O("Illegal identifier: "+g):ue(i,g)?i[g]:ue(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===s&&(l[qX(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&O("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=ue(r,g)&&r[g];return y||O("Unrecognized function: "+g),ye(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(const g of p.properties){const m=g.key.name;sx.has(m)&&O("Illegal property: "+m)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const h_=Symbol("vega_selection_getter");function DO(e){return(!e.getter||!e.getter[h_])&&(e.getter=pi(e.field),e.getter[h_]=!0),e.getter}const yE="intersect",p_="union",WX="vlMulti",HX="vlPoint",g_="or",GX="and",or="_vgsid_",Yc=pi(or),YX="E",VX="R",XX="R-E",KX="R-LE",JX="R-RE",QX="E-LT",ZX="E-LTE",eK="E-GT",tK="E-GTE",nK="E-VALID",iK="E-ONE",mp="index:unit";function m_(e,t){for(var n=t.fields,i=t.values,r=n.length,o=0,s,a;o<r;++o)if(a=n[o],s=DO(a)(e),Wo(s)&&(s=en(s)),Wo(i[o])&&(i[o]=en(i[o])),Z(i[o])&&Wo(i[o][0])&&(i[o]=i[o].map(en)),a.type===YX){if(Z(i[o])?!i[o].includes(s):s!==i[o])return!1}else if(a.type===VX){if(!iu(s,i[o]))return!1}else if(a.type===JX){if(!iu(s,i[o],!0,!1))return!1}else if(a.type===XX){if(!iu(s,i[o],!1,!1))return!1}else if(a.type===KX){if(!iu(s,i[o],!1,!0))return!1}else if(a.type===QX){if(s>=i[o])return!1}else if(a.type===ZX){if(s>i[o])return!1}else if(a.type===eK){if(s<=i[o])return!1}else if(a.type===tK){if(s<i[o])return!1}else if(a.type===nK){if(s===null||isNaN(s))return!1}else if(a.type===iK&&i[o].indexOf(s)===-1)return!1;return!0}function rK(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[mp]&&i[mp].value:void 0,s=n===yE,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],o&&s){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=m_(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=m_(t,l),s^h)return h;return a&&s}const TO=zp(Yc),oK=TO.left,sK=TO.right;function aK(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[mp]&&i[mp].value:void 0,s=n===yE,a=Yc(t),u=oK(r,a);if(u===r.length||Yc(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(sK(r,a)-u<o.size)return!1}return!0}function uK(e,t){return Z(e)||O("First argument to selectionTuples must be an array."),ce(t)||O("Second argument to selectionTuples must be an object."),e.map(n=>me(t.fields?{values:t.fields.map(i=>DO(i)(n.datum))}:{[or]:Yc(n.datum)},t))}function lK(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,p,g,m,y,b,x=o.length,v=0,A,w;v<x;++v)if(l=o[v],d=l.unit,c=l.fields,f=l.values,c&&f){for(A=0,w=c.length;A<w;++A)h=c[A],g=s[h.field]||(s[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=Xm[`${y}_union`],g[d]=b(m,re(f[A]));n&&(m=a[d]||(a[d]=[]),m.push(re(f).reduce((E,C,S)=>(E[c[S].field]=C,E),{})))}else h=or,p=Yc(l),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[or]:p}));if(t=t||p_,s[or]?s[or]=Xm[`${or}_${t}`](...Object.values(s[or])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(C=>s[E][C]).reduce((C,S)=>C===void 0?S:Xm[`${u[E]}_${t}`](C,S))}),o=Object.keys(a),n&&o.length){const E=i?HX:WX;s[E]=t===p_?{[g_]:o.reduce((C,S)=>(C.push(...a[S]),C),[])}:{[GX]:o.map(C=>({[g_]:a[C]}))}}return s}var Xm={[`${or}_union`]:q9,[`${or}_intersect`]:U9,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.includes(n)):t},R_union:function(e,t){var n=en(t[0]),i=en(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=en(t[0]),i=en(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const cK=":",fK="@";function bE(e,t,n,i){t[0].type!==sa&&O("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&Se(t).value,s="unit",a=fK+s,u=cK+r;o===yE&&!ue(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),ue(i,u)||(i[u]=n.getData(r).tuplesRef())}function MO(e){const t=this.context.data[e];return t?t.values.value:[]}function dK(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function hK(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(gi).insert(t)),1}function pK(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Nf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},gK=Nf("format"),OO=Nf("timeFormat"),mK=Nf("utcFormat"),yK=Nf("timeParse"),bK=Nf("utcParse"),Cd=new Date(2e3,0,1);function qg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Cd.setYear(2e3),Cd.setMonth(e),Cd.setDate(t),OO.call(this,Cd,n))}function xK(e){return qg.call(this,e,1,"%B")}function vK(e){return qg.call(this,e,1,"%b")}function EK(e){return qg.call(this,0,2+e,"%A")}function AK(e){return qg.call(this,0,2+e,"%a")}const wK=":",CK="@",ab="%",RO="$";function xE(e,t,n,i){t[0].type!==sa&&O("First argument to data functions must be a string literal.");const r=t[0].value,o=wK+r;if(!ue(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function SK(e,t,n,i){t[0].type!==sa&&O("First argument to indata must be a string literal."),t[1].type!==sa&&O("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=CK+o;ue(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function En(e,t,n,i){if(t[0].type===sa)y_(n,i,t[0].value);else for(e in n.scales)y_(n,i,e)}function y_(e,t,n){const i=ab+n;if(!ue(t,i))try{t[i]=e.scaleRef(n)}catch{}}function kr(e,t){if(_e(e)){const n=t.scales[e];return n&&AC(n.value)?n.value:void 0}else if(ye(e))return AC(e)?e:void 0}function _K(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=En,n._range=En,n._scale=En;const i=r=>"_["+(r.type===sa?ee(ab+r.value):ee(ab)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function vE(e,t){return function(n,i,r){if(n){const o=kr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const $K=vE("area",Qq),FK=vE("bounds",nW),kK=vE("centroid",uW);function DK(e,t){const n=kr(e,(t||this).context);return n&&n.scale()}function TK(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 EE(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function MK(){return EE(this.context.dataflow,"warn",arguments)}function OK(){return EE(this.context.dataflow,"info",arguments)}function RK(){return EE(this.context.dataflow,"debug",arguments)}function Km(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ub(e){const t=dh(e),n=Km(t.r),i=Km(t.g),r=Km(t.b);return .2126*n+.7152*i+.0722*r}function NK(e,t){const n=ub(e),i=ub(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function LK(){const e=[].slice.call(arguments);return e.unshift({}),me(...e)}function NO(e,t){return e===t||e!==e&&t!==t?!0:Z(e)?Z(t)&&e.length===t.length?PK(e,t):!1:ce(e)&&ce(t)?LO(e,t):!1}function PK(e,t){for(let n=0,i=e.length;n<i;++n)if(!NO(e[n],t[n]))return!1;return!0}function LO(e,t){for(const n in e)if(!NO(e[n],t[n]))return!1;return!0}function b_(e){return t=>LO(e,t)}function IK(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,l=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=s.changeset(),c.stamp=l,s.runAfter(()=>{a.modified=!0,s.pulse(u,c).run()},!0,1)),n&&(f=n===!0?gi:Z(n)||ig(n)?n:b_(n),c.remove(f)),t&&c.insert(t),i&&(f=b_(i),u.value.some(f)?c.remove(f):c.insert(i)),r){if(ye(r))throw Error("modify parameter must be a data tuple, not a function");for(d in o)c.modify(r,d,o[d])}return 1}function BK(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function zK(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const x_={};function UK(e,t){const n=x_[t]||(x_[t]=pi(t));return Z(e)?e.map(n):n(e)}function Wg(e){return Z(e)||ArrayBuffer.isView(e)?e:null}function AE(e){return Wg(e)||(_e(e)?e:null)}function jK(e,...t){return Wg(e).join(...t)}function qK(e,...t){return AE(e).indexOf(...t)}function WK(e,...t){return AE(e).lastIndexOf(...t)}function HK(e,...t){return AE(e).slice(...t)}function GK(e,t,n){return ye(n)&&O("Function argument passed to replace."),!_e(t)&&!px(t)&&O("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function YK(e){return Wg(e).slice().reverse()}function VK(e){return Wg(e).slice().sort(el)}function XK(e,t,n){return Pv(e||0,t||0,n||0)}function KK(e,t){const n=kr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function JK(e,t){const n=kr(e,(t||this).context);return n?n.copy():void 0}function QK(e,t){const n=kr(e,(t||this).context);return n?n.domain():[]}function ZK(e,t,n){const i=kr(e,(n||this).context);return i?Z(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function eJ(e,t){const n=kr(e,(t||this).context);return n&&n.range?n.range():[]}function tJ(e,t,n){const i=kr(e,(n||this).context);return i?i(t):void 0}function nJ(e,t,n,i,r){e=kr(e,(r||this).context);const o=DT(t,n);let s=e.domain(),a=s[0],u=Se(s),l=An;return u-a?l=bT(e,a,u):e=(e.interpolator?Oe("sequential")().interpolator(e.interpolator()):Oe("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(s=e.ticks(+i||15),a!==s[0]&&s.unshift(a),u!==Se(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function iJ(e,t,n){const i=kr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function rJ(e){let t=null;return function(n){return n?Ic(n,t=t||ku(e)):e}}const PO=e=>e.data;function IO(e,t){const n=MO.call(t,e);return n.root&&n.root.lookup||{}}function oJ(e,t,n){const i=IO(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(PO):void 0}function sJ(e,t){const n=IO(e,this)[t];return n?n.ancestors().map(PO):void 0}const BO=()=>typeof window<"u"&&window||null;function aJ(){const e=BO();return e?e.screen:{}}function uJ(){const e=BO();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function lJ(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function zO(e,t,n){if(!e)return[];const[i,r]=e,o=new mt().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return _M(s,o,cJ(t))}function cJ(e){let t=null;if(e){const n=re(e.marktype),i=re(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function fJ(e,t,n,i=5){e=re(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function dJ(e){return re(e).reduce((t,[n,i],r)=>t+=r==0?`M ${n},${i} `:r===e.length-1?" Z":`L ${n},${i} `,"")}function hJ(e,t,n){const{x:i,y:r,mark:o}=n,s=new mt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<s.x1&&(s.x1=u),u>s.x2&&(s.x2=u),l<s.y1&&(s.y1=l),l>s.y2&&(s.y2=l);return s.translate(i,r),zO([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>pJ(u.x,u.y,t))}function pJ(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[s,a]=n[o],[u,l]=n[r];l>t!=a>t&&e<(s-u)*(t-l)/(a-l)+u&&i++}return i&1}const Vc={random(){return yi()},cumulativeNormal:ug,cumulativeLogNormal:zx,cumulativeUniform:Wx,densityNormal:Nx,densityLogNormal:Bx,densityUniform:qx,quantileNormal:lg,quantileLogNormal:Ux,quantileUniform:Hx,sampleNormal:ag,sampleLogNormal:Ix,sampleUniform:jx,isArray:Z,isBoolean:hx,isDate:Wo,isDefined(e){return e!==void 0},isNumber:Ko,isObject:ce,isRegExp:px,isString:_e,isTuple:ig,isValid(e){return e!=null&&e===e},toBoolean:mx,toDate(e){return yx(e)},toNumber:en,toString:bx,indexof:qK,join:jK,lastindexof:WK,replace:GK,reverse:YK,sort:VK,slice:HK,flush:Ek,lerp:wk,merge:LK,pad:_k,peek:Se,pluck:UK,span:ff,inrange:iu,truncate:$k,rgb:dh,lab:Sh,hcl:_h,hsl:Y1,luminance:ub,contrast:NK,sequence:Yn,format:gK,utcFormat:mK,utcParse:bK,utcOffset:Zk,utcSequence:nD,timeFormat:OO,timeParse:yK,timeOffset:Qk,timeSequence:tD,timeUnitSpecifier:Uk,monthFormat:xK,monthAbbrevFormat:vK,dayFormat:EK,dayAbbrevFormat:AK,quarter:yk,utcquarter:bk,week:qk,utcweek:Gk,dayofyear:jk,utcdayofyear:Hk,warn:MK,info:OK,debug:RK,extent(e){return mr(e)},inScope:TK,intersect:zO,clampRange:xk,pinchDistance:BK,pinchAngle:zK,screen:aJ,containerSize:lJ,windowSize:uJ,bandspace:XK,setdata:hK,pathShape:rJ,panLinear:hk,panLog:pk,panPow:gk,panSymlog:mk,zoomLinear:ux,zoomLog:lx,zoomPow:ph,zoomSymlog:cx,encode:pK,modify:IK,lassoAppend:fJ,lassoPath:dJ,intersectLasso:hJ},gJ=["view","item","group","xy","x","y"],mJ="event.vega.",UO="this.",wE={},jO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${ee(RO+e)}]`,functions:yJ,constants:$O,visitors:wE},lb=kO(jO);function yJ(e){const t=FO(e);gJ.forEach(n=>t[n]=mJ+n);for(const n in Vc)t[n]=UO+n;return me(t,_K(e,Vc,wE)),t}function ht(e,t,n){return arguments.length===1?Vc[e]:(Vc[e]=t,n&&(wE[e]=n),lb&&(lb.functions[e]=UO+e),this)}ht("bandwidth",KK,En);ht("copy",JK,En);ht("domain",QK,En);ht("range",eJ,En);ht("invert",ZK,En);ht("scale",tJ,En);ht("gradient",nJ,En);ht("geoArea",$K,En);ht("geoBounds",FK,En);ht("geoCentroid",kK,En);ht("geoShape",iJ,En);ht("geoScale",DK,En);ht("indata",dK,SK);ht("data",MO,xE);ht("treePath",oJ,xE);ht("treeAncestors",sJ,xE);ht("vlSelectionTest",rK,bE);ht("vlSelectionIdTest",aK,bE);ht("vlSelectionResolve",lK,bE);ht("vlSelectionTuples",uK);function Er(e,t){const n={};let i;try{e=_e(e)?e:ee(e)+"",i=_O(e)}catch{O("Expression parse error: "+e)}i.visit(o=>{if(o.type!==xO)return;const s=o.callee.name,a=jO.visitors[s];a&&a(s,o.arguments,t,n)});const r=lb(i);return r.globals.forEach(o=>{const s=RO+o;!ue(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:me({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function bJ(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(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const xJ=Pi(["rule"]),v_=Pi(["group","image","rect"]);function vJ(e,t){let n="";return xJ[t]||(e.x2&&(e.x?(v_[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?(v_[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function CE(e){return(e+"").toLowerCase()}function EJ(e){return CE(e)==="operator"}function AJ(e){return CE(e)==="collect"}function Pl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function wJ(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
|
|
10
|
-
: (u > v || v == null) && u != null ? ${i}
|
|
11
|
-
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
|
|
12
|
-
: v !== v && u === u ? ${i} : `}var CJ={operator:(e,t)=>Pl(e,["_"],t.code),parameter:(e,t)=>Pl(e,["datum","_"],t.code),event:(e,t)=>Pl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Pl(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const s="o["+ee(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=vJ(i,n),r+="return m;",Pl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(ee).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(o,s)=>{const a=t[s];let u,l;return o.path?(u=`a${o.path}`,l=`b${o.path}`):((n=n||{})["f"+s]=o,u=`this.f${s}(a)`,l=`this.f${s}(b)`),wJ(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function SJ(e){const t=this;EJ(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function _J(e){const t=this;if(e.params){const n=t.get(e.id);n||O("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function $J(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=Z(r)?r.map(o=>E_(o,n,t)):E_(r,n,t)}return t}function E_(e,t,n){if(!e||!ce(e))return e;for(let i=0,r=A_.length,o;i<r;++i)if(o=A_[i],ue(e,o.key))return o.parse(e,t,n);return e}var A_=[{key:"$ref",parse:FJ},{key:"$key",parse:DJ},{key:"$expr",parse:kJ},{key:"$field",parse:TJ},{key:"$encode",parse:OJ},{key:"$compare",parse:MJ},{key:"$context",parse:RJ},{key:"$subflow",parse:NJ},{key:"$tupleid",parse:LJ}];function FJ(e,t){return t.get(e.$ref)||O("Operator not defined: "+e.$ref)}function kJ(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=Un(t.parameterExpression(e.$expr),e.$fields))}function DJ(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=gx(e.$key,e.$flat,t.expr.codegen))}function TJ(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=pi(e.$field,e.$name,t.expr.codegen))}function MJ(e,t){const n="c:"+e.$compare+"_"+e.$order,i=re(e.$compare).map(r=>r&&r.$tupleid?ne:r);return t.fn[n]||(t.fn[n]=fx(i,e.$order,t.expr.codegen))}function OJ(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=Un(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function RJ(e,t){return t}function NJ(e,t){const n=e.$subflow;return function(i,r,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),u=s.signals.parent;return u&&u.set(o),a.detachSubflow=()=>t.detach(s),a}}function LJ(){return ne}function PJ(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(o=>t.get(o)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(o=>t.get(o)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&O("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function IJ(e){var t=this,n=ce(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||O("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,i,r,o,s)}const BJ={skip:!0};function zJ(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(i[o]=s.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(r[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function UJ(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(o=>{n.update(t.signals[o],r[o],BJ)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(gi).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function qO(e,t,n,i){return new WO(e,t,n,i)}function WO(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||CJ,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function w_(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)}WO.prototype=w_.prototype={fork(){const e=new w_(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==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,i=n.dataflow,r=e.value;if(n.set(e.id,t),AJ(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(i.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),i.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=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[CE(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,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:bJ,parseOperator:SJ,parseOperatorParameters:_J,parseParameters:$J,parseStream:PJ,parseUpdate:IJ,getState:zJ,setState:UJ};function jJ(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),HO(t,e.description()))}function HO(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function qJ(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const Jm="default";function WJ(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Jm,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?_e(r)?r:r.user:Jm,s=i.item&&i.item.cursor||null;return r&&o===r.user&&s==r.item?r:{user:o,item:s}}),e.add(null,function(n){let i=n.cursor,r=this.value;return _e(i)||(r=i.item,i=i.user),cb(e,i&&i!==Jm?i:r||i),r},{cursor:t})}function cb(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function yp(e,t){var n=e._runtime.data;return ue(n,t)||O("Unrecognized data set: "+t),n[t]}function HJ(e,t){return arguments.length<2?yp(this,e).values.value:Hg.call(this,e,Sa().remove(gi).insert(t))}function Hg(e,t){kD(t)||O("Second argument to changes must be a changeset.");const n=yp(this,e);return n.modified=!0,this.pulse(n.input,t)}function GJ(e,t){return Hg.call(this,e,Sa().insert(t))}function YJ(e,t){return Hg.call(this,e,Sa().remove(t))}function GO(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function YO(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Gg(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function VJ(e){var t=Gg(e),n=GO(e),i=YO(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(o){e.error(o)}})}function XJ(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=Gg(e),s=t.changedTouches?t.changedTouches[0]:t,o=Mg(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=KJ(e,n,o),t}function KJ(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(s){var a=i,u;if(s){for(u=t;u;u=u.mark.group)if(u.mark.name===s){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;_e(s)&&(s=r(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:ln(e),item:ln(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const C_="view",JJ="timer",QJ="window",ZJ={trap:!1};function eQ(e){const t=me({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{Z(i[o])&&(i[o]=Pi(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function VO(e,t,n,i){e._eventListeners.push({type:n,sources:re(t),handler:i})}function tQ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Sd(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||ce(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function nQ(e,t,n){var i=this,r=new sg(n),o=function(l,c){i.runAsync(null,()=>{e===C_&&tQ(i,t)&&l.preventDefault(),r.receive(XJ(i,l,c))})},s;if(e===JJ)Sd(i,"timer",t)&&i.timer(o,t);else if(e===C_)Sd(i,"view",t)&&i.addEventListener(t,o,ZJ);else if(e===QJ?Sd(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Sd(i,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=s.length;a<u;++a)s[a].addEventListener(t,o);VO(i,s,t,o)}return r}function S_(e){return e.item}function __(e){return e.item.mark.source}function $_(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function iQ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",S_),__,$_(e)),this.on(this.events("view","pointerout",S_),__,$_(t)),this}function rQ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,o,s,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(s=i[r],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Jn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const oQ="vega-bind",sQ="vega-bind-name",aQ="vega-bind-radio";function uQ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,s)})}},i.debounce&&(r.update=dx(i.debounce,r.update))),(i.input==null&&i.element?lQ:fQ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function lQ(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),VO(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(cQ(r))}}function cQ(e){return typeof Event<"u"?new Event(e):{type:e}}function fQ(e,t,n,i){const r=i.signal(n.signal),o=Jn("div",{class:oQ}),s=n.input==="radio"?o:o.appendChild(Jn("label"));s.appendChild(Jn("span",{class:sQ},n.name||n.signal)),t.appendChild(o);let a=dQ;switch(n.input){case"checkbox":a=hQ;break;case"select":a=pQ;break;case"radio":a=gQ;break;case"range":a=mQ;break}a(e,s,n,r)}function dQ(e,t,n,i){const r=Jn("input");for(const o in n)o!=="signal"&&o!=="element"&&r.setAttribute(o==="input"?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=o=>r.value=o}function hQ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Jn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function pQ(e,t,n,i){const r=Jn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};bp(s,i)&&(u.selected=!0),r.appendChild(Jn("option",u,(o[a]||s)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=s=>{for(let a=0,u=n.options.length;a<u;++a)if(bp(n.options[a],s)){r.selectedIndex=a;return}}}function gQ(e,t,n,i){const r=Jn("span",{class:aQ}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};bp(s,i)&&(u.checked=!0);const l=Jn("input",u);l.addEventListener("change",()=>e.update(s));const c=Jn("label",{},(o[a]||s)+"");return c.prepend(l),r.appendChild(c),l}),e.set=s=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)bp(a[l].value,s)&&(a[l].checked=!0)}}function mQ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,s=n.step||ea(o,r,100),a=Jn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Jn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function bp(e,t){return e===t||e+""==t+""}function XO(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,GO(e),YO(e),Gg(e),r,o).background(e.background())}function SE(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function yQ(e,t,n,i){const r=new i(e.loader(),SE(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Gg(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function bQ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Og(i);e=n._el=e?Qm(n,e,!0):null,jJ(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||$f,a=e?o.renderer:o.headless;return n._renderer=a?XO(n,n._renderer,e,a):null,n._handler=yQ(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=Qm(n,t,!0):e.appendChild(Jn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=Qm(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{uQ(n,u.element||t,u)})),n}function Qm(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Il=e=>+e||0,xQ=e=>({top:e,bottom:e,left:e,right:e});function F_(e){return ce(e)?{top:Il(e.top),bottom:Il(e.bottom),left:Il(e.left),right:Il(e.right)}:xQ(Il(e))}async function _E(e,t,n,i){const r=Og(t),o=r&&r.headless;return o||O("Unrecognized renderer type: "+t),await e.runAsync(),XO(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function vQ(e,t){e!==Io.Canvas&&e!==Io.SVG&&e!==Io.PNG&&O("Unrecognized image type: "+e);const n=await _E(this,e,t);return e===Io.SVG?EQ(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function EQ(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function AQ(e,t){return(await _E(this,Io.Canvas,e,t)).canvas()}async function wQ(e){return(await _E(this,Io.SVG,e)).svg()}function CQ(e,t,n){return qO(e,Cu,Vc,n).parse(t)}function SQ(e){var t=this._runtime.scales;return ue(t,e)||O("Unrecognized scale or projection: "+e),t[e].value}var KO="width",JO="height",$E="padding",k_={skip:!0};function QO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===$E?i.left+i.right:0)}function ZO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===$E?i.top+i.bottom:0)}function _Q(e){var t=e._signals,n=t[KO],i=t[JO],r=t[$E];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=QO(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=ZO(e,a.size),o()},{size:i});const s=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,s.rank=r.rank+1}function $Q(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(KO,n,k_),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(JO,i,k_),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==r[0]||s._origin[1]!==r[1])&&(s._resize=1,s._origin=r),a&&s.run("enter"),o&&s.runAfter(u=>u.resize())},!1,1)}function FQ(e){return this._runtime.getState(e||{data:kQ,signals:DQ,recurse:!0})}function kQ(e,t){return t.modified&&Z(t.input.value)&&!e.startsWith("_:vega:_")}function DQ(e,t){return!(e==="parent"||t instanceof Cu.proxy)}function TQ(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function MQ(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(nG(n,t))}function OQ(e,t,n,i){const r=e.element();r&&r.setAttribute("title",RQ(i))}function RQ(e){return e==null?"":Z(e)?eR(e):ce(e)&&!Wo(e)?NQ(e):e+""}function NQ(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(Z(n)?eR(n):tR(n))}).join(`
|
|
13
|
-
`)}function eR(e){return"["+e.map(tR).join(", ")+"]"}function tR(e){return Z(e)?"[…]":ce(e)&&!Wo(e)?"{…}":e}function LQ(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e?.();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function nR(e,t){const n=this;if(t=t||{},cu.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=me({},e.locale,t.locale);n.locale(xD(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Io.Canvas,n._scenegraph=new ZT;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||OQ,n._redraw=!0,n._handler=new $f().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=eQ(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=CQ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:me({},o)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=QO(n,n._width),n._viewHeight=ZO(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,_Q(n),qJ(n),WJ(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function _d(e,t){return ue(e._signals,t)?e._signals[t]:O("Unrecognized signal name: "+ee(t))}function iR(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function D_(e,t,n,i){let r=iR(n,i);return r||(r=SE(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function T_(e,t,n){const i=iR(t,n);return i&&t._targets.remove(i),e}H(nR,cu,{async evaluate(e,t,n){if(await cu.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,VJ(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&zd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&HO(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=_d(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",F_(e)):F_(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Og(e)||O("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(cu.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(_d(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:$Q,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=SE(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,o;--i>=0;)if(o=n[i].type,r=n[i].handler,e===o&&(t===r||t===r.raw)){this._handler.off(o,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return D_(this,e,_d(this,e),t)},removeSignalListener(e,t){return T_(this,_d(this,e),t)},addDataListener(e,t){return D_(this,e,yp(this,e).values,t)},removeDataListener(e,t){return T_(this,yp(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=cb(this,null);this._globalCursor=!!e,t&&cb(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:MQ,events:nQ,finalize:rQ,hover:iQ,data:HJ,change:Hg,insert:GJ,remove:YJ,scale:SQ,initialize:bQ,toImageURL:vQ,toCanvas:AQ,toSVG:wQ,getState:FQ,setState:TQ,_watchPixelRatio:LQ});const PQ="view",xp="[",vp="]",rR="{",oR="}",IQ=":",sR=",",BQ="@",zQ=">",UQ=/[[\]{}]/,jQ={"*":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 aR,uR;function hs(e,t,n){return aR=t||PQ,uR=n||jQ,lR(e.trim()).map(fb)}function qQ(e){return uR[e]}function _c(e,t,n,i,r){const o=e.length;let s=0,a;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.includes(a)?--s:i&&i.includes(a)&&++s}return t}function lR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=_c(e,r,sR,xp+rR,vp+oR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function fb(e){return e[0]==="["?WQ(e):HQ(e)}function WQ(e){const t=e.length;let n=1,i;if(n=_c(e,n,vp,xp,vp),n===t)throw"Empty between selector: "+e;if(i=lR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==zQ)throw"Expected '>' after between selector: "+e;i=i.map(fb);const r=fb(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function HQ(e){const t={source:aR},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===oR){if(a=e.lastIndexOf(rR),a>=0){try{i=GQ(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===BQ&&(r=++a),u=_c(e,a,IQ),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=_c(e,a,xp),a===s)n.push(e.substring(o,s).trim());else if(n.push(e.substring(o,a).trim()),l=[],o=++a,o===s)throw"Unmatched left bracket: "+e;for(;a<s;){if(a=_c(e,a,vp),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==xp)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||UQ.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):qQ(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function GQ(e){const t=e.split(sR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function YQ(e){return ce(e)?e:{type:e||"pad"}}const Bl=e=>+e||0,VQ=e=>({top:e,bottom:e,left:e,right:e});function XQ(e){return ce(e)?e.signal?e:{top:Bl(e.top),bottom:Bl(e.bottom),left:Bl(e.left),right:Bl(e.right)}:VQ(Bl(e))}const $t=e=>ce(e)&&!Z(e)?me({},e):{value:e};function M_(e,t,n,i){return n!=null?(ce(n)&&!Z(n)||Z(n)&&n.length&&ce(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function qt(e,t,n){for(const i in t)M_(e,i,t[i]);for(const i in n)M_(e,i,n[i],"update")}function cl(e,t,n){for(const i in t)n&&ue(n,i)||(e[i]=me(e[i]||{},t[i]));return e}function tu(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const FE="mark",kE="frame",DE="scope",KQ="axis",JQ="axis-domain",QQ="axis-grid",ZQ="axis-label",eZ="axis-tick",tZ="axis-title",nZ="legend",iZ="legend-band",rZ="legend-entry",oZ="legend-gradient",cR="legend-label",sZ="legend-symbol",aZ="legend-title",uZ="title",lZ="title-text",cZ="title-subtitle";function fZ(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!tu(u,e)&&Zm(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===kE?r.group:n===FE?me({},r.mark,r[t]):null;for(u in c)l=tu(u,e)||(u==="fill"||u==="stroke")&&(tu("fill",e)||tu("stroke",e)),l||Zm(o,u,c[u]);re(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)tu(h,e)||Zm(o,h,d[h])}),e=me({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=me(s,e.enter),a&&(e.update=me(a,e.update)),e}function Zm(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const fR=e=>_e(e)?ee(e):e.signal?`(${e.signal})`:dR(e);function Yg(e){if(e.gradient!=null)return hZ(e);let t=e.signal?`(${e.signal})`:e.color?dZ(e.color):e.field!=null?dR(e.field):e.value!==void 0?ee(e.value):void 0;return e.scale!=null&&(t=pZ(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${ih(e.exponent)})`),e.mult!=null&&(t+=`*${ih(e.mult)}`),e.offset!=null&&(t+=`+${ih(e.offset)}`),e.round&&(t=`round(${t})`),t}const $d=(e,t,n,i)=>`(${e}(${[t,n,i].map(Yg).join(",")})+'')`;function dZ(e){return e.c?$d("hcl",e.h,e.c,e.l):e.h||e.s?$d("hsl",e.h,e.s,e.l):e.l||e.a?$d("lab",e.l,e.a,e.b):e.r||e.g||e.b?$d("rgb",e.r,e.g,e.b):null}function hZ(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:ee(n));for(;t.length&&Se(t)==null;)t.pop();return t.unshift(fR(e.gradient)),`gradient(${t.join(",")})`}function ih(e){return ce(e)?"("+Yg(e)+")":e}function dR(e){return hR(ce(e)?e:{datum:e})}function hR(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):O("Invalid field reference: "+ee(e));return e.signal||(i=_e(i)?Hp(i).map(ee).join("]["):hR(i)),t+"["+i+"]"}function pZ(e,t){const n=fR(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+ih(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function gZ(e){let t="";return e.forEach(n=>{const i=Yg(n);t+=n.test?`(${n.test})?${i}:`:i}),Se(t)===":"&&(t+="null"),t}function pR(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=fZ(e,t,n,i,r.config);for(const a in e)s[a]=mZ(e[a],t,o,r);return o}function mZ(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=bZ(yZ(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function yZ(e){return Z(e)?gZ(e):Yg(e)}function bZ(e,t,n,i){const r=Er(e,t);return r.$fields.forEach(o=>i[o]=1),me(n,r.$params),r.$expr}const xZ="outer",vZ=["value","update","init","react","bind"];function O_(e,t){O(e+' for "outer" push: '+ee(t))}function gR(e,t){const n=e.name;if(e.push===xZ)t.signals[n]||O_("No prior signal definition",n),vZ.forEach(i=>{e[i]!==void 0&&O_("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function db(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Vg(e,t,n,i){return new db(e,t,n,i)}function Ep(e,t){return Vg("operator",e,t)}function te(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Xc(e,t){return t?{$field:e,$name:t}:{$field:e}}const hb=Xc("key");function R_(e,t){return{$compare:e,$order:t}}function EZ(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const AZ="ascending",wZ="descending";function CZ(e){return ce(e)?(e.order===wZ?"-":"+")+Xg(e.op,e.field):""}function Xg(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const TE="scope",pb="view";function Et(e){return e&&e.signal}function SZ(e){return e&&e.expr}function rh(e){if(Et(e))return!0;if(ce(e)){for(const t in e)if(rh(e[t]))return!0}return!1}function Fi(e,t){return e??t}function Vs(e){return e&&e.signal||e}const N_="timer";function Kc(e,t){return(e.merge?$Z:e.stream?FZ:e.type?kZ:O("Invalid stream specification: "+ee(e)))(e,t)}function _Z(e){return e===TE?pb:e||pb}function $Z(e,t){const n=e.merge.map(r=>Kc(r,t)),i=ME({merge:n},e,t);return t.addStream(i).id}function FZ(e,t){const n=Kc(e.stream,t),i=ME({stream:n},e,t);return t.addStream(i).id}function kZ(e,t){let n;e.type===N_?(n=t.event(N_,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(_Z(e.source),e.type);const i=ME({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function ME(e,t,n){let i=t.between;return i&&(i.length!==2&&O('Stream "between" parameter must have 2 entries: '+ee(t)),e.between=[Kc(i[0],n),Kc(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(DZ(t.marktype,t.markname,t.markrole)),t.source===TE&&i.push("inScope(event.item)"),i.length&&(e.filter=Er("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function DZ(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const TZ={code:"_.$value",ast:{type:"Identifier",value:"value"}};function MZ(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||O("Signal update missing events specification."),_e(o)&&(o=hs(o,t.isSubscope()?TE:pb)),o=re(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[RZ(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&O("Signal encode and update are mutually exclusive."),s="encode(item(),"+ee(i)+")"),r.update=_e(s)?Er(s,t):s.expr!=null?Er(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:TZ,$params:{$value:t.signalRef(s.signal)}}:O("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(me(OZ(u,t),r)))}function OZ(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Kc(e,t)}}function RZ(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function NZ(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?O("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=Er(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>MZ(r,t,n.id))}const qe=e=>(t,n,i)=>Vg(e,n,t||void 0,i),mR=qe("aggregate"),LZ=qe("axisticks"),yR=qe("bound"),Hi=qe("collect"),L_=qe("compare"),PZ=qe("datajoin"),bR=qe("encode"),IZ=qe("expression"),BZ=qe("facet"),zZ=qe("field"),UZ=qe("key"),jZ=qe("legendentries"),qZ=qe("load"),WZ=qe("mark"),HZ=qe("multiextent"),GZ=qe("multivalues"),YZ=qe("overlap"),VZ=qe("params"),xR=qe("prefacet"),XZ=qe("projection"),KZ=qe("proxy"),JZ=qe("relay"),vR=qe("render"),QZ=qe("scale"),Fa=qe("sieve"),ZZ=qe("sortitems"),ER=qe("viewlayout"),eee=qe("values");let tee=0;const AR={min:"min",max:"max",count:"sum"};function nee(e,t){const n=e.type||"linear";dT(n)||O("Unrecognized scale type: "+ee(n)),t.addScale(e.name,{type:n,domain:void 0})}function iee(e,t){const n=t.getScale(e.name).params;let i;n.domain=wR(e.domain,e,t),e.range!=null&&(n.range=SR(e,t,n)),e.interpolate!=null&&hee(e.interpolate,n),e.nice!=null&&(n.nice=dee(e.nice,t)),e.bins!=null&&(n.bins=fee(e.bins,t));for(i in e)ue(n,i)||i==="name"||(n[i]=ci(e[i],t))}function ci(e,t){return ce(e)?e.signal?t.signalRef(e.signal):O("Unsupported object: "+ee(e)):e}function oh(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>ci(n,t))}function Kg(e){O("Can not find data set: "+ee(e))}function wR(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&O("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(Z(e)?ree:e.fields?see:oee)(e,t,n)}function ree(e,t,n){return e.map(i=>ci(i,n))}function oee(e,t,n){const i=n.getData(e.data);return i||Kg(e.data),Fu(t.type)?i.valuesRef(n,e.field,CR(e.sort,!1)):gT(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function see(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=_e(s)?{data:i,field:s}:Z(s)||s.signal?aee(s,n):s,o.push(s),o),[]);return(Fu(t.type)?uee:gT(t.type)?lee:cee)(e,n,r)}function aee(e,t){const n="_:vega:_"+tee++,i=Hi({});if(Z(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+ee(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Fa({})]),{data:n,field:"data"}}function uee(e,t,n){const i=CR(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||Kg(l.data),c.countsRef(t,l.field,i)}),a={groupby:hb,pulse:s};i&&(r=i.op||"count",o=i.field?Xg(r,i.field):"count",a.ops=[AR[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(mR(a));const u=t.add(Hi({pulse:te(r)}));return o=t.add(eee({field:hb,sort:t.sortRef(i),pulse:te(u)})),te(o)}function CR(e,t){return e&&(!e.field&&!e.op?ce(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?O("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!AR[e.op]&&O("Multiple domain scales can not be sorted using "+e.op)),e}function lee(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Kg(r.data),o.domainRef(t,r.field)});return te(t.add(GZ({values:i})))}function cee(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||Kg(r.data),o.extentRef(t,r.field)});return te(t.add(HZ({extents:i})))}function fee(e,t){return e.signal||Z(e)?oh(e,t):t.objectProperty(e)}function dee(e,t){return e.signal?t.signalRef(e.signal):ce(e)?{interval:ci(e.interval),step:ci(e.step)}:ci(e)}function hee(e,t){t.interpolate=ci(e.type||e),e.gamma!=null&&(t.interpolateGamma=ci(e.gamma))}function SR(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(_e(r)){if(i&&ue(i,r))return e=me({},e,{range:i[r]}),SR(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Fu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:O("Unrecognized scale range value: "+ee(r))}else if(r.scheme){n.scheme=Z(r.scheme)?oh(r.scheme,t):ci(r.scheme,t),r.extent&&(n.schemeExtent=oh(r.extent,t)),r.count&&(n.schemeCount=ci(r.count,t));return}else if(r.step){n.rangeStep=ci(r.step,t);return}else{if(Fu(e.type)&&!Z(r))return wR(r,e,t);Z(r)||O("Unsupported range type: "+ee(r))}return r.map(o=>(Z(o)?oh:ci)(o,t))}function pee(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=gb(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=gb(n[r],r,t));t.addProjection(e.name,i)}function gb(e,t,n){return Z(e)?e.map(i=>gb(i,t,n)):ce(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:O("Unsupported parameter object: "+ee(e)):e}const Gi="top",fl="left",dl="right",is="bottom",_R="center",gee="vertical",mee="start",yee="middle",bee="end",mb="index",OE="label",xee="offset",Lu="perc",vee="perc2",di="value",Lf="guide-label",RE="guide-title",Eee="group-title",Aee="group-subtitle",P_="symbol",sh="gradient",yb="discrete",bb="size",wee="shape",Cee="fill",See="stroke",_ee="strokeWidth",$ee="strokeDash",Fee="opacity",NE=[bb,wee,Cee,See,_ee,$ee,Fee],Pf={name:1,style:1,interactive:1},$e={value:0},hi={value:1},Jg="group",$R="rect",LE="rule",kee="symbol",ka="text";function Jc(e){return e.type=Jg,e.interactive=e.interactive||!1,e}function jn(e,t){const n=(i,r)=>Fi(e[i],Fi(t[i],r));return n.isVertical=i=>gee===Fi(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Fi(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Fi(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Fi(e.columns,Fi(t.columns,+n.isVertical(!0))),n}function FR(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 Dee(e,t,n){const i=t.config.style[n];return i&&i[e]}function Qg(e,t,n){return`item.anchor === '${mee}' ? ${e} : item.anchor === '${bee}' ? ${t} : ${n}`}const PE=Qg(ee(fl),ee(dl),ee(_R));function Tee(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},ce(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function kR(e,t){return t?e?ce(e)?Object.assign({},e,{offset:kR(e.offset,t)}):{value:e,offset:t}:t:e}function ii(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=cl(e.encode,t,Pf)):e.interactive=!1,e}function Mee(e,t,n,i){const r=jn(e,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=s,d=a):(l=[0,0],c=[1,0],f=a,d=s);const h={enter:u={opacity:$e,x:$e,y:$e,width:$t(f),height:$t(d)},update:me({},u,{opacity:hi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:$e}};return qt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),ii({type:$R,role:oZ,encode:h},i)}function Oee(e,t,n,i,r){const o=jn(e,n),s=o.isVertical(),a=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";s?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:$e,fill:{scale:t,field:di}};p[l]={signal:h+"datum."+Lu,mult:u},p[c]=$e,p[f]={signal:h+"datum."+vee,mult:u},p[d]=$t(a);const g={enter:p,update:me({},p,{opacity:hi}),exit:{opacity:$e}};return qt(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),ii({type:$R,role:iZ,key:di,from:r,encode:g},i)}const Ree=`datum.${Lu}<=0?"${fl}":datum.${Lu}>=1?"${dl}":"${_R}"`,Nee=`datum.${Lu}<=0?"${is}":datum.${Lu}>=1?"${Gi}":"${yee}"`;function I_(e,t,n,i){const r=jn(e,t),o=r.isVertical(),s=$t(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:$e},update:c={opacity:hi,text:{field:OE}},exit:{opacity:$e}};return qt(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:Fi(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:Nee},f="y",d="x",h="1-"):(l.align=c.align={signal:Ree},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Lu,mult:a},l[d]=c[d]=s,s.offset=Fi(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+mb}:void 0,ii({type:ka,role:cR,style:Lf,key:di,from:i,encode:p,overlap:u},n)}function Lee(e,t,n,i,r){const o=jn(e,t),s=n.entries,a=!!(s&&s.interactive),u=s?s.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${xee} : datum.${bb}`,h=l?$t(l):{field:bb},p=`datum.${mb}`,g=`max(1, ${r})`;let m,y,b,x,v;h.mult=.5,m={enter:y={opacity:$e,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:hi,x:y.x,y:y.y},exit:{opacity:$e}};let A=null,w=null;e.fill||(A=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),qt(m,{fill:o("symbolFillColor",A),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),NE.forEach($=>{e[$]&&(b[$]=y[$]={scale:e[$],field:di})});const E=ii({type:kee,role:sZ,key:di,from:f,clip:l?!0:void 0,encode:m},n.symbols),C=$t(c);C.offset=o("labelOffset"),m={enter:y={opacity:$e,x:{signal:d,offset:C},y:h},update:b={opacity:hi,text:{field:OE},x:y.x,y:y.y},exit:{opacity:$e}},qt(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const S=ii({type:ka,role:cR,style:Lf,key:di,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:$e,height:l?$t(l):$e,opacity:$e},exit:{opacity:$e},update:b={opacity:hi,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${x}`,b.column.signal=`floor(${p} / ${x})`,v={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,v={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:mb}},Jc({role:DE,from:i,encode:cl(m,s,Pf),marks:[E,S],name:u,interactive:a,sort:v})}function Pee(e,t){const n=jn(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const IE='item.orient === "left"',BE='item.orient === "right"',Zg=`(${IE} || ${BE})`,Iee=`datum.vgrad && ${Zg}`,Bee=Qg('"top"','"bottom"','"middle"'),zee=Qg('"right"','"left"','"center"'),Uee=`datum.vgrad && ${BE} ? (${zee}) : (${Zg} && !(datum.vgrad && ${IE})) ? "left" : ${PE}`,jee=`item._anchor || (${Zg} ? "middle" : "start")`,qee=`${Iee} ? (${IE} ? -90 : 90) : 0`,Wee=`${Zg} ? (datum.vgrad ? (${BE} ? "bottom" : "top") : ${Bee}) : "top"`;function Hee(e,t,n,i){const r=jn(e,t),o={enter:{opacity:$e},update:{opacity:hi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:$e}};return qt(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:jee},angle:{signal:qee},align:{signal:Uee},baseline:{signal:Wee},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),ii({type:ka,role:aZ,style:RE,from:i,encode:o},n)}function Gee(e,t){let n;return ce(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+B_(e.path)+")":e.sphere&&(n="geoShape("+B_(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function B_(e){return ce(e)&&e.signal?e.signal:ee(e)}function DR(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===Jg?DE:t||FE}function Yee(e){return{marktype:e.type,name:e.name||void 0,role:e.role||DR(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Vee(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function zE(e,t){const n=MD(e.type);n||O("Unrecognized transform type: "+ee(e.type));const i=Vg(n.type.toLowerCase(),null,TR(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function TR(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=Xee(s,t,n)}return i}function Xee(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return Kee(e,t,n);if(r===void 0){e.required&&O("Missing required "+ee(t.type)+" parameter: "+ee(e.name));return}else{if(i==="param")return Jee(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!Et(r)?r.map(o=>z_(e,o,n)):z_(e,r,n)}function z_(e,t,n){const i=e.type;if(Et(t))return j_(i)?O("Expression references can not be signals."):e1(i)?n.fieldRef(t):q_(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||e1(i);return r&&Qee(t)?n.exprRef(t.expr,t.as):r&&Zee(t)?Xc(t.field,t.as):j_(i)?Er(t,n):ete(i)?te(n.getData(t).values):e1(i)?Xc(t):q_(i)?n.compareRef(t):t}}function Kee(e,t,n){return _e(t.from)||O('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Jee(e,t,n){const i=t[e.name];return e.array?(Z(i)||O("Expected an array of sub-parameters. Instead: "+ee(i)),i.map(r=>U_(e,r,n))):U_(e,i,n)}function U_(e,t,n){const i=e.params.length;let r;for(let s=0;s<i;++s){r=e.params[s];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||O("Unsupported parameter: "+ee(t));const o=me(TR(r,t,n),r.key);return te(n.add(VZ(o)))}const Qee=e=>e&&e.expr,Zee=e=>e&&e.field,ete=e=>e==="data",j_=e=>e==="expr",e1=e=>e==="field",q_=e=>e==="compare";function tte(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||O("Only group marks can be faceted."),i.field!=null?s=a=ah(i,n):(e.data?a=te(n.getData(e.data).aggregate):(o=zE(me({type:"aggregate",groupby:re(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=ah(i,n),s=a=te(n.add(o))),r=n.keyRef(i.groupby,!0))):s=te(n.add(Hi(null,[{}]))),s||(s=ah(e,n)),{key:r,pulse:s,parent:a}}function ah(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:te(t.getData(e.data).output)}function la(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}la.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=te(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new la(e,o,r,i,s)};function MR(e){return _e(e)?e:null}function W_(e,t,n){const i=Xg(n.op,n.field);let r;if(t.ops){for(let o=0,s=t.as.length;o<s;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function zl(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=CZ(o);let l=MR(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:hb,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:te(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(Vg(i,void 0,d)),s&&(t.index[r]=f),c=te(f),l!=null&&(a[l]=c)}return c}la.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=MR(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&W_(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:te(i.output)},n&&n.field&&W_(e,u,n),a=e.add(mR(u)),s=e.add(Hi({pulse:te(a)})),s={agg:a,ref:te(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return te(this.values)},extentRef(e,t){return zl(e,this,"extent","extent",t,!1)},domainRef(e,t){return zl(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return zl(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return zl(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return zl(e,this,"indata","tupleindex",t,!0,!0)}};function nte(e,t,n){const i=e.from.facet,r=i.name,o=ah(i,t);let s;i.name||O("Facet must have a name: "+ee(i)),i.data||O("Facet must reference a data set: "+ee(i)),i.field?s=t.add(xR({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(BZ({key:t.keyRef(i.groupby),group:te(t.proxy(n.parent)),pulse:o})):O("Facet must specify groupby or field: "+ee(i));const a=t.fork(),u=a.add(Hi()),l=a.add(Fa({pulse:te(u)}));a.addData(r,new la(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function ite(e,t,n){const i=t.add(xR({pulse:n.pulse})),r=t.fork();r.add(Fa()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function OR(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(Ep()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=Er(l,t);u.update=c.$expr,u.params=c.$params}function e0(e,t){const n=DR(e),i=e.type===Jg,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===DE||n===kE,a,u,l,c,f,d,h;const p=n===FE||s||r,g=tte(e.from,i,t);u=t.add(PZ({key:g.key||(e.key?Xc(e.key):void 0),pulse:g.pulse,clean:!i}));const m=te(u);u=l=t.add(Hi({pulse:m})),u=t.add(WZ({markdef:Yee(e),interactive:Vee(e.interactive,t),clip:Gee(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:te(u)}));const y=te(u);u=c=t.add(bR(pR(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(w=>{const E=zE(w,t),C=E.metadata;(C.generates||C.changes)&&O("Mark transforms should not generate new data."),C.nomod||(c.params.mod=!0),E.params.pulse=te(u),t.add(u=E)}),e.sort&&(u=t.add(ZZ({sort:t.compareRef(e.sort),pulse:te(u)})));const b=te(u);(r||s)&&(s=t.add(ER({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=te(s));const x=t.add(yR({mark:y,pulse:d||b}));h=te(x),i&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?nte(e,t,g):p?ite(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(x))),o&&(h=rte(o,h,t));const v=t.add(vR({pulse:h})),A=t.add(Fa({pulse:te(v)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new la(t,l,v,A)),e.on&&e.on.forEach(w=>{(w.insert||w.remove||w.toggle)&&O("Marks only support modify triggers."),OR(w,t,f)}))}function rte(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:Et(o)?n.signalRef(o.signal):o,method:Et(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;s.boundTolerance=Et(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return te(n.add(YZ(s)))}function ote(e,t){const n=t.config.legend,i=e.encode||{},r=jn(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;NE.forEach(x=>e[x]?(l[x]=e[x],c=c||e[x]):0),c||O("Missing valid scale for legend.");const p=ste(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=te(t.add(Hi(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=te(t.add(jZ(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===sh?(h=[Mee(e,c,n,i.gradient),I_(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Vs(r.gradientLength())})/100))`)):p===yb?h=[Oee(e,c,n,i.gradient,b),I_(e,n,i.labels,b)]:(f=Pee(e,n),h=[Lee(e,n,i,b,Vs(f.columns))],d.size=lte(e,t,h[0].marks)),h=[Jc({role:rZ,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(Hee(e,n,i.title,m)),e0(Jc({role:nZ,from:m,encode:cl(ute(r,e,n),o,Pf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function ste(e,t){let n=e.type||P_;return!e.type&&ate(e)===1&&(e.fill||e.stroke)&&(n=jv(t)?sh:cy(t)?yb:P_),n!==sh?n:cy(t)?yb:sh}function ate(e){return NE.reduce((t,n)=>t+(e[n]?1:0),0)}function ute(e,t,n){const i={enter:{},update:{}};return qt(i,{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}),i}function lte(e,t,n){const i=Vs(H_("size",e,n)),r=Vs(H_("strokeWidth",e,n)),o=Vs(cte(n[1].encode,t,Lf));return Er(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function H_(e,t,n){return t[e]?`scale("${t[e]}",datum)`:FR(e,n[0].encode)}function cte(e,t,n){return FR("fontSize",e)||Dee("fontSize",t,n)}const fte=`item.orient==="${fl}"?-90:item.orient==="${dl}"?90:0`;function dte(e,t){e=_e(e)?{text:e}:e;const n=jn(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=te(t.add(Hi(null,[l])));return u.push(gte(e,n,hte(e),c)),e.subtitle&&u.push(mte(e,n,i.subtitle,c)),e0(Jc({role:uZ,from:c,encode:pte(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function hte(e){const t=e.encode;return t&&t.title||me({name:e.name,interactive:e.interactive,style:e.style},t)}function pte(e,t){const n={enter:{},update:{}};return qt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:PE},angle:{signal:fte},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),cl(n,t,Pf)}function gte(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return qt(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),ii({type:ka,role:lZ,style:Eee,from:i,encode:s},n)}function mte(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return qt(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),ii({type:ka,role:cZ,style:Aee,from:i,encode:s},n)}function yte(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(zE(i,t))}),e.on&&e.on.forEach(i=>{OR(i,t,e.name)}),t.addDataPipeline(e.name,bte(e,t,n))}function bte(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?Et(e.values)||rh(e.format)?(i.push(G_(t,e)),i.push(r=_s())):i.push(r=_s({$ingest:e.values,$format:e.format})):e.url?rh(e.url)||rh(e.format)?(i.push(G_(t,e)),i.push(r=_s())):i.push(r=_s({$request:e.url,$format:e.format})):e.source&&(r=a=re(e.source).map(d=>te(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=_s()),i.push(c),f.generates&&(s=!0),f.modifies&&!s&&(o=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=JZ({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,_s())),r||i.push(_s()),i.push(Fa({})),i}function _s(e){const t=Hi({},e);return t.metadata={source:!0},t}function G_(e,t){return qZ({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const RR=e=>e===is||e===Gi,t0=(e,t,n)=>Et(e)?Ate(e.signal,t,n):e===fl||e===Gi?t:n,Ft=(e,t,n)=>Et(e)?vte(e.signal,t,n):RR(e)?t:n,Ni=(e,t,n)=>Et(e)?Ete(e.signal,t,n):RR(e)?n:t,NR=(e,t,n)=>Et(e)?wte(e.signal,t,n):e===Gi?{value:t}:{value:n},xte=(e,t,n)=>Et(e)?Cte(e.signal,t,n):e===dl?{value:t}:{value:n},vte=(e,t,n)=>LR(`${e} === '${Gi}' || ${e} === '${is}'`,t,n),Ete=(e,t,n)=>LR(`${e} !== '${Gi}' && ${e} !== '${is}'`,t,n),Ate=(e,t,n)=>UE(`${e} === '${fl}' || ${e} === '${Gi}'`,t,n),wte=(e,t,n)=>UE(`${e} === '${Gi}'`,t,n),Cte=(e,t,n)=>UE(`${e} === '${dl}'`,t,n),LR=(e,t,n)=>(t=t!=null?$t(t):t,n=n!=null?$t(n):n,Y_(t)&&Y_(n)?(t=t?t.signal||ee(t.value):null,n=n?n.signal||ee(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[me({test:e},t)].concat(n||[])),Y_=e=>e==null||Object.keys(e).length===1,UE=(e,t,n)=>({signal:`${e} ? (${uu(t)}) : (${uu(n)})`}),Ste=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${fl}' ? (${uu(i)}) : `:"")+(n!=null?`${e} === '${is}' ? (${uu(n)}) : `:"")+(r!=null?`${e} === '${dl}' ? (${uu(r)}) : `:"")+(t!=null?`${e} === '${Gi}' ? (${uu(t)}) : `:"")+"(null)"}),uu=e=>Et(e)?e.signal:e==null?null:ee(e),_te=(e,t)=>t===0?0:Et(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},hu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Ka(e,t,n,i){let r;if(t&&ue(t,e))return t[e];if(ue(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[RE][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Lf][r]}return null}function V_(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function $te(e,t){var n=t.config,i=n.style,r=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,u,l;if(Et(s)){const f=V_([n.axisX,n.axisY]),d=V_([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=Ft(s,Ka(l,n.axisX,r,i),Ka(l,n.axisY,r,i));u={};for(l of d)u[l]=Ste(s.signal,Ka(l,n.axisTop,r,i),Ka(l,n.axisBottom,r,i),Ka(l,n.axisLeft,r,i),Ka(l,n.axisRight,r,i))}else a=s===Gi||s===is?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?me({},r,a,u,o):r}function Fte(e,t,n,i){const r=jn(e,t),o=e.orient;let s,a;const u={enter:s={opacity:$e},update:a={opacity:hi},exit:{opacity:$e}};qt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=X_(e,0),c=X_(e,1);return s.x=a.x=Ft(o,l,$e),s.x2=a.x2=Ft(o,c),s.y=a.y=Ni(o,l,$e),s.y2=a.y2=Ni(o,c),ii({type:LE,role:JQ,from:i,encode:u},n)}function X_(e,t){return{scale:e.scale,range:t}}function kte(e,t,n,i,r){const o=jn(e,t),s=e.orient,a=e.gridScale,u=t0(s,1,-1),l=Dte(e.offset,u);let c,f,d;const h={enter:c={opacity:$e},update:d={opacity:hi},exit:f={opacity:$e}};qt(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:di,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=Ft(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:me(g,{mult:u,offset:l});return c.x=d.x=Ft(s,p,m),c.y=d.y=Ni(s,p,m),c.x2=d.x2=Ni(s,y),c.y2=d.y2=Ft(s,y),f.x=Ft(s,p),f.y=Ni(s,p),ii({type:LE,role:QQ,key:di,from:i,encode:h},n)}function Dte(e,t){if(t!==1)if(!ce(e))e=Et(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=me({},e);for(;n.mult!=null;)if(ce(n.mult))n=n.mult=me({},n.mult);else return n.mult=Et(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Tte(e,t,n,i,r,o){const s=jn(e,t),a=e.orient,u=t0(a,-1,1);let l,c,f;const d={enter:l={opacity:$e},update:f={opacity:hi},exit:c={opacity:$e}};qt(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=$t(r);h.mult=u;const p={scale:e.scale,field:di,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=Ft(a,$e,p),f.y2=l.y2=Ft(a,h),c.x=Ft(a,p),f.x=l.x=Ni(a,$e,p),f.x2=l.x2=Ni(a,h),c.y=Ni(a,p),ii({type:LE,role:eZ,key:di,from:i,encode:d},n)}function t1(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Mte(e,t,n,i,r,o){const s=jn(e,t),a=e.orient,u=e.scale,l=t0(a,-1,1),c=Vs(s("labelFlush")),f=Vs(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=c===0||!!c,g;const m=$t(r);m.mult=l,m.offset=$t(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:di,band:.5,offset:kR(o.offset,s("labelOffset"))},b=Ft(a,p?t1(u,c,'"left"','"right"','"center"'):{value:"center"},xte(a,"left","right")),x=Ft(a,NR(a,"bottom","top"),p?t1(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),v=t1(u,c,`-(${f})`,f,0);p=p&&f;const A={opacity:$e,x:Ft(a,y,m),y:Ni(a,y,m)},w={enter:A,update:g={opacity:hi,text:{field:OE},x:A.x,y:A.y,align:b,baseline:x},exit:{opacity:$e,x:A.x,y:A.y}};qt(w,{dx:!d&&p?Ft(a,v):null,dy:!h&&p?Ni(a,v):null}),qt(w,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const E=s("labelBound");let C=s("labelOverlap");return C=C||E?{separation:s("labelSeparation"),method:C,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,g.align!==b&&(g.align=hu(g.align,b)),g.baseline!==x&&(g.baseline=hu(g.baseline,x)),ii({type:ka,role:ZQ,style:Lf,key:di,from:i,encode:w,overlap:C},n)}function Ote(e,t,n,i){const r=jn(e,t),o=e.orient,s=t0(o,-1,1);let a,u;const l={enter:a={opacity:$e,anchor:$t(r("titleAnchor",null)),align:{signal:PE}},update:u=me({},a,{opacity:hi,text:$t(e.title)}),exit:{opacity:$e}},c={signal:`lerp(range("${e.scale}"), ${Qg(0,1,.5)})`};return u.x=Ft(o,c),u.y=Ni(o,c),a.angle=Ft(o,$e,_te(s,90)),a.baseline=Ft(o,NR(o,is,Gi),{value:is}),u.angle=a.angle,u.baseline=a.baseline,qt(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Rte(r,o,l,n),l.update.align=hu(l.update.align,a.align),l.update.angle=hu(l.update.angle,a.angle),l.update.baseline=hu(l.update.baseline,a.baseline),ii({type:ka,role:tZ,style:RE,from:i,encode:l},n)}function Rte(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=hu($t(a),n.update[u]),!1):!tu(u,i),o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?$t(s):Ft(t,$t(s),$t(o))}function Nte(e,t){const n=$te(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=jn(e,n),l=Tee(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=te(t.add(Hi({},[c]))),d=te(t.add(LZ({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(kte(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(Tte(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(Mte(e,n,i.labels,d,p,l))),c.domain&&h.push(Fte(e,n,i.domain,f)),c.title&&h.push(Ote(e,n,i.title,f)),e0(Jc({role:KQ,from:f,encode:cl(Lte(u,e),r,Pf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function Lte(e,t){const n={enter:{},update:{}};return qt(n,{orient:e("orient"),offset:e("offset")||0,position:Fi(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 PR(e,t,n){const i=re(e.signals),r=re(e.scales);return n||i.forEach(o=>gR(o,t)),re(e.projections).forEach(o=>pee(o,t)),r.forEach(o=>nee(o,t)),re(e.data).forEach(o=>yte(o,t)),r.forEach(o=>iee(o,t)),(n||i).forEach(o=>NZ(o,t)),re(e.axes).forEach(o=>Nte(o,t)),re(e.marks).forEach(o=>e0(o,t)),re(e.legends).forEach(o=>ote(o,t)),e.title&&dte(e.title,t),t.parseLambdas(),t}const Pte=e=>cl({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Ite(e,t){const n=t.config,i=te(t.root=t.add(Ep())),r=Bte(e,n);r.forEach(l=>gR(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Hi()),s=t.add(bR(pR(Pte(e.encode),Jg,kE,e.style,t,{pulse:te(o)}))),a=t.add(ER({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:te(s)}));t.operators.pop(),t.pushState(te(s),te(a),null),PR(e,t,r),t.operators.push(a);let u=t.add(yR({mark:i,pulse:te(a)}));return u=t.add(vR({pulse:te(u)})),u=t.add(Fa({pulse:te(u)})),t.addData("root",new la(t,o,o,u)),t}function Ul(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Bte(e,t){const n=s=>Fi(e[s],t[s]),i=[Ul("background",n("background")),Ul("autosize",YQ(n("autosize"))),Ul("padding",XQ(n("padding"))),Ul("width",n("width")||0),Ul("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return re(e.signals).forEach(s=>{ue(r,s.name)?s=me(r[s.name],s):i.push(s),o[s.name]=s}),re(t.signals).forEach(s=>{!ue(o,s.name)&&!ue(r,s.name)&&i.push(s)}),i}function IR(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 K_(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}IR.prototype=K_.prototype={parse(e){return PR(e,this)},fork(){return new K_(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 db?te(e):e;return this.add(KZ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,o){let s,a;i&&(s=i.data||(i.data={}),a=s[r]||(s[r]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(te(this.add(Fa({pulse:e})))),this._parent.push(t),this._lookup.push(n?te(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Se(this._parent)},encode(){return Se(this._encode)},lookup(){return Se(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(_e(e))return Xc(e,t);e.signal||O("Unsupported field reference: "+ee(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=te(this.add(zZ(r)))}return i},compareRef(e){let t=!1;const n=o=>Et(o)?(t=!0,this.signalRef(o.signal)):SZ(o)?(t=!0,this.exprRef(o.expr)):o,i=re(e.field).map(n),r=re(e.order).map(n);return t?te(this.add(L_({fields:i,orders:r}))):R_(i,r)},keyRef(e,t){let n=!1;const i=o=>Et(o)?(n=!0,te(r[o.signal])):o,r=this.signals;return e=re(e).map(i),n?te(this.add(UZ({fields:e,flat:t}))):EZ(e,t)},sortRef(e){if(!e)return e;const t=Xg(e.op,e.field),n=e.order||AZ;return n.signal?te(this.add(L_({fields:t,orders:this.signalRef(n.signal)}))):R_(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return ue(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&O("Duplicate signal name: "+ee(e));const n=t instanceof db?t:this.add(Ep(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||O("Unrecognized signal name: "+ee(e)),this.signals[e]},signalRef(e){return this.signals[e]?te(this.signals[e]):(ue(this.lambdas,e)||(this.lambdas[e]=this.add(Ep(null))),te(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=Er(i,this),o=this.lambdas[i];o.params=r.$params,o.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!ce(e)?e:this.signalRef(e.signal||jE(e))},exprRef(e,t){const n={expr:Er(e,this)};return t&&(n.expr.$name=t),te(this.add(IZ(n)))},addBinding(e,t){this.bindings||O("Nested signals do not support binding: "+ee(e)),this.bindings.push(me({signal:e},t))},addScaleProj(e,t){ue(this.scales,e)&&O("Duplicate scale or projection name: "+ee(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,QZ(t))},addProjection(e,t){this.addScaleProj(e,XZ(t))},getScale(e){return this.scales[e]||O("Unrecognized scale name: "+ee(e)),this.scales[e]},scaleRef(e){return te(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return ue(this.data,e)&&O("Duplicate data set name: "+ee(e)),this.data[e]=t},getData(e){return this.data[e]||O("Undefined data set name: "+ee(e)),this.data[e]},addDataPipeline(e,t){return ue(this.data,e)&&O("Duplicate data set name: "+ee(e)),this.addData(e,la.fromEntries(this,t))}};function jE(e){return(Z(e)?zte:Ute)(e)}function zte(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(ce(r)?r.signal||jE(r):ee(r))}return n+"]"}function Ute(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+ee(i)+":"+(ce(r)?r.signal||jE(r):ee(r));return t+"}"}function jte(){const e="sans-serif",i="#4c78a8",r="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,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:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function qte(e,t,n){return ce(e)||O("Input Vega specification must be an object."),t=Gp(jte(),t,e.config),Ite(e,new IR(t,n)).toRuntime()}var Wte="6.2.0";me(Cu,mI,mq,Vq,OH,vG,YY,_Y,XY,xV,kV,LV);const Hte=Wte,Gte=Object.freeze(Object.defineProperty({__proto__:null,Bounds:mt,CanvasHandler:$f,CanvasRenderer:Ih,DATE:Ln,DAY:Qt,DAYOFYEAR:xr,Dataflow:cu,Debug:ak,DisallowedObjectProperties:sx,Error:ax,EventStream:sg,Gradient:DT,GroupItem:Sg,HOURS:ei,Handler:h2,HybridHandler:vM,HybridRenderer:Ey,Info:sk,Item:Cg,MILLISECONDS:Ii,MINUTES:ti,MONTH:rn,Marks:ni,MultiPulse:Dx,None:rk,Operator:He,Parameters:og,Pulse:Go,QUARTER:Nn,RenderType:Io,Renderer:_f,ResourceLoader:LT,SECONDS:mi,SVGHandler:aM,SVGRenderer:x2,SVGStringRenderer:xM,Scenegraph:ZT,TIME_UNITS:vx,Transform:M,View:nR,WEEK:xt,Warn:ok,YEAR:jt,accessor:Un,accessorFields:nn,accessorName:ut,array:re,ascending:el,bandwidthNRD:Rx,bin:ND,bootstrapCI:LD,boundClip:DM,boundContext:Af,boundItem:my,boundMark:XT,boundStroke:po,changeset:Sa,clampRange:xk,codegenExpression:kO,compare:fx,constant:ln,cumulativeLogNormal:zx,cumulativeNormal:ug,cumulativeUniform:Wx,dayofyear:jk,debounce:dx,defaultLocale:Sx,definition:MD,densityLogNormal:Bx,densityNormal:Nx,densityUniform:qx,domChild:bt,domClear:si,domCreate:Lo,domFind:d2,dotbin:PD,error:O,expressionFunction:ht,extend:me,extent:mr,extentIndex:vk,falsy:So,fastmap:tl,field:pi,flush:Ek,font:Dg,fontFamily:Sf,fontSize:_r,format:Bd,formatLocale:bh,formats:Fx,hasOwnProperty:ue,id:cf,identity:An,inferType:ED,inferTypes:AD,ingest:Re,inherits:H,inrange:iu,interpolate:qv,interpolateColors:Ag,interpolateRange:mT,intersect:_M,intersectBoxLine:ru,intersectPath:Jv,intersectPoint:Qv,intersectRule:IT,isArray:Z,isBoolean:hx,isDate:Wo,isFunction:ye,isIterable:Ak,isNumber:Ko,isObject:ce,isRegExp:px,isString:_e,isTuple:ig,key:gx,lerp:wk,lineHeight:es,loader:tg,locale:xD,logger:uk,lruCache:Ck,markup:b2,merge:Sk,mergeConfig:Gp,multiLineOffset:l2,one:Zu,pad:_k,panLinear:hk,panLog:pk,panPow:gk,panSymlog:mk,parse:qte,parseExpression:_O,parseSelector:hs,path:ox,pathCurves:Vv,pathEqual:TM,pathParse:ku,pathRectangle:OT,pathRender:Ic,pathSymbols:MT,pathTrail:RT,peek:Se,point:Mg,projection:I2,quantileLogNormal:Ux,quantileNormal:lg,quantileUniform:Hx,quantiles:Mx,quantizeInterpolator:yT,quarter:yk,quartiles:Ox,get random(){return yi},randomInteger:vP,randomKDE:Px,randomLCG:xP,randomLogNormal:BD,randomMixture:zD,randomNormal:Lx,randomUniform:UD,read:SD,regressionConstant:Gx,regressionExp:qD,regressionLinear:Yx,regressionLoess:GD,regressionLog:jD,regressionPoly:HD,regressionPow:WD,regressionQuad:Vx,renderModule:Og,repeat:Vl,resetDefaultLocale:y7,resetSVGDefIds:Rj,responseType:CD,runtimeContext:qO,sampleCurve:fg,sampleLogNormal:Ix,sampleNormal:ag,sampleUniform:jx,scale:Oe,sceneEqual:v2,sceneFromJSON:JT,scenePickVisit:Dh,sceneToJSON:KT,sceneVisit:Bi,sceneZOrder:Zv,scheme:Wv,serializeXML:gM,setHybridRendererOptions:Dj,setRandom:yP,span:ff,splitAccessPath:Hp,stringValue:ee,textMetrics:Kn,timeBin:oD,timeFloor:Xk,timeFormatLocale:Rc,timeInterval:rl,timeOffset:Qk,timeSequence:tD,timeUnitSpecifier:Uk,timeUnits:Ex,toBoolean:mx,toDate:yx,toNumber:en,toSet:Pi,toString:bx,transform:OD,transforms:Cu,truncate:$k,truthy:gi,tupleid:ne,typeParsers:oy,utcFloor:Kk,utcInterval:ol,utcOffset:Zk,utcSequence:nD,utcdayofyear:Hk,utcquarter:bk,utcweek:Gk,version:Hte,visitArray:Fo,week:qk,writeConfig:Yp,zero:Oo,zoomLinear:ux,zoomLog:lx,zoomPow:ph,zoomSymlog:cx},Symbol.toStringTag,{value:"Module"})),Yte=/("(?:[^\\"]|\\.)*")|[:,]/g;function n1(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return(function o(s,a,u){s&&typeof s.toJSON=="function"&&(s=s.toJSON());const l=JSON.stringify(s,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(Yte,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(s=JSON.parse(l),r=void 0),typeof s=="object"&&s!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(s)){p="[",g="]";const{length:m}=s;for(;h<m;h++)d.push(o(s[h],f,h===m-1?0:1)||"null")}else{p="{",g="}";const m=Object.keys(s),{length:y}=m;for(;h<y;h++){const b=m[h],x=`${JSON.stringify(b)}: `,v=o(s[b],f,x.length+(h===y-1?0:1));v!==void 0&&d.push(x+v)}}if(d.length>0)return[p,n+d.join(`,
|
|
14
|
-
${f}`),g].join(`
|
|
15
|
-
${a}`)}return l})(e,"",0)}function Vte(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),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&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Xte={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},Kte={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Jte={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Qte=Array.prototype.slice,$s=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Qte.call(t,1))},Zte=(e,t=0,n=1,i=0,r=0,o=0,s=0)=>_e(e)?new Date(e):new Date(e,t,n,i,r,o,s);var ene={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:Zte,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(),sort:e=>e.slice().sort(el),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(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const tne=["view","item","group","xy","x","y"],xb=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&xb.add(setImmediate);const nne={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Xte[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),xb.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||ene[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Kte[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Jte[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);e.memberDepth-=1;const o=e(i.value);return sx.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):xb.has(o)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):n[r]=o,n},{})};function jl(e,t,n,i,r,o){const s=a=>nne[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=i,s.event=r,s.item=o,tne.forEach(a=>s.fn[a]=(...u)=>r.vega[a](...u)),s(e)}var ine={operator(e,t){const n=t.ast,i=e.functions;return r=>jl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>jl(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>jl(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,o)=>{const s=o.item&&o.item.datum;return jl(n,i,r,s,o)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const u=s.datum;let l=0,c;for(const f in i)c=jl(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&Vte(s,i,o),l}}};function hl(e,t,n){return e.fields=t||[],e.fname=n,e}function rne(e){return e.length===1?one(e[0]):sne(e)}const one=e=>function(t){return t[e]},sne=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function i1(e){throw Error(e)}function Da(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||i1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&i1("Access path missing closing bracket: "+e),i&&i1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function ane(e,t,n){const i=Da(e);return e=i.length===1?i[0]:e,hl(rne(i),[e],e)}ane("id");const une=hl(e=>e,[],"identity");hl(()=>0,[],"zero");hl(()=>1,[],"one");hl(()=>!0,[],"true");hl(()=>!1,[],"false");function lne(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const cne=0,fne=1,BR=2,dne=3,hne=4;function pne(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lne,i=e||cne;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=fne&&n("error","ERROR",arguments),this},warn(){return i>=BR&&n("warn","WARN",arguments),this},info(){return i>=dne&&n("log","INFO",arguments),this},debug(){return i>=hne&&n("log","DEBUG",arguments),this}}}var X=Array.isArray;function ke(e){return e===Object(e)}const J_=e=>e!=="__proto__";function zR(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=gne(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;n0(i,o,r[o],s)}return i},{})}function n0(e,t,n,i){if(!J_(t))return;let r,o;if(ke(n)&&!X(n)){o=ke(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?n0(o,r,n[r]):J_(r)&&(o[r]=n[r])}else e[t]=n}function gne(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function ct(e){return e!=null?X(e)?e:[e]:[]}function mne(e){return typeof e=="function"}function pt(e,t){return Object.hasOwn(e,t)}function If(e){return typeof e=="boolean"}function Ze(e){return typeof e=="number"}function he(e){return typeof e=="string"}function Fe(e){return X(e)?"["+e.map(Fe)+"]":ke(e)||he(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function pl(e,t,n){return e.fields=t||[],e.fname=n,e}function yne(e){return e.length===1?bne(e[0]):xne(e)}const bne=e=>function(t){return t[e]},xne=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function r1(e){throw Error(e)}function vne(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||r1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&r1("Access path missing closing bracket: "+e),i&&r1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Ene(e,t,n){const i=vne(e);return e=i.length===1?i[0]:e,pl(yne(i),[e],e)}Ene("id");pl(e=>e,[],"identity");pl(()=>0,[],"zero");pl(()=>1,[],"one");pl(()=>!0,[],"true");pl(()=>!1,[],"false");[...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function")];const Ane="RawCode",wne="Literal",Cne="Property",Sne="Identifier",_ne="ArrayExpression",$ne="BinaryExpression",Fne="CallExpression",kne="ConditionalExpression",Dne="LogicalExpression",Tne="MemberExpression",Mne="ObjectExpression",One="UnaryExpression";function Yi(e){this.type=e}Yi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Rne(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function Rne(e){switch(e.type){case _ne:return e.elements;case $ne:case Dne:return[e.left,e.right];case Fne:return[e.callee].concat(e.arguments);case kne:return[e.test,e.consequent,e.alternate];case Tne:return[e.object,e.property];case Mne:return e.properties;case Cne:return[e.key,e.value];case One:return[e.argument];case Sne:case wne:case Ane:default:return[]}}var Dr,J,N,an,Ue,i0=1,Bf=2,ca=3,ps=4,r0=5,Ta=6,Dn=7,zf=8,Nne=9;Dr={};Dr[i0]="Boolean";Dr[Bf]="<end>";Dr[ca]="Identifier";Dr[ps]="Keyword";Dr[r0]="Null";Dr[Ta]="Numeric";Dr[Dn]="Punctuator";Dr[zf]="String";Dr[Nne]="RegularExpression";var Lne="ArrayExpression",Pne="BinaryExpression",Ine="CallExpression",Bne="ConditionalExpression",UR="Identifier",zne="Literal",Une="LogicalExpression",jne="MemberExpression",qne="ObjectExpression",Wne="Property",Hne="UnaryExpression",kt="Unexpected token %0",Gne="Unexpected number",Yne="Unexpected string",Vne="Unexpected identifier",Xne="Unexpected reserved word",Kne="Unexpected end of input",vb="Invalid regular expression",o1="Invalid regular expression: missing /",jR="Octal literals are not allowed in strict mode.",Jne="Duplicate data property in object literal not allowed in strict mode",Ut="ILLEGAL",Qc="Disabled.",Qne=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]"),Zne=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 o0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Hr(e){return e>=48&&e<=57}function qE(e){return"0123456789abcdefABCDEF".includes(e)}function $c(e){return"01234567".includes(e)}function eie(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Zc(e){return e===10||e===13||e===8232||e===8233}function Uf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Qne.test(String.fromCharCode(e))}function Ap(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Zne.test(String.fromCharCode(e))}const tie={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 qR(){for(;N<an;){const e=J.charCodeAt(N);if(eie(e)||Zc(e))++N;else break}}function Eb(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)N<an&&qE(J[N])?(i=J[N++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):Te({},kt,Ut);return String.fromCharCode(r)}function nie(){var e,t,n,i;for(e=J[N],t=0,e==="}"&&Te({},kt,Ut);N<an&&(e=J[N++],!!qE(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Te({},kt,Ut),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function WR(){var e,t;for(e=J.charCodeAt(N++),t=String.fromCharCode(e),e===92&&(J.charCodeAt(N)!==117&&Te({},kt,Ut),++N,e=Eb("u"),(!e||e==="\\"||!Uf(e.charCodeAt(0)))&&Te({},kt,Ut),t=e);N<an&&(e=J.charCodeAt(N),!!Ap(e));)++N,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),J.charCodeAt(N)!==117&&Te({},kt,Ut),++N,e=Eb("u"),(!e||e==="\\"||!Ap(e.charCodeAt(0)))&&Te({},kt,Ut),t+=e);return t}function iie(){var e,t;for(e=N++;N<an;){if(t=J.charCodeAt(N),t===92)return N=e,WR();if(Ap(t))++N;else break}return J.slice(e,N)}function rie(){var e,t,n;return e=N,t=J.charCodeAt(N)===92?WR():iie(),t.length===1?n=ca:tie.hasOwnProperty(t)?n=ps:t==="null"?n=r0:t==="true"||t==="false"?n=i0:n=ca,{type:n,value:t,start:e,end:N}}function s1(){var e=N,t=J.charCodeAt(N),n,i=J[N],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++N,{type:Dn,value:String.fromCharCode(t),start:e,end:N};default:if(n=J.charCodeAt(N+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return N+=2,{type:Dn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:N};case 33:case 61:return N+=2,J.charCodeAt(N)===61&&++N,{type:Dn,value:J.slice(e,N),start:e,end:N}}}if(s=J.substr(N,4),s===">>>=")return N+=4,{type:Dn,value:s,start:e,end:N};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return N+=3,{type:Dn,value:o,start:e,end:N};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return N+=2,{type:Dn,value:r,start:e,end:N};if(r==="//"&&Te({},kt,Ut),"<>=!+-*%&|^/".includes(i))return++N,{type:Dn,value:i,start:e,end:N};Te({},kt,Ut)}function oie(e){let t="";for(;N<an&&qE(J[N]);)t+=J[N++];return t.length===0&&Te({},kt,Ut),Uf(J.charCodeAt(N))&&Te({},kt,Ut),{type:Ta,value:parseInt("0x"+t,16),start:e,end:N}}function sie(e){let t="0"+J[N++];for(;N<an&&$c(J[N]);)t+=J[N++];return(Uf(J.charCodeAt(N))||Hr(J.charCodeAt(N)))&&Te({},kt,Ut),{type:Ta,value:parseInt(t,8),octal:!0,start:e,end:N}}function Q_(){var e,t,n;if(n=J[N],o0(Hr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=N,e="",n!=="."){if(e=J[N++],n=J[N],e==="0"){if(n==="x"||n==="X")return++N,oie(t);if($c(n))return sie(t);n&&Hr(n.charCodeAt(0))&&Te({},kt,Ut)}for(;Hr(J.charCodeAt(N));)e+=J[N++];n=J[N]}if(n==="."){for(e+=J[N++];Hr(J.charCodeAt(N));)e+=J[N++];n=J[N]}if(n==="e"||n==="E")if(e+=J[N++],n=J[N],(n==="+"||n==="-")&&(e+=J[N++]),Hr(J.charCodeAt(N)))for(;Hr(J.charCodeAt(N));)e+=J[N++];else Te({},kt,Ut);return Uf(J.charCodeAt(N))&&Te({},kt,Ut),{type:Ta,value:parseFloat(e),start:t,end:N}}function aie(){var e="",t,n,i,r,o=!1;for(t=J[N],o0(t==="'"||t==='"',"String literal must starts with a quote"),n=N,++N;N<an;)if(i=J[N++],i===t){t="";break}else if(i==="\\")if(i=J[N++],!i||!Zc(i.charCodeAt(0)))switch(i){case"u":case"x":J[N]==="{"?(++N,e+=nie()):e+=Eb(i);break;case"n":e+=`
|
|
16
|
-
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:$c(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),N<an&&$c(J[N])&&(o=!0,r=r*8+"01234567".indexOf(J[N++]),"0123".includes(i)&&N<an&&$c(J[N])&&(r=r*8+"01234567".indexOf(J[N++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&J[N]===`
|
|
17
|
-
`&&++N;else{if(Zc(i.charCodeAt(0)))break;e+=i}return t!==""&&Te({},kt,Ut),{type:zf,value:e,octal:o,start:n,end:N}}function uie(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Te({},vb)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Te({},vb)}try{return new RegExp(e,t)}catch{return null}}function lie(){var e,t,n,i,r;for(e=J[N],o0(e==="/","Regular expression literal must start with a slash"),t=J[N++],n=!1,i=!1;N<an;)if(e=J[N++],t+=e,e==="\\")e=J[N++],Zc(e.charCodeAt(0))&&Te({},o1),t+=e;else if(Zc(e.charCodeAt(0)))Te({},o1);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||Te({},o1),r=t.substr(1,t.length-2),{value:r,literal:t}}function cie(){var e,t,n;for(t="",n="";N<an&&(e=J[N],!!Ap(e.charCodeAt(0)));)++N,e==="\\"&&N<an?Te({},kt,Ut):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Te({},vb,n),{value:n,literal:t}}function fie(){var e,t,n,i;return Ue=null,qR(),e=N,t=lie(),n=cie(),i=uie(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:N}}function die(e){return e.type===ca||e.type===ps||e.type===i0||e.type===r0}function HR(){if(qR(),N>=an)return{type:Bf,start:N,end:N};const e=J.charCodeAt(N);return Uf(e)?rie():e===40||e===41||e===59?s1():e===39||e===34?aie():e===46?Hr(J.charCodeAt(N+1))?Q_():s1():Hr(e)?Q_():s1()}function On(){const e=Ue;return N=e.end,Ue=HR(),N=e.end,e}function GR(){const e=N;Ue=HR(),N=e}function hie(e){const t=new Yi(Lne);return t.elements=e,t}function Z_(e,t,n){const i=new Yi(e==="||"||e==="&&"?Une:Pne);return i.operator=e,i.left=t,i.right=n,i}function pie(e,t){const n=new Yi(Ine);return n.callee=e,n.arguments=t,n}function gie(e,t,n){const i=new Yi(Bne);return i.test=e,i.consequent=t,i.alternate=n,i}function WE(e){const t=new Yi(UR);return t.name=e,t}function hc(e){const t=new Yi(zne);return t.value=e.value,t.raw=J.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function e$(e,t,n){const i=new Yi(jne);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function mie(e){const t=new Yi(qne);return t.properties=e,t}function t$(e,t,n){const i=new Yi(Wne);return i.key=t,i.value=n,i.kind=e,i}function yie(e,t){const n=new Yi(Hne);return n.operator=e,n.argument=t,n.prefix=!0,n}function Te(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(o0(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=N,n.description=r,n}function s0(e){e.type===Bf&&Te(e,Kne),e.type===Ta&&Te(e,Gne),e.type===zf&&Te(e,Yne),e.type===ca&&Te(e,Vne),e.type===ps&&Te(e,Xne),Te(e,kt,e.value)}function un(e){const t=On();(t.type!==Dn||t.value!==e)&&s0(t)}function Xe(e){return Ue.type===Dn&&Ue.value===e}function a1(e){return Ue.type===ps&&Ue.value===e}function bie(){const e=[];for(N=Ue.start,un("[");!Xe("]");)Xe(",")?(On(),e.push(null)):(e.push(fa()),Xe("]")||un(","));return On(),hie(e)}function n$(){N=Ue.start;const e=On();return e.type===zf||e.type===Ta?(e.octal&&Te(e,jR),hc(e)):WE(e.value)}function xie(){var e,t,n,i;if(N=Ue.start,e=Ue,e.type===ca)return n=n$(),un(":"),i=fa(),t$("init",n,i);if(e.type===Bf||e.type===Dn)s0(e);else return t=n$(),un(":"),i=fa(),t$("init",t,i)}function vie(){var e=[],t,n,i,r={},o=String;for(N=Ue.start,un("{");!Xe("}");)t=xie(),t.key.type===UR?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?Te({},Jne):r[i]=!0,e.push(t),Xe("}")||un(",");return un("}"),mie(e)}function Eie(){un("(");const e=HE();return un(")"),e}const Aie={if:1};function wie(){var e,t,n;if(Xe("("))return Eie();if(Xe("["))return bie();if(Xe("{"))return vie();if(e=Ue.type,N=Ue.start,e===ca||Aie[Ue.value])n=WE(On().value);else if(e===zf||e===Ta)Ue.octal&&Te(Ue,jR),n=hc(On());else{if(e===ps)throw new Error(Qc);e===i0?(t=On(),t.value=t.value==="true",n=hc(t)):e===r0?(t=On(),t.value=null,n=hc(t)):Xe("/")||Xe("/=")?(n=hc(fie()),GR()):s0(On())}return n}function Cie(){const e=[];if(un("("),!Xe(")"))for(;N<an&&(e.push(fa()),!Xe(")"));)un(",");return un(")"),e}function Sie(){N=Ue.start;const e=On();return die(e)||s0(e),WE(e.value)}function _ie(){return un("."),Sie()}function $ie(){un("[");const e=HE();return un("]"),e}function Fie(){var e,t,n;for(e=wie();;)if(Xe("."))n=_ie(),e=e$(".",e,n);else if(Xe("("))t=Cie(),e=pie(e,t);else if(Xe("["))n=$ie(),e=e$("[",e,n);else break;return e}function i$(){const e=Fie();if(Ue.type===Dn&&(Xe("++")||Xe("--")))throw new Error(Qc);return e}function uh(){var e,t;if(Ue.type!==Dn&&Ue.type!==ps)t=i$();else{if(Xe("++")||Xe("--"))throw new Error(Qc);if(Xe("+")||Xe("-")||Xe("~")||Xe("!"))e=On(),t=uh(),t=yie(e.value,t);else{if(a1("delete")||a1("void")||a1("typeof"))throw new Error(Qc);t=i$()}}return t}function r$(e){let t=0;if(e.type!==Dn&&e.type!==ps)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function kie(){var e,t,n,i,r,o,s,a,u,l;if(e=Ue,u=uh(),i=Ue,r=r$(i),r===0)return u;for(i.prec=r,On(),t=[e,Ue],s=uh(),o=[u,i,s];(r=r$(Ue))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=Z_(a,u,s),o.push(n);i=On(),i.prec=r,o.push(i),t.push(Ue),n=uh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=Z_(o[l-1].value,o[l-2],n),l-=2;return n}function fa(){var e,t,n;return e=kie(),Xe("?")&&(On(),t=fa(),un(":"),n=fa(),e=gie(e,t,n)),e}function HE(){const e=fa();if(Xe(","))throw new Error(Qc);return e}function Die(e){J=e,N=0,an=J.length,Ue=null,GR();const t=HE();if(Ue.type!==Bf)throw new Error("Unexpect token after expression.");return t}var Tie="6.3.1",Mie={version:Tie};function GE(e){return U(e,"or")}function YE(e){return U(e,"and")}function VE(e){return U(e,"not")}function lh(e,t){if(VE(e))lh(e.not,t);else if(YE(e))for(const n of e.and)lh(n,t);else if(GE(e))for(const n of e.or)lh(n,t);else t(e)}function pu(e,t){return VE(e)?{not:pu(e.not,t)}:YE(e)?{and:e.and.map(n=>pu(n,t))}:GE(e)?{or:e.or.map(n=>pu(n,t))}:t(e)}const fe=structuredClone;function YR(e){throw new Error(e)}function Pu(e,t){const n={};for(const i of t)pt(e,i)&&(n[i]=e[i]);return n}function Qn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Pe(e)).join(",")})`};function we(e){if(Ze(e))return e;const t=he(e)?e:Pe(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function Ab(e){return e===!1||e===null}function Ae(e,t){return e.includes(t)}function Iu(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function XE(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function VR(e,...t){for(const n of t)Oie(e,n??{});return e}function Oie(e,t){for(const n of z(t))n0(e,n,t[n],!0)}function lr(e,t){const n=[],i={};let r;for(const o of e)r=t(o),!(r in i)&&(i[r]=1,n.push(o));return n}function Rie(e,t){const n=z(e),i=z(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function XR(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function KE(e,t){for(const n of e)if(t.has(n))return!0;return!1}function wb(e){const t=new Set;for(const n of e){const r=Da(n).map((s,a)=>a===0?s:`[${s}]`),o=r.map((s,a)=>r.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function JE(e,t){return e===void 0||t===void 0?!0:KE(wb(e),wb(t))}function Ge(e){return z(e).length===0}const z=Object.keys,gt=Object.values,rs=Object.entries;function ef(e){return e===!0||e===!1}function Qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Fc(e,t){return VE(e)?`!(${Fc(e.not,t)})`:YE(e)?`(${e.and.map(n=>Fc(n,t)).join(") && (")})`:GE(e)?`(${e.or.map(n=>Fc(n,t)).join(") || (")})`:t(e)}function wp(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&wp(e[n],t)&&delete e[n],Ge(e)}function jf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function QE(e,t="datum"){const n=Da(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(Fe).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function KR(e,t="datum"){return`${t}[${Fe(Da(e).join("."))}]`}function Be(e){return`datum['${e.replaceAll("'","\\'")}']`}function JR(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function Nie(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function xi(e){return`${Da(e).map(Nie).join("\\.")}`}function da(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function gl(e){return`${Da(e).join(".")}`}function Bu(e){return e?Da(e).length:0}function ft(...e){return e.find(t=>t!==void 0)}let QR=42;function ZR(e){const t=++QR;return e?String(e)+t:t}function Lie(){QR=42}function eN(e){return tN(e)?e:`__${e}`}function tN(e){return e.startsWith("__")}function tf(e){if(e!==void 0)return(e%360+360)%360}function a0(e){return Ze(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const o$=Object.getPrototypeOf(structuredClone({}));function Vn(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Vn(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!Vn(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])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!==o$.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==o$.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!Vn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pe(e){const t=[];return(function n(i){if(i?.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?`${i}`:"null";if(typeof i!="object")return JSON.stringify(i);let r,o;if(Array.isArray(i)){for(o="[",r=0;r<i.length;r++)r&&(o+=","),o+=n(i[r])||"null";return`${o}]`}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const s=t.push(i)-1,a=Object.keys(i).sort();for(o="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(o&&(o+=","),o+=`${JSON.stringify(u)}:${l}`)}return t.splice(s,1),`{${o}}`})(e)}function U(e,t){return ke(e)&&pt(e,t)&&e[t]!==void 0}const no="row",io="column",u0="facet",et="x",Ot="y",Vi="x2",Tr="y2",gs="xOffset",ml="yOffset",Xi="radius",mo="radius2",Ai="theta",yo="theta2",Ki="latitude",Ji="longitude",Qi="latitude2",vi="longitude2",ms="time",In="color",Mr="fill",Or="stroke",Bn="shape",bo="size",Ma="angle",xo="opacity",ys="fillOpacity",bs="strokeOpacity",xs="strokeWidth",vs="strokeDash",qf="text",zu="order",Wf="detail",l0="key",ha="tooltip",c0="href",f0="url",d0="description",Pie={x:1,y:1,x2:1,y2:1},nN={theta:1,theta2:1,radius:1,radius2:1};function iN(e){return pt(nN,e)}const ZE={longitude:1,longitude2:1,latitude:1,latitude2:1};function rN(e){switch(e){case Ki:return"y";case Qi:return"y2";case Ji:return"x";case vi:return"x2"}}function oN(e){return pt(ZE,e)}const Iie=z(ZE),eA={...Pie,...nN,...ZE,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function gu(e){return e===In||e===Mr||e===Or}const sN={row:1,column:1,facet:1},fi=z(sN),tA={...eA,...sN},Bie=z(tA),{order:npe,detail:ipe,tooltip:rpe,...zie}=tA,{row:ope,column:spe,facet:ape,...Uie}=zie;function jie(e){return pt(Uie,e)}function aN(e){return pt(tA,e)}const qie=[Vi,Tr,Qi,vi,yo,mo];function uN(e){return Oa(e)!==e}function Oa(e){switch(e){case Vi:return et;case Tr:return Ot;case Qi:return Ki;case vi:return Ji;case yo:return Ai;case mo:return Xi}return e}function os(e){if(iN(e))switch(e){case Ai:return"startAngle";case yo:return"endAngle";case Xi:return"outerRadius";case mo:return"innerRadius"}return e}function Rr(e){switch(e){case et:return Vi;case Ot:return Tr;case Ki:return Qi;case Ji:return vi;case Ai:return yo;case Xi:return mo}}function zn(e){switch(e){case et:case Vi:return"width";case Ot:case Tr:return"height"}}function lN(e){switch(e){case et:return"xOffset";case Ot:return"yOffset";case Vi:return"x2Offset";case Tr:return"y2Offset";case Ai:return"thetaOffset";case Xi:return"radiusOffset";case yo:return"theta2Offset";case mo:return"radius2Offset"}}function nA(e){switch(e){case et:return"xOffset";case Ot:return"yOffset"}}function Wie(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Hie=z(eA),{x:upe,y:lpe,x2:cpe,y2:fpe,xOffset:dpe,yOffset:hpe,latitude:ppe,longitude:gpe,latitude2:mpe,longitude2:ype,theta:bpe,theta2:xpe,radius:vpe,radius2:Epe,...iA}=eA,Gie=z(iA),rA={x:1,y:1},vo=z(rA);function dt(e){return pt(rA,e)}const oA={theta:1,radius:1},Yie=z(oA);function h0(e){return e==="width"?et:Ot}const cN={xOffset:1,yOffset:1};function Hf(e){return pt(cN,e)}const Vie={time:1};function u1(e){return e in Vie}const{text:Ape,tooltip:wpe,href:Cpe,url:Spe,description:_pe,detail:$pe,key:Fpe,order:kpe,...fN}=iA,Xie=z(fN);function Kie(e){return pt(iA,e)}function Jie(e){switch(e){case In:case Mr:case Or:case bo:case Bn:case xo:case xs:case vs:return!0;case ys:case bs:case Ma:case ms:return!1}}const dN={...rA,...oA,...cN,...fN},sA=z(dN);function Nr(e){return pt(dN,e)}function Qie(e,t){return ere(e)[t]}const hN={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:Dpe,...Zie}=hN;function ere(e){switch(e){case In:case Mr:case Or:case d0:case Wf:case l0:case ha:case c0:case zu:case xo:case ys:case bs:case xs:case u0:case no:case io:return hN;case et:case Ot:case gs:case ml:case Ki:case Ji:case ms:return Zie;case Vi:case Tr:case Qi:case vi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case bo:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case vs:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Bn:return{point:"always",geoshape:"always"};case qf:return{text:"always"};case Ma:return{point:"always",square:"always",text:"always"};case f0:return{image:"always"};case Ai:return{text:"always",arc:"always"};case Xi:return{text:"always",arc:"always"};case yo:case mo:return{arc:"always"}}}function l1(e){switch(e){case et:case Ot:case Ai:case Xi:case gs:case ml:case bo:case Ma:case xs:case xo:case ys:case bs:case ms:case Vi:case Tr:case yo:case mo:return;case u0:case no:case io:case Bn:case vs:case qf:case ha:case c0:case f0:case d0:return"discrete";case In:case Mr:case Or:return"flexible";case Ki:case Ji:case Qi:case vi:case Wf:case l0:case zu:return}}const tre={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},nre={count:1,min:1,max:1};function co(e){return U(e,"argmin")}function Es(e){return U(e,"argmax")}function aA(e){return he(e)&&pt(tre,e)}const ire=new Set(["count","valid","missing","distinct"]);function p0(e){return he(e)&&ire.has(e)}function rre(e){return he(e)&&Ae(["min","max"],e)}const ore=new Set(["count","sum","distinct","valid","missing"]),sre=new Set(["mean","average","median","q1","q3","min","max"]);function pN(e){return If(e)&&(e=_0(e,void 0)),`bin${z(e).map(t=>g0(e[t])?Qe(`_${t}_${rs(e[t])}`):Qe(`_${t}_${e[t]}`)).join("")}`}function Ye(e){return e===!0||Ra(e)&&!e.binned}function Nt(e){return e==="binned"||Ra(e)&&e.binned===!0}function Ra(e){return ke(e)}function g0(e){return U(e,"param")}function s$(e){switch(e){case no:case io:case bo:case In:case Mr:case Or:case xs:case xo:case ys:case bs:case Bn:return 6;case vs:return 4;default:return 10}}function Gf(e){return U(e,"expr")}function Lt(e,{level:t}={level:0}){const n=z(e||{}),i={};for(const r of n)i[r]=t===0?Gn(e[r]):Lt(e[r],{level:t-1});return i}function gN(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:s,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},x=Pu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:y,subtitle:b}}function Mo(e){return he(e)||X(e)&&he(e[0])}function Q(e){return U(e,"signal")}function Na(e){return U(e,"step")}function are(e){return X(e)?!1:U(e,"fields")&&!U(e,"data")}function ure(e){return X(e)?!1:U(e,"fields")&&U(e,"data")}function Zr(e){return X(e)?!1:U(e,"field")&&U(e,"data")}const lre={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},cre=z(lre),fre={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Cb=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],dre=" – ";function mN(e){const t=X(e.condition)?e.condition.map(a$):a$(e.condition);return{...Gn(e),condition:t}}function Gn(e){if(Gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function a$(e){if(Gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ke(e){if(Gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Q(e)?e:e!==void 0?{value:e}:void 0}function hre(e){return Q(e)?e.signal:Fe(e)}function u$(e){return Q(e)?e.signal:Fe(e.value)}function Oi(e){return Q(e)?e.signal:e==null?null:Fe(e)}function pre(e,t,n){for(const i of n){const r=Ar(i,t.markDef,t.config);r!==void 0&&(e[i]=Ke(r))}return e}function yN(e){return[].concat(e.type,e.style??[])}function Le(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&U(t,r)?t[r]:t[e]!==void 0?t[e]:o&&(!r||r===e)?void 0:Ar(e,t,n,i)}function Ar(e,t,n,{vgChannel:i}={}){const r=Sb(e,t,n.style);return ft(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Sb(e,t,n){return bN(e,yN(t),n)}function bN(e,t,n){t=ct(t);let i;for(const r of t){const o=n[r];U(o,e)&&(i=o[e])}return i}function xN(e,t){return ct(e).reduce((n,i)=>(n.field.push(G(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function vN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Vn(r,i))return;n.push(i)}),n}function EN(e,t){return Vn(e,t)||!t?e:e?[...ct(e),...ct(t)].join(", "):t}function AN(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Mo(n)||Q(n))&&(Mo(i)||Q(i)))return{explicit:e.explicit,value:EN(n,i)};if(Mo(n)||Q(n))return{explicit:e.explicit,value:n};if(Mo(i)||Q(i))return{explicit:e.explicit,value:i};if(!Mo(n)&&!Q(n)&&!Mo(i)&&!Q(i))return{explicit:e.explicit,value:vN(n,i)};throw new Error("It should never reach here")}function uA(e){return`Invalid specification ${Pe(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const gre='Autosize "fit" only works for single views and layered views.';function l$(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function c$(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function f$(e){return e?`Dropping "fit-${e}" because spec has discrete ${zn(e)}.`:'Dropping "fit" because spec has discrete size.'}function lA(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 mre(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function yre(e){return`The "nearest" transform is not supported for ${e} marks.`}function wN(e){return`Selection not supported for ${e} yet.`}function bre(e){return`Cannot find a selection named "${e}".`}const xre="Scale bindings are currently only supported for scales with unbinned, continuous domains.",vre="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Ere="Legend bindings are only supported for selections over an individual field or encoding channel.";function Are(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function wre(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Cre="The same selection must be used to override scale domains in a layered view.",Sre='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function _re(e){return`Unknown repeated value "${e}".`}function h$(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const $re="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",cA="Animation involving facet, layer, or concat is currently unsupported.";function Fre(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ee(e)}.`}function kre(e,t,n,i){return`${e.length?"Multiple ":"No "}matching ${ee(t)} encoding found for selection ${ee(n.param)}. Using "field": ${ee(i)}.`}const Dre="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Tre(e){return`Unrecognized parse "${e}".`}function p$(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Mre="Attempt to add the same child twice.";function Ore(e){return`Ignoring an invalid transform: ${Pe(e)}.`}const Rre='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 g$(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Nre(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Pe(t)} is overridden by a child projection ${Pe(n)}.`}const Lre="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Pre(e){return`${e}Offset dropped because ${e} is continuous`}function Ire(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Pe(n)}}.`}function CN(e){return`Invalid field type "${e}".`}function Bre(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function zre(e){return`Invalid aggregation operator "${e}".`}function SN(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Ure(e){return`Position range does not support relative band size for ${e}.`}function _b(e,t){return`Dropping ${Pe(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const jre="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function m0(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function qre(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Wre(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Hre(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Gre(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function c1(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Yre(e){return`The ${e} for range marks cannot be an expression`}function Vre(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 Xre(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Kre(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Jre(e){return`Cannot use the relative band size with ${e} scale.`}function Qre(e){return`Using unaggregated domain with raw field has no effect (${Pe(e)}).`}function Zre(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function eoe(e){return`Unaggregated domain is currently unsupported for log scale (${Pe(e)}).`}function toe(e){return`Cannot apply size to non-oriented mark "${e}".`}function noe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function ioe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function _N(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function $N(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function roe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Pe(n)} and ${Pe(i)}). Using ${Pe(n)}.`}function ooe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Pe(n)} and ${Pe(i)}). Using the union of the two domains.`}function soe(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 aoe(e){return`Dropping sort property ${Pe(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const m$="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",uoe="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.",loe="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.",coe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function foe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function doe(e){return`Stack is applied to a non-linear scale (${e}).`}function hoe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Cp(e,t){return`Invalid ${e}: ${Pe(t)}.`}function poe(e){return`Dropping day from datetime ${Pe(e)} as day cannot be combined with other units.`}function goe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function moe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function yoe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function y$(e){return`1D error band does not support ${e}.`}function FN(e){return`Channel ${e} is required for "binned" bin.`}function boe(e){return`Channel ${e} should not be used with "binned" bin.`}function xoe(e){return`Domain for ${e} is required for threshold scale.`}const kN=pne(BR);let pa=kN;function voe(e){return pa=e,pa}function Eoe(){return pa=kN,pa}function fA(...e){pa.error(...e)}function j(...e){pa.warn(...e)}function Aoe(...e){pa.debug(...e)}function La(e){if(e&&ke(e)){for(const t of hA)if(U(e,t))return!0}return!1}const DN=["january","february","march","april","may","june","july","august","september","october","november","december"],woe=DN.map(e=>e.substr(0,3)),TN=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Coe=TN.map(e=>e.substr(0,3));function Soe(e){if(a0(e)&&(e=+e),Ze(e))return e>4&&j(Cp("quarter",e)),e-1;throw new Error(Cp("quarter",e))}function _oe(e){if(a0(e)&&(e=+e),Ze(e))return e-1;{const t=e.toLowerCase(),n=DN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=woe.indexOf(i);if(r!==-1)return r;throw new Error(Cp("month",e))}}function $oe(e){if(a0(e)&&(e=+e),Ze(e))return e%7;{const t=e.toLowerCase(),n=TN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Coe.indexOf(i);if(r!==-1)return r;throw new Error(Cp("day",e))}}function dA(e,t){const n=[];if(t&&e.day!==void 0&&z(e).length>1&&(j(poe(e)),e=fe(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?_oe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Soe(e.quarter):e.quarter;n.push(Ze(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?$oe(e.day):e.day;n.push(Ze(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ga(e){const n=dA(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Foe(e){const n=dA(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function koe(e){const t=dA(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const MN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},hA=z(MN);function Doe(e){return ue(MN,e)}function Pa(e){return ke(e)?e.binned:ON(e)}function ON(e){return e?.startsWith("binned")}function pA(e){return e.startsWith("utc")}function Toe(e){return e.substring(3)}const Moe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function y0(e){return hA.filter(t=>NN(e,t))}function RN(e){const t=y0(e);return t[t.length-1]}function NN(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Ooe(e,t,{end:n}={end:!1}){const i=QE(t),r=pA(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of hA)NN(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),Foe(a)}function LN(e){if(!e)return;const t=y0(e);return`timeUnitSpecifier(${Pe(t)}, ${Pe(Moe)})`}function Roe(e,t,n){if(!e)return;const i=LN(e);return`${n||pA(e)?"utc":"time"}Format(${t}, ${i})`}function Dt(e){if(!e)return;let t;return he(e)?ON(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ke(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),pA(t.unit)&&(t.utc=!0,t.unit=Toe(t.unit)),t}function Noe(e){const{utc:t,...n}=Dt(e);return n.unit?(t?"utc":"")+z(n).map(i=>Qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):`${t?"utc":""}timeunit${z(n).map(i=>Qe(`_${i}_${n[i]}`)).join("")}`}function PN(e,t=n=>n){const n=Dt(e),i=RN(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=IN(i,n.step),a={...r,[s]:+r[s]+o};return`${t(ga(a))} - ${t(ga(r))}`}}const Loe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Poe(e){return ue(Loe,e)}function IN(e,t=1){if(Poe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Ioe(e){return U(e,"param")}function gA(e){return!!e?.field&&e.equal!==void 0}function mA(e){return!!e?.field&&e.lt!==void 0}function yA(e){return!!e?.field&&e.lte!==void 0}function bA(e){return!!e?.field&&e.gt!==void 0}function xA(e){return!!e?.field&&e.gte!==void 0}function vA(e){if(e?.field){if(X(e.range)&&e.range.length===2)return!0;if(Q(e.range))return!0}return!1}function EA(e){return!!e?.field&&(X(e.oneOf)||X(e.in))}function Boe(e){return!!e?.field&&e.valid!==void 0}function BN(e){return EA(e)||gA(e)||vA(e)||mA(e)||bA(e)||yA(e)||xA(e)}function tr(e,t){return $0(e,{timeUnit:t,wrapTime:!0})}function zoe(e,t){return e.map(n=>tr(n,t))}function zN(e,t=!0){const{field:n}=e,i=Dt(e.timeUnit),{unit:r,binned:o}=i||{},s=G(e,{expr:"datum"}),a=r?`time(${o?s:Ooe(r,n)})`:s;if(gA(e))return`${a}===${tr(e.equal,r)}`;if(mA(e)){const u=e.lt;return`${a}<${tr(u,r)}`}else if(bA(e)){const u=e.gt;return`${a}>${tr(u,r)}`}else if(yA(e)){const u=e.lte;return`${a}<=${tr(u,r)}`}else if(xA(e)){const u=e.gte;return`${a}>=${tr(u,r)}`}else{if(EA(e))return`indexof([${zoe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Boe(e))return b0(a,e.valid);if(vA(e)){const{range:u}=Lt(e),l=Q(u)?{signal:`${u.signal}[0]`}:u[0],c=Q(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return`inrange(${a}, [${tr(l,r)}, ${tr(c,r)}])`;const f=[];return l!==null&&f.push(`${a} >= ${tr(l,r)}`),c!==null&&f.push(`${a} <= ${tr(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Pe(e)}`)}function b0(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Uoe(e){return BN(e)&&e.timeUnit?{...e,timeUnit:Dt(e.timeUnit)}:e}const Yf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function joe(e){return e==="quantitative"||e==="temporal"}function UN(e){return e==="ordinal"||e==="nominal"}const ma=Yf.quantitative,AA=Yf.ordinal,Uu=Yf.temporal,wA=Yf.nominal,yl=Yf.geojson;function qoe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case ma:return"quantitative";case"t":case Uu:return"temporal";case"o":case AA:return"ordinal";case"n":case wA:return"nominal";case yl:return"geojson"}}const Pt={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},$b={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Woe(e,t){const n=$b[e],i=$b[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Hoe={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 b$(e){return Hoe[e]}const jN=new Set(["linear","log","pow","sqrt","symlog"]),qN=new Set([...jN,"time","utc"]);function WN(e){return jN.has(e)}const HN=new Set(["quantile","quantize","threshold"]),Goe=new Set([...qN,...HN,"sequential","identity"]),Yoe=new Set(["ordinal","bin-ordinal","point","band"]);function Tt(e){return Yoe.has(e)}function zi(e){return Goe.has(e)}function cr(e){return qN.has(e)}function ju(e){return HN.has(e)}const Voe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Xoe(e){return!he(e)&&U(e,"name")}function GN(e){return U(e,"param")}function Koe(e){return U(e,"unionWith")}function Joe(e){return ke(e)&&"field"in e}const Qoe={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:Tpe,domain:Mpe,range:Ope,rangeMax:Rpe,rangeMin:Npe,scheme:Lpe,...Zoe}=Qoe,ese=z(Zoe);function Fb(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 cr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return cr(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return cr(e);case"nice":return cr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return zi(e)&&!Ae(["log","time","utc","threshold","quantile"],e)}}function YN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return gu(e)?void 0:Kre(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 tse(e,t){return Ae([AA,wA],t)?e===void 0||Tt(e):t===Uu?Ae([Pt.TIME,Pt.UTC,void 0],e):t===ma?WN(e)||ju(e)||e===void 0:!0}function nse(e,t,n=!1){if(!Nr(e))return!1;switch(e){case et:case Ot:case gs:case ml:case Ai:case Xi:return cr(t)||t==="band"?!0:t==="point"?!n:!1;case ms:return Ae(["linear","band"],t);case bo:case xs:case xo:case ys:case bs:case Ma:return cr(t)||ju(t)||Ae(["band","point","ordinal"],t);case In:case Mr:case Or:return t!=="band";case vs:case Bn:return t==="ordinal"||ju(t)}}function ise(e){return ke(e)&&"value"in e}const $n={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"},VN=$n.arc,x0=$n.area,v0=$n.bar,rse=$n.image,E0=$n.line,A0=$n.point,ose=$n.rect,Sp=$n.rule,XN=$n.text,CA=$n.tick,sse=$n.trail,SA=$n.circle,_A=$n.square,KN=$n.geoshape;function As(e){return["line","area","trail"].includes(e)}function nf(e){return["rect","bar","image","arc","tick"].includes(e)}const ase=new Set(z($n));function wr(e){return U(e,"type")}const use=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],lse=["fill","fillOpacity"],cse=[...use,...lse],fse={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},x$=z(fse),f1=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],dse={area:["line","point"],bar:f1,rect:f1,line:["point"],tick:["bandSize","thickness",...f1]},hse={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},pse={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},JN=z(pse);function ya(e){return U(e,"band")}const gse={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},mse=5,$A={binSpacing:0,continuousBandSize:mse,minBandSize:.25,timeUnitBandPosition:.5},yse={...$A,binSpacing:1},bse={...$A,thickness:1};function xse(e){return wr(e)?e.type:e}function QN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function FA({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){if(!i||!zi(i)||r)return"always-valid";const o=QN(Le("invalid",e,t),{isPath:As(e.type)});return t.scale?.invalid?.[n]!==void 0?"show":o}function vse(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function ZN({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,o=`peek(${i})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:o})`}}function e6({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){const s=n?.get("type"),a=ji(t),u=p0(a?.aggregate),l=FA({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const c=o.scale.invalid?.[e]??"zero-or-min";return{test:b0(G(a,{expr:"datum"}),!1),...Ese(c,n,i)}}}function Ese(e,t,n){if(ise(e)){const{value:i}=e;return Q(i)?{signal:i.signal}:{value:i}}return ZN({scale:t,scaleName:n,mode:"zeroOrMin"})}function kA(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=Oa(t),u=DA(e),l=e6({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function Ase(e){const{datum:t}=e;return La(t)?ga(t):`${Pe(t)}`}function Xs(e,t,n,i){const r={};if(t&&(r.scale=t),Lr(e)){const{datum:o}=e;La(o)?r.signal=ga(o):Q(o)?r.signal=o.signal:Gf(o)?r.signal=o.expr:r.value=o}else r.field=G(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function _p({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!Q(s)&&0<s&&s<1?"datum":void 0,u=G(t,{expr:a,suffix:r}),l=n!==void 0?G(n,{expr:a}):G(t,{suffix:o,expr:a}),c={};if(s===0||s===1){c.scale=e;const f=s===0?u:l;c.field=f}else{const f=Q(s)?`(1-${s.signal}) * ${u} + ${s.signal} * ${l}`:`${1-s} * ${u} + ${s} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function wse({scaleName:e,fieldDef:t}){const n=G(t,{expr:"datum"}),i=G(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function DA({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(de(t)){const f=s?.get("type");if(Sn(t)){c??=ss({fieldDef:t,fieldDef2:n,markDef:i,config:r});const{bin:d,timeUnit:h,type:p}=t;if(Ye(d)||c&&h&&p===Uu)return a?.impute?Xs(t,o,{binSuffix:"mid"},{offset:u}):c&&!Tt(f)?_p({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Xs(t,o,Qf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Nt(d)){if(q(n))return _p({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(FN(e===et?Vi:Tr))}}return Xs(t,o,Tt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Ui(t)){const f=t.value,d=u?{offset:u}:{};return{...kc(e,f),...d}}}return mne(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function kc(e,t){return Ae(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:Ae(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ke(t)}function ba(e){return e&&e!=="number"&&e!=="time"}function t6(e,t,n){return`${e}(${t}${n?`, ${Pe(n)}`:""})`}function TA({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){if(ba(n))return Ri({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=n6(e,i,r),a=qu(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return Ri({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Ri({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return Ri({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}function u(l){return q(l)?Dt(l.timeUnit)||{}:{unit:void 0,utc:void 0}}if(Hu(e)){const{unit:l,utc:c}=u(e),f=Sse({field:s,timeUnit:l,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:c||Ia(e)&&e.scale?.type===Pt.UTC});return f?{signal:f}:void 0}if(t=kb({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&Ye(e.bin)){const l=G(e,{expr:i,binSuffix:"end"});return{signal:Vf(s,l,t,n,o)}}else return t||qu(e)==="quantitative"?{signal:`${o6(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function n6(e,t,n){return q(e)?n?`${G(e,{expr:t,suffix:"end"})}-${G(e,{expr:t,suffix:"start"})}`:G(e,{expr:t}):Ase(e)}function Ri({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??=n6(e,i,r),s!=="datum.value"&&q(e)&&Ye(e.bin)){const a=G(e,{expr:i,binSuffix:"end"});return{signal:Vf(s,a,t,n,o)}}return{signal:t6(n,s,t)}}function i6(e,t,n,i,r,o){if(!(he(i)&&ba(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&qu(e)==="quantitative"&&(r.normalizedNumberFormatType&&Wu(e)&&e.stack==="normalize"||r.numberFormatType))){if(Wu(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return kb({type:"quantitative",config:r,normalizeStack:!0});if(Hu(e)){const s=q(e)?Dt(e.timeUnit)?.unit:void 0;return s===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Cse({specifiedFormat:n,timeUnit:s,config:r,omitTimeFormatConfig:o})}return kb({type:t,specifiedFormat:n,config:r})}}function r6(e,t,n){if(e&&(Q(e)||e==="number"||e==="time"))return e;if(Hu(t)&&n!=="time"&&n!=="utc")return q(t)&&Dt(t?.timeUnit)?.utc?"utc":"time"}function kb({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(he(t))return t;if(e===ma)return i?n.normalizedNumberFormat:n.numberFormat}function Cse({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:LN(t)}:i?void 0:n.timeFormat)}function o6(e,t){return`format(${e}, "${t||""}")`}function v$(e,t,n,i){return ba(n)?t6(n,e,t):o6(e,(he(t)?t:void 0)??i.numberFormat)}function Vf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Vf(e,t,r.numberFormat,r.numberFormatType,r);const o=v$(e,n,i,r),s=v$(t,n,i,r);return`${b0(e,!1)} ? "null" : ${o} + "${dre}" + ${s}`}function Sse({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, ${Pe(n)})`:(n=he(n)?n:r,`${o?"utc":"time"}Format(${e}, ${Pe(n)})`):Roe(t,e,o)}const w0="min",_se={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 E$(e){return pt(_se,e)}function $se(e){return U(e,"encoding")}function ro(e){return e&&(e.op==="count"||U(e,"field"))}function s6(e){return e&&X(e)}function Xf(e){return U(e,"row")||U(e,"column")}function MA(e){return U(e,"header")}function C0(e){return U(e,"facet")}function Fse(e){return U(e,"param")}function kse(e){return!he(e)&&U(e,"repeat")}function A$(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function OA(e){return U(e,"sort")}function ss({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(de(e)&&e.bandPosition!==void 0)return e.bandPosition;if(q(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return Ar("timeUnitBandPosition",n,i);if(Ye(o))return .5}}function a6({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){const a=zn(e),u=Le(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:l,bin:c}=t;if(l&&!n)return{band:Ar("timeUnitBandSize",i,r)};if(Ye(c)&&!Tt(o))return{band:1}}if(nf(i.type))return o?Tt(o)?r[i.type]?.discreteBandSize||{band:1}:r[i.type]?.continuousBandSize:r[i.type]?.discreteBandSize}function u6(e,t,n,i){return Ye(e.bin)||e.timeUnit&&Sn(e)&&e.type==="temporal"?ss({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function l6(e){return U(e,"sort")&&!U(e,"field")}function Kf(e){return U(e,"condition")}function S0(e){const t=e?.condition;return!!t&&!X(t)&&q(t)}function Jf(e){const t=e?.condition;return!!t&&!X(t)&&de(t)}function Dse(e){const t=e?.condition;return!!t&&(X(t)||Ui(t))}function q(e){return U(e,"field")||e?.aggregate==="count"}function qu(e){return e?.type}function Lr(e){return U(e,"datum")}function qo(e){return Sn(e)&&!Fp(e)||$p(e)}function w$(e){return Sn(e)&&e.type==="quantitative"&&!e.bin||$p(e)}function $p(e){return Lr(e)&&Ze(e.datum)}function de(e){return q(e)||Lr(e)}function Sn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function Ui(e){return U(e,"value")}function Ia(e){return U(e,"scale")||U(e,"sort")}function Wu(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function c6(e){return U(e,"legend")}function f6(e){return U(e,"format")||U(e,"formatType")}function Tse(e){return Qn(e,["legend","axis","header","scale"])}function Mse(e){return U(e,"op")}function G(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(Rse(e))n=eN("count");else{let s;if(!t.nofn)if(Mse(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;Ye(a)?(s=pN(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Es(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):co(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!Pa(l)&&(s=Noe(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}s&&(n=n?`${s}_${n}`:s)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?gl(n):t.expr?KR(n,t.expr)+o:xi(n)+o}function Fp(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return q(e)&&!!e.bin;case"temporal":return!1}throw new Error(CN(e.type))}function Ose(e){return Ia(e)&&ju(e.scale?.type)}function Rse(e){return e.aggregate==="count"}function Nse(e,t){const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(Ye(i))return`${n} (binned)`;if(r&&!Pa(r)){const s=Dt(r)?.unit;if(s)return`${n} (${y0(s).join("-")})`}else if(o)return Es(o)?`${n} for max ${o.argmax}`:co(o)?`${n} for min ${o.argmin}`:`${jf(o)} of ${n}`;return n}function Lse(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Es(t))return`${r} for argmax(${t.argmax})`;if(co(t))return`${r} for argmin(${t.argmin})`;const o=i&&!Pa(i)?Dt(i):void 0,s=t||o?.unit||o?.maxbins&&"timeunit"||Ye(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const d6=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return Lse(e);default:return Nse(e,t)}};let h6=d6;function p6(e){h6=e}function Pse(){p6(d6)}function mu(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=RA(e)?.title;if(!q(e))return r??e.title;const o=e,s=i?NA(o,t):void 0;return n?ft(r,o.title,s):r??o.title??s}function RA(e){if(Wu(e)&&e.axis)return e.axis;if(c6(e)&&e.legend)return e.legend;if(MA(e)&&e.header)return e.header}function NA(e,t){return h6(e,t)}function kp(e){if(f6(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=RA(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Ise(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(OA(e)&&X(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Es(n)&&!co(n))return"quantitative";if(Ia(e)&&e.scale?.type)switch($b[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ji(e){if(q(e))return e;if(S0(e))return e.condition}function vt(e){if(de(e))return e;if(Jf(e))return e.condition}function g6(e,t,n,i={}){if(he(e)||Ze(e)||If(e)){const r=he(e)?"string":Ze(e)?"number":"boolean";return j(Ire(t,r,e)),{value:e}}return de(e)?Dp(e,t,n,i):Jf(e)?{...e,condition:Dp(e.condition,t,n,i)}:e}function Dp(e,t,n,i){if(f6(e)){const{format:r,formatType:o,...s}=e;if(ba(o)&&!n.customFormatTypes)return j(g$(t)),Dp(s,t,n,i)}else{const r=Wu(e)?"axis":c6(e)?"legend":MA(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(ba(s)&&!n.customFormatTypes)return j(g$(t)),Dp({...e,[r]:a},t,n,i)}}return q(e)?LA(e,t,i):Bse(e)}function Bse(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ze(n)?"quantitative":he(n)?"nominal":La(n)?"temporal":void 0,{...e,type:t}}function LA(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!aA(i)&&!Es(i)&&!co(i)&&(j(zre(i)),delete a.aggregate),r&&(a.timeUnit=Dt(r)),s&&(a.field=`${s}`),Ye(o)&&(a.bin=_0(o,t)),Nt(o)&&!dt(t)&&j(boe(t)),Sn(a)){const{type:u}=a,l=qoe(u);u!==l&&(a.type=l),u!=="quantitative"&&p0(i)&&(j(Bre(u,i)),a.type="quantitative")}else if(!uN(t)){const u=Ise(a,t);a.type=u}if(Sn(a)){const{compatible:u,warning:l}=zse(a,t)||{};u===!1&&j(l)}if(OA(a)&&he(a.sort)){const{sort:u}=a;if(E$(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&E$(l))return{...a,sort:{encoding:l,order:"descending"}}}if(MA(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function _0(e,t){return If(e)?{maxbins:s$(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:s$(t)}:e}const Ja={compatible:!0};function zse(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case no:case io:case u0:return Fp(e)?Ja:{compatible:!1,warning:Wre(t)};case et:case Ot:case gs:case ml:case In:case Mr:case Or:case qf:case Wf:case l0:case ha:case c0:case f0:case Ma:case Ai:case Xi:case d0:return Ja;case Ji:case vi:case Ki:case Qi:return n!==ma?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Ja;case xo:case ys:case bs:case xs:case bo:case yo:case mo:case Vi:case Tr:case ms:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Ja;case Bn:case vs:return!Fp(e)&&!Ose(e)?{compatible:!1,warning:Hre(t)}:Ja;case zu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Ja}}function Hu(e){const{formatType:t}=kp(e);return t==="time"||!t&&Use(e)}function Use(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function $0(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const o=t&&Dt(t)?.unit;let s=o||n==="temporal",a;return Gf(e)?a=e.expr:Q(e)?a=e.signal:La(e)?(s=!0,a=ga(e)):(he(e)||Ze(e))&&s&&(a=`datetime(${Pe(e)})`,Doe(o)&&(Ze(e)&&e<1e4||he(e)&&isNaN(Date.parse(e)))&&(a=ga({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:Pe(e)}function m6(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!Pa(e.timeUnit)?e.timeUnit:void 0,o=$0(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function Qf(e,t){return Ye(e.bin)?Nr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const C$={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 Zf(e){return e?.condition}const y6=["domain","grid","labels","ticks","title"],jse={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"},b6={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},qse={...b6,style:1,labelExpr:1,encoding:1};function S$(e){return pt(qse,e)}const Wse={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},x6=z(Wse);function Eo(e){return U(e,"mark")}class F0{name;run;constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Eo(t)?xse(t.mark)===this.name:!1}}function Ks(e,t){const n=e?.[t];return n?X(n)?Iu(n,i=>!!i.field):q(n)||S0(n):!1}function v6(e,t){const n=e?.[t];return n?X(n)?Iu(n,i=>!!i.field):q(n)||Lr(n)||Jf(n):!1}function E6(e,t){if(dt(t)){const n=e[t];if((q(n)||Lr(n))&&(UN(n.type)||q(n)&&n.timeUnit)){const i=nA(t);return v6(e,i)}}return!1}function A6(e){return Iu(Bie,t=>{if(Ks(e,t)){const n=e[t];if(X(n))return Iu(n,i=>!!i.aggregate);{const i=ji(n);return i&&!!i.aggregate}}return!1})}function w6(e,t){const n=[],i=[],r=[],o=[],s={};return PA(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=RA(a)?.title;let m=G(a,{forAs:!0});const y={...g?[]:{title:mu(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Es(c)?(b="argmax",m=G({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):co(c)?(b="argmin",m=G({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const x={op:b,as:m};l&&(x.field=l),o.push(x)}}else if(n.push(m),Sn(a)&&Ye(f)){if(i.push({bin:f,field:l,as:m}),n.push(G(a,{binSuffix:"end"})),Qf(a,u)&&n.push(G(a,{binSuffix:"range"})),dt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",uN(u)||(y.type=ma)}else if(d&&!Pa(d)){r.push({timeUnit:d,field:l,as:m});const b=Sn(a)&&a.type!==Uu&&"time";b&&(u===qf||u===ha?y.formatType=b:Kie(u)?y.legend={formatType:b,...y.legend}:dt(u)&&(y.axis={formatType:b,...y.axis}))}s[u]=y}else n.push(l),s[u]=e[u]}else s[u]=e[u]}),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function Hse(e,t,n){const i=Qie(t,n);if(i){if(i==="binned"){const r=e[t===Vi?et:Ot];return!!(q(r)&&q(e[t])&&Nt(r.bin))}}else return!1;return!0}function Gse(e,t,n,i){const r={};for(const o of z(e))aN(o)||j(qre(o));for(let o of Hie){if(!e[o])continue;const s=e[o];if(Hf(o)){const a=Wie(o),u=r[a];if(q(u)&&joe(u.type)&&q(s)&&!u.timeUnit){j(Pre(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(Lre),o=Ai),!Hse(e,o,t)){j(m0(o,t));continue}if(o===bo&&t==="line"&&ji(e[o])?.aggregate){j(jre);continue}if(o===In&&(n?"fill"in e:"stroke"in e)){j(SN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Wf||o===zu&&!X(s)&&!Ui(s)||o===ha&&X(s)){if(s){if(o===zu){const a=e[o];if(l6(a)){r[o]=a;continue}}r[o]=ct(s).reduce((a,u)=>(q(u)?a.push(LA(u,o)):j(_b(u,o)),a),[])}}else{if(o===ha&&s===null)r[o]=null;else if(!q(s)&&!Lr(s)&&!Ui(s)&&!Kf(s)&&!Q(s)){j(_b(s,o));continue}r[o]=g6(s,o,i)}}return r}function k0(e,t){const n={};for(const i of z(e)){const r=g6(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Yse(e){const t=[];for(const n of z(e))if(Ks(e,n)){const i=e[n],r=ct(i);for(const o of r)q(o)?t.push(o):S0(o)&&t.push(o.condition)}return t}function PA(e,t,n){if(e)for(const i of z(e)){const r=e[i];if(X(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function Vse(e,t,n,i){return e?z(e).reduce((r,o)=>{const s=e[o];return X(s)?s.reduce((a,u)=>t.call(i,a,u,o),r):t.call(i,r,s,o)},n):n}function C6(e,t){return z(t).reduce((n,i)=>{switch(i){case et:case Ot:case c0:case d0:case f0:case Vi:case Tr:case gs:case ml:case Ai:case yo:case Xi:case mo:case ms:case Ki:case Ji:case Qi:case vi:case qf:case Bn:case Ma:case ha:return n;case zu:if(e==="line"||e==="trail")return n;case Wf:case l0:{const r=t[i];if(X(r)||q(r))for(const o of ct(r))o.aggregate||n.push(G(o,{}));return n}case bo:if(e==="trail")return n;case In:case Mr:case Or:case xo:case ys:case bs:case vs:case xs:{const r=ji(t[i]);return r&&!r.aggregate&&n.push(G(r,{})),n}}},[])}function Xse(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(X(t)){for(const o of t)o.aggregate?(i||(i=[]),i.push(o)):(r||(r=[]),r.push(o));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return X(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Db(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:s,titlePrefix:a})=>{const u=i?` of ${IA(t)}`:"";return{field:s+t.field,type:t.type,title:Q(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=Yse(n).map(Tse);return{tooltip:[...r,...lr(o,we)]}}function IA(e){const{title:t,field:n}=e;return ft(t,n)}function BA(e,t,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=IA(n);return S6(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...he(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function S6(e,t,n,i){const{clip:r,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...s?{opacity:s}:{},...wr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...If(e[t])?{}:e[t]}}]:[]}function _6(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",o=i[r],s=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Fd(o,n),continuousAxisChannelDef2:Fd(s,n),continuousAxisChannelDefError:Fd(a,n),continuousAxisChannelDefError2:Fd(u,n),continuousAxis:r}}function Fd(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(yoe(n,t)),i}else return e}function $6(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(wr(n)&&n.orient)return n.orient;if(qo(r)){if(qo(o)){const s=q(r)&&r.aggregate,a=q(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return Hu(o)&&!Hu(r)?"horizontal":"vertical"}return"horizontal"}else{if(qo(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Tp="boxplot",Kse=["box","median","outliers","rule","ticks"],Jse=new F0(Tp,k6);function F6(e){return Ze(e)?"tukey":e}function k6(e,{config:t}){e={...e,encoding:k0(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=wr(n)?n:{type:n};r&&j(wN("boxplot"));const u=a.extent??t.boxplot.extent,l=Le("size",a,t),c=a.invalid,f=F6(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:A,customTooltipWithoutAggregatedField:w}=Qse(e,u,t),E=gl(g.field),{color:C,size:S,...$}=x,k=Pr=>BA(a,m,g,Pr,t.boxplot),L=k($),T=k(x),F=(ke(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",_=k({...$,...S?{size:S}:{},color:{condition:{test:`${Be(`lower_box_${g.field}`)} >= ${Be(`upper_box_${g.field}`)}`,...C||{value:F}}}}),D=Db([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,x),P={type:"tick",color:"black",opacity:1,orient:v,invalid:c,aria:!1},B=f==="min-max"?D:Db([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,x),I=[...L({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...L({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...L({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:B}),...L({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:B})],Y=[...f!=="tukey"?I:[],...T({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:A,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:D}),..._({partName:"median",mark:{type:"tick",invalid:c,...ke(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:v,aria:!1},positionPrefix:"mid_box",extraEncoding:D})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:Y};const le=Be(`lower_box_${g.field}`),oe=Be(`upper_box_${g.field}`),pe=`(${oe} - ${le})`,We=`${le} - ${u} * ${pe}`,ge=`${oe} + ${u} * ${pe}`,Ht=Be(g.field),ws={joinaggregate:D6(g.field),groupby:y},wo={transform:[{filter:`(${We} <= ${Ht}) && (${Ht} <= ${ge})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${E}`},{op:"max",field:g.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${E}`},...b],groupby:y}],layer:I},{tooltip:V,...be}=$,{scale:ve,axis:W}=g,Rt=IA(g),Ie=S6(a,"outliers",t.boxplot,{transform:[{filter:`(${Ht} < ${We}) || (${Ht} > ${ge})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Rt!==void 0?{title:Rt}:{},...ve!==void 0?{scale:ve}:{},...W!==void 0?{axis:W}:{}},...be,...C?{color:C}:{},...w?{tooltip:w}:{}}})[0];let Ct;const Gt=[...d,...h,ws];return Ie?Ct={transform:Gt,layer:[Ie,wo]}:(Ct=wo,Ct.transform.unshift(...Gt)),{...s,layer:[Ct,{transform:p,layer:Y}]}}function D6(e){const t=gl(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Qse(e,t,n){const i=$6(e,Tp),{continuousAxisChannelDef:r,continuousAxis:o}=_6(e,i,Tp),s=r.field,a=gl(s),u=F6(t),l=[...D6(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${Be(`upper_box_${a}`)} - ${Be(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${Be(`upper_box_${a}`)} + ${Be(`iqr_${a}`)} * ${t}, ${Be(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${Be(`lower_box_${a}`)} - ${Be(`iqr_${a}`)} * ${t}, ${Be(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Xse(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:x}=w6(p,n),v=i==="vertical"?"horizontal":"vertical",A=i,w=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:w,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:A,customTooltipWithoutAggregatedField:h}}const zA="errorbar",Zse=["ticks","rule"],eae=new F0(zA,T6);function T6(e,{config:t}){e={...e,encoding:k0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=M6(e,zA,t);delete o.size;const c=BA(a,r,i,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function tae(e,t){const{encoding:n}=e;if(nae(n))return{orient:$6(e,t),inputType:"raw"};const i=iae(n),r=rae(n),o=n.x,s=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(de(a)&&de(u))throw new Error(`${t} cannot have both x2 and y2`);if(de(a)){if(qo(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(de(u)){if(qo(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")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(de(u)&&!de(a))throw new Error(`${t} cannot have xError2 without xError`);if(de(c)&&!de(l))throw new Error(`${t} cannot have yError2 without yError`);if(de(a)&&de(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(de(a)){if(qo(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(de(l)){if(qo(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")}}function nae(e){return(de(e.x)||de(e.y))&&!de(e.x2)&&!de(e.y2)&&!de(e.xError)&&!de(e.xError2)&&!de(e.yError)&&!de(e.yError2)}function iae(e){return de(e.x2)||de(e.y2)}function rae(e){return de(e.xError)||de(e.xError2)||de(e.yError)||de(e.yError2)}function M6(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=wr(i)?i:{type:i};o&&j(wN(t));const{orient:l,inputType:c}=tae(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=_6(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=oae(u,f,d,h,p,c,t,n),{[g]:v,[g==="x"?"x2":"y2"]:A,[g==="x"?"xError":"yError"]:w,[g==="x"?"xError2":"yError2"]:E,...C}=r,{bins:S,timeUnits:$,aggregate:k,groupby:L,encoding:T}=w6(C,n),F=[...k,...m],_=c!=="raw"?[]:L,D=Db(b,f,T,x);return{transform:[...a.transform??[],...S,...$,...F.length===0?[]:[{aggregate:F,groupby:_}],...y],groupby:_,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:T,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:D}}function oae(e,t,n,i,r,o,s,a){let u=[],l=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&j(moe(h,p,s)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${Be(`center_${c}`)} + ${Be(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${Be(`center_${c}`)} - ${Be(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:jf(h)},{fieldPrefix:"upper_",titlePrefix:_$(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:_$(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:mu({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:mu({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:mu({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(goe(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:Be(n.field),as:`upper_${c}`},{calculate:Be(c),as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${Be(c)} + ${Be(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${Be(c)} + ${Be(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${Be(c)} - ${Be(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:da(da(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function _$(e,t,n){return`${jf(e)} ${n} ${t}`}const UA="errorband",sae=["band","borders"],aae=new F0(UA,O6);function O6(e,{config:t}){e={...e,encoding:k0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=M6(e,UA,t),l=s,c=BA(l,r,i,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?j(y$("interpolate")):l.tension&&j(y$("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const R6={};function jA(e,t,n){const i=new F0(e,t);R6[e]={normalizer:i,parts:n}}function uae(){return z(R6)}jA(Tp,k6,Kse);jA(zA,T6,Zse);jA(UA,O6,sae);const lae=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],N6={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"},L6={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"},cae=z(N6),fae=z(L6),dae={header:1,headerRow:1,headerColumn:1,headerFacet:1},P6=z(dae),I6=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],hae={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},pae={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},qi="_vgsid_",gae={point:{on:"click",fields:[qi],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 qA(e){return e==="legend"||!!e?.legend}function d1(e){return qA(e)&&ke(e)}function WA(e){return!!e?.select}function B6(e){const t=[];for(const n of e||[]){if(WA(n))continue;const{expr:i,bind:r,...o}=n;if(r&&i){const s={...o,bind:r,init:i};t.push(s)}else{const s={...o,...i?{update:i}:{},...r?{bind:r}:{}};t.push(s)}}return t}function mae(e){return D0(e)||GA(e)||HA(e)}function HA(e){return U(e,"concat")}function D0(e){return U(e,"vconcat")}function GA(e){return U(e,"hconcat")}function z6({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Cr(e){return U(e,"step")}function $$(e){return U(e,"view")||U(e,"width")||U(e,"height")}const F$=20,yae={align:1,bounds:1,center:1,columns:1,spacing:1},bae=z(yae);function xae(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(C0(e)&&!Xf(e.facet)||HA(e))&&(r.columns=s),D0(e)&&(r.columns=1);for(const a of bae)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Ze(u)?u:{row:u.row??o,column:u.column??o}}else r[a]=e[a];return r}function Tb(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Mb(e,t){const n=Mp(e,t);return Cr(n)?n.step:U6}function Mp(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ft(n,{step:e.step})}const U6=20,vae={continuousWidth:300,continuousHeight:300,step:U6},Eae={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:vae,mark:hse,arc:{},area:{},bar:yse,circle:{},geoshape:{},image:{},line:{},point:{},rect:$A,rule:{color:"black"},square:{},text:{color:"black"},tick:bse,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:Voe,projection:{},legend:hae,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:gae,style:{},title:{},facet:{spacing:F$},concat:{spacing:F$},normalizedNumberFormat:".0%"},Ur=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],k$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},D$={blue:Ur[0],orange:Ur[1],red:Ur[2],teal:Ur[3],green:Ur[4],yellow:Ur[5],purple:Ur[6],pink:Ur[7],brown:Ur[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 Aae(e={}){return{signals:[{name:"color",value:ke(e)?{...D$,...e}:D$}],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 wae(e){return{signals:[{name:"fontSize",value:ke(e)?{...k$,...e}:k$}],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 Cae(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function j6(e){const t=z(e||{}),n={};for(const i of t){const r=e[i];n[i]=Zf(r)?mN(r):Gn(r)}return n}function Sae(e){const t=z(e),n={};for(const i of t)n[i]=j6(e[i]);return n}const _ae=[...JN,...x6,...P6,"background","padding","legend","lineBreak","scale","style","title","view"];function q6(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=zR({},fe(Eae),n?Cae(n):{},t?Aae(t):{},i?wae(i):{},o||{});r&&n0(s,"selection",r,!0);const a=Qn(s,_ae);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=Gn(s[u]));for(const u of JN)s[u]&&(a[u]=Lt(s[u]));for(const u of x6)s[u]&&(a[u]=j6(s[u]));for(const u of P6)s[u]&&(a[u]=Lt(s[u]));if(s.legend&&(a.legend=Lt(s.legend)),s.scale){const{invalid:u,...l}=s.scale,c=Lt(u,{level:1});a.scale={...Lt(l),...z(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=Sae(s.style)),s.title&&(a.title=Lt(s.title)),s.view&&(a.view=Lt(s.view)),a}const $ae=new Set(["view",...ase]),Fae=["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"],kae={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...dse};function Dae(e){e=fe(e);for(const t of Fae)delete e[t];if(e.axis)for(const t in e.axis)Zf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of lae)delete e.legend[t];if(e.mark){for(const t of x$)delete e.mark[t];e.mark.tooltip&&ke(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(B6(e.params)),delete e.params);for(const t of $ae){for(const i of x$)delete e[t][i];const n=kae[t];if(n)for(const i of n)delete e[t][i];Mae(e,t)}for(const t of uae())delete e[t];Tae(e);for(const t in e)ke(e[t])&&Ge(e[t])&&delete e[t];return Ge(e)?void 0:e}function Tae(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=gN(e.title);Ge(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ge(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ge(i)?delete e.title:e.title=i}function Mae(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};Ge(o)||(e.style[n??t]=o),delete e[t]}function T0(e){return U(e,"layer")}function Oae(e){return U(e,"repeat")}function Rae(e){return!X(e.repeat)&&U(e.repeat,"layer")}class YA{map(t,n){return C0(t)?this.mapFacet(t,n):Oae(t)?this.mapRepeat(t,n):GA(t)?this.mapHConcat(t,n):D0(t)?this.mapVConcat(t,n):HA(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(T0(t))return this.mapLayer(t,n);if(Eo(t))return this.mapUnit(t,n);throw new Error(uA(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const Nae={zero:1,center:1,normalize:1};function Lae(e){return pt(Nae,e)}const Pae=new Set([VN,v0,x0,Sp,A0,SA,_A,E0,XN,CA]),Iae=new Set([v0,x0,VN]);function Qa(e){return q(e)&&qu(e)==="quantitative"&&!e.bin}function T$(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(i),s=e[t],a=e[r];if(q(s)&&q(a))if(Qa(s)&&Qa(a)){if(s.stack)return t;if(a.stack)return r;const u=q(s)&&!!s.aggregate,l=q(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(o){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Qa(s))return t;if(Qa(a))return r}else{if(Qa(s))return o&&n==="vertical"?void 0:t;if(Qa(a))return o&&n==="horizontal"?void 0:r}}function Bae(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function W6(e,t){const n=wr(e)?e:{type:e},i=n.type;if(!Pae.has(i))return null;const r=T$(t,"x",n)||T$(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?G(o,{}):void 0,a=Bae(r),u=[],l=new Set;if(t[a]){const g=t[a],m=q(g)?G(g,{}):void 0;m&&m!==s&&(u.push(a),l.add(m))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?G(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=Gie.reduce((g,m)=>{if(m!=="tooltip"&&Ks(t,m)){const y=t[m];for(const b of ct(y)){const x=ji(b);if(x.aggregate)continue;const v=G(x,{});(!v||!l.has(v))&&g.push({channel:m,fieldDef:x})}}return g},[]);let p;return o.stack!==void 0?If(o.stack)?p=o.stack?"zero":null:p=o.stack:Iae.has(i)&&(p="zero"),!p||!Lae(p)||A6(t)&&h.length===0?null:(o?.scale?.type&&o?.scale?.type!==Pt.LINEAR&&o?.stack&&j(doe(o.scale.type)),de(t[Rr(r)])?(o.stack!==void 0&&j(foe(r)),null):(q(o)&&o.aggregate&&!ore.has(o.aggregate)&&j(hoe(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:As(i),stackBy:h,offset:p}))}function H6(e,t,n){const i=Lt(e),r=Le("orient",i,n);if(i.orient=qae(i.type,t,r),r!==void 0&&r!==i.orient&&j(Xre(i.orient,r)),i.type==="bar"&&i.orient){const u=Le("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:gse[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Le("opacity",i,n),s=Le("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=Uae(i.type,t)),Le("cursor",i,n)===void 0&&(i.cursor=zae(i,t,n)),i}function zae(e,t,n){return t.href||e.href||Le("href",e,n)?"pointer":e.cursor}const G6=.7;function Uae(e,t){if(Ae([A0,CA,SA,_A],e)&&!A6(t))return G6}function jae(e,t,{graticule:n}){if(n)return!1;const i=Ar("filled",e,t),r=e.type;return ft(i,r!==A0&&r!==E0&&r!==Sp)}function qae(e,t,n){switch(e){case A0:case SA:case _A:case ose:case rse:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case XN:case v0:if(q(i)&&(Nt(i.bin)||q(r)&&r.aggregate&&!i.aggregate))return"vertical";if(q(r)&&(Nt(r.bin)||q(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(q(i)&&i.type===ma&&!Ye(i.bin)||$p(i))&&q(r)&&Nt(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===ma&&!Ye(r.bin)||$p(r))&&q(i)&&Nt(i.bin)?"vertical":"horizontal"}case Sp:if(o&&!(q(i)&&Nt(i.bin))&&s&&!(q(r)&&Nt(r.bin)))return;case x0:if(s)return q(r)&&Nt(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Nt(i.bin)?"vertical":"horizontal";if(e===Sp){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case E0:case CA:{const a=w$(i),u=w$(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=Sn(i)&&i.type===Uu,c=Sn(r)&&r.type===Uu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function Wae(e){const{point:t,line:n,...i}=e;return z(i).length>1?i:i.type}function Hae(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Qn(e[t],["point","line"])});return e}function h1(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ke(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ke(t.point)?t.point:{}:void 0}function M$(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class Gae{name="path-overlay";hasMatchingType(t,n){if(Eo(t)){const{mark:i,encoding:r}=t,o=wr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!h1(o,n[o.type],r);case"area":return!!h1(o,n[o.type],r)||!!M$(o,n[o.type])}}return!1}run(t,n,i){const{config:r}=n,{params:o,projection:s,mark:a,name:u,encoding:l,...c}=t,f=k0(l,r),d=wr(a)?a:{type:a},h=h1(d,r[d.type],f),p=d.type==="area"&&M$(d,r[d.type]),g=[{name:u,...o?{params:o}:{},mark:Wae({...d.type==="area"&&Le("opacity",d,r)==null&&Le("fillOpacity",d,r)==null?{opacity:G6}:{},...d}),encoding:Qn(f,["shape"])}],m=W6(H6(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:x}=m;y={...f,[b]:{...f[b],...x?{stack:x}:{}}}}return y=Qn(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...Pu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...Pu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Hae(r)})}}function Yae(e,t){return t?Xf(e)?V6(e,t):Y6(e,t):e}function p1(e,t){return t?V6(e,t):e}function Ob(e,t,n){const i=t[e];if(kse(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(_re(i.repeat));return}return t}function Y6(e,t){if(e=Ob("field",e,t),e!==void 0){if(e===null)return null;if(OA(e)&&ro(e.sort)){const n=Ob("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function O$(e,t){if(q(e))return Y6(e,t);{const n=Ob("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function R$(e,t){if(de(e)){const n=O$(e,t);if(n)return n;if(Kf(e))return{condition:e.condition}}else{if(Jf(e)){const n=O$(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function V6(e,t){const n={};for(const i in e)if(U(e,i)){const r=e[i];if(X(r))n[i]=r.map(o=>R$(o,t)).filter(o=>o);else{const o=R$(r,t);o!==void 0&&(n[i]=o)}}return n}class Vae{name="RuleForRangedLine";hasMatchingType(t){if(Eo(t)){const{encoding:n,mark:i}=t;if(i==="line"||wr(i)&&i.type==="line")for(const r of qie){const o=Oa(r),s=n[o];if(n[r]&&(q(s)&&!Nt(s.bin)||Lr(s)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:o}=t;return j(Vre(!!r.x2,!!r.y2)),i({...t,mark:ke(o)?{...o,type:"rule"}:"rule"},n)}}class Xae extends YA{nonFacetUnitNormalizers=[Jse,eae,aae,new Gae,new Vae];map(t,n){if(Eo(t)){const i=Ks(t.encoding,no),r=Ks(t.encoding,io),o=Ks(t.encoding,u0);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=p1(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(s,n.config))return u.run(s,n,a);return s}mapRepeat(t,n){return Rae(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...o}=t,{row:s,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...o,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${Qe(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!X(i)&&t.columns&&(t=Qn(t,["columns"]),j(h$("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!X(i)&&i.row||[u?u.row:null],f=!X(i)&&i.column||[u?u.column:null],d=X(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=`${(r.name?`${r.name}_`:"")+l}child__${X(i)?`${Qe(p)}`:(i.row?`row_${Qe(g)}`:"")+(i.column?`column_${Qe(m)}`:"")}`,x=this.map(r,{...n,repeater:y,repeaterPrefix:b});x.name=b,a.push(Qn(x,["data"]))}const h=X(i)?t.columns:i.column?i.column.length:1;return{data:r.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Xf(i)&&t.columns&&(t=Qn(t,["columns"]),j(h$("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=L$({parentProjection:s,projection:r}),l=N$({parentEncoding:o,encoding:p1(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:o,...s}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=p1(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:o}=t;if(i||r){o&&j(Gre([...i?[no]:[],...r?[io]:[]]));const s={},a={};for(const u of[no,io]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;s[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??={},a[g][u]=l[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:Yae(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:o,projection:s,...a}=t,u={...r,parentEncoding:N$({parentEncoding:n,encoding:o,layer:!0}),parentProjection:L$({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function N$({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...z(e),...z(t)]);for(const o of r){const s=t[o],a=e[o];if(de(s)){const u={...a,...s};i[o]=u}else Jf(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Ui(a)||Q(a)||de(a)||X(a))&&(i[o]=a)}}else i=t;return!i||Ge(i)?void 0:i}function L$(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Nre({parentProjection:t,projection:n})),n??t}function VA(e){return U(e,"filter")}function Kae(e){return U(e,"stop")}function X6(e){return U(e,"lookup")}function Jae(e){return U(e,"data")}function Qae(e){return U(e,"param")}function Zae(e){return U(e,"pivot")}function eue(e){return U(e,"density")}function tue(e){return U(e,"quantile")}function nue(e){return U(e,"regression")}function iue(e){return U(e,"loess")}function rue(e){return U(e,"sample")}function oue(e){return U(e,"window")}function sue(e){return U(e,"joinaggregate")}function aue(e){return U(e,"flatten")}function uue(e){return U(e,"calculate")}function K6(e){return U(e,"bin")}function lue(e){return U(e,"impute")}function cue(e){return U(e,"timeUnit")}function fue(e){return U(e,"aggregate")}function due(e){return U(e,"stack")}function hue(e){return U(e,"fold")}function pue(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function gue(e){return e.map(t=>VA(t)?{filter:pu(t.filter,Uoe)}:t)}class mue extends YA{map(t,n){return n.emptySelections??={},n.selectionPredicates??={},t=P$(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=P$(t,n),t.encoding){const i={};for(const[r,o]of rs(t.encoding))i[r]=J6(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:rs(i).map(([o,s])=>{const{init:a,bind:u,empty:l,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=l!=="none";for(const f of gt(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function P$(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(VA(o))return{filter:Rb(o,t)};if(K6(o)&&Ra(o.bin))return{...o,bin:Q6(o.bin)};if(X6(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function J6(e,t){const n=fe(e);if(q(n)&&Ra(n.bin)&&(n.bin=Q6(n.bin)),Ia(n)&&n.scale?.domain?.selection){const{selection:i,...r}=n.scale.domain;n.scale.domain={...r,...i?{param:i}:{}}}if(Kf(n))if(X(n.condition))n.condition=n.condition.map(i=>{const{selection:r,param:o,test:s,...a}=i;return o?i:{...a,test:Rb(i,t)}});else{const{selection:i,param:r,test:o,...s}=J6(n.condition,t);n.condition=r?n.condition:{...s,test:Rb(n.condition,t)}}return n}function Q6(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Rb(e,t){const n=i=>pu(i,r=>{const o=t.emptySelections[r]??!0,s={param:r,empty:o};return t.selectionPredicates[r]??=[],t.selectionPredicates[r].push(s),s});return e.selection?n(e.selection):pu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Nb extends YA{map(t,n){const i=n.selections??[];if(t.params&&!Eo(t)){const r=[];for(const o of t.params)WA(o)?i.push(o):r.push(o);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),o=[];for(const s of i)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(he(a)&&(a===t.name||r.includes(a))||X(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Nb.prototype[e];Nb.prototype[e]=function(n,i){return t.call(this,n,yue(n,i))}}function yue(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Z6(e,t){t===void 0&&(t=q6(e.config));const n=Eue(e,t),{width:i,height:r}=e,o=Aue(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const bue=new Xae,xue=new mue,vue=new Nb;function Eue(e,t={}){const n={config:t};return vue.map(bue.map(xue.map(e,n),n),n)}function I$(e){return he(e)?{type:e}:e??{}}function Aue(e,t,n){let{width:i,height:r}=t;const o=Eo(e)||T0(e),s={};o?i=="container"&&r=="container"?(s.type="fit",s.contains="padding"):i=="container"?(s.type="fit-x",s.contains="padding"):r=="container"&&(s.type="fit-y",s.contains="padding"):(i=="container"&&(j(l$("width")),i=void 0),r=="container"&&(j(l$("height")),r=void 0));const a={type:"pad",...s,...n?I$(n.autosize):{},...I$(e.autosize)};if(a.type==="fit"&&!o&&(j(gre),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(c$("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(c$("height")),!Vn(a,{type:"pad"}))return a}function wue(e){return["fit","fit-x","fit-y"].includes(e)}function Cue(e){return e?`fit-${h0(e)}`:"fit"}const Sue=["background","padding"];function B$(e,t){const n={};for(const i of Sue)e&&e[i]!==void 0&&(n[i]=Gn(e[i]));return t&&(n.params=e.params),n}class Ao{explicit;implicit;constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Ao(fe(this.explicit),fe(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return ft(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of z(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function rr(e){return{explicit:!0,value:e}}function qn(e){return{explicit:!1,value:e}}function e4(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:M0(t,n,i,r)}}function M0(e,t,n,i){return e.explicit&&t.explicit&&j(roe(n,i,e.value,t.value)),e}function as(e,t,n,i,r=M0){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Vn(e.value,t.value)?e:r(e,t,n,i)}class _ue extends Ao{explicit;implicit;parseNothing;constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Gu(e){return U(e,"url")}function rf(e){return U(e,"values")}function t4(e){return U(e,"name")&&!Gu(e)&&!rf(e)&&!Xo(e)}function Xo(e){return e&&(n4(e)||i4(e)||XA(e))}function n4(e){return U(e,"sequence")}function i4(e){return U(e,"sphere")}function XA(e){return U(e,"graticule")}var rt;(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"})(rt||(rt={}));function r4({invalid:e,isPath:t}){switch(QN(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 $ue(e){const{marks:t,scales:n}=r4(e);return t===n?rt.Main:n==="include-invalid-values"?rt.PreFilterInvalid:rt.PostFilterInvalid}class je{debugName;_children=[];_parent=null;_hash;constructor(t,n){this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){j(Mre);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class Rn extends je{type;refCounts;_source;_name;clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${ZR()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function g1(e){return e.as!==void 0}function z$(e){return`${e}_end`}class hr extends je{timeUnits;clone(){return new hr(null,fe(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{const{field:a,timeUnit:u}=o;if(u){let l;if(Pa(u)){if(it(n)){const{mark:c,markDef:f,config:d}=n,h=ss({fieldDef:o,markDef:f,config:d});(nf(c)||h)&&(l={timeUnit:Dt(u),field:a})}}else l={as:G(o,{forAs:!0}),field:a,timeUnit:u};if(it(n)){const{mark:c,markDef:f,config:d}=n,h=ss({fieldDef:o,markDef:f,config:d});nf(c)&&dt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[we(l)]=l)}return r},{});return Ge(i)?null:new hr(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=Dt(i),s={...r,timeUnit:o};return new hr(t,{[we(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of rs(this.timeUnits)){const o=g1(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(gt(this.timeUnits).map(t=>g1(t)?t.as:z$(t.field)))}dependentFields(){return new Set(gt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${we(this.timeUnits)}`}assemble(){const t=[];for(const n of gt(this.timeUnits)){const{rectBandPosition:i}=n,r=Dt(n.timeUnit);if(g1(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:xi(o),type:"timeunit",...a?{units:y0(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...U$(c,i,r))}else if(n){const{field:o}=n,s=JR(o),a=o4({timeUnit:r,field:s}),u=z$(s);t.push({type:"formula",expr:a,as:u}),t.push(...U$([s,u],i,r))}}return t}}const O0="offsetted_rect_start",R0="offsetted_rect_end";function o4({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=RN(i),{part:s,step:a}=IN(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', ${Be(t)}, ${n?-a:a})`}function U$([e,t],n,i){if(n!==void 0&&n!==.5){const r=Be(e),o=Be(t);return[{type:"formula",expr:j$([o4({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${O0}`},{type:"formula",expr:j$([r,o],n+.5),as:`${e}_${R0}`}]}return[]}function j$([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ed="_tuple_fields";class Fue{hasChannel;hasField;hasSelectionId;timeUnit;items;constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const kue={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??=new Fue,o={},s={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=Qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Qe(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?ct(n.value):null;let{fields:d,encodings:h}=ke(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ke(p))for(const g of z(p))jie(g)?(h||(h=[])).push(g):l==="interval"?(j(Sre),h=c.encodings):(d??=[]).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){j(mre(p,g.aggregate));continue}else if(!m){j(d$(p));continue}if(g.timeUnit&&!Pa(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};s[we(y)]=y}if(!o[m]){const y=l==="interval"&&Nr(p)&&zi(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(o[m]=b),r.hasField[m]=o[m],r.hasSelectionId=r.hasSelectionId||m===qi,oN(p)?(b.geoChannel=p,b.channel=rN(p),r.hasChannel[b.channel]=o[m]):r.hasChannel[p]=o[m]}}else j(d$(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===qi}f&&(t.init=f.map(p=>r.items.map(g=>ke(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Ge(s)||(r.timeUnit=new hr(null,s))},signals:(e,t,n)=>{const i=t.name+ed;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(l4)})}},s4="_curr",ch="anim_value",nu="anim_clock",Lb="eased_anim_clock",a4="min_extent",u4="max_range_extent",m1="last_tick_at",y1="is_playing",Due=1/60*1e3,Tue=(e,t)=>[{name:Lb,update:nu},{name:`${e}_domain`,init:`domain('${t}')`},{name:a4,init:`extent(${e}_domain)[0]`},{name:u4,init:`extent(range('${t}'))[1]`},{name:ch,update:`invert('${t}', ${Lb})`}],Mue={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(pr(t)&&(n=n.concat([{name:nu,init:"0",on:[{events:{type:"timer",throttle:Due},update:`${y1} ? (${nu} + (now() - ${m1}) > ${u4} ? 0 : ${nu} + (now() - ${m1})) : ${nu}`}]},{name:m1,init:"now()",on:[{events:[{signal:nu},{signal:y1}],update:"now()"}]},{name:y1,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+ed,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=gt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+yu):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Js(e)}, `;if(t.project.hasSelectionId)l+=`${qi}: ${s}[${Fe(qi)}]`;else if(pr(t))l+=`fields: ${r}, values: [${ch} ? ${ch} : ${a4}]`;else{const c=o.items.map(f=>e.fieldDef(f.channel)?.bin?`[${s}[${Fe(e.vgField(f.channel,{}))}], ${s}[${Fe(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${s}[${Fe(f.field)}]`).join(", ");l+=`fields: ${r}, values: [${c}]`}if(pr(t))return n.concat(Tue(t.name,e.scaleName(ms)),[{name:i+ho,on:[{events:[{signal:Lb},{signal:ch}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+ho,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function l4(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=xi(r.field),r}function xa(e,t=!0,n=une){if(X(e)){const i=e.map(r=>xa(r,t,n));return t?`[${i.join(", ")}]`:i}else if(La(e))return n(t?ga(e):koe(e));return t?n(Pe(e)):e}function Oue(e,t){for(const n of gt(e.component.selection??{})){const i=n.name;let r=`${i}${ho}, ${n.resolve==="global"?"true":`{unit: ${Js(e)}}`}`;for(const o of L0)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+sle,on:[{events:{signal:n.name+ho},update:`modify(${Fe(n.name+va)}, ${r})`}]})}return KA(t)}function Rue(e,t){if(e.component.selection&&z(e.component.selection).length){const n=Fe(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:hs("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return KA(t)}function Nue(e,t){let n=!1;for(const i of gt(e.component.selection??{})){const r=i.name,o=Fe(r+va);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${_4}(${o}, ${Fe(a)}${u}`})}n=!0;for(const a of L0)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),KA(t)}function Lue(e,t){const n=[],i=[],r=Js(e,{escape:!1});for(const o of gt(e.component.selection??{})){const s={name:o.name+va};if(o.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:qi}}]),o.init){const u=o.project.items.map(l4);s.values=o.project.hasSelectionId?o.init.map(l=>({unit:r,[qi]:xa(l,!1)[0]})):o.init.map(l=>({unit:r,fields:u,values:xa(l,!1)}))}if([...n,...t].filter(u=>u.name===o.name+va).length||n.push(s),pr(o)&&t.length){const u=e.lookupDataSource(e.getDataName(rt.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+s4,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function c4(e,t){for(const n of gt(e.component.selection??{}))for(const i of L0)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Pue(e,t){for(const n of e.children)it(n)&&(t=c4(n,t));return t}function Iue(e,t,n,i){const r=T4(e,t.param,t);return{signal:zi(n.get("type"))&&X(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function KA(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const oo={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!Nr(r))continue;const o=e.getScaleComponent(r),s=o?o.get("type"):void 0;if(s=="sequential"&&j(vre),!o||!zi(s)){j(xre);continue}o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||Ib(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(_4))r.update=`{${i.map(s=>`${Fe(xi(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${Fe(xi(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}r.update=o}return n.concat(i.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Ib(e))for(const i of t.scales){const r=n.find(o=>o.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function Pb(e,t){return`domain(${Fe(e.scaleName(t))})`}function Ib(e){return e.parent&&Al(e.parent)&&(!e.parent.parent||Ib(e.parent.parent))}const yu="_brush",f4="_scale_trigger",ql="geo_interval_init_tick",d4="_init",Bue="_center",zue={defined:e=>e.type==="interval",parse:(e,t,n)=>{if(e.hasProjection){const i={...ce(n.select)?n.select:{}};i.fields=[qi],i.encodings||(i.encodings=n.value?z(n.value):[Ji,Ki]),n.select={type:"interval",...i}}if(t.translate&&!oo.defined(t)){const i=`!event.item || event.item.mark.name !== ${Fe(t.name+yu)}`;for(const r of t.events){if(!r.between){j(`${r} is not an ordered event stream for interval selections.`);continue}const o=ct(r.between[0].filter??=[]);o.includes(i)||o.push(i)}}},signals:(e,t,n)=>{const i=t.name,r=i+ho,o=gt(t.project.hasChannel).filter(a=>a.channel===et||a.channel===Ot),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(Uue(e,t,u,s?.[u.index])),[])),e.hasProjection){const a=Fe(e.projectionName()),u=e.projectionName()+Bue,{x:l,y:c}=t.project.hasChannel,f=l?.signals.visual,d=c?.signals.visual,h=l?s?.[l.index]:`${u}[0]`,p=c?s?.[c.index]:`${u}[1]`,g=A=>e.getSizeSignalRef(A).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;s&&(n.unshift({name:i+d4,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(w=>w.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${Fe(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Js(e)}}`,x=`vlSelectionTuples(${y}, ${b})`,v=o.map(A=>A.signals.visual);return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...s?[{signal:ql}]:[]],update:x}]})}else{if(!oo.defined(t)){const l=i+f4,c=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Fe(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=zi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:`${c.join(" && ")} ? ${l} : {}`}]})}const a=o.map(l=>l.signals.data),u=`unit: ${Js(e)}, fields: ${i+ed}, values`;return n.concat({name:r,...s?{init:`{${u}: ${xa(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(it(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===ql).length||n.unshift({name:ql,value:null,on:[{events:"timer{1}",update:`${ql} === null ? {} : ${ql}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r?.signals.visual,a=o?.signals.visual,u=`data(${Fe(t.name+va)})`;if(oo.defined(t)||!r&&!o)return n;const l={x:r!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of z(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Js(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=z(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+yu}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+yu,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function Uue(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=Fe(r?e.scaleName(o):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(o===et?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=oo.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,m=i?{init:xa(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+f4},update:zi(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:xa(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===et?0:1,h=t.name+d4,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}function bl({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=Kf(t)&&t.condition;let s=[];o&&(s=ct(o).map(l=>{const c=r(l);if(Fse(l)){const{param:f,empty:d}=l;return{test:D4(e,{param:f,empty:d}),...c}}else return{test:Np(e,l.test),...c}})),i!==void 0&&s.push(i);const a=r(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function JA(e,t="text"){const n=e.encoding[t];return bl({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>N0(i,e.config),invalidValueRef:void 0})}function N0(e,t,n="datum"){if(e){if(Ui(e))return Ke(e.value);if(de(e)){const{format:i,formatType:r}=kp(e);return TA({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function h4(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(X(s))return{tooltip:q$({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return bl({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=N0(l,r,a);if(c)return c;if(l===null)return;let f=Le("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),he(f))return{value:f};if(ke(f))return Q(f)?f:f.content==="encoding"?q$(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function p4(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o=new Set,s=i?"datum.datum":"datum",a=[];function u(c,f){const d=Oa(f),h=Sn(c)?c:{...c,type:e[d].type},p=h.title||NA(h,r),g=ct(p).join(", ").replaceAll(/"/g,'\\"');let m;if(dt(f)){const y=f==="x"?"x2":"y2",b=ji(e[y]);if(Nt(h.bin)&&b){const x=G(h,{expr:s}),v=G(b,{expr:s}),{format:A,formatType:w}=kp(h);m=Vf(x,v,A,w,r),o.add(y)}}if((dt(f)||f===Ai||f===Xi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=kp(h);m=TA({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??=N0(h,r,s).signal,a.push({channel:f,key:g,value:m})}PA(e,(c,f)=>{q(c)?u(c,f):S0(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!o.has(c)&&!l[f]&&(l[f]=d);return l}function q$(e,t,n,{reactiveGeom:i}={}){const r=p4(e,t,n,{reactiveGeom:i}),o=rs(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function jue(e){const{markDef:t,config:n}=e,i=Le("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...que(e),...Wue(e)}}function que(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Le("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:pt(fre,t)?{}:{ariaRoleDescription:{value:t}}}function Wue(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return bl({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>N0(u,e.config),invalidValueRef:void 0});const s=Le("description",n,i);if(s!=null)return{description:Ke(s)};if(i.aria===!1)return{};const a=p4(t,r,i);if(!Ge(a))return{description:{signal:rs(a).filter(([u])=>!u.startsWith("_")).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function It(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??=Le(e,i,o,{vgChannel:s,ignoreVgConfig:!Kf(l)}),u!==void 0&&(a=Ke(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=e6({...c,scaleChannel:e,channelDef:l});return bl({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>DA({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function g4(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Le("filled",n,r),a=Ae(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Le(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Le(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ke(u)}:{},...l?{stroke:Ke(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(SN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...It("color",e,{vgChannel:c,defaultValue:s?u:l}),...It("fill",e,{defaultValue:i.fill?u:void 0}),...It("stroke",e,{defaultValue:i.stroke?l:void 0})}}function Hue(e){const{encoding:t,mark:n}=e,i=t.order;return!As(n)&&Ui(i)?bl({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ke(r.value),invalidValueRef:void 0}):{}}function Yu({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:DA({channel:o,channelDef:a,markDef:t,config:i?.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ke(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function xn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=t,u=r[e],l=r[Rr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Yu({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),p=QA({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&dt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Gue({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function Gue(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(de(n)&&r&&t===r.fieldChannel){if(q(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return _p({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Xs(n,i,{suffix:"end"},{offset:o})}return kA(e)}function QA({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=Oa(n),u=os(n),l=Le(n,o,s,{vgChannel:u});if(l!==void 0)return kc(n,l);switch(t){case"zeroOrMin":return W$({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return W$({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[zn(n)],mult:.5}}}}function W$({mainChannel:e,config:t,...n}){const i=ZN(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=r.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Yue={left:"x",center:"xc",right:"x2"},Vue={top:"y",middle:"yc",bottom:"y2"};function m4(e,t,n,i="middle"){if(e==="radius"||e==="theta")return os(e);const r=e==="x"?"align":"baseline",o=Le(r,t,n);let s;return Q(o)?(j(Yre(r)),s=void 0):s=o,e==="x"?Yue[s||(i==="top"?"left":"center")]:Vue[s||i]}function Op(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?y4(e,t,{defaultPos:n,defaultPos2:i}):xn(e,t,{defaultPos:n})}function y4(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=Rr(e),a=zn(e),u=Xue(t,i,s),l=u[a]?m4(e,r,o):os(e);return{...xn(e,t,{defaultPos:n,vgChannel:l}),...u}}function Xue(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=Oa(n),l=zn(n),c=os(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in o?Yu({channel:n,markDef:o,encoding:i,model:e}):Yu({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=zn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Kue({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:kd(n,o)||kd(n,{[n]:Sb(n,o,a.style),[l]:Sb(l,o,a.style)})||kd(n,a[r])||kd(n,a.mark)||{[c]:QA({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Kue({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return de(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Xs(t,o,{suffix:"start"},{offset:u}):kA({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function kd(e,t){const n=zn(e),i=os(e);if(t[i]!==void 0)return{[i]:kc(e,t[i])};if(t[e]!==void 0)return{[i]:kc(e,t[e])};if(t[n]){const r=t[n];if(ya(r))j(Ure(n));else return{[n]:kc(e,r)}}}function fo(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=Rr(t),a=zn(t),u=i[t],l=i[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??Le("size",r,n,{vgChannel:a}),p=lN(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(Ye(u.bin)||Nt(u.bin)||u.timeUnit&&!l)&&!(h&&!ya(h))&&!i[p]&&!Tt(f)?Zue({fieldDef:u,fieldDef2:l,channel:t,model:e}):(de(u)&&Tt(f)||g)&&!l?Que(u,t,e):y4(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Jue(e,t,n,i,r,o,s){if(ya(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=Ar("minBandSize",{type:s},i);return{signal:c?`max(${Oi(c)}, ${l})`:l}}else r.band!==1&&(j(Jre(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(Q(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(Na(u)&&Ze(u.step))return{value:u.step-2}}if(!o){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=ft(u,s==="tick"?f:s==="bar"?l:c);if(Q(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Ze(d))return{signal:`${1-d} * ${e}`}}return{value:Mb(i.view,e)-2}}function Que(e,t,n){const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=zn(t),f=Rr(t),d=lN(t),h=n.scaleName(d),p=n.getScaleComponent(nA(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=It("size",n,{vgChannel:c,defaultRef:Ke(i.size)}):j(toe(i.type)));const y=!!m,b=a6({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(l||p)?.get("type"),useVlSizeChannel:g});m=m||{[c]:Jue(c,h||u,p||l,o,b,!!e,i.type)};const x=(l||p)?.get("type")==="band"&&ya(b)&&!y?"top":"middle",v=m4(t,i,o,x),A=v==="xc"||v==="yc",{offset:w,offsetType:E}=Yu({channel:t,markDef:i,encoding:r,model:n,bandPosition:A?.5:0}),C=kA({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:w,defaultRef:QA({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:A?E==="encoding"?0:.5:Q(b)?{signal:`(1-${b})/2`}:ya(b)?(1-b.band)/2:0});if(c)return{[v]:C,...m};{const S=os(f),$=m[c],k=w?{...$,offset:w}:$;return{[v]:C,[S]:X(C)?[C[0],{...C[1],offset:k}]:{...C,offset:k}}}}function H$(e,t,n,i,r,o,s){if(iN(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(Q(n)||Q(r)||Q(i)||o){const l=Oi(n),c=Oi(r),f=Oi(i),d=Oi(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function Zue({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:o,encoding:s}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=a6({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),h=i.component.axes[n]?.[0]?.get("translate")??.5,p=dt(n)?Le("binSpacing",o,r)??0:0,g=Rr(n),m=os(n),y=os(g),b=Ar("minBandSize",o,r),{offset:x}=Yu({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:v}=Yu({channel:g,markDef:o,encoding:s,model:i,bandPosition:0}),A=wse({fieldDef:e,scaleName:u}),w=H$(n,p,c,h,x,b,A),E=H$(g,p,c,h,v??x,b,A),C=Q(f)?{signal:`(1-${f.signal})/2`}:ya(f)?(1-f.band)/2:.5,S=ss({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(Ye(e.bin)||e.timeUnit){const $=e.timeUnit&&S!==.5;return{[y]:G$({fieldDef:e,scaleName:u,bandPosition:C,offset:E,useRectOffsetField:$}),[m]:G$({fieldDef:e,scaleName:u,bandPosition:Q(C)?{signal:`1-${C.signal}`}:1-C,offset:w,useRectOffsetField:$})}}else if(Nt(e.bin)){const $=Xs(e,u,{},{offset:E});if(q(t))return{[y]:$,[m]:Xs(t,u,{},{offset:w})};if(Ra(e.bin)&&e.bin.step)return{[y]:$,[m]:{signal:`scale("${u}", ${G(e,{expr:"datum"})} + ${e.bin.step})`,offset:w}}}j(FN(g))}function G$({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return _p({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:O0,endSuffix:R0}:{}})}const ele=new Set(["aria","width","height"]);function wi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?g4(e):{};return{...tle(e.markDef,t),...Y$("fill",n),...Y$("stroke",i),...It("opacity",e),...It("fillOpacity",e),...It("strokeOpacity",e),...It("strokeWidth",e),...It("strokeDash",e),...Hue(e),...h4(e),...JA(e,"href"),...jue(e)}}function Y$(e,t){return t?{[e]:t}:{}}function tle(e,t){return cre.reduce((n,i)=>(!ele.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ke(e[i])),n),{})}function ZA(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{let s;if(!Nr(o)||!(s=e.getScaleType(o)))return;const a=p0(r.aggregate),u=FA({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(vse(u)){const l=e.vgField(o,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});l&&i.add(l)}}),i.size>0)return{defined:{signal:[...i].map(o=>b0(o,!0)).join(" && ")}}}function V$(e,t){if(t!==void 0)return{[e]:Ke(t)}}const b1="voronoi",b4={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(b1)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(As(o))return j(yre(o)),n;const s={name:e.getName(b1),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...h4(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(b1)&&(u=!0)}),u||n.splice(a+1,0,s),n}},x4={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!qA(e.bind),parse:(e,t,n)=>$4(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init?.[0],a=b4.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=Qe(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:xa(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Fe(u.field)}] : null`}]:[],bind:o[u.field]??o[u.channel]??o})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(l=>l.name===i+ho),s=i+ed,a=r.items.map(l=>Qe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(o.update=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},Rp="_toggle",v4={defined:e=>e.type==="point"&&!pr(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Rp,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+ho,i=t.name+Rp;return`${i} ? null : ${n}, ${t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Js(e)}}, `}${i} ? ${n} : null`}},nle={defined:e=>e.clear!==void 0&&e.clear!==!1&&!pr(e),parse:(e,t)=>{t.clear&&(t.clear=he(t.clear)?hs(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(x4.defined(t))for(const i of t.project.items){const r=n.findIndex(o=>o.name===Qe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,o){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const r of t.project.items){const o=n.findIndex(s=>s.name===r.signals.visual);if(i(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===r.signals.data);i(s,"null")}}else{let r=n.findIndex(o=>o.name===t.name+ho);i(r,"null"),v4.defined(t)&&(r=n.findIndex(o=>o.name===t.name+Rp),i(r,"false"))}return n}},E4={defined:e=>{const t=e.resolve==="global"&&e.bind&&qA(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==qi;return t&&!n&&j(Ere),t&&n},parse:(e,t,n)=>{const i=fe(n);if(i.select=he(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},$4(t,i),ce(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=ct(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const r=d1(t.bind)?t.bind.legend:"click",o=he(r)?hs(r,"view"):ct(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=d1(t.bind)&&t.bind.legend,o=s=>a=>{const u=fe(a);return u.markname=s,u};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${Qe(s.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(o(`${a}_symbols`)).concat(r.merge.map(o(`${a}_labels`))).concat(r.merge.map(o(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(d=>d.name===i+ho),s=i+ed,a=r.items.filter(d=>d.hasLegend).map(d=>Qe(`${i}_${Qe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(o.update=l,delete o.value,delete o.on);const c=n.find(d=>d.name===i+Rp),f=d1(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function ile(e,t,n){const i=e.fieldDef(t)?.field;for(const r of gt(e.component.selection??{})){const o=r.project.hasField[i]??r.project.hasChannel[t];if(o&&E4.defined(r)){const s=n.get("selections")??[];s.push(r.name),n.set("selections",s,!1),o.hasLegend=!0}}}const A4="_translate_anchor",w4="_translate_delta",rle={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=oo.defined(t),o=i+A4,{x:s,y:a}=t.project.hasChannel;let u=hs(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+yu,l))),n.push({name:o,value:{},on:[{events:u.map(l=>l.between[0]),update:`{x: x(unit), y: y(unit)${s!==void 0?`, extent_x: ${r?Pb(e,et):`slice(${s.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${r?Pb(e,Ot):`slice(${a.signals.visual})`}`:""}}`}]},{name:i+w4,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&X$(e,t,s,"width",n),a!==void 0&&X$(e,t,a,"height",n),n}};function X$(e,t,n,i,r){const o=t.name,s=o+A4,a=o+w4,u=n.channel,l=oo.defined(t),c=r.find(A=>A.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d?.get("type"),p=d?.get("reverse"),g=l?u===et?p?"":"-":p?"-":"":"",m=`${s}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",x=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",v=`${b}(${m}, ${y}${x})`;c.on.push({events:{signal:a},update:l?v:`clampRange(${v}, 0, ${f})`})}const C4="_zoom_anchor",S4="_zoom_delta",ole={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=oo.defined(t),o=i+S4,{x:s,y:a}=t.project.hasChannel,u=Fe(e.scaleName(et)),l=Fe(e.scaleName(Ot));let c=hs(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+yu,f))),n.push({name:i+C4,on:[{events:c,update:r?`{${[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&K$(e,t,s,"width",n),a!==void 0&&K$(e,t,a,"height",n),n}};function K$(e,t,n,i,r){const o=t.name,s=n.channel,a=oo.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c?.get("type"),d=a?Pb(e,s):u.name,h=o+S4,p=`${o}${C4}.${s}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const va="_store",ho="_tuple",sle="_modify",_4="vlSelectionResolve",L0=[Mue,zue,kue,v4,x4,oo,E4,nle,rle,ole,b4];function ale(e){let t=e.parent;for(;t&&!Zn(t);)t=t.parent;return t}function Js(e,{escape:t}={escape:!0}){let n=t?Fe(e.name):e.name;const i=ale(e);if(i){const{facet:r}=i;for(const o of fi)r[o]&&(n+=` + '__facet_${o}_' + (facet[${Fe(i.vgField(o))}])`)}return n}function ew(e){return gt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function $4(e,t){(_e(t.select)||!t.select.on)&&delete e.events,(_e(t.select)||!t.select.clear)&&delete e.clear,(_e(t.select)||!t.select.toggle)&&delete e.toggle}function pr(e){return e.events?.find(t=>"type"in t&&t.type==="timer")}function Bb(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Bb(e.object)),t.push(...Bb(e.property))),t)}function F4(e){return e.object.type==="MemberExpression"?F4(e.object):e.object.name==="datum"}function k4(e){const t=Die(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&F4(i)&&n.add(Bb(i).slice(1).join("."))}),n}class xl extends je{model;filter;expr;_dependentFields;clone(){return new xl(null,this.model,fe(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Np(this.model,this.filter,this),this._dependentFields=k4(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function ule(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const o of t){const s=Qe(o.name),a=o.select,u=he(a)?a:a.type,l=ke(a)?fe(a):{type:u},c=i[u];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=fe(c[h]??l[h])));const f=n[s]={...l,name:s,type:u,init:o.value,bind:o.bind,events:he(l.on)?hs(l.on,"scope"):ct(fe(l.on))};if(pr(f)&&(r++,r>1)){delete n[s];continue}const d=fe(o);for(const h of L0)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&j($re),n}function D4(e,t,n,i="datum"){const r=he(t)?t:t.param,o=Qe(r),s=Fe(o+va);let a;try{a=e.getSelectionComponent(o,r)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${Fe(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function T4(e,t,n){const i=Qe(t),r=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!o)o=s.project.items[0].field,s.project.items.length>1&&j(Fre(o));else if(r&&!o){const a=s.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(o=s.project.items[0].field,j(kre(a,r,n,o))):o=a[0].field}return`${s.name}[${Fe(xi(o))}]`}function lle(e,t){for(const[n,i]of rs(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Rn(new xl(t,e,{param:n}),r,rt.Lookup,e.component.data.outputNodeRefCounts)}}function Np(e,t,n){return Fc(t,i=>he(i)?i:Ioe(i)?D4(e,i,n):zN(i))}function cle(e,t){if(e)return X(e)&&!Mo(e)?e.map(n=>NA(n,t)).join(", "):e}function x1(e,t,n,i){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=i}function pc(e,t,n,i={header:!1}){const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const f in c){const d=f,h=jse[d],p=c[d];if(h&&h!==t&&h!=="both")delete c[d];else if(Zf(p)){const{condition:g,...m}=p,y=ct(g),b=C$[d];if(b){const{vgProp:x,part:v}=b,A=[...y.map(w=>{const{test:E,...C}=w;return{test:Np(null,E),...C}}),m];x1(c,v,x,A),delete c[d]}else if(b===null){const x={signal:y.map(v=>{const{test:A,...w}=v;return`${Np(null,A)} ? ${u$(w)} : `}).join("")+u$(m)};c[d]=x}}else if(Q(p)){const g=C$[d];if(g){const{vgProp:m,part:y}=g;x1(c,y,m,p),delete c[d]}}Ae(["labelAlign","labelBaseline"],d)&&c[d]===null&&delete c[d]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:f}=c.encode;c.encode={...f?{grid:f}:{}},Ge(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ft(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let d=a;c.encode?.labels?.update&&Q(c.encode.labels.update.text)&&(d=da(a,"datum.label",c.encode.labels.update.text.signal)),x1(c,"labels","text",{signal:d})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const d of y6)e.hasAxisPart(d)||delete c.encode[d];Ge(c.encode)&&delete c.encode}const f=cle(u,n);return{scale:s,orient:o,grid:!1,...f?{title:f}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ft(l,0)}}}}function M4(e){const{axes:t}=e.component,n=[];for(const i of vo)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const o=i==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function fle(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>pc(r,"grid",t)),...i.map(r=>pc(r,"grid",t)),...n.map(r=>pc(r,"main",t)),...i.map(r=>pc(r,"main",t))].filter(r=>r)}function J$(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...z(s),...z(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${Oi(s[c])} : ${Oi(a[c])}`};return l}return t[r]})])}function dle(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:WN(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Q(n)?"axisOrient":`axis${jf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:J$(a,i,e,n),vgAxisConfig:J$(u,i,e,n),axisConfigStyle:hle([...u,...a],i)}}function hle(e,t){const n=[{}];for(const i of e){let r=t[i]?.style;if(r){r=ct(r);for(const o of r)n.push(t.style[o])}}return Object.assign.apply(null,n)}function zb(e,t,n,i={}){const r=bN(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(i[o]?.[e]!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const Q$={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??ple(n,e),gridScale:({model:e,channel:t})=>gle(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||R4(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||O4(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??yle(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??ble(t.type,n,q(t)&&!!t.timeUnit,q(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??vle({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??Ele({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=N4(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return vN(r?[A$(r)]:[],q(s)?[A$(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Ale(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??wle(n,t)};function ple(e,t){return!Tt(e)&&q(t)&&!Ye(t?.bin)&&!Nt(t?.bin)}function gle(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function mle(e,t,n,i,r){const o=t?.labelAngle;if(o!==void 0)return Q(o)?o:tf(o);{const{configValue:s}=zb("labelAngle",i,t?.style,r);return s!==void 0?tf(s):n===et&&Ae([wA,AA],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function Ub(e){return`(((${e.signal} % 360) + 360) % 360)`}function O4(e,t,n,i){if(e!==void 0)if(n==="x"){if(Q(e)){const r=Ub(e),o=Q(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(Q(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(Q(e)){const r=Ub(e),o=Q(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(Q(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function R4(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,o=i?"bottom":"left";if(Q(e)){const s=Ub(e),a=Q(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${r?`(${s} + 90)`:s} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${s} && ${s} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(Q(t)){const s=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${s} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===o)?"left":"right"}function yle(e,t){if(t==="x"&&Ae(["quantitative","temporal"],e))return!0}function ble(e,t,n,i){if(n&&!ke(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function xle(e){return e==="x"?"bottom":"left"}function vle({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){if(!i&&!Tt(t)&&t!=="log"){if(q(e)){if(Ye(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&Ae(["month","hours","day","quarter"],Dt(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Ele({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=PN(n);if(i)return{signal:i}}}}function N4(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,s=r?r.title:void 0;if(o&&s)return EN(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function Ale(e,t){const n=e.values;if(X(n))return m6(t,n);if(Q(n))return n}function wle(e,t){return e==="rect"&&Fp(t)?1:0}class Vu extends je{transform;_dependentFields;clone(){return new Vu(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=k4(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Ia(i)&&s6(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${zN({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new Vu(t,{calculate:u,as:Xu(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${we(this.transform)}`}}function Xu(e,t,n){return G(e,{prefix:t,suffix:"sort_index",...n})}function P0(e,t){return Ae(["top","bottom"],t)?"column":Ae(["left","right"],t)||e==="row"?"row":"column"}function Ku(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return ft((t||{})[e],r[e],n.header[e])}function I0(e,t,n,i){const r={};for(const o of e){const s=Ku(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const tw=["row","column"],nw=["header","footer"];function Cle(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=I0(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=P0(t,a),l=tf(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...P4(l,u),...L4(u,l,o),...I4(i,r,t,cae,N6)}}}function L4(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=R4(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function P4(e,t){const n=O4(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Sle(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of nw)if(n[r])for(const o of n[r]){const s=$le(e,t,r,n,o);s!=null&&i.push(s)}return i}function _le(e,t){const{sort:n}=e;return ro(n)?{field:G(n,{expr:"datum"}),order:n.order??"ascending"}:X(n)?{field:Xu(e,t,{expr:"datum"}),order:"ascending"}:{field:G(e,{expr:"datum"}),order:n??"ascending"}}function jb(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=I0(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=TA({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=P0(t,a);return{text:{signal:u?da(da(u,"datum.label",l),"datum.value",G(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...P4(o,c),...L4(c,o,s),...I4(n,e,t,fae,L6)}}function $le(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i,a=e.config?e.config:void 0;if(s&&r.labels){const{labelOrient:f}=I0(["labelOrient"],s.header,a,t);(t==="row"&&!Ae(["top","bottom"],f)||t==="column"&&!Ae(["left","right"],f))&&(o=jb(s,t,a))}const u=Zn(e)&&!Xf(e.facet),l=r.axes,c=l?.length>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:_le(s,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const Fle={column:{start:0,end:1},row:{start:1,end:0}};function kle(e,t){return Fle[t][e]}function Dle(e,t){const n={};for(const i of fi){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:o,titleOrient:s}=I0(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=P0(i,s),u=kle(o,a);u!==void 0&&(n[a]=u)}}return Ge(n)?void 0:n}function I4(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=Ku(s,t?.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function iw(e){return[...Dd(e,"width"),...Dd(e,"height"),...Dd(e,"childWidth"),...Dd(e,"childHeight")]}function Dd(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Tt(s)&&Na(a)){const u=e.scaleName(n);return Zn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[Z$(u,a)]:[Z$(u,a),{name:r,update:B4(u,o,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const o=r.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=Tb(e.config.view,o?"width":"height"),u=`isFinite(${s}) ? ${s} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function Z$(e,t){const n=`${e}_step`;return Q(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function B4(e,t,n){const i=t.get("type"),r=t.get("padding"),o=ft(t.get("paddingOuter"),r);let s=t.get("paddingInner");return s=i==="band"?s!==void 0?s:r:1,`bandspace(${n}, ${Oi(s)}, ${Oi(o)}) * ${e}_step`}function z4(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function U4(e,t){return z(e).reduce((n,i)=>({...n,...bl({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ke(r.value),invalidValueRef:void 0})}),{})}function j4(e,t){if(Zn(t))return e==="theta"?"independent":"shared";if(Al(t))return"shared";if(cw(t))return dt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function rw(e,t){const n=e.scale[t],i=dt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(soe(t)),"independent"):e[i][t]||"shared"}const Tle={...pae,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},q4=z(Tle);class Mle extends Ao{}const eF={symbols:Ole,gradient:Rle,labels:Nle,entries:Lle};function Ole(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:u,mark:l}=n,c=s.filled&&l!=="trail";let f={...pre({},n,cse),...g4(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?W4(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===In)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ke(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ke(g??1));else if(X(f.fill)){const m=qb(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ke(m))}}if(f.stroke){if(i==="stroke"||!c&&i===In)delete f.stroke;else if(U(f.stroke,"field")||p)delete f.stroke;else if(X(f.stroke)){const m=ft(qb(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==xo){const m=q(t)&&G4(n,r,t);m?f.opacity=[{test:m,...Ke(g??1)},Ke(u.legend.unselectedOpacity)]:g&&(f.opacity=Ke(g))}return f={...f,...e},Ge(f)?void 0:f}function Rle(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:o,encoding:s}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?W4(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ke(l)),a={...a,...e},Ge(a)?void 0:a}function Nle(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?G4(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;ba(c)?f=Ri({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:s}):l===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=Ri({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&q(t)&&t.timeUnit===void 0&&(f=Ri({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ge(d)?void 0:d}function Lle(e,{legendCmpt:t}){return t.get("selections")?.length?{...e,fill:{value:"transparent"}}:e}function W4(e){return H4(e,(t,n)=>Math.max(t,n.value))}function qb(e){return H4(e,(t,n)=>ft(t,n.value))}function H4(e,t){if(Dse(e))return ct(e.condition).reduce(t,e.value);if(Ui(e))return e.value}function G4(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=Fe(n.field);return i.map(o=>`(!length(data(${Fe(Qe(o)+va)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const tF={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return i6(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return r6(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??qle(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Wle(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Ile(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>mu(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(gu(n)&&cr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Ple(t,e)};function Ple(e,t){const n=e.values;if(X(n))return m6(t,n);if(Q(n))return n}function Ile(e,t,n,i){if(t!=="shape"){const r=qb(n)??i;if(r)return r}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 Ble(e){const{legend:t}=e;return ft(t.type,zle(e))}function zle({channel:e,timeUnit:t,scaleType:n}){if(gu(e)){if(Ae(["quarter","month","day"],t))return"symbol";if(cr(n))return"gradient"}return"symbol"}function Ule({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??jle(n,t)}function jle(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function qle({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(cr(r))return n==="horizontal"?i==="top"||i==="bottom"?nF(t,"width",s,o):s:nF(t,"height",u,a)}function nF(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Wle(e){if(Ae(["quantile","threshold","log","symlog"],e))return"greedy"}function Y4(e){const t=it(e)?Hle(e):Xle(e);return e.component.legends=t,t}function Hle(e){const{encoding:t}=e,n={};for(const i of[In,...I6]){const r=vt(t[i]);!r||!e.getScaleComponent(i)||i===Bn&&q(r)&&r.type===yl||(n[i]=Vle(e,i))}return n}function Gle(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Yle(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!n?.values;case"title":if(t==="title"&&e===i?.title)return!0}return e===(n||{})[t]}function Vle(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new Mle({},Gle(e,t));ile(e,t,a);const u=n!==void 0?!n:s.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=vt(r[t]),f=q(c)?Dt(c.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=Ble({legend:n,channel:t,timeUnit:f,scaleType:l}),p=Ule({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:p};for(const v of q4){if(h==="gradient"&&v.startsWith("symbol")||h==="symbol"&&v.startsWith("gradient"))continue;const A=v in tF?tF[v](g):n[v];if(A!==void 0){const w=Yle(A,v,n,e.fieldDef(t));(w||o.legend[v]===void 0)&&a.set(v,A,w)}}const m=n?.encoding??{},y=a.get("selections"),b={},x={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const v of["labels","legend","title","symbols","gradient","entries"]){const A=U4(m[v]??{},e),w=v in eF?eF[v](A,x):A;w!==void 0&&!Ge(w)&&(b[v]={...y?.length&&q(c)?{name:`${Qe(c.field)}_legend_${v}`}:{},...y?.length?{interactive:!0}:{},update:y?.length?{...w,cursor:{value:"pointer"}}:w})}return Ge(b)||a.set("encode",b,!!n?.encoding),a}function Xle(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Y4(i);for(const r of z(i.component.legends))n.legend[r]=rw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=V4(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of z(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function V4(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const o of q4){const s=as(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",(a,u)=>{switch(o){case"symbolType":return Kle(a,u);case"title":return AN(a,u);case"type":return r=!0,qn("symbol")}return M0(a,u,o,"legend")});e.setWithExplicit(o,s)}return r&&(e.implicit?.encode?.gradient&&wp(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&wp(e.explicit,["encode","gradient"])),e}function Kle(e,t){return t.value==="circle"?t:e}function Jle(e,t,n,i){e.encode??={},e.encode[t]??={},e.encode[t].update??={},e.encode[t].update[n]=i}function X4(e){const t=e.component.legends,n={};for(const r of z(t)){const o=e.getScaleComponent(r),s=Pe(o.get("domains"));if(n[s])for(const a of n[s])V4(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return gt(n).flat().map(r=>Qle(r,e.config)).filter(r=>r!==void 0)}function Qle(e,t){const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),o.encode?.symbols){const s=o.encode.symbols.update;s.fill&&s.fill.value!=="transparent"&&!s.stroke&&!o.stroke&&(s.stroke={value:"transparent"});for(const a of I6)o[a]&&delete s[a]}if(o.title||delete o.title,i!==void 0){let s=i;o.encode?.labels?.update&&Q(o.encode.labels.update.text)&&(s=da(i,"datum.label",o.encode.labels.update.text.signal)),Jle(o,"labels","text",{signal:s})}return o}}function Zle(e){return Al(e)||cw(e)?ece(e):K4(e)}function ece(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),K4(e))}function K4(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const u=Q(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return Ae(s,u)||s.push(u),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const tce=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class J4 extends Ao{specifiedProjection;size;data;merged=!1;constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r}get isFit(){return!!this.data}}function Q4(e){e.component.projection=it(e)?nce(e):oce(e)}function nce(e){if(e.hasProjection){const t=Lt(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?ice(e):void 0,o=new J4(e.projectionName(!0),{...Lt(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function ice(e){const t=[],{encoding:n}=e;for(const i of[[Ji,Ki],[vi,Qi]])(vt(n[i[0]])||vt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Bn)&&e.typedFieldDef(Bn).type===yl&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(rt.Main)),t}function rce(e,t){const n=XE(tce,r=>!!(!pt(e.explicit,r)&&!pt(t.explicit,r)||pt(e.explicit,r)&&pt(t.explicit,r)&&Vn(e.get(r),t.get(r))));if(Vn(e.size,t.size)){if(n)return e;if(Vn(e.explicit,{}))return t;if(Vn(t.explicit,{}))return e}return null}function oce(e){if(e.children.length===0)return;let t;for(const i of e.children)Q4(i);const n=XE(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=rce(t,r);return o&&(t=o),!!o}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new J4(i,t.specifiedProjection,t.size,fe(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&r.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),i),s.merged=!0)}return r}}function sce(e,t,n,i){if(Qf(t,n)){const r=it(e)?e.axis(n)??e.legend(n)??{}:{},o=G(t,{expr:"datum"}),s=G(t,{expr:"datum",binSuffix:"end"});return{formulaAs:G(t,{binSuffix:"range",forAs:!0}),formula:Vf(o,s,r.format,r.formatType,i)}}return{}}function Z4(e,t){return`${pN(e)}_${t}`}function ace(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function ow(e,t,n){const i=_0(n,void 0)??{},r=Z4(i,t);return e.getName(`${r}_bins`)}function uce(e){return"as"in e}function iF(e,t,n){let i,r;uce(e)?i=he(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[G(e,{forAs:!0}),G(e,{binSuffix:"end",forAs:!0})];const o={..._0(t,void 0)},s=Z4(o,e.field),{signal:a,extentSignal:u}=ace(n,s);if(g0(o.extent)){const c=o.extent;r=T4(n,c.param,c),delete o.extent}const l={bin:o,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:s,binComponent:l}}class gr extends je{bins;clone(){return new gr(null,fe(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(Sn(o)&&Ye(o.bin)){const{key:a,binComponent:u}=iF(o,o.bin,n);r[a]={...u,...r[a],...sce(n,o,s,n.config)}}return r},{});return Ge(i)?null:new gr(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=iF(n,n.bin,i);return new gr(t,{[r]:o})}merge(t,n){for(const i of z(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=lr([...this.bins[i].as,...t.bins[i].as],we)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(gt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(gt(this.bins).map(t=>t.field))}hash(){return`Bin ${we(this.bins)}`}assemble(){return gt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:xi(t.field),as:i,signal:t.signal,...g0(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:xi(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:G({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function lce(e,t,n,i){const r=it(i)?i.encoding[Rr(t)]:void 0;if(Sn(n)&&it(i)&&u6(n,r,i.markDef,i.config)){e.add(G(n,{})),e.add(G(n,{suffix:"end"}));const{mark:o,markDef:s,config:a}=i,u=ss({fieldDef:n,markDef:s,config:a});nf(o)&&u!==.5&&dt(t)&&(e.add(G(n,{suffix:O0})),e.add(G(n,{suffix:R0}))),n.bin&&Qf(n,t)&&e.add(G(n,{binSuffix:"range"}))}else if(oN(t)){const o=rN(t);e.add(i.getName(o))}else e.add(G(n));return Ia(n)&&Joe(n.scale?.range)&&e.add(n.scale.range.field),e}function cce(e,t){for(const n of z(t)){const i=t[n];for(const r of z(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Li extends je{dimensions;measures;clone(){return new Li(null,new Set(this.dimensions),fe(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(s=>{s.aggregate&&(i=!0)});const r={},o=new Set;return!i||(n.forEachFieldDef((s,a)=>{const{aggregate:u,field:l}=s;if(u)if(u==="count")r["*"]??={},r["*"].count=new Set([G(s,{forAs:!0})]);else{if(co(u)||Es(u)){const c=co(u)?"argmin":"argmax",f=u[c];r[f]??={},r[f][c]=new Set([G({op:c,field:f},{forAs:!0})])}else r[l]??={},r[l][u]=new Set([G(s,{forAs:!0})]);Nr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??={},r[l].min=new Set([G({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([G({field:l,aggregate:"max"},{forAs:!0})]))}else lce(o,a,s,n)}),o.size+z(r).length===0)?null:new Li(t,o,r)}static makeFromTransform(t,n){const i=new Set,r={};for(const o of n.aggregate){const{op:s,field:a,as:u}=o;s&&(s==="count"?(r["*"]??={},r["*"].count=new Set([u||G(o,{forAs:!0})])):(r[a]??={},r[a][s]??=new Set,r[a][s].add(u||G(o,{forAs:!0}))))}for(const o of n.groupby??[])i.add(o);return i.size+z(r).length===0?null:new Li(t,i,r)}merge(t){return XR(this.dimensions,t.dimensions)?(cce(this.measures,t.measures),!0):(Aoe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...z(this.measures)])}producedFields(){const t=new Set;for(const n of z(this.measures))for(const i of z(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${we({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of z(this.measures))for(const s of z(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:xi(o));return{type:"aggregate",groupby:[...this.dimensions].map(xi),ops:t,fields:n,as:i}}}class vl extends je{model;name;data;column;row;facet;childModel;constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of fi){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[G(s),...Ye(a)?[G(s,{binSuffix:"end"})]:[]],...ro(u)?{sortField:u}:X(u)?{sortIndexField:Xu(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of fi)this[n]&&(t+=` ${n.charAt(0)}:${we(this[n])}`);return t}get fields(){const t=[];for(const n of fi)this[n]?.fields&&t.push(...this[n].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of fi)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of vo){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(Tt(r)&&Na(o)){const s=B0(this.childModel,n),a=lw(s);a?t[n]=a:j(lA(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];r&&i&&i[r]&&(n?(o.push(`distinct_${i[r]}`),s.push("max")):(o.push(i[r]),s.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=w0,field:f}=u;o.push(f),s.push(c),a.push(G(u,{forAs:!0}))}else l&&(o.push(l),s.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const u of tw){for(const l of nw){const c=i[u]?.[l]??[];for(const f of c)if(f.axes?.length>0){o[u]=!0;break}}if(o[u]){const l=`length(data("${this.facet.name}"))`,c=u==="row"?n?{signal:`ceil(${l} / ${n})`}:1:n?{signal:`min(${l}, ${n})`}:{signal:l};r.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:c}]})}}const{row:s,column:a}=o;return(s||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:o,facet:s}=this;if(r&&o&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[io,no])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function rF(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function fce(e,t){const n=QE(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=rF(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=rF(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(Tre(t)),null}function dce(e){const t={};return lh(e.filter,n=>{if(BN(n)){let i=null;gA(n)?i=Gn(n.equal):yA(n)?i=Gn(n.lte):mA(n)?i=Gn(n.lt):bA(n)?i=Gn(n.gt):xA(n)?i=Gn(n.gte):vA(n)?i=n.range[0]:EA(n)&&(i=(n.oneOf??n.in)[0]),i&&(La(i)?t[n.field]="date":Ze(i)?t[n.field]="number":he(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function hce(e){const t={};function n(i){Hu(i)?t[i.field]="date":i.type==="quantitative"&&rre(i.aggregate)?t[i.field]="number":Bu(i.field)>1?i.field in t||(t[i.field]="flatten"):Ia(i)&&ro(i.sort)&&Bu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((it(e)||Zn(e))&&e.forEachFieldDef((i,r)=>{if(Sn(i))n(i);else{const o=Oa(r),s=e.fieldDef(o);n({...i,type:s.type})}}),it(e)){const{mark:i,markDef:r,encoding:o}=e;if(As(i)&&!e.encoding.order){const s=r.orient==="horizontal"?"y":"x",a=o[s];q(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function pce(e){const t={};if(it(e)&&e.component.selection)for(const n of z(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Bu(r.field)>1&&(t[r.field]="flatten")}return t}class tn extends je{_parse;clone(){return new tn(null,fe(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${we(this._parse)}`}static makeExplicit(t,n,i){let r={};const o=n.data;return!Xo(o)&&o?.format?.parse&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of z(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(p$(a,i[a],u.value)))}for(const a of z(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(p$(a,n[a],u)))}const o=new Ao(n,i);r.copyAll(o);const s={};for(const a of z(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return z(s).length===0||r.parseNothing?null:new tn(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of z(this._parse)){const i=this._parse[n];Bu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(z(this._parse))}dependentFields(){return new Set(z(this._parse))}assembleTransforms(t=!1){return z(this._parse).filter(n=>t?Bu(n)>1:!0).map(n=>{const i=fce(n,this._parse[n]);return i?{type:"formula",expr:i,as:gl(n)}:null}).filter(n=>n!==null)}}class us extends je{clone(){return new us(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([qi])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:qi}}}class td extends je{params;clone(){return new td(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${we(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class nd extends je{params;clone(){return new nd(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${we(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Ea extends je{_data;_name;_generator;constructor(t){super(null),t??={name:"source"};let n;if(Xo(t)||(n=t.format?{...Qn(t.format,["parse"])}:{}),rf(t))this._data={values:t.values};else if(Gu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];Ae(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else i4(t)?this._data={values:[{type:"Sphere"}]}:(t4(t)||Xo(t))&&(this._data={});this._generator=Xo(t),t.name&&(this._name=t.name),n&&!Ge(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function sw(e){return e instanceof Ea||e instanceof td||e instanceof nd}class aw{#e;constructor(){this.#e=!1}setModified(){this.#e=!0}get modifiedFlag(){return this.#e}}class Ba extends aw{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,o)=>o[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class uw extends aw{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class gce extends uw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of z(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class mce extends uw{requiresSelectionId;constructor(t){super(),this.requiresSelectionId=t&&ew(t)}run(t){t instanceof us&&(this.requiresSelectionId&&(sw(t.parent)||t.parent instanceof Li||t.parent instanceof tn)||(this.setModified(),t.remove()))}}class yce extends aw{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof hr&&(i=t.producedFields(),KE(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class bce extends uw{constructor(){super()}run(t){t instanceof Rn&&!t.isRequired()&&(this.setModified(),t.remove())}}class xce extends Ba{run(t){if(!sw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof tn)if(t instanceof tn)this.setModified(),t.merge(n);else{if(JE(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class vce extends Ba{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof tn);if(t.numChildren()>1&&i.length>=1){const r={},o=new Set;for(const s of i){const a=s.parse;for(const u of z(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!Ge(r)){this.setModified();const s=new tn(t,r);for(const a of n){if(a instanceof tn)for(const u of z(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof tn&&z(a.parse).length===0&&a.remove()}}}}}class Ece extends Ba{run(t){t instanceof Rn||t.numChildren()>0||t instanceof vl||t instanceof Ea||(this.setModified(),t.remove())}}class Ace extends Ba{run(t){const n=t.children.filter(r=>r instanceof hr),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class wce extends Ba{run(t){const n=t.children.filter(r=>r instanceof Li),i={};for(const r of n){const o=we(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of z(i)){const o=i[r];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Cce extends Ba{model;constructor(t){super(),this.model=t}run(t){const n=!(sw(t)||t instanceof xl||t instanceof tn||t instanceof us),i=[],r=[];for(const o of t.children)o instanceof gr&&(n&&!JE(t.producedFields(),o.dependentFields())?i.push(o):r.push(o));if(i.length>0){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof gr?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(r.length>1){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Sce extends Ba{run(t){const n=[...t.children];if(!Iu(n,s=>s instanceof Rn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof Rn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof Rn)a=u;else break}r.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else r.push(s);if(r.length){this.setModified();for(const s of r)s.parent.removeChild(s),s.parent=o}}}class za extends je{transform;clone(){return new za(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=lr(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??G(t)}hash(){return`JoinAggregateTransform ${we(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const o of this.transform.joinaggregate)n.push(o.op),i.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Ju extends je{filter;clone(){return new Ju(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:o}=n,{marks:s,scales:a}=i;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=Nr(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=FA({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:p0(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return z(u).length?new Ju(t,u):null}dependentFields(){return new Set(z(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${we(this.filter)}`}assemble(){const t=z(this.filter).reduce((n,i)=>{const r=this.filter[i],o=G(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${Wb(o)}))`):r.type==="quantitative"&&n.push(Wb(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function Wb(e){return`isValid(${e}) && isFinite(+${e})`}function _ce(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=G(i);return r&&t.push(r),t},[])}function $ce(e){return X(e)&&e.every(t=>he(t))&&e.length>1}class so extends je{_stack;clone(){return new so(null,fe(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:o,offset:s="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(ft(f.order,"ascending"));const l={field:a,order:u};let c;return $ce(o)?c=o:he(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new so(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:s,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:u}=i,l=o.map(h=>{const p=r[h];return ji(p)}).filter(h=>!!h),c=_ce(n),f=n.encoding.order;let d;if(X(f)||q(f))d=xN(f);else{const h=l6(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new so(t,{dimensionFieldDefs:l,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${we(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[G(r,{binSuffix:"mid"})]:[G(r,{}),G(r,{binSuffix:"end"})]:[G(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:o,sort:s,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=G(c,{expr:"datum"}),p=G(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${Wb(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:G(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:G(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:s,as:l,offset:a}),t}}class El extends je{transform;clone(){return new El(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=lr(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??G(t)}hash(){return`WindowTransform ${we(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>aA(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function Fce(e){function t(n){if(!(n instanceof vl)){const i=n.clone();if(i instanceof Rn){const r=Gb+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Li||i instanceof so||i instanceof El||i instanceof za)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Hb(e){if(e instanceof vl)if(e.numChildren()===1&&!(e.children[0]instanceof Rn)){const t=e.children[0];(t instanceof Li||t instanceof so||t instanceof El||t instanceof za)&&t.addDimensions(e.fields),t.swapWithParent(),Hb(e)}else{const t=e.model.component.data.main;e8(t);const n=Fce(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Hb)}function e8(e){if(e instanceof Rn&&e.type===rt.Main&&e.numChildren()===1){const t=e.children[0];t instanceof vl||(t.swapWithParent(),e8(e))}}const Gb="scale_",Td=5;function Yb(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Yb(t.children))return!1}return!0}function Ci(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function oF(e,t,n){let i=e.sources,r=!1;return r=Ci(new bce,i)||r,r=Ci(new mce(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=Ci(new Ece,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=Ci(new xce,i)||r,r=Ci(new Cce(t),i)||r,r=Ci(new yce,i)||r,r=Ci(new vce,i)||r,r=Ci(new wce,i)||r,r=Ci(new Ace,i)||r,r=Ci(new gce,i)||r,r=Ci(new Sce,i)||r),e.sources=i,r}function kce(e,t){Yb(e.sources);let n=0,i=0;for(let r=0;r<Td&&oF(e,t,!0);r++)n++;e.sources.map(Hb);for(let r=0;r<Td&&oF(e,t,!1);r++)i++;Yb(e.sources),Math.max(n,i)===Td&&j(`Maximum optimization runs(${Td}) reached.`)}class St{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}signal;static fromName(t,n){return new St(()=>t(n))}}function t8(e){it(e)?Dce(e):Tce(e)}function Dce(e){const t=e.component.scales;for(const n of z(t)){const i=Oce(e,n);if(t[n].setWithExplicit("domains",i),Nce(e,n),e.component.data.isFaceted){let o=e;for(;!Zn(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of i.value)Zr(a)&&(a.data=Gb+a.data.replace(Gb,""))}}}function Tce(e){for(const n of e.children)t8(n);const t=e.component.scales;for(const n of z(t)){let i,r=null;for(const o of e.children){const s=o.component.scales[n];if(s){i===void 0?i=s.getWithExplicit("domains"):i=as(i,s.getWithExplicit("domains"),"domains","scale",Vb);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(Cre),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Mce(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=sF(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=sF(t,n);if(r)return"unaggregated"}return e}function Oce(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Mce(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&vt(i.x2)?vt(i.x)?as($o(n,r,e,"x"),$o(n,r,e,"x2"),"domain","scale",Vb):$o(n,r,e,"x2"):t==="y"&&vt(i.y2)?vt(i.y)?as($o(n,r,e,"y"),$o(n,r,e,"y2"),"domain","scale",Vb):$o(n,r,e,"y2"):$o(n,r,e,t)}function Rce(e,t,n){return e.map(i=>({signal:`{data: ${$0(i,{timeUnit:n,type:t})}}`}))}function v1(e,t,n){const i=Dt(n)?.unit;return t==="temporal"||i?Rce(e,t,i):[e]}function $o(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=vt(r[i]),{type:c}=l,f=l.timeUnit,d=$ue({invalid:Ar("invalid",o,a),isPath:As(s)});if(Koe(t)){const g=$o(e,void 0,n,i),m=v1(t.unionWith,c,f);return rr([...m,...g.value])}else{if(Q(t))return rr([t]);if(t&&t!=="unaggregated"&&!GN(t))return rr(v1(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return qn([[0,1]]);const g=n.requestDataName(d);return qn([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=Nr(i)&&q(l)?Lce(n,i,e):void 0;if(Lr(l)){const g=v1([l.datum],c,f);return qn(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return qn([{data:n.requestDataName(d),field:G({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:G({field:g,aggregate:"max"})}])}else if(Ye(p.bin)){if(Tt(e))return qn(e==="bin-ordinal"?[]:[{data:ef(h)?n.requestDataName(d):n.requestDataName(rt.Raw),field:n.vgField(i,Qf(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!ke(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(Ye(g)){const m=ow(n,p.field,g);return qn([new St(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return qn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&Ae(["time","utc"],e)){const g=r[Rr(i)];if(u6(p,g,o,a)){const m=n.requestDataName(d),y=ss({fieldDef:p,fieldDef2:g,markDef:o,config:a}),b=nf(s)&&y!==.5&&dt(i);return qn([{data:m,field:n.vgField(i,b?{suffix:O0}:{})},{data:m,field:n.vgField(i,{suffix:b?R0:"end"})}])}}return qn(h?[{data:ef(h)?n.requestDataName(d):n.requestDataName(rt.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function E1(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":w0),...i?{field:xi(i)}:{},...r?{order:r}:{}}}function Nce(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,o=GN(i)?i:void 0,s=Ra(r)&&g0(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function Lce(e,t,n){if(!Tt(n))return;const i=e.fieldDef(t),r=i.sort;if(s6(r))return{op:"min",field:Xu(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(ro(r)){const a=o&&!s.has(r.field);return E1(r,a)}else if($se(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(co(c)||Es(c))return E1({field:G(l),order:u},d);if(aA(c)||!c)return E1({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(Ae(["ascending",void 0],r))return!0}}function sF(e,t){const{aggregate:n,type:i}=e;return n?he(n)&&!sre.has(n)?{valid:!1,reason:Zre(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:eoe(e)}:{valid:!0}:{valid:!1,reason:Qre(e)}}function Vb(e,t,n,i){return e.explicit&&t.explicit&&j(ooe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Pce(e){const t=lr(e.map(s=>{if(Zr(s)){const{sort:a,...u}=s;return u}return s}),we),n=lr(e.map(s=>{if(Zr(s)){const a=s.sort;return a!==void 0&&!ef(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),we);if(t.length===0)return;if(t.length===1){const s=e[0];if(Zr(s)&&n.length>0){let a=n[0];if(n.length>1){j(m$);const u=n.filter(l=>ke(l)&&"op"in l&&l.op!=="min");n.every(l=>ke(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(ke(a)&&"field"in a){const u=a.field;s.field===u&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const i=lr(n.map(s=>ef(s)||!("op"in s)||he(s.op)&&pt(nre,s.op)?s:(j(aoe(s)),!0)),we);let r;i.length===1?r=i[0]:i.length>1&&(j(m$),r=!0);const o=lr(e.map(s=>Zr(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function lw(e){if(Zr(e)&&he(e.field))return e.field;if(are(e)){let t;for(const n of e.fields)if(Zr(n)&&he(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(uoe),t}return j(loe),t}else if(ure(e)){j(coe);const t=e.fields[0];return he(t)?t:void 0}}function B0(e,t){const i=e.component.scales[t].get("domains").map(r=>(Zr(r)&&(r.data=e.lookupDataSource(r.data)),r));return Pce(i)}function n8(e){return Al(e)||cw(e)?e.children.reduce((t,n)=>t.concat(n8(n)),aF(e)):aF(e)}function aF(e){return z(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:s,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=Ice(r.range,o,n,e),h=B0(e,n),p=a?Iue(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function Ice(e,t,n,i){if(dt(n)){if(Na(e))return{step:{signal:`${t}_step`}}}else if(ke(e)&&Zr(e))return{...e,data:i.lookupDataSource(e.data)};return e}class i8 extends Ao{merged=!1;constructor(t,n){super({},{name:t}),this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(Ae([Pt.LOG,Pt.TIME,Pt.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&Ae([Pt.LINEAR,Pt.SQRT,Pt.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,o=!1,s=!1;for(const a of i){if(X(a)){const u=a[0],l=a[a.length-1];if(Ze(u)&&Ze(l))if(u<=0&&l>=0){r=!0;continue}else{o=!0;continue}}s=!0}if(r)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const Bce=["range","scheme"];function zce(e){const t=e.component.scales;for(const n of sA){const i=t[n];if(!i)continue;const r=Uce(n,e);i.setWithExplicit("range",r)}}function uF(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,o=zn(t),s=e.getName(o);if(ke(i)&&i.binned&&i.step!==void 0)return new St(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(s)} / (${u})`});if(Ye(i)){const a=ow(e,r,i);return new St(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function Uce(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of Bce)if(n[f]!==void 0){const d=Fb(o,f),h=YN(e,f);if(!d)j(_N(o,f,e));else if(h)j(h);else switch(f){case"range":{const p=n.range;if(X(p)){if(dt(e))return rr(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return St.fromName(y,m)}return g}))}else if(ke(p))return rr({data:t.requestDataName(rt.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return rr(p)}case"scheme":return rr(jce(n[f]))}}const s=e===et||e==="xOffset"?"width":"height",a=i[s];if(Cr(a)){if(dt(e))if(Tt(o)){const f=o8(a,t,e);if(f)return rr({step:f})}else j($N(s));else if(Hf(e)){const f=e===gs?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=s8(a,o);if(p)return rr(p)}}}const{rangeMin:u,rangeMax:l}=n,c=qce(e,t);return(u!==void 0||l!==void 0)&&Fb(o,"rangeMin")&&X(c)&&c.length===2?rr([u??c[0],l??c[1]]):qn(c)}function jce(e){return Xoe(e)?{scheme:e.name,...Qn(e,["name"])}:{scheme:e}}function r8(e,t,n,{center:i}={}){const r=zn(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===Ot&&zi(n)?i?[St.fromName(a=>`${s(a)}/2`,o),St.fromName(a=>`-${s(a)}/2`,o)]:[St.fromName(s,o),0]:i?[St.fromName(a=>`-${s(a)}/2`,o),St.fromName(a=>`${s(a)}/2`,o)]:[0,St.fromName(s,o)]}function qce(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=vt(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case et:case Ot:{if(Ae(["point","band"],u)){const f=a8(e,n,i.view);if(Cr(f))return{step:o8(f,t,e)}}return r8(e,t,u)}case gs:case ml:return Wce(e,t,u);case bo:{const f=Yce(r,i),d=Vce(r,n,t,i);return ju(u)?Gce(f,d,Hce(u,i,l,e)):[f,d]}case Ai:return[0,Math.PI*2];case Ma:return[0,360];case Xi:return[0,new St(()=>{const f=t.getSignalName(Zn(t.parent)?"child_width":"width"),d=t.getSignalName(Zn(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case ms:return{step:1e3/i.scale.framesPerSecond};case xs:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case vs:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Bn:return"symbol";case In:case Mr:case Or:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case xo:case ys:case bs:return[i.scale.minOpacity,i.scale.maxOpacity]}}function o8(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=nA(n),s=i[o];if(z6({step:e,offsetIsDiscrete:de(s)&&UN(s.type)})==="offset"&&v6(i,o)){const u=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${hre(f)})`}}else return e.step}function s8(e,t){if(z6({step:e,offsetIsDiscrete:Tt(t)})==="offset")return{step:e.step}}function Wce(e,t,n){const i=e===gs?"x":"y",r=t.getScaleComponent(i);if(!r)return r8(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=a8(i,t.size,t.config.view);if(Cr(l)){const c=s8(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=PN(l.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ss({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Q(f)?`${f.signal}/2${h}`:`${f/2+d}`,g=Q(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return YR(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function a8(e,t,n){const i=e===et?"width":"height",r=t[i];return r||Mp(n,i)}function Hce(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&X(n)?n.length+1:(j(xoe(i)),3)}}function Gce(e,t,n){const i=()=>{const r=Oi(t),o=Oi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return Q(t)?new St(i):{signal:i()}}function Yce(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(m0("size",e))}const lF=.95;function Vce(e,t,n,i){const r={x:uF(n,"x"),y:uF(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=cF(t,r,i.view);return Ze(o)?o-1:new St(()=>`${o.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 o=cF(t,r,i.view);return Ze(o)?Math.pow(lF*o,2):new St(()=>`pow(${lF} * ${o.signal}, 2)`)}}throw new Error(m0("size",e))}function cF(e,t,n){const i=Cr(e.width)?e.width.step:Mb(n,"width"),r=Cr(e.height)?e.height.step:Mb(n,"height");return t.x||t.y?new St(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function u8(e,t){it(e)?Xce(e,t):c8(e,t)}function Xce(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of z(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=vt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Fb(h,t),y=YN(a,t);if(d!==void 0&&(m?y&&j(y):j(_N(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,x=f.type;switch(t){case"domainMax":case"domainMin":La(u[t])||x==="temporal"||b?l.set(t,{signal:$0(u[t],{type:x,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(fF,t)?fF[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:E6(r,a),hasSecondaryRangeChannel:!!r[Rr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const fF={bins:({model:e,fieldOrDatumDef:t})=>q(t)?Kce(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Jce(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>Qce(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Zce(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>efe(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>tfe(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=q(e)?e.sort:void 0;return nfe(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>ife(e,t,n,i,r,o.scale,s)};function l8(e){it(e)?zce(e):c8(e,"range")}function c8(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?l8(i):u8(i,t);for(const i of z(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=as(r,a,t,"scale",e4((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Kce(e,t){const n=t.bin;if(Ye(n)){const i=ow(e,t.field,n);return new St(()=>e.getSignalName(i))}else if(Nt(n)&&Ra(n)&&n.step!==void 0)return{step:n.step}}function Jce(e,t){if(Ae([In,Mr,Or],e)&&t!=="nominal")return"hcl"}function Qce(e,t,n,i,r,o){if(!(ji(o)?.bin||X(n)||r!=null||i!=null||Ae([Pt.TIME,Pt.UTC],e)))return dt(t)?!0:void 0}function Zce(e,t,n,i,r,o){if(dt(e)){if(cr(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=r;if(s==="bar"&&!(q(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===Pt.POINT)return n.pointPadding}}function efe(e,t,n,i,r,o=!1){if(e===void 0){if(dt(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return o?c:ft(s,n==="bar"?a:n==="tick"?l:u)}else if(Hf(t)&&i===Pt.BAND)return r.offsetBandPaddingInner}}function tfe(e,t,n,i,r,o=!1){if(e===void 0){if(dt(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=r;if(o)return a;if(n===Pt.BAND)return ft(s,Q(i)?{signal:`${i.signal}/2`}:i/2)}else if(Hf(t)){if(n===Pt.POINT)return .5;if(n===Pt.BAND)return r.offsetBandPaddingOuter}}}function nfe(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return zi(e)&&t==="descending"?Q(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(zi(e)&&t==="descending")return!0}function ife(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&zi(r)){if(X(n)){const u=n[0],l=n[n.length-1];if(Ze(u)&&u<=0&&Ze(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ju(r))return!0;if(!(q(t)&&t.bin)&&Ae([...vo,...Yie],e)){const{orient:u,type:l}=i;return Ae(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:Ae(["bar","area"],l)&&!s?!0:o?.zero}return!1}function rfe(e,t,n,i,r=!1){const o=ofe(t,n,i,r),{type:s}=e;return Nr(t)?s!==void 0?nse(t,s)?q(n)&&!tse(s,n.type)?(j(ioe(s,o)),o):s:(j(noe(t,s,o)),o):o:null}function ofe(e,t,n,i){switch(t.type){case"nominal":case"ordinal":{if(gu(e)||l1(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(c1(e,"ordinal")),"ordinal";if(u1(e))return"band";if(dt(e)||Hf(e)){if(Ae(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in oA)return"band";const r=n[zn(e)];return ya(r)||Wu(t)&&t.axis?.tickBand?"band":"point"}case"temporal":return gu(e)?"time":l1(e)==="discrete"?(j(c1(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&Dt(t.timeUnit).utc?"utc":u1(e)?"band":"time";case"quantitative":return gu(e)?q(t)&&Ye(t.bin)?"bin-ordinal":"linear":l1(e)==="discrete"?(j(c1(e,"quantitative")),"ordinal"):u1(e)?"band":"linear";case"geojson":return}throw new Error(CN(t.type))}function sfe(e,{ignoreRange:t}={}){f8(e),t8(e);for(const n of ese)u8(e,n);t||l8(e)}function f8(e){it(e)?e.component.scales=afe(e):e.component.scales=lfe(e)}function afe(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of sA){const s=vt(t[o]);if(s&&n===KN&&o===Bn&&s.type===yl)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??={};const u=E6(t,o),l=rfe(a,o,s,i,u);r[o]=new i8(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const ufe=e4((e,t)=>b$(e)-b$(t));function lfe(e){const t=e.component.scales={},n={},i=e.component.resolve;for(const r of e.children){f8(r);for(const o of z(r.component.scales))if(i.scale[o]??=j4(o,e),i.scale[o]==="shared"){const s=n[o],a=r.component.scales[o].getWithExplicit("type");s?Woe(s.value,a.value)?n[o]=as(s,a,"type","scale",ufe):(i.scale[o]="independent",delete n[o]):n[o]=a}}for(const r of z(n)){const o=e.scaleName(r,!0),s=n[r];t[r]=new i8(o,s);for(const a of e.children){const u=a.component.scales[r];u&&(a.renameScale(u.get("name"),o),u.merged=!0)}}return t}class A1{nameMap;constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function it(e){return e?.type==="unit"}function Zn(e){return e?.type==="facet"}function cw(e){return e?.type==="concat"}function Al(e){return e?.type==="layer"}class fw{type;parent;config;name;size;title;description;data;transforms;layout;scaleNameMap;projectionNameMap;signalNameMap;component;view;constructor(t,n,i,r,o,s,a){this.type=n,this.parent=i,this.config=o,this.parent=i,this.config=o,this.view=Lt(a),this.name=t.name??r,this.title=Mo(t.title)?{text:t.title}:t.title?Lt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new A1,this.projectionNameMap=i?i.projectionNameMap:new A1,this.signalNameMap=i?i.signalNameMap:new A1,this.data=t.data,this.description=t.description,this.transforms=gue(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:xae(t,n,o),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:C0(t)||i?.component.data.isFaceted&&t.data===void 0},layoutSize:new Ao,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?fe(s):{}},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(){sfe(this)}parseProjection(){Q4(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Y4(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of z(i)){const s=i[o];s!==void 0&&(r[o]=Ke(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ke(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ge(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=Dle(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of fi)t[i].title&&n.push(Cle(this,i));for(const i of tw)n=n.concat(Sle(this,i));return n}assembleAxes(){return fle(this.component.axes,this.config)}assembleLegends(){return X4(this)}assembleProjections(){return Zle(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...gN(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return Ae(["unit","layer"],this.type)?Ae(["middle",void 0],i.anchor)&&(i.frame??="group"):i.anchor??="start",Ge(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Zn(this.parent)?n8(this):[];r.length>0&&(n.scales=r);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return Qe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(rt[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Zn(this.parent)){const n=z4(t),i=h0(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(Tt(o)&&Na(s)){const a=r.get("name"),u=B0(this,i),l=lw(u);if(l){const c=G({aggregate:"distinct",field:l},{expr:"datum"});return{signal:B4(a,r,c)}}else return j(lA(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(aN(t)&&Nr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(bre(n));return i}hasAxisOrientSignalRef(){return this.component.axes.x?.some(t=>t.hasOrientSignalRef())||this.component.axes.y?.some(t=>t.hasOrientSignalRef())}}class d8 extends fw{vgField(t,n={}){const i=this.fieldDef(t);if(i)return G(i,n)}reduceFieldDef(t,n){return Vse(this.getMapping(),(i,r,o)=>{const s=ji(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){PA(this.getMapping(),(i,r)=>{const o=ji(i);o&&t(o,r)},n)}}class z0 extends je{transform;clone(){return new z0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${we(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class U0 extends je{transform;clone(){return new U0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${we(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class j0 extends je{transform;clone(){return new j0(this.parent,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((o,s)=>r[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${we(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class q0 extends je{transform;clone(){return new q0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${we(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class bu extends je{fields;geojson;signal;clone(){return new bu(null,fe(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Ji,Ki],[vi,Qi]]){const o=r.map(s=>{const a=vt(n.encoding[s]);return q(a)?a.field:Lr(a)?{expr:`${a.datum}`}:Ui(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new bu(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Bn)){const r=n.typedFieldDef(Bn);r.type===yl&&(t=new bu(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(he);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${we(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}]}}class of extends je{projection;fields;as;clone(){return new of(null,this.projection,fe(this.fields),fe(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Ji,Ki],[vi,Qi]]){const r=i.map(s=>{const a=vt(n.encoding[s]);return q(a)?a.field:Lr(a)?{expr:`${a.datum}`}:Ui(a)?{expr:`${a.value}`}:void 0}),o=i[0]===vi?"2":"";(r[0]||r[1])&&(t=new of(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(he))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${we(this.fields)} ${we(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Qs extends je{transform;clone(){return new Qs(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Qs(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,o=i.y;if(q(r)&&q(o)){const s=r.impute?r:o.impute?o:void 0;if(s===void 0)return;const a=r.impute?o:o.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=s.impute,d=C6(n.mark,i);return new Qs(t,{impute:s.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${we(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:o,value:s,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Kae(i)?this.processSequence(i):i}:{},method:"value",...o?{groupby:o}:{},value:!r||r==="value"?s:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class W0 extends je{transform;clone(){return new W0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${we(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class sf extends je{transform;secondary;clone(){return new sf(null,fe(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const o=n.component.data.sources,{from:s}=i;let a=null;if(Jae(s)){let u=g8(s.data,o);u||(u=new Ea(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new Rn(u,l,rt.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Qae(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Qe(u),u)}catch{throw new Error(Are(u))}if(a=l.materialized,!a)throw new Error(wre(u))}return new sf(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?ct(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${we({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:ct(this.transform.as)}:{}};else{let n=this.transform.as;he(n)||(j(Rre),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class H0 extends je{transform;clone(){return new H0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${we(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class G0 extends je{transform;clone(){return new G0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=fe(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${we(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Y0 extends je{transform;clone(){return new Y0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=lr((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${we(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:o}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...o!==void 0?{op:o}:{},...i!==void 0?{groupby:i}:{}}}}class V0 extends je{transform;clone(){return new V0(null,fe(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${we(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function h8(e){let t=0;function n(i,r){if(i instanceof Ea&&!i.isGenerator&&!Gu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof tn&&(i.parent instanceof Ea&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof vl){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof td||i instanceof nd||i instanceof Ju||i instanceof xl||i instanceof Vu||i instanceof of||i instanceof Li||i instanceof sf||i instanceof El||i instanceof za||i instanceof q0||i instanceof j0||i instanceof z0||i instanceof W0||i instanceof H0||i instanceof G0||i instanceof us||i instanceof V0||i instanceof Y0||i instanceof U0)&&r.transform.push(i.assemble()),(i instanceof gr||i instanceof hr||i instanceof Qs||i instanceof so||i instanceof bu)&&r.transform.push(...i.assemble()),i instanceof Rn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Rn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof Rn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const s of i.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function cfe(e){const t=[],n=h8(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function ffe(e,t){const n=[],i=h8(n);let r=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${r++}`);const a=s.assemble();i(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function dfe(e){return e==="top"||e==="left"||Q(e)?"header":"footer"}function hfe(e){for(const t of fi)pfe(e,t);dF(e,"x"),dF(e,"y")}function pfe(e,t){const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const s=n[t],a=Ku("title",null,i,t);let u=mu(s,i,{allowDisabling:!0,includeDefault:a===void 0||!!a});r.component.layoutHeaders[t].title&&(u=X(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const l=Ku("labelOrient",s.header,i,t),c=s.header!==null?ft(s.header?.labels,i.header.labels,!0):!1,f=Ae(["bottom","right"],l)?"footer":"header";o.layoutHeaders[t]={title:s.header!==null?u:null,facetFieldDef:s,[f]:t==="facet"?[]:[p8(e,t,c)]}}}function p8(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function dF(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=rw(r,t),r.axis[t]==="shared"){const o=t==="x"?"column":"row",s=i[o];for(const a of n.component.axes[t]){const u=dfe(a.get("orient"));s[u]??=[p8(e,o,!1)];const l=pc(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function gfe(e){dw(e),Lp(e,"width"),Lp(e,"height")}function mfe(e){dw(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Lp(e,t),Lp(e,n)}function dw(e){for(const t of e.children)t.parseLayoutSize()}function Lp(e,t){const n=z4(t),i=h0(n),r=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??j4(i,e);if(l==="independent"&&u.value==="step"){s=void 0;break}if(s){if(l==="independent"&&s.value!==u.value){s=void 0;break}s=as(s,u,n,"")}else s=u}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function yfe(e){const{size:t,component:n}=e;for(const i of vo){const r=zn(i);if(t[r]){const o=t[r];n.layoutSize.set(r,Cr(o)?"step":o,!0)}else{const o=bfe(e,r);n.layoutSize.set(r,o,!1)}}}function bfe(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const o=r.get("type"),s=r.get("range");if(Tt(o)){const a=Mp(i.view,t);return Na(s)||Cr(a)?"step":a}else return Tb(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Tb(i.view,t);{const o=Mp(i.view,t);return Cr(o)?o.step:o}}}function Xb(e,t,n){return G(t,{suffix:`by_${G(e)}`,...n})}class Dc extends d8{facet;child;children;constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=yw(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Xf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=z(t),i={};for(const r of n){if(![no,io].includes(r)){j(m0(r,"facet"));break}const o=t[r];if(o.field===void 0){j(_b(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=LA(t,n);return i.header?i.header=Lt(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return U(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=X0(this),this.child.parseData()}parseLayoutSize(){dw(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,gt(this.component.selection).some(t=>pr(t))&&fA(cA)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),hfe(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of fi)for(const i of nw){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=Ku("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=P0(n,a);t.titleAnchor??={},t.titleAnchor[u]="end"}}if(o?.[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??={},t[u][n]=.5),r.title&&(t.offset??={},t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Dc))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Dc?{...this.channelHasField("column")?{encode:{update:{columns:{field:G(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof Dc){if(this.child.channelHasField("column")){const r=G(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of vo){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Tt(s)&&Na(a)){const u=B0(this.child,r),l=lw(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(lA(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of fi){const f=this.facet[c];if(f){u.push(G(f));const{bin:d,sort:h}=f;if(Ye(d)&&u.push(G(f,{binSuffix:"end"})),ro(h)){const{field:p,op:g=w0}=h,m=Xb(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(X(h)){const p=Xu(f,c);o.push(p),s.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?ro(i.sort)?[Xb(i,i.sort,{expr:"datum"})]:X(i.sort)?[Xu(i,t,{expr:"datum"})]:[G(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(ro(r)?r.order:!X(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:n}=this;if(t.facet)return jb(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const r of tw)if(t[r]){const o=Ku("labelOrient",t[r]?.header,n,r);if(i[r].includes(o))return jb(t[r],r,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=cfe(n),r=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:fi.map(u=>this.facetSortFields(u)).flat(),order:fi.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Rue(this,[]))}]}getMapping(){return this.facet}}function xfe(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(ro(o.sort)){const{field:s,op:a=w0}=o.sort;e=r=new za(e,{joinaggregate:[{op:a,field:s,as:Xb(o,o.sort,{forAs:!0})}],groupby:[G(o)]})}return r}return null}function g8(e,t){for(const n of t){const i=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,o=i.format?.feature;if(r&&o)continue;const s=e.format?.feature;if((s||o)&&s!==o)continue;const a=i.format?.mesh;if(!((r||a)&&r!==a)){if(rf(e)&&rf(i)){if(Vn(e.values,i.values))return n}else if(Gu(e)&&Gu(i)){if(e.url===i.url)return n}else if(t4(e)&&e.name===n.dataName)return n}}return null}function vfe(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Ea({values:[]});return t.push(i),i}const n=g8(e.data,t);if(n)return Xo(e.data)||(n.data.format=VR({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Ea(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Efe(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(uue(r))s=e=new Vu(e,r),o="derived";else if(VA(r)){const a=dce(r);s=e=tn.makeWithAncestors(e,{},a,n)??e,e=new xl(e,t,r.filter)}else if(K6(r))s=e=gr.makeFromTransform(e,r,t),o="number";else if(cue(r))o="date",n.getWithExplicit(r.field).value===void 0&&(e=new tn(e,{[r.field]:o}),n.set(r.field,o,!1)),s=e=hr.makeFromTransform(e,r);else if(fue(r))s=e=Li.makeFromTransform(e,r),o="number",ew(t)&&(e=new us(e));else if(X6(r))s=e=sf.make(e,t,r,i++),o="derived";else if(oue(r))s=e=new El(e,r),o="number";else if(sue(r))s=e=new za(e,r),o="number";else if(due(r))s=e=so.makeFromTransform(e,r),o="derived";else if(hue(r))s=e=new q0(e,r),o="derived";else if(pue(r))s=e=new U0(e,r),o="derived";else if(aue(r))s=e=new j0(e,r),o="derived";else if(Zae(r))s=e=new Y0(e,r),o="derived";else if(rue(r))e=new V0(e,r);else if(lue(r))s=e=Qs.makeFromTransform(e,r),o="derived";else if(eue(r))s=e=new z0(e,r),o="derived";else if(tue(r))s=e=new H0(e,r),o="derived";else if(nue(r))s=e=new G0(e,r),o="derived";else if(iue(r))s=e=new W0(e,r),o="derived";else{j(Ore(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function X0(e){let t=vfe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(Xo(r)||Gu(r)||rf(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new _ue;Xo(r)?(n4(r)?t=new nd(t,r.sequence):XA(r)&&(t=new td(t,r.graticule)),s.parseNothing=!0):r?.format?.parse===null&&(s.parseNothing=!0),t=tn.makeExplicit(t,e,s)??t,t=new us(t);const a=e.parent&&Al(e.parent);(it(e)||Zn(e))&&a&&(t=gr.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Efe(t,e,s));const u=pce(e),l=hce(e);t=tn.makeWithAncestors(t,{},{...u,...l},s)??t,it(e)&&(t=bu.parseAll(t,e),t=of.parseAll(t,e)),(it(e)||Zn(e))&&(a||(t=gr.makeFromEncoding(t,e)??t),t=hr.makeFromEncoding(t,e)??t,t=Vu.parseAllForSortIndex(t,e));const c=t=Md(rt.Raw,e,t);if(it(e)){const m=Li.makeFromEncoding(t,e);m&&(t=m,ew(e)&&(t=new us(t))),t=Qs.makeFromEncoding(t,e)??t,t=so.makeFromEncoding(t,e)??t}let f,d;if(it(e)){const{markDef:m,mark:y,config:b}=e,x=Le("invalid",m,b),{marks:v,scales:A}=d=r4({invalid:x,isPath:As(y)});v!==A&&A==="include-invalid-values"&&(f=t=Md(rt.PreFilterInvalid,e,t)),v==="exclude-invalid-values"&&(t=Ju.make(t,e,d)??t)}const h=t=Md(rt.Main,e,t);let p;if(it(e)&&d){const{marks:m,scales:y}=d;m==="include-invalid-values"&&y==="exclude-invalid-values"&&(t=Ju.make(t,e,d)??t,p=t=Md(rt.PostFilterInvalid,e,t))}it(e)&&lle(e,h);let g=null;if(Zn(e)){const m=e.getName("facet");t=xfe(t,e.facet)??t,g=new vl(t,e,m,h.getSource()),n[m]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function Md(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new Rn(n,o,e,r);return i[o]=s,s}class Afe extends fw{children;constructor(t,n,i,r){super(t,"concat",n,i,r,t.resolve),(t.resolve?.axis?.x==="shared"||t.resolve?.axis?.y==="shared")&&j(Dre),this.children=this.getChildren(t).map((o,s)=>yw(o,this,this.getName(`concat_${s}`),void 0,r))}parseData(){this.component.data=X0(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of z(t.component.selection))this.component.selection[n]=t.component.selection[n]}gt(this.component.selection).some(t=>pr(t))&&fA(cA)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return D0(t)?t.vconcat:GA(t)?t.hconcat:t.concat}parseLayoutSize(){mfe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=iw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function wfe(e){return e===!1||e===null}const Cfe={disable:1,gridScale:1,scale:1,...b6,labelExpr:1,encode:1},m8=z(Cfe);class hw extends Ao{explicit;implicit;mainExtracted;constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new hw(fe(this.explicit),fe(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!wfe(this.get(t))}hasOrientSignalRef(){return Q(this.explicit.orient)}}function Sfe(e,t,n){const{encoding:i,config:r}=e,o=vt(i[t])??vt(i[Rr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(ba(u))return{text:Ri({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(qu(o)==="quantitative"){if(Wu(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Ri({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Ri({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(qu(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:Ri({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function _fe(e){return vo.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Ofe(n,e)]),t),{})}const $fe={bottom:"top",top:"bottom",left:"right",right:"left"};function Ffe(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const o of z(r.component.axes))n.axis[o]=rw(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=kfe(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of vo){for(const o of e.children)if(o.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const s of o.component.axes[r]){const{value:a,explicit:u}=s.getWithExplicit("orient");if(!Q(a)){if(i[a]>0&&!u){const l=$fe[a];i[a]>i[l]&&s.set("orient",l,!1)}i[a]++}}}delete o.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[o,s]of(t[r]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function kfe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],o=t[i];if(!!r!=!!o)return;if(r&&o){const s=r.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value)return;e[i]=Dfe(r,o)}}}else return t.map(n=>n.clone());return e}function Dfe(e,t){for(const n of m8){const i=as(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return AN(r,o);case"gridScale":return{explicit:r.explicit,value:ft(r.value,o.value)}}return M0(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function Tfe(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Q(n.labelAngle)?n.labelAngle:tf(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===N4(i,r))return!0}return e===n[t]}const Mfe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Ofe(e,t){let n=t.axis(e);const i=new hw,r=vt(t.encoding[e]),{mark:o,config:s}=t,a=n?.orient||s[e==="x"?"axisX":"axisY"]?.orient||s.axis?.orient||xle(e),u=t.getScaleComponent(e).get("type"),l=dle(e,u,a,t.config),c=n!==void 0?!n:zb("disable",s.style,n?.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=mle(r,n,e,s.style,l),d=r6(n.formatType,r,u),h=i6(r,r.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const y of m8){const b=y in Q$?Q$[y](p):S$(y)?n[y]:void 0,x=b!==void 0,v=Tfe(b,y,n,t,e);if(x&&v)i.set(y,b,v);else{const{configValue:A=void 0,configFrom:w=void 0}=S$(y)&&y!=="values"?zb(y,s.style,n.style,l):{},E=A!==void 0;x&&!E?i.set(y,b,v):(w!=="vgAxisConfig"||Mfe.has(y)&&E||Zf(A)||Q(A))&&i.set(y,A,!1)}}const g=n.encoding??{},m=y6.reduce((y,b)=>{if(!i.hasAxisPart(b))return y;const x=U4(g[b]??{},t),v=b==="labels"?Sfe(t,e,x):x;return v!==void 0&&!Ge(v)&&(y[b]={update:v}),y},{});return Ge(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function Rfe({encoding:e,size:t}){for(const n of vo){const i=zn(n);Cr(t[i])&&qo(e[n])&&(delete t[i],j($N(i)))}return t}const Nfe={vgMark:"arc",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...xn("x",e,{defaultPos:"mid"}),...xn("y",e,{defaultPos:"mid"}),...fo(e,"radius"),...fo(e,"theta")})},Lfe={vgMark:"area",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Op("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Op("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...ZA(e)})},Pfe={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},Ife={vgMark:"shape",encodeEntry:e=>({...wi(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&&q(n)&&n.type===yl?{field:G(n,{expr:"datum"})}:{}}]}},Bfe={vgMark:"image",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y"),...JA(e,"url")})},zfe={vgMark:"line",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...xn("x",e,{defaultPos:"mid"}),...xn("y",e,{defaultPos:"mid"}),...It("size",e,{vgChannel:"strokeWidth"}),...ZA(e)})},Ufe={vgMark:"trail",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...xn("x",e,{defaultPos:"mid"}),...xn("y",e,{defaultPos:"mid"}),...It("size",e),...ZA(e)})};function pw(e,t){const{config:n}=e;return{...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...xn("x",e,{defaultPos:"mid"}),...xn("y",e,{defaultPos:"mid"}),...It("size",e),...It("angle",e),...jfe(e,n,t)}}function jfe(e,t,n){return n?{shape:{value:n}}:It("shape",e)}const qfe={vgMark:"symbol",encodeEntry:e=>pw(e)},Wfe={vgMark:"symbol",encodeEntry:e=>pw(e,"circle")},Hfe={vgMark:"symbol",encodeEntry:e=>pw(e,"square")},Gfe={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},Yfe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Op("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Op("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...It("size",e,{vgChannel:"strokeWidth"})}}},Vfe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...wi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...xn("x",e,{defaultPos:"mid"}),...xn("y",e,{defaultPos:"mid"}),...JA(e),...It("size",e,{vgChannel:"fontSize"}),...It("angle",e),...V$("align",Xfe(e.markDef,n,t)),...V$("baseline",Kfe(e.markDef,n,t)),...xn("radius",e,{defaultPos:null}),...xn("theta",e,{defaultPos:null})}}};function Xfe(e,t,n){if(Le("align",e,n)===void 0)return"center"}function Kfe(e,t,n){if(Le("baseline",e,n)===void 0)return"middle"}const Jfe={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",o=i==="horizontal"?"y":"x",s=i==="horizontal"?"height":"width";return{...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,r),...xn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ke(Le("thickness",n,t))}}},Od={arc:Nfe,area:Lfe,bar:Pfe,circle:Wfe,geoshape:Ife,image:Bfe,line:zfe,point:qfe,rect:Gfe,rule:Yfe,square:Hfe,text:Vfe,tick:Jfe,trail:Ufe};function Qfe(e){if(Ae([E0,x0,sse],e.mark)){const t=C6(e.mark,e.encoding);if(t.length>0)return Zfe(e,t)}else if(e.mark===v0){const t=Cb.some(n=>Le(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return ede(e)}return gw(e)}const hF="faceted_path_";function Zfe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:hF+e.requestDataName(rt.Main),data:e.requestDataName(rt.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:gw(e,{fromPrefix:hF})}]}const pF="stack_group_";function ede(e){const[t]=gw(e,{fromPrefix:pF}),n=e.scaleName(e.stack.fieldChannel),i=(l={})=>e.vgField(e.stack.fieldChannel,l),r=(l,c)=>{const f=[i({prefix:"min",suffix:"start",expr:c}),i({prefix:"max",suffix:"start",expr:c}),i({prefix:"min",suffix:"end",expr:c}),i({prefix:"max",suffix:"end",expr:c})];return`${l}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...Pu(t.encode.update,["y","yc","y2","height",...Cb]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Qn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...Pu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Qn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of Cb){const c=Ar(l,e.markDef,e.config);t.encode.update[l]?(o[l]=t.encode.update[l],delete t.encode.update[l]):c&&(o[l]=Ke(c)),c&&(t.encode.update[l]={value:0})}const a=[];if(e.stack.groupbyChannels?.length>0)for(const l of e.stack.groupbyChannels){const c=e.fieldDef(l),f=G(c);f&&a.push(f),(c?.bin||c?.timeUnit)&&a.push(G(c,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,c)=>{if(t.encode.update[c])return{...l,[c]:t.encode.update[c]};{const f=Ar(c,e.markDef,e.config);return f!==void 0?{...l,[c]:Ke(f)}:l}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(rt.Main),name:pF+e.requestDataName(rt.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function tde(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!X(s)&&Ui(s)&&Ab(s.value)||!s&&Ab(Le("order",r,o)))){if((X(s)||q(s))&&!n)return xN(s,{expr:"datum"});if(As(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function gw(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=ft(i.clip,nde(e),ide(e)),a=yN(i),u=r.key,l=tde(e),c=rde(e);c&&Object.values(e.component.selection).some(h=>h.type==="point"&&!h.bind&&h.on!=="pointerover")&&(e.markDef.cursor??="pointer");const f=Le("aria",i,o),d=Od[n].postEncodingTransform?Od[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Od[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(rt.Main)},encode:{update:Od[n].encodeEntry(e)},...d?{transform:d}:{}}]}function nde(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t?.get("selectionExtent")||n?.get("selectionExtent")?!0:void 0}function ide(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function rde(e){if(!e.component.selection)return null;const t=z(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=z(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class y8 extends d8{markDef;encoding;specifiedScales={};stack;specifiedAxes={};specifiedLegends={};specifiedProjection={};selection=[];children=[];constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,$$(t)?t.view:void 0);const s=wr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=jae(s,o,{graticule:t.data&&XA(t.data)}));const u=this.encoding=Gse(t.encoding||{},a,s.filled,o);this.markDef=H6(s,u,o),this.size=Rfe({encoding:u,size:$$(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=W6(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>WA(l)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:t}=this,n=this.mark===KN,i=t&&Iie.some(r=>de(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return sA.reduce((i,r)=>{const o=vt(n[r]);return o&&(i[r]=this.initScale(o.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=Lt(t);return X(n)&&(r.domain=n.map(Gn)),X(i)&&(r.range=i.map(Gn)),r}initAxes(t){return vo.reduce((n,i)=>{const r=t[i];if(de(r)||i===et&&de(t.x2)||i===Ot&&de(t.y2)){const o=de(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=z(t),i={};for(const r of n){const o=t[r];i[r]=Zf(o)?mN(o):Gn(o)}return i}initLegends(t){return Xie.reduce((n,i)=>{const r=vt(t[i]);if(r&&Jie(i)){const o=r.legend;n[i]=o&&Lt(o)}return n},{})}alignStackOrderWithColorDomain(){const{color:t,fill:n,order:i,xOffset:r,yOffset:o}=this.encoding,s=n||t,a=q(s)?s:void 0,u=a?.field,l=a?.scale,c=a?.type,f=l?.domain,d=r||o,h=q(d)?d:void 0,p=`_${u}_sort_index`;if(!i&&Array.isArray(f)&&typeof u=="string"&&c==="nominal")if(h&&!h.sort)h.sort=f;else{const g=`indexof(${Fe(f)}, datum['${u}'])`,m=this.markDef?.orient==="horizontal"?"ascending":"descending";this.transforms.push({calculate:g,as:p}),this.encoding.order={field:p,type:"quantitative",sort:m}}}parseData(){this.component.data=X0(this)}parseLayoutSize(){yfe(this)}parseSelections(){this.component.selection=ule(this,this.selection)}parseMarkGroup(){this.component.mark=Qfe(this)}parseAxesAndHeaders(){this.component.axes=_fe(this)}assembleSelectionTopLevelSignals(t){return Nue(this,t)}assembleSignals(){return[...M4(this),...Oue(this,[])]}assembleSelectionData(t){return Lue(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return iw(this)}correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data),"time"in this.encoding&&(t.from.data=t.from.data+s4)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t);assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Al(this.parent))&&(t=c4(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Ks(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ji(n)}typedFieldDef(t){const n=this.fieldDef(t);return Sn(n)?n:null}}class mw extends fw{children;constructor(t,n,i,r,o){super(t,"layer",n,i,o,t.resolve,t.view);const s={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(T0(a))return new mw(a,this,this.getName(`layer_${u}`),s,o);if(Eo(a))return new y8(a,this,this.getName(`layer_${u}`),s,o);throw new Error(uA(a))})}parseData(){this.component.data=X0(this);for(const t of this.children)t.parseData()}parseLayoutSize(){gfe(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of z(t.component.selection))this.component.selection[n]=t.component.selection[n]}gt(this.component.selection).some(t=>pr(t))&&fA(cA)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Ffe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),M4(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),iw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of ct(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Pue(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),X4(this))}}function yw(e,t,n,i,r){if(C0(e))return new Dc(e,t,n,r);if(T0(e))return new mw(e,t,n,i,r);if(Eo(e))return new y8(e,t,n,i,r);if(mae(e))return new Afe(e,t,n,r);throw new Error(uA(e))}function ode(e,t={}){t.logger&&voe(t.logger),t.fieldTitle&&p6(t.fieldTitle);try{const n=q6(zR(t.config,e.config)),i=Z6(e,n),r=yw(i,null,"",void 0,n);return r.parse(),kce(r.component.data,r),{spec:ade(r,sde(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Eoe(),t.fieldTitle&&Pse()}}function sde(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):he(t)&&(t={type:t}),r&&o&&wue(t.type)){if(r==="step"&&o==="step")j(f$()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(f$(h0(s)));const a=s==="width"?"height":"width";t.type=Cue(a)}}return{...z(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...B$(n,!1),...B$(e,!0)}}function ade(e,t,n={},i){const r=e.config?Dae(e.config):void 0,o=ffe(e.component.data,n),s=e.assembleSelectionData(o),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:s,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...B6(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const ude=Mie.version,lde=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Bu,accessPathWithDatum:QE,accessWithDatumToUnescapedPath:Be,compile:ode,contains:Ae,deepEqual:Vn,deleteNestedProperty:wp,duplicate:fe,entries:rs,every:XE,fieldIntersection:JE,flatAccessWithDatum:KR,getFirstDefined:ft,hasIntersection:KE,hasProperty:U,hash:we,internalField:eN,isBoolean:ef,isEmpty:Ge,isEqual:Rie,isInternalField:tN,isNullOrFalse:Ab,isNumeric:a0,keys:z,logicalExpr:Fc,mergeDeep:VR,never:YR,normalize:Z6,normalizeAngle:tf,omit:Qn,pick:Pu,prefixGenerator:wb,removePathFromField:gl,replaceAll:da,replacePathInField:xi,resetIdCounter:Lie,setEqual:XR,some:Iu,stringify:Pe,titleCase:jf,unescapeSingleQuoteAndPathDot:JR,unique:lr,uniqueId:ZR,vals:gt,varName:Qe,version:ude},Symbol.toStringTag,{value:"Module"}));function b8(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var cde="3.0.0",fde={version:cde};const Za="#fff",gF="#888",dde={background:"#333",view:{stroke:gF},title:{color:Za,subtitleColor:Za},style:{"guide-label":{fill:Za},"guide-title":{fill:Za}},axis:{domainColor:Za,gridColor:gF,tickColor:Za}},Fs="#4572a7",hde={background:"#fff",arc:{fill:Fs},area:{fill:Fs},line:{stroke:Fs,strokeWidth:2},path:{stroke:Fs},rect:{fill:Fs},shape:{stroke:Fs},symbol:{fill:Fs,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},ks="#30a2da",w1="#cbcbcb",pde="#999",gde="#333",mF="#f0f0f0",yF="#333",mde={arc:{fill:ks},area:{fill:ks},axis:{domainColor:w1,grid:!0,gridColor:w1,gridWidth:1,labelColor:pde,labelFontSize:10,titleColor:gde,tickColor:w1,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:mF,group:{fill:mF},legend:{labelColor:yF,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:yF,titleFontSize:14,titlePadding:10},line:{stroke:ks,strokeWidth:2},path:{stroke:ks,strokeWidth:.5},rect:{fill:ks},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:ks},bar:{binSpacing:2,fill:ks,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Ds="#000",yde={group:{fill:"#e5e5e5"},arc:{fill:Ds},area:{fill:Ds},line:{stroke:Ds},path:{stroke:Ds},rect:{fill:Ds},shape:{stroke:Ds},symbol:{fill:Ds,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},bde=22,xde="normal",bF="Benton Gothic, sans-serif",xF=11.5,vde="normal",Ts="#82c6df",C1="Benton Gothic Bold, sans-serif",vF="normal",EF=13,Wl={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},Ede={background:"#ffffff",title:{anchor:"start",color:"#000000",font:C1,fontSize:bde,fontWeight:xde},arc:{fill:Ts},area:{fill:Ts},line:{stroke:Ts,strokeWidth:2},path:{stroke:Ts},rect:{fill:Ts},shape:{stroke:Ts},symbol:{fill:Ts,size:30},axis:{labelFont:bF,labelFontSize:xF,labelFontWeight:vde,titleFont:C1,titleFontSize:EF,titleFontWeight:vF},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:bF,labelFontSize:xF,symbolType:"square",titleFont:C1,titleFontSize:EF,titleFontWeight:vF},range:{category:Wl["category-6"],diverging:Wl["fireandice-6"],heatmap:Wl["fire-7"],ordinal:Wl["fire-7"],ramp:Wl["fire-7"]}},Ms="#ab5787",Rd="#979797",Ade={background:"#f9f9f9",arc:{fill:Ms},area:{fill:Ms},line:{stroke:Ms},path:{stroke:Ms},rect:{fill:Ms},shape:{stroke:Ms},symbol:{fill:Ms,size:30},axis:{domainColor:Rd,domainWidth:.5,gridWidth:.2,labelColor:Rd,tickColor:Rd,tickWidth:.2,titleColor:Rd},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Os="#3e5c69",wde={background:"#fff",arc:{fill:Os},area:{fill:Os},line:{stroke:Os},path:{stroke:Os},rect:{fill:Os},shape:{stroke:Os},symbol:{fill:Os},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},oi="#1696d2",AF="#000000",Cde="#FFFFFF",Nd="Lato",S1="Lato",Sde="Lato",_de="#DEDDDD",$de=18,Hl={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Fde={background:Cde,title:{anchor:"start",fontSize:$de,font:Nd},axisX:{domain:!0,domainColor:AF,domainWidth:1,grid:!1,labelFontSize:12,labelFont:S1,labelAngle:0,tickColor:AF,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Nd},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:_de,gridWidth:1,labelFontSize:12,labelFont:S1,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Nd,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:S1,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Nd,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Hl["six-groups-cat-1"],diverging:Hl["diverging-colors"],heatmap:Hl["diverging-colors"],ordinal:Hl["six-groups-seq"],ramp:Hl["shades-blue"]},area:{fill:oi},rect:{fill:oi},line:{color:oi,stroke:oi,strokeWidth:5},trail:{color:oi,stroke:oi,strokeWidth:0,size:1},path:{stroke:oi,strokeWidth:.5},point:{filled:!0},text:{font:Sde,color:oi,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:oi,stroke:null}},arc:{fill:oi},shape:{stroke:oi},symbol:{fill:oi,size:30}},Rs="#3366CC",wF="#ccc",Ld="Arial, sans-serif",kde={arc:{fill:Rs},area:{fill:Rs},path:{stroke:Rs},rect:{fill:Rs},shape:{stroke:Rs},symbol:{stroke:Rs},circle:{fill:Rs},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Ld,fontSize:12},"guide-title":{font:Ld,fontSize:12},"group-title":{font:Ld,fontSize:12}},title:{font:Ld,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:wF,tickColor:wF,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},bw=e=>e*(1/3+1),CF=bw(9),SF=bw(10),_F=bw(12),Gl="Segoe UI",$F="wf_standard-font, helvetica, arial, sans-serif",FF="#252423",Yl="#605E5C",kF="transparent",Dde="#C8C6C4",_i="#118DFF",Tde="#12239E",Mde="#E66C37",Ode="#6B007B",Rde="#E044A7",Nde="#744EC2",Lde="#D9B300",Pde="#D64550",x8=_i,v8="#DEEFFF",DF=[v8,x8],Ide=[v8,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",x8],Bde={view:{stroke:kF},background:kF,font:Gl,header:{titleFont:$F,titleFontSize:_F,titleColor:FF,labelFont:Gl,labelFontSize:SF,labelColor:Yl},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Yl,labelFontSize:CF,titleFont:$F,titleColor:FF,titleFontSize:_F,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Dde,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:_i},line:{stroke:_i,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Gl,fontSize:CF,fill:Yl},arc:{fill:_i},area:{fill:_i,line:!0,opacity:.6},path:{stroke:_i},rect:{fill:_i},point:{fill:_i,filled:!0,size:75},shape:{stroke:_i},symbol:{fill:_i,strokeWidth:1.5,size:50},legend:{titleFont:Gl,titleFontWeight:"bold",titleColor:Yl,labelFont:Gl,labelFontSize:SF,labelColor:Yl,symbolType:"circle",symbolSize:75},range:{category:[_i,Tde,Mde,Ode,Rde,Nde,Lde,Pde],diverging:DF,heatmap:DF,ordinal:Ide}},_1='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',zde='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',$1=400,Pd={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Ude=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],jde=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function K0({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=Pd.gridBg[e],r=Pd.textPrimary[e],o=Pd.textSecondary[e],s=n==="dark"?Ude:jde,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:_1,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:zde,labelFontWeight:$1,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Pd.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:_1,fill:o,fontWeight:$1},"guide-title":{font:_1,fill:o,fontWeight:$1}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const qde=K0({theme:"white",background:"#ffffff"}),Wde=K0({theme:"g10",background:"#f4f4f4"}),Hde=K0({theme:"g90",background:"#262626"}),Gde=K0({theme:"g100",background:"#161616"}),Yde=fde.version,Vde=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Wde,carbong100:Gde,carbong90:Hde,carbonwhite:qde,dark:dde,excel:hde,fivethirtyeight:mde,ggplot2:yde,googlecharts:kde,latimes:Ede,powerbi:Bde,quartz:Ade,urbaninstitute:Fde,version:Yde,vox:wde},Symbol.toStringTag,{value:"Module"}));function Xde(e,t,n,i){if(Z(e))return`[${e.map(r=>t(_e(r)?r:TF(r,n))).join(", ")}]`;if(ce(e)){let r="";const{title:o,image:s,...a}=e;o&&(r+=`<h2>${t(o)}</h2>`),s&&(r+=`<img src="${new URL(t(s),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(ce(c)&&(c=TF(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function Kde(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function TF(e,t){return JSON.stringify(e,Kde(t))}var Jde=`#vg-tooltip-element {
|
|
18
|
-
visibility: hidden;
|
|
19
|
-
padding: 8px;
|
|
20
|
-
position: fixed;
|
|
21
|
-
z-index: 1000;
|
|
22
|
-
font-family: sans-serif;
|
|
23
|
-
font-size: 11px;
|
|
24
|
-
border-radius: 3px;
|
|
25
|
-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
|
26
|
-
/* The default theme is the light theme. */
|
|
27
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
28
|
-
border: 1px solid #d9d9d9;
|
|
29
|
-
color: black;
|
|
30
|
-
}
|
|
31
|
-
#vg-tooltip-element.visible {
|
|
32
|
-
visibility: visible;
|
|
33
|
-
}
|
|
34
|
-
#vg-tooltip-element h2 {
|
|
35
|
-
margin-top: 0;
|
|
36
|
-
margin-bottom: 10px;
|
|
37
|
-
font-size: 13px;
|
|
38
|
-
}
|
|
39
|
-
#vg-tooltip-element table {
|
|
40
|
-
border-spacing: 0;
|
|
41
|
-
}
|
|
42
|
-
#vg-tooltip-element table tr {
|
|
43
|
-
border: none;
|
|
44
|
-
}
|
|
45
|
-
#vg-tooltip-element table tr td {
|
|
46
|
-
overflow: hidden;
|
|
47
|
-
text-overflow: ellipsis;
|
|
48
|
-
padding-top: 2px;
|
|
49
|
-
padding-bottom: 2px;
|
|
50
|
-
}
|
|
51
|
-
#vg-tooltip-element table tr td.key {
|
|
52
|
-
color: #808080;
|
|
53
|
-
max-width: 150px;
|
|
54
|
-
text-align: right;
|
|
55
|
-
padding-right: 4px;
|
|
56
|
-
}
|
|
57
|
-
#vg-tooltip-element table tr td.value {
|
|
58
|
-
display: block;
|
|
59
|
-
max-width: 300px;
|
|
60
|
-
max-height: 7em;
|
|
61
|
-
text-align: left;
|
|
62
|
-
}
|
|
63
|
-
#vg-tooltip-element.dark-theme {
|
|
64
|
-
background-color: rgba(32, 32, 32, 0.9);
|
|
65
|
-
border: 1px solid #f5f5f5;
|
|
66
|
-
color: white;
|
|
67
|
-
}
|
|
68
|
-
#vg-tooltip-element.dark-theme td.key {
|
|
69
|
-
color: #bfbfbf;
|
|
70
|
-
}
|
|
71
|
-
`;const E8="vg-tooltip-element",Qde={offsetX:10,offsetY:10,id:E8,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Zde,maxDepth:2,formatTooltip:Xde,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Zde(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function ehe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Jde.toString().replaceAll(E8,e)}function A8(e,t,{offsetX:n,offsetY:i}){const r=w8({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,i),o=["bottom-right","bottom-left","top-right","top-left"];for(const s of o)if(C8(r[s],t))return r[s];return r["top-left"]}function the(e,t,n,i,r){const{position:o,offsetX:s,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=nhe(u,l,n),f=w8(c,i,s,a),d=Array.isArray(o)?o:[o];for(const h of d)if(C8(f[h],i)&&!ihe(t,f[h],i))return f[h];return A8(t,i,r)}function nhe(e,t,n){const i=n.isVoronoi?n.datum.bounds:n.bounds;let r=e.left+t[0]+i.x1,o=e.top+t[1]+i.y1,s=n;for(;s.mark.group;)s=s.mark.group,r+=s.x??0,o+=s.y??0;const a=i.x2-i.x1,u=i.y2-i.y1;return{x1:r,x2:r+a,y1:o,y2:o+u}}function w8(e,t,n,i){const r=(e.x1+e.x2)/2,o=(e.y1+e.y2)/2,s=e.x1-t.width-n,a=r-t.width/2,u=e.x2+n,l=e.y1-t.height-i,c=o-t.height/2,f=e.y2+i;return{top:{x:a,y:l},bottom:{x:a,y:f},left:{x:s,y:c},right:{x:u,y:c},"top-left":{x:s,y:l},"top-right":{x:u,y:l},"bottom-left":{x:s,y:f},"bottom-right":{x:u,y:f}}}function C8(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function ihe(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class rhe{call;options;el;constructor(t){this.options={...Qde,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=ehe(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=this.options.anchor==="mark"?the(t,n,i,this.el.getBoundingClientRect(),this.options):A8(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var F1={};var ohe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),she=Object.prototype.hasOwnProperty;function Kb(e,t){return she.call(e,t)}function Jb(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)Kb(e,r)&&i.push(r);return i}function Xn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Qb(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function Ls(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function S8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Zb(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(Zb(e[t]))return!0}else if(typeof e=="object"){for(var i=Jb(e),r=i.length,o=0;o<r;o++)if(Zb(e[i[o]]))return!0}}return!1}function MF(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
|
|
72
|
-
`)}var _8=(function(e){ohe(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,MF(n,{name:i,index:r,operation:o,tree:s}))||this;return u.name=i,u.index=r,u.operation=o,u.tree=s,Object.setPrototypeOf(u,a.prototype),u.message=MF(n,{name:i,index:r,operation:o,tree:s}),u}return t})(Error),st=_8,ahe=Xn,lu={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=Pp(n,this.path);i&&(i=Xn(i));var r=Zs(n,{op:"remove",path:this.from}).removed;return Zs(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Pp(n,this.from);return Zs(n,{op:"add",path:this.path,value:Xn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:af(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},uhe={add:function(e,t,n){return Qb(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:lu.move,copy:lu.copy,test:lu.test,_get:lu._get};function Pp(e,t){if(t=="")return e;var n={op:"_get",path:t};return Zs(e,n),n.value}function Zs(e,t,n,i,r,o){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):Ip(t,0)),t.path===""){var s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=Pp(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=af(e,t.value),s.test===!1)throw new st("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new st("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Xn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=Ip;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=S8(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!Qb(h))throw new st("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);Qb(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new st("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=uhe[t.op].call(t,l,h,e);if(s.test===!1)throw new st("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=lu[t.op].call(t,l,h,e);if(s.test===!1)throw new st("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new st("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function J0(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new st("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Xn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=Zs(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function lhe(e,t,n){var i=Zs(e,t);if(i.test===!1)throw new st("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Ip(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new st("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(lu[e.op]){if(typeof e.path!="string")throw new st("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new st('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new st("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new st("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Zb(e.value))throw new st("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new st("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new st("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=$8([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new st("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new st("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function $8(e,t,n){try{if(!Array.isArray(e))throw new st("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)J0(Xn(t),Xn(e),n||!0);else{n=n||Ip;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof st)return r;throw r}}function af(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,o,s;if(n&&i){if(o=e.length,o!=t.length)return!1;for(r=o;r--!==0;)if(!af(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(o=a.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=o;r--!==0;)if(s=a[r],!af(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}var che=Object.freeze({__proto__:null,JsonPatchError:st,_areEquals:af,applyOperation:Zs,applyPatch:J0,applyReducer:lhe,deepClone:ahe,getValueByPointer:Pp,validate:$8,validator:Ip});var xw=new WeakMap,fhe=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),dhe=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function hhe(e){return xw.get(e)}function phe(e,t){return e.observers.get(t)}function ghe(e,t){e.observers.delete(t.callback)}function mhe(e,t){t.unobserve()}function yhe(e,t){var n=[],i,r=hhe(e);if(!r)r=new fhe(e),xw.set(e,r);else{var o=phe(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Xn(e),t){i.callback=t,i.next=null;var s=function(){ex(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){ex(i),clearTimeout(i.next),ghe(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new dhe(t,i)),i}function ex(e,t){t===void 0&&(t=!1);var n=xw.get(e.object);vw(n.value,e.object,e.patches,"",t),e.patches.length&&J0(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function vw(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=Jb(t),s=Jb(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(Kb(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?vw(c,f,n,i+"/"+Ls(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Ls(l),value:Xn(c)}),n.push({op:"replace",path:i+"/"+Ls(l),value:Xn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Ls(l),value:Xn(c)}),n.push({op:"remove",path:i+"/"+Ls(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&o.length==s.length))for(var u=0;u<o.length;u++){var l=o[u];!Kb(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+Ls(l),value:Xn(t[l])})}}}function bhe(e,t,n){n===void 0&&(n=!1);var i=[];return vw(e,t,i,"",n),i}var xhe=Object.freeze({__proto__:null,compare:bhe,generate:ex,observe:yhe,unobserve:mhe});Object.assign({},che,xhe,{JsonPatchError:_8,deepClone:Xn,escapePathComponent:Ls,unescapePathComponent:S8});function vhe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k1,OF;function Ehe(){if(OF)return k1;OF=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const i=this.map.get(n);if(i!==void 0)return this.map.delete(n),this.map.set(n,i),i}delete(n){return this.map.delete(n)}set(n,i){if(!this.delete(n)&&i!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,i)}return this}}return k1=e,k1}var D1,RF;function Ew(){if(RF)return D1;RF=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return D1=i=>i?typeof i!="object"?e:i:t,D1}var Id={exports:{}},T1,NF;function Aw(){if(NF)return T1;NF=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return T1={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},T1}var M1,LF;function Q0(){return LF||(LF=1,M1=typeof process=="object"&&F1&&F1.NODE_DEBUG&&/\bsemver\b/i.test(F1.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),M1}var PF;function ww(){return PF||(PF=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=Aw(),o=Q0();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[d,i]],p=m=>{for(const[y,b]of h)m=m.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return m},g=(m,y,b)=>{const x=p(y),v=f++;o(m,v,y),c[m]=v,u[v]=y,l[v]=x,s[v]=new RegExp(y,b?"g":void 0),a[v]=new RegExp(x,b?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[c.NUMERICIDENTIFIER]}|${u[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NUMERICIDENTIFIERLOOSE]}|${u[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),g("FULL",`^${u[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),g("LOOSE",`^${u[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),g("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[c.COERCE],!0),g("COERCERTLFULL",u[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Id,Id.exports)),Id.exports}var O1,IF;function Ahe(){if(IF)return O1;IF=1;const e=/^[0-9]+$/,t=(i,r)=>{const o=e.test(i),s=e.test(r);return o&&s&&(i=+i,r=+r),i===r?0:o&&!s?-1:s&&!o?1:i<r?-1:1};return O1={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},O1}var R1,BF;function Cw(){if(BF)return R1;BF=1;const e=Q0(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Aw(),{safeRe:i,safeSrc:r,t:o}=ww(),s=Ew(),{compareIdentifiers:a}=Ahe();class u{constructor(c,f){if(f=s(f),c instanceof u){if(c.loose===!!f.loose&&c.includePrerelease===!!f.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=c.trim().match(f.loose?i[o.LOOSE]:i[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+d[1],this.minor=+d[2],this.patch=+d[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");d[4]?this.prerelease=d[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){const p=+h;if(p>=0&&p<n)return p}return h}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof u)){if(typeof c=="string"&&c===this.version)return 0;c=new u(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof u||(c=new u(c,this.options)),a(this.major,c.major)||a(this.minor,c.minor)||a(this.patch,c.patch)}comparePre(c){if(c instanceof u||(c=new u(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],h=c.prerelease[f];if(e("prerelease compare",f,d,h),d===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(d===void 0)return-1;if(d===h)continue;return a(d,h)}while(++f)}compareBuild(c){c instanceof u||(c=new u(c,this.options));let f=0;do{const d=this.build[f],h=c.build[f];if(e("build compare",f,d,h),d===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(d===void 0)return-1;if(d===h)continue;return a(d,h)}while(++f)}inc(c,f,d){if(c.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const h=new RegExp(`^${this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]}$`),p=`-${f}`.match(h);if(!p||p[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const h=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(f){let p=[f,h];d===!1&&(p=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return R1=u,R1}var N1,zF;function wl(){if(zF)return N1;zF=1;const e=Cw();return N1=(n,i,r)=>new e(n,r).compare(new e(i,r)),N1}var L1,UF;function whe(){if(UF)return L1;UF=1;const e=wl();return L1=(n,i,r)=>e(n,i,r)===0,L1}var P1,jF;function Che(){if(jF)return P1;jF=1;const e=wl();return P1=(n,i,r)=>e(n,i,r)!==0,P1}var I1,qF;function She(){if(qF)return I1;qF=1;const e=wl();return I1=(n,i,r)=>e(n,i,r)>0,I1}var B1,WF;function _he(){if(WF)return B1;WF=1;const e=wl();return B1=(n,i,r)=>e(n,i,r)>=0,B1}var z1,HF;function $he(){if(HF)return z1;HF=1;const e=wl();return z1=(n,i,r)=>e(n,i,r)<0,z1}var U1,GF;function Fhe(){if(GF)return U1;GF=1;const e=wl();return U1=(n,i,r)=>e(n,i,r)<=0,U1}var j1,YF;function khe(){if(YF)return j1;YF=1;const e=whe(),t=Che(),n=She(),i=_he(),r=$he(),o=Fhe();return j1=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return o(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},j1}var q1,VF;function Dhe(){if(VF)return q1;VF=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}q1=t;const n=Ew(),{safeRe:i,t:r}=ww(),o=khe(),s=Q0(),a=Cw(),u=F8();return q1}var W1,XF;function F8(){if(XF)return W1;XF=1;const e=/\s+/g;class t{constructor(_,D){if(D=r(D),_ instanceof t)return _.loose===!!D.loose&&_.includePrerelease===!!D.includePrerelease?_:new t(_.raw,D);if(_ instanceof o)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=D,this.loose=!!D.loose,this.includePrerelease=!!D.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(P=>this.parseRange(P.trim())).filter(P=>P.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const P=this.set[0];if(this.set=this.set.filter(B=>!g(B[0])),this.set.length===0)this.set=[P];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&m(B[0])){this.set=[B];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const D=this.set[_];for(let P=0;P<D.length;P++)P>0&&(this.formatted+=" "),this.formatted+=D[P].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const P=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+_,B=i.get(P);if(B)return B;const I=this.options.loose,Y=I?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];_=_.replace(Y,L(this.options.includePrerelease)),s("hyphen replace",_),_=_.replace(u[l.COMPARATORTRIM],c),s("comparator trim",_),_=_.replace(u[l.TILDETRIM],f),s("tilde trim",_),_=_.replace(u[l.CARETTRIM],d),s("caret trim",_);let le=_.split(" ").map(ge=>b(ge,this.options)).join(" ").split(/\s+/).map(ge=>k(ge,this.options));I&&(le=le.filter(ge=>(s("loose invalid filter",ge,this.options),!!ge.match(u[l.COMPARATORLOOSE])))),s("range list",le);const oe=new Map,pe=le.map(ge=>new o(ge,this.options));for(const ge of pe){if(g(ge))return[ge];oe.set(ge.value,ge)}oe.size>1&&oe.has("")&&oe.delete("");const We=[...oe.values()];return i.set(P,We),We}intersects(_,D){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(P=>y(P,D)&&_.set.some(B=>y(B,D)&&P.every(I=>B.every(Y=>I.intersects(Y,D)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new a(_,this.options)}catch{return!1}for(let D=0;D<this.set.length;D++)if(T(this.set[D],_,this.options))return!0;return!1}}W1=t;const n=Ehe(),i=new n,r=Ew(),o=Dhe(),s=Q0(),a=Cw(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=ww(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=Aw(),g=F=>F.value==="<0.0.0-0",m=F=>F.value==="",y=(F,_)=>{let D=!0;const P=F.slice();let B=P.pop();for(;D&&P.length;)D=P.every(I=>B.intersects(I,_)),B=P.pop();return D},b=(F,_)=>(s("comp",F,_),F=w(F,_),s("caret",F),F=v(F,_),s("tildes",F),F=C(F,_),s("xrange",F),F=$(F,_),s("stars",F),F),x=F=>!F||F.toLowerCase()==="x"||F==="*",v=(F,_)=>F.trim().split(/\s+/).map(D=>A(D,_)).join(" "),A=(F,_)=>{const D=_.loose?u[l.TILDELOOSE]:u[l.TILDE];return F.replace(D,(P,B,I,Y,le)=>{s("tilde",F,P,B,I,Y,le);let oe;return x(B)?oe="":x(I)?oe=`>=${B}.0.0 <${+B+1}.0.0-0`:x(Y)?oe=`>=${B}.${I}.0 <${B}.${+I+1}.0-0`:le?(s("replaceTilde pr",le),oe=`>=${B}.${I}.${Y}-${le} <${B}.${+I+1}.0-0`):oe=`>=${B}.${I}.${Y} <${B}.${+I+1}.0-0`,s("tilde return",oe),oe})},w=(F,_)=>F.trim().split(/\s+/).map(D=>E(D,_)).join(" "),E=(F,_)=>{s("caret",F,_);const D=_.loose?u[l.CARETLOOSE]:u[l.CARET],P=_.includePrerelease?"-0":"";return F.replace(D,(B,I,Y,le,oe)=>{s("caret",F,B,I,Y,le,oe);let pe;return x(I)?pe="":x(Y)?pe=`>=${I}.0.0${P} <${+I+1}.0.0-0`:x(le)?I==="0"?pe=`>=${I}.${Y}.0${P} <${I}.${+Y+1}.0-0`:pe=`>=${I}.${Y}.0${P} <${+I+1}.0.0-0`:oe?(s("replaceCaret pr",oe),I==="0"?Y==="0"?pe=`>=${I}.${Y}.${le}-${oe} <${I}.${Y}.${+le+1}-0`:pe=`>=${I}.${Y}.${le}-${oe} <${I}.${+Y+1}.0-0`:pe=`>=${I}.${Y}.${le}-${oe} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?Y==="0"?pe=`>=${I}.${Y}.${le}${P} <${I}.${Y}.${+le+1}-0`:pe=`>=${I}.${Y}.${le}${P} <${I}.${+Y+1}.0-0`:pe=`>=${I}.${Y}.${le} <${+I+1}.0.0-0`),s("caret return",pe),pe})},C=(F,_)=>(s("replaceXRanges",F,_),F.split(/\s+/).map(D=>S(D,_)).join(" ")),S=(F,_)=>{F=F.trim();const D=_.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return F.replace(D,(P,B,I,Y,le,oe)=>{s("xRange",F,P,B,I,Y,le,oe);const pe=x(I),We=pe||x(Y),ge=We||x(le),Ht=ge;return B==="="&&Ht&&(B=""),oe=_.includePrerelease?"-0":"",pe?B===">"||B==="<"?P="<0.0.0-0":P="*":B&&Ht?(We&&(Y=0),le=0,B===">"?(B=">=",We?(I=+I+1,Y=0,le=0):(Y=+Y+1,le=0)):B==="<="&&(B="<",We?I=+I+1:Y=+Y+1),B==="<"&&(oe="-0"),P=`${B+I}.${Y}.${le}${oe}`):We?P=`>=${I}.0.0${oe} <${+I+1}.0.0-0`:ge&&(P=`>=${I}.${Y}.0${oe} <${I}.${+Y+1}.0-0`),s("xRange return",P),P})},$=(F,_)=>(s("replaceStars",F,_),F.trim().replace(u[l.STAR],"")),k=(F,_)=>(s("replaceGTE0",F,_),F.trim().replace(u[_.includePrerelease?l.GTE0PRE:l.GTE0],"")),L=F=>(_,D,P,B,I,Y,le,oe,pe,We,ge,Ht)=>(x(P)?D="":x(B)?D=`>=${P}.0.0${F?"-0":""}`:x(I)?D=`>=${P}.${B}.0${F?"-0":""}`:Y?D=`>=${D}`:D=`>=${D}${F?"-0":""}`,x(pe)?oe="":x(We)?oe=`<${+pe+1}.0.0-0`:x(ge)?oe=`<${pe}.${+We+1}.0-0`:Ht?oe=`<=${pe}.${We}.${ge}-${Ht}`:F?oe=`<${pe}.${We}.${+ge+1}-0`:oe=`<=${oe}`,`${D} ${oe}`.trim()),T=(F,_,D)=>{for(let P=0;P<F.length;P++)if(!F[P].test(_))return!1;if(_.prerelease.length&&!D.includePrerelease){for(let P=0;P<F.length;P++)if(s(F[P].semver),F[P].semver!==o.ANY&&F[P].semver.prerelease.length>0){const B=F[P].semver;if(B.major===_.major&&B.minor===_.minor&&B.patch===_.patch)return!0}return!1}return!0};return W1}var H1,KF;function The(){if(KF)return H1;KF=1;const e=F8();return H1=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},H1}var Mhe=The(),k8=vhe(Mhe);function Ohe(e,t,n){const i=e.open(t),r=250,{origin:o}=new URL(t);let s=40;function a(l){l.source===i&&(s=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){s<=0||(i.postMessage(n,o),setTimeout(u,r),s-=1)}setTimeout(u,r)}var Rhe=`.vega-embed {
|
|
73
|
-
position: relative;
|
|
74
|
-
display: inline-block;
|
|
75
|
-
box-sizing: border-box;
|
|
76
|
-
}
|
|
77
|
-
.vega-embed.has-actions {
|
|
78
|
-
padding-right: 38px;
|
|
79
|
-
}
|
|
80
|
-
.vega-embed details:not([open]) > :not(summary) {
|
|
81
|
-
display: none !important;
|
|
82
|
-
}
|
|
83
|
-
.vega-embed summary {
|
|
84
|
-
list-style: none;
|
|
85
|
-
position: absolute;
|
|
86
|
-
top: 0;
|
|
87
|
-
right: 0;
|
|
88
|
-
padding: 6px;
|
|
89
|
-
z-index: 1000;
|
|
90
|
-
background: white;
|
|
91
|
-
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
|
92
|
-
color: #1b1e23;
|
|
93
|
-
border: 1px solid #aaa;
|
|
94
|
-
border-radius: 999px;
|
|
95
|
-
opacity: 0.2;
|
|
96
|
-
transition: opacity 0.4s ease-in;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
line-height: 0px;
|
|
99
|
-
}
|
|
100
|
-
.vega-embed summary::-webkit-details-marker {
|
|
101
|
-
display: none;
|
|
102
|
-
}
|
|
103
|
-
.vega-embed summary:active {
|
|
104
|
-
box-shadow: #aaa 0px 0px 0px 1px inset;
|
|
105
|
-
}
|
|
106
|
-
.vega-embed summary svg {
|
|
107
|
-
width: 14px;
|
|
108
|
-
height: 14px;
|
|
109
|
-
}
|
|
110
|
-
.vega-embed details[open] summary {
|
|
111
|
-
opacity: 0.7;
|
|
112
|
-
}
|
|
113
|
-
.vega-embed:hover summary, .vega-embed:focus-within summary {
|
|
114
|
-
opacity: 1 !important;
|
|
115
|
-
transition: opacity 0.2s ease;
|
|
116
|
-
}
|
|
117
|
-
.vega-embed .vega-actions {
|
|
118
|
-
position: absolute;
|
|
119
|
-
z-index: 1001;
|
|
120
|
-
top: 35px;
|
|
121
|
-
right: -9px;
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-direction: column;
|
|
124
|
-
padding-bottom: 8px;
|
|
125
|
-
padding-top: 8px;
|
|
126
|
-
border-radius: 4px;
|
|
127
|
-
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
|
|
128
|
-
border: 1px solid #d9d9d9;
|
|
129
|
-
background: white;
|
|
130
|
-
animation-duration: 0.15s;
|
|
131
|
-
animation-name: scale-in;
|
|
132
|
-
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
|
|
133
|
-
text-align: left;
|
|
134
|
-
}
|
|
135
|
-
.vega-embed .vega-actions a {
|
|
136
|
-
padding: 8px 16px;
|
|
137
|
-
font-family: sans-serif;
|
|
138
|
-
font-size: 14px;
|
|
139
|
-
font-weight: 600;
|
|
140
|
-
white-space: nowrap;
|
|
141
|
-
color: #434a56;
|
|
142
|
-
text-decoration: none;
|
|
143
|
-
}
|
|
144
|
-
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
|
|
145
|
-
background-color: #f7f7f9;
|
|
146
|
-
color: black;
|
|
147
|
-
}
|
|
148
|
-
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
|
|
149
|
-
content: "";
|
|
150
|
-
display: inline-block;
|
|
151
|
-
position: absolute;
|
|
152
|
-
}
|
|
153
|
-
.vega-embed .vega-actions::before {
|
|
154
|
-
left: auto;
|
|
155
|
-
right: 14px;
|
|
156
|
-
top: -16px;
|
|
157
|
-
border: 8px solid rgba(0, 0, 0, 0);
|
|
158
|
-
border-bottom-color: #d9d9d9;
|
|
159
|
-
}
|
|
160
|
-
.vega-embed .vega-actions::after {
|
|
161
|
-
left: auto;
|
|
162
|
-
right: 15px;
|
|
163
|
-
top: -14px;
|
|
164
|
-
border: 7px solid rgba(0, 0, 0, 0);
|
|
165
|
-
border-bottom-color: #fff;
|
|
166
|
-
}
|
|
167
|
-
.vega-embed .chart-wrapper.fit-x {
|
|
168
|
-
width: 100%;
|
|
169
|
-
}
|
|
170
|
-
.vega-embed .chart-wrapper.fit-y {
|
|
171
|
-
height: 100%;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.vega-embed-wrapper {
|
|
175
|
-
max-width: 100%;
|
|
176
|
-
overflow: auto;
|
|
177
|
-
padding-right: 14px;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@keyframes scale-in {
|
|
181
|
-
from {
|
|
182
|
-
opacity: 0;
|
|
183
|
-
transform: scale(0.6);
|
|
184
|
-
}
|
|
185
|
-
to {
|
|
186
|
-
opacity: 1;
|
|
187
|
-
transform: scale(1);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
`;function D8(e,...t){for(const n of t)Nhe(e,n);return e}function Nhe(e,t){for(const n of Object.keys(t))Yp(e,n,t[n],!0)}const nr=Gte;let uf=lde;const JF=typeof window<"u"?window:void 0;uf===void 0&&JF?.vl?.compile&&(uf=JF.vl);const Lhe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Phe={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"},gc={vega:"Vega","vega-lite":"Vega-Lite"},Bp={vega:nr.version,"vega-lite":uf?uf.version:"not available"},Ihe={vega:e=>e,"vega-lite":(e,t)=>uf.compile(e,{config:t}).spec},Bhe=`
|
|
191
|
-
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
|
192
|
-
<circle r="2" cy="8" cx="2"></circle>
|
|
193
|
-
<circle r="2" cy="8" cx="8"></circle>
|
|
194
|
-
<circle r="2" cy="8" cx="14"></circle>
|
|
195
|
-
</svg>`,zhe="chart-wrapper";function Uhe(e){return typeof e=="function"}function QF(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,s=window.open("");s.document.write(r+e+o),s.document.title=`${gc[i]} JSON Source`}function jhe(e,t){if(e.$schema){const n=b8(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${gc[n.library]}, but mode argument sets ${gc[t]??t}.`);const i=n.library;return k8(Bp[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${gc[i]} ${n.version}, but the current version of ${gc[i]} is v${Bp[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function T8(e){return!!(e&&"load"in e)}function ZF(e){return T8(e)?e:nr.loader(e)}function qhe(e){const t=e.usermeta?.embedOptions??{};return _e(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Ppe(e,t,n={}){let i,r;_e(t)?(r=ZF(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=qhe(i),s=o.loader;(!r||s)&&(r=ZF(n.loader??s));const a=await ek(o,r),u=await ek(n,r),l={...D8(u,a),config:Gp(u.config??{},a.config??{})};return await Hhe(e,i,l,r)}async function ek(e,t){const n=_e(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=_e(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function Whe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Hhe(e,t,n={},i){const r=n.theme?Gp(Vde[n.theme],n.config??{}):n.config,o=hx(n.actions)?n.actions:D8({},Lhe,n.actions??{}),s={...Phe,...n.i18n},a=n.renderer??"svg",u=n.logLevel??nr.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const A="vega-embed-style",{root:w,rootContainer:E}=Whe(c);if(!w.getElementById(A)){const C=document.createElement("style");C.id=A,C.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Rhe.toString():n.defaultStyle,E.appendChild(C)}}const f=jhe(t,n.mode);let d=Ihe[f](t,r);if(f==="vega-lite"&&d.$schema){const A=b8(d.$schema);k8(Bp.vega,`^${A.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${A.version}, but current version is v${Bp.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const A=document.createElement("div");A.classList.add(zhe),c.appendChild(A),h=A}const p=n.patch;if(p&&(d=p instanceof Function?p(d):J0(d,p,!0,!1).newDocument),n.formatLocale&&nr.formatLocale(n.formatLocale),n.timeFormatLocale&&nr.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const A in n.expressionFunctions){const w=n.expressionFunctions[A];"fn"in w?nr.expressionFunction(A,w.fn,w.visitor):w instanceof Function&&nr.expressionFunction(A,w)}const{ast:g}=n,m=nr.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||nr.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:nr.expressionInterpreter??n.expr??ine}:{}});if(y.addSignalListener("autosize",(A,w)=>{const{type:E}=w;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:A,tooltip:w}=n,E=A&&!T8(A)?A?.baseURL:void 0,C=Uhe(w)?w:new rhe({baseURL:E,...w===!0?{}:w}).call;y.tooltip(C)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:A,updateSet:w}=typeof b=="boolean"?{}:b;y.hover(A,w)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let x;if(o!==!1){let A=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),A=E;const C=document.createElement("summary");C.innerHTML=Bhe,E.append(C),x=S=>{E.contains(S.target)||E.removeAttribute("open")},document.addEventListener("click",x)}const w=document.createElement("div");if(A.append(w),w.classList.add("vega-actions"),o===!0||o.export!==!1){for(const E of["svg","png"])if(o===!0||o.export===!0||o.export[E]){const C=s[`${E.toUpperCase()}_ACTION`],S=document.createElement("a"),$=ce(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;S.text=C,S.href="#",S.target="_blank",S.download=`${l}.${E}`,S.addEventListener("mousedown",async function(k){k.preventDefault();const L=await y.toImageURL(E,$);this.href=L}),w.append(S)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function(C){QF(n1(t),n.sourceHeader??"",n.sourceFooter??"",f),C.preventDefault()}),w.append(E)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const E=document.createElement("a");E.text=s.COMPILED_ACTION,E.href="#",E.addEventListener("click",function(C){QF(n1(d),n.sourceHeader??"",n.sourceFooter??"","vega"),C.preventDefault()}),w.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",C=document.createElement("a");C.text=s.EDITOR_ACTION,C.href="#",C.addEventListener("click",function(S){Ohe(window,E,{config:r,mode:p?"vega":f,renderer:a,spec:n1(p?d:t)}),S.preventDefault()}),w.append(C)}}function v(){x&&document.removeEventListener("click",x),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:v,embedOptions:n}}export{Khe as S,Qhe as a,ine as b,Zhe as c,Jhe as d,Ppe as e,gi as t};
|