streamlit-nightly 1.45.2.dev20250610__py3-none-any.whl → 1.45.2.dev20250611__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.
Files changed (77) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/manifest.json +218 -218
  3. streamlit/static/static/js/{ErrorOutline.esm.BFmVpS9Y.js → ErrorOutline.esm.BdEPU15-.js} +1 -1
  4. streamlit/static/static/js/{FileDownload.esm.CUwGnb6l.js → FileDownload.esm.CPW9RVdy.js} +1 -1
  5. streamlit/static/static/js/{FileHelper.7jhiJzN9.js → FileHelper.DIRQHKjC.js} +1 -1
  6. streamlit/static/static/js/{FormClearHelper.DHx8ahLp.js → FormClearHelper.DBWnhmsU.js} +1 -1
  7. streamlit/static/static/js/{Hooks.BDCbPb9Z.js → Hooks.C186ViyU.js} +1 -1
  8. streamlit/static/static/js/{InputInstructions.B29VfaHu.js → InputInstructions.Dw8Kfux5.js} +1 -1
  9. streamlit/static/static/js/{ProgressBar.DCvzFED3.js → ProgressBar.CxUNkTV6.js} +1 -1
  10. streamlit/static/static/js/{RenderInPortalIfExists.Dum6Yo4x.js → RenderInPortalIfExists.BKXBNQQq.js} +1 -1
  11. streamlit/static/static/js/{Toolbar.BKJU0yem.js → Toolbar.BJYum78u.js} +1 -1
  12. streamlit/static/static/js/{base-input.B5D5SCDU.js → base-input.kjoewkRb.js} +1 -1
  13. streamlit/static/static/js/{checkbox.eyyRCmXH.js → checkbox.3isrn_og.js} +1 -1
  14. streamlit/static/static/js/{createSuper.Bfw-n2CW.js → createSuper.BI6vR8a0.js} +1 -1
  15. streamlit/static/static/js/{data-grid-overlay-editor.Ic_-1uWB.js → data-grid-overlay-editor.Cm77d4zl.js} +1 -1
  16. streamlit/static/static/js/{downloader.BrOujhsH.js → downloader.EOCjD0NL.js} +1 -1
  17. streamlit/static/static/js/{es6.Da9PSRiO.js → es6.C5daX2Be.js} +2 -2
  18. streamlit/static/static/js/{iframeResizer.contentWindow.-m9KEHjj.js → iframeResizer.contentWindow.BMJUZZwp.js} +1 -1
  19. streamlit/static/static/js/{index.Cy5cgtmd.js → index.4R_UCp47.js} +1 -1
  20. streamlit/static/static/js/{index.Da6TsobW.js → index.B1mJuAq5.js} +1 -1
  21. streamlit/static/static/js/{index.DD4IkJLw.js → index.B250IT6a.js} +5 -5
  22. streamlit/static/static/js/{index.bgJFjVuq.js → index.BCrEmee_.js} +16 -16
  23. streamlit/static/static/js/{index.hHS2hw5y.js → index.BDtaM1CN.js} +1 -1
  24. streamlit/static/static/js/index.BF4ErgkJ.js +1 -0
  25. streamlit/static/static/js/{index.CZ7DfyLC.js → index.BOI5cGOL.js} +1 -1
  26. streamlit/static/static/js/{index.DM31JZhq.js → index.BX1E2ySZ.js} +1 -1
  27. streamlit/static/static/js/{index.D-xYY77h.js → index.BahyTNeD.js} +1 -1
  28. streamlit/static/static/js/index.BhbIE27r.js +769 -0
  29. streamlit/static/static/js/{index.CsRqF1UT.js → index.Bqgf6rro.js} +1 -1
  30. streamlit/static/static/js/{index.Dzd6lYTb.js → index.BrZir92w.js} +1 -1
  31. streamlit/static/static/js/{index.CsG3cY4S.js → index.C8tUObTJ.js} +1 -1
  32. streamlit/static/static/js/{index.BCuDY7Wq.js → index.CC9mIHYY.js} +1 -1
  33. streamlit/static/static/js/{index.Dv1JTAEg.js → index.CSPwImJC.js} +1 -1
  34. streamlit/static/static/js/{index.B9Hmg5tY.js → index.CWBc7XaF.js} +1 -1
  35. streamlit/static/static/js/{index.B_hrvDfD.js → index.CZ4q7an5.js} +1 -1
  36. streamlit/static/static/js/{index.BFvBq9Ky.js → index.C_fRYRHk.js} +1 -1
  37. streamlit/static/static/js/{index.DpjOn_mW.js → index.CrA9QRW0.js} +1 -1
  38. streamlit/static/static/js/{index.lfluHnyb.js → index.CtcMvS-_.js} +1 -1
  39. streamlit/static/static/js/{index.LVLiaAG5.js → index.Czu-GVzu.js} +1 -1
  40. streamlit/static/static/js/{index.DkDFCkmE.js → index.D-JeS9T4.js} +1 -1
  41. streamlit/static/static/js/{index.DKRwWqPL.js → index.DINWiL73.js} +1 -1
  42. streamlit/static/static/js/{index.B2Wwybqa.js → index.DMHsm4sn.js} +1 -1
  43. streamlit/static/static/js/index.DNadNLPx.js +1 -0
  44. streamlit/static/static/js/{index.DVX3m8nA.js → index.DPZr2Uus.js} +1 -1
  45. streamlit/static/static/js/{index.rCHgixxf.js → index.DT1MtVX-.js} +1 -1
  46. streamlit/static/static/js/{index.B9zQe0Ch.js → index.DWiuFOtg.js} +1 -1
  47. streamlit/static/static/js/{index.DWZy7E8v.js → index.DXsNtpkK.js} +1 -1
  48. streamlit/static/static/js/{index.tgnkrUS7.js → index.Dn0s0tyl.js} +1 -1
  49. streamlit/static/static/js/{index.B6hFQ_0c.js → index.ImEyS-hh.js} +1 -1
  50. streamlit/static/static/js/{index.Bkc0rVhi.js → index.N0O5_Lsy.js} +1 -1
  51. streamlit/static/static/js/{index.C2jhjPwI.js → index.Uz7GO7SU.js} +1 -1
  52. streamlit/static/static/js/{index.X0NCujg7.js → index.W6jmNWSX.js} +1 -1
  53. streamlit/static/static/js/{index.DHyANL2t.js → index.WILG491-.js} +1 -1
  54. streamlit/static/static/js/{index.CVnrNDsY.js → index.poPmLKfl.js} +1 -1
  55. streamlit/static/static/js/{index.Ff_iBwit.js → index.uWesVSaB.js} +1 -1
  56. streamlit/static/static/js/{input.CcBKvzV7.js → input.ClFwD0mq.js} +1 -1
  57. streamlit/static/static/js/{memory.Dy3vhhGd.js → memory.Yyz9MYzu.js} +1 -1
  58. streamlit/static/static/js/{mergeWith.Br7ttj2E.js → mergeWith.DD6Kt92K.js} +1 -1
  59. streamlit/static/static/js/{number-overlay-editor.Dp8qIE2c.js → number-overlay-editor.BikEvrb3.js} +1 -1
  60. streamlit/static/static/js/{possibleConstructorReturn.DrBKFKPb.js → possibleConstructorReturn.D8TCcIZ-.js} +1 -1
  61. streamlit/static/static/js/{sandbox._fV6ffVT.js → sandbox.CDwm_VZE.js} +1 -1
  62. streamlit/static/static/js/{textarea.CG3YusUv.js → textarea.YCA7hvEm.js} +1 -1
  63. streamlit/static/static/js/{timepicker.CgWFbpop.js → timepicker.B4bN2wJ4.js} +1 -1
  64. streamlit/static/static/js/{toConsumableArray.COmxQMZV.js → toConsumableArray.Cs6WL6jE.js} +1 -1
  65. streamlit/static/static/js/{uniqueId.Cp7qO6qN.js → uniqueId.DmJ1AzJ5.js} +1 -1
  66. streamlit/static/static/js/{useBasicWidgetState.CunX1Hmv.js → useBasicWidgetState.hfDgYzWw.js} +1 -1
  67. streamlit/static/static/js/{useOnInputChange.DCd-U4SE.js → useOnInputChange.DGVbDPHa.js} +1 -1
  68. streamlit/static/static/js/{withFullScreenWrapper.C9CPnWj9.js → withFullScreenWrapper.BzKsjBsN.js} +1 -1
  69. {streamlit_nightly-1.45.2.dev20250610.dist-info → streamlit_nightly-1.45.2.dev20250611.dist-info}/METADATA +1 -1
  70. {streamlit_nightly-1.45.2.dev20250610.dist-info → streamlit_nightly-1.45.2.dev20250611.dist-info}/RECORD +74 -74
  71. streamlit/static/static/js/index.BxCeuwGy.js +0 -782
  72. streamlit/static/static/js/index.C8Tx_yNT.js +0 -1
  73. streamlit/static/static/js/index.E46WZGKk.js +0 -1
  74. {streamlit_nightly-1.45.2.dev20250610.data → streamlit_nightly-1.45.2.dev20250611.data}/scripts/streamlit.cmd +0 -0
  75. {streamlit_nightly-1.45.2.dev20250610.dist-info → streamlit_nightly-1.45.2.dev20250611.dist-info}/WHEEL +0 -0
  76. {streamlit_nightly-1.45.2.dev20250610.dist-info → streamlit_nightly-1.45.2.dev20250611.dist-info}/entry_points.txt +0 -0
  77. {streamlit_nightly-1.45.2.dev20250610.dist-info → streamlit_nightly-1.45.2.dev20250611.dist-info}/top_level.txt +0 -0
@@ -1,20 +1,20 @@
1
- import{J as b8,n as x8,H as at,aG as v8,aH as HA,aI as E8,aJ as w8,aK as Va,aL as Ch,N as A8,z as S8,aD as Mk,r as St,M as $x,ar as C8,ao as $8,ak as VA,al as YA,X as _8,aM as F8,O as XA,aA as KA,l as Ok,C as k8,j as bm,aN as D8}from"./index.BxCeuwGy.js";import{S as JA,T as T8}from"./Toolbar.BKJU0yem.js";import{E as Rk,w as M8}from"./withFullScreenWrapper.C9CPnWj9.js";import{m as O8}from"./mergeWith.Br7ttj2E.js";import{a as Ic,n as R8,b as N8,c as ep,t as ra,p as L8,d as P8,e as I8,i as us,f as tp,g as QA,l as rl,h as _x,j as np,k as ZA,m as No,o as Cu,q as z8,r as ls,s as B8,u as U8,v as j8,w as q8}from"./threshold.DjX0wlsa.js";import{f as W8,a as hy,b as Nk,c as G8,R as ip,r as Lk,d as Fx,e as kx,C as Dx,g as eS,h as tS,i as rp,j as gy,n as en,k as yf,l as H8,m as V8,o as Y8,p as X8,q as K8,s as J8,t as Q8,u as Z8,v as e9,w as t9,x as n9,y as $h}from"./value.CgPGBV_l.js";import{P as i9,i as r9,a as o9,b as s9,p as Tx,T as a9,n as u9,t as l9,d as c9}from"./timer.CAwTRJ_g.js";import{u as f9}from"./FormClearHelper.DHx8ahLp.js";const d9=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:b8(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",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"}}}}}),h9=x8("div",{target:"e1d0pwhz0"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"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:"rgb(0 0 0 / 16%) 0px 4px 16px",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 nS(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:at(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:at(t.fontSizes.md),titleColor:Va(t),titleFontStyle:"normal",labelFontSize:at(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),labelFontStyle:"normal"},axis:{labelFontSize:at(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:at(t.fontSizes.sm),titleColor:Va(t),titleFontStyle:"normal",ticks:!1,gridColor:Ch(t),domain:!1,domainWidth:1,domainColor:Ch(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:at(t.spacing.lg),labelPadding:at(t.spacing.lg),labelSeparation:at(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:at(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),titleFontSize:at(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:Va(t),titlePadding:5,labelPadding:at(t.spacing.lg),columnPadding:at(t.spacing.sm),rowPadding:at(t.spacing.twoXS),padding:7,symbolStrokeWidth:at(t.spacing.twoXS)},range:{category:w8(t),diverging:E8(t),ramp:HA(t),heatmap:HA(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:at(t.sizes.defaultChartHeight),continuousWidth:at(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:v8(t)},bar:{binSpacing:at(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?O8({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function g9(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:at(i.twoSm),titleFontSize:at(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Ch(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:Ch(t),continuousHeight:at(t.sizes.defaultChartHeight),continuousWidth:at(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?A8({},s,e):s}const p9=20;function m9(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&$x(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const y9=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=nS(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=nS(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=g9(u.config,r),o?(u.width=s,u.height=a,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})):t&&(u.width=s,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})),u.padding||(u.padding={}),$x(u.padding.bottom)&&(u.padding.bottom=p9),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&m9(u),u},b9=e=>{const t=S8(),{expanded:n,width:i,height:r}=Mk(Rk),{id:o,formId:s,spec:a,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=e,h=St.useMemo(()=>d,[JSON.stringify(d)]),g=St.useMemo(()=>y9(a,c,f,h,t,n,i||0,r),[a,c,f,h,t,n,i,r]);return{id:o,formId:s,vegaLiteTheme:f,spec:g,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function yo(e,t,n){return e.fields=t||[],e.fname=n,e}function x9(e){return e==null?null:e.fname}function Pk(e){return e==null?null:e.fields}function Ik(e){return e.length===1?v9(e[0]):E9(e)}const v9=e=>function(t){return t[e]},E9=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Qd(e){throw Error(e)}function Mx(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||Qd("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&Qd("Access path missing closing bracket: "+e),i&&Qd("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Ox(e,t,n){const i=Mx(e);return e=i.length===1?i[0]:e,yo((n&&n.get||Ik)(i),[e],t||e)}const w9=Ox("id"),Rx=yo(e=>e,[],"identity"),A9=yo(()=>0,[],"zero"),S9=yo(()=>1,[],"one"),zk=yo(()=>!0,[],"true"),C9=yo(()=>!1,[],"false");function $9(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Bk=0,Uk=1,jk=2,qk=3,Wk=4;function _9(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$9,i=e||Bk;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Uk&&n(t||"error","ERROR",arguments),this},warn(){return i>=jk&&n(t||"warn","WARN",arguments),this},info(){return i>=qk&&n(t||"log","INFO",arguments),this},debug(){return i>=Wk&&n(t||"log","DEBUG",arguments),this}}}var op=Array.isArray;function oa(e){return e===Object(e)}const iS=e=>e!=="__proto__";function Nx(){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=F9(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;sp(i,o,r[o],s)}return i},{})}function sp(e,t,n,i){if(!iS(t))return;let r,o;if(oa(n)&&!op(n)){o=oa(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?sp(o,r,n[r]):iS(r)&&(o[r]=n[r])}else e[t]=n}function F9(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 ol(e){return e[e.length-1]}function Lx(e){return e==null||e===""?null:+e}const Gk=e=>t=>e*Math.exp(t),Hk=e=>t=>Math.log(e*t),Vk=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Yk=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,_h=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function ap(e,t,n,i){const r=n(e[0]),o=n(ol(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function k9(e,t){return ap(e,t,Lx,Rx)}function D9(e,t){var n=Math.sign(e[0]);return ap(e,t,Hk(n),Gk(n))}function T9(e,t,n){return ap(e,t,_h(n),_h(1/n))}function M9(e,t,n){return ap(e,t,Vk(n),Yk(n))}function up(e,t,n,i,r){const o=i(e[0]),s=i(ol(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function O9(e,t,n){return up(e,t,n,Lx,Rx)}function R9(e,t,n){const i=Math.sign(e[0]);return up(e,t,n,Hk(i),Gk(i))}function N9(e,t,n,i){return up(e,t,n,_h(i),_h(1/i))}function L9(e,t,n,i){return up(e,t,n,Vk(i),Yk(i))}function P9(e){return 1+~~(new Date(e).getMonth()/3)}function I9(e){return 1+~~(new Date(e).getUTCMonth()/3)}function zc(e){return e!=null?op(e)?e:[e]:[]}function z9(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 lp(e){return typeof e=="function"}const B9="descending";function U9(e,t,n){n=n||{},t=zc(t)||[];const i=[],r=[],o={},s=n.comparator||j9;return zc(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===B9?-1:1),r.push(a=lp(a)?a:Ox(a,null,n)),(Pk(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:yo(s(r,i),Object.keys(o))}const Px=(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),j9=(e,t)=>e.length===1?q9(e[0],t[0]):W9(e,t,e.length),q9=(e,t)=>function(n,i){return Px(e(n),e(i))*t},W9=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=Px(o(i),o(r));return s*t[a]});function G9(e){return lp(e)?e:()=>e}function H9(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Ix(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 V9(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 Y9(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]}const X9=Object.prototype.hasOwnProperty;function Hr(e,t){return X9.call(e,t)}const dd={};function K9(e){let t={},n;function i(o){return Hr(t,o)&&t[o]!==dd}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]===dd&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=dd),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!==dd&&(!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 J9(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=ol(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 Q9(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Ix(i,n)}function Z9(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 Xk(e){return typeof e=="boolean"}function Kk(e){return Object.prototype.toString.call(e)==="[object Date]"}function eP(e){return e&&lp(e[Symbol.iterator])}function Jk(e){return typeof e=="number"}function tP(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function to(e){return typeof e=="string"}function nP(e,t,n){e&&(e=t?zc(e).map(a=>a.replace(/\\(.)/g,"$1")):zc(e));const i=e&&e.length,r=n&&n.get||Ik,o=a=>r(t?[a]:Mx(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 yo(s,e,"key")}function iP(e,t){const n=e[0],i=ol(e),r=+t;return r?r===1?i:n+r*(i-n):n}const rP=1e4;function oP(e){e=+e||rP;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=>Hr(t,s)||Hr(n,s),get:s=>Hr(t,s)?t[s]:Hr(n,s)?o(s,n[s]):void 0,set:(s,a)=>Hr(t,s)?t[s]=a:o(s,a)}}function sP(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 ec(e,t){let n="";for(;--t>=0;)n+=e;return n}function aP(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?ec(r,s)+o:i==="center"?ec(r,~~(s/2))+o+ec(r,Math.ceil(s/2)):o+ec(r,s)}function uP(e){return e&&ol(e)-e[0]||0}function pu(e){return op(e)?"["+e.map(pu)+"]":oa(e)||to(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function lP(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const cP=e=>Jk(e)||Kk(e)?e:Date.parse(e);function fP(e,t){return t=t||cP,e==null||e===""?null:t(e)}function dP(e){return e==null||e===""?null:e+""}function hP(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function gP(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 pP(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)}function ri(e,t,n){return e.fields=t||[],e.fname=n,e}function lt(e){return e==null?null:e.fname}function xn(e){return e==null?null:e.fields}function Qk(e){return e.length===1?mP(e[0]):yP(e)}const mP=e=>function(t){return t[e]},yP=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function L(e){throw Error(e)}function zx(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||L("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&L("Access path missing closing bracket: "+e),i&&L("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Li(e,t,n){const i=zx(e);return e=i.length===1?i[0]:e,ri((n&&n.get||Qk)(i),[e],t||e)}const cp=Li("id"),Ln=ri(e=>e,[],"identity"),zs=ri(()=>0,[],"zero"),bf=ri(()=>1,[],"one"),Pi=ri(()=>!0,[],"true"),As=ri(()=>!1,[],"false");function bP(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const xP=0,Zk=1,vP=2,EP=3,wP=4;function AP(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bP,i=e||xP;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Zk&&n("error","ERROR",arguments),this},warn(){return i>=vP&&n("warn","WARN",arguments),this},info(){return i>=EP&&n("log","INFO",arguments),this},debug(){return i>=wP&&n("log","DEBUG",arguments),this}}}var Z=Array.isArray;function me(e){return e===Object(e)}const rS=e=>e!=="__proto__";function SP(){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=CP(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;eD(i,o,r[o],s)}return i},{})}function eD(e,t,n,i){if(!rS(t))return;let r,o;if(me(n)&&!Z(n)){o=me(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?eD(o,r,n[r]):rS(r)&&(o[r]=n[r])}else e[t]=n}function CP(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 $e(e){return e[e.length-1]}function mn(e){return e==null||e===""?null:+e}const tD=e=>t=>e*Math.exp(t),nD=e=>t=>Math.log(e*t),iD=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),rD=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Fh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function fp(e,t,n,i){const r=n(e[0]),o=n($e(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function $P(e,t){return fp(e,t,mn,Ln)}function _P(e,t){var n=Math.sign(e[0]);return fp(e,t,nD(n),tD(n))}function FP(e,t,n){return fp(e,t,Fh(n),Fh(1/n))}function kP(e,t,n){return fp(e,t,iD(n),rD(n))}function dp(e,t,n,i,r){const o=i(e[0]),s=i($e(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function oD(e,t,n){return dp(e,t,n,mn,Ln)}function sD(e,t,n){const i=Math.sign(e[0]);return dp(e,t,n,nD(i),tD(i))}function py(e,t,n,i){return dp(e,t,n,Fh(i),Fh(1/i))}function aD(e,t,n,i){return dp(e,t,n,iD(i),rD(i))}function DP(e){return 1+~~(new Date(e).getMonth()/3)}function TP(e){return 1+~~(new Date(e).getUTCMonth()/3)}function oe(e){return e!=null?Z(e)?e:[e]:[]}function MP(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 be(e){return typeof e=="function"}const OP="descending";function uD(e,t,n){n=n||{},t=oe(t)||[];const i=[],r=[],o={},s=n.comparator||RP;return oe(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===OP?-1:1),r.push(a=be(a)?a:Li(a,null,n)),(xn(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:ri(s(r,i),Object.keys(o))}const hp=(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),RP=(e,t)=>e.length===1?NP(e[0],t[0]):LP(e,t,e.length),NP=(e,t)=>function(n,i){return hp(e(n),e(i))*t},LP=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=hp(o(i),o(r));return s*t[a]});function wn(e){return be(e)?e:()=>e}function lD(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function ye(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 lo(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 PP(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 le(e,t){return Object.hasOwn(e,t)}const hd={};function xf(e){let t={},n;function i(o){return le(t,o)&&t[o]!==hd}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]===hd&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=hd),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!==hd&&(!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 IP(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=$e(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 G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ye(i,n)}function tc(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 zP(e){return typeof e=="boolean"}function Ys(e){return Object.prototype.toString.call(e)==="[object Date]"}function BP(e){return e&&be(e[Symbol.iterator])}function sa(e){return typeof e=="number"}function cD(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Ke(e){return typeof e=="string"}function fD(e,t,n){e&&(e=t?oe(e).map(a=>a.replace(/\\(.)/g,"$1")):oe(e));const i=e&&e.length,r=n&&n.get||Qk,o=a=>r(t?[a]:zx(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 ri(s,e,"key")}function UP(e,t){const n=e[0],i=$e(e),r=+t;return r?r===1?i:n+r*(i-n):n}const jP=1e4;function qP(e){e=+e||jP;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=>le(t,s)||le(n,s),get:s=>le(t,s)?t[s]:le(n,s)?o(s,n[s]):void 0,set:(s,a)=>le(t,s)?t[s]=a:o(s,a)}}function WP(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 gd(e,t){let n="";for(;--t>=0;)n+=e;return n}function GP(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?gd(r,s)+o:i==="center"?gd(r,~~(s/2))+o+gd(r,Math.ceil(s/2)):o+gd(r,s)}function gp(e){return e&&$e(e)-e[0]||0}function re(e){return Z(e)?"["+e.map(re)+"]":me(e)||Ke(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function dD(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const HP=e=>sa(e)||Ys(e)?e:Date.parse(e);function hD(e,t){return t=t||HP,e==null||e===""?null:t(e)}function gD(e){return e==null||e===""?null:e+""}function yr(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function VP(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 Ls(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 oS={},xm={},vm=34,kl=10,Em=13;function pD(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function YP(e,t){var n=pD(e);return function(i,r){return t(n(i),r,e)}}function sS(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 XP(e){return e<0?"-"+Fn(-e,6):e>9999?"+"+Fn(e,6):Fn(e,4)}function KP(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":XP(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 JP(e){var t=new RegExp('["'+e+`
2
- \r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?YP(m,d):pD(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,x=!1;f.charCodeAt(g-1)===kl&&--g,f.charCodeAt(g-1)===Em&&--g;function v(){if(b)return xm;if(x)return x=!1,oS;var A,E=p,S;if(f.charCodeAt(E)===vm){for(;p++<g&&f.charCodeAt(p)!==vm||f.charCodeAt(++p)===vm;);return(A=p)>=g?b=!0:(S=f.charCodeAt(p++))===kl?x=!0:S===Em&&(x=!0,f.charCodeAt(p)===kl&&++p),f.slice(E+1,A-1).replace(/""/g,'"')}for(;p<g;){if((S=f.charCodeAt(A=p++))===kl)x=!0;else if(S===Em)x=!0,f.charCodeAt(p)===kl&&++p;else if(S!==n)continue;return f.slice(E,A)}return b=!0,f.slice(E,g)}for(;(y=v())!==xm;){for(var w=[];y!==oS&&y!==xm;)w.push(y),y=v();d&&(w=d(w,m++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function s(f,d){return d==null&&(d=sS(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
1
+ import{J as m8,n as y8,H as at,aG as b8,aH as HA,aI as x8,aJ as v8,aK as Va,aL as Ch,N as E8,z as w8,r as Rt,M as $x,ar as A8,ao as S8,ak as VA,al as YA,X as C8,aM as $8,O as XA,aA as KA,l as Mk,aD as _8,aN as F8,C as k8,j as bm,aO as D8}from"./index.BhbIE27r.js";import{S as JA,T as T8}from"./Toolbar.BJYum78u.js";import{w as M8,E as O8}from"./withFullScreenWrapper.BzKsjBsN.js";import{m as R8}from"./mergeWith.DD6Kt92K.js";import{a as Ic,n as N8,b as L8,c as ep,t as ra,p as P8,d as I8,e as z8,i as us,f as tp,g as QA,l as rl,h as _x,j as np,k as ZA,m as No,o as Cu,q as B8,r as ls,s as U8,u as j8,v as q8,w as W8}from"./threshold.DjX0wlsa.js";import{f as G8,a as hy,b as Ok,c as H8,R as ip,r as Rk,d as Fx,e as kx,C as Dx,g as eS,h as tS,i as rp,j as gy,n as en,k as yf,l as V8,m as Y8,o as X8,p as K8,q as J8,s as Q8,t as Z8,u as e9,v as t9,w as n9,x as i9,y as $h}from"./value.CgPGBV_l.js";import{P as r9,i as o9,a as s9,b as a9,p as Tx,T as u9,n as l9,t as c9,d as f9}from"./timer.CAwTRJ_g.js";import{u as d9}from"./FormClearHelper.DBWnhmsU.js";const h9=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:"rgb(0 0 0 / 16%) 0px 1px 4px",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"}}}}}),g9=y8("div",{target:"e1d0pwhz0"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"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:"rgb(0 0 0 / 16%) 0px 4px 16px",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 nS(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:at(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:at(t.fontSizes.md),titleColor:Va(t),titleFontStyle:"normal",labelFontSize:at(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),labelFontStyle:"normal"},axis:{labelFontSize:at(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:at(t.fontSizes.sm),titleColor:Va(t),titleFontStyle:"normal",ticks:!1,gridColor:Ch(t),domain:!1,domainWidth:1,domainColor:Ch(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:at(t.spacing.lg),labelPadding:at(t.spacing.lg),labelSeparation:at(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:at(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:Va(t),titleFontSize:at(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:Va(t),titlePadding:5,labelPadding:at(t.spacing.lg),columnPadding:at(t.spacing.sm),rowPadding:at(t.spacing.twoXS),padding:7,symbolStrokeWidth:at(t.spacing.twoXS)},range:{category:v8(t),diverging:x8(t),ramp:HA(t),heatmap:HA(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:at(t.sizes.defaultChartHeight),continuousWidth:at(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:b8(t)},bar:{binSpacing:at(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 p9(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:at(i.twoSm),titleFontSize:at(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Ch(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:Ch(t),continuousHeight:at(t.sizes.defaultChartHeight),continuousWidth:at(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?E8({},s,e):s}const m9=20;function y9(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&$x(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const b9=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=nS(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=nS(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=p9(u.config,r),u.title&&(typeof u.title=="string"&&(u.title={text:u.title}),u.title.limit=u.title.limit??Math.max(s-40,0)),o?(u.width=s,u.height=a,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})):t&&(u.width=s,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})),u.padding||(u.padding={}),$x(u.padding.bottom)&&(u.padding.bottom=m9),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&y9(u),u},x9=(e,t,n,i)=>{const r=w8(),{id:o,formId:s,spec:a,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=e,h=Rt.useMemo(()=>d,[JSON.stringify(d)]),g=Rt.useMemo(()=>b9(a,c,f,h,r,t,n||0,i),[a,c,f,h,r,t,n,i]);return{id:o,formId:s,vegaLiteTheme:f,spec:g,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function yo(e,t,n){return e.fields=t||[],e.fname=n,e}function v9(e){return e==null?null:e.fname}function Nk(e){return e==null?null:e.fields}function Lk(e){return e.length===1?E9(e[0]):w9(e)}const E9=e=>function(t){return t[e]},w9=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Qd(e){throw Error(e)}function Mx(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||Qd("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&Qd("Access path missing closing bracket: "+e),i&&Qd("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Ox(e,t,n){const i=Mx(e);return e=i.length===1?i[0]:e,yo((n&&n.get||Lk)(i),[e],t||e)}const A9=Ox("id"),Rx=yo(e=>e,[],"identity"),S9=yo(()=>0,[],"zero"),C9=yo(()=>1,[],"one"),Pk=yo(()=>!0,[],"true"),$9=yo(()=>!1,[],"false");function _9(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Ik=0,zk=1,Bk=2,Uk=3,jk=4;function F9(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_9,i=e||Ik;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=zk&&n(t||"error","ERROR",arguments),this},warn(){return i>=Bk&&n(t||"warn","WARN",arguments),this},info(){return i>=Uk&&n(t||"log","INFO",arguments),this},debug(){return i>=jk&&n(t||"log","DEBUG",arguments),this}}}var op=Array.isArray;function oa(e){return e===Object(e)}const iS=e=>e!=="__proto__";function Nx(){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=k9(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;sp(i,o,r[o],s)}return i},{})}function sp(e,t,n,i){if(!iS(t))return;let r,o;if(oa(n)&&!op(n)){o=oa(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?sp(o,r,n[r]):iS(r)&&(o[r]=n[r])}else e[t]=n}function k9(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 ol(e){return e[e.length-1]}function Lx(e){return e==null||e===""?null:+e}const qk=e=>t=>e*Math.exp(t),Wk=e=>t=>Math.log(e*t),Gk=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Hk=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,_h=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function ap(e,t,n,i){const r=n(e[0]),o=n(ol(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function D9(e,t){return ap(e,t,Lx,Rx)}function T9(e,t){var n=Math.sign(e[0]);return ap(e,t,Wk(n),qk(n))}function M9(e,t,n){return ap(e,t,_h(n),_h(1/n))}function O9(e,t,n){return ap(e,t,Gk(n),Hk(n))}function up(e,t,n,i,r){const o=i(e[0]),s=i(ol(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function R9(e,t,n){return up(e,t,n,Lx,Rx)}function N9(e,t,n){const i=Math.sign(e[0]);return up(e,t,n,Wk(i),qk(i))}function L9(e,t,n,i){return up(e,t,n,_h(i),_h(1/i))}function P9(e,t,n,i){return up(e,t,n,Gk(i),Hk(i))}function I9(e){return 1+~~(new Date(e).getMonth()/3)}function z9(e){return 1+~~(new Date(e).getUTCMonth()/3)}function zc(e){return e!=null?op(e)?e:[e]:[]}function B9(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 lp(e){return typeof e=="function"}const U9="descending";function j9(e,t,n){n=n||{},t=zc(t)||[];const i=[],r=[],o={},s=n.comparator||q9;return zc(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===U9?-1:1),r.push(a=lp(a)?a:Ox(a,null,n)),(Nk(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:yo(s(r,i),Object.keys(o))}const Px=(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),q9=(e,t)=>e.length===1?W9(e[0],t[0]):G9(e,t,e.length),W9=(e,t)=>function(n,i){return Px(e(n),e(i))*t},G9=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=Px(o(i),o(r));return s*t[a]});function H9(e){return lp(e)?e:()=>e}function V9(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Ix(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 Y9(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 X9(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]}const K9=Object.prototype.hasOwnProperty;function Hr(e,t){return K9.call(e,t)}const dd={};function J9(e){let t={},n;function i(o){return Hr(t,o)&&t[o]!==dd}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]===dd&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=dd),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!==dd&&(!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 Q9(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=ol(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 Z9(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Ix(i,n)}function eP(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 Vk(e){return typeof e=="boolean"}function Yk(e){return Object.prototype.toString.call(e)==="[object Date]"}function tP(e){return e&&lp(e[Symbol.iterator])}function Xk(e){return typeof e=="number"}function nP(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function to(e){return typeof e=="string"}function iP(e,t,n){e&&(e=t?zc(e).map(a=>a.replace(/\\(.)/g,"$1")):zc(e));const i=e&&e.length,r=n&&n.get||Lk,o=a=>r(t?[a]:Mx(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 yo(s,e,"key")}function rP(e,t){const n=e[0],i=ol(e),r=+t;return r?r===1?i:n+r*(i-n):n}const oP=1e4;function sP(e){e=+e||oP;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=>Hr(t,s)||Hr(n,s),get:s=>Hr(t,s)?t[s]:Hr(n,s)?o(s,n[s]):void 0,set:(s,a)=>Hr(t,s)?t[s]=a:o(s,a)}}function aP(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 ec(e,t){let n="";for(;--t>=0;)n+=e;return n}function uP(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?ec(r,s)+o:i==="center"?ec(r,~~(s/2))+o+ec(r,Math.ceil(s/2)):o+ec(r,s)}function lP(e){return e&&ol(e)-e[0]||0}function pu(e){return op(e)?"["+e.map(pu)+"]":oa(e)||to(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function cP(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const fP=e=>Xk(e)||Yk(e)?e:Date.parse(e);function dP(e,t){return t=t||fP,e==null||e===""?null:t(e)}function hP(e){return e==null||e===""?null:e+""}function gP(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function pP(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 mP(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)}function ri(e,t,n){return e.fields=t||[],e.fname=n,e}function lt(e){return e==null?null:e.fname}function xn(e){return e==null?null:e.fields}function Kk(e){return e.length===1?yP(e[0]):bP(e)}const yP=e=>function(t){return t[e]},bP=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function L(e){throw Error(e)}function zx(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||L("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&L("Access path missing closing bracket: "+e),i&&L("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Li(e,t,n){const i=zx(e);return e=i.length===1?i[0]:e,ri((n&&n.get||Kk)(i),[e],t||e)}const cp=Li("id"),Ln=ri(e=>e,[],"identity"),zs=ri(()=>0,[],"zero"),bf=ri(()=>1,[],"one"),Pi=ri(()=>!0,[],"true"),As=ri(()=>!1,[],"false");function xP(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const vP=0,Jk=1,EP=2,wP=3,AP=4;function SP(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xP,i=e||vP;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Jk&&n("error","ERROR",arguments),this},warn(){return i>=EP&&n("warn","WARN",arguments),this},info(){return i>=wP&&n("log","INFO",arguments),this},debug(){return i>=AP&&n("log","DEBUG",arguments),this}}}var Z=Array.isArray;function me(e){return e===Object(e)}const rS=e=>e!=="__proto__";function CP(){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=$P(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Qk(i,o,r[o],s)}return i},{})}function Qk(e,t,n,i){if(!rS(t))return;let r,o;if(me(n)&&!Z(n)){o=me(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Qk(o,r,n[r]):rS(r)&&(o[r]=n[r])}else e[t]=n}function $P(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 $e(e){return e[e.length-1]}function mn(e){return e==null||e===""?null:+e}const Zk=e=>t=>e*Math.exp(t),eD=e=>t=>Math.log(e*t),tD=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),nD=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Fh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function fp(e,t,n,i){const r=n(e[0]),o=n($e(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function _P(e,t){return fp(e,t,mn,Ln)}function FP(e,t){var n=Math.sign(e[0]);return fp(e,t,eD(n),Zk(n))}function kP(e,t,n){return fp(e,t,Fh(n),Fh(1/n))}function DP(e,t,n){return fp(e,t,tD(n),nD(n))}function dp(e,t,n,i,r){const o=i(e[0]),s=i($e(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function iD(e,t,n){return dp(e,t,n,mn,Ln)}function rD(e,t,n){const i=Math.sign(e[0]);return dp(e,t,n,eD(i),Zk(i))}function py(e,t,n,i){return dp(e,t,n,Fh(i),Fh(1/i))}function oD(e,t,n,i){return dp(e,t,n,tD(i),nD(i))}function TP(e){return 1+~~(new Date(e).getMonth()/3)}function MP(e){return 1+~~(new Date(e).getUTCMonth()/3)}function oe(e){return e!=null?Z(e)?e:[e]:[]}function OP(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 be(e){return typeof e=="function"}const RP="descending";function sD(e,t,n){n=n||{},t=oe(t)||[];const i=[],r=[],o={},s=n.comparator||NP;return oe(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===RP?-1:1),r.push(a=be(a)?a:Li(a,null,n)),(xn(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:ri(s(r,i),Object.keys(o))}const hp=(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),NP=(e,t)=>e.length===1?LP(e[0],t[0]):PP(e,t,e.length),LP=(e,t)=>function(n,i){return hp(e(n),e(i))*t},PP=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=hp(o(i),o(r));return s*t[a]});function wn(e){return be(e)?e:()=>e}function aD(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function ye(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 lo(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 IP(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 le(e,t){return Object.hasOwn(e,t)}const hd={};function xf(e){let t={},n;function i(o){return le(t,o)&&t[o]!==hd}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]===hd&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=hd),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!==hd&&(!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 zP(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=$e(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 G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ye(i,n)}function tc(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 BP(e){return typeof e=="boolean"}function Ys(e){return Object.prototype.toString.call(e)==="[object Date]"}function UP(e){return e&&be(e[Symbol.iterator])}function sa(e){return typeof e=="number"}function uD(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Ke(e){return typeof e=="string"}function lD(e,t,n){e&&(e=t?oe(e).map(a=>a.replace(/\\(.)/g,"$1")):oe(e));const i=e&&e.length,r=n&&n.get||Kk,o=a=>r(t?[a]:zx(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 ri(s,e,"key")}function jP(e,t){const n=e[0],i=$e(e),r=+t;return r?r===1?i:n+r*(i-n):n}const qP=1e4;function WP(e){e=+e||qP;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=>le(t,s)||le(n,s),get:s=>le(t,s)?t[s]:le(n,s)?o(s,n[s]):void 0,set:(s,a)=>le(t,s)?t[s]=a:o(s,a)}}function GP(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 gd(e,t){let n="";for(;--t>=0;)n+=e;return n}function HP(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?gd(r,s)+o:i==="center"?gd(r,~~(s/2))+o+gd(r,Math.ceil(s/2)):o+gd(r,s)}function gp(e){return e&&$e(e)-e[0]||0}function re(e){return Z(e)?"["+e.map(re)+"]":me(e)||Ke(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function cD(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const VP=e=>sa(e)||Ys(e)?e:Date.parse(e);function fD(e,t){return t=t||VP,e==null||e===""?null:t(e)}function dD(e){return e==null||e===""?null:e+""}function yr(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function YP(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 Ls(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 oS={},xm={},vm=34,kl=10,Em=13;function hD(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function XP(e,t){var n=hD(e);return function(i,r){return t(n(i),r,e)}}function sS(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 KP(e){return e<0?"-"+Fn(-e,6):e>9999?"+"+Fn(e,6):Fn(e,4)}function JP(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":KP(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 QP(e){var t=new RegExp('["'+e+`
2
+ \r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?XP(m,d):hD(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,x=!1;f.charCodeAt(g-1)===kl&&--g,f.charCodeAt(g-1)===Em&&--g;function v(){if(b)return xm;if(x)return x=!1,oS;var A,E=p,S;if(f.charCodeAt(E)===vm){for(;p++<g&&f.charCodeAt(p)!==vm||f.charCodeAt(++p)===vm;);return(A=p)>=g?b=!0:(S=f.charCodeAt(p++))===kl?x=!0:S===Em&&(x=!0,f.charCodeAt(p)===kl&&++p),f.slice(E+1,A-1).replace(/""/g,'"')}for(;p<g;){if((S=f.charCodeAt(A=p++))===kl)x=!0;else if(S===Em)x=!0,f.charCodeAt(p)===kl&&++p;else if(S!==n)continue;return f.slice(E,A)}return b=!0,f.slice(E,g)}for(;(y=v())!==xm;){for(var w=[];y!==oS&&y!==xm;)w.push(y),y=v();d&&(w=d(w,m++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function s(f,d){return d==null&&(d=sS(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
3
3
  `)}function a(f,d){return d==null&&(d=sS(f)),o(f,d).join(`
4
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?KP(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function QP(e){return e}function ZP(e){if(e==null)return QP;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 eI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function tI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return aS(e,n)})}:aS(e,t)}function aS(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=mD(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 mD(e,t){var n=ZP(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&eI(f,g)}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 nI(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,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.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 iI(e){return mD(e,rI.apply(this,arguments))}function rI(e,t,n){var i,r,o;if(arguments.length>1)i=oI(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:nI(e,i)}}function oI(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 sI(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 aI(e,t){const n=sI(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 uS extends Map{constructor(t,n=xD){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(my(this,t))}has(t){return super.has(my(this,t))}set(t,n){return super.set(yD(this,t),n)}delete(t){return super.delete(bD(this,t))}}class kh extends Set{constructor(t,n=xD){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(my(this,t))}add(t){return super.add(yD(this,t))}delete(t){return super.delete(bD(this,t))}}function my({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function yD({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function bD({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function xD(e){return e!==null&&typeof e=="object"?e.valueOf():e}function uI(e,t){return Array.from(t,n=>e[n])}function lI(e=Ic){if(e===Ic)return vD;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 vD(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Xs(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 yy(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 ED(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?vD:lI(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)),g=Math.min(i,Math.floor(t+(u-l)*f/u+d));ED(e,t,h,g,r)}const o=e[t];let s=n,a=i;for(Dl(e,n,t),r(e[i],o)>0&&Dl(e,n,i);s<a;){for(Dl(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Dl(e,n,a):(++a,Dl(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Dl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function by(e,t,n){if(e=Float64Array.from(R8(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return yy(e);if(t>=1)return Xs(e);var i,r=(i-1)*t,o=Math.floor(r),s=Xs(ED(e,o).subarray(0,o+1)),a=yy(e.subarray(o+1));return s+(a-s)*(r-o)}}function wD(e,t,n=N8){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 cI(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 AD(e,t){return by(e,.5,t)}function*fI(e){for(const t of e)yield*t}function SD(e){return Array.from(fI(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 CD(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function dI(e,...t){e=new kh(e),t=t.map(hI);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function hI(e){return e instanceof kh?e:new kh(e)}function gI(...e){const t=new kh;for(const n of e)for(const i of n)t.add(i);return t}const wm=new Date,Am=new Date;function Et(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=>Et(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)=>(wm.setTime(+o),Am.setTime(+s),e(wm),e(Am),Math.floor(n(wm,Am))),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 $u=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$u.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$u);$u.range;const Xr=1e3,li=Xr*60,Kr=li*60,co=Kr*24,Bx=co*7,lS=co*30,Sm=co*365,Jr=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getUTCSeconds());Jr.range;const pp=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xr)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getMinutes());pp.range;const mp=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getUTCMinutes());mp.range;const yp=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xr-e.getMinutes()*li)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getHours());yp.range;const bp=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCHours());bp.range;const no=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*li)/co,e=>e.getDate()-1);no.range;const Go=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>e.getUTCDate()-1);Go.range;const $D=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>Math.floor(e/co));$D.range;function Fa(e){return Et(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())*li)/Bx)}const sl=Fa(0),Dh=Fa(1),pI=Fa(2),mI=Fa(3),_u=Fa(4),yI=Fa(5),bI=Fa(6);sl.range;Dh.range;pI.range;mI.range;_u.range;yI.range;bI.range;function ka(e){return Et(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)/Bx)}const al=ka(0),Th=ka(1),xI=ka(2),vI=ka(3),Fu=ka(4),EI=ka(5),wI=ka(6);al.range;Th.range;xI.range;vI.range;Fu.range;EI.range;wI.range;const Bc=Et(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());Bc.range;const Uc=Et(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());Uc.range;const br=Et(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());br.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});br.range;const xr=Et(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());xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});xr.range;function _D(e,t,n,i,r,o){const s=[[Jr,1,Xr],[Jr,5,5*Xr],[Jr,15,15*Xr],[Jr,30,30*Xr],[o,1,li],[o,5,5*li],[o,15,15*li],[o,30,30*li],[r,1,Kr],[r,3,3*Kr],[r,6,6*Kr],[r,12,12*Kr],[i,1,co],[i,2,2*co],[n,1,Bx],[t,1,lS],[t,3,3*lS],[e,1,Sm]];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),g=h?h.range(l,+c+1):[];return d?g.reverse():g}function u(l,c,f){const d=Math.abs(c-l)/f,h=ep(([,,m])=>m).right(s,d);if(h===s.length)return e.every(ra(l/Sm,c/Sm,f));if(h===0)return $u.every(Math.max(ra(l,c,f),1));const[g,p]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return g.every(p)}return[a,u]}const[AI,SI]=_D(xr,Uc,al,$D,bp,mp),[CI,$I]=_D(br,Bc,sl,no,yp,pp),jt="year",Pn="quarter",nn="month",bt="week",In="date",Zt="day",vr="dayofyear",ei="hours",ti="minutes",pi="seconds",Ii="milliseconds",Ux=[jt,Pn,nn,bt,In,Zt,vr,ei,ti,pi,Ii],Cm=Ux.reduce((e,t,n)=>(e[t]=1+n,e),{});function jx(e){const t=oe(e).slice(),n={};return t.length||L("Missing time unit."),t.forEach(r=>{le(Cm,r)?n[r]=1:L(`Invalid time unit: ${r}.`)}),(n[bt]||n[Zt]?1:0)+(n[Pn]||n[nn]||n[In]?1:0)+(n[vr]?1:0)>1&&L(`Incompatible time units: ${e}`),t.sort((r,o)=>Cm[r]-Cm[o]),t}const _I={[jt]:"%Y ",[Pn]:"Q%q ",[nn]:"%b ",[In]:"%d ",[bt]:"W%U ",[Zt]:"%a ",[vr]:"%j ",[ei]:"%H:00",[ti]:"00:%M",[pi]:":%S",[Ii]:".%L",[`${jt}-${nn}`]:"%Y-%m ",[`${jt}-${nn}-${In}`]:"%Y-%m-%d ",[`${ei}-${ti}`]:"%H:%M"};function FD(e,t){const n=ye({},_I,t),i=jx(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 Bs=new Date;function qx(e){return Bs.setFullYear(e),Bs.setMonth(0),Bs.setDate(1),Bs.setHours(0,0,0,0),Bs}function kD(e){return TD(new Date(e))}function DD(e){return xy(new Date(e))}function TD(e){return no.count(qx(e.getFullYear())-1,e)}function xy(e){return sl.count(qx(e.getFullYear())-1,e)}function vy(e){return qx(e).getDay()}function FI(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 MD(e){return RD(new Date(e))}function OD(e){return Ey(new Date(e))}function RD(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Go.count(t-1,e)}function Ey(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return al.count(t-1,e)}function wy(e){return Bs.setTime(Date.UTC(e,0,1)),Bs.getUTCDay()}function kI(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 ND(e,t,n,i,r){const o=t||1,s=$e(e),a=(y,b,x)=>(x=x||y,DI(n[x],i[x],y===s&&o,b)),u=new Date,l=yr(e),c=l[jt]?a(jt):wn(2012),f=l[nn]?a(nn):l[Pn]?a(Pn):zs,d=l[bt]&&l[Zt]?a(Zt,1,bt+Zt):l[bt]?a(bt,1):l[Zt]?a(Zt,1):l[In]?a(In,1):l[vr]?a(vr,1):bf,h=l[ei]?a(ei):zs,g=l[ti]?a(ti):zs,p=l[pi]?a(pi):zs,m=l[Ii]?a(Ii):zs;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function DI(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 ku(e,t,n){return t+e*7-(n+6)%7}const TI={[jt]:e=>e.getFullYear(),[Pn]:e=>Math.floor(e.getMonth()/3),[nn]:e=>e.getMonth(),[In]:e=>e.getDate(),[ei]:e=>e.getHours(),[ti]:e=>e.getMinutes(),[pi]:e=>e.getSeconds(),[Ii]:e=>e.getMilliseconds(),[vr]:e=>TD(e),[bt]:e=>xy(e),[bt+Zt]:(e,t)=>ku(xy(e),e.getDay(),vy(t)),[Zt]:(e,t)=>ku(1,e.getDay(),vy(t))},MI={[Pn]:e=>3*e,[bt]:(e,t)=>ku(e,0,vy(t))};function LD(e,t){return ND(e,t||1,TI,MI,FI)}const OI={[jt]:e=>e.getUTCFullYear(),[Pn]:e=>Math.floor(e.getUTCMonth()/3),[nn]:e=>e.getUTCMonth(),[In]:e=>e.getUTCDate(),[ei]:e=>e.getUTCHours(),[ti]:e=>e.getUTCMinutes(),[pi]:e=>e.getUTCSeconds(),[Ii]:e=>e.getUTCMilliseconds(),[vr]:e=>RD(e),[bt]:e=>Ey(e),[Zt]:(e,t)=>ku(1,e.getUTCDay(),wy(t)),[bt+Zt]:(e,t)=>ku(Ey(e),e.getUTCDay(),wy(t))},RI={[Pn]:e=>3*e,[bt]:(e,t)=>ku(e,0,wy(t))};function PD(e,t){return ND(e,t||1,OI,RI,kI)}const NI={[jt]:br,[Pn]:Bc.every(3),[nn]:Bc,[bt]:sl,[In]:no,[Zt]:no,[vr]:no,[ei]:yp,[ti]:pp,[pi]:Jr,[Ii]:$u},LI={[jt]:xr,[Pn]:Uc.every(3),[nn]:Uc,[bt]:al,[In]:Go,[Zt]:Go,[vr]:Go,[ei]:bp,[ti]:mp,[pi]:Jr,[Ii]:$u};function ul(e){return NI[e]}function ll(e){return LI[e]}function ID(e,t,n){return e?e.offset(t,n):void 0}function zD(e,t,n){return ID(ul(e),t,n)}function BD(e,t,n){return ID(ll(e),t,n)}function UD(e,t,n,i){return e?e.range(t,n,i):void 0}function jD(e,t,n,i){return UD(ul(e),t,n,i)}function qD(e,t,n,i){return UD(ll(e),t,n,i)}const nc=1e3,ic=nc*60,rc=ic*60,xp=rc*24,PI=xp*7,cS=xp*30,Ay=xp*365,WD=[jt,nn,In,ei,ti,pi,Ii],oc=WD.slice(0,-1),sc=oc.slice(0,-1),ac=sc.slice(0,-1),II=ac.slice(0,-1),zI=[jt,bt],fS=[jt,nn],GD=[jt],Tl=[[oc,1,nc],[oc,5,5*nc],[oc,15,15*nc],[oc,30,30*nc],[sc,1,ic],[sc,5,5*ic],[sc,15,15*ic],[sc,30,30*ic],[ac,1,rc],[ac,3,3*rc],[ac,6,6*rc],[ac,12,12*rc],[II,1,xp],[zI,1,PI],[fS,1,cS],[fS,3,3*cS],[GD,1,Ay]];function HD(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(gp(t))/n;let r=ep(a=>a[2]).right(Tl,i),o,s;return r===Tl.length?(o=GD,s=ra(t[0]/Ay,t[1]/Ay,n)):r?(r=Tl[i/Tl[r-1][2]<Tl[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=WD,s=Math.max(ra(t[0],t[1],n),1)),{units:o,step:s}}function $m(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 _m(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 Ml(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function VD(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=Ol(r),c=Rl(r),f=Ol(o),d=Rl(o),h=Ol(s),g=Rl(s),p=Ol(a),m=Rl(a),y=Ol(u),b=Rl(u),x={a:P,A:z,b:I,B:V,c:null,d:yS,e:yS,f:u7,g:b7,G:v7,H:o7,I:s7,j:a7,L:YD,m:l7,M:c7,p:ue,q:ie,Q:vS,s:ES,S:f7,u:d7,U:h7,V:g7,w:p7,W:m7,x:null,X:null,y:y7,Y:x7,Z:E7,"%":xS},v={a:he,A:We,b:ge,B:Ht,c:null,d:bS,e:bS,f:C7,g:N7,G:P7,H:w7,I:A7,j:S7,L:KD,m:$7,M:_7,p:ws,q:_o,Q:vS,s:ES,S:F7,u:k7,U:D7,V:T7,w:M7,W:O7,x:null,X:null,y:R7,Y:L7,Z:I7,"%":xS},w={a:_,A:F,b:O,B:T,c:k,d:pS,e:pS,f:t7,g:gS,G:hS,H:mS,I:mS,j:JI,L:e7,m:KI,M:QI,p:C,q:XI,Q:i7,s:r7,S:ZI,u:WI,U:GI,V:HI,w:qI,W:VI,x:$,X:D,y:gS,Y:hS,Z:YI,"%":n7};x.x=A(n,x),x.X=A(i,x),x.c=A(t,x),v.x=A(n,v),v.X=A(i,v),v.c=A(t,v);function A(Y,pe){return function(ve){var W=[],Rt=-1,Ne=0,Vt=Y.length,At,Zi,fd;for(ve instanceof Date||(ve=new Date(+ve));++Rt<Vt;)Y.charCodeAt(Rt)===37&&(W.push(Y.slice(Ne,Rt)),(Zi=dS[At=Y.charAt(++Rt)])!=null?At=Y.charAt(++Rt):Zi=At==="e"?" ":"0",(fd=pe[At])&&(At=fd(ve,Zi)),W.push(At),Ne=Rt+1);return W.push(Y.slice(Ne,Rt)),W.join("")}}function E(Y,pe){return function(ve){var W=Ml(1900,void 0,1),Rt=S(W,Y,ve+="",0),Ne,Vt;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(pe&&!("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?(Ne=_m(Ml(W.y,0,1)),Vt=Ne.getUTCDay(),Ne=Vt>4||Vt===0?Th.ceil(Ne):Th(Ne),Ne=Go.offset(Ne,(W.V-1)*7),W.y=Ne.getUTCFullYear(),W.m=Ne.getUTCMonth(),W.d=Ne.getUTCDate()+(W.w+6)%7):(Ne=$m(Ml(W.y,0,1)),Vt=Ne.getDay(),Ne=Vt>4||Vt===0?Dh.ceil(Ne):Dh(Ne),Ne=no.offset(Ne,(W.V-1)*7),W.y=Ne.getFullYear(),W.m=Ne.getMonth(),W.d=Ne.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),Vt="Z"in W?_m(Ml(W.y,0,1)).getUTCDay():$m(Ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Vt+5)%7:W.w+W.U*7-(Vt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,_m(W)):$m(W)}}function S(Y,pe,ve,W){for(var Rt=0,Ne=pe.length,Vt=ve.length,At,Zi;Rt<Ne;){if(W>=Vt)return-1;if(At=pe.charCodeAt(Rt++),At===37){if(At=pe.charAt(Rt++),Zi=w[At in dS?pe.charAt(Rt++):At],!Zi||(W=Zi(Y,ve,W))<0)return-1}else if(At!=ve.charCodeAt(W++))return-1}return W}function C(Y,pe,ve){var W=l.exec(pe.slice(ve));return W?(Y.p=c.get(W[0].toLowerCase()),ve+W[0].length):-1}function _(Y,pe,ve){var W=h.exec(pe.slice(ve));return W?(Y.w=g.get(W[0].toLowerCase()),ve+W[0].length):-1}function F(Y,pe,ve){var W=f.exec(pe.slice(ve));return W?(Y.w=d.get(W[0].toLowerCase()),ve+W[0].length):-1}function O(Y,pe,ve){var W=y.exec(pe.slice(ve));return W?(Y.m=b.get(W[0].toLowerCase()),ve+W[0].length):-1}function T(Y,pe,ve){var W=p.exec(pe.slice(ve));return W?(Y.m=m.get(W[0].toLowerCase()),ve+W[0].length):-1}function k(Y,pe,ve){return S(Y,t,pe,ve)}function $(Y,pe,ve){return S(Y,n,pe,ve)}function D(Y,pe,ve){return S(Y,i,pe,ve)}function P(Y){return s[Y.getDay()]}function z(Y){return o[Y.getDay()]}function I(Y){return u[Y.getMonth()]}function V(Y){return a[Y.getMonth()]}function ue(Y){return r[+(Y.getHours()>=12)]}function ie(Y){return 1+~~(Y.getMonth()/3)}function he(Y){return s[Y.getUTCDay()]}function We(Y){return o[Y.getUTCDay()]}function ge(Y){return u[Y.getUTCMonth()]}function Ht(Y){return a[Y.getUTCMonth()]}function ws(Y){return r[+(Y.getUTCHours()>=12)]}function _o(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var pe=A(Y+="",x);return pe.toString=function(){return Y},pe},parse:function(Y){var pe=E(Y+="",!1);return pe.toString=function(){return Y},pe},utcFormat:function(Y){var pe=A(Y+="",v);return pe.toString=function(){return Y},pe},utcParse:function(Y){var pe=E(Y+="",!0);return pe.toString=function(){return Y},pe}}}var dS={"-":"",_:" ",0:"0"},Mt=/^\s*\d+/,BI=/^%/,UI=/[\\^$*+?|[\]().{}]/g;function Te(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 jI(e){return e.replace(UI,"\\$&")}function Ol(e){return new RegExp("^(?:"+e.map(jI).join("|")+")","i")}function Rl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function qI(e,t,n){var i=Mt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function WI(e,t,n){var i=Mt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function GI(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function HI(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function VI(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function hS(e,t,n){var i=Mt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function gS(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 YI(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 XI(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 KI(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 pS(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function JI(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 mS(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function QI(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function ZI(e,t,n){var i=Mt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function e7(e,t,n){var i=Mt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function t7(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 n7(e,t,n){var i=BI.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function i7(e,t,n){var i=Mt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function r7(e,t,n){var i=Mt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function yS(e,t){return Te(e.getDate(),t,2)}function o7(e,t){return Te(e.getHours(),t,2)}function s7(e,t){return Te(e.getHours()%12||12,t,2)}function a7(e,t){return Te(1+no.count(br(e),e),t,3)}function YD(e,t){return Te(e.getMilliseconds(),t,3)}function u7(e,t){return YD(e,t)+"000"}function l7(e,t){return Te(e.getMonth()+1,t,2)}function c7(e,t){return Te(e.getMinutes(),t,2)}function f7(e,t){return Te(e.getSeconds(),t,2)}function d7(e){var t=e.getDay();return t===0?7:t}function h7(e,t){return Te(sl.count(br(e)-1,e),t,2)}function XD(e){var t=e.getDay();return t>=4||t===0?_u(e):_u.ceil(e)}function g7(e,t){return e=XD(e),Te(_u.count(br(e),e)+(br(e).getDay()===4),t,2)}function p7(e){return e.getDay()}function m7(e,t){return Te(Dh.count(br(e)-1,e),t,2)}function y7(e,t){return Te(e.getFullYear()%100,t,2)}function b7(e,t){return e=XD(e),Te(e.getFullYear()%100,t,2)}function x7(e,t){return Te(e.getFullYear()%1e4,t,4)}function v7(e,t){var n=e.getDay();return e=n>=4||n===0?_u(e):_u.ceil(e),Te(e.getFullYear()%1e4,t,4)}function E7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Te(t/60|0,"0",2)+Te(t%60,"0",2)}function bS(e,t){return Te(e.getUTCDate(),t,2)}function w7(e,t){return Te(e.getUTCHours(),t,2)}function A7(e,t){return Te(e.getUTCHours()%12||12,t,2)}function S7(e,t){return Te(1+Go.count(xr(e),e),t,3)}function KD(e,t){return Te(e.getUTCMilliseconds(),t,3)}function C7(e,t){return KD(e,t)+"000"}function $7(e,t){return Te(e.getUTCMonth()+1,t,2)}function _7(e,t){return Te(e.getUTCMinutes(),t,2)}function F7(e,t){return Te(e.getUTCSeconds(),t,2)}function k7(e){var t=e.getUTCDay();return t===0?7:t}function D7(e,t){return Te(al.count(xr(e)-1,e),t,2)}function JD(e){var t=e.getUTCDay();return t>=4||t===0?Fu(e):Fu.ceil(e)}function T7(e,t){return e=JD(e),Te(Fu.count(xr(e),e)+(xr(e).getUTCDay()===4),t,2)}function M7(e){return e.getUTCDay()}function O7(e,t){return Te(Th.count(xr(e)-1,e),t,2)}function R7(e,t){return Te(e.getUTCFullYear()%100,t,2)}function N7(e,t){return e=JD(e),Te(e.getUTCFullYear()%100,t,2)}function L7(e,t){return Te(e.getUTCFullYear()%1e4,t,4)}function P7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fu(e):Fu.ceil(e),Te(e.getUTCFullYear()%1e4,t,4)}function I7(){return"+0000"}function xS(){return"%"}function vS(e){return+e}function ES(e){return Math.floor(+e/1e3)}var Ya,Wx,QD,Gx,ZD;z7({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 z7(e){return Ya=VD(e),Wx=Ya.format,QD=Ya.parse,Gx=Ya.utcFormat,ZD=Ya.utcParse,Ya}function uc(e){const t={};return n=>t[n]||(t[n]=e(n))}function B7(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=U7(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 U7(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 e3(e){const t=uc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=hy(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return B7(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=hy(s??",f");const a=ra(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=I8(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=P8(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=L8(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let Sy;t3();function t3(){return Sy=e3({format:Nk,formatPrefix:G8})}function n3(e){return e3(W8(e))}function Mh(e){return arguments.length?Sy=n3(e):Sy}function wS(e,t,n){n=n||{},me(n)||L(`Invalid time multi-format specifier: ${n}`);const i=t(pi),r=t(ti),o=t(ei),s=t(In),a=t(bt),u=t(nn),l=t(Pn),c=t(jt),f=e(n[Ii]||".%L"),d=e(n[pi]||":%S"),h=e(n[ti]||"%I:%M"),g=e(n[ei]||"%I %p"),p=e(n[In]||n[Zt]||"%a %d"),m=e(n[bt]||"%b %d"),y=e(n[nn]||"%B"),b=e(n[Pn]||"%B"),x=e(n[jt]||"%Y");return v=>(i(v)<v?f:r(v)<v?d:o(v)<v?h:s(v)<v?g:u(v)<v?a(v)<v?p:m:c(v)<v?l(v)<v?y:b:x)(v)}function i3(e){const t=uc(e.format),n=uc(e.utcFormat);return{timeFormat:i=>Ke(i)?t(i):wS(t,ul,i),utcFormat:i=>Ke(i)?n(i):wS(n,ll,i),timeParse:uc(e.parse),utcParse:uc(e.utcParse)}}let Cy;r3();function r3(){return Cy=i3({format:Wx,parse:QD,utcFormat:Gx,utcParse:ZD})}function o3(e){return i3(VD(e))}function jc(e){return arguments.length?Cy=o3(e):Cy}const $y=(e,t)=>ye({},e,t);function s3(e,t){const n=e?n3(e):Mh(),i=t?o3(t):jc();return $y(n,i)}function Hx(e,t){const n=arguments.length;return n&&n!==2&&L("defaultLocale expects either zero or two arguments."),n?$y(Mh(e),jc(t)):$y(Mh(),jc())}function j7(){return t3(),r3(),Hx()}const q7=/^(data:|([A-Za-z]+:)?\/\/)/,W7=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,G7=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,AS="file://";function H7(e,t){return n=>({options:n||{},sanitize:Y7,load:V7,fileAccess:!1,file:X7(t),http:J7(e)})}async function V7(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Y7(e,t){t=ye({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=W7.test(e.replace(G7,""));(e==null||typeof e!="string"||!a)&&L("Sanitize failure, invalid URI: "+re(e));const u=q7.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(AS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(AS.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 X7(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):K7}async function K7(){L("No file system access.")}function J7(e){return e?async function(t,n){const i=ye({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?be(o[r])?o[r]():o.text():L(o.status+""+o.statusText)}:Q7}async function Q7(){L("No HTTP fetch method available.")}const Z7=e=>e!=null&&e===e,ez=e=>e==="true"||e==="false"||e===!0||e===!1,tz=e=>!Number.isNaN(Date.parse(e)),a3=e=>!Number.isNaN(+e)&&!(e instanceof Date),nz=e=>a3(e)&&Number.isInteger(+e),_y={boolean:dD,integer:mn,number:mn,date:hD,string:gD,unknown:Ln},pd=[ez,nz,a3,tz],iz=["boolean","integer","number","date"];function u3(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=pd.length,r=pd.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]&&Z7(u)&&!pd[a](u)&&(r[a]=0,++s,s===pd.length))return"string";return iz[r.reduce((o,s)=>o===0?s:o,0)-1]}function l3(e,t){return t.reduce((n,i)=>(n[i]=u3(e,i),n),{})}function SS(e){const t=function(n,i){const r={delimiter:e};return Vx(n,i?ye(i,r):r)};return t.responseType="text",t}function Vx(e,t){return t.header&&(e=t.header.map(re).join(t.delimiter)+`
6
- `+e),JP(t.delimiter).parse(e+"")}Vx.responseType="text";function rz(e){return typeof Buffer=="function"&&be(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Yx(e,t){const n=t&&t.property?Li(t.property):Ln;return me(e)&&!rz(e)?oz(n(e),t):n(JSON.parse(e))}Yx.responseType="json";function oz(e,t){return!Z(e)&&BP(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const sz={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function c3(e,t){let n,i,r,o;return e=Yx(e,t),t&&t.feature?(n=tI,r=t.feature):t&&t.mesh?(n=iI,r=t.mesh,o=sz[t.filter]):L("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):L("Invalid TopoJSON object: "+r),i&&i.features||[i]}c3.responseType="json";const Zd={dsv:Vx,csv:SS(","),tsv:SS(" "),json:Yx,topojson:c3};function Xx(e,t){return arguments.length>1?(Zd[e]=t,this):le(Zd,e)?Zd[e]:null}function f3(e){const t=Xx(e);return t&&t.responseType||"text"}function d3(e,t,n,i){t=t||{};const r=Xx(t.type||"json");return r||L("Unknown data format type: "+t.type),e=r(e,t),t.parse&&az(e,t.parse,n,i),le(e,"columns")&&delete e.columns,e}function az(e,t,n,i){if(!e.length)return;const r=jc();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=l3(e,o)),o=Object.keys(t);const d=o.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!_y[g])throw Error("Illegal format pattern: "+h+":"+g);return _y[g]});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 vp=H7(typeof fetch<"u"&&fetch,null);function Ep(e){const t=e||Ln,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 eh(e,t){try{await t(e)}catch(n){e.error(n)}}const h3=Symbol("vega_id");let uz=1;function wp(e){return!!(e&&te(e))}function te(e){return e[h3]}function g3(e,t){return e[h3]=t,e}function Oe(e){const t=e===Object(e)?e:{data:e};return te(t)?t:g3(t,uz++)}function Kx(e){return Ap(e,Oe({}))}function Ap(e,t){for(const n in e)t[n]=e[n];return t}function p3(e,t){return g3(t,te(e))}function Da(e,t){return e?t?(n,i)=>e(n,i)||te(t(n))-te(t(i)):(n,i)=>e(n,i)||te(n)-te(i):null}function m3(e){return e&&e.constructor===Ta}function Ta(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:Ta,insert(a){const u=oe(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=be(a)?i:t,l=oe(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:wn(l)};return be(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return be(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,g,p,m;for(f=0,d=u.length;f<d;++f)l[te(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[te(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[te(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=te(p),l[m]?l[m]=1:a.add.push(Oe(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[te(p)]<0&&a.rem.push(p);function y(b,x,v){v?b[x]=v(b):a.encode=x,s||(c[te(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[te(p)],m>0&&(y(p,g,h.value),a.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[te(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[te(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 th="_:mod:_";function Sp(){Object.defineProperty(this,th,{writable:!0,value:{}})}Sp.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[th];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[th];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[th]={},this}};let lz=0;const cz="pulse",fz=new Sp,dz=1,hz=2;function Ge(e,t,n,i){this.id=++lz,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 CS(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ge.prototype={targets(){return this._targets||(this._targets=Ep(cp))},set(e){return this.value!==e?(this.value=e,1):0},skip:CS(dz),modified:CS(hz),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Sp,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Ge?(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===cz)oe(a).forEach(f=>{f instanceof Ge?f!==this&&(f.targets().add(this),o.push(f)):L("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||fz,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 gz(e,t,n,i){let r=1,o;return e instanceof Ge?o=e:e&&e.prototype instanceof Ge?o=new e:be(e)?o=new Ge(null,e):(r=0,o=new Ge(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function pz(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 mz=0;function Cp(e,t,n){this.id=++mz,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function ko(e,t,n){return new Cp(e,t,n)}Cp.prototype={_filter:Pi,_apply:Ln,targets(){return this._targets||(this._targets=Ep(cp))},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=ko(e);return this.targets().add(t),t},apply(e){const t=ko(null,e);return this.targets().add(t),t},merge(){const e=ko();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=ko();return this.targets().add(ko(null,null,lD(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(ko(null,null,()=>n=!0)),t.targets().add(ko(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Pi,this._targets=null}};function yz(e,t,n,i){const r=this,o=ko(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=oe(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function bz(e,t){const n=this.locale();return d3(e,t,n.timeParse,n.utcParse)}function xz(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function vz(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:f3(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 Ez(e,t,n){const i=this,r=i._pending||wz(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Pi).insert(o.data||[])),r.done(),o}function wz(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 Az={skip:!0};function Sz(e,t,n,i,r){return(e instanceof Ge?$z:Cz)(this,e,t,n,i,r),this}function Cz(e,t,n,i,r,o){const s=ye({},o,Az);let a,u;be(n)||(n=wn(n)),i===void 0?a=l=>e.touch(n(l)):be(i)?(u=new Ge(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;m3(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function $z(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Ge(null,_z(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 _z(e,t){return t=be(t)?t:wn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function Fz(e){e.rank=++this._rank}function kz(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&&L("Cycle detected in dataflow graph.")}const Oh={},rr=1,To=2,jr=4,Dz=rr|To,$S=rr|jr,Xa=rr|To|jr,_S=8,Nl=16,FS=32,kS=64;function Ho(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Fm(e,t){const n=[];return Ls(e,t,i=>n.push(i)),n}function DS(e,t){const n={};return e.visit(t,i=>{n[te(i)]=1}),i=>n[te(i)]?null:i}function md(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ho.prototype={StopPropagation:Oh,ADD:rr,REM:To,MOD:jr,ADD_REM:Dz,ADD_MOD:$S,ALL:Xa,REFLOW:_S,SOURCE:Nl,NO_SOURCE:FS,NO_FIELDS:kS,fork(e){return new Ho(this.dataflow).init(this,e)},clone(){const e=this.fork(Xa);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(Xa|Nl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ho(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&kS)&&(n.fields=e.fields),t&rr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&To?(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&FS?(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||Xa;return t&rr&&this.add.length||t&To&&this.rem.length||t&jr&&this.mod.length},reflow(e){if(e)return this.fork(Xa).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(jr,DS(this,rr))),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&rr&&(n.addF=md(n.addF,t)),e&To&&(n.remF=md(n.remF,t)),e&jr&&(n.modF=md(n.modF,t)),e&Nl&&(n.srcF=md(n.srcF,t)),n},materialize(e){e=e||Xa;const t=this;return e&rr&&t.addF&&(t.add=Fm(t.add,t.addF),t.addF=null),e&To&&t.remF&&(t.rem=Fm(t.rem,t.remF),t.remF=null),e&jr&&t.modF&&(t.mod=Fm(t.mod,t.modF),t.modF=null),e&Nl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Nl)return Ls(n.source,n.srcF,i),n;e&rr&&Ls(n.add,n.addF,i),e&To&&Ls(n.rem,n.remF,i),e&jr&&Ls(n.mod,n.modF,i);const r=n.source;if(e&_S&&r){const o=n.add.length+n.mod.length;o===r.length||(o?Ls(r,DS(n,$S),i):Ls(r,n.srcF,i))}return n}};function Jx(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}G(Jx,Ho,{fork(e){const t=new Ho(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(){L("MultiPulse does not support filtering.")},materialize(){L("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 Tz(e,t,n){const i=this,r=[];if(i._pulse)return y3(i);if(i._pending&&await i._pending,t&&await eh(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Ho(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ep(cp);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=Oh),u!==Oh&&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 eh(i,c[f].callback)}return n&&await eh(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 Mz(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 Oz(e,t,n){return this._pulse?y3(this):(this.evaluate(e,t,n),this)}function Rz(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 y3(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function Nz(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function Lz(e,t){const n=e.source,i=this._clock;return n&&Z(n)?new Jx(this,i,n.map(r=>r.pulse),t):this._input[e.id]||Pz(this._pulse,n&&n.pulse)}function Pz(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Oh&&(e.source=t.source),e)}const Qx={skip:!1,force:!1};function Iz(e,t){const n=t||Qx;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function zz(e,t,n){const i=n||Qx;return(e.set(t)||i.force)&&this.touch(e,i),this}function Bz(e,t,n){this.touch(e,n||Qx);const i=new Ho(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 Uz(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),b3(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,jz(t,0,e)):i=n,i}}}function b3(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 jz(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,b3(e,i,t,n)}function mu(){this.logger(AP()),this.logLevel(Zk),this._clock=0,this._rank=0,this._locale=Hx();try{this._loader=vp()}catch{}this._touched=Ep(cp),this._input={},this._pulse=null,this._heap=Uz((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Ll(e){return function(){return this._log[e].apply(this,arguments)}}mu.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:Ll("error"),warn:Ll("warn"),info:Ll("info"),debug:Ll("debug"),logLevel:Ll("level"),cleanThreshold:1e4,add:gz,connect:pz,rank:Fz,rerank:kz,pulse:Bz,touch:Iz,update:zz,changeset:Ta,ingest:xz,parse:bz,preload:Ez,request:vz,events:yz,on:Sz,evaluate:Tz,run:Oz,runAsync:Mz,runAfter:Rz,_enqueue:Nz,_getPulse:Lz};function M(e,t){Ge.call(this,e,null,t)}G(M,Ge,{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 Du={};function x3(e){const t=v3(e);return t&&t.Definition||null}function v3(e){return e=e&&e.toLowerCase(),le(Du,e)?Du[e]:null}function*E3(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 Zx(e,t,n){const i=Float64Array.from(E3(e,n));return i.sort(Ic),t.map(r=>wD(i,r))}function ev(e,t){return Zx(e,[.25,.5,.75],t)}function tv(e,t){const n=e.length,i=aI(e,t),r=ev(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 w3(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 g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+p)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var mi=Math.random;function qz(e){mi=e}function A3(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(E3(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[~~(mi()*o)];c[l]=a/o}return c.sort(Ic),[by(c,n/2),by(c,1-n/2)]}function S3(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?Wz(o,t+t/4):o}function Wz(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 Gz(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function Hz(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*mi())},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 C3=Math.sqrt(2*Math.PI),Vz=Math.SQRT2;let Pl=NaN;function $p(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(Pl===Pl)n=Pl,Pl=NaN;else{do n=mi()*2-1,i=mi()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,Pl=i*o}return e+n*t}function nv(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*C3)}function _p(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 Fp(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*Vz*Yz(2*e-1)}function Yz(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 iv(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:()=>$p(n,i),pdf:o=>nv(o,n,i),cdf:o=>_p(o,n,i),icdf:o=>Fp(o,n,i)};return r.mean(e).stdev(t)}function rv(e,t){const n=iv();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=tv(e)),r):t},sample(){return e[~~(mi()*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 ov(e,t){return e=e||0,t=t??1,Math.exp(e+$p()*t)}function sv(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*C3*e)}function av(e,t,n){return _p(Math.log(e),t,n)}function uv(e,t,n){return Math.exp(Fp(e,t,n))}function $3(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:()=>ov(n,i),pdf:o=>sv(o,n,i),cdf:o=>av(o,n,i),icdf:o=>uv(o,n,i)};return r.mean(e).stdev(t)}function _3(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=mi();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 lv(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*mi()}function cv(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function fv(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function dv(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function F3(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:()=>lv(n,i),pdf:o=>cv(o,n,i),cdf:o=>fv(o,n,i),icdf:o=>dv(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function hv(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 vf(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 kp(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));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 Ef(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 cl(e,t,n,i,r){let o=0,s=0;return Ef(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function gv(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ef(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=vf(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:cl(e,t,n,r,l)}}function k3(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ef(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=vf(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:cl(e,t,n,r,l)}}function D3(e,t,n){const[i,r,o,s]=kp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,g;Ef(e,t,n,(b,x)=>{d=i[f++],h=Math.log(x),g=d*x,a+=(x*h-a)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=vf(u/s,a/s,l/s,c/s),y=b=>Math.exp(p+m*(b-o));return{coef:[Math.exp(p-m*o),m],predict:y,rSquared:cl(e,t,n,s,y)}}function T3(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Ef(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,o+=(h*g-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=vf(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:cl(e,t,n,a,c)}}function pv(e,t,n){const[i,r,o,s]=kp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<a;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,x=(d*u-f*l)/b,v=(f*y-d*l)/b,w=-x*u,A=E=>(E=E-o,x*E*E+v*E+w+s);return{coef:[w-v*o+x*o*o+s,v-2*x*o,x],predict:A,rSquared:cl(e,t,n,s,A)}}function M3(e,t,n,i){if(i===0)return hv(e,t,n);if(i===1)return gv(e,t,n);if(i===2)return pv(e,t,n);const[r,o,s,a]=kp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*o[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=Kz(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:Xz(f,y,-s,a),predict:b,rSquared:cl(e,t,n,a,b)}}function Xz(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 Kz(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 TS=2,MS=1e-12;function O3(e,t,n,i){const[r,o,s,a]=kp(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<=TS;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],x=g[1],v=y-r[b]>r[x]-y?b:x;let w=0,A=0,E=0,S=0,C=0;const _=1/Math.abs(r[v]-y||1);for(let T=b;T<=x;++T){const k=r[T],$=o[T],D=Jz(Math.abs(y-k)*_)*d[T],P=k*D;w+=D,A+=P,E+=$*D,S+=$*P,C+=k*P}const[F,O]=vf(A/w,E/w,S/w,C/w);c[m]=F+O*y,f[m]=Math.abs(o[m]-c[m]),Qz(r,m+1,g)}if(h===TS)break;const p=AD(f);if(Math.abs(p)<MS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?MS:(b=1-y*y)*b}return Zz(r,c,s,a)}function Jz(e){return(e=1-e*e*e)*e*e}function Qz(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 Zz(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 eB=.5*Math.PI/180;function Dp(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(o+p/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let p=n;--p>0;)c.push(r(o+p/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,g=tB(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&nB(f,p,d,h,g)>eB?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function tB(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 nB(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 iB(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 Fy(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:iB(e)}function R3(e,t,n){return n||e+(t?"_"+t:"")}const km=()=>{},rB={init:km,add:km,rem:km,idx:0},qc={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}},wf=Object.keys(qc).filter(e=>e!=="__count__");function oB(e,t){return(n,i)=>ye({name:e,aggregate_param:i,out:n||e},rB,t)}[...wf,"__count__"].forEach(e=>{qc[e]=oB(e,qc[e])});function N3(e,t,n){return qc[e](n,t)}function L3(e,t){return e.idx-t.idx}function sB(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=qc[r]())})};return e.forEach(n),Object.values(t).sort(L3)}function aB(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function uB(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function lB(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function cB(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function P3(e,t){const n=t||Ln,i=sB(e),r=e.slice().sort(L3);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=aB,o.prototype.add=uB,o.prototype.rem=lB,o.prototype.set=cB,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function mv(e){this._key=e?Li(e):te,this.reset()}const Gt=mv.prototype;Gt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Gt.add=function(e){this._add.push(e)};Gt.rem=function(e){this._rem.push(e)};Gt.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};Gt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",le(n,o)||(n[o]=1,++r);return r};Gt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=PP(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Gt.argmin=function(e){return this.extent(e)[0]||{}};Gt.argmax=function(e){return this.extent(e)[1]||{}};Gt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Gt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Gt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=ev(this.values(),e),this._get=e),this._q};Gt.q1=function(e){return this.quartile(e)[0]};Gt.q2=function(e){return this.quartile(e)[1]};Gt.q3=function(e){return this.quartile(e)[2]};Gt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=A3(this.values(),1e3,.05,e),this._get=e),this._ci};Gt.ci0=function(e){return this.ci(e)[0]};Gt.ci1=function(e){return this.ci(e)[1]};function Ko(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}Ko.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:wf},{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"}]};G(Ko,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=oe(xn(b)),v=x.length;let w=0,A;for(;w<v;++w)i[A=x[w]]||(i[A]=1,t.push(A))}this._dims=oe(e.groupby),this._dnames=this._dims.map(b=>{const x=lt(b);return r(b),n.push(x),x}),this.cellkey=e.key?e.key:Fy(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,g,p,m,y;for(l!==s.length&&L("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"&&L("Null aggregate field specified."),p=lt(f),m=R3(d,p,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}g=c[p],g||(r(f),g=c[p]=[],g.field=f,this._measures.push(g)),d!=="count"&&(this._countOnly=!1),g.push(N3(d,h,m))}return this._measures=this._measures.map(b=>P3(b,b.field)),Object.create(null)},cellkey:Fy(),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 mv),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?p3(t.tuple,o):Oe(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 fB=1e-14;function yv(e){M.call(this,null,e)}yv.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"]}]};G(yv,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(xn(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=w3(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=mn(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(fB+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=ri(u,xn(t),e.name||"bin_"+lt(t))}});function I3(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?WP(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function bv(e){M.call(this,[],e)}bv.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(bv,M,{transform(e,t){const n=t.fork(t.ALL),i=I3(te,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(Da(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function z3(e){Ge.call(this,null,dB,e)}G(z3,Ge);function dB(e){return this.value&&!e.modified()?this.value:uD(e.fields,e.orders)}function xv(e){M.call(this,null,e)}xv.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 hB(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(xv,M,{transform(e,t){const n=f=>d=>{for(var h=hB(a(d),e.case,o)||[],g,p=0,m=h.length;p<m;++p)s.test(g=h[p])||f(g)},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=Oe({}),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 vv(e){M.call(this,null,e)}vv.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(vv,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=gB(a,r,o,e.filter||Pi)):n.mod=a,n.source=this.value,n.modifies(i)}});function gB(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(Oe(o)),o={},o[t]=l);return r}const OS={kde:rv,mixture:_3,normal:iv,lognormal:$3,uniform:F3},pB="distributions",RS="function",mB="field";function B3(e,t){const n=e[RS];le(OS,n)||L("Unknown distribution function: "+n);const i=OS[n]();for(const r in e)r===mB?i.data((e.from||t()).map(e[r])):r===pB?i[r](e[r].map(o=>B3(o,t))):typeof i[r]===RS&&i[r](e[r]);return i}function Ev(e){M.call(this,null,e)}const U3=[{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}]}],yB={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:U3},{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:U3.concat(yB)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Ev,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=B3(e.distribution,bB(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&L("Invalid density method: "+s),!e.extent&&!i.data&&L("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||lo(i.data()),l=Dp(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Oe(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function bB(e){return()=>e.materialize(e.SOURCE).source}function j3(e,t){return e?e.map((n,i)=>t[i]||lt(n)):null}function wv(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 q3="bin";function Av(e){M.call(this,null,e)}Av.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:q3}]};const xB=(e,t)=>gp(lo(e,t))/30;G(Av,M,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=wv(t.source,e.groupby,Ln),r=e.smooth||!1,o=e.field,s=e.step||xB(n,o),a=Da((g,p)=>o(g)-o(p)),u=e.as||q3,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(a);h=-1;for(const p of S3(g,s,r,o))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function W3(e){Ge.call(this,null,vB,e),this.modified(!0)}G(W3,Ge);function vB(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ri(n=>t(n,e),xn(t),lt(t))}function Sv(e){M.call(this,[void 0,void 0],e)}Sv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(Sv,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=mn(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=lt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function Cv(e,t){Ge.call(this,e),this.parent=t,this.count=0}G(Cv,Ge,{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 Tp(e){M.call(this,{},e),this._keys=xf();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)}}G(Tp,M,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=le(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 Cv(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=te(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(te(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=te(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(te(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=te(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 G3(e){Ge.call(this,null,EB,e)}G(G3,Ge);function EB(e){return this.value&&!e.modified()?this.value:Z(e.name)?oe(e.name).map(t=>Li(t)):Li(e.name,e.as)}function $v(e){M.call(this,xf(),e)}$v.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G($v,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=te(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(te(f),1)});function c(f){const d=te(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),o.push(f)):!h&&!g?(i.set(d,1),s.push(f)):l&&h&&!g&&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 _v(e){M.call(this,[],e)}_v.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}]};G(_v,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=j3(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(g=>g(a)),l=u.reduce((g,p)=>Math.max(g,p.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 Fv(e){M.call(this,[],e)}Fv.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"]}]};G(Fv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(lt),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 kv(e){M.call(this,null,e)}kv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(kv,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 H3(e){M.call(this,[],e)}G(H3,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=Oe(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 yd={value:"value",median:AD,mean:cI,min:yy,max:Xs},wB=[];function Dv(e){M.call(this,[],e)}Dv.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 AB(e){var t=e.method||yd.value,n;if(yd[t]==null)L("Unrecognized imputation method: "+t);else return t===yd.value?(n=e.value!==void 0?e.value:0,()=>n):yd[t]}function SB(e){const t=e.field;return n=>n?t(n):NaN}G(Dv,M,{transform(e,t){var n=t.fork(t.ALL),i=AB(e),r=SB(e),o=lt(e.field),s=lt(e.key),a=(e.groupby||[]).map(lt),u=CB(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,x,v,w;for(m=0,x=u.length;m<x;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],w={_impute:!0},y=0,v=g.length;y<v;++y)w[a[y]]=g[y];w[s]=p,w[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Oe(w))}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 CB(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,g,p,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=a[g]||(a[g]=s.push(g)),c=(l=t?t.map(r):wB)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function Tv(e){Ko.call(this,e)}Tv.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:wf},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(Tv,Ko,{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=>{ye(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 Mv(e){M.call(this,null,e)}Mv.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"]}]};G(Mv,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=wv(i,e.groupby,e.field),o=(e.groupby||[]).map(lt),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"&&L("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=lo(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=rv(h,s)[a],p=e.counts?h.length:1,m=c||lo(h);Dp(g,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]*p,l.push(Oe(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function V3(e){Ge.call(this,null,$B,e)}G(V3,Ge);function $B(e){return this.value&&!e.modified()?this.value:fD(e.fields,e.flat)}function Y3(e){M.call(this,[],e),this._pending=null}G(Y3,M,{transform(e,t){const n=t.dataflow;return this._pending?Dm(this,t,this._pending):_B(e)?t.StopPropagation:e.values?Dm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=oe(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>Dm(this,t,oe(i.data)))}});function _B(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Dm(e,t,n){n.forEach(Oe);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 Ov(e){M.call(this,{},e)}Ov.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}]};G(Ov,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&&L('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&L('The "as" parameter has too few output field names.'),c=c||r.map(lt),f=function(g){for(var p=0,m=0,y,b;p<a;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=o;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||L("Missing output field names."),f=function(g){for(var p=0,m;p<a;++p)m=i.get(n[p](g)),g[c[p]]=m??o}),s?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function X3(e){Ge.call(this,null,FB,e)}G(X3,Ge);function FB(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 K3(e){Ge.call(this,null,kB,e)}G(K3,Ge);function kB(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function J3(e){M.call(this,null,e)}G(J3,M,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Rv(e){Ko.call(this,e)}Rv.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:wf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(Rv,Ko,{_transform:Ko.prototype.transform,transform(e,t){return this._transform(DB(e,t),t)}});function DB(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=xn(n).concat(xn(i)),s=MB(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=>TB(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function TB(e,t,n,i){return ri(r=>t(r)===e?n(r):NaN,i,e+"")}function MB(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(hp),t?r.slice(0,t):r}function Q3(e){Tp.call(this,e)}G(Q3,Tp,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(te(o),n,t,o);return(e.modified("field")||i&&t.modified(xn(i)))&&L("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(Oe(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 Nv(e){M.call(this,null,e)}Nv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(Nv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=j3(e.fields,e.as||[]),o=i?(a,u)=>OB(a,u,i,r):Ap;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=te(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Oe({}));s[te(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[te(a)]))}),n}});function OB(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function Z3(e){M.call(this,null,e)}G(Z3,M,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Lv(e){M.call(this,null,e)}Lv.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 RB=1e-14;G(Lv,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=wv(r,e.groupby,e.field),s=(e.groupby||[]).map(lt),a=[],u=e.step||.01,l=e.probs||Yn(u/2,1-RB,u),c=l.length;return o.forEach(f=>{const d=Zx(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<s.length;++p)g[s[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],a.push(Oe(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function eT(e){M.call(this,null,e)}G(eT,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=te(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=Kx(r);i[te(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[te(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function Pv(e){M.call(this,[],e),this.count=0}Pv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(Pv,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[te(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)*mi()),d<s.length&&d>=u&&(f=s[d],o[te(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=te(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[te(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[te(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[te(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[te(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[te(c)])),this.count=a,this.value=n.source=s,n}});function Iv(e){M.call(this,null,e)}Iv.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"}]};G(Iv,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,Oe(o)}),n.add=t.add.concat(this.value),n}});function tT(e){M.call(this,null,e),this.modified(!0)}G(tT,M,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function zv(e){M.call(this,null,e)}const nT=["unit0","unit1"];zv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Ux,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:nT}]};G(zv,M,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?ll:ul)(o.unit).offset,a=e.as||nT,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(xn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=o(p),i&&(g[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}:HD({extent:e.extent||lo(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=jx(i),s=this.value||{},a=(n?PD:LD)(o,r);return a.unit=$e(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function iT(e){M.call(this,xf(),e)}G(iT,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 rT(e){M.call(this,null,e)}G(rT,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(Da(e.sort)):t.source).map(e.field))}});function NB(e,t,n,i){const r=Wc[e](t,n);return{init:r.init||zs,update:function(o,s){s[i]=r.next(o)}}}const Wc={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=Wc.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||L("ntile num must be greater than zero.");const n=Wc.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||L("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=LB(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function LB(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const PB=Object.keys(Wc);function oT(e){const t=oe(e.ops),n=oe(e.fields),i=oe(e.params),r=oe(e.aggregate_params),o=oe(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){oe(xn(g)).forEach(p=>u[p]=1)}h(e.sort),t.forEach((g,p)=>{const m=n[p],y=i[p],b=r[p]||null,x=lt(m),v=R3(g,x,o[p]);if(h(m),s.push(v),le(Wc,g))a.push(NB(g,m,y,v));else{if(m==null&&g!=="count"&&L("Null aggregate field specified."),g==="count"){c.push(v);return}d=!1;let w=l[x];w||(w=l[x]=[],w.field=m,f.push(w)),w.push(N3(g,b,v))}}),(c.length||f.length)&&(this.cell=IB(f,c,d)),this.inputs=Object.keys(u)}const sT=oT.prototype;sT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};sT.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 IB(e,t,n){e=e.map(u=>P3(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 mv;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 Bv(e){M.call(this,{},e),this._mlen=0,this._mods=[]}Bv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:PB.concat(wf)},{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}]};G(Bv,M,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=Da(e.sort),r=Fy(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new oT(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)zB(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]=I3(te),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function zB(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?ep(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||wn(-1)};t.init();for(let f=0;f<u;++f)BB(c,s,f,u),o&&UB(c,l),t.update(c,a[f])}function BB(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 UB(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 jB=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Ko,bin:yv,collect:bv,compare:z3,countpattern:xv,cross:vv,density:Ev,dotbin:Av,expression:W3,extent:Sv,facet:Tp,field:G3,filter:$v,flatten:_v,fold:Fv,formula:kv,generate:H3,impute:Dv,joinaggregate:Tv,kde:Mv,key:V3,load:Y3,lookup:Ov,multiextent:X3,multivalues:K3,params:J3,pivot:Rv,prefacet:Q3,project:Nv,proxy:Z3,quantile:Lv,relay:eT,sample:Pv,sequence:Iv,sieve:tT,subflow:Cv,timeunit:zv,tupleindex:iT,values:rT,window:Bv},Symbol.toStringTag,{value:"Module"}));function Re(e){return function(){return e}}const NS=Math.abs,Yt=Math.atan2,Ss=Math.cos,qB=Math.max,Tm=Math.min,er=Math.sin,Gs=Math.sqrt,Kt=1e-12,Tu=Math.PI,Rh=Tu/2,aT=2*Tu;function WB(e){return e>1?0:e<-1?Tu:Math.acos(e)}function LS(e){return e>=1?Rh:e<=-1?-Rh:Math.asin(e)}function Mp(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 i9(t)}function GB(e){return e.innerRadius}function HB(e){return e.outerRadius}function VB(e){return e.startAngle}function YB(e){return e.endAngle}function XB(e){return e&&e.padAngle}function KB(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<Kt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function bd(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/Gs(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,x=p-h,v=b*b+x*x,w=r-o,A=d*p-g*h,E=(x<0?-1:1)*Gs(qB(0,w*w*v-A*A)),S=(A*x-b*E)/v,C=(-A*b-x*E)/v,_=(A*x+b*E)/v,F=(-A*b+x*E)/v,O=S-m,T=C-y,k=_-m,$=F-y;return O*O+T*T>k*k+$*$&&(S=_,C=F),{cx:S,cy:C,x01:-c,y01:-f,x11:S*(r/w-1),y11:C*(r/w-1)}}function JB(){var e=GB,t=HB,n=Re(0),i=null,r=VB,o=YB,s=XB,a=null,u=Mp(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-Rh,p=o.apply(this,arguments)-Rh,m=NS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Kt))a.moveTo(0,0);else if(m>aT-Kt)a.moveTo(h*Ss(g),h*er(g)),a.arc(0,0,h,g,p,!y),d>Kt&&(a.moveTo(d*Ss(p),d*er(p)),a.arc(0,0,d,p,g,y));else{var b=g,x=p,v=g,w=p,A=m,E=m,S=s.apply(this,arguments)/2,C=S>Kt&&(i?+i.apply(this,arguments):Gs(d*d+h*h)),_=Tm(NS(h-d)/2,+n.apply(this,arguments)),F=_,O=_,T,k;if(C>Kt){var $=LS(C/d*er(S)),D=LS(C/h*er(S));(A-=$*2)>Kt?($*=y?1:-1,v+=$,w-=$):(A=0,v=w=(g+p)/2),(E-=D*2)>Kt?(D*=y?1:-1,b+=D,x-=D):(E=0,b=x=(g+p)/2)}var P=h*Ss(b),z=h*er(b),I=d*Ss(w),V=d*er(w);if(_>Kt){var ue=h*Ss(x),ie=h*er(x),he=d*Ss(v),We=d*er(v),ge;if(m<Tu)if(ge=KB(P,z,he,We,ue,ie,I,V)){var Ht=P-ge[0],ws=z-ge[1],_o=ue-ge[0],Y=ie-ge[1],pe=1/er(WB((Ht*_o+ws*Y)/(Gs(Ht*Ht+ws*ws)*Gs(_o*_o+Y*Y)))/2),ve=Gs(ge[0]*ge[0]+ge[1]*ge[1]);F=Tm(_,(d-ve)/(pe-1)),O=Tm(_,(h-ve)/(pe+1))}else F=O=0}E>Kt?O>Kt?(T=bd(he,We,P,z,h,O,y),k=bd(ue,ie,I,V,h,O,y),a.moveTo(T.cx+T.x01,T.cy+T.y01),O<_?a.arc(T.cx,T.cy,O,Yt(T.y01,T.x01),Yt(k.y01,k.x01),!y):(a.arc(T.cx,T.cy,O,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(k.cy+k.y11,k.cx+k.x11),!y),a.arc(k.cx,k.cy,O,Yt(k.y11,k.x11),Yt(k.y01,k.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,x,!y)):a.moveTo(P,z),!(d>Kt)||!(A>Kt)?a.lineTo(I,V):F>Kt?(T=bd(I,V,ue,ie,d,-F,y),k=bd(P,z,he,We,d,-F,y),a.lineTo(T.cx+T.x01,T.cy+T.y01),F<_?a.arc(T.cx,T.cy,F,Yt(T.y01,T.x01),Yt(k.y01,k.x01),!y):(a.arc(T.cx,T.cy,F,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(k.cy+k.y11,k.cx+k.x11),y),a.arc(k.cx,k.cy,F,Yt(k.y11,k.x11),Yt(k.y01,k.x01),!y))):a.arc(0,0,d,w,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-Tu/2;return[Ss(f)*c,er(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Re(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Re(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Re(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Re(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Re(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Re(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Re(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function uT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lT(e){this._context=e}lT.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 Uv(e){return new lT(e)}function cT(e){return e[0]}function fT(e){return e[1]}function dT(e,t){var n=Re(!0),i=null,r=Uv,o=null,s=Mp(a);e=typeof e=="function"?e:e===void 0?cT:Re(e),t=typeof t=="function"?t:t===void 0?fT:Re(t);function a(u){var l,c=(u=uT(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:Re(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Re(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Re(!!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 hT(e,t,n){var i=null,r=Re(!0),o=null,s=Uv,a=null,u=Mp(l);e=typeof e=="function"?e:e===void 0?cT:Re(+e),t=typeof t=="function"?t:Re(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fT:Re(+n);function l(f){var d,h,g,p=(f=uT(f)).length,m,y=!1,b,x=new Array(p),v=new Array(p);for(o==null&&(a=s(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=d-1;g>=h;--g)a.point(x[g],v[g]);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 dT().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Re(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Re(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Re(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Re(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Re(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Re(+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:Re(!!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 QB={draw(e,t){const n=Gs(t/Tu);e.moveTo(n,0),e.arc(0,0,n,0,aT)}};function ZB(e,t){let n=null,i=Mp(r);e=typeof e=="function"?e:Re(e||QB),t=typeof t=="function"?t:Re(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:Re(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Re(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function Jo(){}function Nh(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 Op(e){this._context=e}Op.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:Nh(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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eU(e){return new Op(e)}function gT(e){this._context=e}gT.prototype={areaStart:Jo,areaEnd:Jo,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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tU(e){return new gT(e)}function pT(e){this._context=e}pT.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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nU(e){return new pT(e)}function mT(e,t){this._basis=new Op(e),this._beta=t}mT.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 iU=function e(t){function n(i){return t===1?new Op(i):new mT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Lh(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 jv(e,t){this._context=e,this._k=(1-t)/6}jv.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:Lh(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:Lh(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 rU=function e(t){function n(i){return new jv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function qv(e,t){this._context=e,this._k=(1-t)/6}qv.prototype={areaStart:Jo,areaEnd:Jo,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:Lh(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 oU=function e(t){function n(i){return new qv(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:Lh(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 sU=function e(t){function n(i){return new Wv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Gv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Kt){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>Kt){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 yT(e,t){this._context=e,this._alpha=t}yT.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:Gv(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 aU=function e(t){function n(i){return t?new yT(i,t):new jv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bT(e,t){this._context=e,this._alpha=t}bT.prototype={areaStart:Jo,areaEnd:Jo,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:Gv(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 uU=function e(t){function n(i){return t?new bT(i,t):new qv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function xT(e,t){this._context=e,this._alpha=t}xT.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:Gv(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 lU=function e(t){function n(i){return t?new xT(i,t):new Wv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function vT(e){this._context=e}vT.prototype={areaStart:Jo,areaEnd:Jo,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 cU(e){return new vT(e)}function PS(e){return e<0?-1:1}function IS(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(PS(o)+PS(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function zS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Mm(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 Ph(e){this._context=e}Ph.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:Mm(this,this._t0,zS(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,Mm(this,zS(this,n=IS(this,e,t)),n);break;default:Mm(this,this._t0,n=IS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ET(e){this._context=new wT(e)}(ET.prototype=Object.create(Ph.prototype)).point=function(e,t){Ph.prototype.point.call(this,t,e)};function wT(e){this._context=e}wT.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 fU(e){return new Ph(e)}function dU(e){return new ET(e)}function AT(e){this._context=e}AT.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=BS(e),r=BS(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 BS(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 hU(e){return new AT(e)}function Rp(e,t){this._context=e,this._t=t}Rp.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 gU(e){return new Rp(e,.5)}function pU(e){return new Rp(e,0)}function mU(e){return new Rp(e,1)}function Vo(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 yU=()=>typeof Image<"u"?Image:null,ky=Symbol("implicit");function Hv(){var e=new uS,t=[],n=[],i=ky;function r(o){let s=e.get(o);if(s===void 0){if(i!==ky)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 uS;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 Hv(t,n).unknown(i)},us.apply(r,arguments),r}const ST=Math.PI/180,CT=180/Math.PI,Ih=18,$T=.96422,_T=1,FT=.82521,kT=4/29,yu=6/29,DT=3*yu*yu,bU=yu*yu*yu;function TT(e){if(e instanceof dr)return new dr(e.l,e.a,e.b,e.opacity);if(e instanceof Qr)return MT(e);e instanceof ip||(e=Lk(e));var t=Lm(e.r),n=Lm(e.g),i=Lm(e.b),r=Om((.2225045*t+.7168786*n+.0606169*i)/_T),o,s;return t===n&&n===i?o=s=r:(o=Om((.4360747*t+.3850649*n+.1430804*i)/$T),s=Om((.0139322*t+.0971045*n+.7141733*i)/FT)),new dr(116*r-16,500*(o-r),200*(r-s),e.opacity)}function zh(e,t,n,i){return arguments.length===1?TT(e):new dr(e,t,n,i??1)}function dr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}Fx(dr,zh,kx(Dx,{brighter(e){return new dr(this.l+Ih*(e??1),this.a,this.b,this.opacity)},darker(e){return new dr(this.l-Ih*(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=$T*Rm(t),e=_T*Rm(e),n=FT*Rm(n),new ip(Nm(3.1338561*t-1.6168667*e-.4906146*n),Nm(-.9787684*t+1.9161415*e+.033454*n),Nm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Om(e){return e>bU?Math.pow(e,1/3):e/DT+kT}function Rm(e){return e>yu?e*e*e:DT*(e-kT)}function Nm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xU(e){if(e instanceof Qr)return new Qr(e.h,e.c,e.l,e.opacity);if(e instanceof dr||(e=TT(e)),e.a===0&&e.b===0)return new Qr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*CT;return new Qr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Bh(e,t,n,i){return arguments.length===1?xU(e):new Qr(e,t,n,i??1)}function Qr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function MT(e){if(isNaN(e.h))return new dr(e.l,0,0,e.opacity);var t=e.h*ST;return new dr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Fx(Qr,Bh,kx(Dx,{brighter(e){return new Qr(this.h,this.c,this.l+Ih*(e??1),this.opacity)},darker(e){return new Qr(this.h,this.c,this.l-Ih*(e??1),this.opacity)},rgb(){return MT(this).rgb()}}));var OT=-.14861,Vv=1.78277,Yv=-.29227,Np=-.90649,Gc=1.97294,US=Gc*Np,jS=Gc*Vv,qS=Vv*Yv-Np*OT;function vU(e){if(e instanceof Ks)return new Ks(e.h,e.s,e.l,e.opacity);e instanceof ip||(e=Lk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(qS*i+US*t-jS*n)/(qS+US-jS),o=i-r,s=(Gc*(n-r)-Yv*o)/Np,a=Math.sqrt(s*s+o*o)/(Gc*r*(1-r)),u=a?Math.atan2(s,o)*CT-120:NaN;return new Ks(u<0?u+360:u,a,r,e.opacity)}function Dy(e,t,n,i){return arguments.length===1?vU(e):new Ks(e,t,n,i??1)}function Ks(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Fx(Ks,Dy,kx(Dx,{brighter(e){return e=e==null?tS:Math.pow(tS,e),new Ks(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?eS:Math.pow(eS,e),new Ks(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*ST,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new ip(255*(t+n*(OT*i+Vv*r)),255*(t+n*(Yv*i+Np*r)),255*(t+n*(Gc*i)),this.opacity)}}));function EU(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function wU(e,t){var n=rp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function RT(e){return function(t,n){var i=e((t=gy(t)).h,(n=gy(n)).h),r=en(t.s,n.s),o=en(t.l,n.l),s=en(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 AU=RT(rp);var SU=RT(en);function CU(e,t){var n=en((e=zh(e)).l,(t=zh(t)).l),i=en(e.a,t.a),r=en(e.b,t.b),o=en(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 NT(e){return function(t,n){var i=e((t=Bh(t)).h,(n=Bh(n)).h),r=en(t.c,n.c),o=en(t.l,n.l),s=en(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 $U=NT(rp);var _U=NT(en);function LT(e){return function t(n){n=+n;function i(r,o){var s=e((r=Dy(r)).h,(o=Dy(o)).h),a=en(r.s,o.s),u=en(r.l,o.l),l=en(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 FU=LT(rp);var kU=LT(en);function Xv(e,t){t===void 0&&(t=e,e=yf);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 DU(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const TU=Object.freeze(Object.defineProperty({__proto__:null,interpolate:yf,interpolateArray:H8,interpolateBasis:V8,interpolateBasisClosed:Y8,interpolateCubehelix:FU,interpolateCubehelixLong:kU,interpolateDate:X8,interpolateDiscrete:EU,interpolateHcl:$U,interpolateHclLong:_U,interpolateHsl:AU,interpolateHslLong:SU,interpolateHue:wU,interpolateLab:CU,interpolateNumber:K8,interpolateNumberArray:J8,interpolateObject:Q8,interpolateRgb:Z8,interpolateRgbBasis:e9,interpolateRgbBasisClosed:t9,interpolateRound:tp,interpolateString:n9,interpolateTransformCss:r9,interpolateTransformSvg:o9,interpolateZoom:s9,piecewise:Xv,quantize:DU},Symbol.toStringTag,{value:"Module"}));function PT(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,QA),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return PT(e).unknown(t)},e=arguments.length?Array.from(e,QA):[0,1],rl(n)}function IT(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 WS(e){return Math.log(e)}function GS(e){return Math.exp(e)}function MU(e){return-Math.log(-e)}function OU(e){return-Math.exp(-e)}function RU(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NU(e){return e===10?RU:e===Math.E?Math.exp:t=>Math.pow(e,t)}function LU(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 HS(e){return(t,n)=>-e(-t,n)}function Kv(e){const t=e(WS,GS),n=t.domain;let i=10,r,o;function s(){return r=LU(i),o=NU(i),n()[0]<0?(r=HS(r),o=HS(o),e(MU,OU)):e(WS,GS),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),g,p;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(g=1;g<i;++g)if(p=d<0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(p=d>0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}y.length*2<m&&(y=ZA(l,c,m))}else y=ZA(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=hy(u)).precision==null&&(u.trim=!0),u=Nk(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(IT(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function zT(){const e=Kv(_x()).domain([1,10]);return e.copy=()=>np(e,zT()).base(e.base()),us.apply(e,arguments),e}function VS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function YS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Jv(e){var t=1,n=e(VS(t),YS(t));return n.constant=function(i){return arguments.length?e(VS(t=+i),YS(t)):t},rl(n)}function BT(){var e=Jv(_x());return e.copy=function(){return np(e,BT()).constant(e.constant())},us.apply(e,arguments)}function XS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function PU(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function IU(e){return e<0?-e*e:e*e}function Qv(e){var t=e(No,No),n=1;function i(){return n===1?e(No,No):n===.5?e(PU,IU):e(XS(n),XS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},rl(t)}function Zv(){var e=Qv(_x());return e.copy=function(){return np(e,Zv()).exponent(e.exponent())},us.apply(e,arguments),e}function zU(){return Zv.apply(null,arguments).exponent(.5)}function UT(){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]=wD(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[Cu(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(Ic),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 UT().domain(e).range(t).unknown(i)},us.apply(o,arguments)}function jT(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[Cu(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 jT().domain([e,t]).range(r).unknown(o)},us.apply(rl(s),arguments)}function BU(e){return new Date(e)}function UU(e){return e instanceof Date?+e:+new Date(+e)}function e2(e,t,n,i,r,o,s,a,u,l){var c=z8(),f=c.invert,d=c.domain,h=l(".%L"),g=l(":%S"),p=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),v=l("%Y");function w(A){return(u(A)<A?h:a(A)<A?g:s(A)<A?p:o(A)<A?m:i(A)<A?r(A)<A?y:b:n(A)<A?x:v)(A)}return c.invert=function(A){return new Date(f(A))},c.domain=function(A){return arguments.length?d(Array.from(A,UU)):d().map(BU)},c.ticks=function(A){var E=d();return e(E[0],E[E.length-1],A??10)},c.tickFormat=function(A,E){return E==null?w:l(E)},c.nice=function(A){var E=d();return(!A||typeof A.range!="function")&&(A=t(E[0],E[E.length-1],A??10)),A?d(IT(E,A)):c},c.copy=function(){return np(c,e2(e,t,n,i,r,o,s,a,u,l))},c}function jU(){return us.apply(e2(CI,$I,br,Bc,sl,no,yp,pp,Jr,Wx).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function qU(){return us.apply(e2(AI,SI,xr,Uc,al,Go,bp,mp,Jr,Gx).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lp(){var e=0,t=1,n,i,r,o,s=No,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,g;return arguments.length?([h,g]=d,s=f(h,g),l):[s(0),s(1)]}}return l.range=c(yf),l.rangeRound=c(tp),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 cs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function t2(){var e=rl(Lp()(No));return e.copy=function(){return cs(e,t2())},ls.apply(e,arguments)}function qT(){var e=Kv(Lp()).domain([1,10]);return e.copy=function(){return cs(e,qT()).base(e.base())},ls.apply(e,arguments)}function WT(){var e=Jv(Lp());return e.copy=function(){return cs(e,WT()).constant(e.constant())},ls.apply(e,arguments)}function n2(){var e=Qv(Lp());return e.copy=function(){return cs(e,n2()).exponent(e.exponent())},ls.apply(e,arguments)}function WU(){return n2.apply(null,arguments).exponent(.5)}function Pp(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=No,c,f=!1,d;function h(p){return isNaN(p=+p)?d:(p=.5+((p=+c(p))-o)*(i*p<i*o?a:u),l(f?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,n]=p,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(p){return arguments.length?(f=!!p,h):f},h.interpolator=function(p){return arguments.length?(l=p,h):l};function g(p){return function(m){var y,b,x;return arguments.length?([y,b,x]=m,l=Xv(p,[y,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=g(yf),h.rangeRound=g(tp),h.unknown=function(p){return arguments.length?(d=p,h):d},function(p){return c=p,r=p(e),o=p(t),s=p(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function GT(){var e=rl(Pp()(No));return e.copy=function(){return cs(e,GT())},ls.apply(e,arguments)}function HT(){var e=Kv(Pp()).domain([.1,1,10]);return e.copy=function(){return cs(e,HT()).base(e.base())},ls.apply(e,arguments)}function VT(){var e=Jv(Pp());return e.copy=function(){return cs(e,VT()).constant(e.constant())},ls.apply(e,arguments)}function i2(){var e=Qv(Pp());return e.copy=function(){return cs(e,i2()).exponent(e.exponent())},ls.apply(e,arguments)}function GU(){return i2.apply(null,arguments).exponent(.5)}function $r(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 HU=$r("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),VU=$r("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),YU=$r("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),XU=$r("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),KU=$r("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),JU=$r("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),QU=$r("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ZU=$r("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ej=$r("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),tj=$r("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function r2(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const nj="identity",Mu="linear",fo="log",Af="pow",Sf="sqrt",Ip="symlog",aa="time",ua="utc",hr="sequential",fl="diverging",Ou="quantile",zp="quantize",Bp="threshold",o2="ordinal",Ty="point",YT="band",s2="bin-ordinal",wt="continuous",Cf="discrete",$f="discretizing",vi="interpolating",a2="temporal";function ij(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 rj(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 u2(){const e=Hv().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],g=r2(f,a,u);let p=i[d-0];r=(h-p)/(g||1),s&&(r=Math.floor(r)),p+=(h-p-r*(f-a))*l,o=r*(1-a),s&&(p=Math.round(p),o=Math.round(o));const m=Yn(f).map(y=>p+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(),g=h.length-1;let p=+f[0],m=+f[1],y,b,x;if(!(p!==p||m!==m)&&(m<p&&(x=p,p=m,m=x),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Cu(h,p)-1),b=p===m?y:Cu(h,m)-1,p-h[y]>o+1e-10&&++y,d&&(x=y,y=g-b,b=g-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 u2().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function XT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return XT(t())},e}function oj(){return XT(u2().paddingInner(1))}var sj=Array.prototype.map;function aj(e){return sj.call(e,mn)}const uj=Array.prototype.slice;function KT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Cu(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=aj(i),n):e.slice()},n.range=function(i){return arguments.length?(t=uj.call(i),n):t.slice()},n.tickFormat=function(i,r){return j8(e[0],$e(e),i??10,r)},n.copy=function(){return KT().domain(n.domain()).range(n.range())},n}const Uh=new Map,JT=Symbol("vega_scale");function QT(e){return e[JT]=!0,e}function KS(e){return e&&e[JT]===!0}function lj(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?ij(o):o.invertExtent?rj(o):void 0),o.type=e,QT(o)};return i.metadata=yr(oe(n)),i}function Me(e,t,n){return arguments.length>1?(Uh.set(e,lj(e,t,n)),this):ZT(e)?Uh.get(e):void 0}Me(nj,PT);Me(Mu,B8,wt);Me(fo,zT,[wt,fo]);Me(Af,Zv,wt);Me(Sf,zU,wt);Me(Ip,BT,wt);Me(aa,jU,[wt,a2]);Me(ua,qU,[wt,a2]);Me(hr,t2,[wt,vi]);Me(`${hr}-${Mu}`,t2,[wt,vi]);Me(`${hr}-${fo}`,qT,[wt,vi,fo]);Me(`${hr}-${Af}`,n2,[wt,vi]);Me(`${hr}-${Sf}`,WU,[wt,vi]);Me(`${hr}-${Ip}`,WT,[wt,vi]);Me(`${fl}-${Mu}`,GT,[wt,vi]);Me(`${fl}-${fo}`,HT,[wt,vi,fo]);Me(`${fl}-${Af}`,i2,[wt,vi]);Me(`${fl}-${Sf}`,GU,[wt,vi]);Me(`${fl}-${Ip}`,VT,[wt,vi]);Me(Ou,UT,[$f,Ou]);Me(zp,jT,$f);Me(Bp,U8,$f);Me(s2,KT,[Cf,$f]);Me(o2,Hv,Cf);Me(YT,u2,Cf);Me(Ty,oj,Cf);function ZT(e){return Uh.has(e)}function Ma(e,t){const n=Uh.get(e);return n&&n.metadata[t]}function l2(e){return Ma(e,wt)}function Ru(e){return Ma(e,Cf)}function My(e){return Ma(e,$f)}function eM(e){return Ma(e,fo)}function cj(e){return Ma(e,a2)}function tM(e){return Ma(e,vi)}function nM(e){return Ma(e,Ou)}const fj=["clamp","base","constant","exponent"];function iM(e,t){const n=t[0],i=$e(t)-n;return function(r){return e(n+r*i)}}function Up(e,t,n){return Xv(c2(t||"rgb",n),e)}function rM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function oM(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?wn(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=Me(o)().domain([t,n]).range([0,1]),fj.forEach(a=>e[a]?s[a](e[a]()):0),s)}function c2(e,t){const n=TU[dj(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function dj(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const hj={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"},gj={accent:VU,category10:HU,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:YU,observable10:XU,paired:KU,pastel1:JU,pastel2:QU,set1:ZU,set2:ej,set3:tj,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function sM(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 aM(e,t){for(const n in e)f2(n,t(e[n]))}const JS={};aM(gj,sM);aM(hj,e=>Up(sM(e)));function f2(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(JS[e]=t,this):JS[e]}const nh="symbol",pj="discrete",mj="gradient",yj=e=>Z(e)?e.map(t=>String(t)):String(e),bj=(e,t)=>e[1]-t[1],xj=(e,t)=>t[1]-e[1];function d2(e,t,n){let i;return sa(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(gp(e.domain())/n||1)+1))),me(t)&&(i=t.step,t=t.interval),Ke(t)&&(t=e.type===aa?ul(t):e.type==ua?ll(t):L("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function uM(e,t,n){let i=e.range(),r=i[0],o=$e(i),s=bj;if(r>o&&(i=o,o=r,r=i,s=xj),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],$e(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function h2(e,t){return e.bins?uM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function lM(e,t,n,i,r,o){const s=t.type;let a=yj;if(s===aa||r===aa)a=e.timeFormat(i);else if(s===ua||r===ua)a=e.utcFormat(i);else if(eM(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=cM(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 cM(e,t,n){const i=h2(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 Oy={[Ou]:"quantiles",[zp]:"thresholds",[Bp]:"domain"},fM={[Ou]:"quantiles",[zp]:"domain"};function dM(e,t){return e.bins?wj(e.bins):e.type===fo?cM(e,t,!0):Oy[e.type]?Ej(e[Oy[e.type]]()):h2(e,t)}function vj(e,t,n){const i=t[fM[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,3*10,n)}function Ej(e){const t=[-1/0].concat(e);return t.max=1/0,t}function wj(e){const t=e.slice(0,-1);return t.max=$e(e),t}const Aj=e=>Oy[e.type]||e.bins;function hM(e,t,n,i,r,o,s){const a=fM[t.type]&&o!==aa&&o!==ua?vj(e,t,r):lM(e,t,n,r,o,s);return i===nh&&Aj(t)?Sj(a):i===pj?Cj(a):$j(a)}const Sj=e=>(t,n,i)=>{const r=QS(i[n+1],QS(i.max,1/0)),o=ZS(t,e),s=ZS(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},QS=(e,t)=>e??t,Cj=e=>(t,n)=>n?e(t):null,$j=e=>t=>e(t),ZS=(e,t)=>Number.isFinite(e)?t(e):null;function _j(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+$e(t),o=r-i;if(e.type===Bp){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function Fj(e,t,n,i){const r=i||t.type;return Ke(n)&&cj(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===aa?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===ua?e.utcFormat("%A, %d %B %Y, %X UTC"):hM(e,t,5,null,n,i,!0)}function gM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Fj(e,t,n.format,n.formatType);if(My(t.type)){const o=dM(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(Ru(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($e(o))}`}}let pM=0;function kj(){pM=0}const jh="p_";function g2(e){return e&&e.gradient}function mM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?jh:"";return r||(r=e.id="gradient_"+pM++,i==="radial"?(e.x1=tr(e.x1,.5),e.y1=tr(e.y1,.5),e.r1=tr(e.r1,0),e.x2=tr(e.x2,.5),e.y2=tr(e.y2,.5),e.r2=tr(e.r2,.5),o=jh):(e.x1=tr(e.x1,0),e.y1=tr(e.y1,0),e.x2=tr(e.x2,1),e.y2=tr(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function tr(e,t){return e??t}function yM(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 eC={basis:{curve:eU},"basis-closed":{curve:tU},"basis-open":{curve:nU},bundle:{curve:iU,tension:"beta",value:.85},cardinal:{curve:rU,tension:"tension",value:0},"cardinal-open":{curve:sU,tension:"tension",value:0},"cardinal-closed":{curve:oU,tension:"tension",value:0},"catmull-rom":{curve:aU,tension:"alpha",value:.5},"catmull-rom-closed":{curve:uU,tension:"alpha",value:.5},"catmull-rom-open":{curve:lU,tension:"alpha",value:.5},linear:{curve:Uv},"linear-closed":{curve:cU},monotone:{horizontal:dU,vertical:fU},natural:{curve:hU},step:{curve:gU},"step-after":{curve:mU},"step-before":{curve:pU}};function p2(e,t,n){var i=le(eC,e)&&eC[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const Dj={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Tj=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Mj=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Oj=/^((\s+,?\s*)|(,\s*))/,Rj=/^[01]/;function Nu(e){const t=[];return(e.match(Tj)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=Dj[o],a=Nj(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 Nj(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)?Rj:Mj,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(Oj);u!==null&&(r+=u[0].length)}return i}const Qo=Math.PI/180,Lj=1e-14,Us=Math.PI/2,ar=Math.PI*2,Ka=Math.sqrt(3)/2;var Pm={},Im={},bM=[].join;function Pj(e,t,n,i,r,o,s,a,u){const l=bM.call(arguments);if(Pm[l])return Pm[l];const c=s*Qo,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,g=d*(u-t)*.5-f*(a-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,x=d/i,v=m*a+y*u,w=b*a+x*u,A=m*e+y*t,E=b*e+x*t;let C=1/((A-v)*(A-v)+(E-w)*(E-w))-.25;C<0&&(C=0);let _=Math.sqrt(C);o==r&&(_=-_);const F=.5*(v+A)-_*(E-w),O=.5*(w+E)+_*(A-v),T=Math.atan2(w-O,v-F);let $=Math.atan2(E-O,A-F)-T;$<0&&o===1?$+=ar:$>0&&o===0&&($-=ar);const D=Math.ceil(Math.abs($/(Us+.001))),P=[];for(let z=0;z<D;++z){const I=T+z*$/D,V=T+(z+1)*$/D;P[z]=[F,O,I,V,n,i,f,d]}return Pm[l]=P}function Ij(e){const t=bM.call(e);if(Im[t])return Im[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,g=Math.cos(r),p=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),w=n+g-v*p,A=i+p+v*g,E=n+m,S=i+y,C=E+v*y,_=S-v*m;return Im[t]=[c*w+f*A,d*w+h*A,c*C+f*_,d*C+h*_,c*E+f*S,d*E+h*S]}const oi=["l",0,0,0,0,0,0,0];function zj(e,t,n){const i=oi[0]=e[0];if(i==="a"||i==="A")oi[1]=t*e[1],oi[2]=n*e[2],oi[3]=e[3],oi[4]=e[4],oi[5]=e[5],oi[6]=t*e[6],oi[7]=n*e[7];else if(i==="h"||i==="H")oi[1]=t*e[1];else if(i==="v"||i==="V")oi[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)oi[r]=(r%2==1?t:n)*e[r];return oi}function Hc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,g,p,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=zj(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-g,f=2*l-p):a[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=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":tC(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":tC(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 tC(e,t,n,i){const r=Pj(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=Ij(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const nC=.5773502691896257,iC={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ar)}},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=Ka*n,r=i-n*nC,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=Ka*n,r=i-n*nC;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=Ka*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=Ka*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=Ka*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=Ka*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 xM(e){return le(iC,e)?iC[e]:Bj(e)}var zm={};function Bj(e){if(!le(zm,e)){const t=Nu(e);zm[e]={draw:function(n,i){Hc(n,t,0,0,Math.sqrt(i)/2)}}}return zm[e]}const Fo=.448084975506;function Uj(e){return e.x}function jj(e){return e.y}function qj(e){return e.width}function Wj(e){return e.height}function Ir(e){return typeof e=="function"?e:()=>+e}function xd(e,t,n){return Math.max(t,Math.min(e,n))}function vM(){var e=Uj,t=jj,n=qj,i=Wj,r=Ir(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,x=xd(+r.call(this,c),0,b),v=xd(+o.call(this,c),0,b),w=xd(+s.call(this,c),0,b),A=xd(+a.call(this,c),0,b);if(u||(u=h=Tx()),x<=0&&v<=0&&w<=0&&A<=0)u.rect(g,p,m,y);else{var E=g+m,S=p+y;u.moveTo(g+x,p),u.lineTo(E-v,p),u.bezierCurveTo(E-Fo*v,p,E,p+Fo*v,E,p+v),u.lineTo(E,S-A),u.bezierCurveTo(E,S-Fo*A,E-Fo*A,S,E-A,S),u.lineTo(g+w,S),u.bezierCurveTo(g+Fo*w,S,g,S-Fo*w,g,S-w),u.lineTo(g,p+x),u.bezierCurveTo(g,p+Fo*x,g+Fo*x,p,g+x,p),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 EM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const g=h/2;if(o){var p=a-d,m=f-s;if(p||m){var y=Math.hypot(p,m),b=(p/=y)*u,x=(m/=y)*u,v=Math.atan2(m,p);r.moveTo(s-b,a-x),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,v-Math.PI,v),r.lineTo(s+b,a+x),r.arc(s,a,u,v,v+Math.PI)}else r.arc(f,d,g,0,ar);r.closePath()}else o=1;s=f,a=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=Tx()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(o=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,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 _f(e,t){return e??t}const Ff=e=>e.x||0,kf=e=>e.y||0,Gj=e=>e.width||0,Hj=e=>e.height||0,Vj=e=>(e.x||0)+(e.width||0),Yj=e=>(e.y||0)+(e.height||0),Xj=e=>e.startAngle||0,Kj=e=>e.endAngle||0,Jj=e=>e.padAngle||0,Qj=e=>e.innerRadius||0,Zj=e=>e.outerRadius||0,eq=e=>e.cornerRadius||0,tq=e=>_f(e.cornerRadiusTopLeft,e.cornerRadius)||0,nq=e=>_f(e.cornerRadiusTopRight,e.cornerRadius)||0,iq=e=>_f(e.cornerRadiusBottomRight,e.cornerRadius)||0,rq=e=>_f(e.cornerRadiusBottomLeft,e.cornerRadius)||0,oq=e=>_f(e.size,64),sq=e=>e.size||1,jp=e=>e.defined!==!1,aq=e=>xM(e.shape||"circle"),uq=JB().startAngle(Xj).endAngle(Kj).padAngle(Jj).innerRadius(Qj).outerRadius(Zj).cornerRadius(eq),lq=hT().x(Ff).y1(kf).y0(Yj).defined(jp),cq=hT().y(kf).x1(Ff).x0(Vj).defined(jp),fq=dT().x(Ff).y(kf).defined(jp),dq=vM().x(Ff).y(kf).width(Gj).height(Hj).cornerRadius(tq,nq,iq,rq),hq=ZB().type(aq).size(oq),gq=EM().x(Ff).y(kf).defined(jp).size(sq);function m2(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function pq(e,t){return uq.context(e)(t)}function mq(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?cq:lq).curve(p2(i,n.orient,n.tension)).context(e)(t)}function yq(e,t){const n=t[0],i=n.interpolate||"linear";return fq.curve(p2(i,n.orient,n.tension)).context(e)(t)}function dl(e,t,n,i){return dq.context(e)(t,n,i)}function bq(e,t){return(t.mark.shape||t.shape).context(e)(t)}function xq(e,t){return hq.context(e)(t)}function vq(e,t){return gq.context(e)(t)}var wM=1;function AM(){wM=1}function y2(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+wM++),s=r.clipping[o]||(r.clipping[o]={id:o});return be(i)?s.path=i(null):m2(n)?s.path=dl(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function pt(e){this.clear(),e&&this.union(e)}pt.prototype={clone(){return new pt(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 qp(e){this.mark=e,this.bounds=this.bounds||new pt}function Wp(e){qp.call(this,e),this.items=this.items||[]}G(Wp,qp);class SM{constructor(t){this._pending=0,this._loader=t||vp()}pending(){return this._pending}sanitizeURL(t){const n=this;return rC(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Il(n),i)).catch(()=>(Il(n),null))}loadImage(t){const n=this,i=yU();return rC(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=le(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>Il(n),s.onerror=()=>Il(n),s.src=o,s}).catch(r=>(Il(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 rC(e){e._pending+=1}function Il(e){e._pending-=1}function bo(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?Eq(t,i):0))}return e}function Eq(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const wq=ar-1e-8;let Gp,ih,rh,Hs,Ry,oh,Ny,Ly;const Lo=(e,t)=>Gp.add(e,t),sh=(e,t)=>Lo(ih=e,rh=t),oC=e=>Lo(e,Gp.y1),sC=e=>Lo(Gp.x1,e),js=(e,t)=>Ry*e+Ny*t,qs=(e,t)=>oh*e+Ly*t,Bm=(e,t)=>Lo(js(e,t),qs(e,t)),Um=(e,t)=>sh(js(e,t),qs(e,t));function Df(e,t){return Gp=e,t?(Hs=t*Qo,Ry=Ly=Math.cos(Hs),oh=Math.sin(Hs),Ny=-oh):(Ry=Ly=1,Hs=oh=Ny=0),Aq}const Aq={beginPath(){},closePath(){},moveTo:Um,lineTo:Um,rect(e,t,n,i){Hs?(Bm(e+n,t),Bm(e+n,t+i),Bm(e,t+i),Um(e,t)):(Lo(e+n,t+i),sh(e,t))},quadraticCurveTo(e,t,n,i){const r=js(e,t),o=qs(e,t),s=js(n,i),a=qs(n,i);aC(ih,r,s,oC),aC(rh,o,a,sC),sh(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=js(e,t),a=qs(e,t),u=js(n,i),l=qs(n,i),c=js(r,o),f=qs(r,o);uC(ih,s,u,c,oC),uC(rh,a,l,f,sC),sh(c,f)},arc(e,t,n,i,r,o){if(i+=Hs,r+=Hs,ih=n*Math.cos(r)+e,rh=n*Math.sin(r)+t,Math.abs(r-i)>wq)Lo(e-n,t-n),Lo(e+n,t+n);else{const s=l=>Lo(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%ar,i<0&&(i+=ar),r=r%ar,r<0&&(r+=ar),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=ar,a=i-i%Us,u=0;u<4&&a>r;++u,a-=Us)s(a);else for(a=i-i%Us+Us,u=0;u<4&&a<r;++u,a=a+Us)s(a)}}};function aC(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function uC(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)>Lj?(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(lC(u,e,t,n,i)),0<l&&l<1&&r(lC(l,e,t,n,i))}function lC(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 Yo=(Yo=Vo(1,1))?Yo.getContext("2d"):null;const Py=new pt;function b2(e){return function(t,n){if(!Yo)return!0;e(Yo,t),Py.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=Py;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Yo.isPointInPath(u,a))return!0;return!1}}function x2(e,t){return t.contains(e.x||0,e.y||0)}function CM(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(Py.set(n,i,n+r,i+o))}function $M(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 lu(t,n,i,r,o)}function lu(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,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(o-t)),m===1&&(h=l,g=a-t),m===2&&(h=-c,g=-(s-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function Lu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Si(e,t){return e??t}function cC(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Sq(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=Vo(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=cC(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return cC(o,t.stops)}function _M(e,t,n){return g2(n)?Sq(e,n,t.bounds):n}function qh(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=_M(e,t,t.fill),!0):!1}var Cq=[];function Pu(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=_M(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||Cq),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function $q(e,t){return e.zindex-t.zindex||e.index-t.index}function v2(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($q)}function zi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=v2(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 Wh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=v2(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){zi(n,r=>{(!i||i.intersects(r.bounds))&&FM(e,t,r,r)})}}function _q(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&FM(e,t,n.items[0],n.items)}}function FM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Lu(t,n),n.fill&&qh(t,n,r)&&t.fill(),n.stroke&&Pu(t,n,r)&&t.stroke()))}function Hp(e){return e=e||Pi,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Wh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Tf(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 w2(e){return Hp(Tf(e))}function Js(e,t){return"translate("+e+","+t+")"}function A2(e){return"rotate("+e+")"}function Fq(e,t){return"scale("+e+","+t+")"}function kM(e){return Js(e.x||0,e.y||0)}function kq(e){return Js(e.x||0,e.y||0)+(e.angle?" "+A2(e.angle):"")}function Dq(e){return Js(e.x||0,e.y||0)+(e.angle?" "+A2(e.angle):"")+(e.scaleX||e.scaleY?" "+Fq(e.scaleX||1,e.scaleY||1):"")}function S2(e,t,n){function i(s,a){s("transform",kq(a)),s("d",t(null,a))}function r(s,a){return t(Df(s,a.angle),a),bo(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*=Qo),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:w2(o),isect:n||b2(o)}}var Tq=S2("arc",pq);function Mq(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 Oq(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 Rq(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 C2(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(Df(u),c),bo(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Tf(o);function a(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:_q(o),pick:a,isect:x2,tip:n}}var Nq=C2("area",mq,Mq);function Lq(e,t){var n=t.clip;e.save(),be(n)?(e.beginPath(),n(e),e.clip()):DM(e,t.group)}function DM(e,t){e.beginPath(),m2(t)?dl(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function TM(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 Pq(e,t){e("transform",kM(t))}function MM(e,t){const n=TM(t);e("d",dl(null,t,n,n))}function Iq(e,t){e("class","background"),e("aria-hidden",!0),MM(e,t)}function zq(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?MM(e,t):e("d","")}function Bq(e,t,n){const i=t.clip?y2(n,t,t):null;e("clip-path",i)}function Uq(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),bo(e,t),e.translate(t.x||0,t.y||0)}function Vc(e,t,n,i){const r=TM(t);e.beginPath(),dl(e,t,(n||0)+r,(i||0)+r)}const jq=Tf(Vc),qq=Tf(Vc,!1),Wq=Tf(Vc,!0);function Gq(e,t,n,i){zi(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&&(Vc(e,r,o,s),Lu(e,r),r.fill&&qh(e,r,u)&&e.fill(),r.stroke&&!a&&Pu(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&DM(e,r),n&&n.translate(-o,-s),zi(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&&(Vc(e,r,o,s),Lu(e,r),Pu(e,r,u)&&e.stroke())})}function Hq(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 Wh(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),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||o<f||o>g))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,p&&m2(u)&&!Wq(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&qq(e,u,s,a)?(e.restore(),u):(l=Wh(u,b=>Vq(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&jq(e,u,s,a)&&(l=u),e.restore(),l||null)})}function Vq(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var Yq={type:"group",tag:"g",nested:!1,attr:Pq,bound:Uq,draw:Gq,pick:Hq,isect:CM,content:Bq,background:Iq,foreground:zq},Yc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function $2(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 _2(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 F2(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 Vp(e,t){return e==="center"?t/2:e==="right"?t:0}function Yp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function Xq(e,t,n){const i=$2(t,n),r=_2(t,i),o=F2(t,i),s=(t.x||0)-Vp(t.align,r),a=(t.y||0)-Yp(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Yc["xmlns:xlink"],"xlink:href"),e("transform",Js(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function Kq(e,t){const n=t.image,i=_2(t,n),r=F2(t,n),o=(t.x||0)-Vp(t.align,i),s=(t.y||0)-Yp(t.baseline,r);return e.set(o,s,o+i,s+r)}function Jq(e,t,n){zi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=$2(i,this);let o=_2(i,r),s=F2(i,r);if(o===0||s===0)return;let a=(i.x||0)-Vp(i.align,o),u=(i.y||0)-Yp(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)&&(Lu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var Qq={type:"image",tag:"image",nested:!1,attr:Xq,bound:Kq,draw:Jq,pick:Hp(),isect:Pi,get:$2,xOffset:Vp,yOffset:Yp},Zq=C2("line",yq,Oq);function eW(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",Dq(t)),e("d",t.path)}function ah(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)*Qo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=Nu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),Hc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):Hc(e,u,i,r,o,s)}function tW(e,t){return ah(Df(e,t.angle),t)?e.set(0,0,0,0):bo(e,t,!0)}var nW={type:"path",tag:"path",nested:!1,attr:eW,bound:tW,draw:E2(ah),pick:w2(ah),isect:b2(ah)};function iW(e,t){e("d",dl(null,t))}function rW(e,t){var n,i;return bo(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function fC(e,t){e.beginPath(),dl(e,t)}var oW={type:"rect",tag:"path",nested:!1,attr:iW,bound:rW,draw:E2(fC),pick:w2(fC),isect:CM};function sW(e,t){e("transform",kM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function aW(e,t){var n,i;return bo(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function OM(e,t,n){var i,r,o,s;return t.stroke&&Pu(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 uW(e,t,n){zi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&OM(e,i,r)&&(Lu(e,i),e.stroke())}})}function lW(e,t,n,i){return e.isPointInStroke?OM(e,t,1)&&e.isPointInStroke(n,i):!1}var cW={type:"rule",tag:"line",nested:!1,attr:sW,bound:aW,draw:uW,pick:Hp(lW),isect:$M},fW=S2("shape",bq),dW=S2("symbol",xq,x2);const dC=qP();var Jn={height:_r,measureWidth:k2,estimateWidth:Gh,width:Gh,canvas:RM};RM(!0);function RM(e){Jn.width=e&&Yo?k2:Gh}function Gh(e,t){return NM(es(e,t),_r(e))}function NM(e,t){return~~(.8*e.length*t)}function k2(e,t){return _r(e)<=0||!(t=es(e,t))?0:LM(t,Xp(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=dC.get(n);return i===void 0&&(Yo.font=t,i=Yo.measureText(e).width,dC.set(n,i)),i}function _r(e){return e.fontSize!=null?+e.fontSize||0:11}function Zo(e){return e.lineHeight!=null?e.lineHeight:_r(e)+2}function hW(e){return Z(e)?e.length>1?e:e[0]:e}function Mf(e){return hW(e.lineBreak&&e.text&&!Z(e.text)?e.text.split(e.lineBreak):e.text)}function D2(e){const t=Mf(e);return(Z(t)?t.length-1:0)*Zo(e)}function es(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?pW(e,n):n}function gW(e){if(Jn.width===k2){const t=Xp(e);return n=>LM(n,t)}else if(Jn.width===Gh){const t=_r(e);return n=>NM(n,t)}else return t=>Jn.width(e,t)}function pW(e,t){var n=+e.limit,i=gW(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 Of(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xp(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+_r(e)+"px "+Of(e,t)}function T2(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*Zo(e):t==="line-bottom"?.29*n-.5*Zo(e):0)}const mW={left:"start",center:"middle",right:"end"},Ac=new pt;function Kp(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Us,t+=i*Math.cos(r),n+=i*Math.sin(r)),Ac.x1=t,Ac.y1=n,Ac}function yW(e,t){var n=t.dx||0,i=(t.dy||0)+T2(t),r=Kp(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",mW[t.align]||"start"),a?(u=Js(o,s)+" "+A2(a),(n||i)&&(u+=" "+Js(n,i))):u=Js(o+n,s+i),e("transform",u)}function M2(e,t,n){var i=Jn.height(t),r=t.align,o=Kp(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+T2(t)-Math.round(.8*i),c=Mf(t),f;if(Z(c)?(i+=Zo(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Jn.width(t,h)),0)):f=Jn.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*Qo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Qo,s,a);return e}function bW(e,t,n){zi(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=Xp(i),e.textAlign=i.align||"left",o=Kp(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Qo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+T2(i),c=Mf(i),Lu(e,i),Z(c))for(l=Zo(i),u=0;u<c.length;++u)f=es(i,c[u]),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Pu(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=es(i,c),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Pu(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function xW(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Kp(t),a=s.x1,u=s.y1,l=M2(Ac,t,1),c=-t.angle*Qo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),g=d*r+f*o+(u-d*a-f*u);return l.contains(h,g)}function vW(e,t){const n=M2(Ac,e,2);return lu(t,n[0],n[1],n[2],n[3])||lu(t,n[0],n[1],n[4],n[5])||lu(t,n[4],n[5],n[6],n[7])||lu(t,n[2],n[3],n[6],n[7])}var EW={type:"text",tag:"text",nested:!1,attr:yW,bound:M2,draw:bW,pick:Hp(xW),isect:vW},wW=C2("trail",vq,Rq),ni={arc:Tq,area:Nq,group:Yq,image:Qq,line:Zq,path:nW,rect:oW,rule:cW,shape:fW,symbol:dW,text:EW,trail:wW};function Iy(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 pt),e,n)}var hC={mark:null};function PM(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]:(hC.mark=e,l=hC),c=Iy(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new pt,s)for(a=0,u=o.length;a<u;++a)t.union(Iy(o[a],r,n));return e.bounds=t}const AW=["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 IM(e,t){return JSON.stringify(e,AW,t)}function zM(e){const t=typeof e=="string"?JSON.parse(e):e;return BM(t)}function BM(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"&&BM(n[r]);return t&&PM(e),e}class UM{constructor(t){arguments.length?this.root=zM(t):(this.root=gC({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Wp(this.root)])}toJSON(t){return IM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=gC(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function gC(e,t){const n={bounds:new pt,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 Po(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function O2(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 yt(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=Po(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function ai(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function jM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Jp(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function SW(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=ni[r.marktype]).tip){for(s=Jp(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 R2=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||vp(),this._tooltip=n||CW}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=Po(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=SW(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 CW(e,t,n,i){e.element().setAttribute("title",i||"")}class Rf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new SM(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 $W="keydown",_W="keypress",FW="keyup",qM="dragenter",uh="dragleave",WM="dragover",zy="pointerdown",kW="pointerup",Hh="pointermove",lh="pointerout",GM="pointerover",By="mousedown",DW="mouseup",HM="mousemove",Vh="mouseout",VM="mouseover",Yh="click",TW="dblclick",MW="wheel",YM="mousewheel",Xh="touchstart",Kh="touchmove",Jh="touchend",OW=[$W,_W,FW,qM,uh,WM,zy,kW,Hh,lh,GM,By,DW,HM,Vh,VM,Yh,TW,MW,YM,Xh,Kh,Jh],Uy=Hh,Sc=Vh,jy=Yh;class Nf extends R2{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=OW,this.pointermove=mC([Hh,HM],[GM,VM],[lh,Vh]),this.dragover=mC([WM],[qM],[uh]),this.pointerout=yC([lh,Vh]),this.dragleave=yC([uh])}initialize(t,n,i){return this._canvas=t&&O2(t,"canvas"),[Yh,By,zy,Hh,lh,uh].forEach(r=>pC(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(YM,t)}pointerdown(t){this._down=this._active,this.fire(zy,t)}mousedown(t){this._down=this._active,this.fire(By,t)}click(t){this._down===this._active&&(this.fire(Yh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Xh,t,!0)}touchmove(t){this.fire(Kh,t,!0)}touchend(t){this.fire(Jh,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===jy&&r&&r.href?this.handleHref(n,r,r.href):(t===Uy||t===Sc)&&this.handleTooltip(n,r,t!==Sc),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&&(pC(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=Jp(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 RW=e=>e===Xh||e===Kh||e===Jh?[Xh,Kh,Jh]:[e];function pC(e,t){RW(t).forEach(n=>NW(e,n))}function NW(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 lc(e,t,n){t.forEach(i=>e.fire(i,n))}function mC(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?lc(this,e,i):((!r||!r.exit)&&lc(this,n,i),this._active=o,lc(this,t,i),lc(this,e,i))}}function yC(e){return function(t){lc(this,e,t),this._active=null}}function LW(){return typeof window<"u"&&window.devicePixelRatio||1}function PW(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?LW():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 Qh extends Rf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new pt,this._tempb=new pt}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Vo(1,1,this._options.type),t&&this._canvas&&(ai(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)PW(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||L("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=IW(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):zW(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&&Lq(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 IW=(e,t,n)=>new pt().set(0,0,t,n).translate(-e[0],-e[1]);function zW(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 XM extends R2{constructor(t,n){super(t,n);const i=this;i._hrefHandler=jm(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=jm(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Sc)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(jy,this._hrefHandler),r.removeEventListener(Uy,this._tooltipHandler),r.removeEventListener(Sc,this._tooltipHandler)),this._svg=r=t&&O2(t,"svg"),r&&(r.addEventListener(jy,this._hrefHandler),r.addEventListener(Uy,this._tooltipHandler),r.addEventListener(Sc,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:jm(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 jm=(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)},KM="aria-hidden",N2="aria-label",L2="role",P2="aria-roledescription",JM="graphics-object",I2="graphics-symbol",QM=(e,t,n)=>({[L2]:e,[P2]:t,[N2]:n||void 0}),BW=yr(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),bC={axis:{desc:"axis",caption:qW},legend:{desc:"legend",caption:WW},"title-text":{desc:"title",caption:e=>`Title text '${vC(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${vC(e)}'`}},xC={ariaRole:L2,ariaRoleDescription:P2,description:N2};function ZM(e,t){const n=t.aria===!1;if(e(KM,n||void 0),n||t.description==null)for(const i in xC)e(xC[i],void 0);else{const i=t.mark.marktype;e(N2,t.description),e(L2,t.ariaRole||(i==="group"?JM:I2)),e(P2,t.ariaRoleDescription||`${i} mark`)}}function e5(e){return e.aria===!1?{[KM]:!0}:BW[e.role]?null:bC[e.role]?jW(e,bC[e.role]):UW(e)}function UW(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return QM(n?JM:I2,`${t} mark container`,e.description)}function jW(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return QM(t.role||I2,t.desc,n.description||i(n))}catch{return null}}function vC(e){return oe(e.text).join(" ")}function qW(e){const t=e.datum,n=e.orient,i=t.title?t5(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 ${Ru(a)?"discrete":a} scale with ${gM(s,o,e)}`}function WW(e){const t=e.datum,n=t.title?t5(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 HW(i)+(n?` titled '${n}'`:"")+` for ${GW(o)} with ${gM(u,a,e)}`}function t5(e){try{return oe($e(e.items).items[0].text).join(" ")}catch{return null}}function GW(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+$e(e)}function HW(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const n5=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),VW=e=>n5(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function z2(){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}="${VW(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=n5(u),a),toString:()=>e};return a}const i5=e=>r5(z2(),e)+"";function r5(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):r5(e,i)}return e.close()}const Zh={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"},eg={blend:"mix-blend-mode"},o5={fill:"none","stroke-miterlimit":10},zl=0,EC="http://www.w3.org/2000/xmlns/",mt=Yc.xmlns;class B2 extends Rf{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=yt(t,0,"svg",mt),this._svg.setAttributeNS(EC,"xmlns",mt),this._svg.setAttributeNS(EC,"xmlns:xlink",Yc["xmlns:xlink"]),this._svg.setAttribute("version",Yc.version),this._svg.setAttribute("class","marks"),ai(t,1),this._root=yt(this._svg,zl,"g",mt),Io(this._root,o5),ai(this._svg,zl+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&&(Io(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=yt(t,zl,"rect",mt),Io(i,{width:this._width,height:this._height,fill:n}));const r=i5(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),ai(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,wC(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,wC(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=AC(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return ai(c,0),n._svg;c.setAttribute("class",jM(n));const f=e5(n);for(const p in f)cn(c,p,f[p]);l||cn(c,"pointer-events",u),cn(c,"clip-path",n.clip?y2(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=AC(p,c,d,a.tag,o);m&&(this._update(a,y,p),l&&KW(this,y,p,r)),d=y,++h};return a.nested?n.items.length&&g(n.items[0]):zi(n,g),ai(c,h),c}_update(t,n,i){Zr=n,Qt=n.__values__,ZM(Cc,i),t.attr(Cc,i,this);const r=QW[t.type];r&&r.call(this,t,n,i),Zr&&this.style(Zr,i)}style(t,n){if(n!=null){for(const i in Zh){let r=i==="font"?Of(n):n[i];if(r===Qt[i])continue;const o=Zh[i];r==null?t.removeAttribute(o):(g2(r)&&(r=mM(r,this._defs.gradient,s5())),t.setAttribute(o,r+"")),Qt[i]=r}for(const i in eg)ch(t,eg[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=yt(t,zl+1,"defs",mt)),r=YW(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=yt(t,zl+1,"defs",mt)),r=XW(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):ai(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function wC(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 YW(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=yt(e,n++,"pattern",mt);Io(s,{id:jh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=yt(s,0,"rect",mt),Io(s,{width:1,height:1,fill:`url(${s5()}#${t.id})`}),e=yt(e,n++,"radialGradient",mt),Io(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=yt(e,n++,"linearGradient",mt),Io(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=yt(e,i,"stop",mt),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return ai(e,i),n}function XW(e,t,n){let i;return e=yt(e,n,"clipPath",mt),e.setAttribute("id",t.id),t.path?(i=yt(e,0,"path",mt),i.setAttribute("d",t.path)):(i=yt(e,0,"rect",mt),Io(i,{x:0,y:0,width:t.width,height:t.height})),ai(e,1),n+1}function KW(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;zi(n,s=>{r=e.mark(t,s,r,i),++o}),ai(t,1+o)}function AC(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Po(s,i,mt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=Po(s,"path",mt);o.appendChild(a),a.__data__=e;const u=Po(s,"g",mt);o.appendChild(u),u.__data__=e;const l=Po(s,"path",mt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||JW(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function JW(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Zr=null,Qt=null;const QW={group(e,t,n){const i=Zr=t.childNodes[2];Qt=i.__values__,e.foreground(Cc,n,this),Qt=t.__values__,Zr=t.childNodes[1],e.content(Cc,n,this);const r=Zr=t.childNodes[0];e.background(Cc,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Qt.events&&(cn(i,"pointer-events",o),cn(r,"pointer-events",o),Qt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;cn(i,"display",null),this.style(r,n),cn(r,"stroke",null),s&&(n.fill=null),Qt=i.__values__,this.style(i,n),s&&(n.fill=s),Zr=null}else cn(i,"display","none")},image(e,t,n){n.smooth===!1?(ch(t,"image-rendering","optimizeSpeed"),ch(t,"image-rendering","pixelated")):ch(t,"image-rendering",null)},text(e,t,n){const i=Mf(n);let r,o,s,a;Z(i)?(o=i.map(u=>es(n,u)),r=o.join(`
7
- `),r!==Qt.text&&(ai(t,0),s=t.ownerDocument,a=Zo(n),o.forEach((u,l)=>{const c=Po(s,"tspan",mt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Qt.text=r)):(o=es(n,i),o!==Qt.text&&(t.textContent=o,Qt.text=o)),cn(t,"font-family",Of(n)),cn(t,"font-size",_r(n)+"px"),cn(t,"font-style",n.fontStyle),cn(t,"font-variant",n.fontVariant),cn(t,"font-weight",n.fontWeight)}};function Cc(e,t,n){t!==Qt[e]&&(n?ZW(Zr,e,t,n):cn(Zr,e,t),Qt[e]=t)}function ch(e,t,n){n!==Qt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Qt[t]=n)}function Io(e,t){for(const n in t)cn(e,n,t[n])}function cn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function ZW(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function s5(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class a5 extends Rf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=z2();n.open("svg",ye({},Yc,{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",o5,{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=[ZM,i.attr];t.open("g",{class:jM(n),"clip-path":n.clip?y2(this,n,n.group):null},e5(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=Mf(a);if(Z(l)){const c={x:0,dy:Zo(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(es(a,l[f])).close()}else t.text(es(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)),zi(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]):zi(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&&eG(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:jh+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 eG(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"]=Of(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 Zh){let a=t[s];const u=Zh[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(g2(a)&&(a=mM(a,r.gradient,"")),e[u]=a)}for(const s in eg){const a=t[s];a!=null&&(o=o||[],o.push(`${eg[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const $i={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function tG(e){$i.svgMarkTypes=e.svgMarkTypes??["text"],$i.svgOnTop=e.svgOnTop??!0,$i.debug=e.debug??!1}class qy extends Rf{constructor(t){super(t),this._svgRenderer=new B2(t),this._canvasRenderer=new Qh(t)}initialize(t,n,i,r,o){this._root_el=yt(t,0,"div");const s=yt(this._root_el,0,"div"),a=yt(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 u5 extends Nf{constructor(t,n){super(t,n)}initialize(t,n,i){const r=yt(yt(t,0,"div"),$i.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const l5="canvas",c5="hybrid",f5="png",d5="svg",h5="none",zo={Canvas:l5,PNG:f5,SVG:d5,Hybrid:c5,None:h5},la={};la[l5]=la[f5]={renderer:Qh,headless:Qh,handler:Nf};la[d5]={renderer:B2,headless:a5,handler:XM};la[c5]={renderer:qy,headless:qy,handler:u5};la[h5]={};function Qp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(la[e]=t,this):la[e]}function g5(e,t,n){const i=[],r=new pt().union(t),o=e.marktype;return o?p5(e,r,n,i):o==="group"?m5(e,r,n,i):L("Intersect scene must be mark node or group item.")}function p5(e,t,n,i){if(nG(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)m5(r[a],t,n,i);else for(const u=ni[o].isect;a<s;++a){const l=r[a];y5(l,t,u)&&i.push(l)}}return i}function nG(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function m5(e,t,n,i){n&&n(e.mark)&&y5(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)p5(r[u],t,n,i);t.translate(s,a)}return i}function y5(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const qm=new pt;function b5(e){const t=e.clip;if(be(t))t(Df(qm.clear()));else if(t)qm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(qm)}const iG=1e-9;function U2(e,t,n){return e===t?!0:n==="path"?x5(e,t):e instanceof Date&&t instanceof Date?+e==+t:sa(e)&&sa(t)?Math.abs(e-t)<=iG:!e||!t||!me(e)&&!me(t)?e==t:rG(e,t)}function x5(e,t){return U2(Nu(e),Nu(t))}function rG(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],!U2(e[r],t[r],r))return!1;return typeof e==typeof t}function oG(){AM(),kj()}const Iu="top",ki="left",Di="right",ts="bottom",sG="top-left",aG="top-right",uG="bottom-left",lG="bottom-right",j2="start",Wy="middle",fn="end",cG="x",fG="y",Zp="group",q2="axis",W2="title",dG="frame",hG="scope",G2="legend",v5="row-header",E5="row-footer",w5="row-title",A5="column-header",S5="column-footer",C5="column-title",gG="padding",pG="symbol",$5="fit",_5="fit-x",F5="fit-y",mG="pad",H2="none",vd="all",Gy="each",V2="flush",Bo="column",Uo="row";function k5(e){M.call(this,null,e)}G(k5,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=Ed(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Zp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Ed(l,s))),i.role){case q2:case G2:case W2:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Ed(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Ed(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return b5(i),t.modifies("bounds")}});function Ed(e,t,n){return t(e.bounds.clear(),e,n)}const SC=":vega_identifier:";function Y2(e){M.call(this,0,e)}Y2.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(Y2,M,{transform(e,t){const n=yG(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 yG(e){return e._signals[SC]||(e._signals[SC]=e.add(0))}function D5(e){M.call(this,null,e)}G(D5,M,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,bG(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===Zp?Wp:qp;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 bG(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 T5(e){M.call(this,null,e)}const CC={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!M5(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},M5=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),$C=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(M5(r,o=e[n].bounds,t))return!0},xG=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},vG=(e,t,n)=>{var i=e.range(),r=new pt;return t===Iu||t===ts?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)},_C=e=>(e.forEach(t=>t.opacity=1),e),FC=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(T5,M,{transform(e,t){const n=CC[e.method]||CC.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")&&(_C(r),t=FC(t,e)),t;if(r=r.filter(xG),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=_C(r),t=FC(t,e),o.length>=3&&$C(o,i)){do o=n(o,i);while(o.length>=3&&$C(o,i));o.length<3&&!$e(r).opacity&&(o.length>1&&($e(o).opacity=0),$e(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=vG(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 O5(e){M.call(this,null,e)}G(O5,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 Jt=new pt;function cu(e,t,n){return e[t]===n?0:(e[t]=n,1)}function EG(e){var t=e.items[0].orient;return t===ki||t===Di}function wG(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function AG(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=wG(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=o.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&D2(g),b=0,x=0,v,w;switch(Jt.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 Iu:b=f||0,x=-c,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(l,0),g&&wd(e,g,w,p,y,0,-1,m);break;case ki:b=-c,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,l),g&&wd(e,g,w,p,y,1,-1,m);break;case Di:b=n+c,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,l),g&&wd(e,g,w,p,y,1,1,m);break;case ts:b=f||0,x=i+c,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,w),g&&wd(e,g,w,p,0,0,1,m);break;default:b=r.x,x=r.y}return bo(m.translate(b,x),r),cu(r,"x",b+s)|cu(r,"y",x+s)&&(r.bounds=Jt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function wd(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 kC=(e,t)=>Math.floor(Math.min(e,t)),DC=(e,t)=>Math.ceil(Math.max(e,t));function SG(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===Zp)switch(r.role){case q2:case G2:case W2:break;case v5:s.rowheaders.push(...o);break;case E5:s.rowfooters.push(...o);break;case A5:s.colheaders.push(...o);break;case S5:s.colfooters.push(...o);break;case w5:s.rowtitle=o[0];break;case C5:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function CG(e){return new pt().set(0,0,e.width||0,e.height||0)}function $G(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=me(e)?e[t]:e;return i??(n!==void 0?n:0)}function TC(e){return e<0?Math.ceil(-e):0}function R5(e,t,n){var i=!n.nodirty,r=n.bounds===V2?CG:$G,o=Jt.set(0,0,0,0),s=Je(n.align,Bo),a=Je(n.align,Uo),u=Je(n.padding,Bo),l=Je(n.padding,Uo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,x=Array(d),v=Array(d),w=Array(d),A,E,S,C,_,F,O,T,k,$,D;for(E=0;E<c;++E)g[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)F=t[E],_=w[E]=r(F),F.x=F.x||0,x[E]=0,F.y=F.y||0,v[E]=0,S=E%c,C=~~(E/c),p=Math.max(p,O=Math.ceil(_.x2)),b=Math.max(b,T=Math.ceil(_.y2)),g[S]=Math.max(g[S],O),y[C]=Math.max(y[C],T),h[E]=u+TC(_.x1),m[E]=l+TC(_.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===Gy)for(S=1;S<c;++S){for(D=0,E=S;E<d;E+=c)D<h[E]&&(D=h[E]);for(E=S;E<d;E+=c)h[E]=D+g[S-1]}else if(s===vd){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+p)}else for(s=!1,S=1;S<c;++S)for(E=S;E<d;E+=c)h[E]+=g[S-1];if(a===Gy)for(C=1;C<f;++C){for(D=0,E=C*c,A=E+c;E<A;++E)D<m[E]&&(D=m[E]);for(E=C*c;E<A;++E)m[E]=D+y[C-1]}else if(a===vd){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,C=1;C<f;++C)for(E=C*c,A=E+c;E<A;++E)m[E]+=y[C-1];for(k=0,E=0;E<d;++E)k=h[E]+(E%c?k:0),x[E]+=k-t[E].x;for(S=0;S<c;++S)for($=0,E=S;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===vd?p:g[E%c],k=_-w[E].x2-t[E].x-x[E],k>0&&(x[E]+=k/2);if(a&&Je(n.center,Uo)&&c!==1)for(E=0;E<d;++E)_=a===vd?b:y[~~(E/c)],$=_-w[E].y2-t[E].y-v[E],$>0&&(v[E]+=$/2);for(E=0;E<d;++E)o.union(w[E].translate(x[E],v[E]));switch(k=Je(n.anchor,cG),$=Je(n.anchor,fG),Je(n.anchor,Bo)){case fn:k-=o.width();break;case Wy:k-=o.width()/2}switch(Je(n.anchor,Uo)){case fn:$-=o.height();break;case Wy:$-=o.height()/2}for(k=Math.round(k),$=Math.round($),o.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)F=t[E],F.x+=x[E]+=k,F.y+=v[E]+=$,o.union(F.mark.bounds.union(F.bounds.translate(x[E],v[E]))),i&&e.dirty(F);return o}function _G(e,t,n){var i=SG(t),r=i.marks,o=n.bounds===V2?FG:kG,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=R5(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=Je(n.headerBand,Uo,null),c=Ad(e,i.rowheaders,r,a,u,-Je(s,"rowHeader"),kC,0,o,"x1",0,a,1,p)),i.colheaders&&(p=Je(n.headerBand,Bo,null),f=Ad(e,i.colheaders,r,a,a,-Je(s,"columnHeader"),kC,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=Je(n.footerBand,Uo,null),d=Ad(e,i.rowfooters,r,a,u,Je(s,"rowFooter"),DC,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=Je(n.footerBand,Bo,null),h=Ad(e,i.colfooters,r,a,a,Je(s,"columnFooter"),DC,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=Je(n.titleAnchor,Uo),m=Je(s,"rowTitle"),m=g===fn?d+m:c-m,p=Je(n.titleBand,Uo,.5),MC(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=Je(n.titleAnchor,Bo),m=Je(s,"columnTitle"),m=g===fn?h+m:f-m,p=Je(n.titleBand,Bo,.5),MC(e,i.coltitle,m,1,y,p))}function FG(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 kG(e,t){return e.bounds[t]}function Ad(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,x,v,w,A,E,S,C;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=s(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=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(A=t[b],w=A.mark.bounds,x=y;x>=0&&(E=n[x])==null;x-=d);a?(S=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),C=p):(S=p,C=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),w.union(A.bounds.translate(S-(A.x||0),C-(A.y||0))),A.x=S,A.y=C,e.dirty(A),m=s(m,w[l])}return m}function MC(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 DG(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function TG(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 MG(e,t,n,i,r,o,s){const a=DG(n,t),u=TG(e,a("offset",0)),l=a("anchor",j2),c=l===fn?1:l===Wy?.5:0,f={align:Gy,bounds:a("bounds",V2),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ki:f.anchor={x:Math.floor(i.x1)-u,column:fn,y:c*(s||i.height()+2*i.y1),row:l};break;case Di:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case Iu:f.anchor={y:Math.floor(r.y1)-u,row:fn,x:c*(o||r.width()+2*r.x1),column:l};break;case ts:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case sG:f.anchor={x:u,y:u};break;case aG:f.anchor={x:o-u,y:u,column:fn};break;case uG:f.anchor={x:u,y:s-u,row:fn};break;case lG:f.anchor={x:o-u,y:s-u,column:fn,row:fn};break}return f}function OG(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(),NG(e,n,n.items[0].items[0]),o=RG(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===pG&&LG(n.items[0].items[0].items[0].items),r!==H2&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,bo(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function RG(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function NG(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&Bl(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 ki:r+=Math.ceil(s.bounds.width())+u;break;case Di:case ts:break;default:o+=s.bounds.height()+u}switch((r||o)&&Bl(e,n,r,o),s.orient){case ki:c+=Ja(t,n,s,a,1,1);break;case Di:l+=Ja(t,n,s,fn,0,0)+u,c+=Ja(t,n,s,a,1,1);break;case ts:l+=Ja(t,n,s,a,0,0),c+=Ja(t,n,s,fn,-1,0,1)+u;break;default:l+=Ja(t,n,s,a,0,0)}(l||c)&&Bl(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(Bl(e,n,-l,0),Bl(e,s,-l,0))}}function Ja(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:D2(n);return Math.round(i===j2?f:i===fn?d-h:.5*(c-h))}function Bl(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 LG(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 PG(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===ki||a===Di?i:n,g=0,p=0,m=0,y=0,b=0,x;if(s!==Zp?a===ki?(g=r.y2,h=r.y1):a===Di?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===ki&&(g=i,h=0),x=u===j2?g:u===fn?h:(g+h)/2,d&&d.text){switch(a){case Iu:case ts:b=f.bounds.height()+c;break;case ki:y=f.bounds.width()+c;break;case Di:y=-f.bounds.width()-c;break}Jt.clear().union(d.bounds),Jt.translate(y-(d.x||0),b-(d.y||0)),cu(d,"x",y)|cu(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Jt),d.mark.bounds.clear().union(Jt),e.dirty(d)),Jt.clear().union(d.bounds)}else Jt.clear();switch(Jt.union(f.bounds),a){case Iu:p=x,m=r.y1-Jt.height()-l;break;case ki:p=r.x1-Jt.width()-l,m=x;break;case Di:p=r.x2+Jt.width()+l,m=x;break;case ts:p=x,m=r.y2+l;break;default:p=o.x,m=o.y}return cu(o,"x",p)|cu(o,"y",m)&&(Jt.translate(p,m),e.dirty(o),o.bounds.clear().union(Jt),t.bounds.clear().union(Jt),e.dirty(o)),o.bounds}function N5(e){M.call(this,null,e)}G(N5,M,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&_G(n,i,e.layout),zG(n,i,e)}),IG(e.mark.group)?t.reflow():t}});function IG(e){return e&&e.mark.role!=="legend-entry"}function zG(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new pt().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case q2:h=EG(f)?a:u,h.union(AG(e,f,r,o));break;case W2:c=f;break;case G2:l.push(OG(e,f));break;case dG:case hG:case v5:case E5:case w5:case A5:case S5:case C5: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||Di,d!==H2&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];R5(e,b,MG(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===$5||n.autosize.type===_5||n.autosize.type===F5))switch(y.orient){case ki:case Di:s.add(b.x1,0).add(b.x2,0);break;case Iu:case ts:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(PG(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),BG(e,t,s,n)}function BG(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===gG){const g=e.padding();s-=g.left+g.right,a-=g.top+g.bottom}o===H2?(l=0,f=0,u=s,c=a):o===$5?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===_5?(u=Math.max(0,s-l-d),a=c+f+h):o===F5?(s=u+l+d,c=Math.max(0,a-f-h)):o===mG&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const UG=Object.freeze(Object.defineProperty({__proto__:null,bound:k5,identifier:Y2,mark:D5,overlap:T5,render:O5,viewlayout:N5},Symbol.toStringTag,{value:"Module"}));function L5(e){M.call(this,null,e)}G(L5,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=d2(o,s,e.minstep),u=e.format||lM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?uM(o,e.values,a):h2(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Oe({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Oe({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function P5(e){M.call(this,null,e)}function jG(){return Oe({})}function qG(e){const t=xf().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(P5,M,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||jG,o=e.key||te,s=this.value;return Z(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&L("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=qG(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 I5(e){M.call(this,null,e)}G(I5,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||As,u=r.enter||As,l=r.exit||As,c=(o&&!s?r[o]:a)||As;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!==As&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==As&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==As){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 z5(e){M.call(this,[],e)}G(z5,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||nh,s=e.scale,a=+e.limit,u=d2(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===nh,c=e.format||hM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||dM(s,u),d,h,g,p,m;return r&&(i.rem=r),o===nh?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,be(g=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=wn(p=g||8),r=r.map((y,b)=>Oe({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(Oe({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):o===mj?(d=s.domain(),h=oM(s,d[0],$e(d)),f.length<3&&!e.values&&d[0]!==$e(d)&&(f=[d[0],$e(d)]),r=f.map((y,b)=>Oe({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=_j(s),r=f.map((y,b)=>Oe({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const WG=e=>e.source.x,GG=e=>e.source.y,HG=e=>e.target.x,VG=e=>e.target.y;function X2(e){M.call(this,{},e)}X2.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"}]};G(X2,M,{transform(e,t){var n=e.sourceX||WG,i=e.sourceY||GG,r=e.targetX||HG,o=e.targetY||VG,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=OC.get(u+"-"+a)||OC.get(u);return l||L("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 B5=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,YG=(e,t,n,i)=>B5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),U5=(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},XG=(e,t,n,i)=>U5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),j5=(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},KG=(e,t,n,i)=>j5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),JG=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,QG=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,ZG=(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},eH=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},tH=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},nH=(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},OC=xf({line:B5,"line-radial":YG,arc:U5,"arc-radial":XG,curve:j5,"curve-radial":KG,"orthogonal-horizontal":JG,"orthogonal-vertical":QG,"orthogonal-radial":ZG,"diagonal-horizontal":eH,"diagonal-vertical":tH,"diagonal-radial":nH});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"]}]};G(K2,M,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||bf,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)/CD(l),h=Yn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const iH=5;function rH(e){const t=e.type;return!e.bins&&(t===Mu||t===Af||t===Sf)}function q5(e){return l2(e)&&e!==hr}const oH=yr(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function W5(e){M.call(this,null,e),this.modified(!0)}G(W5,M,{transform(e,t){var n=t.dataflow,i=this.value,r=sH(e);(!i||r!==i.type)&&(this.value=i=Me(r)());for(r in e)if(!oH[r]){if(r==="padding"&&q5(i.type))continue;be(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return dH(i,e,fH(i,e,uH(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function sH(e){var t=e.type,n="",i;return t===hr?hr+"-"+Mu:(aH(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?hr+"-":i===3?fl+"-":""),(n+t||Mu).toLowerCase())}function aH(e){const t=e.type;return l2(t)&&t!==aa&&t!==ua&&(e.scheme||e.range&&e.range.length&&e.range.every(Ke))}function uH(e,t,n){const i=lH(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&rH(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 q5(o)&&t.padding&&r[0]!==$e(r)&&(r=cH(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(G5(o,r,n)),o===o2&&e.unknown(t.domainImplicit?ky:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&d2(e,t.nice)||null),r.length}function lH(e,t,n){return t?(e.domain(G5(e.type,t,n)),t.length):-1}function cH(e,t,n,i,r,o){var s=Math.abs($e(n)-n[0]),a=s/(s-2*i),u=e===fo?sD(t,null,a):e===Sf?py(t,null,a,.5):e===Af?py(t,null,a,r||1):e===Ip?aD(t,null,a,o||1):oD(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function G5(e,t,n){if(eM(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: "+re(t))}return t}function fH(e,t,n){let i=t.bins;if(i&&!Z(i)){const r=e.domain(),o=r[0],s=$e(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||L("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===s2&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function dH(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=hH(i,t,n);else if(t.scheme&&(o=gH(i,t,n),be(o))){if(e.interpolator)return e.interpolator(o);L(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&tM(i))return e.interpolator(Up(Hy(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(c2(t.interpolate,t.interpolateGamma)):be(e.round)?e.round(r):be(e.rangeRound)&&e.interpolate(r?tp:yf),o&&e.range(Hy(o,t.reverse))}function hH(e,t,n){e!==YT&&e!==Ty&&L("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Ty?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*r2(n,r,i)]}function gH(e,t,n){var i=t.schemeExtent,r,o;return Z(t.scheme)?o=Up(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=f2(r),o||L(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bp?n+1:e===s2?n-1:e===Ou||e===zp?+t.schemeCount||iH:n,tM(e)?RC(o,i,t.reverse):be(o)?rM(RC(o,i),n):e===o2?o:o.slice(0,n)}function RC(e,t,n){return be(e)&&(t||n)?iM(e,Hy(t||[0,1],n)):e}function Hy(e,t){return t?e.slice().reverse():e}function H5(e){M.call(this,null,e)}G(H5,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(Da(e.sort)),this.modified(n),t}});const NC="zero",V5="center",Y5="normalize",X5=["y0","y1"];function J2(e){M.call(this,null,e)}J2.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:NC,values:[NC,V5,Y5]},{name:"as",type:"string",array:!0,length:2,default:X5}]};G(J2,M,{transform(e,t){var n=e.as||X5,i=n[0],r=n[1],o=Da(e.sort),s=e.field||bf,a=e.offset===V5?pH:e.offset===Y5?mH:yH,u,l,c,f;for(u=bH(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 pH(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 mH(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 yH(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 bH(e,t,n,i){var r=[],o=p=>p(c),s,a,u,l,c,f,d,h,g;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,g=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>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const xH=Object.freeze(Object.defineProperty({__proto__:null,axisticks:L5,datajoin:P5,encode:I5,legendentries:z5,linkpath:X2,pie:K2,scale:W5,sortitems:H5,stack:J2},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,Vy=1e-12,Ee=Math.PI,st=Ee/2,tg=Ee/4,An=Ee*2,ut=180/Ee,xe=Ee/180,Se=Math.abs,hl=Math.atan,yi=Math.atan2,se=Math.cos,Sd=Math.ceil,K5=Math.exp,Yy=Math.hypot,ng=Math.log,Wm=Math.pow,ne=Math.sin,ci=Math.sign||function(e){return e>0?1:e<0?-1:0},Sn=Math.sqrt,Q2=Math.tan;function J5(e){return e>1?0:e<-1?Ee:Math.acos(e)}function zn(e){return e>1?st:e<-1?-st:Math.asin(e)}function zt(){}function ig(e,t){e&&PC.hasOwnProperty(e.type)&&PC[e.type](e,t)}var LC={Feature:function(e,t){ig(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)ig(n[i].geometry,t)}},PC={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){Xy(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Xy(n[i],t,0)},Polygon:function(e,t){IC(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)IC(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)ig(n[i],t)}};function Xy(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 IC(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Xy(e[n],t,1);t.polygonEnd()}function Vr(e,t){e&&LC.hasOwnProperty(e.type)?LC[e.type](e,t):ig(e,t)}var rg=new vn,og=new vn,Q5,Z5,Ky,Jy,Qy,Er={point:zt,lineStart:zt,lineEnd:zt,polygonStart:function(){rg=new vn,Er.lineStart=vH,Er.lineEnd=EH},polygonEnd:function(){var e=+rg;og.add(e<0?An+e:e),this.lineStart=this.lineEnd=this.point=zt},sphere:function(){og.add(An)}};function vH(){Er.point=wH}function EH(){eO(Q5,Z5)}function wH(e,t){Er.point=eO,Q5=e,Z5=t,e*=xe,t*=xe,Ky=e,Jy=se(t=t/2+tg),Qy=ne(t)}function eO(e,t){e*=xe,t*=xe,t=t/2+tg;var n=e-Ky,i=n>=0?1:-1,r=i*n,o=se(t),s=ne(t),a=Qy*s,u=Jy*o+a*se(r),l=a*i*ne(r);rg.add(yi(l,u)),Ky=e,Jy=o,Qy=s}function AH(e){return og=new vn,Vr(e,Er),og*2}function sg(e){return[yi(e[1],e[0]),zn(e[2])]}function ca(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*ne(t),ne(n)]}function Cd(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function zu(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 Gm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function $d(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ag(e){var t=Sn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var tt,Tn,rt,Hn,Ps,tO,nO,bu,$c,Mo,ho,qr={point:Zy,lineStart:zC,lineEnd:BC,polygonStart:function(){qr.point=rO,qr.lineStart=SH,qr.lineEnd=CH,$c=new vn,Er.polygonStart()},polygonEnd:function(){Er.polygonEnd(),qr.point=Zy,qr.lineStart=zC,qr.lineEnd=BC,rg<0?(tt=-(rt=180),Tn=-(Hn=90)):$c>ae?Hn=90:$c<-1e-6&&(Tn=-90),ho[0]=tt,ho[1]=rt},sphere:function(){tt=-(rt=180),Tn=-(Hn=90)}};function Zy(e,t){Mo.push(ho=[tt=e,rt=e]),t<Tn&&(Tn=t),t>Hn&&(Hn=t)}function iO(e,t){var n=ca([e*xe,t*xe]);if(bu){var i=zu(bu,n),r=[i[1],-i[0],0],o=zu(r,i);ag(o),o=sg(o);var s=e-Ps,a=s>0?1:-1,u=o[0]*ut*a,l,c=Se(s)>180;c^(a*Ps<u&&u<a*e)?(l=o[1]*ut,l>Hn&&(Hn=l)):(u=(u+360)%360-180,c^(a*Ps<u&&u<a*e)?(l=-o[1]*ut,l<Tn&&(Tn=l)):(t<Tn&&(Tn=t),t>Hn&&(Hn=t))),c?e<Ps?Gn(tt,e)>Gn(tt,rt)&&(rt=e):Gn(e,rt)>Gn(tt,rt)&&(tt=e):rt>=tt?(e<tt&&(tt=e),e>rt&&(rt=e)):e>Ps?Gn(tt,e)>Gn(tt,rt)&&(rt=e):Gn(e,rt)>Gn(tt,rt)&&(tt=e)}else Mo.push(ho=[tt=e,rt=e]);t<Tn&&(Tn=t),t>Hn&&(Hn=t),bu=n,Ps=e}function zC(){qr.point=iO}function BC(){ho[0]=tt,ho[1]=rt,qr.point=Zy,bu=null}function rO(e,t){if(bu){var n=e-Ps;$c.add(Se(n)>180?n+(n>0?360:-360):n)}else tO=e,nO=t;Er.point(e,t),iO(e,t)}function SH(){Er.lineStart()}function CH(){rO(tO,nO),Er.lineEnd(),Se($c)>ae&&(tt=-(rt=180)),ho[0]=tt,ho[1]=rt,bu=null}function Gn(e,t){return(t-=e)<0?t+360:t}function $H(e,t){return e[0]-t[0]}function UC(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function _H(e){var t,n,i,r,o,s,a;if(Hn=rt=-(tt=Tn=1/0),Mo=[],Vr(e,qr),n=Mo.length){for(Mo.sort($H),t=1,i=Mo[0],o=[i];t<n;++t)r=Mo[t],UC(i,r[0])||UC(i,r[1])?(Gn(i[0],r[1])>Gn(i[0],i[1])&&(i[1]=r[1]),Gn(r[0],i[1])>Gn(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=Gn(i[1],r[0]))>s&&(s=a,tt=r[0],rt=i[1])}return Mo=ho=null,tt===1/0||Tn===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,Tn],[rt,Hn]]}var cc,ug,lg,cg,fg,dg,hg,gg,eb,tb,nb,oO,sO,dn,hn,gn,Ti={sphere:zt,point:Z2,lineStart:jC,lineEnd:qC,polygonStart:function(){Ti.lineStart=DH,Ti.lineEnd=TH},polygonEnd:function(){Ti.lineStart=jC,Ti.lineEnd=qC}};function Z2(e,t){e*=xe,t*=xe;var n=se(t);Lf(n*se(e),n*ne(e),ne(t))}function Lf(e,t,n){++cc,lg+=(e-lg)/cc,cg+=(t-cg)/cc,fg+=(n-fg)/cc}function jC(){Ti.point=FH}function FH(e,t){e*=xe,t*=xe;var n=se(t);dn=n*se(e),hn=n*ne(e),gn=ne(t),Ti.point=kH,Lf(dn,hn,gn)}function kH(e,t){e*=xe,t*=xe;var n=se(t),i=n*se(e),r=n*ne(e),o=ne(t),s=yi(Sn((s=hn*o-gn*r)*s+(s=gn*i-dn*o)*s+(s=dn*r-hn*i)*s),dn*i+hn*r+gn*o);ug+=s,dg+=s*(dn+(dn=i)),hg+=s*(hn+(hn=r)),gg+=s*(gn+(gn=o)),Lf(dn,hn,gn)}function qC(){Ti.point=Z2}function DH(){Ti.point=MH}function TH(){aO(oO,sO),Ti.point=Z2}function MH(e,t){oO=e,sO=t,e*=xe,t*=xe,Ti.point=aO;var n=se(t);dn=n*se(e),hn=n*ne(e),gn=ne(t),Lf(dn,hn,gn)}function aO(e,t){e*=xe,t*=xe;var n=se(t),i=n*se(e),r=n*ne(e),o=ne(t),s=hn*o-gn*r,a=gn*i-dn*o,u=dn*r-hn*i,l=Yy(s,a,u),c=zn(l),f=l&&-c/l;eb.add(f*s),tb.add(f*a),nb.add(f*u),ug+=c,dg+=c*(dn+(dn=i)),hg+=c*(hn+(hn=r)),gg+=c*(gn+(gn=o)),Lf(dn,hn,gn)}function OH(e){cc=ug=lg=cg=fg=dg=hg=gg=0,eb=new vn,tb=new vn,nb=new vn,Vr(e,Ti);var t=+eb,n=+tb,i=+nb,r=Yy(t,n,i);return r<Vy&&(t=dg,n=hg,i=gg,ug<ae&&(t=lg,n=cg,i=fg),r=Yy(t,n,i),r<Vy)?[NaN,NaN]:[yi(n,t)*ut,zn(i/r)*ut]}function ib(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 rb(e,t){return Se(e)>Ee&&(e-=Math.round(e/An)*An),[e,t]}rb.invert=rb;function uO(e,t,n){return(e%=An)?t||n?ib(GC(e),HC(t,n)):GC(e):t||n?HC(t,n):rb}function WC(e){return function(t,n){return t+=e,Se(t)>Ee&&(t-=Math.round(t/An)*An),[t,n]}}function GC(e){var t=WC(e);return t.invert=WC(-e),t}function HC(e,t){var n=se(e),i=ne(e),r=se(t),o=ne(t);function s(a,u){var l=se(u),c=se(a)*l,f=ne(a)*l,d=ne(u),h=d*n+c*i;return[yi(f*r-h*o,c*n-d*i),zn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=ne(a)*l,d=ne(u),h=d*r-f*o;return[yi(f*r+d*o,c*n+h*i),zn(h*n-c*i)]},s}function RH(e){e=uO(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]*=ut,n[1]*=ut,n}return t.invert=function(n){return n=e.invert(n[0]*xe,n[1]*xe),n[0]*=ut,n[1]*=ut,n},t}function NH(e,t,n,i,r,o){if(n){var s=se(t),a=ne(t),u=i*n;r==null?(r=t+i*An,o=t-u/2):(r=VC(s,r),o=VC(s,o),(i>0?r<o:r>o)&&(r+=i*An));for(var l,c=r;i>0?c>o:c<o;c-=u)l=sg([s,-a*se(c),-a*ne(c)]),e.point(l[0],l[1])}}function VC(e,t){t=ca(t),t[0]-=e,ag(t);var n=J5(-t[1]);return((-t[2]<0?-n:n)+An-ae)%An}function lO(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:zt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fh(e,t){return Se(e[0]-t[0])<ae&&Se(e[1]-t[1])<ae}function _d(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 cO(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(fh(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ae}o.push(b=new _d(m,g,null,!0)),s.push(b.o=new _d(m,null,b,!1)),o.push(b=new _d(y,g,null,!1)),s.push(b.o=new _d(y,null,b,!0))}}),!!o.length){for(s.sort(t),YC(o),YC(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 YC(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 Hm(e){return Se(e[0])<=Ee?e[0]:ci(e[0])*((Se(e[0])+Ee)%An-Ee)}function LH(e,t){var n=Hm(t),i=t[1],r=ne(i),o=[ne(n),-se(n),0],s=0,a=0,u=new vn;r===1?i=st+ae:r===-1&&(i=-st-ae);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=Hm(h),p=h[1]/2+tg,m=ne(p),y=se(p),b=0;b<d;++b,g=v,m=A,y=E,h=x){var x=f[b],v=Hm(x),w=x[1]/2+tg,A=ne(w),E=se(w),S=v-g,C=S>=0?1:-1,_=C*S,F=_>Ee,O=m*A;if(u.add(yi(O*C*ne(_),y*E+O*se(_))),s+=F?S+C*An:S,F^g>=n^v>=n){var T=zu(ca(h),ca(x));ag(T);var k=zu(o,T);ag(k);var $=(F^S>=0?-1:1)*zn(k[2]);(i>$||i===$&&(T[0]||T[1]))&&(a+=F^S>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function fO(e,t,n,i){return function(r){var o=t(r),s=lO(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=x,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=SD(c);var v=LH(l,i);c.length?(u||(r.polygonStart(),u=!0),cO(c,IH,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,w){e(v,w)&&r.point(v,w)}function g(v,w){o.point(v,w)}function p(){d.point=g,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(v,w){f.push([v,w]),a.point(v,w)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var v=a.clean(),w=s.result(),A,E=w.length,S,C,_;if(f.pop(),l.push(f),f=null,!!E){if(v&1){if(C=w[0],(S=C.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),A=0;A<S;++A)r.point((_=C[A])[0],_[1]);r.lineEnd()}return}E>1&&v&2&&w.push(w.pop().concat(w.shift())),c.push(w.filter(PH))}}return d}}function PH(e){return e.length>1}function IH(e,t){return((e=e.x)[0]<0?e[1]-st-ae:st-e[1])-((t=t.x)[0]<0?t[1]-st-ae:st-t[1])}const XC=fO(function(){return!0},zH,UH,[-Ee,-st]);function zH(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=Se(o-t);Se(u-Ee)<ae?(e.point(t,n=(n+s)/2>0?st:-st),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=Ee&&(Se(t-i)<ae&&(t-=i*ae),Se(o-a)<ae&&(o-=a*ae),n=BH(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 BH(e,t,n,i){var r,o,s=ne(e-n);return Se(s)>ae?hl((ne(t)*(o=se(i))*ne(n)-ne(i)*(r=se(t))*ne(e))/(r*o*s)):(t+i)/2}function UH(e,t,n,i){var r;if(e==null)r=n*st,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(Se(e[0]-t[0])>ae){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 jH(e){var t=se(e),n=2*xe,i=t>0,r=Se(t)>ae;function o(c,f,d,h){NH(h,e,n,d,c,f)}function s(c,f){return se(c)*se(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],x,v=s(m,y),w=i?v?0:l(m,y):v?l(m+(m<0?Ee:-Ee),y):0;if(!f&&(g=h=v)&&c.lineStart(),v!==h&&(x=u(f,b),(!x||fh(f,x)||fh(b,x))&&(b[2]=1)),v!==h)p=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 A;!(w&d)&&(A=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(A[0][0],A[0][1]),c.point(A[1][0],A[1][1]),c.lineEnd()):(c.point(A[1][0],A[1][1]),c.lineEnd(),c.lineStart(),c.point(A[0][0],A[0][1],3)))}v&&(!f||!fh(f,b))&&c.point(b[0],b[1]),f=b,h=v,d=w},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=ca(c),g=ca(f),p=[1,0,0],m=zu(h,g),y=Cd(m,m),b=m[0],x=y-b*b;if(!x)return!d&&c;var v=t*y/x,w=-t*b/x,A=zu(p,m),E=$d(p,v),S=$d(m,w);Gm(E,S);var C=A,_=Cd(E,C),F=Cd(C,C),O=_*_-F*(Cd(E,E)-1);if(!(O<0)){var T=Sn(O),k=$d(C,(-_-T)/F);if(Gm(k,E),k=sg(k),!d)return k;var $=c[0],D=f[0],P=c[1],z=f[1],I;D<$&&(I=$,$=D,D=I);var V=D-$,ue=Se(V-Ee)<ae,ie=ue||V<ae;if(!ue&&z<P&&(I=P,P=z,z=I),ie?ue?P+z>0^k[1]<(Se(k[0]-$)<ae?P:z):P<=k[1]&&k[1]<=z:V>Ee^($<=k[0]&&k[0]<=D)){var he=$d(C,(-_+T)/F);return Gm(he,E),[k,sg(he)]}}}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 fO(s,a,o,i?[0,-e]:[-Ee,e-Ee])}function qH(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,g;if(g=n-s,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-s,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=o-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}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 Fd=1e9,kd=-1e9;function dO(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,g=0;if(l==null||(h=s(l,f))!==(g=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)!==g);else d.point(c[0],c[1])}function s(l,c){return Se(l[0]-e)<ae?c>0?0:3:Se(l[0]-n)<ae?c>0?2:1:Se(l[1]-t)<ae?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=lO(),d,h,g,p,m,y,b,x,v,w,A,E={point:S,lineStart:O,lineEnd:T,polygonStart:_,polygonEnd:F};function S($,D){r($,D)&&c.point($,D)}function C(){for(var $=0,D=0,P=h.length;D<P;++D)for(var z=h[D],I=1,V=z.length,ue=z[0],ie,he,We=ue[0],ge=ue[1];I<V;++I)ie=We,he=ge,ue=z[I],We=ue[0],ge=ue[1],he<=i?ge>i&&(We-ie)*(i-he)>(ge-he)*(e-ie)&&++$:ge<=i&&(We-ie)*(i-he)<(ge-he)*(e-ie)&&--$;return $}function _(){c=f,d=[],h=[],A=!0}function F(){var $=C(),D=A&&$,P=(d=SD(d)).length;(D||P)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&cO(d,a,$,o,l),l.polygonEnd()),c=l,d=h=g=null}function O(){E.point=k,h&&h.push(g=[]),w=!0,v=!1,b=x=NaN}function T(){d&&(k(p,m),y&&v&&f.rejoin(),d.push(f.result())),E.point=S,v&&c.lineEnd()}function k($,D){var P=r($,D);if(h&&g.push([$,D]),w)p=$,m=D,y=P,w=!1,P&&(c.lineStart(),c.point($,D));else if(P&&v)c.point($,D);else{var z=[b=Math.max(kd,Math.min(Fd,b)),x=Math.max(kd,Math.min(Fd,x))],I=[$=Math.max(kd,Math.min(Fd,$)),D=Math.max(kd,Math.min(Fd,D))];qH(z,I,e,t,n,i)?(v||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),P||c.lineEnd(),A=!1):P&&(c.lineStart(),c.point($,D),A=!1)}b=$,x=D,v=P}return E}}function KC(e,t,n){var i=Yn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function JC(e,t,n){var i=Yn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function WH(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Yn(Sd(i/c)*c,n,c).map(g).concat(Yn(Sd(a/f)*f,s,f).map(p)).concat(Yn(Sd(t/u)*u,e,u).filter(function(x){return Se(x%c)>ae}).map(d)).concat(Yn(Sd(o/l)*l,r,l).filter(function(x){return Se(x%f)>ae}).map(h))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(s).slice(1),g(n).reverse().slice(1),p(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=KC(o,r,90),h=JC(t,e,m),g=KC(a,s,90),p=JC(i,n,m),y):m},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}const Xc=e=>e;var Vm=new vn,ob=new vn,hO,gO,sb,ab,Yr={point:zt,lineStart:zt,lineEnd:zt,polygonStart:function(){Yr.lineStart=GH,Yr.lineEnd=VH},polygonEnd:function(){Yr.lineStart=Yr.lineEnd=Yr.point=zt,Vm.add(Se(ob)),ob=new vn},result:function(){var e=Vm/2;return Vm=new vn,e}};function GH(){Yr.point=HH}function HH(e,t){Yr.point=pO,hO=sb=e,gO=ab=t}function pO(e,t){ob.add(ab*e-sb*t),sb=e,ab=t}function VH(){pO(hO,gO)}var Bu=1/0,pg=Bu,Kc=-Bu,mg=Kc,yg={point:YH,lineStart:zt,lineEnd:zt,polygonStart:zt,polygonEnd:zt,result:function(){var e=[[Bu,pg],[Kc,mg]];return Kc=mg=-(pg=Bu=1/0),e}};function YH(e,t){e<Bu&&(Bu=e),e>Kc&&(Kc=e),t<pg&&(pg=t),t>mg&&(mg=t)}var ub=0,lb=0,fc=0,bg=0,xg=0,fu=0,cb=0,fb=0,dc=0,mO,yO,ur,lr,ui={point:fa,lineStart:QC,lineEnd:ZC,polygonStart:function(){ui.lineStart=JH,ui.lineEnd=QH},polygonEnd:function(){ui.point=fa,ui.lineStart=QC,ui.lineEnd=ZC},result:function(){var e=dc?[cb/dc,fb/dc]:fu?[bg/fu,xg/fu]:fc?[ub/fc,lb/fc]:[NaN,NaN];return ub=lb=fc=bg=xg=fu=cb=fb=dc=0,e}};function fa(e,t){ub+=e,lb+=t,++fc}function QC(){ui.point=XH}function XH(e,t){ui.point=KH,fa(ur=e,lr=t)}function KH(e,t){var n=e-ur,i=t-lr,r=Sn(n*n+i*i);bg+=r*(ur+e)/2,xg+=r*(lr+t)/2,fu+=r,fa(ur=e,lr=t)}function ZC(){ui.point=fa}function JH(){ui.point=ZH}function QH(){bO(mO,yO)}function ZH(e,t){ui.point=bO,fa(mO=ur=e,yO=lr=t)}function bO(e,t){var n=e-ur,i=t-lr,r=Sn(n*n+i*i);bg+=r*(ur+e)/2,xg+=r*(lr+t)/2,fu+=r,r=lr*e-ur*t,cb+=r*(ur+e),fb+=r*(lr+t),dc+=r*3,fa(ur=e,lr=t)}function xO(e){this._context=e}xO.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,An);break}}},result:zt};var db=new vn,Ym,vO,EO,hc,gc,Jc={point:zt,lineStart:function(){Jc.point=eV},lineEnd:function(){Ym&&wO(vO,EO),Jc.point=zt},polygonStart:function(){Ym=!0},polygonEnd:function(){Ym=null},result:function(){var e=+db;return db=new vn,e}};function eV(e,t){Jc.point=wO,vO=hc=e,EO=gc=t}function wO(e,t){hc-=e,gc-=t,db.add(Sn(hc*hc+gc*gc)),hc=e,gc=t}let e$,vg,t$,n$;class i${constructor(t){this._append=t==null?AO:tV(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!==t$||this._append!==vg){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`,t$=i,vg=this._append,n$=this._,this._=r}this._+=n$;break}}}result(){const t=this._;return this._="",t.length?t:null}}function AO(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function tV(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return AO;if(t!==e$){const n=10**t;e$=t,vg=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 vg}function SO(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),Vr(a,r(o))),o.result()}return s.area=function(a){return Vr(a,r(Yr)),Yr.result()},s.measure=function(a){return Vr(a,r(Jc)),Jc.result()},s.bounds=function(a){return Vr(a,r(yg)),yg.result()},s.centroid=function(a){return Vr(a,r(ui)),ui.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,Xc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new i$(n)):new xO(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 i$(n)),s},s.projection(e).digits(n).context(t)}function e0(e){return function(t){var n=new hb;for(var i in e)n[i]=e[i];return n.stream=t,n}}function hb(){}hb.prototype={constructor:hb,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 eE(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Vr(n,e.stream(yg)),t(yg.result()),i!=null&&e.clipExtent(i),e}function t0(e,t,n){return eE(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 tE(e,t,n){return t0(e,[[0,0],t],n)}function nE(e,t,n){return eE(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 iE(e,t,n){return eE(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 r$=16,nV=se(30*xe);function o$(e,t){return+t?rV(e,t):iV(e)}function iV(e){return e0({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function rV(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,x=y*y+b*b;if(x>4*t&&p--){var v=s+d,w=a+h,A=u+g,E=Sn(v*v+w*w+A*A),S=zn(A/=E),C=Se(Se(A)-1)<ae||Se(o-f)<ae?(o+f)/2:yi(w,v),_=e(C,S),F=_[0],O=_[1],T=F-i,k=O-r,$=b*T-y*k;($*$/x>t||Se((y*T+b*k)/x-.5)>.3||s*d+a*h+u*g<nV)&&(n(i,r,o,s,a,u,F,O,C,v/=E,w/=E,A,p,m),m.point(F,O),n(F,O,C,v,w,A,l,c,f,d,h,g,p,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:v,polygonStart:function(){i.polygonStart(),m.lineStart=w},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(S,C){S=e(S,C),i.point(S[0],S[1])}function b(){f=NaN,m.point=x,i.lineStart()}function x(S,C){var _=ca([S,C]),F=e(S,C);n(f,d,c,h,g,p,f=F[0],d=F[1],c=S,h=_[0],g=_[1],p=_[2],r$,i),i.point(f,d)}function v(){m.point=y,i.lineEnd()}function w(){b(),m.point=A,m.lineEnd=E}function A(S,C){x(r=S,C),o=f,s=d,a=h,u=g,l=p,m.point=x}function E(){n(f,d,c,h,g,p,o,s,r,a,u,l,r$,i),m.lineEnd=v,v()}return m}}var oV=e0({point:function(e,t){this.stream.point(e*xe,t*xe)}});function sV(e){return e0({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function aV(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 s$(e,t,n,i,r,o){if(!o)return aV(e,t,n,i,r);var s=se(o),a=ne(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 g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function Fr(e){return CO(function(){return e})()}function CO(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,g=null,p=XC,m=null,y,b,x,v=Xc,w=.5,A,E,S,C,_;function F($){return S($[0]*xe,$[1]*xe)}function O($){return $=S.invert($[0],$[1]),$&&[$[0]*ut,$[1]*ut]}F.stream=function($){return C&&_===$?C:C=oV(sV(c)(p(A(v(_=$)))))},F.preclip=function($){return arguments.length?(p=$,g=void 0,k()):p},F.postclip=function($){return arguments.length?(v=$,m=y=b=x=null,k()):v},F.clipAngle=function($){return arguments.length?(p=+$?jH(g=$*xe):(g=null,XC),k()):g*ut},F.clipExtent=function($){return arguments.length?(v=$==null?(m=y=b=x=null,Xc):dO(m=+$[0][0],y=+$[0][1],b=+$[1][0],x=+$[1][1]),k()):m==null?null:[[m,y],[b,x]]},F.scale=function($){return arguments.length?(n=+$,T()):n},F.translate=function($){return arguments.length?(i=+$[0],r=+$[1],T()):[i,r]},F.center=function($){return arguments.length?(o=$[0]%360*xe,s=$[1]%360*xe,T()):[o*ut,s*ut]},F.rotate=function($){return arguments.length?(a=$[0]%360*xe,u=$[1]%360*xe,l=$.length>2?$[2]%360*xe:0,T()):[a*ut,u*ut,l*ut]},F.angle=function($){return arguments.length?(f=$%360*xe,T()):f*ut},F.reflectX=function($){return arguments.length?(d=$?-1:1,T()):d<0},F.reflectY=function($){return arguments.length?(h=$?-1:1,T()):h<0},F.precision=function($){return arguments.length?(A=o$(E,w=$*$),k()):Sn(w)},F.fitExtent=function($,D){return t0(F,$,D)},F.fitSize=function($,D){return tE(F,$,D)},F.fitWidth=function($,D){return nE(F,$,D)},F.fitHeight=function($,D){return iE(F,$,D)};function T(){var $=s$(n,0,0,d,h,f).apply(null,t(o,s)),D=s$(n,i-$[0],r-$[1],d,h,f);return c=uO(a,u,l),E=ib(t,D),S=ib(c,E),A=o$(E,w),k()}function k(){return C=_=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&O,T()}}function rE(e){var t=0,n=Ee/3,i=CO(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*xe,n=o[1]*xe):[t*ut,n*ut]},r}function uV(e){var t=se(e);function n(i,r){return[i*t,ne(r)/t]}return n.invert=function(i,r){return[i/t,zn(r*t)]},n}function lV(e,t){var n=ne(e),i=(n+ne(t))/2;if(Se(i)<ae)return uV(e);var r=1+n*(2*i-n),o=Sn(r)/i;function s(a,u){var l=Sn(r-2*i*ne(u))/i;return[l*ne(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=yi(a,Se(l))*ci(l);return l*i<0&&(c-=Ee*ci(a)*ci(l)),[c/i,zn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Eg(){return rE(lV).scale(155.424).center([0,33.6442])}function $O(){return Eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function cV(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 fV(){var e,t,n=$O(),i,r=Eg().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Eg().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],g=d[1];return u=null,i.point(h,g),u||(o.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=cV([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(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),o=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ae,p+.12*h+ae],[g-.214*h-ae,p+.234*h-ae]]).stream(l),a=s.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ae,p+.166*h+ae],[g-.115*h-ae,p+.234*h-ae]]).stream(l),f()},c.fitExtent=function(d,h){return t0(c,d,h)},c.fitSize=function(d,h){return tE(c,d,h)},c.fitWidth=function(d,h){return nE(c,d,h)},c.fitHeight=function(d,h){return iE(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function _O(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*ne(t),o*ne(n)]}}function Pf(e){return function(t,n){var i=Sn(t*t+n*n),r=e(i),o=ne(r),s=se(r);return[yi(t*o,i*s),zn(i&&n*o/i)]}}var FO=_O(function(e){return Sn(2/(1+e))});FO.invert=Pf(function(e){return 2*zn(e/2)});function dV(){return Fr(FO).scale(124.75).clipAngle(180-.001)}var kO=_O(function(e){return(e=J5(e))&&e/ne(e)});kO.invert=Pf(function(e){return e});function hV(){return Fr(kO).scale(79.4188).clipAngle(180-.001)}function n0(e,t){return[e,ng(Q2((st+t)/2))]}n0.invert=function(e,t){return[e,2*hl(K5(t))-st]};function gV(){return DO(n0).scale(961/An)}function DO(e){var t=Fr(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(RH(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===n0?[[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 Dd(e){return Q2((st+e)/2)}function pV(e,t){var n=se(e),i=e===t?ne(e):ng(n/se(t))/ng(Dd(t)/Dd(e)),r=n*Wm(Dd(e),i)/i;if(!i)return n0;function o(s,a){r>0?a<-st+ae&&(a=-st+ae):a>st-ae&&(a=st-ae);var u=r/Wm(Dd(a),i);return[u*ne(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=ci(i)*Sn(s*s+u*u),c=yi(s,Se(u))*ci(u);return u*i<0&&(c-=Ee*ci(s)*ci(u)),[c/i,2*hl(Wm(r/l,1/i))-st]},o}function mV(){return rE(pV).scale(109.5).parallels([30,30])}function wg(e,t){return[e,t]}wg.invert=wg;function yV(){return Fr(wg).scale(152.63)}function bV(e,t){var n=se(e),i=e===t?ne(e):(n-se(t))/(t-e),r=n/i+e;if(Se(i)<ae)return wg;function o(s,a){var u=r-a,l=i*s;return[u*ne(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=yi(s,Se(u))*ci(u);return u*i<0&&(l-=Ee*ci(s)*ci(u)),[l/i,r-ci(i)*Sn(s*s+u*u)]},o}function xV(){return rE(bV).scale(131.154).center([0,13.9389])}var _c=1.340264,Fc=-.081106,kc=893e-6,Dc=.003796,Ag=Sn(3)/2,vV=12;function TO(e,t){var n=zn(Ag*ne(t)),i=n*n,r=i*i*i;return[e*se(n)/(Ag*(_c+3*Fc*i+r*(7*kc+9*Dc*i))),n*(_c+Fc*i+r*(kc+Dc*i))]}TO.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<vV&&(a=n*(_c+Fc*i+r*(kc+Dc*i))-t,u=_c+3*Fc*i+r*(7*kc+9*Dc*i),n-=s=a/u,i=n*n,r=i*i*i,!(Se(s)<Vy));++o);return[Ag*e*(_c+3*Fc*i+r*(7*kc+9*Dc*i))/se(n),zn(ne(n)/Ag)]};function EV(){return Fr(TO).scale(177.158)}function MO(e,t){var n=se(t),i=se(e)*n;return[n*ne(e)/i,ne(t)/i]}MO.invert=Pf(hl);function wV(){return Fr(MO).scale(144.049).clipAngle(60)}function AV(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,g=e0({point:function(v,w){var A=x([v,w]);this.stream.point(A[0],A[1])}}),p=Xc,m,y;function b(){return d=e*i,h=e*r,m=y=null,x}function x(v){var w=v[0]*d,A=v[1]*h;if(o){var E=A*s-w*a;w=w*s+A*a,A=E}return[w+t,A+n]}return x.invert=function(v){var w=v[0]-t,A=v[1]-n;if(o){var E=A*s+w*a;w=w*s-A*a,A=E}return[w/d,A/h]},x.stream=function(v){return m&&y===v?m:m=g(p(y=v))},x.postclip=function(v){return arguments.length?(p=v,u=l=c=f=null,b()):p},x.clipExtent=function(v){return arguments.length?(p=v==null?(u=l=c=f=null,Xc):dO(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=ne(o),s=se(o),b()):o*ut},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,w){return t0(x,v,w)},x.fitSize=function(v,w){return tE(x,v,w)},x.fitWidth=function(v,w){return nE(x,v,w)},x.fitHeight=function(v,w){return iE(x,v,w)},x}function OO(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)))]}OO.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(Se(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function SV(){return Fr(OO).scale(175.295)}function RO(e,t){return[se(t)*ne(e),ne(t)]}RO.invert=Pf(zn);function CV(){return Fr(RO).scale(249.5).clipAngle(90+ae)}function NO(e,t){var n=se(t),i=1+se(e)*n;return[n*ne(e)/i,ne(t)/i]}NO.invert=Pf(function(e){return 2*hl(e)});function $V(){return Fr(NO).scale(250).clipAngle(142)}function LO(e,t){return[ng(Q2((st+t)/2)),-e]}LO.invert=function(e,t){return[-t,2*hl(K5(e))-st]};function _V(){var e=DO(LO),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 FV=Math.abs,gb=Math.cos,Sg=Math.sin,kV=1e-6,PO=Math.PI,pb=PO/2,a$=DV(2);function u$(e){return e>1?pb:e<-1?-pb:Math.asin(e)}function DV(e){return e>0?Math.sqrt(e):0}function TV(e,t){var n=e*Sg(t),i=30,r;do t-=r=(t+Sg(t)-n)/(1+gb(t));while(FV(r)>kV&&--i>0);return t/2}function MV(e,t,n){function i(r,o){return[e*r*gb(o=TV(n,o)),t*Sg(o)]}return i.invert=function(r,o){return o=u$(o/t),[r/(e*gb(o)),u$((2*o+Sg(2*o))/n)]},i}var OV=MV(a$/pb,a$,PO);function RV(){return Fr(OV).scale(169.529)}const NV=SO(),mb=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function LV(e,t){return function n(){const i=t();return i.type=e,i.path=SO().projection(i),i.copy=i.copy||function(){const r=n();return mb.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},QT(i)}}function oE(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Cg[e]=LV(e,t),this):Cg[e]||null}function IO(e){return e&&e.path||NV}const Cg={albers:$O,albersusa:fV,azimuthalequalarea:dV,azimuthalequidistant:hV,conicconformal:mV,conicequalarea:Eg,conicequidistant:xV,equalEarth:EV,equirectangular:yV,gnomonic:wV,identity:AV,mercator:gV,mollweide:RV,naturalEarth1:SV,orthographic:CV,stereographic:$V,transversemercator:_V};for(const e in Cg)oE(e,Cg[e]);function PV(){}const zr=[[],[[[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 zO(){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),IV(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(zV((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,zr[m<<1].forEach(x);++h<e-1;)p=m,m=u[h+1]>=l,zr[p|m<<1].forEach(x);for(zr[m<<0].forEach(x);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,zr[m<<1|y<<2].forEach(x);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,zr[p|m<<1|y<<2|b<<3].forEach(x);zr[m|y<<3].forEach(x)}for(h=-1,y=u[g*e]>=l,zr[y<<2].forEach(x);++h<e-1;)b=y,y=u[g*e+h+1]>=l,zr[y<<2|b<<3].forEach(x);zr[y<<3].forEach(x);function x(v){var w=[v[0][0]+h,v[0][1]+g],A=[v[1][0]+h,v[1][1]+g],E=s(w),S=s(A),C,_;(C=d[E])?(_=f[S])?(delete d[C.end],delete f[_.start],C===_?(C.ring.push(A),c(C.ring)):f[C.start]=d[_.end]={start:C.start,end:_.end,ring:C.ring.concat(_.ring)}):(delete d[C.end],C.ring.push(A),d[C.end=S]=C):(C=f[S])?(_=d[E])?(delete f[C.start],delete d[_.end],C===_?(C.ring.push(A),c(C.ring)):f[_.start]=d[C.end]={start:_.start,end:C.end,ring:_.ring.concat(C.ring)}):(delete f[C.start],C.ring.unshift(w),f[C.start=E]=C):f[E]=d[S]={start:E,end:S,ring:[w,A]}}}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],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],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||L("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:PV,i):n===a},i}function IV(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 zV(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=BV(e,t[n]))return r;return 0}function BV(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(UV(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function UV(e,t,n){var i;return jV(e,t,n)&&qV(e[i=+(e[0]===t[0])],n[i],t[i])}function jV(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function qV(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function BO(e,t,n){return function(i){var r=lo(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?ra(o,s,e):a/(e+1);return Yn(o+u,s,u)}}function sE(e){M.call(this,null,e)}sE.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"}]};G(sE,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||Ln,o=zO().smooth(e.smooth!==!1),s=e.thresholds||WV(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));GV(f,c,l,e),f.forEach(d=>{u.push(Ap(l,Oe(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function WV(e,t,n){const i=BO(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Xs(t(r).values)))}function GV(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(be(r)&&(r=r(n,i)),be(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(sa(r)?r:r[0])||1,a=(sa(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(UO(t,s,a,u,l))}function UO(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 l$(e,t,n){const i=e>=0?e:tv(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Xm(e){return be(e)?e:wn(+e)}function jO(){var e=u=>u[0],t=u=>u[1],n=bf,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=l$(i[0],u,e)>>s,f=l$(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>s),p=2*h+(o>>s),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(v=>{const w=d+(+e(v)>>s),A=h+(+t(v)>>s);w>=0&&w<g&&A>=0&&A<p&&(m[w+A*g]+=+n(v))}),c>0&&f>0?(Qa(g,p,m,y,c),Za(g,p,y,m,f),Qa(g,p,m,y,c),Za(g,p,y,m,f),Qa(g,p,m,y,c),Za(g,p,y,m,f)):c>0?(Qa(g,p,m,y,c),Qa(g,p,y,m,c),Qa(g,p,m,y,c),b=y):f>0&&(Za(g,p,m,y,f),Za(g,p,y,m,f),Za(g,p,m,y,f),b=y);const x=l?Math.pow(2,-2*s):1/CD(b);for(let v=0,w=g*p;v<w;++v)b[v]*=x;return{values:b,scale:1<<s,width:g,height:p,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=Xm(u),a):e},a.y=function(u){return arguments.length?(t=Xm(u),a):t},a.weight=function(u){return arguments.length?(n=Xm(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||L("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||L("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=oe(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&L("invalid bandwidth"),i=u,a):i},a}function Qa(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 Za(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 aE(e){M.call(this,null,e)}aE.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 HV=["x","y","weight","size","cellSize","bandwidth"];function qO(e,t){return HV.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(aE,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=VV(i,e.groupby),o=(e.groupby||[]).map(lt),s=qO(jO(),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=>Oe(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function VV(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 uE(e){M.call(this,null,e)}uE.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}]};G(uE,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=zO().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||BO(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=qO(jO(),e)(r,!0),u=UO(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(Oe),n}});const yb="Feature",lE="FeatureCollection",YV="MultiPoint";function cE(e){M.call(this,null,e)}cE.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(cE,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&&Ln,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(xn(a))||o&&t.modified(xn(o))||s&&t.modified(xn(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:yb,geometry:{type:YV,coordinates:i}})),this.value={type:lE,features:n}}});function fE(e){M.call(this,null,e)}fE.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"}]};G(fE,M,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Ln,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=IO(e.projection),n.materialize().reflow()):s=r===Ln||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=XV(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function XV(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function dE(e){M.call(this,null,e)}dE.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"]}]};G(dE,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 hE(e){M.call(this,null,e)}hE.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"}]};G(hE,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=KV(IO(e.projection),e.field||Li("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function KV(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 gE(e){M.call(this,[],e),this.generator=WH()}gE.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}]};G(gE,M,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)be(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(p3(n[0],r)):t.add.push(Oe(r)),n[0]=r,t}});function pE(e){M.call(this,null,e)}pE.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"}]};G(pE,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||Ln,o=QV(e.opacity,e),s=JV(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Xs(n.map(l=>Xs(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ye({},l,u);i||(f.$max=Xs(c.values||[])),l[a]=ZV(c,f,s.dep?s:wn(s(f)),o.dep?o:wn(o(f)))}),t.reflow(!0).modifies(a)}});function JV(e,t){let n;return be(e)?(n=i=>$h(e(i,t)),n.dep=WO(e)):n=wn($h(e||"#888")),n}function QV(e,t){let n;return be(e)?(n=i=>e(i,t),n.dep=WO(e)):e?n=wn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function WO(e){if(!be(e))return!1;const t=yr(xn(e));return t.$x||t.$y||t.$value||t.$max}function ZV(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]:zs,d=Vo(u-s,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-s,l-a),p=g.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);p[y+0]=v.r,p[y+1]=v.g,p[y+2]=v.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function GO(e){M.call(this,null,e),this.modified(!0)}G(GO,M,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=tY(e.type),mb.forEach(i=>{e[i]!=null&&c$(n,i,e[i])})):mb.forEach(i=>{e.modified(i)&&c$(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&eY(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function eY(e,t){const n=nY(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function tY(e){const t=oE((e||"mercator").toLowerCase());return t||L("Unrecognized projection type: "+e),t()}function c$(e,t,n){be(e[t])&&e[t](n)}function nY(e){return e=oe(e),e.length===1?e[0]:{type:lE,features:e.reduce((t,n)=>t.concat(iY(n)),[])}}function iY(e){return e.type===lE?e.features:oe(e).filter(t=>t!=null).map(t=>t.type===yb?t:{type:yb,geometry:t})}const rY=Object.freeze(Object.defineProperty({__proto__:null,contour:uE,geojson:cE,geopath:fE,geopoint:dE,geoshape:hE,graticule:gE,heatmap:pE,isocontour:sE,kde2d:aE,projection:GO},Symbol.toStringTag,{value:"Module"}));function oY(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 sY(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return HO(this.cover(t,n),t,n,e)}function HO(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,g,p,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((p=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|p]))return r[y]=s,e;if(h=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===h&&n===g)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),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function aY(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)HO(this,s[n],a[n],e[n]);return this}function uY(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 lY(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function cY(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 pn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function fY(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,g,p;for(h&&d.push(new pn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(s=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new pn(h[3],m,y,u,l),new pn(h[2],s,y,m,l),new pn(h[1],m,a,u,y),new pn(h[0],s,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}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 w=Math.sqrt(n=v);r=e-w,o=t-w,c=e+w,f=t+w,i=h.data}}return i}function dY(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,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(s+u)/2))?s=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))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 hY(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function gY(){return this._root}function pY(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function mY(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new pn(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 pn(r,l,c,a,u)),(r=i[2])&&t.push(new pn(r,o,c,l,u)),(r=i[1])&&t.push(new pn(r,l,s,a,c)),(r=i[0])&&t.push(new pn(r,o,s,l,c))}return this}function yY(e){var t=[],n=[],i;for(this._root&&t.push(new pn(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 pn(o,s,a,c,f)),(o=r[1])&&t.push(new pn(o,c,a,u,f)),(o=r[2])&&t.push(new pn(o,s,f,c,l)),(o=r[3])&&t.push(new pn(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 bY(e){return e[0]}function xY(e){return arguments.length?(this._x=e,this):this._x}function vY(e){return e[1]}function EY(e){return arguments.length?(this._y=e,this):this._y}function mE(e,t,n){var i=new yE(t??bY,n??vY,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function yE(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 f$(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var $n=mE.prototype=yE.prototype;$n.copy=function(){var e=new yE(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=f$(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]=f$(i));return e};$n.add=sY;$n.addAll=aY;$n.cover=uY;$n.data=lY;$n.extent=cY;$n.find=fY;$n.remove=dY;$n.removeAll=hY;$n.root=gY;$n.size=pY;$n.visit=mY;$n.visitAfter=yY;$n.x=xY;$n.y=EY;function yn(e){return function(){return e}}function jo(e){return(e()-.5)*1e-6}function wY(e){return e.x+e.vx}function AY(e){return e.y+e.vy}function SY(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=yn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<o;++y)for(f=mE(t,wY,AY).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(x,v,w,A,E){var S=x.data,C=x.r,_=p+C;if(S){if(S.index>d.index){var F=h-S.x-S.vx,O=g-S.y-S.vy,T=F*F+O*O;T<_*_&&(F===0&&(F=jo(i),T+=F*F),O===0&&(O=jo(i),T+=O*O),T=(_-(T=Math.sqrt(T)))/T*r,d.vx+=(F*=T)*(_=(C*=C)/(m+C)),d.vy+=(O*=T)*_,S.vx-=F*(_=1-_),S.vy-=O*_)}return}return v>h+_||A<h-_||w>g+_||E<g-_}}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:yn(+l),u(),s):e},s}function CY(e){return e.index}function d$(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function $Y(e){var t=CY,n=f,i,r=yn(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,w,A,E,S,C,_;x<b;++x)v=e[x],w=v.source,A=v.target,E=A.x+A.vx-w.x-w.vx||jo(l),S=A.y+A.vy-w.y-w.vy||jo(l),C=Math.sqrt(E*E+S*S),C=(C-o[x])/C*m*i[x],E*=C,S*=C,A.vx-=E*(_=u[x]),A.vy-=S*_,w.vx+=E*(_=1-_),w.vy+=S*_}function h(){if(s){var m,y=s.length,b=e.length,x=new Map(s.map((w,A)=>[t(w,A,s),w])),v;for(m=0,a=new Array(y);m<b;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=d$(x,v.source)),typeof v.target!="object"&&(v.target=d$(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),g(),o=new Array(b),p()}}function g(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){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:yn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:yn(+m),p(),d):r},d}function _Y(e,t,n){var i=new a9,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?u9():+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 FY=1664525,kY=1013904223,h$=4294967296;function DY(){let e=1;return()=>(e=(FY*e+kY)%h$)/h$}function TY(e){return e.x}function MY(e){return e.y}var OY=10,RY=Math.PI*(3-Math.sqrt(5));function NY(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=l9(f),l=c9("tick","end"),c=DY();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var x=0;x<p;++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 p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=OY*Math.sqrt(.5+p),x=p*RY;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(s=1-p,t):1-s},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,x=e.length,v,w,A,E,S;for(y==null?y=1/0:y*=y,b=0;b<x;++b)E=e[b],v=p-E.x,w=m-E.y,A=v*v+w*w,A<y&&(S=E,y=A);return S},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function LY(){var e,t,n,i,r=yn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=mE(e,TY,MY).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(o=new Array(g),h=0;h<g;++h)p=e[h],o[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,x,v;if(h.length){for(b=x=v=0;v<4;++v)(p=h[v])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,x+=m*p.y);h.x=b/y,h.y=x/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=o[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,x=m-g,v=y*y+b*b;if(x*x/u<v)return v<a&&(y===0&&(y=jo(n),v+=y*y),b===0&&(b=jo(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=jo(n),v+=y*y),b===0&&(b=jo(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,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:yn(+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 PY(e){var t=yn(.1),n,i,r;typeof e!="function"&&(e=yn(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:yn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:yn(+a),s(),o):e},o}function IY(e){var t=yn(.1),n,i,r;typeof e!="function"&&(e=yn(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:yn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:yn(+a),s(),o):e},o}const g$={center:oY,collide:SY,nbody:LY,link:$Y,x:PY,y:IY},pc="forces",bb=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],zY=["static","iterations"],VO=["x","y","vx","vy"];function bE(e){M.call(this,null,e)}bE.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:VO}]};G(bE,M,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(bb),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&YO(n,e,0,t)):(this.value=n=UY(t.source,e),n.on("tick",BY(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(zY)||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!==pc||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(VO)}});function BY(e,t){return()=>e.touch(t).run()}function UY(e,t){const n=NY(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),YO(n,t,!0).on("end",()=>o=!0)}function YO(e,t,n,i){var r=oe(t.forces),o,s,a,u;for(o=0,s=bb.length;o<s;++o)a=bb[o],a!==pc&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=pc+o,a=n||t.modified(pc,o)?qY(r[o]):i&&jY(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(pc+o,null);return e.numForces=r.length,e}function jY(e,t){var n,i;for(n in e)if(be(i=e[n])&&t.modified(xn(i)))return 1;return 0}function qY(e){var t,n;le(g$,e.force)||L("Unrecognized force: "+e.force),t=g$[e.force]();for(n in e)be(t[n])&&WY(t[n],e[n],e);return t}function WY(e,t,n){e(be(t)?i=>t(i,n):t)}const GY=Object.freeze(Object.defineProperty({__proto__:null,force:bE},Symbol.toStringTag,{value:"Module"}));function HY(e,t){return e.parent===t.parent?1:2}function VY(e){return e.reduce(YY,0)/e.length}function YY(e,t){return e+t.x}function XY(e){return 1+e.reduce(KY,0)}function KY(e,t){return Math.max(e,t.y)}function JY(e){for(var t;t=e.children;)e=t[0];return e}function QY(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ZY(){var e=HY,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=VY(h),d.y=XY(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=JY(o),l=QY(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 eX(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 tX(){return this.eachAfter(eX)}function nX(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function iX(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 rX(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 oX(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function sX(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 aX(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function uX(e){for(var t=this,n=lX(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 lX(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 cX(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function fX(){return Array.from(this)}function dX(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function hX(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*gX(){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 xE(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=yX)):t===void 0&&(t=mX);for(var n=new Uu(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 Uu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(XO)}function pX(){return xE(this).eachBefore(bX)}function mX(e){return e.children}function yX(e){return Array.isArray(e)?e[1]:null}function bX(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function XO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Uu(e){this.data=e,this.depth=this.height=0,this.parent=null}Uu.prototype=xE.prototype={constructor:Uu,count:tX,each:nX,eachAfter:rX,eachBefore:iX,find:oX,sum:sX,sort:aX,path:uX,ancestors:cX,descendants:fX,leaves:dX,links:hX,copy:pX,[Symbol.iterator]:gX};function dh(e){return e==null?null:KO(e)}function KO(e){if(typeof e!="function")throw new Error;return e}function Ws(){return 0}function su(e){return function(){return e}}const xX=1664525,vX=1013904223,p$=4294967296;function EX(){let e=1;return()=>(e=(xX*e+vX)%p$)/p$}function wX(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function AX(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 SX(e,t){for(var n=0,i=(e=AX(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&JO(s,o)?++n:(s=$X(r=CX(r,o)),n=0);return s}function CX(e,t){var n,i;if(Km(t,e))return[t];for(n=0;n<e.length;++n)if(Td(t,e[n])&&Km(mc(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(Td(mc(e[n],e[i]),t)&&Td(mc(e[n],t),e[i])&&Td(mc(e[i],t),e[n])&&Km(QO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Td(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 JO(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 Km(e,t){for(var n=0;n<t.length;++n)if(!JO(e,t[n]))return!1;return!0}function $X(e){switch(e.length){case 1:return _X(e[0]);case 2:return mc(e[0],e[1]);case 3:return QO(e[0],e[1],e[2])}}function _X(e){return{x:e.x,y:e.y,r:e.r}}function mc(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 QO(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,g=r-a,p=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,w=h*g-d*p,A=(g*v-p*x)/(w*2)-i,E=(p*m-g*y)/w,S=(h*x-d*v)/(w*2)-r,C=(d*y-h*m)/w,_=E*E+C*C-1,F=2*(o+A*E+S*C),O=A*A+S*S-o*o,T=-(Math.abs(_)>1e-6?(F+Math.sqrt(F*F-4*_*O))/(2*_):O/F);return{x:i+A+E*T,y:r+S+C*T,r:T}}function m$(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 y$(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 b$(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 Md(e){this._=e,this.next=null,this.previous=null}function FX(e,t){if(!(o=(e=wX(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;m$(i,n,r=e[2]),n=new Md(n),i=new Md(i),r=new Md(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){m$(n._,i._,r=e[u]),r=new Md(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(y$(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(y$(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=b$(n);(r=r.next)!==i;)(a=b$(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=SX(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function kX(e){return Math.sqrt(e.value)}function DX(){var e=null,t=1,n=1,i=Ws;function r(o){const s=EX();return o.x=t/2,o.y=n/2,e?o.eachBefore(x$(e)).eachAfter(Jm(i,.5,s)).eachBefore(v$(1)):o.eachBefore(x$(kX)).eachAfter(Jm(Ws,1,s)).eachAfter(Jm(i,o.r/Math.min(t,n),s)).eachBefore(v$(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=dh(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:su(+o),r):i},r}function x$(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jm(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=FX(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function v$(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 ZO(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 If(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 TX(){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(ZO),s}function o(s,a){return function(u){u.children&&If(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 MX={depth:-1},E$={},Qm={};function OX(e){return e.id}function RX(e){return e.parentId}function w$(){var e=OX,t=RX,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=o.map((v,w)=>NX(n(v,w,r))),b=y.map(A$),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(A$(v)),o.push(Qm));s=(v,w)=>y[w],a=(v,w)=>b[w]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new Uu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?E$:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=o[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===E$)throw new Error("ambiguous: "+g);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===Qm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Qm);--y)h.data=null}if(f.parent=MX,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(XO),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=dh(r),i):e},i.parentId=function(r){return arguments.length?(t=dh(r),i):t},i.path=function(r){return arguments.length?(n=dh(r),i):n},i}function NX(e){e=`${e}`;let t=e.length;return xb(e,t-1)&&!xb(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function A$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!xb(e,t););return e.slice(0,t)}function xb(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function LX(e,t){return e.parent===t.parent?1:2}function Zm(e){var t=e.children;return t?t[0]:e.t}function e1(e){var t=e.children;return t?t[t.length-1]:e.t}function PX(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 IX(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 zX(e,t,n){return e.a.parent===t.parent?e.a:n}function hh(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}hh.prototype=Object.create(Uu.prototype);function BX(e){for(var t=new hh(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 hh(o[s],s)),r.parent=n;return(t.parent=new hh(null,0)).children=[t],t}function UX(){var e=LX,t=1,n=1,i=null;function r(l){var c=BX(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 g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*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){IX(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,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,x=p.m,v;g=e1(g),d=Zm(d),g&&d;)p=Zm(p),h=e1(h),h.a=l,v=g.z+b-d.z-m+e(g._,d._),v>0&&(PX(zX(g,l,f),l,v),m+=v,y+=v),b+=g.m,m+=d.m,x+=p.m,y+=h.m;g&&!e1(h)&&(h.t=g,h.m+=b-y),d&&!Zm(p)&&(p.t=d,p.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 i0(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 eR=(1+Math.sqrt(5))/2;function tR(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,x,v,w,A;c<d;){h=r-n,g=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,w=Math.max(g/h,h/g)/(p*e),A=m*m*w,v=Math.max(b/A,A/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),A=m*m*w,x=Math.max(b/A,A/y),x>v){m-=l;break}v=x}s.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?If(u,n,i,r,p?i+=g*m/p:o):i0(u,n,i,p?n+=h*m/p:r,o),p-=m,c=f}return s}const nR=function e(t){function n(i,r,o,s,a){tR(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(eR);function jX(){var e=nR,t=!1,n=1,i=1,r=[0],o=Ws,s=Ws,a=Ws,u=Ws,l=Ws;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(ZO),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,g+=l(d)-h,p+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,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=KO(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:su(+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:su(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:su(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:su(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:su(+d),c):l},c}function qX(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,g,p,m,y){if(f>=d-1){var b=o[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var x=l[f],v=h/2+x,w=f+1,A=d-1;w<A;){var E=w+A>>>1;l[E]<v?w=E+1:A=E}v-l[w-1]<l[w]-v&&f+1<w&&--w;var S=l[w]-x,C=h-S;if(m-g>y-p){var _=h?(g*C+m*S)/h:m;c(f,w,S,g,p,_,y),c(w,d,C,_,p,m,y)}else{var F=h?(p*C+y*S)/h:y;c(f,w,S,g,p,m,F),c(w,d,C,g,F,m,y)}}}function WX(e,t,n,i,r){(e.depth&1?i0:If)(e,t,n,i,r)}const GX=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,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?If(l,r,o,s,p?o+=(a-o)*l.value/p:a):i0(l,r,o,p?r+=(s-r)*l.value/p:s,a),p-=l.value}else i._squarify=u=tR(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(eR);function vb(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function vE(e){M.call(this,null,e)}vE.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const HX=e=>e.values;G(vE,M,{transform(e,t){t.source||L("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&&wp(s.data)&&r.rem.push(s.data)}),this.value=o=xE({values:oe(e.keys).reduce((s,a)=>(s.key(a),s),VX()).entries(r.source)},HX),n&&o.each(s=>{s.children&&(s=Oe(s.data),r.add.push(s),r.source.push(s))}),vb(o,te,te)),r.source.root=o,r}});function VX(){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 xo(e){M.call(this,null,e)}const YX=(e,t)=>e.parent===t.parent?1:2;G(xo,M,{transform(e,t){(!t.source||!t.source.root)&&L(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(Da(e.sort,s=>s.data)),XX(n,this.params,e),n.separation&&n.separation(e.separation!==!1?YX:bf);try{this.value=n(r)}catch(s){L(s)}return r.each(s=>KX(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function XX(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 KX(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 Eb=["x","y","r","depth","children"];function EE(e){xo.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:Eb.length,default:Eb}]};G(EE,xo,{layout:DX,params:["radius","size","padding"],fields:Eb});const wb=["x0","y0","x1","y1","depth","children"];function wE(e){xo.call(this,e)}wE.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:wb.length,default:wb}]};G(wE,xo,{layout:TX,params:["size","round","padding"],fields:wb});function AE(e){M.call(this,null,e)}AE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(AE,M,{transform(e,t){t.source||L("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?vb(w$().id(e.key).parentId(e.parentKey)(r.source),e.key,Pi):vb(w$()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const S$={tidy:UX,cluster:ZY},Ab=["x","y","depth","children"];function SE(e){xo.call(this,e)}SE.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:Ab.length,default:Ab}]};G(SE,xo,{layout(e){const t=e||"tidy";if(le(S$,t))return S$[t]();L("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Ab});function CE(e){M.call(this,[],e)}CE.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(CE,M,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||L("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[te(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[te(a)]&&o[te(u)]&&r.add.push(Oe({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[te(s)]=1),n.forEach(s=>{(o[te(s.source)]||o[te(s.target)])&&r.mod.push(s)})),r}});const C$={binary:qX,dice:If,slice:i0,slicedice:WX,squarify:nR,resquarify:GX},Sb=["x0","y0","x1","y1","depth","children"];function $E(e){xo.call(this,e)}$E.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:Sb.length,default:Sb}]};G($E,xo,{layout(){const e=jX();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{le(C$,t)?e.tile(C$[t]):L("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Sb});const JX=Object.freeze(Object.defineProperty({__proto__:null,nest:vE,pack:EE,partition:wE,stratify:AE,tree:SE,treelinks:CE,treemap:$E},Symbol.toStringTag,{value:"Module"})),t1=4278190080;function QX(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function ZX(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=Vo(o,s).getContext("2d"),l=Vo(o,s).getContext("2d"),c=a&&Vo(o,s).getContext("2d");n.forEach(S=>gh(u,S,!1)),gh(l,t,!1),a&&gh(c,t,!0);const f=n1(u,o,s),d=n1(l,o,s),h=a&&n1(c,o,s),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,x,v,w,A,E;for(y=0;y<s;++y)for(m=0;m<o;++m)v=y*o+m,w=f[v]&t1,E=d[v]&t1,A=a&&h[v]&t1,(w||A||E)&&(b=e(m),x=e(y),!r&&(w||E)&&g.set(b,x),a&&(w||A)&&p.set(b,x));return[g,p]}function n1(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function gh(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>gh(e,o.items,n))}):ni[i].draw(e,{items:n?t.map(eK):t})}function eK(e){const t=Ap(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Br=5,un=31,Qc=32,Oo=new Uint32Array(Qc+1),Fi=new Uint32Array(Qc+1);Fi[0]=0;Oo[0]=~Fi[0];for(let e=1;e<=Qc;++e)Fi[e]=Fi[e-1]<<1|1,Oo[e]=~Fi[e];function tK(e,t){const n=new Uint32Array(~~((e*t+Qc)/Qc));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>>>Br]&1<<(a&un)},set:(o,s)=>{const a=s*e+o;i(a>>>Br,1<<(a&un))},clear:(o,s)=>{const a=s*e+o;r(a>>>Br,~(1<<(a&un)))},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>>>Br,h=f>>>Br,d===h){if(n[d]&Oo[c&un]&Fi[(f&un)+1])return!0}else{if(n[d]&Oo[c&un]||n[h]&Fi[(f&un)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])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>>>Br,d=c>>>Br,f===d)i(f,Oo[l&un]&Fi[(c&un)+1]);else for(i(f,Oo[l&un]),i(d,Fi[(c&un)+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>>>Br,d=c>>>Br,f===d)r(f,Fi[l&un]|Oo[(c&un)+1]);else for(r(f,Fi[l&un]),r(d,Oo[(c&un)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function nK(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=()=>tK(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function iK(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=Jn.width(s.datum,s.datum.text);let f=0,d,h,g,p,m,y,b;for(let x=0;x<u;++x)d=a[x].x,g=a[x].y,h=a[x].x2===void 0?d:a[x].x2,p=a[x].y2===void 0?g:a[x].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),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,g=s.y-y,p=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",g<0&&p<=o?s.baseline="top":0<=g&&o<p&&(s.baseline="bottom"),!0}}function $g(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 qo(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 rK(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 g=e.invert(l),p=e.invert(c);let m=f,y=o,b;if(!$g(g,p,d,h,r,o)&&!qo(e,g,p,h,d,m,s,a)&&!qo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,qo(e,g,p,h,d,b,s,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Jn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,x,v,w,A,E,S,C,_,F,O,T,k,$,D,P,z;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,w=c[I].y2===void 0?v:c[I].y2,b>x&&(z=b,b=x,x=z),v>w&&(z=v,v=w,w=z),_=e(b),O=e(x),F=~~((_+O)/2),T=e(v),$=e(w),k=~~((T+$)/2),S=F;S>=_;--S)for(C=k;C>=T;--C)P=u(S,C,g,h,d),P&&([l.x,l.y,g,p]=P);for(S=F;S<=O;++S)for(C=k;C<=$;++C)P=u(S,C,g,h,d),P&&([l.x,l.y,g,p]=P);!p&&!n&&(D=Math.abs(x-b+w-v),A=(b+x)/2,E=(v+w)/2,D>=y&&!$g(A,E,h,d,r,o)&&!qo(e,A,E,d,h,d,s,null)&&(y=D,l.x=A,l.y=E,m=!0))}return p||m?(A=h/2,E=d/2,s.setRange(e(l.x-A),e(l.y-E),e(l.x+A),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const oK=[-1,-1,1,1],sK=[-1,1,-1,1];function aK(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=Jn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,x,v,w,A,E,S,C,_,F,O,T,k;for(let $=0;$<f;++$){for(x=c[$].x,w=c[$].y,v=c[$].x2===void 0?x:c[$].x2,A=c[$].y2===void 0?w:c[$].y2,g.push([e((x+v)/2),e((w+A)/2)]);g.length;)if([C,_]=g.pop(),!(s.get(C,_)||a.get(C,_)||u.get(C,_))){u.set(C,_);for(let D=0;D<4;++D)E=C+oK[D],S=_+sK[D],u.outOfBounds(E,S,E,S)||g.push([E,S]);if(E=e.invert(C),S=e.invert(_),F=p,O=o,!$g(E,S,h,d,r,o)&&!qo(e,E,S,d,h,F,s,a)&&!qo(e,E,S,d,h,d,s,null)){for(;O-F>=1;)T=(F+O)/2,qo(e,E,S,d,h,T,s,a)?O=T:F=T;F>p&&(l.x=E,l.y=S,p=F,m=!0)}}!m&&!n&&(k=Math.abs(v-x+A-w),E=(x+v)/2,S=(w+A)/2,k>=b&&!$g(E,S,h,d,r,o)&&!qo(e,E,S,d,h,d,s,null)&&(b=k,l.x=E,l.y=S,y=!0))}return m||y?(E=h/2,S=d/2,s.setRange(e(l.x-E),e(l.y-S),e(l.x+E),e(l.y+S)),l.align="center",l.baseline="middle",!0):!1}}const uK=["right","center","left"],lK=["bottom","middle","top"];function cK(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,g,p,m,y,b,x,v,w,A,E,S,C,_,F;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,g=(n[O]>>>2&3)-1,p=h===0&&g===0||i[O]<0,m=h&&g?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,E=c[4+g]+y*f*g/2+i[O]*g*m,v=E-f/2,w=E+f/2,S=e(b),_=e(v),F=e(w),!d)if($$(S,S,_,F,s,a,b,b,v,w,c,p))d=Jn.width(l.datum,l.datum.text);else continue;if(A=b+y*d*h/2,b=A-d/2,x=A+d/2,S=e(b),C=e(x),$$(S,C,_,F,s,a,b,x,v,w,c,p))return l.x=h?h*y<0?x:b:A,l.y=g?g*y<0?w:v:E,l.align=uK[h*y+1],l.baseline=lK[g*y+1],s.setRange(S,_,C,F),!0}return!1}}function $$(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 i1=0,r1=4,o1=8,s1=0,a1=1,u1=2,fK={"top-left":i1+s1,top:i1+a1,"top-right":i1+u1,left:r1+s1,middle:r1+a1,right:r1+u1,"bottom-left":o1+s1,bottom:o1+a1,"bottom-right":o1+u1},dK={naive:iK,"reduced-search":rK,floodfill:aK};function hK(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=gK(i,f),h=pK(r,f),g=mK(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=yK(g,p,a,u),b=l===null||l===1/0,x=m&&c==="naive";let v=-1,w=-1;const A=e.map(_=>{const F=b?Jn.width(_,_.text):void 0;return v=Math.max(v,F),w=Math.max(w,_.fontSize),{datum:_,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(_),textWidth:F}});l=l===null||l===1/0?Math.max(v,w)+Math.max(...i):l;const E=nK(t[0],t[1],l);let S;if(!x){n&&A.sort((O,T)=>n(O.datum,T.datum));let _=!1;for(let O=0;O<h.length&&!_;++O)_=h[O]===5||d[O]<0;const F=(g&&s||m)&&e.map(O=>O.datum);S=o.length||F?ZX(E,F||[],o,_,m):QX(E,s&&A)}const C=m?dK[c](E,S,s,u):cK(E,S,h,d);return A.forEach(_=>_.opacity=+C(_)),A}function gK(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 pK(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=fK[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function mK(e){return e&&e.mark&&e.mark.marktype}function yK(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 Cb=["x","y","opacity","align","baseline"],iR=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function _E(e){M.call(this,null,e)}_E.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:iR},{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:Cb.length,default:Cb}]};G(_E,M,{transform(e,t){function n(o){const s=e[o];return be(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)&&L("Size parameter should be specified as a [width, height] array.");const r=e.as||Cb;return hK(t.materialize(t.SOURCE).source||[],e.size,e.sort,oe(e.offset==null?1:e.offset),oe(e.anchor||iR),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 bK=Object.freeze(Object.defineProperty({__proto__:null,label:_E},Symbol.toStringTag,{value:"Module"}));function rR(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 FE(e){M.call(this,null,e)}FE.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}]};G(FE,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=rR(i,e.groupby),o=(e.groupby||[]).map(lt),s=o.length,a=e.as||[lt(e.x),lt(e.y)],u=[];r.forEach(l=>{O3(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(Oe(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const $b={constant:hv,linear:gv,log:k3,exp:D3,pow:T3,quad:pv,poly:M3},xK=(e,t)=>e==="poly"?t:e==="quad"?2:1;function kE(e){M.call(this,null,e)}kE.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($b)},{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}]};G(kE,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=rR(i,e.groupby),o=(e.groupby||[]).map(lt),s=e.method||"linear",a=e.order==null?3:e.order,u=xK(s,a),l=e.as||[lt(e.x),lt(e.y)],c=$b[s],f=[];let d=e.extent;le($b,s)||L("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 p=c(h,e.x,e.y,a);if(e.params){f.push(Oe({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||lo(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(Oe(x))};s==="linear"||s==="constant"?m.forEach(b=>y([b,p.predict(b)])):Dp(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const vK=Object.freeze(Object.defineProperty({__proto__:null,loess:FE,regression:kE},Symbol.toStringTag,{value:"Module"})),io=11102230246251565e-32,Xt=134217729,EK=(3+8*io)*io;function l1(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 wK(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function zf(e){return new Float64Array(e)}const AK=(3+16*io)*io,SK=(2+12*io)*io,CK=(9+64*io)*io*io,eu=zf(4),_$=zf(8),F$=zf(12),k$=zf(16),ln=zf(4);function $K(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,g,p,m,y,b,x,v,w,A,E,S;const C=e-r,_=n-r,F=t-o,O=i-o;v=C*O,d=Xt*C,h=d-(d-C),g=C-h,d=Xt*O,p=d-(d-O),m=O-p,w=g*m-(v-h*p-g*p-h*m),A=F*_,d=Xt*F,h=d-(d-F),g=F-h,d=Xt*_,p=d-(d-_),m=_-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,eu[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,eu[1]=x-(y+f)+(f-A),S=b+y,f=S-b,eu[2]=b-(S-f)+(y-f),eu[3]=S;let T=wK(4,eu),k=SK*s;if(T>=k||-T>=k||(f=e-C,a=e-(C+f)+(f-r),f=n-_,l=n-(_+f)+(f-r),f=t-F,u=t-(F+f)+(f-o),f=i-O,c=i-(O+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(k=CK*s+EK*Math.abs(T),T+=C*c+O*a-(F*l+_*u),T>=k||-T>=k))return T;v=a*O,d=Xt*a,h=d-(d-a),g=a-h,d=Xt*O,p=d-(d-O),m=O-p,w=g*m-(v-h*p-g*p-h*m),A=u*_,d=Xt*u,h=d-(d-u),g=u-h,d=Xt*_,p=d-(d-_),m=_-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const $=l1(4,eu,4,ln,_$);v=C*c,d=Xt*C,h=d-(d-C),g=C-h,d=Xt*c,p=d-(d-c),m=c-p,w=g*m-(v-h*p-g*p-h*m),A=F*l,d=Xt*F,h=d-(d-F),g=F-h,d=Xt*l,p=d-(d-l),m=l-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const D=l1($,_$,4,ln,F$);v=a*c,d=Xt*a,h=d-(d-a),g=a-h,d=Xt*c,p=d-(d-c),m=c-p,w=g*m-(v-h*p-g*p-h*m),A=u*l,d=Xt*u,h=d-(d-u),g=u-h,d=Xt*l,p=d-(d-l),m=l-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const P=l1(D,F$,4,ln,k$);return k$[P-1]}function Od(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)>=AK*l?u:-$K(e,t,n,i,r,o,l)}const D$=Math.pow(2,-52),Rd=new Uint32Array(512);class _g{static from(t,n=TK,i=MK){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 _g(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 C=0;C<s;C++){const _=t[2*C],F=t[2*C+1];_<a&&(a=_),F<u&&(u=F),_>l&&(l=_),F>c&&(c=F),this._ids[C]=C}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let C=0,_=1/0;C<s;C++){const F=c1(f,d,t[2*C],t[2*C+1]);F<_&&(h=C,_=F)}const m=t[2*h],y=t[2*h+1];for(let C=0,_=1/0;C<s;C++){if(C===h)continue;const F=c1(m,y,t[2*C],t[2*C+1]);F<_&&F>0&&(g=C,_=F)}let b=t[2*g],x=t[2*g+1],v=1/0;for(let C=0;C<s;C++){if(C===h||C===g)continue;const _=kK(m,y,b,x,t[2*C],t[2*C+1]);_<v&&(p=C,v=_)}let w=t[2*p],A=t[2*p+1];if(v===1/0){for(let F=0;F<s;F++)this._dists[F]=t[2*F]-t[0]||t[2*F+1]-t[1];du(this._ids,this._dists,0,s-1);const C=new Uint32Array(s);let _=0;for(let F=0,O=-1/0;F<s;F++){const T=this._ids[F],k=this._dists[T];k>O&&(C[_++]=T,O=k)}this.hull=C.subarray(0,_),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Od(m,y,b,x,w,A)<0){const C=g,_=b,F=x;g=p,b=w,x=A,p=C,w=_,A=F}const E=DK(m,y,b,x,w,A);this._cx=E.x,this._cy=E.y;for(let C=0;C<s;C++)this._dists[C]=c1(t[2*C],t[2*C+1],E.x,E.y);du(this._ids,this._dists,0,s-1),this._hullStart=h;let S=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,x)]=g,o[this._hashKey(w,A)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let C=0,_,F;C<this._ids.length;C++){const O=this._ids[C],T=t[2*O],k=t[2*O+1];if(C>0&&Math.abs(T-_)<=D$&&Math.abs(k-F)<=D$||(_=T,F=k,O===h||O===g||O===p))continue;let $=0;for(let V=0,ue=this._hashKey(T,k);V<this._hashSize&&($=o[(ue+V)%this._hashSize],!($!==-1&&$!==i[$]));V++);$=n[$];let D=$,P;for(;P=i[D],Od(T,k,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 z=this._addTriangle(D,O,i[D],-1,-1,r[D]);r[O]=this._legalize(z+2),r[D]=z,S++;let I=i[D];for(;P=i[I],Od(T,k,t[2*I],t[2*I+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(I,O,P,r[O],-1,r[I]),r[O]=this._legalize(z+2),i[I]=I,S--,I=P;if(D===$)for(;P=n[D],Od(T,k,t[2*P],t[2*P+1],t[2*D],t[2*D+1])<0;)z=this._addTriangle(P,O,D,-1,r[D],r[P]),this._legalize(z+2),r[P]=z,i[D]=D,S--,D=P;this._hullStart=n[O]=D,i[D]=n[I]=O,i[O]=I,o[this._hashKey(T,k)]=O,o[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(S);for(let C=0,_=this._hullStart;C<S;C++)this.hull[C]=_,_=i[_];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(_K(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=Rd[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],g=n[c],p=n[f];if(FK(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,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<Rd.length&&(Rd[o++]=b)}else{if(o===0)break;t=Rd[--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 _K(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function c1(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function FK(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,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function kK(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,g=(s*f-u*c)*d;return h*h+g*g}function DK(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,g=t+(s*f-u*c)*d;return{x:h,y:g}}function du(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;Ul(e,r,o),t[e[n]]>t[e[i]]&&Ul(e,n,i),t[e[o]]>t[e[i]]&&Ul(e,o,i),t[e[n]]>t[e[o]]&&Ul(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;Ul(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(du(e,t,o,i),du(e,t,n,s-1)):(du(e,t,n,s-1),du(e,t,o,i))}}function Ul(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function TK(e){return e[0]}function MK(e){return e[1]}const T$=1e-6;class Vs{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)>T$||Math.abs(this._y1-o)>T$)&&(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 _b{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 OK=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 p=0,m=0,y=i.length,b,x;p<y;p+=3,m+=2){const v=i[p]*2,w=i[p+1]*2,A=i[p+2]*2,E=t[v],S=t[v+1],C=t[w],_=t[w+1],F=t[A],O=t[A+1],T=C-E,k=_-S,$=F-E,D=O-S,P=(T*D-k*$)*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 z=1e9*Math.sign((o-E)*D-(s-S)*$);b=(E+F)/2-z*D,x=(S+O)/2+z*$}else{const z=1/P,I=T*T+k*k,V=$*$+D*D;b=E+(D*I-k*V)*z,x=S+(T*V-$*I)*z}a[m]=b,a[m+1]=x}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Vs: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,g=Math.floor(d/3)*2,p=s[h],m=s[h+1],y=s[g],b=s[g+1];this._renderSegment(p,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],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Vs: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 Vs: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 _b;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 g,p,m,y,b;if(l===0){if((g=this._clipSegment(o,s,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,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 RK=2*Math.PI,tu=Math.pow;function NK(e){return e[0]}function LK(e){return e[1]}function PK(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 IK(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class DE{static from(t,n=NK,i=LK,r){return new DE("length"in t?zK(t,n,i,r):Float64Array.from(BK(t,n,i,r)))}constructor(t){this._delaunator=new _g(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&&PK(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 g=IK(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new _g(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 OK(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=tu(n-l[t*2],2)+tu(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=tu(n-l[g*2],2)+tu(i-l[g*2+1],2);if(p<f&&(f=p,c=g),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!==g&&tu(n-l[h*2],2)+tu(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Vs: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 Vs: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,RK)}return i&&i.value()}renderHull(t){const n=t==null?t=new Vs: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 _b;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Vs: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 _b;return this.renderTriangle(t,n),n.value()}}function zK(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*BK(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 TE(e){M.call(this,null,e)}TE.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 UK=[-1e5,-1e5,1e5,1e5];G(TE,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]]:UK;const o=this.value=DE.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&&!qK(u)?jK(u):null}return t.reflow(e.modified()).modifies(n)}});function jK(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 qK(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const WK=Object.freeze(Object.defineProperty({__proto__:null,voronoi:TE},Symbol.toStringTag,{value:"Module"}));var f1=Math.PI/180,yc=64,ph=2048;function GK(){var e=[256,256],t,n,i,r,o,s,a,u=oR,l=[],c=Math.random,f={};f.layout=function(){for(var g=d(Vo()),p=JK((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,x=[],v=l.map(A=>({text:t(A),font:n(A),style:r(A),weight:o(A),rotate:s(A),size:~~(i(A)+1e-14),padding:a(A),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:A})).sort((A,E)=>E.size-A.size);++b<y;){var w=v[b];w.x=e[0]*(c()+.5)>>1,w.y=e[1]*(c()+.5)>>1,HK(g,w,v,b),w.hasText&&h(p,w,m)&&(x.push(w),m?YK(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}return x};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(yc<<5)/p,g.height=ph/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,x=Math.hypot(e[0],e[1]),v=u(e),w=c()<.5?1:-1,A=-w,E,S,C;(E=v(A+=w))&&(S=~~E[0],C=~~E[1],!(Math.min(Math.abs(S),Math.abs(C))>=x));)if(p.x=y+S,p.y=b+C,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!VK(p,g,e[0]))&&(!m||XK(p,m))){for(var _=p.sprite,F=p.width>>5,O=e[0]>>5,T=p.x-(F<<4),k=T&127,$=32-k,D=p.y1-p.y0,P=(p.y+p.y0)*O+(T>>5),z,I=0;I<D;I++){z=0;for(var V=0;V<=F;V++)g[P+V]|=z<<$|(V<F?(z=_[I*F+V])>>>k:0);P+=O}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=Cs(g),f):n},f.fontStyle=function(g){return arguments.length?(r=Cs(g),f):r},f.fontWeight=function(g){return arguments.length?(o=Cs(g),f):o},f.rotate=function(g){return arguments.length?(s=Cs(g),f):s},f.text=function(g){return arguments.length?(t=Cs(g),f):t},f.spiral=function(g){return arguments.length?(u=QK[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=Cs(g),f):i},f.padding=function(g){return arguments.length?(a=Cs(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function HK(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(yc<<5)/o,ph/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,g;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 p=Math.sin(t.rotate*f1),m=Math.cos(t.rotate*f1),y=c*m,b=c*p,x=d*m,v=d*p;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>=yc<<5&&(s=0,a+=u,u=0),a+d>=ph)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*f1),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 w=r.getImageData(0,0,(yc<<5)/o,ph/o).data,A=[];--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++)A[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var E=0,S=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var C=f*g+(h>>5),_=w[(a+g)*(yc<<5)+(s+h)<<2]?1<<31-h%32:0;A[C]|=_,E|=_}E?S=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+S,t.sprite=A.slice(0,(t.y1-t.y0)*f)}}}function VK(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 YK(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 XK(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 oR(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function KK(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 JK(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Cs(e){return typeof e=="function"?e:function(){return e}}var QK={archimedean:oR,rectangular:KK};const sR=["x","y","font","fontSize","fontStyle","fontWeight","angle"],ZK=["text","font","rotate","fontSize","fontStyle","fontWeight"];function ME(e){M.call(this,GK(),e)}ME.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:sR}]};G(ME,M,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&L("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return be(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||ZK.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||sR;let a=e.fontSize||14,u;if(be(a)?u=e.fontSizeRange:a=wn(a),u){const g=a,p=Me("sqrt")().domain(lo(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[s[0]]=NaN,g[s[1]]=NaN,g[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(mi).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[s[0]]=p.x+f,m[s[1]]=p.y+d,m[s[2]]=p.font,m[s[3]]=p.size,m[s[4]]=p.style,m[s[5]]=p.weight,m[s[6]]=p.rotate;return t.reflow(i).modifies(s)}});const eJ=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:ME},Symbol.toStringTag,{value:"Module"})),tJ=e=>new Uint8Array(e),nJ=e=>new Uint16Array(e),Tc=e=>new Uint32Array(e);function iJ(){let e=8,t=[],n=Tc(0),i=Nd(0,e),r=Nd(0,e);return{data:()=>t,seen:()=>n=rJ(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=Nd(o,e,i),r=Nd(o,e))}}}function rJ(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Nd(e,t,n){const i=(t<257?tJ:t<65537?nJ:Tc)(e);return n&&i.set(n),i}function M$(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=Tc(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Tc(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=oJ(h,d),c)g=t,p=e,t=Array(c+f),e=Tc(c+f),sJ(l,g,p,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),[q8(u,a[0],0,l),Cu(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function oJ(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),uI(e,t)}function sJ(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 OE(e){M.call(this,iJ(),e),this._indices=null,this._dims=null}OE.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}}]};G(OE,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(M$(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,g={};let p,m,y,b,x,v,w,A,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,w=0,A=b.length;w<A;++w)v[b[w]._index]=1;for(w=0;w<h;++w)E=i[w],(!s[w]||e.modified("fields",w)||t.modified(E.fields))&&(y=E.fname,(p=g[y])||(o[y]=m=O$(),g[y]=p=m.insert(E,t.source,0)),s[w]=M$(m,w,r[w]).onAdd(p,u));for(w=0,A=a.data().length;w<A;++w)x[w]||(l[w]!==u[w]?f.push(w):v[w]&&u[w]!==c&&d.push(w));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,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=s[g].insert(a[h],i,d)),o[h].onAdd(p,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,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=g=o[h],o[h]=a,g!==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],g=l[1],p=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]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;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 g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=s[g],o[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=s[g],o[m]^=h,i.push(m);e.range=t.slice()}});function RE(e){M.call(this,null,e)}RE.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."}]};G(RE,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 aJ=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:OE,resolvefilter:RE},Symbol.toStringTag,{value:"Module"})),uJ="RawCode",da="Literal",lJ="Property",cJ="Identifier",fJ="ArrayExpression",dJ="BinaryExpression",aR="CallExpression",hJ="ConditionalExpression",gJ="LogicalExpression",pJ="MemberExpression",mJ="ObjectExpression",yJ="UnaryExpression";function Wi(e){this.type=e}Wi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=bJ(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function bJ(e){switch(e.type){case fJ:return e.elements;case dJ:case gJ:return[e.left,e.right];case aR:return[e.callee].concat(e.arguments);case hJ:return[e.test,e.consequent,e.alternate];case pJ:return[e.object,e.property];case mJ:return e.properties;case lJ:return[e.key,e.value];case yJ:return[e.argument];case cJ:case da:case uJ:default:return[]}}var kr,K,R,rn,Pe,r0=1,Bf=2,ha=3,fs=4,o0=5,Oa=6,kn=7,Uf=8,xJ=9;kr={};kr[r0]="Boolean";kr[Bf]="<end>";kr[ha]="Identifier";kr[fs]="Keyword";kr[o0]="Null";kr[Oa]="Numeric";kr[kn]="Punctuator";kr[Uf]="String";kr[xJ]="RegularExpression";var vJ="ArrayExpression",EJ="BinaryExpression",wJ="CallExpression",AJ="ConditionalExpression",uR="Identifier",SJ="Literal",CJ="LogicalExpression",$J="MemberExpression",_J="ObjectExpression",FJ="Property",kJ="UnaryExpression",$t="Unexpected token %0",DJ="Unexpected number",TJ="Unexpected string",MJ="Unexpected identifier",OJ="Unexpected reserved word",RJ="Unexpected end of input",Fb="Invalid regular expression",d1="Invalid regular expression: missing /",lR="Octal literals are not allowed in strict mode.",NJ="Duplicate data property in object literal not allowed in strict mode",Bt="ILLEGAL",Zc="Disabled.",LJ=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]"),PJ=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 s0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Wr(e){return e>=48&&e<=57}function NE(e){return"0123456789abcdefABCDEF".includes(e)}function Mc(e){return"01234567".includes(e)}function IJ(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 ef(e){return e===10||e===13||e===8232||e===8233}function jf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&LJ.test(String.fromCharCode(e))}function Fg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&PJ.test(String.fromCharCode(e))}const zJ={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 cR(){for(;R<rn;){const e=K.charCodeAt(R);if(IJ(e)||ef(e))++R;else break}}function kb(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<rn&&NE(K[R])?(i=K[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):ke({},$t,Bt);return String.fromCharCode(r)}function BJ(){var e,t,n,i;for(e=K[R],t=0,e==="}"&&ke({},$t,Bt);R<rn&&(e=K[R++],!!NE(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&ke({},$t,Bt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function fR(){var e,t;for(e=K.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(K.charCodeAt(R)!==117&&ke({},$t,Bt),++R,e=kb("u"),(!e||e==="\\"||!jf(e.charCodeAt(0)))&&ke({},$t,Bt),t=e);R<rn&&(e=K.charCodeAt(R),!!Fg(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),K.charCodeAt(R)!==117&&ke({},$t,Bt),++R,e=kb("u"),(!e||e==="\\"||!Fg(e.charCodeAt(0)))&&ke({},$t,Bt),t+=e);return t}function UJ(){var e,t;for(e=R++;R<rn;){if(t=K.charCodeAt(R),t===92)return R=e,fR();if(Fg(t))++R;else break}return K.slice(e,R)}function jJ(){var e,t,n;return e=R,t=K.charCodeAt(R)===92?fR():UJ(),t.length===1?n=ha:zJ.hasOwnProperty(t)?n=fs:t==="null"?n=o0:t==="true"||t==="false"?n=r0:n=ha,{type:n,value:t,start:e,end:R}}function h1(){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==="//"&&ke({},$t,Bt),"<>=!+-*%&|^/".includes(i))return++R,{type:kn,value:i,start:e,end:R};ke({},$t,Bt)}function qJ(e){let t="";for(;R<rn&&NE(K[R]);)t+=K[R++];return t.length===0&&ke({},$t,Bt),jf(K.charCodeAt(R))&&ke({},$t,Bt),{type:Oa,value:parseInt("0x"+t,16),start:e,end:R}}function WJ(e){let t="0"+K[R++];for(;R<rn&&Mc(K[R]);)t+=K[R++];return(jf(K.charCodeAt(R))||Wr(K.charCodeAt(R)))&&ke({},$t,Bt),{type:Oa,value:parseInt(t,8),octal:!0,start:e,end:R}}function R$(){var e,t,n;if(n=K[R],s0(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,qJ(t);if(Mc(n))return WJ(t);n&&Wr(n.charCodeAt(0))&&ke({},$t,Bt)}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 ke({},$t,Bt);return jf(K.charCodeAt(R))&&ke({},$t,Bt),{type:Oa,value:parseFloat(e),start:t,end:R}}function GJ(){var e="",t,n,i,r,o=!1;for(t=K[R],s0(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<rn;)if(i=K[R++],i===t){t="";break}else if(i==="\\")if(i=K[R++],!i||!ef(i.charCodeAt(0)))switch(i){case"u":case"x":K[R]==="{"?(++R,e+=BJ()):e+=kb(i);break;case"n":e+=`
5
+ `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?JP(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function ZP(e){return e}function eI(e){if(e==null)return ZP;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 tI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function nI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return aS(e,n)})}:aS(e,t)}function aS(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=gD(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 gD(e,t){var n=eI(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&tI(f,g)}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 iI(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,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.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 rI(e){return gD(e,oI.apply(this,arguments))}function oI(e,t,n){var i,r,o;if(arguments.length>1)i=sI(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:iI(e,i)}}function sI(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 aI(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 uI(e,t){const n=aI(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 uS extends Map{constructor(t,n=yD){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(my(this,t))}has(t){return super.has(my(this,t))}set(t,n){return super.set(pD(this,t),n)}delete(t){return super.delete(mD(this,t))}}class kh extends Set{constructor(t,n=yD){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(my(this,t))}add(t){return super.add(pD(this,t))}delete(t){return super.delete(mD(this,t))}}function my({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function pD({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function mD({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function yD(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lI(e,t){return Array.from(t,n=>e[n])}function cI(e=Ic){if(e===Ic)return bD;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 bD(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function Xs(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 yy(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 xD(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?bD:cI(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)),g=Math.min(i,Math.floor(t+(u-l)*f/u+d));xD(e,t,h,g,r)}const o=e[t];let s=n,a=i;for(Dl(e,n,t),r(e[i],o)>0&&Dl(e,n,i);s<a;){for(Dl(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Dl(e,n,a):(++a,Dl(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Dl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function by(e,t,n){if(e=Float64Array.from(N8(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return yy(e);if(t>=1)return Xs(e);var i,r=(i-1)*t,o=Math.floor(r),s=Xs(xD(e,o).subarray(0,o+1)),a=yy(e.subarray(o+1));return s+(a-s)*(r-o)}}function vD(e,t,n=L8){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 fI(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 ED(e,t){return by(e,.5,t)}function*dI(e){for(const t of e)yield*t}function wD(e){return Array.from(dI(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 AD(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function hI(e,...t){e=new kh(e),t=t.map(gI);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function gI(e){return e instanceof kh?e:new kh(e)}function pI(...e){const t=new kh;for(const n of e)for(const i of n)t.add(i);return t}const wm=new Date,Am=new Date;function Et(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=>Et(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)=>(wm.setTime(+o),Am.setTime(+s),e(wm),e(Am),Math.floor(n(wm,Am))),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 $u=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$u.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$u);$u.range;const Xr=1e3,li=Xr*60,Kr=li*60,co=Kr*24,Bx=co*7,lS=co*30,Sm=co*365,Jr=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xr)},(e,t)=>(t-e)/Xr,e=>e.getUTCSeconds());Jr.range;const pp=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xr)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getMinutes());pp.range;const mp=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*li)},(e,t)=>(t-e)/li,e=>e.getUTCMinutes());mp.range;const yp=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xr-e.getMinutes()*li)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getHours());yp.range;const bp=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCHours());bp.range;const no=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*li)/co,e=>e.getDate()-1);no.range;const Go=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>e.getUTCDate()-1);Go.range;const SD=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/co,e=>Math.floor(e/co));SD.range;function Fa(e){return Et(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())*li)/Bx)}const sl=Fa(0),Dh=Fa(1),mI=Fa(2),yI=Fa(3),_u=Fa(4),bI=Fa(5),xI=Fa(6);sl.range;Dh.range;mI.range;yI.range;_u.range;bI.range;xI.range;function ka(e){return Et(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)/Bx)}const al=ka(0),Th=ka(1),vI=ka(2),EI=ka(3),Fu=ka(4),wI=ka(5),AI=ka(6);al.range;Th.range;vI.range;EI.range;Fu.range;wI.range;AI.range;const Bc=Et(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());Bc.range;const Uc=Et(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());Uc.range;const br=Et(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());br.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});br.range;const xr=Et(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());xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(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)});xr.range;function CD(e,t,n,i,r,o){const s=[[Jr,1,Xr],[Jr,5,5*Xr],[Jr,15,15*Xr],[Jr,30,30*Xr],[o,1,li],[o,5,5*li],[o,15,15*li],[o,30,30*li],[r,1,Kr],[r,3,3*Kr],[r,6,6*Kr],[r,12,12*Kr],[i,1,co],[i,2,2*co],[n,1,Bx],[t,1,lS],[t,3,3*lS],[e,1,Sm]];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),g=h?h.range(l,+c+1):[];return d?g.reverse():g}function u(l,c,f){const d=Math.abs(c-l)/f,h=ep(([,,m])=>m).right(s,d);if(h===s.length)return e.every(ra(l/Sm,c/Sm,f));if(h===0)return $u.every(Math.max(ra(l,c,f),1));const[g,p]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return g.every(p)}return[a,u]}const[SI,CI]=CD(xr,Uc,al,SD,bp,mp),[$I,_I]=CD(br,Bc,sl,no,yp,pp),jt="year",Pn="quarter",nn="month",bt="week",In="date",Zt="day",vr="dayofyear",ei="hours",ti="minutes",pi="seconds",Ii="milliseconds",Ux=[jt,Pn,nn,bt,In,Zt,vr,ei,ti,pi,Ii],Cm=Ux.reduce((e,t,n)=>(e[t]=1+n,e),{});function jx(e){const t=oe(e).slice(),n={};return t.length||L("Missing time unit."),t.forEach(r=>{le(Cm,r)?n[r]=1:L(`Invalid time unit: ${r}.`)}),(n[bt]||n[Zt]?1:0)+(n[Pn]||n[nn]||n[In]?1:0)+(n[vr]?1:0)>1&&L(`Incompatible time units: ${e}`),t.sort((r,o)=>Cm[r]-Cm[o]),t}const FI={[jt]:"%Y ",[Pn]:"Q%q ",[nn]:"%b ",[In]:"%d ",[bt]:"W%U ",[Zt]:"%a ",[vr]:"%j ",[ei]:"%H:00",[ti]:"00:%M",[pi]:":%S",[Ii]:".%L",[`${jt}-${nn}`]:"%Y-%m ",[`${jt}-${nn}-${In}`]:"%Y-%m-%d ",[`${ei}-${ti}`]:"%H:%M"};function $D(e,t){const n=ye({},FI,t),i=jx(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 Bs=new Date;function qx(e){return Bs.setFullYear(e),Bs.setMonth(0),Bs.setDate(1),Bs.setHours(0,0,0,0),Bs}function _D(e){return kD(new Date(e))}function FD(e){return xy(new Date(e))}function kD(e){return no.count(qx(e.getFullYear())-1,e)}function xy(e){return sl.count(qx(e.getFullYear())-1,e)}function vy(e){return qx(e).getDay()}function kI(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 DD(e){return MD(new Date(e))}function TD(e){return Ey(new Date(e))}function MD(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Go.count(t-1,e)}function Ey(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return al.count(t-1,e)}function wy(e){return Bs.setTime(Date.UTC(e,0,1)),Bs.getUTCDay()}function DI(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 OD(e,t,n,i,r){const o=t||1,s=$e(e),a=(y,b,x)=>(x=x||y,TI(n[x],i[x],y===s&&o,b)),u=new Date,l=yr(e),c=l[jt]?a(jt):wn(2012),f=l[nn]?a(nn):l[Pn]?a(Pn):zs,d=l[bt]&&l[Zt]?a(Zt,1,bt+Zt):l[bt]?a(bt,1):l[Zt]?a(Zt,1):l[In]?a(In,1):l[vr]?a(vr,1):bf,h=l[ei]?a(ei):zs,g=l[ti]?a(ti):zs,p=l[pi]?a(pi):zs,m=l[Ii]?a(Ii):zs;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function TI(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 ku(e,t,n){return t+e*7-(n+6)%7}const MI={[jt]:e=>e.getFullYear(),[Pn]:e=>Math.floor(e.getMonth()/3),[nn]:e=>e.getMonth(),[In]:e=>e.getDate(),[ei]:e=>e.getHours(),[ti]:e=>e.getMinutes(),[pi]:e=>e.getSeconds(),[Ii]:e=>e.getMilliseconds(),[vr]:e=>kD(e),[bt]:e=>xy(e),[bt+Zt]:(e,t)=>ku(xy(e),e.getDay(),vy(t)),[Zt]:(e,t)=>ku(1,e.getDay(),vy(t))},OI={[Pn]:e=>3*e,[bt]:(e,t)=>ku(e,0,vy(t))};function RD(e,t){return OD(e,t||1,MI,OI,kI)}const RI={[jt]:e=>e.getUTCFullYear(),[Pn]:e=>Math.floor(e.getUTCMonth()/3),[nn]:e=>e.getUTCMonth(),[In]:e=>e.getUTCDate(),[ei]:e=>e.getUTCHours(),[ti]:e=>e.getUTCMinutes(),[pi]:e=>e.getUTCSeconds(),[Ii]:e=>e.getUTCMilliseconds(),[vr]:e=>MD(e),[bt]:e=>Ey(e),[Zt]:(e,t)=>ku(1,e.getUTCDay(),wy(t)),[bt+Zt]:(e,t)=>ku(Ey(e),e.getUTCDay(),wy(t))},NI={[Pn]:e=>3*e,[bt]:(e,t)=>ku(e,0,wy(t))};function ND(e,t){return OD(e,t||1,RI,NI,DI)}const LI={[jt]:br,[Pn]:Bc.every(3),[nn]:Bc,[bt]:sl,[In]:no,[Zt]:no,[vr]:no,[ei]:yp,[ti]:pp,[pi]:Jr,[Ii]:$u},PI={[jt]:xr,[Pn]:Uc.every(3),[nn]:Uc,[bt]:al,[In]:Go,[Zt]:Go,[vr]:Go,[ei]:bp,[ti]:mp,[pi]:Jr,[Ii]:$u};function ul(e){return LI[e]}function ll(e){return PI[e]}function LD(e,t,n){return e?e.offset(t,n):void 0}function PD(e,t,n){return LD(ul(e),t,n)}function ID(e,t,n){return LD(ll(e),t,n)}function zD(e,t,n,i){return e?e.range(t,n,i):void 0}function BD(e,t,n,i){return zD(ul(e),t,n,i)}function UD(e,t,n,i){return zD(ll(e),t,n,i)}const nc=1e3,ic=nc*60,rc=ic*60,xp=rc*24,II=xp*7,cS=xp*30,Ay=xp*365,jD=[jt,nn,In,ei,ti,pi,Ii],oc=jD.slice(0,-1),sc=oc.slice(0,-1),ac=sc.slice(0,-1),zI=ac.slice(0,-1),BI=[jt,bt],fS=[jt,nn],qD=[jt],Tl=[[oc,1,nc],[oc,5,5*nc],[oc,15,15*nc],[oc,30,30*nc],[sc,1,ic],[sc,5,5*ic],[sc,15,15*ic],[sc,30,30*ic],[ac,1,rc],[ac,3,3*rc],[ac,6,6*rc],[ac,12,12*rc],[zI,1,xp],[BI,1,II],[fS,1,cS],[fS,3,3*cS],[qD,1,Ay]];function WD(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(gp(t))/n;let r=ep(a=>a[2]).right(Tl,i),o,s;return r===Tl.length?(o=qD,s=ra(t[0]/Ay,t[1]/Ay,n)):r?(r=Tl[i/Tl[r-1][2]<Tl[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=jD,s=Math.max(ra(t[0],t[1],n),1)),{units:o,step:s}}function $m(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 _m(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 Ml(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function GD(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=Ol(r),c=Rl(r),f=Ol(o),d=Rl(o),h=Ol(s),g=Rl(s),p=Ol(a),m=Rl(a),y=Ol(u),b=Rl(u),x={a:P,A:z,b:I,B:V,c:null,d:yS,e:yS,f:l7,g:x7,G:E7,H:s7,I:a7,j:u7,L:HD,m:c7,M:f7,p:ue,q:ie,Q:vS,s:ES,S:d7,u:h7,U:g7,V:p7,w:m7,W:y7,x:null,X:null,y:b7,Y:v7,Z:w7,"%":xS},v={a:he,A:We,b:ge,B:Ht,c:null,d:bS,e:bS,f:$7,g:L7,G:I7,H:A7,I:S7,j:C7,L:YD,m:_7,M:F7,p:ws,q:_o,Q:vS,s:ES,S:k7,u:D7,U:T7,V:M7,w:O7,W:R7,x:null,X:null,y:N7,Y:P7,Z:z7,"%":xS},w={a:_,A:F,b:O,B:T,c:k,d:pS,e:pS,f:n7,g:gS,G:hS,H:mS,I:mS,j:QI,L:t7,m:JI,M:ZI,p:C,q:KI,Q:r7,s:o7,S:e7,u:GI,U:HI,V:VI,w:WI,W:YI,x:$,X:D,y:gS,Y:hS,Z:XI,"%":i7};x.x=A(n,x),x.X=A(i,x),x.c=A(t,x),v.x=A(n,v),v.X=A(i,v),v.c=A(t,v);function A(Y,pe){return function(ve){var W=[],Ot=-1,Ne=0,Vt=Y.length,At,Zi,fd;for(ve instanceof Date||(ve=new Date(+ve));++Ot<Vt;)Y.charCodeAt(Ot)===37&&(W.push(Y.slice(Ne,Ot)),(Zi=dS[At=Y.charAt(++Ot)])!=null?At=Y.charAt(++Ot):Zi=At==="e"?" ":"0",(fd=pe[At])&&(At=fd(ve,Zi)),W.push(At),Ne=Ot+1);return W.push(Y.slice(Ne,Ot)),W.join("")}}function E(Y,pe){return function(ve){var W=Ml(1900,void 0,1),Ot=S(W,Y,ve+="",0),Ne,Vt;if(Ot!=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(pe&&!("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?(Ne=_m(Ml(W.y,0,1)),Vt=Ne.getUTCDay(),Ne=Vt>4||Vt===0?Th.ceil(Ne):Th(Ne),Ne=Go.offset(Ne,(W.V-1)*7),W.y=Ne.getUTCFullYear(),W.m=Ne.getUTCMonth(),W.d=Ne.getUTCDate()+(W.w+6)%7):(Ne=$m(Ml(W.y,0,1)),Vt=Ne.getDay(),Ne=Vt>4||Vt===0?Dh.ceil(Ne):Dh(Ne),Ne=no.offset(Ne,(W.V-1)*7),W.y=Ne.getFullYear(),W.m=Ne.getMonth(),W.d=Ne.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),Vt="Z"in W?_m(Ml(W.y,0,1)).getUTCDay():$m(Ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Vt+5)%7:W.w+W.U*7-(Vt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,_m(W)):$m(W)}}function S(Y,pe,ve,W){for(var Ot=0,Ne=pe.length,Vt=ve.length,At,Zi;Ot<Ne;){if(W>=Vt)return-1;if(At=pe.charCodeAt(Ot++),At===37){if(At=pe.charAt(Ot++),Zi=w[At in dS?pe.charAt(Ot++):At],!Zi||(W=Zi(Y,ve,W))<0)return-1}else if(At!=ve.charCodeAt(W++))return-1}return W}function C(Y,pe,ve){var W=l.exec(pe.slice(ve));return W?(Y.p=c.get(W[0].toLowerCase()),ve+W[0].length):-1}function _(Y,pe,ve){var W=h.exec(pe.slice(ve));return W?(Y.w=g.get(W[0].toLowerCase()),ve+W[0].length):-1}function F(Y,pe,ve){var W=f.exec(pe.slice(ve));return W?(Y.w=d.get(W[0].toLowerCase()),ve+W[0].length):-1}function O(Y,pe,ve){var W=y.exec(pe.slice(ve));return W?(Y.m=b.get(W[0].toLowerCase()),ve+W[0].length):-1}function T(Y,pe,ve){var W=p.exec(pe.slice(ve));return W?(Y.m=m.get(W[0].toLowerCase()),ve+W[0].length):-1}function k(Y,pe,ve){return S(Y,t,pe,ve)}function $(Y,pe,ve){return S(Y,n,pe,ve)}function D(Y,pe,ve){return S(Y,i,pe,ve)}function P(Y){return s[Y.getDay()]}function z(Y){return o[Y.getDay()]}function I(Y){return u[Y.getMonth()]}function V(Y){return a[Y.getMonth()]}function ue(Y){return r[+(Y.getHours()>=12)]}function ie(Y){return 1+~~(Y.getMonth()/3)}function he(Y){return s[Y.getUTCDay()]}function We(Y){return o[Y.getUTCDay()]}function ge(Y){return u[Y.getUTCMonth()]}function Ht(Y){return a[Y.getUTCMonth()]}function ws(Y){return r[+(Y.getUTCHours()>=12)]}function _o(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var pe=A(Y+="",x);return pe.toString=function(){return Y},pe},parse:function(Y){var pe=E(Y+="",!1);return pe.toString=function(){return Y},pe},utcFormat:function(Y){var pe=A(Y+="",v);return pe.toString=function(){return Y},pe},utcParse:function(Y){var pe=E(Y+="",!0);return pe.toString=function(){return Y},pe}}}var dS={"-":"",_:" ",0:"0"},Tt=/^\s*\d+/,UI=/^%/,jI=/[\\^$*+?|[\]().{}]/g;function Te(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 qI(e){return e.replace(jI,"\\$&")}function Ol(e){return new RegExp("^(?:"+e.map(qI).join("|")+")","i")}function Rl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function WI(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function GI(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function HI(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function VI(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function YI(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function hS(e,t,n){var i=Tt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function gS(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function XI(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 KI(e,t,n){var i=Tt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function JI(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function pS(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function QI(e,t,n){var i=Tt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function mS(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function ZI(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function e7(e,t,n){var i=Tt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function t7(e,t,n){var i=Tt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function n7(e,t,n){var i=Tt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function i7(e,t,n){var i=UI.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function r7(e,t,n){var i=Tt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function o7(e,t,n){var i=Tt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function yS(e,t){return Te(e.getDate(),t,2)}function s7(e,t){return Te(e.getHours(),t,2)}function a7(e,t){return Te(e.getHours()%12||12,t,2)}function u7(e,t){return Te(1+no.count(br(e),e),t,3)}function HD(e,t){return Te(e.getMilliseconds(),t,3)}function l7(e,t){return HD(e,t)+"000"}function c7(e,t){return Te(e.getMonth()+1,t,2)}function f7(e,t){return Te(e.getMinutes(),t,2)}function d7(e,t){return Te(e.getSeconds(),t,2)}function h7(e){var t=e.getDay();return t===0?7:t}function g7(e,t){return Te(sl.count(br(e)-1,e),t,2)}function VD(e){var t=e.getDay();return t>=4||t===0?_u(e):_u.ceil(e)}function p7(e,t){return e=VD(e),Te(_u.count(br(e),e)+(br(e).getDay()===4),t,2)}function m7(e){return e.getDay()}function y7(e,t){return Te(Dh.count(br(e)-1,e),t,2)}function b7(e,t){return Te(e.getFullYear()%100,t,2)}function x7(e,t){return e=VD(e),Te(e.getFullYear()%100,t,2)}function v7(e,t){return Te(e.getFullYear()%1e4,t,4)}function E7(e,t){var n=e.getDay();return e=n>=4||n===0?_u(e):_u.ceil(e),Te(e.getFullYear()%1e4,t,4)}function w7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Te(t/60|0,"0",2)+Te(t%60,"0",2)}function bS(e,t){return Te(e.getUTCDate(),t,2)}function A7(e,t){return Te(e.getUTCHours(),t,2)}function S7(e,t){return Te(e.getUTCHours()%12||12,t,2)}function C7(e,t){return Te(1+Go.count(xr(e),e),t,3)}function YD(e,t){return Te(e.getUTCMilliseconds(),t,3)}function $7(e,t){return YD(e,t)+"000"}function _7(e,t){return Te(e.getUTCMonth()+1,t,2)}function F7(e,t){return Te(e.getUTCMinutes(),t,2)}function k7(e,t){return Te(e.getUTCSeconds(),t,2)}function D7(e){var t=e.getUTCDay();return t===0?7:t}function T7(e,t){return Te(al.count(xr(e)-1,e),t,2)}function XD(e){var t=e.getUTCDay();return t>=4||t===0?Fu(e):Fu.ceil(e)}function M7(e,t){return e=XD(e),Te(Fu.count(xr(e),e)+(xr(e).getUTCDay()===4),t,2)}function O7(e){return e.getUTCDay()}function R7(e,t){return Te(Th.count(xr(e)-1,e),t,2)}function N7(e,t){return Te(e.getUTCFullYear()%100,t,2)}function L7(e,t){return e=XD(e),Te(e.getUTCFullYear()%100,t,2)}function P7(e,t){return Te(e.getUTCFullYear()%1e4,t,4)}function I7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fu(e):Fu.ceil(e),Te(e.getUTCFullYear()%1e4,t,4)}function z7(){return"+0000"}function xS(){return"%"}function vS(e){return+e}function ES(e){return Math.floor(+e/1e3)}var Ya,Wx,KD,Gx,JD;B7({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 B7(e){return Ya=GD(e),Wx=Ya.format,KD=Ya.parse,Gx=Ya.utcFormat,JD=Ya.utcParse,Ya}function uc(e){const t={};return n=>t[n]||(t[n]=e(n))}function U7(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=j7(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 j7(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 QD(e){const t=uc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=hy(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return U7(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=hy(s??",f");const a=ra(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=I8(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=P8(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let Sy;ZD();function ZD(){return Sy=QD({format:Ok,formatPrefix:H8})}function e3(e){return QD(G8(e))}function Mh(e){return arguments.length?Sy=e3(e):Sy}function wS(e,t,n){n=n||{},me(n)||L(`Invalid time multi-format specifier: ${n}`);const i=t(pi),r=t(ti),o=t(ei),s=t(In),a=t(bt),u=t(nn),l=t(Pn),c=t(jt),f=e(n[Ii]||".%L"),d=e(n[pi]||":%S"),h=e(n[ti]||"%I:%M"),g=e(n[ei]||"%I %p"),p=e(n[In]||n[Zt]||"%a %d"),m=e(n[bt]||"%b %d"),y=e(n[nn]||"%B"),b=e(n[Pn]||"%B"),x=e(n[jt]||"%Y");return v=>(i(v)<v?f:r(v)<v?d:o(v)<v?h:s(v)<v?g:u(v)<v?a(v)<v?p:m:c(v)<v?l(v)<v?y:b:x)(v)}function t3(e){const t=uc(e.format),n=uc(e.utcFormat);return{timeFormat:i=>Ke(i)?t(i):wS(t,ul,i),utcFormat:i=>Ke(i)?n(i):wS(n,ll,i),timeParse:uc(e.parse),utcParse:uc(e.utcParse)}}let Cy;n3();function n3(){return Cy=t3({format:Wx,parse:KD,utcFormat:Gx,utcParse:JD})}function i3(e){return t3(GD(e))}function jc(e){return arguments.length?Cy=i3(e):Cy}const $y=(e,t)=>ye({},e,t);function r3(e,t){const n=e?e3(e):Mh(),i=t?i3(t):jc();return $y(n,i)}function Hx(e,t){const n=arguments.length;return n&&n!==2&&L("defaultLocale expects either zero or two arguments."),n?$y(Mh(e),jc(t)):$y(Mh(),jc())}function q7(){return ZD(),n3(),Hx()}const W7=/^(data:|([A-Za-z]+:)?\/\/)/,G7=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,H7=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,AS="file://";function V7(e,t){return n=>({options:n||{},sanitize:X7,load:Y7,fileAccess:!1,file:K7(t),http:Q7(e)})}async function Y7(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function X7(e,t){t=ye({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=G7.test(e.replace(H7,""));(e==null||typeof e!="string"||!a)&&L("Sanitize failure, invalid URI: "+re(e));const u=W7.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(AS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(AS.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 K7(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):J7}async function J7(){L("No file system access.")}function Q7(e){return e?async function(t,n){const i=ye({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?be(o[r])?o[r]():o.text():L(o.status+""+o.statusText)}:Z7}async function Z7(){L("No HTTP fetch method available.")}const ez=e=>e!=null&&e===e,tz=e=>e==="true"||e==="false"||e===!0||e===!1,nz=e=>!Number.isNaN(Date.parse(e)),o3=e=>!Number.isNaN(+e)&&!(e instanceof Date),iz=e=>o3(e)&&Number.isInteger(+e),_y={boolean:cD,integer:mn,number:mn,date:fD,string:dD,unknown:Ln},pd=[tz,iz,o3,nz],rz=["boolean","integer","number","date"];function s3(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=pd.length,r=pd.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]&&ez(u)&&!pd[a](u)&&(r[a]=0,++s,s===pd.length))return"string";return rz[r.reduce((o,s)=>o===0?s:o,0)-1]}function a3(e,t){return t.reduce((n,i)=>(n[i]=s3(e,i),n),{})}function SS(e){const t=function(n,i){const r={delimiter:e};return Vx(n,i?ye(i,r):r)};return t.responseType="text",t}function Vx(e,t){return t.header&&(e=t.header.map(re).join(t.delimiter)+`
6
+ `+e),QP(t.delimiter).parse(e+"")}Vx.responseType="text";function oz(e){return typeof Buffer=="function"&&be(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Yx(e,t){const n=t&&t.property?Li(t.property):Ln;return me(e)&&!oz(e)?sz(n(e),t):n(JSON.parse(e))}Yx.responseType="json";function sz(e,t){return!Z(e)&&UP(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const az={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function u3(e,t){let n,i,r,o;return e=Yx(e,t),t&&t.feature?(n=nI,r=t.feature):t&&t.mesh?(n=rI,r=t.mesh,o=az[t.filter]):L("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):L("Invalid TopoJSON object: "+r),i&&i.features||[i]}u3.responseType="json";const Zd={dsv:Vx,csv:SS(","),tsv:SS(" "),json:Yx,topojson:u3};function Xx(e,t){return arguments.length>1?(Zd[e]=t,this):le(Zd,e)?Zd[e]:null}function l3(e){const t=Xx(e);return t&&t.responseType||"text"}function c3(e,t,n,i){t=t||{};const r=Xx(t.type||"json");return r||L("Unknown data format type: "+t.type),e=r(e,t),t.parse&&uz(e,t.parse,n,i),le(e,"columns")&&delete e.columns,e}function uz(e,t,n,i){if(!e.length)return;const r=jc();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=a3(e,o)),o=Object.keys(t);const d=o.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!_y[g])throw Error("Illegal format pattern: "+h+":"+g);return _y[g]});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 vp=V7(typeof fetch<"u"&&fetch,null);function Ep(e){const t=e||Ln,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 eh(e,t){try{await t(e)}catch(n){e.error(n)}}const f3=Symbol("vega_id");let lz=1;function wp(e){return!!(e&&te(e))}function te(e){return e[f3]}function d3(e,t){return e[f3]=t,e}function Oe(e){const t=e===Object(e)?e:{data:e};return te(t)?t:d3(t,lz++)}function Kx(e){return Ap(e,Oe({}))}function Ap(e,t){for(const n in e)t[n]=e[n];return t}function h3(e,t){return d3(t,te(e))}function Da(e,t){return e?t?(n,i)=>e(n,i)||te(t(n))-te(t(i)):(n,i)=>e(n,i)||te(n)-te(i):null}function g3(e){return e&&e.constructor===Ta}function Ta(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:Ta,insert(a){const u=oe(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=be(a)?i:t,l=oe(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:wn(l)};return be(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return be(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,g,p,m;for(f=0,d=u.length;f<d;++f)l[te(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[te(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[te(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=te(p),l[m]?l[m]=1:a.add.push(Oe(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[te(p)]<0&&a.rem.push(p);function y(b,x,v){v?b[x]=v(b):a.encode=x,s||(c[te(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[te(p)],m>0&&(y(p,g,h.value),a.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[te(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[te(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 th="_:mod:_";function Sp(){Object.defineProperty(this,th,{writable:!0,value:{}})}Sp.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[th];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[th];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[th]={},this}};let cz=0;const fz="pulse",dz=new Sp,hz=1,gz=2;function Ge(e,t,n,i){this.id=++cz,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 CS(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ge.prototype={targets(){return this._targets||(this._targets=Ep(cp))},set(e){return this.value!==e?(this.value=e,1):0},skip:CS(hz),modified:CS(gz),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Sp,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Ge?(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===fz)oe(a).forEach(f=>{f instanceof Ge?f!==this&&(f.targets().add(this),o.push(f)):L("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||dz,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 pz(e,t,n,i){let r=1,o;return e instanceof Ge?o=e:e&&e.prototype instanceof Ge?o=new e:be(e)?o=new Ge(null,e):(r=0,o=new Ge(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function mz(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 yz=0;function Cp(e,t,n){this.id=++yz,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function ko(e,t,n){return new Cp(e,t,n)}Cp.prototype={_filter:Pi,_apply:Ln,targets(){return this._targets||(this._targets=Ep(cp))},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=ko(e);return this.targets().add(t),t},apply(e){const t=ko(null,e);return this.targets().add(t),t},merge(){const e=ko();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=ko();return this.targets().add(ko(null,null,aD(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(ko(null,null,()=>n=!0)),t.targets().add(ko(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Pi,this._targets=null}};function bz(e,t,n,i){const r=this,o=ko(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=oe(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function xz(e,t){const n=this.locale();return c3(e,t,n.timeParse,n.utcParse)}function vz(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function Ez(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:l3(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 wz(e,t,n){const i=this,r=i._pending||Az(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Pi).insert(o.data||[])),r.done(),o}function Az(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 Sz={skip:!0};function Cz(e,t,n,i,r){return(e instanceof Ge?_z:$z)(this,e,t,n,i,r),this}function $z(e,t,n,i,r,o){const s=ye({},o,Sz);let a,u;be(n)||(n=wn(n)),i===void 0?a=l=>e.touch(n(l)):be(i)?(u=new Ge(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;g3(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function _z(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Ge(null,Fz(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 Fz(e,t){return t=be(t)?t:wn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function kz(e){e.rank=++this._rank}function Dz(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&&L("Cycle detected in dataflow graph.")}const Oh={},rr=1,To=2,jr=4,Tz=rr|To,$S=rr|jr,Xa=rr|To|jr,_S=8,Nl=16,FS=32,kS=64;function Ho(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Fm(e,t){const n=[];return Ls(e,t,i=>n.push(i)),n}function DS(e,t){const n={};return e.visit(t,i=>{n[te(i)]=1}),i=>n[te(i)]?null:i}function md(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ho.prototype={StopPropagation:Oh,ADD:rr,REM:To,MOD:jr,ADD_REM:Tz,ADD_MOD:$S,ALL:Xa,REFLOW:_S,SOURCE:Nl,NO_SOURCE:FS,NO_FIELDS:kS,fork(e){return new Ho(this.dataflow).init(this,e)},clone(){const e=this.fork(Xa);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(Xa|Nl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ho(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&kS)&&(n.fields=e.fields),t&rr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&To?(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&FS?(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||Xa;return t&rr&&this.add.length||t&To&&this.rem.length||t&jr&&this.mod.length},reflow(e){if(e)return this.fork(Xa).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(jr,DS(this,rr))),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&rr&&(n.addF=md(n.addF,t)),e&To&&(n.remF=md(n.remF,t)),e&jr&&(n.modF=md(n.modF,t)),e&Nl&&(n.srcF=md(n.srcF,t)),n},materialize(e){e=e||Xa;const t=this;return e&rr&&t.addF&&(t.add=Fm(t.add,t.addF),t.addF=null),e&To&&t.remF&&(t.rem=Fm(t.rem,t.remF),t.remF=null),e&jr&&t.modF&&(t.mod=Fm(t.mod,t.modF),t.modF=null),e&Nl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Nl)return Ls(n.source,n.srcF,i),n;e&rr&&Ls(n.add,n.addF,i),e&To&&Ls(n.rem,n.remF,i),e&jr&&Ls(n.mod,n.modF,i);const r=n.source;if(e&_S&&r){const o=n.add.length+n.mod.length;o===r.length||(o?Ls(r,DS(n,$S),i):Ls(r,n.srcF,i))}return n}};function Jx(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}G(Jx,Ho,{fork(e){const t=new Ho(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(){L("MultiPulse does not support filtering.")},materialize(){L("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 Mz(e,t,n){const i=this,r=[];if(i._pulse)return p3(i);if(i._pending&&await i._pending,t&&await eh(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Ho(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ep(cp);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=Oh),u!==Oh&&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 eh(i,c[f].callback)}return n&&await eh(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 Oz(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 Rz(e,t,n){return this._pulse?p3(this):(this.evaluate(e,t,n),this)}function Nz(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 p3(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function Lz(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function Pz(e,t){const n=e.source,i=this._clock;return n&&Z(n)?new Jx(this,i,n.map(r=>r.pulse),t):this._input[e.id]||Iz(this._pulse,n&&n.pulse)}function Iz(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Oh&&(e.source=t.source),e)}const Qx={skip:!1,force:!1};function zz(e,t){const n=t||Qx;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function Bz(e,t,n){const i=n||Qx;return(e.set(t)||i.force)&&this.touch(e,i),this}function Uz(e,t,n){this.touch(e,n||Qx);const i=new Ho(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 jz(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),m3(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,qz(t,0,e)):i=n,i}}}function m3(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 qz(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,m3(e,i,t,n)}function mu(){this.logger(SP()),this.logLevel(Jk),this._clock=0,this._rank=0,this._locale=Hx();try{this._loader=vp()}catch{}this._touched=Ep(cp),this._input={},this._pulse=null,this._heap=jz((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Ll(e){return function(){return this._log[e].apply(this,arguments)}}mu.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:Ll("error"),warn:Ll("warn"),info:Ll("info"),debug:Ll("debug"),logLevel:Ll("level"),cleanThreshold:1e4,add:pz,connect:mz,rank:kz,rerank:Dz,pulse:Uz,touch:zz,update:Bz,changeset:Ta,ingest:vz,parse:xz,preload:wz,request:Ez,events:bz,on:Cz,evaluate:Mz,run:Rz,runAsync:Oz,runAfter:Nz,_enqueue:Lz,_getPulse:Pz};function M(e,t){Ge.call(this,e,null,t)}G(M,Ge,{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 Du={};function y3(e){const t=b3(e);return t&&t.Definition||null}function b3(e){return e=e&&e.toLowerCase(),le(Du,e)?Du[e]:null}function*x3(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 Zx(e,t,n){const i=Float64Array.from(x3(e,n));return i.sort(Ic),t.map(r=>vD(i,r))}function ev(e,t){return Zx(e,[.25,.5,.75],t)}function tv(e,t){const n=e.length,i=uI(e,t),r=ev(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 v3(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 g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+p)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var mi=Math.random;function Wz(e){mi=e}function E3(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(x3(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[~~(mi()*o)];c[l]=a/o}return c.sort(Ic),[by(c,n/2),by(c,1-n/2)]}function w3(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?Gz(o,t+t/4):o}function Gz(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 Hz(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function Vz(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*mi())},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 A3=Math.sqrt(2*Math.PI),Yz=Math.SQRT2;let Pl=NaN;function $p(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(Pl===Pl)n=Pl,Pl=NaN;else{do n=mi()*2-1,i=mi()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,Pl=i*o}return e+n*t}function nv(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*A3)}function _p(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 Fp(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*Yz*Xz(2*e-1)}function Xz(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 iv(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:()=>$p(n,i),pdf:o=>nv(o,n,i),cdf:o=>_p(o,n,i),icdf:o=>Fp(o,n,i)};return r.mean(e).stdev(t)}function rv(e,t){const n=iv();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=tv(e)),r):t},sample(){return e[~~(mi()*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 ov(e,t){return e=e||0,t=t??1,Math.exp(e+$p()*t)}function sv(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*A3*e)}function av(e,t,n){return _p(Math.log(e),t,n)}function uv(e,t,n){return Math.exp(Fp(e,t,n))}function S3(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:()=>ov(n,i),pdf:o=>sv(o,n,i),cdf:o=>av(o,n,i),icdf:o=>uv(o,n,i)};return r.mean(e).stdev(t)}function C3(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=mi();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 lv(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*mi()}function cv(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function fv(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function dv(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function $3(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:()=>lv(n,i),pdf:o=>cv(o,n,i),cdf:o=>fv(o,n,i),icdf:o=>dv(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function hv(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 vf(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 kp(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));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 Ef(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 cl(e,t,n,i,r){let o=0,s=0;return Ef(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function gv(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ef(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=vf(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:cl(e,t,n,r,l)}}function _3(e,t,n){let i=0,r=0,o=0,s=0,a=0;Ef(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=vf(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:cl(e,t,n,r,l)}}function F3(e,t,n){const[i,r,o,s]=kp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,g;Ef(e,t,n,(b,x)=>{d=i[f++],h=Math.log(x),g=d*x,a+=(x*h-a)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=vf(u/s,a/s,l/s,c/s),y=b=>Math.exp(p+m*(b-o));return{coef:[Math.exp(p-m*o),m],predict:y,rSquared:cl(e,t,n,s,y)}}function k3(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Ef(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,o+=(h*g-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=vf(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:cl(e,t,n,a,c)}}function pv(e,t,n){const[i,r,o,s]=kp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<a;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,x=(d*u-f*l)/b,v=(f*y-d*l)/b,w=-x*u,A=E=>(E=E-o,x*E*E+v*E+w+s);return{coef:[w-v*o+x*o*o+s,v-2*x*o,x],predict:A,rSquared:cl(e,t,n,s,A)}}function D3(e,t,n,i){if(i===0)return hv(e,t,n);if(i===1)return gv(e,t,n);if(i===2)return pv(e,t,n);const[r,o,s,a]=kp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*o[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=Jz(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:Kz(f,y,-s,a),predict:b,rSquared:cl(e,t,n,a,b)}}function Kz(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 Jz(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 TS=2,MS=1e-12;function T3(e,t,n,i){const[r,o,s,a]=kp(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<=TS;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],x=g[1],v=y-r[b]>r[x]-y?b:x;let w=0,A=0,E=0,S=0,C=0;const _=1/Math.abs(r[v]-y||1);for(let T=b;T<=x;++T){const k=r[T],$=o[T],D=Qz(Math.abs(y-k)*_)*d[T],P=k*D;w+=D,A+=P,E+=$*D,S+=$*P,C+=k*P}const[F,O]=vf(A/w,E/w,S/w,C/w);c[m]=F+O*y,f[m]=Math.abs(o[m]-c[m]),Zz(r,m+1,g)}if(h===TS)break;const p=ED(f);if(Math.abs(p)<MS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?MS:(b=1-y*y)*b}return eB(r,c,s,a)}function Qz(e){return(e=1-e*e*e)*e*e}function Zz(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 eB(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 tB=.5*Math.PI/180;function Dp(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(o+p/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let p=n;--p>0;)c.push(r(o+p/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,g=nB(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&iB(f,p,d,h,g)>tB?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function nB(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 iB(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 rB(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 Fy(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:rB(e)}function M3(e,t,n){return n||e+(t?"_"+t:"")}const km=()=>{},oB={init:km,add:km,rem:km,idx:0},qc={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}},wf=Object.keys(qc).filter(e=>e!=="__count__");function sB(e,t){return(n,i)=>ye({name:e,aggregate_param:i,out:n||e},oB,t)}[...wf,"__count__"].forEach(e=>{qc[e]=sB(e,qc[e])});function O3(e,t,n){return qc[e](n,t)}function R3(e,t){return e.idx-t.idx}function aB(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=qc[r]())})};return e.forEach(n),Object.values(t).sort(R3)}function uB(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function lB(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function cB(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function fB(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function N3(e,t){const n=t||Ln,i=aB(e),r=e.slice().sort(R3);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=uB,o.prototype.add=lB,o.prototype.rem=cB,o.prototype.set=fB,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function mv(e){this._key=e?Li(e):te,this.reset()}const Gt=mv.prototype;Gt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Gt.add=function(e){this._add.push(e)};Gt.rem=function(e){this._rem.push(e)};Gt.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};Gt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",le(n,o)||(n[o]=1,++r);return r};Gt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=IP(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Gt.argmin=function(e){return this.extent(e)[0]||{}};Gt.argmax=function(e){return this.extent(e)[1]||{}};Gt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Gt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Gt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=ev(this.values(),e),this._get=e),this._q};Gt.q1=function(e){return this.quartile(e)[0]};Gt.q2=function(e){return this.quartile(e)[1]};Gt.q3=function(e){return this.quartile(e)[2]};Gt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=E3(this.values(),1e3,.05,e),this._get=e),this._ci};Gt.ci0=function(e){return this.ci(e)[0]};Gt.ci1=function(e){return this.ci(e)[1]};function Ko(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}Ko.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:wf},{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"}]};G(Ko,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=oe(xn(b)),v=x.length;let w=0,A;for(;w<v;++w)i[A=x[w]]||(i[A]=1,t.push(A))}this._dims=oe(e.groupby),this._dnames=this._dims.map(b=>{const x=lt(b);return r(b),n.push(x),x}),this.cellkey=e.key?e.key:Fy(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,g,p,m,y;for(l!==s.length&&L("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"&&L("Null aggregate field specified."),p=lt(f),m=M3(d,p,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}g=c[p],g||(r(f),g=c[p]=[],g.field=f,this._measures.push(g)),d!=="count"&&(this._countOnly=!1),g.push(O3(d,h,m))}return this._measures=this._measures.map(b=>N3(b,b.field)),Object.create(null)},cellkey:Fy(),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 mv),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?h3(t.tuple,o):Oe(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 dB=1e-14;function yv(e){M.call(this,null,e)}yv.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"]}]};G(yv,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(xn(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=v3(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=mn(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(dB+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=ri(u,xn(t),e.name||"bin_"+lt(t))}});function L3(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?GP(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function bv(e){M.call(this,[],e)}bv.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(bv,M,{transform(e,t){const n=t.fork(t.ALL),i=L3(te,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(Da(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function P3(e){Ge.call(this,null,hB,e)}G(P3,Ge);function hB(e){return this.value&&!e.modified()?this.value:sD(e.fields,e.orders)}function xv(e){M.call(this,null,e)}xv.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 gB(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(xv,M,{transform(e,t){const n=f=>d=>{for(var h=gB(a(d),e.case,o)||[],g,p=0,m=h.length;p<m;++p)s.test(g=h[p])||f(g)},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=Oe({}),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 vv(e){M.call(this,null,e)}vv.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(vv,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=pB(a,r,o,e.filter||Pi)):n.mod=a,n.source=this.value,n.modifies(i)}});function pB(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(Oe(o)),o={},o[t]=l);return r}const OS={kde:rv,mixture:C3,normal:iv,lognormal:S3,uniform:$3},mB="distributions",RS="function",yB="field";function I3(e,t){const n=e[RS];le(OS,n)||L("Unknown distribution function: "+n);const i=OS[n]();for(const r in e)r===yB?i.data((e.from||t()).map(e[r])):r===mB?i[r](e[r].map(o=>I3(o,t))):typeof i[r]===RS&&i[r](e[r]);return i}function Ev(e){M.call(this,null,e)}const z3=[{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}]}],bB={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:z3},{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:z3.concat(bB)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Ev,M,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=I3(e.distribution,xB(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&L("Invalid density method: "+s),!e.extent&&!i.data&&L("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||lo(i.data()),l=Dp(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Oe(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function xB(e){return()=>e.materialize(e.SOURCE).source}function B3(e,t){return e?e.map((n,i)=>t[i]||lt(n)):null}function wv(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 U3="bin";function Av(e){M.call(this,null,e)}Av.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:U3}]};const vB=(e,t)=>gp(lo(e,t))/30;G(Av,M,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=wv(t.source,e.groupby,Ln),r=e.smooth||!1,o=e.field,s=e.step||vB(n,o),a=Da((g,p)=>o(g)-o(p)),u=e.as||U3,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(a);h=-1;for(const p of w3(g,s,r,o))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function j3(e){Ge.call(this,null,EB,e),this.modified(!0)}G(j3,Ge);function EB(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ri(n=>t(n,e),xn(t),lt(t))}function Sv(e){M.call(this,[void 0,void 0],e)}Sv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(Sv,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=mn(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=lt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function Cv(e,t){Ge.call(this,e),this.parent=t,this.count=0}G(Cv,Ge,{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 Tp(e){M.call(this,{},e),this._keys=xf();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)}}G(Tp,M,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=le(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 Cv(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=te(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(te(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=te(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(te(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=te(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 q3(e){Ge.call(this,null,wB,e)}G(q3,Ge);function wB(e){return this.value&&!e.modified()?this.value:Z(e.name)?oe(e.name).map(t=>Li(t)):Li(e.name,e.as)}function $v(e){M.call(this,xf(),e)}$v.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G($v,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=te(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(te(f),1)});function c(f){const d=te(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),o.push(f)):!h&&!g?(i.set(d,1),s.push(f)):l&&h&&!g&&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 _v(e){M.call(this,[],e)}_v.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}]};G(_v,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=B3(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(g=>g(a)),l=u.reduce((g,p)=>Math.max(g,p.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 Fv(e){M.call(this,[],e)}Fv.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"]}]};G(Fv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(lt),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 kv(e){M.call(this,null,e)}kv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(kv,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 W3(e){M.call(this,[],e)}G(W3,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=Oe(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 yd={value:"value",median:ED,mean:fI,min:yy,max:Xs},AB=[];function Dv(e){M.call(this,[],e)}Dv.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 SB(e){var t=e.method||yd.value,n;if(yd[t]==null)L("Unrecognized imputation method: "+t);else return t===yd.value?(n=e.value!==void 0?e.value:0,()=>n):yd[t]}function CB(e){const t=e.field;return n=>n?t(n):NaN}G(Dv,M,{transform(e,t){var n=t.fork(t.ALL),i=SB(e),r=CB(e),o=lt(e.field),s=lt(e.key),a=(e.groupby||[]).map(lt),u=$B(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,x,v,w;for(m=0,x=u.length;m<x;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],w={_impute:!0},y=0,v=g.length;y<v;++y)w[a[y]]=g[y];w[s]=p,w[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Oe(w))}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 $B(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,g,p,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=a[g]||(a[g]=s.push(g)),c=(l=t?t.map(r):AB)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function Tv(e){Ko.call(this,e)}Tv.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:wf},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(Tv,Ko,{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=>{ye(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 Mv(e){M.call(this,null,e)}Mv.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"]}]};G(Mv,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=wv(i,e.groupby,e.field),o=(e.groupby||[]).map(lt),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"&&L("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=lo(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=rv(h,s)[a],p=e.counts?h.length:1,m=c||lo(h);Dp(g,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]*p,l.push(Oe(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function G3(e){Ge.call(this,null,_B,e)}G(G3,Ge);function _B(e){return this.value&&!e.modified()?this.value:lD(e.fields,e.flat)}function H3(e){M.call(this,[],e),this._pending=null}G(H3,M,{transform(e,t){const n=t.dataflow;return this._pending?Dm(this,t,this._pending):FB(e)?t.StopPropagation:e.values?Dm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=oe(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>Dm(this,t,oe(i.data)))}});function FB(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Dm(e,t,n){n.forEach(Oe);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 Ov(e){M.call(this,{},e)}Ov.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}]};G(Ov,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&&L('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&L('The "as" parameter has too few output field names.'),c=c||r.map(lt),f=function(g){for(var p=0,m=0,y,b;p<a;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=o;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||L("Missing output field names."),f=function(g){for(var p=0,m;p<a;++p)m=i.get(n[p](g)),g[c[p]]=m??o}),s?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function V3(e){Ge.call(this,null,kB,e)}G(V3,Ge);function kB(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 Y3(e){Ge.call(this,null,DB,e)}G(Y3,Ge);function DB(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function X3(e){M.call(this,null,e)}G(X3,M,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Rv(e){Ko.call(this,e)}Rv.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:wf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(Rv,Ko,{_transform:Ko.prototype.transform,transform(e,t){return this._transform(TB(e,t),t)}});function TB(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=xn(n).concat(xn(i)),s=OB(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=>MB(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function MB(e,t,n,i){return ri(r=>t(r)===e?n(r):NaN,i,e+"")}function OB(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(hp),t?r.slice(0,t):r}function K3(e){Tp.call(this,e)}G(K3,Tp,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(te(o),n,t,o);return(e.modified("field")||i&&t.modified(xn(i)))&&L("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(Oe(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 Nv(e){M.call(this,null,e)}Nv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(Nv,M,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=B3(e.fields,e.as||[]),o=i?(a,u)=>RB(a,u,i,r):Ap;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=te(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Oe({}));s[te(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[te(a)]))}),n}});function RB(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function J3(e){M.call(this,null,e)}G(J3,M,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Lv(e){M.call(this,null,e)}Lv.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 NB=1e-14;G(Lv,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=wv(r,e.groupby,e.field),s=(e.groupby||[]).map(lt),a=[],u=e.step||.01,l=e.probs||Yn(u/2,1-NB,u),c=l.length;return o.forEach(f=>{const d=Zx(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<s.length;++p)g[s[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],a.push(Oe(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function Q3(e){M.call(this,null,e)}G(Q3,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=te(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=Kx(r);i[te(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[te(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function Pv(e){M.call(this,[],e),this.count=0}Pv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(Pv,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[te(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)*mi()),d<s.length&&d>=u&&(f=s[d],o[te(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=te(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[te(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[te(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[te(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[te(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[te(c)])),this.count=a,this.value=n.source=s,n}});function Iv(e){M.call(this,null,e)}Iv.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"}]};G(Iv,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,Oe(o)}),n.add=t.add.concat(this.value),n}});function Z3(e){M.call(this,null,e),this.modified(!0)}G(Z3,M,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function zv(e){M.call(this,null,e)}const eT=["unit0","unit1"];zv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Ux,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:eT}]};G(zv,M,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?ll:ul)(o.unit).offset,a=e.as||eT,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(xn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=o(p),i&&(g[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}:WD({extent:e.extent||lo(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=jx(i),s=this.value||{},a=(n?ND:RD)(o,r);return a.unit=$e(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function tT(e){M.call(this,xf(),e)}G(tT,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 nT(e){M.call(this,null,e)}G(nT,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(Da(e.sort)):t.source).map(e.field))}});function LB(e,t,n,i){const r=Wc[e](t,n);return{init:r.init||zs,update:function(o,s){s[i]=r.next(o)}}}const Wc={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=Wc.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||L("ntile num must be greater than zero.");const n=Wc.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||L("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=PB(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function PB(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const IB=Object.keys(Wc);function iT(e){const t=oe(e.ops),n=oe(e.fields),i=oe(e.params),r=oe(e.aggregate_params),o=oe(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){oe(xn(g)).forEach(p=>u[p]=1)}h(e.sort),t.forEach((g,p)=>{const m=n[p],y=i[p],b=r[p]||null,x=lt(m),v=M3(g,x,o[p]);if(h(m),s.push(v),le(Wc,g))a.push(LB(g,m,y,v));else{if(m==null&&g!=="count"&&L("Null aggregate field specified."),g==="count"){c.push(v);return}d=!1;let w=l[x];w||(w=l[x]=[],w.field=m,f.push(w)),w.push(O3(g,b,v))}}),(c.length||f.length)&&(this.cell=zB(f,c,d)),this.inputs=Object.keys(u)}const rT=iT.prototype;rT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};rT.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 zB(e,t,n){e=e.map(u=>N3(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 mv;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 Bv(e){M.call(this,{},e),this._mlen=0,this._mods=[]}Bv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:IB.concat(wf)},{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}]};G(Bv,M,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=Da(e.sort),r=Fy(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new iT(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)BB(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]=L3(te),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function BB(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?ep(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||wn(-1)};t.init();for(let f=0;f<u;++f)UB(c,s,f,u),o&&jB(c,l),t.update(c,a[f])}function UB(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 jB(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 qB=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Ko,bin:yv,collect:bv,compare:P3,countpattern:xv,cross:vv,density:Ev,dotbin:Av,expression:j3,extent:Sv,facet:Tp,field:q3,filter:$v,flatten:_v,fold:Fv,formula:kv,generate:W3,impute:Dv,joinaggregate:Tv,kde:Mv,key:G3,load:H3,lookup:Ov,multiextent:V3,multivalues:Y3,params:X3,pivot:Rv,prefacet:K3,project:Nv,proxy:J3,quantile:Lv,relay:Q3,sample:Pv,sequence:Iv,sieve:Z3,subflow:Cv,timeunit:zv,tupleindex:tT,values:nT,window:Bv},Symbol.toStringTag,{value:"Module"}));function Re(e){return function(){return e}}const NS=Math.abs,Yt=Math.atan2,Ss=Math.cos,WB=Math.max,Tm=Math.min,er=Math.sin,Gs=Math.sqrt,Kt=1e-12,Tu=Math.PI,Rh=Tu/2,oT=2*Tu;function GB(e){return e>1?0:e<-1?Tu:Math.acos(e)}function LS(e){return e>=1?Rh:e<=-1?-Rh:Math.asin(e)}function Mp(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 r9(t)}function HB(e){return e.innerRadius}function VB(e){return e.outerRadius}function YB(e){return e.startAngle}function XB(e){return e.endAngle}function KB(e){return e&&e.padAngle}function JB(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<Kt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function bd(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/Gs(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,x=p-h,v=b*b+x*x,w=r-o,A=d*p-g*h,E=(x<0?-1:1)*Gs(WB(0,w*w*v-A*A)),S=(A*x-b*E)/v,C=(-A*b-x*E)/v,_=(A*x+b*E)/v,F=(-A*b+x*E)/v,O=S-m,T=C-y,k=_-m,$=F-y;return O*O+T*T>k*k+$*$&&(S=_,C=F),{cx:S,cy:C,x01:-c,y01:-f,x11:S*(r/w-1),y11:C*(r/w-1)}}function QB(){var e=HB,t=VB,n=Re(0),i=null,r=YB,o=XB,s=KB,a=null,u=Mp(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-Rh,p=o.apply(this,arguments)-Rh,m=NS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Kt))a.moveTo(0,0);else if(m>oT-Kt)a.moveTo(h*Ss(g),h*er(g)),a.arc(0,0,h,g,p,!y),d>Kt&&(a.moveTo(d*Ss(p),d*er(p)),a.arc(0,0,d,p,g,y));else{var b=g,x=p,v=g,w=p,A=m,E=m,S=s.apply(this,arguments)/2,C=S>Kt&&(i?+i.apply(this,arguments):Gs(d*d+h*h)),_=Tm(NS(h-d)/2,+n.apply(this,arguments)),F=_,O=_,T,k;if(C>Kt){var $=LS(C/d*er(S)),D=LS(C/h*er(S));(A-=$*2)>Kt?($*=y?1:-1,v+=$,w-=$):(A=0,v=w=(g+p)/2),(E-=D*2)>Kt?(D*=y?1:-1,b+=D,x-=D):(E=0,b=x=(g+p)/2)}var P=h*Ss(b),z=h*er(b),I=d*Ss(w),V=d*er(w);if(_>Kt){var ue=h*Ss(x),ie=h*er(x),he=d*Ss(v),We=d*er(v),ge;if(m<Tu)if(ge=JB(P,z,he,We,ue,ie,I,V)){var Ht=P-ge[0],ws=z-ge[1],_o=ue-ge[0],Y=ie-ge[1],pe=1/er(GB((Ht*_o+ws*Y)/(Gs(Ht*Ht+ws*ws)*Gs(_o*_o+Y*Y)))/2),ve=Gs(ge[0]*ge[0]+ge[1]*ge[1]);F=Tm(_,(d-ve)/(pe-1)),O=Tm(_,(h-ve)/(pe+1))}else F=O=0}E>Kt?O>Kt?(T=bd(he,We,P,z,h,O,y),k=bd(ue,ie,I,V,h,O,y),a.moveTo(T.cx+T.x01,T.cy+T.y01),O<_?a.arc(T.cx,T.cy,O,Yt(T.y01,T.x01),Yt(k.y01,k.x01),!y):(a.arc(T.cx,T.cy,O,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(k.cy+k.y11,k.cx+k.x11),!y),a.arc(k.cx,k.cy,O,Yt(k.y11,k.x11),Yt(k.y01,k.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,x,!y)):a.moveTo(P,z),!(d>Kt)||!(A>Kt)?a.lineTo(I,V):F>Kt?(T=bd(I,V,ue,ie,d,-F,y),k=bd(P,z,he,We,d,-F,y),a.lineTo(T.cx+T.x01,T.cy+T.y01),F<_?a.arc(T.cx,T.cy,F,Yt(T.y01,T.x01),Yt(k.y01,k.x01),!y):(a.arc(T.cx,T.cy,F,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(k.cy+k.y11,k.cx+k.x11),y),a.arc(k.cx,k.cy,F,Yt(k.y11,k.x11),Yt(k.y01,k.x01),!y))):a.arc(0,0,d,w,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-Tu/2;return[Ss(f)*c,er(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Re(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Re(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Re(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Re(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Re(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Re(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Re(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function sT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aT(e){this._context=e}aT.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 Uv(e){return new aT(e)}function uT(e){return e[0]}function lT(e){return e[1]}function cT(e,t){var n=Re(!0),i=null,r=Uv,o=null,s=Mp(a);e=typeof e=="function"?e:e===void 0?uT:Re(e),t=typeof t=="function"?t:t===void 0?lT:Re(t);function a(u){var l,c=(u=sT(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:Re(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Re(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Re(!!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 fT(e,t,n){var i=null,r=Re(!0),o=null,s=Uv,a=null,u=Mp(l);e=typeof e=="function"?e:e===void 0?uT:Re(+e),t=typeof t=="function"?t:Re(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lT:Re(+n);function l(f){var d,h,g,p=(f=sT(f)).length,m,y=!1,b,x=new Array(p),v=new Array(p);for(o==null&&(a=s(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=d-1;g>=h;--g)a.point(x[g],v[g]);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 cT().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Re(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Re(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Re(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Re(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Re(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Re(+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:Re(!!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 ZB={draw(e,t){const n=Gs(t/Tu);e.moveTo(n,0),e.arc(0,0,n,0,oT)}};function eU(e,t){let n=null,i=Mp(r);e=typeof e=="function"?e:Re(e||ZB),t=typeof t=="function"?t:Re(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:Re(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Re(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function Jo(){}function Nh(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 Op(e){this._context=e}Op.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:Nh(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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tU(e){return new Op(e)}function dT(e){this._context=e}dT.prototype={areaStart:Jo,areaEnd:Jo,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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nU(e){return new dT(e)}function hT(e){this._context=e}hT.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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iU(e){return new hT(e)}function gT(e,t){this._basis=new Op(e),this._beta=t}gT.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 rU=function e(t){function n(i){return t===1?new Op(i):new gT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Lh(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 jv(e,t){this._context=e,this._k=(1-t)/6}jv.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:Lh(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:Lh(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 oU=function e(t){function n(i){return new jv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function qv(e,t){this._context=e,this._k=(1-t)/6}qv.prototype={areaStart:Jo,areaEnd:Jo,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:Lh(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 sU=function e(t){function n(i){return new qv(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:Lh(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 aU=function e(t){function n(i){return new Wv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Gv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Kt){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>Kt){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 pT(e,t){this._context=e,this._alpha=t}pT.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:Gv(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 uU=function e(t){function n(i){return t?new pT(i,t):new jv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function mT(e,t){this._context=e,this._alpha=t}mT.prototype={areaStart:Jo,areaEnd:Jo,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:Gv(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 lU=function e(t){function n(i){return t?new mT(i,t):new qv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function yT(e,t){this._context=e,this._alpha=t}yT.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:Gv(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 cU=function e(t){function n(i){return t?new yT(i,t):new Wv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bT(e){this._context=e}bT.prototype={areaStart:Jo,areaEnd:Jo,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 fU(e){return new bT(e)}function PS(e){return e<0?-1:1}function IS(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(PS(o)+PS(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function zS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Mm(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 Ph(e){this._context=e}Ph.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:Mm(this,this._t0,zS(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,Mm(this,zS(this,n=IS(this,e,t)),n);break;default:Mm(this,this._t0,n=IS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function xT(e){this._context=new vT(e)}(xT.prototype=Object.create(Ph.prototype)).point=function(e,t){Ph.prototype.point.call(this,t,e)};function vT(e){this._context=e}vT.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 dU(e){return new Ph(e)}function hU(e){return new xT(e)}function ET(e){this._context=e}ET.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=BS(e),r=BS(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 BS(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 gU(e){return new ET(e)}function Rp(e,t){this._context=e,this._t=t}Rp.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 pU(e){return new Rp(e,.5)}function mU(e){return new Rp(e,0)}function yU(e){return new Rp(e,1)}function Vo(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 bU=()=>typeof Image<"u"?Image:null,ky=Symbol("implicit");function Hv(){var e=new uS,t=[],n=[],i=ky;function r(o){let s=e.get(o);if(s===void 0){if(i!==ky)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 uS;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 Hv(t,n).unknown(i)},us.apply(r,arguments),r}const wT=Math.PI/180,AT=180/Math.PI,Ih=18,ST=.96422,CT=1,$T=.82521,_T=4/29,yu=6/29,FT=3*yu*yu,xU=yu*yu*yu;function kT(e){if(e instanceof dr)return new dr(e.l,e.a,e.b,e.opacity);if(e instanceof Qr)return DT(e);e instanceof ip||(e=Rk(e));var t=Lm(e.r),n=Lm(e.g),i=Lm(e.b),r=Om((.2225045*t+.7168786*n+.0606169*i)/CT),o,s;return t===n&&n===i?o=s=r:(o=Om((.4360747*t+.3850649*n+.1430804*i)/ST),s=Om((.0139322*t+.0971045*n+.7141733*i)/$T)),new dr(116*r-16,500*(o-r),200*(r-s),e.opacity)}function zh(e,t,n,i){return arguments.length===1?kT(e):new dr(e,t,n,i??1)}function dr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}Fx(dr,zh,kx(Dx,{brighter(e){return new dr(this.l+Ih*(e??1),this.a,this.b,this.opacity)},darker(e){return new dr(this.l-Ih*(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=ST*Rm(t),e=CT*Rm(e),n=$T*Rm(n),new ip(Nm(3.1338561*t-1.6168667*e-.4906146*n),Nm(-.9787684*t+1.9161415*e+.033454*n),Nm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Om(e){return e>xU?Math.pow(e,1/3):e/FT+_T}function Rm(e){return e>yu?e*e*e:FT*(e-_T)}function Nm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vU(e){if(e instanceof Qr)return new Qr(e.h,e.c,e.l,e.opacity);if(e instanceof dr||(e=kT(e)),e.a===0&&e.b===0)return new Qr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*AT;return new Qr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Bh(e,t,n,i){return arguments.length===1?vU(e):new Qr(e,t,n,i??1)}function Qr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function DT(e){if(isNaN(e.h))return new dr(e.l,0,0,e.opacity);var t=e.h*wT;return new dr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Fx(Qr,Bh,kx(Dx,{brighter(e){return new Qr(this.h,this.c,this.l+Ih*(e??1),this.opacity)},darker(e){return new Qr(this.h,this.c,this.l-Ih*(e??1),this.opacity)},rgb(){return DT(this).rgb()}}));var TT=-.14861,Vv=1.78277,Yv=-.29227,Np=-.90649,Gc=1.97294,US=Gc*Np,jS=Gc*Vv,qS=Vv*Yv-Np*TT;function EU(e){if(e instanceof Ks)return new Ks(e.h,e.s,e.l,e.opacity);e instanceof ip||(e=Rk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(qS*i+US*t-jS*n)/(qS+US-jS),o=i-r,s=(Gc*(n-r)-Yv*o)/Np,a=Math.sqrt(s*s+o*o)/(Gc*r*(1-r)),u=a?Math.atan2(s,o)*AT-120:NaN;return new Ks(u<0?u+360:u,a,r,e.opacity)}function Dy(e,t,n,i){return arguments.length===1?EU(e):new Ks(e,t,n,i??1)}function Ks(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Fx(Ks,Dy,kx(Dx,{brighter(e){return e=e==null?tS:Math.pow(tS,e),new Ks(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?eS:Math.pow(eS,e),new Ks(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*wT,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new ip(255*(t+n*(TT*i+Vv*r)),255*(t+n*(Yv*i+Np*r)),255*(t+n*(Gc*i)),this.opacity)}}));function wU(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function AU(e,t){var n=rp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function MT(e){return function(t,n){var i=e((t=gy(t)).h,(n=gy(n)).h),r=en(t.s,n.s),o=en(t.l,n.l),s=en(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 SU=MT(rp);var CU=MT(en);function $U(e,t){var n=en((e=zh(e)).l,(t=zh(t)).l),i=en(e.a,t.a),r=en(e.b,t.b),o=en(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 OT(e){return function(t,n){var i=e((t=Bh(t)).h,(n=Bh(n)).h),r=en(t.c,n.c),o=en(t.l,n.l),s=en(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 _U=OT(rp);var FU=OT(en);function RT(e){return function t(n){n=+n;function i(r,o){var s=e((r=Dy(r)).h,(o=Dy(o)).h),a=en(r.s,o.s),u=en(r.l,o.l),l=en(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 kU=RT(rp);var DU=RT(en);function Xv(e,t){t===void 0&&(t=e,e=yf);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 TU(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const MU=Object.freeze(Object.defineProperty({__proto__:null,interpolate:yf,interpolateArray:V8,interpolateBasis:Y8,interpolateBasisClosed:X8,interpolateCubehelix:kU,interpolateCubehelixLong:DU,interpolateDate:K8,interpolateDiscrete:wU,interpolateHcl:_U,interpolateHclLong:FU,interpolateHsl:SU,interpolateHslLong:CU,interpolateHue:AU,interpolateLab:$U,interpolateNumber:J8,interpolateNumberArray:Q8,interpolateObject:Z8,interpolateRgb:e9,interpolateRgbBasis:t9,interpolateRgbBasisClosed:n9,interpolateRound:tp,interpolateString:i9,interpolateTransformCss:o9,interpolateTransformSvg:s9,interpolateZoom:a9,piecewise:Xv,quantize:TU},Symbol.toStringTag,{value:"Module"}));function NT(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,QA),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return NT(e).unknown(t)},e=arguments.length?Array.from(e,QA):[0,1],rl(n)}function LT(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 WS(e){return Math.log(e)}function GS(e){return Math.exp(e)}function OU(e){return-Math.log(-e)}function RU(e){return-Math.exp(-e)}function NU(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LU(e){return e===10?NU:e===Math.E?Math.exp:t=>Math.pow(e,t)}function PU(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 HS(e){return(t,n)=>-e(-t,n)}function Kv(e){const t=e(WS,GS),n=t.domain;let i=10,r,o;function s(){return r=PU(i),o=LU(i),n()[0]<0?(r=HS(r),o=HS(o),e(OU,RU)):e(WS,GS),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),g,p;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(g=1;g<i;++g)if(p=d<0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(p=d>0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}y.length*2<m&&(y=ZA(l,c,m))}else y=ZA(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=hy(u)).precision==null&&(u.trim=!0),u=Ok(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(LT(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function PT(){const e=Kv(_x()).domain([1,10]);return e.copy=()=>np(e,PT()).base(e.base()),us.apply(e,arguments),e}function VS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function YS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Jv(e){var t=1,n=e(VS(t),YS(t));return n.constant=function(i){return arguments.length?e(VS(t=+i),YS(t)):t},rl(n)}function IT(){var e=Jv(_x());return e.copy=function(){return np(e,IT()).constant(e.constant())},us.apply(e,arguments)}function XS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function IU(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zU(e){return e<0?-e*e:e*e}function Qv(e){var t=e(No,No),n=1;function i(){return n===1?e(No,No):n===.5?e(IU,zU):e(XS(n),XS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},rl(t)}function Zv(){var e=Qv(_x());return e.copy=function(){return np(e,Zv()).exponent(e.exponent())},us.apply(e,arguments),e}function BU(){return Zv.apply(null,arguments).exponent(.5)}function zT(){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]=vD(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[Cu(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(Ic),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 zT().domain(e).range(t).unknown(i)},us.apply(o,arguments)}function BT(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[Cu(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 BT().domain([e,t]).range(r).unknown(o)},us.apply(rl(s),arguments)}function UU(e){return new Date(e)}function jU(e){return e instanceof Date?+e:+new Date(+e)}function e2(e,t,n,i,r,o,s,a,u,l){var c=B8(),f=c.invert,d=c.domain,h=l(".%L"),g=l(":%S"),p=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),v=l("%Y");function w(A){return(u(A)<A?h:a(A)<A?g:s(A)<A?p:o(A)<A?m:i(A)<A?r(A)<A?y:b:n(A)<A?x:v)(A)}return c.invert=function(A){return new Date(f(A))},c.domain=function(A){return arguments.length?d(Array.from(A,jU)):d().map(UU)},c.ticks=function(A){var E=d();return e(E[0],E[E.length-1],A??10)},c.tickFormat=function(A,E){return E==null?w:l(E)},c.nice=function(A){var E=d();return(!A||typeof A.range!="function")&&(A=t(E[0],E[E.length-1],A??10)),A?d(LT(E,A)):c},c.copy=function(){return np(c,e2(e,t,n,i,r,o,s,a,u,l))},c}function qU(){return us.apply(e2($I,_I,br,Bc,sl,no,yp,pp,Jr,Wx).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function WU(){return us.apply(e2(SI,CI,xr,Uc,al,Go,bp,mp,Jr,Gx).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lp(){var e=0,t=1,n,i,r,o,s=No,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,g;return arguments.length?([h,g]=d,s=f(h,g),l):[s(0),s(1)]}}return l.range=c(yf),l.rangeRound=c(tp),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 cs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function t2(){var e=rl(Lp()(No));return e.copy=function(){return cs(e,t2())},ls.apply(e,arguments)}function UT(){var e=Kv(Lp()).domain([1,10]);return e.copy=function(){return cs(e,UT()).base(e.base())},ls.apply(e,arguments)}function jT(){var e=Jv(Lp());return e.copy=function(){return cs(e,jT()).constant(e.constant())},ls.apply(e,arguments)}function n2(){var e=Qv(Lp());return e.copy=function(){return cs(e,n2()).exponent(e.exponent())},ls.apply(e,arguments)}function GU(){return n2.apply(null,arguments).exponent(.5)}function Pp(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=No,c,f=!1,d;function h(p){return isNaN(p=+p)?d:(p=.5+((p=+c(p))-o)*(i*p<i*o?a:u),l(f?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,n]=p,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(p){return arguments.length?(f=!!p,h):f},h.interpolator=function(p){return arguments.length?(l=p,h):l};function g(p){return function(m){var y,b,x;return arguments.length?([y,b,x]=m,l=Xv(p,[y,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=g(yf),h.rangeRound=g(tp),h.unknown=function(p){return arguments.length?(d=p,h):d},function(p){return c=p,r=p(e),o=p(t),s=p(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function qT(){var e=rl(Pp()(No));return e.copy=function(){return cs(e,qT())},ls.apply(e,arguments)}function WT(){var e=Kv(Pp()).domain([.1,1,10]);return e.copy=function(){return cs(e,WT()).base(e.base())},ls.apply(e,arguments)}function GT(){var e=Jv(Pp());return e.copy=function(){return cs(e,GT()).constant(e.constant())},ls.apply(e,arguments)}function i2(){var e=Qv(Pp());return e.copy=function(){return cs(e,i2()).exponent(e.exponent())},ls.apply(e,arguments)}function HU(){return i2.apply(null,arguments).exponent(.5)}function $r(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 VU=$r("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),YU=$r("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),XU=$r("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),KU=$r("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),JU=$r("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),QU=$r("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ZU=$r("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ej=$r("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),tj=$r("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),nj=$r("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function r2(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const ij="identity",Mu="linear",fo="log",Af="pow",Sf="sqrt",Ip="symlog",aa="time",ua="utc",hr="sequential",fl="diverging",Ou="quantile",zp="quantize",Bp="threshold",o2="ordinal",Ty="point",HT="band",s2="bin-ordinal",wt="continuous",Cf="discrete",$f="discretizing",vi="interpolating",a2="temporal";function rj(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 oj(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 u2(){const e=Hv().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],g=r2(f,a,u);let p=i[d-0];r=(h-p)/(g||1),s&&(r=Math.floor(r)),p+=(h-p-r*(f-a))*l,o=r*(1-a),s&&(p=Math.round(p),o=Math.round(o));const m=Yn(f).map(y=>p+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(),g=h.length-1;let p=+f[0],m=+f[1],y,b,x;if(!(p!==p||m!==m)&&(m<p&&(x=p,p=m,m=x),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Cu(h,p)-1),b=p===m?y:Cu(h,m)-1,p-h[y]>o+1e-10&&++y,d&&(x=y,y=g-b,b=g-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 u2().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function VT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return VT(t())},e}function sj(){return VT(u2().paddingInner(1))}var aj=Array.prototype.map;function uj(e){return aj.call(e,mn)}const lj=Array.prototype.slice;function YT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Cu(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=uj(i),n):e.slice()},n.range=function(i){return arguments.length?(t=lj.call(i),n):t.slice()},n.tickFormat=function(i,r){return q8(e[0],$e(e),i??10,r)},n.copy=function(){return YT().domain(n.domain()).range(n.range())},n}const Uh=new Map,XT=Symbol("vega_scale");function KT(e){return e[XT]=!0,e}function KS(e){return e&&e[XT]===!0}function cj(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?rj(o):o.invertExtent?oj(o):void 0),o.type=e,KT(o)};return i.metadata=yr(oe(n)),i}function Me(e,t,n){return arguments.length>1?(Uh.set(e,cj(e,t,n)),this):JT(e)?Uh.get(e):void 0}Me(ij,NT);Me(Mu,U8,wt);Me(fo,PT,[wt,fo]);Me(Af,Zv,wt);Me(Sf,BU,wt);Me(Ip,IT,wt);Me(aa,qU,[wt,a2]);Me(ua,WU,[wt,a2]);Me(hr,t2,[wt,vi]);Me(`${hr}-${Mu}`,t2,[wt,vi]);Me(`${hr}-${fo}`,UT,[wt,vi,fo]);Me(`${hr}-${Af}`,n2,[wt,vi]);Me(`${hr}-${Sf}`,GU,[wt,vi]);Me(`${hr}-${Ip}`,jT,[wt,vi]);Me(`${fl}-${Mu}`,qT,[wt,vi]);Me(`${fl}-${fo}`,WT,[wt,vi,fo]);Me(`${fl}-${Af}`,i2,[wt,vi]);Me(`${fl}-${Sf}`,HU,[wt,vi]);Me(`${fl}-${Ip}`,GT,[wt,vi]);Me(Ou,zT,[$f,Ou]);Me(zp,BT,$f);Me(Bp,j8,$f);Me(s2,YT,[Cf,$f]);Me(o2,Hv,Cf);Me(HT,u2,Cf);Me(Ty,sj,Cf);function JT(e){return Uh.has(e)}function Ma(e,t){const n=Uh.get(e);return n&&n.metadata[t]}function l2(e){return Ma(e,wt)}function Ru(e){return Ma(e,Cf)}function My(e){return Ma(e,$f)}function QT(e){return Ma(e,fo)}function fj(e){return Ma(e,a2)}function ZT(e){return Ma(e,vi)}function eM(e){return Ma(e,Ou)}const dj=["clamp","base","constant","exponent"];function tM(e,t){const n=t[0],i=$e(t)-n;return function(r){return e(n+r*i)}}function Up(e,t,n){return Xv(c2(t||"rgb",n),e)}function nM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function iM(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?wn(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=Me(o)().domain([t,n]).range([0,1]),dj.forEach(a=>e[a]?s[a](e[a]()):0),s)}function c2(e,t){const n=MU[hj(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function hj(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const gj={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"},pj={accent:YU,category10:VU,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:XU,observable10:KU,paired:JU,pastel1:QU,pastel2:ZU,set1:ej,set2:tj,set3:nj,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function rM(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 oM(e,t){for(const n in e)f2(n,t(e[n]))}const JS={};oM(pj,rM);oM(gj,e=>Up(rM(e)));function f2(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(JS[e]=t,this):JS[e]}const nh="symbol",mj="discrete",yj="gradient",bj=e=>Z(e)?e.map(t=>String(t)):String(e),xj=(e,t)=>e[1]-t[1],vj=(e,t)=>t[1]-e[1];function d2(e,t,n){let i;return sa(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(gp(e.domain())/n||1)+1))),me(t)&&(i=t.step,t=t.interval),Ke(t)&&(t=e.type===aa?ul(t):e.type==ua?ll(t):L("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function sM(e,t,n){let i=e.range(),r=i[0],o=$e(i),s=xj;if(r>o&&(i=o,o=r,r=i,s=vj),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],$e(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function h2(e,t){return e.bins?sM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function aM(e,t,n,i,r,o){const s=t.type;let a=bj;if(s===aa||r===aa)a=e.timeFormat(i);else if(s===ua||r===ua)a=e.utcFormat(i);else if(QT(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=uM(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 uM(e,t,n){const i=h2(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 Oy={[Ou]:"quantiles",[zp]:"thresholds",[Bp]:"domain"},lM={[Ou]:"quantiles",[zp]:"domain"};function cM(e,t){return e.bins?Aj(e.bins):e.type===fo?uM(e,t,!0):Oy[e.type]?wj(e[Oy[e.type]]()):h2(e,t)}function Ej(e,t,n){const i=t[lM[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,3*10,n)}function wj(e){const t=[-1/0].concat(e);return t.max=1/0,t}function Aj(e){const t=e.slice(0,-1);return t.max=$e(e),t}const Sj=e=>Oy[e.type]||e.bins;function fM(e,t,n,i,r,o,s){const a=lM[t.type]&&o!==aa&&o!==ua?Ej(e,t,r):aM(e,t,n,r,o,s);return i===nh&&Sj(t)?Cj(a):i===mj?$j(a):_j(a)}const Cj=e=>(t,n,i)=>{const r=QS(i[n+1],QS(i.max,1/0)),o=ZS(t,e),s=ZS(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},QS=(e,t)=>e??t,$j=e=>(t,n)=>n?e(t):null,_j=e=>t=>e(t),ZS=(e,t)=>Number.isFinite(e)?t(e):null;function Fj(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+$e(t),o=r-i;if(e.type===Bp){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function kj(e,t,n,i){const r=i||t.type;return Ke(n)&&fj(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===aa?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===ua?e.utcFormat("%A, %d %B %Y, %X UTC"):fM(e,t,5,null,n,i,!0)}function dM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=kj(e,t,n.format,n.formatType);if(My(t.type)){const o=cM(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(Ru(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($e(o))}`}}let hM=0;function Dj(){hM=0}const jh="p_";function g2(e){return e&&e.gradient}function gM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?jh:"";return r||(r=e.id="gradient_"+hM++,i==="radial"?(e.x1=tr(e.x1,.5),e.y1=tr(e.y1,.5),e.r1=tr(e.r1,0),e.x2=tr(e.x2,.5),e.y2=tr(e.y2,.5),e.r2=tr(e.r2,.5),o=jh):(e.x1=tr(e.x1,0),e.y1=tr(e.y1,0),e.x2=tr(e.x2,1),e.y2=tr(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function tr(e,t){return e??t}function pM(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 eC={basis:{curve:tU},"basis-closed":{curve:nU},"basis-open":{curve:iU},bundle:{curve:rU,tension:"beta",value:.85},cardinal:{curve:oU,tension:"tension",value:0},"cardinal-open":{curve:aU,tension:"tension",value:0},"cardinal-closed":{curve:sU,tension:"tension",value:0},"catmull-rom":{curve:uU,tension:"alpha",value:.5},"catmull-rom-closed":{curve:lU,tension:"alpha",value:.5},"catmull-rom-open":{curve:cU,tension:"alpha",value:.5},linear:{curve:Uv},"linear-closed":{curve:fU},monotone:{horizontal:hU,vertical:dU},natural:{curve:gU},step:{curve:pU},"step-after":{curve:yU},"step-before":{curve:mU}};function p2(e,t,n){var i=le(eC,e)&&eC[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const Tj={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Mj=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Oj=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Rj=/^((\s+,?\s*)|(,\s*))/,Nj=/^[01]/;function Nu(e){const t=[];return(e.match(Mj)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=Tj[o],a=Lj(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 Lj(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)?Nj:Oj,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(Rj);u!==null&&(r+=u[0].length)}return i}const Qo=Math.PI/180,Pj=1e-14,Us=Math.PI/2,ar=Math.PI*2,Ka=Math.sqrt(3)/2;var Pm={},Im={},mM=[].join;function Ij(e,t,n,i,r,o,s,a,u){const l=mM.call(arguments);if(Pm[l])return Pm[l];const c=s*Qo,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,g=d*(u-t)*.5-f*(a-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,x=d/i,v=m*a+y*u,w=b*a+x*u,A=m*e+y*t,E=b*e+x*t;let C=1/((A-v)*(A-v)+(E-w)*(E-w))-.25;C<0&&(C=0);let _=Math.sqrt(C);o==r&&(_=-_);const F=.5*(v+A)-_*(E-w),O=.5*(w+E)+_*(A-v),T=Math.atan2(w-O,v-F);let $=Math.atan2(E-O,A-F)-T;$<0&&o===1?$+=ar:$>0&&o===0&&($-=ar);const D=Math.ceil(Math.abs($/(Us+.001))),P=[];for(let z=0;z<D;++z){const I=T+z*$/D,V=T+(z+1)*$/D;P[z]=[F,O,I,V,n,i,f,d]}return Pm[l]=P}function zj(e){const t=mM.call(e);if(Im[t])return Im[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,g=Math.cos(r),p=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),w=n+g-v*p,A=i+p+v*g,E=n+m,S=i+y,C=E+v*y,_=S-v*m;return Im[t]=[c*w+f*A,d*w+h*A,c*C+f*_,d*C+h*_,c*E+f*S,d*E+h*S]}const oi=["l",0,0,0,0,0,0,0];function Bj(e,t,n){const i=oi[0]=e[0];if(i==="a"||i==="A")oi[1]=t*e[1],oi[2]=n*e[2],oi[3]=e[3],oi[4]=e[4],oi[5]=e[5],oi[6]=t*e[6],oi[7]=n*e[7];else if(i==="h"||i==="H")oi[1]=t*e[1];else if(i==="v"||i==="V")oi[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)oi[r]=(r%2==1?t:n)*e[r];return oi}function Hc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,g,p,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=Bj(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-g,f=2*l-p):a[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=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":tC(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":tC(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 tC(e,t,n,i){const r=Ij(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=zj(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const nC=.5773502691896257,iC={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ar)}},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=Ka*n,r=i-n*nC,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=Ka*n,r=i-n*nC;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=Ka*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=Ka*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=Ka*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=Ka*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 yM(e){return le(iC,e)?iC[e]:Uj(e)}var zm={};function Uj(e){if(!le(zm,e)){const t=Nu(e);zm[e]={draw:function(n,i){Hc(n,t,0,0,Math.sqrt(i)/2)}}}return zm[e]}const Fo=.448084975506;function jj(e){return e.x}function qj(e){return e.y}function Wj(e){return e.width}function Gj(e){return e.height}function Ir(e){return typeof e=="function"?e:()=>+e}function xd(e,t,n){return Math.max(t,Math.min(e,n))}function bM(){var e=jj,t=qj,n=Wj,i=Gj,r=Ir(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,x=xd(+r.call(this,c),0,b),v=xd(+o.call(this,c),0,b),w=xd(+s.call(this,c),0,b),A=xd(+a.call(this,c),0,b);if(u||(u=h=Tx()),x<=0&&v<=0&&w<=0&&A<=0)u.rect(g,p,m,y);else{var E=g+m,S=p+y;u.moveTo(g+x,p),u.lineTo(E-v,p),u.bezierCurveTo(E-Fo*v,p,E,p+Fo*v,E,p+v),u.lineTo(E,S-A),u.bezierCurveTo(E,S-Fo*A,E-Fo*A,S,E-A,S),u.lineTo(g+w,S),u.bezierCurveTo(g+Fo*w,S,g,S-Fo*w,g,S-w),u.lineTo(g,p+x),u.bezierCurveTo(g,p+Fo*x,g+Fo*x,p,g+x,p),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 xM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const g=h/2;if(o){var p=a-d,m=f-s;if(p||m){var y=Math.hypot(p,m),b=(p/=y)*u,x=(m/=y)*u,v=Math.atan2(m,p);r.moveTo(s-b,a-x),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,v-Math.PI,v),r.lineTo(s+b,a+x),r.arc(s,a,u,v,v+Math.PI)}else r.arc(f,d,g,0,ar);r.closePath()}else o=1;s=f,a=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=Tx()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(o=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,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 _f(e,t){return e??t}const Ff=e=>e.x||0,kf=e=>e.y||0,Hj=e=>e.width||0,Vj=e=>e.height||0,Yj=e=>(e.x||0)+(e.width||0),Xj=e=>(e.y||0)+(e.height||0),Kj=e=>e.startAngle||0,Jj=e=>e.endAngle||0,Qj=e=>e.padAngle||0,Zj=e=>e.innerRadius||0,eq=e=>e.outerRadius||0,tq=e=>e.cornerRadius||0,nq=e=>_f(e.cornerRadiusTopLeft,e.cornerRadius)||0,iq=e=>_f(e.cornerRadiusTopRight,e.cornerRadius)||0,rq=e=>_f(e.cornerRadiusBottomRight,e.cornerRadius)||0,oq=e=>_f(e.cornerRadiusBottomLeft,e.cornerRadius)||0,sq=e=>_f(e.size,64),aq=e=>e.size||1,jp=e=>e.defined!==!1,uq=e=>yM(e.shape||"circle"),lq=QB().startAngle(Kj).endAngle(Jj).padAngle(Qj).innerRadius(Zj).outerRadius(eq).cornerRadius(tq),cq=fT().x(Ff).y1(kf).y0(Xj).defined(jp),fq=fT().y(kf).x1(Ff).x0(Yj).defined(jp),dq=cT().x(Ff).y(kf).defined(jp),hq=bM().x(Ff).y(kf).width(Hj).height(Vj).cornerRadius(nq,iq,rq,oq),gq=eU().type(uq).size(sq),pq=xM().x(Ff).y(kf).defined(jp).size(aq);function m2(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function mq(e,t){return lq.context(e)(t)}function yq(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?fq:cq).curve(p2(i,n.orient,n.tension)).context(e)(t)}function bq(e,t){const n=t[0],i=n.interpolate||"linear";return dq.curve(p2(i,n.orient,n.tension)).context(e)(t)}function dl(e,t,n,i){return hq.context(e)(t,n,i)}function xq(e,t){return(t.mark.shape||t.shape).context(e)(t)}function vq(e,t){return gq.context(e)(t)}function Eq(e,t){return pq.context(e)(t)}var vM=1;function EM(){vM=1}function y2(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+vM++),s=r.clipping[o]||(r.clipping[o]={id:o});return be(i)?s.path=i(null):m2(n)?s.path=dl(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function pt(e){this.clear(),e&&this.union(e)}pt.prototype={clone(){return new pt(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 qp(e){this.mark=e,this.bounds=this.bounds||new pt}function Wp(e){qp.call(this,e),this.items=this.items||[]}G(Wp,qp);class wM{constructor(t){this._pending=0,this._loader=t||vp()}pending(){return this._pending}sanitizeURL(t){const n=this;return rC(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Il(n),i)).catch(()=>(Il(n),null))}loadImage(t){const n=this,i=bU();return rC(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=le(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>Il(n),s.onerror=()=>Il(n),s.src=o,s}).catch(r=>(Il(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 rC(e){e._pending+=1}function Il(e){e._pending-=1}function bo(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?wq(t,i):0))}return e}function wq(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const Aq=ar-1e-8;let Gp,ih,rh,Hs,Ry,oh,Ny,Ly;const Lo=(e,t)=>Gp.add(e,t),sh=(e,t)=>Lo(ih=e,rh=t),oC=e=>Lo(e,Gp.y1),sC=e=>Lo(Gp.x1,e),js=(e,t)=>Ry*e+Ny*t,qs=(e,t)=>oh*e+Ly*t,Bm=(e,t)=>Lo(js(e,t),qs(e,t)),Um=(e,t)=>sh(js(e,t),qs(e,t));function Df(e,t){return Gp=e,t?(Hs=t*Qo,Ry=Ly=Math.cos(Hs),oh=Math.sin(Hs),Ny=-oh):(Ry=Ly=1,Hs=oh=Ny=0),Sq}const Sq={beginPath(){},closePath(){},moveTo:Um,lineTo:Um,rect(e,t,n,i){Hs?(Bm(e+n,t),Bm(e+n,t+i),Bm(e,t+i),Um(e,t)):(Lo(e+n,t+i),sh(e,t))},quadraticCurveTo(e,t,n,i){const r=js(e,t),o=qs(e,t),s=js(n,i),a=qs(n,i);aC(ih,r,s,oC),aC(rh,o,a,sC),sh(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=js(e,t),a=qs(e,t),u=js(n,i),l=qs(n,i),c=js(r,o),f=qs(r,o);uC(ih,s,u,c,oC),uC(rh,a,l,f,sC),sh(c,f)},arc(e,t,n,i,r,o){if(i+=Hs,r+=Hs,ih=n*Math.cos(r)+e,rh=n*Math.sin(r)+t,Math.abs(r-i)>Aq)Lo(e-n,t-n),Lo(e+n,t+n);else{const s=l=>Lo(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%ar,i<0&&(i+=ar),r=r%ar,r<0&&(r+=ar),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=ar,a=i-i%Us,u=0;u<4&&a>r;++u,a-=Us)s(a);else for(a=i-i%Us+Us,u=0;u<4&&a<r;++u,a=a+Us)s(a)}}};function aC(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function uC(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)>Pj?(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(lC(u,e,t,n,i)),0<l&&l<1&&r(lC(l,e,t,n,i))}function lC(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 Yo=(Yo=Vo(1,1))?Yo.getContext("2d"):null;const Py=new pt;function b2(e){return function(t,n){if(!Yo)return!0;e(Yo,t),Py.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=Py;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Yo.isPointInPath(u,a))return!0;return!1}}function x2(e,t){return t.contains(e.x||0,e.y||0)}function AM(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(Py.set(n,i,n+r,i+o))}function SM(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 lu(t,n,i,r,o)}function lu(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,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(o-t)),m===1&&(h=l,g=a-t),m===2&&(h=-c,g=-(s-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function Lu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Si(e,t){return e??t}function cC(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function Cq(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=Vo(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=cC(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return cC(o,t.stops)}function CM(e,t,n){return g2(n)?Cq(e,n,t.bounds):n}function qh(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=CM(e,t,t.fill),!0):!1}var $q=[];function Pu(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=CM(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||$q),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function _q(e,t){return e.zindex-t.zindex||e.index-t.index}function v2(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(_q)}function zi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=v2(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 Wh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=v2(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){zi(n,r=>{(!i||i.intersects(r.bounds))&&$M(e,t,r,r)})}}function Fq(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&$M(e,t,n.items[0],n.items)}}function $M(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Lu(t,n),n.fill&&qh(t,n,r)&&t.fill(),n.stroke&&Pu(t,n,r)&&t.stroke()))}function Hp(e){return e=e||Pi,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Wh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Tf(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 w2(e){return Hp(Tf(e))}function Js(e,t){return"translate("+e+","+t+")"}function A2(e){return"rotate("+e+")"}function kq(e,t){return"scale("+e+","+t+")"}function _M(e){return Js(e.x||0,e.y||0)}function Dq(e){return Js(e.x||0,e.y||0)+(e.angle?" "+A2(e.angle):"")}function Tq(e){return Js(e.x||0,e.y||0)+(e.angle?" "+A2(e.angle):"")+(e.scaleX||e.scaleY?" "+kq(e.scaleX||1,e.scaleY||1):"")}function S2(e,t,n){function i(s,a){s("transform",Dq(a)),s("d",t(null,a))}function r(s,a){return t(Df(s,a.angle),a),bo(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*=Qo),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:w2(o),isect:n||b2(o)}}var Mq=S2("arc",mq);function Oq(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 Rq(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 Nq(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 C2(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(Df(u),c),bo(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Tf(o);function a(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:Fq(o),pick:a,isect:x2,tip:n}}var Lq=C2("area",yq,Oq);function Pq(e,t){var n=t.clip;e.save(),be(n)?(e.beginPath(),n(e),e.clip()):FM(e,t.group)}function FM(e,t){e.beginPath(),m2(t)?dl(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function kM(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 Iq(e,t){e("transform",_M(t))}function DM(e,t){const n=kM(t);e("d",dl(null,t,n,n))}function zq(e,t){e("class","background"),e("aria-hidden",!0),DM(e,t)}function Bq(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?DM(e,t):e("d","")}function Uq(e,t,n){const i=t.clip?y2(n,t,t):null;e("clip-path",i)}function jq(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),bo(e,t),e.translate(t.x||0,t.y||0)}function Vc(e,t,n,i){const r=kM(t);e.beginPath(),dl(e,t,(n||0)+r,(i||0)+r)}const qq=Tf(Vc),Wq=Tf(Vc,!1),Gq=Tf(Vc,!0);function Hq(e,t,n,i){zi(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&&(Vc(e,r,o,s),Lu(e,r),r.fill&&qh(e,r,u)&&e.fill(),r.stroke&&!a&&Pu(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&FM(e,r),n&&n.translate(-o,-s),zi(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&&(Vc(e,r,o,s),Lu(e,r),Pu(e,r,u)&&e.stroke())})}function Vq(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 Wh(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),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||o<f||o>g))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,p&&m2(u)&&!Gq(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&Wq(e,u,s,a)?(e.restore(),u):(l=Wh(u,b=>Yq(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&qq(e,u,s,a)&&(l=u),e.restore(),l||null)})}function Yq(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var Xq={type:"group",tag:"g",nested:!1,attr:Iq,bound:jq,draw:Hq,pick:Vq,isect:AM,content:Uq,background:zq,foreground:Bq},Yc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function $2(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 _2(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 F2(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 Vp(e,t){return e==="center"?t/2:e==="right"?t:0}function Yp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function Kq(e,t,n){const i=$2(t,n),r=_2(t,i),o=F2(t,i),s=(t.x||0)-Vp(t.align,r),a=(t.y||0)-Yp(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Yc["xmlns:xlink"],"xlink:href"),e("transform",Js(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function Jq(e,t){const n=t.image,i=_2(t,n),r=F2(t,n),o=(t.x||0)-Vp(t.align,i),s=(t.y||0)-Yp(t.baseline,r);return e.set(o,s,o+i,s+r)}function Qq(e,t,n){zi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=$2(i,this);let o=_2(i,r),s=F2(i,r);if(o===0||s===0)return;let a=(i.x||0)-Vp(i.align,o),u=(i.y||0)-Yp(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)&&(Lu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var Zq={type:"image",tag:"image",nested:!1,attr:Kq,bound:Jq,draw:Qq,pick:Hp(),isect:Pi,get:$2,xOffset:Vp,yOffset:Yp},eW=C2("line",bq,Rq);function tW(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",Tq(t)),e("d",t.path)}function ah(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)*Qo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=Nu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),Hc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):Hc(e,u,i,r,o,s)}function nW(e,t){return ah(Df(e,t.angle),t)?e.set(0,0,0,0):bo(e,t,!0)}var iW={type:"path",tag:"path",nested:!1,attr:tW,bound:nW,draw:E2(ah),pick:w2(ah),isect:b2(ah)};function rW(e,t){e("d",dl(null,t))}function oW(e,t){var n,i;return bo(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function fC(e,t){e.beginPath(),dl(e,t)}var sW={type:"rect",tag:"path",nested:!1,attr:rW,bound:oW,draw:E2(fC),pick:w2(fC),isect:AM};function aW(e,t){e("transform",_M(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function uW(e,t){var n,i;return bo(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function TM(e,t,n){var i,r,o,s;return t.stroke&&Pu(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 lW(e,t,n){zi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&TM(e,i,r)&&(Lu(e,i),e.stroke())}})}function cW(e,t,n,i){return e.isPointInStroke?TM(e,t,1)&&e.isPointInStroke(n,i):!1}var fW={type:"rule",tag:"line",nested:!1,attr:aW,bound:uW,draw:lW,pick:Hp(cW),isect:SM},dW=S2("shape",xq),hW=S2("symbol",vq,x2);const dC=WP();var Jn={height:_r,measureWidth:k2,estimateWidth:Gh,width:Gh,canvas:MM};MM(!0);function MM(e){Jn.width=e&&Yo?k2:Gh}function Gh(e,t){return OM(es(e,t),_r(e))}function OM(e,t){return~~(.8*e.length*t)}function k2(e,t){return _r(e)<=0||!(t=es(e,t))?0:RM(t,Xp(e))}function RM(e,t){const n=`(${t}) ${e}`;let i=dC.get(n);return i===void 0&&(Yo.font=t,i=Yo.measureText(e).width,dC.set(n,i)),i}function _r(e){return e.fontSize!=null?+e.fontSize||0:11}function Zo(e){return e.lineHeight!=null?e.lineHeight:_r(e)+2}function gW(e){return Z(e)?e.length>1?e:e[0]:e}function Mf(e){return gW(e.lineBreak&&e.text&&!Z(e.text)?e.text.split(e.lineBreak):e.text)}function D2(e){const t=Mf(e);return(Z(t)?t.length-1:0)*Zo(e)}function es(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?mW(e,n):n}function pW(e){if(Jn.width===k2){const t=Xp(e);return n=>RM(n,t)}else if(Jn.width===Gh){const t=_r(e);return n=>OM(n,t)}else return t=>Jn.width(e,t)}function mW(e,t){var n=+e.limit,i=pW(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 Of(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xp(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+_r(e)+"px "+Of(e,t)}function T2(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*Zo(e):t==="line-bottom"?.29*n-.5*Zo(e):0)}const yW={left:"start",center:"middle",right:"end"},Ac=new pt;function Kp(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Us,t+=i*Math.cos(r),n+=i*Math.sin(r)),Ac.x1=t,Ac.y1=n,Ac}function bW(e,t){var n=t.dx||0,i=(t.dy||0)+T2(t),r=Kp(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",yW[t.align]||"start"),a?(u=Js(o,s)+" "+A2(a),(n||i)&&(u+=" "+Js(n,i))):u=Js(o+n,s+i),e("transform",u)}function M2(e,t,n){var i=Jn.height(t),r=t.align,o=Kp(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+T2(t)-Math.round(.8*i),c=Mf(t),f;if(Z(c)?(i+=Zo(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Jn.width(t,h)),0)):f=Jn.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*Qo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Qo,s,a);return e}function xW(e,t,n){zi(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=Xp(i),e.textAlign=i.align||"left",o=Kp(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Qo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+T2(i),c=Mf(i),Lu(e,i),Z(c))for(l=Zo(i),u=0;u<c.length;++u)f=es(i,c[u]),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Pu(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=es(i,c),i.fill&&qh(e,i,r)&&e.fillText(f,s,a),i.stroke&&Pu(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function vW(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Kp(t),a=s.x1,u=s.y1,l=M2(Ac,t,1),c=-t.angle*Qo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),g=d*r+f*o+(u-d*a-f*u);return l.contains(h,g)}function EW(e,t){const n=M2(Ac,e,2);return lu(t,n[0],n[1],n[2],n[3])||lu(t,n[0],n[1],n[4],n[5])||lu(t,n[4],n[5],n[6],n[7])||lu(t,n[2],n[3],n[6],n[7])}var wW={type:"text",tag:"text",nested:!1,attr:bW,bound:M2,draw:xW,pick:Hp(vW),isect:EW},AW=C2("trail",Eq,Nq),ni={arc:Mq,area:Lq,group:Xq,image:Zq,line:eW,path:iW,rect:sW,rule:fW,shape:dW,symbol:hW,text:wW,trail:AW};function Iy(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 pt),e,n)}var hC={mark:null};function NM(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]:(hC.mark=e,l=hC),c=Iy(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new pt,s)for(a=0,u=o.length;a<u;++a)t.union(Iy(o[a],r,n));return e.bounds=t}const SW=["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 LM(e,t){return JSON.stringify(e,SW,t)}function PM(e){const t=typeof e=="string"?JSON.parse(e):e;return IM(t)}function IM(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"&&IM(n[r]);return t&&NM(e),e}class zM{constructor(t){arguments.length?this.root=PM(t):(this.root=gC({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Wp(this.root)])}toJSON(t){return LM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=gC(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function gC(e,t){const n={bounds:new pt,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 Po(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function O2(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 yt(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=Po(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function ai(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function BM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Jp(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function CW(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=ni[r.marktype]).tip){for(s=Jp(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 R2=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||vp(),this._tooltip=n||$W}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=Po(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=CW(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 $W(e,t,n,i){e.element().setAttribute("title",i||"")}class Rf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new wM(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 _W="keydown",FW="keypress",kW="keyup",UM="dragenter",uh="dragleave",jM="dragover",zy="pointerdown",DW="pointerup",Hh="pointermove",lh="pointerout",qM="pointerover",By="mousedown",TW="mouseup",WM="mousemove",Vh="mouseout",GM="mouseover",Yh="click",MW="dblclick",OW="wheel",HM="mousewheel",Xh="touchstart",Kh="touchmove",Jh="touchend",RW=[_W,FW,kW,UM,uh,jM,zy,DW,Hh,lh,qM,By,TW,WM,Vh,GM,Yh,MW,OW,HM,Xh,Kh,Jh],Uy=Hh,Sc=Vh,jy=Yh;class Nf extends R2{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=RW,this.pointermove=mC([Hh,WM],[qM,GM],[lh,Vh]),this.dragover=mC([jM],[UM],[uh]),this.pointerout=yC([lh,Vh]),this.dragleave=yC([uh])}initialize(t,n,i){return this._canvas=t&&O2(t,"canvas"),[Yh,By,zy,Hh,lh,uh].forEach(r=>pC(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(HM,t)}pointerdown(t){this._down=this._active,this.fire(zy,t)}mousedown(t){this._down=this._active,this.fire(By,t)}click(t){this._down===this._active&&(this.fire(Yh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Xh,t,!0)}touchmove(t){this.fire(Kh,t,!0)}touchend(t){this.fire(Jh,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===jy&&r&&r.href?this.handleHref(n,r,r.href):(t===Uy||t===Sc)&&this.handleTooltip(n,r,t!==Sc),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&&(pC(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=Jp(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 NW=e=>e===Xh||e===Kh||e===Jh?[Xh,Kh,Jh]:[e];function pC(e,t){NW(t).forEach(n=>LW(e,n))}function LW(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 lc(e,t,n){t.forEach(i=>e.fire(i,n))}function mC(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?lc(this,e,i):((!r||!r.exit)&&lc(this,n,i),this._active=o,lc(this,t,i),lc(this,e,i))}}function yC(e){return function(t){lc(this,e,t),this._active=null}}function PW(){return typeof window<"u"&&window.devicePixelRatio||1}function IW(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?PW():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 Qh extends Rf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new pt,this._tempb=new pt}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Vo(1,1,this._options.type),t&&this._canvas&&(ai(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)IW(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||L("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=zW(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):BW(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&&Pq(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 zW=(e,t,n)=>new pt().set(0,0,t,n).translate(-e[0],-e[1]);function BW(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 VM extends R2{constructor(t,n){super(t,n);const i=this;i._hrefHandler=jm(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=jm(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Sc)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(jy,this._hrefHandler),r.removeEventListener(Uy,this._tooltipHandler),r.removeEventListener(Sc,this._tooltipHandler)),this._svg=r=t&&O2(t,"svg"),r&&(r.addEventListener(jy,this._hrefHandler),r.addEventListener(Uy,this._tooltipHandler),r.addEventListener(Sc,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:jm(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 jm=(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)},YM="aria-hidden",N2="aria-label",L2="role",P2="aria-roledescription",XM="graphics-object",I2="graphics-symbol",KM=(e,t,n)=>({[L2]:e,[P2]:t,[N2]:n||void 0}),UW=yr(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),bC={axis:{desc:"axis",caption:WW},legend:{desc:"legend",caption:GW},"title-text":{desc:"title",caption:e=>`Title text '${vC(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${vC(e)}'`}},xC={ariaRole:L2,ariaRoleDescription:P2,description:N2};function JM(e,t){const n=t.aria===!1;if(e(YM,n||void 0),n||t.description==null)for(const i in xC)e(xC[i],void 0);else{const i=t.mark.marktype;e(N2,t.description),e(L2,t.ariaRole||(i==="group"?XM:I2)),e(P2,t.ariaRoleDescription||`${i} mark`)}}function QM(e){return e.aria===!1?{[YM]:!0}:UW[e.role]?null:bC[e.role]?qW(e,bC[e.role]):jW(e)}function jW(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return KM(n?XM:I2,`${t} mark container`,e.description)}function qW(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return KM(t.role||I2,t.desc,n.description||i(n))}catch{return null}}function vC(e){return oe(e.text).join(" ")}function WW(e){const t=e.datum,n=e.orient,i=t.title?ZM(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 ${Ru(a)?"discrete":a} scale with ${dM(s,o,e)}`}function GW(e){const t=e.datum,n=t.title?ZM(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 VW(i)+(n?` titled '${n}'`:"")+` for ${HW(o)} with ${dM(u,a,e)}`}function ZM(e){try{return oe($e(e.items).items[0].text).join(" ")}catch{return null}}function HW(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+$e(e)}function VW(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const e5=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),YW=e=>e5(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function z2(){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}="${YW(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=e5(u),a),toString:()=>e};return a}const t5=e=>n5(z2(),e)+"";function n5(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):n5(e,i)}return e.close()}const Zh={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"},eg={blend:"mix-blend-mode"},i5={fill:"none","stroke-miterlimit":10},zl=0,EC="http://www.w3.org/2000/xmlns/",mt=Yc.xmlns;class B2 extends Rf{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=yt(t,0,"svg",mt),this._svg.setAttributeNS(EC,"xmlns",mt),this._svg.setAttributeNS(EC,"xmlns:xlink",Yc["xmlns:xlink"]),this._svg.setAttribute("version",Yc.version),this._svg.setAttribute("class","marks"),ai(t,1),this._root=yt(this._svg,zl,"g",mt),Io(this._root,i5),ai(this._svg,zl+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&&(Io(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=yt(t,zl,"rect",mt),Io(i,{width:this._width,height:this._height,fill:n}));const r=t5(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),ai(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,wC(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,wC(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=AC(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return ai(c,0),n._svg;c.setAttribute("class",BM(n));const f=QM(n);for(const p in f)cn(c,p,f[p]);l||cn(c,"pointer-events",u),cn(c,"clip-path",n.clip?y2(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=AC(p,c,d,a.tag,o);m&&(this._update(a,y,p),l&&JW(this,y,p,r)),d=y,++h};return a.nested?n.items.length&&g(n.items[0]):zi(n,g),ai(c,h),c}_update(t,n,i){Zr=n,Qt=n.__values__,JM(Cc,i),t.attr(Cc,i,this);const r=ZW[t.type];r&&r.call(this,t,n,i),Zr&&this.style(Zr,i)}style(t,n){if(n!=null){for(const i in Zh){let r=i==="font"?Of(n):n[i];if(r===Qt[i])continue;const o=Zh[i];r==null?t.removeAttribute(o):(g2(r)&&(r=gM(r,this._defs.gradient,r5())),t.setAttribute(o,r+"")),Qt[i]=r}for(const i in eg)ch(t,eg[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=yt(t,zl+1,"defs",mt)),r=XW(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=yt(t,zl+1,"defs",mt)),r=KW(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):ai(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function wC(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 XW(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=yt(e,n++,"pattern",mt);Io(s,{id:jh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=yt(s,0,"rect",mt),Io(s,{width:1,height:1,fill:`url(${r5()}#${t.id})`}),e=yt(e,n++,"radialGradient",mt),Io(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=yt(e,n++,"linearGradient",mt),Io(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=yt(e,i,"stop",mt),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return ai(e,i),n}function KW(e,t,n){let i;return e=yt(e,n,"clipPath",mt),e.setAttribute("id",t.id),t.path?(i=yt(e,0,"path",mt),i.setAttribute("d",t.path)):(i=yt(e,0,"rect",mt),Io(i,{x:0,y:0,width:t.width,height:t.height})),ai(e,1),n+1}function JW(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;zi(n,s=>{r=e.mark(t,s,r,i),++o}),ai(t,1+o)}function AC(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Po(s,i,mt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=Po(s,"path",mt);o.appendChild(a),a.__data__=e;const u=Po(s,"g",mt);o.appendChild(u),u.__data__=e;const l=Po(s,"path",mt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||QW(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function QW(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Zr=null,Qt=null;const ZW={group(e,t,n){const i=Zr=t.childNodes[2];Qt=i.__values__,e.foreground(Cc,n,this),Qt=t.__values__,Zr=t.childNodes[1],e.content(Cc,n,this);const r=Zr=t.childNodes[0];e.background(Cc,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Qt.events&&(cn(i,"pointer-events",o),cn(r,"pointer-events",o),Qt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;cn(i,"display",null),this.style(r,n),cn(r,"stroke",null),s&&(n.fill=null),Qt=i.__values__,this.style(i,n),s&&(n.fill=s),Zr=null}else cn(i,"display","none")},image(e,t,n){n.smooth===!1?(ch(t,"image-rendering","optimizeSpeed"),ch(t,"image-rendering","pixelated")):ch(t,"image-rendering",null)},text(e,t,n){const i=Mf(n);let r,o,s,a;Z(i)?(o=i.map(u=>es(n,u)),r=o.join(`
7
+ `),r!==Qt.text&&(ai(t,0),s=t.ownerDocument,a=Zo(n),o.forEach((u,l)=>{const c=Po(s,"tspan",mt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Qt.text=r)):(o=es(n,i),o!==Qt.text&&(t.textContent=o,Qt.text=o)),cn(t,"font-family",Of(n)),cn(t,"font-size",_r(n)+"px"),cn(t,"font-style",n.fontStyle),cn(t,"font-variant",n.fontVariant),cn(t,"font-weight",n.fontWeight)}};function Cc(e,t,n){t!==Qt[e]&&(n?eG(Zr,e,t,n):cn(Zr,e,t),Qt[e]=t)}function ch(e,t,n){n!==Qt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Qt[t]=n)}function Io(e,t){for(const n in t)cn(e,n,t[n])}function cn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function eG(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function r5(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class o5 extends Rf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=z2();n.open("svg",ye({},Yc,{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",i5,{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=[JM,i.attr];t.open("g",{class:BM(n),"clip-path":n.clip?y2(this,n,n.group):null},QM(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=Mf(a);if(Z(l)){const c={x:0,dy:Zo(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(es(a,l[f])).close()}else t.text(es(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)),zi(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]):zi(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&&tG(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:jh+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 tG(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"]=Of(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 Zh){let a=t[s];const u=Zh[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(g2(a)&&(a=gM(a,r.gradient,"")),e[u]=a)}for(const s in eg){const a=t[s];a!=null&&(o=o||[],o.push(`${eg[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const $i={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function nG(e){$i.svgMarkTypes=e.svgMarkTypes??["text"],$i.svgOnTop=e.svgOnTop??!0,$i.debug=e.debug??!1}class qy extends Rf{constructor(t){super(t),this._svgRenderer=new B2(t),this._canvasRenderer=new Qh(t)}initialize(t,n,i,r,o){this._root_el=yt(t,0,"div");const s=yt(this._root_el,0,"div"),a=yt(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 s5 extends Nf{constructor(t,n){super(t,n)}initialize(t,n,i){const r=yt(yt(t,0,"div"),$i.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const a5="canvas",u5="hybrid",l5="png",c5="svg",f5="none",zo={Canvas:a5,PNG:l5,SVG:c5,Hybrid:u5,None:f5},la={};la[a5]=la[l5]={renderer:Qh,headless:Qh,handler:Nf};la[c5]={renderer:B2,headless:o5,handler:VM};la[u5]={renderer:qy,headless:qy,handler:s5};la[f5]={};function Qp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(la[e]=t,this):la[e]}function d5(e,t,n){const i=[],r=new pt().union(t),o=e.marktype;return o?h5(e,r,n,i):o==="group"?g5(e,r,n,i):L("Intersect scene must be mark node or group item.")}function h5(e,t,n,i){if(iG(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)g5(r[a],t,n,i);else for(const u=ni[o].isect;a<s;++a){const l=r[a];p5(l,t,u)&&i.push(l)}}return i}function iG(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function g5(e,t,n,i){n&&n(e.mark)&&p5(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)h5(r[u],t,n,i);t.translate(s,a)}return i}function p5(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const qm=new pt;function m5(e){const t=e.clip;if(be(t))t(Df(qm.clear()));else if(t)qm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(qm)}const rG=1e-9;function U2(e,t,n){return e===t?!0:n==="path"?y5(e,t):e instanceof Date&&t instanceof Date?+e==+t:sa(e)&&sa(t)?Math.abs(e-t)<=rG:!e||!t||!me(e)&&!me(t)?e==t:oG(e,t)}function y5(e,t){return U2(Nu(e),Nu(t))}function oG(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],!U2(e[r],t[r],r))return!1;return typeof e==typeof t}function sG(){EM(),Dj()}const Iu="top",ki="left",Di="right",ts="bottom",aG="top-left",uG="top-right",lG="bottom-left",cG="bottom-right",j2="start",Wy="middle",fn="end",fG="x",dG="y",Zp="group",q2="axis",W2="title",hG="frame",gG="scope",G2="legend",b5="row-header",x5="row-footer",v5="row-title",E5="column-header",w5="column-footer",A5="column-title",pG="padding",mG="symbol",S5="fit",C5="fit-x",$5="fit-y",yG="pad",H2="none",vd="all",Gy="each",V2="flush",Bo="column",Uo="row";function _5(e){M.call(this,null,e)}G(_5,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=Ed(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Zp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Ed(l,s))),i.role){case q2:case G2:case W2:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Ed(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Ed(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return m5(i),t.modifies("bounds")}});function Ed(e,t,n){return t(e.bounds.clear(),e,n)}const SC=":vega_identifier:";function Y2(e){M.call(this,0,e)}Y2.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(Y2,M,{transform(e,t){const n=bG(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 bG(e){return e._signals[SC]||(e._signals[SC]=e.add(0))}function F5(e){M.call(this,null,e)}G(F5,M,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,xG(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===Zp?Wp:qp;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 xG(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 k5(e){M.call(this,null,e)}const CC={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!D5(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},D5=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),$C=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(D5(r,o=e[n].bounds,t))return!0},vG=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},EG=(e,t,n)=>{var i=e.range(),r=new pt;return t===Iu||t===ts?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)},_C=e=>(e.forEach(t=>t.opacity=1),e),FC=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(k5,M,{transform(e,t){const n=CC[e.method]||CC.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")&&(_C(r),t=FC(t,e)),t;if(r=r.filter(vG),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=_C(r),t=FC(t,e),o.length>=3&&$C(o,i)){do o=n(o,i);while(o.length>=3&&$C(o,i));o.length<3&&!$e(r).opacity&&(o.length>1&&($e(o).opacity=0),$e(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=EG(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 T5(e){M.call(this,null,e)}G(T5,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 Jt=new pt;function cu(e,t,n){return e[t]===n?0:(e[t]=n,1)}function wG(e){var t=e.items[0].orient;return t===ki||t===Di}function AG(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function SG(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=AG(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=o.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&D2(g),b=0,x=0,v,w;switch(Jt.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 Iu:b=f||0,x=-c,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(l,0),g&&wd(e,g,w,p,y,0,-1,m);break;case ki:b=-c,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,l),g&&wd(e,g,w,p,y,1,-1,m);break;case Di:b=n+c,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,l),g&&wd(e,g,w,p,y,1,1,m);break;case ts:b=f||0,x=i+c,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,w),g&&wd(e,g,w,p,0,0,1,m);break;default:b=r.x,x=r.y}return bo(m.translate(b,x),r),cu(r,"x",b+s)|cu(r,"y",x+s)&&(r.bounds=Jt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function wd(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 kC=(e,t)=>Math.floor(Math.min(e,t)),DC=(e,t)=>Math.ceil(Math.max(e,t));function CG(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===Zp)switch(r.role){case q2:case G2:case W2:break;case b5:s.rowheaders.push(...o);break;case x5:s.rowfooters.push(...o);break;case E5:s.colheaders.push(...o);break;case w5:s.colfooters.push(...o);break;case v5:s.rowtitle=o[0];break;case A5:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function $G(e){return new pt().set(0,0,e.width||0,e.height||0)}function _G(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=me(e)?e[t]:e;return i??(n!==void 0?n:0)}function TC(e){return e<0?Math.ceil(-e):0}function M5(e,t,n){var i=!n.nodirty,r=n.bounds===V2?$G:_G,o=Jt.set(0,0,0,0),s=Je(n.align,Bo),a=Je(n.align,Uo),u=Je(n.padding,Bo),l=Je(n.padding,Uo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,x=Array(d),v=Array(d),w=Array(d),A,E,S,C,_,F,O,T,k,$,D;for(E=0;E<c;++E)g[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)F=t[E],_=w[E]=r(F),F.x=F.x||0,x[E]=0,F.y=F.y||0,v[E]=0,S=E%c,C=~~(E/c),p=Math.max(p,O=Math.ceil(_.x2)),b=Math.max(b,T=Math.ceil(_.y2)),g[S]=Math.max(g[S],O),y[C]=Math.max(y[C],T),h[E]=u+TC(_.x1),m[E]=l+TC(_.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===Gy)for(S=1;S<c;++S){for(D=0,E=S;E<d;E+=c)D<h[E]&&(D=h[E]);for(E=S;E<d;E+=c)h[E]=D+g[S-1]}else if(s===vd){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+p)}else for(s=!1,S=1;S<c;++S)for(E=S;E<d;E+=c)h[E]+=g[S-1];if(a===Gy)for(C=1;C<f;++C){for(D=0,E=C*c,A=E+c;E<A;++E)D<m[E]&&(D=m[E]);for(E=C*c;E<A;++E)m[E]=D+y[C-1]}else if(a===vd){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,C=1;C<f;++C)for(E=C*c,A=E+c;E<A;++E)m[E]+=y[C-1];for(k=0,E=0;E<d;++E)k=h[E]+(E%c?k:0),x[E]+=k-t[E].x;for(S=0;S<c;++S)for($=0,E=S;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===vd?p:g[E%c],k=_-w[E].x2-t[E].x-x[E],k>0&&(x[E]+=k/2);if(a&&Je(n.center,Uo)&&c!==1)for(E=0;E<d;++E)_=a===vd?b:y[~~(E/c)],$=_-w[E].y2-t[E].y-v[E],$>0&&(v[E]+=$/2);for(E=0;E<d;++E)o.union(w[E].translate(x[E],v[E]));switch(k=Je(n.anchor,fG),$=Je(n.anchor,dG),Je(n.anchor,Bo)){case fn:k-=o.width();break;case Wy:k-=o.width()/2}switch(Je(n.anchor,Uo)){case fn:$-=o.height();break;case Wy:$-=o.height()/2}for(k=Math.round(k),$=Math.round($),o.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)F=t[E],F.x+=x[E]+=k,F.y+=v[E]+=$,o.union(F.mark.bounds.union(F.bounds.translate(x[E],v[E]))),i&&e.dirty(F);return o}function FG(e,t,n){var i=CG(t),r=i.marks,o=n.bounds===V2?kG:DG,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=M5(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=Je(n.headerBand,Uo,null),c=Ad(e,i.rowheaders,r,a,u,-Je(s,"rowHeader"),kC,0,o,"x1",0,a,1,p)),i.colheaders&&(p=Je(n.headerBand,Bo,null),f=Ad(e,i.colheaders,r,a,a,-Je(s,"columnHeader"),kC,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=Je(n.footerBand,Uo,null),d=Ad(e,i.rowfooters,r,a,u,Je(s,"rowFooter"),DC,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=Je(n.footerBand,Bo,null),h=Ad(e,i.colfooters,r,a,a,Je(s,"columnFooter"),DC,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=Je(n.titleAnchor,Uo),m=Je(s,"rowTitle"),m=g===fn?d+m:c-m,p=Je(n.titleBand,Uo,.5),MC(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=Je(n.titleAnchor,Bo),m=Je(s,"columnTitle"),m=g===fn?h+m:f-m,p=Je(n.titleBand,Bo,.5),MC(e,i.coltitle,m,1,y,p))}function kG(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 DG(e,t){return e.bounds[t]}function Ad(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,x,v,w,A,E,S,C;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=s(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=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(A=t[b],w=A.mark.bounds,x=y;x>=0&&(E=n[x])==null;x-=d);a?(S=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),C=p):(S=p,C=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),w.union(A.bounds.translate(S-(A.x||0),C-(A.y||0))),A.x=S,A.y=C,e.dirty(A),m=s(m,w[l])}return m}function MC(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 TG(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function MG(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 OG(e,t,n,i,r,o,s){const a=TG(n,t),u=MG(e,a("offset",0)),l=a("anchor",j2),c=l===fn?1:l===Wy?.5:0,f={align:Gy,bounds:a("bounds",V2),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ki:f.anchor={x:Math.floor(i.x1)-u,column:fn,y:c*(s||i.height()+2*i.y1),row:l};break;case Di:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case Iu:f.anchor={y:Math.floor(r.y1)-u,row:fn,x:c*(o||r.width()+2*r.x1),column:l};break;case ts:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case aG:f.anchor={x:u,y:u};break;case uG:f.anchor={x:o-u,y:u,column:fn};break;case lG:f.anchor={x:u,y:s-u,row:fn};break;case cG:f.anchor={x:o-u,y:s-u,column:fn,row:fn};break}return f}function RG(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(),LG(e,n,n.items[0].items[0]),o=NG(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===mG&&PG(n.items[0].items[0].items[0].items),r!==H2&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,bo(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function NG(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function LG(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&Bl(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 ki:r+=Math.ceil(s.bounds.width())+u;break;case Di:case ts:break;default:o+=s.bounds.height()+u}switch((r||o)&&Bl(e,n,r,o),s.orient){case ki:c+=Ja(t,n,s,a,1,1);break;case Di:l+=Ja(t,n,s,fn,0,0)+u,c+=Ja(t,n,s,a,1,1);break;case ts:l+=Ja(t,n,s,a,0,0),c+=Ja(t,n,s,fn,-1,0,1)+u;break;default:l+=Ja(t,n,s,a,0,0)}(l||c)&&Bl(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(Bl(e,n,-l,0),Bl(e,s,-l,0))}}function Ja(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:D2(n);return Math.round(i===j2?f:i===fn?d-h:.5*(c-h))}function Bl(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 PG(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 IG(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===ki||a===Di?i:n,g=0,p=0,m=0,y=0,b=0,x;if(s!==Zp?a===ki?(g=r.y2,h=r.y1):a===Di?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===ki&&(g=i,h=0),x=u===j2?g:u===fn?h:(g+h)/2,d&&d.text){switch(a){case Iu:case ts:b=f.bounds.height()+c;break;case ki:y=f.bounds.width()+c;break;case Di:y=-f.bounds.width()-c;break}Jt.clear().union(d.bounds),Jt.translate(y-(d.x||0),b-(d.y||0)),cu(d,"x",y)|cu(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Jt),d.mark.bounds.clear().union(Jt),e.dirty(d)),Jt.clear().union(d.bounds)}else Jt.clear();switch(Jt.union(f.bounds),a){case Iu:p=x,m=r.y1-Jt.height()-l;break;case ki:p=r.x1-Jt.width()-l,m=x;break;case Di:p=r.x2+Jt.width()+l,m=x;break;case ts:p=x,m=r.y2+l;break;default:p=o.x,m=o.y}return cu(o,"x",p)|cu(o,"y",m)&&(Jt.translate(p,m),e.dirty(o),o.bounds.clear().union(Jt),t.bounds.clear().union(Jt),e.dirty(o)),o.bounds}function O5(e){M.call(this,null,e)}G(O5,M,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&FG(n,i,e.layout),BG(n,i,e)}),zG(e.mark.group)?t.reflow():t}});function zG(e){return e&&e.mark.role!=="legend-entry"}function BG(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new pt().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case q2:h=wG(f)?a:u,h.union(SG(e,f,r,o));break;case W2:c=f;break;case G2:l.push(RG(e,f));break;case hG:case gG:case b5:case x5:case v5:case E5:case w5:case A5: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||Di,d!==H2&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];M5(e,b,OG(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===S5||n.autosize.type===C5||n.autosize.type===$5))switch(y.orient){case ki:case Di:s.add(b.x1,0).add(b.x2,0);break;case Iu:case ts:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(IG(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),UG(e,t,s,n)}function UG(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===pG){const g=e.padding();s-=g.left+g.right,a-=g.top+g.bottom}o===H2?(l=0,f=0,u=s,c=a):o===S5?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===C5?(u=Math.max(0,s-l-d),a=c+f+h):o===$5?(s=u+l+d,c=Math.max(0,a-f-h)):o===yG&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const jG=Object.freeze(Object.defineProperty({__proto__:null,bound:_5,identifier:Y2,mark:F5,overlap:k5,render:T5,viewlayout:O5},Symbol.toStringTag,{value:"Module"}));function R5(e){M.call(this,null,e)}G(R5,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=d2(o,s,e.minstep),u=e.format||aM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?sM(o,e.values,a):h2(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Oe({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Oe({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function N5(e){M.call(this,null,e)}function qG(){return Oe({})}function WG(e){const t=xf().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(N5,M,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||qG,o=e.key||te,s=this.value;return Z(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&L("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=WG(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 L5(e){M.call(this,null,e)}G(L5,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||As,u=r.enter||As,l=r.exit||As,c=(o&&!s?r[o]:a)||As;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!==As&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==As&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==As){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 P5(e){M.call(this,[],e)}G(P5,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||nh,s=e.scale,a=+e.limit,u=d2(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===nh,c=e.format||fM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||cM(s,u),d,h,g,p,m;return r&&(i.rem=r),o===nh?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,be(g=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=wn(p=g||8),r=r.map((y,b)=>Oe({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(Oe({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):o===yj?(d=s.domain(),h=iM(s,d[0],$e(d)),f.length<3&&!e.values&&d[0]!==$e(d)&&(f=[d[0],$e(d)]),r=f.map((y,b)=>Oe({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=Fj(s),r=f.map((y,b)=>Oe({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const GG=e=>e.source.x,HG=e=>e.source.y,VG=e=>e.target.x,YG=e=>e.target.y;function X2(e){M.call(this,{},e)}X2.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"}]};G(X2,M,{transform(e,t){var n=e.sourceX||GG,i=e.sourceY||HG,r=e.targetX||VG,o=e.targetY||YG,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=OC.get(u+"-"+a)||OC.get(u);return l||L("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 I5=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,XG=(e,t,n,i)=>I5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),z5=(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},KG=(e,t,n,i)=>z5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),B5=(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},JG=(e,t,n,i)=>B5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),QG=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,ZG=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,eH=(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},tH=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},nH=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},iH=(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},OC=xf({line:I5,"line-radial":XG,arc:z5,"arc-radial":KG,curve:B5,"curve-radial":JG,"orthogonal-horizontal":QG,"orthogonal-vertical":ZG,"orthogonal-radial":eH,"diagonal-horizontal":tH,"diagonal-vertical":nH,"diagonal-radial":iH});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"]}]};G(K2,M,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||bf,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)/AD(l),h=Yn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const rH=5;function oH(e){const t=e.type;return!e.bins&&(t===Mu||t===Af||t===Sf)}function U5(e){return l2(e)&&e!==hr}const sH=yr(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function j5(e){M.call(this,null,e),this.modified(!0)}G(j5,M,{transform(e,t){var n=t.dataflow,i=this.value,r=aH(e);(!i||r!==i.type)&&(this.value=i=Me(r)());for(r in e)if(!sH[r]){if(r==="padding"&&U5(i.type))continue;be(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return hH(i,e,dH(i,e,lH(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function aH(e){var t=e.type,n="",i;return t===hr?hr+"-"+Mu:(uH(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?hr+"-":i===3?fl+"-":""),(n+t||Mu).toLowerCase())}function uH(e){const t=e.type;return l2(t)&&t!==aa&&t!==ua&&(e.scheme||e.range&&e.range.length&&e.range.every(Ke))}function lH(e,t,n){const i=cH(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&oH(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 U5(o)&&t.padding&&r[0]!==$e(r)&&(r=fH(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(q5(o,r,n)),o===o2&&e.unknown(t.domainImplicit?ky:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&d2(e,t.nice)||null),r.length}function cH(e,t,n){return t?(e.domain(q5(e.type,t,n)),t.length):-1}function fH(e,t,n,i,r,o){var s=Math.abs($e(n)-n[0]),a=s/(s-2*i),u=e===fo?rD(t,null,a):e===Sf?py(t,null,a,.5):e===Af?py(t,null,a,r||1):e===Ip?oD(t,null,a,o||1):iD(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function q5(e,t,n){if(QT(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: "+re(t))}return t}function dH(e,t,n){let i=t.bins;if(i&&!Z(i)){const r=e.domain(),o=r[0],s=$e(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||L("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===s2&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function hH(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=gH(i,t,n);else if(t.scheme&&(o=pH(i,t,n),be(o))){if(e.interpolator)return e.interpolator(o);L(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&ZT(i))return e.interpolator(Up(Hy(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(c2(t.interpolate,t.interpolateGamma)):be(e.round)?e.round(r):be(e.rangeRound)&&e.interpolate(r?tp:yf),o&&e.range(Hy(o,t.reverse))}function gH(e,t,n){e!==HT&&e!==Ty&&L("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Ty?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*r2(n,r,i)]}function pH(e,t,n){var i=t.schemeExtent,r,o;return Z(t.scheme)?o=Up(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=f2(r),o||L(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bp?n+1:e===s2?n-1:e===Ou||e===zp?+t.schemeCount||rH:n,ZT(e)?RC(o,i,t.reverse):be(o)?nM(RC(o,i),n):e===o2?o:o.slice(0,n)}function RC(e,t,n){return be(e)&&(t||n)?tM(e,Hy(t||[0,1],n)):e}function Hy(e,t){return t?e.slice().reverse():e}function W5(e){M.call(this,null,e)}G(W5,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(Da(e.sort)),this.modified(n),t}});const NC="zero",G5="center",H5="normalize",V5=["y0","y1"];function J2(e){M.call(this,null,e)}J2.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:NC,values:[NC,G5,H5]},{name:"as",type:"string",array:!0,length:2,default:V5}]};G(J2,M,{transform(e,t){var n=e.as||V5,i=n[0],r=n[1],o=Da(e.sort),s=e.field||bf,a=e.offset===G5?mH:e.offset===H5?yH:bH,u,l,c,f;for(u=xH(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 mH(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 yH(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 bH(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 xH(e,t,n,i){var r=[],o=p=>p(c),s,a,u,l,c,f,d,h,g;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,g=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>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const vH=Object.freeze(Object.defineProperty({__proto__:null,axisticks:R5,datajoin:N5,encode:L5,legendentries:P5,linkpath:X2,pie:K2,scale:j5,sortitems:W5,stack:J2},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,Vy=1e-12,Ee=Math.PI,st=Ee/2,tg=Ee/4,An=Ee*2,ut=180/Ee,xe=Ee/180,Se=Math.abs,hl=Math.atan,yi=Math.atan2,se=Math.cos,Sd=Math.ceil,Y5=Math.exp,Yy=Math.hypot,ng=Math.log,Wm=Math.pow,ne=Math.sin,ci=Math.sign||function(e){return e>0?1:e<0?-1:0},Sn=Math.sqrt,Q2=Math.tan;function X5(e){return e>1?0:e<-1?Ee:Math.acos(e)}function zn(e){return e>1?st:e<-1?-st:Math.asin(e)}function zt(){}function ig(e,t){e&&PC.hasOwnProperty(e.type)&&PC[e.type](e,t)}var LC={Feature:function(e,t){ig(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)ig(n[i].geometry,t)}},PC={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){Xy(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Xy(n[i],t,0)},Polygon:function(e,t){IC(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)IC(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)ig(n[i],t)}};function Xy(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 IC(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Xy(e[n],t,1);t.polygonEnd()}function Vr(e,t){e&&LC.hasOwnProperty(e.type)?LC[e.type](e,t):ig(e,t)}var rg=new vn,og=new vn,K5,J5,Ky,Jy,Qy,Er={point:zt,lineStart:zt,lineEnd:zt,polygonStart:function(){rg=new vn,Er.lineStart=EH,Er.lineEnd=wH},polygonEnd:function(){var e=+rg;og.add(e<0?An+e:e),this.lineStart=this.lineEnd=this.point=zt},sphere:function(){og.add(An)}};function EH(){Er.point=AH}function wH(){Q5(K5,J5)}function AH(e,t){Er.point=Q5,K5=e,J5=t,e*=xe,t*=xe,Ky=e,Jy=se(t=t/2+tg),Qy=ne(t)}function Q5(e,t){e*=xe,t*=xe,t=t/2+tg;var n=e-Ky,i=n>=0?1:-1,r=i*n,o=se(t),s=ne(t),a=Qy*s,u=Jy*o+a*se(r),l=a*i*ne(r);rg.add(yi(l,u)),Ky=e,Jy=o,Qy=s}function SH(e){return og=new vn,Vr(e,Er),og*2}function sg(e){return[yi(e[1],e[0]),zn(e[2])]}function ca(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*ne(t),ne(n)]}function Cd(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function zu(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 Gm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function $d(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ag(e){var t=Sn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var tt,Tn,rt,Hn,Ps,Z5,eO,bu,$c,Mo,ho,qr={point:Zy,lineStart:zC,lineEnd:BC,polygonStart:function(){qr.point=nO,qr.lineStart=CH,qr.lineEnd=$H,$c=new vn,Er.polygonStart()},polygonEnd:function(){Er.polygonEnd(),qr.point=Zy,qr.lineStart=zC,qr.lineEnd=BC,rg<0?(tt=-(rt=180),Tn=-(Hn=90)):$c>ae?Hn=90:$c<-1e-6&&(Tn=-90),ho[0]=tt,ho[1]=rt},sphere:function(){tt=-(rt=180),Tn=-(Hn=90)}};function Zy(e,t){Mo.push(ho=[tt=e,rt=e]),t<Tn&&(Tn=t),t>Hn&&(Hn=t)}function tO(e,t){var n=ca([e*xe,t*xe]);if(bu){var i=zu(bu,n),r=[i[1],-i[0],0],o=zu(r,i);ag(o),o=sg(o);var s=e-Ps,a=s>0?1:-1,u=o[0]*ut*a,l,c=Se(s)>180;c^(a*Ps<u&&u<a*e)?(l=o[1]*ut,l>Hn&&(Hn=l)):(u=(u+360)%360-180,c^(a*Ps<u&&u<a*e)?(l=-o[1]*ut,l<Tn&&(Tn=l)):(t<Tn&&(Tn=t),t>Hn&&(Hn=t))),c?e<Ps?Gn(tt,e)>Gn(tt,rt)&&(rt=e):Gn(e,rt)>Gn(tt,rt)&&(tt=e):rt>=tt?(e<tt&&(tt=e),e>rt&&(rt=e)):e>Ps?Gn(tt,e)>Gn(tt,rt)&&(rt=e):Gn(e,rt)>Gn(tt,rt)&&(tt=e)}else Mo.push(ho=[tt=e,rt=e]);t<Tn&&(Tn=t),t>Hn&&(Hn=t),bu=n,Ps=e}function zC(){qr.point=tO}function BC(){ho[0]=tt,ho[1]=rt,qr.point=Zy,bu=null}function nO(e,t){if(bu){var n=e-Ps;$c.add(Se(n)>180?n+(n>0?360:-360):n)}else Z5=e,eO=t;Er.point(e,t),tO(e,t)}function CH(){Er.lineStart()}function $H(){nO(Z5,eO),Er.lineEnd(),Se($c)>ae&&(tt=-(rt=180)),ho[0]=tt,ho[1]=rt,bu=null}function Gn(e,t){return(t-=e)<0?t+360:t}function _H(e,t){return e[0]-t[0]}function UC(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function FH(e){var t,n,i,r,o,s,a;if(Hn=rt=-(tt=Tn=1/0),Mo=[],Vr(e,qr),n=Mo.length){for(Mo.sort(_H),t=1,i=Mo[0],o=[i];t<n;++t)r=Mo[t],UC(i,r[0])||UC(i,r[1])?(Gn(i[0],r[1])>Gn(i[0],i[1])&&(i[1]=r[1]),Gn(r[0],i[1])>Gn(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=Gn(i[1],r[0]))>s&&(s=a,tt=r[0],rt=i[1])}return Mo=ho=null,tt===1/0||Tn===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,Tn],[rt,Hn]]}var cc,ug,lg,cg,fg,dg,hg,gg,eb,tb,nb,iO,rO,dn,hn,gn,Ti={sphere:zt,point:Z2,lineStart:jC,lineEnd:qC,polygonStart:function(){Ti.lineStart=TH,Ti.lineEnd=MH},polygonEnd:function(){Ti.lineStart=jC,Ti.lineEnd=qC}};function Z2(e,t){e*=xe,t*=xe;var n=se(t);Lf(n*se(e),n*ne(e),ne(t))}function Lf(e,t,n){++cc,lg+=(e-lg)/cc,cg+=(t-cg)/cc,fg+=(n-fg)/cc}function jC(){Ti.point=kH}function kH(e,t){e*=xe,t*=xe;var n=se(t);dn=n*se(e),hn=n*ne(e),gn=ne(t),Ti.point=DH,Lf(dn,hn,gn)}function DH(e,t){e*=xe,t*=xe;var n=se(t),i=n*se(e),r=n*ne(e),o=ne(t),s=yi(Sn((s=hn*o-gn*r)*s+(s=gn*i-dn*o)*s+(s=dn*r-hn*i)*s),dn*i+hn*r+gn*o);ug+=s,dg+=s*(dn+(dn=i)),hg+=s*(hn+(hn=r)),gg+=s*(gn+(gn=o)),Lf(dn,hn,gn)}function qC(){Ti.point=Z2}function TH(){Ti.point=OH}function MH(){oO(iO,rO),Ti.point=Z2}function OH(e,t){iO=e,rO=t,e*=xe,t*=xe,Ti.point=oO;var n=se(t);dn=n*se(e),hn=n*ne(e),gn=ne(t),Lf(dn,hn,gn)}function oO(e,t){e*=xe,t*=xe;var n=se(t),i=n*se(e),r=n*ne(e),o=ne(t),s=hn*o-gn*r,a=gn*i-dn*o,u=dn*r-hn*i,l=Yy(s,a,u),c=zn(l),f=l&&-c/l;eb.add(f*s),tb.add(f*a),nb.add(f*u),ug+=c,dg+=c*(dn+(dn=i)),hg+=c*(hn+(hn=r)),gg+=c*(gn+(gn=o)),Lf(dn,hn,gn)}function RH(e){cc=ug=lg=cg=fg=dg=hg=gg=0,eb=new vn,tb=new vn,nb=new vn,Vr(e,Ti);var t=+eb,n=+tb,i=+nb,r=Yy(t,n,i);return r<Vy&&(t=dg,n=hg,i=gg,ug<ae&&(t=lg,n=cg,i=fg),r=Yy(t,n,i),r<Vy)?[NaN,NaN]:[yi(n,t)*ut,zn(i/r)*ut]}function ib(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 rb(e,t){return Se(e)>Ee&&(e-=Math.round(e/An)*An),[e,t]}rb.invert=rb;function sO(e,t,n){return(e%=An)?t||n?ib(GC(e),HC(t,n)):GC(e):t||n?HC(t,n):rb}function WC(e){return function(t,n){return t+=e,Se(t)>Ee&&(t-=Math.round(t/An)*An),[t,n]}}function GC(e){var t=WC(e);return t.invert=WC(-e),t}function HC(e,t){var n=se(e),i=ne(e),r=se(t),o=ne(t);function s(a,u){var l=se(u),c=se(a)*l,f=ne(a)*l,d=ne(u),h=d*n+c*i;return[yi(f*r-h*o,c*n-d*i),zn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=ne(a)*l,d=ne(u),h=d*r-f*o;return[yi(f*r+d*o,c*n+h*i),zn(h*n-c*i)]},s}function NH(e){e=sO(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]*=ut,n[1]*=ut,n}return t.invert=function(n){return n=e.invert(n[0]*xe,n[1]*xe),n[0]*=ut,n[1]*=ut,n},t}function LH(e,t,n,i,r,o){if(n){var s=se(t),a=ne(t),u=i*n;r==null?(r=t+i*An,o=t-u/2):(r=VC(s,r),o=VC(s,o),(i>0?r<o:r>o)&&(r+=i*An));for(var l,c=r;i>0?c>o:c<o;c-=u)l=sg([s,-a*se(c),-a*ne(c)]),e.point(l[0],l[1])}}function VC(e,t){t=ca(t),t[0]-=e,ag(t);var n=X5(-t[1]);return((-t[2]<0?-n:n)+An-ae)%An}function aO(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:zt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fh(e,t){return Se(e[0]-t[0])<ae&&Se(e[1]-t[1])<ae}function _d(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 uO(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(fh(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ae}o.push(b=new _d(m,g,null,!0)),s.push(b.o=new _d(m,null,b,!1)),o.push(b=new _d(y,g,null,!1)),s.push(b.o=new _d(y,null,b,!0))}}),!!o.length){for(s.sort(t),YC(o),YC(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 YC(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 Hm(e){return Se(e[0])<=Ee?e[0]:ci(e[0])*((Se(e[0])+Ee)%An-Ee)}function PH(e,t){var n=Hm(t),i=t[1],r=ne(i),o=[ne(n),-se(n),0],s=0,a=0,u=new vn;r===1?i=st+ae:r===-1&&(i=-st-ae);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=Hm(h),p=h[1]/2+tg,m=ne(p),y=se(p),b=0;b<d;++b,g=v,m=A,y=E,h=x){var x=f[b],v=Hm(x),w=x[1]/2+tg,A=ne(w),E=se(w),S=v-g,C=S>=0?1:-1,_=C*S,F=_>Ee,O=m*A;if(u.add(yi(O*C*ne(_),y*E+O*se(_))),s+=F?S+C*An:S,F^g>=n^v>=n){var T=zu(ca(h),ca(x));ag(T);var k=zu(o,T);ag(k);var $=(F^S>=0?-1:1)*zn(k[2]);(i>$||i===$&&(T[0]||T[1]))&&(a+=F^S>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function lO(e,t,n,i){return function(r){var o=t(r),s=aO(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=x,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=wD(c);var v=PH(l,i);c.length?(u||(r.polygonStart(),u=!0),uO(c,zH,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,w){e(v,w)&&r.point(v,w)}function g(v,w){o.point(v,w)}function p(){d.point=g,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(v,w){f.push([v,w]),a.point(v,w)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var v=a.clean(),w=s.result(),A,E=w.length,S,C,_;if(f.pop(),l.push(f),f=null,!!E){if(v&1){if(C=w[0],(S=C.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),A=0;A<S;++A)r.point((_=C[A])[0],_[1]);r.lineEnd()}return}E>1&&v&2&&w.push(w.pop().concat(w.shift())),c.push(w.filter(IH))}}return d}}function IH(e){return e.length>1}function zH(e,t){return((e=e.x)[0]<0?e[1]-st-ae:st-e[1])-((t=t.x)[0]<0?t[1]-st-ae:st-t[1])}const XC=lO(function(){return!0},BH,jH,[-Ee,-st]);function BH(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=Se(o-t);Se(u-Ee)<ae?(e.point(t,n=(n+s)/2>0?st:-st),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=Ee&&(Se(t-i)<ae&&(t-=i*ae),Se(o-a)<ae&&(o-=a*ae),n=UH(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 UH(e,t,n,i){var r,o,s=ne(e-n);return Se(s)>ae?hl((ne(t)*(o=se(i))*ne(n)-ne(i)*(r=se(t))*ne(e))/(r*o*s)):(t+i)/2}function jH(e,t,n,i){var r;if(e==null)r=n*st,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(Se(e[0]-t[0])>ae){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 qH(e){var t=se(e),n=2*xe,i=t>0,r=Se(t)>ae;function o(c,f,d,h){LH(h,e,n,d,c,f)}function s(c,f){return se(c)*se(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],x,v=s(m,y),w=i?v?0:l(m,y):v?l(m+(m<0?Ee:-Ee),y):0;if(!f&&(g=h=v)&&c.lineStart(),v!==h&&(x=u(f,b),(!x||fh(f,x)||fh(b,x))&&(b[2]=1)),v!==h)p=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 A;!(w&d)&&(A=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(A[0][0],A[0][1]),c.point(A[1][0],A[1][1]),c.lineEnd()):(c.point(A[1][0],A[1][1]),c.lineEnd(),c.lineStart(),c.point(A[0][0],A[0][1],3)))}v&&(!f||!fh(f,b))&&c.point(b[0],b[1]),f=b,h=v,d=w},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=ca(c),g=ca(f),p=[1,0,0],m=zu(h,g),y=Cd(m,m),b=m[0],x=y-b*b;if(!x)return!d&&c;var v=t*y/x,w=-t*b/x,A=zu(p,m),E=$d(p,v),S=$d(m,w);Gm(E,S);var C=A,_=Cd(E,C),F=Cd(C,C),O=_*_-F*(Cd(E,E)-1);if(!(O<0)){var T=Sn(O),k=$d(C,(-_-T)/F);if(Gm(k,E),k=sg(k),!d)return k;var $=c[0],D=f[0],P=c[1],z=f[1],I;D<$&&(I=$,$=D,D=I);var V=D-$,ue=Se(V-Ee)<ae,ie=ue||V<ae;if(!ue&&z<P&&(I=P,P=z,z=I),ie?ue?P+z>0^k[1]<(Se(k[0]-$)<ae?P:z):P<=k[1]&&k[1]<=z:V>Ee^($<=k[0]&&k[0]<=D)){var he=$d(C,(-_+T)/F);return Gm(he,E),[k,sg(he)]}}}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 lO(s,a,o,i?[0,-e]:[-Ee,e-Ee])}function WH(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,g;if(g=n-s,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-s,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=o-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}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 Fd=1e9,kd=-1e9;function cO(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,g=0;if(l==null||(h=s(l,f))!==(g=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)!==g);else d.point(c[0],c[1])}function s(l,c){return Se(l[0]-e)<ae?c>0?0:3:Se(l[0]-n)<ae?c>0?2:1:Se(l[1]-t)<ae?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=aO(),d,h,g,p,m,y,b,x,v,w,A,E={point:S,lineStart:O,lineEnd:T,polygonStart:_,polygonEnd:F};function S($,D){r($,D)&&c.point($,D)}function C(){for(var $=0,D=0,P=h.length;D<P;++D)for(var z=h[D],I=1,V=z.length,ue=z[0],ie,he,We=ue[0],ge=ue[1];I<V;++I)ie=We,he=ge,ue=z[I],We=ue[0],ge=ue[1],he<=i?ge>i&&(We-ie)*(i-he)>(ge-he)*(e-ie)&&++$:ge<=i&&(We-ie)*(i-he)<(ge-he)*(e-ie)&&--$;return $}function _(){c=f,d=[],h=[],A=!0}function F(){var $=C(),D=A&&$,P=(d=wD(d)).length;(D||P)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&uO(d,a,$,o,l),l.polygonEnd()),c=l,d=h=g=null}function O(){E.point=k,h&&h.push(g=[]),w=!0,v=!1,b=x=NaN}function T(){d&&(k(p,m),y&&v&&f.rejoin(),d.push(f.result())),E.point=S,v&&c.lineEnd()}function k($,D){var P=r($,D);if(h&&g.push([$,D]),w)p=$,m=D,y=P,w=!1,P&&(c.lineStart(),c.point($,D));else if(P&&v)c.point($,D);else{var z=[b=Math.max(kd,Math.min(Fd,b)),x=Math.max(kd,Math.min(Fd,x))],I=[$=Math.max(kd,Math.min(Fd,$)),D=Math.max(kd,Math.min(Fd,D))];WH(z,I,e,t,n,i)?(v||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),P||c.lineEnd(),A=!1):P&&(c.lineStart(),c.point($,D),A=!1)}b=$,x=D,v=P}return E}}function KC(e,t,n){var i=Yn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function JC(e,t,n){var i=Yn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function GH(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Yn(Sd(i/c)*c,n,c).map(g).concat(Yn(Sd(a/f)*f,s,f).map(p)).concat(Yn(Sd(t/u)*u,e,u).filter(function(x){return Se(x%c)>ae}).map(d)).concat(Yn(Sd(o/l)*l,r,l).filter(function(x){return Se(x%f)>ae}).map(h))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(s).slice(1),g(n).reverse().slice(1),p(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=KC(o,r,90),h=JC(t,e,m),g=KC(a,s,90),p=JC(i,n,m),y):m},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}const Xc=e=>e;var Vm=new vn,ob=new vn,fO,dO,sb,ab,Yr={point:zt,lineStart:zt,lineEnd:zt,polygonStart:function(){Yr.lineStart=HH,Yr.lineEnd=YH},polygonEnd:function(){Yr.lineStart=Yr.lineEnd=Yr.point=zt,Vm.add(Se(ob)),ob=new vn},result:function(){var e=Vm/2;return Vm=new vn,e}};function HH(){Yr.point=VH}function VH(e,t){Yr.point=hO,fO=sb=e,dO=ab=t}function hO(e,t){ob.add(ab*e-sb*t),sb=e,ab=t}function YH(){hO(fO,dO)}var Bu=1/0,pg=Bu,Kc=-Bu,mg=Kc,yg={point:XH,lineStart:zt,lineEnd:zt,polygonStart:zt,polygonEnd:zt,result:function(){var e=[[Bu,pg],[Kc,mg]];return Kc=mg=-(pg=Bu=1/0),e}};function XH(e,t){e<Bu&&(Bu=e),e>Kc&&(Kc=e),t<pg&&(pg=t),t>mg&&(mg=t)}var ub=0,lb=0,fc=0,bg=0,xg=0,fu=0,cb=0,fb=0,dc=0,gO,pO,ur,lr,ui={point:fa,lineStart:QC,lineEnd:ZC,polygonStart:function(){ui.lineStart=QH,ui.lineEnd=ZH},polygonEnd:function(){ui.point=fa,ui.lineStart=QC,ui.lineEnd=ZC},result:function(){var e=dc?[cb/dc,fb/dc]:fu?[bg/fu,xg/fu]:fc?[ub/fc,lb/fc]:[NaN,NaN];return ub=lb=fc=bg=xg=fu=cb=fb=dc=0,e}};function fa(e,t){ub+=e,lb+=t,++fc}function QC(){ui.point=KH}function KH(e,t){ui.point=JH,fa(ur=e,lr=t)}function JH(e,t){var n=e-ur,i=t-lr,r=Sn(n*n+i*i);bg+=r*(ur+e)/2,xg+=r*(lr+t)/2,fu+=r,fa(ur=e,lr=t)}function ZC(){ui.point=fa}function QH(){ui.point=eV}function ZH(){mO(gO,pO)}function eV(e,t){ui.point=mO,fa(gO=ur=e,pO=lr=t)}function mO(e,t){var n=e-ur,i=t-lr,r=Sn(n*n+i*i);bg+=r*(ur+e)/2,xg+=r*(lr+t)/2,fu+=r,r=lr*e-ur*t,cb+=r*(ur+e),fb+=r*(lr+t),dc+=r*3,fa(ur=e,lr=t)}function yO(e){this._context=e}yO.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,An);break}}},result:zt};var db=new vn,Ym,bO,xO,hc,gc,Jc={point:zt,lineStart:function(){Jc.point=tV},lineEnd:function(){Ym&&vO(bO,xO),Jc.point=zt},polygonStart:function(){Ym=!0},polygonEnd:function(){Ym=null},result:function(){var e=+db;return db=new vn,e}};function tV(e,t){Jc.point=vO,bO=hc=e,xO=gc=t}function vO(e,t){hc-=e,gc-=t,db.add(Sn(hc*hc+gc*gc)),hc=e,gc=t}let e$,vg,t$,n$;class i${constructor(t){this._append=t==null?EO:nV(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!==t$||this._append!==vg){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`,t$=i,vg=this._append,n$=this._,this._=r}this._+=n$;break}}}result(){const t=this._;return this._="",t.length?t:null}}function EO(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nV(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return EO;if(t!==e$){const n=10**t;e$=t,vg=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 vg}function wO(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),Vr(a,r(o))),o.result()}return s.area=function(a){return Vr(a,r(Yr)),Yr.result()},s.measure=function(a){return Vr(a,r(Jc)),Jc.result()},s.bounds=function(a){return Vr(a,r(yg)),yg.result()},s.centroid=function(a){return Vr(a,r(ui)),ui.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,Xc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new i$(n)):new yO(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 i$(n)),s},s.projection(e).digits(n).context(t)}function e0(e){return function(t){var n=new hb;for(var i in e)n[i]=e[i];return n.stream=t,n}}function hb(){}hb.prototype={constructor:hb,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 eE(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Vr(n,e.stream(yg)),t(yg.result()),i!=null&&e.clipExtent(i),e}function t0(e,t,n){return eE(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 tE(e,t,n){return t0(e,[[0,0],t],n)}function nE(e,t,n){return eE(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 iE(e,t,n){return eE(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 r$=16,iV=se(30*xe);function o$(e,t){return+t?oV(e,t):rV(e)}function rV(e){return e0({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function oV(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,x=y*y+b*b;if(x>4*t&&p--){var v=s+d,w=a+h,A=u+g,E=Sn(v*v+w*w+A*A),S=zn(A/=E),C=Se(Se(A)-1)<ae||Se(o-f)<ae?(o+f)/2:yi(w,v),_=e(C,S),F=_[0],O=_[1],T=F-i,k=O-r,$=b*T-y*k;($*$/x>t||Se((y*T+b*k)/x-.5)>.3||s*d+a*h+u*g<iV)&&(n(i,r,o,s,a,u,F,O,C,v/=E,w/=E,A,p,m),m.point(F,O),n(F,O,C,v,w,A,l,c,f,d,h,g,p,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:v,polygonStart:function(){i.polygonStart(),m.lineStart=w},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(S,C){S=e(S,C),i.point(S[0],S[1])}function b(){f=NaN,m.point=x,i.lineStart()}function x(S,C){var _=ca([S,C]),F=e(S,C);n(f,d,c,h,g,p,f=F[0],d=F[1],c=S,h=_[0],g=_[1],p=_[2],r$,i),i.point(f,d)}function v(){m.point=y,i.lineEnd()}function w(){b(),m.point=A,m.lineEnd=E}function A(S,C){x(r=S,C),o=f,s=d,a=h,u=g,l=p,m.point=x}function E(){n(f,d,c,h,g,p,o,s,r,a,u,l,r$,i),m.lineEnd=v,v()}return m}}var sV=e0({point:function(e,t){this.stream.point(e*xe,t*xe)}});function aV(e){return e0({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function uV(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 s$(e,t,n,i,r,o){if(!o)return uV(e,t,n,i,r);var s=se(o),a=ne(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 g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function Fr(e){return AO(function(){return e})()}function AO(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,g=null,p=XC,m=null,y,b,x,v=Xc,w=.5,A,E,S,C,_;function F($){return S($[0]*xe,$[1]*xe)}function O($){return $=S.invert($[0],$[1]),$&&[$[0]*ut,$[1]*ut]}F.stream=function($){return C&&_===$?C:C=sV(aV(c)(p(A(v(_=$)))))},F.preclip=function($){return arguments.length?(p=$,g=void 0,k()):p},F.postclip=function($){return arguments.length?(v=$,m=y=b=x=null,k()):v},F.clipAngle=function($){return arguments.length?(p=+$?qH(g=$*xe):(g=null,XC),k()):g*ut},F.clipExtent=function($){return arguments.length?(v=$==null?(m=y=b=x=null,Xc):cO(m=+$[0][0],y=+$[0][1],b=+$[1][0],x=+$[1][1]),k()):m==null?null:[[m,y],[b,x]]},F.scale=function($){return arguments.length?(n=+$,T()):n},F.translate=function($){return arguments.length?(i=+$[0],r=+$[1],T()):[i,r]},F.center=function($){return arguments.length?(o=$[0]%360*xe,s=$[1]%360*xe,T()):[o*ut,s*ut]},F.rotate=function($){return arguments.length?(a=$[0]%360*xe,u=$[1]%360*xe,l=$.length>2?$[2]%360*xe:0,T()):[a*ut,u*ut,l*ut]},F.angle=function($){return arguments.length?(f=$%360*xe,T()):f*ut},F.reflectX=function($){return arguments.length?(d=$?-1:1,T()):d<0},F.reflectY=function($){return arguments.length?(h=$?-1:1,T()):h<0},F.precision=function($){return arguments.length?(A=o$(E,w=$*$),k()):Sn(w)},F.fitExtent=function($,D){return t0(F,$,D)},F.fitSize=function($,D){return tE(F,$,D)},F.fitWidth=function($,D){return nE(F,$,D)},F.fitHeight=function($,D){return iE(F,$,D)};function T(){var $=s$(n,0,0,d,h,f).apply(null,t(o,s)),D=s$(n,i-$[0],r-$[1],d,h,f);return c=sO(a,u,l),E=ib(t,D),S=ib(c,E),A=o$(E,w),k()}function k(){return C=_=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&O,T()}}function rE(e){var t=0,n=Ee/3,i=AO(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*xe,n=o[1]*xe):[t*ut,n*ut]},r}function lV(e){var t=se(e);function n(i,r){return[i*t,ne(r)/t]}return n.invert=function(i,r){return[i/t,zn(r*t)]},n}function cV(e,t){var n=ne(e),i=(n+ne(t))/2;if(Se(i)<ae)return lV(e);var r=1+n*(2*i-n),o=Sn(r)/i;function s(a,u){var l=Sn(r-2*i*ne(u))/i;return[l*ne(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=yi(a,Se(l))*ci(l);return l*i<0&&(c-=Ee*ci(a)*ci(l)),[c/i,zn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Eg(){return rE(cV).scale(155.424).center([0,33.6442])}function SO(){return Eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function fV(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 dV(){var e,t,n=SO(),i,r=Eg().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Eg().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],g=d[1];return u=null,i.point(h,g),u||(o.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=fV([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(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),o=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ae,p+.12*h+ae],[g-.214*h-ae,p+.234*h-ae]]).stream(l),a=s.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ae,p+.166*h+ae],[g-.115*h-ae,p+.234*h-ae]]).stream(l),f()},c.fitExtent=function(d,h){return t0(c,d,h)},c.fitSize=function(d,h){return tE(c,d,h)},c.fitWidth=function(d,h){return nE(c,d,h)},c.fitHeight=function(d,h){return iE(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function CO(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*ne(t),o*ne(n)]}}function Pf(e){return function(t,n){var i=Sn(t*t+n*n),r=e(i),o=ne(r),s=se(r);return[yi(t*o,i*s),zn(i&&n*o/i)]}}var $O=CO(function(e){return Sn(2/(1+e))});$O.invert=Pf(function(e){return 2*zn(e/2)});function hV(){return Fr($O).scale(124.75).clipAngle(180-.001)}var _O=CO(function(e){return(e=X5(e))&&e/ne(e)});_O.invert=Pf(function(e){return e});function gV(){return Fr(_O).scale(79.4188).clipAngle(180-.001)}function n0(e,t){return[e,ng(Q2((st+t)/2))]}n0.invert=function(e,t){return[e,2*hl(Y5(t))-st]};function pV(){return FO(n0).scale(961/An)}function FO(e){var t=Fr(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(NH(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===n0?[[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 Dd(e){return Q2((st+e)/2)}function mV(e,t){var n=se(e),i=e===t?ne(e):ng(n/se(t))/ng(Dd(t)/Dd(e)),r=n*Wm(Dd(e),i)/i;if(!i)return n0;function o(s,a){r>0?a<-st+ae&&(a=-st+ae):a>st-ae&&(a=st-ae);var u=r/Wm(Dd(a),i);return[u*ne(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=ci(i)*Sn(s*s+u*u),c=yi(s,Se(u))*ci(u);return u*i<0&&(c-=Ee*ci(s)*ci(u)),[c/i,2*hl(Wm(r/l,1/i))-st]},o}function yV(){return rE(mV).scale(109.5).parallels([30,30])}function wg(e,t){return[e,t]}wg.invert=wg;function bV(){return Fr(wg).scale(152.63)}function xV(e,t){var n=se(e),i=e===t?ne(e):(n-se(t))/(t-e),r=n/i+e;if(Se(i)<ae)return wg;function o(s,a){var u=r-a,l=i*s;return[u*ne(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=yi(s,Se(u))*ci(u);return u*i<0&&(l-=Ee*ci(s)*ci(u)),[l/i,r-ci(i)*Sn(s*s+u*u)]},o}function vV(){return rE(xV).scale(131.154).center([0,13.9389])}var _c=1.340264,Fc=-.081106,kc=893e-6,Dc=.003796,Ag=Sn(3)/2,EV=12;function kO(e,t){var n=zn(Ag*ne(t)),i=n*n,r=i*i*i;return[e*se(n)/(Ag*(_c+3*Fc*i+r*(7*kc+9*Dc*i))),n*(_c+Fc*i+r*(kc+Dc*i))]}kO.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<EV&&(a=n*(_c+Fc*i+r*(kc+Dc*i))-t,u=_c+3*Fc*i+r*(7*kc+9*Dc*i),n-=s=a/u,i=n*n,r=i*i*i,!(Se(s)<Vy));++o);return[Ag*e*(_c+3*Fc*i+r*(7*kc+9*Dc*i))/se(n),zn(ne(n)/Ag)]};function wV(){return Fr(kO).scale(177.158)}function DO(e,t){var n=se(t),i=se(e)*n;return[n*ne(e)/i,ne(t)/i]}DO.invert=Pf(hl);function AV(){return Fr(DO).scale(144.049).clipAngle(60)}function SV(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,g=e0({point:function(v,w){var A=x([v,w]);this.stream.point(A[0],A[1])}}),p=Xc,m,y;function b(){return d=e*i,h=e*r,m=y=null,x}function x(v){var w=v[0]*d,A=v[1]*h;if(o){var E=A*s-w*a;w=w*s+A*a,A=E}return[w+t,A+n]}return x.invert=function(v){var w=v[0]-t,A=v[1]-n;if(o){var E=A*s+w*a;w=w*s-A*a,A=E}return[w/d,A/h]},x.stream=function(v){return m&&y===v?m:m=g(p(y=v))},x.postclip=function(v){return arguments.length?(p=v,u=l=c=f=null,b()):p},x.clipExtent=function(v){return arguments.length?(p=v==null?(u=l=c=f=null,Xc):cO(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=ne(o),s=se(o),b()):o*ut},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,w){return t0(x,v,w)},x.fitSize=function(v,w){return tE(x,v,w)},x.fitWidth=function(v,w){return nE(x,v,w)},x.fitHeight=function(v,w){return iE(x,v,w)},x}function TO(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)))]}TO.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(Se(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function CV(){return Fr(TO).scale(175.295)}function MO(e,t){return[se(t)*ne(e),ne(t)]}MO.invert=Pf(zn);function $V(){return Fr(MO).scale(249.5).clipAngle(90+ae)}function OO(e,t){var n=se(t),i=1+se(e)*n;return[n*ne(e)/i,ne(t)/i]}OO.invert=Pf(function(e){return 2*hl(e)});function _V(){return Fr(OO).scale(250).clipAngle(142)}function RO(e,t){return[ng(Q2((st+t)/2)),-e]}RO.invert=function(e,t){return[-t,2*hl(Y5(e))-st]};function FV(){var e=FO(RO),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 kV=Math.abs,gb=Math.cos,Sg=Math.sin,DV=1e-6,NO=Math.PI,pb=NO/2,a$=TV(2);function u$(e){return e>1?pb:e<-1?-pb:Math.asin(e)}function TV(e){return e>0?Math.sqrt(e):0}function MV(e,t){var n=e*Sg(t),i=30,r;do t-=r=(t+Sg(t)-n)/(1+gb(t));while(kV(r)>DV&&--i>0);return t/2}function OV(e,t,n){function i(r,o){return[e*r*gb(o=MV(n,o)),t*Sg(o)]}return i.invert=function(r,o){return o=u$(o/t),[r/(e*gb(o)),u$((2*o+Sg(2*o))/n)]},i}var RV=OV(a$/pb,a$,NO);function NV(){return Fr(RV).scale(169.529)}const LV=wO(),mb=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function PV(e,t){return function n(){const i=t();return i.type=e,i.path=wO().projection(i),i.copy=i.copy||function(){const r=n();return mb.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},KT(i)}}function oE(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Cg[e]=PV(e,t),this):Cg[e]||null}function LO(e){return e&&e.path||LV}const Cg={albers:SO,albersusa:dV,azimuthalequalarea:hV,azimuthalequidistant:gV,conicconformal:yV,conicequalarea:Eg,conicequidistant:vV,equalEarth:wV,equirectangular:bV,gnomonic:AV,identity:SV,mercator:pV,mollweide:NV,naturalEarth1:CV,orthographic:$V,stereographic:_V,transversemercator:FV};for(const e in Cg)oE(e,Cg[e]);function IV(){}const zr=[[],[[[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 PO(){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),zV(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(BV((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,zr[m<<1].forEach(x);++h<e-1;)p=m,m=u[h+1]>=l,zr[p|m<<1].forEach(x);for(zr[m<<0].forEach(x);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,zr[m<<1|y<<2].forEach(x);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,zr[p|m<<1|y<<2|b<<3].forEach(x);zr[m|y<<3].forEach(x)}for(h=-1,y=u[g*e]>=l,zr[y<<2].forEach(x);++h<e-1;)b=y,y=u[g*e+h+1]>=l,zr[y<<2|b<<3].forEach(x);zr[y<<3].forEach(x);function x(v){var w=[v[0][0]+h,v[0][1]+g],A=[v[1][0]+h,v[1][1]+g],E=s(w),S=s(A),C,_;(C=d[E])?(_=f[S])?(delete d[C.end],delete f[_.start],C===_?(C.ring.push(A),c(C.ring)):f[C.start]=d[_.end]={start:C.start,end:_.end,ring:C.ring.concat(_.ring)}):(delete d[C.end],C.ring.push(A),d[C.end=S]=C):(C=f[S])?(_=d[E])?(delete f[C.start],delete d[_.end],C===_?(C.ring.push(A),c(C.ring)):f[_.start]=d[C.end]={start:_.start,end:C.end,ring:_.ring.concat(C.ring)}):(delete f[C.start],C.ring.unshift(w),f[C.start=E]=C):f[E]=d[S]={start:E,end:S,ring:[w,A]}}}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],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],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||L("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:IV,i):n===a},i}function zV(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 BV(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=UV(e,t[n]))return r;return 0}function UV(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(jV(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function jV(e,t,n){var i;return qV(e,t,n)&&WV(e[i=+(e[0]===t[0])],n[i],t[i])}function qV(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function WV(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function IO(e,t,n){return function(i){var r=lo(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?ra(o,s,e):a/(e+1);return Yn(o+u,s,u)}}function sE(e){M.call(this,null,e)}sE.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"}]};G(sE,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||Ln,o=PO().smooth(e.smooth!==!1),s=e.thresholds||GV(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));HV(f,c,l,e),f.forEach(d=>{u.push(Ap(l,Oe(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function GV(e,t,n){const i=IO(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Xs(t(r).values)))}function HV(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(be(r)&&(r=r(n,i)),be(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(sa(r)?r:r[0])||1,a=(sa(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(zO(t,s,a,u,l))}function zO(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 l$(e,t,n){const i=e>=0?e:tv(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Xm(e){return be(e)?e:wn(+e)}function BO(){var e=u=>u[0],t=u=>u[1],n=bf,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=l$(i[0],u,e)>>s,f=l$(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>s),p=2*h+(o>>s),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(v=>{const w=d+(+e(v)>>s),A=h+(+t(v)>>s);w>=0&&w<g&&A>=0&&A<p&&(m[w+A*g]+=+n(v))}),c>0&&f>0?(Qa(g,p,m,y,c),Za(g,p,y,m,f),Qa(g,p,m,y,c),Za(g,p,y,m,f),Qa(g,p,m,y,c),Za(g,p,y,m,f)):c>0?(Qa(g,p,m,y,c),Qa(g,p,y,m,c),Qa(g,p,m,y,c),b=y):f>0&&(Za(g,p,m,y,f),Za(g,p,y,m,f),Za(g,p,m,y,f),b=y);const x=l?Math.pow(2,-2*s):1/AD(b);for(let v=0,w=g*p;v<w;++v)b[v]*=x;return{values:b,scale:1<<s,width:g,height:p,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=Xm(u),a):e},a.y=function(u){return arguments.length?(t=Xm(u),a):t},a.weight=function(u){return arguments.length?(n=Xm(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||L("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||L("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=oe(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&L("invalid bandwidth"),i=u,a):i},a}function Qa(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 Za(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 aE(e){M.call(this,null,e)}aE.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 VV=["x","y","weight","size","cellSize","bandwidth"];function UO(e,t){return VV.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(aE,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=YV(i,e.groupby),o=(e.groupby||[]).map(lt),s=UO(BO(),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=>Oe(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function YV(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 uE(e){M.call(this,null,e)}uE.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}]};G(uE,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=PO().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||IO(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=UO(BO(),e)(r,!0),u=zO(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(Oe),n}});const yb="Feature",lE="FeatureCollection",XV="MultiPoint";function cE(e){M.call(this,null,e)}cE.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(cE,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&&Ln,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(xn(a))||o&&t.modified(xn(o))||s&&t.modified(xn(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:yb,geometry:{type:XV,coordinates:i}})),this.value={type:lE,features:n}}});function fE(e){M.call(this,null,e)}fE.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"}]};G(fE,M,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Ln,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=LO(e.projection),n.materialize().reflow()):s=r===Ln||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=KV(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function KV(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function dE(e){M.call(this,null,e)}dE.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"]}]};G(dE,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 hE(e){M.call(this,null,e)}hE.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"}]};G(hE,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=JV(LO(e.projection),e.field||Li("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function JV(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 gE(e){M.call(this,[],e),this.generator=GH()}gE.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}]};G(gE,M,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)be(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(h3(n[0],r)):t.add.push(Oe(r)),n[0]=r,t}});function pE(e){M.call(this,null,e)}pE.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"}]};G(pE,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||Ln,o=ZV(e.opacity,e),s=QV(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Xs(n.map(l=>Xs(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ye({},l,u);i||(f.$max=Xs(c.values||[])),l[a]=eY(c,f,s.dep?s:wn(s(f)),o.dep?o:wn(o(f)))}),t.reflow(!0).modifies(a)}});function QV(e,t){let n;return be(e)?(n=i=>$h(e(i,t)),n.dep=jO(e)):n=wn($h(e||"#888")),n}function ZV(e,t){let n;return be(e)?(n=i=>e(i,t),n.dep=jO(e)):e?n=wn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function jO(e){if(!be(e))return!1;const t=yr(xn(e));return t.$x||t.$y||t.$value||t.$max}function eY(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]:zs,d=Vo(u-s,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-s,l-a),p=g.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);p[y+0]=v.r,p[y+1]=v.g,p[y+2]=v.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function qO(e){M.call(this,null,e),this.modified(!0)}G(qO,M,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=nY(e.type),mb.forEach(i=>{e[i]!=null&&c$(n,i,e[i])})):mb.forEach(i=>{e.modified(i)&&c$(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&tY(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function tY(e,t){const n=iY(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function nY(e){const t=oE((e||"mercator").toLowerCase());return t||L("Unrecognized projection type: "+e),t()}function c$(e,t,n){be(e[t])&&e[t](n)}function iY(e){return e=oe(e),e.length===1?e[0]:{type:lE,features:e.reduce((t,n)=>t.concat(rY(n)),[])}}function rY(e){return e.type===lE?e.features:oe(e).filter(t=>t!=null).map(t=>t.type===yb?t:{type:yb,geometry:t})}const oY=Object.freeze(Object.defineProperty({__proto__:null,contour:uE,geojson:cE,geopath:fE,geopoint:dE,geoshape:hE,graticule:gE,heatmap:pE,isocontour:sE,kde2d:aE,projection:qO},Symbol.toStringTag,{value:"Module"}));function sY(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 aY(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return WO(this.cover(t,n),t,n,e)}function WO(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,g,p,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((p=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|p]))return r[y]=s,e;if(h=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===h&&n===g)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),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function uY(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)WO(this,s[n],a[n],e[n]);return this}function lY(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 cY(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function fY(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 pn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function dY(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,g,p;for(h&&d.push(new pn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(s=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new pn(h[3],m,y,u,l),new pn(h[2],s,y,m,l),new pn(h[1],m,a,u,y),new pn(h[0],s,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}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 w=Math.sqrt(n=v);r=e-w,o=t-w,c=e+w,f=t+w,i=h.data}}return i}function hY(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,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(s+u)/2))?s=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))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 gY(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function pY(){return this._root}function mY(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function yY(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new pn(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 pn(r,l,c,a,u)),(r=i[2])&&t.push(new pn(r,o,c,l,u)),(r=i[1])&&t.push(new pn(r,l,s,a,c)),(r=i[0])&&t.push(new pn(r,o,s,l,c))}return this}function bY(e){var t=[],n=[],i;for(this._root&&t.push(new pn(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 pn(o,s,a,c,f)),(o=r[1])&&t.push(new pn(o,c,a,u,f)),(o=r[2])&&t.push(new pn(o,s,f,c,l)),(o=r[3])&&t.push(new pn(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 xY(e){return e[0]}function vY(e){return arguments.length?(this._x=e,this):this._x}function EY(e){return e[1]}function wY(e){return arguments.length?(this._y=e,this):this._y}function mE(e,t,n){var i=new yE(t??xY,n??EY,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function yE(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 f$(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var $n=mE.prototype=yE.prototype;$n.copy=function(){var e=new yE(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=f$(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]=f$(i));return e};$n.add=aY;$n.addAll=uY;$n.cover=lY;$n.data=cY;$n.extent=fY;$n.find=dY;$n.remove=hY;$n.removeAll=gY;$n.root=pY;$n.size=mY;$n.visit=yY;$n.visitAfter=bY;$n.x=vY;$n.y=wY;function yn(e){return function(){return e}}function jo(e){return(e()-.5)*1e-6}function AY(e){return e.x+e.vx}function SY(e){return e.y+e.vy}function CY(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=yn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<o;++y)for(f=mE(t,AY,SY).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(x,v,w,A,E){var S=x.data,C=x.r,_=p+C;if(S){if(S.index>d.index){var F=h-S.x-S.vx,O=g-S.y-S.vy,T=F*F+O*O;T<_*_&&(F===0&&(F=jo(i),T+=F*F),O===0&&(O=jo(i),T+=O*O),T=(_-(T=Math.sqrt(T)))/T*r,d.vx+=(F*=T)*(_=(C*=C)/(m+C)),d.vy+=(O*=T)*_,S.vx-=F*(_=1-_),S.vy-=O*_)}return}return v>h+_||A<h-_||w>g+_||E<g-_}}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:yn(+l),u(),s):e},s}function $Y(e){return e.index}function d$(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function _Y(e){var t=$Y,n=f,i,r=yn(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,w,A,E,S,C,_;x<b;++x)v=e[x],w=v.source,A=v.target,E=A.x+A.vx-w.x-w.vx||jo(l),S=A.y+A.vy-w.y-w.vy||jo(l),C=Math.sqrt(E*E+S*S),C=(C-o[x])/C*m*i[x],E*=C,S*=C,A.vx-=E*(_=u[x]),A.vy-=S*_,w.vx+=E*(_=1-_),w.vy+=S*_}function h(){if(s){var m,y=s.length,b=e.length,x=new Map(s.map((w,A)=>[t(w,A,s),w])),v;for(m=0,a=new Array(y);m<b;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=d$(x,v.source)),typeof v.target!="object"&&(v.target=d$(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),g(),o=new Array(b),p()}}function g(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){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:yn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:yn(+m),p(),d):r},d}function FY(e,t,n){var i=new u9,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?l9():+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 kY=1664525,DY=1013904223,h$=4294967296;function TY(){let e=1;return()=>(e=(kY*e+DY)%h$)/h$}function MY(e){return e.x}function OY(e){return e.y}var RY=10,NY=Math.PI*(3-Math.sqrt(5));function LY(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=c9(f),l=f9("tick","end"),c=TY();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var x=0;x<p;++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 p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=RY*Math.sqrt(.5+p),x=p*NY;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(s=1-p,t):1-s},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,x=e.length,v,w,A,E,S;for(y==null?y=1/0:y*=y,b=0;b<x;++b)E=e[b],v=p-E.x,w=m-E.y,A=v*v+w*w,A<y&&(S=E,y=A);return S},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function PY(){var e,t,n,i,r=yn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=mE(e,MY,OY).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(o=new Array(g),h=0;h<g;++h)p=e[h],o[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,x,v;if(h.length){for(b=x=v=0;v<4;++v)(p=h[v])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,x+=m*p.y);h.x=b/y,h.y=x/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=o[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,x=m-g,v=y*y+b*b;if(x*x/u<v)return v<a&&(y===0&&(y=jo(n),v+=y*y),b===0&&(b=jo(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=jo(n),v+=y*y),b===0&&(b=jo(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,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:yn(+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 IY(e){var t=yn(.1),n,i,r;typeof e!="function"&&(e=yn(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:yn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:yn(+a),s(),o):e},o}function zY(e){var t=yn(.1),n,i,r;typeof e!="function"&&(e=yn(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:yn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:yn(+a),s(),o):e},o}const g$={center:sY,collide:CY,nbody:PY,link:_Y,x:IY,y:zY},pc="forces",bb=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],BY=["static","iterations"],GO=["x","y","vx","vy"];function bE(e){M.call(this,null,e)}bE.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:GO}]};G(bE,M,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(bb),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&HO(n,e,0,t)):(this.value=n=jY(t.source,e),n.on("tick",UY(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(BY)||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!==pc||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(GO)}});function UY(e,t){return()=>e.touch(t).run()}function jY(e,t){const n=LY(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),HO(n,t,!0).on("end",()=>o=!0)}function HO(e,t,n,i){var r=oe(t.forces),o,s,a,u;for(o=0,s=bb.length;o<s;++o)a=bb[o],a!==pc&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=pc+o,a=n||t.modified(pc,o)?WY(r[o]):i&&qY(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(pc+o,null);return e.numForces=r.length,e}function qY(e,t){var n,i;for(n in e)if(be(i=e[n])&&t.modified(xn(i)))return 1;return 0}function WY(e){var t,n;le(g$,e.force)||L("Unrecognized force: "+e.force),t=g$[e.force]();for(n in e)be(t[n])&&GY(t[n],e[n],e);return t}function GY(e,t,n){e(be(t)?i=>t(i,n):t)}const HY=Object.freeze(Object.defineProperty({__proto__:null,force:bE},Symbol.toStringTag,{value:"Module"}));function VY(e,t){return e.parent===t.parent?1:2}function YY(e){return e.reduce(XY,0)/e.length}function XY(e,t){return e+t.x}function KY(e){return 1+e.reduce(JY,0)}function JY(e,t){return Math.max(e,t.y)}function QY(e){for(var t;t=e.children;)e=t[0];return e}function ZY(e){for(var t;t=e.children;)e=t[t.length-1];return e}function eX(){var e=VY,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=YY(h),d.y=KY(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=QY(o),l=ZY(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 tX(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 nX(){return this.eachAfter(tX)}function iX(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function rX(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 oX(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 sX(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function aX(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 uX(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function lX(e){for(var t=this,n=cX(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 cX(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 fX(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function dX(){return Array.from(this)}function hX(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function gX(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*pX(){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 xE(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=bX)):t===void 0&&(t=yX);for(var n=new Uu(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 Uu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(VO)}function mX(){return xE(this).eachBefore(xX)}function yX(e){return e.children}function bX(e){return Array.isArray(e)?e[1]:null}function xX(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function VO(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Uu(e){this.data=e,this.depth=this.height=0,this.parent=null}Uu.prototype=xE.prototype={constructor:Uu,count:nX,each:iX,eachAfter:oX,eachBefore:rX,find:sX,sum:aX,sort:uX,path:lX,ancestors:fX,descendants:dX,leaves:hX,links:gX,copy:mX,[Symbol.iterator]:pX};function dh(e){return e==null?null:YO(e)}function YO(e){if(typeof e!="function")throw new Error;return e}function Ws(){return 0}function su(e){return function(){return e}}const vX=1664525,EX=1013904223,p$=4294967296;function wX(){let e=1;return()=>(e=(vX*e+EX)%p$)/p$}function AX(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SX(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 CX(e,t){for(var n=0,i=(e=SX(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&XO(s,o)?++n:(s=_X(r=$X(r,o)),n=0);return s}function $X(e,t){var n,i;if(Km(t,e))return[t];for(n=0;n<e.length;++n)if(Td(t,e[n])&&Km(mc(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(Td(mc(e[n],e[i]),t)&&Td(mc(e[n],t),e[i])&&Td(mc(e[i],t),e[n])&&Km(KO(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Td(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 XO(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 Km(e,t){for(var n=0;n<t.length;++n)if(!XO(e,t[n]))return!1;return!0}function _X(e){switch(e.length){case 1:return FX(e[0]);case 2:return mc(e[0],e[1]);case 3:return KO(e[0],e[1],e[2])}}function FX(e){return{x:e.x,y:e.y,r:e.r}}function mc(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 KO(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,g=r-a,p=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,w=h*g-d*p,A=(g*v-p*x)/(w*2)-i,E=(p*m-g*y)/w,S=(h*x-d*v)/(w*2)-r,C=(d*y-h*m)/w,_=E*E+C*C-1,F=2*(o+A*E+S*C),O=A*A+S*S-o*o,T=-(Math.abs(_)>1e-6?(F+Math.sqrt(F*F-4*_*O))/(2*_):O/F);return{x:i+A+E*T,y:r+S+C*T,r:T}}function m$(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 y$(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 b$(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 Md(e){this._=e,this.next=null,this.previous=null}function kX(e,t){if(!(o=(e=AX(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;m$(i,n,r=e[2]),n=new Md(n),i=new Md(i),r=new Md(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){m$(n._,i._,r=e[u]),r=new Md(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(y$(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(y$(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=b$(n);(r=r.next)!==i;)(a=b$(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=CX(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function DX(e){return Math.sqrt(e.value)}function TX(){var e=null,t=1,n=1,i=Ws;function r(o){const s=wX();return o.x=t/2,o.y=n/2,e?o.eachBefore(x$(e)).eachAfter(Jm(i,.5,s)).eachBefore(v$(1)):o.eachBefore(x$(DX)).eachAfter(Jm(Ws,1,s)).eachAfter(Jm(i,o.r/Math.min(t,n),s)).eachBefore(v$(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=dh(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:su(+o),r):i},r}function x$(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jm(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=kX(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function v$(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 JO(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 If(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 MX(){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(JO),s}function o(s,a){return function(u){u.children&&If(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 OX={depth:-1},E$={},Qm={};function RX(e){return e.id}function NX(e){return e.parentId}function w$(){var e=RX,t=NX,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=o.map((v,w)=>LX(n(v,w,r))),b=y.map(A$),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(A$(v)),o.push(Qm));s=(v,w)=>y[w],a=(v,w)=>b[w]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new Uu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?E$:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=o[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===E$)throw new Error("ambiguous: "+g);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===Qm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Qm);--y)h.data=null}if(f.parent=OX,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(VO),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=dh(r),i):e},i.parentId=function(r){return arguments.length?(t=dh(r),i):t},i.path=function(r){return arguments.length?(n=dh(r),i):n},i}function LX(e){e=`${e}`;let t=e.length;return xb(e,t-1)&&!xb(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function A$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!xb(e,t););return e.slice(0,t)}function xb(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function PX(e,t){return e.parent===t.parent?1:2}function Zm(e){var t=e.children;return t?t[0]:e.t}function e1(e){var t=e.children;return t?t[t.length-1]:e.t}function IX(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 zX(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 BX(e,t,n){return e.a.parent===t.parent?e.a:n}function hh(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}hh.prototype=Object.create(Uu.prototype);function UX(e){for(var t=new hh(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 hh(o[s],s)),r.parent=n;return(t.parent=new hh(null,0)).children=[t],t}function jX(){var e=PX,t=1,n=1,i=null;function r(l){var c=UX(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 g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*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){zX(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,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,x=p.m,v;g=e1(g),d=Zm(d),g&&d;)p=Zm(p),h=e1(h),h.a=l,v=g.z+b-d.z-m+e(g._,d._),v>0&&(IX(BX(g,l,f),l,v),m+=v,y+=v),b+=g.m,m+=d.m,x+=p.m,y+=h.m;g&&!e1(h)&&(h.t=g,h.m+=b-y),d&&!Zm(p)&&(p.t=d,p.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 i0(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 QO=(1+Math.sqrt(5))/2;function ZO(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,x,v,w,A;c<d;){h=r-n,g=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,w=Math.max(g/h,h/g)/(p*e),A=m*m*w,v=Math.max(b/A,A/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),A=m*m*w,x=Math.max(b/A,A/y),x>v){m-=l;break}v=x}s.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?If(u,n,i,r,p?i+=g*m/p:o):i0(u,n,i,p?n+=h*m/p:r,o),p-=m,c=f}return s}const eR=function e(t){function n(i,r,o,s,a){ZO(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(QO);function qX(){var e=eR,t=!1,n=1,i=1,r=[0],o=Ws,s=Ws,a=Ws,u=Ws,l=Ws;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(JO),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,g+=l(d)-h,p+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,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=YO(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:su(+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:su(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:su(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:su(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:su(+d),c):l},c}function WX(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,g,p,m,y){if(f>=d-1){var b=o[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var x=l[f],v=h/2+x,w=f+1,A=d-1;w<A;){var E=w+A>>>1;l[E]<v?w=E+1:A=E}v-l[w-1]<l[w]-v&&f+1<w&&--w;var S=l[w]-x,C=h-S;if(m-g>y-p){var _=h?(g*C+m*S)/h:m;c(f,w,S,g,p,_,y),c(w,d,C,_,p,m,y)}else{var F=h?(p*C+y*S)/h:y;c(f,w,S,g,p,m,F),c(w,d,C,g,F,m,y)}}}function GX(e,t,n,i,r){(e.depth&1?i0:If)(e,t,n,i,r)}const HX=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,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?If(l,r,o,s,p?o+=(a-o)*l.value/p:a):i0(l,r,o,p?r+=(s-r)*l.value/p:s,a),p-=l.value}else i._squarify=u=ZO(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(QO);function vb(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function vE(e){M.call(this,null,e)}vE.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const VX=e=>e.values;G(vE,M,{transform(e,t){t.source||L("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&&wp(s.data)&&r.rem.push(s.data)}),this.value=o=xE({values:oe(e.keys).reduce((s,a)=>(s.key(a),s),YX()).entries(r.source)},VX),n&&o.each(s=>{s.children&&(s=Oe(s.data),r.add.push(s),r.source.push(s))}),vb(o,te,te)),r.source.root=o,r}});function YX(){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 xo(e){M.call(this,null,e)}const XX=(e,t)=>e.parent===t.parent?1:2;G(xo,M,{transform(e,t){(!t.source||!t.source.root)&&L(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(Da(e.sort,s=>s.data)),KX(n,this.params,e),n.separation&&n.separation(e.separation!==!1?XX:bf);try{this.value=n(r)}catch(s){L(s)}return r.each(s=>JX(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function KX(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 JX(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 Eb=["x","y","r","depth","children"];function EE(e){xo.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:Eb.length,default:Eb}]};G(EE,xo,{layout:TX,params:["radius","size","padding"],fields:Eb});const wb=["x0","y0","x1","y1","depth","children"];function wE(e){xo.call(this,e)}wE.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:wb.length,default:wb}]};G(wE,xo,{layout:MX,params:["size","round","padding"],fields:wb});function AE(e){M.call(this,null,e)}AE.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(AE,M,{transform(e,t){t.source||L("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?vb(w$().id(e.key).parentId(e.parentKey)(r.source),e.key,Pi):vb(w$()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const S$={tidy:jX,cluster:eX},Ab=["x","y","depth","children"];function SE(e){xo.call(this,e)}SE.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:Ab.length,default:Ab}]};G(SE,xo,{layout(e){const t=e||"tidy";if(le(S$,t))return S$[t]();L("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Ab});function CE(e){M.call(this,[],e)}CE.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(CE,M,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||L("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[te(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[te(a)]&&o[te(u)]&&r.add.push(Oe({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[te(s)]=1),n.forEach(s=>{(o[te(s.source)]||o[te(s.target)])&&r.mod.push(s)})),r}});const C$={binary:WX,dice:If,slice:i0,slicedice:GX,squarify:eR,resquarify:HX},Sb=["x0","y0","x1","y1","depth","children"];function $E(e){xo.call(this,e)}$E.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:Sb.length,default:Sb}]};G($E,xo,{layout(){const e=qX();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{le(C$,t)?e.tile(C$[t]):L("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Sb});const QX=Object.freeze(Object.defineProperty({__proto__:null,nest:vE,pack:EE,partition:wE,stratify:AE,tree:SE,treelinks:CE,treemap:$E},Symbol.toStringTag,{value:"Module"})),t1=4278190080;function ZX(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function eK(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=Vo(o,s).getContext("2d"),l=Vo(o,s).getContext("2d"),c=a&&Vo(o,s).getContext("2d");n.forEach(S=>gh(u,S,!1)),gh(l,t,!1),a&&gh(c,t,!0);const f=n1(u,o,s),d=n1(l,o,s),h=a&&n1(c,o,s),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,x,v,w,A,E;for(y=0;y<s;++y)for(m=0;m<o;++m)v=y*o+m,w=f[v]&t1,E=d[v]&t1,A=a&&h[v]&t1,(w||A||E)&&(b=e(m),x=e(y),!r&&(w||E)&&g.set(b,x),a&&(w||A)&&p.set(b,x));return[g,p]}function n1(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function gh(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>gh(e,o.items,n))}):ni[i].draw(e,{items:n?t.map(tK):t})}function tK(e){const t=Ap(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Br=5,un=31,Qc=32,Oo=new Uint32Array(Qc+1),Fi=new Uint32Array(Qc+1);Fi[0]=0;Oo[0]=~Fi[0];for(let e=1;e<=Qc;++e)Fi[e]=Fi[e-1]<<1|1,Oo[e]=~Fi[e];function nK(e,t){const n=new Uint32Array(~~((e*t+Qc)/Qc));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>>>Br]&1<<(a&un)},set:(o,s)=>{const a=s*e+o;i(a>>>Br,1<<(a&un))},clear:(o,s)=>{const a=s*e+o;r(a>>>Br,~(1<<(a&un)))},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>>>Br,h=f>>>Br,d===h){if(n[d]&Oo[c&un]&Fi[(f&un)+1])return!0}else{if(n[d]&Oo[c&un]||n[h]&Fi[(f&un)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])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>>>Br,d=c>>>Br,f===d)i(f,Oo[l&un]&Fi[(c&un)+1]);else for(i(f,Oo[l&un]),i(d,Fi[(c&un)+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>>>Br,d=c>>>Br,f===d)r(f,Fi[l&un]|Oo[(c&un)+1]);else for(r(f,Fi[l&un]),r(d,Oo[(c&un)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function iK(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=()=>nK(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function rK(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=Jn.width(s.datum,s.datum.text);let f=0,d,h,g,p,m,y,b;for(let x=0;x<u;++x)d=a[x].x,g=a[x].y,h=a[x].x2===void 0?d:a[x].x2,p=a[x].y2===void 0?g:a[x].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),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,g=s.y-y,p=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",g<0&&p<=o?s.baseline="top":0<=g&&o<p&&(s.baseline="bottom"),!0}}function $g(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 qo(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 oK(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 g=e.invert(l),p=e.invert(c);let m=f,y=o,b;if(!$g(g,p,d,h,r,o)&&!qo(e,g,p,h,d,m,s,a)&&!qo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,qo(e,g,p,h,d,b,s,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Jn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,x,v,w,A,E,S,C,_,F,O,T,k,$,D,P,z;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,w=c[I].y2===void 0?v:c[I].y2,b>x&&(z=b,b=x,x=z),v>w&&(z=v,v=w,w=z),_=e(b),O=e(x),F=~~((_+O)/2),T=e(v),$=e(w),k=~~((T+$)/2),S=F;S>=_;--S)for(C=k;C>=T;--C)P=u(S,C,g,h,d),P&&([l.x,l.y,g,p]=P);for(S=F;S<=O;++S)for(C=k;C<=$;++C)P=u(S,C,g,h,d),P&&([l.x,l.y,g,p]=P);!p&&!n&&(D=Math.abs(x-b+w-v),A=(b+x)/2,E=(v+w)/2,D>=y&&!$g(A,E,h,d,r,o)&&!qo(e,A,E,d,h,d,s,null)&&(y=D,l.x=A,l.y=E,m=!0))}return p||m?(A=h/2,E=d/2,s.setRange(e(l.x-A),e(l.y-E),e(l.x+A),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const sK=[-1,-1,1,1],aK=[-1,1,-1,1];function uK(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=Jn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,x,v,w,A,E,S,C,_,F,O,T,k;for(let $=0;$<f;++$){for(x=c[$].x,w=c[$].y,v=c[$].x2===void 0?x:c[$].x2,A=c[$].y2===void 0?w:c[$].y2,g.push([e((x+v)/2),e((w+A)/2)]);g.length;)if([C,_]=g.pop(),!(s.get(C,_)||a.get(C,_)||u.get(C,_))){u.set(C,_);for(let D=0;D<4;++D)E=C+sK[D],S=_+aK[D],u.outOfBounds(E,S,E,S)||g.push([E,S]);if(E=e.invert(C),S=e.invert(_),F=p,O=o,!$g(E,S,h,d,r,o)&&!qo(e,E,S,d,h,F,s,a)&&!qo(e,E,S,d,h,d,s,null)){for(;O-F>=1;)T=(F+O)/2,qo(e,E,S,d,h,T,s,a)?O=T:F=T;F>p&&(l.x=E,l.y=S,p=F,m=!0)}}!m&&!n&&(k=Math.abs(v-x+A-w),E=(x+v)/2,S=(w+A)/2,k>=b&&!$g(E,S,h,d,r,o)&&!qo(e,E,S,d,h,d,s,null)&&(b=k,l.x=E,l.y=S,y=!0))}return m||y?(E=h/2,S=d/2,s.setRange(e(l.x-E),e(l.y-S),e(l.x+E),e(l.y+S)),l.align="center",l.baseline="middle",!0):!1}}const lK=["right","center","left"],cK=["bottom","middle","top"];function fK(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,g,p,m,y,b,x,v,w,A,E,S,C,_,F;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,g=(n[O]>>>2&3)-1,p=h===0&&g===0||i[O]<0,m=h&&g?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,E=c[4+g]+y*f*g/2+i[O]*g*m,v=E-f/2,w=E+f/2,S=e(b),_=e(v),F=e(w),!d)if($$(S,S,_,F,s,a,b,b,v,w,c,p))d=Jn.width(l.datum,l.datum.text);else continue;if(A=b+y*d*h/2,b=A-d/2,x=A+d/2,S=e(b),C=e(x),$$(S,C,_,F,s,a,b,x,v,w,c,p))return l.x=h?h*y<0?x:b:A,l.y=g?g*y<0?w:v:E,l.align=lK[h*y+1],l.baseline=cK[g*y+1],s.setRange(S,_,C,F),!0}return!1}}function $$(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 i1=0,r1=4,o1=8,s1=0,a1=1,u1=2,dK={"top-left":i1+s1,top:i1+a1,"top-right":i1+u1,left:r1+s1,middle:r1+a1,right:r1+u1,"bottom-left":o1+s1,bottom:o1+a1,"bottom-right":o1+u1},hK={naive:rK,"reduced-search":oK,floodfill:uK};function gK(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=pK(i,f),h=mK(r,f),g=yK(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=bK(g,p,a,u),b=l===null||l===1/0,x=m&&c==="naive";let v=-1,w=-1;const A=e.map(_=>{const F=b?Jn.width(_,_.text):void 0;return v=Math.max(v,F),w=Math.max(w,_.fontSize),{datum:_,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(_),textWidth:F}});l=l===null||l===1/0?Math.max(v,w)+Math.max(...i):l;const E=iK(t[0],t[1],l);let S;if(!x){n&&A.sort((O,T)=>n(O.datum,T.datum));let _=!1;for(let O=0;O<h.length&&!_;++O)_=h[O]===5||d[O]<0;const F=(g&&s||m)&&e.map(O=>O.datum);S=o.length||F?eK(E,F||[],o,_,m):ZX(E,s&&A)}const C=m?hK[c](E,S,s,u):fK(E,S,h,d);return A.forEach(_=>_.opacity=+C(_)),A}function pK(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 mK(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=dK[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function yK(e){return e&&e.mark&&e.mark.marktype}function bK(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 Cb=["x","y","opacity","align","baseline"],tR=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function _E(e){M.call(this,null,e)}_E.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:tR},{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:Cb.length,default:Cb}]};G(_E,M,{transform(e,t){function n(o){const s=e[o];return be(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)&&L("Size parameter should be specified as a [width, height] array.");const r=e.as||Cb;return gK(t.materialize(t.SOURCE).source||[],e.size,e.sort,oe(e.offset==null?1:e.offset),oe(e.anchor||tR),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 xK=Object.freeze(Object.defineProperty({__proto__:null,label:_E},Symbol.toStringTag,{value:"Module"}));function nR(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 FE(e){M.call(this,null,e)}FE.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}]};G(FE,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=nR(i,e.groupby),o=(e.groupby||[]).map(lt),s=o.length,a=e.as||[lt(e.x),lt(e.y)],u=[];r.forEach(l=>{T3(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(Oe(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const $b={constant:hv,linear:gv,log:_3,exp:F3,pow:k3,quad:pv,poly:D3},vK=(e,t)=>e==="poly"?t:e==="quad"?2:1;function kE(e){M.call(this,null,e)}kE.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($b)},{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}]};G(kE,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=nR(i,e.groupby),o=(e.groupby||[]).map(lt),s=e.method||"linear",a=e.order==null?3:e.order,u=vK(s,a),l=e.as||[lt(e.x),lt(e.y)],c=$b[s],f=[];let d=e.extent;le($b,s)||L("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 p=c(h,e.x,e.y,a);if(e.params){f.push(Oe({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||lo(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(Oe(x))};s==="linear"||s==="constant"?m.forEach(b=>y([b,p.predict(b)])):Dp(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const EK=Object.freeze(Object.defineProperty({__proto__:null,loess:FE,regression:kE},Symbol.toStringTag,{value:"Module"})),io=11102230246251565e-32,Xt=134217729,wK=(3+8*io)*io;function l1(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 AK(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function zf(e){return new Float64Array(e)}const SK=(3+16*io)*io,CK=(2+12*io)*io,$K=(9+64*io)*io*io,eu=zf(4),_$=zf(8),F$=zf(12),k$=zf(16),ln=zf(4);function _K(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,g,p,m,y,b,x,v,w,A,E,S;const C=e-r,_=n-r,F=t-o,O=i-o;v=C*O,d=Xt*C,h=d-(d-C),g=C-h,d=Xt*O,p=d-(d-O),m=O-p,w=g*m-(v-h*p-g*p-h*m),A=F*_,d=Xt*F,h=d-(d-F),g=F-h,d=Xt*_,p=d-(d-_),m=_-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,eu[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,eu[1]=x-(y+f)+(f-A),S=b+y,f=S-b,eu[2]=b-(S-f)+(y-f),eu[3]=S;let T=AK(4,eu),k=CK*s;if(T>=k||-T>=k||(f=e-C,a=e-(C+f)+(f-r),f=n-_,l=n-(_+f)+(f-r),f=t-F,u=t-(F+f)+(f-o),f=i-O,c=i-(O+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(k=$K*s+wK*Math.abs(T),T+=C*c+O*a-(F*l+_*u),T>=k||-T>=k))return T;v=a*O,d=Xt*a,h=d-(d-a),g=a-h,d=Xt*O,p=d-(d-O),m=O-p,w=g*m-(v-h*p-g*p-h*m),A=u*_,d=Xt*u,h=d-(d-u),g=u-h,d=Xt*_,p=d-(d-_),m=_-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const $=l1(4,eu,4,ln,_$);v=C*c,d=Xt*C,h=d-(d-C),g=C-h,d=Xt*c,p=d-(d-c),m=c-p,w=g*m-(v-h*p-g*p-h*m),A=F*l,d=Xt*F,h=d-(d-F),g=F-h,d=Xt*l,p=d-(d-l),m=l-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const D=l1($,_$,4,ln,F$);v=a*c,d=Xt*a,h=d-(d-a),g=a-h,d=Xt*c,p=d-(d-c),m=c-p,w=g*m-(v-h*p-g*p-h*m),A=u*l,d=Xt*u,h=d-(d-u),g=u-h,d=Xt*l,p=d-(d-l),m=l-p,E=g*m-(A-h*p-g*p-h*m),y=w-E,f=w-y,ln[0]=w-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-A,f=x-y,ln[1]=x-(y+f)+(f-A),S=b+y,f=S-b,ln[2]=b-(S-f)+(y-f),ln[3]=S;const P=l1(D,F$,4,ln,k$);return k$[P-1]}function Od(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)>=SK*l?u:-_K(e,t,n,i,r,o,l)}const D$=Math.pow(2,-52),Rd=new Uint32Array(512);class _g{static from(t,n=MK,i=OK){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 _g(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 C=0;C<s;C++){const _=t[2*C],F=t[2*C+1];_<a&&(a=_),F<u&&(u=F),_>l&&(l=_),F>c&&(c=F),this._ids[C]=C}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let C=0,_=1/0;C<s;C++){const F=c1(f,d,t[2*C],t[2*C+1]);F<_&&(h=C,_=F)}const m=t[2*h],y=t[2*h+1];for(let C=0,_=1/0;C<s;C++){if(C===h)continue;const F=c1(m,y,t[2*C],t[2*C+1]);F<_&&F>0&&(g=C,_=F)}let b=t[2*g],x=t[2*g+1],v=1/0;for(let C=0;C<s;C++){if(C===h||C===g)continue;const _=DK(m,y,b,x,t[2*C],t[2*C+1]);_<v&&(p=C,v=_)}let w=t[2*p],A=t[2*p+1];if(v===1/0){for(let F=0;F<s;F++)this._dists[F]=t[2*F]-t[0]||t[2*F+1]-t[1];du(this._ids,this._dists,0,s-1);const C=new Uint32Array(s);let _=0;for(let F=0,O=-1/0;F<s;F++){const T=this._ids[F],k=this._dists[T];k>O&&(C[_++]=T,O=k)}this.hull=C.subarray(0,_),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Od(m,y,b,x,w,A)<0){const C=g,_=b,F=x;g=p,b=w,x=A,p=C,w=_,A=F}const E=TK(m,y,b,x,w,A);this._cx=E.x,this._cy=E.y;for(let C=0;C<s;C++)this._dists[C]=c1(t[2*C],t[2*C+1],E.x,E.y);du(this._ids,this._dists,0,s-1),this._hullStart=h;let S=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,x)]=g,o[this._hashKey(w,A)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let C=0,_,F;C<this._ids.length;C++){const O=this._ids[C],T=t[2*O],k=t[2*O+1];if(C>0&&Math.abs(T-_)<=D$&&Math.abs(k-F)<=D$||(_=T,F=k,O===h||O===g||O===p))continue;let $=0;for(let V=0,ue=this._hashKey(T,k);V<this._hashSize&&($=o[(ue+V)%this._hashSize],!($!==-1&&$!==i[$]));V++);$=n[$];let D=$,P;for(;P=i[D],Od(T,k,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 z=this._addTriangle(D,O,i[D],-1,-1,r[D]);r[O]=this._legalize(z+2),r[D]=z,S++;let I=i[D];for(;P=i[I],Od(T,k,t[2*I],t[2*I+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(I,O,P,r[O],-1,r[I]),r[O]=this._legalize(z+2),i[I]=I,S--,I=P;if(D===$)for(;P=n[D],Od(T,k,t[2*P],t[2*P+1],t[2*D],t[2*D+1])<0;)z=this._addTriangle(P,O,D,-1,r[D],r[P]),this._legalize(z+2),r[P]=z,i[D]=D,S--,D=P;this._hullStart=n[O]=D,i[D]=n[I]=O,i[O]=I,o[this._hashKey(T,k)]=O,o[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(S);for(let C=0,_=this._hullStart;C<S;C++)this.hull[C]=_,_=i[_];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(FK(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=Rd[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],g=n[c],p=n[f];if(kK(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,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<Rd.length&&(Rd[o++]=b)}else{if(o===0)break;t=Rd[--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 FK(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function c1(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function kK(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,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function DK(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,g=(s*f-u*c)*d;return h*h+g*g}function TK(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,g=t+(s*f-u*c)*d;return{x:h,y:g}}function du(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;Ul(e,r,o),t[e[n]]>t[e[i]]&&Ul(e,n,i),t[e[o]]>t[e[i]]&&Ul(e,o,i),t[e[n]]>t[e[o]]&&Ul(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;Ul(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(du(e,t,o,i),du(e,t,n,s-1)):(du(e,t,n,s-1),du(e,t,o,i))}}function Ul(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function MK(e){return e[0]}function OK(e){return e[1]}const T$=1e-6;class Vs{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)>T$||Math.abs(this._y1-o)>T$)&&(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 _b{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 RK=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 p=0,m=0,y=i.length,b,x;p<y;p+=3,m+=2){const v=i[p]*2,w=i[p+1]*2,A=i[p+2]*2,E=t[v],S=t[v+1],C=t[w],_=t[w+1],F=t[A],O=t[A+1],T=C-E,k=_-S,$=F-E,D=O-S,P=(T*D-k*$)*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 z=1e9*Math.sign((o-E)*D-(s-S)*$);b=(E+F)/2-z*D,x=(S+O)/2+z*$}else{const z=1/P,I=T*T+k*k,V=$*$+D*D;b=E+(D*I-k*V)*z,x=S+(T*V-$*I)*z}a[m]=b,a[m+1]=x}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Vs: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,g=Math.floor(d/3)*2,p=s[h],m=s[h+1],y=s[g],b=s[g+1];this._renderSegment(p,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],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Vs: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 Vs: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 _b;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 g,p,m,y,b;if(l===0){if((g=this._clipSegment(o,s,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,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 NK=2*Math.PI,tu=Math.pow;function LK(e){return e[0]}function PK(e){return e[1]}function IK(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 zK(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class DE{static from(t,n=LK,i=PK,r){return new DE("length"in t?BK(t,n,i,r):Float64Array.from(UK(t,n,i,r)))}constructor(t){this._delaunator=new _g(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&&IK(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 g=zK(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new _g(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 RK(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=tu(n-l[t*2],2)+tu(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=tu(n-l[g*2],2)+tu(i-l[g*2+1],2);if(p<f&&(f=p,c=g),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!==g&&tu(n-l[h*2],2)+tu(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Vs: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 Vs: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,NK)}return i&&i.value()}renderHull(t){const n=t==null?t=new Vs: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 _b;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Vs: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 _b;return this.renderTriangle(t,n),n.value()}}function BK(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*UK(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 TE(e){M.call(this,null,e)}TE.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 jK=[-1e5,-1e5,1e5,1e5];G(TE,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]]:jK;const o=this.value=DE.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&&!WK(u)?qK(u):null}return t.reflow(e.modified()).modifies(n)}});function qK(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 WK(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const GK=Object.freeze(Object.defineProperty({__proto__:null,voronoi:TE},Symbol.toStringTag,{value:"Module"}));var f1=Math.PI/180,yc=64,ph=2048;function HK(){var e=[256,256],t,n,i,r,o,s,a,u=iR,l=[],c=Math.random,f={};f.layout=function(){for(var g=d(Vo()),p=QK((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,x=[],v=l.map(A=>({text:t(A),font:n(A),style:r(A),weight:o(A),rotate:s(A),size:~~(i(A)+1e-14),padding:a(A),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:A})).sort((A,E)=>E.size-A.size);++b<y;){var w=v[b];w.x=e[0]*(c()+.5)>>1,w.y=e[1]*(c()+.5)>>1,VK(g,w,v,b),w.hasText&&h(p,w,m)&&(x.push(w),m?XK(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}return x};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(yc<<5)/p,g.height=ph/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,x=Math.hypot(e[0],e[1]),v=u(e),w=c()<.5?1:-1,A=-w,E,S,C;(E=v(A+=w))&&(S=~~E[0],C=~~E[1],!(Math.min(Math.abs(S),Math.abs(C))>=x));)if(p.x=y+S,p.y=b+C,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!YK(p,g,e[0]))&&(!m||KK(p,m))){for(var _=p.sprite,F=p.width>>5,O=e[0]>>5,T=p.x-(F<<4),k=T&127,$=32-k,D=p.y1-p.y0,P=(p.y+p.y0)*O+(T>>5),z,I=0;I<D;I++){z=0;for(var V=0;V<=F;V++)g[P+V]|=z<<$|(V<F?(z=_[I*F+V])>>>k:0);P+=O}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=Cs(g),f):n},f.fontStyle=function(g){return arguments.length?(r=Cs(g),f):r},f.fontWeight=function(g){return arguments.length?(o=Cs(g),f):o},f.rotate=function(g){return arguments.length?(s=Cs(g),f):s},f.text=function(g){return arguments.length?(t=Cs(g),f):t},f.spiral=function(g){return arguments.length?(u=ZK[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=Cs(g),f):i},f.padding=function(g){return arguments.length?(a=Cs(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function VK(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(yc<<5)/o,ph/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,g;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 p=Math.sin(t.rotate*f1),m=Math.cos(t.rotate*f1),y=c*m,b=c*p,x=d*m,v=d*p;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>=yc<<5&&(s=0,a+=u,u=0),a+d>=ph)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*f1),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 w=r.getImageData(0,0,(yc<<5)/o,ph/o).data,A=[];--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++)A[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var E=0,S=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var C=f*g+(h>>5),_=w[(a+g)*(yc<<5)+(s+h)<<2]?1<<31-h%32:0;A[C]|=_,E|=_}E?S=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+S,t.sprite=A.slice(0,(t.y1-t.y0)*f)}}}function YK(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 XK(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 KK(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 iR(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function JK(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 QK(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Cs(e){return typeof e=="function"?e:function(){return e}}var ZK={archimedean:iR,rectangular:JK};const rR=["x","y","font","fontSize","fontStyle","fontWeight","angle"],eJ=["text","font","rotate","fontSize","fontStyle","fontWeight"];function ME(e){M.call(this,HK(),e)}ME.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:rR}]};G(ME,M,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&L("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return be(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||eJ.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||rR;let a=e.fontSize||14,u;if(be(a)?u=e.fontSizeRange:a=wn(a),u){const g=a,p=Me("sqrt")().domain(lo(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[s[0]]=NaN,g[s[1]]=NaN,g[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(mi).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[s[0]]=p.x+f,m[s[1]]=p.y+d,m[s[2]]=p.font,m[s[3]]=p.size,m[s[4]]=p.style,m[s[5]]=p.weight,m[s[6]]=p.rotate;return t.reflow(i).modifies(s)}});const tJ=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:ME},Symbol.toStringTag,{value:"Module"})),nJ=e=>new Uint8Array(e),iJ=e=>new Uint16Array(e),Tc=e=>new Uint32Array(e);function rJ(){let e=8,t=[],n=Tc(0),i=Nd(0,e),r=Nd(0,e);return{data:()=>t,seen:()=>n=oJ(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=Nd(o,e,i),r=Nd(o,e))}}}function oJ(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Nd(e,t,n){const i=(t<257?nJ:t<65537?iJ:Tc)(e);return n&&i.set(n),i}function M$(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=Tc(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Tc(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=sJ(h,d),c)g=t,p=e,t=Array(c+f),e=Tc(c+f),aJ(l,g,p,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),[W8(u,a[0],0,l),Cu(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function sJ(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),lI(e,t)}function aJ(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 OE(e){M.call(this,rJ(),e),this._indices=null,this._dims=null}OE.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}}]};G(OE,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(M$(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,g={};let p,m,y,b,x,v,w,A,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,w=0,A=b.length;w<A;++w)v[b[w]._index]=1;for(w=0;w<h;++w)E=i[w],(!s[w]||e.modified("fields",w)||t.modified(E.fields))&&(y=E.fname,(p=g[y])||(o[y]=m=O$(),g[y]=p=m.insert(E,t.source,0)),s[w]=M$(m,w,r[w]).onAdd(p,u));for(w=0,A=a.data().length;w<A;++w)x[w]||(l[w]!==u[w]?f.push(w):v[w]&&u[w]!==c&&d.push(w));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,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=s[g].insert(a[h],i,d)),o[h].onAdd(p,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,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=g=o[h],o[h]=a,g!==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],g=l[1],p=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]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;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 g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=s[g],o[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=s[g],o[m]^=h,i.push(m);e.range=t.slice()}});function RE(e){M.call(this,null,e)}RE.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."}]};G(RE,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 uJ=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:OE,resolvefilter:RE},Symbol.toStringTag,{value:"Module"})),lJ="RawCode",da="Literal",cJ="Property",fJ="Identifier",dJ="ArrayExpression",hJ="BinaryExpression",oR="CallExpression",gJ="ConditionalExpression",pJ="LogicalExpression",mJ="MemberExpression",yJ="ObjectExpression",bJ="UnaryExpression";function Wi(e){this.type=e}Wi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=xJ(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function xJ(e){switch(e.type){case dJ:return e.elements;case hJ:case pJ:return[e.left,e.right];case oR:return[e.callee].concat(e.arguments);case gJ:return[e.test,e.consequent,e.alternate];case mJ:return[e.object,e.property];case yJ:return e.properties;case cJ:return[e.key,e.value];case bJ:return[e.argument];case fJ:case da:case lJ:default:return[]}}var kr,K,R,rn,Pe,r0=1,Bf=2,ha=3,fs=4,o0=5,Oa=6,kn=7,Uf=8,vJ=9;kr={};kr[r0]="Boolean";kr[Bf]="<end>";kr[ha]="Identifier";kr[fs]="Keyword";kr[o0]="Null";kr[Oa]="Numeric";kr[kn]="Punctuator";kr[Uf]="String";kr[vJ]="RegularExpression";var EJ="ArrayExpression",wJ="BinaryExpression",AJ="CallExpression",SJ="ConditionalExpression",sR="Identifier",CJ="Literal",$J="LogicalExpression",_J="MemberExpression",FJ="ObjectExpression",kJ="Property",DJ="UnaryExpression",Ct="Unexpected token %0",TJ="Unexpected number",MJ="Unexpected string",OJ="Unexpected identifier",RJ="Unexpected reserved word",NJ="Unexpected end of input",Fb="Invalid regular expression",d1="Invalid regular expression: missing /",aR="Octal literals are not allowed in strict mode.",LJ="Duplicate data property in object literal not allowed in strict mode",Bt="ILLEGAL",Zc="Disabled.",PJ=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]"),IJ=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 s0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Wr(e){return e>=48&&e<=57}function NE(e){return"0123456789abcdefABCDEF".includes(e)}function Mc(e){return"01234567".includes(e)}function zJ(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 ef(e){return e===10||e===13||e===8232||e===8233}function jf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&PJ.test(String.fromCharCode(e))}function Fg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&IJ.test(String.fromCharCode(e))}const BJ={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 uR(){for(;R<rn;){const e=K.charCodeAt(R);if(zJ(e)||ef(e))++R;else break}}function kb(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<rn&&NE(K[R])?(i=K[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):ke({},Ct,Bt);return String.fromCharCode(r)}function UJ(){var e,t,n,i;for(e=K[R],t=0,e==="}"&&ke({},Ct,Bt);R<rn&&(e=K[R++],!!NE(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&ke({},Ct,Bt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function lR(){var e,t;for(e=K.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(K.charCodeAt(R)!==117&&ke({},Ct,Bt),++R,e=kb("u"),(!e||e==="\\"||!jf(e.charCodeAt(0)))&&ke({},Ct,Bt),t=e);R<rn&&(e=K.charCodeAt(R),!!Fg(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),K.charCodeAt(R)!==117&&ke({},Ct,Bt),++R,e=kb("u"),(!e||e==="\\"||!Fg(e.charCodeAt(0)))&&ke({},Ct,Bt),t+=e);return t}function jJ(){var e,t;for(e=R++;R<rn;){if(t=K.charCodeAt(R),t===92)return R=e,lR();if(Fg(t))++R;else break}return K.slice(e,R)}function qJ(){var e,t,n;return e=R,t=K.charCodeAt(R)===92?lR():jJ(),t.length===1?n=ha:BJ.hasOwnProperty(t)?n=fs:t==="null"?n=o0:t==="true"||t==="false"?n=r0:n=ha,{type:n,value:t,start:e,end:R}}function h1(){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==="//"&&ke({},Ct,Bt),"<>=!+-*%&|^/".includes(i))return++R,{type:kn,value:i,start:e,end:R};ke({},Ct,Bt)}function WJ(e){let t="";for(;R<rn&&NE(K[R]);)t+=K[R++];return t.length===0&&ke({},Ct,Bt),jf(K.charCodeAt(R))&&ke({},Ct,Bt),{type:Oa,value:parseInt("0x"+t,16),start:e,end:R}}function GJ(e){let t="0"+K[R++];for(;R<rn&&Mc(K[R]);)t+=K[R++];return(jf(K.charCodeAt(R))||Wr(K.charCodeAt(R)))&&ke({},Ct,Bt),{type:Oa,value:parseInt(t,8),octal:!0,start:e,end:R}}function R$(){var e,t,n;if(n=K[R],s0(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,WJ(t);if(Mc(n))return GJ(t);n&&Wr(n.charCodeAt(0))&&ke({},Ct,Bt)}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 ke({},Ct,Bt);return jf(K.charCodeAt(R))&&ke({},Ct,Bt),{type:Oa,value:parseFloat(e),start:t,end:R}}function HJ(){var e="",t,n,i,r,o=!1;for(t=K[R],s0(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<rn;)if(i=K[R++],i===t){t="";break}else if(i==="\\")if(i=K[R++],!i||!ef(i.charCodeAt(0)))switch(i){case"u":case"x":K[R]==="{"?(++R,e+=UJ()):e+=kb(i);break;case"n":e+=`
8
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:Mc(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),R<rn&&Mc(K[R])&&(o=!0,r=r*8+"01234567".indexOf(K[R++]),"0123".includes(i)&&R<rn&&Mc(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(ef(i.charCodeAt(0)))break;e+=i}return t!==""&&ke({},$t,Bt),{type:Uf,value:e,octal:o,start:n,end:R}}function HJ(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";ke({},Fb)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{ke({},Fb)}try{return new RegExp(e,t)}catch{return null}}function VJ(){var e,t,n,i,r;for(e=K[R],s0(e==="/","Regular expression literal must start with a slash"),t=K[R++],n=!1,i=!1;R<rn;)if(e=K[R++],t+=e,e==="\\")e=K[R++],ef(e.charCodeAt(0))&&ke({},d1),t+=e;else if(ef(e.charCodeAt(0)))ke({},d1);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||ke({},d1),r=t.substr(1,t.length-2),{value:r,literal:t}}function YJ(){var e,t,n;for(t="",n="";R<rn&&(e=K[R],!!Fg(e.charCodeAt(0)));)++R,e==="\\"&&R<rn?ke({},$t,Bt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&ke({},Fb,n),{value:n,literal:t}}function XJ(){var e,t,n,i;return Pe=null,cR(),e=R,t=VJ(),n=YJ(),i=HJ(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function KJ(e){return e.type===ha||e.type===fs||e.type===r0||e.type===o0}function dR(){if(cR(),R>=rn)return{type:Bf,start:R,end:R};const e=K.charCodeAt(R);return jf(e)?jJ():e===40||e===41||e===59?h1():e===39||e===34?GJ():e===46?Wr(K.charCodeAt(R+1))?R$():h1():Wr(e)?R$():h1()}function Mn(){const e=Pe;return R=e.end,Pe=dR(),R=e.end,e}function hR(){const e=R;Pe=dR(),R=e}function JJ(e){const t=new Wi(vJ);return t.elements=e,t}function N$(e,t,n){const i=new Wi(e==="||"||e==="&&"?CJ:EJ);return i.operator=e,i.left=t,i.right=n,i}function QJ(e,t){const n=new Wi(wJ);return n.callee=e,n.arguments=t,n}function ZJ(e,t,n){const i=new Wi(AJ);return i.test=e,i.consequent=t,i.alternate=n,i}function LE(e){const t=new Wi(uR);return t.name=e,t}function bc(e){const t=new Wi(SJ);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 L$(e,t,n){const i=new Wi($J);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function eQ(e){const t=new Wi(_J);return t.properties=e,t}function P$(e,t,n){const i=new Wi(FJ);return i.key=t,i.value=n,i.kind=e,i}function tQ(e,t){const n=new Wi(kJ);return n.operator=e,n.argument=t,n.prefix=!0,n}function ke(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(s0(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=R,n.description=r,n}function a0(e){e.type===Bf&&ke(e,RJ),e.type===Oa&&ke(e,DJ),e.type===Uf&&ke(e,TJ),e.type===ha&&ke(e,MJ),e.type===fs&&ke(e,OJ),ke(e,$t,e.value)}function on(e){const t=Mn();(t.type!==kn||t.value!==e)&&a0(t)}function Ve(e){return Pe.type===kn&&Pe.value===e}function g1(e){return Pe.type===fs&&Pe.value===e}function nQ(){const e=[];for(R=Pe.start,on("[");!Ve("]");)Ve(",")?(Mn(),e.push(null)):(e.push(ga()),Ve("]")||on(","));return Mn(),JJ(e)}function I$(){R=Pe.start;const e=Mn();return e.type===Uf||e.type===Oa?(e.octal&&ke(e,lR),bc(e)):LE(e.value)}function iQ(){var e,t,n,i;if(R=Pe.start,e=Pe,e.type===ha)return n=I$(),on(":"),i=ga(),P$("init",n,i);if(e.type===Bf||e.type===kn)a0(e);else return t=I$(),on(":"),i=ga(),P$("init",t,i)}function rQ(){var e=[],t,n,i,r={},o=String;for(R=Pe.start,on("{");!Ve("}");)t=iQ(),t.key.type===uR?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?ke({},NJ):r[i]=!0,e.push(t),Ve("}")||on(",");return on("}"),eQ(e)}function oQ(){on("(");const e=PE();return on(")"),e}const sQ={if:1};function aQ(){var e,t,n;if(Ve("("))return oQ();if(Ve("["))return nQ();if(Ve("{"))return rQ();if(e=Pe.type,R=Pe.start,e===ha||sQ[Pe.value])n=LE(Mn().value);else if(e===Uf||e===Oa)Pe.octal&&ke(Pe,lR),n=bc(Mn());else{if(e===fs)throw new Error(Zc);e===r0?(t=Mn(),t.value=t.value==="true",n=bc(t)):e===o0?(t=Mn(),t.value=null,n=bc(t)):Ve("/")||Ve("/=")?(n=bc(XJ()),hR()):a0(Mn())}return n}function uQ(){const e=[];if(on("("),!Ve(")"))for(;R<rn&&(e.push(ga()),!Ve(")"));)on(",");return on(")"),e}function lQ(){R=Pe.start;const e=Mn();return KJ(e)||a0(e),LE(e.value)}function cQ(){return on("."),lQ()}function fQ(){on("[");const e=PE();return on("]"),e}function dQ(){var e,t,n;for(e=aQ();;)if(Ve("."))n=cQ(),e=L$(".",e,n);else if(Ve("("))t=uQ(),e=QJ(e,t);else if(Ve("["))n=fQ(),e=L$("[",e,n);else break;return e}function z$(){const e=dQ();if(Pe.type===kn&&(Ve("++")||Ve("--")))throw new Error(Zc);return e}function mh(){var e,t;if(Pe.type!==kn&&Pe.type!==fs)t=z$();else{if(Ve("++")||Ve("--"))throw new Error(Zc);if(Ve("+")||Ve("-")||Ve("~")||Ve("!"))e=Mn(),t=mh(),t=tQ(e.value,t);else{if(g1("delete")||g1("void")||g1("typeof"))throw new Error(Zc);t=z$()}}return t}function B$(e){let t=0;if(e.type!==kn&&e.type!==fs)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 hQ(){var e,t,n,i,r,o,s,a,u,l;if(e=Pe,u=mh(),i=Pe,r=B$(i),r===0)return u;for(i.prec=r,Mn(),t=[e,Pe],s=mh(),o=[u,i,s];(r=B$(Pe))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=N$(a,u,s),o.push(n);i=Mn(),i.prec=r,o.push(i),t.push(Pe),n=mh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=N$(o[l-1].value,o[l-2],n),l-=2;return n}function ga(){var e,t,n;return e=hQ(),Ve("?")&&(Mn(),t=ga(),on(":"),n=ga(),e=ZJ(e,t,n)),e}function PE(){const e=ga();if(Ve(","))throw new Error(Zc);return e}function gR(e){K=e,R=0,rn=K.length,Pe=null,hR();const t=PE();if(Pe.type!==Bf)throw new Error("Unexpect token after expression.");return t}var pR={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 mR(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&&L("Missing arguments to clamp function."),s.length>3&&L("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&&L("Missing arguments to if function."),s.length>3&&L("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function gQ(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function yR(e){e=e||{};const t=e.allowed?yr(e.allowed):{},n=e.forbidden?yr(e.forbidden):{},i=e.constants||pR,r=(e.functions||mR)(f),o=e.globalvar,s=e.fieldvar,a=be(o)?o:g=>`${o}["${g}"]`;let u={},l={},c=0;function f(g){if(Ke(g))return g;const p=d[g.type];return p==null&&L("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:le(n,p)?L("Illegal identifier: "+p):le(i,p)?i[p]:le(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===s&&(l[gQ(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&L("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=le(r,p)&&r[p];return y||L("Unrecognized function: "+p),be(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const U$=Symbol("vega_selection_getter");function bR(e){return(!e.getter||!e.getter[U$])&&(e.getter=Li(e.field),e.getter[U$]=!0),e.getter}const IE="intersect",j$="union",pQ="vlMulti",mQ="vlPoint",q$="or",yQ="and",sr="_vgsid_",tf=Li(sr),bQ="E",xQ="R",vQ="R-E",EQ="R-LE",wQ="R-RE",AQ="E-LT",SQ="E-LTE",CQ="E-GT",$Q="E-GTE",_Q="E-VALID",FQ="E-ONE",kg="index:unit";function W$(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=bR(a)(e),Ys(s)&&(s=mn(s)),Ys(i[o])&&(i[o]=mn(i[o])),Z(i[o])&&Ys(i[o][0])&&(i[o]=i[o].map(mn)),a.type===bQ){if(Z(i[o])?!i[o].includes(s):s!==i[o])return!1}else if(a.type===xQ){if(!tc(s,i[o]))return!1}else if(a.type===wQ){if(!tc(s,i[o],!0,!1))return!1}else if(a.type===vQ){if(!tc(s,i[o],!1,!1))return!1}else if(a.type===EQ){if(!tc(s,i[o],!1,!0))return!1}else if(a.type===AQ){if(s>=i[o])return!1}else if(a.type===SQ){if(s>i[o])return!1}else if(a.type===CQ){if(s<=i[o])return!1}else if(a.type===$Q){if(s<i[o])return!1}else if(a.type===_Q){if(s===null||isNaN(s))return!1}else if(a.type===FQ&&i[o].indexOf(s)===-1)return!1;return!0}function kQ(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[kg]&&i[kg].value:void 0,s=n===IE,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=W$(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=W$(t,l),s^h)return h;return a&&s}const xR=ep(tf),DQ=xR.left,TQ=xR.right;function MQ(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[kg]&&i[kg].value:void 0,s=n===IE,a=tf(t),u=DQ(r,a);if(u===r.length||tf(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(TQ(r,a)-u<o.size)return!1}return!0}function OQ(e,t){return e.map(n=>ye(t.fields?{values:t.fields.map(i=>bR(i)(n.datum))}:{[sr]:tf(n.datum)},t))}function RQ(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,g,p,m,y,b,x=o.length,v=0,w,A;v<x;++v)if(l=o[v],d=l.unit,c=l.fields,f=l.values,c&&f){for(w=0,A=c.length;w<A;++w)h=c[w],p=s[h.field]||(s[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=p1[`${y}_union`],p[d]=b(m,oe(f[w]));n&&(m=a[d]||(a[d]=[]),m.push(oe(f).reduce((E,S,C)=>(E[c[C].field]=S,E),{})))}else h=sr,g=tf(l),p=s[h]||(s[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[sr]:g}));if(t=t||j$,s[sr]?s[sr]=p1[`${sr}_${t}`](...Object.values(s[sr])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(S=>s[E][S]).reduce((S,C)=>S===void 0?C:p1[`${u[E]}_${t}`](S,C))}),o=Object.keys(a),n&&o.length){const E=i?mQ:pQ;s[E]=t===j$?{[q$]:o.reduce((S,C)=>(S.push(...a[C]),S),[])}:{[yQ]:o.map(S=>({[q$]:a[S]}))}}return s}var p1={[`${sr}_union`]:gI,[`${sr}_intersect`]:dI,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=mn(t[0]),i=mn(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=mn(t[0]),i=mn(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 NQ=":",LQ="@";function zE(e,t,n,i){t[0].type!==da&&L("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&$e(t).value,s="unit",a=LQ+s,u=NQ+r;o===IE&&!le(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),le(i,u)||(i[u]=n.getData(r).tuplesRef())}function vR(e){const t=this.context.data[e];return t?t.values.value:[]}function PQ(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function IQ(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Pi).insert(t)),1}function zQ(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 qf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},BQ=qf("format"),ER=qf("timeFormat"),UQ=qf("utcFormat"),jQ=qf("timeParse"),qQ=qf("utcParse"),Ld=new Date(2e3,0,1);function u0(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Ld.setYear(2e3),Ld.setMonth(e),Ld.setDate(t),ER.call(this,Ld,n))}function WQ(e){return u0.call(this,e,1,"%B")}function GQ(e){return u0.call(this,e,1,"%b")}function HQ(e){return u0.call(this,0,2+e,"%A")}function VQ(e){return u0.call(this,0,2+e,"%a")}const YQ=":",XQ="@",Db="%",wR="$";function BE(e,t,n,i){t[0].type!==da&&L("First argument to data functions must be a string literal.");const r=t[0].value,o=YQ+r;if(!le(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function KQ(e,t,n,i){t[0].type!==da&&L("First argument to indata must be a string literal."),t[1].type!==da&&L("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=XQ+o;le(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function En(e,t,n,i){if(t[0].type===da)G$(n,i,t[0].value);else for(e in n.scales)G$(n,i,e)}function G$(e,t,n){const i=Db+n;if(!le(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Dr(e,t){if(Ke(e)){const n=t.scales[e];return n&&KS(n.value)?n.value:void 0}else if(be(e))return KS(e)?e:void 0}function JQ(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===da?re(Db+r.value):re(Db)+"+"+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 UE(e,t){return function(n,i,r){if(n){const o=Dr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const QQ=UE("area",AH),ZQ=UE("bounds",_H),eZ=UE("centroid",OH);function tZ(e,t){const n=Dr(e,(t||this).context);return n&&n.scale()}function nZ(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 jE(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function iZ(){return jE(this.context.dataflow,"warn",arguments)}function rZ(){return jE(this.context.dataflow,"info",arguments)}function oZ(){return jE(this.context.dataflow,"debug",arguments)}function m1(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tb(e){const t=$h(e),n=m1(t.r),i=m1(t.g),r=m1(t.b);return .2126*n+.7152*i+.0722*r}function sZ(e,t){const n=Tb(e),i=Tb(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function aZ(){const e=[].slice.call(arguments);return e.unshift({}),ye(...e)}function AR(e,t){return e===t||e!==e&&t!==t?!0:Z(e)?Z(t)&&e.length===t.length?uZ(e,t):!1:me(e)&&me(t)?SR(e,t):!1}function uZ(e,t){for(let n=0,i=e.length;n<i;++n)if(!AR(e[n],t[n]))return!1;return!0}function SR(e,t){for(const n in e)if(!AR(e[n],t[n]))return!1;return!0}function H$(e){return t=>SR(e,t)}function lZ(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?Pi:Z(n)||wp(n)?n:H$(n),c.remove(f)),t&&c.insert(t),i&&(f=H$(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function cZ(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 fZ(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const V$={};function dZ(e,t){const n=V$[t]||(V$[t]=Li(t));return Z(e)?e.map(n):n(e)}function l0(e){return Z(e)||ArrayBuffer.isView(e)?e:null}function qE(e){return l0(e)||(Ke(e)?e:null)}function hZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return l0(e).join(...n)}function gZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).indexOf(...n)}function pZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).lastIndexOf(...n)}function mZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).slice(...n)}function yZ(e,t,n){return be(n)&&L("Function argument passed to replace."),!Ke(t)&&!cD(t)&&L("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function bZ(e){return l0(e).slice().reverse()}function xZ(e){return l0(e).slice().sort(hp)}function vZ(e,t,n){return r2(e||0,t||0,n||0)}function EZ(e,t){const n=Dr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function wZ(e,t){const n=Dr(e,(t||this).context);return n?n.copy():void 0}function AZ(e,t){const n=Dr(e,(t||this).context);return n?n.domain():[]}function SZ(e,t,n){const i=Dr(e,(n||this).context);return i?Z(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function CZ(e,t){const n=Dr(e,(t||this).context);return n&&n.range?n.range():[]}function $Z(e,t,n){const i=Dr(e,(n||this).context);return i?i(t):void 0}function _Z(e,t,n,i,r){e=Dr(e,(r||this).context);const o=yM(t,n);let s=e.domain(),a=s[0],u=$e(s),l=Ln;return u-a?l=oM(e,a,u):e=(e.interpolator?Me("sequential")().interpolator(e.interpolator()):Me("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!==$e(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function FZ(e,t,n){const i=Dr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function kZ(e){let t=null;return function(n){return n?Hc(n,t=t||Nu(e)):e}}const CR=e=>e.data;function $R(e,t){const n=vR.call(t,e);return n.root&&n.root.lookup||{}}function DZ(e,t,n){const i=$R(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(CR):void 0}function TZ(e,t){const n=$R(e,this)[t];return n?n.ancestors().map(CR):void 0}const _R=()=>typeof window<"u"&&window||null;function MZ(){const e=_R();return e?e.screen:{}}function OZ(){const e=_R();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function RZ(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function FR(e,t,n){if(!e)return[];const[i,r]=e,o=new pt().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return g5(s,o,NZ(t))}function NZ(e){let t=null;if(e){const n=oe(e.marktype),i=oe(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function LZ(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=oe(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 PZ(e){return oe(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function IZ(e,t,n){const{x:i,y:r,mark:o}=n,s=new pt().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),FR([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>zZ(u.x,u.y,t))}function zZ(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 nf={random(){return mi()},cumulativeNormal:_p,cumulativeLogNormal:av,cumulativeUniform:fv,densityNormal:nv,densityLogNormal:sv,densityUniform:cv,quantileNormal:Fp,quantileLogNormal:uv,quantileUniform:dv,sampleNormal:$p,sampleLogNormal:ov,sampleUniform:lv,isArray:Z,isBoolean:zP,isDate:Ys,isDefined(e){return e!==void 0},isNumber:sa,isObject:me,isRegExp:cD,isString:Ke,isTuple:wp,isValid(e){return e!=null&&e===e},toBoolean:dD,toDate(e){return hD(e)},toNumber:mn,toString:gD,indexof:gZ,join:hZ,lastindexof:pZ,replace:yZ,reverse:bZ,sort:xZ,slice:mZ,flush:IP,lerp:UP,merge:aZ,pad:GP,peek:$e,pluck:dZ,span:gp,inrange:tc,truncate:VP,rgb:$h,lab:zh,hcl:Bh,hsl:gy,luminance:Tb,contrast:sZ,sequence:Yn,format:BQ,utcFormat:UQ,utcParse:qQ,utcOffset:BD,utcSequence:qD,timeFormat:ER,timeParse:jQ,timeOffset:zD,timeSequence:jD,timeUnitSpecifier:FD,monthFormat:WQ,monthAbbrevFormat:GQ,dayFormat:HQ,dayAbbrevFormat:VQ,quarter:DP,utcquarter:TP,week:DD,utcweek:OD,dayofyear:kD,utcdayofyear:MD,warn:iZ,info:rZ,debug:oZ,extent(e){return lo(e)},inScope:nZ,intersect:FR,clampRange:MP,pinchDistance:cZ,pinchAngle:fZ,screen:MZ,containerSize:RZ,windowSize:OZ,bandspace:vZ,setdata:IQ,pathShape:kZ,panLinear:$P,panLog:_P,panPow:FP,panSymlog:kP,zoomLinear:oD,zoomLog:sD,zoomPow:py,zoomSymlog:aD,encode:zQ,modify:lZ,lassoAppend:LZ,lassoPath:PZ,intersectLasso:IZ},BZ=["view","item","group","xy","x","y"],UZ="event.vega.",kR="this.",WE={},DR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${re(wR+e)}]`,functions:jZ,constants:pR,visitors:WE},Mb=yR(DR);function jZ(e){const t=mR(e);BZ.forEach(n=>t[n]=UZ+n);for(const n in nf)t[n]=kR+n;return ye(t,JQ(e,nf,WE)),t}function ht(e,t,n){return arguments.length===1?nf[e]:(nf[e]=t,n&&(WE[e]=n),Mb&&(Mb.functions[e]=kR+e),this)}ht("bandwidth",EZ,En);ht("copy",wZ,En);ht("domain",AZ,En);ht("range",CZ,En);ht("invert",SZ,En);ht("scale",$Z,En);ht("gradient",_Z,En);ht("geoArea",QQ,En);ht("geoBounds",ZQ,En);ht("geoCentroid",eZ,En);ht("geoShape",FZ,En);ht("geoScale",tZ,En);ht("indata",PQ,KQ);ht("data",vR,BE);ht("treePath",DZ,BE);ht("treeAncestors",TZ,BE);ht("vlSelectionTest",kQ,zE);ht("vlSelectionIdTest",MQ,zE);ht("vlSelectionResolve",RQ,zE);ht("vlSelectionTuples",OQ);function wr(e,t){const n={};let i;try{e=Ke(e)?e:re(e)+"",i=gR(e)}catch{L("Expression parse error: "+e)}i.visit(o=>{if(o.type!==aR)return;const s=o.callee.name,a=DR.visitors[s];a&&a(s,o.arguments,t,n)});const r=Mb(i);return r.globals.forEach(o=>{const s=wR+o;!le(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:ye({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function qZ(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 WZ=yr(["rule"]),Y$=yr(["group","image","rect"]);function GZ(e,t){let n="";return WZ[t]||(e.x2&&(e.x?(Y$[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?(Y$[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 GE(e){return(e+"").toLowerCase()}function HZ(e){return GE(e)==="operator"}function VZ(e){return GE(e)==="collect"}function jl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function YZ(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
9
+ `&&++R;else{if(ef(i.charCodeAt(0)))break;e+=i}return t!==""&&ke({},Ct,Bt),{type:Uf,value:e,octal:o,start:n,end:R}}function VJ(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";ke({},Fb)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{ke({},Fb)}try{return new RegExp(e,t)}catch{return null}}function YJ(){var e,t,n,i,r;for(e=K[R],s0(e==="/","Regular expression literal must start with a slash"),t=K[R++],n=!1,i=!1;R<rn;)if(e=K[R++],t+=e,e==="\\")e=K[R++],ef(e.charCodeAt(0))&&ke({},d1),t+=e;else if(ef(e.charCodeAt(0)))ke({},d1);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||ke({},d1),r=t.substr(1,t.length-2),{value:r,literal:t}}function XJ(){var e,t,n;for(t="",n="";R<rn&&(e=K[R],!!Fg(e.charCodeAt(0)));)++R,e==="\\"&&R<rn?ke({},Ct,Bt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&ke({},Fb,n),{value:n,literal:t}}function KJ(){var e,t,n,i;return Pe=null,uR(),e=R,t=YJ(),n=XJ(),i=VJ(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function JJ(e){return e.type===ha||e.type===fs||e.type===r0||e.type===o0}function cR(){if(uR(),R>=rn)return{type:Bf,start:R,end:R};const e=K.charCodeAt(R);return jf(e)?qJ():e===40||e===41||e===59?h1():e===39||e===34?HJ():e===46?Wr(K.charCodeAt(R+1))?R$():h1():Wr(e)?R$():h1()}function Mn(){const e=Pe;return R=e.end,Pe=cR(),R=e.end,e}function fR(){const e=R;Pe=cR(),R=e}function QJ(e){const t=new Wi(EJ);return t.elements=e,t}function N$(e,t,n){const i=new Wi(e==="||"||e==="&&"?$J:wJ);return i.operator=e,i.left=t,i.right=n,i}function ZJ(e,t){const n=new Wi(AJ);return n.callee=e,n.arguments=t,n}function eQ(e,t,n){const i=new Wi(SJ);return i.test=e,i.consequent=t,i.alternate=n,i}function LE(e){const t=new Wi(sR);return t.name=e,t}function bc(e){const t=new Wi(CJ);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 L$(e,t,n){const i=new Wi(_J);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function tQ(e){const t=new Wi(FJ);return t.properties=e,t}function P$(e,t,n){const i=new Wi(kJ);return i.key=t,i.value=n,i.kind=e,i}function nQ(e,t){const n=new Wi(DJ);return n.operator=e,n.argument=t,n.prefix=!0,n}function ke(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(s0(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=R,n.description=r,n}function a0(e){e.type===Bf&&ke(e,NJ),e.type===Oa&&ke(e,TJ),e.type===Uf&&ke(e,MJ),e.type===ha&&ke(e,OJ),e.type===fs&&ke(e,RJ),ke(e,Ct,e.value)}function on(e){const t=Mn();(t.type!==kn||t.value!==e)&&a0(t)}function Ve(e){return Pe.type===kn&&Pe.value===e}function g1(e){return Pe.type===fs&&Pe.value===e}function iQ(){const e=[];for(R=Pe.start,on("[");!Ve("]");)Ve(",")?(Mn(),e.push(null)):(e.push(ga()),Ve("]")||on(","));return Mn(),QJ(e)}function I$(){R=Pe.start;const e=Mn();return e.type===Uf||e.type===Oa?(e.octal&&ke(e,aR),bc(e)):LE(e.value)}function rQ(){var e,t,n,i;if(R=Pe.start,e=Pe,e.type===ha)return n=I$(),on(":"),i=ga(),P$("init",n,i);if(e.type===Bf||e.type===kn)a0(e);else return t=I$(),on(":"),i=ga(),P$("init",t,i)}function oQ(){var e=[],t,n,i,r={},o=String;for(R=Pe.start,on("{");!Ve("}");)t=rQ(),t.key.type===sR?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?ke({},LJ):r[i]=!0,e.push(t),Ve("}")||on(",");return on("}"),tQ(e)}function sQ(){on("(");const e=PE();return on(")"),e}const aQ={if:1};function uQ(){var e,t,n;if(Ve("("))return sQ();if(Ve("["))return iQ();if(Ve("{"))return oQ();if(e=Pe.type,R=Pe.start,e===ha||aQ[Pe.value])n=LE(Mn().value);else if(e===Uf||e===Oa)Pe.octal&&ke(Pe,aR),n=bc(Mn());else{if(e===fs)throw new Error(Zc);e===r0?(t=Mn(),t.value=t.value==="true",n=bc(t)):e===o0?(t=Mn(),t.value=null,n=bc(t)):Ve("/")||Ve("/=")?(n=bc(KJ()),fR()):a0(Mn())}return n}function lQ(){const e=[];if(on("("),!Ve(")"))for(;R<rn&&(e.push(ga()),!Ve(")"));)on(",");return on(")"),e}function cQ(){R=Pe.start;const e=Mn();return JJ(e)||a0(e),LE(e.value)}function fQ(){return on("."),cQ()}function dQ(){on("[");const e=PE();return on("]"),e}function hQ(){var e,t,n;for(e=uQ();;)if(Ve("."))n=fQ(),e=L$(".",e,n);else if(Ve("("))t=lQ(),e=ZJ(e,t);else if(Ve("["))n=dQ(),e=L$("[",e,n);else break;return e}function z$(){const e=hQ();if(Pe.type===kn&&(Ve("++")||Ve("--")))throw new Error(Zc);return e}function mh(){var e,t;if(Pe.type!==kn&&Pe.type!==fs)t=z$();else{if(Ve("++")||Ve("--"))throw new Error(Zc);if(Ve("+")||Ve("-")||Ve("~")||Ve("!"))e=Mn(),t=mh(),t=nQ(e.value,t);else{if(g1("delete")||g1("void")||g1("typeof"))throw new Error(Zc);t=z$()}}return t}function B$(e){let t=0;if(e.type!==kn&&e.type!==fs)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 gQ(){var e,t,n,i,r,o,s,a,u,l;if(e=Pe,u=mh(),i=Pe,r=B$(i),r===0)return u;for(i.prec=r,Mn(),t=[e,Pe],s=mh(),o=[u,i,s];(r=B$(Pe))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=N$(a,u,s),o.push(n);i=Mn(),i.prec=r,o.push(i),t.push(Pe),n=mh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=N$(o[l-1].value,o[l-2],n),l-=2;return n}function ga(){var e,t,n;return e=gQ(),Ve("?")&&(Mn(),t=ga(),on(":"),n=ga(),e=eQ(e,t,n)),e}function PE(){const e=ga();if(Ve(","))throw new Error(Zc);return e}function dR(e){K=e,R=0,rn=K.length,Pe=null,fR();const t=PE();if(Pe.type!==Bf)throw new Error("Unexpect token after expression.");return t}var hR={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 gR(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&&L("Missing arguments to clamp function."),s.length>3&&L("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&&L("Missing arguments to if function."),s.length>3&&L("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function pQ(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function pR(e){e=e||{};const t=e.allowed?yr(e.allowed):{},n=e.forbidden?yr(e.forbidden):{},i=e.constants||hR,r=(e.functions||gR)(f),o=e.globalvar,s=e.fieldvar,a=be(o)?o:g=>`${o}["${g}"]`;let u={},l={},c=0;function f(g){if(Ke(g))return g;const p=d[g.type];return p==null&&L("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:le(n,p)?L("Illegal identifier: "+p):le(i,p)?i[p]:le(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===s&&(l[pQ(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&L("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=le(r,p)&&r[p];return y||L("Unrecognized function: "+p),be(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const U$=Symbol("vega_selection_getter");function mR(e){return(!e.getter||!e.getter[U$])&&(e.getter=Li(e.field),e.getter[U$]=!0),e.getter}const IE="intersect",j$="union",mQ="vlMulti",yQ="vlPoint",q$="or",bQ="and",sr="_vgsid_",tf=Li(sr),xQ="E",vQ="R",EQ="R-E",wQ="R-LE",AQ="R-RE",SQ="E-LT",CQ="E-LTE",$Q="E-GT",_Q="E-GTE",FQ="E-VALID",kQ="E-ONE",kg="index:unit";function W$(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=mR(a)(e),Ys(s)&&(s=mn(s)),Ys(i[o])&&(i[o]=mn(i[o])),Z(i[o])&&Ys(i[o][0])&&(i[o]=i[o].map(mn)),a.type===xQ){if(Z(i[o])?!i[o].includes(s):s!==i[o])return!1}else if(a.type===vQ){if(!tc(s,i[o]))return!1}else if(a.type===AQ){if(!tc(s,i[o],!0,!1))return!1}else if(a.type===EQ){if(!tc(s,i[o],!1,!1))return!1}else if(a.type===wQ){if(!tc(s,i[o],!1,!0))return!1}else if(a.type===SQ){if(s>=i[o])return!1}else if(a.type===CQ){if(s>i[o])return!1}else if(a.type===$Q){if(s<=i[o])return!1}else if(a.type===_Q){if(s<i[o])return!1}else if(a.type===FQ){if(s===null||isNaN(s))return!1}else if(a.type===kQ&&i[o].indexOf(s)===-1)return!1;return!0}function DQ(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[kg]&&i[kg].value:void 0,s=n===IE,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=W$(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=W$(t,l),s^h)return h;return a&&s}const yR=ep(tf),TQ=yR.left,MQ=yR.right;function OQ(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[kg]&&i[kg].value:void 0,s=n===IE,a=tf(t),u=TQ(r,a);if(u===r.length||tf(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(MQ(r,a)-u<o.size)return!1}return!0}function RQ(e,t){return e.map(n=>ye(t.fields?{values:t.fields.map(i=>mR(i)(n.datum))}:{[sr]:tf(n.datum)},t))}function NQ(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,g,p,m,y,b,x=o.length,v=0,w,A;v<x;++v)if(l=o[v],d=l.unit,c=l.fields,f=l.values,c&&f){for(w=0,A=c.length;w<A;++w)h=c[w],p=s[h.field]||(s[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=p1[`${y}_union`],p[d]=b(m,oe(f[w]));n&&(m=a[d]||(a[d]=[]),m.push(oe(f).reduce((E,S,C)=>(E[c[C].field]=S,E),{})))}else h=sr,g=tf(l),p=s[h]||(s[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[sr]:g}));if(t=t||j$,s[sr]?s[sr]=p1[`${sr}_${t}`](...Object.values(s[sr])):Object.keys(s).forEach(E=>{s[E]=Object.keys(s[E]).map(S=>s[E][S]).reduce((S,C)=>S===void 0?C:p1[`${u[E]}_${t}`](S,C))}),o=Object.keys(a),n&&o.length){const E=i?yQ:mQ;s[E]=t===j$?{[q$]:o.reduce((S,C)=>(S.push(...a[C]),S),[])}:{[bQ]:o.map(S=>({[q$]:a[S]}))}}return s}var p1={[`${sr}_union`]:pI,[`${sr}_intersect`]:hI,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=mn(t[0]),i=mn(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=mn(t[0]),i=mn(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 LQ=":",PQ="@";function zE(e,t,n,i){t[0].type!==da&&L("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&$e(t).value,s="unit",a=PQ+s,u=LQ+r;o===IE&&!le(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),le(i,u)||(i[u]=n.getData(r).tuplesRef())}function bR(e){const t=this.context.data[e];return t?t.values.value:[]}function IQ(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function zQ(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Pi).insert(t)),1}function BQ(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 qf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},UQ=qf("format"),xR=qf("timeFormat"),jQ=qf("utcFormat"),qQ=qf("timeParse"),WQ=qf("utcParse"),Ld=new Date(2e3,0,1);function u0(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Ld.setYear(2e3),Ld.setMonth(e),Ld.setDate(t),xR.call(this,Ld,n))}function GQ(e){return u0.call(this,e,1,"%B")}function HQ(e){return u0.call(this,e,1,"%b")}function VQ(e){return u0.call(this,0,2+e,"%A")}function YQ(e){return u0.call(this,0,2+e,"%a")}const XQ=":",KQ="@",Db="%",vR="$";function BE(e,t,n,i){t[0].type!==da&&L("First argument to data functions must be a string literal.");const r=t[0].value,o=XQ+r;if(!le(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function JQ(e,t,n,i){t[0].type!==da&&L("First argument to indata must be a string literal."),t[1].type!==da&&L("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=KQ+o;le(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function En(e,t,n,i){if(t[0].type===da)G$(n,i,t[0].value);else for(e in n.scales)G$(n,i,e)}function G$(e,t,n){const i=Db+n;if(!le(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Dr(e,t){if(Ke(e)){const n=t.scales[e];return n&&KS(n.value)?n.value:void 0}else if(be(e))return KS(e)?e:void 0}function QQ(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===da?re(Db+r.value):re(Db)+"+"+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 UE(e,t){return function(n,i,r){if(n){const o=Dr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const ZQ=UE("area",SH),eZ=UE("bounds",FH),tZ=UE("centroid",RH);function nZ(e,t){const n=Dr(e,(t||this).context);return n&&n.scale()}function iZ(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 jE(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function rZ(){return jE(this.context.dataflow,"warn",arguments)}function oZ(){return jE(this.context.dataflow,"info",arguments)}function sZ(){return jE(this.context.dataflow,"debug",arguments)}function m1(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Tb(e){const t=$h(e),n=m1(t.r),i=m1(t.g),r=m1(t.b);return .2126*n+.7152*i+.0722*r}function aZ(e,t){const n=Tb(e),i=Tb(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function uZ(){const e=[].slice.call(arguments);return e.unshift({}),ye(...e)}function ER(e,t){return e===t||e!==e&&t!==t?!0:Z(e)?Z(t)&&e.length===t.length?lZ(e,t):!1:me(e)&&me(t)?wR(e,t):!1}function lZ(e,t){for(let n=0,i=e.length;n<i;++n)if(!ER(e[n],t[n]))return!1;return!0}function wR(e,t){for(const n in e)if(!ER(e[n],t[n]))return!1;return!0}function H$(e){return t=>wR(e,t)}function cZ(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?Pi:Z(n)||wp(n)?n:H$(n),c.remove(f)),t&&c.insert(t),i&&(f=H$(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function fZ(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 dZ(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const V$={};function hZ(e,t){const n=V$[t]||(V$[t]=Li(t));return Z(e)?e.map(n):n(e)}function l0(e){return Z(e)||ArrayBuffer.isView(e)?e:null}function qE(e){return l0(e)||(Ke(e)?e:null)}function gZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return l0(e).join(...n)}function pZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).indexOf(...n)}function mZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).lastIndexOf(...n)}function yZ(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return qE(e).slice(...n)}function bZ(e,t,n){return be(n)&&L("Function argument passed to replace."),!Ke(t)&&!uD(t)&&L("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function xZ(e){return l0(e).slice().reverse()}function vZ(e){return l0(e).slice().sort(hp)}function EZ(e,t,n){return r2(e||0,t||0,n||0)}function wZ(e,t){const n=Dr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function AZ(e,t){const n=Dr(e,(t||this).context);return n?n.copy():void 0}function SZ(e,t){const n=Dr(e,(t||this).context);return n?n.domain():[]}function CZ(e,t,n){const i=Dr(e,(n||this).context);return i?Z(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function $Z(e,t){const n=Dr(e,(t||this).context);return n&&n.range?n.range():[]}function _Z(e,t,n){const i=Dr(e,(n||this).context);return i?i(t):void 0}function FZ(e,t,n,i,r){e=Dr(e,(r||this).context);const o=pM(t,n);let s=e.domain(),a=s[0],u=$e(s),l=Ln;return u-a?l=iM(e,a,u):e=(e.interpolator?Me("sequential")().interpolator(e.interpolator()):Me("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!==$e(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function kZ(e,t,n){const i=Dr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function DZ(e){let t=null;return function(n){return n?Hc(n,t=t||Nu(e)):e}}const AR=e=>e.data;function SR(e,t){const n=bR.call(t,e);return n.root&&n.root.lookup||{}}function TZ(e,t,n){const i=SR(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(AR):void 0}function MZ(e,t){const n=SR(e,this)[t];return n?n.ancestors().map(AR):void 0}const CR=()=>typeof window<"u"&&window||null;function OZ(){const e=CR();return e?e.screen:{}}function RZ(){const e=CR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function NZ(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function $R(e,t,n){if(!e)return[];const[i,r]=e,o=new pt().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return d5(s,o,LZ(t))}function LZ(e){let t=null;if(e){const n=oe(e.marktype),i=oe(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function PZ(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=oe(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 IZ(e){return oe(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function zZ(e,t,n){const{x:i,y:r,mark:o}=n,s=new pt().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),$R([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>BZ(u.x,u.y,t))}function BZ(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 nf={random(){return mi()},cumulativeNormal:_p,cumulativeLogNormal:av,cumulativeUniform:fv,densityNormal:nv,densityLogNormal:sv,densityUniform:cv,quantileNormal:Fp,quantileLogNormal:uv,quantileUniform:dv,sampleNormal:$p,sampleLogNormal:ov,sampleUniform:lv,isArray:Z,isBoolean:BP,isDate:Ys,isDefined(e){return e!==void 0},isNumber:sa,isObject:me,isRegExp:uD,isString:Ke,isTuple:wp,isValid(e){return e!=null&&e===e},toBoolean:cD,toDate(e){return fD(e)},toNumber:mn,toString:dD,indexof:pZ,join:gZ,lastindexof:mZ,replace:bZ,reverse:xZ,sort:vZ,slice:yZ,flush:zP,lerp:jP,merge:uZ,pad:HP,peek:$e,pluck:hZ,span:gp,inrange:tc,truncate:YP,rgb:$h,lab:zh,hcl:Bh,hsl:gy,luminance:Tb,contrast:aZ,sequence:Yn,format:UQ,utcFormat:jQ,utcParse:WQ,utcOffset:ID,utcSequence:UD,timeFormat:xR,timeParse:qQ,timeOffset:PD,timeSequence:BD,timeUnitSpecifier:$D,monthFormat:GQ,monthAbbrevFormat:HQ,dayFormat:VQ,dayAbbrevFormat:YQ,quarter:TP,utcquarter:MP,week:FD,utcweek:TD,dayofyear:_D,utcdayofyear:DD,warn:rZ,info:oZ,debug:sZ,extent(e){return lo(e)},inScope:iZ,intersect:$R,clampRange:OP,pinchDistance:fZ,pinchAngle:dZ,screen:OZ,containerSize:NZ,windowSize:RZ,bandspace:EZ,setdata:zQ,pathShape:DZ,panLinear:_P,panLog:FP,panPow:kP,panSymlog:DP,zoomLinear:iD,zoomLog:rD,zoomPow:py,zoomSymlog:oD,encode:BQ,modify:cZ,lassoAppend:PZ,lassoPath:IZ,intersectLasso:zZ},UZ=["view","item","group","xy","x","y"],jZ="event.vega.",_R="this.",WE={},FR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${re(vR+e)}]`,functions:qZ,constants:hR,visitors:WE},Mb=pR(FR);function qZ(e){const t=gR(e);UZ.forEach(n=>t[n]=jZ+n);for(const n in nf)t[n]=_R+n;return ye(t,QQ(e,nf,WE)),t}function ht(e,t,n){return arguments.length===1?nf[e]:(nf[e]=t,n&&(WE[e]=n),Mb&&(Mb.functions[e]=_R+e),this)}ht("bandwidth",wZ,En);ht("copy",AZ,En);ht("domain",SZ,En);ht("range",$Z,En);ht("invert",CZ,En);ht("scale",_Z,En);ht("gradient",FZ,En);ht("geoArea",ZQ,En);ht("geoBounds",eZ,En);ht("geoCentroid",tZ,En);ht("geoShape",kZ,En);ht("geoScale",nZ,En);ht("indata",IQ,JQ);ht("data",bR,BE);ht("treePath",TZ,BE);ht("treeAncestors",MZ,BE);ht("vlSelectionTest",DQ,zE);ht("vlSelectionIdTest",OQ,zE);ht("vlSelectionResolve",NQ,zE);ht("vlSelectionTuples",RQ);function wr(e,t){const n={};let i;try{e=Ke(e)?e:re(e)+"",i=dR(e)}catch{L("Expression parse error: "+e)}i.visit(o=>{if(o.type!==oR)return;const s=o.callee.name,a=FR.visitors[s];a&&a(s,o.arguments,t,n)});const r=Mb(i);return r.globals.forEach(o=>{const s=vR+o;!le(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:ye({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function WZ(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 GZ=yr(["rule"]),Y$=yr(["group","image","rect"]);function HZ(e,t){let n="";return GZ[t]||(e.x2&&(e.x?(Y$[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?(Y$[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 GE(e){return(e+"").toLowerCase()}function VZ(e){return GE(e)==="operator"}function YZ(e){return GE(e)==="collect"}function jl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function XZ(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
10
10
  : (u > v || v == null) && u != null ? ${i}
11
11
  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
12
- : v !== v && u === u ? ${i} : `}var XZ={operator:(e,t)=>jl(e,["_"],t.code),parameter:(e,t)=>jl(e,["datum","_"],t.code),event:(e,t)=>jl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return jl(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["+re(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=GZ(i,n),r+="return m;",jl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(re).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)`),YZ(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function KZ(e){const t=this;HZ(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function JZ(e){const t=this;if(e.params){const n=t.get(e.id);n||L("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function QZ(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=Z(r)?r.map(o=>X$(o,n,t)):X$(r,n,t)}return t}function X$(e,t,n){if(!e||!me(e))return e;for(let i=0,r=K$.length,o;i<r;++i)if(o=K$[i],le(e,o.key))return o.parse(e,t,n);return e}var K$=[{key:"$ref",parse:ZZ},{key:"$key",parse:tee},{key:"$expr",parse:eee},{key:"$field",parse:nee},{key:"$encode",parse:ree},{key:"$compare",parse:iee},{key:"$context",parse:oee},{key:"$subflow",parse:see},{key:"$tupleid",parse:aee}];function ZZ(e,t){return t.get(e.$ref)||L("Operator not defined: "+e.$ref)}function eee(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=ri(t.parameterExpression(e.$expr),e.$fields))}function tee(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=fD(e.$key,e.$flat,t.expr.codegen))}function nee(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Li(e.$field,e.$name,t.expr.codegen))}function iee(e,t){const n="c:"+e.$compare+"_"+e.$order,i=oe(e.$compare).map(r=>r&&r.$tupleid?te:r);return t.fn[n]||(t.fn[n]=uD(i,e.$order,t.expr.codegen))}function ree(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=ri(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function oee(e,t){return t}function see(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 aee(){return te}function uee(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&&L("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function lee(e){var t=this,n=me(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||L("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 cee={skip:!0};function fee(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 dee(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],cee)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Pi).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function TR(e,t,n,i){return new MR(e,t,n,i)}function MR(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||XZ,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function J$(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)}MR.prototype=J$.prototype={fork(){const e=new J$(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),VZ(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[GE(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:qZ,parseOperator:KZ,parseOperatorParameters:JZ,parseParameters:QZ,parseStream:uee,parseUpdate:lee,getState:fee,setState:dee};function hee(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),OR(t,e.description()))}function OR(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function gee(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const y1="default";function pee(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y1,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?Ke(r)?r:r.user:y1,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 Ke(i)||(r=i.item,i=i.user),Ob(e,i&&i!==y1?i:r||i),r},{cursor:t})}function Ob(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 Dg(e,t){var n=e._runtime.data;return le(n,t)||L("Unrecognized data set: "+t),n[t]}function mee(e,t){return arguments.length<2?Dg(this,e).values.value:c0.call(this,e,Ta().remove(Pi).insert(t))}function c0(e,t){m3(t)||L("Second argument to changes must be a changeset.");const n=Dg(this,e);return n.modified=!0,this.pulse(n.input,t)}function yee(e,t){return c0.call(this,e,Ta().insert(t))}function bee(e,t){return c0.call(this,e,Ta().remove(t))}function RR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function NR(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function f0(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function xee(e){var t=f0(e),n=RR(e),i=NR(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 vee(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=f0(e),s=t.changedTouches?t.changedTouches[0]:t,o=Jp(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=Eee(e,n,o),t}function Eee(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;Ke(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:wn(e),item:wn(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const Q$="view",wee="timer",Aee="window",See={trap:!1};function Cee(e){const t=ye({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{Z(i[o])&&(i[o]=yr(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function LR(e,t,n,i){e._eventListeners.push({type:n,sources:oe(t),handler:i})}function $ee(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 Pd(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||me(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function _ee(e,t,n){var i=this,r=new Cp(n),o=function(l,c){i.runAsync(null,()=>{e===Q$&&$ee(i,t)&&l.preventDefault(),r.receive(vee(i,l,c))})},s;if(e===wee)Pd(i,"timer",t)&&i.timer(o,t);else if(e===Q$)Pd(i,"view",t)&&i.addEventListener(t,o,See);else if(e===Aee?Pd(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Pd(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);LR(i,s,t,o)}return r}function Z$(e){return e.item}function e_(e){return e.item.mark.source}function t_(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function Fee(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",Z$),e_,t_(e)),this.on(this.events("view","pointerout",Z$),e_,t_(t)),this}function kee(){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 Qn(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 Dee="vega-bind",Tee="vega-bind-name",Mee="vega-bind-radio";function Oee(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=lD(i.debounce,r.update))),(i.input==null&&i.element?Ree:Lee)(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 Ree(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),LR(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(Nee(r))}}function Nee(e){return typeof Event<"u"?new Event(e):{type:e}}function Lee(e,t,n,i){const r=i.signal(n.signal),o=Qn("div",{class:Dee}),s=n.input==="radio"?o:o.appendChild(Qn("label"));s.appendChild(Qn("span",{class:Tee},n.name||n.signal)),t.appendChild(o);let a=Pee;switch(n.input){case"checkbox":a=Iee;break;case"select":a=zee;break;case"radio":a=Bee;break;case"range":a=Uee;break}a(e,s,n,r)}function Pee(e,t,n,i){const r=Qn("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 Iee(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Qn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function zee(e,t,n,i){const r=Qn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};Tg(s,i)&&(u.selected=!0),r.appendChild(Qn("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(Tg(n.options[a],s)){r.selectedIndex=a;return}}}function Bee(e,t,n,i){const r=Qn("span",{class:Mee}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};Tg(s,i)&&(u.checked=!0);const l=Qn("input",u);l.addEventListener("change",()=>e.update(s));const c=Qn("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)Tg(a[l].value,s)&&(a[l].checked=!0)}}function Uee(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||ra(o,r,100),a=Qn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Qn("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 Tg(e,t){return e===t||e+""==t+""}function PR(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,RR(e),NR(e),f0(e),r,o).background(e.background())}function HE(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function jee(e,t,n,i){const r=new i(e.loader(),HE(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,f0(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function qee(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Qp(i);e=n._el=e?b1(n,e,!0):null,hee(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Nf,a=e?o.renderer:o.headless;return n._renderer=a?PR(n,n._renderer,e,a):null,n._handler=jee(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=b1(n,t,!0):e.appendChild(Qn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=b1(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Oee(n,u.element||t,u)})),n}function b1(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 ql=e=>+e||0,Wee=e=>({top:e,bottom:e,left:e,right:e});function n_(e){return me(e)?{top:ql(e.top),bottom:ql(e.bottom),left:ql(e.left),right:ql(e.right)}:Wee(ql(e))}async function VE(e,t,n,i){const r=Qp(t),o=r&&r.headless;return o||L("Unrecognized renderer type: "+t),await e.runAsync(),PR(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function Gee(e,t){e!==zo.Canvas&&e!==zo.SVG&&e!==zo.PNG&&L("Unrecognized image type: "+e);const n=await VE(this,e,t);return e===zo.SVG?Hee(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Hee(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Vee(e,t){return(await VE(this,zo.Canvas,e,t)).canvas()}async function Yee(e){return(await VE(this,zo.SVG,e)).svg()}function Xee(e,t,n){return TR(e,Du,nf,n).parse(t)}function Kee(e){var t=this._runtime.scales;return le(t,e)||L("Unrecognized scale or projection: "+e),t[e].value}var IR="width",zR="height",YE="padding",i_={skip:!0};function BR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===YE?i.left+i.right:0)}function UR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===YE?i.top+i.bottom:0)}function Jee(e){var t=e._signals,n=t[IR],i=t[zR],r=t[YE];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=BR(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=UR(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 Qee(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(IR,n,i_),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(zR,i,i_),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 Zee(e){return this._runtime.getState(e||{data:ete,signals:tte,recurse:!0})}function ete(e,t){return t.modified&&Z(t.input.value)&&!e.startsWith("_:vega:_")}function tte(e,t){return!(e==="parent"||t instanceof Du.proxy)}function nte(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function ite(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(_Y(n,t))}function rte(e,t,n,i){const r=e.element();r&&r.setAttribute("title",ote(i))}function ote(e){return e==null?"":Z(e)?jR(e):me(e)&&!Ys(e)?ste(e):e+""}function ste(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(Z(n)?jR(n):qR(n))}).join(`
13
- `)}function jR(e){return"["+e.map(qR).join(", ")+"]"}function qR(e){return Z(e)?"[…]":me(e)&&!Ys(e)?"{…}":e}function ate(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&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 WR(e,t){const n=this;if(t=t||{},mu.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=ye({},e.locale,t.locale);n.locale(s3(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||zo.Canvas,n._scenegraph=new UM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||rte,n._redraw=!0,n._handler=new Nf().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Cee(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Xee(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:ye({},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=BR(n,n._width),n._viewHeight=UR(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Jee(n),gee(n),pee(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Id(e,t){return le(e._signals,t)?e._signals[t]:L("Unrecognized signal name: "+re(t))}function GR(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function r_(e,t,n,i){let r=GR(n,i);return r||(r=HE(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function o_(e,t,n){const i=GR(t,n);return i&&t._targets.remove(i),e}G(WR,mu,{async evaluate(e,t,n){if(await mu.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,xee(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&eh(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&&OR(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=Id(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",n_(e)):n_(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?(Qp(e)||L("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&&(mu.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Id(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Qee,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=HE(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 r_(this,e,Id(this,e),t)},removeSignalListener(e,t){return o_(this,Id(this,e),t)},addDataListener(e,t){return r_(this,e,Dg(this,e).values,t)},removeDataListener(e,t){return o_(this,Dg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Ob(this,null);this._globalCursor=!!e,t&&Ob(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:ite,events:_ee,finalize:kee,hover:Fee,data:mee,change:c0,insert:yee,remove:bee,scale:Kee,initialize:qee,toImageURL:Gee,toCanvas:Vee,toSVG:Yee,getState:Zee,setState:nte,_watchPixelRatio:ate});const ute="view",Mg="[",Og="]",HR="{",VR="}",lte=":",YR=",",cte="@",fte=">",dte=/[[\]{}]/,hte={"*":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 XR,KR;function ds(e,t,n){return XR=t||ute,KR=n||hte,JR(e.trim()).map(Rb)}function gte(e){return KR[e]}function Oc(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.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function JR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Oc(e,r,YR,Mg+HR,Og+VR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function Rb(e){return e[0]==="["?pte(e):mte(e)}function pte(e){const t=e.length;let n=1,i;if(n=Oc(e,n,Og,Mg,Og),n===t)throw"Empty between selector: "+e;if(i=JR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==fte)throw"Expected '>' after between selector: "+e;i=i.map(Rb);const r=Rb(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function mte(e){const t={source:XR},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===VR){if(a=e.lastIndexOf(HR),a>=0){try{i=yte(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]===cte&&(r=++a),u=Oc(e,a,lte),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=Oc(e,a,Mg),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=Oc(e,a,Og),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==Mg)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||dte.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):gte(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 yte(e){const t=e.split(YR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function bte(e){return me(e)?e:{type:e||"pad"}}const Wl=e=>+e||0,xte=e=>({top:e,bottom:e,left:e,right:e});function vte(e){return me(e)?e.signal?e:{top:Wl(e.top),bottom:Wl(e.bottom),left:Wl(e.left),right:Wl(e.right)}:xte(Wl(e))}const _t=e=>me(e)&&!Z(e)?ye({},e):{value:e};function s_(e,t,n,i){return n!=null?(me(n)&&!Z(n)||Z(n)&&n.length&&me(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Wt(e,t,n){for(const i in t)s_(e,i,t[i]);for(const i in n)s_(e,i,n[i],"update")}function gl(e,t,n){for(const i in t)n&&le(n,i)||(e[i]=ye(e[i]||{},t[i]));return e}function au(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const XE="mark",KE="frame",JE="scope",Ete="axis",wte="axis-domain",Ate="axis-grid",Ste="axis-label",Cte="axis-tick",$te="axis-title",_te="legend",Fte="legend-band",kte="legend-entry",Dte="legend-gradient",QR="legend-label",Tte="legend-symbol",Mte="legend-title",Ote="title",Rte="title-text",Nte="title-subtitle";function Lte(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!au(u,e)&&x1(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===KE?r.group:n===XE?ye({},r.mark,r[t]):null;for(u in c)l=au(u,e)||(u==="fill"||u==="stroke")&&(au("fill",e)||au("stroke",e)),l||x1(o,u,c[u]);oe(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)au(h,e)||x1(o,h,d[h])}),e=ye({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=ye(s,e.enter),a&&(e.update=ye(a,e.update)),e}function x1(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const ZR=e=>Ke(e)?re(e):e.signal?`(${e.signal})`:eN(e);function d0(e){if(e.gradient!=null)return Ite(e);let t=e.signal?`(${e.signal})`:e.color?Pte(e.color):e.field!=null?eN(e.field):e.value!==void 0?re(e.value):void 0;return e.scale!=null&&(t=zte(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${yh(e.exponent)})`),e.mult!=null&&(t+=`*${yh(e.mult)}`),e.offset!=null&&(t+=`+${yh(e.offset)}`),e.round&&(t=`round(${t})`),t}const zd=(e,t,n,i)=>`(${e}(${[t,n,i].map(d0).join(",")})+'')`;function Pte(e){return e.c?zd("hcl",e.h,e.c,e.l):e.h||e.s?zd("hsl",e.h,e.s,e.l):e.l||e.a?zd("lab",e.l,e.a,e.b):e.r||e.g||e.b?zd("rgb",e.r,e.g,e.b):null}function Ite(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:re(n));for(;t.length&&$e(t)==null;)t.pop();return t.unshift(ZR(e.gradient)),`gradient(${t.join(",")})`}function yh(e){return me(e)?"("+d0(e)+")":e}function eN(e){return tN(me(e)?e:{datum:e})}function tN(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):L("Invalid field reference: "+re(e));return e.signal||(i=Ke(i)?zx(i).map(re).join("]["):tN(i)),t+"["+i+"]"}function zte(e,t){const n=ZR(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?"":"*"+yh(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Bte(e){let t="";return e.forEach(n=>{const i=d0(n);t+=n.test?`(${n.test})?${i}:`:i}),$e(t)===":"&&(t+="null"),t}function nN(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=Lte(e,t,n,i,r.config);for(const a in e)s[a]=Ute(e[a],t,o,r);return o}function Ute(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=qte(jte(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function jte(e){return Z(e)?Bte(e):d0(e)}function qte(e,t,n,i){const r=wr(e,t);return r.$fields.forEach(o=>i[o]=1),ye(n,r.$params),r.$expr}const Wte="outer",Gte=["value","update","init","react","bind"];function a_(e,t){L(e+' for "outer" push: '+re(t))}function iN(e,t){const n=e.name;if(e.push===Wte)t.signals[n]||a_("No prior signal definition",n),Gte.forEach(i=>{e[i]!==void 0&&a_("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 Nb(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function h0(e,t,n,i){return new Nb(e,t,n,i)}function Rg(e,t){return h0("operator",e,t)}function ee(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function rf(e,t){return t?{$field:e,$name:t}:{$field:e}}const Lb=rf("key");function u_(e,t){return{$compare:e,$order:t}}function Hte(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Vte="ascending",Yte="descending";function Xte(e){return me(e)?(e.order===Yte?"-":"+")+g0(e.op,e.field):""}function g0(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const QE="scope",Pb="view";function vt(e){return e&&e.signal}function Kte(e){return e&&e.expr}function bh(e){if(vt(e))return!0;if(me(e)){for(const t in e)if(bh(e[t]))return!0}return!1}function _i(e,t){return e??t}function Qs(e){return e&&e.signal||e}const l_="timer";function of(e,t){return(e.merge?Qte:e.stream?Zte:e.type?ene:L("Invalid stream specification: "+re(e)))(e,t)}function Jte(e){return e===QE?Pb:e||Pb}function Qte(e,t){const n=e.merge.map(r=>of(r,t)),i=ZE({merge:n},e,t);return t.addStream(i).id}function Zte(e,t){const n=of(e.stream,t),i=ZE({stream:n},e,t);return t.addStream(i).id}function ene(e,t){let n;e.type===l_?(n=t.event(l_,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Jte(e.source),e.type);const i=ZE({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function ZE(e,t,n){let i=t.between;return i&&(i.length!==2&&L('Stream "between" parameter must have 2 entries: '+re(t)),e.between=[of(i[0],n),of(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(tne(t.marktype,t.markname,t.markrole)),t.source===QE&&i.push("inScope(event.item)"),i.length&&(e.filter=wr("("+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 tne(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 nne={code:"_.$value",ast:{type:"Identifier",value:"value"}};function ine(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||L("Signal update missing events specification."),Ke(o)&&(o=ds(o,t.isSubscope()?QE:Pb)),o=oe(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[one(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&L("Signal encode and update are mutually exclusive."),s="encode(item(),"+re(i)+")"),r.update=Ke(s)?wr(s,t):s.expr!=null?wr(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:nne,$params:{$value:t.signalRef(s.signal)}}:L("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(ye(rne(u,t),r)))}function rne(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):of(e,t)}}function one(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function sne(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?L("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=wr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>ine(r,t,n.id))}const qe=e=>(t,n,i)=>h0(e,n,t||void 0,i),rN=qe("aggregate"),ane=qe("axisticks"),oN=qe("bound"),Gi=qe("collect"),c_=qe("compare"),une=qe("datajoin"),sN=qe("encode"),lne=qe("expression"),cne=qe("facet"),fne=qe("field"),dne=qe("key"),hne=qe("legendentries"),gne=qe("load"),pne=qe("mark"),mne=qe("multiextent"),yne=qe("multivalues"),bne=qe("overlap"),xne=qe("params"),aN=qe("prefacet"),vne=qe("projection"),Ene=qe("proxy"),wne=qe("relay"),uN=qe("render"),Ane=qe("scale"),Ra=qe("sieve"),Sne=qe("sortitems"),lN=qe("viewlayout"),Cne=qe("values");let $ne=0;const cN={min:"min",max:"max",count:"sum"};function _ne(e,t){const n=e.type||"linear";ZT(n)||L("Unrecognized scale type: "+re(n)),t.addScale(e.name,{type:n,domain:void 0})}function Fne(e,t){const n=t.getScale(e.name).params;let i;n.domain=fN(e.domain,e,t),e.range!=null&&(n.range=hN(e,t,n)),e.interpolate!=null&&Ine(e.interpolate,n),e.nice!=null&&(n.nice=Pne(e.nice,t)),e.bins!=null&&(n.bins=Lne(e.bins,t));for(i in e)le(n,i)||i==="name"||(n[i]=fi(e[i],t))}function fi(e,t){return me(e)?e.signal?t.signalRef(e.signal):L("Unsupported object: "+re(e)):e}function xh(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>fi(n,t))}function p0(e){L("Can not find data set: "+re(e))}function fN(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&L("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(Z(e)?kne:e.fields?Tne:Dne)(e,t,n)}function kne(e,t,n){return e.map(i=>fi(i,n))}function Dne(e,t,n){const i=n.getData(e.data);return i||p0(e.data),Ru(t.type)?i.valuesRef(n,e.field,dN(e.sort,!1)):nM(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Tne(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=Ke(s)?{data:i,field:s}:Z(s)||s.signal?Mne(s,n):s,o.push(s),o),[]);return(Ru(t.type)?One:nM(t.type)?Rne:Nne)(e,n,r)}function Mne(e,t){const n="_:vega:_"+$ne++,i=Gi({});if(Z(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+re(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ra({})]),{data:n,field:"data"}}function One(e,t,n){const i=dN(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||p0(l.data),c.countsRef(t,l.field,i)}),a={groupby:Lb,pulse:s};i&&(r=i.op||"count",o=i.field?g0(r,i.field):"count",a.ops=[cN[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(rN(a));const u=t.add(Gi({pulse:ee(r)}));return o=t.add(Cne({field:Lb,sort:t.sortRef(i),pulse:ee(u)})),ee(o)}function dN(e,t){return e&&(!e.field&&!e.op?me(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?L("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!cN[e.op]&&L("Multiple domain scales can not be sorted using "+e.op)),e}function Rne(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||p0(r.data),o.domainRef(t,r.field)});return ee(t.add(yne({values:i})))}function Nne(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||p0(r.data),o.extentRef(t,r.field)});return ee(t.add(mne({extents:i})))}function Lne(e,t){return e.signal||Z(e)?xh(e,t):t.objectProperty(e)}function Pne(e,t){return e.signal?t.signalRef(e.signal):me(e)?{interval:fi(e.interval),step:fi(e.step)}:fi(e)}function Ine(e,t){t.interpolate=fi(e.type||e),e.gamma!=null&&(t.interpolateGamma=fi(e.gamma))}function hN(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(Ke(r)){if(i&&le(i,r))return e=ye({},e,{range:i[r]}),hN(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Ru(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:L("Unrecognized scale range value: "+re(r))}else if(r.scheme){n.scheme=Z(r.scheme)?xh(r.scheme,t):fi(r.scheme,t),r.extent&&(n.schemeExtent=xh(r.extent,t)),r.count&&(n.schemeCount=fi(r.count,t));return}else if(r.step){n.rangeStep=fi(r.step,t);return}else{if(Ru(e.type)&&!Z(r))return fN(r,e,t);Z(r)||L("Unsupported range type: "+re(r))}return r.map(o=>(Z(o)?xh:fi)(o,t))}function zne(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Ib(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Ib(n[r],r,t));t.addProjection(e.name,i)}function Ib(e,t,n){return Z(e)?e.map(i=>Ib(i,t,n)):me(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:L("Unsupported parameter object: "+re(e)):e}const Hi="top",pl="left",ml="right",ns="bottom",gN="center",Bne="vertical",Une="start",jne="middle",qne="end",zb="index",ew="label",Wne="offset",ju="perc",Gne="perc2",hi="value",Wf="guide-label",tw="guide-title",Hne="group-title",Vne="group-subtitle",f_="symbol",vh="gradient",Bb="discrete",Ub="size",Yne="shape",Xne="fill",Kne="stroke",Jne="strokeWidth",Qne="strokeDash",Zne="opacity",nw=[Ub,Yne,Xne,Kne,Jne,Qne,Zne],Gf={name:1,style:1,interactive:1},Ce={value:0},gi={value:1},m0="group",pN="rect",iw="rule",eie="symbol",Na="text";function sf(e){return e.type=m0,e.interactive=e.interactive||!1,e}function qn(e,t){const n=(i,r)=>_i(e[i],_i(t[i],r));return n.isVertical=i=>Bne===_i(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>_i(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>_i(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>_i(e.columns,_i(t.columns,+n.isVertical(!0))),n}function mN(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 tie(e,t,n){const i=t.config.style[n];return i&&i[e]}function y0(e,t,n){return`item.anchor === '${Une}' ? ${e} : item.anchor === '${qne}' ? ${t} : ${n}`}const rw=y0(re(pl),re(ml),re(gN));function nie(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'`},me(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 yN(e,t){return t?e?me(e)?Object.assign({},e,{offset:yN(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=gl(e.encode,t,Gf)):e.interactive=!1,e}function iie(e,t,n,i){const r=qn(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:Ce,x:Ce,y:Ce,width:_t(f),height:_t(d)},update:ye({},u,{opacity:gi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ce}};return Wt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),ii({type:pN,role:Dte,encode:h},i)}function rie(e,t,n,i,r){const o=qn(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 g={opacity:Ce,fill:{scale:t,field:hi}};g[l]={signal:h+"datum."+ju,mult:u},g[c]=Ce,g[f]={signal:h+"datum."+Gne,mult:u},g[d]=_t(a);const p={enter:g,update:ye({},g,{opacity:gi}),exit:{opacity:Ce}};return Wt(p,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),ii({type:pN,role:Fte,key:hi,from:r,encode:p},i)}const oie=`datum.${ju}<=0?"${pl}":datum.${ju}>=1?"${ml}":"${gN}"`,sie=`datum.${ju}<=0?"${ns}":datum.${ju}>=1?"${Hi}":"${jne}"`;function d_(e,t,n,i){const r=qn(e,t),o=r.isVertical(),s=_t(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const g={enter:l={opacity:Ce},update:c={opacity:gi,text:{field:ew}},exit:{opacity:Ce}};return Wt(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:_i(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:sie},f="y",d="x",h="1-"):(l.align=c.align={signal:oie},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+ju,mult:a},l[d]=c[d]=s,s.offset=_i(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+zb}:void 0,ii({type:Na,role:QR,style:Wf,key:hi,from:i,encode:g,overlap:u},n)}function aie(e,t,n,i,r){const o=qn(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.${Wne} : datum.${Ub}`,h=l?_t(l):{field:Ub},g=`datum.${zb}`,p=`max(1, ${r})`;let m,y,b,x,v;h.mult=.5,m={enter:y={opacity:Ce,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:gi,x:y.x,y:y.y},exit:{opacity:Ce}};let w=null,A=null;e.fill||(w=t.symbolBaseFillColor,A=t.symbolBaseStrokeColor),Wt(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",A),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),nw.forEach(_=>{e[_]&&(b[_]=y[_]={scale:e[_],field:hi})});const E=ii({type:eie,role:Tte,key:hi,from:f,clip:l?!0:void 0,encode:m},n.symbols),S=_t(c);S.offset=o("labelOffset"),m={enter:y={opacity:Ce,x:{signal:d,offset:S},y:h},update:b={opacity:gi,text:{field:ew},x:y.x,y:y.y},exit:{opacity:Ce}},Wt(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 C=ii({type:Na,role:QR,style:Wf,key:hi,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ce,height:l?_t(l):Ce,opacity:Ce},exit:{opacity:Ce},update:b={opacity:gi,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${p})`,b.row.signal=`${g}%${x}`,b.column.signal=`floor(${g} / ${x})`,v={field:["row",g]}):(b.row.signal=`floor(${g} / ${p})`,b.column.signal=`${g} % ${p}`,v={field:g}),b.column.signal=`(${r})?${b.column.signal}:${g}`,i={facet:{data:i,name:"value",groupby:zb}},sf({role:JE,from:i,encode:gl(m,s,Gf),marks:[E,C],name:u,interactive:a,sort:v})}function uie(e,t){const n=qn(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ow='item.orient === "left"',sw='item.orient === "right"',b0=`(${ow} || ${sw})`,lie=`datum.vgrad && ${b0}`,cie=y0('"top"','"bottom"','"middle"'),fie=y0('"right"','"left"','"center"'),die=`datum.vgrad && ${sw} ? (${fie}) : (${b0} && !(datum.vgrad && ${ow})) ? "left" : ${rw}`,hie=`item._anchor || (${b0} ? "middle" : "start")`,gie=`${lie} ? (${ow} ? -90 : 90) : 0`,pie=`${b0} ? (datum.vgrad ? (${sw} ? "bottom" : "top") : ${cie}) : "top"`;function mie(e,t,n,i){const r=qn(e,t),o={enter:{opacity:Ce},update:{opacity:gi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ce}};return Wt(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:hie},angle:{signal:gie},align:{signal:die},baseline:{signal:pie},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:Na,role:Mte,style:tw,from:i,encode:o},n)}function yie(e,t){let n;return me(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+h_(e.path)+")":e.sphere&&(n="geoShape("+h_(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function h_(e){return me(e)&&e.signal?e.signal:re(e)}function bN(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===m0?JE:t||XE}function bie(e){return{marktype:e.type,name:e.name||void 0,role:e.role||bN(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function xie(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function aw(e,t){const n=x3(e.type);n||L("Unrecognized transform type: "+re(e.type));const i=h0(n.type.toLowerCase(),null,xN(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function xN(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=vie(s,t,n)}return i}function vie(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return Eie(e,t,n);if(r===void 0){e.required&&L("Missing required "+re(t.type)+" parameter: "+re(e.name));return}else{if(i==="param")return wie(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!vt(r)?r.map(o=>g_(e,o,n)):g_(e,r,n)}function g_(e,t,n){const i=e.type;if(vt(t))return m_(i)?L("Expression references can not be signals."):v1(i)?n.fieldRef(t):y_(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||v1(i);return r&&Aie(t)?n.exprRef(t.expr,t.as):r&&Sie(t)?rf(t.field,t.as):m_(i)?wr(t,n):Cie(i)?ee(n.getData(t).values):v1(i)?rf(t):y_(i)?n.compareRef(t):t}}function Eie(e,t,n){return Ke(t.from)||L('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function wie(e,t,n){const i=t[e.name];return e.array?(Z(i)||L("Expected an array of sub-parameters. Instead: "+re(i)),i.map(r=>p_(e,r,n))):p_(e,i,n)}function p_(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||L("Unsupported parameter: "+re(t));const o=ye(xN(r,t,n),r.key);return ee(n.add(xne(o)))}const Aie=e=>e&&e.expr,Sie=e=>e&&e.field,Cie=e=>e==="data",m_=e=>e==="expr",v1=e=>e==="field",y_=e=>e==="compare";function $ie(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||L("Only group marks can be faceted."),i.field!=null?s=a=Eh(i,n):(e.data?a=ee(n.getData(e.data).aggregate):(o=aw(ye({type:"aggregate",groupby:oe(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Eh(i,n),s=a=ee(n.add(o))),r=n.keyRef(i.groupby,!0))):s=ee(n.add(Gi(null,[{}]))),s||(s=Eh(e,n)),{key:r,pulse:s,parent:a}}function Eh(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ee(t.getData(e.data).output)}function pa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}pa.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=ee(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new pa(e,o,r,i,s)};function vN(e){return Ke(e)?e:null}function b_(e,t,n){const i=g0(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 Gl(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=Xte(o);let l=vN(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:Lb,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:ee(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(h0(i,void 0,d)),s&&(t.index[r]=f),c=ee(f),l!=null&&(a[l]=c)}return c}pa.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=vN(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&b_(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ee(i.output)},n&&n.field&&b_(e,u,n),a=e.add(rN(u)),s=e.add(Gi({pulse:ee(a)})),s={agg:a,ref:ee(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return ee(this.values)},extentRef(e,t){return Gl(e,this,"extent","extent",t,!1)},domainRef(e,t){return Gl(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Gl(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Gl(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Gl(e,this,"indata","tupleindex",t,!0,!0)}};function _ie(e,t,n){const i=e.from.facet,r=i.name,o=Eh(i,t);let s;i.name||L("Facet must have a name: "+re(i)),i.data||L("Facet must reference a data set: "+re(i)),i.field?s=t.add(aN({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(cne({key:t.keyRef(i.groupby),group:ee(t.proxy(n.parent)),pulse:o})):L("Facet must specify groupby or field: "+re(i));const a=t.fork(),u=a.add(Gi()),l=a.add(Ra({pulse:ee(u)}));a.addData(r,new pa(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function Fie(e,t,n){const i=t.add(aN({pulse:n.pulse})),r=t.fork();r.add(Ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function EN(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(Rg()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=wr(l,t);u.update=c.$expr,u.params=c.$params}function x0(e,t){const n=bN(e),i=e.type===m0,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===JE||n===KE,a,u,l,c,f,d,h;const g=n===XE||s||r,p=$ie(e.from,i,t);u=t.add(une({key:p.key||(e.key?rf(e.key):void 0),pulse:p.pulse,clean:!i}));const m=ee(u);u=l=t.add(Gi({pulse:m})),u=t.add(pne({markdef:bie(e),interactive:xie(e.interactive,t),clip:yie(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ee(u)}));const y=ee(u);u=c=t.add(sN(nN(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(A=>{const E=aw(A,t),S=E.metadata;(S.generates||S.changes)&&L("Mark transforms should not generate new data."),S.nomod||(c.params.mod=!0),E.params.pulse=ee(u),t.add(u=E)}),e.sort&&(u=t.add(Sne({sort:t.compareRef(e.sort),pulse:ee(u)})));const b=ee(u);(r||s)&&(s=t.add(lN({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ee(s));const x=t.add(oN({mark:y,pulse:d||b}));h=ee(x),i&&(g&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?_ie(e,t,p):g?Fie(e,t,p):t.parse(e),t.popState(),g&&(s&&a.push(s),a.push(x))),o&&(h=kie(o,h,t));const v=t.add(uN({pulse:h})),w=t.add(Ra({pulse:ee(v)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new pa(t,l,v,w)),e.on&&e.on.forEach(A=>{(A.insert||A.remove||A.toggle)&&L("Marks only support modify triggers."),EN(A,t,f)}))}function kie(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:vt(o)?n.signalRef(o.signal):o,method:vt(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=vt(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return ee(n.add(bne(s)))}function Die(e,t){const n=t.config.legend,i=e.encode||{},r=qn(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;nw.forEach(x=>e[x]?(l[x]=e[x],c=c||e[x]):0),c||L("Missing valid scale for legend.");const g=Tie(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=ee(t.add(Gi(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=ee(t.add(hne(d={type:g,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 g===vh?(h=[iie(e,c,n,i.gradient),d_(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Qs(r.gradientLength())})/100))`)):g===Bb?h=[rie(e,c,n,i.gradient,b),d_(e,n,i.labels,b)]:(f=uie(e,n),h=[aie(e,n,i,b,Qs(f.columns))],d.size=Rie(e,t,h[0].marks)),h=[sf({role:kte,from:m,encode:y,marks:h,layout:f,interactive:a})],p.title&&h.push(mie(e,n,i.title,m)),x0(sf({role:_te,from:m,encode:gl(Oie(r,e,n),o,Gf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function Tie(e,t){let n=e.type||f_;return!e.type&&Mie(e)===1&&(e.fill||e.stroke)&&(n=l2(t)?vh:My(t)?Bb:f_),n!==vh?n:My(t)?Bb:vh}function Mie(e){return nw.reduce((t,n)=>t+(e[n]?1:0),0)}function Oie(e,t,n){const i={enter:{},update:{}};return Wt(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 Rie(e,t,n){const i=Qs(x_("size",e,n)),r=Qs(x_("strokeWidth",e,n)),o=Qs(Nie(n[1].encode,t,Wf));return wr(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function x_(e,t,n){return t[e]?`scale("${t[e]}",datum)`:mN(e,n[0].encode)}function Nie(e,t,n){return mN("fontSize",e)||tie("fontSize",t,n)}const Lie=`item.orient==="${pl}"?-90:item.orient==="${ml}"?90:0`;function Pie(e,t){e=Ke(e)?{text:e}:e;const n=qn(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=ee(t.add(Gi(null,[l])));return u.push(Bie(e,n,Iie(e),c)),e.subtitle&&u.push(Uie(e,n,i.subtitle,c)),x0(sf({role:Ote,from:c,encode:zie(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Iie(e){const t=e.encode;return t&&t.title||ye({name:e.name,interactive:e.interactive,style:e.style},t)}function zie(e,t){const n={enter:{},update:{}};return Wt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:rw},angle:{signal:Lie},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),gl(n,t,Gf)}function Bie(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Wt(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:Na,role:Rte,style:Hne,from:i,encode:s},n)}function Uie(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Wt(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:Na,role:Nte,style:Vne,from:i,encode:s},n)}function jie(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(aw(i,t))}),e.on&&e.on.forEach(i=>{EN(i,t,e.name)}),t.addDataPipeline(e.name,qie(e,t,n))}function qie(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?vt(e.values)||bh(e.format)?(i.push(v_(t,e)),i.push(r=$s())):i.push(r=$s({$ingest:e.values,$format:e.format})):e.url?bh(e.url)||bh(e.format)?(i.push(v_(t,e)),i.push(r=$s())):i.push(r=$s({$request:e.url,$format:e.format})):e.source&&(r=a=oe(e.source).map(d=>ee(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]=wne({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,$s())),r||i.push($s()),i.push(Ra({})),i}function $s(e){const t=Gi({},e);return t.metadata={source:!0},t}function v_(e,t){return gne({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 wN=e=>e===ns||e===Hi,v0=(e,t,n)=>vt(e)?Vie(e.signal,t,n):e===pl||e===Hi?t:n,Ft=(e,t,n)=>vt(e)?Gie(e.signal,t,n):wN(e)?t:n,Ri=(e,t,n)=>vt(e)?Hie(e.signal,t,n):wN(e)?n:t,AN=(e,t,n)=>vt(e)?Yie(e.signal,t,n):e===Hi?{value:t}:{value:n},Wie=(e,t,n)=>vt(e)?Xie(e.signal,t,n):e===ml?{value:t}:{value:n},Gie=(e,t,n)=>SN(`${e} === '${Hi}' || ${e} === '${ns}'`,t,n),Hie=(e,t,n)=>SN(`${e} !== '${Hi}' && ${e} !== '${ns}'`,t,n),Vie=(e,t,n)=>uw(`${e} === '${pl}' || ${e} === '${Hi}'`,t,n),Yie=(e,t,n)=>uw(`${e} === '${Hi}'`,t,n),Xie=(e,t,n)=>uw(`${e} === '${ml}'`,t,n),SN=(e,t,n)=>(t=t!=null?_t(t):t,n=n!=null?_t(n):n,E_(t)&&E_(n)?(t=t?t.signal||re(t.value):null,n=n?n.signal||re(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ye({test:e},t)].concat(n||[])),E_=e=>e==null||Object.keys(e).length===1,uw=(e,t,n)=>({signal:`${e} ? (${hu(t)}) : (${hu(n)})`}),Kie=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${pl}' ? (${hu(i)}) : `:"")+(n!=null?`${e} === '${ns}' ? (${hu(n)}) : `:"")+(r!=null?`${e} === '${ml}' ? (${hu(r)}) : `:"")+(t!=null?`${e} === '${Hi}' ? (${hu(t)}) : `:"")+"(null)"}),hu=e=>vt(e)?e.signal:e==null?null:re(e),Jie=(e,t)=>t===0?0:vt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},xu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function nu(e,t,n,i){let r;if(t&&le(t,e))return t[e];if(le(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[tw][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[Wf][r]}return null}function w_(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Qie(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(vt(s)){const f=w_([n.axisX,n.axisY]),d=w_([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=Ft(s,nu(l,n.axisX,r,i),nu(l,n.axisY,r,i));u={};for(l of d)u[l]=Kie(s.signal,nu(l,n.axisTop,r,i),nu(l,n.axisBottom,r,i),nu(l,n.axisLeft,r,i),nu(l,n.axisRight,r,i))}else a=s===Hi||s===ns?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?ye({},r,a,u,o):r}function Zie(e,t,n,i){const r=qn(e,t),o=e.orient;let s,a;const u={enter:s={opacity:Ce},update:a={opacity:gi},exit:{opacity:Ce}};Wt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=A_(e,0),c=A_(e,1);return s.x=a.x=Ft(o,l,Ce),s.x2=a.x2=Ft(o,c),s.y=a.y=Ri(o,l,Ce),s.y2=a.y2=Ri(o,c),ii({type:iw,role:wte,from:i,encode:u},n)}function A_(e,t){return{scale:e.scale,range:t}}function ere(e,t,n,i,r){const o=qn(e,t),s=e.orient,a=e.gridScale,u=v0(s,1,-1),l=tre(e.offset,u);let c,f,d;const h={enter:c={opacity:Ce},update:d={opacity:gi},exit:f={opacity:Ce}};Wt(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const g={scale:e.scale,field:hi,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},p=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}:ye(p,{mult:u,offset:l});return c.x=d.x=Ft(s,g,m),c.y=d.y=Ri(s,g,m),c.x2=d.x2=Ri(s,y),c.y2=d.y2=Ft(s,y),f.x=Ft(s,g),f.y=Ri(s,g),ii({type:iw,role:Ate,key:hi,from:i,encode:h},n)}function tre(e,t){if(t!==1)if(!me(e))e=vt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=ye({},e);for(;n.mult!=null;)if(me(n.mult))n=n.mult=ye({},n.mult);else return n.mult=vt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function nre(e,t,n,i,r,o){const s=qn(e,t),a=e.orient,u=v0(a,-1,1);let l,c,f;const d={enter:l={opacity:Ce},update:f={opacity:gi},exit:c={opacity:Ce}};Wt(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 g={scale:e.scale,field:hi,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=Ft(a,Ce,g),f.y2=l.y2=Ft(a,h),c.x=Ft(a,g),f.x=l.x=Ri(a,Ce,g),f.x2=l.x2=Ri(a,h),c.y=Ri(a,g),ii({type:iw,role:Cte,key:hi,from:i,encode:d},n)}function E1(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function ire(e,t,n,i,r,o){const s=qn(e,t),a=e.orient,u=e.scale,l=v0(a,-1,1),c=Qs(s("labelFlush")),f=Qs(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let g=c===0||!!c,p;const m=_t(r);m.mult=l,m.offset=_t(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:hi,band:.5,offset:yN(o.offset,s("labelOffset"))},b=Ft(a,g?E1(u,c,'"left"','"right"','"center"'):{value:"center"},Wie(a,"left","right")),x=Ft(a,AN(a,"bottom","top"),g?E1(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),v=E1(u,c,`-(${f})`,f,0);g=g&&f;const w={opacity:Ce,x:Ft(a,y,m),y:Ri(a,y,m)},A={enter:w,update:p={opacity:gi,text:{field:ew},x:w.x,y:w.y,align:b,baseline:x},exit:{opacity:Ce,x:w.x,y:w.y}};Wt(A,{dx:!d&&g?Ft(a,v):null,dy:!h&&g?Ri(a,v):null}),Wt(A,{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 S=s("labelOverlap");return S=S||E?{separation:s("labelSeparation"),method:S,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,p.align!==b&&(p.align=xu(p.align,b)),p.baseline!==x&&(p.baseline=xu(p.baseline,x)),ii({type:Na,role:Ste,style:Wf,key:hi,from:i,encode:A,overlap:S},n)}function rre(e,t,n,i){const r=qn(e,t),o=e.orient,s=v0(o,-1,1);let a,u;const l={enter:a={opacity:Ce,anchor:_t(r("titleAnchor",null)),align:{signal:rw}},update:u=ye({},a,{opacity:gi,text:_t(e.title)}),exit:{opacity:Ce}},c={signal:`lerp(range("${e.scale}"), ${y0(0,1,.5)})`};return u.x=Ft(o,c),u.y=Ri(o,c),a.angle=Ft(o,Ce,Jie(s,90)),a.baseline=Ft(o,AN(o,ns,Hi),{value:ns}),u.angle=a.angle,u.baseline=a.baseline,Wt(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")}),ore(r,o,l,n),l.update.align=xu(l.update.align,a.align),l.update.angle=xu(l.update.angle,a.angle),l.update.baseline=xu(l.update.baseline,a.baseline),ii({type:Na,role:$te,style:tw,from:i,encode:l},n)}function ore(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=xu(_t(a),n.update[u]),!1):!au(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 sre(e,t){const n=Qie(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=qn(e,n),l=nie(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ee(t.add(Gi({},[c]))),d=ee(t.add(ane({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 g;return c.grid&&h.push(ere(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(nre(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(ire(e,n,i.labels,d,g,l))),c.domain&&h.push(Zie(e,n,i.domain,f)),c.title&&h.push(rre(e,n,i.title,f)),x0(sf({role:Ete,from:f,encode:gl(are(u,e),r,Gf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function are(e,t){const n={enter:{},update:{}};return Wt(n,{orient:e("orient"),offset:e("offset")||0,position:_i(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 CN(e,t,n){const i=oe(e.signals),r=oe(e.scales);return n||i.forEach(o=>iN(o,t)),oe(e.projections).forEach(o=>zne(o,t)),r.forEach(o=>_ne(o,t)),oe(e.data).forEach(o=>jie(o,t)),r.forEach(o=>Fne(o,t)),(n||i).forEach(o=>sne(o,t)),oe(e.axes).forEach(o=>sre(o,t)),oe(e.marks).forEach(o=>x0(o,t)),oe(e.legends).forEach(o=>Die(o,t)),e.title&&Pie(e.title,t),t.parseLambdas(),t}const ure=e=>gl({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function lre(e,t){const n=t.config,i=ee(t.root=t.add(Rg())),r=cre(e,n);r.forEach(l=>iN(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(Gi()),s=t.add(sN(nN(ure(e.encode),m0,KE,e.style,t,{pulse:ee(o)}))),a=t.add(lN({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ee(s)}));t.operators.pop(),t.pushState(ee(s),ee(a),null),CN(e,t,r),t.operators.push(a);let u=t.add(oN({mark:i,pulse:ee(a)}));return u=t.add(uN({pulse:ee(u)})),u=t.add(Ra({pulse:ee(u)})),t.addData("root",new pa(t,o,o,u)),t}function Hl(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function cre(e,t){const n=s=>_i(e[s],t[s]),i=[Hl("background",n("background")),Hl("autosize",bte(n("autosize"))),Hl("padding",vte(n("padding"))),Hl("width",n("width")||0),Hl("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return oe(e.signals).forEach(s=>{le(r,s.name)?s=ye(r[s.name],s):i.push(s),o[s.name]=s}),oe(t.signals).forEach(s=>{!le(o,s.name)&&!le(r,s.name)&&i.push(s)}),i}function $N(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 S_(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}$N.prototype=S_.prototype={parse(e){return CN(e,this)},fork(){return new S_(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 Nb?ee(e):e;return this.add(Ene({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(ee(this.add(Ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?ee(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $e(this._parent)},encode(){return $e(this._encode)},lookup(){return $e(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Ke(e))return rf(e,t);e.signal||L("Unsupported field reference: "+re(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=ee(this.add(fne(r)))}return i},compareRef(e){let t=!1;const n=o=>vt(o)?(t=!0,this.signalRef(o.signal)):Kte(o)?(t=!0,this.exprRef(o.expr)):o,i=oe(e.field).map(n),r=oe(e.order).map(n);return t?ee(this.add(c_({fields:i,orders:r}))):u_(i,r)},keyRef(e,t){let n=!1;const i=o=>vt(o)?(n=!0,ee(r[o.signal])):o,r=this.signals;return e=oe(e).map(i),n?ee(this.add(dne({fields:e,flat:t}))):Hte(e,t)},sortRef(e){if(!e)return e;const t=g0(e.op,e.field),n=e.order||Vte;return n.signal?ee(this.add(c_({fields:t,orders:this.signalRef(n.signal)}))):u_(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 le(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&L("Duplicate signal name: "+re(e));const n=t instanceof Nb?t:this.add(Rg(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||L("Unrecognized signal name: "+re(e)),this.signals[e]},signalRef(e){return this.signals[e]?ee(this.signals[e]):(le(this.lambdas,e)||(this.lambdas[e]=this.add(Rg(null))),ee(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=wr(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||!me(e)?e:this.signalRef(e.signal||lw(e))},exprRef(e,t){const n={expr:wr(e,this)};return t&&(n.expr.$name=t),ee(this.add(lne(n)))},addBinding(e,t){this.bindings||L("Nested signals do not support binding: "+re(e)),this.bindings.push(ye({signal:e},t))},addScaleProj(e,t){le(this.scales,e)&&L("Duplicate scale or projection name: "+re(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,Ane(t))},addProjection(e,t){this.addScaleProj(e,vne(t))},getScale(e){return this.scales[e]||L("Unrecognized scale name: "+re(e)),this.scales[e]},scaleRef(e){return ee(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 le(this.data,e)&&L("Duplicate data set name: "+re(e)),this.data[e]=t},getData(e){return this.data[e]||L("Undefined data set name: "+re(e)),this.data[e]},addDataPipeline(e,t){return le(this.data,e)&&L("Duplicate data set name: "+re(e)),this.addData(e,pa.fromEntries(this,t))}};function lw(e){return(Z(e)?fre:dre)(e)}function fre(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(me(r)?r.signal||lw(r):re(r))}return n+"]"}function dre(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+re(i)+":"+(me(r)?r.signal||lw(r):re(r));return t+"}"}function hre(){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 gre(e,t,n){return me(e)||L("Input Vega specification must be an object."),t=SP(hre(),t,e.config),lre(e,new $N(t,n)).toRuntime()}var pre="5.33.0";Ix(Du,jB,UG,xH,rY,GY,bK,JX,vK,WK,eJ,aJ);const mre=Object.freeze(Object.defineProperty({__proto__:null,Bounds:pt,CanvasHandler:Nf,CanvasRenderer:Qh,DATE:In,DAY:Zt,DAYOFYEAR:vr,Dataflow:mu,Debug:Wk,Error:Uk,EventStream:Cp,Gradient:yM,GroupItem:Wp,HOURS:ei,Handler:R2,HybridHandler:u5,HybridRenderer:qy,Info:qk,Item:qp,MILLISECONDS:Ii,MINUTES:ti,MONTH:nn,Marks:ni,MultiPulse:Jx,None:Bk,Operator:Ge,Parameters:Sp,Pulse:Ho,QUARTER:Pn,RenderType:zo,Renderer:Rf,ResourceLoader:SM,SECONDS:pi,SVGHandler:XM,SVGRenderer:B2,SVGStringRenderer:a5,Scenegraph:UM,TIME_UNITS:Ux,Transform:M,View:WR,WEEK:bt,Warn:jk,YEAR:jt,accessor:yo,accessorFields:Pk,accessorName:x9,array:zc,ascending:Px,bandwidthNRD:tv,bin:w3,bootstrapCI:A3,boundClip:b5,boundContext:Df,boundItem:Iy,boundMark:PM,boundStroke:bo,changeset:Ta,clampRange:z9,codegenExpression:yR,compare:U9,constant:G9,cumulativeLogNormal:av,cumulativeNormal:_p,cumulativeUniform:fv,dayofyear:kD,debounce:H9,defaultLocale:Hx,definition:x3,densityLogNormal:sv,densityNormal:nv,densityUniform:cv,domChild:yt,domClear:ai,domCreate:Po,domFind:O2,dotbin:S3,error:Qd,expressionFunction:ht,extend:Ix,extent:V9,extentIndex:Y9,falsy:C9,fastmap:K9,field:Ox,flush:J9,font:Xp,fontFamily:Of,fontSize:_r,format:Zd,formatLocale:Mh,formats:Xx,hasOwnProperty:Hr,id:w9,identity:Rx,inferType:u3,inferTypes:l3,ingest:Oe,inherits:Q9,inrange:Z9,interpolate:c2,interpolateColors:Up,interpolateRange:iM,intersect:g5,intersectBoxLine:lu,intersectPath:b2,intersectPoint:x2,intersectRule:$M,isArray:op,isBoolean:Xk,isDate:Kk,isFunction:lp,isIterable:eP,isNumber:Jk,isObject:oa,isRegExp:tP,isString:to,isTuple:wp,key:nP,lerp:iP,lineHeight:Zo,loader:vp,locale:s3,logger:_9,lruCache:oP,markup:z2,merge:sP,mergeConfig:Nx,multiLineOffset:D2,one:S9,pad:aP,panLinear:k9,panLog:D9,panPow:T9,panSymlog:M9,parse:gre,parseExpression:gR,parseSelector:ds,path:Tx,pathCurves:p2,pathEqual:x5,pathParse:Nu,pathRectangle:vM,pathRender:Hc,pathSymbols:xM,pathTrail:EM,peek:ol,point:Jp,projection:oE,quantileLogNormal:uv,quantileNormal:Fp,quantileUniform:dv,quantiles:Zx,quantizeInterpolator:rM,quarter:P9,quartiles:ev,get random(){return mi},randomInteger:Hz,randomKDE:rv,randomLCG:Gz,randomLogNormal:$3,randomMixture:_3,randomNormal:iv,randomUniform:F3,read:d3,regressionConstant:hv,regressionExp:D3,regressionLinear:gv,regressionLoess:O3,regressionLog:k3,regressionPoly:M3,regressionPow:T3,regressionQuad:pv,renderModule:Qp,repeat:ec,resetDefaultLocale:j7,resetSVGClipId:AM,resetSVGDefIds:oG,responseType:f3,runtimeContext:TR,sampleCurve:Dp,sampleLogNormal:ov,sampleNormal:$p,sampleUniform:lv,scale:Me,sceneEqual:U2,sceneFromJSON:zM,scenePickVisit:Wh,sceneToJSON:IM,sceneVisit:zi,sceneZOrder:v2,scheme:f2,serializeXML:i5,setHybridRendererOptions:tG,setRandom:qz,span:uP,splitAccessPath:Mx,stringValue:pu,textMetrics:Jn,timeBin:HD,timeFloor:LD,timeFormatLocale:jc,timeInterval:ul,timeOffset:zD,timeSequence:jD,timeUnitSpecifier:FD,timeUnits:jx,toBoolean:lP,toDate:fP,toNumber:Lx,toSet:hP,toString:dP,transform:v3,transforms:Du,truncate:gP,truthy:zk,tupleid:te,typeParsers:_y,utcFloor:PD,utcInterval:ll,utcOffset:BD,utcSequence:qD,utcdayofyear:MD,utcquarter:I9,utcweek:OD,version:pre,visitArray:pP,week:DD,writeConfig:sp,zero:A9,zoomLinear:O9,zoomLog:R9,zoomPow:N9,zoomSymlog:L9},Symbol.toStringTag,{value:"Module"})),yre=/("(?:[^\\"]|\\.)*")|[:,]/g;function w1(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(yre,(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,g,p;if(Array.isArray(s)){g="[",p="]";const{length:m}=s;for(;h<m;h++)d.push(o(s[h],f,h===m-1?0:1)||"null")}else{g="{",p="}";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[g,n+d.join(`,
12
+ : v !== v && u === u ? ${i} : `}var KZ={operator:(e,t)=>jl(e,["_"],t.code),parameter:(e,t)=>jl(e,["datum","_"],t.code),event:(e,t)=>jl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return jl(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["+re(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=HZ(i,n),r+="return m;",jl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(re).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)`),XZ(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function JZ(e){const t=this;VZ(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function QZ(e){const t=this;if(e.params){const n=t.get(e.id);n||L("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function ZZ(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=Z(r)?r.map(o=>X$(o,n,t)):X$(r,n,t)}return t}function X$(e,t,n){if(!e||!me(e))return e;for(let i=0,r=K$.length,o;i<r;++i)if(o=K$[i],le(e,o.key))return o.parse(e,t,n);return e}var K$=[{key:"$ref",parse:eee},{key:"$key",parse:nee},{key:"$expr",parse:tee},{key:"$field",parse:iee},{key:"$encode",parse:oee},{key:"$compare",parse:ree},{key:"$context",parse:see},{key:"$subflow",parse:aee},{key:"$tupleid",parse:uee}];function eee(e,t){return t.get(e.$ref)||L("Operator not defined: "+e.$ref)}function tee(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=ri(t.parameterExpression(e.$expr),e.$fields))}function nee(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=lD(e.$key,e.$flat,t.expr.codegen))}function iee(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Li(e.$field,e.$name,t.expr.codegen))}function ree(e,t){const n="c:"+e.$compare+"_"+e.$order,i=oe(e.$compare).map(r=>r&&r.$tupleid?te:r);return t.fn[n]||(t.fn[n]=sD(i,e.$order,t.expr.codegen))}function oee(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=ri(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function see(e,t){return t}function aee(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 uee(){return te}function lee(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&&L("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function cee(e){var t=this,n=me(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||L("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 fee={skip:!0};function dee(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 hee(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],fee)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Pi).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function kR(e,t,n,i){return new DR(e,t,n,i)}function DR(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||KZ,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function J$(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)}DR.prototype=J$.prototype={fork(){const e=new J$(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),YZ(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[GE(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:WZ,parseOperator:JZ,parseOperatorParameters:QZ,parseParameters:ZZ,parseStream:lee,parseUpdate:cee,getState:dee,setState:hee};function gee(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),TR(t,e.description()))}function TR(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function pee(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const y1="default";function mee(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y1,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?Ke(r)?r:r.user:y1,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 Ke(i)||(r=i.item,i=i.user),Ob(e,i&&i!==y1?i:r||i),r},{cursor:t})}function Ob(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 Dg(e,t){var n=e._runtime.data;return le(n,t)||L("Unrecognized data set: "+t),n[t]}function yee(e,t){return arguments.length<2?Dg(this,e).values.value:c0.call(this,e,Ta().remove(Pi).insert(t))}function c0(e,t){g3(t)||L("Second argument to changes must be a changeset.");const n=Dg(this,e);return n.modified=!0,this.pulse(n.input,t)}function bee(e,t){return c0.call(this,e,Ta().insert(t))}function xee(e,t){return c0.call(this,e,Ta().remove(t))}function MR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function OR(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function f0(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function vee(e){var t=f0(e),n=MR(e),i=OR(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 Eee(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=f0(e),s=t.changedTouches?t.changedTouches[0]:t,o=Jp(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=wee(e,n,o),t}function wee(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;Ke(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:wn(e),item:wn(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const Q$="view",Aee="timer",See="window",Cee={trap:!1};function $ee(e){const t=ye({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{Z(i[o])&&(i[o]=yr(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function RR(e,t,n,i){e._eventListeners.push({type:n,sources:oe(t),handler:i})}function _ee(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 Pd(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||me(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Fee(e,t,n){var i=this,r=new Cp(n),o=function(l,c){i.runAsync(null,()=>{e===Q$&&_ee(i,t)&&l.preventDefault(),r.receive(Eee(i,l,c))})},s;if(e===Aee)Pd(i,"timer",t)&&i.timer(o,t);else if(e===Q$)Pd(i,"view",t)&&i.addEventListener(t,o,Cee);else if(e===See?Pd(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Pd(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);RR(i,s,t,o)}return r}function Z$(e){return e.item}function e_(e){return e.item.mark.source}function t_(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function kee(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",Z$),e_,t_(e)),this.on(this.events("view","pointerout",Z$),e_,t_(t)),this}function Dee(){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 Qn(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 Tee="vega-bind",Mee="vega-bind-name",Oee="vega-bind-radio";function Ree(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=aD(i.debounce,r.update))),(i.input==null&&i.element?Nee:Pee)(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 Nee(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),RR(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(Lee(r))}}function Lee(e){return typeof Event<"u"?new Event(e):{type:e}}function Pee(e,t,n,i){const r=i.signal(n.signal),o=Qn("div",{class:Tee}),s=n.input==="radio"?o:o.appendChild(Qn("label"));s.appendChild(Qn("span",{class:Mee},n.name||n.signal)),t.appendChild(o);let a=Iee;switch(n.input){case"checkbox":a=zee;break;case"select":a=Bee;break;case"radio":a=Uee;break;case"range":a=jee;break}a(e,s,n,r)}function Iee(e,t,n,i){const r=Qn("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 zee(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Qn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function Bee(e,t,n,i){const r=Qn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};Tg(s,i)&&(u.selected=!0),r.appendChild(Qn("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(Tg(n.options[a],s)){r.selectedIndex=a;return}}}function Uee(e,t,n,i){const r=Qn("span",{class:Oee}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};Tg(s,i)&&(u.checked=!0);const l=Qn("input",u);l.addEventListener("change",()=>e.update(s));const c=Qn("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)Tg(a[l].value,s)&&(a[l].checked=!0)}}function jee(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||ra(o,r,100),a=Qn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Qn("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 Tg(e,t){return e===t||e+""==t+""}function NR(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,MR(e),OR(e),f0(e),r,o).background(e.background())}function HE(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function qee(e,t,n,i){const r=new i(e.loader(),HE(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,f0(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function Wee(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Qp(i);e=n._el=e?b1(n,e,!0):null,gee(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Nf,a=e?o.renderer:o.headless;return n._renderer=a?NR(n,n._renderer,e,a):null,n._handler=qee(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=b1(n,t,!0):e.appendChild(Qn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=b1(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Ree(n,u.element||t,u)})),n}function b1(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 ql=e=>+e||0,Gee=e=>({top:e,bottom:e,left:e,right:e});function n_(e){return me(e)?{top:ql(e.top),bottom:ql(e.bottom),left:ql(e.left),right:ql(e.right)}:Gee(ql(e))}async function VE(e,t,n,i){const r=Qp(t),o=r&&r.headless;return o||L("Unrecognized renderer type: "+t),await e.runAsync(),NR(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function Hee(e,t){e!==zo.Canvas&&e!==zo.SVG&&e!==zo.PNG&&L("Unrecognized image type: "+e);const n=await VE(this,e,t);return e===zo.SVG?Vee(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Vee(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Yee(e,t){return(await VE(this,zo.Canvas,e,t)).canvas()}async function Xee(e){return(await VE(this,zo.SVG,e)).svg()}function Kee(e,t,n){return kR(e,Du,nf,n).parse(t)}function Jee(e){var t=this._runtime.scales;return le(t,e)||L("Unrecognized scale or projection: "+e),t[e].value}var LR="width",PR="height",YE="padding",i_={skip:!0};function IR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===YE?i.left+i.right:0)}function zR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===YE?i.top+i.bottom:0)}function Qee(e){var t=e._signals,n=t[LR],i=t[PR],r=t[YE];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=IR(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=zR(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 Zee(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(LR,n,i_),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(PR,i,i_),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 ete(e){return this._runtime.getState(e||{data:tte,signals:nte,recurse:!0})}function tte(e,t){return t.modified&&Z(t.input.value)&&!e.startsWith("_:vega:_")}function nte(e,t){return!(e==="parent"||t instanceof Du.proxy)}function ite(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function rte(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(FY(n,t))}function ote(e,t,n,i){const r=e.element();r&&r.setAttribute("title",ste(i))}function ste(e){return e==null?"":Z(e)?BR(e):me(e)&&!Ys(e)?ate(e):e+""}function ate(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(Z(n)?BR(n):UR(n))}).join(`
13
+ `)}function BR(e){return"["+e.map(UR).join(", ")+"]"}function UR(e){return Z(e)?"[…]":me(e)&&!Ys(e)?"{…}":e}function ute(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&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 jR(e,t){const n=this;if(t=t||{},mu.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=ye({},e.locale,t.locale);n.locale(r3(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||zo.Canvas,n._scenegraph=new zM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||ote,n._redraw=!0,n._handler=new Nf().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=$ee(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Kee(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:ye({},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=IR(n,n._width),n._viewHeight=zR(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Qee(n),pee(n),mee(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Id(e,t){return le(e._signals,t)?e._signals[t]:L("Unrecognized signal name: "+re(t))}function qR(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function r_(e,t,n,i){let r=qR(n,i);return r||(r=HE(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function o_(e,t,n){const i=qR(t,n);return i&&t._targets.remove(i),e}G(jR,mu,{async evaluate(e,t,n){if(await mu.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,vee(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&eh(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&&TR(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=Id(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",n_(e)):n_(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?(Qp(e)||L("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&&(mu.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Id(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Zee,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=HE(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 r_(this,e,Id(this,e),t)},removeSignalListener(e,t){return o_(this,Id(this,e),t)},addDataListener(e,t){return r_(this,e,Dg(this,e).values,t)},removeDataListener(e,t){return o_(this,Dg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Ob(this,null);this._globalCursor=!!e,t&&Ob(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:rte,events:Fee,finalize:Dee,hover:kee,data:yee,change:c0,insert:bee,remove:xee,scale:Jee,initialize:Wee,toImageURL:Hee,toCanvas:Yee,toSVG:Xee,getState:ete,setState:ite,_watchPixelRatio:ute});const lte="view",Mg="[",Og="]",WR="{",GR="}",cte=":",HR=",",fte="@",dte=">",hte=/[[\]{}]/,gte={"*":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 VR,YR;function ds(e,t,n){return VR=t||lte,YR=n||gte,XR(e.trim()).map(Rb)}function pte(e){return YR[e]}function Oc(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.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function XR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Oc(e,r,HR,Mg+WR,Og+GR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function Rb(e){return e[0]==="["?mte(e):yte(e)}function mte(e){const t=e.length;let n=1,i;if(n=Oc(e,n,Og,Mg,Og),n===t)throw"Empty between selector: "+e;if(i=XR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==dte)throw"Expected '>' after between selector: "+e;i=i.map(Rb);const r=Rb(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function yte(e){const t={source:VR},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===GR){if(a=e.lastIndexOf(WR),a>=0){try{i=bte(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]===fte&&(r=++a),u=Oc(e,a,cte),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=Oc(e,a,Mg),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=Oc(e,a,Og),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==Mg)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||hte.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):pte(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 bte(e){const t=e.split(HR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function xte(e){return me(e)?e:{type:e||"pad"}}const Wl=e=>+e||0,vte=e=>({top:e,bottom:e,left:e,right:e});function Ete(e){return me(e)?e.signal?e:{top:Wl(e.top),bottom:Wl(e.bottom),left:Wl(e.left),right:Wl(e.right)}:vte(Wl(e))}const $t=e=>me(e)&&!Z(e)?ye({},e):{value:e};function s_(e,t,n,i){return n!=null?(me(n)&&!Z(n)||Z(n)&&n.length&&me(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Wt(e,t,n){for(const i in t)s_(e,i,t[i]);for(const i in n)s_(e,i,n[i],"update")}function gl(e,t,n){for(const i in t)n&&le(n,i)||(e[i]=ye(e[i]||{},t[i]));return e}function au(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const XE="mark",KE="frame",JE="scope",wte="axis",Ate="axis-domain",Ste="axis-grid",Cte="axis-label",$te="axis-tick",_te="axis-title",Fte="legend",kte="legend-band",Dte="legend-entry",Tte="legend-gradient",KR="legend-label",Mte="legend-symbol",Ote="legend-title",Rte="title",Nte="title-text",Lte="title-subtitle";function Pte(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!au(u,e)&&x1(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===KE?r.group:n===XE?ye({},r.mark,r[t]):null;for(u in c)l=au(u,e)||(u==="fill"||u==="stroke")&&(au("fill",e)||au("stroke",e)),l||x1(o,u,c[u]);oe(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)au(h,e)||x1(o,h,d[h])}),e=ye({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=ye(s,e.enter),a&&(e.update=ye(a,e.update)),e}function x1(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const JR=e=>Ke(e)?re(e):e.signal?`(${e.signal})`:QR(e);function d0(e){if(e.gradient!=null)return zte(e);let t=e.signal?`(${e.signal})`:e.color?Ite(e.color):e.field!=null?QR(e.field):e.value!==void 0?re(e.value):void 0;return e.scale!=null&&(t=Bte(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${yh(e.exponent)})`),e.mult!=null&&(t+=`*${yh(e.mult)}`),e.offset!=null&&(t+=`+${yh(e.offset)}`),e.round&&(t=`round(${t})`),t}const zd=(e,t,n,i)=>`(${e}(${[t,n,i].map(d0).join(",")})+'')`;function Ite(e){return e.c?zd("hcl",e.h,e.c,e.l):e.h||e.s?zd("hsl",e.h,e.s,e.l):e.l||e.a?zd("lab",e.l,e.a,e.b):e.r||e.g||e.b?zd("rgb",e.r,e.g,e.b):null}function zte(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:re(n));for(;t.length&&$e(t)==null;)t.pop();return t.unshift(JR(e.gradient)),`gradient(${t.join(",")})`}function yh(e){return me(e)?"("+d0(e)+")":e}function QR(e){return ZR(me(e)?e:{datum:e})}function ZR(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):L("Invalid field reference: "+re(e));return e.signal||(i=Ke(i)?zx(i).map(re).join("]["):ZR(i)),t+"["+i+"]"}function Bte(e,t){const n=JR(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?"":"*"+yh(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Ute(e){let t="";return e.forEach(n=>{const i=d0(n);t+=n.test?`(${n.test})?${i}:`:i}),$e(t)===":"&&(t+="null"),t}function eN(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=Pte(e,t,n,i,r.config);for(const a in e)s[a]=jte(e[a],t,o,r);return o}function jte(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=Wte(qte(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function qte(e){return Z(e)?Ute(e):d0(e)}function Wte(e,t,n,i){const r=wr(e,t);return r.$fields.forEach(o=>i[o]=1),ye(n,r.$params),r.$expr}const Gte="outer",Hte=["value","update","init","react","bind"];function a_(e,t){L(e+' for "outer" push: '+re(t))}function tN(e,t){const n=e.name;if(e.push===Gte)t.signals[n]||a_("No prior signal definition",n),Hte.forEach(i=>{e[i]!==void 0&&a_("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 Nb(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function h0(e,t,n,i){return new Nb(e,t,n,i)}function Rg(e,t){return h0("operator",e,t)}function ee(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function rf(e,t){return t?{$field:e,$name:t}:{$field:e}}const Lb=rf("key");function u_(e,t){return{$compare:e,$order:t}}function Vte(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Yte="ascending",Xte="descending";function Kte(e){return me(e)?(e.order===Xte?"-":"+")+g0(e.op,e.field):""}function g0(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const QE="scope",Pb="view";function vt(e){return e&&e.signal}function Jte(e){return e&&e.expr}function bh(e){if(vt(e))return!0;if(me(e)){for(const t in e)if(bh(e[t]))return!0}return!1}function _i(e,t){return e??t}function Qs(e){return e&&e.signal||e}const l_="timer";function of(e,t){return(e.merge?Zte:e.stream?ene:e.type?tne:L("Invalid stream specification: "+re(e)))(e,t)}function Qte(e){return e===QE?Pb:e||Pb}function Zte(e,t){const n=e.merge.map(r=>of(r,t)),i=ZE({merge:n},e,t);return t.addStream(i).id}function ene(e,t){const n=of(e.stream,t),i=ZE({stream:n},e,t);return t.addStream(i).id}function tne(e,t){let n;e.type===l_?(n=t.event(l_,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Qte(e.source),e.type);const i=ZE({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function ZE(e,t,n){let i=t.between;return i&&(i.length!==2&&L('Stream "between" parameter must have 2 entries: '+re(t)),e.between=[of(i[0],n),of(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(nne(t.marktype,t.markname,t.markrole)),t.source===QE&&i.push("inScope(event.item)"),i.length&&(e.filter=wr("("+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 nne(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 ine={code:"_.$value",ast:{type:"Identifier",value:"value"}};function rne(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||L("Signal update missing events specification."),Ke(o)&&(o=ds(o,t.isSubscope()?QE:Pb)),o=oe(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[sne(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&L("Signal encode and update are mutually exclusive."),s="encode(item(),"+re(i)+")"),r.update=Ke(s)?wr(s,t):s.expr!=null?wr(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:ine,$params:{$value:t.signalRef(s.signal)}}:L("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(ye(one(u,t),r)))}function one(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):of(e,t)}}function sne(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function ane(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?L("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=wr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>rne(r,t,n.id))}const qe=e=>(t,n,i)=>h0(e,n,t||void 0,i),nN=qe("aggregate"),une=qe("axisticks"),iN=qe("bound"),Gi=qe("collect"),c_=qe("compare"),lne=qe("datajoin"),rN=qe("encode"),cne=qe("expression"),fne=qe("facet"),dne=qe("field"),hne=qe("key"),gne=qe("legendentries"),pne=qe("load"),mne=qe("mark"),yne=qe("multiextent"),bne=qe("multivalues"),xne=qe("overlap"),vne=qe("params"),oN=qe("prefacet"),Ene=qe("projection"),wne=qe("proxy"),Ane=qe("relay"),sN=qe("render"),Sne=qe("scale"),Ra=qe("sieve"),Cne=qe("sortitems"),aN=qe("viewlayout"),$ne=qe("values");let _ne=0;const uN={min:"min",max:"max",count:"sum"};function Fne(e,t){const n=e.type||"linear";JT(n)||L("Unrecognized scale type: "+re(n)),t.addScale(e.name,{type:n,domain:void 0})}function kne(e,t){const n=t.getScale(e.name).params;let i;n.domain=lN(e.domain,e,t),e.range!=null&&(n.range=fN(e,t,n)),e.interpolate!=null&&zne(e.interpolate,n),e.nice!=null&&(n.nice=Ine(e.nice,t)),e.bins!=null&&(n.bins=Pne(e.bins,t));for(i in e)le(n,i)||i==="name"||(n[i]=fi(e[i],t))}function fi(e,t){return me(e)?e.signal?t.signalRef(e.signal):L("Unsupported object: "+re(e)):e}function xh(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>fi(n,t))}function p0(e){L("Can not find data set: "+re(e))}function lN(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&L("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(Z(e)?Dne:e.fields?Mne:Tne)(e,t,n)}function Dne(e,t,n){return e.map(i=>fi(i,n))}function Tne(e,t,n){const i=n.getData(e.data);return i||p0(e.data),Ru(t.type)?i.valuesRef(n,e.field,cN(e.sort,!1)):eM(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Mne(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=Ke(s)?{data:i,field:s}:Z(s)||s.signal?One(s,n):s,o.push(s),o),[]);return(Ru(t.type)?Rne:eM(t.type)?Nne:Lne)(e,n,r)}function One(e,t){const n="_:vega:_"+_ne++,i=Gi({});if(Z(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+re(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ra({})]),{data:n,field:"data"}}function Rne(e,t,n){const i=cN(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||p0(l.data),c.countsRef(t,l.field,i)}),a={groupby:Lb,pulse:s};i&&(r=i.op||"count",o=i.field?g0(r,i.field):"count",a.ops=[uN[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(nN(a));const u=t.add(Gi({pulse:ee(r)}));return o=t.add($ne({field:Lb,sort:t.sortRef(i),pulse:ee(u)})),ee(o)}function cN(e,t){return e&&(!e.field&&!e.op?me(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?L("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!uN[e.op]&&L("Multiple domain scales can not be sorted using "+e.op)),e}function Nne(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||p0(r.data),o.domainRef(t,r.field)});return ee(t.add(bne({values:i})))}function Lne(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||p0(r.data),o.extentRef(t,r.field)});return ee(t.add(yne({extents:i})))}function Pne(e,t){return e.signal||Z(e)?xh(e,t):t.objectProperty(e)}function Ine(e,t){return e.signal?t.signalRef(e.signal):me(e)?{interval:fi(e.interval),step:fi(e.step)}:fi(e)}function zne(e,t){t.interpolate=fi(e.type||e),e.gamma!=null&&(t.interpolateGamma=fi(e.gamma))}function fN(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(Ke(r)){if(i&&le(i,r))return e=ye({},e,{range:i[r]}),fN(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Ru(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:L("Unrecognized scale range value: "+re(r))}else if(r.scheme){n.scheme=Z(r.scheme)?xh(r.scheme,t):fi(r.scheme,t),r.extent&&(n.schemeExtent=xh(r.extent,t)),r.count&&(n.schemeCount=fi(r.count,t));return}else if(r.step){n.rangeStep=fi(r.step,t);return}else{if(Ru(e.type)&&!Z(r))return lN(r,e,t);Z(r)||L("Unsupported range type: "+re(r))}return r.map(o=>(Z(o)?xh:fi)(o,t))}function Bne(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Ib(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Ib(n[r],r,t));t.addProjection(e.name,i)}function Ib(e,t,n){return Z(e)?e.map(i=>Ib(i,t,n)):me(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:L("Unsupported parameter object: "+re(e)):e}const Hi="top",pl="left",ml="right",ns="bottom",dN="center",Une="vertical",jne="start",qne="middle",Wne="end",zb="index",ew="label",Gne="offset",ju="perc",Hne="perc2",hi="value",Wf="guide-label",tw="guide-title",Vne="group-title",Yne="group-subtitle",f_="symbol",vh="gradient",Bb="discrete",Ub="size",Xne="shape",Kne="fill",Jne="stroke",Qne="strokeWidth",Zne="strokeDash",eie="opacity",nw=[Ub,Xne,Kne,Jne,Qne,Zne,eie],Gf={name:1,style:1,interactive:1},Ce={value:0},gi={value:1},m0="group",hN="rect",iw="rule",tie="symbol",Na="text";function sf(e){return e.type=m0,e.interactive=e.interactive||!1,e}function qn(e,t){const n=(i,r)=>_i(e[i],_i(t[i],r));return n.isVertical=i=>Une===_i(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>_i(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>_i(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>_i(e.columns,_i(t.columns,+n.isVertical(!0))),n}function gN(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 nie(e,t,n){const i=t.config.style[n];return i&&i[e]}function y0(e,t,n){return`item.anchor === '${jne}' ? ${e} : item.anchor === '${Wne}' ? ${t} : ${n}`}const rw=y0(re(pl),re(ml),re(dN));function iie(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'`},me(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 pN(e,t){return t?e?me(e)?Object.assign({},e,{offset:pN(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=gl(e.encode,t,Gf)):e.interactive=!1,e}function rie(e,t,n,i){const r=qn(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:Ce,x:Ce,y:Ce,width:$t(f),height:$t(d)},update:ye({},u,{opacity:gi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ce}};return Wt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),ii({type:hN,role:Tte,encode:h},i)}function oie(e,t,n,i,r){const o=qn(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 g={opacity:Ce,fill:{scale:t,field:hi}};g[l]={signal:h+"datum."+ju,mult:u},g[c]=Ce,g[f]={signal:h+"datum."+Hne,mult:u},g[d]=$t(a);const p={enter:g,update:ye({},g,{opacity:gi}),exit:{opacity:Ce}};return Wt(p,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),ii({type:hN,role:kte,key:hi,from:r,encode:p},i)}const sie=`datum.${ju}<=0?"${pl}":datum.${ju}>=1?"${ml}":"${dN}"`,aie=`datum.${ju}<=0?"${ns}":datum.${ju}>=1?"${Hi}":"${qne}"`;function d_(e,t,n,i){const r=qn(e,t),o=r.isVertical(),s=$t(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const g={enter:l={opacity:Ce},update:c={opacity:gi,text:{field:ew}},exit:{opacity:Ce}};return Wt(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:_i(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:aie},f="y",d="x",h="1-"):(l.align=c.align={signal:sie},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+ju,mult:a},l[d]=c[d]=s,s.offset=_i(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+zb}:void 0,ii({type:Na,role:KR,style:Wf,key:hi,from:i,encode:g,overlap:u},n)}function uie(e,t,n,i,r){const o=qn(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.${Gne} : datum.${Ub}`,h=l?$t(l):{field:Ub},g=`datum.${zb}`,p=`max(1, ${r})`;let m,y,b,x,v;h.mult=.5,m={enter:y={opacity:Ce,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:gi,x:y.x,y:y.y},exit:{opacity:Ce}};let w=null,A=null;e.fill||(w=t.symbolBaseFillColor,A=t.symbolBaseStrokeColor),Wt(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",A),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),nw.forEach(_=>{e[_]&&(b[_]=y[_]={scale:e[_],field:hi})});const E=ii({type:tie,role:Mte,key:hi,from:f,clip:l?!0:void 0,encode:m},n.symbols),S=$t(c);S.offset=o("labelOffset"),m={enter:y={opacity:Ce,x:{signal:d,offset:S},y:h},update:b={opacity:gi,text:{field:ew},x:y.x,y:y.y},exit:{opacity:Ce}},Wt(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 C=ii({type:Na,role:KR,style:Wf,key:hi,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ce,height:l?$t(l):Ce,opacity:Ce},exit:{opacity:Ce},update:b={opacity:gi,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${p})`,b.row.signal=`${g}%${x}`,b.column.signal=`floor(${g} / ${x})`,v={field:["row",g]}):(b.row.signal=`floor(${g} / ${p})`,b.column.signal=`${g} % ${p}`,v={field:g}),b.column.signal=`(${r})?${b.column.signal}:${g}`,i={facet:{data:i,name:"value",groupby:zb}},sf({role:JE,from:i,encode:gl(m,s,Gf),marks:[E,C],name:u,interactive:a,sort:v})}function lie(e,t){const n=qn(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ow='item.orient === "left"',sw='item.orient === "right"',b0=`(${ow} || ${sw})`,cie=`datum.vgrad && ${b0}`,fie=y0('"top"','"bottom"','"middle"'),die=y0('"right"','"left"','"center"'),hie=`datum.vgrad && ${sw} ? (${die}) : (${b0} && !(datum.vgrad && ${ow})) ? "left" : ${rw}`,gie=`item._anchor || (${b0} ? "middle" : "start")`,pie=`${cie} ? (${ow} ? -90 : 90) : 0`,mie=`${b0} ? (datum.vgrad ? (${sw} ? "bottom" : "top") : ${fie}) : "top"`;function yie(e,t,n,i){const r=qn(e,t),o={enter:{opacity:Ce},update:{opacity:gi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ce}};return Wt(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:gie},angle:{signal:pie},align:{signal:hie},baseline:{signal:mie},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:Na,role:Ote,style:tw,from:i,encode:o},n)}function bie(e,t){let n;return me(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+h_(e.path)+")":e.sphere&&(n="geoShape("+h_(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function h_(e){return me(e)&&e.signal?e.signal:re(e)}function mN(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===m0?JE:t||XE}function xie(e){return{marktype:e.type,name:e.name||void 0,role:e.role||mN(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function vie(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function aw(e,t){const n=y3(e.type);n||L("Unrecognized transform type: "+re(e.type));const i=h0(n.type.toLowerCase(),null,yN(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function yN(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=Eie(s,t,n)}return i}function Eie(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return wie(e,t,n);if(r===void 0){e.required&&L("Missing required "+re(t.type)+" parameter: "+re(e.name));return}else{if(i==="param")return Aie(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!vt(r)?r.map(o=>g_(e,o,n)):g_(e,r,n)}function g_(e,t,n){const i=e.type;if(vt(t))return m_(i)?L("Expression references can not be signals."):v1(i)?n.fieldRef(t):y_(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||v1(i);return r&&Sie(t)?n.exprRef(t.expr,t.as):r&&Cie(t)?rf(t.field,t.as):m_(i)?wr(t,n):$ie(i)?ee(n.getData(t).values):v1(i)?rf(t):y_(i)?n.compareRef(t):t}}function wie(e,t,n){return Ke(t.from)||L('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Aie(e,t,n){const i=t[e.name];return e.array?(Z(i)||L("Expected an array of sub-parameters. Instead: "+re(i)),i.map(r=>p_(e,r,n))):p_(e,i,n)}function p_(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||L("Unsupported parameter: "+re(t));const o=ye(yN(r,t,n),r.key);return ee(n.add(vne(o)))}const Sie=e=>e&&e.expr,Cie=e=>e&&e.field,$ie=e=>e==="data",m_=e=>e==="expr",v1=e=>e==="field",y_=e=>e==="compare";function _ie(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||L("Only group marks can be faceted."),i.field!=null?s=a=Eh(i,n):(e.data?a=ee(n.getData(e.data).aggregate):(o=aw(ye({type:"aggregate",groupby:oe(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Eh(i,n),s=a=ee(n.add(o))),r=n.keyRef(i.groupby,!0))):s=ee(n.add(Gi(null,[{}]))),s||(s=Eh(e,n)),{key:r,pulse:s,parent:a}}function Eh(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ee(t.getData(e.data).output)}function pa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}pa.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=ee(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new pa(e,o,r,i,s)};function bN(e){return Ke(e)?e:null}function b_(e,t,n){const i=g0(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 Gl(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=Kte(o);let l=bN(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:Lb,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:ee(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(h0(i,void 0,d)),s&&(t.index[r]=f),c=ee(f),l!=null&&(a[l]=c)}return c}pa.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=bN(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&b_(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ee(i.output)},n&&n.field&&b_(e,u,n),a=e.add(nN(u)),s=e.add(Gi({pulse:ee(a)})),s={agg:a,ref:ee(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return ee(this.values)},extentRef(e,t){return Gl(e,this,"extent","extent",t,!1)},domainRef(e,t){return Gl(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Gl(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Gl(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Gl(e,this,"indata","tupleindex",t,!0,!0)}};function Fie(e,t,n){const i=e.from.facet,r=i.name,o=Eh(i,t);let s;i.name||L("Facet must have a name: "+re(i)),i.data||L("Facet must reference a data set: "+re(i)),i.field?s=t.add(oN({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(fne({key:t.keyRef(i.groupby),group:ee(t.proxy(n.parent)),pulse:o})):L("Facet must specify groupby or field: "+re(i));const a=t.fork(),u=a.add(Gi()),l=a.add(Ra({pulse:ee(u)}));a.addData(r,new pa(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function kie(e,t,n){const i=t.add(oN({pulse:n.pulse})),r=t.fork();r.add(Ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function xN(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(Rg()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=wr(l,t);u.update=c.$expr,u.params=c.$params}function x0(e,t){const n=mN(e),i=e.type===m0,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===JE||n===KE,a,u,l,c,f,d,h;const g=n===XE||s||r,p=_ie(e.from,i,t);u=t.add(lne({key:p.key||(e.key?rf(e.key):void 0),pulse:p.pulse,clean:!i}));const m=ee(u);u=l=t.add(Gi({pulse:m})),u=t.add(mne({markdef:xie(e),interactive:vie(e.interactive,t),clip:bie(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ee(u)}));const y=ee(u);u=c=t.add(rN(eN(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(A=>{const E=aw(A,t),S=E.metadata;(S.generates||S.changes)&&L("Mark transforms should not generate new data."),S.nomod||(c.params.mod=!0),E.params.pulse=ee(u),t.add(u=E)}),e.sort&&(u=t.add(Cne({sort:t.compareRef(e.sort),pulse:ee(u)})));const b=ee(u);(r||s)&&(s=t.add(aN({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ee(s));const x=t.add(iN({mark:y,pulse:d||b}));h=ee(x),i&&(g&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?Fie(e,t,p):g?kie(e,t,p):t.parse(e),t.popState(),g&&(s&&a.push(s),a.push(x))),o&&(h=Die(o,h,t));const v=t.add(sN({pulse:h})),w=t.add(Ra({pulse:ee(v)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new pa(t,l,v,w)),e.on&&e.on.forEach(A=>{(A.insert||A.remove||A.toggle)&&L("Marks only support modify triggers."),xN(A,t,f)}))}function Die(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:vt(o)?n.signalRef(o.signal):o,method:vt(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=vt(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return ee(n.add(xne(s)))}function Tie(e,t){const n=t.config.legend,i=e.encode||{},r=qn(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;nw.forEach(x=>e[x]?(l[x]=e[x],c=c||e[x]):0),c||L("Missing valid scale for legend.");const g=Mie(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=ee(t.add(Gi(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=ee(t.add(gne(d={type:g,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 g===vh?(h=[rie(e,c,n,i.gradient),d_(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Qs(r.gradientLength())})/100))`)):g===Bb?h=[oie(e,c,n,i.gradient,b),d_(e,n,i.labels,b)]:(f=lie(e,n),h=[uie(e,n,i,b,Qs(f.columns))],d.size=Nie(e,t,h[0].marks)),h=[sf({role:Dte,from:m,encode:y,marks:h,layout:f,interactive:a})],p.title&&h.push(yie(e,n,i.title,m)),x0(sf({role:Fte,from:m,encode:gl(Rie(r,e,n),o,Gf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function Mie(e,t){let n=e.type||f_;return!e.type&&Oie(e)===1&&(e.fill||e.stroke)&&(n=l2(t)?vh:My(t)?Bb:f_),n!==vh?n:My(t)?Bb:vh}function Oie(e){return nw.reduce((t,n)=>t+(e[n]?1:0),0)}function Rie(e,t,n){const i={enter:{},update:{}};return Wt(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 Nie(e,t,n){const i=Qs(x_("size",e,n)),r=Qs(x_("strokeWidth",e,n)),o=Qs(Lie(n[1].encode,t,Wf));return wr(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function x_(e,t,n){return t[e]?`scale("${t[e]}",datum)`:gN(e,n[0].encode)}function Lie(e,t,n){return gN("fontSize",e)||nie("fontSize",t,n)}const Pie=`item.orient==="${pl}"?-90:item.orient==="${ml}"?90:0`;function Iie(e,t){e=Ke(e)?{text:e}:e;const n=qn(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=ee(t.add(Gi(null,[l])));return u.push(Uie(e,n,zie(e),c)),e.subtitle&&u.push(jie(e,n,i.subtitle,c)),x0(sf({role:Rte,from:c,encode:Bie(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function zie(e){const t=e.encode;return t&&t.title||ye({name:e.name,interactive:e.interactive,style:e.style},t)}function Bie(e,t){const n={enter:{},update:{}};return Wt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:rw},angle:{signal:Pie},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),gl(n,t,Gf)}function Uie(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Wt(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:Na,role:Nte,style:Vne,from:i,encode:s},n)}function jie(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Wt(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:Na,role:Lte,style:Yne,from:i,encode:s},n)}function qie(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(aw(i,t))}),e.on&&e.on.forEach(i=>{xN(i,t,e.name)}),t.addDataPipeline(e.name,Wie(e,t,n))}function Wie(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?vt(e.values)||bh(e.format)?(i.push(v_(t,e)),i.push(r=$s())):i.push(r=$s({$ingest:e.values,$format:e.format})):e.url?bh(e.url)||bh(e.format)?(i.push(v_(t,e)),i.push(r=$s())):i.push(r=$s({$request:e.url,$format:e.format})):e.source&&(r=a=oe(e.source).map(d=>ee(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]=Ane({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,$s())),r||i.push($s()),i.push(Ra({})),i}function $s(e){const t=Gi({},e);return t.metadata={source:!0},t}function v_(e,t){return pne({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 vN=e=>e===ns||e===Hi,v0=(e,t,n)=>vt(e)?Yie(e.signal,t,n):e===pl||e===Hi?t:n,_t=(e,t,n)=>vt(e)?Hie(e.signal,t,n):vN(e)?t:n,Ri=(e,t,n)=>vt(e)?Vie(e.signal,t,n):vN(e)?n:t,EN=(e,t,n)=>vt(e)?Xie(e.signal,t,n):e===Hi?{value:t}:{value:n},Gie=(e,t,n)=>vt(e)?Kie(e.signal,t,n):e===ml?{value:t}:{value:n},Hie=(e,t,n)=>wN(`${e} === '${Hi}' || ${e} === '${ns}'`,t,n),Vie=(e,t,n)=>wN(`${e} !== '${Hi}' && ${e} !== '${ns}'`,t,n),Yie=(e,t,n)=>uw(`${e} === '${pl}' || ${e} === '${Hi}'`,t,n),Xie=(e,t,n)=>uw(`${e} === '${Hi}'`,t,n),Kie=(e,t,n)=>uw(`${e} === '${ml}'`,t,n),wN=(e,t,n)=>(t=t!=null?$t(t):t,n=n!=null?$t(n):n,E_(t)&&E_(n)?(t=t?t.signal||re(t.value):null,n=n?n.signal||re(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ye({test:e},t)].concat(n||[])),E_=e=>e==null||Object.keys(e).length===1,uw=(e,t,n)=>({signal:`${e} ? (${hu(t)}) : (${hu(n)})`}),Jie=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${pl}' ? (${hu(i)}) : `:"")+(n!=null?`${e} === '${ns}' ? (${hu(n)}) : `:"")+(r!=null?`${e} === '${ml}' ? (${hu(r)}) : `:"")+(t!=null?`${e} === '${Hi}' ? (${hu(t)}) : `:"")+"(null)"}),hu=e=>vt(e)?e.signal:e==null?null:re(e),Qie=(e,t)=>t===0?0:vt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},xu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function nu(e,t,n,i){let r;if(t&&le(t,e))return t[e];if(le(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[tw][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[Wf][r]}return null}function w_(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Zie(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(vt(s)){const f=w_([n.axisX,n.axisY]),d=w_([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=_t(s,nu(l,n.axisX,r,i),nu(l,n.axisY,r,i));u={};for(l of d)u[l]=Jie(s.signal,nu(l,n.axisTop,r,i),nu(l,n.axisBottom,r,i),nu(l,n.axisLeft,r,i),nu(l,n.axisRight,r,i))}else a=s===Hi||s===ns?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?ye({},r,a,u,o):r}function ere(e,t,n,i){const r=qn(e,t),o=e.orient;let s,a;const u={enter:s={opacity:Ce},update:a={opacity:gi},exit:{opacity:Ce}};Wt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=A_(e,0),c=A_(e,1);return s.x=a.x=_t(o,l,Ce),s.x2=a.x2=_t(o,c),s.y=a.y=Ri(o,l,Ce),s.y2=a.y2=Ri(o,c),ii({type:iw,role:Ate,from:i,encode:u},n)}function A_(e,t){return{scale:e.scale,range:t}}function tre(e,t,n,i,r){const o=qn(e,t),s=e.orient,a=e.gridScale,u=v0(s,1,-1),l=nre(e.offset,u);let c,f,d;const h={enter:c={opacity:Ce},update:d={opacity:gi},exit:f={opacity:Ce}};Wt(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const g={scale:e.scale,field:hi,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},p=_t(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}:ye(p,{mult:u,offset:l});return c.x=d.x=_t(s,g,m),c.y=d.y=Ri(s,g,m),c.x2=d.x2=Ri(s,y),c.y2=d.y2=_t(s,y),f.x=_t(s,g),f.y=Ri(s,g),ii({type:iw,role:Ste,key:hi,from:i,encode:h},n)}function nre(e,t){if(t!==1)if(!me(e))e=vt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=ye({},e);for(;n.mult!=null;)if(me(n.mult))n=n.mult=ye({},n.mult);else return n.mult=vt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function ire(e,t,n,i,r,o){const s=qn(e,t),a=e.orient,u=v0(a,-1,1);let l,c,f;const d={enter:l={opacity:Ce},update:f={opacity:gi},exit:c={opacity:Ce}};Wt(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 g={scale:e.scale,field:hi,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=_t(a,Ce,g),f.y2=l.y2=_t(a,h),c.x=_t(a,g),f.x=l.x=Ri(a,Ce,g),f.x2=l.x2=Ri(a,h),c.y=Ri(a,g),ii({type:iw,role:$te,key:hi,from:i,encode:d},n)}function E1(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function rre(e,t,n,i,r,o){const s=qn(e,t),a=e.orient,u=e.scale,l=v0(a,-1,1),c=Qs(s("labelFlush")),f=Qs(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let g=c===0||!!c,p;const m=$t(r);m.mult=l,m.offset=$t(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:hi,band:.5,offset:pN(o.offset,s("labelOffset"))},b=_t(a,g?E1(u,c,'"left"','"right"','"center"'):{value:"center"},Gie(a,"left","right")),x=_t(a,EN(a,"bottom","top"),g?E1(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),v=E1(u,c,`-(${f})`,f,0);g=g&&f;const w={opacity:Ce,x:_t(a,y,m),y:Ri(a,y,m)},A={enter:w,update:p={opacity:gi,text:{field:ew},x:w.x,y:w.y,align:b,baseline:x},exit:{opacity:Ce,x:w.x,y:w.y}};Wt(A,{dx:!d&&g?_t(a,v):null,dy:!h&&g?Ri(a,v):null}),Wt(A,{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 S=s("labelOverlap");return S=S||E?{separation:s("labelSeparation"),method:S,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,p.align!==b&&(p.align=xu(p.align,b)),p.baseline!==x&&(p.baseline=xu(p.baseline,x)),ii({type:Na,role:Cte,style:Wf,key:hi,from:i,encode:A,overlap:S},n)}function ore(e,t,n,i){const r=qn(e,t),o=e.orient,s=v0(o,-1,1);let a,u;const l={enter:a={opacity:Ce,anchor:$t(r("titleAnchor",null)),align:{signal:rw}},update:u=ye({},a,{opacity:gi,text:$t(e.title)}),exit:{opacity:Ce}},c={signal:`lerp(range("${e.scale}"), ${y0(0,1,.5)})`};return u.x=_t(o,c),u.y=Ri(o,c),a.angle=_t(o,Ce,Qie(s,90)),a.baseline=_t(o,EN(o,ns,Hi),{value:ns}),u.angle=a.angle,u.baseline=a.baseline,Wt(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")}),sre(r,o,l,n),l.update.align=xu(l.update.align,a.align),l.update.angle=xu(l.update.angle,a.angle),l.update.baseline=xu(l.update.baseline,a.baseline),ii({type:Na,role:_te,style:tw,from:i,encode:l},n)}function sre(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=xu($t(a),n.update[u]),!1):!au(u,i),o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?$t(s):_t(t,$t(s),$t(o))}function are(e,t){const n=Zie(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=qn(e,n),l=iie(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ee(t.add(Gi({},[c]))),d=ee(t.add(une({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 g;return c.grid&&h.push(tre(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(ire(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(rre(e,n,i.labels,d,g,l))),c.domain&&h.push(ere(e,n,i.domain,f)),c.title&&h.push(ore(e,n,i.title,f)),x0(sf({role:wte,from:f,encode:gl(ure(u,e),r,Gf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function ure(e,t){const n={enter:{},update:{}};return Wt(n,{orient:e("orient"),offset:e("offset")||0,position:_i(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 AN(e,t,n){const i=oe(e.signals),r=oe(e.scales);return n||i.forEach(o=>tN(o,t)),oe(e.projections).forEach(o=>Bne(o,t)),r.forEach(o=>Fne(o,t)),oe(e.data).forEach(o=>qie(o,t)),r.forEach(o=>kne(o,t)),(n||i).forEach(o=>ane(o,t)),oe(e.axes).forEach(o=>are(o,t)),oe(e.marks).forEach(o=>x0(o,t)),oe(e.legends).forEach(o=>Tie(o,t)),e.title&&Iie(e.title,t),t.parseLambdas(),t}const lre=e=>gl({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function cre(e,t){const n=t.config,i=ee(t.root=t.add(Rg())),r=fre(e,n);r.forEach(l=>tN(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(Gi()),s=t.add(rN(eN(lre(e.encode),m0,KE,e.style,t,{pulse:ee(o)}))),a=t.add(aN({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ee(s)}));t.operators.pop(),t.pushState(ee(s),ee(a),null),AN(e,t,r),t.operators.push(a);let u=t.add(iN({mark:i,pulse:ee(a)}));return u=t.add(sN({pulse:ee(u)})),u=t.add(Ra({pulse:ee(u)})),t.addData("root",new pa(t,o,o,u)),t}function Hl(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function fre(e,t){const n=s=>_i(e[s],t[s]),i=[Hl("background",n("background")),Hl("autosize",xte(n("autosize"))),Hl("padding",Ete(n("padding"))),Hl("width",n("width")||0),Hl("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return oe(e.signals).forEach(s=>{le(r,s.name)?s=ye(r[s.name],s):i.push(s),o[s.name]=s}),oe(t.signals).forEach(s=>{!le(o,s.name)&&!le(r,s.name)&&i.push(s)}),i}function SN(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 S_(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}SN.prototype=S_.prototype={parse(e){return AN(e,this)},fork(){return new S_(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 Nb?ee(e):e;return this.add(wne({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(ee(this.add(Ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?ee(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $e(this._parent)},encode(){return $e(this._encode)},lookup(){return $e(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Ke(e))return rf(e,t);e.signal||L("Unsupported field reference: "+re(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=ee(this.add(dne(r)))}return i},compareRef(e){let t=!1;const n=o=>vt(o)?(t=!0,this.signalRef(o.signal)):Jte(o)?(t=!0,this.exprRef(o.expr)):o,i=oe(e.field).map(n),r=oe(e.order).map(n);return t?ee(this.add(c_({fields:i,orders:r}))):u_(i,r)},keyRef(e,t){let n=!1;const i=o=>vt(o)?(n=!0,ee(r[o.signal])):o,r=this.signals;return e=oe(e).map(i),n?ee(this.add(hne({fields:e,flat:t}))):Vte(e,t)},sortRef(e){if(!e)return e;const t=g0(e.op,e.field),n=e.order||Yte;return n.signal?ee(this.add(c_({fields:t,orders:this.signalRef(n.signal)}))):u_(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 le(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&L("Duplicate signal name: "+re(e));const n=t instanceof Nb?t:this.add(Rg(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||L("Unrecognized signal name: "+re(e)),this.signals[e]},signalRef(e){return this.signals[e]?ee(this.signals[e]):(le(this.lambdas,e)||(this.lambdas[e]=this.add(Rg(null))),ee(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=wr(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||!me(e)?e:this.signalRef(e.signal||lw(e))},exprRef(e,t){const n={expr:wr(e,this)};return t&&(n.expr.$name=t),ee(this.add(cne(n)))},addBinding(e,t){this.bindings||L("Nested signals do not support binding: "+re(e)),this.bindings.push(ye({signal:e},t))},addScaleProj(e,t){le(this.scales,e)&&L("Duplicate scale or projection name: "+re(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,Sne(t))},addProjection(e,t){this.addScaleProj(e,Ene(t))},getScale(e){return this.scales[e]||L("Unrecognized scale name: "+re(e)),this.scales[e]},scaleRef(e){return ee(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 le(this.data,e)&&L("Duplicate data set name: "+re(e)),this.data[e]=t},getData(e){return this.data[e]||L("Undefined data set name: "+re(e)),this.data[e]},addDataPipeline(e,t){return le(this.data,e)&&L("Duplicate data set name: "+re(e)),this.addData(e,pa.fromEntries(this,t))}};function lw(e){return(Z(e)?dre:hre)(e)}function dre(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(me(r)?r.signal||lw(r):re(r))}return n+"]"}function hre(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+re(i)+":"+(me(r)?r.signal||lw(r):re(r));return t+"}"}function gre(){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 pre(e,t,n){return me(e)||L("Input Vega specification must be an object."),t=CP(gre(),t,e.config),cre(e,new SN(t,n)).toRuntime()}var mre="5.33.0";Ix(Du,qB,jG,vH,oY,HY,xK,QX,EK,GK,tJ,uJ);const yre=Object.freeze(Object.defineProperty({__proto__:null,Bounds:pt,CanvasHandler:Nf,CanvasRenderer:Qh,DATE:In,DAY:Zt,DAYOFYEAR:vr,Dataflow:mu,Debug:jk,Error:zk,EventStream:Cp,Gradient:pM,GroupItem:Wp,HOURS:ei,Handler:R2,HybridHandler:s5,HybridRenderer:qy,Info:Uk,Item:qp,MILLISECONDS:Ii,MINUTES:ti,MONTH:nn,Marks:ni,MultiPulse:Jx,None:Ik,Operator:Ge,Parameters:Sp,Pulse:Ho,QUARTER:Pn,RenderType:zo,Renderer:Rf,ResourceLoader:wM,SECONDS:pi,SVGHandler:VM,SVGRenderer:B2,SVGStringRenderer:o5,Scenegraph:zM,TIME_UNITS:Ux,Transform:M,View:jR,WEEK:bt,Warn:Bk,YEAR:jt,accessor:yo,accessorFields:Nk,accessorName:v9,array:zc,ascending:Px,bandwidthNRD:tv,bin:v3,bootstrapCI:E3,boundClip:m5,boundContext:Df,boundItem:Iy,boundMark:NM,boundStroke:bo,changeset:Ta,clampRange:B9,codegenExpression:pR,compare:j9,constant:H9,cumulativeLogNormal:av,cumulativeNormal:_p,cumulativeUniform:fv,dayofyear:_D,debounce:V9,defaultLocale:Hx,definition:y3,densityLogNormal:sv,densityNormal:nv,densityUniform:cv,domChild:yt,domClear:ai,domCreate:Po,domFind:O2,dotbin:w3,error:Qd,expressionFunction:ht,extend:Ix,extent:Y9,extentIndex:X9,falsy:$9,fastmap:J9,field:Ox,flush:Q9,font:Xp,fontFamily:Of,fontSize:_r,format:Zd,formatLocale:Mh,formats:Xx,hasOwnProperty:Hr,id:A9,identity:Rx,inferType:s3,inferTypes:a3,ingest:Oe,inherits:Z9,inrange:eP,interpolate:c2,interpolateColors:Up,interpolateRange:tM,intersect:d5,intersectBoxLine:lu,intersectPath:b2,intersectPoint:x2,intersectRule:SM,isArray:op,isBoolean:Vk,isDate:Yk,isFunction:lp,isIterable:tP,isNumber:Xk,isObject:oa,isRegExp:nP,isString:to,isTuple:wp,key:iP,lerp:rP,lineHeight:Zo,loader:vp,locale:r3,logger:F9,lruCache:sP,markup:z2,merge:aP,mergeConfig:Nx,multiLineOffset:D2,one:C9,pad:uP,panLinear:D9,panLog:T9,panPow:M9,panSymlog:O9,parse:pre,parseExpression:dR,parseSelector:ds,path:Tx,pathCurves:p2,pathEqual:y5,pathParse:Nu,pathRectangle:bM,pathRender:Hc,pathSymbols:yM,pathTrail:xM,peek:ol,point:Jp,projection:oE,quantileLogNormal:uv,quantileNormal:Fp,quantileUniform:dv,quantiles:Zx,quantizeInterpolator:nM,quarter:I9,quartiles:ev,get random(){return mi},randomInteger:Vz,randomKDE:rv,randomLCG:Hz,randomLogNormal:S3,randomMixture:C3,randomNormal:iv,randomUniform:$3,read:c3,regressionConstant:hv,regressionExp:F3,regressionLinear:gv,regressionLoess:T3,regressionLog:_3,regressionPoly:D3,regressionPow:k3,regressionQuad:pv,renderModule:Qp,repeat:ec,resetDefaultLocale:q7,resetSVGClipId:EM,resetSVGDefIds:sG,responseType:l3,runtimeContext:kR,sampleCurve:Dp,sampleLogNormal:ov,sampleNormal:$p,sampleUniform:lv,scale:Me,sceneEqual:U2,sceneFromJSON:PM,scenePickVisit:Wh,sceneToJSON:LM,sceneVisit:zi,sceneZOrder:v2,scheme:f2,serializeXML:t5,setHybridRendererOptions:nG,setRandom:Wz,span:lP,splitAccessPath:Mx,stringValue:pu,textMetrics:Jn,timeBin:WD,timeFloor:RD,timeFormatLocale:jc,timeInterval:ul,timeOffset:PD,timeSequence:BD,timeUnitSpecifier:$D,timeUnits:jx,toBoolean:cP,toDate:dP,toNumber:Lx,toSet:gP,toString:hP,transform:b3,transforms:Du,truncate:pP,truthy:Pk,tupleid:te,typeParsers:_y,utcFloor:ND,utcInterval:ll,utcOffset:ID,utcSequence:UD,utcdayofyear:DD,utcquarter:z9,utcweek:TD,version:mre,visitArray:mP,week:FD,writeConfig:sp,zero:S9,zoomLinear:R9,zoomLog:N9,zoomPow:L9,zoomSymlog:P9},Symbol.toStringTag,{value:"Module"})),bre=/("(?:[^\\"]|\\.)*")|[:,]/g;function w1(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(bre,(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,g,p;if(Array.isArray(s)){g="[",p="]";const{length:m}=s;for(;h<m;h++)d.push(o(s[h],f,h===m-1?0:1)||"null")}else{g="{",p="}";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[g,n+d.join(`,
14
14
  ${f}`),p].join(`
15
- ${a}`)}return l}(e,"",0)}function bre(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 xre={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},vre={"*":(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},Ere={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const wre=Array.prototype.slice,_s=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,wre.call(t,1))},Are=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var Sre={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:Are,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return _s("join",arguments)},indexof:function(){return _s("indexOf",arguments)},lastindexof:function(){return _s("lastIndexOf",arguments)},slice:function(){return _s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return _s("substring",arguments,String)},split:function(){return _s("split",arguments,String)},replace:function(){return _s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Cre=["view","item","group","xy","x","y"],jb=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&jb.add(setImmediate);const $re={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:xre[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),jb.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]||Sre[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>vre[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Ere[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);return e.memberDepth-=1,jb.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Vl(e,t,n,i,r,o){const s=a=>$re[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,Cre.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var _re={operator(e,t){const n=t.ast,i=e.functions;return r=>Vl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Vl(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Vl(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 Vl(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=Vl(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&bre(s,i,o),l}}};const Fre="5.23.0",kre={version:Fre};function yl(e,t,n){return e.fields=t||[],e.fname=n,e}function Dre(e){return e.length===1?Tre(e[0]):Mre(e)}const Tre=e=>function(t){return t[e]},Mre=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function A1(e){throw Error(e)}function La(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||A1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&A1("Access path missing closing bracket: "+e),i&&A1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Ore(e,t,n){const i=La(e);return e=i.length===1?i[0]:e,yl(Dre(i),[e],e)}Ore("id");const Rre=yl(e=>e,[],"identity");yl(()=>0,[],"zero");yl(()=>1,[],"one");yl(()=>!0,[],"true");yl(()=>!1,[],"false");function Nre(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Lre=0,Pre=1,_N=2,Ire=3,zre=4;function Bre(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nre,i=e||Lre;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Pre&&n("error","ERROR",arguments),this},warn(){return i>=_N&&n("warn","WARN",arguments),this},info(){return i>=Ire&&n("log","INFO",arguments),this},debug(){return i>=zre&&n("log","DEBUG",arguments),this}}}var X=Array.isArray;function Fe(e){return e===Object(e)}const C_=e=>e!=="__proto__";function FN(){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=Ure(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;E0(i,o,r[o],s)}return i},{})}function E0(e,t,n,i){if(!C_(t))return;let r,o;if(Fe(n)&&!X(n)){o=Fe(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?E0(o,r,n[r]):C_(r)&&(o[r]=n[r])}else e[t]=n}function Ure(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 jre(e){return typeof e=="function"}const qre=Object.prototype.hasOwnProperty;function gt(e,t){return qre.call(e,t)}function Hf(e){return typeof e=="boolean"}function Ze(e){return typeof e=="number"}function de(e){return typeof e=="string"}function _e(e){return X(e)?"["+e.map(_e)+"]":Fe(e)||de(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function cw(e){return U(e,"or")}function fw(e){return U(e,"and")}function dw(e){return U(e,"not")}function wh(e,t){if(dw(e))wh(e.not,t);else if(fw(e))for(const n of e.and)wh(n,t);else if(cw(e))for(const n of e.or)wh(n,t);else t(e)}function vu(e,t){return dw(e)?{not:vu(e.not,t)}:fw(e)?{and:e.and.map(n=>vu(n,t))}:cw(e)?{or:e.or.map(n=>vu(n,t))}:t(e)}const ce=structuredClone;function kN(e){throw new Error(e)}function qu(e,t){const n={};for(const i of t)gt(e,i)&&(n[i]=e[i]);return n}function Rn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>je(e)).join(",")})`};function Ae(e){if(Ze(e))return e;const t=de(e)?e:je(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 qb(e){return e===!1||e===null}function we(e,t){return e.includes(t)}function Wu(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function hw(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function DN(e,...t){for(const n of t)Wre(e,n??{});return e}function Wre(e,t){for(const n of B(t))E0(e,n,t[n],!0)}function cr(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 Gre(e,t){const n=B(e),i=B(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function TN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gw(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=La(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 pw(e,t){return e===void 0||t===void 0?!0:gw(Wb(e),Wb(t))}function Ue(e){return B(e).length===0}const B=Object.keys,qt=Object.values,is=Object.entries;function af(e){return e===!0||e===!1}function Qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Rc(e,t){return dw(e)?`!(${Rc(e.not,t)})`:fw(e)?`(${e.and.map(n=>Rc(n,t)).join(") && (")})`:cw(e)?`(${e.or.map(n=>Rc(n,t)).join(") || (")})`:t(e)}function Ng(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Ng(e[n],t)&&delete e[n],Ue(e)}function Vf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function mw(e,t="datum"){const n=La(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(_e).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function MN(e,t="datum"){return`${t}[${_e(La(e).join("."))}]`}function Le(e){return`datum['${e.replaceAll("'","\\'")}']`}function Hre(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function bi(e){return`${La(e).map(Hre).join("\\.")}`}function ma(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function bl(e){return`${La(e).join(".")}`}function Gu(e){return e?La(e).length:0}function ft(...e){return e.find(t=>t!==void 0)}let ON=42;function RN(e){const t=++ON;return e?String(e)+t:t}function Vre(){ON=42}function NN(e){return LN(e)?e:`__${e}`}function LN(e){return e.startsWith("__")}function uf(e){if(e!==void 0)return(e%360+360)%360}function w0(e){return Ze(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const $_=Object.getPrototypeOf(structuredClone({}));function Xn(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(!Xn(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(!Xn(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!==$_.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==$_.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(!Xn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function je(e){const t=[];return function n(i){if(i&&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 Fe(e)&&gt(e,t)&&e[t]!==void 0}const ro="row",oo="column",A0="facet",et="x",Ot="y",Vi="x2",Tr="y2",hs="xOffset",xl="yOffset",Yi="radius",vo="radius2",Ei="theta",Eo="theta2",Xi="latitude",Ki="longitude",Ji="latitude2",xi="longitude2",gs="time",Bn="color",Mr="fill",Or="stroke",Un="shape",wo="size",Pa="angle",Ao="opacity",ps="fillOpacity",ms="strokeOpacity",ys="strokeWidth",bs="strokeDash",Yf="text",Hu="order",Xf="detail",S0="key",ya="tooltip",C0="href",$0="url",_0="description",Yre={x:1,y:1,x2:1,y2:1},PN={theta:1,theta2:1,radius:1,radius2:1};function IN(e){return gt(PN,e)}const yw={longitude:1,longitude2:1,latitude:1,latitude2:1};function zN(e){switch(e){case Xi:return"y";case Ji:return"y2";case Ki:return"x";case xi:return"x2"}}function BN(e){return gt(yw,e)}const Xre=B(yw),bw={...Yre,...PN,...yw,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 Eu(e){return e===Bn||e===Mr||e===Or}const UN={row:1,column:1,facet:1},di=B(UN),xw={...bw,...UN},Kre=B(xw),{order:rme,detail:ome,tooltip:sme,...Jre}=xw,{row:ame,column:ume,facet:lme,...Qre}=Jre;function Zre(e){return gt(Qre,e)}function jN(e){return gt(xw,e)}const eoe=[Vi,Tr,Ji,xi,Eo,vo];function qN(e){return Ia(e)!==e}function Ia(e){switch(e){case Vi:return et;case Tr:return Ot;case Ji:return Xi;case xi:return Ki;case Eo:return Ei;case vo:return Yi}return e}function rs(e){if(IN(e))switch(e){case Ei:return"startAngle";case Eo:return"endAngle";case Yi:return"outerRadius";case vo:return"innerRadius"}return e}function Rr(e){switch(e){case et:return Vi;case Ot:return Tr;case Xi:return Ji;case Ki:return xi;case Ei:return Eo;case Yi:return vo}}function jn(e){switch(e){case et:case Vi:return"width";case Ot:case Tr:return"height"}}function WN(e){switch(e){case et:return"xOffset";case Ot:return"yOffset";case Vi:return"x2Offset";case Tr:return"y2Offset";case Ei:return"thetaOffset";case Yi:return"radiusOffset";case Eo:return"theta2Offset";case vo:return"radius2Offset"}}function vw(e){switch(e){case et:return"xOffset";case Ot:return"yOffset"}}function toe(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const noe=B(bw),{x:cme,y:fme,x2:dme,y2:hme,xOffset:gme,yOffset:pme,latitude:mme,longitude:yme,latitude2:bme,longitude2:xme,theta:vme,theta2:Eme,radius:wme,radius2:Ame,...Ew}=bw,ioe=B(Ew),ww={x:1,y:1},So=B(ww);function dt(e){return gt(ww,e)}const Aw={theta:1,radius:1},roe=B(Aw);function F0(e){return e==="width"?et:Ot}const GN={xOffset:1,yOffset:1};function Kf(e){return gt(GN,e)}const ooe={time:1};function S1(e){return e in ooe}const{text:Sme,tooltip:Cme,href:$me,url:_me,description:Fme,detail:kme,key:Dme,order:Tme,...HN}=Ew,soe=B(HN);function aoe(e){return gt(Ew,e)}function uoe(e){switch(e){case Bn:case Mr:case Or:case wo:case Un:case Ao:case ys:case bs:return!0;case ps:case ms:case Pa:case gs:return!1}}const VN={...ww,...Aw,...GN,...HN},Sw=B(VN);function Nr(e){return gt(VN,e)}function loe(e,t){return foe(e)[t]}const YN={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:Mme,...coe}=YN;function foe(e){switch(e){case Bn:case Mr:case Or:case _0:case Xf:case S0:case ya:case C0:case Hu:case Ao:case ps:case ms:case ys:case A0:case ro:case oo:return YN;case et:case Ot:case hs:case xl:case Xi:case Ki:case gs:return coe;case Vi:case Tr:case Ji:case xi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case wo:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case bs:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Un:return{point:"always",geoshape:"always"};case Yf:return{text:"always"};case Pa:return{point:"always",square:"always",text:"always"};case $0:return{image:"always"};case Ei:return{text:"always",arc:"always"};case Yi:return{text:"always",arc:"always"};case Eo:case vo:return{arc:"always"}}}function C1(e){switch(e){case et:case Ot:case Ei:case Yi:case hs:case xl:case wo:case Pa:case ys:case Ao:case ps:case ms:case gs:case Vi:case Tr:case Eo:case vo:return;case A0:case ro:case oo:case Un:case bs:case Yf:case ya:case C0:case $0:case _0:return"discrete";case Bn:case Mr:case Or:return"flexible";case Xi:case Ki:case Ji:case xi:case Xf:case S0:case Hu:return}}const doe={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},hoe={count:1,min:1,max:1};function go(e){return U(e,"argmin")}function xs(e){return U(e,"argmax")}function Cw(e){return de(e)&&gt(doe,e)}const goe=new Set(["count","valid","missing","distinct"]);function k0(e){return de(e)&&goe.has(e)}function poe(e){return de(e)&&we(["min","max"],e)}const moe=new Set(["count","sum","distinct","valid","missing"]),yoe=new Set(["mean","average","median","q1","q3","min","max"]);function XN(e){return Hf(e)&&(e=U0(e,void 0)),"bin"+B(e).map(t=>D0(e[t])?Qe(`_${t}_${is(e[t])}`):Qe(`_${t}_${e[t]}`)).join("")}function He(e){return e===!0||za(e)&&!e.binned}function Nt(e){return e==="binned"||za(e)&&e.binned===!0}function za(e){return Fe(e)}function D0(e){return U(e,"param")}function __(e){switch(e){case ro:case oo:case wo:case Bn:case Mr:case Or:case ys:case Ao:case ps:case ms:case Un:return 6;case bs:return 4;default:return 10}}function Jf(e){return U(e,"expr")}function Lt(e,{level:t}={level:0}){const n=B(e||{}),i={};for(const r of n)i[r]=t===0?Vn(e[r]):Lt(e[r],{level:t-1});return i}function KN(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:g,...p}=e,m={...p,...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}:{},...g?{subtitlePadding:g}:{}},x=qu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:y,subtitle:b}}function Ro(e){return de(e)||X(e)&&de(e[0])}function Q(e){return U(e,"signal")}function Ba(e){return U(e,"step")}function boe(e){return X(e)?!1:U(e,"fields")&&!U(e,"data")}function xoe(e){return X(e)?!1:U(e,"fields")&&U(e,"data")}function eo(e){return X(e)?!1:U(e,"field")&&U(e,"data")}const voe={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},Eoe=B(voe),woe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Gb=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function JN(e){const t=X(e.condition)?e.condition.map(F_):F_(e.condition);return{...Vn(e),condition:t}}function Vn(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function F_(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ye(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Q(e)?e:e!==void 0?{value:e}:void 0}function Aoe(e){return Q(e)?e.signal:_e(e)}function k_(e){return Q(e)?e.signal:_e(e.value)}function Mi(e){return Q(e)?e.signal:e==null?null:_e(e)}function Soe(e,t,n){for(const i of n){const r=Ar(i,t.markDef,t.config);r!==void 0&&(e[i]=Ye(r))}return e}function QN(e){return[].concat(e.type,e.style??[])}function Be(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=Hb(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 Hb(e,t,n){return ZN(e,QN(t),n)}function ZN(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 e6(e,t){return ct(e).reduce((n,i)=>(n.field.push(H(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function t6(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Xn(r,i))return;n.push(i)}),n}function n6(e,t){return Xn(e,t)||!t?e:e?[...ct(e),...ct(t)].join(", "):t}function i6(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Ro(n)||Q(n))&&(Ro(i)||Q(i)))return{explicit:e.explicit,value:n6(n,i)};if(Ro(n)||Q(n))return{explicit:e.explicit,value:n};if(Ro(i)||Q(i))return{explicit:e.explicit,value:i};if(!Ro(n)&&!Q(n)&&!Ro(i)&&!Q(i))return{explicit:e.explicit,value:t6(n,i)};throw new Error("It should never reach here")}function $w(e){return`Invalid specification ${je(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Coe='Autosize "fit" only works for single views and layered views.';function D_(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function T_(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 M_(e){return e?`Dropping "fit-${e}" because spec has discrete ${jn(e)}.`:'Dropping "fit" because spec has discrete size.'}function _w(e){return`Unknown field for ${e}. Cannot calculate view size.`}function O_(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function $oe(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function _oe(e){return`The "nearest" transform is not supported for ${e} marks.`}function r6(e){return`Selection not supported for ${e} yet.`}function Foe(e){return`Cannot find a selection named "${e}".`}const koe="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Doe="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Toe="Legend bindings are only supported for selections over an individual field or encoding channel.";function Moe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Ooe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Roe="The same selection must be used to override scale domains in a layered view.",Noe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Loe(e){return`Unknown repeated value "${e}".`}function R_(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Poe="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",Fw="Animation involving facet, layer, or concat is currently unsupported.";function Ioe(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${pu(e)}.`}function zoe(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${pu(t)} encoding found for selection ${pu(n.param)}. Using "field": ${pu(i)}.`}const Boe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Uoe(e){return`Unrecognized parse "${e}".`}function N_(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const joe="Attempt to add the same child twice.";function qoe(e){return`Ignoring an invalid transform: ${je(e)}.`}const Woe='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 L_(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Goe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${je(t)} is overridden by a child projection ${je(n)}.`}const Hoe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Voe(e){return`${e}Offset dropped because ${e} is continuous`}function Yoe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${je(n)}}.`}function o6(e){return`Invalid field type "${e}".`}function Xoe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Koe(e){return`Invalid aggregation operator "${e}".`}function s6(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 Joe(e){return`Position range does not support relative band size for ${e}.`}function Vb(e,t){return`Dropping ${je(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Qoe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function T0(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Zoe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function ese(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function tse(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function nse(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function $1(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function ise(e){return`The ${e} for range marks cannot be an expression`}function rse(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 ose(e,t){return`Specified orient "${e}" overridden with "${t}".`}function sse(e){return`Cannot use the scale property "${e}" with non-color channel.`}function ase(e){return`Cannot use the relative band size with ${e} scale.`}function use(e){return`Using unaggregated domain with raw field has no effect (${je(e)}).`}function lse(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function cse(e){return`Unaggregated domain is currently unsupported for log scale (${je(e)}).`}function fse(e){return`Cannot apply size to non-oriented mark "${e}".`}function dse(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function hse(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function a6(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function u6(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function gse(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${je(n)} and ${je(i)}). Using ${je(n)}.`}function pse(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${je(n)} and ${je(i)}). Using the union of the two domains.`}function mse(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 yse(e){return`Dropping sort property ${je(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const P_="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",bse="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.",xse="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.",vse="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 Ese(e){return`Cannot stack "${e}" if there is already "${e}2".`}function wse(e){return`Stack is applied to a non-linear scale (${e}).`}function Ase(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Lg(e,t){return`Invalid ${e}: ${je(t)}.`}function Sse(e){return`Dropping day from datetime ${je(e)} as day cannot be combined with other units.`}function Cse(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function $se(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function _se(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function I_(e){return`1D error band does not support ${e}.`}function l6(e){return`Channel ${e} is required for "binned" bin.`}function Fse(e){return`Channel ${e} should not be used with "binned" bin.`}function kse(e){return`Domain for ${e} is required for threshold scale.`}const c6=Bre(_N);let ba=c6;function Dse(e){return ba=e,ba}function Tse(){return ba=c6,ba}function kw(...e){ba.error(...e)}function j(...e){ba.warn(...e)}function Mse(...e){ba.debug(...e)}function Ua(e){if(e&&Fe(e)){for(const t of Tw)if(U(e,t))return!0}return!1}const f6=["january","february","march","april","may","june","july","august","september","october","november","december"],Ose=f6.map(e=>e.substr(0,3)),d6=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Rse=d6.map(e=>e.substr(0,3));function Nse(e){if(w0(e)&&(e=+e),Ze(e))return e>4&&j(Lg("quarter",e)),e-1;throw new Error(Lg("quarter",e))}function Lse(e){if(w0(e)&&(e=+e),Ze(e))return e-1;{const t=e.toLowerCase(),n=f6.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Ose.indexOf(i);if(r!==-1)return r;throw new Error(Lg("month",e))}}function Pse(e){if(w0(e)&&(e=+e),Ze(e))return e%7;{const t=e.toLowerCase(),n=d6.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Rse.indexOf(i);if(r!==-1)return r;throw new Error(Lg("day",e))}}function Dw(e,t){const n=[];if(t&&e.day!==void 0&&B(e).length>1&&(j(Sse(e)),e=ce(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Lse(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Nse(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?Pse(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 xa(e){const n=Dw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Ise(e){const n=Dw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function zse(e){const t=Dw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const h6={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Tw=B(h6);function Bse(e){return Hr(h6,e)}function ja(e){return Fe(e)?e.binned:g6(e)}function g6(e){return e&&e.startsWith("binned")}function Mw(e){return e.startsWith("utc")}function Use(e){return e.substring(3)}const jse={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function M0(e){return Tw.filter(t=>m6(e,t))}function p6(e){const t=M0(e);return t[t.length-1]}function m6(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 qse(e,t,{end:n}={end:!1}){const i=mw(t),r=Mw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of Tw)m6(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),Ise(a)}function y6(e){if(!e)return;const t=M0(e);return`timeUnitSpecifier(${je(t)}, ${je(jse)})`}function Wse(e,t,n){if(!e)return;const i=y6(e);return`${n||Mw(e)?"utc":"time"}Format(${t}, ${i})`}function Dt(e){if(!e)return;let t;return de(e)?g6(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Fe(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Mw(t.unit)&&(t.utc=!0,t.unit=Use(t.unit)),t}function Gse(e){const{utc:t,...n}=Dt(e);return n.unit?(t?"utc":"")+B(n).map(i=>Qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+B(n).map(i=>Qe(`_${i}_${n[i]}`)).join("")}function b6(e,t=n=>n){const n=Dt(e),i=p6(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}=x6(i,n.step),a={...r,[s]:+r[s]+o};return`${t(xa(a))} - ${t(xa(r))}`}}const Hse={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Vse(e){return Hr(Hse,e)}function x6(e,t=1){if(Vse(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 Yse(e){return U(e,"param")}function Ow(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Rw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Nw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Lw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Pw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Iw(e){if(e!=null&&e.field){if(X(e.range)&&e.range.length===2)return!0;if(Q(e.range))return!0}return!1}function zw(e){return!!(e!=null&&e.field)&&(X(e.oneOf)||X(e.in))}function Xse(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function v6(e){return zw(e)||Ow(e)||Iw(e)||Rw(e)||Lw(e)||Nw(e)||Pw(e)}function nr(e,t){return j0(e,{timeUnit:t,wrapTime:!0})}function Kse(e,t){return e.map(n=>nr(n,t))}function E6(e,t=!0){const{field:n}=e,i=Dt(e.timeUnit),{unit:r,binned:o}=i||{},s=H(e,{expr:"datum"}),a=r?`time(${o?s:qse(r,n)})`:s;if(Ow(e))return`${a}===${nr(e.equal,r)}`;if(Rw(e)){const u=e.lt;return`${a}<${nr(u,r)}`}else if(Lw(e)){const u=e.gt;return`${a}>${nr(u,r)}`}else if(Nw(e)){const u=e.lte;return`${a}<=${nr(u,r)}`}else if(Pw(e)){const u=e.gte;return`${a}>=${nr(u,r)}`}else{if(zw(e))return`indexof([${Kse(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Xse(e))return O0(a,e.valid);if(Iw(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+", ["+nr(l,r)+", "+nr(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${nr(l,r)}`),c!==null&&f.push(`${a} <= ${nr(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${je(e)}`)}function O0(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Jse(e){return v6(e)&&e.timeUnit?{...e,timeUnit:Dt(e.timeUnit)}:e}const Qf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Qse(e){return e==="quantitative"||e==="temporal"}function w6(e){return e==="ordinal"||e==="nominal"}const va=Qf.quantitative,Bw=Qf.ordinal,Vu=Qf.temporal,Uw=Qf.nominal,vl=Qf.geojson;function Zse(e){if(e)switch(e=e.toLowerCase(),e){case"q":case va:return"quantitative";case"t":case Vu:return"temporal";case"o":case Bw:return"ordinal";case"n":case Uw:return"nominal";case vl:return"geojson"}}const Pt={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Yb={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 eae(e,t){const n=Yb[e],i=Yb[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const tae={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 z_(e){return tae[e]}const A6=new Set(["linear","log","pow","sqrt","symlog"]),S6=new Set([...A6,"time","utc"]);function C6(e){return A6.has(e)}const $6=new Set(["quantile","quantize","threshold"]),nae=new Set([...S6,...$6,"sequential","identity"]),iae=new Set(["ordinal","bin-ordinal","point","band"]);function Tt(e){return iae.has(e)}function Bi(e){return nae.has(e)}function fr(e){return S6.has(e)}function Yu(e){return $6.has(e)}const rae={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 oae(e){return!de(e)&&U(e,"name")}function _6(e){return U(e,"param")}function sae(e){return U(e,"unionWith")}function aae(e){return Fe(e)&&"field"in e}const uae={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:Ome,domain:Rme,range:Nme,rangeMax:Lme,rangeMin:Pme,scheme:Ime,...lae}=uae,cae=B(lae);function Xb(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 fr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return fr(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 fr(e);case"nice":return fr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Bi(e)&&!we(["log","time","utc","threshold","quantile"],e)}}function F6(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Eu(e)?void 0:sse(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 fae(e,t){return we([Bw,Uw],t)?e===void 0||Tt(e):t===Vu?we([Pt.TIME,Pt.UTC,void 0],e):t===va?C6(e)||Yu(e)||e===void 0:!0}function dae(e,t,n=!1){if(!Nr(e))return!1;switch(e){case et:case Ot:case hs:case xl:case Ei:case Yi:return fr(t)||t==="band"?!0:t==="point"?!n:!1;case gs:return we(["linear","band"],t);case wo:case ys:case Ao:case ps:case ms:case Pa:return fr(t)||Yu(t)||we(["band","point","ordinal"],t);case Bn:case Mr:case Or:return t!=="band";case bs:case Un:return t==="ordinal"||Yu(t)}}function hae(e){return Fe(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"},k6=_n.arc,R0=_n.area,N0=_n.bar,gae=_n.image,L0=_n.line,P0=_n.point,pae=_n.rect,Pg=_n.rule,D6=_n.text,jw=_n.tick,mae=_n.trail,qw=_n.circle,Ww=_n.square,T6=_n.geoshape;function vs(e){return["line","area","trail"].includes(e)}function lf(e){return["rect","bar","image","arc","tick"].includes(e)}const yae=new Set(B(_n));function Sr(e){return U(e,"type")}const bae=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],xae=["fill","fillOpacity"],vae=[...bae,...xae],Eae={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},B_=B(Eae),_1=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],wae={area:["line","point"],bar:_1,rect:_1,line:["point"],tick:["bandSize","thickness",..._1]},Aae={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Sae={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},M6=B(Sae);function Ea(e){return U(e,"band")}const Cae={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$ae=5,Gw={binSpacing:0,continuousBandSize:$ae,minBandSize:.25,timeUnitBandPosition:.5},_ae={...Gw,binSpacing:1},Fae={...Gw,thickness:1};function kae(e){return Sr(e)?e.type:e}function O6(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Hw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Bi(i)||r)return"always-valid";const o=O6(Be("invalid",e,t),{isPath:vs(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function Dae(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function R6({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 N6({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=ji(t),u=k0(a==null?void 0:a.aggregate),l=Hw({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const f=((c=o.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:O0(H(a,{expr:"datum"}),!1),...Tae(f,n,i)}}}function Tae(e,t,n){if(hae(e)){const{value:i}=e;return Q(i)?{signal:i.signal}:{value:i}}return R6({scale:t,scaleName:n,mode:"zeroOrMin"})}function Vw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=Ia(t),u=Yw(e),l=N6({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function Mae(e){const{datum:t}=e;return Ua(t)?xa(t):`${je(t)}`}function Zs(e,t,n,i){const r={};if(t&&(r.scale=t),Lr(e)){const{datum:o}=e;Ua(o)?r.signal=xa(o):Q(o)?r.signal=o.signal:Jf(o)?r.signal=o.expr:r.value=o}else r.field=H(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function Ig({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=H(t,{expr:a,suffix:r}),l=n!==void 0?H(n,{expr:a}):H(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 Oae({scaleName:e,fieldDef:t}){const n=H(t,{expr:"datum"}),i=H(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function Yw({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(fe(t)){const f=s==null?void 0:s.get("type");if(Cn(t)){c??(c=os({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(He(d)||c&&h&&g===Vu)return a!=null&&a.impute?Zs(t,o,{binSuffix:"mid"},{offset:u}):c&&!Tt(f)?Ig({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Zs(t,o,id(t,e)?{binSuffix:"range"}:{},{offset:u});if(Nt(d)){if(q(n))return Ig({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(l6(e===et?Vi:Tr))}}return Zs(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{...Nc(e,f),...d}}}return jre(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Nc(e,t){return we(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:we(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ye(t)}function wa(e){return e&&e!=="number"&&e!=="time"}function L6(e,t,n){return`${e}(${t}${n?`, ${je(n)}`:""})`}const Rae=" – ";function Xw({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(wa(n))return Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=P6(e,i,r),a=Xu(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return Oi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Oi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return Oi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(Ju(e)){const c=Lae({field:s,timeUnit:q(e)?(u=Dt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:qa(e)&&((l=e.scale)==null?void 0:l.type)===Pt.UTC});return c?{signal:c}:void 0}if(t=Kb({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&He(e.bin)){const c=H(e,{expr:i,binSuffix:"end"});return{signal:Zf(s,c,t,n,o)}}else return t||Xu(e)==="quantitative"?{signal:`${B6(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function P6(e,t,n){return q(e)?n?`${H(e,{expr:t,suffix:"end"})}-${H(e,{expr:t,suffix:"start"})}`:H(e,{expr:t}):Mae(e)}function Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=P6(e,i,r)),s!=="datum.value"&&q(e)&&He(e.bin)){const a=H(e,{expr:i,binSuffix:"end"});return{signal:Zf(s,a,t,n,o)}}return{signal:L6(n,s,t)}}function I6(e,t,n,i,r,o){var s;if(!(de(i)&&wa(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&Xu(e)==="quantitative"&&(r.normalizedNumberFormatType&&Ku(e)&&e.stack==="normalize"||r.numberFormatType))){if(Ku(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return Kb({type:"quantitative",config:r,normalizeStack:!0});if(Ju(e)){const a=q(e)?(s=Dt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Nae({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return Kb({type:t,specifiedFormat:n,config:r})}}function z6(e,t,n){var i;if(e&&(Q(e)||e==="number"||e==="time"))return e;if(Ju(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=Dt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function Kb({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(de(t))return t;if(e===va)return i?n.normalizedNumberFormat:n.numberFormat}function Nae({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:y6(t)}:i?void 0:n.timeFormat)}function B6(e,t){return`format(${e}, "${t||""}")`}function U_(e,t,n,i){return wa(n)?L6(n,e,t):B6(e,(de(t)?t:void 0)??i.numberFormat)}function Zf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Zf(e,t,r.numberFormat,r.numberFormatType,r);const o=U_(e,n,i,r),s=U_(t,n,i,r);return`${O0(e,!1)} ? "null" : ${o} + "${Rae}" + ${s}`}function Lae({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=de(n)?n:r,`${o?"utc":"time"}Format(${e}, '${n}')`):Wse(t,e,o)}const I0="min",Pae={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 j_(e){return gt(Pae,e)}function Iae(e){return U(e,"encoding")}function so(e){return e&&(e.op==="count"||U(e,"field"))}function U6(e){return e&&X(e)}function ed(e){return U(e,"row")||U(e,"column")}function Kw(e){return U(e,"header")}function z0(e){return U(e,"facet")}function zae(e){return U(e,"param")}function Bae(e){return!de(e)&&U(e,"repeat")}function q_(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Jw(e){return U(e,"sort")}function os({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(fe(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(He(o))return .5}}function j6({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=jn(e),u=Be(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:Ar("timeUnitBandSize",i,r)};if(He(h)&&!Tt(o))return{band:1}}if(lf(i.type))return o?Tt(o)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function q6(e,t,n,i){return He(e.bin)||e.timeUnit&&Cn(e)&&e.type==="temporal"?os({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function W6(e){return U(e,"sort")&&!U(e,"field")}function td(e){return U(e,"condition")}function B0(e){const t=e==null?void 0:e.condition;return!!t&&!X(t)&&q(t)}function nd(e){const t=e==null?void 0:e.condition;return!!t&&!X(t)&&fe(t)}function Uae(e){const t=e==null?void 0:e.condition;return!!t&&(X(t)||Ui(t))}function q(e){return U(e,"field")||(e==null?void 0:e.aggregate)==="count"}function Xu(e){return e==null?void 0:e.type}function Lr(e){return U(e,"datum")}function Wo(e){return Cn(e)&&!Bg(e)||zg(e)}function W_(e){return Cn(e)&&e.type==="quantitative"&&!e.bin||zg(e)}function zg(e){return Lr(e)&&Ze(e.datum)}function fe(e){return q(e)||Lr(e)}function Cn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function Ui(e){return U(e,"value")}function qa(e){return U(e,"scale")||U(e,"sort")}function Ku(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function G6(e){return U(e,"legend")}function H6(e){return U(e,"format")||U(e,"formatType")}function jae(e){return Rn(e,["legend","axis","header","scale"])}function qae(e){return U(e,"op")}function H(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(Gae(e))n=NN("count");else{let s;if(!t.nofn)if(qae(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;He(a)?(s=XN(a),r=(t.binSuffix??"")+(t.suffix??"")):u?xs(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):go(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!ja(l)&&(s=Gse(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?bl(n):t.expr?MN(n,t.expr)+o:bi(n)+o}function Bg(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(o6(e.type))}function Wae(e){var t;return qa(e)&&Yu((t=e.scale)==null?void 0:t.type)}function Gae(e){return e.aggregate==="count"}function Hae(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(He(i))return`${n} (binned)`;if(r&&!ja(r)){const a=(s=Dt(r))==null?void 0:s.unit;if(a)return`${n} (${M0(a).join("-")})`}else if(o)return xs(o)?`${n} for max ${o.argmax}`:go(o)?`${n} for min ${o.argmin}`:`${Vf(o)} of ${n}`;return n}function Vae(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(xs(t))return`${r} for argmax(${t.argmax})`;if(go(t))return`${r} for argmin(${t.argmin})`;const o=i&&!ja(i)?Dt(i):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||He(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const V6=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return Vae(e);default:return Hae(e,t)}};let Y6=V6;function X6(e){Y6=e}function Yae(){X6(V6)}function wu(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=Qw(e))==null?void 0:a.title;if(!q(e))return r??e.title;const o=e,s=i?Zw(o,t):void 0;return n?ft(r,o.title,s):r??o.title??s}function Qw(e){if(Ku(e)&&e.axis)return e.axis;if(G6(e)&&e.legend)return e.legend;if(Kw(e)&&e.header)return e.header}function Zw(e,t){return Y6(e,t)}function Ug(e){if(H6(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Qw(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Xae(e,t){var o;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(Jw(e)&&X(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!xs(n)&&!go(n))return"quantitative";if(qa(e)&&((o=e.scale)!=null&&o.type))switch(Yb[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ji(e){if(q(e))return e;if(B0(e))return e.condition}function xt(e){if(fe(e))return e;if(nd(e))return e.condition}function K6(e,t,n,i={}){if(de(e)||Ze(e)||Hf(e)){const r=de(e)?"string":Ze(e)?"number":"boolean";return j(Yoe(t,r,e)),{value:e}}return fe(e)?jg(e,t,n,i):nd(e)?{...e,condition:jg(e.condition,t,n,i)}:e}function jg(e,t,n,i){if(H6(e)){const{format:r,formatType:o,...s}=e;if(wa(o)&&!n.customFormatTypes)return j(L_(t)),jg(s,t,n,i)}else{const r=Ku(e)?"axis":G6(e)?"legend":Kw(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(wa(s)&&!n.customFormatTypes)return j(L_(t)),jg({...e,[r]:a},t,n,i)}}return q(e)?eA(e,t,i):Kae(e)}function Kae(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ze(n)?"quantitative":de(n)?"nominal":Ua(n)?"temporal":void 0,{...e,type:t}}function eA(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!Cw(i)&&!xs(i)&&!go(i)&&(j(Koe(i)),delete a.aggregate),r&&(a.timeUnit=Dt(r)),s&&(a.field=`${s}`),He(o)&&(a.bin=U0(o,t)),Nt(o)&&!dt(t)&&j(Fse(t)),Cn(a)){const{type:u}=a,l=Zse(u);u!==l&&(a.type=l),u!=="quantitative"&&k0(i)&&(j(Xoe(u,i)),a.type="quantitative")}else if(!qN(t)){const u=Xae(a,t);a.type=u}if(Cn(a)){const{compatible:u,warning:l}=Jae(a,t)||{};u===!1&&j(l)}if(Jw(a)&&de(a.sort)){const{sort:u}=a;if(j_(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&j_(l))return{...a,sort:{encoding:l,order:"descending"}}}if(Kw(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 U0(e,t){return Hf(e)?{maxbins:__(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:__(t)}:e}const iu={compatible:!0};function Jae(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 ro:case oo:case A0:return Bg(e)?iu:{compatible:!1,warning:ese(t)};case et:case Ot:case hs:case xl:case Bn:case Mr:case Or:case Yf:case Xf:case S0:case ya:case C0:case $0:case Pa:case Ei:case Yi:case _0:return iu;case Ki:case xi:case Xi:case Ji:return n!==va?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:iu;case Ao:case ps:case ms:case ys:case wo:case Eo:case vo:case Vi:case Tr:case gs:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:iu;case Un:case bs:return!Bg(e)&&!Wae(e)?{compatible:!1,warning:tse(t)}:iu;case Hu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:iu}}function Ju(e){const{formatType:t}=Ug(e);return t==="time"||!t&&Qae(e)}function Qae(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function j0(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const o=t&&((u=Dt(t))==null?void 0:u.unit);let s=o||n==="temporal",a;return Jf(e)?a=e.expr:Q(e)?a=e.signal:Ua(e)?(s=!0,a=xa(e)):(de(e)||Ze(e))&&s&&(a=`datetime(${je(e)})`,Bse(o)&&(Ze(e)&&e<1e4||de(e)&&isNaN(Date.parse(e)))&&(a=xa({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:je(e)}function J6(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!ja(e.timeUnit)?e.timeUnit:void 0,o=j0(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function id(e,t){return He(e.bin)?Nr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const G_={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 rd(e){return e==null?void 0:e.condition}const Q6=["domain","grid","labels","ticks","title"],Zae={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"},Z6={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},eue={...Z6,style:1,labelExpr:1,encoding:1};function H_(e){return gt(eue,e)}const tue={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},e4=B(tue);function Co(e){return U(e,"mark")}class q0{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Co(t)?kae(t.mark)===this.name:!1}}function ea(e,t){const n=e&&e[t];return n?X(n)?Wu(n,i=>!!i.field):q(n)||B0(n):!1}function t4(e,t){const n=e&&e[t];return n?X(n)?Wu(n,i=>!!i.field):q(n)||Lr(n)||nd(n):!1}function n4(e,t){if(dt(t)){const n=e[t];if((q(n)||Lr(n))&&(w6(n.type)||q(n)&&n.timeUnit)){const i=vw(t);return t4(e,i)}}return!1}function i4(e){return Wu(Kre,t=>{if(ea(e,t)){const n=e[t];if(X(n))return Wu(n,i=>!!i.aggregate);{const i=ji(n);return i&&!!i.aggregate}}return!1})}function r4(e,t){const n=[],i=[],r=[],o=[],s={};return tA(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=Qw(a),p=g==null?void 0:g.title;let m=H(a,{forAs:!0});const y={...p?[]:{title:wu(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(xs(c)?(b="argmax",m=H({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):go(c)?(b="argmin",m=H({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),Cn(a)&&He(f)){if(i.push({bin:f,field:l,as:m}),n.push(H(a,{binSuffix:"end"})),id(a,u)&&n.push(H(a,{binSuffix:"range"})),dt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",qN(u)||(y.type=va)}else if(d&&!ja(d)){r.push({timeUnit:d,field:l,as:m});const b=Cn(a)&&a.type!==Vu&&"time";b&&(u===Yf||u===ya?y.formatType=b:aoe(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 nue(e,t,n){const i=loe(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 iue(e,t,n,i){const r={};for(const o of B(e))jN(o)||j(Zoe(o));for(let o of noe){if(!e[o])continue;const s=e[o];if(Kf(o)){const a=toe(o),u=r[a];if(q(u)&&Qse(u.type)&&q(s)&&!u.timeUnit){j(Voe(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(Hoe),o=Ei),!nue(e,o,t)){j(T0(o,t));continue}if(o===wo&&t==="line"){const a=ji(e[o]);if(a!=null&&a.aggregate){j(Qoe);continue}}if(o===Bn&&(n?"fill"in e:"stroke"in e)){j(s6("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Xf||o===Hu&&!X(s)&&!Ui(s)||o===ya&&X(s)){if(s){if(o===Hu){const a=e[o];if(W6(a)){r[o]=a;continue}}r[o]=ct(s).reduce((a,u)=>(q(u)?a.push(eA(u,o)):j(Vb(u,o)),a),[])}}else{if(o===ya&&s===null)r[o]=null;else if(!q(s)&&!Lr(s)&&!Ui(s)&&!td(s)&&!Q(s)){j(Vb(s,o));continue}r[o]=K6(s,o,i)}}return r}function W0(e,t){const n={};for(const i of B(e)){const r=K6(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function rue(e){const t=[];for(const n of B(e))if(ea(e,n)){const i=e[n],r=ct(i);for(const o of r)q(o)?t.push(o):B0(o)&&t.push(o.condition)}return t}function tA(e,t,n){if(e)for(const i of B(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 oue(e,t,n,i){return e?B(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 o4(e,t){return B(t).reduce((n,i)=>{switch(i){case et:case Ot:case C0:case _0:case $0:case Vi:case Tr:case hs:case xl:case Ei:case Eo:case Yi:case vo:case gs:case Xi:case Ki:case Ji:case xi:case Yf:case Un:case Pa:case ya:return n;case Hu:if(e==="line"||e==="trail")return n;case Xf:case S0:{const r=t[i];if(X(r)||q(r))for(const o of ct(r))o.aggregate||n.push(H(o,{}));return n}case wo:if(e==="trail")return n;case Bn:case Mr:case Or:case Ao:case ps:case ms:case bs:case ys:{const r=ji(t[i]);return r&&!r.aggregate&&n.push(H(r,{})),n}}},[])}function sue(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 Jb(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 ${nA(t)}`:"";return{field:s+t.field,type:t.type,title:Q(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=rue(n).map(jae);return{tooltip:[...r,...cr(o,Ae)]}}function nA(e){const{title:t,field:n}=e;return ft(t,n)}function iA(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=nA(n);return s4(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}:{}},...de(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function s4(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}:{},...Sr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Hf(e[t])?{}:e[t]}}]:[]}function a4(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:Bd(o,n),continuousAxisChannelDef2:Bd(s,n),continuousAxisChannelDefError:Bd(a,n),continuousAxisChannelDefError2:Bd(u,n),continuousAxis:r}}function Bd(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(_se(n,t)),i}else return e}function u4(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(Sr(n)&&n.orient)return n.orient;if(Wo(r)){if(Wo(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 Ju(o)&&!Ju(r)?"horizontal":"vertical"}return"horizontal"}else{if(Wo(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const qg="boxplot",aue=["box","median","outliers","rule","ticks"],uue=new q0(qg,c4);function l4(e){return Ze(e)?"tukey":e}function c4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=Sr(n)?n:{type:n};r&&j(r6("boxplot"));const u=a.extent??t.boxplot.extent,l=Be("size",a,t),c=a.invalid,f=l4(u),{bins:d,timeUnits:h,transform:g,continuousAxisChannelDef:p,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:w,customTooltipWithoutAggregatedField:A}=lue(e,u,t),E=bl(p.field),{color:S,size:C,..._}=x,F=fd=>iA(a,m,p,fd,t.boxplot),O=F(_),T=F(x),k=(Fe(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$=F({..._,...C?{size:C}:{},color:{condition:{test:`${Le(`lower_box_${p.field}`)} >= ${Le(`upper_box_${p.field}`)}`,...S||{value:k}}}}),D=Jb([{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"}],p,x),P={type:"tick",color:"black",opacity:1,orient:v,invalid:c,aria:!1},z=f==="min-max"?D:Jb([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,x),I=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:z})],V=[...f!=="tukey"?I:[],...T({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:w,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:D}),...$({partName:"median",mark:{type:"tick",invalid:c,...Fe(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(g),layer:V};const ue=Le(`lower_box_${p.field}`),ie=Le(`upper_box_${p.field}`),he=`(${ie} - ${ue})`,We=`${ue} - ${u} * ${he}`,ge=`${ie} + ${u} * ${he}`,Ht=Le(p.field),ws={joinaggregate:f4(p.field),groupby:y},_o={transform:[{filter:`(${We} <= ${Ht}) && (${Ht} <= ${ge})`},{aggregate:[{op:"min",field:p.field,as:`lower_whisker_${E}`},{op:"max",field:p.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${p.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${p.field}`,as:`upper_box_${E}`},...b],groupby:y}],layer:I},{tooltip:Y,...pe}=_,{scale:ve,axis:W}=p,Rt=nA(p),Ne=Rn(W,["title"]),Vt=s4(a,"outliers",t.boxplot,{transform:[{filter:`(${Ht} < ${We}) || (${Ht} > ${ge})`}],mark:"point",encoding:{[m]:{field:p.field,type:p.type,...Rt!==void 0?{title:Rt}:{},...ve!==void 0?{scale:ve}:{},...Ue(Ne)?{}:{axis:Ne}},...pe,...S?{color:S}:{},...A?{tooltip:A}:{}}})[0];let At;const Zi=[...d,...h,ws];return Vt?At={transform:Zi,layer:[Vt,_o]}:(At=_o,At.transform.unshift(...Zi)),{...s,layer:[At,{transform:g,layer:V}]}}function f4(e){const t=bl(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function lue(e,t,n){const i=u4(e,qg),{continuousAxisChannelDef:r,continuousAxis:o}=a4(e,i,qg),s=r.field,a=bl(s),u=l4(t),l=[...f4(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:`${Le(`upper_box_${a}`)} - ${Le(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${Le(`upper_box_${a}`)} + ${Le(`iqr_${a}`)} * ${t}, ${Le(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${Le(`lower_box_${a}`)} - ${Le(`iqr_${a}`)} * ${t}, ${Le(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:g}=sue(d),{bins:p,timeUnits:m,aggregate:y,groupby:b,encoding:x}=r4(g,n),v=i==="vertical"?"horizontal":"vertical",w=i,A=[...p,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:p,timeUnits:m,transform:A,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:w,customTooltipWithoutAggregatedField:h}}const rA="errorbar",cue=["ticks","rule"],fue=new q0(rA,d4);function d4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=h4(e,rA,t);delete o.size;const c=iA(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}:{}},g=[...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,...g.length>1?{layer:g}:{...g[0]}}}function due(e,t){const{encoding:n}=e;if(hue(n))return{orient:u4(e,t),inputType:"raw"};const i=gue(n),r=pue(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(fe(a)&&fe(u))throw new Error(`${t} cannot have both x2 and y2`);if(fe(a)){if(Wo(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(fe(u)){if(Wo(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(fe(u)&&!fe(a))throw new Error(`${t} cannot have xError2 without xError`);if(fe(c)&&!fe(l))throw new Error(`${t} cannot have yError2 without yError`);if(fe(a)&&fe(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(fe(a)){if(Wo(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(fe(l)){if(Wo(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 hue(e){return(fe(e.x)||fe(e.y))&&!fe(e.x2)&&!fe(e.y2)&&!fe(e.xError)&&!fe(e.xError2)&&!fe(e.yError)&&!fe(e.yError2)}function gue(e){return fe(e.x2)||fe(e.y2)}function pue(e){return fe(e.xError)||fe(e.xError2)||fe(e.yError)||fe(e.yError2)}function h4(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=Sr(i)?i:{type:i};o&&j(r6(t));const{orient:l,inputType:c}=due(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=a4(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=mue(u,f,d,h,g,c,t,n),{[p]:v,[p==="x"?"x2":"y2"]:w,[p==="x"?"xError":"yError"]:A,[p==="x"?"xError2":"yError2"]:E,...S}=r,{bins:C,timeUnits:_,aggregate:F,groupby:O,encoding:T}=r4(S,n),k=[...F,...m],$=c!=="raw"?[]:O,D=Jb(b,f,T,x);return{transform:[...a.transform??[],...C,..._,...k.length===0?[]:[{aggregate:k,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:T,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:D}}function mue(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,g=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(g==="iqr")&&j($se(h,g,s)),g==="stderr"||g==="stdev")u=[{op:g,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${Le(`center_${c}`)} + ${Le(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${Le(`center_${c}`)} - ${Le(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Vf(h)},{fieldPrefix:"upper_",titlePrefix:V_(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:V_(h,g,"-")}],d=!0;else{let p,m,y;g==="ci"?(p="mean",m="ci0",y="ci1"):(p="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:p,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:wu({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:wu({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:wu({field:c,aggregate:p,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(Cse(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:Le(n.field),as:`upper_${c}`},{calculate:Le(c),as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${Le(c)} + ${Le(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${Le(c)} + ${Le(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${Le(c)} - ${Le(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:ma(ma(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function V_(e,t,n){return`${Vf(e)} ${n} ${t}`}const oA="errorband",yue=["band","borders"],bue=new q0(oA,g4);function g4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=h4(e,oA,t),l=s,c=iA(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 g={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},h={...h,...g,aria:!1}):l.interpolate?j(I_("interpolate")):l.tension&&j(I_("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 p4={};function sA(e,t,n){const i=new q0(e,t);p4[e]={normalizer:i,parts:n}}function xue(){return B(p4)}sA(qg,c4,aue);sA(rA,d4,cue);sA(oA,g4,yue);const vue=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],m4={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"},y4={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"},Eue=B(m4),wue=B(y4),Aue={header:1,headerRow:1,headerColumn:1,headerFacet:1},b4=B(Aue),x4=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Sue={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Cue={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_",$ue={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 aA(e){return e==="legend"||!!(e!=null&&e.legend)}function F1(e){return aA(e)&&Fe(e)}function uA(e){return!!(e!=null&&e.select)}function v4(e){const t=[];for(const n of e||[]){if(uA(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 _ue(e){return G0(e)||cA(e)||lA(e)}function lA(e){return U(e,"concat")}function G0(e){return U(e,"vconcat")}function cA(e){return U(e,"hconcat")}function E4({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Cr(e){return U(e,"step")}function Y_(e){return U(e,"view")||U(e,"width")||U(e,"height")}const X_=20,Fue={align:1,bounds:1,center:1,columns:1,spacing:1},kue=B(Fue);function Due(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(z0(e)&&!ed(e.facet)||lA(e))&&(r.columns=s),G0(e)&&(r.columns=1);for(const a of kue)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 Qb(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Zb(e,t){const n=Wg(e,t);return Cr(n)?n.step:w4}function Wg(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ft(n,{step:e.step})}const w4=20,Tue={continuousWidth:200,continuousHeight:200,step:w4},Mue={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Tue,mark:Aae,arc:{},area:{},bar:_ae,circle:{},geoshape:{},image:{},line:{},point:{},rect:Gw,rule:{color:"black"},square:{},text:{color:"black"},tick:Fae,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:rae,projection:{},legend:Sue,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:$ue,style:{},title:{},facet:{spacing:X_},concat:{spacing:X_},normalizedNumberFormat:".0%"},Ur=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],K_={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},J_={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 Oue(e={}){return{signals:[{name:"color",value:Fe(e)?{...J_,...e}:J_}],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 Rue(e){return{signals:[{name:"fontSize",value:Fe(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 Nue(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function A4(e){const t=B(e||{}),n={};for(const i of t){const r=e[i];n[i]=rd(r)?JN(r):Vn(r)}return n}function Lue(e){const t=B(e),n={};for(const i of t)n[i]=A4(e[i]);return n}const Pue=[...M6,...e4,...b4,"background","padding","legend","lineBreak","scale","style","title","view"];function S4(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=FN({},ce(Mue),n?Nue(n):{},t?Oue(t):{},i?Rue(i):{},o||{});r&&E0(s,"selection",r,!0);const a=Rn(s,Pue);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=Vn(s[u]));for(const u of M6)s[u]&&(a[u]=Lt(s[u]));for(const u of e4)s[u]&&(a[u]=A4(s[u]));for(const u of b4)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),...B(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=Lue(s.style)),s.title&&(a.title=Lt(s.title)),s.view&&(a.view=Lt(s.view)),a}const Iue=new Set(["view",...yae]),zue=["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"],Bue={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...wae};function Uue(e){e=ce(e);for(const t of zue)delete e[t];if(e.axis)for(const t in e.axis)rd(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of vue)delete e.legend[t];if(e.mark){for(const t of B_)delete e.mark[t];e.mark.tooltip&&Fe(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(v4(e.params)),delete e.params);for(const t of Iue){for(const i of B_)delete e[t][i];const n=Bue[t];if(n)for(const i of n)delete e[t][i];que(e,t)}for(const t of xue())delete e[t];jue(e);for(const t in e)Fe(e[t])&&Ue(e[t])&&delete e[t];return Ue(e)?void 0:e}function jue(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=KN(e.title);Ue(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ue(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ue(i)?delete e.title:e.title=i}function que(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};Ue(o)||(e.style[n??t]=o),delete e[t]}function H0(e){return U(e,"layer")}function Wue(e){return U(e,"repeat")}function Gue(e){return!X(e.repeat)&&U(e.repeat,"layer")}class fA{map(t,n){return z0(t)?this.mapFacet(t,n):Wue(t)?this.mapRepeat(t,n):cA(t)?this.mapHConcat(t,n):G0(t)?this.mapVConcat(t,n):lA(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(H0(t))return this.mapLayer(t,n);if(Co(t))return this.mapUnit(t,n);throw new Error($w(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 Hue={zero:1,center:1,normalize:1};function Vue(e){return gt(Hue,e)}const Yue=new Set([k6,N0,R0,Pg,P0,qw,Ww,L0,D6,jw]),Xue=new Set([N0,R0,k6]);function ru(e){return q(e)&&Xu(e)==="quantitative"&&!e.bin}function Q_(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(ru(s)&&ru(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(ru(s))return t;if(ru(a))return r}else{if(ru(s))return o&&n==="vertical"?void 0:t;if(ru(a))return o&&n==="horizontal"?void 0:r}}function Kue(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function C4(e,t){var p,m;const n=Sr(e)?e:{type:e},i=n.type;if(!Yue.has(i))return null;const r=Q_(t,"x",n)||Q_(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?H(o,{}):void 0,a=Kue(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?H(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?H(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=ioe.reduce((y,b)=>{if(b!=="tooltip"&&ea(t,b)){const x=t[b];for(const v of ct(x)){const w=ji(v);if(w.aggregate)continue;const A=H(w,{});(!A||!l.has(A))&&y.push({channel:b,fieldDef:w})}}return y},[]);let g;return o.stack!==void 0?Hf(o.stack)?g=o.stack?"zero":null:g=o.stack:Xue.has(i)&&(g="zero"),!g||!Vue(g)||i4(t)&&h.length===0?null:((p=o==null?void 0:o.scale)!=null&&p.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Pt.LINEAR&&o!=null&&o.stack&&j(wse(o.scale.type)),fe(t[Rr(r)])?(o.stack!==void 0&&j(Ese(r)),null):(q(o)&&o.aggregate&&!moe.has(o.aggregate)&&j(Ase(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:vs(i),stackBy:h,offset:g}))}function $4(e,t,n){const i=Lt(e),r=Be("orient",i,n);if(i.orient=ele(i.type,t,r),r!==void 0&&r!==i.orient&&j(ose(i.orient,r)),i.type==="bar"&&i.orient){const u=Be("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Cae[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Be("opacity",i,n),s=Be("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=Que(i.type,t)),Be("cursor",i,n)===void 0&&(i.cursor=Jue(i,t,n)),i}function Jue(e,t,n){return t.href||e.href||Be("href",e,n)?"pointer":e.cursor}function Que(e,t){if(we([P0,jw,qw,Ww],e)&&!i4(t))return .7}function Zue(e,t,{graticule:n}){if(n)return!1;const i=Ar("filled",e,t),r=e.type;return ft(i,r!==P0&&r!==L0&&r!==Pg)}function ele(e,t,n){switch(e){case P0:case qw:case Ww:case D6:case pae:case gae:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case N0: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===va&&!He(i.bin)||zg(i))&&q(r)&&Nt(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===va&&!He(r.bin)||zg(r))&&q(i)&&Nt(i.bin)?"vertical":"horizontal"}case Pg:if(o&&!(q(i)&&Nt(i.bin))&&s&&!(q(r)&&Nt(r.bin)))return;case R0:if(s)return q(r)&&Nt(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Nt(i.bin)?"vertical":"horizontal";if(e===Pg){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case L0:case jw:{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=Cn(i)&&i.type===Vu,c=Cn(r)&&r.type===Vu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function tle(e){const{point:t,line:n,...i}=e;return B(i).length>1?i:i.type}function nle(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Rn(e[t],["point","line"])});return e}function k1(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Fe(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Fe(t.point)?t.point:{}:void 0}function Z_(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 ile{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Co(t)){const{mark:i,encoding:r}=t,o=Sr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!k1(o,n[o.type],r);case"area":return!!k1(o,n[o.type],r)||!!Z_(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=W0(l,r),d=Sr(a)?a:{type:a},h=k1(d,r[d.type],f),g=d.type==="area"&&Z_(d,r[d.type]),p=[{name:u,...o?{params:o}:{},mark:tle({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Rn(f,["shape"])}],m=C4($4(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=Rn(y,["y2","x2"]),g&&p.push({...s?{projection:s}:{},mark:{type:"line",...qu(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),h&&p.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...qu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:p},{...n,config:nle(r)})}}function rle(e,t){return t?ed(e)?F4(e,t):_4(e,t):e}function D1(e,t){return t?F4(e,t):e}function ex(e,t,n){const i=t[e];if(Bae(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(Loe(i.repeat));return}return t}function _4(e,t){if(e=ex("field",e,t),e!==void 0){if(e===null)return null;if(Jw(e)&&so(e.sort)){const n=ex("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function eF(e,t){if(q(e))return _4(e,t);{const n=ex("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function tF(e,t){if(fe(e)){const n=eF(e,t);if(n)return n;if(td(e))return{condition:e.condition}}else{if(nd(e)){const n=eF(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function F4(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=>tF(o,t)).filter(o=>o);else{const o=tF(r,t);o!==void 0&&(n[i]=o)}}return n}class ole{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Co(t)){const{encoding:n,mark:i}=t;if(i==="line"||Sr(i)&&i.type==="line")for(const r of eoe){const o=Ia(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(rse(!!r.x2,!!r.y2)),i({...t,mark:Fe(o)?{...o,type:"rule"}:"rule"},n)}}class sle extends fA{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[uue,fue,bue,new ile,new ole]}map(t,n){if(Co(t)){const i=ea(t.encoding,ro),r=ea(t.encoding,oo),o=ea(t.encoding,A0);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=D1(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 Gue(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)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return g.name=h,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!X(i)&&t.columns&&(t=Rn(t,["columns"]),j(R_("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 g of d)for(const p of c)for(const m of f){const y={repeat:g,row:p,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(X(i)?`${Qe(g)}`:(i.row?`row_${Qe(p)}`:"")+(i.column?`column_${Qe(m)}`:"")),x=this.map(r,{...n,repeater:y,repeaterPrefix:b});x.name=b,a.push(Rn(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 ed(i)&&t.columns&&(t=Rn(t,["columns"]),j(R_("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=iF({parentProjection:s,projection:r}),l=nF({parentEncoding:o,encoding:D1(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,...g}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=D1(s,n.repeater);return this.mapFacet({...g,...m,facet:p,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(nse([...i?[ro]:[],...r?[oo]:[]]));const s={},a={};for(const u of[ro,oo]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...g}=l;s[u]=g;for(const p of["align","center","spacing"])l[p]!==void 0&&(a[p]??(a[p]={}),a[p][u]=l[p])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:rle(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:nF({parentEncoding:n,encoding:o,layer:!0}),parentProjection:iF({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function nF({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...B(e),...B(t)]);for(const o of r){const s=t[o],a=e[o];if(fe(s)){const u={...a,...s};i[o]=u}else nd(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Ui(a)||Q(a)||fe(a)||X(a))&&(i[o]=a)}}else i=t;return!i||Ue(i)?void 0:i}function iF(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Goe({parentProjection:t,projection:n})),n??t}function dA(e){return U(e,"filter")}function ale(e){return U(e,"stop")}function k4(e){return U(e,"lookup")}function ule(e){return U(e,"data")}function lle(e){return U(e,"param")}function cle(e){return U(e,"pivot")}function fle(e){return U(e,"density")}function dle(e){return U(e,"quantile")}function hle(e){return U(e,"regression")}function gle(e){return U(e,"loess")}function ple(e){return U(e,"sample")}function mle(e){return U(e,"window")}function yle(e){return U(e,"joinaggregate")}function ble(e){return U(e,"flatten")}function xle(e){return U(e,"calculate")}function D4(e){return U(e,"bin")}function vle(e){return U(e,"impute")}function Ele(e){return U(e,"timeUnit")}function wle(e){return U(e,"aggregate")}function Ale(e){return U(e,"stack")}function Sle(e){return U(e,"fold")}function Cle(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function $le(e){return e.map(t=>dA(t)?{filter:vu(t.filter,Jse)}:t)}class _le extends fA{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=rF(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=rF(t,n),t.encoding){const i={};for(const[r,o]of is(t.encoding))i[r]=T4(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:is(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 qt(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function rF(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(dA(o))return{filter:tx(o,t)};if(D4(o)&&za(o.bin))return{...o,bin:M4(o.bin)};if(k4(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function T4(e,t){var i,r;const n=ce(e);if(q(n)&&za(n.bin)&&(n.bin=M4(n.bin)),qa(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(td(n))if(X(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:tx(o,t)}});else{const{selection:o,param:s,test:a,...u}=T4(n.condition,t);n.condition=s?n.condition:{...u,test:tx(n.condition,t)}}return n}function M4(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function tx(e,t){const n=i=>vu(i,r=>{var o;const s=t.emptySelections[r]??!0,a={param:r,empty:s};return(o=t.selectionPredicates)[r]??(o[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):vu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class nx extends fA{map(t,n){const i=n.selections??[];if(t.params&&!Co(t)){const r=[];for(const o of t.params)uA(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)(de(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=nx.prototype[e];nx.prototype[e]=function(n,i){return t.call(this,n,Fle(n,i))}}function Fle(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function O4(e,t){t===void 0&&(t=S4(e.config));const n=Mle(e,t),{width:i,height:r}=e,o=Ole(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const kle=new sle,Dle=new _le,Tle=new nx;function Mle(e,t={}){const n={config:t};return Tle.map(kle.map(Dle.map(e,n),n),n)}function oF(e){return de(e)?{type:e}:e??{}}function Ole(e,t,n){let{width:i,height:r}=t;const o=Co(e)||H0(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(D_("width")),i=void 0),r=="container"&&(j(D_("height")),r=void 0));const a={type:"pad",...s,...n?oF(n.autosize):{},...oF(e.autosize)};if(a.type==="fit"&&!o&&(j(Coe),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(T_("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(T_("height")),!Xn(a,{type:"pad"}))return a}function Rle(e){return["fit","fit-x","fit-y"].includes(e)}function Nle(e){return e?`fit-${F0(e)}`:"fit"}const Lle=["background","padding"];function sF(e,t){const n={};for(const i of Lle)e&&e[i]!==void 0&&(n[i]=Vn(e[i]));return t&&(n.params=e.params),n}class $o{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new $o(ce(this.explicit),ce(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 B(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function or(e){return{explicit:!0,value:e}}function Wn(e){return{explicit:!1,value:e}}function R4(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:V0(t,n,i,r)}}function V0(e,t,n,i){return e.explicit&&t.explicit&&j(gse(n,i,e.value,t.value)),e}function ss(e,t,n,i,r=V0){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Xn(e.value,t.value)?e:r(e,t,n,i)}class Ple extends $o{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 Qu(e){return U(e,"url")}function cf(e){return U(e,"values")}function N4(e){return U(e,"name")&&!Qu(e)&&!cf(e)&&!Xo(e)}function Xo(e){return e&&(L4(e)||P4(e)||hA(e))}function L4(e){return U(e,"sequence")}function P4(e){return U(e,"sphere")}function hA(e){return U(e,"graticule")}var it;(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"})(it||(it={}));function I4({invalid:e,isPath:t}){switch(O6(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 Ile(e){const{marks:t,scales:n}=I4(e);return t===n?it.Main:n==="include-invalid-values"?it.PreFilterInvalid:it.PostFilterInvalid}class ze{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,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(joe);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 Nn extends ze{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 ${RN()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function T1(e){return e.as!==void 0}function aF(e){return`${e}_end`}class gr extends ze{clone(){return new gr(null,ce(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(ja(u)){if(nt(n)){const{mark:c,markDef:f,config:d}=n,h=os({fieldDef:o,markDef:f,config:d});(lf(c)||h)&&(l={timeUnit:Dt(u),field:a})}}else l={as:H(o,{forAs:!0}),field:a,timeUnit:u};if(nt(n)){const{mark:c,markDef:f,config:d}=n,h=os({fieldDef:o,markDef:f,config:d});lf(c)&&dt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[Ae(l)]=l)}return r},{});return Ue(i)?null:new gr(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=Dt(i),s={...r,timeUnit:o};return new gr(t,{[Ae(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 is(this.timeUnits)){const o=T1(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(qt(this.timeUnits).map(t=>T1(t)?t.as:aF(t.field)))}dependentFields(){return new Set(qt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Ae(this.timeUnits)}`}assemble(){const t=[];for(const n of qt(this.timeUnits)){const{rectBandPosition:i}=n,r=Dt(n.timeUnit);if(T1(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:bi(o),type:"timeunit",...a?{units:M0(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...uF(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=z4({timeUnit:r,field:s}),u=aF(s);t.push({type:"formula",expr:a,as:u}),t.push(...uF([s,u],i,r))}}return t}}const Y0="offsetted_rect_start",X0="offsetted_rect_end";function z4({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=p6(i),{part:s,step:a}=x6(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', ${Le(t)}, ${n?-a:a})`}function uF([e,t],n,i){if(n!==void 0&&n!==.5){const r=Le(e),o=Le(t);return[{type:"formula",expr:lF([z4({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Y0}`},{type:"formula",expr:lF([r,o],n+.5),as:`${e}_${X0}`}]}return[]}function lF([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const od="_tuple_fields";class zle{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Ble={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new zle),o={},s={},a=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=Qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Qe(`${i}_${m}_${b}`);return a.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?ct(n.value):null;let{fields:d,encodings:h}=Fe(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(Fe(g))for(const p of B(g))Zre(p)?(h||(h=[])).push(p):l==="interval"?(j(Noe),h=c.encodings):(d??(d=[])).push(p)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const g of h??[]){const p=e.fieldDef(g);if(p){let m=p.field;if(p.aggregate){j($oe(g,p.aggregate));continue}else if(!m){j(O_(g));continue}if(p.timeUnit&&!ja(p.timeUnit)){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};s[Ae(y)]=y}if(!o[m]){const y=l==="interval"&&Nr(g)&&Bi(e.getScaleComponent(g).get("type"))?"R":p.bin?"R-RE":"E",b={field:m,channel:g,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,BN(g)?(b.geoChannel=g,b.channel=zN(g),r.hasChannel[b.channel]=o[m]):r.hasChannel[g]=o[m]}}else j(O_(g))}for(const g of d??[]){if(r.hasField[g])continue;const p={type:"E",field:g,index:r.items.length};p.signals={...u(p,"data")},r.items.push(p),r.hasField[g]=p,r.hasSelectionId=r.hasSelectionId||g===qi}f&&(t.init=f.map(g=>r.items.map(p=>Fe(g)?g[p.geoChannel||p.channel]!==void 0?g[p.geoChannel||p.channel]:g[p.field]:g))),Ue(s)||(r.timeUnit=new gr(null,s))},signals:(e,t,n)=>{const i=t.name+od;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(q4)})}},B4="_curr",Ah="anim_value",uu="anim_clock",ix="eased_anim_clock",U4="min_extent",j4="max_range_extent",M1="last_tick_at",O1="is_playing",Ule=1/60*1e3,jle=(e,t)=>[{name:ix,update:uu},{name:`${e}_domain`,init:`domain('${t}')`},{name:U4,init:`extent(${e}_domain)[0]`},{name:j4,init:`extent(range('${t}'))[1]`},{name:Ah,update:`invert('${t}', ${ix})`}],qle={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(pr(t)&&(n=n.concat([{name:uu,init:"0",on:[{events:{type:"timer",throttle:Ule},update:`${O1} ? (${uu} + (now() - ${M1}) > ${j4} ? 0 : ${uu} + (now() - ${M1})) : ${uu}`}]},{name:M1,init:"now()",on:[{events:[{signal:uu},{signal:O1}],update:"now()"}]},{name:O1,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+od,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=qt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Au):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: ${ta(e)}, `;if(t.project.hasSelectionId)l+=`${qi}: ${s}[${_e(qi)}]`;else if(pr(t))l+=`fields: ${r}, values: [${Ah} ? ${Ah} : ${U4}]`;else{const c=o.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${s}[${_e(e.vgField(f.channel,{}))}], ${s}[${_e(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${s}[${_e(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(pr(t))return n.concat(jle(t.name,e.scaleName(gs)),[{name:i+mo,on:[{events:[{signal:ix},{signal:Ah}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+mo,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function q4(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=bi(r.field),r}function Aa(e,t=!0,n=Rre){if(X(e)){const i=e.map(r=>Aa(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Ua(e))return n(t?xa(e):zse(e));return t?n(je(e)):e}function Wle(e,t){for(const n of qt(e.component.selection??{})){const i=n.name;let r=`${i}${mo}, ${n.resolve==="global"?"true":`{unit: ${ta(e)}}`}`;for(const o of J0)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+yce,on:[{events:{signal:n.name+mo},update:`modify(${_e(n.name+Sa)}, ${r})`}]})}return gA(t)}function Gle(e,t){if(e.component.selection&&B(e.component.selection).length){const n=_e(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ds("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return gA(t)}function Hle(e,t){let n=!1;for(const i of qt(e.component.selection??{})){const r=i.name,o=_e(r+Sa);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:`${sL}(${o}, ${_e(a)}${u}`})}n=!0;for(const a of J0)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"}]}),gA(t)}function Vle(e,t){const n=[],i=[],r=ta(e,{escape:!1});for(const o of qt(e.component.selection??{})){const s={name:o.name+Sa};if(o.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:qi}}]),o.init){const u=o.project.items.map(q4);s.values=o.project.hasSelectionId?o.init.map(l=>({unit:r,[qi]:Aa(l,!1)[0]})):o.init.map(l=>({unit:r,fields:u,values:Aa(l,!1)}))}if([...n,...t].filter(u=>u.name===o.name+Sa).length||n.push(s),pr(o)&&t.length){const u=e.lookupDataSource(e.getDataName(it.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+B4,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function W4(e,t){for(const n of qt(e.component.selection??{}))for(const i of J0)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Yle(e,t){for(const n of e.children)nt(n)&&(t=W4(n,t));return t}function Xle(e,t,n,i){const r=yL(e,t.param,t);return{signal:Bi(n.get("type"))&&X(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function gA(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const ao={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(Doe),!o||!Bi(s)){j(koe);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||ox(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(sL))r.update=`{${i.map(s=>`${_e(bi(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${_e(bi(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&&!ox(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 rx(e,t){return`domain(${_e(e.scaleName(t))})`}function ox(e){return e.parent&&Cl(e.parent)&&(!e.parent.parent||ox(e.parent.parent))}const Au="_brush",G4="_scale_trigger",Yl="geo_interval_init_tick",H4="_init",Kle="_center",Jle={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...oa(n.select)?n.select:{}};r.fields=[qi],r.encodings||(r.encodings=n.value?B(n.value):[Ki,Xi]),n.select={type:"interval",...r}}if(t.translate&&!ao.defined(t)){const r=`!event.item || event.item.mark.name !== ${_e(t.name+Au)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=ct((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+mo,o=qt(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(Qle(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=_e(e.projectionName()),u=e.projectionName()+Kle,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?s&&s[l.index]:`${u}[0]`,g=c?s&&s[c.index]:`${u}[1]`,p=w=>e.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":p("width")}, ${d?d+"[1]":p("height")}]]`;s&&(n.unshift({name:i+H4,init:`[scale(${a}, [${l?h[0]:h}, ${c?g[0]:g}]), scale(${a}, [${l?h[1]:h}, ${c?g[1]:g}])]`}),(!l||!c)&&(n.find(A=>A.name===u)||n.unshift({name:u,update:`invert(${a}, [${p("width")}/2, ${p("height")}/2])`})));const y=`intersect(${m}, {markname: ${_e(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${ta(e)}}`,x=`vlSelectionTuples(${y}, ${b})`,v=o.map(w=>w.signals.visual);return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...s?[{signal:Yl}]:[]],update:x}]})}else{if(!ao.defined(t)){const l=i+G4,c=o.map(f=>{const d=f.channel,{data:h,visual:g}=f.signals,p=_e(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Bi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${p}, ${g})[0] === ${y}${h}[0] && ${y}invert(${p}, ${g})[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: ${ta(e)}, fields: ${i+od}, values`;return n.concat({name:r,...s?{init:`{${u}: ${Aa(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(nt(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Yl).length||n.unshift({name:Yl,value:null,on:[{events:"timer{1}",update:`${Yl} === null ? {} : ${Yl}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r==null?void 0:r.signals.visual,a=o==null?void 0:o.signals.visual,u=`data(${_e(t.name+Sa)})`;if(ao.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 B(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${ta(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=B(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),{}),p=d??(t.translate?"move":null);return[{name:`${i+Au}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Au,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function Qle(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=_e(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=ao.defined(t),g=e.getScaleComponent(o),p=g?g.get("type"):void 0,m=i?{init:Aa(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+G4},update:Bi(p)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:Aa(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===et?0:1,h=t.name+H4,g=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...g,on:f}]}}function El({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=td(t)&&t.condition;let s=[];o&&(s=ct(o).map(l=>{const c=r(l);if(zae(l)){const{param:f,empty:d}=l;return{test:mL(e,{param:f,empty:d}),...c}}else return{test:Yg(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 pA(e,t="text"){const n=e.encoding[t];return El({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>K0(i,e.config),invalidValueRef:void 0})}function K0(e,t,n="datum"){if(e){if(Ui(e))return Ye(e.value);if(fe(e)){const{format:i,formatType:r}=Ug(e);return Xw({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function V4(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(X(s))return{tooltip:cF({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return El({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=K0(l,r,a);if(c)return c;if(l===null)return;let f=Be("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),de(f))return{value:f};if(Fe(f))return Q(f)?f:f.content==="encoding"?cF(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function Y4(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=Ia(f),h=Cn(c)?c:{...c,type:e[d].type},g=h.title||Zw(h,r),p=ct(g).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=H(h,{expr:s}),v=H(b,{expr:s}),{format:w,formatType:A}=Ug(h);m=Zf(x,v,w,A,r),o.add(y)}}if((dt(f)||f===Ei||f===Yi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=Ug(h);m=Xw({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??(m=K0(h,r,s).signal),a.push({channel:f,key:p,value:m})}tA(e,(c,f)=>{q(c)?u(c,f):B0(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 cF(e,t,n,{reactiveGeom:i}={}){const r=Y4(e,t,n,{reactiveGeom:i}),o=is(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Zle(e){const{markDef:t,config:n}=e,i=Be("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...ece(e),...tce(e)}}function ece(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Be("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:gt(woe,t)?{}:{ariaRoleDescription:{value:t}}}function tce(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return El({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>K0(u,e.config),invalidValueRef:void 0});const s=Be("description",n,i);if(s!=null)return{description:Ye(s)};if(i.aria===!1)return{};const a=Y4(t,r,i);if(!Ue(a))return{description:{signal:is(a).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??(u=Be(e,i,o,{vgChannel:s,ignoreVgConfig:!td(l)})),u!==void 0&&(a=Ye(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=N6({...c,scaleChannel:e,channelDef:l});return El({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>Yw({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function X4(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Be("filled",n,r),a=we(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Be(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Be(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ye(u)}:{},...l?{stroke:Ye(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(s6("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 nce(e){const{encoding:t,mark:n}=e,i=t.order;return!vs(n)&&Ui(i)?El({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ye(r.value),invalidValueRef:void 0}):{}}function Zu({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:Yw({channel:o,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ye(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function bn(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}=Zu({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),g=mA({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),p=!u&&dt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:ice({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:h==="encoding"?0:void 0});return p?{[i||e]:p}:void 0}function ice(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(fe(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 Ig({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Zs(n,i,{suffix:"end"},{offset:o})}return Vw(e)}function mA({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=Ia(n),u=rs(n),l=Be(n,o,s,{vgChannel:u});if(l!==void 0)return Nc(n,l);switch(t){case"zeroOrMin":return fF({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return fF({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[jn(n)],mult:.5}}}}function fF({mainChannel:e,config:t,...n}){const i=R6(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 rce={left:"x",center:"xc",right:"x2"},oce={top:"y",middle:"yc",bottom:"y2"};function K4(e,t,n,i="middle"){if(e==="radius"||e==="theta")return rs(e);const r=e==="x"?"align":"baseline",o=Be(r,t,n);let s;return Q(o)?(j(ise(r)),s=void 0):s=o,e==="x"?rce[s||(i==="top"?"left":"center")]:oce[s||i]}function Gg(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?J4(e,t,{defaultPos:n,defaultPos2:i}):bn(e,t,{defaultPos:n})}function J4(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=Rr(e),a=jn(e),u=sce(t,i,s),l=u[a]?K4(e,r,o):rs(e);return{...bn(e,t,{defaultPos:n,vgChannel:l}),...u}}function sce(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=Ia(n),l=jn(n),c=rs(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:g}=n in i||n in o?Zu({channel:n,markDef:o,encoding:i,model:e}):Zu({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=jn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=ace({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:g,defaultRef:void 0});return p!==void 0?{[c]:p}:Ud(n,o)||Ud(n,{[n]:Hb(n,o,a.style),[l]:Hb(l,o,a.style)})||Ud(n,a[r])||Ud(n,a.mark)||{[c]:mA({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function ace({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return fe(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Zs(t,o,{suffix:"start"},{offset:u}):Vw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Ud(e,t){const n=jn(e),i=rs(e);if(t[i]!==void 0)return{[i]:Nc(e,t[i])};if(t[e]!==void 0)return{[i]:Nc(e,t[e])};if(t[n]){const r=t[n];if(Ea(r))j(Joe(n));else return{[n]:Nc(e,r)}}}function po(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=Rr(t),a=jn(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??Be("size",r,n,{vgChannel:a}),g=WN(t),p=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(He(u.bin)||Nt(u.bin)||u.timeUnit&&!l)&&!(h&&!Ea(h))&&!i[g]&&!Tt(f)?cce({fieldDef:u,fieldDef2:l,channel:t,model:e}):(fe(u)&&Tt(f)||p)&&!l?lce(u,t,e):J4(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function uce(e,t,n,i,r,o,s){if(Ea(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(${Mi(c)}, ${l})`:l}}else r.band!==1&&(j(ase(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(Ba(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:Zb(i.view,e)-2}}function lce(e,t,n){var C,_;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=jn(t),f=Rr(t),d=WN(t),h=n.scaleName(d),g=n.getScaleComponent(vw(t)),p=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(p?m=It("size",n,{vgChannel:c,defaultRef:Ye(i.size)}):j(fse(i.type)));const y=!!m,b=j6({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(C=l||g)==null?void 0:C.get("type"),useVlSizeChannel:p});m=m||{[c]:uce(c,h||u,g||l,o,b,!!e,i.type)};const x=((_=l||g)==null?void 0:_.get("type"))==="band"&&Ea(b)&&!y?"top":"middle",v=K4(t,i,o,x),w=v==="xc"||v==="yc",{offset:A,offsetType:E}=Zu({channel:t,markDef:i,encoding:r,model:n,bandPosition:w?.5:0}),S=Vw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:A,defaultRef:mA({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:w?E==="encoding"?0:.5:Q(b)?{signal:`(1-${b})/2`}:Ea(b)?(1-b.band)/2:0});if(c)return{[v]:S,...m};{const F=rs(f),O=m[c],T=A?{...O,offset:A}:O;return{[v]:S,[F]:X(S)?[S[0],{...S[1],offset:T}]:{...S,offset:T}}}}function dF(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=Mi(n),c=Mi(r),f=Mi(i),d=Mi(o),g=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,p=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${g})`:g;return{signal:p+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function cce({fieldDef:e,fieldDef2:t,channel:n,model:i}){var _;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=j6({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(_=i.component.axes[n])==null?void 0:_[0],h=(d==null?void 0:d.get("translate"))??.5,g=dt(n)?Be("binSpacing",o,r)??0:0,p=Rr(n),m=rs(n),y=rs(p),b=Ar("minBandSize",o,r),{offset:x}=Zu({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:v}=Zu({channel:p,markDef:o,encoding:s,model:i,bandPosition:0}),w=Oae({fieldDef:e,scaleName:u}),A=dF(n,g,c,h,x,b,w),E=dF(p,g,c,h,v??x,b,w),S=Q(f)?{signal:`(1-${f.signal})/2`}:Ea(f)?(1-f.band)/2:.5,C=os({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(He(e.bin)||e.timeUnit){const F=e.timeUnit&&C!==.5;return{[y]:hF({fieldDef:e,scaleName:u,bandPosition:S,offset:E,useRectOffsetField:F}),[m]:hF({fieldDef:e,scaleName:u,bandPosition:Q(S)?{signal:`1-${S.signal}`}:1-S,offset:A,useRectOffsetField:F})}}else if(Nt(e.bin)){const F=Zs(e,u,{},{offset:E});if(q(t))return{[y]:F,[m]:Zs(t,u,{},{offset:A})};if(za(e.bin)&&e.bin.step)return{[y]:F,[m]:{signal:`scale("${u}", ${H(e,{expr:"datum"})} + ${e.bin.step})`,offset:A}}}j(l6(p))}function hF({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Ig({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Y0,endSuffix:X0}:{}})}const fce=new Set(["aria","width","height"]);function wi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?X4(e):{};return{...dce(e.markDef,t),...gF("fill",n),...gF("stroke",i),...It("opacity",e),...It("fillOpacity",e),...It("strokeOpacity",e),...It("strokeWidth",e),...It("strokeDash",e),...nce(e),...V4(e),...pA(e,"href"),...Zle(e)}}function gF(e,t){return t?{[e]:t}:{}}function dce(e,t){return Eoe.reduce((n,i)=>(!fce.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ye(e[i])),n),{})}function yA(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!Nr(o)||!(s=e.getScaleType(o)))return;const a=k0(r.aggregate),u=Hw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(Dae(u)){const c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(o=>O0(o,!0)).join(" && ")}}}function pF(e,t){if(t!==void 0)return{[e]:Ye(t)}}const R1="voronoi",Q4={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(R1)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(vs(o))return j(_oe(o)),n;const s={name:e.getName(R1),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...V4(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(R1)&&(u=!0)}),u||n.splice(a+1,0,s),n}},Z4={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!aA(e.bind),parse:(e,t,n)=>aL(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=Q4.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:Aa(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${_e(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+mo),s=i+od,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}},Hg="_toggle",eL={defined:e=>e.type==="point"&&!pr(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Hg,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+mo,i=t.name+Hg;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${ta(e)}}, `)+`${i} ? ${n} : null`}},hce={defined:e=>e.clear!==void 0&&e.clear!==!1&&!pr(e),parse:(e,t)=>{t.clear&&(t.clear=de(t.clear)?ds(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(Z4.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+mo);i(r,"null"),eL.defined(t)&&(r=n.findIndex(o=>o.name===t.name+Hg),i(r,"false"))}return n}},tL={defined:e=>{const t=e.resolve==="global"&&e.bind&&aA(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==qi;return t&&!n&&j(Toe),t&&n},parse:(e,t,n)=>{const i=ce(n);if(i.select=de(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},aL(t,i),oa(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=F1(t.bind)?t.bind.legend:"click",o=de(r)?ds(r,"view"):ct(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=F1(t.bind)&&t.bind.legend,o=s=>a=>{const u=ce(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+mo),s=i+od,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+Hg),f=F1(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function gce(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const o of qt(e.component.selection??{})){const s=o.project.hasField[i]??o.project.hasChannel[t];if(s&&tL.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const nL="_translate_anchor",iL="_translate_delta",pce={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+nL,{x:s,y:a}=t.project.hasChannel;let u=ds(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Au,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?rx(e,et):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?rx(e,Ot):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+iL,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&mF(e,t,s,"width",n),a!==void 0&&mF(e,t,a,"height",n),n}};function mF(e,t,n,i,r){const o=t.name,s=o+nL,a=o+iL,u=n.channel,l=ao.defined(t),c=r.find(w=>w.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),g=d&&d.get("reverse"),p=l?u===et?g?"":"-":g?"-":"":"",m=`${s}.extent_${u}`,y=`${p}${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 rL="_zoom_anchor",oL="_zoom_delta",mce={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+oL,{x:s,y:a}=t.project.hasChannel,u=_e(e.scaleName(et)),l=_e(e.scaleName(Ot));let c=ds(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Au,f))),n.push({name:i+rL,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&&yF(e,t,s,"width",n),a!==void 0&&yF(e,t,a,"height",n),n}};function yF(e,t,n,i,r){const o=t.name,s=n.channel,a=ao.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?rx(e,s):u.name,h=o+oL,g=`${o}${rL}.${s}`,p=!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=`${p}(${d}, ${g}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Sa="_store",mo="_tuple",yce="_modify",sL="vlSelectionResolve",J0=[qle,Jle,Ble,eL,Z4,ao,tL,hce,pce,mce,Q4];function bce(e){let t=e.parent;for(;t&&!Zn(t);)t=t.parent;return t}function ta(e,{escape:t}={escape:!0}){let n=t?_e(e.name):e.name;const i=bce(e);if(i){const{facet:r}=i;for(const o of di)r[o]&&(n+=` + '__facet_${o}_' + (facet[${_e(i.vgField(o))}])`)}return n}function bA(e){return qt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function aL(e,t){(to(t.select)||!t.select.on)&&delete e.events,(to(t.select)||!t.select.clear)&&delete e.clear,(to(t.select)||!t.select.toggle)&&delete e.toggle}function pr(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}const xce="RawCode",vce="Literal",Ece="Property",wce="Identifier",Ace="ArrayExpression",Sce="BinaryExpression",Cce="CallExpression",$ce="ConditionalExpression",_ce="LogicalExpression",Fce="MemberExpression",kce="ObjectExpression",Dce="UnaryExpression";function Qi(e){this.type=e}Qi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Tce(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function Tce(e){switch(e.type){case Ace:return e.elements;case Sce:case _ce:return[e.left,e.right];case Cce:return[e.callee].concat(e.arguments);case $ce:return[e.test,e.consequent,e.alternate];case Fce:return[e.object,e.property];case kce:return e.properties;case Ece:return[e.key,e.value];case Dce:return[e.argument];case wce:case vce:case xce:default:return[]}}var Pr,J,N,sn,Ie,Q0=1,sd=2,Ca=3,Es=4,Z0=5,Wa=6,Dn=7,ad=8,Mce=9;Pr={};Pr[Q0]="Boolean";Pr[sd]="<end>";Pr[Ca]="Identifier";Pr[Es]="Keyword";Pr[Z0]="Null";Pr[Wa]="Numeric";Pr[Dn]="Punctuator";Pr[ad]="String";Pr[Mce]="RegularExpression";var Oce="ArrayExpression",Rce="BinaryExpression",Nce="CallExpression",Lce="ConditionalExpression",uL="Identifier",Pce="Literal",Ice="LogicalExpression",zce="MemberExpression",Bce="ObjectExpression",Uce="Property",jce="UnaryExpression",kt="Unexpected token %0",qce="Unexpected number",Wce="Unexpected string",Gce="Unexpected identifier",Hce="Unexpected reserved word",Vce="Unexpected end of input",sx="Invalid regular expression",N1="Invalid regular expression: missing /",lL="Octal literals are not allowed in strict mode.",Yce="Duplicate data property in object literal not allowed in strict mode",Ut="ILLEGAL",ff="Disabled.",Xce=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]"),Kce=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 em(e,t){if(!e)throw new Error("ASSERT: "+t)}function Gr(e){return e>=48&&e<=57}function xA(e){return"0123456789abcdefABCDEF".includes(e)}function Lc(e){return"01234567".includes(e)}function Jce(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 df(e){return e===10||e===13||e===8232||e===8233}function ud(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Xce.test(String.fromCharCode(e))}function Vg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Kce.test(String.fromCharCode(e))}const Qce={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 cL(){for(;N<sn;){const e=J.charCodeAt(N);if(Jce(e)||df(e))++N;else break}}function ax(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)N<sn&&xA(J[N])?(i=J[N++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):De({},kt,Ut);return String.fromCharCode(r)}function Zce(){var e,t,n,i;for(e=J[N],t=0,e==="}"&&De({},kt,Ut);N<sn&&(e=J[N++],!!xA(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&De({},kt,Ut),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function fL(){var e,t;for(e=J.charCodeAt(N++),t=String.fromCharCode(e),e===92&&(J.charCodeAt(N)!==117&&De({},kt,Ut),++N,e=ax("u"),(!e||e==="\\"||!ud(e.charCodeAt(0)))&&De({},kt,Ut),t=e);N<sn&&(e=J.charCodeAt(N),!!Vg(e));)++N,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),J.charCodeAt(N)!==117&&De({},kt,Ut),++N,e=ax("u"),(!e||e==="\\"||!Vg(e.charCodeAt(0)))&&De({},kt,Ut),t+=e);return t}function efe(){var e,t;for(e=N++;N<sn;){if(t=J.charCodeAt(N),t===92)return N=e,fL();if(Vg(t))++N;else break}return J.slice(e,N)}function tfe(){var e,t,n;return e=N,t=J.charCodeAt(N)===92?fL():efe(),t.length===1?n=Ca:Qce.hasOwnProperty(t)?n=Es:t==="null"?n=Z0:t==="true"||t==="false"?n=Q0:n=Ca,{type:n,value:t,start:e,end:N}}function L1(){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==="//"&&De({},kt,Ut),"<>=!+-*%&|^/".includes(i))return++N,{type:Dn,value:i,start:e,end:N};De({},kt,Ut)}function nfe(e){let t="";for(;N<sn&&xA(J[N]);)t+=J[N++];return t.length===0&&De({},kt,Ut),ud(J.charCodeAt(N))&&De({},kt,Ut),{type:Wa,value:parseInt("0x"+t,16),start:e,end:N}}function ife(e){let t="0"+J[N++];for(;N<sn&&Lc(J[N]);)t+=J[N++];return(ud(J.charCodeAt(N))||Gr(J.charCodeAt(N)))&&De({},kt,Ut),{type:Wa,value:parseInt(t,8),octal:!0,start:e,end:N}}function bF(){var e,t,n;if(n=J[N],em(Gr(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,nfe(t);if(Lc(n))return ife(t);n&&Gr(n.charCodeAt(0))&&De({},kt,Ut)}for(;Gr(J.charCodeAt(N));)e+=J[N++];n=J[N]}if(n==="."){for(e+=J[N++];Gr(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++]),Gr(J.charCodeAt(N)))for(;Gr(J.charCodeAt(N));)e+=J[N++];else De({},kt,Ut);return ud(J.charCodeAt(N))&&De({},kt,Ut),{type:Wa,value:parseFloat(e),start:t,end:N}}function rfe(){var e="",t,n,i,r,o=!1;for(t=J[N],em(t==="'"||t==='"',"String literal must starts with a quote"),n=N,++N;N<sn;)if(i=J[N++],i===t){t="";break}else if(i==="\\")if(i=J[N++],!i||!df(i.charCodeAt(0)))switch(i){case"u":case"x":J[N]==="{"?(++N,e+=Zce()):e+=ax(i);break;case"n":e+=`
15
+ ${a}`)}return l}(e,"",0)}function xre(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 vre={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},Ere={"*":(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},wre={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Are=Array.prototype.slice,_s=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Are.call(t,1))},Sre=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var Cre={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:Sre,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return _s("join",arguments)},indexof:function(){return _s("indexOf",arguments)},lastindexof:function(){return _s("lastIndexOf",arguments)},slice:function(){return _s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return _s("substring",arguments,String)},split:function(){return _s("split",arguments,String)},replace:function(){return _s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const $re=["view","item","group","xy","x","y"],jb=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&jb.add(setImmediate);const _re={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:vre[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),jb.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]||Cre[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Ere[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>wre[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);return e.memberDepth-=1,jb.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Vl(e,t,n,i,r,o){const s=a=>_re[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,$re.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var Fre={operator(e,t){const n=t.ast,i=e.functions;return r=>Vl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Vl(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Vl(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 Vl(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=Vl(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&xre(s,i,o),l}}};const kre="5.23.0",Dre={version:kre};function yl(e,t,n){return e.fields=t||[],e.fname=n,e}function Tre(e){return e.length===1?Mre(e[0]):Ore(e)}const Mre=e=>function(t){return t[e]},Ore=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function A1(e){throw Error(e)}function La(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||A1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&A1("Access path missing closing bracket: "+e),i&&A1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Rre(e,t,n){const i=La(e);return e=i.length===1?i[0]:e,yl(Tre(i),[e],e)}Rre("id");const Nre=yl(e=>e,[],"identity");yl(()=>0,[],"zero");yl(()=>1,[],"one");yl(()=>!0,[],"true");yl(()=>!1,[],"false");function Lre(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Pre=0,Ire=1,CN=2,zre=3,Bre=4;function Ure(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lre,i=e||Pre;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Ire&&n("error","ERROR",arguments),this},warn(){return i>=CN&&n("warn","WARN",arguments),this},info(){return i>=zre&&n("log","INFO",arguments),this},debug(){return i>=Bre&&n("log","DEBUG",arguments),this}}}var X=Array.isArray;function Fe(e){return e===Object(e)}const C_=e=>e!=="__proto__";function $N(){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=jre(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;E0(i,o,r[o],s)}return i},{})}function E0(e,t,n,i){if(!C_(t))return;let r,o;if(Fe(n)&&!X(n)){o=Fe(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?E0(o,r,n[r]):C_(r)&&(o[r]=n[r])}else e[t]=n}function jre(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 qre(e){return typeof e=="function"}const Wre=Object.prototype.hasOwnProperty;function gt(e,t){return Wre.call(e,t)}function Hf(e){return typeof e=="boolean"}function Ze(e){return typeof e=="number"}function de(e){return typeof e=="string"}function _e(e){return X(e)?"["+e.map(_e)+"]":Fe(e)||de(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function cw(e){return U(e,"or")}function fw(e){return U(e,"and")}function dw(e){return U(e,"not")}function wh(e,t){if(dw(e))wh(e.not,t);else if(fw(e))for(const n of e.and)wh(n,t);else if(cw(e))for(const n of e.or)wh(n,t);else t(e)}function vu(e,t){return dw(e)?{not:vu(e.not,t)}:fw(e)?{and:e.and.map(n=>vu(n,t))}:cw(e)?{or:e.or.map(n=>vu(n,t))}:t(e)}const ce=structuredClone;function _N(e){throw new Error(e)}function qu(e,t){const n={};for(const i of t)gt(e,i)&&(n[i]=e[i]);return n}function Rn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>je(e)).join(",")})`};function Ae(e){if(Ze(e))return e;const t=de(e)?e:je(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 qb(e){return e===!1||e===null}function we(e,t){return e.includes(t)}function Wu(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function hw(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function FN(e,...t){for(const n of t)Gre(e,n??{});return e}function Gre(e,t){for(const n of B(t))E0(e,n,t[n],!0)}function cr(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 Hre(e,t){const n=B(e),i=B(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function kN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gw(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=La(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 pw(e,t){return e===void 0||t===void 0?!0:gw(Wb(e),Wb(t))}function Ue(e){return B(e).length===0}const B=Object.keys,qt=Object.values,is=Object.entries;function af(e){return e===!0||e===!1}function Qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Rc(e,t){return dw(e)?`!(${Rc(e.not,t)})`:fw(e)?`(${e.and.map(n=>Rc(n,t)).join(") && (")})`:cw(e)?`(${e.or.map(n=>Rc(n,t)).join(") || (")})`:t(e)}function Ng(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Ng(e[n],t)&&delete e[n],Ue(e)}function Vf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function mw(e,t="datum"){const n=La(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(_e).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function DN(e,t="datum"){return`${t}[${_e(La(e).join("."))}]`}function Le(e){return`datum['${e.replaceAll("'","\\'")}']`}function Vre(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function bi(e){return`${La(e).map(Vre).join("\\.")}`}function ma(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function bl(e){return`${La(e).join(".")}`}function Gu(e){return e?La(e).length:0}function ft(...e){return e.find(t=>t!==void 0)}let TN=42;function MN(e){const t=++TN;return e?String(e)+t:t}function Yre(){TN=42}function ON(e){return RN(e)?e:`__${e}`}function RN(e){return e.startsWith("__")}function uf(e){if(e!==void 0)return(e%360+360)%360}function w0(e){return Ze(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const $_=Object.getPrototypeOf(structuredClone({}));function Xn(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(!Xn(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(!Xn(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!==$_.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==$_.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(!Xn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function je(e){const t=[];return function n(i){if(i&&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 Fe(e)&&gt(e,t)&&e[t]!==void 0}const ro="row",oo="column",A0="facet",et="x",Mt="y",Vi="x2",Tr="y2",hs="xOffset",xl="yOffset",Yi="radius",vo="radius2",Ei="theta",Eo="theta2",Xi="latitude",Ki="longitude",Ji="latitude2",xi="longitude2",gs="time",Bn="color",Mr="fill",Or="stroke",Un="shape",wo="size",Pa="angle",Ao="opacity",ps="fillOpacity",ms="strokeOpacity",ys="strokeWidth",bs="strokeDash",Yf="text",Hu="order",Xf="detail",S0="key",ya="tooltip",C0="href",$0="url",_0="description",Xre={x:1,y:1,x2:1,y2:1},NN={theta:1,theta2:1,radius:1,radius2:1};function LN(e){return gt(NN,e)}const yw={longitude:1,longitude2:1,latitude:1,latitude2:1};function PN(e){switch(e){case Xi:return"y";case Ji:return"y2";case Ki:return"x";case xi:return"x2"}}function IN(e){return gt(yw,e)}const Kre=B(yw),bw={...Xre,...NN,...yw,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 Eu(e){return e===Bn||e===Mr||e===Or}const zN={row:1,column:1,facet:1},di=B(zN),xw={...bw,...zN},Jre=B(xw),{order:ome,detail:sme,tooltip:ame,...Qre}=xw,{row:ume,column:lme,facet:cme,...Zre}=Qre;function eoe(e){return gt(Zre,e)}function BN(e){return gt(xw,e)}const toe=[Vi,Tr,Ji,xi,Eo,vo];function UN(e){return Ia(e)!==e}function Ia(e){switch(e){case Vi:return et;case Tr:return Mt;case Ji:return Xi;case xi:return Ki;case Eo:return Ei;case vo:return Yi}return e}function rs(e){if(LN(e))switch(e){case Ei:return"startAngle";case Eo:return"endAngle";case Yi:return"outerRadius";case vo:return"innerRadius"}return e}function Rr(e){switch(e){case et:return Vi;case Mt:return Tr;case Xi:return Ji;case Ki:return xi;case Ei:return Eo;case Yi:return vo}}function jn(e){switch(e){case et:case Vi:return"width";case Mt:case Tr:return"height"}}function jN(e){switch(e){case et:return"xOffset";case Mt:return"yOffset";case Vi:return"x2Offset";case Tr:return"y2Offset";case Ei:return"thetaOffset";case Yi:return"radiusOffset";case Eo:return"theta2Offset";case vo:return"radius2Offset"}}function vw(e){switch(e){case et:return"xOffset";case Mt:return"yOffset"}}function noe(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const ioe=B(bw),{x:fme,y:dme,x2:hme,y2:gme,xOffset:pme,yOffset:mme,latitude:yme,longitude:bme,latitude2:xme,longitude2:vme,theta:Eme,theta2:wme,radius:Ame,radius2:Sme,...Ew}=bw,roe=B(Ew),ww={x:1,y:1},So=B(ww);function dt(e){return gt(ww,e)}const Aw={theta:1,radius:1},ooe=B(Aw);function F0(e){return e==="width"?et:Mt}const qN={xOffset:1,yOffset:1};function Kf(e){return gt(qN,e)}const soe={time:1};function S1(e){return e in soe}const{text:Cme,tooltip:$me,href:_me,url:Fme,description:kme,detail:Dme,key:Tme,order:Mme,...WN}=Ew,aoe=B(WN);function uoe(e){return gt(Ew,e)}function loe(e){switch(e){case Bn:case Mr:case Or:case wo:case Un:case Ao:case ys:case bs:return!0;case ps:case ms:case Pa:case gs:return!1}}const GN={...ww,...Aw,...qN,...WN},Sw=B(GN);function Nr(e){return gt(GN,e)}function coe(e,t){return doe(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:Ome,...foe}=HN;function doe(e){switch(e){case Bn:case Mr:case Or:case _0:case Xf:case S0:case ya:case C0:case Hu:case Ao:case ps:case ms:case ys:case A0:case ro:case oo:return HN;case et:case Mt:case hs:case xl:case Xi:case Ki:case gs:return foe;case Vi:case Tr:case Ji:case xi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case wo:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case bs:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Un:return{point:"always",geoshape:"always"};case Yf:return{text:"always"};case Pa:return{point:"always",square:"always",text:"always"};case $0:return{image:"always"};case Ei:return{text:"always",arc:"always"};case Yi:return{text:"always",arc:"always"};case Eo:case vo:return{arc:"always"}}}function C1(e){switch(e){case et:case Mt:case Ei:case Yi:case hs:case xl:case wo:case Pa:case ys:case Ao:case ps:case ms:case gs:case Vi:case Tr:case Eo:case vo:return;case A0:case ro:case oo:case Un:case bs:case Yf:case ya:case C0:case $0:case _0:return"discrete";case Bn:case Mr:case Or:return"flexible";case Xi:case Ki:case Ji:case xi:case Xf:case S0:case Hu:return}}const hoe={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},goe={count:1,min:1,max:1};function go(e){return U(e,"argmin")}function xs(e){return U(e,"argmax")}function Cw(e){return de(e)&&gt(hoe,e)}const poe=new Set(["count","valid","missing","distinct"]);function k0(e){return de(e)&&poe.has(e)}function moe(e){return de(e)&&we(["min","max"],e)}const yoe=new Set(["count","sum","distinct","valid","missing"]),boe=new Set(["mean","average","median","q1","q3","min","max"]);function VN(e){return Hf(e)&&(e=U0(e,void 0)),"bin"+B(e).map(t=>D0(e[t])?Qe(`_${t}_${is(e[t])}`):Qe(`_${t}_${e[t]}`)).join("")}function He(e){return e===!0||za(e)&&!e.binned}function Nt(e){return e==="binned"||za(e)&&e.binned===!0}function za(e){return Fe(e)}function D0(e){return U(e,"param")}function __(e){switch(e){case ro:case oo:case wo:case Bn:case Mr:case Or:case ys:case Ao:case ps:case ms:case Un:return 6;case bs:return 4;default:return 10}}function Jf(e){return U(e,"expr")}function Lt(e,{level:t}={level:0}){const n=B(e||{}),i={};for(const r of n)i[r]=t===0?Vn(e[r]):Lt(e[r],{level:t-1});return i}function YN(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:g,...p}=e,m={...p,...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}:{},...g?{subtitlePadding:g}:{}},x=qu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:y,subtitle:b}}function Ro(e){return de(e)||X(e)&&de(e[0])}function Q(e){return U(e,"signal")}function Ba(e){return U(e,"step")}function xoe(e){return X(e)?!1:U(e,"fields")&&!U(e,"data")}function voe(e){return X(e)?!1:U(e,"fields")&&U(e,"data")}function eo(e){return X(e)?!1:U(e,"field")&&U(e,"data")}const Eoe={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},woe=B(Eoe),Aoe={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Gb=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function XN(e){const t=X(e.condition)?e.condition.map(F_):F_(e.condition);return{...Vn(e),condition:t}}function Vn(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function F_(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ye(e){if(Jf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Q(e)?e:e!==void 0?{value:e}:void 0}function Soe(e){return Q(e)?e.signal:_e(e)}function k_(e){return Q(e)?e.signal:_e(e.value)}function Mi(e){return Q(e)?e.signal:e==null?null:_e(e)}function Coe(e,t,n){for(const i of n){const r=Ar(i,t.markDef,t.config);r!==void 0&&(e[i]=Ye(r))}return e}function KN(e){return[].concat(e.type,e.style??[])}function Be(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=Hb(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 Hb(e,t,n){return JN(e,KN(t),n)}function JN(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 QN(e,t){return ct(e).reduce((n,i)=>(n.field.push(H(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function ZN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Xn(r,i))return;n.push(i)}),n}function e6(e,t){return Xn(e,t)||!t?e:e?[...ct(e),...ct(t)].join(", "):t}function t6(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Ro(n)||Q(n))&&(Ro(i)||Q(i)))return{explicit:e.explicit,value:e6(n,i)};if(Ro(n)||Q(n))return{explicit:e.explicit,value:n};if(Ro(i)||Q(i))return{explicit:e.explicit,value:i};if(!Ro(n)&&!Q(n)&&!Ro(i)&&!Q(i))return{explicit:e.explicit,value:ZN(n,i)};throw new Error("It should never reach here")}function $w(e){return`Invalid specification ${je(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const $oe='Autosize "fit" only works for single views and layered views.';function D_(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function T_(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 M_(e){return e?`Dropping "fit-${e}" because spec has discrete ${jn(e)}.`:'Dropping "fit" because spec has discrete size.'}function _w(e){return`Unknown field for ${e}. Cannot calculate view size.`}function O_(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function _oe(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Foe(e){return`The "nearest" transform is not supported for ${e} marks.`}function n6(e){return`Selection not supported for ${e} yet.`}function koe(e){return`Cannot find a selection named "${e}".`}const Doe="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Toe="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Moe="Legend bindings are only supported for selections over an individual field or encoding channel.";function Ooe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Roe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Noe="The same selection must be used to override scale domains in a layered view.",Loe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Poe(e){return`Unknown repeated value "${e}".`}function R_(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Ioe="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",Fw="Animation involving facet, layer, or concat is currently unsupported.";function zoe(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${pu(e)}.`}function Boe(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${pu(t)} encoding found for selection ${pu(n.param)}. Using "field": ${pu(i)}.`}const Uoe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function joe(e){return`Unrecognized parse "${e}".`}function N_(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const qoe="Attempt to add the same child twice.";function Woe(e){return`Ignoring an invalid transform: ${je(e)}.`}const Goe='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 L_(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Hoe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${je(t)} is overridden by a child projection ${je(n)}.`}const Voe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Yoe(e){return`${e}Offset dropped because ${e} is continuous`}function Xoe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${je(n)}}.`}function i6(e){return`Invalid field type "${e}".`}function Koe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Joe(e){return`Invalid aggregation operator "${e}".`}function r6(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 Qoe(e){return`Position range does not support relative band size for ${e}.`}function Vb(e,t){return`Dropping ${je(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Zoe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function T0(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function ese(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function tse(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function nse(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function ise(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function $1(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function rse(e){return`The ${e} for range marks cannot be an expression`}function ose(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 sse(e,t){return`Specified orient "${e}" overridden with "${t}".`}function ase(e){return`Cannot use the scale property "${e}" with non-color channel.`}function use(e){return`Cannot use the relative band size with ${e} scale.`}function lse(e){return`Using unaggregated domain with raw field has no effect (${je(e)}).`}function cse(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function fse(e){return`Unaggregated domain is currently unsupported for log scale (${je(e)}).`}function dse(e){return`Cannot apply size to non-oriented mark "${e}".`}function hse(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function gse(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function o6(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function s6(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function pse(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${je(n)} and ${je(i)}). Using ${je(n)}.`}function mse(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${je(n)} and ${je(i)}). Using the union of the two domains.`}function yse(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 bse(e){return`Dropping sort property ${je(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const P_="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",xse="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.",vse="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.",Ese="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 wse(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Ase(e){return`Stack is applied to a non-linear scale (${e}).`}function Sse(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Lg(e,t){return`Invalid ${e}: ${je(t)}.`}function Cse(e){return`Dropping day from datetime ${je(e)} as day cannot be combined with other units.`}function $se(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function _se(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Fse(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function I_(e){return`1D error band does not support ${e}.`}function a6(e){return`Channel ${e} is required for "binned" bin.`}function kse(e){return`Channel ${e} should not be used with "binned" bin.`}function Dse(e){return`Domain for ${e} is required for threshold scale.`}const u6=Ure(CN);let ba=u6;function Tse(e){return ba=e,ba}function Mse(){return ba=u6,ba}function kw(...e){ba.error(...e)}function j(...e){ba.warn(...e)}function Ose(...e){ba.debug(...e)}function Ua(e){if(e&&Fe(e)){for(const t of Tw)if(U(e,t))return!0}return!1}const l6=["january","february","march","april","may","june","july","august","september","october","november","december"],Rse=l6.map(e=>e.substr(0,3)),c6=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Nse=c6.map(e=>e.substr(0,3));function Lse(e){if(w0(e)&&(e=+e),Ze(e))return e>4&&j(Lg("quarter",e)),e-1;throw new Error(Lg("quarter",e))}function Pse(e){if(w0(e)&&(e=+e),Ze(e))return e-1;{const t=e.toLowerCase(),n=l6.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Rse.indexOf(i);if(r!==-1)return r;throw new Error(Lg("month",e))}}function Ise(e){if(w0(e)&&(e=+e),Ze(e))return e%7;{const t=e.toLowerCase(),n=c6.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Nse.indexOf(i);if(r!==-1)return r;throw new Error(Lg("day",e))}}function Dw(e,t){const n=[];if(t&&e.day!==void 0&&B(e).length>1&&(j(Cse(e)),e=ce(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Pse(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Lse(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?Ise(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 xa(e){const n=Dw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function zse(e){const n=Dw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Bse(e){const t=Dw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const f6={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Tw=B(f6);function Use(e){return Hr(f6,e)}function ja(e){return Fe(e)?e.binned:d6(e)}function d6(e){return e&&e.startsWith("binned")}function Mw(e){return e.startsWith("utc")}function jse(e){return e.substring(3)}const qse={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function M0(e){return Tw.filter(t=>g6(e,t))}function h6(e){const t=M0(e);return t[t.length-1]}function g6(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 Wse(e,t,{end:n}={end:!1}){const i=mw(t),r=Mw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of Tw)g6(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),zse(a)}function p6(e){if(!e)return;const t=M0(e);return`timeUnitSpecifier(${je(t)}, ${je(qse)})`}function Gse(e,t,n){if(!e)return;const i=p6(e);return`${n||Mw(e)?"utc":"time"}Format(${t}, ${i})`}function kt(e){if(!e)return;let t;return de(e)?d6(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Fe(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Mw(t.unit)&&(t.utc=!0,t.unit=jse(t.unit)),t}function Hse(e){const{utc:t,...n}=kt(e);return n.unit?(t?"utc":"")+B(n).map(i=>Qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+B(n).map(i=>Qe(`_${i}_${n[i]}`)).join("")}function m6(e,t=n=>n){const n=kt(e),i=h6(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}=y6(i,n.step),a={...r,[s]:+r[s]+o};return`${t(xa(a))} - ${t(xa(r))}`}}const Vse={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Yse(e){return Hr(Vse,e)}function y6(e,t=1){if(Yse(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 Xse(e){return U(e,"param")}function Ow(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Rw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Nw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Lw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Pw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Iw(e){if(e!=null&&e.field){if(X(e.range)&&e.range.length===2)return!0;if(Q(e.range))return!0}return!1}function zw(e){return!!(e!=null&&e.field)&&(X(e.oneOf)||X(e.in))}function Kse(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function b6(e){return zw(e)||Ow(e)||Iw(e)||Rw(e)||Lw(e)||Nw(e)||Pw(e)}function nr(e,t){return j0(e,{timeUnit:t,wrapTime:!0})}function Jse(e,t){return e.map(n=>nr(n,t))}function x6(e,t=!0){const{field:n}=e,i=kt(e.timeUnit),{unit:r,binned:o}=i||{},s=H(e,{expr:"datum"}),a=r?`time(${o?s:Wse(r,n)})`:s;if(Ow(e))return`${a}===${nr(e.equal,r)}`;if(Rw(e)){const u=e.lt;return`${a}<${nr(u,r)}`}else if(Lw(e)){const u=e.gt;return`${a}>${nr(u,r)}`}else if(Nw(e)){const u=e.lte;return`${a}<=${nr(u,r)}`}else if(Pw(e)){const u=e.gte;return`${a}>=${nr(u,r)}`}else{if(zw(e))return`indexof([${Jse(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Kse(e))return O0(a,e.valid);if(Iw(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+", ["+nr(l,r)+", "+nr(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${nr(l,r)}`),c!==null&&f.push(`${a} <= ${nr(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${je(e)}`)}function O0(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Qse(e){return b6(e)&&e.timeUnit?{...e,timeUnit:kt(e.timeUnit)}:e}const Qf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Zse(e){return e==="quantitative"||e==="temporal"}function v6(e){return e==="ordinal"||e==="nominal"}const va=Qf.quantitative,Bw=Qf.ordinal,Vu=Qf.temporal,Uw=Qf.nominal,vl=Qf.geojson;function eae(e){if(e)switch(e=e.toLowerCase(),e){case"q":case va:return"quantitative";case"t":case Vu:return"temporal";case"o":case Bw:return"ordinal";case"n":case Uw:return"nominal";case vl:return"geojson"}}const Pt={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Yb={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 tae(e,t){const n=Yb[e],i=Yb[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const nae={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 z_(e){return nae[e]}const E6=new Set(["linear","log","pow","sqrt","symlog"]),w6=new Set([...E6,"time","utc"]);function A6(e){return E6.has(e)}const S6=new Set(["quantile","quantize","threshold"]),iae=new Set([...w6,...S6,"sequential","identity"]),rae=new Set(["ordinal","bin-ordinal","point","band"]);function Dt(e){return rae.has(e)}function Bi(e){return iae.has(e)}function fr(e){return w6.has(e)}function Yu(e){return S6.has(e)}const oae={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 sae(e){return!de(e)&&U(e,"name")}function C6(e){return U(e,"param")}function aae(e){return U(e,"unionWith")}function uae(e){return Fe(e)&&"field"in e}const lae={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:Rme,domain:Nme,range:Lme,rangeMax:Pme,rangeMin:Ime,scheme:zme,...cae}=lae,fae=B(cae);function Xb(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 fr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return fr(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 fr(e);case"nice":return fr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Bi(e)&&!we(["log","time","utc","threshold","quantile"],e)}}function $6(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Eu(e)?void 0:ase(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 dae(e,t){return we([Bw,Uw],t)?e===void 0||Dt(e):t===Vu?we([Pt.TIME,Pt.UTC,void 0],e):t===va?A6(e)||Yu(e)||e===void 0:!0}function hae(e,t,n=!1){if(!Nr(e))return!1;switch(e){case et:case Mt:case hs:case xl:case Ei:case Yi:return fr(t)||t==="band"?!0:t==="point"?!n:!1;case gs:return we(["linear","band"],t);case wo:case ys:case Ao:case ps:case ms:case Pa:return fr(t)||Yu(t)||we(["band","point","ordinal"],t);case Bn:case Mr:case Or:return t!=="band";case bs:case Un:return t==="ordinal"||Yu(t)}}function gae(e){return Fe(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"},_6=_n.arc,R0=_n.area,N0=_n.bar,pae=_n.image,L0=_n.line,P0=_n.point,mae=_n.rect,Pg=_n.rule,F6=_n.text,jw=_n.tick,yae=_n.trail,qw=_n.circle,Ww=_n.square,k6=_n.geoshape;function vs(e){return["line","area","trail"].includes(e)}function lf(e){return["rect","bar","image","arc","tick"].includes(e)}const bae=new Set(B(_n));function Sr(e){return U(e,"type")}const xae=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],vae=["fill","fillOpacity"],Eae=[...xae,...vae],wae={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},B_=B(wae),_1=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Aae={area:["line","point"],bar:_1,rect:_1,line:["point"],tick:["bandSize","thickness",..._1]},Sae={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Cae={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},D6=B(Cae);function Ea(e){return U(e,"band")}const $ae={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},_ae=5,Gw={binSpacing:0,continuousBandSize:_ae,minBandSize:.25,timeUnitBandPosition:.5},Fae={...Gw,binSpacing:1},kae={...Gw,thickness:1};function Dae(e){return Sr(e)?e.type:e}function T6(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Hw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Bi(i)||r)return"always-valid";const o=T6(Be("invalid",e,t),{isPath:vs(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function Tae(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function M6({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 O6({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=ji(t),u=k0(a==null?void 0:a.aggregate),l=Hw({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const f=((c=o.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:O0(H(a,{expr:"datum"}),!1),...Mae(f,n,i)}}}function Mae(e,t,n){if(gae(e)){const{value:i}=e;return Q(i)?{signal:i.signal}:{value:i}}return M6({scale:t,scaleName:n,mode:"zeroOrMin"})}function Vw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=Ia(t),u=Yw(e),l=O6({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function Oae(e){const{datum:t}=e;return Ua(t)?xa(t):`${je(t)}`}function Zs(e,t,n,i){const r={};if(t&&(r.scale=t),Lr(e)){const{datum:o}=e;Ua(o)?r.signal=xa(o):Q(o)?r.signal=o.signal:Jf(o)?r.signal=o.expr:r.value=o}else r.field=H(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function Ig({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=H(t,{expr:a,suffix:r}),l=n!==void 0?H(n,{expr:a}):H(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 Rae({scaleName:e,fieldDef:t}){const n=H(t,{expr:"datum"}),i=H(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function Yw({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(fe(t)){const f=s==null?void 0:s.get("type");if(Cn(t)){c??(c=os({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(He(d)||c&&h&&g===Vu)return a!=null&&a.impute?Zs(t,o,{binSuffix:"mid"},{offset:u}):c&&!Dt(f)?Ig({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Zs(t,o,id(t,e)?{binSuffix:"range"}:{},{offset:u});if(Nt(d)){if(q(n))return Ig({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(a6(e===et?Vi:Tr))}}return Zs(t,o,Dt(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{...Nc(e,f),...d}}}return qre(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Nc(e,t){return we(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:we(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ye(t)}function wa(e){return e&&e!=="number"&&e!=="time"}function R6(e,t,n){return`${e}(${t}${n?`, ${je(n)}`:""})`}const Nae=" – ";function Xw({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(wa(n))return Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=N6(e,i,r),a=Xu(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return Oi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return Oi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return Oi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(Ju(e)){const c=Pae({field:s,timeUnit:q(e)?(u=kt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:qa(e)&&((l=e.scale)==null?void 0:l.type)===Pt.UTC});return c?{signal:c}:void 0}if(t=Kb({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&He(e.bin)){const c=H(e,{expr:i,binSuffix:"end"});return{signal:Zf(s,c,t,n,o)}}else return t||Xu(e)==="quantitative"?{signal:`${I6(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function N6(e,t,n){return q(e)?n?`${H(e,{expr:t,suffix:"end"})}-${H(e,{expr:t,suffix:"start"})}`:H(e,{expr:t}):Oae(e)}function Oi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=N6(e,i,r)),s!=="datum.value"&&q(e)&&He(e.bin)){const a=H(e,{expr:i,binSuffix:"end"});return{signal:Zf(s,a,t,n,o)}}return{signal:R6(n,s,t)}}function L6(e,t,n,i,r,o){var s;if(!(de(i)&&wa(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&Xu(e)==="quantitative"&&(r.normalizedNumberFormatType&&Ku(e)&&e.stack==="normalize"||r.numberFormatType))){if(Ku(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return Kb({type:"quantitative",config:r,normalizeStack:!0});if(Ju(e)){const a=q(e)?(s=kt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Lae({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return Kb({type:t,specifiedFormat:n,config:r})}}function P6(e,t,n){var i;if(e&&(Q(e)||e==="number"||e==="time"))return e;if(Ju(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=kt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function Kb({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(de(t))return t;if(e===va)return i?n.normalizedNumberFormat:n.numberFormat}function Lae({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:p6(t)}:i?void 0:n.timeFormat)}function I6(e,t){return`format(${e}, "${t||""}")`}function U_(e,t,n,i){return wa(n)?R6(n,e,t):I6(e,(de(t)?t:void 0)??i.numberFormat)}function Zf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Zf(e,t,r.numberFormat,r.numberFormatType,r);const o=U_(e,n,i,r),s=U_(t,n,i,r);return`${O0(e,!1)} ? "null" : ${o} + "${Nae}" + ${s}`}function Pae({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=de(n)?n:r,`${o?"utc":"time"}Format(${e}, '${n}')`):Gse(t,e,o)}const I0="min",Iae={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 j_(e){return gt(Iae,e)}function zae(e){return U(e,"encoding")}function so(e){return e&&(e.op==="count"||U(e,"field"))}function z6(e){return e&&X(e)}function ed(e){return U(e,"row")||U(e,"column")}function Kw(e){return U(e,"header")}function z0(e){return U(e,"facet")}function Bae(e){return U(e,"param")}function Uae(e){return!de(e)&&U(e,"repeat")}function q_(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Jw(e){return U(e,"sort")}function os({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(fe(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(He(o))return .5}}function B6({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=jn(e),u=Be(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:Ar("timeUnitBandSize",i,r)};if(He(h)&&!Dt(o))return{band:1}}if(lf(i.type))return o?Dt(o)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function U6(e,t,n,i){return He(e.bin)||e.timeUnit&&Cn(e)&&e.type==="temporal"?os({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function j6(e){return U(e,"sort")&&!U(e,"field")}function td(e){return U(e,"condition")}function B0(e){const t=e==null?void 0:e.condition;return!!t&&!X(t)&&q(t)}function nd(e){const t=e==null?void 0:e.condition;return!!t&&!X(t)&&fe(t)}function jae(e){const t=e==null?void 0:e.condition;return!!t&&(X(t)||Ui(t))}function q(e){return U(e,"field")||(e==null?void 0:e.aggregate)==="count"}function Xu(e){return e==null?void 0:e.type}function Lr(e){return U(e,"datum")}function Wo(e){return Cn(e)&&!Bg(e)||zg(e)}function W_(e){return Cn(e)&&e.type==="quantitative"&&!e.bin||zg(e)}function zg(e){return Lr(e)&&Ze(e.datum)}function fe(e){return q(e)||Lr(e)}function Cn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function Ui(e){return U(e,"value")}function qa(e){return U(e,"scale")||U(e,"sort")}function Ku(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function q6(e){return U(e,"legend")}function W6(e){return U(e,"format")||U(e,"formatType")}function qae(e){return Rn(e,["legend","axis","header","scale"])}function Wae(e){return U(e,"op")}function H(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(Hae(e))n=ON("count");else{let s;if(!t.nofn)if(Wae(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;He(a)?(s=VN(a),r=(t.binSuffix??"")+(t.suffix??"")):u?xs(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):go(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!ja(l)&&(s=Hse(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?bl(n):t.expr?DN(n,t.expr)+o:bi(n)+o}function Bg(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(i6(e.type))}function Gae(e){var t;return qa(e)&&Yu((t=e.scale)==null?void 0:t.type)}function Hae(e){return e.aggregate==="count"}function Vae(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(He(i))return`${n} (binned)`;if(r&&!ja(r)){const a=(s=kt(r))==null?void 0:s.unit;if(a)return`${n} (${M0(a).join("-")})`}else if(o)return xs(o)?`${n} for max ${o.argmax}`:go(o)?`${n} for min ${o.argmin}`:`${Vf(o)} of ${n}`;return n}function Yae(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(xs(t))return`${r} for argmax(${t.argmax})`;if(go(t))return`${r} for argmin(${t.argmin})`;const o=i&&!ja(i)?kt(i):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||He(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const G6=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return Yae(e);default:return Vae(e,t)}};let H6=G6;function V6(e){H6=e}function Xae(){V6(G6)}function wu(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=Qw(e))==null?void 0:a.title;if(!q(e))return r??e.title;const o=e,s=i?Zw(o,t):void 0;return n?ft(r,o.title,s):r??o.title??s}function Qw(e){if(Ku(e)&&e.axis)return e.axis;if(q6(e)&&e.legend)return e.legend;if(Kw(e)&&e.header)return e.header}function Zw(e,t){return H6(e,t)}function Ug(e){if(W6(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Qw(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Kae(e,t){var o;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(Jw(e)&&X(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!xs(n)&&!go(n))return"quantitative";if(qa(e)&&((o=e.scale)!=null&&o.type))switch(Yb[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function ji(e){if(q(e))return e;if(B0(e))return e.condition}function xt(e){if(fe(e))return e;if(nd(e))return e.condition}function Y6(e,t,n,i={}){if(de(e)||Ze(e)||Hf(e)){const r=de(e)?"string":Ze(e)?"number":"boolean";return j(Xoe(t,r,e)),{value:e}}return fe(e)?jg(e,t,n,i):nd(e)?{...e,condition:jg(e.condition,t,n,i)}:e}function jg(e,t,n,i){if(W6(e)){const{format:r,formatType:o,...s}=e;if(wa(o)&&!n.customFormatTypes)return j(L_(t)),jg(s,t,n,i)}else{const r=Ku(e)?"axis":q6(e)?"legend":Kw(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(wa(s)&&!n.customFormatTypes)return j(L_(t)),jg({...e,[r]:a},t,n,i)}}return q(e)?eA(e,t,i):Jae(e)}function Jae(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ze(n)?"quantitative":de(n)?"nominal":Ua(n)?"temporal":void 0,{...e,type:t}}function eA(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!Cw(i)&&!xs(i)&&!go(i)&&(j(Joe(i)),delete a.aggregate),r&&(a.timeUnit=kt(r)),s&&(a.field=`${s}`),He(o)&&(a.bin=U0(o,t)),Nt(o)&&!dt(t)&&j(kse(t)),Cn(a)){const{type:u}=a,l=eae(u);u!==l&&(a.type=l),u!=="quantitative"&&k0(i)&&(j(Koe(u,i)),a.type="quantitative")}else if(!UN(t)){const u=Kae(a,t);a.type=u}if(Cn(a)){const{compatible:u,warning:l}=Qae(a,t)||{};u===!1&&j(l)}if(Jw(a)&&de(a.sort)){const{sort:u}=a;if(j_(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&j_(l))return{...a,sort:{encoding:l,order:"descending"}}}if(Kw(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 U0(e,t){return Hf(e)?{maxbins:__(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:__(t)}:e}const iu={compatible:!0};function Qae(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 ro:case oo:case A0:return Bg(e)?iu:{compatible:!1,warning:tse(t)};case et:case Mt:case hs:case xl:case Bn:case Mr:case Or:case Yf:case Xf:case S0:case ya:case C0:case $0:case Pa:case Ei:case Yi:case _0:return iu;case Ki:case xi:case Xi:case Ji:return n!==va?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:iu;case Ao:case ps:case ms:case ys:case wo:case Eo:case vo:case Vi:case Tr:case gs:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:iu;case Un:case bs:return!Bg(e)&&!Gae(e)?{compatible:!1,warning:nse(t)}:iu;case Hu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:iu}}function Ju(e){const{formatType:t}=Ug(e);return t==="time"||!t&&Zae(e)}function Zae(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function j0(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const o=t&&((u=kt(t))==null?void 0:u.unit);let s=o||n==="temporal",a;return Jf(e)?a=e.expr:Q(e)?a=e.signal:Ua(e)?(s=!0,a=xa(e)):(de(e)||Ze(e))&&s&&(a=`datetime(${je(e)})`,Use(o)&&(Ze(e)&&e<1e4||de(e)&&isNaN(Date.parse(e)))&&(a=xa({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:je(e)}function X6(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!ja(e.timeUnit)?e.timeUnit:void 0,o=j0(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function id(e,t){return He(e.bin)?Nr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const G_={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 rd(e){return e==null?void 0:e.condition}const K6=["domain","grid","labels","ticks","title"],eue={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"},J6={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},tue={...J6,style:1,labelExpr:1,encoding:1};function H_(e){return gt(tue,e)}const nue={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},Q6=B(nue);function Co(e){return U(e,"mark")}class q0{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Co(t)?Dae(t.mark)===this.name:!1}}function ea(e,t){const n=e&&e[t];return n?X(n)?Wu(n,i=>!!i.field):q(n)||B0(n):!1}function Z6(e,t){const n=e&&e[t];return n?X(n)?Wu(n,i=>!!i.field):q(n)||Lr(n)||nd(n):!1}function e4(e,t){if(dt(t)){const n=e[t];if((q(n)||Lr(n))&&(v6(n.type)||q(n)&&n.timeUnit)){const i=vw(t);return Z6(e,i)}}return!1}function t4(e){return Wu(Jre,t=>{if(ea(e,t)){const n=e[t];if(X(n))return Wu(n,i=>!!i.aggregate);{const i=ji(n);return i&&!!i.aggregate}}return!1})}function n4(e,t){const n=[],i=[],r=[],o=[],s={};return tA(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=Qw(a),p=g==null?void 0:g.title;let m=H(a,{forAs:!0});const y={...p?[]:{title:wu(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(xs(c)?(b="argmax",m=H({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):go(c)?(b="argmin",m=H({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),Cn(a)&&He(f)){if(i.push({bin:f,field:l,as:m}),n.push(H(a,{binSuffix:"end"})),id(a,u)&&n.push(H(a,{binSuffix:"range"})),dt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",UN(u)||(y.type=va)}else if(d&&!ja(d)){r.push({timeUnit:d,field:l,as:m});const b=Cn(a)&&a.type!==Vu&&"time";b&&(u===Yf||u===ya?y.formatType=b:uoe(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 iue(e,t,n){const i=coe(t,n);if(i){if(i==="binned"){const r=e[t===Vi?et:Mt];return!!(q(r)&&q(e[t])&&Nt(r.bin))}}else return!1;return!0}function rue(e,t,n,i){const r={};for(const o of B(e))BN(o)||j(ese(o));for(let o of ioe){if(!e[o])continue;const s=e[o];if(Kf(o)){const a=noe(o),u=r[a];if(q(u)&&Zse(u.type)&&q(s)&&!u.timeUnit){j(Yoe(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(Voe),o=Ei),!iue(e,o,t)){j(T0(o,t));continue}if(o===wo&&t==="line"){const a=ji(e[o]);if(a!=null&&a.aggregate){j(Zoe);continue}}if(o===Bn&&(n?"fill"in e:"stroke"in e)){j(r6("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===Xf||o===Hu&&!X(s)&&!Ui(s)||o===ya&&X(s)){if(s){if(o===Hu){const a=e[o];if(j6(a)){r[o]=a;continue}}r[o]=ct(s).reduce((a,u)=>(q(u)?a.push(eA(u,o)):j(Vb(u,o)),a),[])}}else{if(o===ya&&s===null)r[o]=null;else if(!q(s)&&!Lr(s)&&!Ui(s)&&!td(s)&&!Q(s)){j(Vb(s,o));continue}r[o]=Y6(s,o,i)}}return r}function W0(e,t){const n={};for(const i of B(e)){const r=Y6(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function oue(e){const t=[];for(const n of B(e))if(ea(e,n)){const i=e[n],r=ct(i);for(const o of r)q(o)?t.push(o):B0(o)&&t.push(o.condition)}return t}function tA(e,t,n){if(e)for(const i of B(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 sue(e,t,n,i){return e?B(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 i4(e,t){return B(t).reduce((n,i)=>{switch(i){case et:case Mt:case C0:case _0:case $0:case Vi:case Tr:case hs:case xl:case Ei:case Eo:case Yi:case vo:case gs:case Xi:case Ki:case Ji:case xi:case Yf:case Un:case Pa:case ya:return n;case Hu:if(e==="line"||e==="trail")return n;case Xf:case S0:{const r=t[i];if(X(r)||q(r))for(const o of ct(r))o.aggregate||n.push(H(o,{}));return n}case wo:if(e==="trail")return n;case Bn:case Mr:case Or:case Ao:case ps:case ms:case bs:case ys:{const r=ji(t[i]);return r&&!r.aggregate&&n.push(H(r,{})),n}}},[])}function aue(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 Jb(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 ${nA(t)}`:"";return{field:s+t.field,type:t.type,title:Q(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=oue(n).map(qae);return{tooltip:[...r,...cr(o,Ae)]}}function nA(e){const{title:t,field:n}=e;return ft(t,n)}function iA(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=nA(n);return r4(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}:{}},...de(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function r4(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}:{},...Sr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Hf(e[t])?{}:e[t]}}]:[]}function o4(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:Bd(o,n),continuousAxisChannelDef2:Bd(s,n),continuousAxisChannelDefError:Bd(a,n),continuousAxisChannelDefError2:Bd(u,n),continuousAxis:r}}function Bd(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(Fse(n,t)),i}else return e}function s4(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(Sr(n)&&n.orient)return n.orient;if(Wo(r)){if(Wo(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 Ju(o)&&!Ju(r)?"horizontal":"vertical"}return"horizontal"}else{if(Wo(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const qg="boxplot",uue=["box","median","outliers","rule","ticks"],lue=new q0(qg,u4);function a4(e){return Ze(e)?"tukey":e}function u4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=Sr(n)?n:{type:n};r&&j(n6("boxplot"));const u=a.extent??t.boxplot.extent,l=Be("size",a,t),c=a.invalid,f=a4(u),{bins:d,timeUnits:h,transform:g,continuousAxisChannelDef:p,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:w,customTooltipWithoutAggregatedField:A}=cue(e,u,t),E=bl(p.field),{color:S,size:C,..._}=x,F=fd=>iA(a,m,p,fd,t.boxplot),O=F(_),T=F(x),k=(Fe(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$=F({..._,...C?{size:C}:{},color:{condition:{test:`${Le(`lower_box_${p.field}`)} >= ${Le(`upper_box_${p.field}`)}`,...S||{value:k}}}}),D=Jb([{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"}],p,x),P={type:"tick",color:"black",opacity:1,orient:v,invalid:c,aria:!1},z=f==="min-max"?D:Jb([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,x),I=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:z})],V=[...f!=="tukey"?I:[],...T({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:w,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:D}),...$({partName:"median",mark:{type:"tick",invalid:c,...Fe(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(g),layer:V};const ue=Le(`lower_box_${p.field}`),ie=Le(`upper_box_${p.field}`),he=`(${ie} - ${ue})`,We=`${ue} - ${u} * ${he}`,ge=`${ie} + ${u} * ${he}`,Ht=Le(p.field),ws={joinaggregate:l4(p.field),groupby:y},_o={transform:[{filter:`(${We} <= ${Ht}) && (${Ht} <= ${ge})`},{aggregate:[{op:"min",field:p.field,as:`lower_whisker_${E}`},{op:"max",field:p.field,as:`upper_whisker_${E}`},{op:"min",field:`lower_box_${p.field}`,as:`lower_box_${E}`},{op:"max",field:`upper_box_${p.field}`,as:`upper_box_${E}`},...b],groupby:y}],layer:I},{tooltip:Y,...pe}=_,{scale:ve,axis:W}=p,Ot=nA(p),Ne=Rn(W,["title"]),Vt=r4(a,"outliers",t.boxplot,{transform:[{filter:`(${Ht} < ${We}) || (${Ht} > ${ge})`}],mark:"point",encoding:{[m]:{field:p.field,type:p.type,...Ot!==void 0?{title:Ot}:{},...ve!==void 0?{scale:ve}:{},...Ue(Ne)?{}:{axis:Ne}},...pe,...S?{color:S}:{},...A?{tooltip:A}:{}}})[0];let At;const Zi=[...d,...h,ws];return Vt?At={transform:Zi,layer:[Vt,_o]}:(At=_o,At.transform.unshift(...Zi)),{...s,layer:[At,{transform:g,layer:V}]}}function l4(e){const t=bl(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function cue(e,t,n){const i=s4(e,qg),{continuousAxisChannelDef:r,continuousAxis:o}=o4(e,i,qg),s=r.field,a=bl(s),u=a4(t),l=[...l4(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:`${Le(`upper_box_${a}`)} - ${Le(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${Le(`upper_box_${a}`)} + ${Le(`iqr_${a}`)} * ${t}, ${Le(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${Le(`lower_box_${a}`)} - ${Le(`iqr_${a}`)} * ${t}, ${Le(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:g}=aue(d),{bins:p,timeUnits:m,aggregate:y,groupby:b,encoding:x}=n4(g,n),v=i==="vertical"?"horizontal":"vertical",w=i,A=[...p,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:p,timeUnits:m,transform:A,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:v,boxOrient:w,customTooltipWithoutAggregatedField:h}}const rA="errorbar",fue=["ticks","rule"],due=new q0(rA,c4);function c4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=f4(e,rA,t);delete o.size;const c=iA(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}:{}},g=[...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,...g.length>1?{layer:g}:{...g[0]}}}function hue(e,t){const{encoding:n}=e;if(gue(n))return{orient:s4(e,t),inputType:"raw"};const i=pue(n),r=mue(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(fe(a)&&fe(u))throw new Error(`${t} cannot have both x2 and y2`);if(fe(a)){if(Wo(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(fe(u)){if(Wo(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(fe(u)&&!fe(a))throw new Error(`${t} cannot have xError2 without xError`);if(fe(c)&&!fe(l))throw new Error(`${t} cannot have yError2 without yError`);if(fe(a)&&fe(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(fe(a)){if(Wo(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(fe(l)){if(Wo(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 gue(e){return(fe(e.x)||fe(e.y))&&!fe(e.x2)&&!fe(e.y2)&&!fe(e.xError)&&!fe(e.xError2)&&!fe(e.yError)&&!fe(e.yError2)}function pue(e){return fe(e.x2)||fe(e.y2)}function mue(e){return fe(e.xError)||fe(e.xError2)||fe(e.yError)||fe(e.yError2)}function f4(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=Sr(i)?i:{type:i};o&&j(n6(t));const{orient:l,inputType:c}=hue(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=o4(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=yue(u,f,d,h,g,c,t,n),{[p]:v,[p==="x"?"x2":"y2"]:w,[p==="x"?"xError":"yError"]:A,[p==="x"?"xError2":"yError2"]:E,...S}=r,{bins:C,timeUnits:_,aggregate:F,groupby:O,encoding:T}=n4(S,n),k=[...F,...m],$=c!=="raw"?[]:O,D=Jb(b,f,T,x);return{transform:[...a.transform??[],...C,..._,...k.length===0?[]:[{aggregate:k,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:T,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:D}}function yue(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,g=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(g==="iqr")&&j(_se(h,g,s)),g==="stderr"||g==="stdev")u=[{op:g,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${Le(`center_${c}`)} + ${Le(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${Le(`center_${c}`)} - ${Le(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Vf(h)},{fieldPrefix:"upper_",titlePrefix:V_(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:V_(h,g,"-")}],d=!0;else{let p,m,y;g==="ci"?(p="mean",m="ci0",y="ci1"):(p="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:p,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:wu({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:wu({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:wu({field:c,aggregate:p,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j($se(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:Le(n.field),as:`upper_${c}`},{calculate:Le(c),as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${Le(c)} + ${Le(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${Le(c)} + ${Le(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${Le(c)} - ${Le(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:ma(ma(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function V_(e,t,n){return`${Vf(e)} ${n} ${t}`}const oA="errorband",bue=["band","borders"],xue=new q0(oA,d4);function d4(e,{config:t}){e={...e,encoding:W0(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=f4(e,oA,t),l=s,c=iA(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 g={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},h={...h,...g,aria:!1}):l.interpolate?j(I_("interpolate")):l.tension&&j(I_("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 h4={};function sA(e,t,n){const i=new q0(e,t);h4[e]={normalizer:i,parts:n}}function vue(){return B(h4)}sA(qg,u4,uue);sA(rA,c4,fue);sA(oA,d4,bue);const Eue=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],g4={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"},p4={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"},wue=B(g4),Aue=B(p4),Sue={header:1,headerRow:1,headerColumn:1,headerFacet:1},m4=B(Sue),y4=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Cue={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},$ue={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_",_ue={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 aA(e){return e==="legend"||!!(e!=null&&e.legend)}function F1(e){return aA(e)&&Fe(e)}function uA(e){return!!(e!=null&&e.select)}function b4(e){const t=[];for(const n of e||[]){if(uA(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 Fue(e){return G0(e)||cA(e)||lA(e)}function lA(e){return U(e,"concat")}function G0(e){return U(e,"vconcat")}function cA(e){return U(e,"hconcat")}function x4({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function Cr(e){return U(e,"step")}function Y_(e){return U(e,"view")||U(e,"width")||U(e,"height")}const X_=20,kue={align:1,bounds:1,center:1,columns:1,spacing:1},Due=B(kue);function Tue(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(z0(e)&&!ed(e.facet)||lA(e))&&(r.columns=s),G0(e)&&(r.columns=1);for(const a of Due)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 Qb(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Zb(e,t){const n=Wg(e,t);return Cr(n)?n.step:v4}function Wg(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ft(n,{step:e.step})}const v4=20,Mue={continuousWidth:200,continuousHeight:200,step:v4},Oue={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Mue,mark:Sae,arc:{},area:{},bar:Fae,circle:{},geoshape:{},image:{},line:{},point:{},rect:Gw,rule:{color:"black"},square:{},text:{color:"black"},tick:kae,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:oae,projection:{},legend:Cue,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:_ue,style:{},title:{},facet:{spacing:X_},concat:{spacing:X_},normalizedNumberFormat:".0%"},Ur=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],K_={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},J_={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 Rue(e={}){return{signals:[{name:"color",value:Fe(e)?{...J_,...e}:J_}],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 Nue(e){return{signals:[{name:"fontSize",value:Fe(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 Lue(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function E4(e){const t=B(e||{}),n={};for(const i of t){const r=e[i];n[i]=rd(r)?XN(r):Vn(r)}return n}function Pue(e){const t=B(e),n={};for(const i of t)n[i]=E4(e[i]);return n}const Iue=[...D6,...Q6,...m4,"background","padding","legend","lineBreak","scale","style","title","view"];function w4(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=$N({},ce(Oue),n?Lue(n):{},t?Rue(t):{},i?Nue(i):{},o||{});r&&E0(s,"selection",r,!0);const a=Rn(s,Iue);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=Vn(s[u]));for(const u of D6)s[u]&&(a[u]=Lt(s[u]));for(const u of Q6)s[u]&&(a[u]=E4(s[u]));for(const u of m4)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),...B(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=Pue(s.style)),s.title&&(a.title=Lt(s.title)),s.view&&(a.view=Lt(s.view)),a}const zue=new Set(["view",...bae]),Bue=["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"],Uue={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Aae};function jue(e){e=ce(e);for(const t of Bue)delete e[t];if(e.axis)for(const t in e.axis)rd(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Eue)delete e.legend[t];if(e.mark){for(const t of B_)delete e.mark[t];e.mark.tooltip&&Fe(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(b4(e.params)),delete e.params);for(const t of zue){for(const i of B_)delete e[t][i];const n=Uue[t];if(n)for(const i of n)delete e[t][i];Wue(e,t)}for(const t of vue())delete e[t];que(e);for(const t in e)Fe(e[t])&&Ue(e[t])&&delete e[t];return Ue(e)?void 0:e}function que(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=YN(e.title);Ue(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ue(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ue(i)?delete e.title:e.title=i}function Wue(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};Ue(o)||(e.style[n??t]=o),delete e[t]}function H0(e){return U(e,"layer")}function Gue(e){return U(e,"repeat")}function Hue(e){return!X(e.repeat)&&U(e.repeat,"layer")}class fA{map(t,n){return z0(t)?this.mapFacet(t,n):Gue(t)?this.mapRepeat(t,n):cA(t)?this.mapHConcat(t,n):G0(t)?this.mapVConcat(t,n):lA(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(H0(t))return this.mapLayer(t,n);if(Co(t))return this.mapUnit(t,n);throw new Error($w(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 Vue={zero:1,center:1,normalize:1};function Yue(e){return gt(Vue,e)}const Xue=new Set([_6,N0,R0,Pg,P0,qw,Ww,L0,F6,jw]),Kue=new Set([N0,R0,_6]);function ru(e){return q(e)&&Xu(e)==="quantitative"&&!e.bin}function Q_(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(ru(s)&&ru(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(ru(s))return t;if(ru(a))return r}else{if(ru(s))return o&&n==="vertical"?void 0:t;if(ru(a))return o&&n==="horizontal"?void 0:r}}function Jue(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function A4(e,t){var p,m;const n=Sr(e)?e:{type:e},i=n.type;if(!Xue.has(i))return null;const r=Q_(t,"x",n)||Q_(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?H(o,{}):void 0,a=Jue(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?H(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?H(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=roe.reduce((y,b)=>{if(b!=="tooltip"&&ea(t,b)){const x=t[b];for(const v of ct(x)){const w=ji(v);if(w.aggregate)continue;const A=H(w,{});(!A||!l.has(A))&&y.push({channel:b,fieldDef:w})}}return y},[]);let g;return o.stack!==void 0?Hf(o.stack)?g=o.stack?"zero":null:g=o.stack:Kue.has(i)&&(g="zero"),!g||!Yue(g)||t4(t)&&h.length===0?null:((p=o==null?void 0:o.scale)!=null&&p.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==Pt.LINEAR&&o!=null&&o.stack&&j(Ase(o.scale.type)),fe(t[Rr(r)])?(o.stack!==void 0&&j(wse(r)),null):(q(o)&&o.aggregate&&!yoe.has(o.aggregate)&&j(Sse(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:vs(i),stackBy:h,offset:g}))}function S4(e,t,n){const i=Lt(e),r=Be("orient",i,n);if(i.orient=tle(i.type,t,r),r!==void 0&&r!==i.orient&&j(sse(i.orient,r)),i.type==="bar"&&i.orient){const u=Be("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:$ae[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Be("opacity",i,n),s=Be("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=Zue(i.type,t)),Be("cursor",i,n)===void 0&&(i.cursor=Que(i,t,n)),i}function Que(e,t,n){return t.href||e.href||Be("href",e,n)?"pointer":e.cursor}function Zue(e,t){if(we([P0,jw,qw,Ww],e)&&!t4(t))return .7}function ele(e,t,{graticule:n}){if(n)return!1;const i=Ar("filled",e,t),r=e.type;return ft(i,r!==P0&&r!==L0&&r!==Pg)}function tle(e,t,n){switch(e){case P0:case qw:case Ww:case F6:case mae:case pae:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case N0: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===va&&!He(i.bin)||zg(i))&&q(r)&&Nt(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===va&&!He(r.bin)||zg(r))&&q(i)&&Nt(i.bin)?"vertical":"horizontal"}case Pg:if(o&&!(q(i)&&Nt(i.bin))&&s&&!(q(r)&&Nt(r.bin)))return;case R0:if(s)return q(r)&&Nt(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Nt(i.bin)?"vertical":"horizontal";if(e===Pg){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case L0:case jw:{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=Cn(i)&&i.type===Vu,c=Cn(r)&&r.type===Vu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function nle(e){const{point:t,line:n,...i}=e;return B(i).length>1?i:i.type}function ile(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Rn(e[t],["point","line"])});return e}function k1(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Fe(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Fe(t.point)?t.point:{}:void 0}function Z_(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 rle{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Co(t)){const{mark:i,encoding:r}=t,o=Sr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!k1(o,n[o.type],r);case"area":return!!k1(o,n[o.type],r)||!!Z_(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=W0(l,r),d=Sr(a)?a:{type:a},h=k1(d,r[d.type],f),g=d.type==="area"&&Z_(d,r[d.type]),p=[{name:u,...o?{params:o}:{},mark:nle({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Rn(f,["shape"])}],m=A4(S4(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=Rn(y,["y2","x2"]),g&&p.push({...s?{projection:s}:{},mark:{type:"line",...qu(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),h&&p.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...qu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:p},{...n,config:ile(r)})}}function ole(e,t){return t?ed(e)?$4(e,t):C4(e,t):e}function D1(e,t){return t?$4(e,t):e}function ex(e,t,n){const i=t[e];if(Uae(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(Poe(i.repeat));return}return t}function C4(e,t){if(e=ex("field",e,t),e!==void 0){if(e===null)return null;if(Jw(e)&&so(e.sort)){const n=ex("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function eF(e,t){if(q(e))return C4(e,t);{const n=ex("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function tF(e,t){if(fe(e)){const n=eF(e,t);if(n)return n;if(td(e))return{condition:e.condition}}else{if(nd(e)){const n=eF(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function $4(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=>tF(o,t)).filter(o=>o);else{const o=tF(r,t);o!==void 0&&(n[i]=o)}}return n}class sle{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Co(t)){const{encoding:n,mark:i}=t;if(i==="line"||Sr(i)&&i.type==="line")for(const r of toe){const o=Ia(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(ose(!!r.x2,!!r.y2)),i({...t,mark:Fe(o)?{...o,type:"rule"}:"rule"},n)}}class ale extends fA{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[lue,due,xue,new rle,new sle]}map(t,n){if(Co(t)){const i=ea(t.encoding,ro),r=ea(t.encoding,oo),o=ea(t.encoding,A0);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=D1(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 Hue(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)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return g.name=h,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!X(i)&&t.columns&&(t=Rn(t,["columns"]),j(R_("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 g of d)for(const p of c)for(const m of f){const y={repeat:g,row:p,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(X(i)?`${Qe(g)}`:(i.row?`row_${Qe(p)}`:"")+(i.column?`column_${Qe(m)}`:"")),x=this.map(r,{...n,repeater:y,repeaterPrefix:b});x.name=b,a.push(Rn(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 ed(i)&&t.columns&&(t=Rn(t,["columns"]),j(R_("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=iF({parentProjection:s,projection:r}),l=nF({parentEncoding:o,encoding:D1(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,...g}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=D1(s,n.repeater);return this.mapFacet({...g,...m,facet:p,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(ise([...i?[ro]:[],...r?[oo]:[]]));const s={},a={};for(const u of[ro,oo]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...g}=l;s[u]=g;for(const p of["align","center","spacing"])l[p]!==void 0&&(a[p]??(a[p]={}),a[p][u]=l[p])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:ole(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:nF({parentEncoding:n,encoding:o,layer:!0}),parentProjection:iF({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function nF({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...B(e),...B(t)]);for(const o of r){const s=t[o],a=e[o];if(fe(s)){const u={...a,...s};i[o]=u}else nd(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Ui(a)||Q(a)||fe(a)||X(a))&&(i[o]=a)}}else i=t;return!i||Ue(i)?void 0:i}function iF(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Hoe({parentProjection:t,projection:n})),n??t}function dA(e){return U(e,"filter")}function ule(e){return U(e,"stop")}function _4(e){return U(e,"lookup")}function lle(e){return U(e,"data")}function cle(e){return U(e,"param")}function fle(e){return U(e,"pivot")}function dle(e){return U(e,"density")}function hle(e){return U(e,"quantile")}function gle(e){return U(e,"regression")}function ple(e){return U(e,"loess")}function mle(e){return U(e,"sample")}function yle(e){return U(e,"window")}function ble(e){return U(e,"joinaggregate")}function xle(e){return U(e,"flatten")}function vle(e){return U(e,"calculate")}function F4(e){return U(e,"bin")}function Ele(e){return U(e,"impute")}function wle(e){return U(e,"timeUnit")}function Ale(e){return U(e,"aggregate")}function Sle(e){return U(e,"stack")}function Cle(e){return U(e,"fold")}function $le(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function _le(e){return e.map(t=>dA(t)?{filter:vu(t.filter,Qse)}:t)}class Fle extends fA{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=rF(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=rF(t,n),t.encoding){const i={};for(const[r,o]of is(t.encoding))i[r]=k4(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:is(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 qt(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function rF(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(dA(o))return{filter:tx(o,t)};if(F4(o)&&za(o.bin))return{...o,bin:D4(o.bin)};if(_4(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function k4(e,t){var i,r;const n=ce(e);if(q(n)&&za(n.bin)&&(n.bin=D4(n.bin)),qa(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(td(n))if(X(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:tx(o,t)}});else{const{selection:o,param:s,test:a,...u}=k4(n.condition,t);n.condition=s?n.condition:{...u,test:tx(n.condition,t)}}return n}function D4(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function tx(e,t){const n=i=>vu(i,r=>{var o;const s=t.emptySelections[r]??!0,a={param:r,empty:s};return(o=t.selectionPredicates)[r]??(o[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):vu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class nx extends fA{map(t,n){const i=n.selections??[];if(t.params&&!Co(t)){const r=[];for(const o of t.params)uA(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)(de(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=nx.prototype[e];nx.prototype[e]=function(n,i){return t.call(this,n,kle(n,i))}}function kle(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function T4(e,t){t===void 0&&(t=w4(e.config));const n=Ole(e,t),{width:i,height:r}=e,o=Rle(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Dle=new ale,Tle=new Fle,Mle=new nx;function Ole(e,t={}){const n={config:t};return Mle.map(Dle.map(Tle.map(e,n),n),n)}function oF(e){return de(e)?{type:e}:e??{}}function Rle(e,t,n){let{width:i,height:r}=t;const o=Co(e)||H0(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(D_("width")),i=void 0),r=="container"&&(j(D_("height")),r=void 0));const a={type:"pad",...s,...n?oF(n.autosize):{},...oF(e.autosize)};if(a.type==="fit"&&!o&&(j($oe),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(T_("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(T_("height")),!Xn(a,{type:"pad"}))return a}function Nle(e){return["fit","fit-x","fit-y"].includes(e)}function Lle(e){return e?`fit-${F0(e)}`:"fit"}const Ple=["background","padding"];function sF(e,t){const n={};for(const i of Ple)e&&e[i]!==void 0&&(n[i]=Vn(e[i]));return t&&(n.params=e.params),n}class $o{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new $o(ce(this.explicit),ce(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 B(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function or(e){return{explicit:!0,value:e}}function Wn(e){return{explicit:!1,value:e}}function M4(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:V0(t,n,i,r)}}function V0(e,t,n,i){return e.explicit&&t.explicit&&j(pse(n,i,e.value,t.value)),e}function ss(e,t,n,i,r=V0){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Xn(e.value,t.value)?e:r(e,t,n,i)}class Ile extends $o{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 Qu(e){return U(e,"url")}function cf(e){return U(e,"values")}function O4(e){return U(e,"name")&&!Qu(e)&&!cf(e)&&!Xo(e)}function Xo(e){return e&&(R4(e)||N4(e)||hA(e))}function R4(e){return U(e,"sequence")}function N4(e){return U(e,"sphere")}function hA(e){return U(e,"graticule")}var it;(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"})(it||(it={}));function L4({invalid:e,isPath:t}){switch(T6(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 zle(e){const{marks:t,scales:n}=L4(e);return t===n?it.Main:n==="include-invalid-values"?it.PreFilterInvalid:it.PostFilterInvalid}class ze{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,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(qoe);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 Nn extends ze{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 ${MN()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function T1(e){return e.as!==void 0}function aF(e){return`${e}_end`}class gr extends ze{clone(){return new gr(null,ce(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(ja(u)){if(nt(n)){const{mark:c,markDef:f,config:d}=n,h=os({fieldDef:o,markDef:f,config:d});(lf(c)||h)&&(l={timeUnit:kt(u),field:a})}}else l={as:H(o,{forAs:!0}),field:a,timeUnit:u};if(nt(n)){const{mark:c,markDef:f,config:d}=n,h=os({fieldDef:o,markDef:f,config:d});lf(c)&&dt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[Ae(l)]=l)}return r},{});return Ue(i)?null:new gr(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=kt(i),s={...r,timeUnit:o};return new gr(t,{[Ae(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 is(this.timeUnits)){const o=T1(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(qt(this.timeUnits).map(t=>T1(t)?t.as:aF(t.field)))}dependentFields(){return new Set(qt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Ae(this.timeUnits)}`}assemble(){const t=[];for(const n of qt(this.timeUnits)){const{rectBandPosition:i}=n,r=kt(n.timeUnit);if(T1(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:bi(o),type:"timeunit",...a?{units:M0(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...uF(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=P4({timeUnit:r,field:s}),u=aF(s);t.push({type:"formula",expr:a,as:u}),t.push(...uF([s,u],i,r))}}return t}}const Y0="offsetted_rect_start",X0="offsetted_rect_end";function P4({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=h6(i),{part:s,step:a}=y6(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', ${Le(t)}, ${n?-a:a})`}function uF([e,t],n,i){if(n!==void 0&&n!==.5){const r=Le(e),o=Le(t);return[{type:"formula",expr:lF([P4({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Y0}`},{type:"formula",expr:lF([r,o],n+.5),as:`${e}_${X0}`}]}return[]}function lF([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const od="_tuple_fields";class Ble{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Ule={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Ble),o={},s={},a=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=Qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Qe(`${i}_${m}_${b}`);return a.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?ct(n.value):null;let{fields:d,encodings:h}=Fe(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(Fe(g))for(const p of B(g))eoe(p)?(h||(h=[])).push(p):l==="interval"?(j(Loe),h=c.encodings):(d??(d=[])).push(p)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const g of h??[]){const p=e.fieldDef(g);if(p){let m=p.field;if(p.aggregate){j(_oe(g,p.aggregate));continue}else if(!m){j(O_(g));continue}if(p.timeUnit&&!ja(p.timeUnit)){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};s[Ae(y)]=y}if(!o[m]){const y=l==="interval"&&Nr(g)&&Bi(e.getScaleComponent(g).get("type"))?"R":p.bin?"R-RE":"E",b={field:m,channel:g,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,IN(g)?(b.geoChannel=g,b.channel=PN(g),r.hasChannel[b.channel]=o[m]):r.hasChannel[g]=o[m]}}else j(O_(g))}for(const g of d??[]){if(r.hasField[g])continue;const p={type:"E",field:g,index:r.items.length};p.signals={...u(p,"data")},r.items.push(p),r.hasField[g]=p,r.hasSelectionId=r.hasSelectionId||g===qi}f&&(t.init=f.map(g=>r.items.map(p=>Fe(g)?g[p.geoChannel||p.channel]!==void 0?g[p.geoChannel||p.channel]:g[p.field]:g))),Ue(s)||(r.timeUnit=new gr(null,s))},signals:(e,t,n)=>{const i=t.name+od;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(U4)})}},I4="_curr",Ah="anim_value",uu="anim_clock",ix="eased_anim_clock",z4="min_extent",B4="max_range_extent",M1="last_tick_at",O1="is_playing",jle=1/60*1e3,qle=(e,t)=>[{name:ix,update:uu},{name:`${e}_domain`,init:`domain('${t}')`},{name:z4,init:`extent(${e}_domain)[0]`},{name:B4,init:`extent(range('${t}'))[1]`},{name:Ah,update:`invert('${t}', ${ix})`}],Wle={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(pr(t)&&(n=n.concat([{name:uu,init:"0",on:[{events:{type:"timer",throttle:jle},update:`${O1} ? (${uu} + (now() - ${M1}) > ${B4} ? 0 : ${uu} + (now() - ${M1})) : ${uu}`}]},{name:M1,init:"now()",on:[{events:[{signal:uu},{signal:O1}],update:"now()"}]},{name:O1,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+od,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=qt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Au):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: ${ta(e)}, `;if(t.project.hasSelectionId)l+=`${qi}: ${s}[${_e(qi)}]`;else if(pr(t))l+=`fields: ${r}, values: [${Ah} ? ${Ah} : ${z4}]`;else{const c=o.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${s}[${_e(e.vgField(f.channel,{}))}], ${s}[${_e(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${s}[${_e(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(pr(t))return n.concat(qle(t.name,e.scaleName(gs)),[{name:i+mo,on:[{events:[{signal:ix},{signal:Ah}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+mo,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function U4(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=bi(r.field),r}function Aa(e,t=!0,n=Nre){if(X(e)){const i=e.map(r=>Aa(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Ua(e))return n(t?xa(e):Bse(e));return t?n(je(e)):e}function Gle(e,t){for(const n of qt(e.component.selection??{})){const i=n.name;let r=`${i}${mo}, ${n.resolve==="global"?"true":`{unit: ${ta(e)}}`}`;for(const o of J0)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+bce,on:[{events:{signal:n.name+mo},update:`modify(${_e(n.name+Sa)}, ${r})`}]})}return gA(t)}function Hle(e,t){if(e.component.selection&&B(e.component.selection).length){const n=_e(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ds("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return gA(t)}function Vle(e,t){let n=!1;for(const i of qt(e.component.selection??{})){const r=i.name,o=_e(r+Sa);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:`${rL}(${o}, ${_e(a)}${u}`})}n=!0;for(const a of J0)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"}]}),gA(t)}function Yle(e,t){const n=[],i=[],r=ta(e,{escape:!1});for(const o of qt(e.component.selection??{})){const s={name:o.name+Sa};if(o.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:qi}}]),o.init){const u=o.project.items.map(U4);s.values=o.project.hasSelectionId?o.init.map(l=>({unit:r,[qi]:Aa(l,!1)[0]})):o.init.map(l=>({unit:r,fields:u,values:Aa(l,!1)}))}if([...n,...t].filter(u=>u.name===o.name+Sa).length||n.push(s),pr(o)&&t.length){const u=e.lookupDataSource(e.getDataName(it.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+I4,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function j4(e,t){for(const n of qt(e.component.selection??{}))for(const i of J0)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Xle(e,t){for(const n of e.children)nt(n)&&(t=j4(n,t));return t}function Kle(e,t,n,i){const r=pL(e,t.param,t);return{signal:Bi(n.get("type"))&&X(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function gA(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const ao={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(Toe),!o||!Bi(s)){j(Doe);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||ox(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(rL))r.update=`{${i.map(s=>`${_e(bi(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${_e(bi(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&&!ox(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 rx(e,t){return`domain(${_e(e.scaleName(t))})`}function ox(e){return e.parent&&Cl(e.parent)&&(!e.parent.parent||ox(e.parent.parent))}const Au="_brush",q4="_scale_trigger",Yl="geo_interval_init_tick",W4="_init",Jle="_center",Qle={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...oa(n.select)?n.select:{}};r.fields=[qi],r.encodings||(r.encodings=n.value?B(n.value):[Ki,Xi]),n.select={type:"interval",...r}}if(t.translate&&!ao.defined(t)){const r=`!event.item || event.item.mark.name !== ${_e(t.name+Au)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=ct((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+mo,o=qt(t.project.hasChannel).filter(a=>a.channel===et||a.channel===Mt),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(Zle(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=_e(e.projectionName()),u=e.projectionName()+Jle,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?s&&s[l.index]:`${u}[0]`,g=c?s&&s[c.index]:`${u}[1]`,p=w=>e.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":p("width")}, ${d?d+"[1]":p("height")}]]`;s&&(n.unshift({name:i+W4,init:`[scale(${a}, [${l?h[0]:h}, ${c?g[0]:g}]), scale(${a}, [${l?h[1]:h}, ${c?g[1]:g}])]`}),(!l||!c)&&(n.find(A=>A.name===u)||n.unshift({name:u,update:`invert(${a}, [${p("width")}/2, ${p("height")}/2])`})));const y=`intersect(${m}, {markname: ${_e(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${ta(e)}}`,x=`vlSelectionTuples(${y}, ${b})`,v=o.map(w=>w.signals.visual);return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...s?[{signal:Yl}]:[]],update:x}]})}else{if(!ao.defined(t)){const l=i+q4,c=o.map(f=>{const d=f.channel,{data:h,visual:g}=f.signals,p=_e(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Bi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${p}, ${g})[0] === ${y}${h}[0] && ${y}invert(${p}, ${g})[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: ${ta(e)}, fields: ${i+od}, values`;return n.concat({name:r,...s?{init:`{${u}: ${Aa(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(nt(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Yl).length||n.unshift({name:Yl,value:null,on:[{events:"timer{1}",update:`${Yl} === null ? {} : ${Yl}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r==null?void 0:r.signals.visual,a=o==null?void 0:o.signals.visual,u=`data(${_e(t.name+Sa)})`;if(ao.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 B(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${ta(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=B(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),{}),p=d??(t.translate?"move":null);return[{name:`${i+Au}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Au,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function Zle(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=_e(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=ao.defined(t),g=e.getScaleComponent(o),p=g?g.get("type"):void 0,m=i?{init:Aa(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+q4},update:Bi(p)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:Aa(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===et?0:1,h=t.name+W4,g=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...g,on:f}]}}function El({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=td(t)&&t.condition;let s=[];o&&(s=ct(o).map(l=>{const c=r(l);if(Bae(l)){const{param:f,empty:d}=l;return{test:gL(e,{param:f,empty:d}),...c}}else return{test:Yg(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 pA(e,t="text"){const n=e.encoding[t];return El({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>K0(i,e.config),invalidValueRef:void 0})}function K0(e,t,n="datum"){if(e){if(Ui(e))return Ye(e.value);if(fe(e)){const{format:i,formatType:r}=Ug(e);return Xw({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function G4(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(X(s))return{tooltip:cF({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return El({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=K0(l,r,a);if(c)return c;if(l===null)return;let f=Be("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),de(f))return{value:f};if(Fe(f))return Q(f)?f:f.content==="encoding"?cF(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function H4(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=Ia(f),h=Cn(c)?c:{...c,type:e[d].type},g=h.title||Zw(h,r),p=ct(g).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=H(h,{expr:s}),v=H(b,{expr:s}),{format:w,formatType:A}=Ug(h);m=Zf(x,v,w,A,r),o.add(y)}}if((dt(f)||f===Ei||f===Yi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=Ug(h);m=Xw({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??(m=K0(h,r,s).signal),a.push({channel:f,key:p,value:m})}tA(e,(c,f)=>{q(c)?u(c,f):B0(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 cF(e,t,n,{reactiveGeom:i}={}){const r=H4(e,t,n,{reactiveGeom:i}),o=is(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function ece(e){const{markDef:t,config:n}=e,i=Be("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...tce(e),...nce(e)}}function tce(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Be("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:gt(Aoe,t)?{}:{ariaRoleDescription:{value:t}}}function nce(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return El({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>K0(u,e.config),invalidValueRef:void 0});const s=Be("description",n,i);if(s!=null)return{description:Ye(s)};if(i.aria===!1)return{};const a=H4(t,r,i);if(!Ue(a))return{description:{signal:is(a).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??(u=Be(e,i,o,{vgChannel:s,ignoreVgConfig:!td(l)})),u!==void 0&&(a=Ye(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=O6({...c,scaleChannel:e,channelDef:l});return El({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>Yw({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function V4(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Be("filled",n,r),a=we(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Be(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Be(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ye(u)}:{},...l?{stroke:Ye(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(r6("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 ice(e){const{encoding:t,mark:n}=e,i=t.order;return!vs(n)&&Ui(i)?El({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ye(r.value),invalidValueRef:void 0}):{}}function Zu({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:Yw({channel:o,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ye(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function bn(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}=Zu({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),g=mA({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),p=!u&&dt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:rce({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:h==="encoding"?0:void 0});return p?{[i||e]:p}:void 0}function rce(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(fe(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 Ig({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Zs(n,i,{suffix:"end"},{offset:o})}return Vw(e)}function mA({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=Ia(n),u=rs(n),l=Be(n,o,s,{vgChannel:u});if(l!==void 0)return Nc(n,l);switch(t){case"zeroOrMin":return fF({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return fF({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[jn(n)],mult:.5}}}}function fF({mainChannel:e,config:t,...n}){const i=M6(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 oce={left:"x",center:"xc",right:"x2"},sce={top:"y",middle:"yc",bottom:"y2"};function Y4(e,t,n,i="middle"){if(e==="radius"||e==="theta")return rs(e);const r=e==="x"?"align":"baseline",o=Be(r,t,n);let s;return Q(o)?(j(rse(r)),s=void 0):s=o,e==="x"?oce[s||(i==="top"?"left":"center")]:sce[s||i]}function Gg(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?X4(e,t,{defaultPos:n,defaultPos2:i}):bn(e,t,{defaultPos:n})}function X4(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=Rr(e),a=jn(e),u=ace(t,i,s),l=u[a]?Y4(e,r,o):rs(e);return{...bn(e,t,{defaultPos:n,vgChannel:l}),...u}}function ace(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=Ia(n),l=jn(n),c=rs(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:g}=n in i||n in o?Zu({channel:n,markDef:o,encoding:i,model:e}):Zu({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=jn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=uce({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:g,defaultRef:void 0});return p!==void 0?{[c]:p}:Ud(n,o)||Ud(n,{[n]:Hb(n,o,a.style),[l]:Hb(l,o,a.style)})||Ud(n,a[r])||Ud(n,a.mark)||{[c]:mA({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function uce({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return fe(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Zs(t,o,{suffix:"start"},{offset:u}):Vw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Ud(e,t){const n=jn(e),i=rs(e);if(t[i]!==void 0)return{[i]:Nc(e,t[i])};if(t[e]!==void 0)return{[i]:Nc(e,t[e])};if(t[n]){const r=t[n];if(Ea(r))j(Qoe(n));else return{[n]:Nc(e,r)}}}function po(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=Rr(t),a=jn(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??Be("size",r,n,{vgChannel:a}),g=jN(t),p=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(He(u.bin)||Nt(u.bin)||u.timeUnit&&!l)&&!(h&&!Ea(h))&&!i[g]&&!Dt(f)?fce({fieldDef:u,fieldDef2:l,channel:t,model:e}):(fe(u)&&Dt(f)||p)&&!l?cce(u,t,e):X4(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function lce(e,t,n,i,r,o,s){if(Ea(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(${Mi(c)}, ${l})`:l}}else r.band!==1&&(j(use(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(Ba(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:Zb(i.view,e)-2}}function cce(e,t,n){var C,_;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=jn(t),f=Rr(t),d=jN(t),h=n.scaleName(d),g=n.getScaleComponent(vw(t)),p=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(p?m=It("size",n,{vgChannel:c,defaultRef:Ye(i.size)}):j(dse(i.type)));const y=!!m,b=B6({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(C=l||g)==null?void 0:C.get("type"),useVlSizeChannel:p});m=m||{[c]:lce(c,h||u,g||l,o,b,!!e,i.type)};const x=((_=l||g)==null?void 0:_.get("type"))==="band"&&Ea(b)&&!y?"top":"middle",v=Y4(t,i,o,x),w=v==="xc"||v==="yc",{offset:A,offsetType:E}=Zu({channel:t,markDef:i,encoding:r,model:n,bandPosition:w?.5:0}),S=Vw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:A,defaultRef:mA({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:w?E==="encoding"?0:.5:Q(b)?{signal:`(1-${b})/2`}:Ea(b)?(1-b.band)/2:0});if(c)return{[v]:S,...m};{const F=rs(f),O=m[c],T=A?{...O,offset:A}:O;return{[v]:S,[F]:X(S)?[S[0],{...S[1],offset:T}]:{...S,offset:T}}}}function dF(e,t,n,i,r,o,s){if(LN(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=Mi(n),c=Mi(r),f=Mi(i),d=Mi(o),g=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,p=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${g})`:g;return{signal:p+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function fce({fieldDef:e,fieldDef2:t,channel:n,model:i}){var _;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=B6({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(_=i.component.axes[n])==null?void 0:_[0],h=(d==null?void 0:d.get("translate"))??.5,g=dt(n)?Be("binSpacing",o,r)??0:0,p=Rr(n),m=rs(n),y=rs(p),b=Ar("minBandSize",o,r),{offset:x}=Zu({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:v}=Zu({channel:p,markDef:o,encoding:s,model:i,bandPosition:0}),w=Rae({fieldDef:e,scaleName:u}),A=dF(n,g,c,h,x,b,w),E=dF(p,g,c,h,v??x,b,w),S=Q(f)?{signal:`(1-${f.signal})/2`}:Ea(f)?(1-f.band)/2:.5,C=os({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(He(e.bin)||e.timeUnit){const F=e.timeUnit&&C!==.5;return{[y]:hF({fieldDef:e,scaleName:u,bandPosition:S,offset:E,useRectOffsetField:F}),[m]:hF({fieldDef:e,scaleName:u,bandPosition:Q(S)?{signal:`1-${S.signal}`}:1-S,offset:A,useRectOffsetField:F})}}else if(Nt(e.bin)){const F=Zs(e,u,{},{offset:E});if(q(t))return{[y]:F,[m]:Zs(t,u,{},{offset:A})};if(za(e.bin)&&e.bin.step)return{[y]:F,[m]:{signal:`scale("${u}", ${H(e,{expr:"datum"})} + ${e.bin.step})`,offset:A}}}j(a6(p))}function hF({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Ig({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Y0,endSuffix:X0}:{}})}const dce=new Set(["aria","width","height"]);function wi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?V4(e):{};return{...hce(e.markDef,t),...gF("fill",n),...gF("stroke",i),...It("opacity",e),...It("fillOpacity",e),...It("strokeOpacity",e),...It("strokeWidth",e),...It("strokeDash",e),...ice(e),...G4(e),...pA(e,"href"),...ece(e)}}function gF(e,t){return t?{[e]:t}:{}}function hce(e,t){return woe.reduce((n,i)=>(!dce.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ye(e[i])),n),{})}function yA(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!Nr(o)||!(s=e.getScaleType(o)))return;const a=k0(r.aggregate),u=Hw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(Tae(u)){const c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(o=>O0(o,!0)).join(" && ")}}}function pF(e,t){if(t!==void 0)return{[e]:Ye(t)}}const R1="voronoi",K4={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(R1)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(vs(o))return j(Foe(o)),n;const s={name:e.getName(R1),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...G4(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(R1)&&(u=!0)}),u||n.splice(a+1,0,s),n}},J4={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!aA(e.bind),parse:(e,t,n)=>oL(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=K4.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:Aa(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${_e(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+mo),s=i+od,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}},Hg="_toggle",Q4={defined:e=>e.type==="point"&&!pr(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Hg,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+mo,i=t.name+Hg;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${ta(e)}}, `)+`${i} ? ${n} : null`}},gce={defined:e=>e.clear!==void 0&&e.clear!==!1&&!pr(e),parse:(e,t)=>{t.clear&&(t.clear=de(t.clear)?ds(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(J4.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+mo);i(r,"null"),Q4.defined(t)&&(r=n.findIndex(o=>o.name===t.name+Hg),i(r,"false"))}return n}},Z4={defined:e=>{const t=e.resolve==="global"&&e.bind&&aA(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==qi;return t&&!n&&j(Moe),t&&n},parse:(e,t,n)=>{const i=ce(n);if(i.select=de(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},oL(t,i),oa(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=F1(t.bind)?t.bind.legend:"click",o=de(r)?ds(r,"view"):ct(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=F1(t.bind)&&t.bind.legend,o=s=>a=>{const u=ce(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+mo),s=i+od,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+Hg),f=F1(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function pce(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const o of qt(e.component.selection??{})){const s=o.project.hasField[i]??o.project.hasChannel[t];if(s&&Z4.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const eL="_translate_anchor",tL="_translate_delta",mce={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+eL,{x:s,y:a}=t.project.hasChannel;let u=ds(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Au,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?rx(e,et):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?rx(e,Mt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+tL,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&mF(e,t,s,"width",n),a!==void 0&&mF(e,t,a,"height",n),n}};function mF(e,t,n,i,r){const o=t.name,s=o+eL,a=o+tL,u=n.channel,l=ao.defined(t),c=r.find(w=>w.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),g=d&&d.get("reverse"),p=l?u===et?g?"":"-":g?"-":"":"",m=`${s}.extent_${u}`,y=`${p}${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 nL="_zoom_anchor",iL="_zoom_delta",yce={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=ao.defined(t),o=i+iL,{x:s,y:a}=t.project.hasChannel,u=_e(e.scaleName(et)),l=_e(e.scaleName(Mt));let c=ds(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Au,f))),n.push({name:i+nL,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&&yF(e,t,s,"width",n),a!==void 0&&yF(e,t,a,"height",n),n}};function yF(e,t,n,i,r){const o=t.name,s=n.channel,a=ao.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?rx(e,s):u.name,h=o+iL,g=`${o}${nL}.${s}`,p=!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=`${p}(${d}, ${g}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Sa="_store",mo="_tuple",bce="_modify",rL="vlSelectionResolve",J0=[Wle,Qle,Ule,Q4,J4,ao,Z4,gce,mce,yce,K4];function xce(e){let t=e.parent;for(;t&&!Zn(t);)t=t.parent;return t}function ta(e,{escape:t}={escape:!0}){let n=t?_e(e.name):e.name;const i=xce(e);if(i){const{facet:r}=i;for(const o of di)r[o]&&(n+=` + '__facet_${o}_' + (facet[${_e(i.vgField(o))}])`)}return n}function bA(e){return qt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function oL(e,t){(to(t.select)||!t.select.on)&&delete e.events,(to(t.select)||!t.select.clear)&&delete e.clear,(to(t.select)||!t.select.toggle)&&delete e.toggle}function pr(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}const vce="RawCode",Ece="Literal",wce="Property",Ace="Identifier",Sce="ArrayExpression",Cce="BinaryExpression",$ce="CallExpression",_ce="ConditionalExpression",Fce="LogicalExpression",kce="MemberExpression",Dce="ObjectExpression",Tce="UnaryExpression";function Qi(e){this.type=e}Qi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Mce(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function Mce(e){switch(e.type){case Sce:return e.elements;case Cce:case Fce:return[e.left,e.right];case $ce:return[e.callee].concat(e.arguments);case _ce:return[e.test,e.consequent,e.alternate];case kce:return[e.object,e.property];case Dce:return e.properties;case wce:return[e.key,e.value];case Tce:return[e.argument];case Ace:case Ece:case vce:default:return[]}}var Pr,J,N,sn,Ie,Q0=1,sd=2,Ca=3,Es=4,Z0=5,Wa=6,Dn=7,ad=8,Oce=9;Pr={};Pr[Q0]="Boolean";Pr[sd]="<end>";Pr[Ca]="Identifier";Pr[Es]="Keyword";Pr[Z0]="Null";Pr[Wa]="Numeric";Pr[Dn]="Punctuator";Pr[ad]="String";Pr[Oce]="RegularExpression";var Rce="ArrayExpression",Nce="BinaryExpression",Lce="CallExpression",Pce="ConditionalExpression",sL="Identifier",Ice="Literal",zce="LogicalExpression",Bce="MemberExpression",Uce="ObjectExpression",jce="Property",qce="UnaryExpression",Ft="Unexpected token %0",Wce="Unexpected number",Gce="Unexpected string",Hce="Unexpected identifier",Vce="Unexpected reserved word",Yce="Unexpected end of input",sx="Invalid regular expression",N1="Invalid regular expression: missing /",aL="Octal literals are not allowed in strict mode.",Xce="Duplicate data property in object literal not allowed in strict mode",Ut="ILLEGAL",ff="Disabled.",Kce=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]"),Jce=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 em(e,t){if(!e)throw new Error("ASSERT: "+t)}function Gr(e){return e>=48&&e<=57}function xA(e){return"0123456789abcdefABCDEF".includes(e)}function Lc(e){return"01234567".includes(e)}function Qce(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 df(e){return e===10||e===13||e===8232||e===8233}function ud(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Kce.test(String.fromCharCode(e))}function Vg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Jce.test(String.fromCharCode(e))}const Zce={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 uL(){for(;N<sn;){const e=J.charCodeAt(N);if(Qce(e)||df(e))++N;else break}}function ax(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)N<sn&&xA(J[N])?(i=J[N++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):De({},Ft,Ut);return String.fromCharCode(r)}function efe(){var e,t,n,i;for(e=J[N],t=0,e==="}"&&De({},Ft,Ut);N<sn&&(e=J[N++],!!xA(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&De({},Ft,Ut),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function lL(){var e,t;for(e=J.charCodeAt(N++),t=String.fromCharCode(e),e===92&&(J.charCodeAt(N)!==117&&De({},Ft,Ut),++N,e=ax("u"),(!e||e==="\\"||!ud(e.charCodeAt(0)))&&De({},Ft,Ut),t=e);N<sn&&(e=J.charCodeAt(N),!!Vg(e));)++N,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),J.charCodeAt(N)!==117&&De({},Ft,Ut),++N,e=ax("u"),(!e||e==="\\"||!Vg(e.charCodeAt(0)))&&De({},Ft,Ut),t+=e);return t}function tfe(){var e,t;for(e=N++;N<sn;){if(t=J.charCodeAt(N),t===92)return N=e,lL();if(Vg(t))++N;else break}return J.slice(e,N)}function nfe(){var e,t,n;return e=N,t=J.charCodeAt(N)===92?lL():tfe(),t.length===1?n=Ca:Zce.hasOwnProperty(t)?n=Es:t==="null"?n=Z0:t==="true"||t==="false"?n=Q0:n=Ca,{type:n,value:t,start:e,end:N}}function L1(){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==="//"&&De({},Ft,Ut),"<>=!+-*%&|^/".includes(i))return++N,{type:Dn,value:i,start:e,end:N};De({},Ft,Ut)}function ife(e){let t="";for(;N<sn&&xA(J[N]);)t+=J[N++];return t.length===0&&De({},Ft,Ut),ud(J.charCodeAt(N))&&De({},Ft,Ut),{type:Wa,value:parseInt("0x"+t,16),start:e,end:N}}function rfe(e){let t="0"+J[N++];for(;N<sn&&Lc(J[N]);)t+=J[N++];return(ud(J.charCodeAt(N))||Gr(J.charCodeAt(N)))&&De({},Ft,Ut),{type:Wa,value:parseInt(t,8),octal:!0,start:e,end:N}}function bF(){var e,t,n;if(n=J[N],em(Gr(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,ife(t);if(Lc(n))return rfe(t);n&&Gr(n.charCodeAt(0))&&De({},Ft,Ut)}for(;Gr(J.charCodeAt(N));)e+=J[N++];n=J[N]}if(n==="."){for(e+=J[N++];Gr(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++]),Gr(J.charCodeAt(N)))for(;Gr(J.charCodeAt(N));)e+=J[N++];else De({},Ft,Ut);return ud(J.charCodeAt(N))&&De({},Ft,Ut),{type:Wa,value:parseFloat(e),start:t,end:N}}function ofe(){var e="",t,n,i,r,o=!1;for(t=J[N],em(t==="'"||t==='"',"String literal must starts with a quote"),n=N,++N;N<sn;)if(i=J[N++],i===t){t="";break}else if(i==="\\")if(i=J[N++],!i||!df(i.charCodeAt(0)))switch(i){case"u":case"x":J[N]==="{"?(++N,e+=efe()):e+=ax(i);break;case"n":e+=`
16
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:Lc(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),N<sn&&Lc(J[N])&&(o=!0,r=r*8+"01234567".indexOf(J[N++]),"0123".includes(i)&&N<sn&&Lc(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(df(i.charCodeAt(0)))break;e+=i}return t!==""&&De({},kt,Ut),{type:ad,value:e,octal:o,start:n,end:N}}function ofe(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({},sx)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{De({},sx)}try{return new RegExp(e,t)}catch{return null}}function sfe(){var e,t,n,i,r;for(e=J[N],em(e==="/","Regular expression literal must start with a slash"),t=J[N++],n=!1,i=!1;N<sn;)if(e=J[N++],t+=e,e==="\\")e=J[N++],df(e.charCodeAt(0))&&De({},N1),t+=e;else if(df(e.charCodeAt(0)))De({},N1);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||De({},N1),r=t.substr(1,t.length-2),{value:r,literal:t}}function afe(){var e,t,n;for(t="",n="";N<sn&&(e=J[N],!!Vg(e.charCodeAt(0)));)++N,e==="\\"&&N<sn?De({},kt,Ut):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&De({},sx,n),{value:n,literal:t}}function ufe(){var e,t,n,i;return Ie=null,cL(),e=N,t=sfe(),n=afe(),i=ofe(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:N}}function lfe(e){return e.type===Ca||e.type===Es||e.type===Q0||e.type===Z0}function dL(){if(cL(),N>=sn)return{type:sd,start:N,end:N};const e=J.charCodeAt(N);return ud(e)?tfe():e===40||e===41||e===59?L1():e===39||e===34?rfe():e===46?Gr(J.charCodeAt(N+1))?bF():L1():Gr(e)?bF():L1()}function On(){const e=Ie;return N=e.end,Ie=dL(),N=e.end,e}function hL(){const e=N;Ie=dL(),N=e}function cfe(e){const t=new Qi(Oce);return t.elements=e,t}function xF(e,t,n){const i=new Qi(e==="||"||e==="&&"?Ice:Rce);return i.operator=e,i.left=t,i.right=n,i}function ffe(e,t){const n=new Qi(Nce);return n.callee=e,n.arguments=t,n}function dfe(e,t,n){const i=new Qi(Lce);return i.test=e,i.consequent=t,i.alternate=n,i}function vA(e){const t=new Qi(uL);return t.name=e,t}function xc(e){const t=new Qi(Pce);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 vF(e,t,n){const i=new Qi(zce);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function hfe(e){const t=new Qi(Bce);return t.properties=e,t}function EF(e,t,n){const i=new Qi(Uce);return i.key=t,i.value=n,i.kind=e,i}function gfe(e,t){const n=new Qi(jce);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)=>(em(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=N,n.description=r,n}function tm(e){e.type===sd&&De(e,Vce),e.type===Wa&&De(e,qce),e.type===ad&&De(e,Wce),e.type===Ca&&De(e,Gce),e.type===Es&&De(e,Hce),De(e,kt,e.value)}function an(e){const t=On();(t.type!==Dn||t.value!==e)&&tm(t)}function Xe(e){return Ie.type===Dn&&Ie.value===e}function P1(e){return Ie.type===Es&&Ie.value===e}function pfe(){const e=[];for(N=Ie.start,an("[");!Xe("]");)Xe(",")?(On(),e.push(null)):(e.push($a()),Xe("]")||an(","));return On(),cfe(e)}function wF(){N=Ie.start;const e=On();return e.type===ad||e.type===Wa?(e.octal&&De(e,lL),xc(e)):vA(e.value)}function mfe(){var e,t,n,i;if(N=Ie.start,e=Ie,e.type===Ca)return n=wF(),an(":"),i=$a(),EF("init",n,i);if(e.type===sd||e.type===Dn)tm(e);else return t=wF(),an(":"),i=$a(),EF("init",t,i)}function yfe(){var e=[],t,n,i,r={},o=String;for(N=Ie.start,an("{");!Xe("}");)t=mfe(),t.key.type===uL?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?De({},Yce):r[i]=!0,e.push(t),Xe("}")||an(",");return an("}"),hfe(e)}function bfe(){an("(");const e=EA();return an(")"),e}const xfe={if:1};function vfe(){var e,t,n;if(Xe("("))return bfe();if(Xe("["))return pfe();if(Xe("{"))return yfe();if(e=Ie.type,N=Ie.start,e===Ca||xfe[Ie.value])n=vA(On().value);else if(e===ad||e===Wa)Ie.octal&&De(Ie,lL),n=xc(On());else{if(e===Es)throw new Error(ff);e===Q0?(t=On(),t.value=t.value==="true",n=xc(t)):e===Z0?(t=On(),t.value=null,n=xc(t)):Xe("/")||Xe("/=")?(n=xc(ufe()),hL()):tm(On())}return n}function Efe(){const e=[];if(an("("),!Xe(")"))for(;N<sn&&(e.push($a()),!Xe(")"));)an(",");return an(")"),e}function wfe(){N=Ie.start;const e=On();return lfe(e)||tm(e),vA(e.value)}function Afe(){return an("."),wfe()}function Sfe(){an("[");const e=EA();return an("]"),e}function Cfe(){var e,t,n;for(e=vfe();;)if(Xe("."))n=Afe(),e=vF(".",e,n);else if(Xe("("))t=Efe(),e=ffe(e,t);else if(Xe("["))n=Sfe(),e=vF("[",e,n);else break;return e}function AF(){const e=Cfe();if(Ie.type===Dn&&(Xe("++")||Xe("--")))throw new Error(ff);return e}function Sh(){var e,t;if(Ie.type!==Dn&&Ie.type!==Es)t=AF();else{if(Xe("++")||Xe("--"))throw new Error(ff);if(Xe("+")||Xe("-")||Xe("~")||Xe("!"))e=On(),t=Sh(),t=gfe(e.value,t);else{if(P1("delete")||P1("void")||P1("typeof"))throw new Error(ff);t=AF()}}return t}function SF(e){let t=0;if(e.type!==Dn&&e.type!==Es)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 $fe(){var e,t,n,i,r,o,s,a,u,l;if(e=Ie,u=Sh(),i=Ie,r=SF(i),r===0)return u;for(i.prec=r,On(),t=[e,Ie],s=Sh(),o=[u,i,s];(r=SF(Ie))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=xF(a,u,s),o.push(n);i=On(),i.prec=r,o.push(i),t.push(Ie),n=Sh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=xF(o[l-1].value,o[l-2],n),l-=2;return n}function $a(){var e,t,n;return e=$fe(),Xe("?")&&(On(),t=$a(),an(":"),n=$a(),e=dfe(e,t,n)),e}function EA(){const e=$a();if(Xe(","))throw new Error(ff);return e}function _fe(e){J=e,N=0,sn=J.length,Ie=null,hL();const t=EA();if(Ie.type!==sd)throw new Error("Unexpect token after expression.");return t}function ux(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...ux(e.object)),t.push(...ux(e.property))),t)}function gL(e){return e.object.type==="MemberExpression"?gL(e.object):e.object.name==="datum"}function pL(e){const t=_fe(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&gL(i)&&n.add(ux(i).slice(1).join("."))}),n}class wl extends ze{clone(){return new wl(null,this.model,ce(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Yg(this.model,this.filter,this),this._dependentFields=pL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Ffe(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=de(a)?a:a.type,l=Fe(a)?ce(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]=ce(c[h]??l[h])));const f=n[s]={...l,name:s,type:u,init:o.value,bind:o.bind,events:de(l.on)?ds(l.on,"scope"):ct(ce(l.on))};if(pr(f)&&(r++,r>1)){delete n[s];continue}const d=ce(o);for(const h of J0)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&j(Poe),n}function mL(e,t,n,i="datum"){const r=de(t)?t:t.param,o=Qe(r),s=_e(o+Sa);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"?")":`, ${_e(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function yL(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(Ioe(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(zoe(a,r,n,o))):o=a[0].field}return`${s.name}[${_e(bi(o))}]`}function kfe(e,t){for(const[n,i]of is(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Nn(new wl(t,e,{param:n}),r,it.Lookup,e.component.data.outputNodeRefCounts)}}function Yg(e,t,n){return Rc(t,i=>de(i)?i:Yse(i)?mL(e,i,n):E6(i))}function Dfe(e,t){if(e)return X(e)&&!Ro(e)?e.map(n=>Zw(n,t)).join(", "):e}function I1(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function vc(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const g=h,p=Zae[g],m=c[g];if(p&&p!==t&&p!=="both")delete c[g];else if(rd(m)){const{condition:y,...b}=m,x=ct(y),v=G_[g];if(v){const{vgProp:w,part:A}=v,E=[...x.map(S=>{const{test:C,..._}=S;return{test:Yg(null,C),..._}}),b];I1(c,A,w,E),delete c[g]}else if(v===null){const w={signal:x.map(A=>{const{test:E,...S}=A;return`${Yg(null,E)} ? ${k_(S)} : `}).join("")+k_(b)};c[g]=w}}else if(Q(m)){const y=G_[g];if(y){const{vgProp:b,part:x}=y;I1(c,x,b,m),delete c[g]}}we(["labelAlign","labelBaseline"],g)&&c[g]===null&&delete c[g]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Ue(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 g=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&Q(c.encode.labels.update.text)&&(g=ma(a,"datum.label",c.encode.labels.update.text.signal)),I1(c,"labels","text",{signal:g})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const g of Q6)e.hasAxisPart(g)||delete c.encode[g];Ue(c.encode)&&delete c.encode}const h=Dfe(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ft(l,0)}}}}function bL(e){const{axes:t}=e.component,n=[];for(const i of So)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 Tfe(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>vc(r,"grid",t)),...i.map(r=>vc(r,"grid",t)),...n.map(r=>vc(r,"main",t)),...i.map(r=>vc(r,"main",t))].filter(r=>r)}function CF(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([...B(s),...B(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${Mi(s[c])} : ${Mi(a[c])}`};return l}return t[r]})])}function Mfe(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:C6(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Q(n)?"axisOrient":`axis${Vf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:CF(a,i,e,n),vgAxisConfig:CF(u,i,e,n),axisConfigStyle:Ofe([...u,...a],i)}}function Ofe(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=ct(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function lx(e,t,n,i={}){var o;const r=ZN(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=i[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const $F={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Rfe(n,e),gridScale:({model:e,channel:t})=>Nfe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||vL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||xL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Pfe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Ife(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??Bfe({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:Ufe,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=EL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return t6(r?[q_(r)]:[],q(s)?[q_(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>jfe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??qfe(n,t)};function Rfe(e,t){return!Tt(e)&&q(t)&&!He(t==null?void 0:t.bin)&&!Nt(t==null?void 0:t.bin)}function Nfe(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Lfe(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return Q(o)?o:uf(o);{const{configValue:s}=lx("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?uf(s):n===et&&we([Uw,Bw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function cx(e){return`(((${e.signal} % 360) + 360) % 360)`}function xL(e,t,n,i){if(e!==void 0)if(n==="x"){if(Q(e)){const r=cx(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=cx(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 vL(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=cx(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 Pfe(e,t){if(t==="x"&&we(["quantitative","temporal"],e))return!0}function Ife(e,t,n,i){if(n&&!Fe(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function zfe(e){return e==="x"?"bottom":"left"}function Bfe({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!Tt(t)&&t!=="log"){if(q(e)){if(He(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&we(["month","hours","day","quarter"],(r=Dt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Ufe({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=b6(n);if(i)return{signal:i}}}}function EL(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 n6(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function jfe(e,t){const n=e.values;if(X(n))return J6(t,n);if(Q(n))return n}function qfe(e,t){return e==="rect"&&Bg(t)?1:0}class el extends ze{clone(){return new el(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=pL(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(qa(i)&&U6(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${E6({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new el(t,{calculate:u,as:tl(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 ${Ae(this.transform)}`}}function tl(e,t,n){return H(e,{prefix:t,suffix:"sort_index",...n})}function nm(e,t){return we(["top","bottom"],t)?"column":we(["left","right"],t)||e==="row"?"row":"column"}function nl(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 im(e,t,n,i){const r={};for(const o of e){const s=nl(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const wA=["row","column"],AA=["header","footer"];function Wfe(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}=im(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=nm(t,a),l=uf(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...AL(l,u),...wL(u,l,o),...SL(i,r,t,Eue,m4)}}}function wL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=vL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function AL(e,t){const n=xL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Gfe(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of AA)if(n[r])for(const o of n[r]){const s=Vfe(e,t,r,n,o);s!=null&&i.push(s)}return i}function Hfe(e,t){const{sort:n}=e;return so(n)?{field:H(n,{expr:"datum"}),order:n.order??"ascending"}:X(n)?{field:tl(e,t,{expr:"datum"}),order:"ascending"}:{field:H(e,{expr:"datum"}),order:n??"ascending"}}function fx(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=im(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Xw({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=nm(t,a);return{text:{signal:u?ma(ma(u,"datum.label",l),"datum.value",H(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...AL(o,c),...wL(c,o,s),...SL(n,e,t,wue,y4)}}function Vfe(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}=im(["labelOrient"],s.header,a,t);(t==="row"&&!we(["top","bottom"],f)||t==="column"&&!we(["left","right"],f))&&(o=fx(s,t,a))}const u=Zn(e)&&!ed(e.facet),l=r.axes,c=(l==null?void 0: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:Hfe(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 Yfe={column:{start:0,end:1},row:{start:1,end:0}};function Xfe(e,t){return Yfe[t][e]}function Kfe(e,t){const n={};for(const i of di){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=im(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=nm(i,s),u=Xfe(o,a);u!==void 0&&(n[a]=u)}}return Ue(n)?void 0:n}function SL(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=nl(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function SA(e){return[...jd(e,"width"),...jd(e,"height"),...jd(e,"childWidth"),...jd(e,"childHeight")]}function jd(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)&&Ba(a)){const u=e.scaleName(n);return Zn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[_F(u,a)]:[_F(u,a),{name:r,update:CL(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=Qb(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 _F(e,t){const n=`${e}_step`;return Q(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function CL(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}, ${Mi(s)}, ${Mi(o)}) * ${e}_step`}function $L(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function _L(e,t){return B(e).reduce((n,i)=>({...n,...El({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ye(r.value),invalidValueRef:void 0})}),{})}function FL(e,t){if(Zn(t))return e==="theta"?"independent":"shared";if(Cl(t))return"shared";if(TA(t))return dt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function CA(e,t){const n=e.scale[t],i=dt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(mse(t)),"independent"):e[i][t]||"shared"}const Jfe={...Cue,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},kL=B(Jfe);class Qfe extends $o{}const FF={symbols:Zfe,gradient:ede,labels:tde,entries:nde};function Zfe(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={...Soe({},n,vae),...X4(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,g=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,p=d===void 0?DL(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===Bn)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ye(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ye(p??1));else if(X(f.fill)){const m=dx(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ye(m))}}if(f.stroke){if(i==="stroke"||!c&&i===Bn)delete f.stroke;else if(U(f.stroke,"field")||g)delete f.stroke;else if(X(f.stroke)){const m=ft(dx(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Ao){const m=q(t)&&ML(n,r,t);m?f.opacity=[{test:m,...Ye(p??1)},Ye(u.legend.unselectedOpacity)]:p&&(f.opacity=Ye(p))}return f={...f,...e},Ue(f)?void 0:f}function ede(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?DL(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ye(l)),a={...a,...e},Ue(a)?void 0:a}function tde(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?ML(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;wa(c)?f=Oi({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=Oi({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=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ue(d)?void 0:d}function nde(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function DL(e){return TL(e,(t,n)=>Math.max(t,n.value))}function dx(e){return TL(e,(t,n)=>ft(t,n.value))}function TL(e,t){if(Uae(e))return ct(e.condition).reduce(t,e.value);if(Ui(e))return e.value}function ML(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=_e(n.field);return i.map(o=>`(!length(data(${_e(Qe(o)+Sa)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const kF={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 z6(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??lde(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??cde(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??rde(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>wu(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Eu(n)&&fr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>ide(t,e)};function ide(e,t){const n=e.values;if(X(n))return J6(t,n);if(Q(n))return n}function rde(e,t,n,i){if(t!=="shape"){const r=dx(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 ode(e){const{legend:t}=e;return ft(t.type,sde(e))}function sde({channel:e,timeUnit:t,scaleType:n}){if(Eu(e)){if(we(["quarter","month","day"],t))return"symbol";if(fr(n))return"gradient"}return"symbol"}function ade({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??ude(n,t)}function ude(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 lde({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(fr(r))return n==="horizontal"?i==="top"||i==="bottom"?DF(t,"width",s,o):s:DF(t,"height",u,a)}function DF(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function cde(e){if(we(["quantile","threshold","log","symlog"],e))return"greedy"}function OL(e){const t=nt(e)?fde(e):pde(e);return e.component.legends=t,t}function fde(e){const{encoding:t}=e,n={};for(const i of[Bn,...x4]){const r=xt(t[i]);!r||!e.getScaleComponent(i)||i===Un&&q(r)&&r.type===vl||(n[i]=gde(e,i))}return n}function dde(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 hde(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function gde(e,t){var v;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new Qfe({},dde(e,t));gce(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=xt(r[t]),f=q(c)?(v=Dt(c.timeUnit))==null?void 0:v.unit:void 0,d=n.orient||o.legend.orient||"right",h=ode({legend:n,channel:t,timeUnit:f,scaleType:l}),g=ade({legend:n,legendType:h,orient:d,legendConfig:s}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:g};for(const w of kL){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const A=w in kF?kF[w](p):n[w];if(A!==void 0){const E=hde(A,w,n,e.fieldDef(t));(E||o.legend[w]===void 0)&&a.set(w,A,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},x={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const A=_L(m[w]??{},e),E=w in FF?FF[w](A,x):A;E!==void 0&&!Ue(E)&&(b[w]={...y!=null&&y.length&&q(c)?{name:`${Qe(c.field)}_legend_${w}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Ue(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function pde(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){OL(i);for(const r of B(i.component.legends))n.legend[r]=CA(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=RL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of B(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function RL(e,t){var o,s,a,u;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 l of kL){const c=ss(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return mde(f,d);case"title":return i6(f,d);case"type":return r=!0,Wn("symbol")}return V0(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&Ng(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Ng(e.explicit,["encode","gradient"])),e}function mde(e,t){return t.value==="circle"?t:e}function yde(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function NL(e){const t=e.component.legends,n={};for(const r of B(t)){const o=e.getScaleComponent(r),s=je(o.get("domains"));if(n[s])for(const a of n[s])RL(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return qt(n).flat().map(r=>bde(r,e.config)).filter(r=>r!==void 0)}function bde(e,t){var s,a,u;const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const l=o.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!o.stroke&&(l.stroke={value:"transparent"});for(const c of x4)o[c]&&delete l[c]}if(o.title||delete o.title,i!==void 0){let l=i;(u=(a=o.encode)==null?void 0:a.labels)!=null&&u.update&&Q(o.encode.labels.update.text)&&(l=ma(i,"datum.label",o.encode.labels.update.text.signal)),yde(o,"labels","text",{signal:l})}return o}}function xde(e){return Cl(e)||TA(e)?vde(e):LL(e)}function vde(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),LL(e))}function LL(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 we(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 Ede=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class PL extends $o{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function IL(e){e.component.projection=nt(e)?wde(e):Cde(e)}function wde(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?Ade(e):void 0,o=new PL(e.projectionName(!0),{...Lt(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function Ade(e){const t=[],{encoding:n}=e;for(const i of[[Ki,Xi],[xi,Ji]])(xt(n[i[0]])||xt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Un)&&e.typedFieldDef(Un).type===vl&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(it.Main)),t}function Sde(e,t){const n=hw(Ede,r=>!!(!gt(e.explicit,r)&&!gt(t.explicit,r)||gt(e.explicit,r)&&gt(t.explicit,r)&&Xn(e.get(r),t.get(r))));if(Xn(e.size,t.size)){if(n)return e;if(Xn(e.explicit,{}))return t;if(Xn(t.explicit,{}))return e}return null}function Cde(e){if(e.children.length===0)return;let t;for(const i of e.children)IL(i);const n=hw(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=Sde(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 PL(i,t.specifiedProjection,t.size,ce(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 $de(e,t,n,i){if(id(t,n)){const r=nt(e)?e.axis(n)??e.legend(n)??{}:{},o=H(t,{expr:"datum"}),s=H(t,{expr:"datum",binSuffix:"end"});return{formulaAs:H(t,{binSuffix:"range",forAs:!0}),formula:Zf(o,s,r.format,r.formatType,i)}}return{}}function zL(e,t){return`${XN(e)}_${t}`}function _de(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function $A(e,t,n){const i=U0(n,void 0)??{},r=zL(i,t);return e.getName(`${r}_bins`)}function Fde(e){return"as"in e}function TF(e,t,n){let i,r;Fde(e)?i=de(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[H(e,{forAs:!0}),H(e,{binSuffix:"end",forAs:!0})];const o={...U0(t,void 0)},s=zL(o,e.field),{signal:a,extentSignal:u}=_de(n,s);if(D0(o.extent)){const c=o.extent;r=yL(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 mr extends ze{clone(){return new mr(null,ce(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(Cn(o)&&He(o.bin)){const{key:a,binComponent:u}=TF(o,o.bin,n);r[a]={...u,...r[a],...$de(n,o,s,n.config)}}return r},{});return Ue(i)?null:new mr(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=TF(n,n.bin,i);return new mr(t,{[r]:o})}merge(t,n){for(const i of B(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=cr([...this.bins[i].as,...t.bins[i].as],Ae)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(qt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(qt(this.bins).map(t=>t.field))}hash(){return`Bin ${Ae(this.bins)}`}assemble(){return qt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:bi(t.field),as:i,signal:t.signal,...D0(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:bi(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:H({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function kde(e,t,n,i){var o;const r=nt(i)?i.encoding[Rr(t)]:void 0;if(Cn(n)&&nt(i)&&q6(n,r,i.markDef,i.config)){e.add(H(n,{})),e.add(H(n,{suffix:"end"}));const{mark:s,markDef:a,config:u}=i,l=os({fieldDef:n,markDef:a,config:u});lf(s)&&l!==.5&&dt(t)&&(e.add(H(n,{suffix:Y0})),e.add(H(n,{suffix:X0}))),n.bin&&id(n,t)&&e.add(H(n,{binSuffix:"range"}))}else if(BN(t)){const s=zN(t);e.add(i.getName(s))}else e.add(H(n));return qa(n)&&aae((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function Dde(e,t){for(const n of B(t)){const i=t[n];for(const r of B(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Ni extends ze{clone(){return new Ni(null,new Set(this.dimensions),ce(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["*"]={}),r["*"].count=new Set([H(s,{forAs:!0})]);else{if(go(u)||xs(u)){const c=go(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([H({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([H(s,{forAs:!0})]);Nr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([H({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([H({field:l,aggregate:"max"},{forAs:!0})]))}else kde(o,a,s,n)}),o.size+B(r).length===0)?null:new Ni(t,o,r)}static makeFromTransform(t,n){var i;const r=new Set,o={};for(const s of n.aggregate){const{op:a,field:u,as:l}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([l||H(s,{forAs:!0})])):(o[u]??(o[u]={}),(i=o[u])[a]??(i[a]=new Set),o[u][a].add(l||H(s,{forAs:!0}))))}for(const s of n.groupby??[])r.add(s);return r.size+B(o).length===0?null:new Ni(t,r,o)}merge(t){return TN(this.dimensions,t.dimensions)?(Dde(this.measures,t.measures),!0):(Mse("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...B(this.measures)])}producedFields(){const t=new Set;for(const n of B(this.measures))for(const i of B(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 ${Ae({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of B(this.measures))for(const s of B(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:bi(o));return{type:"aggregate",groupby:[...this.dimensions].map(bi),ops:t,fields:n,as:i}}}class Al extends ze{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of di){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[H(s),...He(a)?[H(s,{binSuffix:"end"})]:[]],...so(u)?{sortField:u}:X(u)?{sortIndexField:tl(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of di)this[n]&&(t+=` ${n.charAt(0)}:${Ae(this[n])}`);return t}get fields(){var n;const t=[];for(const i of di)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of di)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 So){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(Tt(r)&&Ba(o)){const s=rm(this.childModel,n),a=DA(s);a?t[n]=a:j(_w(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=I0,field:f}=u;o.push(f),s.push(c),a.push(H(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){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const l of wA){for(const c of AA){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}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[oo,ro])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function MF(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Tde(e,t){const n=mw(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=MF(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=MF(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(Uoe(t)),null}function Mde(e){const t={};return wh(e.filter,n=>{if(v6(n)){let i=null;Ow(n)?i=Vn(n.equal):Nw(n)?i=Vn(n.lte):Rw(n)?i=Vn(n.lt):Lw(n)?i=Vn(n.gt):Pw(n)?i=Vn(n.gte):Iw(n)?i=n.range[0]:zw(n)&&(i=(n.oneOf??n.in)[0]),i&&(Ua(i)?t[n.field]="date":Ze(i)?t[n.field]="number":de(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Ode(e){const t={};function n(i){Ju(i)?t[i.field]="date":i.type==="quantitative"&&poe(i.aggregate)?t[i.field]="number":Gu(i.field)>1?i.field in t||(t[i.field]="flatten"):qa(i)&&so(i.sort)&&Gu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((nt(e)||Zn(e))&&e.forEachFieldDef((i,r)=>{if(Cn(i))n(i);else{const o=Ia(r),s=e.fieldDef(o);n({...i,type:s.type})}}),nt(e)){const{mark:i,markDef:r,encoding:o}=e;if(vs(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 Rde(e){const t={};if(nt(e)&&e.component.selection)for(const n of B(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Gu(r.field)>1&&(t[r.field]="flatten")}return t}class tn extends ze{clone(){return new tn(null,ce(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Ae(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!Xo(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of B(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(N_(a,i[a],u.value)))}for(const a of B(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(N_(a,n[a],u)))}const o=new $o(n,i);r.copyAll(o);const s={};for(const a of B(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return B(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 B(this._parse)){const i=this._parse[n];Gu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(B(this._parse))}dependentFields(){return new Set(B(this._parse))}assembleTransforms(t=!1){return B(this._parse).filter(n=>t?Gu(n)>1:!0).map(n=>{const i=Tde(n,this._parse[n]);return i?{type:"formula",expr:i,as:bl(n)}:null}).filter(n=>n!==null)}}class as extends ze{clone(){return new as(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([qi])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:qi}}}class ld extends ze{clone(){return new ld(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Ae(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class cd extends ze{clone(){return new cd(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 ${Ae(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class _a extends ze{constructor(t){super(null),t??(t={name:"source"});let n;if(Xo(t)||(n=t.format?{...Rn(t.format,["parse"])}:{}),cf(t))this._data={values:t.values};else if(Qu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];we(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else P4(t)?this._data={values:[{type:"Sphere"}]}:(N4(t)||Xo(t))&&(this._data={});this._generator=Xo(t),t.name&&(this._name=t.name),n&&!Ue(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:[]}}}var OF=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Nde=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},Ec;function _A(e){return e instanceof _a||e instanceof ld||e instanceof cd}class FA{constructor(){Ec.set(this,void 0),OF(this,Ec,!1,"f")}setModified(){OF(this,Ec,!0,"f")}get modifiedFlag(){return Nde(this,Ec,"f")}}Ec=new WeakMap;class Ga extends FA{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 kA extends FA{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Lde extends kA{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 B(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Pde extends kA{constructor(t){super(),this.requiresSelectionId=t&&bA(t)}run(t){t instanceof as&&(this.requiresSelectionId&&(_A(t.parent)||t.parent instanceof Ni||t.parent instanceof tn)||(this.setModified(),t.remove()))}}class Ide extends FA{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof gr&&(i=t.producedFields(),gw(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 zde extends kA{constructor(){super()}run(t){t instanceof Nn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Bde extends Ga{run(t){if(!_A(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(pw(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Ude extends Ga{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 B(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!Ue(r)){this.setModified();const s=new tn(t,r);for(const a of n){if(a instanceof tn)for(const u of B(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof tn&&B(a.parse).length===0&&a.remove()}}}}}class jde extends Ga{run(t){t instanceof Nn||t.numChildren()>0||t instanceof Al||t instanceof _a||(this.setModified(),t.remove())}}class qde extends Ga{run(t){const n=t.children.filter(r=>r instanceof gr),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Wde extends Ga{run(t){const n=t.children.filter(r=>r instanceof Ni),i={};for(const r of n){const o=Ae(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of B(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 Gde extends Ga{constructor(t){super(),this.model=t}run(t){const n=!(_A(t)||t instanceof wl||t instanceof tn||t instanceof as),i=[],r=[];for(const o of t.children)o instanceof mr&&(n&&!pw(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 mr?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 Hde extends Ga{run(t){const n=[...t.children];if(!Wu(n,s=>s instanceof Nn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof Nn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof Nn)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 Ha extends ze{clone(){return new Ha(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr(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??H(t)}hash(){return`JoinAggregateTransform ${Ae(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 il extends ze{clone(){return new il(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:g}=c,p=Hw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:k0(g)});p!=="show"&&p!=="always-valid"&&(l[c.field]=c)}return l},{});return B(u).length?new il(t,u):null}dependentFields(){return new Set(B(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Ae(this.filter)}`}assemble(){const t=B(this.filter).reduce((n,i)=>{const r=this.filter[i],o=H(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${hx(o)}))`):r.type==="quantitative"&&n.push(hx(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function hx(e){return`isValid(${e}) && isFinite(+${e})`}function Vde(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=H(i);return r&&t.push(r),t},[])}function Yde(e){return X(e)&&e.every(t=>de(t))&&e.length>1}class uo extends ze{clone(){return new uo(null,ce(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 Yde(o)?c=o:de(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new uo(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 g=r[h];return ji(g)}).filter(h=>!!h),c=Vde(n),f=n.encoding.order;let d;if(X(f)||q(f))d=e6(f);else{const h=W6(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((g,p)=>(g.field.includes(p)||(g.field.push(p),g.order.push(h)),g),{field:[],order:[]})}return new uo(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 ${Ae(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[H(r,{binSuffix:"mid"})]:[H(r,{}),H(r,{binSuffix:"end"})]:[H(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=H(c,{expr:"datum"}),g=H(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${hx(h)} ? ${f}*${h}+${1-f}*${g} : ${h}`,as:H(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:H(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 Sl extends ze{clone(){return new Sl(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr(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??H(t)}hash(){return`WindowTransform ${Ae(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=>Cw(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 Xde(e){function t(n){if(!(n instanceof Al)){const i=n.clone();if(i instanceof Nn){const r=px+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Ni||i instanceof uo||i instanceof Sl||i instanceof Ha)&&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 gx(e){if(e instanceof Al)if(e.numChildren()===1&&!(e.children[0]instanceof Nn)){const t=e.children[0];(t instanceof Ni||t instanceof uo||t instanceof Sl||t instanceof Ha)&&t.addDimensions(e.fields),t.swapWithParent(),gx(e)}else{const t=e.model.component.data.main;BL(t);const n=Xde(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(gx)}function BL(e){if(e instanceof Nn&&e.type===it.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Al||(t.swapWithParent(),BL(e))}}const px="scale_",qd=5;function mx(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!mx(t.children))return!1}return!0}function Ai(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function RF(e,t,n){let i=e.sources,r=!1;return r=Ai(new zde,i)||r,r=Ai(new Pde(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=Ai(new jde,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=Ai(new Bde,i)||r,r=Ai(new Gde(t),i)||r,r=Ai(new Ide,i)||r,r=Ai(new Ude,i)||r,r=Ai(new Wde,i)||r,r=Ai(new qde,i)||r,r=Ai(new Lde,i)||r,r=Ai(new Hde,i)||r),e.sources=i,r}function Kde(e,t){mx(e.sources);let n=0,i=0;for(let r=0;r<qd&&RF(e,t,!0);r++)n++;e.sources.map(gx);for(let r=0;r<qd&&RF(e,t,!1);r++)i++;mx(e.sources),Math.max(n,i)===qd&&j(`Maximum optimization runs(${qd}) reached.`)}class Ct{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new Ct(()=>t(n))}}function UL(e){nt(e)?Jde(e):Qde(e)}function Jde(e){const t=e.component.scales;for(const n of B(t)){const i=ehe(e,n);if(t[n].setWithExplicit("domains",i),nhe(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)eo(a)&&(a.data=px+a.data.replace(px,""))}}}function Qde(e){for(const n of e.children)UL(n);const t=e.component.scales;for(const n of B(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=ss(i,s.getWithExplicit("domains"),"domains","scale",yx);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(Roe),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Zde(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=NF(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=NF(t,n);if(r)return"unaggregated"}return e}function ehe(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Zde(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"&&xt(i.x2)?xt(i.x)?ss(Do(n,r,e,"x"),Do(n,r,e,"x2"),"domain","scale",yx):Do(n,r,e,"x2"):t==="y"&&xt(i.y2)?xt(i.y)?ss(Do(n,r,e,"y"),Do(n,r,e,"y2"),"domain","scale",yx):Do(n,r,e,"y2"):Do(n,r,e,t)}function the(e,t,n){return e.map(i=>({signal:`{data: ${j0(i,{timeUnit:n,type:t})}}`}))}function z1(e,t,n){var r;const i=(r=Dt(n))==null?void 0:r.unit;return t==="temporal"||i?the(e,t,i):[e]}function Do(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=xt(r[i]),{type:c}=l,f=l.timeUnit,d=Ile({invalid:Ar("invalid",o,a),isPath:vs(s)});if(sae(t)){const p=Do(e,void 0,n,i),m=z1(t.unionWith,c,f);return or([...m,...p.value])}else{if(Q(t))return or([t]);if(t&&t!=="unaggregated"&&!_6(t))return or(z1(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Wn([[0,1]]);const p=n.requestDataName(d);return Wn([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const h=Nr(i)&&q(l)?ihe(n,i,e):void 0;if(Lr(l)){const p=z1([l.datum],c,f);return Wn(p)}const g=l;if(t==="unaggregated"){const{field:p}=l;return Wn([{data:n.requestDataName(d),field:H({field:p,aggregate:"min"})},{data:n.requestDataName(d),field:H({field:p,aggregate:"max"})}])}else if(He(g.bin)){if(Tt(e))return Wn(e==="bin-ordinal"?[]:[{data:af(h)?n.requestDataName(d):n.requestDataName(it.Raw),field:n.vgField(i,id(g,i)?{binSuffix:"range"}:{}),sort:h===!0||!Fe(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:p}=g;if(He(p)){const m=$A(n,g.field,p);return Wn([new Ct(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Wn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&we(["time","utc"],e)){const p=r[Rr(i)];if(q6(g,p,o,a)){const m=n.requestDataName(d),y=os({fieldDef:g,fieldDef2:p,markDef:o,config:a}),b=lf(s)&&y!==.5&&dt(i);return Wn([{data:m,field:n.vgField(i,b?{suffix:Y0}:{})},{data:m,field:n.vgField(i,{suffix:b?X0:"end"})}])}}return Wn(h?[{data:af(h)?n.requestDataName(d):n.requestDataName(it.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function B1(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":I0),...i?{field:bi(i)}:{},...r?{order:r}:{}}}function nhe(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,o=_6(i)?i:void 0,s=za(r)&&D0(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function ihe(e,t,n){if(!Tt(n))return;const i=e.fieldDef(t),r=i.sort;if(U6(r))return{op:"min",field:tl(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(so(r)){const a=o&&!s.has(r.field);return B1(r,a)}else if(Iae(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(go(c)||xs(c))return B1({field:H(l),order:u},d);if(Cw(c)||!c)return B1({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(we(["ascending",void 0],r))return!0}}function NF(e,t){const{aggregate:n,type:i}=e;return n?de(n)&&!yoe.has(n)?{valid:!1,reason:lse(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:cse(e)}:{valid:!0}:{valid:!1,reason:use(e)}}function yx(e,t,n,i){return e.explicit&&t.explicit&&j(pse(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function rhe(e){const t=cr(e.map(s=>{if(eo(s)){const{sort:a,...u}=s;return u}return s}),Ae),n=cr(e.map(s=>{if(eo(s)){const a=s.sort;return a!==void 0&&!af(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Ae);if(t.length===0)return;if(t.length===1){const s=e[0];if(eo(s)&&n.length>0){let a=n[0];if(n.length>1){j(P_);const u=n.filter(l=>Fe(l)&&"op"in l&&l.op!=="min");n.every(l=>Fe(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Fe(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=cr(n.map(s=>af(s)||!("op"in s)||de(s.op)&&gt(hoe,s.op)?s:(j(yse(s)),!0)),Ae);let r;i.length===1?r=i[0]:i.length>1&&(j(P_),r=!0);const o=cr(e.map(s=>eo(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 DA(e){if(eo(e)&&de(e.field))return e.field;if(boe(e)){let t;for(const n of e.fields)if(eo(n)&&de(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(bse),t}return j(xse),t}else if(xoe(e)){j(vse);const t=e.fields[0];return de(t)?t:void 0}}function rm(e,t){const i=e.component.scales[t].get("domains").map(r=>(eo(r)&&(r.data=e.lookupDataSource(r.data)),r));return rhe(i)}function jL(e){return Cl(e)||TA(e)?e.children.reduce((t,n)=>t.concat(jL(n)),LF(e)):LF(e)}function LF(e){return B(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=ohe(r.range,o,n,e),h=rm(e,n),g=a?Xle(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...g?{domainRaw:g}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function ohe(e,t,n,i){if(dt(n)){if(Ba(e))return{step:{signal:`${t}_step`}}}else if(Fe(e)&&eo(e))return{...e,data:i.lookupDataSource(e.data)};return e}class qL extends $o{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(we([Pt.LOG,Pt.TIME,Pt.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&we([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 she=["range","scheme"];function ahe(e){const t=e.component.scales;for(const n of Sw){const i=t[n];if(!i)continue;const r=uhe(n,e);i.setWithExplicit("range",r)}}function PF(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=jn(t),s=e.getName(o);if(Fe(i)&&i.binned&&i.step!==void 0)return new Ct(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(s)} / (${u})`});if(He(i)){const a=$A(e,r,i);return new Ct(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function uhe(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of she)if(n[f]!==void 0){const d=Xb(o,f),h=F6(e,f);if(!d)j(a6(o,f,e));else if(h)j(h);else switch(f){case"range":{const g=n.range;if(X(g)){if(dt(e))return or(g.map(p=>{if(p==="width"||p==="height"){const m=t.getName(p),y=t.getSignalName.bind(t);return Ct.fromName(y,m)}return p}))}else if(Fe(g))return or({data:t.requestDataName(it.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return or(g)}case"scheme":return or(lhe(n[f]))}}const s=e===et||e==="xOffset"?"width":"height",a=i[s];if(Cr(a)){if(dt(e))if(Tt(o)){const f=GL(a,t,e);if(f)return or({step:f})}else j(u6(s));else if(Kf(e)){const f=e===hs?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=HL(a,o);if(g)return or(g)}}}const{rangeMin:u,rangeMax:l}=n,c=che(e,t);return(u!==void 0||l!==void 0)&&Xb(o,"rangeMin")&&X(c)&&c.length===2?or([u??c[0],l??c[1]]):Wn(c)}function lhe(e){return oae(e)?{scheme:e.name,...Rn(e,["name"])}:{scheme:e}}function WL(e,t,n,{center:i}={}){const r=jn(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===Ot&&Bi(n)?i?[Ct.fromName(a=>`${s(a)}/2`,o),Ct.fromName(a=>`-${s(a)}/2`,o)]:[Ct.fromName(s,o),0]:i?[Ct.fromName(a=>`-${s(a)}/2`,o),Ct.fromName(a=>`${s(a)}/2`,o)]:[0,Ct.fromName(s,o)]}function che(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=xt(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case et:case Ot:{if(we(["point","band"],u)){const f=VL(e,n,i.view);if(Cr(f))return{step:GL(f,t,e)}}return WL(e,t,u)}case hs:case xl:return fhe(e,t,u);case wo:{const f=ghe(r,i),d=phe(r,n,t,i);return Yu(u)?hhe(f,d,dhe(u,i,l,e)):[f,d]}case Ei:return[0,Math.PI*2];case Pa:return[0,360];case Yi:return[0,new Ct(()=>{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 gs:return{step:1e3/i.scale.framesPerSecond};case ys:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case bs:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Un:return"symbol";case Bn:case Mr:case Or:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Ao:case ps:case ms:return[i.scale.minOpacity,i.scale.maxOpacity]}}function GL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=vw(n),s=i[o];if(E4({step:e,offsetIsDiscrete:fe(s)&&w6(s.type)})==="offset"&&t4(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-${Aoe(f)})`}}else return e.step}function HL(e,t){if(E4({step:e,offsetIsDiscrete:Tt(t)})==="offset")return{step:e.step}}function fhe(e,t,n){const i=e===hs?"x":"y",r=t.getScaleComponent(i);if(!r)return WL(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=VL(i,t.size,t.config.view);if(Cr(l)){const c=HL(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=b6(l.timeUnit,g=>`scale('${s}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=os({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const g=Q(f)?`${f.signal}/2`+h:`${f/2+d}`,p=Q(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${g} * (${c})`},{signal:`${p} * (${c})`}]}return[0,{signal:c}]}return kN(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function VL(e,t,n){const i=e===et?"width":"height",r=t[i];return r||Wg(n,i)}function dhe(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(kse(i)),3)}}function hhe(e,t,n){const i=()=>{const r=Mi(t),o=Mi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return Q(t)?new Ct(i):{signal:i()}}function ghe(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(T0("size",e))}const IF=.95;function phe(e,t,n,i){const r={x:PF(n,"x"),y:PF(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=zF(t,r,i.view);return Ze(o)?o-1:new Ct(()=>`${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=zF(t,r,i.view);return Ze(o)?Math.pow(IF*o,2):new Ct(()=>`pow(${IF} * ${o.signal}, 2)`)}}throw new Error(T0("size",e))}function zF(e,t,n){const i=Cr(e.width)?e.width.step:Zb(n,"width"),r=Cr(e.height)?e.height.step:Zb(n,"height");return t.x||t.y?new Ct(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function YL(e,t){nt(e)?mhe(e,t):KL(e,t)}function mhe(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of B(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=xt(r[a]),d=u[t],h=c.get("type"),g=c.get("padding"),p=c.get("paddingInner"),m=Xb(h,t),y=F6(a,t);if(d!==void 0&&(m?y&&j(y):j(a6(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,x=f.type;switch(t){case"domainMax":case"domainMin":Ua(u[t])||x==="temporal"||b?l.set(t,{signal:j0(u[t],{type:x,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(BF,t)?BF[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:g,scalePaddingInner:p,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:n4(r,a),hasSecondaryRangeChannel:!!r[Rr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const BF={bins:({model:e,fieldOrDatumDef:t})=>q(t)?yhe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>bhe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>xhe(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>vhe(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>Ehe(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>whe(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 Ahe(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>She(e,t,n,i,r,o.scale,s)};function XL(e){nt(e)?ahe(e):KL(e,"range")}function KL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?XL(i):YL(i,t);for(const i of B(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=ss(r,a,t,"scale",R4((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function yhe(e,t){const n=t.bin;if(He(n)){const i=$A(e,t.field,n);return new Ct(()=>e.getSignalName(i))}else if(Nt(n)&&za(n)&&n.step!==void 0)return{step:n.step}}function bhe(e,t){if(we([Bn,Mr,Or],e)&&t!=="nominal")return"hcl"}function xhe(e,t,n,i,r,o){var s;if(!((s=ji(o))!=null&&s.bin||X(n)||r!=null||i!=null||we([Pt.TIME,Pt.UTC],e)))return dt(t)?!0:void 0}function vhe(e,t,n,i,r,o){if(dt(e)){if(fr(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 Ehe(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(Kf(t)&&i===Pt.BAND)return r.offsetBandPaddingInner}}function whe(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(Kf(t)){if(n===Pt.POINT)return .5;if(n===Pt.BAND)return r.offsetBandPaddingOuter}}}function Ahe(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Bi(e)&&t==="descending"?Q(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Bi(e)&&t==="descending")return!0}function She(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Bi(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"&&!Yu(r))return!0;if(!(q(t)&&t.bin)&&we([...So,...roe],e)){const{orient:u,type:l}=i;return we(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:we(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function Che(e,t,n,i,r=!1){const o=$he(t,n,i,r),{type:s}=e;return Nr(t)?s!==void 0?dae(t,s)?q(n)&&!fae(s,n.type)?(j(hse(s,o)),o):s:(j(dse(t,s,o)),o):o:null}function $he(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Eu(e)||C1(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j($1(e,"ordinal")),"ordinal";if(S1(e))return"band";if(dt(e)||Kf(e)){if(we(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in Aw)return"band";const o=n[jn(e)];return Ea(o)||Ku(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Eu(e)?"time":C1(e)==="discrete"?(j($1(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&Dt(t.timeUnit).utc?"utc":S1(e)?"band":"time";case"quantitative":return Eu(e)?q(t)&&He(t.bin)?"bin-ordinal":"linear":C1(e)==="discrete"?(j($1(e,"quantitative")),"ordinal"):S1(e)?"band":"linear";case"geojson":return}throw new Error(o6(t.type))}function _he(e,{ignoreRange:t}={}){JL(e),UL(e);for(const n of cae)YL(e,n);t||XL(e)}function JL(e){nt(e)?e.component.scales=Fhe(e):e.component.scales=Dhe(e)}function Fhe(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of Sw){const s=xt(t[o]);if(s&&n===T6&&o===Un&&s.type===vl)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=n4(t,o),l=Che(a,o,s,i,u);r[o]=new qL(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const khe=R4((e,t)=>z_(e)-z_(t));function Dhe(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){JL(o);for(const s of B(o.component.scales))if((t=r.scale)[s]??(t[s]=FL(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?eae(a.value,u.value)?i[s]=ss(a,u,"type","scale",khe):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of B(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new qL(s,a);for(const u of e.children){const l=u.component.scales[o];l&&(u.renameScale(l.get("name"),s),l.merged=!0)}}return n}class U1{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 nt(e){return(e==null?void 0:e.type)==="unit"}function Zn(e){return(e==null?void 0:e.type)==="facet"}function TA(e){return(e==null?void 0:e.type)==="concat"}function Cl(e){return(e==null?void 0:e.type)==="layer"}class MA{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=Ro(t.title)?{text:t.title}:t.title?Lt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new U1,this.projectionNameMap=i?i.projectionNameMap:new U1,this.signalNameMap=i?i.signalNameMap:new U1,this.data=t.data,this.description=t.description,this.transforms=$le(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Due(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:z0(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new $o,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?ce(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(){_he(this)}parseProjection(){IL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){OL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of B(i)){const s=i[o];s!==void 0&&(r[o]=Ye(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ye(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ue(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=Kfe(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 di)t[i].title&&n.push(Wfe(this,i));for(const i of wA)n=n.concat(Gfe(this,i));return n}assembleAxes(){return Tfe(this.component.axes,this.config)}assembleLegends(){return NL(this)}assembleProjections(){return xde(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...KN(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return we(["unit","layer"],this.type)?we(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Ue(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)?jL(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(it[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=$L(t),i=F0(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(Tt(o)&&Ba(s)){const a=r.get("name"),u=rm(this,i),l=DA(u);if(l){const c=H({aggregate:"distinct",field:l},{expr:"datum"});return{signal:CL(a,r,c)}}else return j(_w(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(jN(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(Foe(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class QL extends MA{vgField(t,n={}){const i=this.fieldDef(t);if(i)return H(i,n)}reduceFieldDef(t,n){return oue(this.getMapping(),(i,r,o)=>{const s=ji(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){tA(this.getMapping(),(i,r)=>{const o=ji(i);o&&t(o,r)},n)}}class om extends ze{clone(){return new om(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class sm extends ze{clone(){return new sm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Ae(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class am extends ze{clone(){return new am(this.parent,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class um extends ze{clone(){return new um(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Su extends ze{clone(){return new Su(null,ce(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[[Ki,Xi],[xi,Ji]]){const o=r.map(s=>{const a=xt(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 Su(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Un)){const r=n.typedFieldDef(Un);r.type===vl&&(t=new Su(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(de);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Ae(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 hf extends ze{clone(){return new hf(null,this.projection,ce(this.fields),ce(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[[Ki,Xi],[xi,Ji]]){const r=i.map(s=>{const a=xt(n.encoding[s]);return q(a)?a.field:Lr(a)?{expr:`${a.datum}`}:Ui(a)?{expr:`${a.value}`}:void 0}),o=i[0]===xi?"2":"";(r[0]||r[1])&&(t=new hf(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(de))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Ae(this.fields)} ${Ae(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class na extends ze{clone(){return new na(null,ce(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 na(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=o4(n.mark,i);return new na(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 ${Ae(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:ale(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 lm extends ze{clone(){return new lm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class gf extends ze{clone(){return new gf(null,ce(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(ule(s)){let u=t8(s.data,o);u||(u=new _a(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new Nn(u,l,it.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(lle(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Qe(u),u)}catch{throw new Error(Moe(u))}if(a=l.materialized,!a)throw new Error(Ooe(u))}return new gf(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 ${Ae({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;de(n)||(j(Woe),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 cm extends ze{clone(){return new cm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class fm extends ze{clone(){return new fm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class dm extends ze{clone(){return new dm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Ae(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 hm extends ze{clone(){return new hm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Ae(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function ZL(e){let t=0;function n(i,r){if(i instanceof _a&&!i.isGenerator&&!Qu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof tn&&(i.parent instanceof _a&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Al){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 ld||i instanceof cd||i instanceof il||i instanceof wl||i instanceof el||i instanceof hf||i instanceof Ni||i instanceof gf||i instanceof Sl||i instanceof Ha||i instanceof um||i instanceof am||i instanceof om||i instanceof lm||i instanceof cm||i instanceof fm||i instanceof as||i instanceof hm||i instanceof dm||i instanceof sm)&&r.transform.push(i.assemble()),(i instanceof mr||i instanceof gr||i instanceof na||i instanceof uo||i instanceof Su)&&r.transform.push(...i.assemble()),i instanceof Nn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Nn?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 Nn&&(!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 The(e){const t=[],n=ZL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Mhe(e,t){const n=[],i=ZL(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 Ohe(e){return e==="top"||e==="left"||Q(e)?"header":"footer"}function Rhe(e){for(const t of di)Nhe(e,t);UF(e,"x"),UF(e,"y")}function Nhe(e,t){var s;const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],u=nl("title",null,i,t);let l=wu(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=X(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=nl("labelOrient",a.header,i,t),f=a.header!==null?ft((s=a.header)==null?void 0:s.labels,i.header.labels,!0):!1,d=we(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[e8(e,t,f)]}}}function e8(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 UF(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=CA(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=Ohe(a.get("orient"));s[u]??(s[u]=[e8(e,o,!1)]);const l=vc(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function Lhe(e){OA(e),Xg(e,"width"),Xg(e,"height")}function Phe(e){OA(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Xg(e,t),Xg(e,n)}function OA(e){for(const t of e.children)t.parseLayoutSize()}function Xg(e,t){const n=$L(t),i=F0(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]??FL(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=ss(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 Ihe(e){const{size:t,component:n}=e;for(const i of So){const r=jn(i);if(t[r]){const o=t[r];n.layoutSize.set(r,Cr(o)?"step":o,!0)}else{const o=zhe(e,r);n.layoutSize.set(r,o,!1)}}}function zhe(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=Wg(i.view,t);return Ba(s)||Cr(a)?"step":a}else return Qb(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Qb(i.view,t);{const o=Wg(i.view,t);return Cr(o)?o.step:o}}}function bx(e,t,n){return H(t,{suffix:`by_${H(e)}`,...n})}class Pc extends QL{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=IA(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ed(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=B(t),i={};for(const r of n){if(![ro,oo].includes(r)){j(T0(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Vb(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=eA(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=gm(this),this.child.parseData()}parseLayoutSize(){OA(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Rhe(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 di)for(const i of AA){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=nl("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=nm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(o!=null&&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]={}),t[u][n]=.5),r.title&&(t.offset??(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 Pc))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Pc?{...this.channelHasField("column")?{encode:{update:{columns:{field:H(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof Pc){if(this.child.channelHasField("column")){const r=H(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of So){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Tt(s)&&Ba(a)){const u=rm(this.child,r),l=DA(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(_w(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 di){const f=this.facet[c];if(f){u.push(H(f));const{bin:d,sort:h}=f;if(He(d)&&u.push(H(f,{binSuffix:"end"})),so(h)){const{field:g,op:p=I0}=h,m=bx(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(g),s.push(p),a.push(m))}else if(X(h)){const g=tl(f,c);o.push(g),s.push("max"),a.push(g)}}}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?so(i.sort)?[bx(i,i.sort,{expr:"datum"})]:X(i.sort)?[tl(i,t,{expr:"datum"})]:[H(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(so(r)?r.order:!X(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return fx(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of wA)if(t[o]){const s=nl("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return fx(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=The(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:di.map(u=>this.facetSortFields(u)).flat(),order:di.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Gle(this,[]))}]}getMapping(){return this.facet}}function Bhe(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(so(o.sort)){const{field:s,op:a=I0}=o.sort;e=r=new Ha(e,{joinaggregate:[{op:a,field:s,as:bx(o,o.sort,{forAs:!0})}],groupby:[H(o)]})}return r}return null}function t8(e,t){var n,i,r,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((u||f)&&u!==f)){if(cf(e)&&cf(a)){if(Xn(e.values,a.values))return s}else if(Qu(e)&&Qu(a)){if(e.url===a.url)return s}else if(N4(e)&&e.name===s.dataName)return s}}return null}function Uhe(e,t){if(e.data||!e.parent){if(e.data===null){const i=new _a({values:[]});return t.push(i),i}const n=t8(e.data,t);if(n)return Xo(e.data)||(n.data.format=DN({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new _a(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 jhe(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(xle(r))s=e=new el(e,r),o="derived";else if(dA(r)){const a=Mde(r);s=e=tn.makeWithAncestors(e,{},a,n)??e,e=new wl(e,t,r.filter)}else if(D4(r))s=e=mr.makeFromTransform(e,r,t),o="number";else if(Ele(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=gr.makeFromTransform(e,r);else if(wle(r))s=e=Ni.makeFromTransform(e,r),o="number",bA(t)&&(e=new as(e));else if(k4(r))s=e=gf.make(e,t,r,i++),o="derived";else if(mle(r))s=e=new Sl(e,r),o="number";else if(yle(r))s=e=new Ha(e,r),o="number";else if(Ale(r))s=e=uo.makeFromTransform(e,r),o="derived";else if(Sle(r))s=e=new um(e,r),o="derived";else if(Cle(r))s=e=new sm(e,r),o="derived";else if(ble(r))s=e=new am(e,r),o="derived";else if(cle(r))s=e=new dm(e,r),o="derived";else if(ple(r))e=new hm(e,r);else if(vle(r))s=e=na.makeFromTransform(e,r),o="derived";else if(fle(r))s=e=new om(e,r),o="derived";else if(dle(r))s=e=new cm(e,r),o="derived";else if(hle(r))s=e=new fm(e,r),o="derived";else if(gle(r))s=e=new lm(e,r),o="derived";else{j(qoe(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function gm(e){var m;let t=Uhe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(Xo(r)||Qu(r)||cf(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Ple;Xo(r)?(L4(r)?t=new cd(t,r.sequence):hA(r)&&(t=new ld(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=tn.makeExplicit(t,e,s)??t,t=new as(t);const a=e.parent&&Cl(e.parent);(nt(e)||Zn(e))&&a&&(t=mr.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=jhe(t,e,s));const u=Rde(e),l=Ode(e);t=tn.makeWithAncestors(t,{},{...u,...l},s)??t,nt(e)&&(t=Su.parseAll(t,e),t=hf.parseAll(t,e)),(nt(e)||Zn(e))&&(a||(t=mr.makeFromEncoding(t,e)??t),t=gr.makeFromEncoding(t,e)??t,t=el.parseAllForSortIndex(t,e));const c=t=Wd(it.Raw,e,t);if(nt(e)){const y=Ni.makeFromEncoding(t,e);y&&(t=y,bA(e)&&(t=new as(t))),t=na.makeFromEncoding(t,e)??t,t=uo.makeFromEncoding(t,e)??t}let f,d;if(nt(e)){const{markDef:y,mark:b,config:x}=e,v=Be("invalid",y,x),{marks:w,scales:A}=d=I4({invalid:v,isPath:vs(b)});w!==A&&A==="include-invalid-values"&&(f=t=Wd(it.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=il.make(t,e,d)??t)}const h=t=Wd(it.Main,e,t);let g;if(nt(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=il.make(t,e,d)??t,g=t=Wd(it.PostFilterInvalid,e,t))}nt(e)&&kfe(e,h);let p=null;if(Zn(e)){const y=e.getName("facet");t=Bhe(t,e.facet)??t,p=new Al(t,e,y,h.getSource()),n[y]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:p,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:g}}function Wd(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new Nn(n,o,e,r);return i[o]=s,s}class qhe extends MA{constructor(t,n,i,r){var o,s,a,u;super(t,"concat",n,i,r,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(Boe),this.children=this.getChildren(t).map((l,c)=>IA(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=gm(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 B(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return G0(t)?t.vconcat:cA(t)?t.hconcat:t.concat}parseLayoutSize(){Phe(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=SA(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 Whe(e){return e===!1||e===null}const Ghe={disable:1,gridScale:1,scale:1,...Z6,labelExpr:1,encode:1},n8=B(Ghe);class RA extends $o{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new RA(ce(this.explicit),ce(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Whe(this.get(t))}hasOrientSignalRef(){return Q(this.explicit.orient)}}function Hhe(e,t,n){const{encoding:i,config:r}=e,o=xt(i[t])??xt(i[Rr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(wa(u))return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(Xu(o)==="quantitative"){if(Ku(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(Xu(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Vhe(e){return So.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[ege(n,e)]),t),{})}const Yhe={bottom:"top",top:"bottom",left:"right",right:"left"};function Xhe(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 B(r.component.axes))n.axis[o]=CA(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=Khe(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of So){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=Yhe[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 Khe(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]=Jhe(r,o)}}}else return t.map(n=>n.clone());return e}function Jhe(e,t){for(const n of n8){const i=ss(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return i6(r,o);case"gridScale":return{explicit:r.explicit,value:ft(r.value,o.value)}}return V0(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function Qhe(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:uf(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===EL(i,r))return!0}return e===n[t]}const Zhe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ege(e,t){var y,b;let n=t.axis(e);const i=new RA,r=xt(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=s.axis)==null?void 0:b.orient)||zfe(e),u=t.getScaleComponent(e).get("type"),l=Mfe(e,u,a,t.config),c=n!==void 0?!n:lx("disable",s.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Lfe(r,n,e,s.style,l),d=z6(n.formatType,r,u),h=I6(r,r.type,n.format,n.formatType,s,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of n8){const v=x in $F?$F[x](g):H_(x)?n[x]:void 0,w=v!==void 0,A=Qhe(v,x,n,t,e);if(w&&A)i.set(x,v,A);else{const{configValue:E=void 0,configFrom:S=void 0}=H_(x)&&x!=="values"?lx(x,s.style,n.style,l):{},C=E!==void 0;w&&!C?i.set(x,v,A):(S!=="vgAxisConfig"||Zhe.has(x)&&C||rd(E)||Q(E))&&i.set(x,E,!1)}}const p=n.encoding??{},m=Q6.reduce((x,v)=>{if(!i.hasAxisPart(v))return x;const w=_L(p[v]??{},t),A=v==="labels"?Hhe(t,e,w):w;return A!==void 0&&!Ue(A)&&(x[v]={update:A}),x},{});return Ue(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function tge({encoding:e,size:t}){for(const n of So){const i=jn(n);Cr(t[i])&&Wo(e[n])&&(delete t[i],j(u6(i)))}return t}const nge={vgMark:"arc",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...po(e,"radius"),...po(e,"theta")})},ige={vgMark:"area",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Gg("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Gg("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...yA(e)})},rge={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y")})},oge={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===vl?{field:H(n,{expr:"datum"})}:{}}]}},sge={vgMark:"image",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y"),...pA(e,"url")})},age={vgMark:"line",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e,{vgChannel:"strokeWidth"}),...yA(e)})},uge={vgMark:"trail",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e),...yA(e)})};function NA(e,t){const{config:n}=e;return{...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e),...It("angle",e),...lge(e,n,t)}}function lge(e,t,n){return n?{shape:{value:n}}:It("shape",e)}const cge={vgMark:"symbol",encodeEntry:e=>NA(e)},fge={vgMark:"symbol",encodeEntry:e=>NA(e,"circle")},dge={vgMark:"symbol",encodeEntry:e=>NA(e,"square")},hge={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y")})},gge={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"}),...Gg("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Gg("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...It("size",e,{vgChannel:"strokeWidth"})}}},pge={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"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...pA(e),...It("size",e,{vgChannel:"fontSize"}),...It("angle",e),...pF("align",mge(e.markDef,n,t)),...pF("baseline",yge(e.markDef,n,t)),...bn("radius",e,{defaultPos:null}),...bn("theta",e,{defaultPos:null})}}};function mge(e,t,n){if(Be("align",e,n)===void 0)return"center"}function yge(e,t,n){if(Be("baseline",e,n)===void 0)return"middle"}const bge={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"}),...po(e,r),...bn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ye(Be("thickness",n,t))}}},Gd={arc:nge,area:ige,bar:rge,circle:fge,geoshape:oge,image:sge,line:age,point:cge,rect:hge,rule:gge,square:dge,text:pge,tick:bge,trail:uge};function xge(e){if(we([L0,R0,mae],e.mark)){const t=o4(e.mark,e.encoding);if(t.length>0)return vge(e,t)}else if(e.mark===N0){const t=Gb.some(n=>Be(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Ege(e)}return LA(e)}const jF="faceted_path_";function vge(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:jF+e.requestDataName(it.Main),data:e.requestDataName(it.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:LA(e,{fromPrefix:jF})}]}const qF="stack_group_";function Ege(e){var l;const[t]=LA(e,{fromPrefix:qF}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...qu(t.encode.update,["y","yc","y2","height",...Gb]),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={...Rn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...qu(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={...Rn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of Gb){const f=Ar(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Ye(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=H(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(H(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=Ar(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ye(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(it.Main),name:qF+e.requestDataName(it.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 wge(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!X(s)&&Ui(s)&&qb(s.value)||!s&&qb(Be("order",r,o)))){if((X(s)||q(s))&&!n)return e6(s,{expr:"datum"});if(vs(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function LA(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=ft(i.clip,Age(e),Sge(e)),a=QN(i),u=r.key,l=wge(e),c=Cge(e),f=Be("aria",i,o),d=Gd[n].postEncodingTransform?Gd[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Gd[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(it.Main)},encode:{update:Gd[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Age(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Sge(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Cge(e){if(!e.component.selection)return null;const t=B(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=B(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class i8 extends QL{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,Y_(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>{var c,f,d;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+B4)),(d=(f=l.from)==null?void 0:f.facet)!=null&&d.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l};const s=Sr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=Zue(s,o,{graticule:t.data&&hA(t.data)}));const u=this.encoding=iue(t.encoding||{},a,s.filled,o);this.markDef=$4(s,u,o),this.size=tge({encoding:u,size:Y_(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=C4(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=>uA(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===T6,i=t&&Xre.some(r=>fe(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 Sw.reduce((i,r)=>{const o=xt(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(Vn)),X(i)&&(r.range=i.map(Vn)),r}initAxes(t){return So.reduce((n,i)=>{const r=t[i];if(fe(r)||i===et&&fe(t.x2)||i===Ot&&fe(t.y2)){const o=fe(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=B(t),i={};for(const r of n){const o=t[r];i[r]=rd(o)?JN(o):Vn(o)}return i}initLegends(t){return soe.reduce((n,i)=>{const r=xt(t[i]);if(r&&uoe(i)){const o=r.legend;n[i]=o&&Lt(o)}return n},{})}parseData(){this.component.data=gm(this)}parseLayoutSize(){Ihe(this)}parseSelections(){this.component.selection=Ffe(this,this.selection)}parseMarkGroup(){this.component.mark=xge(this)}parseAxesAndHeaders(){this.component.axes=Vhe(this)}assembleSelectionTopLevelSignals(t){return Hle(this,t)}assembleSignals(){return[...bL(this),...Wle(this,[])]}assembleSelectionData(t){return Vle(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return SA(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Cl(this.parent))&&(t=W4(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 ea(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ji(n)}typedFieldDef(t){const n=this.fieldDef(t);return Cn(n)?n:null}}class PA extends MA{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(H0(a))return new PA(a,this,this.getName(`layer_${u}`),s,o);if(Co(a))return new i8(a,this,this.getName(`layer_${u}`),s,o);throw new Error($w(a))})}parseData(){this.component.data=gm(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Lhe(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Xhe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),bL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),SA(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 Yle(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),NL(this))}}function IA(e,t,n,i,r){if(z0(e))return new Pc(e,t,n,r);if(H0(e))return new PA(e,t,n,i,r);if(Co(e))return new i8(e,t,n,i,r);if(_ue(e))return new qhe(e,t,n,r);throw new Error($w(e))}function $ge(e,t={}){t.logger&&Dse(t.logger),t.fieldTitle&&X6(t.fieldTitle);try{const n=S4(FN(t.config,e.config)),i=O4(e,n),r=IA(i,null,"",void 0,n);return r.parse(),Kde(r.component.data,r),{spec:Fge(r,_ge(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Tse(),t.fieldTitle&&Yae()}}function _ge(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)):de(t)&&(t={type:t}),r&&o&&Rle(t.type)){if(r==="step"&&o==="step")j(M_()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(M_(F0(s)));const a=s==="width"?"height":"width";t.type=Nle(a)}}return{...B(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...sF(n,!1),...sF(e,!0)}}function Fge(e,t,n={},i){const r=e.config?Uue(e.config):void 0,o=Mhe(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(g=>(g.name==="width"||g.name==="height")&&g.value!==void 0?(t[g.name]=+g.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v5.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([]),...v4(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const kge=kre.version,Dge=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Gu,accessPathWithDatum:mw,accessWithDatumToUnescapedPath:Le,compile:$ge,contains:we,deepEqual:Xn,deleteNestedProperty:Ng,duplicate:ce,entries:is,every:hw,fieldIntersection:pw,flatAccessWithDatum:MN,getFirstDefined:ft,hasIntersection:gw,hasProperty:U,hash:Ae,internalField:NN,isBoolean:af,isEmpty:Ue,isEqual:Gre,isInternalField:LN,isNullOrFalse:qb,isNumeric:w0,keys:B,logicalExpr:Rc,mergeDeep:DN,never:kN,normalize:O4,normalizeAngle:uf,omit:Rn,pick:qu,prefixGenerator:Wb,removePathFromField:bl,replaceAll:ma,replacePathInField:bi,resetIdCounter:Vre,setEqual:TN,some:Wu,stringify:je,titleCase:Vf,unique:cr,uniqueId:RN,vals:qt,varName:Qe,version:kge},Symbol.toStringTag,{value:"Module"}));function r8(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Tge="2.15.0",Mge={version:Tge};const ou="#fff",WF="#888",Oge={background:"#333",view:{stroke:WF},title:{color:ou,subtitleColor:ou},style:{"guide-label":{fill:ou},"guide-title":{fill:ou}},axis:{domainColor:ou,gridColor:WF,tickColor:ou}},Fs="#4572a7",Rge={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",j1="#cbcbcb",Nge="#999",Lge="#333",GF="#f0f0f0",HF="#333",Pge={arc:{fill:ks},area:{fill:ks},axis:{domainColor:j1,grid:!0,gridColor:j1,gridWidth:1,labelColor:Nge,labelFontSize:10,titleColor:Lge,tickColor:j1,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:GF,group:{fill:GF},legend:{labelColor:HF,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:HF,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",Ige={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"]}},zge=22,Bge="normal",VF="Benton Gothic, sans-serif",YF=11.5,Uge="normal",Ts="#82c6df",q1="Benton Gothic Bold, sans-serif",XF="normal",KF=13,Xl={"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"]},jge={background:"#ffffff",title:{anchor:"start",color:"#000000",font:q1,fontSize:zge,fontWeight:Bge},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:VF,labelFontSize:YF,labelFontWeight:Uge,titleFont:q1,titleFontSize:KF,titleFontWeight:XF},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:VF,labelFontSize:YF,symbolType:"square",titleFont:q1,titleFontSize:KF,titleFontWeight:XF},range:{category:Xl["category-6"],diverging:Xl["fireandice-6"],heatmap:Xl["fire-7"],ordinal:Xl["fire-7"],ramp:Xl["fire-7"]}},Ms="#ab5787",Hd="#979797",qge={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:Hd,domainWidth:.5,gridWidth:.2,labelColor:Hd,tickColor:Hd,tickWidth:.2,titleColor:Hd},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",Wge={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"]}},si="#1696d2",JF="#000000",Gge="#FFFFFF",Vd="Lato",W1="Lato",Hge="Lato",Vge="#DEDDDD",Yge=18,Kl={"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"]},Xge={background:Gge,title:{anchor:"start",fontSize:Yge,font:Vd},axisX:{domain:!0,domainColor:JF,domainWidth:1,grid:!1,labelFontSize:12,labelFont:W1,labelAngle:0,tickColor:JF,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Vd},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Vge,gridWidth:1,labelFontSize:12,labelFont:W1,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Vd,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:W1,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Vd,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Kl["six-groups-cat-1"],diverging:Kl["diverging-colors"],heatmap:Kl["diverging-colors"],ordinal:Kl["six-groups-seq"],ramp:Kl["shades-blue"]},area:{fill:si},rect:{fill:si},line:{color:si,stroke:si,strokeWidth:5},trail:{color:si,stroke:si,strokeWidth:0,size:1},path:{stroke:si,strokeWidth:.5},point:{filled:!0},text:{font:Hge,color:si,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:si,stroke:null}},arc:{fill:si},shape:{stroke:si},symbol:{fill:si,size:30}},Rs="#3366CC",QF="#ccc",Yd="Arial, sans-serif",Kge={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:Yd,fontSize:12},"guide-title":{font:Yd,fontSize:12},"group-title":{font:Yd,fontSize:12}},title:{font:Yd,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:QF,tickColor:QF,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},zA=e=>e*(1/3+1),ZF=zA(9),ek=zA(10),tk=zA(12),Jl="Segoe UI",nk="wf_standard-font, helvetica, arial, sans-serif",ik="#252423",Ql="#605E5C",rk="transparent",Jge="#C8C6C4",Ci="#118DFF",Qge="#12239E",Zge="#E66C37",epe="#6B007B",tpe="#E044A7",npe="#744EC2",ipe="#D9B300",rpe="#D64550",o8=Ci,s8="#DEEFFF",ok=[s8,o8],ope=[s8,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",o8],spe={view:{stroke:rk},background:rk,font:Jl,header:{titleFont:nk,titleFontSize:tk,titleColor:ik,labelFont:Jl,labelFontSize:ek,labelColor:Ql},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Ql,labelFontSize:ZF,titleFont:nk,titleColor:ik,titleFontSize:tk,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Jge,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ci},line:{stroke:Ci,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Jl,fontSize:ZF,fill:Ql},arc:{fill:Ci},area:{fill:Ci,line:!0,opacity:.6},path:{stroke:Ci},rect:{fill:Ci},point:{fill:Ci,filled:!0,size:75},shape:{stroke:Ci},symbol:{fill:Ci,strokeWidth:1.5,size:50},legend:{titleFont:Jl,titleFontWeight:"bold",titleColor:Ql,labelFont:Jl,labelFontSize:ek,labelColor:Ql,symbolType:"circle",symbolSize:75},range:{category:[Ci,Qge,Zge,epe,tpe,npe,ipe,rpe],diverging:ok,heatmap:ok,ordinal:ope}},G1='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',ape='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',H1=400,Xd={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"}},upe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],lpe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function pm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=Xd.gridBg[e],r=Xd.textPrimary[e],o=Xd.textSecondary[e],s=n==="dark"?upe:lpe,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:G1,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:ape,labelFontWeight:H1,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Xd.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:G1,fill:o,fontWeight:H1},"guide-title":{font:G1,fill:o,fontWeight:H1}},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 cpe=pm({theme:"white",background:"#ffffff"}),fpe=pm({theme:"g10",background:"#f4f4f4"}),dpe=pm({theme:"g90",background:"#262626"}),hpe=pm({theme:"g100",background:"#161616"}),gpe=Mge.version,ppe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:fpe,carbong100:hpe,carbong90:dpe,carbonwhite:cpe,dark:Oge,excel:Rge,fivethirtyeight:Pge,ggplot2:Ige,googlecharts:Kge,latimes:jge,powerbi:spe,quartz:qge,urbaninstitute:Xge,version:gpe,vox:Wge},Symbol.toStringTag,{value:"Module"}));function $l(e,t,n){return e.fields=t||[],e.fname=n,e}function mpe(e){return e.length===1?ype(e[0]):bpe(e)}const ype=e=>function(t){return t[e]},bpe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function V1(e){throw Error(e)}function xpe(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||V1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&V1("Access path missing closing bracket: "+e),i&&V1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function vpe(e,t,n){const i=xpe(e);return e=i.length===1?i[0]:e,$l(mpe(i),[e],e)}vpe("id");$l(e=>e,[],"identity");$l(()=>0,[],"zero");$l(()=>1,[],"one");$l(()=>!0,[],"true");$l(()=>!1,[],"false");var Epe=Array.isArray;function sk(e){return e===Object(e)}function wpe(e){return typeof e=="string"}function Ape(e,t,n,i){if(Epe(e))return`[${e.map(r=>t(wpe(r)?r:ak(r,n))).join(", ")}]`;if(sk(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&&(sk(c)&&(c=ak(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 Spe(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 ak(e,t){return JSON.stringify(e,Spe(t))}var Cpe=`#vg-tooltip-element {
17
+ `&&++N;else{if(df(i.charCodeAt(0)))break;e+=i}return t!==""&&De({},Ft,Ut),{type:ad,value:e,octal:o,start:n,end:N}}function sfe(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({},sx)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{De({},sx)}try{return new RegExp(e,t)}catch{return null}}function afe(){var e,t,n,i,r;for(e=J[N],em(e==="/","Regular expression literal must start with a slash"),t=J[N++],n=!1,i=!1;N<sn;)if(e=J[N++],t+=e,e==="\\")e=J[N++],df(e.charCodeAt(0))&&De({},N1),t+=e;else if(df(e.charCodeAt(0)))De({},N1);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||De({},N1),r=t.substr(1,t.length-2),{value:r,literal:t}}function ufe(){var e,t,n;for(t="",n="";N<sn&&(e=J[N],!!Vg(e.charCodeAt(0)));)++N,e==="\\"&&N<sn?De({},Ft,Ut):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&De({},sx,n),{value:n,literal:t}}function lfe(){var e,t,n,i;return Ie=null,uL(),e=N,t=afe(),n=ufe(),i=sfe(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:N}}function cfe(e){return e.type===Ca||e.type===Es||e.type===Q0||e.type===Z0}function cL(){if(uL(),N>=sn)return{type:sd,start:N,end:N};const e=J.charCodeAt(N);return ud(e)?nfe():e===40||e===41||e===59?L1():e===39||e===34?ofe():e===46?Gr(J.charCodeAt(N+1))?bF():L1():Gr(e)?bF():L1()}function On(){const e=Ie;return N=e.end,Ie=cL(),N=e.end,e}function fL(){const e=N;Ie=cL(),N=e}function ffe(e){const t=new Qi(Rce);return t.elements=e,t}function xF(e,t,n){const i=new Qi(e==="||"||e==="&&"?zce:Nce);return i.operator=e,i.left=t,i.right=n,i}function dfe(e,t){const n=new Qi(Lce);return n.callee=e,n.arguments=t,n}function hfe(e,t,n){const i=new Qi(Pce);return i.test=e,i.consequent=t,i.alternate=n,i}function vA(e){const t=new Qi(sL);return t.name=e,t}function xc(e){const t=new Qi(Ice);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 vF(e,t,n){const i=new Qi(Bce);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function gfe(e){const t=new Qi(Uce);return t.properties=e,t}function EF(e,t,n){const i=new Qi(jce);return i.key=t,i.value=n,i.kind=e,i}function pfe(e,t){const n=new Qi(qce);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)=>(em(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=N,n.description=r,n}function tm(e){e.type===sd&&De(e,Yce),e.type===Wa&&De(e,Wce),e.type===ad&&De(e,Gce),e.type===Ca&&De(e,Hce),e.type===Es&&De(e,Vce),De(e,Ft,e.value)}function an(e){const t=On();(t.type!==Dn||t.value!==e)&&tm(t)}function Xe(e){return Ie.type===Dn&&Ie.value===e}function P1(e){return Ie.type===Es&&Ie.value===e}function mfe(){const e=[];for(N=Ie.start,an("[");!Xe("]");)Xe(",")?(On(),e.push(null)):(e.push($a()),Xe("]")||an(","));return On(),ffe(e)}function wF(){N=Ie.start;const e=On();return e.type===ad||e.type===Wa?(e.octal&&De(e,aL),xc(e)):vA(e.value)}function yfe(){var e,t,n,i;if(N=Ie.start,e=Ie,e.type===Ca)return n=wF(),an(":"),i=$a(),EF("init",n,i);if(e.type===sd||e.type===Dn)tm(e);else return t=wF(),an(":"),i=$a(),EF("init",t,i)}function bfe(){var e=[],t,n,i,r={},o=String;for(N=Ie.start,an("{");!Xe("}");)t=yfe(),t.key.type===sL?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?De({},Xce):r[i]=!0,e.push(t),Xe("}")||an(",");return an("}"),gfe(e)}function xfe(){an("(");const e=EA();return an(")"),e}const vfe={if:1};function Efe(){var e,t,n;if(Xe("("))return xfe();if(Xe("["))return mfe();if(Xe("{"))return bfe();if(e=Ie.type,N=Ie.start,e===Ca||vfe[Ie.value])n=vA(On().value);else if(e===ad||e===Wa)Ie.octal&&De(Ie,aL),n=xc(On());else{if(e===Es)throw new Error(ff);e===Q0?(t=On(),t.value=t.value==="true",n=xc(t)):e===Z0?(t=On(),t.value=null,n=xc(t)):Xe("/")||Xe("/=")?(n=xc(lfe()),fL()):tm(On())}return n}function wfe(){const e=[];if(an("("),!Xe(")"))for(;N<sn&&(e.push($a()),!Xe(")"));)an(",");return an(")"),e}function Afe(){N=Ie.start;const e=On();return cfe(e)||tm(e),vA(e.value)}function Sfe(){return an("."),Afe()}function Cfe(){an("[");const e=EA();return an("]"),e}function $fe(){var e,t,n;for(e=Efe();;)if(Xe("."))n=Sfe(),e=vF(".",e,n);else if(Xe("("))t=wfe(),e=dfe(e,t);else if(Xe("["))n=Cfe(),e=vF("[",e,n);else break;return e}function AF(){const e=$fe();if(Ie.type===Dn&&(Xe("++")||Xe("--")))throw new Error(ff);return e}function Sh(){var e,t;if(Ie.type!==Dn&&Ie.type!==Es)t=AF();else{if(Xe("++")||Xe("--"))throw new Error(ff);if(Xe("+")||Xe("-")||Xe("~")||Xe("!"))e=On(),t=Sh(),t=pfe(e.value,t);else{if(P1("delete")||P1("void")||P1("typeof"))throw new Error(ff);t=AF()}}return t}function SF(e){let t=0;if(e.type!==Dn&&e.type!==Es)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 _fe(){var e,t,n,i,r,o,s,a,u,l;if(e=Ie,u=Sh(),i=Ie,r=SF(i),r===0)return u;for(i.prec=r,On(),t=[e,Ie],s=Sh(),o=[u,i,s];(r=SF(Ie))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=xF(a,u,s),o.push(n);i=On(),i.prec=r,o.push(i),t.push(Ie),n=Sh(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=xF(o[l-1].value,o[l-2],n),l-=2;return n}function $a(){var e,t,n;return e=_fe(),Xe("?")&&(On(),t=$a(),an(":"),n=$a(),e=hfe(e,t,n)),e}function EA(){const e=$a();if(Xe(","))throw new Error(ff);return e}function Ffe(e){J=e,N=0,sn=J.length,Ie=null,fL();const t=EA();if(Ie.type!==sd)throw new Error("Unexpect token after expression.");return t}function ux(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...ux(e.object)),t.push(...ux(e.property))),t)}function dL(e){return e.object.type==="MemberExpression"?dL(e.object):e.object.name==="datum"}function hL(e){const t=Ffe(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&dL(i)&&n.add(ux(i).slice(1).join("."))}),n}class wl extends ze{clone(){return new wl(null,this.model,ce(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=Yg(this.model,this.filter,this),this._dependentFields=hL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function kfe(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=de(a)?a:a.type,l=Fe(a)?ce(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]=ce(c[h]??l[h])));const f=n[s]={...l,name:s,type:u,init:o.value,bind:o.bind,events:de(l.on)?ds(l.on,"scope"):ct(ce(l.on))};if(pr(f)&&(r++,r>1)){delete n[s];continue}const d=ce(o);for(const h of J0)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&j(Ioe),n}function gL(e,t,n,i="datum"){const r=de(t)?t:t.param,o=Qe(r),s=_e(o+Sa);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"?")":`, ${_e(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function pL(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(zoe(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(Boe(a,r,n,o))):o=a[0].field}return`${s.name}[${_e(bi(o))}]`}function Dfe(e,t){for(const[n,i]of is(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new Nn(new wl(t,e,{param:n}),r,it.Lookup,e.component.data.outputNodeRefCounts)}}function Yg(e,t,n){return Rc(t,i=>de(i)?i:Xse(i)?gL(e,i,n):x6(i))}function Tfe(e,t){if(e)return X(e)&&!Ro(e)?e.map(n=>Zw(n,t)).join(", "):e}function I1(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function vc(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const g=h,p=eue[g],m=c[g];if(p&&p!==t&&p!=="both")delete c[g];else if(rd(m)){const{condition:y,...b}=m,x=ct(y),v=G_[g];if(v){const{vgProp:w,part:A}=v,E=[...x.map(S=>{const{test:C,..._}=S;return{test:Yg(null,C),..._}}),b];I1(c,A,w,E),delete c[g]}else if(v===null){const w={signal:x.map(A=>{const{test:E,...S}=A;return`${Yg(null,E)} ? ${k_(S)} : `}).join("")+k_(b)};c[g]=w}}else if(Q(m)){const y=G_[g];if(y){const{vgProp:b,part:x}=y;I1(c,x,b,m),delete c[g]}}we(["labelAlign","labelBaseline"],g)&&c[g]===null&&delete c[g]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Ue(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 g=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&Q(c.encode.labels.update.text)&&(g=ma(a,"datum.label",c.encode.labels.update.text.signal)),I1(c,"labels","text",{signal:g})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const g of K6)e.hasAxisPart(g)||delete c.encode[g];Ue(c.encode)&&delete c.encode}const h=Tfe(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ft(l,0)}}}}function mL(e){const{axes:t}=e.component,n=[];for(const i of So)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 Mfe(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>vc(r,"grid",t)),...i.map(r=>vc(r,"grid",t)),...n.map(r=>vc(r,"main",t)),...i.map(r=>vc(r,"main",t))].filter(r=>r)}function CF(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([...B(s),...B(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${Mi(s[c])} : ${Mi(a[c])}`};return l}return t[r]})])}function Ofe(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:A6(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Q(n)?"axisOrient":`axis${Vf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:CF(a,i,e,n),vgAxisConfig:CF(u,i,e,n),axisConfigStyle:Rfe([...u,...a],i)}}function Rfe(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=ct(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function lx(e,t,n,i={}){var o;const r=JN(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=i[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const $F={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??Nfe(n,e),gridScale:({model:e,channel:t})=>Lfe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||bL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||yL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Ife(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??zfe(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??Ufe({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:jfe,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=xL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return ZN(r?[q_(r)]:[],q(s)?[q_(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>qfe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Wfe(n,t)};function Nfe(e,t){return!Dt(e)&&q(t)&&!He(t==null?void 0:t.bin)&&!Nt(t==null?void 0:t.bin)}function Lfe(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Pfe(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return Q(o)?o:uf(o);{const{configValue:s}=lx("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?uf(s):n===et&&we([Uw,Bw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function cx(e){return`(((${e.signal} % 360) + 360) % 360)`}function yL(e,t,n,i){if(e!==void 0)if(n==="x"){if(Q(e)){const r=cx(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=cx(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 bL(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=cx(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 Ife(e,t){if(t==="x"&&we(["quantitative","temporal"],e))return!0}function zfe(e,t,n,i){if(n&&!Fe(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Bfe(e){return e==="x"?"bottom":"left"}function Ufe({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!Dt(t)&&t!=="log"){if(q(e)){if(He(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&we(["month","hours","day","quarter"],(r=kt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function jfe({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=m6(n);if(i)return{signal:i}}}}function xL(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 e6(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function qfe(e,t){const n=e.values;if(X(n))return X6(t,n);if(Q(n))return n}function Wfe(e,t){return e==="rect"&&Bg(t)?1:0}class el extends ze{clone(){return new el(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=hL(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(qa(i)&&z6(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${x6({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new el(t,{calculate:u,as:tl(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 ${Ae(this.transform)}`}}function tl(e,t,n){return H(e,{prefix:t,suffix:"sort_index",...n})}function nm(e,t){return we(["top","bottom"],t)?"column":we(["left","right"],t)||e==="row"?"row":"column"}function nl(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 im(e,t,n,i){const r={};for(const o of e){const s=nl(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const wA=["row","column"],AA=["header","footer"];function Gfe(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}=im(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=nm(t,a),l=uf(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...EL(l,u),...vL(u,l,o),...wL(i,r,t,wue,g4)}}}function vL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=bL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function EL(e,t){const n=yL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Hfe(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of AA)if(n[r])for(const o of n[r]){const s=Yfe(e,t,r,n,o);s!=null&&i.push(s)}return i}function Vfe(e,t){const{sort:n}=e;return so(n)?{field:H(n,{expr:"datum"}),order:n.order??"ascending"}:X(n)?{field:tl(e,t,{expr:"datum"}),order:"ascending"}:{field:H(e,{expr:"datum"}),order:n??"ascending"}}function fx(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=im(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Xw({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=nm(t,a);return{text:{signal:u?ma(ma(u,"datum.label",l),"datum.value",H(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...EL(o,c),...vL(c,o,s),...wL(n,e,t,Aue,p4)}}function Yfe(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}=im(["labelOrient"],s.header,a,t);(t==="row"&&!we(["top","bottom"],f)||t==="column"&&!we(["left","right"],f))&&(o=fx(s,t,a))}const u=Zn(e)&&!ed(e.facet),l=r.axes,c=(l==null?void 0: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:Vfe(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 Xfe={column:{start:0,end:1},row:{start:1,end:0}};function Kfe(e,t){return Xfe[t][e]}function Jfe(e,t){const n={};for(const i of di){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=im(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=nm(i,s),u=Kfe(o,a);u!==void 0&&(n[a]=u)}}return Ue(n)?void 0:n}function wL(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=nl(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function SA(e){return[...jd(e,"width"),...jd(e,"height"),...jd(e,"childWidth"),...jd(e,"childHeight")]}function jd(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(Dt(s)&&Ba(a)){const u=e.scaleName(n);return Zn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[_F(u,a)]:[_F(u,a),{name:r,update:AL(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=Qb(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 _F(e,t){const n=`${e}_step`;return Q(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function AL(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}, ${Mi(s)}, ${Mi(o)}) * ${e}_step`}function SL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function CL(e,t){return B(e).reduce((n,i)=>({...n,...El({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ye(r.value),invalidValueRef:void 0})}),{})}function $L(e,t){if(Zn(t))return e==="theta"?"independent":"shared";if(Cl(t))return"shared";if(TA(t))return dt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function CA(e,t){const n=e.scale[t],i=dt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(yse(t)),"independent"):e[i][t]||"shared"}const Qfe={...$ue,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},_L=B(Qfe);class Zfe extends $o{}const FF={symbols:ede,gradient:tde,labels:nde,entries:ide};function ede(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={...Coe({},n,Eae),...V4(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,g=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,p=d===void 0?FL(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===Bn)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ye(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ye(p??1));else if(X(f.fill)){const m=dx(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ye(m))}}if(f.stroke){if(i==="stroke"||!c&&i===Bn)delete f.stroke;else if(U(f.stroke,"field")||g)delete f.stroke;else if(X(f.stroke)){const m=ft(dx(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Ao){const m=q(t)&&DL(n,r,t);m?f.opacity=[{test:m,...Ye(p??1)},Ye(u.legend.unselectedOpacity)]:p&&(f.opacity=Ye(p))}return f={...f,...e},Ue(f)?void 0:f}function tde(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?FL(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ye(l)),a={...a,...e},Ue(a)?void 0:a}function nde(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?DL(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;wa(c)?f=Oi({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=Oi({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=Oi({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Ue(d)?void 0:d}function ide(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function FL(e){return kL(e,(t,n)=>Math.max(t,n.value))}function dx(e){return kL(e,(t,n)=>ft(t,n.value))}function kL(e,t){if(jae(e))return ct(e.condition).reduce(t,e.value);if(Ui(e))return e.value}function DL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=_e(n.field);return i.map(o=>`(!length(data(${_e(Qe(o)+Sa)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const kF={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return L6(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return P6(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??cde(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??fde(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??ode(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>wu(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Eu(n)&&fr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>rde(t,e)};function rde(e,t){const n=e.values;if(X(n))return X6(t,n);if(Q(n))return n}function ode(e,t,n,i){if(t!=="shape"){const r=dx(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 sde(e){const{legend:t}=e;return ft(t.type,ade(e))}function ade({channel:e,timeUnit:t,scaleType:n}){if(Eu(e)){if(we(["quarter","month","day"],t))return"symbol";if(fr(n))return"gradient"}return"symbol"}function ude({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??lde(n,t)}function lde(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 cde({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(fr(r))return n==="horizontal"?i==="top"||i==="bottom"?DF(t,"width",s,o):s:DF(t,"height",u,a)}function DF(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function fde(e){if(we(["quantile","threshold","log","symlog"],e))return"greedy"}function TL(e){const t=nt(e)?dde(e):mde(e);return e.component.legends=t,t}function dde(e){const{encoding:t}=e,n={};for(const i of[Bn,...y4]){const r=xt(t[i]);!r||!e.getScaleComponent(i)||i===Un&&q(r)&&r.type===vl||(n[i]=pde(e,i))}return n}function hde(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 gde(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function pde(e,t){var v;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new Zfe({},hde(e,t));pce(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=xt(r[t]),f=q(c)?(v=kt(c.timeUnit))==null?void 0:v.unit:void 0,d=n.orient||o.legend.orient||"right",h=sde({legend:n,channel:t,timeUnit:f,scaleType:l}),g=ude({legend:n,legendType:h,orient:d,legendConfig:s}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:g};for(const w of _L){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const A=w in kF?kF[w](p):n[w];if(A!==void 0){const E=gde(A,w,n,e.fieldDef(t));(E||o.legend[w]===void 0)&&a.set(w,A,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},x={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const A=CL(m[w]??{},e),E=w in FF?FF[w](A,x):A;E!==void 0&&!Ue(E)&&(b[w]={...y!=null&&y.length&&q(c)?{name:`${Qe(c.field)}_legend_${w}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Ue(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function mde(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){TL(i);for(const r of B(i.component.legends))n.legend[r]=CA(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=ML(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of B(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function ML(e,t){var o,s,a,u;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 l of _L){const c=ss(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return yde(f,d);case"title":return t6(f,d);case"type":return r=!0,Wn("symbol")}return V0(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&Ng(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Ng(e.explicit,["encode","gradient"])),e}function yde(e,t){return t.value==="circle"?t:e}function bde(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function OL(e){const t=e.component.legends,n={};for(const r of B(t)){const o=e.getScaleComponent(r),s=je(o.get("domains"));if(n[s])for(const a of n[s])ML(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return qt(n).flat().map(r=>xde(r,e.config)).filter(r=>r!==void 0)}function xde(e,t){var s,a,u;const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const l=o.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!o.stroke&&(l.stroke={value:"transparent"});for(const c of y4)o[c]&&delete l[c]}if(o.title||delete o.title,i!==void 0){let l=i;(u=(a=o.encode)==null?void 0:a.labels)!=null&&u.update&&Q(o.encode.labels.update.text)&&(l=ma(i,"datum.label",o.encode.labels.update.text.signal)),bde(o,"labels","text",{signal:l})}return o}}function vde(e){return Cl(e)||TA(e)?Ede(e):RL(e)}function Ede(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),RL(e))}function RL(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 we(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 wde=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class NL extends $o{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function LL(e){e.component.projection=nt(e)?Ade(e):$de(e)}function Ade(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?Sde(e):void 0,o=new NL(e.projectionName(!0),{...Lt(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function Sde(e){const t=[],{encoding:n}=e;for(const i of[[Ki,Xi],[xi,Ji]])(xt(n[i[0]])||xt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Un)&&e.typedFieldDef(Un).type===vl&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(it.Main)),t}function Cde(e,t){const n=hw(wde,r=>!!(!gt(e.explicit,r)&&!gt(t.explicit,r)||gt(e.explicit,r)&&gt(t.explicit,r)&&Xn(e.get(r),t.get(r))));if(Xn(e.size,t.size)){if(n)return e;if(Xn(e.explicit,{}))return t;if(Xn(t.explicit,{}))return e}return null}function $de(e){if(e.children.length===0)return;let t;for(const i of e.children)LL(i);const n=hw(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=Cde(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 NL(i,t.specifiedProjection,t.size,ce(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 _de(e,t,n,i){if(id(t,n)){const r=nt(e)?e.axis(n)??e.legend(n)??{}:{},o=H(t,{expr:"datum"}),s=H(t,{expr:"datum",binSuffix:"end"});return{formulaAs:H(t,{binSuffix:"range",forAs:!0}),formula:Zf(o,s,r.format,r.formatType,i)}}return{}}function PL(e,t){return`${VN(e)}_${t}`}function Fde(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function $A(e,t,n){const i=U0(n,void 0)??{},r=PL(i,t);return e.getName(`${r}_bins`)}function kde(e){return"as"in e}function TF(e,t,n){let i,r;kde(e)?i=de(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[H(e,{forAs:!0}),H(e,{binSuffix:"end",forAs:!0})];const o={...U0(t,void 0)},s=PL(o,e.field),{signal:a,extentSignal:u}=Fde(n,s);if(D0(o.extent)){const c=o.extent;r=pL(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 mr extends ze{clone(){return new mr(null,ce(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(Cn(o)&&He(o.bin)){const{key:a,binComponent:u}=TF(o,o.bin,n);r[a]={...u,...r[a],..._de(n,o,s,n.config)}}return r},{});return Ue(i)?null:new mr(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=TF(n,n.bin,i);return new mr(t,{[r]:o})}merge(t,n){for(const i of B(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=cr([...this.bins[i].as,...t.bins[i].as],Ae)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(qt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(qt(this.bins).map(t=>t.field))}hash(){return`Bin ${Ae(this.bins)}`}assemble(){return qt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:bi(t.field),as:i,signal:t.signal,...D0(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:bi(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:H({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Dde(e,t,n,i){var o;const r=nt(i)?i.encoding[Rr(t)]:void 0;if(Cn(n)&&nt(i)&&U6(n,r,i.markDef,i.config)){e.add(H(n,{})),e.add(H(n,{suffix:"end"}));const{mark:s,markDef:a,config:u}=i,l=os({fieldDef:n,markDef:a,config:u});lf(s)&&l!==.5&&dt(t)&&(e.add(H(n,{suffix:Y0})),e.add(H(n,{suffix:X0}))),n.bin&&id(n,t)&&e.add(H(n,{binSuffix:"range"}))}else if(IN(t)){const s=PN(t);e.add(i.getName(s))}else e.add(H(n));return qa(n)&&uae((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function Tde(e,t){for(const n of B(t)){const i=t[n];for(const r of B(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Ni extends ze{clone(){return new Ni(null,new Set(this.dimensions),ce(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["*"]={}),r["*"].count=new Set([H(s,{forAs:!0})]);else{if(go(u)||xs(u)){const c=go(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([H({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([H(s,{forAs:!0})]);Nr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([H({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([H({field:l,aggregate:"max"},{forAs:!0})]))}else Dde(o,a,s,n)}),o.size+B(r).length===0)?null:new Ni(t,o,r)}static makeFromTransform(t,n){var i;const r=new Set,o={};for(const s of n.aggregate){const{op:a,field:u,as:l}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([l||H(s,{forAs:!0})])):(o[u]??(o[u]={}),(i=o[u])[a]??(i[a]=new Set),o[u][a].add(l||H(s,{forAs:!0}))))}for(const s of n.groupby??[])r.add(s);return r.size+B(o).length===0?null:new Ni(t,r,o)}merge(t){return kN(this.dimensions,t.dimensions)?(Tde(this.measures,t.measures),!0):(Ose("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...B(this.measures)])}producedFields(){const t=new Set;for(const n of B(this.measures))for(const i of B(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 ${Ae({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of B(this.measures))for(const s of B(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:bi(o));return{type:"aggregate",groupby:[...this.dimensions].map(bi),ops:t,fields:n,as:i}}}class Al extends ze{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of di){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[H(s),...He(a)?[H(s,{binSuffix:"end"})]:[]],...so(u)?{sortField:u}:X(u)?{sortIndexField:tl(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of di)this[n]&&(t+=` ${n.charAt(0)}:${Ae(this[n])}`);return t}get fields(){var n;const t=[];for(const i of di)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of di)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 So){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(Dt(r)&&Ba(o)){const s=rm(this.childModel,n),a=DA(s);a?t[n]=a:j(_w(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=I0,field:f}=u;o.push(f),s.push(c),a.push(H(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){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const l of wA){for(const c of AA){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}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[oo,ro])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function MF(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Mde(e,t){const n=mw(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=MF(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=MF(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(joe(t)),null}function Ode(e){const t={};return wh(e.filter,n=>{if(b6(n)){let i=null;Ow(n)?i=Vn(n.equal):Nw(n)?i=Vn(n.lte):Rw(n)?i=Vn(n.lt):Lw(n)?i=Vn(n.gt):Pw(n)?i=Vn(n.gte):Iw(n)?i=n.range[0]:zw(n)&&(i=(n.oneOf??n.in)[0]),i&&(Ua(i)?t[n.field]="date":Ze(i)?t[n.field]="number":de(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Rde(e){const t={};function n(i){Ju(i)?t[i.field]="date":i.type==="quantitative"&&moe(i.aggregate)?t[i.field]="number":Gu(i.field)>1?i.field in t||(t[i.field]="flatten"):qa(i)&&so(i.sort)&&Gu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((nt(e)||Zn(e))&&e.forEachFieldDef((i,r)=>{if(Cn(i))n(i);else{const o=Ia(r),s=e.fieldDef(o);n({...i,type:s.type})}}),nt(e)){const{mark:i,markDef:r,encoding:o}=e;if(vs(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 Nde(e){const t={};if(nt(e)&&e.component.selection)for(const n of B(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Gu(r.field)>1&&(t[r.field]="flatten")}return t}class tn extends ze{clone(){return new tn(null,ce(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Ae(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!Xo(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of B(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(N_(a,i[a],u.value)))}for(const a of B(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(N_(a,n[a],u)))}const o=new $o(n,i);r.copyAll(o);const s={};for(const a of B(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return B(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 B(this._parse)){const i=this._parse[n];Gu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(B(this._parse))}dependentFields(){return new Set(B(this._parse))}assembleTransforms(t=!1){return B(this._parse).filter(n=>t?Gu(n)>1:!0).map(n=>{const i=Mde(n,this._parse[n]);return i?{type:"formula",expr:i,as:bl(n)}:null}).filter(n=>n!==null)}}class as extends ze{clone(){return new as(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([qi])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:qi}}}class ld extends ze{clone(){return new ld(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Ae(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class cd extends ze{clone(){return new cd(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 ${Ae(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class _a extends ze{constructor(t){super(null),t??(t={name:"source"});let n;if(Xo(t)||(n=t.format?{...Rn(t.format,["parse"])}:{}),cf(t))this._data={values:t.values};else if(Qu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];we(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else N4(t)?this._data={values:[{type:"Sphere"}]}:(O4(t)||Xo(t))&&(this._data={});this._generator=Xo(t),t.name&&(this._name=t.name),n&&!Ue(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:[]}}}var OF=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},Lde=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},Ec;function _A(e){return e instanceof _a||e instanceof ld||e instanceof cd}class FA{constructor(){Ec.set(this,void 0),OF(this,Ec,!1,"f")}setModified(){OF(this,Ec,!0,"f")}get modifiedFlag(){return Lde(this,Ec,"f")}}Ec=new WeakMap;class Ga extends FA{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 kA extends FA{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Pde extends kA{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 B(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Ide extends kA{constructor(t){super(),this.requiresSelectionId=t&&bA(t)}run(t){t instanceof as&&(this.requiresSelectionId&&(_A(t.parent)||t.parent instanceof Ni||t.parent instanceof tn)||(this.setModified(),t.remove()))}}class zde extends FA{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof gr&&(i=t.producedFields(),gw(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 Bde extends kA{constructor(){super()}run(t){t instanceof Nn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Ude extends Ga{run(t){if(!_A(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(pw(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class jde extends Ga{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 B(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!Ue(r)){this.setModified();const s=new tn(t,r);for(const a of n){if(a instanceof tn)for(const u of B(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof tn&&B(a.parse).length===0&&a.remove()}}}}}class qde extends Ga{run(t){t instanceof Nn||t.numChildren()>0||t instanceof Al||t instanceof _a||(this.setModified(),t.remove())}}class Wde extends Ga{run(t){const n=t.children.filter(r=>r instanceof gr),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Gde extends Ga{run(t){const n=t.children.filter(r=>r instanceof Ni),i={};for(const r of n){const o=Ae(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of B(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 Hde extends Ga{constructor(t){super(),this.model=t}run(t){const n=!(_A(t)||t instanceof wl||t instanceof tn||t instanceof as),i=[],r=[];for(const o of t.children)o instanceof mr&&(n&&!pw(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 mr?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 Vde extends Ga{run(t){const n=[...t.children];if(!Wu(n,s=>s instanceof Nn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof Nn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof Nn)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 Ha extends ze{clone(){return new Ha(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr(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??H(t)}hash(){return`JoinAggregateTransform ${Ae(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 il extends ze{clone(){return new il(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:g}=c,p=Hw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:k0(g)});p!=="show"&&p!=="always-valid"&&(l[c.field]=c)}return l},{});return B(u).length?new il(t,u):null}dependentFields(){return new Set(B(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Ae(this.filter)}`}assemble(){const t=B(this.filter).reduce((n,i)=>{const r=this.filter[i],o=H(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${hx(o)}))`):r.type==="quantitative"&&n.push(hx(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function hx(e){return`isValid(${e}) && isFinite(+${e})`}function Yde(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=H(i);return r&&t.push(r),t},[])}function Xde(e){return X(e)&&e.every(t=>de(t))&&e.length>1}class uo extends ze{clone(){return new uo(null,ce(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 Xde(o)?c=o:de(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new uo(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 g=r[h];return ji(g)}).filter(h=>!!h),c=Yde(n),f=n.encoding.order;let d;if(X(f)||q(f))d=QN(f);else{const h=j6(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((g,p)=>(g.field.includes(p)||(g.field.push(p),g.order.push(h)),g),{field:[],order:[]})}return new uo(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 ${Ae(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[H(r,{binSuffix:"mid"})]:[H(r,{}),H(r,{binSuffix:"end"})]:[H(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=H(c,{expr:"datum"}),g=H(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${hx(h)} ? ${f}*${h}+${1-f}*${g} : ${h}`,as:H(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:H(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 Sl extends ze{clone(){return new Sl(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr(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??H(t)}hash(){return`WindowTransform ${Ae(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=>Cw(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 Kde(e){function t(n){if(!(n instanceof Al)){const i=n.clone();if(i instanceof Nn){const r=px+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Ni||i instanceof uo||i instanceof Sl||i instanceof Ha)&&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 gx(e){if(e instanceof Al)if(e.numChildren()===1&&!(e.children[0]instanceof Nn)){const t=e.children[0];(t instanceof Ni||t instanceof uo||t instanceof Sl||t instanceof Ha)&&t.addDimensions(e.fields),t.swapWithParent(),gx(e)}else{const t=e.model.component.data.main;IL(t);const n=Kde(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(gx)}function IL(e){if(e instanceof Nn&&e.type===it.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Al||(t.swapWithParent(),IL(e))}}const px="scale_",qd=5;function mx(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!mx(t.children))return!1}return!0}function Ai(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function RF(e,t,n){let i=e.sources,r=!1;return r=Ai(new Bde,i)||r,r=Ai(new Ide(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=Ai(new qde,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=Ai(new Ude,i)||r,r=Ai(new Hde(t),i)||r,r=Ai(new zde,i)||r,r=Ai(new jde,i)||r,r=Ai(new Gde,i)||r,r=Ai(new Wde,i)||r,r=Ai(new Pde,i)||r,r=Ai(new Vde,i)||r),e.sources=i,r}function Jde(e,t){mx(e.sources);let n=0,i=0;for(let r=0;r<qd&&RF(e,t,!0);r++)n++;e.sources.map(gx);for(let r=0;r<qd&&RF(e,t,!1);r++)i++;mx(e.sources),Math.max(n,i)===qd&&j(`Maximum optimization runs(${qd}) reached.`)}class St{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new St(()=>t(n))}}function zL(e){nt(e)?Qde(e):Zde(e)}function Qde(e){const t=e.component.scales;for(const n of B(t)){const i=the(e,n);if(t[n].setWithExplicit("domains",i),ihe(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)eo(a)&&(a.data=px+a.data.replace(px,""))}}}function Zde(e){for(const n of e.children)zL(n);const t=e.component.scales;for(const n of B(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=ss(i,s.getWithExplicit("domains"),"domains","scale",yx);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(Noe),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function ehe(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=NF(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=NF(t,n);if(r)return"unaggregated"}return e}function the(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=ehe(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"&&xt(i.x2)?xt(i.x)?ss(Do(n,r,e,"x"),Do(n,r,e,"x2"),"domain","scale",yx):Do(n,r,e,"x2"):t==="y"&&xt(i.y2)?xt(i.y)?ss(Do(n,r,e,"y"),Do(n,r,e,"y2"),"domain","scale",yx):Do(n,r,e,"y2"):Do(n,r,e,t)}function nhe(e,t,n){return e.map(i=>({signal:`{data: ${j0(i,{timeUnit:n,type:t})}}`}))}function z1(e,t,n){var r;const i=(r=kt(n))==null?void 0:r.unit;return t==="temporal"||i?nhe(e,t,i):[e]}function Do(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=xt(r[i]),{type:c}=l,f=l.timeUnit,d=zle({invalid:Ar("invalid",o,a),isPath:vs(s)});if(aae(t)){const p=Do(e,void 0,n,i),m=z1(t.unionWith,c,f);return or([...m,...p.value])}else{if(Q(t))return or([t]);if(t&&t!=="unaggregated"&&!C6(t))return or(z1(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Wn([[0,1]]);const p=n.requestDataName(d);return Wn([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const h=Nr(i)&&q(l)?rhe(n,i,e):void 0;if(Lr(l)){const p=z1([l.datum],c,f);return Wn(p)}const g=l;if(t==="unaggregated"){const{field:p}=l;return Wn([{data:n.requestDataName(d),field:H({field:p,aggregate:"min"})},{data:n.requestDataName(d),field:H({field:p,aggregate:"max"})}])}else if(He(g.bin)){if(Dt(e))return Wn(e==="bin-ordinal"?[]:[{data:af(h)?n.requestDataName(d):n.requestDataName(it.Raw),field:n.vgField(i,id(g,i)?{binSuffix:"range"}:{}),sort:h===!0||!Fe(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:p}=g;if(He(p)){const m=$A(n,g.field,p);return Wn([new St(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Wn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&we(["time","utc"],e)){const p=r[Rr(i)];if(U6(g,p,o,a)){const m=n.requestDataName(d),y=os({fieldDef:g,fieldDef2:p,markDef:o,config:a}),b=lf(s)&&y!==.5&&dt(i);return Wn([{data:m,field:n.vgField(i,b?{suffix:Y0}:{})},{data:m,field:n.vgField(i,{suffix:b?X0:"end"})}])}}return Wn(h?[{data:af(h)?n.requestDataName(d):n.requestDataName(it.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function B1(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":I0),...i?{field:bi(i)}:{},...r?{order:r}:{}}}function ihe(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,o=C6(i)?i:void 0,s=za(r)&&D0(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function rhe(e,t,n){if(!Dt(n))return;const i=e.fieldDef(t),r=i.sort;if(z6(r))return{op:"min",field:tl(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(so(r)){const a=o&&!s.has(r.field);return B1(r,a)}else if(zae(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(go(c)||xs(c))return B1({field:H(l),order:u},d);if(Cw(c)||!c)return B1({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(we(["ascending",void 0],r))return!0}}function NF(e,t){const{aggregate:n,type:i}=e;return n?de(n)&&!boe.has(n)?{valid:!1,reason:cse(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:fse(e)}:{valid:!0}:{valid:!1,reason:lse(e)}}function yx(e,t,n,i){return e.explicit&&t.explicit&&j(mse(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function ohe(e){const t=cr(e.map(s=>{if(eo(s)){const{sort:a,...u}=s;return u}return s}),Ae),n=cr(e.map(s=>{if(eo(s)){const a=s.sort;return a!==void 0&&!af(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Ae);if(t.length===0)return;if(t.length===1){const s=e[0];if(eo(s)&&n.length>0){let a=n[0];if(n.length>1){j(P_);const u=n.filter(l=>Fe(l)&&"op"in l&&l.op!=="min");n.every(l=>Fe(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Fe(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=cr(n.map(s=>af(s)||!("op"in s)||de(s.op)&&gt(goe,s.op)?s:(j(bse(s)),!0)),Ae);let r;i.length===1?r=i[0]:i.length>1&&(j(P_),r=!0);const o=cr(e.map(s=>eo(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 DA(e){if(eo(e)&&de(e.field))return e.field;if(xoe(e)){let t;for(const n of e.fields)if(eo(n)&&de(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(xse),t}return j(vse),t}else if(voe(e)){j(Ese);const t=e.fields[0];return de(t)?t:void 0}}function rm(e,t){const i=e.component.scales[t].get("domains").map(r=>(eo(r)&&(r.data=e.lookupDataSource(r.data)),r));return ohe(i)}function BL(e){return Cl(e)||TA(e)?e.children.reduce((t,n)=>t.concat(BL(n)),LF(e)):LF(e)}function LF(e){return B(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=she(r.range,o,n,e),h=rm(e,n),g=a?Kle(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...g?{domainRaw:g}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function she(e,t,n,i){if(dt(n)){if(Ba(e))return{step:{signal:`${t}_step`}}}else if(Fe(e)&&eo(e))return{...e,data:i.lookupDataSource(e.data)};return e}class UL extends $o{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(we([Pt.LOG,Pt.TIME,Pt.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&we([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 ahe=["range","scheme"];function uhe(e){const t=e.component.scales;for(const n of Sw){const i=t[n];if(!i)continue;const r=lhe(n,e);i.setWithExplicit("range",r)}}function PF(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=jn(t),s=e.getName(o);if(Fe(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(He(i)){const a=$A(e,r,i);return new St(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function lhe(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of ahe)if(n[f]!==void 0){const d=Xb(o,f),h=$6(e,f);if(!d)j(o6(o,f,e));else if(h)j(h);else switch(f){case"range":{const g=n.range;if(X(g)){if(dt(e))return or(g.map(p=>{if(p==="width"||p==="height"){const m=t.getName(p),y=t.getSignalName.bind(t);return St.fromName(y,m)}return p}))}else if(Fe(g))return or({data:t.requestDataName(it.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return or(g)}case"scheme":return or(che(n[f]))}}const s=e===et||e==="xOffset"?"width":"height",a=i[s];if(Cr(a)){if(dt(e))if(Dt(o)){const f=qL(a,t,e);if(f)return or({step:f})}else j(s6(s));else if(Kf(e)){const f=e===hs?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=WL(a,o);if(g)return or(g)}}}const{rangeMin:u,rangeMax:l}=n,c=fhe(e,t);return(u!==void 0||l!==void 0)&&Xb(o,"rangeMin")&&X(c)&&c.length===2?or([u??c[0],l??c[1]]):Wn(c)}function che(e){return sae(e)?{scheme:e.name,...Rn(e,["name"])}:{scheme:e}}function jL(e,t,n,{center:i}={}){const r=jn(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===Mt&&Bi(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 fhe(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=xt(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case et:case Mt:{if(we(["point","band"],u)){const f=GL(e,n,i.view);if(Cr(f))return{step:qL(f,t,e)}}return jL(e,t,u)}case hs:case xl:return dhe(e,t,u);case wo:{const f=phe(r,i),d=mhe(r,n,t,i);return Yu(u)?ghe(f,d,hhe(u,i,l,e)):[f,d]}case Ei:return[0,Math.PI*2];case Pa:return[0,360];case Yi: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 gs:return{step:1e3/i.scale.framesPerSecond};case ys:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case bs:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Un:return"symbol";case Bn:case Mr:case Or:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Ao:case ps:case ms:return[i.scale.minOpacity,i.scale.maxOpacity]}}function qL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=vw(n),s=i[o];if(x4({step:e,offsetIsDiscrete:fe(s)&&v6(s.type)})==="offset"&&Z6(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-${Soe(f)})`}}else return e.step}function WL(e,t){if(x4({step:e,offsetIsDiscrete:Dt(t)})==="offset")return{step:e.step}}function dhe(e,t,n){const i=e===hs?"x":"y",r=t.getScaleComponent(i);if(!r)return jL(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=GL(i,t.size,t.config.view);if(Cr(l)){const c=WL(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=m6(l.timeUnit,g=>`scale('${s}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=os({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const g=Q(f)?`${f.signal}/2`+h:`${f/2+d}`,p=Q(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${g} * (${c})`},{signal:`${p} * (${c})`}]}return[0,{signal:c}]}return _N(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function GL(e,t,n){const i=e===et?"width":"height",r=t[i];return r||Wg(n,i)}function hhe(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(Dse(i)),3)}}function ghe(e,t,n){const i=()=>{const r=Mi(t),o=Mi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return Q(t)?new St(i):{signal:i()}}function phe(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(T0("size",e))}const IF=.95;function mhe(e,t,n,i){const r={x:PF(n,"x"),y:PF(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=zF(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=zF(t,r,i.view);return Ze(o)?Math.pow(IF*o,2):new St(()=>`pow(${IF} * ${o.signal}, 2)`)}}throw new Error(T0("size",e))}function zF(e,t,n){const i=Cr(e.width)?e.width.step:Zb(n,"width"),r=Cr(e.height)?e.height.step:Zb(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 HL(e,t){nt(e)?yhe(e,t):YL(e,t)}function yhe(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of B(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=xt(r[a]),d=u[t],h=c.get("type"),g=c.get("padding"),p=c.get("paddingInner"),m=Xb(h,t),y=$6(a,t);if(d!==void 0&&(m?y&&j(y):j(o6(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,x=f.type;switch(t){case"domainMax":case"domainMin":Ua(u[t])||x==="temporal"||b?l.set(t,{signal:j0(u[t],{type:x,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(BF,t)?BF[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:g,scalePaddingInner:p,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:e4(r,a),hasSecondaryRangeChannel:!!r[Rr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const BF={bins:({model:e,fieldOrDatumDef:t})=>q(t)?bhe(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>xhe(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>vhe(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Ehe(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>whe(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>Ahe(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 She(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>Che(e,t,n,i,r,o.scale,s)};function VL(e){nt(e)?uhe(e):YL(e,"range")}function YL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?VL(i):HL(i,t);for(const i of B(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=ss(r,a,t,"scale",M4((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function bhe(e,t){const n=t.bin;if(He(n)){const i=$A(e,t.field,n);return new St(()=>e.getSignalName(i))}else if(Nt(n)&&za(n)&&n.step!==void 0)return{step:n.step}}function xhe(e,t){if(we([Bn,Mr,Or],e)&&t!=="nominal")return"hcl"}function vhe(e,t,n,i,r,o){var s;if(!((s=ji(o))!=null&&s.bin||X(n)||r!=null||i!=null||we([Pt.TIME,Pt.UTC],e)))return dt(t)?!0:void 0}function Ehe(e,t,n,i,r,o){if(dt(e)){if(fr(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 whe(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(Kf(t)&&i===Pt.BAND)return r.offsetBandPaddingInner}}function Ahe(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(Kf(t)){if(n===Pt.POINT)return .5;if(n===Pt.BAND)return r.offsetBandPaddingOuter}}}function She(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Bi(e)&&t==="descending"?Q(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Bi(e)&&t==="descending")return!0}function Che(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Bi(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"&&!Yu(r))return!0;if(!(q(t)&&t.bin)&&we([...So,...ooe],e)){const{orient:u,type:l}=i;return we(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:we(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function $he(e,t,n,i,r=!1){const o=_he(t,n,i,r),{type:s}=e;return Nr(t)?s!==void 0?hae(t,s)?q(n)&&!dae(s,n.type)?(j(gse(s,o)),o):s:(j(hse(t,s,o)),o):o:null}function _he(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Eu(e)||C1(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j($1(e,"ordinal")),"ordinal";if(S1(e))return"band";if(dt(e)||Kf(e)){if(we(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in Aw)return"band";const o=n[jn(e)];return Ea(o)||Ku(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Eu(e)?"time":C1(e)==="discrete"?(j($1(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&kt(t.timeUnit).utc?"utc":S1(e)?"band":"time";case"quantitative":return Eu(e)?q(t)&&He(t.bin)?"bin-ordinal":"linear":C1(e)==="discrete"?(j($1(e,"quantitative")),"ordinal"):S1(e)?"band":"linear";case"geojson":return}throw new Error(i6(t.type))}function Fhe(e,{ignoreRange:t}={}){XL(e),zL(e);for(const n of fae)HL(e,n);t||VL(e)}function XL(e){nt(e)?e.component.scales=khe(e):e.component.scales=The(e)}function khe(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of Sw){const s=xt(t[o]);if(s&&n===k6&&o===Un&&s.type===vl)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=e4(t,o),l=$he(a,o,s,i,u);r[o]=new UL(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const Dhe=M4((e,t)=>z_(e)-z_(t));function The(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){XL(o);for(const s of B(o.component.scales))if((t=r.scale)[s]??(t[s]=$L(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?tae(a.value,u.value)?i[s]=ss(a,u,"type","scale",Dhe):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of B(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new UL(s,a);for(const u of e.children){const l=u.component.scales[o];l&&(u.renameScale(l.get("name"),s),l.merged=!0)}}return n}class U1{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 nt(e){return(e==null?void 0:e.type)==="unit"}function Zn(e){return(e==null?void 0:e.type)==="facet"}function TA(e){return(e==null?void 0:e.type)==="concat"}function Cl(e){return(e==null?void 0:e.type)==="layer"}class MA{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=Ro(t.title)?{text:t.title}:t.title?Lt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new U1,this.projectionNameMap=i?i.projectionNameMap:new U1,this.signalNameMap=i?i.signalNameMap:new U1,this.data=t.data,this.description=t.description,this.transforms=_le(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Tue(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:z0(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new $o,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?ce(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(){Fhe(this)}parseProjection(){LL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){TL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of B(i)){const s=i[o];s!==void 0&&(r[o]=Ye(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ye(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Ue(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=Jfe(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 di)t[i].title&&n.push(Gfe(this,i));for(const i of wA)n=n.concat(Hfe(this,i));return n}assembleAxes(){return Mfe(this.component.axes,this.config)}assembleLegends(){return OL(this)}assembleProjections(){return vde(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...YN(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return we(["unit","layer"],this.type)?we(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Ue(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)?BL(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(it[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=SL(t),i=F0(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(Dt(o)&&Ba(s)){const a=r.get("name"),u=rm(this,i),l=DA(u);if(l){const c=H({aggregate:"distinct",field:l},{expr:"datum"});return{signal:AL(a,r,c)}}else return j(_w(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(BN(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(koe(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class KL extends MA{vgField(t,n={}){const i=this.fieldDef(t);if(i)return H(i,n)}reduceFieldDef(t,n){return sue(this.getMapping(),(i,r,o)=>{const s=ji(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){tA(this.getMapping(),(i,r)=>{const o=ji(i);o&&t(o,r)},n)}}class om extends ze{clone(){return new om(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class sm extends ze{clone(){return new sm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Ae(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class am extends ze{clone(){return new am(this.parent,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class um extends ze{clone(){return new um(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Su extends ze{clone(){return new Su(null,ce(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[[Ki,Xi],[xi,Ji]]){const o=r.map(s=>{const a=xt(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 Su(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Un)){const r=n.typedFieldDef(Un);r.type===vl&&(t=new Su(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(de);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Ae(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 hf extends ze{clone(){return new hf(null,this.projection,ce(this.fields),ce(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[[Ki,Xi],[xi,Ji]]){const r=i.map(s=>{const a=xt(n.encoding[s]);return q(a)?a.field:Lr(a)?{expr:`${a.datum}`}:Ui(a)?{expr:`${a.value}`}:void 0}),o=i[0]===xi?"2":"";(r[0]||r[1])&&(t=new hf(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(de))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Ae(this.fields)} ${Ae(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class na extends ze{clone(){return new na(null,ce(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 na(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=i4(n.mark,i);return new na(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 ${Ae(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:ule(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 lm extends ze{clone(){return new lm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class gf extends ze{clone(){return new gf(null,ce(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(lle(s)){let u=ZL(s.data,o);u||(u=new _a(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new Nn(u,l,it.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(cle(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Qe(u),u)}catch{throw new Error(Ooe(u))}if(a=l.materialized,!a)throw new Error(Roe(u))}return new gf(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 ${Ae({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;de(n)||(j(Goe),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 cm extends ze{clone(){return new cm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class fm extends ze{clone(){return new fm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ce(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 ${Ae(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class dm extends ze{clone(){return new dm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=cr((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Ae(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 hm extends ze{clone(){return new hm(null,ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Ae(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function JL(e){let t=0;function n(i,r){if(i instanceof _a&&!i.isGenerator&&!Qu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof tn&&(i.parent instanceof _a&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Al){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 ld||i instanceof cd||i instanceof il||i instanceof wl||i instanceof el||i instanceof hf||i instanceof Ni||i instanceof gf||i instanceof Sl||i instanceof Ha||i instanceof um||i instanceof am||i instanceof om||i instanceof lm||i instanceof cm||i instanceof fm||i instanceof as||i instanceof hm||i instanceof dm||i instanceof sm)&&r.transform.push(i.assemble()),(i instanceof mr||i instanceof gr||i instanceof na||i instanceof uo||i instanceof Su)&&r.transform.push(...i.assemble()),i instanceof Nn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof Nn?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 Nn&&(!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 Mhe(e){const t=[],n=JL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Ohe(e,t){const n=[],i=JL(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 Rhe(e){return e==="top"||e==="left"||Q(e)?"header":"footer"}function Nhe(e){for(const t of di)Lhe(e,t);UF(e,"x"),UF(e,"y")}function Lhe(e,t){var s;const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],u=nl("title",null,i,t);let l=wu(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=X(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=nl("labelOrient",a.header,i,t),f=a.header!==null?ft((s=a.header)==null?void 0:s.labels,i.header.labels,!0):!1,d=we(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[QL(e,t,f)]}}}function QL(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 UF(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=CA(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=Rhe(a.get("orient"));s[u]??(s[u]=[QL(e,o,!1)]);const l=vc(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function Phe(e){OA(e),Xg(e,"width"),Xg(e,"height")}function Ihe(e){OA(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Xg(e,t),Xg(e,n)}function OA(e){for(const t of e.children)t.parseLayoutSize()}function Xg(e,t){const n=SL(t),i=F0(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]??$L(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=ss(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 zhe(e){const{size:t,component:n}=e;for(const i of So){const r=jn(i);if(t[r]){const o=t[r];n.layoutSize.set(r,Cr(o)?"step":o,!0)}else{const o=Bhe(e,r);n.layoutSize.set(r,o,!1)}}}function Bhe(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(Dt(o)){const a=Wg(i.view,t);return Ba(s)||Cr(a)?"step":a}else return Qb(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Qb(i.view,t);{const o=Wg(i.view,t);return Cr(o)?o.step:o}}}function bx(e,t,n){return H(t,{suffix:`by_${H(e)}`,...n})}class Pc extends KL{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=IA(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ed(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=B(t),i={};for(const r of n){if(![ro,oo].includes(r)){j(T0(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Vb(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=eA(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=gm(this),this.child.parseData()}parseLayoutSize(){OA(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Nhe(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 di)for(const i of AA){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=nl("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=nm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(o!=null&&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]={}),t[u][n]=.5),r.title&&(t.offset??(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 Pc))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Pc?{...this.channelHasField("column")?{encode:{update:{columns:{field:H(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof Pc){if(this.child.channelHasField("column")){const r=H(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of So){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Dt(s)&&Ba(a)){const u=rm(this.child,r),l=DA(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(_w(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 di){const f=this.facet[c];if(f){u.push(H(f));const{bin:d,sort:h}=f;if(He(d)&&u.push(H(f,{binSuffix:"end"})),so(h)){const{field:g,op:p=I0}=h,m=bx(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(g),s.push(p),a.push(m))}else if(X(h)){const g=tl(f,c);o.push(g),s.push("max"),a.push(g)}}}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?so(i.sort)?[bx(i,i.sort,{expr:"datum"})]:X(i.sort)?[tl(i,t,{expr:"datum"})]:[H(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(so(r)?r.order:!X(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return fx(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of wA)if(t[o]){const s=nl("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return fx(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Mhe(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:di.map(u=>this.facetSortFields(u)).flat(),order:di.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Hle(this,[]))}]}getMapping(){return this.facet}}function Uhe(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(so(o.sort)){const{field:s,op:a=I0}=o.sort;e=r=new Ha(e,{joinaggregate:[{op:a,field:s,as:bx(o,o.sort,{forAs:!0})}],groupby:[H(o)]})}return r}return null}function ZL(e,t){var n,i,r,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((u||f)&&u!==f)){if(cf(e)&&cf(a)){if(Xn(e.values,a.values))return s}else if(Qu(e)&&Qu(a)){if(e.url===a.url)return s}else if(O4(e)&&e.name===s.dataName)return s}}return null}function jhe(e,t){if(e.data||!e.parent){if(e.data===null){const i=new _a({values:[]});return t.push(i),i}const n=ZL(e.data,t);if(n)return Xo(e.data)||(n.data.format=FN({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new _a(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 qhe(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(vle(r))s=e=new el(e,r),o="derived";else if(dA(r)){const a=Ode(r);s=e=tn.makeWithAncestors(e,{},a,n)??e,e=new wl(e,t,r.filter)}else if(F4(r))s=e=mr.makeFromTransform(e,r,t),o="number";else if(wle(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=gr.makeFromTransform(e,r);else if(Ale(r))s=e=Ni.makeFromTransform(e,r),o="number",bA(t)&&(e=new as(e));else if(_4(r))s=e=gf.make(e,t,r,i++),o="derived";else if(yle(r))s=e=new Sl(e,r),o="number";else if(ble(r))s=e=new Ha(e,r),o="number";else if(Sle(r))s=e=uo.makeFromTransform(e,r),o="derived";else if(Cle(r))s=e=new um(e,r),o="derived";else if($le(r))s=e=new sm(e,r),o="derived";else if(xle(r))s=e=new am(e,r),o="derived";else if(fle(r))s=e=new dm(e,r),o="derived";else if(mle(r))e=new hm(e,r);else if(Ele(r))s=e=na.makeFromTransform(e,r),o="derived";else if(dle(r))s=e=new om(e,r),o="derived";else if(hle(r))s=e=new cm(e,r),o="derived";else if(gle(r))s=e=new fm(e,r),o="derived";else if(ple(r))s=e=new lm(e,r),o="derived";else{j(Woe(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function gm(e){var m;let t=jhe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(Xo(r)||Qu(r)||cf(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Ile;Xo(r)?(R4(r)?t=new cd(t,r.sequence):hA(r)&&(t=new ld(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=tn.makeExplicit(t,e,s)??t,t=new as(t);const a=e.parent&&Cl(e.parent);(nt(e)||Zn(e))&&a&&(t=mr.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=qhe(t,e,s));const u=Nde(e),l=Rde(e);t=tn.makeWithAncestors(t,{},{...u,...l},s)??t,nt(e)&&(t=Su.parseAll(t,e),t=hf.parseAll(t,e)),(nt(e)||Zn(e))&&(a||(t=mr.makeFromEncoding(t,e)??t),t=gr.makeFromEncoding(t,e)??t,t=el.parseAllForSortIndex(t,e));const c=t=Wd(it.Raw,e,t);if(nt(e)){const y=Ni.makeFromEncoding(t,e);y&&(t=y,bA(e)&&(t=new as(t))),t=na.makeFromEncoding(t,e)??t,t=uo.makeFromEncoding(t,e)??t}let f,d;if(nt(e)){const{markDef:y,mark:b,config:x}=e,v=Be("invalid",y,x),{marks:w,scales:A}=d=L4({invalid:v,isPath:vs(b)});w!==A&&A==="include-invalid-values"&&(f=t=Wd(it.PreFilterInvalid,e,t)),w==="exclude-invalid-values"&&(t=il.make(t,e,d)??t)}const h=t=Wd(it.Main,e,t);let g;if(nt(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=il.make(t,e,d)??t,g=t=Wd(it.PostFilterInvalid,e,t))}nt(e)&&Dfe(e,h);let p=null;if(Zn(e)){const y=e.getName("facet");t=Uhe(t,e.facet)??t,p=new Al(t,e,y,h.getSource()),n[y]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:p,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:g}}function Wd(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new Nn(n,o,e,r);return i[o]=s,s}class Whe extends MA{constructor(t,n,i,r){var o,s,a,u;super(t,"concat",n,i,r,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(Uoe),this.children=this.getChildren(t).map((l,c)=>IA(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=gm(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 B(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return G0(t)?t.vconcat:cA(t)?t.hconcat:t.concat}parseLayoutSize(){Ihe(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=SA(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 Ghe(e){return e===!1||e===null}const Hhe={disable:1,gridScale:1,scale:1,...J6,labelExpr:1,encode:1},e8=B(Hhe);class RA extends $o{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new RA(ce(this.explicit),ce(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Ghe(this.get(t))}hasOrientSignalRef(){return Q(this.explicit.orient)}}function Vhe(e,t,n){const{encoding:i,config:r}=e,o=xt(i[t])??xt(i[Rr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(wa(u))return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(Xu(o)==="quantitative"){if(Ku(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(Xu(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:Oi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Yhe(e){return So.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[tge(n,e)]),t),{})}const Xhe={bottom:"top",top:"bottom",left:"right",right:"left"};function Khe(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 B(r.component.axes))n.axis[o]=CA(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=Jhe(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of So){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=Xhe[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 Jhe(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]=Qhe(r,o)}}}else return t.map(n=>n.clone());return e}function Qhe(e,t){for(const n of e8){const i=ss(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return t6(r,o);case"gridScale":return{explicit:r.explicit,value:ft(r.value,o.value)}}return V0(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function Zhe(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:uf(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===xL(i,r))return!0}return e===n[t]}const ege=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function tge(e,t){var y,b;let n=t.axis(e);const i=new RA,r=xt(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=s.axis)==null?void 0:b.orient)||Bfe(e),u=t.getScaleComponent(e).get("type"),l=Ofe(e,u,a,t.config),c=n!==void 0?!n:lx("disable",s.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Pfe(r,n,e,s.style,l),d=P6(n.formatType,r,u),h=L6(r,r.type,n.format,n.formatType,s,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of e8){const v=x in $F?$F[x](g):H_(x)?n[x]:void 0,w=v!==void 0,A=Zhe(v,x,n,t,e);if(w&&A)i.set(x,v,A);else{const{configValue:E=void 0,configFrom:S=void 0}=H_(x)&&x!=="values"?lx(x,s.style,n.style,l):{},C=E!==void 0;w&&!C?i.set(x,v,A):(S!=="vgAxisConfig"||ege.has(x)&&C||rd(E)||Q(E))&&i.set(x,E,!1)}}const p=n.encoding??{},m=K6.reduce((x,v)=>{if(!i.hasAxisPart(v))return x;const w=CL(p[v]??{},t),A=v==="labels"?Vhe(t,e,w):w;return A!==void 0&&!Ue(A)&&(x[v]={update:A}),x},{});return Ue(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function nge({encoding:e,size:t}){for(const n of So){const i=jn(n);Cr(t[i])&&Wo(e[n])&&(delete t[i],j(s6(i)))}return t}const ige={vgMark:"arc",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...po(e,"radius"),...po(e,"theta")})},rge={vgMark:"area",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Gg("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Gg("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...yA(e)})},oge={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y")})},sge={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===vl?{field:H(n,{expr:"datum"})}:{}}]}},age={vgMark:"image",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y"),...pA(e,"url")})},uge={vgMark:"line",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e,{vgChannel:"strokeWidth"}),...yA(e)})},lge={vgMark:"trail",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e),...yA(e)})};function NA(e,t){const{config:n}=e;return{...wi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...It("size",e),...It("angle",e),...cge(e,n,t)}}function cge(e,t,n){return n?{shape:{value:n}}:It("shape",e)}const fge={vgMark:"symbol",encodeEntry:e=>NA(e)},dge={vgMark:"symbol",encodeEntry:e=>NA(e,"circle")},hge={vgMark:"symbol",encodeEntry:e=>NA(e,"square")},gge={vgMark:"rect",encodeEntry:e=>({...wi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...po(e,"x"),...po(e,"y")})},pge={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"}),...Gg("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Gg("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...It("size",e,{vgChannel:"strokeWidth"})}}},mge={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"}),...bn("x",e,{defaultPos:"mid"}),...bn("y",e,{defaultPos:"mid"}),...pA(e),...It("size",e,{vgChannel:"fontSize"}),...It("angle",e),...pF("align",yge(e.markDef,n,t)),...pF("baseline",bge(e.markDef,n,t)),...bn("radius",e,{defaultPos:null}),...bn("theta",e,{defaultPos:null})}}};function yge(e,t,n){if(Be("align",e,n)===void 0)return"center"}function bge(e,t,n){if(Be("baseline",e,n)===void 0)return"middle"}const xge={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"}),...po(e,r),...bn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ye(Be("thickness",n,t))}}},Gd={arc:ige,area:rge,bar:oge,circle:dge,geoshape:sge,image:age,line:uge,point:fge,rect:gge,rule:pge,square:hge,text:mge,tick:xge,trail:lge};function vge(e){if(we([L0,R0,yae],e.mark)){const t=i4(e.mark,e.encoding);if(t.length>0)return Ege(e,t)}else if(e.mark===N0){const t=Gb.some(n=>Be(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return wge(e)}return LA(e)}const jF="faceted_path_";function Ege(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:jF+e.requestDataName(it.Main),data:e.requestDataName(it.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:LA(e,{fromPrefix:jF})}]}const qF="stack_group_";function wge(e){var l;const[t]=LA(e,{fromPrefix:qF}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...qu(t.encode.update,["y","yc","y2","height",...Gb]),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={...Rn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...qu(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={...Rn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of Gb){const f=Ar(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Ye(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=H(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(H(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=Ar(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ye(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(it.Main),name:qF+e.requestDataName(it.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 Age(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!X(s)&&Ui(s)&&qb(s.value)||!s&&qb(Be("order",r,o)))){if((X(s)||q(s))&&!n)return QN(s,{expr:"datum"});if(vs(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function LA(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=ft(i.clip,Sge(e),Cge(e)),a=KN(i),u=r.key,l=Age(e),c=$ge(e),f=Be("aria",i,o),d=Gd[n].postEncodingTransform?Gd[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Gd[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(it.Main)},encode:{update:Gd[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Sge(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Cge(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function $ge(e){if(!e.component.selection)return null;const t=B(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=B(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class t8 extends KL{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,Y_(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>{var c,f,d;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+I4)),(d=(f=l.from)==null?void 0:f.facet)!=null&&d.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l};const s=Sr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=ele(s,o,{graticule:t.data&&hA(t.data)}));const u=this.encoding=rue(t.encoding||{},a,s.filled,o);this.markDef=S4(s,u,o),this.size=nge({encoding:u,size:Y_(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=A4(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=>uA(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===k6,i=t&&Kre.some(r=>fe(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 Sw.reduce((i,r)=>{const o=xt(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(Vn)),X(i)&&(r.range=i.map(Vn)),r}initAxes(t){return So.reduce((n,i)=>{const r=t[i];if(fe(r)||i===et&&fe(t.x2)||i===Mt&&fe(t.y2)){const o=fe(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=B(t),i={};for(const r of n){const o=t[r];i[r]=rd(o)?XN(o):Vn(o)}return i}initLegends(t){return aoe.reduce((n,i)=>{const r=xt(t[i]);if(r&&loe(i)){const o=r.legend;n[i]=o&&Lt(o)}return n},{})}parseData(){this.component.data=gm(this)}parseLayoutSize(){zhe(this)}parseSelections(){this.component.selection=kfe(this,this.selection)}parseMarkGroup(){this.component.mark=vge(this)}parseAxesAndHeaders(){this.component.axes=Yhe(this)}assembleSelectionTopLevelSignals(t){return Vle(this,t)}assembleSignals(){return[...mL(this),...Gle(this,[])]}assembleSelectionData(t){return Yle(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return SA(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Cl(this.parent))&&(t=j4(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 ea(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return ji(n)}typedFieldDef(t){const n=this.fieldDef(t);return Cn(n)?n:null}}class PA extends MA{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(H0(a))return new PA(a,this,this.getName(`layer_${u}`),s,o);if(Co(a))return new t8(a,this,this.getName(`layer_${u}`),s,o);throw new Error($w(a))})}parseData(){this.component.data=gm(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Phe(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>pr(t))&&kw(Fw)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Khe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),mL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),SA(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 Xle(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),OL(this))}}function IA(e,t,n,i,r){if(z0(e))return new Pc(e,t,n,r);if(H0(e))return new PA(e,t,n,i,r);if(Co(e))return new t8(e,t,n,i,r);if(Fue(e))return new Whe(e,t,n,r);throw new Error($w(e))}function _ge(e,t={}){t.logger&&Tse(t.logger),t.fieldTitle&&V6(t.fieldTitle);try{const n=w4($N(t.config,e.config)),i=T4(e,n),r=IA(i,null,"",void 0,n);return r.parse(),Jde(r.component.data,r),{spec:kge(r,Fge(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Mse(),t.fieldTitle&&Xae()}}function Fge(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)):de(t)&&(t={type:t}),r&&o&&Nle(t.type)){if(r==="step"&&o==="step")j(M_()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(M_(F0(s)));const a=s==="width"?"height":"width";t.type=Lle(a)}}return{...B(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...sF(n,!1),...sF(e,!0)}}function kge(e,t,n={},i){const r=e.config?jue(e.config):void 0,o=Ohe(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(g=>(g.name==="width"||g.name==="height")&&g.value!==void 0?(t[g.name]=+g.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v5.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([]),...b4(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Dge=Dre.version,Tge=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Gu,accessPathWithDatum:mw,accessWithDatumToUnescapedPath:Le,compile:_ge,contains:we,deepEqual:Xn,deleteNestedProperty:Ng,duplicate:ce,entries:is,every:hw,fieldIntersection:pw,flatAccessWithDatum:DN,getFirstDefined:ft,hasIntersection:gw,hasProperty:U,hash:Ae,internalField:ON,isBoolean:af,isEmpty:Ue,isEqual:Hre,isInternalField:RN,isNullOrFalse:qb,isNumeric:w0,keys:B,logicalExpr:Rc,mergeDeep:FN,never:_N,normalize:T4,normalizeAngle:uf,omit:Rn,pick:qu,prefixGenerator:Wb,removePathFromField:bl,replaceAll:ma,replacePathInField:bi,resetIdCounter:Yre,setEqual:kN,some:Wu,stringify:je,titleCase:Vf,unique:cr,uniqueId:MN,vals:qt,varName:Qe,version:Dge},Symbol.toStringTag,{value:"Module"}));function n8(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Mge="2.15.0",Oge={version:Mge};const ou="#fff",WF="#888",Rge={background:"#333",view:{stroke:WF},title:{color:ou,subtitleColor:ou},style:{"guide-label":{fill:ou},"guide-title":{fill:ou}},axis:{domainColor:ou,gridColor:WF,tickColor:ou}},Fs="#4572a7",Nge={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",j1="#cbcbcb",Lge="#999",Pge="#333",GF="#f0f0f0",HF="#333",Ige={arc:{fill:ks},area:{fill:ks},axis:{domainColor:j1,grid:!0,gridColor:j1,gridWidth:1,labelColor:Lge,labelFontSize:10,titleColor:Pge,tickColor:j1,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:GF,group:{fill:GF},legend:{labelColor:HF,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:HF,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",zge={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"]}},Bge=22,Uge="normal",VF="Benton Gothic, sans-serif",YF=11.5,jge="normal",Ts="#82c6df",q1="Benton Gothic Bold, sans-serif",XF="normal",KF=13,Xl={"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"]},qge={background:"#ffffff",title:{anchor:"start",color:"#000000",font:q1,fontSize:Bge,fontWeight:Uge},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:VF,labelFontSize:YF,labelFontWeight:jge,titleFont:q1,titleFontSize:KF,titleFontWeight:XF},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:VF,labelFontSize:YF,symbolType:"square",titleFont:q1,titleFontSize:KF,titleFontWeight:XF},range:{category:Xl["category-6"],diverging:Xl["fireandice-6"],heatmap:Xl["fire-7"],ordinal:Xl["fire-7"],ramp:Xl["fire-7"]}},Ms="#ab5787",Hd="#979797",Wge={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:Hd,domainWidth:.5,gridWidth:.2,labelColor:Hd,tickColor:Hd,tickWidth:.2,titleColor:Hd},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",Gge={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"]}},si="#1696d2",JF="#000000",Hge="#FFFFFF",Vd="Lato",W1="Lato",Vge="Lato",Yge="#DEDDDD",Xge=18,Kl={"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"]},Kge={background:Hge,title:{anchor:"start",fontSize:Xge,font:Vd},axisX:{domain:!0,domainColor:JF,domainWidth:1,grid:!1,labelFontSize:12,labelFont:W1,labelAngle:0,tickColor:JF,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Vd},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Yge,gridWidth:1,labelFontSize:12,labelFont:W1,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Vd,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:W1,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Vd,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Kl["six-groups-cat-1"],diverging:Kl["diverging-colors"],heatmap:Kl["diverging-colors"],ordinal:Kl["six-groups-seq"],ramp:Kl["shades-blue"]},area:{fill:si},rect:{fill:si},line:{color:si,stroke:si,strokeWidth:5},trail:{color:si,stroke:si,strokeWidth:0,size:1},path:{stroke:si,strokeWidth:.5},point:{filled:!0},text:{font:Vge,color:si,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:si,stroke:null}},arc:{fill:si},shape:{stroke:si},symbol:{fill:si,size:30}},Rs="#3366CC",QF="#ccc",Yd="Arial, sans-serif",Jge={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:Yd,fontSize:12},"guide-title":{font:Yd,fontSize:12},"group-title":{font:Yd,fontSize:12}},title:{font:Yd,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:QF,tickColor:QF,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},zA=e=>e*(1/3+1),ZF=zA(9),ek=zA(10),tk=zA(12),Jl="Segoe UI",nk="wf_standard-font, helvetica, arial, sans-serif",ik="#252423",Ql="#605E5C",rk="transparent",Qge="#C8C6C4",Ci="#118DFF",Zge="#12239E",epe="#E66C37",tpe="#6B007B",npe="#E044A7",ipe="#744EC2",rpe="#D9B300",ope="#D64550",i8=Ci,r8="#DEEFFF",ok=[r8,i8],spe=[r8,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",i8],ape={view:{stroke:rk},background:rk,font:Jl,header:{titleFont:nk,titleFontSize:tk,titleColor:ik,labelFont:Jl,labelFontSize:ek,labelColor:Ql},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Ql,labelFontSize:ZF,titleFont:nk,titleColor:ik,titleFontSize:tk,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Qge,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ci},line:{stroke:Ci,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Jl,fontSize:ZF,fill:Ql},arc:{fill:Ci},area:{fill:Ci,line:!0,opacity:.6},path:{stroke:Ci},rect:{fill:Ci},point:{fill:Ci,filled:!0,size:75},shape:{stroke:Ci},symbol:{fill:Ci,strokeWidth:1.5,size:50},legend:{titleFont:Jl,titleFontWeight:"bold",titleColor:Ql,labelFont:Jl,labelFontSize:ek,labelColor:Ql,symbolType:"circle",symbolSize:75},range:{category:[Ci,Zge,epe,tpe,npe,ipe,rpe,ope],diverging:ok,heatmap:ok,ordinal:spe}},G1='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',upe='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',H1=400,Xd={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"}},lpe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],cpe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function pm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=Xd.gridBg[e],r=Xd.textPrimary[e],o=Xd.textSecondary[e],s=n==="dark"?lpe:cpe,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:G1,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:upe,labelFontWeight:H1,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Xd.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:G1,fill:o,fontWeight:H1},"guide-title":{font:G1,fill:o,fontWeight:H1}},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 fpe=pm({theme:"white",background:"#ffffff"}),dpe=pm({theme:"g10",background:"#f4f4f4"}),hpe=pm({theme:"g90",background:"#262626"}),gpe=pm({theme:"g100",background:"#161616"}),ppe=Oge.version,mpe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:dpe,carbong100:gpe,carbong90:hpe,carbonwhite:fpe,dark:Rge,excel:Nge,fivethirtyeight:Ige,ggplot2:zge,googlecharts:Jge,latimes:qge,powerbi:ape,quartz:Wge,urbaninstitute:Kge,version:ppe,vox:Gge},Symbol.toStringTag,{value:"Module"}));function $l(e,t,n){return e.fields=t||[],e.fname=n,e}function ype(e){return e.length===1?bpe(e[0]):xpe(e)}const bpe=e=>function(t){return t[e]},xpe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function V1(e){throw Error(e)}function vpe(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||V1("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&V1("Access path missing closing bracket: "+e),i&&V1("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Epe(e,t,n){const i=vpe(e);return e=i.length===1?i[0]:e,$l(ype(i),[e],e)}Epe("id");$l(e=>e,[],"identity");$l(()=>0,[],"zero");$l(()=>1,[],"one");$l(()=>!0,[],"true");$l(()=>!1,[],"false");var wpe=Array.isArray;function sk(e){return e===Object(e)}function Ape(e){return typeof e=="string"}function Spe(e,t,n,i){if(wpe(e))return`[${e.map(r=>t(Ape(r)?r:ak(r,n))).join(", ")}]`;if(sk(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&&(sk(c)&&(c=ak(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 Cpe(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 ak(e,t){return JSON.stringify(e,Cpe(t))}var $pe=`#vg-tooltip-element {
18
18
  visibility: hidden;
19
19
  padding: 8px;
20
20
  position: fixed;
@@ -68,16 +68,16 @@ ${a}`)}return l}(e,"",0)}function bre(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e
68
68
  #vg-tooltip-element.dark-theme td.key {
69
69
  color: #bfbfbf;
70
70
  }
71
- `;const a8="vg-tooltip-element",$pe={offsetX:10,offsetY:10,id:a8,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:_pe,maxDepth:2,formatTooltip:Ape,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function _pe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function Fpe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Cpe.toString().replace(a8,e)}function u8(e,t,{offsetX:n,offsetY:i}){const r=l8({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 kpe(e,t,n,i,r){const{position:o,offsetX:s,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=Dpe(u,l,n),f=l8(c,i,s,a),d=Array.isArray(o)?o:[o];for(const h of d)if(c8(f[h],i)&&!Tpe(t,f[h],i))return f[h];return u8(t,i,r)}function Dpe(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 l8(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 Tpe(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 Mpe{constructor(t){this.options={...$pe,...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=Fpe(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"?kpe(t,n,i,this.el.getBoundingClientRect(),this.options):u8(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var Y1={};/*!
71
+ `;const o8="vg-tooltip-element",_pe={offsetX:10,offsetY:10,id:o8,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Fpe,maxDepth:2,formatTooltip:Spe,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Fpe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function kpe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return $pe.toString().replace(o8,e)}function s8(e,t,{offsetX:n,offsetY:i}){const r=a8({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(u8(r[s],t))return r[s];return r["top-left"]}function Dpe(e,t,n,i,r){const{position:o,offsetX:s,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=Tpe(u,l,n),f=a8(c,i,s,a),d=Array.isArray(o)?o:[o];for(const h of d)if(u8(f[h],i)&&!Mpe(t,f[h],i))return f[h];return s8(t,i,r)}function Tpe(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 a8(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 u8(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Mpe(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 Ope{constructor(t){this.options={..._pe,...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=kpe(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"?Dpe(t,n,i,this.el.getBoundingClientRect(),this.options):s8(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var Y1={};/*!
72
72
  * https://github.com/Starcounter-Jack/JSON-Patch
73
73
  * (c) 2017-2022 Joachim Wester
74
74
  * MIT licensed
75
- */var Ope=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)}}(),Rpe=Object.prototype.hasOwnProperty;function xx(e,t){return Rpe.call(e,t)}function vx(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)xx(e,r)&&i.push(r);return i}function Kn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Ex(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 Is(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function f8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function wx(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(wx(e[t]))return!0}else if(typeof e=="object"){for(var i=vx(e),r=i.length,o=0;o<r;o++)if(wx(e[i[o]]))return!0}}return!1}function uk(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(`
76
- `)}var d8=function(e){Ope(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,uk(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=uk(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),ot=d8,Npe=Kn,gu={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=Kg(n,this.path);i&&(i=Kn(i));var r=ia(n,{op:"remove",path:this.from}).removed;return ia(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Kg(n,this.from);return ia(n,{op:"add",path:this.path,value:Kn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:pf(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Lpe={add:function(e,t,n){return Ex(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:gu.move,copy:gu.copy,test:gu.test,_get:gu._get};function Kg(e,t){if(t=="")return e;var n={op:"_get",path:t};return ia(e,n),n.value}function ia(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):Jg(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=Kg(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=pf(e,t.value),s.test===!1)throw new ot("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 ot("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Kn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,g=void 0;for(typeof n=="function"?g=n:g=Jg;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=f8(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&&g(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!Ex(h))throw new ot("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);Ex(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new ot("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=Lpe[t.op].call(t,l,h,e);if(s.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=gu[t.op].call(t,l,h,e);if(s.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new ot("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function mm(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new ot("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Kn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=ia(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function Ppe(e,t,n){var i=ia(e,t);if(i.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Jg(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new ot("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(gu[e.op]){if(typeof e.path!="string")throw new ot("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ot('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 ot("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 ot("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")&&wx(e.value))throw new ot("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 ot("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 ot("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=h8([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new ot("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ot("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function h8(e,t,n){try{if(!Array.isArray(e))throw new ot("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)mm(Kn(t),Kn(e),n||!0);else{n=n||Jg;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof ot)return r;throw r}}function pf(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(!pf(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],!pf(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}var Ipe=Object.freeze({__proto__:null,JsonPatchError:ot,_areEquals:pf,applyOperation:ia,applyPatch:mm,applyReducer:Ppe,deepClone:Npe,getValueByPointer:Kg,validate:h8,validator:Jg});/*!
75
+ */var Rpe=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)}}(),Npe=Object.prototype.hasOwnProperty;function xx(e,t){return Npe.call(e,t)}function vx(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)xx(e,r)&&i.push(r);return i}function Kn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Ex(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 Is(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function wx(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(wx(e[t]))return!0}else if(typeof e=="object"){for(var i=vx(e),r=i.length,o=0;o<r;o++)if(wx(e[i[o]]))return!0}}return!1}function uk(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(`
76
+ `)}var c8=function(e){Rpe(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,uk(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=uk(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),ot=c8,Lpe=Kn,gu={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=Kg(n,this.path);i&&(i=Kn(i));var r=ia(n,{op:"remove",path:this.from}).removed;return ia(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Kg(n,this.from);return ia(n,{op:"add",path:this.path,value:Kn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:pf(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Ppe={add:function(e,t,n){return Ex(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:gu.move,copy:gu.copy,test:gu.test,_get:gu._get};function Kg(e,t){if(t=="")return e;var n={op:"_get",path:t};return ia(e,n),n.value}function ia(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):Jg(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=Kg(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=pf(e,t.value),s.test===!1)throw new ot("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 ot("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Kn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,g=void 0;for(typeof n=="function"?g=n:g=Jg;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=l8(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&&g(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!Ex(h))throw new ot("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);Ex(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new ot("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=Ppe[t.op].call(t,l,h,e);if(s.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=gu[t.op].call(t,l,h,e);if(s.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new ot("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function mm(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new ot("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Kn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=ia(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function Ipe(e,t,n){var i=ia(e,t);if(i.test===!1)throw new ot("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Jg(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new ot("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(gu[e.op]){if(typeof e.path!="string")throw new ot("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ot('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 ot("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 ot("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")&&wx(e.value))throw new ot("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 ot("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 ot("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=f8([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new ot("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ot("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function f8(e,t,n){try{if(!Array.isArray(e))throw new ot("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)mm(Kn(t),Kn(e),n||!0);else{n=n||Jg;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof ot)return r;throw r}}function pf(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(!pf(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],!pf(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}var zpe=Object.freeze({__proto__:null,JsonPatchError:ot,_areEquals:pf,applyOperation:ia,applyPatch:mm,applyReducer:Ipe,deepClone:Lpe,getValueByPointer:Kg,validate:f8,validator:Jg});/*!
77
77
  * https://github.com/Starcounter-Jack/JSON-Patch
78
78
  * (c) 2017-2021 Joachim Wester
79
79
  * MIT license
80
- */var BA=new WeakMap,zpe=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Bpe=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function Upe(e){return BA.get(e)}function jpe(e,t){return e.observers.get(t)}function qpe(e,t){e.observers.delete(t.callback)}function Wpe(e,t){t.unobserve()}function Gpe(e,t){var n=[],i,r=Upe(e);if(!r)r=new zpe(e),BA.set(e,r);else{var o=jpe(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Kn(e),t){i.callback=t,i.next=null;var s=function(){Ax(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(){Ax(i),clearTimeout(i.next),qpe(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 Bpe(t,i)),i}function Ax(e,t){t===void 0&&(t=!1);var n=BA.get(e.object);UA(n.value,e.object,e.patches,"",t),e.patches.length&&mm(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function UA(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=vx(t),s=vx(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(xx(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)?UA(c,f,n,i+"/"+Is(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Is(l),value:Kn(c)}),n.push({op:"replace",path:i+"/"+Is(l),value:Kn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Is(l),value:Kn(c)}),n.push({op:"remove",path:i+"/"+Is(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];!xx(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+Is(l),value:Kn(t[l])})}}}function Hpe(e,t,n){n===void 0&&(n=!1);var i=[];return UA(e,t,i,"",n),i}var Vpe=Object.freeze({__proto__:null,compare:Hpe,generate:Ax,observe:Gpe,unobserve:Wpe});Object.assign({},Ipe,Vpe,{JsonPatchError:d8,deepClone:Kn,escapePathComponent:Is,unescapePathComponent:f8});function Ype(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X1,lk;function Xpe(){if(lk)return X1;lk=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 X1=e,X1}var K1,ck;function jA(){if(ck)return K1;ck=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return K1=i=>i?typeof i!="object"?e:i:t,K1}var Kd={exports:{}},J1,fk;function qA(){if(fk)return J1;fk=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return J1={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},J1}var Q1,dk;function ym(){return dk||(dk=1,Q1=typeof process=="object"&&Y1&&Y1.NODE_DEBUG&&/\bsemver\b/i.test(Y1.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Q1}var hk;function WA(){return hk||(hk=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=qA(),o=ym();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=p=>{for(const[m,y]of d)p=p.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return p},g=(p,m,y)=>{const b=h(m),x=c++;o(p,x,m),l[p]=x,u[x]=m,s[x]=new RegExp(m,y?"g":void 0),a[x]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Kd,Kd.exports)),Kd.exports}var Z1,gk;function Kpe(){if(gk)return Z1;gk=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 Z1={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},Z1}var ey,pk;function GA(){if(pk)return ey;pk=1;const e=ym(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=qA(),{safeRe:i,t:r}=WA(),o=jA(),{compareIdentifiers:s}=Kpe();class a{constructor(l,c){if(c=o(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),s(this.major,l.major)||s(this.minor,l.minor)||s(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}inc(l,c,f){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"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 d=Number(f)?1:0;if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ey=a,ey}var ty,mk;function _l(){if(mk)return ty;mk=1;const e=GA();return ty=(n,i,r)=>new e(n,r).compare(new e(i,r)),ty}var ny,yk;function Jpe(){if(yk)return ny;yk=1;const e=_l();return ny=(n,i,r)=>e(n,i,r)===0,ny}var iy,bk;function Qpe(){if(bk)return iy;bk=1;const e=_l();return iy=(n,i,r)=>e(n,i,r)!==0,iy}var ry,xk;function Zpe(){if(xk)return ry;xk=1;const e=_l();return ry=(n,i,r)=>e(n,i,r)>0,ry}var oy,vk;function e0e(){if(vk)return oy;vk=1;const e=_l();return oy=(n,i,r)=>e(n,i,r)>=0,oy}var sy,Ek;function t0e(){if(Ek)return sy;Ek=1;const e=_l();return sy=(n,i,r)=>e(n,i,r)<0,sy}var ay,wk;function n0e(){if(wk)return ay;wk=1;const e=_l();return ay=(n,i,r)=>e(n,i,r)<=0,ay}var uy,Ak;function i0e(){if(Ak)return uy;Ak=1;const e=Jpe(),t=Qpe(),n=Zpe(),i=e0e(),r=t0e(),o=n0e();return uy=(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}`)}},uy}var ly,Sk;function r0e(){if(Sk)return ly;Sk=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(">")))}}ly=t;const n=jA(),{safeRe:i,t:r}=WA(),o=i0e(),s=ym(),a=GA(),u=g8();return ly}var cy,Ck;function g8(){if(Ck)return cy;Ck=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(z=>!p(z[0])),this.set.length===0)this.set=[P];else if(this.set.length>1){for(const z of this.set)if(z.length===1&&m(z[0])){this.set=[z];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&&g))+":"+$,z=i.get(P);if(z)return z;const I=this.options.loose,V=I?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];$=$.replace(V,O(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 ue=$.split(" ").map(ge=>b(ge,this.options)).join(" ").split(/\s+/).map(ge=>F(ge,this.options));I&&(ue=ue.filter(ge=>(s("loose invalid filter",ge,this.options),!!ge.match(u[l.COMPARATORLOOSE])))),s("range list",ue);const ie=new Map,he=ue.map(ge=>new o(ge,this.options));for(const ge of he){if(p(ge))return[ge];ie.set(ge.value,ge)}ie.size>1&&ie.has("")&&ie.delete("");const We=[...ie.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(z=>y(z,D)&&P.every(I=>z.every(V=>I.intersects(V,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}}cy=t;const n=Xpe(),i=new n,r=jA(),o=r0e(),s=ym(),a=GA(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=WA(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=qA(),p=k=>k.value==="<0.0.0-0",m=k=>k.value==="",y=(k,$)=>{let D=!0;const P=k.slice();let z=P.pop();for(;D&&P.length;)D=P.every(I=>z.intersects(I,$)),z=P.pop();return D},b=(k,$)=>(s("comp",k,$),k=A(k,$),s("caret",k),k=v(k,$),s("tildes",k),k=S(k,$),s("xrange",k),k=_(k,$),s("stars",k),k),x=k=>!k||k.toLowerCase()==="x"||k==="*",v=(k,$)=>k.trim().split(/\s+/).map(D=>w(D,$)).join(" "),w=(k,$)=>{const D=$.loose?u[l.TILDELOOSE]:u[l.TILDE];return k.replace(D,(P,z,I,V,ue)=>{s("tilde",k,P,z,I,V,ue);let ie;return x(z)?ie="":x(I)?ie=`>=${z}.0.0 <${+z+1}.0.0-0`:x(V)?ie=`>=${z}.${I}.0 <${z}.${+I+1}.0-0`:ue?(s("replaceTilde pr",ue),ie=`>=${z}.${I}.${V}-${ue} <${z}.${+I+1}.0-0`):ie=`>=${z}.${I}.${V} <${z}.${+I+1}.0-0`,s("tilde return",ie),ie})},A=(k,$)=>k.trim().split(/\s+/).map(D=>E(D,$)).join(" "),E=(k,$)=>{s("caret",k,$);const D=$.loose?u[l.CARETLOOSE]:u[l.CARET],P=$.includePrerelease?"-0":"";return k.replace(D,(z,I,V,ue,ie)=>{s("caret",k,z,I,V,ue,ie);let he;return x(I)?he="":x(V)?he=`>=${I}.0.0${P} <${+I+1}.0.0-0`:x(ue)?I==="0"?he=`>=${I}.${V}.0${P} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.0${P} <${+I+1}.0.0-0`:ie?(s("replaceCaret pr",ie),I==="0"?V==="0"?he=`>=${I}.${V}.${ue}-${ie} <${I}.${V}.${+ue+1}-0`:he=`>=${I}.${V}.${ue}-${ie} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.${ue}-${ie} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?V==="0"?he=`>=${I}.${V}.${ue}${P} <${I}.${V}.${+ue+1}-0`:he=`>=${I}.${V}.${ue}${P} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.${ue} <${+I+1}.0.0-0`),s("caret return",he),he})},S=(k,$)=>(s("replaceXRanges",k,$),k.split(/\s+/).map(D=>C(D,$)).join(" ")),C=(k,$)=>{k=k.trim();const D=$.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return k.replace(D,(P,z,I,V,ue,ie)=>{s("xRange",k,P,z,I,V,ue,ie);const he=x(I),We=he||x(V),ge=We||x(ue),Ht=ge;return z==="="&&Ht&&(z=""),ie=$.includePrerelease?"-0":"",he?z===">"||z==="<"?P="<0.0.0-0":P="*":z&&Ht?(We&&(V=0),ue=0,z===">"?(z=">=",We?(I=+I+1,V=0,ue=0):(V=+V+1,ue=0)):z==="<="&&(z="<",We?I=+I+1:V=+V+1),z==="<"&&(ie="-0"),P=`${z+I}.${V}.${ue}${ie}`):We?P=`>=${I}.0.0${ie} <${+I+1}.0.0-0`:ge&&(P=`>=${I}.${V}.0${ie} <${I}.${+V+1}.0-0`),s("xRange return",P),P})},_=(k,$)=>(s("replaceStars",k,$),k.trim().replace(u[l.STAR],"")),F=(k,$)=>(s("replaceGTE0",k,$),k.trim().replace(u[$.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=k=>($,D,P,z,I,V,ue,ie,he,We,ge,Ht)=>(x(P)?D="":x(z)?D=`>=${P}.0.0${k?"-0":""}`:x(I)?D=`>=${P}.${z}.0${k?"-0":""}`:V?D=`>=${D}`:D=`>=${D}${k?"-0":""}`,x(he)?ie="":x(We)?ie=`<${+he+1}.0.0-0`:x(ge)?ie=`<${he}.${+We+1}.0-0`:Ht?ie=`<=${he}.${We}.${ge}-${Ht}`:k?ie=`<${he}.${We}.${+ge+1}-0`:ie=`<=${ie}`,`${D} ${ie}`.trim()),T=(k,$,D)=>{for(let P=0;P<k.length;P++)if(!k[P].test($))return!1;if($.prerelease.length&&!D.includePrerelease){for(let P=0;P<k.length;P++)if(s(k[P].semver),k[P].semver!==o.ANY&&k[P].semver.prerelease.length>0){const z=k[P].semver;if(z.major===$.major&&z.minor===$.minor&&z.patch===$.patch)return!0}return!1}return!0};return cy}var fy,$k;function o0e(){if($k)return fy;$k=1;const e=g8();return fy=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},fy}var s0e=o0e(),p8=Ype(s0e);function a0e(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 u0e=`.vega-embed {
80
+ */var BA=new WeakMap,Bpe=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Upe=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function jpe(e){return BA.get(e)}function qpe(e,t){return e.observers.get(t)}function Wpe(e,t){e.observers.delete(t.callback)}function Gpe(e,t){t.unobserve()}function Hpe(e,t){var n=[],i,r=jpe(e);if(!r)r=new Bpe(e),BA.set(e,r);else{var o=qpe(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Kn(e),t){i.callback=t,i.next=null;var s=function(){Ax(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(){Ax(i),clearTimeout(i.next),Wpe(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 Upe(t,i)),i}function Ax(e,t){t===void 0&&(t=!1);var n=BA.get(e.object);UA(n.value,e.object,e.patches,"",t),e.patches.length&&mm(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function UA(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=vx(t),s=vx(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(xx(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)?UA(c,f,n,i+"/"+Is(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Is(l),value:Kn(c)}),n.push({op:"replace",path:i+"/"+Is(l),value:Kn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Is(l),value:Kn(c)}),n.push({op:"remove",path:i+"/"+Is(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];!xx(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+Is(l),value:Kn(t[l])})}}}function Vpe(e,t,n){n===void 0&&(n=!1);var i=[];return UA(e,t,i,"",n),i}var Ype=Object.freeze({__proto__:null,compare:Vpe,generate:Ax,observe:Hpe,unobserve:Gpe});Object.assign({},zpe,Ype,{JsonPatchError:c8,deepClone:Kn,escapePathComponent:Is,unescapePathComponent:l8});function Xpe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X1,lk;function Kpe(){if(lk)return X1;lk=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 X1=e,X1}var K1,ck;function jA(){if(ck)return K1;ck=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return K1=i=>i?typeof i!="object"?e:i:t,K1}var Kd={exports:{}},J1,fk;function qA(){if(fk)return J1;fk=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return J1={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},J1}var Q1,dk;function ym(){return dk||(dk=1,Q1=typeof process=="object"&&Y1&&Y1.NODE_DEBUG&&/\bsemver\b/i.test(Y1.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Q1}var hk;function WA(){return hk||(hk=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=qA(),o=ym();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=p=>{for(const[m,y]of d)p=p.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return p},g=(p,m,y)=>{const b=h(m),x=c++;o(p,x,m),l[p]=x,u[x]=m,s[x]=new RegExp(m,y?"g":void 0),a[x]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Kd,Kd.exports)),Kd.exports}var Z1,gk;function Jpe(){if(gk)return Z1;gk=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 Z1={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},Z1}var ey,pk;function GA(){if(pk)return ey;pk=1;const e=ym(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=qA(),{safeRe:i,t:r}=WA(),o=jA(),{compareIdentifiers:s}=Jpe();class a{constructor(l,c){if(c=o(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),s(this.major,l.major)||s(this.minor,l.minor)||s(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}inc(l,c,f){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"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 d=Number(f)?1:0;if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ey=a,ey}var ty,mk;function _l(){if(mk)return ty;mk=1;const e=GA();return ty=(n,i,r)=>new e(n,r).compare(new e(i,r)),ty}var ny,yk;function Qpe(){if(yk)return ny;yk=1;const e=_l();return ny=(n,i,r)=>e(n,i,r)===0,ny}var iy,bk;function Zpe(){if(bk)return iy;bk=1;const e=_l();return iy=(n,i,r)=>e(n,i,r)!==0,iy}var ry,xk;function e0e(){if(xk)return ry;xk=1;const e=_l();return ry=(n,i,r)=>e(n,i,r)>0,ry}var oy,vk;function t0e(){if(vk)return oy;vk=1;const e=_l();return oy=(n,i,r)=>e(n,i,r)>=0,oy}var sy,Ek;function n0e(){if(Ek)return sy;Ek=1;const e=_l();return sy=(n,i,r)=>e(n,i,r)<0,sy}var ay,wk;function i0e(){if(wk)return ay;wk=1;const e=_l();return ay=(n,i,r)=>e(n,i,r)<=0,ay}var uy,Ak;function r0e(){if(Ak)return uy;Ak=1;const e=Qpe(),t=Zpe(),n=e0e(),i=t0e(),r=n0e(),o=i0e();return uy=(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}`)}},uy}var ly,Sk;function o0e(){if(Sk)return ly;Sk=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(">")))}}ly=t;const n=jA(),{safeRe:i,t:r}=WA(),o=r0e(),s=ym(),a=GA(),u=d8();return ly}var cy,Ck;function d8(){if(Ck)return cy;Ck=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(z=>!p(z[0])),this.set.length===0)this.set=[P];else if(this.set.length>1){for(const z of this.set)if(z.length===1&&m(z[0])){this.set=[z];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&&g))+":"+$,z=i.get(P);if(z)return z;const I=this.options.loose,V=I?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];$=$.replace(V,O(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 ue=$.split(" ").map(ge=>b(ge,this.options)).join(" ").split(/\s+/).map(ge=>F(ge,this.options));I&&(ue=ue.filter(ge=>(s("loose invalid filter",ge,this.options),!!ge.match(u[l.COMPARATORLOOSE])))),s("range list",ue);const ie=new Map,he=ue.map(ge=>new o(ge,this.options));for(const ge of he){if(p(ge))return[ge];ie.set(ge.value,ge)}ie.size>1&&ie.has("")&&ie.delete("");const We=[...ie.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(z=>y(z,D)&&P.every(I=>z.every(V=>I.intersects(V,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}}cy=t;const n=Kpe(),i=new n,r=jA(),o=o0e(),s=ym(),a=GA(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=WA(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=qA(),p=k=>k.value==="<0.0.0-0",m=k=>k.value==="",y=(k,$)=>{let D=!0;const P=k.slice();let z=P.pop();for(;D&&P.length;)D=P.every(I=>z.intersects(I,$)),z=P.pop();return D},b=(k,$)=>(s("comp",k,$),k=A(k,$),s("caret",k),k=v(k,$),s("tildes",k),k=S(k,$),s("xrange",k),k=_(k,$),s("stars",k),k),x=k=>!k||k.toLowerCase()==="x"||k==="*",v=(k,$)=>k.trim().split(/\s+/).map(D=>w(D,$)).join(" "),w=(k,$)=>{const D=$.loose?u[l.TILDELOOSE]:u[l.TILDE];return k.replace(D,(P,z,I,V,ue)=>{s("tilde",k,P,z,I,V,ue);let ie;return x(z)?ie="":x(I)?ie=`>=${z}.0.0 <${+z+1}.0.0-0`:x(V)?ie=`>=${z}.${I}.0 <${z}.${+I+1}.0-0`:ue?(s("replaceTilde pr",ue),ie=`>=${z}.${I}.${V}-${ue} <${z}.${+I+1}.0-0`):ie=`>=${z}.${I}.${V} <${z}.${+I+1}.0-0`,s("tilde return",ie),ie})},A=(k,$)=>k.trim().split(/\s+/).map(D=>E(D,$)).join(" "),E=(k,$)=>{s("caret",k,$);const D=$.loose?u[l.CARETLOOSE]:u[l.CARET],P=$.includePrerelease?"-0":"";return k.replace(D,(z,I,V,ue,ie)=>{s("caret",k,z,I,V,ue,ie);let he;return x(I)?he="":x(V)?he=`>=${I}.0.0${P} <${+I+1}.0.0-0`:x(ue)?I==="0"?he=`>=${I}.${V}.0${P} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.0${P} <${+I+1}.0.0-0`:ie?(s("replaceCaret pr",ie),I==="0"?V==="0"?he=`>=${I}.${V}.${ue}-${ie} <${I}.${V}.${+ue+1}-0`:he=`>=${I}.${V}.${ue}-${ie} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.${ue}-${ie} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?V==="0"?he=`>=${I}.${V}.${ue}${P} <${I}.${V}.${+ue+1}-0`:he=`>=${I}.${V}.${ue}${P} <${I}.${+V+1}.0-0`:he=`>=${I}.${V}.${ue} <${+I+1}.0.0-0`),s("caret return",he),he})},S=(k,$)=>(s("replaceXRanges",k,$),k.split(/\s+/).map(D=>C(D,$)).join(" ")),C=(k,$)=>{k=k.trim();const D=$.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return k.replace(D,(P,z,I,V,ue,ie)=>{s("xRange",k,P,z,I,V,ue,ie);const he=x(I),We=he||x(V),ge=We||x(ue),Ht=ge;return z==="="&&Ht&&(z=""),ie=$.includePrerelease?"-0":"",he?z===">"||z==="<"?P="<0.0.0-0":P="*":z&&Ht?(We&&(V=0),ue=0,z===">"?(z=">=",We?(I=+I+1,V=0,ue=0):(V=+V+1,ue=0)):z==="<="&&(z="<",We?I=+I+1:V=+V+1),z==="<"&&(ie="-0"),P=`${z+I}.${V}.${ue}${ie}`):We?P=`>=${I}.0.0${ie} <${+I+1}.0.0-0`:ge&&(P=`>=${I}.${V}.0${ie} <${I}.${+V+1}.0-0`),s("xRange return",P),P})},_=(k,$)=>(s("replaceStars",k,$),k.trim().replace(u[l.STAR],"")),F=(k,$)=>(s("replaceGTE0",k,$),k.trim().replace(u[$.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=k=>($,D,P,z,I,V,ue,ie,he,We,ge,Ht)=>(x(P)?D="":x(z)?D=`>=${P}.0.0${k?"-0":""}`:x(I)?D=`>=${P}.${z}.0${k?"-0":""}`:V?D=`>=${D}`:D=`>=${D}${k?"-0":""}`,x(he)?ie="":x(We)?ie=`<${+he+1}.0.0-0`:x(ge)?ie=`<${he}.${+We+1}.0-0`:Ht?ie=`<=${he}.${We}.${ge}-${Ht}`:k?ie=`<${he}.${We}.${+ge+1}-0`:ie=`<=${ie}`,`${D} ${ie}`.trim()),T=(k,$,D)=>{for(let P=0;P<k.length;P++)if(!k[P].test($))return!1;if($.prerelease.length&&!D.includePrerelease){for(let P=0;P<k.length;P++)if(s(k[P].semver),k[P].semver!==o.ANY&&k[P].semver.prerelease.length>0){const z=k[P].semver;if(z.major===$.major&&z.minor===$.minor&&z.patch===$.patch)return!0}return!1}return!0};return cy}var fy,$k;function s0e(){if($k)return fy;$k=1;const e=d8();return fy=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},fy}var a0e=s0e(),h8=Xpe(a0e);function u0e(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 l0e=`.vega-embed {
81
81
  position: relative;
82
82
  display: inline-block;
83
83
  box-sizing: border-box;
@@ -195,9 +195,9 @@ ${a}`)}return l}(e,"",0)}function bre(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e
195
195
  transform: scale(1);
196
196
  }
197
197
  }
198
- `;function m8(e,...t){for(const n of t)l0e(e,n);return e}function l0e(e,t){for(const n of Object.keys(t))sp(e,n,t[n],!0)}const ir=mre;let mf=Dge;const Jd=typeof window<"u"?window:void 0;var Tk;mf===void 0&&((Tk=Jd==null?void 0:Jd.vl)!=null&&Tk.compile)&&(mf=Jd.vl);const c0e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},f0e={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"},wc={vega:"Vega","vega-lite":"Vega-Lite"},Qg={vega:ir.version,"vega-lite":mf?mf.version:"not available"},d0e={vega:e=>e,"vega-lite":(e,t)=>mf.compile(e,{config:t}).spec},h0e=`
198
+ `;function g8(e,...t){for(const n of t)c0e(e,n);return e}function c0e(e,t){for(const n of Object.keys(t))sp(e,n,t[n],!0)}const ir=yre;let mf=Tge;const Jd=typeof window<"u"?window:void 0;var Tk;mf===void 0&&((Tk=Jd==null?void 0:Jd.vl)!=null&&Tk.compile)&&(mf=Jd.vl);const f0e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},d0e={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"},wc={vega:"Vega","vega-lite":"Vega-Lite"},Qg={vega:ir.version,"vega-lite":mf?mf.version:"not available"},h0e={vega:e=>e,"vega-lite":(e,t)=>mf.compile(e,{config:t}).spec},g0e=`
199
199
  <svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
200
200
  <circle r="2" cy="8" cx="2"></circle>
201
201
  <circle r="2" cy="8" cx="8"></circle>
202
202
  <circle r="2" cy="8" cx="14"></circle>
203
- </svg>`,g0e="chart-wrapper";function p0e(e){return typeof e=="function"}function _k(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=`${wc[i]} JSON Source`}function m0e(e,t){if(e.$schema){const n=r8(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${wc[n.library]}, but mode argument sets ${wc[t]??t}.`);const i=n.library;return p8(Qg[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${wc[i]} ${n.version}, but the current version of ${wc[i]} is v${Qg[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 y8(e){return!!(e&&"load"in e)}function Fk(e){return y8(e)?e:ir.loader(e)}function y0e(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return to(t.defaultStyle)&&(t.defaultStyle=!1),t}async function b0e(e,t,n={}){let i,r;to(t)?(r=Fk(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=y0e(i),s=o.loader;(!r||s)&&(r=Fk(n.loader??s));const a=await kk(o,r),u=await kk(n,r),l={...m8(u,a),config:Nx(u.config??{},a.config??{})};return await v0e(e,i,l,r)}async function kk(e,t){const n=to(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=to(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function x0e(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 v0e(e,t,n={},i){const r=n.theme?Nx(ppe[n.theme],n.config??{}):n.config,o=Xk(n.actions)?n.actions:m8({},c0e,n.actions??{}),s={...f0e,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??ir.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 w="vega-embed-style",{root:A,rootContainer:E}=x0e(c);if(!A.getElementById(w)){const S=document.createElement("style");S.id=w,S.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?u0e.toString():n.defaultStyle,E.appendChild(S)}}const f=m0e(t,n.mode);let d=d0e[f](t,r);if(f==="vega-lite"&&d.$schema){const w=r8(d.$schema);p8(Qg.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${Qg.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const w=document.createElement("div");w.classList.add(g0e),c.appendChild(w),h=w}const g=n.patch;if(g&&(d=g instanceof Function?g(d):mm(d,g,!0,!1).newDocument),n.formatLocale&&ir.formatLocale(n.formatLocale),n.timeFormatLocale&&ir.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const A=n.expressionFunctions[w];"fn"in A?ir.expressionFunction(w,A.fn,A.visitor):A instanceof Function&&ir.expressionFunction(w,A)}const{ast:p}=n,m=ir.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||ir.View)(m,{loader:i,logLevel:u,renderer:a,...p?{expr:ir.expressionInterpreter??n.expr??_re}:{}});if(y.addSignalListener("autosize",(w,A)=>{const{type:E}=A;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:w,tooltip:A}=n,E=w&&!y8(w)?w==null?void 0:w.baseURL:void 0,S=p0e(A)?A:new Mpe({baseURL:E,...A===!0?{}:A}).call;y.tooltip(S)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:w,updateSet:A}=typeof b=="boolean"?{}:b;y.hover(w,A)}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 w=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),w=E;const S=document.createElement("summary");S.innerHTML=h0e,E.append(S),x=C=>{E.contains(C.target)||E.removeAttribute("open")},document.addEventListener("click",x)}const A=document.createElement("div");if(w.append(A),A.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 S=s[`${E.toUpperCase()}_ACTION`],C=document.createElement("a"),_=oa(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;C.text=S,C.href="#",C.target="_blank",C.download=`${l}.${E}`,C.addEventListener("mousedown",async function(F){F.preventDefault();const O=await y.toImageURL(E,_);this.href=O}),A.append(C)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function(S){_k(w1(t),n.sourceHeader??"",n.sourceFooter??"",f),S.preventDefault()}),A.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(S){_k(w1(d),n.sourceHeader??"",n.sourceFooter??"","vega"),S.preventDefault()}),A.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",S=document.createElement("a");S.text=s.EDITOR_ACTION,S.href="#",S.addEventListener("click",function(C){a0e(window,E,{config:r,mode:g?"vega":f,renderer:a,spec:w1(g?d:t)}),C.preventDefault()}),A.append(S)}}function v(){x&&document.removeEventListener("click",x),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:v,embedOptions:n}}function Fl(e,t,n){return e.fields=t||[],e.fname=n,e}function E0e(e){return e.length===1?w0e(e[0]):A0e(e)}const w0e=e=>function(t){return t[e]},A0e=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function dy(e){throw Error(e)}function S0e(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||dy("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&dy("Access path missing closing bracket: "+e),i&&dy("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function C0e(e,t,n){const i=S0e(e);return e=i.length===1?i[0]:e,Fl(E0e(i),[e],e)}C0e("id");Fl(e=>e,[],"identity");Fl(()=>0,[],"zero");Fl(()=>1,[],"one");Fl(()=>!0,[],"true");Fl(()=>!1,[],"false");const $0e=(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);function _0e(e){return typeof e=="string"}function F0e(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 k0e={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},D0e={"*":(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},T0e={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const M0e=Array.prototype.slice,Ns=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,M0e.call(t,1))},O0e=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;return _0e(e)?new Date(e):new Date(e,t,n,i,r,o,s)};var R0e={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:O0e,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 Ns("join",arguments)},indexof:function(){return Ns("indexOf",arguments)},lastindexof:function(){return Ns("lastIndexOf",arguments)},slice:function(){return Ns("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort($0e),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Ns("substring",arguments,String)},split:function(){return Ns("split",arguments,String)},replace:function(){return Ns("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 N0e=["view","item","group","xy","x","y"],Sx=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Sx.add(setImmediate);const L0e={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:k0e[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),Sx.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]||R0e[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>D0e[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>T0e[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);return e.memberDepth-=1,Sx.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Zl(e,t,n,i,r,o){const s=a=>L0e[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,N0e.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var P0e={operator(e,t){const n=t.ast,i=e.functions;return r=>Zl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Zl(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Zl(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 Zl(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=Zl(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&F0e(s,i,o),l}}};const I0e={DATAFRAME_INDEX:"(index)"};function z0e(e){return!e||e.dimensions.numDataRows===0?null:Zg(e)}function B0e(e){const t=Cx(e);if($x(t))return null;const n={};for(const[i,r]of Object.entries(t))n[i]=Zg(r);return n}function Cx(e){if((e==null?void 0:e.length)===0)return null;const t={};return e.forEach(n=>{if(!n)return;const i=n.hasName?n.name:null;t[i]=n.data}),t}function Zg(e,t=0){if(e.dimensions.numDataRows===0)return[];const n=[],{numDataRows:i,numDataColumns:r,numIndexColumns:o}=e.dimensions,s=e.columnTypes[0]??void 0,a=s&&s.type===C8.INDEX&&($8(s)||VA(s)||YA(s));for(let u=t;u<i;u++){const l={};if(a){const{content:c}=e.getCell(u,0);l[I0e.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<r;c++){const f=c+o,{content:d,contentType:h}=e.getCell(u,f);if((d instanceof Date||typeof d=="number"&&Number.isFinite(d))&&(VA(h)||YA(h))&&!_8(h)){const g=new Date(d).getTimezoneOffset()*60*1e3;l[e.columnNames[0][f]]=d.valueOf()+g}else l[e.columnNames[0][f]]=typeof d=="bigint"?Number(d):d}n.push(l)}return n}const U0e=150,j0e=Ok.getLogger("useVegaLiteSelections"),q0e=(e,t,n)=>{const{id:i,formId:r,selectionMode:o}=e,s=St.useCallback(u=>{o.forEach(c=>{u.addSignalListener(c,F8(U0e,(f,d)=>{const h=u.getState({data:(b,x)=>o.some(v=>`${v}_store`===b),recurse:!1});XA(h)&&t.setElementState(i,"viewState",h);let g=d;"vlPoint"in d&&"or"in d.vlPoint&&(g=d.vlPoint.or);const p={id:i,formId:r},m=JSON.parse(t.getStringValue(p)||"{}"),y={selection:{...(m==null?void 0:m.selection)||{},[f]:g||{}}};KA(m,y)||t.setStringValue(p,JSON.stringify(y),{fromUi:!0},n)}))});const l=t.getElementState(i,"viewState");if(XA(l))try{return u.setState(l)}catch(c){j0e.warn("Failed to restore view state",c)}return u},[i,o,t,r,n]),a=St.useCallback(()=>{const u={selection:{}};o.forEach(d=>{u.selection[d]={}});const l={id:i,formId:r},c=t.getStringValue(l),f=c?JSON.parse(c):u;KA(f,u)||t.setStringValue(l,JSON.stringify(u),{fromUi:!0},n)},[i,r,n,o,t]);return{maybeConfigureSelections:s,onFormCleared:a}},Dk="source",W0e=Ok.getLogger("useVegaEmbed");function G0e(e,t,n){const i=St.useRef(null),r=St.useRef(null),o=St.useRef(Dk),s=St.useRef(null),a=St.useRef([]),{maybeConfigureSelections:u,onFormCleared:l}=q0e(e,t,n);f9({widgetMgr:t,element:e,onFormCleared:l});const{data:c,datasets:f}=e;St.useEffect(()=>{i.current===null&&(s.current=c,a.current=f)},[c,f]);const d=St.useCallback(()=>{r.current&&r.current(),r.current=null,i.current=null},[]),h=St.useCallback(async(m,y)=>{if(m.current===null)throw new Error("Element missing.");d();const b={ast:!0,expr:P0e,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:x,view:v,finalize:w}=await b0e(m.current,y,b);i.current=u(v),r.current=w;const A=B0e(a.current),E=A?Object.keys(A):[];if(E.length===1){const[C]=E;o.current=C}else E.length===0&&x.data&&(o.current=Dk);const S=z0e(s.current);if(S&&i.current.insert(o.current,S),A)for(const[C,_]of Object.entries(A))i.current.insert(C,_);return await i.current.runAsync(),await i.current.resize().runAsync(),i.current},[d,u]),g=St.useCallback((m,y,b,x)=>{if(!x||x.dimensions.numDataRows===0){try{m.remove(y,zk)}finally{}return}if(!b||b.dimensions.numDataRows===0){m.insert(y,Zg(x));return}x.hash!==b.hash&&(m.data(y,Zg(x)),W0e.info(`Had to clear the ${y} dataset before inserting data through Vega view.`))},[]),p=St.useCallback(async(m,y)=>{var A;if(i.current===null)return null;const b=s.current,x=a.current;(b||m)&&g(i.current,o.current,b,m);const v=Cx(x)??{},w=Cx(y)??{};for(const[E,S]of Object.entries(w)){const C=E||o.current,_=v[C];g(i.current,C,_,S)}for(const E of Object.keys(v))!Object.hasOwn(w,E)&&E!==o.current&&g(i.current,E,null,null);return await((A=i.current)==null?void 0:A.resize().runAsync()),s.current=m,a.current=y,i.current},[g]);return{createView:h,updateView:p,finalizeView:d}}const H0e=({disableFullscreenMode:e,element:t,fragmentId:n,widgetMgr:i})=>{const{expanded:r,width:o,height:s,expand:a,collapse:u}=Mk(Rk),l=St.useRef(null),c=b9(t),{createView:f,updateView:d,finalizeView:h}=G0e(c,i,n),{data:g,datasets:p,spec:m}=c;return St.useLayoutEffect(()=>(l.current!==null&&f(l,m),h),[f,h,m,o,s]),St.useEffect(()=>{d(g,p)},[g,p,d]),k8(JA,{width:o,height:s,useContainerWidth:c.useContainerWidth,children:[bm(T8,{target:JA,isFullScreen:r,onExpand:a,onCollapse:u,disableFullscreenMode:e}),bm(D8,{styles:[d9]}),bm(h9,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:c.useContainerWidth,isFullScreen:r,ref:l})]})},V0e=M8(H0e),zme=St.memo(V0e);export{zme as default};
203
+ </svg>`,p0e="chart-wrapper";function m0e(e){return typeof e=="function"}function _k(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=`${wc[i]} JSON Source`}function y0e(e,t){if(e.$schema){const n=n8(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${wc[n.library]}, but mode argument sets ${wc[t]??t}.`);const i=n.library;return h8(Qg[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${wc[i]} ${n.version}, but the current version of ${wc[i]} is v${Qg[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 p8(e){return!!(e&&"load"in e)}function Fk(e){return p8(e)?e:ir.loader(e)}function b0e(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return to(t.defaultStyle)&&(t.defaultStyle=!1),t}async function x0e(e,t,n={}){let i,r;to(t)?(r=Fk(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=b0e(i),s=o.loader;(!r||s)&&(r=Fk(n.loader??s));const a=await kk(o,r),u=await kk(n,r),l={...g8(u,a),config:Nx(u.config??{},a.config??{})};return await E0e(e,i,l,r)}async function kk(e,t){const n=to(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=to(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function v0e(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 E0e(e,t,n={},i){const r=n.theme?Nx(mpe[n.theme],n.config??{}):n.config,o=Vk(n.actions)?n.actions:g8({},f0e,n.actions??{}),s={...d0e,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??ir.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 w="vega-embed-style",{root:A,rootContainer:E}=v0e(c);if(!A.getElementById(w)){const S=document.createElement("style");S.id=w,S.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?l0e.toString():n.defaultStyle,E.appendChild(S)}}const f=y0e(t,n.mode);let d=h0e[f](t,r);if(f==="vega-lite"&&d.$schema){const w=n8(d.$schema);h8(Qg.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${Qg.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const w=document.createElement("div");w.classList.add(p0e),c.appendChild(w),h=w}const g=n.patch;if(g&&(d=g instanceof Function?g(d):mm(d,g,!0,!1).newDocument),n.formatLocale&&ir.formatLocale(n.formatLocale),n.timeFormatLocale&&ir.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const A=n.expressionFunctions[w];"fn"in A?ir.expressionFunction(w,A.fn,A.visitor):A instanceof Function&&ir.expressionFunction(w,A)}const{ast:p}=n,m=ir.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||ir.View)(m,{loader:i,logLevel:u,renderer:a,...p?{expr:ir.expressionInterpreter??n.expr??Fre}:{}});if(y.addSignalListener("autosize",(w,A)=>{const{type:E}=A;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:w,tooltip:A}=n,E=w&&!p8(w)?w==null?void 0:w.baseURL:void 0,S=m0e(A)?A:new Ope({baseURL:E,...A===!0?{}:A}).call;y.tooltip(S)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:w,updateSet:A}=typeof b=="boolean"?{}:b;y.hover(w,A)}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 w=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const E=document.createElement("details");E.title=s.CLICK_TO_VIEW_ACTIONS,c.append(E),w=E;const S=document.createElement("summary");S.innerHTML=g0e,E.append(S),x=C=>{E.contains(C.target)||E.removeAttribute("open")},document.addEventListener("click",x)}const A=document.createElement("div");if(w.append(A),A.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 S=s[`${E.toUpperCase()}_ACTION`],C=document.createElement("a"),_=oa(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;C.text=S,C.href="#",C.target="_blank",C.download=`${l}.${E}`,C.addEventListener("mousedown",async function(F){F.preventDefault();const O=await y.toImageURL(E,_);this.href=O}),A.append(C)}}if(o===!0||o.source!==!1){const E=document.createElement("a");E.text=s.SOURCE_ACTION,E.href="#",E.addEventListener("click",function(S){_k(w1(t),n.sourceHeader??"",n.sourceFooter??"",f),S.preventDefault()}),A.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(S){_k(w1(d),n.sourceHeader??"",n.sourceFooter??"","vega"),S.preventDefault()}),A.append(E)}if(o===!0||o.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",S=document.createElement("a");S.text=s.EDITOR_ACTION,S.href="#",S.addEventListener("click",function(C){u0e(window,E,{config:r,mode:g?"vega":f,renderer:a,spec:w1(g?d:t)}),C.preventDefault()}),A.append(S)}}function v(){x&&document.removeEventListener("click",x),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:v,embedOptions:n}}function Fl(e,t,n){return e.fields=t||[],e.fname=n,e}function w0e(e){return e.length===1?A0e(e[0]):S0e(e)}const A0e=e=>function(t){return t[e]},S0e=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function dy(e){throw Error(e)}function C0e(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||dy("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&dy("Access path missing closing bracket: "+e),i&&dy("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function $0e(e,t,n){const i=C0e(e);return e=i.length===1?i[0]:e,Fl(w0e(i),[e],e)}$0e("id");Fl(e=>e,[],"identity");Fl(()=>0,[],"zero");Fl(()=>1,[],"one");Fl(()=>!0,[],"true");Fl(()=>!1,[],"false");const _0e=(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);function F0e(e){return typeof e=="string"}function k0e(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 D0e={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},T0e={"*":(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},M0e={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const O0e=Array.prototype.slice,Ns=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,O0e.call(t,1))},R0e=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;return F0e(e)?new Date(e):new Date(e,t,n,i,r,o,s)};var N0e={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:R0e,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 Ns("join",arguments)},indexof:function(){return Ns("indexOf",arguments)},lastindexof:function(){return Ns("lastIndexOf",arguments)},slice:function(){return Ns("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(_0e),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Ns("substring",arguments,String)},split:function(){return Ns("split",arguments,String)},replace:function(){return Ns("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 L0e=["view","item","group","xy","x","y"],Sx=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Sx.add(setImmediate);const P0e={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:D0e[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),Sx.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]||N0e[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>T0e[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>M0e[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);return e.memberDepth-=1,Sx.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Zl(e,t,n,i,r,o){const s=a=>P0e[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,L0e.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var I0e={operator(e,t){const n=t.ast,i=e.functions;return r=>Zl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>Zl(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Zl(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 Zl(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=Zl(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&k0e(s,i,o),l}}};const z0e={DATAFRAME_INDEX:"(index)"};function B0e(e){return!e||e.dimensions.numDataRows===0?null:Zg(e)}function U0e(e){const t=Cx(e);if($x(t))return null;const n={};for(const[i,r]of Object.entries(t))n[i]=Zg(r);return n}function Cx(e){if((e==null?void 0:e.length)===0)return null;const t={};return e.forEach(n=>{if(!n)return;const i=n.hasName?n.name:null;t[i]=n.data}),t}function Zg(e,t=0){if(e.dimensions.numDataRows===0)return[];const n=[],{numDataRows:i,numDataColumns:r,numIndexColumns:o}=e.dimensions,s=e.columnTypes[0]??void 0,a=s&&s.type===A8.INDEX&&(S8(s)||VA(s)||YA(s));for(let u=t;u<i;u++){const l={};if(a){const{content:c}=e.getCell(u,0);l[z0e.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<r;c++){const f=c+o,{content:d,contentType:h}=e.getCell(u,f);if((d instanceof Date||typeof d=="number"&&Number.isFinite(d))&&(VA(h)||YA(h))&&!C8(h)){const g=new Date(d).getTimezoneOffset()*60*1e3;l[e.columnNames[0][f]]=d.valueOf()+g}else l[e.columnNames[0][f]]=typeof d=="bigint"?Number(d):d}n.push(l)}return n}const j0e=150,q0e=Mk.getLogger("useVegaLiteSelections"),W0e=(e,t,n)=>{const{id:i,formId:r,selectionMode:o}=e,s=Rt.useCallback(u=>{o.forEach(c=>{u.addSignalListener(c,$8(j0e,(f,d)=>{const h=u.getState({data:(b,x)=>o.some(v=>`${v}_store`===b),recurse:!1});XA(h)&&t.setElementState(i,"viewState",h);let g=d;"vlPoint"in d&&"or"in d.vlPoint&&(g=d.vlPoint.or);const p={id:i,formId:r},m=JSON.parse(t.getStringValue(p)||"{}"),y={selection:{...(m==null?void 0:m.selection)||{},[f]:g||{}}};KA(m,y)||t.setStringValue(p,JSON.stringify(y),{fromUi:!0},n)}))});const l=t.getElementState(i,"viewState");if(XA(l))try{return u.setState(l)}catch(c){q0e.warn("Failed to restore view state",c)}return u},[i,o,t,r,n]),a=Rt.useCallback(()=>{const u={selection:{}};o.forEach(d=>{u.selection[d]={}});const l={id:i,formId:r},c=t.getStringValue(l),f=c?JSON.parse(c):u;KA(f,u)||t.setStringValue(l,JSON.stringify(u),{fromUi:!0},n)},[i,r,n,o,t]);return{maybeConfigureSelections:s,onFormCleared:a}},Dk="source",G0e=Mk.getLogger("useVegaEmbed");function H0e(e,t,n){const i=Rt.useRef(null),r=Rt.useRef(null),o=Rt.useRef(Dk),s=Rt.useRef(null),a=Rt.useRef([]),{maybeConfigureSelections:u,onFormCleared:l}=W0e(e,t,n);d9({widgetMgr:t,element:e,onFormCleared:l});const{data:c,datasets:f}=e;Rt.useEffect(()=>{i.current===null&&(s.current=c,a.current=f)},[c,f]);const d=Rt.useCallback(()=>{r.current&&r.current(),r.current=null,i.current=null},[]),h=Rt.useCallback(async(m,y)=>{if(m.current===null)throw new Error("Element missing.");d();const b={ast:!0,expr:I0e,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:x,view:v,finalize:w}=await x0e(m.current,y,b);i.current=u(v),r.current=w;const A=U0e(a.current),E=A?Object.keys(A):[];if(E.length===1){const[C]=E;o.current=C}else E.length===0&&x.data&&(o.current=Dk);const S=B0e(s.current);if(S&&i.current.insert(o.current,S),A)for(const[C,_]of Object.entries(A))i.current.insert(C,_);return await i.current.runAsync(),await i.current.resize().runAsync(),i.current},[d,u]),g=Rt.useCallback((m,y,b,x)=>{if(!x||x.dimensions.numDataRows===0){try{m.remove(y,Pk)}finally{}return}if(!b||b.dimensions.numDataRows===0){m.insert(y,Zg(x));return}x.hash!==b.hash&&(m.data(y,Zg(x)),G0e.info(`Had to clear the ${y} dataset before inserting data through Vega view.`))},[]),p=Rt.useCallback(async(m,y)=>{var A;if(i.current===null)return null;const b=s.current,x=a.current;(b||m)&&g(i.current,o.current,b,m);const v=Cx(x)??{},w=Cx(y)??{};for(const[E,S]of Object.entries(w)){const C=E||o.current,_=v[C];g(i.current,C,_,S)}for(const E of Object.keys(v))!Object.hasOwn(w,E)&&E!==o.current&&g(i.current,E,null,null);return await((A=i.current)==null?void 0:A.resize().runAsync()),s.current=m,a.current=y,i.current},[g]);return{createView:h,updateView:p,finalizeView:d}}const V0e=({disableFullscreenMode:e,element:t,fragmentId:n,widgetMgr:i})=>{const{expanded:r,height:o,expand:s,collapse:a}=_8(O8),[u,l]=F8(),c=x9(t,r,u,o??0),{createView:f,updateView:d,finalizeView:h}=H0e(c,i,n),{data:g,datasets:p,spec:m}=c;return Rt.useLayoutEffect(()=>(l.current!==null&&f(l,m),h),[f,h,m,u,o,l]),Rt.useEffect(()=>{d(g,p)},[g,p,d]),k8(JA,{width:u,height:o,useContainerWidth:c.useContainerWidth,children:[bm(T8,{target:JA,isFullScreen:r,onExpand:s,onCollapse:a,disableFullscreenMode:e}),bm(D8,{styles:[h9]}),bm(g9,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:c.useContainerWidth,isFullScreen:r,ref:l})]})},Y0e=M8(V0e),Bme=Rt.memo(Y0e);export{Bme as default};