@carbon/charts-react 1.23.13 → 1.23.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.cjs +2 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.js +2 -1
- package/package.json +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
`)}async function b2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await x2(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function _2(e,t={}){const{width:n,height:r}=gf(e,t),i=await $a(e,t,!0);return await b2(i,t),await Sf(i,t),m2(i,t),await BM(i,n,r)}async function Cf(e,t={}){const{width:n,height:r}=gf(e,t),i=await _2(e,t),s=await wa(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||NM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||PM(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function E2(e,t={}){return(await Cf(e,t)).toDataURL()}async function O2(e,t={}){return(await Cf(e,t)).toDataURL("image/jpeg",t.quality||1)}let wn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const S2="DONT_STYLE_ME_css_styles_verifier";let N=class Bu extends wn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],g=parseFloat(f);f&&g>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${de}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",S2),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${de}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),O2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),E2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Bu.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Bu.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=va(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},dc=class e0 extends wn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:e0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Af(e){const t=T2(kf(e),360);return Vn(t,[0,10])||Vn(t,[350,0])?{textAnchor:Ke.START,dominantBaseline:Qe.MIDDLE}:Vn(t,[10,80])?{textAnchor:Ke.START,dominantBaseline:Qe.HANGING}:Vn(t,[80,100])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.HANGING}:Vn(t,[100,170])?{textAnchor:Ke.END,dominantBaseline:Qe.HANGING}:Vn(t,[170,190])?{textAnchor:Ke.END,dominantBaseline:Qe.MIDDLE}:Vn(t,[190,260])?{textAnchor:Ke.END,dominantBaseline:Qe.BASELINE}:Vn(t,[260,280])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.BASELINE}:{textAnchor:Ke.START,dominantBaseline:Qe.BASELINE}}function T2(e,t){return(e%t+t)%t}function Vn(e,[t,n]){return e>=t&&e<=n}function kf(e){return e*(180/Math.PI)}function Ut(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function w2(e,t){return t*Math.sin(e-Math.PI/2)}function $2(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function M2(e){return function(t){return e==null?void 0:e[t]}}var C2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},A2=M2(C2),k2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,L2="\\u0300-\\u036f",D2="\\ufe20-\\ufe2f",R2="\\u20d0-\\u20ff",I2=L2+D2+R2,N2="["+I2+"]",P2=RegExp(N2,"g");function U2(e){return e=Mi(e),e&&e.replace(k2,A2).replace(P2,"")}var B2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function H2(e){return e.match(B2)||[]}var V2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function G2(e){return V2.test(e)}var Lf="\\ud800-\\udfff",z2="\\u0300-\\u036f",F2="\\ufe20-\\ufe2f",j2="\\u20d0-\\u20ff",W2=z2+F2+j2,Df="\\u2700-\\u27bf",Rf="a-z\\xdf-\\xf6\\xf8-\\xff",q2="\\xac\\xb1\\xd7\\xf7",Y2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",X2="\\u2000-\\u206f",Z2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",If="A-Z\\xc0-\\xd6\\xd8-\\xde",K2="\\ufe0e\\ufe0f",Nf=q2+Y2+X2+Z2,Pf="['’]",Uf="["+Nf+"]",Q2="["+W2+"]",Bf="\\d+",J2="["+Df+"]",Hf="["+Rf+"]",Vf="[^"+Lf+Nf+Bf+Df+Rf+If+"]",tC="\\ud83c[\\udffb-\\udfff]",eC="(?:"+Q2+"|"+tC+")",nC="[^"+Lf+"]",Gf="(?:\\ud83c[\\udde6-\\uddff]){2}",zf="[\\ud800-\\udbff][\\udc00-\\udfff]",Zr="["+If+"]",rC="\\u200d",Ff="(?:"+Hf+"|"+Vf+")",iC="(?:"+Zr+"|"+Vf+")",jf="(?:"+Pf+"(?:d|ll|m|re|s|t|ve))?",Wf="(?:"+Pf+"(?:D|LL|M|RE|S|T|VE))?",qf=eC+"?",Yf="["+K2+"]?",sC="(?:"+rC+"(?:"+[nC,Gf,zf].join("|")+")"+Yf+qf+")*",aC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lC=Yf+qf+sC,cC="(?:"+[J2,Gf,zf].join("|")+")"+lC,uC=RegExp([Zr+"?"+Hf+"+"+jf+"(?="+[Uf,Zr,"$"].join("|")+")",iC+"+"+Wf+"(?="+[Uf,Zr+Ff,"$"].join("|")+")",Zr+"?"+Ff+"+"+jf,Zr+"+"+Wf,oC,aC,Bf,cC].join("|"),"g");function hC(e){return e.match(uC)||[]}function dC(e,t,n){return e=Mi(e),t=t,t===void 0?G2(e)?hC(e):H2(e):e.match(t)||[]}var pC="['’]",fC=RegExp(pC,"g");function Xf(e){return function(t){return $2(dC(U2(t).replace(fC,"")),e,"")}}function mC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Zf(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Fr(n),n=n===n?n:0),t!==void 0&&(t=Fr(t),t=t===t?t:0),mC(Fr(e),t,n)}var gC="Expected a function";function vC(e,t,n){if(typeof e!="function")throw new TypeError(gC);return setTimeout(function(){e.apply(void 0,n)},t)}var yC=Xo(function(e,t,n){return vC(e,Fr(t)||0,n)});function xC(e,t){var n=-1,r=Qn(e)?Array(e.length):[];return Wl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function bC(e,t){var n=Zt(e)?zo:xC;return n(e,Fs(t))}var _C=1/0;function EC(e,t){return Hs(bC(e,t),_C)}function Kf(e,t){return zs(e,t)}var Kr=Xf(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function OC(e,t){var n;return Wl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function SC(e,t,n){var r=Zt(e)?Yh:OC;return r(e,Fs(t))}class fr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}function*TC(e){for(const t of e)yield*t}function Qf(e){return Array.from(TC(e))}function wC(e){return e}var Ca=1,Aa=2,pc=3,es=4,Jf=1e-6;function $C(e){return"translate("+e+",0)"}function MC(e){return"translate(0,"+e+")"}function CC(e){return t=>+e(t)}function AC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function kC(){return!this.__axis}function ka(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ca||e===es?-1:1,u=e===es||e===Aa?"x":"y",d=e===Ca||e===pc?$C:MC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):wC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?AC:CC)(t.copy(),l),b=p.selection?p.selection():p,S=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),D=M.exit(),A=M.enter().append("g").attr("class","tick"),R=M.select("line"),$=M.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),$=$.merge(A.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ca?"0em":e===pc?"0.71em":"0.32em")),p!==b&&(S=S.transition(p),M=M.transition(p),R=R.transition(p),$=$.transition(p),D=D.transition(p).attr("opacity",Jf).attr("transform",function(H){return isFinite(H=E(H))?d(H+l):this.getAttribute("transform")}),A.attr("opacity",Jf).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:E(H))+l)})),D.remove(),S.attr("d",e===es||e===Aa?a?"M"+c*a+","+x+"H"+l+"V"+_+"H"+c*a:"M"+l+","+x+"V"+_:a?"M"+x+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+x+","+l+"H"+_),M.attr("opacity",1).attr("transform",function(H){return d(E(H)+l)}),R.attr(u+"2",c*s),$.attr(u,c*m).text(g),b.filter(kC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Aa?"start":e===es?"end":"middle"),b.each(function(){this.__axis=E})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function LC(e){return ka(Ca,e)}function DC(e){return ka(Aa,e)}function fc(e){return ka(pc,e)}function tm(e){return ka(es,e)}const mc={capture:!0,passive:!1};function gc(e){e.preventDefault(),e.stopImmediatePropagation()}function RC(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",gc,mc);"onselectstart"in t?n.on("selectstart.drag",gc,mc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function IC(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",gc,mc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function NC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const PC=e=>+e,vc=e=>()=>e;function UC(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function BC(e){e.stopImmediatePropagation()}function yc(e){e.preventDefault(),e.stopImmediatePropagation()}var em={name:"drag"},xc={name:"space"},Qr={name:"handle"},Jr={name:"center"};const{abs:nm,max:ne,min:re}=Math;function rm(e){return[+e[0],+e[1]]}function im(e){return[rm(e[0]),rm(e[1])]}var La={name:"x",handles:["w","e"].map(_c),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},bc={},$n={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},sm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},am={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},HC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},VC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function _c(e){return{type:e}}function GC(e){return!e.ctrlKey&&!e.button}function zC(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function FC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ec(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function jC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function om(){return WC(La)}function WC(e){var t=zC,n=GC,r=FC,i=!0,s=vl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([_c("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",$n.overlay).merge(v).each(function(){var _=Ec(this).extent;I(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([_c("selection")]).enter().append("rect").attr("class","selection").attr("cursor",$n.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(e.handles,function(_){return _.type});x.exit().remove(),x.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return $n[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,x){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,E=_.__brush,b=u(_,arguments),S=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),D=Pi(S,M);function A(R){E.selection=R===1&&M===null?null:D(R),c.call(_),b.brush()}return S!==null&&M!==null?A:A(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,S=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();Ll(_),b.selection=S===null?null:S,c.call(_),M.start(x).brush(x).end(x)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=Ec(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(x){return x.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(x){return x.type==="e"||x.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,x){var _=m.__brush.emitter;return _&&(!x||!_.clean)?_:new d(m,v,x)}function d(m,v,x){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=x}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,x){var _=I(this.that).datum();s.call(m,this.that,new UC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:x,dispatch:s}),_)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,x=m.target.__data__.type,_=(i&&m.metaKey?x="overlay":x)==="selection"?em:i&&m.altKey?Jr:Qr,E=e===bc?null:HC[x],b=e===La?null:VC[x],S=Ec(v),M=S.extent,D=S.selection,A=M[0][0],R,$,H=M[0][1],P,B,O=M[1][0],w,k,L=M[1][1],U,K,W=0,j=0,X,ct=E&&b&&i&&m.shiftKey,J,Y,et=Array.from(m.touches||[m],rt=>{const Et=rt.identifier;return rt=nr(rt,v),rt.point0=rt.slice(),rt.identifier=Et,rt});Ll(v);var ut=u(v,arguments,!0).beforestart();if(x==="overlay"){D&&(X=!0);const rt=[et[0],et[1]||et[0]];S.selection=D=[[R=e===bc?A:re(rt[0][0],rt[1][0]),P=e===La?H:re(rt[0][1],rt[1][1])],[w=e===bc?O:ne(rt[0][0],rt[1][0]),U=e===La?L:ne(rt[0][1],rt[1][1])]],et.length>1&&dt(m)}else R=D[0][0],P=D[0][1],w=D[1][0],U=D[1][1];$=R,B=P,k=w,K=U;var F=I(v).attr("pointer-events","none"),q=F.selectAll(".overlay").attr("cursor",$n[x]);if(m.touches)ut.moved=G,ut.ended=ot;else{var Z=I(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",ot,!0);i&&Z.on("keydown.brush",It,!0).on("keyup.brush",Ht,!0),RC(m.view)}c.call(v),ut.start(m,_.name);function G(rt){for(const Et of rt.changedTouches||[rt])for(const Ne of et)Ne.identifier===Et.identifier&&(Ne.cur=nr(Et,v));if(ct&&!J&&!Y&&et.length===1){const Et=et[0];nm(Et.cur[0]-Et[0])>nm(Et.cur[1]-Et[1])?Y=!0:J=!0}for(const Et of et)Et.cur&&(Et[0]=Et.cur[0],Et[1]=Et.cur[1]);X=!0,yc(rt),dt(rt)}function dt(rt){const Et=et[0],Ne=Et.point0;var Te;switch(W=Et[0]-Ne[0],j=Et[1]-Ne[1],_){case xc:case em:{E&&(W=ne(A-R,re(O-w,W)),$=R+W,k=w+W),b&&(j=ne(H-P,re(L-U,j)),B=P+j,K=U+j);break}case Qr:{et[1]?(E&&($=ne(A,re(O,et[0][0])),k=ne(A,re(O,et[1][0])),E=1),b&&(B=ne(H,re(L,et[0][1])),K=ne(H,re(L,et[1][1])),b=1)):(E<0?(W=ne(A-R,re(O-R,W)),$=R+W,k=w):E>0&&(W=ne(A-w,re(O-w,W)),$=R,k=w+W),b<0?(j=ne(H-P,re(L-P,j)),B=P+j,K=U):b>0&&(j=ne(H-U,re(L-U,j)),B=P,K=U+j));break}case Jr:{E&&($=ne(A,re(O,R-W*E)),k=ne(A,re(O,w+W*E))),b&&(B=ne(H,re(L,P-j*b)),K=ne(H,re(L,U+j*b)));break}}k<$&&(E*=-1,Te=R,R=w,w=Te,Te=$,$=k,k=Te,x in sm&&q.attr("cursor",$n[x=sm[x]])),K<B&&(b*=-1,Te=P,P=U,U=Te,Te=B,B=K,K=Te,x in am&&q.attr("cursor",$n[x=am[x]])),S.selection&&(D=S.selection),J&&($=D[0][0],k=D[1][0]),Y&&(B=D[0][1],K=D[1][1]),(D[0][0]!==$||D[0][1]!==B||D[1][0]!==k||D[1][1]!==K)&&(S.selection=[[$,B],[k,K]],c.call(v),ut.brush(rt,_.name))}function ot(rt){if(BC(rt),rt.touches){if(rt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else IC(rt.view,X),Z.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);F.attr("pointer-events","all"),q.attr("cursor",$n.overlay),S.selection&&(D=S.selection),jC(D)&&(S.selection=null,c.call(v)),ut.end(rt,_.name)}function It(rt){switch(rt.keyCode){case 16:{ct=E&&b;break}case 18:{_===Qr&&(E&&(w=k-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=Jr,dt(rt));break}case 32:{(_===Qr||_===Jr)&&(E<0?w=k-W:E>0&&(R=$-W),b<0?U=K-j:b>0&&(P=B-j),_=xc,q.attr("cursor",$n.selection),dt(rt));break}default:return}yc(rt)}function Ht(rt){switch(rt.keyCode){case 16:{ct&&(J=Y=ct=!1,dt(rt));break}case 18:{_===Jr&&(E<0?w=k:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Qr,dt(rt));break}case 32:{_===xc&&(rt.altKey?(E&&(w=k-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=Jr):(E<0?w=k:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Qr),q.attr("cursor",$n[x]),dt(rt));break}default:return}yc(rt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=im(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:vc(im(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:vc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:vc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const Oc=Math.PI,Sc=2*Oc,mr=1e-6,qC=Sc-mr;function lm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YC(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lm;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Tc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lm:YC(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>mr)if(!(Math.abs(d*l-c*u)>mr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,g=l*l+c*c,m=p*p+f*f,v=Math.sqrt(g),x=Math.sqrt(h),_=s*Math.tan((Oc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>mr&&this._append`L${t+E*u},${n+E*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+b*l},${this._y1=n+b*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>mr||Math.abs(this._y1-u)>mr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Sc+Sc),h>qC?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>mr&&this._append`A${r},${r},0,${+(h>=Oc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function cm(){return new Tc}cm.prototype=Tc.prototype;var wt=1e-6,XC=1e-12,mt=Math.PI,fe=mt/2,um=mt/4,Ee=mt*2,ae=180/mt,Bt=mt/180,St=Math.abs,hm=Math.atan,gr=Math.atan2,$t=Math.cos,ZC=Math.exp,KC=Math.log,_t=Math.sin,Gn=Math.sign||function(e){return e>0?1:e<0?-1:0},We=Math.sqrt,QC=Math.tan;function JC(e){return e>1?0:e<-1?mt:Math.acos(e)}function Mn(e){return e>1?fe:e<-1?-fe:Math.asin(e)}function De(){}function Da(e,t){e&&pm.hasOwnProperty(e.type)&&pm[e.type](e,t)}var dm={Feature:function(e,t){Da(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Da(n[r].geometry,t)}},pm={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){wc(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)wc(n[r],t,0)},Polygon:function(e,t){fm(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)fm(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Da(n[r],t)}};function wc(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function fm(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)wc(e[n],t,1);t.polygonEnd()}function ti(e,t){e&&dm.hasOwnProperty(e.type)?dm[e.type](e,t):Da(e,t)}function $c(e){return[gr(e[1],e[0]),Mn(e[2])]}function ei(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*_t(t),_t(n)]}function Ra(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ia(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 Mc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Na(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Cc(e){var t=We(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ac(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function kc(e,t){return St(e)>mt&&(e-=Math.round(e/Ee)*Ee),[e,t]}kc.invert=kc;function mm(e,t,n){return(e%=Ee)?t||n?Ac(vm(e),ym(t,n)):vm(e):t||n?ym(t,n):kc}function gm(e){return function(t,n){return t+=e,St(t)>mt&&(t-=Math.round(t/Ee)*Ee),[t,n]}}function vm(e){var t=gm(e);return t.invert=gm(-e),t}function ym(e,t){var n=$t(e),r=_t(e),i=$t(t),s=_t(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*n+u*r;return[gr(d*i-p*s,u*n-h*r),Mn(p*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*i-d*s;return[gr(d*i+h*s,u*n+p*r),Mn(p*n-u*r)]},a}function tA(e){e=mm(e[0]*Bt,e[1]*Bt,e.length>2?e[2]*Bt:0);function t(n){return n=e(n[0]*Bt,n[1]*Bt),n[0]*=ae,n[1]*=ae,n}return t.invert=function(n){return n=e.invert(n[0]*Bt,n[1]*Bt),n[0]*=ae,n[1]*=ae,n},t}function eA(e,t,n,r,i,s){if(n){var a=$t(t),o=_t(t),l=r*n;i==null?(i=t+r*Ee,s=t-l/2):(i=xm(a,i),s=xm(a,s),(r>0?i<s:i>s)&&(i+=r*Ee));for(var c,u=i;r>0?u>s:u<s;u-=l)c=$c([a,-o*$t(u),-o*_t(u)]),e.point(c[0],c[1])}}function xm(e,t){t=ei(t),t[0]-=e,Cc(t);var n=JC(-t[1]);return((-t[2]<0?-n:n)+Ee-wt)%Ee}function bm(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:De,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Pa(e,t){return St(e[0]-t[0])<wt&&St(e[1]-t[1])<wt}function Ua(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function _m(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(f){if(!((g=f.length-1)<=0)){var g,m=f[0],v=f[g],x;if(Pa(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}v[0]+=2*wt}s.push(x=new Ua(m,f,null,!0)),a.push(x.o=new Ua(m,null,x,!1)),s.push(x=new Ua(v,f,null,!1)),a.push(x.o=new Ua(v,null,x,!0))}}),!!s.length){for(a.sort(t),Em(s),Em(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);i.lineEnd()}}}function Em(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Lc(e){return St(e[0])<=mt?e[0]:Gn(e[0])*((St(e[0])+mt)%Ee-mt)}function nA(e,t){var n=Lc(t),r=t[1],i=_t(r),s=[_t(n),-$t(n),0],a=0,o=0,l=new fr;i===1?r=fe+wt:i===-1&&(r=-fe-wt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=Lc(p),g=p[1]/2+um,m=_t(g),v=$t(g),x=0;x<h;++x,f=E,m=S,v=M,p=_){var _=d[x],E=Lc(_),b=_[1]/2+um,S=_t(b),M=$t(b),D=E-f,A=D>=0?1:-1,R=A*D,$=R>mt,H=m*S;if(l.add(gr(H*A*_t(R),v*M+H*$t(R))),a+=$?D+A*Ee:D,$^f>=n^E>=n){var P=Ia(ei(p),ei(_));Cc(P);var B=Ia(s,P);Cc(B);var O=($^D>=0?-1:1)*Mn(B[2]);(r>O||r===O&&(P[0]||P[1]))&&(o+=$^D>=0?1:-1)}}return(a<-1e-6||a<wt&&l<-1e-12)^o&1}function Om(e,t,n,r){return function(i){var s=t(i),a=bm(),o=t(a),l=!1,c,u,d,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=_,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,u=Qf(u);var E=nA(c,r);u.length?(l||(i.polygonStart(),l=!0),_m(u,iA,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(E,b){e(E,b)&&i.point(E,b)}function f(E,b){s.point(E,b)}function g(){h.point=f,s.lineStart()}function m(){h.point=p,s.lineEnd()}function v(E,b){d.push([E,b]),o.point(E,b)}function x(){o.lineStart(),d=[]}function _(){v(d[0][0],d[0][1]),o.lineEnd();var E=o.clean(),b=a.result(),S,M=b.length,D,A,R;if(d.pop(),c.push(d),d=null,!!M){if(E&1){if(A=b[0],(D=A.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<D;++S)i.point((R=A[S])[0],R[1]);i.lineEnd()}return}M>1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(rA))}}return h}}function rA(e){return e.length>1}function iA(e,t){return((e=e.x)[0]<0?e[1]-fe-wt:fe-e[1])-((t=t.x)[0]<0?t[1]-fe-wt:fe-t[1])}const Sm=Om(function(){return!0},sA,oA,[-mt,-fe]);function sA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?mt:-mt,l=St(s-t);St(l-mt)<wt?(e.point(t,n=(n+a)/2>0?fe:-fe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=mt&&(St(t-r)<wt&&(t-=r*wt),St(s-o)<wt&&(s-=o*wt),n=aA(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function aA(e,t,n,r){var i,s,a=_t(e-n);return St(a)>wt?hm((_t(t)*(s=$t(r))*_t(n)-_t(r)*(i=$t(t))*_t(e))/(i*s*a)):(t+r)/2}function oA(e,t,n,r){var i;if(e==null)i=n*fe,r.point(-mt,i),r.point(0,i),r.point(mt,i),r.point(mt,0),r.point(mt,-i),r.point(0,-i),r.point(-mt,-i),r.point(-mt,0),r.point(-mt,i);else if(St(e[0]-t[0])>wt){var s=e[0]<t[0]?mt:-mt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function lA(e){var t=$t(e),n=2*Bt,r=t>0,i=St(t)>wt;function s(u,d,h,p){eA(p,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var x=[m,v],_,E=a(m,v),b=r?E?0:c(m,v):E?c(m+(m<0?mt:-mt),v):0;if(!d&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(d,x),(!_||Pa(d,_)||Pa(x,_))&&(x[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(x,d),u.point(_[0],_[1])):(_=l(d,x),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var S;!(b&h)&&(S=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(S[0][0],S[0][1]),u.point(S[1][0],S[1][1]),u.lineEnd()):(u.point(S[1][0],S[1][1]),u.lineEnd(),u.lineStart(),u.point(S[0][0],S[0][1],3)))}E&&(!d||!Pa(d,x))&&u.point(x[0],x[1]),d=x,p=E,h=b},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=ei(u),f=ei(d),g=[1,0,0],m=Ia(p,f),v=Ra(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,S=Ia(g,m),M=Na(g,E),D=Na(m,b);Mc(M,D);var A=S,R=Ra(M,A),$=Ra(A,A),H=R*R-$*(Ra(M,M)-1);if(!(H<0)){var P=We(H),B=Na(A,(-R-P)/$);if(Mc(B,M),B=$c(B),!h)return B;var O=u[0],w=d[0],k=u[1],L=d[1],U;w<O&&(U=O,O=w,w=U);var K=w-O,W=St(K-mt)<wt,j=W||K<wt;if(!W&&L<k&&(U=k,k=L,L=U),j?W?k+L>0^B[1]<(St(B[0]-O)<wt?k:L):k<=B[1]&&B[1]<=L:K>mt^(O<=B[0]&&B[0]<=w)){var X=Na(A,(-R+P)/$);return Mc(X,M),[B,$c(X)]}}}function c(u,d){var h=r?e:mt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return Om(a,o,s,r?[0,-e]:[-mt,e-mt])}function cA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-o,f;if(f=n-a,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-a,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=a+u*h,e[1]=o+u*p),d<1&&(t[0]=a+d*h,t[1]=o+d*p),!0}}}}}var Ba=1e9,Ha=-1e9;function uA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var p=0,f=0;if(c==null||(p=a(c,d))!==(f=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==f);else h.point(u[0],u[1])}function a(c,u){return St(c[0]-e)<wt?u>0?0:3:St(c[0]-n)<wt?u>0?2:1:St(c[1]-t)<wt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=bm(),h,p,f,g,m,v,x,_,E,b,S,M={point:D,lineStart:H,lineEnd:P,polygonStart:R,polygonEnd:$};function D(O,w){i(O,w)&&u.point(O,w)}function A(){for(var O=0,w=0,k=p.length;w<k;++w)for(var L=p[w],U=1,K=L.length,W=L[0],j,X,ct=W[0],J=W[1];U<K;++U)j=ct,X=J,W=L[U],ct=W[0],J=W[1],X<=r?J>r&&(ct-j)*(r-X)>(J-X)*(e-j)&&++O:J<=r&&(ct-j)*(r-X)<(J-X)*(e-j)&&--O;return O}function R(){u=d,h=[],p=[],S=!0}function $(){var O=A(),w=S&&O,k=(h=Qf(h)).length;(w||k)&&(c.polygonStart(),w&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),k&&_m(h,o,O,s,c),c.polygonEnd()),u=c,h=p=f=null}function H(){M.point=B,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function P(){h&&(B(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=D,E&&u.lineEnd()}function B(O,w){var k=i(O,w);if(p&&f.push([O,w]),b)g=O,m=w,v=k,b=!1,k&&(u.lineStart(),u.point(O,w));else if(k&&E)u.point(O,w);else{var L=[x=Math.max(Ha,Math.min(Ba,x)),_=Math.max(Ha,Math.min(Ba,_))],U=[O=Math.max(Ha,Math.min(Ba,O)),w=Math.max(Ha,Math.min(Ba,w))];cA(L,U,e,t,n,r)?(E||(u.lineStart(),u.point(L[0],L[1])),u.point(U[0],U[1]),k||u.lineEnd(),S=!1):k&&(u.lineStart(),u.point(O,w),S=!1)}x=O,_=w,E=k}return M}}const Dc=e=>e;var Rc=new fr,Ic=new fr,Tm,wm,Nc,Pc,Cn={point:De,lineStart:De,lineEnd:De,polygonStart:function(){Cn.lineStart=hA,Cn.lineEnd=pA},polygonEnd:function(){Cn.lineStart=Cn.lineEnd=Cn.point=De,Rc.add(St(Ic)),Ic=new fr},result:function(){var e=Rc/2;return Rc=new fr,e}};function hA(){Cn.point=dA}function dA(e,t){Cn.point=$m,Tm=Nc=e,wm=Pc=t}function $m(e,t){Ic.add(Pc*e-Nc*t),Nc=e,Pc=t}function pA(){$m(Tm,wm)}var ni=1/0,Va=ni,ns=-ni,Ga=ns,za={point:fA,lineStart:De,lineEnd:De,polygonStart:De,polygonEnd:De,result:function(){var e=[[ni,Va],[ns,Ga]];return ns=Ga=-(Va=ni=1/0),e}};function fA(e,t){e<ni&&(ni=e),e>ns&&(ns=e),t<Va&&(Va=t),t>Ga&&(Ga=t)}var Uc=0,Bc=0,rs=0,Fa=0,ja=0,ri=0,Hc=0,Vc=0,is=0,Mm,Cm,an,on,Re={point:vr,lineStart:Am,lineEnd:km,polygonStart:function(){Re.lineStart=vA,Re.lineEnd=yA},polygonEnd:function(){Re.point=vr,Re.lineStart=Am,Re.lineEnd=km},result:function(){var e=is?[Hc/is,Vc/is]:ri?[Fa/ri,ja/ri]:rs?[Uc/rs,Bc/rs]:[NaN,NaN];return Uc=Bc=rs=Fa=ja=ri=Hc=Vc=is=0,e}};function vr(e,t){Uc+=e,Bc+=t,++rs}function Am(){Re.point=mA}function mA(e,t){Re.point=gA,vr(an=e,on=t)}function gA(e,t){var n=e-an,r=t-on,i=We(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ri+=i,vr(an=e,on=t)}function km(){Re.point=vr}function vA(){Re.point=xA}function yA(){Lm(Mm,Cm)}function xA(e,t){Re.point=Lm,vr(Mm=an=e,Cm=on=t)}function Lm(e,t){var n=e-an,r=t-on,i=We(n*n+r*r);Fa+=i*(an+e)/2,ja+=i*(on+t)/2,ri+=i,i=on*e-an*t,Hc+=i*(an+e),Vc+=i*(on+t),is+=i*3,vr(an=e,on=t)}function Dm(e){this._context=e}Dm.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,Ee);break}}},result:De};var Gc=new fr,zc,Rm,Im,ss,as,os={point:De,lineStart:function(){os.point=bA},lineEnd:function(){zc&&Nm(Rm,Im),os.point=De},polygonStart:function(){zc=!0},polygonEnd:function(){zc=null},result:function(){var e=+Gc;return Gc=new fr,e}};function bA(e,t){os.point=Nm,Rm=ss=e,Im=as=t}function Nm(e,t){ss-=e,as-=t,Gc.add(We(ss*ss+as*as)),ss=e,as=t}let Pm,Wa,Um,Bm;class Hm{constructor(t){this._append=t==null?Vm:_A(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!==Um||this._append!==Wa){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Um=r,Wa=this._append,Bm=this._,this._=i}this._+=Bm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Vm(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _A(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Vm;if(t!==Pm){const n=10**t;Pm=t,Wa=function(r){let i=1;this._+=r[0];for(const s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return Wa}function EA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),ti(o,i(s))),s.result()}return a.area=function(o){return ti(o,i(Cn)),Cn.result()},a.measure=function(o){return ti(o,i(os)),os.result()},a.bounds=function(o){return ti(o,i(za)),za.result()},a.centroid=function(o){return ti(o,i(Re)),Re.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Dc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Hm(n)):new Dm(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Hm(n)),a},a.projection(e).digits(n).context(t)}function Fc(e){return function(t){var n=new jc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function jc(){}jc.prototype={constructor:jc,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 Wc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ti(n,e.stream(za)),t(za.result()),r!=null&&e.clipExtent(r),e}function Gm(e,t,n){return Wc(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function OA(e,t,n){return Gm(e,[[0,0],t],n)}function SA(e,t,n){return Wc(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function TA(e,t,n){return Wc(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var zm=16,wA=$t(30*Bt);function Fm(e,t){return+t?MA(e,t):$A(e)}function $A(e){return Fc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function MA(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,g,m){var v=c-r,x=u-i,_=v*v+x*x;if(_>4*t&&g--){var E=a+h,b=o+p,S=l+f,M=We(E*E+b*b+S*S),D=Mn(S/=M),A=St(St(S)-1)<wt||St(s-d)<wt?(s+d)/2:gr(b,E),R=e(A,D),$=R[0],H=R[1],P=$-r,B=H-i,O=x*P-v*B;(O*O/_>t||St((v*P+x*B)/_-.5)>.3||a*h+o*p+l*f<wA)&&(n(r,i,s,a,o,l,$,H,A,E/=M,b/=M,S,g,m),m.point($,H),n($,H,A,E,b,S,c,u,d,h,p,f,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,p,f,g,m={point:v,lineStart:x,lineEnd:E,polygonStart:function(){r.polygonStart(),m.lineStart=b},polygonEnd:function(){r.polygonEnd(),m.lineStart=x}};function v(D,A){D=e(D,A),r.point(D[0],D[1])}function x(){d=NaN,m.point=_,r.lineStart()}function _(D,A){var R=ei([D,A]),$=e(D,A);n(d,h,u,p,f,g,d=$[0],h=$[1],u=D,p=R[0],f=R[1],g=R[2],zm,r),r.point(d,h)}function E(){m.point=v,r.lineEnd()}function b(){x(),m.point=S,m.lineEnd=M}function S(D,A){_(i=D,A),s=d,a=h,o=p,l=f,c=g,m.point=_}function M(){n(d,h,u,p,f,g,s,a,i,o,l,c,zm,r),m.lineEnd=E,E()}return m}}var CA=Fc({point:function(e,t){this.stream.point(e*Bt,t*Bt)}});function AA(e){return Fc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function kA(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function jm(e,t,n,r,i,s){if(!s)return kA(e,t,n,r,i);var a=$t(s),o=_t(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,p=(o*t+a*n)/e;function f(g,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return f.invert=function(g,m){return[r*(u*g-d*m+h),i*(p-d*g-u*m)]},f}function qa(e){return Wm(function(){return e})()}function Wm(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,g=Sm,m=null,v,x,_,E=Dc,b=.5,S,M,D,A,R;function $(O){return D(O[0]*Bt,O[1]*Bt)}function H(O){return O=D.invert(O[0],O[1]),O&&[O[0]*ae,O[1]*ae]}$.stream=function(O){return A&&R===O?A:A=CA(AA(u)(g(S(E(R=O)))))},$.preclip=function(O){return arguments.length?(g=O,f=void 0,B()):g},$.postclip=function(O){return arguments.length?(E=O,m=v=x=_=null,B()):E},$.clipAngle=function(O){return arguments.length?(g=+O?lA(f=O*Bt):(f=null,Sm),B()):f*ae},$.clipExtent=function(O){return arguments.length?(E=O==null?(m=v=x=_=null,Dc):uA(m=+O[0][0],v=+O[0][1],x=+O[1][0],_=+O[1][1]),B()):m==null?null:[[m,v],[x,_]]},$.scale=function(O){return arguments.length?(n=+O,P()):n},$.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],P()):[r,i]},$.center=function(O){return arguments.length?(s=O[0]%360*Bt,a=O[1]%360*Bt,P()):[s*ae,a*ae]},$.rotate=function(O){return arguments.length?(o=O[0]%360*Bt,l=O[1]%360*Bt,c=O.length>2?O[2]%360*Bt:0,P()):[o*ae,l*ae,c*ae]},$.angle=function(O){return arguments.length?(d=O%360*Bt,P()):d*ae},$.reflectX=function(O){return arguments.length?(h=O?-1:1,P()):h<0},$.reflectY=function(O){return arguments.length?(p=O?-1:1,P()):p<0},$.precision=function(O){return arguments.length?(S=Fm(M,b=O*O),B()):We(b)},$.fitExtent=function(O,w){return Gm($,O,w)},$.fitSize=function(O,w){return OA($,O,w)},$.fitWidth=function(O,w){return SA($,O,w)},$.fitHeight=function(O,w){return TA($,O,w)};function P(){var O=jm(n,0,0,h,p,d).apply(null,t(s,a)),w=jm(n,r-O[0],i-O[1],h,p,d);return u=mm(o,l,c),M=Ac(t,w),D=Ac(u,M),S=Fm(M,b),B()}function B(){return A=R=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&H,P()}}function qm(e){var t=0,n=mt/3,r=Wm(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Bt,n=s[1]*Bt):[t*ae,n*ae]},i}function LA(e){var t=$t(e);function n(r,i){return[r*t,_t(i)/t]}return n.invert=function(r,i){return[r/t,Mn(i*t)]},n}function DA(e,t){var n=_t(e),r=(n+_t(t))/2;if(St(r)<wt)return LA(e);var i=1+n*(2*r-n),s=We(i)/r;function a(o,l){var c=We(i-2*r*_t(l))/r;return[c*_t(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=gr(o,St(c))*Gn(c);return c*r<0&&(u-=mt*Gn(o)*Gn(c)),[u/r,Mn((i-(o*o+c*c)*r*r)/(2*r))]},a}function Ym(){return qm(DA).scale(155.424).center([0,33.6442])}function RA(){return Ym().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function qc(e,t){return[e,KC(QC((fe+t)/2))]}qc.invert=function(e,t){return[e,2*hm(ZC(t))-fe]};function IA(){return NA(qc).scale(961/Ee)}function NA(e){var t=qa(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=mt*r(),h=t(tA(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===qc?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function Ya(e,t){return[e,t]}Ya.invert=Ya;function PA(){return qa(Ya).scale(152.63)}function UA(e,t){var n=$t(e),r=e===t?_t(e):(n-$t(t))/(t-e),i=n/r+e;if(St(r)<wt)return Ya;function s(a,o){var l=i-o,c=r*a;return[l*_t(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=gr(a,St(l))*Gn(l);return l*r<0&&(c-=mt*Gn(a)*Gn(l)),[c/r,i-Gn(r)*We(a*a+l*l)]},s}function BA(){return qm(UA).scale(131.154).center([0,13.9389])}var ls=1.340264,cs=-.081106,us=893e-6,hs=.003796,Xa=We(3)/2,HA=12;function Xm(e,t){var n=Mn(Xa*_t(t)),r=n*n,i=r*r*r;return[e*$t(n)/(Xa*(ls+3*cs*r+i*(7*us+9*hs*r))),n*(ls+cs*r+i*(us+hs*r))]}Xm.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<HA&&(o=n*(ls+cs*r+i*(us+hs*r))-t,l=ls+3*cs*r+i*(7*us+9*hs*r),n-=a=o/l,r=n*n,i=r*r*r,!(St(a)<XC));++s);return[Xa*e*(ls+3*cs*r+i*(7*us+9*hs*r))/$t(n),Mn(_t(n)/Xa)]};function VA(){return qa(Xm).scale(177.158)}function Zm(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Zm.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(St(i)>wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function GA(){return qa(Zm).scale(175.295)}function zA(e,t){return e.parent===t.parent?1:2}function FA(e){return e.reduce(jA,0)/e.length}function jA(e,t){return e+t.x}function WA(e){return 1+e.reduce(qA,0)}function qA(e,t){return Math.max(e,t.y)}function YA(e){for(var t;t=e.children;)e=t[0];return e}function XA(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ZA(){var e=zA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=FA(p),h.y=WA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=YA(s),c=XA(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function KA(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function QA(){return this.eachAfter(KA)}function JA(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function tk(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function ek(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function nk(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function rk(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function ik(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function sk(e){for(var t=this,n=ak(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function ak(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ok(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function lk(){return Array.from(this)}function ck(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function uk(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*hk(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function ds(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=fk)):t===void 0&&(t=pk);for(var n=new ps(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new ps(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(gk)}function dk(){return ds(this).eachBefore(mk)}function pk(e){return e.children}function fk(e){return Array.isArray(e)?e[1]:null}function mk(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function gk(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ps(e){this.data=e,this.depth=this.height=0,this.parent=null}ps.prototype=ds.prototype={constructor:ps,count:QA,each:JA,eachAfter:ek,eachBefore:tk,find:nk,sum:rk,sort:ik,path:sk,ancestors:ok,descendants:lk,leaves:ck,links:uk,copy:dk,[Symbol.iterator]:hk};function vk(e){return e==null?null:Km(e)}function Km(e){if(typeof e!="function")throw new Error;return e}function yr(){return 0}function ii(e){return function(){return e}}const yk=1664525,xk=1013904223,Qm=4294967296;function bk(){let e=1;return()=>(e=(yk*e+xk)%Qm)/Qm}function _k(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ek(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Ok(e,t){for(var n=0,r=(e=Ek(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Jm(a,s)?++n:(a=Tk(i=Sk(i,s)),n=0);return a}function Sk(e,t){var n,r;if(Yc(t,e))return[t];for(n=0;n<e.length;++n)if(Za(t,e[n])&&Yc(fs(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Za(fs(e[n],e[r]),t)&&Za(fs(e[n],t),e[r])&&Za(fs(e[r],t),e[n])&&Yc(tg(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Za(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Jm(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Yc(e,t){for(var n=0;n<t.length;++n)if(!Jm(e,t[n]))return!1;return!0}function Tk(e){switch(e.length){case 1:return wk(e[0]);case 2:return fs(e[0],e[1]);case 3:return tg(e[0],e[1],e[2])}}function wk(e){return{x:e.x,y:e.y,r:e.r}}function fs(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function tg(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,p=r-c,f=i-o,g=i-u,m=l-s,v=d-s,x=r*r+i*i-s*s,_=x-a*a-o*o+l*l,E=x-c*c-u*u+d*d,b=p*f-h*g,S=(f*E-g*_)/(b*2)-r,M=(g*m-f*v)/b,D=(p*_-h*E)/(b*2)-i,A=(h*v-p*m)/b,R=M*M+A*A-1,$=2*(s+S*M+D*A),H=S*S+D*D-s*s,P=-(Math.abs(R)>1e-6?($+Math.sqrt($*$-4*R*H))/(2*R):H/$);return{x:r+S+M*P,y:i+D+A*P,r:P}}function eg(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function ng(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function rg(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Ka(e){this._=e,this.next=null,this.previous=null}function $k(e,t){if(!(s=(e=_k(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;eg(r,n,i=e[2]),n=new Ka(n),r=new Ka(r),i=new Ka(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){eg(n._,r._,i=e[l]),i=new Ka(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(ng(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(ng(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=rg(n);(i=i.next)!==r;)(o=rg(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Ok(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Mk(e){return Math.sqrt(e.value)}function Ck(){var e=null,t=1,n=1,r=yr;function i(s){const a=bk();return s.x=t/2,s.y=n/2,e?s.eachBefore(ig(e)).eachAfter(Xc(r,.5,a)).eachBefore(sg(1)):s.eachBefore(ig(Mk)).eachAfter(Xc(yr,1,a)).eachAfter(Xc(r,s.r/Math.min(t,n),a)).eachBefore(sg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=vk(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:ii(+s),i):r},i}function ig(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xc(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=$k(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function sg(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 Ak(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 kk(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function Lk(e,t){return e.parent===t.parent?1:2}function Zc(e){var t=e.children;return t?t[0]:e.t}function Kc(e){var t=e.children;return t?t[t.length-1]:e.t}function Dk(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Rk(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Ik(e,t,n){return e.a.parent===t.parent?e.a:n}function Qa(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}Qa.prototype=Object.create(ps.prototype);function Nk(e){for(var t=new Qa(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Qa(s[a],a)),i.parent=n;return(t.parent=new Qa(null,0)).children=[t],t}function Pk(){var e=Lk,t=1,n=1,r=null;function i(c){var u=Nk(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(x){x.x<d.x&&(d=x),x.x>h.x&&(h=x),x.depth>p.depth&&(p=x)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),v=n/(p.depth||1);c.eachBefore(function(x){x.x=(x.x+g)*m,x.y=x.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Rk(c);var p=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-p):c.z=p}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,p=c,f=u,g=h.parent.children[0],m=h.m,v=p.m,x=f.m,_=g.m,E;f=Kc(f),h=Zc(h),f&&h;)g=Zc(g),p=Kc(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(Dk(Ik(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!Kc(p)&&(p.t=f,p.m+=x-v),h&&!Zc(g)&&(g.t=h,g.m+=m-_,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Uk(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var Bk=(1+Math.sqrt(5))/2;function Hk(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,g=t.value,m,v,x,_,E,b,S;u<h;){p=i-n,f=s-r;do m=o[d++].value;while(!m&&d<h);for(v=x=m,b=Math.max(f/p,p/f)/(g*e),S=m*m*b,E=Math.max(x/S,S/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>x&&(x=c),S=m*m*b,_=Math.max(x/S,S/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?kk(l,n,r,i,g?r+=f*m/g:s):Uk(l,n,r,g?n+=p*m/g:i,s),g-=m,u=d}return a}const Vk=function e(t){function n(r,i,s,a,o){Hk(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Bk);function Gk(){var e=Vk,t=!1,n=1,r=1,i=[0],s=yr,a=yr,o=yr,l=yr,c=yr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(Ak),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,v=h.y1-p;m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),h.x0=f,h.y0=g,h.x1=m,h.y1=v,h.children&&(p=i[h.depth+1]=s(h)/2,f+=c(h)-p,g+=a(h)-p,m-=o(h)-p,v-=l(h)-p,m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),e(h,f,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Km(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:ii(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:ii(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:ii(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:ii(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:ii(+h),u):c},u}function Ja(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Tc(t)}function zk(e){return e.innerRadius}function Fk(e){return e.outerRadius}function jk(e){return e.startAngle}function Wk(e){return e.endAngle}function qk(e){return e&&e.padAngle}function Yk(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<ee))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function to(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Xr(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,g=r+d,m=(h+f)/2,v=(p+g)/2,x=f-h,_=g-p,E=x*x+_*_,b=i-s,S=h*g-f*p,M=(_<0?-1:1)*Xr(AM(0,b*b*E-S*S)),D=(S*_-x*M)/E,A=(-S*x-_*M)/E,R=(S*_+x*M)/E,$=(-S*x+_*M)/E,H=D-m,P=A-v,B=R-m,O=$-v;return H*H+P*P>B*B+O*O&&(D=R,A=$),{cx:D,cy:A,x01:-u,y01:-d,x11:D*(i/b-1),y11:A*(i/b-1)}}function ms(){var e=zk,t=Fk,n=pt(0),r=null,i=jk,s=Wk,a=qk,o=null,l=Ja(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-Ea,g=s.apply(this,arguments)-Ea,m=hf(g-f),v=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>ee))o.moveTo(0,0);else if(m>Oa-ee)o.moveTo(p*pr(f),p*sn(f)),o.arc(0,0,p,f,g,!v),h>ee&&(o.moveTo(h*pr(g),h*sn(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,S=m,M=m,D=a.apply(this,arguments)/2,A=D>ee&&(r?+r.apply(this,arguments):Xr(h*h+p*p)),R=oc(hf(p-h)/2,+n.apply(this,arguments)),$=R,H=R,P,B;if(A>ee){var O=df(A/h*sn(D)),w=df(A/p*sn(D));(S-=O*2)>ee?(O*=v?1:-1,E+=O,b-=O):(S=0,E=b=(f+g)/2),(M-=w*2)>ee?(w*=v?1:-1,x+=w,_-=w):(M=0,x=_=(f+g)/2)}var k=p*pr(x),L=p*sn(x),U=h*pr(b),K=h*sn(b);if(R>ee){var W=p*pr(_),j=p*sn(_),X=h*pr(E),ct=h*sn(E),J;if(m<ts)if(J=Yk(k,L,X,ct,W,j,U,K)){var Y=k-J[0],et=L-J[1],ut=W-J[0],F=j-J[1],q=1/sn(kM((Y*ut+et*F)/(Xr(Y*Y+et*et)*Xr(ut*ut+F*F)))/2),Z=Xr(J[0]*J[0]+J[1]*J[1]);$=oc(R,(h-Z)/(q-1)),H=oc(R,(p-Z)/(q+1))}else $=H=0}M>ee?H>ee?(P=to(X,ct,k,L,p,H,v),B=to(W,j,U,K,p,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<R?o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,p,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),!v),o.arc(B.cx,B.cy,H,te(B.y11,B.x11),te(B.y01,B.x01),!v))):(o.moveTo(k,L),o.arc(0,0,p,x,_,!v)):o.moveTo(k,L),!(h>ee)||!(S>ee)?o.lineTo(U,K):$>ee?(P=to(U,K,W,j,h,-$,v),B=to(k,L,X,ct,h,-$,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<R?o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,h,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),v),o.arc(B.cx,B.cy,$,te(B.y11,B.x11),te(B.y01,B.x01),!v))):o.arc(0,0,h,b,E,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-ts/2;return[pr(d)*u,sn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:pt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:pt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:pt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:pt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:pt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:pt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:pt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Qc(e){return e[0]}function Jc(e){return e[1]}function gs(e,t){var n=pt(!0),r=null,i=Sa,s=null,a=Ja(o);e=typeof e=="function"?e:e===void 0?Qc:pt(e),t=typeof t=="function"?t:t===void 0?Jc:pt(t);function o(l){var c,u=(l=ga(l)).length,d,h=!1,p;for(r==null&&(s=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(p)return s=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:pt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:pt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:pt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function tu(e,t,n){var r=null,i=pt(!0),s=null,a=Sa,o=null,l=Ja(c);e=typeof e=="function"?e:e===void 0?Qc:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Jc:pt(+n);function c(d){var h,p,f,g=(d=ga(d)).length,m,v=!1,x,_=new Array(g),E=new Array(g);for(s==null&&(o=a(x=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[h]=+e(m,h,d),E[h]=+t(m,h,d),o.point(r?+r(m,h,d):_[h],n?+n(m,h,d):E[h]))}if(x)return o=null,x+""||null}function u(){return gs().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function Xk(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Zk(e){return e}function Kk(){var e=Zk,t=Xk,n=null,r=pt(0),i=pt(Oa),s=pt(0);function a(o){var l,c=(o=ga(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Oa,Math.max(-Oa,i.apply(this,arguments)-g)),v,x=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=x*(m<0?-1:1),E;for(l=0;l<c;++l)(E=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=E);for(t!=null?p.sort(function(b,S){return t(f[b],f[S])}):n!=null&&p.sort(function(b,S){return n(o[b],o[S])}),l=0,d=h?(m-c*_)/h:0;l<c;++l,g=v)u=p[l],E=f[u],v=g+(E>0?E*d:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:x};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:pt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var Qk=og(Sa);function ag(e){this._curve=e}ag.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function og(e){function t(n){return new ag(e(n))}return t._curve=e,t}function Jk(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(og(n)):t()._curve},e}function tL(){return Jk(gs().curve(Qk))}class eL{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function nL(e){return new eL(e,!0)}function rL(e){return e.source}function iL(e){return e.target}function sL(e){let t=rL,n=iL,r=Qc,i=Jc,s=null,a=null,o=Ja(l);function l(){let c;const u=Sw.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function aL(){return sL(nL)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=it.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${de}--${i}--${this.type}`,!0),r&&r.classed(`${de}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===it.SVG?"svg":"div"}${r}.${de}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=I(`#${s}`).select("rect");if(a.size()!==0){const o=parseFloat(a.attr("height")),l=parseFloat(a.attr("width"));!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&i.attr("clip-path",`url(#${s})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:lg,setPrototypeOf:cg,isFrozen:oL,getPrototypeOf:lL,getOwnPropertyDescriptor:cL}=Object;let{freeze:oe,seal:Ie,create:ug}=Object,{apply:eu,construct:nu}=typeof Reflect<"u"&&Reflect;oe||(oe=function(e){return e}),Ie||(Ie=function(e){return e}),eu||(eu=function(e,t,n){return e.apply(t,n)}),nu||(nu=function(e,t){return new e(...t)});const eo=ce(Array.prototype.forEach),uL=ce(Array.prototype.lastIndexOf),hg=ce(Array.prototype.pop),vs=ce(Array.prototype.push),hL=ce(Array.prototype.splice),no=ce(String.prototype.toLowerCase),ru=ce(String.prototype.toString),dg=ce(String.prototype.match),ys=ce(String.prototype.replace),dL=ce(String.prototype.indexOf),pL=ce(String.prototype.trim),qe=ce(Object.prototype.hasOwnProperty),le=ce(RegExp.prototype.test),xs=fL(TypeError);function ce(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return eu(e,t,r)}}function fL(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nu(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:no;cg&&cg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(oL(t)||(t[r]=s),i=s)}e[i]=!0}return e}function mL(e){for(let t=0;t<e.length;t++)qe(e,t)||(e[t]=null);return e}function An(e){const t=ug(null);for(const[n,r]of lg(e))qe(e,n)&&(Array.isArray(r)?t[n]=mL(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=An(r):t[n]=r);return t}function bs(e,t){for(;e!==null;){const r=cL(e,t);if(r){if(r.get)return ce(r.get);if(typeof r.value=="function")return ce(r.value)}e=lL(e)}function n(){return null}return n}const pg=oe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iu=oe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),su=oe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gL=oe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),au=oe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),vL=oe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fg=oe(["#text"]),mg=oe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ou=oe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gg=oe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ro=oe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yL=Ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xL=Ie(/<%[\w\W]*|[\w\W]*%>/gm),bL=Ie(/\$\{[\w\W]*/gm),_L=Ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),EL=Ie(/^aria-[\-\w]+$/),vg=Ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OL=Ie(/^(?:\w+script|data):/i),SL=Ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yg=Ie(/^html$/i),TL=Ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var xg=Object.freeze({__proto__:null,ARIA_ATTR:EL,ATTR_WHITESPACE:SL,CUSTOM_ELEMENT:TL,DATA_ATTR:_L,DOCTYPE_NAME:yg,ERB_EXPR:xL,IS_ALLOWED_URI:vg,IS_SCRIPT_OR_DATA:OL,MUSTACHE_EXPR:yL,TMPLIT_EXPR:bL});const _s={element:1,text:3,progressingInstruction:7,comment:8,document:9},wL=function(){return typeof window>"u"?null:window},$L=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},bg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _g(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wL();const t=C=>_g(C);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==_s.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=bs(f,"cloneNode"),m=bs(f,"remove"),v=bs(f,"nextSibling"),x=bs(f,"childNodes"),_=bs(f,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let E,b="";const{implementation:S,createNodeIterator:M,createDocumentFragment:D,getElementsByTagName:A}=n,{importNode:R}=r;let $=bg();t.isSupported=typeof lg=="function"&&typeof _=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:P,TMPLIT_EXPR:B,DATA_ATTR:O,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=xg;let{IS_ALLOWED_URI:K}=xg,W=null;const j=vt({},[...pg,...iu,...su,...au,...fg]);let X=null;const ct=vt({},[...mg,...ou,...gg,...ro]);let J=Object.seal(ug(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,et=null,ut=!0,F=!0,q=!1,Z=!0,G=!1,dt=!0,ot=!1,It=!1,Ht=!1,rt=!1,Et=!1,Ne=!1,Te=!0,Ts=!1;const ws="user-content-";let _r=!0,Xe=!1,li={},ci=null;const Hv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Vv=null;const Gv=vt({},["audio","video","img","source","image","track"]);let Lu=null;const zv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yo="http://www.w3.org/1998/Math/MathML",xo="http://www.w3.org/2000/svg",Ln="http://www.w3.org/1999/xhtml";let ui=Ln,Du=!1,Ru=null;const rU=vt({},[yo,xo,Ln],ru);let bo=vt({},["mi","mo","mn","ms","mtext"]),_o=vt({},["annotation-xml"]);const iU=vt({},["title","style","font","a","script"]);let $s=null;const sU=["application/xhtml+xml","text/html"],aU="text/html";let Xt=null,hi=null;const oU=n.createElement("form"),Fv=function(C){return C instanceof RegExp||C instanceof Function},Iu=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(hi&&hi===C)){if((!C||typeof C!="object")&&(C={}),C=An(C),$s=sU.indexOf(C.PARSER_MEDIA_TYPE)===-1?aU:C.PARSER_MEDIA_TYPE,Xt=$s==="application/xhtml+xml"?ru:no,W=qe(C,"ALLOWED_TAGS")?vt({},C.ALLOWED_TAGS,Xt):j,X=qe(C,"ALLOWED_ATTR")?vt({},C.ALLOWED_ATTR,Xt):ct,Ru=qe(C,"ALLOWED_NAMESPACES")?vt({},C.ALLOWED_NAMESPACES,ru):rU,Lu=qe(C,"ADD_URI_SAFE_ATTR")?vt(An(zv),C.ADD_URI_SAFE_ATTR,Xt):zv,Vv=qe(C,"ADD_DATA_URI_TAGS")?vt(An(Gv),C.ADD_DATA_URI_TAGS,Xt):Gv,ci=qe(C,"FORBID_CONTENTS")?vt({},C.FORBID_CONTENTS,Xt):Hv,Y=qe(C,"FORBID_TAGS")?vt({},C.FORBID_TAGS,Xt):An({}),et=qe(C,"FORBID_ATTR")?vt({},C.FORBID_ATTR,Xt):An({}),li=qe(C,"USE_PROFILES")?C.USE_PROFILES:!1,ut=C.ALLOW_ARIA_ATTR!==!1,F=C.ALLOW_DATA_ATTR!==!1,q=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=C.SAFE_FOR_TEMPLATES||!1,dt=C.SAFE_FOR_XML!==!1,ot=C.WHOLE_DOCUMENT||!1,rt=C.RETURN_DOM||!1,Et=C.RETURN_DOM_FRAGMENT||!1,Ne=C.RETURN_TRUSTED_TYPE||!1,Ht=C.FORCE_BODY||!1,Te=C.SANITIZE_DOM!==!1,Ts=C.SANITIZE_NAMED_PROPS||!1,_r=C.KEEP_CONTENT!==!1,Xe=C.IN_PLACE||!1,K=C.ALLOWED_URI_REGEXP||vg,ui=C.NAMESPACE||Ln,bo=C.MATHML_TEXT_INTEGRATION_POINTS||bo,_o=C.HTML_INTEGRATION_POINTS||_o,J=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&Fv(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&Fv(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(F=!1),Et&&(rt=!0),li&&(W=vt({},fg),X=[],li.html===!0&&(vt(W,pg),vt(X,mg)),li.svg===!0&&(vt(W,iu),vt(X,ou),vt(X,ro)),li.svgFilters===!0&&(vt(W,su),vt(X,ou),vt(X,ro)),li.mathMl===!0&&(vt(W,au),vt(X,gg),vt(X,ro))),C.ADD_TAGS&&(W===j&&(W=An(W)),vt(W,C.ADD_TAGS,Xt)),C.ADD_ATTR&&(X===ct&&(X=An(X)),vt(X,C.ADD_ATTR,Xt)),C.ADD_URI_SAFE_ATTR&&vt(Lu,C.ADD_URI_SAFE_ATTR,Xt),C.FORBID_CONTENTS&&(ci===Hv&&(ci=An(ci)),vt(ci,C.FORBID_CONTENTS,Xt)),_r&&(W["#text"]=!0),ot&&vt(W,["html","head","body"]),W.table&&(vt(W,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw xs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=C.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=$L(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));oe&&oe(C),hi=C}},jv=vt({},[...iu,...su,...gL]),Wv=vt({},[...au,...vL]),lU=function(C){let tt=_(C);(!tt||!tt.tagName)&&(tt={namespaceURI:ui,tagName:"template"});const Q=no(C.tagName),Tt=no(tt.tagName);return Ru[C.namespaceURI]?C.namespaceURI===xo?tt.namespaceURI===Ln?Q==="svg":tt.namespaceURI===yo?Q==="svg"&&(Tt==="annotation-xml"||bo[Tt]):!!jv[Q]:C.namespaceURI===yo?tt.namespaceURI===Ln?Q==="math":tt.namespaceURI===xo?Q==="math"&&_o[Tt]:!!Wv[Q]:C.namespaceURI===Ln?tt.namespaceURI===xo&&!_o[Tt]||tt.namespaceURI===yo&&!bo[Tt]?!1:!Wv[Q]&&(iU[Q]||!jv[Q]):!!($s==="application/xhtml+xml"&&Ru[C.namespaceURI]):!1},Er=function(C){vs(t.removed,{element:C});try{_(C).removeChild(C)}catch{m(C)}},di=function(C,tt){try{vs(t.removed,{attribute:tt.getAttributeNode(C),from:tt})}catch{vs(t.removed,{attribute:null,from:tt})}if(tt.removeAttribute(C),C==="is")if(rt||Et)try{Er(tt)}catch{}else try{tt.setAttribute(C,"")}catch{}},qv=function(C){let tt=null,Q=null;if(Ht)C="<remove></remove>"+C;else{const Vt=dg(C,/^[\r\n\t ]+/);Q=Vt&&Vt[0]}$s==="application/xhtml+xml"&&ui===Ln&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Tt=E?E.createHTML(C):C;if(ui===Ln)try{tt=new h().parseFromString(Tt,$s)}catch{}if(!tt||!tt.documentElement){tt=S.createDocument(ui,"template",null);try{tt.documentElement.innerHTML=Du?b:Tt}catch{}}const Qt=tt.body||tt.documentElement;return C&&Q&&Qt.insertBefore(n.createTextNode(Q),Qt.childNodes[0]||null),ui===Ln?A.call(tt,ot?"html":"body")[0]:ot?tt.documentElement:Qt},Yv=function(C){return M.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nu=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Xv=function(C){return typeof o=="function"&&C instanceof o};function Dn(C,tt,Q){eo(C,Tt=>{Tt.call(t,tt,Q,hi)})}const Zv=function(C){let tt=null;if(Dn($.beforeSanitizeElements,C,null),Nu(C))return Er(C),!0;const Q=Xt(C.nodeName);if(Dn($.uponSanitizeElement,C,{tagName:Q,allowedTags:W}),dt&&C.hasChildNodes()&&!Xv(C.firstElementChild)&&le(/<[/\w!]/g,C.innerHTML)&&le(/<[/\w!]/g,C.textContent)||C.nodeType===_s.progressingInstruction||dt&&C.nodeType===_s.comment&&le(/<[/\w]/g,C.data))return Er(C),!0;if(!W[Q]||Y[Q]){if(!Y[Q]&&Qv(Q)&&(J.tagNameCheck instanceof RegExp&&le(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q)))return!1;if(_r&&!ci[Q]){const Tt=_(C)||C.parentNode,Qt=x(C)||C.childNodes;if(Qt&&Tt){const Vt=Qt.length;for(let Rn=Vt-1;Rn>=0;--Rn){const Ze=g(Qt[Rn],!0);Ze.__removalCount=(C.__removalCount||0)+1,Tt.insertBefore(Ze,v(C))}}}return Er(C),!0}return C instanceof l&&!lU(C)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&le(/<\/no(script|embed|frames)/i,C.innerHTML)?(Er(C),!0):(G&&C.nodeType===_s.text&&(tt=C.textContent,eo([H,P,B],Tt=>{tt=ys(tt,Tt," ")}),C.textContent!==tt&&(vs(t.removed,{element:C.cloneNode()}),C.textContent=tt)),Dn($.afterSanitizeElements,C,null),!1)},Kv=function(C,tt,Q){if(Te&&(tt==="id"||tt==="name")&&(Q in n||Q in oU))return!1;if(!(F&&!et[tt]&&le(O,tt))&&!(ut&&le(w,tt))){if(!X[tt]||et[tt]){if(!(Qv(C)&&(J.tagNameCheck instanceof RegExp&&le(J.tagNameCheck,C)||J.tagNameCheck instanceof Function&&J.tagNameCheck(C))&&(J.attributeNameCheck instanceof RegExp&&le(J.attributeNameCheck,tt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(tt))||tt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&le(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q))))return!1}else if(!Lu[tt]&&!le(K,ys(Q,L,""))&&!((tt==="src"||tt==="xlink:href"||tt==="href")&&C!=="script"&&dL(Q,"data:")===0&&Vv[C])&&!(q&&!le(k,ys(Q,L,"")))&&Q)return!1}return!0},Qv=function(C){return C!=="annotation-xml"&&dg(C,U)},Jv=function(C){Dn($.beforeSanitizeAttributes,C,null);const{attributes:tt}=C;if(!tt||Nu(C))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Tt=tt.length;for(;Tt--;){const Qt=tt[Tt],{name:Vt,namespaceURI:Rn,value:Ze}=Qt,un=Xt(Vt),Pu=Ze;let ie=Vt==="value"?Pu:pL(Pu);if(Q.attrName=un,Q.attrValue=ie,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Dn($.uponSanitizeAttribute,C,Q),ie=Q.attrValue,Ts&&(un==="id"||un==="name")&&(di(Vt,C),ie=ws+ie),dt&&le(/((--!?|])>)|<\/(style|title)/i,ie)){di(Vt,C);continue}if(Q.forceKeepAttr)continue;if(!Q.keepAttr){di(Vt,C);continue}if(!Z&&le(/\/>/i,ie)){di(Vt,C);continue}G&&eo([H,P,B],uU=>{ie=ys(ie,uU," ")});const t0=Xt(C.nodeName);if(!Kv(t0,un,ie)){di(Vt,C);continue}if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Rn)switch(p.getAttributeType(t0,un)){case"TrustedHTML":{ie=E.createHTML(ie);break}case"TrustedScriptURL":{ie=E.createScriptURL(ie);break}}if(ie!==Pu)try{Rn?C.setAttributeNS(Rn,Vt,ie):C.setAttribute(Vt,ie),Nu(C)?Er(C):hg(t.removed)}catch{di(Vt,C)}}Dn($.afterSanitizeAttributes,C,null)},cU=function C(tt){let Q=null;const Tt=Yv(tt);for(Dn($.beforeSanitizeShadowDOM,tt,null);Q=Tt.nextNode();)Dn($.uponSanitizeShadowNode,Q,null),Zv(Q),Jv(Q),Q.content instanceof s&&C(Q.content);Dn($.afterSanitizeShadowDOM,tt,null)};return t.sanitize=function(C){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,Tt=null,Qt=null,Vt=null;if(Du=!C,Du&&(C="<!-->"),typeof C!="string"&&!Xv(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw xs("dirty is not a string, aborting")}else throw xs("toString is not a function");if(!t.isSupported)return C;if(It||Iu(tt),t.removed=[],typeof C=="string"&&(Xe=!1),Xe){if(C.nodeName){const un=Xt(C.nodeName);if(!W[un]||Y[un])throw xs("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)Q=qv("<!---->"),Tt=Q.ownerDocument.importNode(C,!0),Tt.nodeType===_s.element&&Tt.nodeName==="BODY"||Tt.nodeName==="HTML"?Q=Tt:Q.appendChild(Tt);else{if(!rt&&!G&&!ot&&C.indexOf("<")===-1)return E&&Ne?E.createHTML(C):C;if(Q=qv(C),!Q)return rt?null:Ne?b:""}Q&&Ht&&Er(Q.firstChild);const Rn=Yv(Xe?C:Q);for(;Qt=Rn.nextNode();)Zv(Qt),Jv(Qt),Qt.content instanceof s&&cU(Qt.content);if(Xe)return C;if(rt){if(Et)for(Vt=D.call(Q.ownerDocument);Q.firstChild;)Vt.appendChild(Q.firstChild);else Vt=Q;return(X.shadowroot||X.shadowrootmode)&&(Vt=R.call(r,Vt,!0)),Vt}let Ze=ot?Q.outerHTML:Q.innerHTML;return ot&&W["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&le(yg,Q.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
4
4
|
`+Ze),G&&eo([H,P,B],un=>{Ze=ys(Ze,un," ")}),E&&Ne?E.createHTML(Ze):Ze},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Iu(C),It=!0},t.clearConfig=function(){hi=null,It=!1},t.isValidAttribute=function(C,tt,Q){hi||Iu({});const Tt=Xt(C),Qt=Xt(tt);return Kv(Tt,Qt,Q)},t.addHook=function(C,tt){typeof tt=="function"&&vs($[C],tt)},t.removeHook=function(C,tt){if(tt!==void 0){const Q=uL($[C],tt);return Q===-1?void 0:hL($[C],Q,1)[0]}return hg($[C])},t.removeHooks=function(C){$[C]=[]},t.removeAllHooks=function(){$=bg()},t}var lu=_g();const io=e=>lu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ML=e=>lu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>lu.sanitize(e,{ALLOWED_TAGS:[]}),Eg=class n0 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=it.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
5
5
|
<button
|
|
6
|
+
type="button"
|
|
6
7
|
class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
|
|
7
8
|
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${ln(l.id)}`)}" aria-label="${ln(l.title)}">
|
|
8
9
|
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
|
|
9
10
|
${ML(l.iconSVG.content)}
|
|
10
11
|
</svg>
|
|
11
|
-
</button>`).each(function(l,c){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(u){const d=I(this);d.classed("hovered",!0),o.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===bt.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${n0.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===bt.MAKE_FULLSCREEN&&l?a.type=bt.EXIT_FULLSCREEN:a.type===bt.EXIT_FULLSCREEN&&!l&&(a.type=bt.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
|
|
12
|
+
</button>`).each(function(l,c){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(u){const d=I(this);d.classed("hovered",!0),o.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===bt.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${n0.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===bt.MAKE_FULLSCREEN&&l?a.type=bt.EXIT_FULLSCREEN:a.type===bt.EXIT_FULLSCREEN&&!l&&(a.type=bt.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
|
|
12
13
|
<circle cx="16" cy="16" r="2"></circle>
|
|
13
14
|
<circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case bt.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case bt.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case bt.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case bt.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case bt.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case bt.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case bt.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case bt.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case bt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
|
|
14
15
|
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case bt.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
|