UNPKG

react-infinite-canvas

Version:

An Infinite Canvas Component for React where you can place your component anywhere on the canvas with zoom in, zoom out and panning functionality. It also supports custom components to control the canvas.

2 lines 63.2 kB
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._dotSvgContainer_64xbd_1{position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0}._container_1xxyl_1{position:relative;overflow:hidden;width:100%;height:100%}._canvasWrapper_1xxyl_8{position:relative;width:100%;height:100%;overflow:hidden;background-color:var(--kf-color-bg-gray);cursor:grab;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._canvasWrapper_1xxyl_8._panning_1xxyl_21{cursor:grabbing}._canvas_1xxyl_8{position:relative;z-index:2;width:100%;height:100%}._canvas_1xxyl_8>div:first-of-type{position:absolute;inset-inline-start:0;inset-block-start:0;transition:transform .01s ease}._contentWrapper_1xxyl_39{position:absolute}._verticalScrollBar_17thb_1{position:absolute;inset-inline-end:2px;inset-block-start:0;inset-block-end:0;background:transparent}._horizontalScrollBar_17thb_9{position:absolute;inset-block-end:2px;inset-inline-start:0;inset-inline-end:0;background:transparent}._verticalScrollBar_17thb_1>div,._horizontalScrollBar_17thb_9>div{position:absolute;border-radius:50px;z-index:8;cursor:pointer}._verticalScrollBar_17thb_1>div{width:100%}._horizontalScrollBar_17thb_9>div{height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); (function(J,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],A):(J=typeof globalThis<"u"?globalThis:J||self,A(J.ReactInfiniteCanvas={},J.jsxRuntime,J.React))})(this,function(J,A,M){"use strict";var Qt="http://www.w3.org/1999/xhtml";const ye={svg:"http://www.w3.org/2000/svg",xhtml:Qt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function At(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ye.hasOwnProperty(e)?{space:ye[e],local:t}:t}function mn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Qt&&e.documentElement.namespaceURI===Qt?e.createElement(t):e.createElementNS(n,t)}}function yn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function we(t){var e=At(t);return(e.local?yn:mn)(e)}function wn(){}function Jt(t){return t==null?wn:function(){return this.querySelector(t)}}function xn(t){typeof t!="function"&&(t=Jt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=new Array(o),l,f,c=0;c<o;++c)(l=a[c])&&(f=t.call(l,l.__data__,c,a))&&("__data__"in l&&(f.__data__=l.__data__),s[c]=f);return new G(r,this._parents)}function vn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Sn(){return[]}function xe(t){return t==null?Sn:function(){return this.querySelectorAll(t)}}function bn(t){return function(){return vn(t.apply(this,arguments))}}function En(t){typeof t=="function"?t=bn(t):t=xe(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],s=o.length,l,f=0;f<s;++f)(l=o[f])&&(r.push(t.call(l,l.__data__,f,o)),i.push(l));return new G(r,i)}function ve(t){return function(){return this.matches(t)}}function Se(t){return function(e){return e.matches(t)}}var Tn=Array.prototype.find;function Cn(t){return function(){return Tn.call(this.children,t)}}function Nn(){return this.firstElementChild}function zn(t){return this.select(t==null?Nn:Cn(typeof t=="function"?t:Se(t)))}var Mn=Array.prototype.filter;function An(){return Array.from(this.children)}function In(t){return function(){return Mn.call(this.children,t)}}function Ln(t){return this.selectAll(t==null?An:In(typeof t=="function"?t:Se(t)))}function $n(t){typeof t!="function"&&(t=ve(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],l,f=0;f<o;++f)(l=a[f])&&t.call(l,l.__data__,f,a)&&s.push(l);return new G(r,this._parents)}function be(t){return new Array(t.length)}function kn(){return new G(this._enter||this._groups.map(be),this._parents)}function It(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}It.prototype={constructor:It,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Dn(t){return function(){return t}}function Rn(t,e,n,r,i,a){for(var o=0,s,l=e.length,f=a.length;o<f;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new It(t,a[o]);for(;o<l;++o)(s=e[o])&&(i[o]=s)}function Pn(t,e,n,r,i,a,o){var s,l,f=new Map,c=e.length,p=a.length,_=new Array(c),m;for(s=0;s<c;++s)(l=e[s])&&(_[s]=m=o.call(l,l.__data__,s,e)+"",f.has(m)?i[s]=l:f.set(m,l));for(s=0;s<p;++s)m=o.call(t,a[s],s,a)+"",(l=f.get(m))?(r[s]=l,l.__data__=a[s],f.delete(m)):n[s]=new It(t,a[s]);for(s=0;s<c;++s)(l=e[s])&&f.get(_[s])===l&&(i[s]=l)}function On(t){return t.__data__}function Xn(t,e){if(!arguments.length)return Array.from(this,On);var n=e?Pn:Rn,r=this._parents,i=this._groups;typeof t!="function"&&(t=Dn(t));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),f=0;f<a;++f){var c=r[f],p=i[f],_=p.length,m=Fn(t.call(c,c&&c.__data__,f,r)),C=m.length,v=s[f]=new Array(C),N=o[f]=new Array(C),y=l[f]=new Array(_);n(c,p,v,N,y,m,e);for(var z=0,k=0,X,Y;z<C;++z)if(X=v[z]){for(z>=k&&(k=z+1);!(Y=N[k])&&++k<C;);X._next=Y||null}}return o=new G(o,r),o._enter=s,o._exit=l,o}function Fn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Yn(){return new G(this._exit||this._groups.map(be),this._parents)}function qn(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Vn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var f=n[l],c=r[l],p=f.length,_=s[l]=new Array(p),m,C=0;C<p;++C)(m=f[C]||c[C])&&(_[C]=m);for(;l<i;++l)s[l]=n[l];return new G(s,this._parents)}function Hn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Un(t){t||(t=Kn);function e(p,_){return p&&_?t(p.__data__,_.__data__):!p-!_}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,l=i[a]=new Array(s),f,c=0;c<s;++c)(f=o[c])&&(l[c]=f);l.sort(e)}return new G(i,this._parents).order()}function Kn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Bn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Gn(){return Array.from(this)}function Zn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Qn(){let t=0;for(const e of this)++t;return t}function Jn(){return!this.node()}function Wn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&t.call(s,s.__data__,a,i);return this}function jn(t){return function(){this.removeAttribute(t)}}function tr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function er(t,e){return function(){this.setAttribute(t,e)}}function nr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function rr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ir(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function or(t,e){var n=At(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?tr:jn:typeof e=="function"?n.local?ir:rr:n.local?nr:er)(n,e))}function Ee(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ar(t){return function(){this.style.removeProperty(t)}}function sr(t,e,n){return function(){this.style.setProperty(t,e,n)}}function cr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ur(t,e,n){return arguments.length>1?this.each((e==null?ar:typeof e=="function"?cr:sr)(t,e,n==null?"":n)):dt(this.node(),t)}function dt(t,e){return t.style.getPropertyValue(e)||Ee(t).getComputedStyle(t,null).getPropertyValue(e)}function lr(t){return function(){delete this[t]}}function fr(t,e){return function(){this[t]=e}}function hr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function pr(t,e){return arguments.length>1?this.each((e==null?lr:typeof e=="function"?hr:fr)(t,e)):this.node()[t]}function Te(t){return t.trim().split(/^|\s+/)}function Wt(t){return t.classList||new Ce(t)}function Ce(t){this._node=t,this._names=Te(t.getAttribute("class")||"")}Ce.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ne(t,e){for(var n=Wt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ze(t,e){for(var n=Wt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function dr(t){return function(){Ne(this,t)}}function _r(t){return function(){ze(this,t)}}function gr(t,e){return function(){(e.apply(this,arguments)?Ne:ze)(this,t)}}function mr(t,e){var n=Te(t+"");if(arguments.length<2){for(var r=Wt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?gr:e?dr:_r)(n,e))}function yr(){this.textContent=""}function wr(t){return function(){this.textContent=t}}function xr(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function vr(t){return arguments.length?this.each(t==null?yr:(typeof t=="function"?xr:wr)(t)):this.node().textContent}function Sr(){this.innerHTML=""}function br(t){return function(){this.innerHTML=t}}function Er(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function Tr(t){return arguments.length?this.each(t==null?Sr:(typeof t=="function"?Er:br)(t)):this.node().innerHTML}function Cr(){this.nextSibling&&this.parentNode.appendChild(this)}function Nr(){return this.each(Cr)}function zr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Mr(){return this.each(zr)}function Ar(t){var e=typeof t=="function"?t:we(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ir(){return null}function Lr(t,e){var n=typeof t=="function"?t:we(t),r=e==null?Ir:typeof e=="function"?e:Jt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function $r(){var t=this.parentNode;t&&t.removeChild(this)}function kr(){return this.each($r)}function Dr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Rr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Pr(t){return this.select(t?Rr:Dr)}function Or(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Xr(t){return function(e){t.call(this,e,this.__data__)}}function Fr(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Yr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function qr(t,e,n){return function(){var r=this.__on,i,a=Xr(e);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Vr(t,e,n){var r=Fr(t+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,f=s.length,c;l<f;++l)for(i=0,c=s[l];i<a;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(s=e?qr:Yr,i=0;i<a;++i)this.each(s(r[i],e,n));return this}function Me(t,e,n){var r=Ee(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Hr(t,e){return function(){return Me(this,t,e)}}function Ur(t,e){return function(){return Me(this,t,e.apply(this,arguments))}}function Kr(t,e){return this.each((typeof e=="function"?Ur:Hr)(t,e))}function*Br(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Ae=[null];function G(t,e){this._groups=t,this._parents=e}function mt(){return new G([[document.documentElement]],Ae)}function Gr(){return this}G.prototype=mt.prototype={constructor:G,select:xn,selectAll:En,selectChild:zn,selectChildren:Ln,filter:$n,data:Xn,enter:kn,exit:Yn,join:qn,merge:Vn,selection:Gr,order:Hn,sort:Un,call:Bn,nodes:Gn,node:Zn,size:Qn,empty:Jn,each:Wn,attr:or,style:ur,property:pr,classed:mr,text:vr,html:Tr,raise:Nr,lower:Mr,append:Ar,insert:Lr,remove:kr,clone:Pr,datum:Or,on:Vr,dispatch:Kr,[Symbol.iterator]:Br};function U(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],Ae)}function Zr(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ct(t,e){if(t=Zr(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var Qr={value:()=>{}};function jt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Lt(n)}function Lt(t){this._=t}function Jr(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Lt.prototype=jt.prototype={constructor:Lt,on:function(t,e){var n=this._,r=Jr(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Wr(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Ie(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Ie(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Lt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Wr(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Ie(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Qr,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const te={capture:!0,passive:!1};function ee(t){t.preventDefault(),t.stopImmediatePropagation()}function jr(t){var e=t.document.documentElement,n=U(t).on("dragstart.drag",ee,te);"onselectstart"in e?n.on("selectstart.drag",ee,te):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function ti(t,e){var n=t.document.documentElement,r=U(t).on("dragstart.drag",null);e&&(r.on("click.drag",ee,te),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 ne(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Le(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function yt(){}var wt=.7,$t=1/wt,_t="\\s*([+-]?\\d+)\\s*",xt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ei=/^#([0-9a-f]{3,8})$/,ni=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),ri=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),ii=new RegExp(`^rgba\\(${_t},${_t},${_t},${xt}\\)$`),oi=new RegExp(`^rgba\\(${tt},${tt},${tt},${xt}\\)$`),ai=new RegExp(`^hsl\\(${xt},${tt},${tt}\\)$`),si=new RegExp(`^hsla\\(${xt},${tt},${tt},${xt}\\)$`),$e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ne(yt,vt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ke,formatHex:ke,formatHex8:ci,formatHsl:ui,formatRgb:De,toString:De});function ke(){return this.rgb().formatHex()}function ci(){return this.rgb().formatHex8()}function ui(){return Fe(this).formatHsl()}function De(){return this.rgb().formatRgb()}function vt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ei.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Re(e):n===3?new K(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?kt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?kt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ni.exec(t))?new K(e[1],e[2],e[3],1):(e=ri.exec(t))?new K(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ii.exec(t))?kt(e[1],e[2],e[3],e[4]):(e=oi.exec(t))?kt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ai.exec(t))?Xe(e[1],e[2]/100,e[3]/100,1):(e=si.exec(t))?Xe(e[1],e[2]/100,e[3]/100,e[4]):$e.hasOwnProperty(t)?Re($e[t]):t==="transparent"?new K(NaN,NaN,NaN,0):null}function Re(t){return new K(t>>16&255,t>>8&255,t&255,1)}function kt(t,e,n,r){return r<=0&&(t=e=n=NaN),new K(t,e,n,r)}function li(t){return t instanceof yt||(t=vt(t)),t?(t=t.rgb(),new K(t.r,t.g,t.b,t.opacity)):new K}function re(t,e,n,r){return arguments.length===1?li(t):new K(t,e,n,r==null?1:r)}function K(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ne(K,re,Le(yt,{brighter(t){return t=t==null?$t:Math.pow($t,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?wt:Math.pow(wt,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new K(lt(this.r),lt(this.g),lt(this.b),Dt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pe,formatHex:Pe,formatHex8:fi,formatRgb:Oe,toString:Oe}));function Pe(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}`}function fi(){return`#${ft(this.r)}${ft(this.g)}${ft(this.b)}${ft((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oe(){const t=Dt(this.opacity);return`${t===1?"rgb(":"rgba("}${lt(this.r)}, ${lt(this.g)}, ${lt(this.b)}${t===1?")":`, ${t})`}`}function Dt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function lt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ft(t){return t=lt(t),(t<16?"0":"")+t.toString(16)}function Xe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new W(t,e,n,r)}function Fe(t){if(t instanceof W)return new W(t.h,t.s,t.l,t.opacity);if(t instanceof yt||(t=vt(t)),!t)return new W;if(t instanceof W)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-e)/s+2:o=(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new W(o,s,l,t.opacity)}function hi(t,e,n,r){return arguments.length===1?Fe(t):new W(t,e,n,r==null?1:r)}function W(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ne(W,hi,Le(yt,{brighter(t){return t=t==null?$t:Math.pow($t,t),new W(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?wt:Math.pow(wt,t),new W(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new K(ie(t>=240?t-240:t+120,i,r),ie(t,i,r),ie(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new W(Ye(this.h),Rt(this.s),Rt(this.l),Dt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Dt(this.opacity);return`${t===1?"hsl(":"hsla("}${Ye(this.h)}, ${Rt(this.s)*100}%, ${Rt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ye(t){return t=(t||0)%360,t<0?t+360:t}function Rt(t){return Math.max(0,Math.min(1,t||0))}function ie(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const qe=t=>()=>t;function pi(t,e){return function(n){return t+n*e}}function di(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function _i(t){return(t=+t)==1?Ve:function(e,n){return n-e?di(e,n,t):qe(isNaN(e)?n:e)}}function Ve(t,e){var n=e-t;return n?pi(t,n):qe(isNaN(t)?e:t)}const He=function t(e){var n=_i(e);function r(i,a){var o=n((i=re(i)).r,(a=re(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),f=Ve(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=f(c),i+""}}return r.gamma=t,r}(1);function ut(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ae=new RegExp(oe.source,"g");function gi(t){return function(){return t}}function mi(t){return function(e){return t(e)+""}}function yi(t,e){var n=oe.lastIndex=ae.lastIndex=0,r,i,a,o=-1,s=[],l=[];for(t=t+"",e=e+"";(r=oe.exec(t))&&(i=ae.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:ut(r,i)})),n=ae.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?mi(l[0].x):gi(e):(e=l.length,function(f){for(var c=0,p;c<e;++c)s[(p=l[c]).i]=p.x(f);return s.join("")})}var Ue=180/Math.PI,se={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ke(t,e,n,r,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Ue,skewX:Math.atan(l)*Ue,scaleX:o,scaleY:s}}var Pt;function wi(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?se:Ke(e.a,e.b,e.c,e.d,e.e,e.f)}function xi(t){return t==null||(Pt||(Pt=document.createElementNS("http://www.w3.org/2000/svg","g")),Pt.setAttribute("transform",t),!(t=Pt.transform.baseVal.consolidate()))?se:(t=t.matrix,Ke(t.a,t.b,t.c,t.d,t.e,t.f))}function Be(t,e,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,c,p,_,m,C){if(f!==p||c!==_){var v=m.push("translate(",null,e,null,n);C.push({i:v-4,x:ut(f,p)},{i:v-2,x:ut(c,_)})}else(p||_)&&m.push("translate("+p+e+_+n)}function o(f,c,p,_){f!==c?(f-c>180?c+=360:c-f>180&&(f+=360),_.push({i:p.push(i(p)+"rotate(",null,r)-2,x:ut(f,c)})):c&&p.push(i(p)+"rotate("+c+r)}function s(f,c,p,_){f!==c?_.push({i:p.push(i(p)+"skewX(",null,r)-2,x:ut(f,c)}):c&&p.push(i(p)+"skewX("+c+r)}function l(f,c,p,_,m,C){if(f!==p||c!==_){var v=m.push(i(m)+"scale(",null,",",null,")");C.push({i:v-4,x:ut(f,p)},{i:v-2,x:ut(c,_)})}else(p!==1||_!==1)&&m.push(i(m)+"scale("+p+","+_+")")}return function(f,c){var p=[],_=[];return f=t(f),c=t(c),a(f.translateX,f.translateY,c.translateX,c.translateY,p,_),o(f.rotate,c.rotate,p,_),s(f.skewX,c.skewX,p,_),l(f.scaleX,f.scaleY,c.scaleX,c.scaleY,p,_),f=c=null,function(m){for(var C=-1,v=_.length,N;++C<v;)p[(N=_[C]).i]=N.x(m);return p.join("")}}}var vi=Be(wi,"px, ","px)","deg)"),Si=Be(xi,", ",")",")"),bi=1e-12;function Ge(t){return((t=Math.exp(t))+1/t)/2}function Ei(t){return((t=Math.exp(t))-1/t)/2}function Ti(t){return((t=Math.exp(2*t))-1)/(t+1)}const Ci=function t(e,n,r){function i(a,o){var s=a[0],l=a[1],f=a[2],c=o[0],p=o[1],_=o[2],m=c-s,C=p-l,v=m*m+C*C,N,y;if(v<bi)y=Math.log(_/f)/e,N=function(I){return[s+I*m,l+I*C,f*Math.exp(e*I*y)]};else{var z=Math.sqrt(v),k=(_*_-f*f+r*v)/(2*f*n*z),X=(_*_-f*f-r*v)/(2*_*n*z),Y=Math.log(Math.sqrt(k*k+1)-k),O=Math.log(Math.sqrt(X*X+1)-X);y=(O-Y)/e,N=function(I){var L=I*y,D=Ge(Y),Q=f/(n*z)*(D*Ti(e*L+Y)-Ei(Y));return[s+Q*m,l+Q*C,f*D/Ge(e*L+Y)]}}return N.duration=y*1e3*e/Math.SQRT2,N}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,l=s*s;return t(o,s,l)},i}(Math.SQRT2,2,4);var gt=0,St=0,bt=0,Ze=1e3,Ot,Et,Xt=0,ht=0,Ft=0,Tt=typeof performance=="object"&&performance.now?performance:Date,Qe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ce(){return ht||(Qe(Ni),ht=Tt.now()+Ft)}function Ni(){ht=0}function Yt(){this._call=this._time=this._next=null}Yt.prototype=Je.prototype={constructor:Yt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ce():+n)+(e==null?0:+e),!this._next&&Et!==this&&(Et?Et._next=this:Ot=this,Et=this),this._call=t,this._time=n,ue()},stop:function(){this._call&&(this._call=null,this._time=1/0,ue())}};function Je(t,e,n){var r=new Yt;return r.restart(t,e,n),r}function zi(){ce(),++gt;for(var t=Ot,e;t;)(e=ht-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gt}function We(){ht=(Xt=Tt.now())+Ft,gt=St=0;try{zi()}finally{gt=0,Ai(),ht=0}}function Mi(){var t=Tt.now(),e=t-Xt;e>Ze&&(Ft-=e,Xt=t)}function Ai(){for(var t,e=Ot,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ot=n);Et=t,ue(r)}function ue(t){if(!gt){St&&(St=clearTimeout(St));var e=t-ht;e>24?(t<1/0&&(St=setTimeout(We,t-Tt.now()-Ft)),bt&&(bt=clearInterval(bt))):(bt||(Xt=Tt.now(),bt=setInterval(Mi,Ze)),gt=1,Qe(We))}}function je(t,e,n){var r=new Yt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Ii=jt("start","end","cancel","interrupt"),Li=[],tn=0,en=1,le=2,qt=3,nn=4,fe=5,Vt=6;function Ht(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;$i(t,n,{name:e,index:r,group:i,on:Ii,tween:Li,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:tn})}function he(t,e){var n=j(t,e);if(n.state>tn)throw new Error("too late; already scheduled");return n}function et(t,e){var n=j(t,e);if(n.state>qt)throw new Error("too late; already running");return n}function j(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function $i(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Je(a,0,n.time);function a(f){n.state=en,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var c,p,_,m;if(n.state!==en)return l();for(c in r)if(m=r[c],m.name===n.name){if(m.state===qt)return je(o);m.state===nn?(m.state=Vt,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete r[c]):+c<e&&(m.state=Vt,m.timer.stop(),m.on.call("cancel",t,t.__data__,m.index,m.group),delete r[c])}if(je(function(){n.state===qt&&(n.state=nn,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=le,n.on.call("start",t,t.__data__,n.index,n.group),n.state===le){for(n.state=qt,i=new Array(_=n.tween.length),c=0,p=-1;c<_;++c)(m=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=m);i.length=p+1}}function s(f){for(var c=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(l),n.state=fe,1),p=-1,_=i.length;++p<_;)i[p].call(t,c);n.state===fe&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=Vt,n.timer.stop(),delete r[e];for(var f in r)return;delete t.__transition}}function Ut(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>le&&r.state<fe,r.state=Vt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function ki(t){return this.each(function(){Ut(this,t)})}function Di(t,e){var n,r;return function(){var i=et(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ri(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=et(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},l=0,f=i.length;l<f;++l)if(i[l].name===e){i[l]=s;break}l===f&&i.push(s)}a.tween=i}}function Pi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=j(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Di:Ri)(n,t,e))}function pe(t,e,n){var r=t._id;return t.each(function(){var i=et(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return j(i,r).value[e]}}function rn(t,e){var n;return(typeof e=="number"?ut:e instanceof vt?He:(n=vt(e))?(e=n,He):yi)(t,e)}function Oi(t){return function(){this.removeAttribute(t)}}function Xi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fi(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Yi(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function qi(t,e,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s)))}}function Vi(t,e,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s)))}}function Hi(t,e){var n=At(t),r=n==="transform"?Si:rn;return this.attrTween(t,typeof e=="function"?(n.local?Vi:qi)(n,r,pe(this,"attr."+t,e)):e==null?(n.local?Xi:Oi)(n):(n.local?Yi:Fi)(n,r,e))}function Ui(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ki(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Bi(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ki(t,a)),n}return i._value=e,i}function Gi(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ui(t,a)),n}return i._value=e,i}function Zi(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=At(t);return this.tween(n,(r.local?Bi:Gi)(r,e))}function Qi(t,e){return function(){he(this,t).delay=+e.apply(this,arguments)}}function Ji(t,e){return e=+e,function(){he(this,t).delay=e}}function Wi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Qi:Ji)(e,t)):j(this.node(),e).delay}function ji(t,e){return function(){et(this,t).duration=+e.apply(this,arguments)}}function to(t,e){return e=+e,function(){et(this,t).duration=e}}function eo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ji:to)(e,t)):j(this.node(),e).duration}function no(t,e){if(typeof e!="function")throw new Error;return function(){et(this,t).ease=e}}function ro(t){var e=this._id;return arguments.length?this.each(no(e,t)):j(this.node(),e).ease}function io(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,t).ease=n}}function oo(t){if(typeof t!="function")throw new Error;return this.each(io(this._id,t))}function ao(t){typeof t!="function"&&(t=ve(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,s=r[i]=[],l,f=0;f<o;++f)(l=a[f])&&t.call(l,l.__data__,f,a)&&s.push(l);return new it(r,this._parents,this._name,this._id)}function so(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var l=e[s],f=n[s],c=l.length,p=o[s]=new Array(c),_,m=0;m<c;++m)(_=l[m]||f[m])&&(p[m]=_);for(;s<r;++s)o[s]=e[s];return new it(o,this._parents,this._name,this._id)}function co(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function uo(t,e,n){var r,i,a=co(e)?he:et;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}function lo(t,e){var n=this._id;return arguments.length<2?j(this.node(),n).on.on(t):this.each(uo(n,t,e))}function fo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ho(){return this.on("end.remove",fo(this._id))}function po(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jt(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s=r[o],l=s.length,f=a[o]=new Array(l),c,p,_=0;_<l;++_)(c=s[_])&&(p=t.call(c,c.__data__,_,s))&&("__data__"in c&&(p.__data__=c.__data__),f[_]=p,Ht(f[_],e,n,_,f,j(c,n)));return new it(a,this._parents,e,n)}function _o(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xe(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l=r[s],f=l.length,c,p=0;p<f;++p)if(c=l[p]){for(var _=t.call(c,c.__data__,p,l),m,C=j(c,n),v=0,N=_.length;v<N;++v)(m=_[v])&&Ht(m,e,n,v,_,C);a.push(_),o.push(c)}return new it(a,o,e,n)}var go=mt.prototype.constructor;function mo(){return new go(this._groups,this._parents)}function yo(t,e){var n,r,i;return function(){var a=dt(this,t),o=(this.style.removeProperty(t),dt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function on(t){return function(){this.style.removeProperty(t)}}function wo(t,e,n){var r,i=n+"",a;return function(){var o=dt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function xo(t,e,n){var r,i,a;return function(){var o=dt(this,t),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),dt(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s))}}function vo(t,e){var n,r,i,a="style."+e,o="end."+a,s;return function(){var l=et(this,t),f=l.on,c=l.value[a]==null?s||(s=on(e)):void 0;(f!==n||i!==c)&&(r=(n=f).copy()).on(o,i=c),l.on=r}}function So(t,e,n){var r=(t+="")=="transform"?vi:rn;return e==null?this.styleTween(t,yo(t,r)).on("end.style."+t,on(t)):typeof e=="function"?this.styleTween(t,xo(t,r,pe(this,"style."+t,e))).each(vo(this._id,t)):this.styleTween(t,wo(t,r,e),n).on("end.style."+t,null)}function bo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Eo(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&bo(t,o,n)),r}return a._value=e,a}function To(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Eo(t,e,n==null?"":n))}function Co(t){return function(){this.textContent=t}}function No(t){return function(){var e=t(this);this.textContent=e==null?"":e}}function zo(t){return this.tween("text",typeof t=="function"?No(pe(this,"text",t)):Co(t==null?"":t+""))}function Mo(t){return function(e){this.textContent=t.call(this,e)}}function Ao(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Mo(i)),e}return r._value=t,r}function Io(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Ao(t))}function Lo(){for(var t=this._name,e=this._id,n=an(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,f=0;f<s;++f)if(l=o[f]){var c=j(l,e);Ht(l,t,n,f,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new it(r,this._parents,t,n)}function $o(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var f=et(this,r),c=f.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),f.on=e}),i===0&&a()})}var ko=0;function it(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function an(){return++ko}var ot=mt.prototype;it.prototype={constructor:it,select:po,selectAll:_o,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:ao,merge:so,selection:mo,transition:Lo,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:lo,attr:Hi,attrTween:Zi,style:So,styleTween:To,text:zo,textTween:Io,remove:ho,tween:Pi,delay:Wi,duration:eo,ease:ro,easeVarying:oo,end:$o,[Symbol.iterator]:ot[Symbol.iterator]};function Do(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ro={time:null,delay:0,duration:250,ease:Do};function Po(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Oo(t){var e,n;t instanceof it?(e=t._id,t=t._name):(e=an(),(n=Ro).time=ce(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,f=0;f<s;++f)(l=o[f])&&Ht(l,t,e,f,o,n||Po(l,e));return new it(r,this._parents,t,e)}mt.prototype.interrupt=ki,mt.prototype.transition=Oo;const Kt=t=>()=>t;function Xo(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function at(t,e,n){this.k=t,this.x=e,this.y=n}at.prototype={constructor:at,scale:function(t){return t===1?this:new at(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new at(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ct=new at(1,0,0);at.prototype;function de(t){t.stopImmediatePropagation()}function Nt(t){t.preventDefault(),t.stopImmediatePropagation()}function Fo(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Yo(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function sn(){return this.__zoom||Ct}function qo(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Vo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ho(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function cn(){var t=Fo,e=Yo,n=Ho,r=qo,i=Vo,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Ci,f=jt("start","zoom","end"),c,p,_,m=500,C=150,v=0,N=10;function y(u){u.property("__zoom",sn).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",Q).filter(i).on("touchstart.zoom",nt).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(u,d,h,g){var w=u.selection?u.selection():u;w.property("__zoom",sn),u!==w?Y(u,d,h,g):w.interrupt().each(function(){O(this,arguments).event(g).start().zoom(null,typeof d=="function"?d.apply(this,arguments):d).end()})},y.scaleBy=function(u,d,h,g){y.scaleTo(u,function(){var w=this.__zoom.k,x=typeof d=="function"?d.apply(this,arguments):d;return w*x},h,g)},y.scaleTo=function(u,d,h,g){y.transform(u,function(){var w=e.apply(this,arguments),x=this.__zoom,S=h==null?X(w):typeof h=="function"?h.apply(this,arguments):h,T=x.invert(S),b=typeof d=="function"?d.apply(this,arguments):d;return n(k(z(x,b),S,T),w,o)},h,g)},y.translateBy=function(u,d,h,g){y.transform(u,function(){return n(this.__zoom.translate(typeof d=="function"?d.apply(this,arguments):d,typeof h=="function"?h.apply(this,arguments):h),e.apply(this,arguments),o)},null,g)},y.translateTo=function(u,d,h,g,w){y.transform(u,function(){var x=e.apply(this,arguments),S=this.__zoom,T=g==null?X(x):typeof g=="function"?g.apply(this,arguments):g;return n(Ct.translate(T[0],T[1]).scale(S.k).translate(typeof d=="function"?-d.apply(this,arguments):-d,typeof h=="function"?-h.apply(this,arguments):-h),x,o)},g,w)};function z(u,d){return d=Math.max(a[0],Math.min(a[1],d)),d===u.k?u:new at(d,u.x,u.y)}function k(u,d,h){var g=d[0]-h[0]*u.k,w=d[1]-h[1]*u.k;return g===u.x&&w===u.y?u:new at(u.k,g,w)}function X(u){return[(+u[0][0]+ +u[1][0])/2,(+u[0][1]+ +u[1][1])/2]}function Y(u,d,h,g){u.on("start.zoom",function(){O(this,arguments).event(g).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(g).end()}).tween("zoom",function(){var w=this,x=arguments,S=O(w,x).event(g),T=e.apply(w,x),b=h==null?X(T):typeof h=="function"?h.apply(w,x):h,P=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),R=w.__zoom,F=typeof d=="function"?d.apply(w,x):d,V=l(R.invert(b).concat(P/R.k),F.invert(b).concat(P/F.k));return function(H){if(H===1)H=F;else{var B=V(H),rt=P/B[2];H=new at(rt,b[0]-B[0]*rt,b[1]-B[1]*rt)}S.zoom(null,H)}})}function O(u,d,h){return!h&&u.__zooming||new I(u,d)}function I(u,d){this.that=u,this.args=d,this.active=0,this.sourceEvent=null,this.extent=e.apply(u,d),this.taps=0}I.prototype={event:function(u){return u&&(this.sourceEvent=u),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(u,d){return this.mouse&&u!=="mouse"&&(this.mouse[1]=d.invert(this.mouse[0])),this.touch0&&u!=="touch"&&(this.touch0[1]=d.invert(this.touch0[0])),this.touch1&&u!=="touch"&&(this.touch1[1]=d.invert(this.touch1[0])),this.that.__zoom=d,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(u){var d=U(this.that).datum();f.call(u,this.that,new Xo(u,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:f}),d)}};function L(u,...d){if(!t.apply(this,arguments))return;var h=O(this,d).event(u),g=this.__zoom,w=Math.max(a[0],Math.min(a[1],g.k*Math.pow(2,r.apply(this,arguments)))),x=ct(u);if(h.wheel)(h.mouse[0][0]!==x[0]||h.mouse[0][1]!==x[1])&&(h.mouse[1]=g.invert(h.mouse[0]=x)),clearTimeout(h.wheel);else{if(g.k===w)return;h.mouse=[x,g.invert(x)],Ut(this),h.start()}Nt(u),h.wheel=setTimeout(S,C),h.zoom("mouse",n(k(z(g,w),h.mouse[0],h.mouse[1]),h.extent,o));function S(){h.wheel=null,h.end()}}function D(u,...d){if(_||!t.apply(this,arguments))return;var h=u.currentTarget,g=O(this,d,!0).event(u),w=U(u.view).on("mousemove.zoom",b,!0).on("mouseup.zoom",P,!0),x=ct(u,h),S=u.clientX,T=u.clientY;jr(u.view),de(u),g.mouse=[x,this.__zoom.invert(x)],Ut(this),g.start();function b(R){if(Nt(R),!g.moved){var F=R.clientX-S,V=R.clientY-T;g.moved=F*F+V*V>v}g.event(R).zoom("mouse",n(k(g.that.__zoom,g.mouse[0]=ct(R,h),g.mouse[1]),g.extent,o))}function P(R){w.on("mousemove.zoom mouseup.zoom",null),ti(R.view,g.moved),Nt(R),g.event(R).end()}}function Q(u,...d){if(t.apply(this,arguments)){var h=this.__zoom,g=ct(u.changedTouches?u.changedTouches[0]:u,this),w=h.invert(g),x=h.k*(u.shiftKey?.5:2),S=n(k(z(h,x),g,w),e.apply(this,d),o);Nt(u),s>0?U(this).transition().duration(s).call(Y,S,g,u):U(this).call(y.transform,S,g,u)}}function nt(u,...d){if(t.apply(this,arguments)){var h=u.touches,g=h.length,w=O(this,d,u.changedTouches.length===g).event(u),x,S,T,b;for(de(u),S=0;S<g;++S)T=h[S],b=ct(T,this),b=[b,this.__zoom.invert(b),T.identifier],w.touch0?!w.touch1&&w.touch0[2]!==b[2]&&(w.touch1=b,w.taps=0):(w.touch0=b,x=!0,w.taps=1+!!c);c&&(c=clearTimeout(c)),x&&(w.taps<2&&(p=b[0],c=setTimeout(function(){c=null},m)),Ut(this),w.start())}}function E(u,...d){if(this.__zooming){var h=O(this,d).event(u),g=u.changedTouches,w=g.length,x,S,T,b;for(Nt(u),x=0;x<w;++x)S=g[x],T=ct(S,this),h.touch0&&h.touch0[2]===S.identifier?h.touch0[0]=T:h.touch1&&h.touch1[2]===S.identifier&&(h.touch1[0]=T);if(S=h.that.__zoom,h.touch1){var P=h.touch0[0],R=h.touch0[1],F=h.touch1[0],V=h.touch1[1],H=(H=F[0]-P[0])*H+(H=F[1]-P[1])*H,B=(B=V[0]-R[0])*B+(B=V[1]-R[1])*B;S=z(S,Math.sqrt(H/B)),T=[(P[0]+F[0])/2,(P[1]+F[1])/2],b=[(R[0]+V[0])/2,(R[1]+V[1])/2]}else if(h.touch0)T=h.touch0[0],b=h.touch0[1];else return;h.zoom("touch",n(k(S,T,b),h.extent,o))}}function $(u,...d){if(this.__zooming){var h=O(this,d).event(u),g=u.changedTouches,w=g.length,x,S;for(de(u),_&&clearTimeout(_),_=setTimeout(function(){_=null},m),x=0;x<w;++x)S=g[x],h.touch0&&h.touch0[2]===S.identifier?delete h.touch0:h.touch1&&h.touch1[2]===S.identifier&&delete h.touch1;if(h.touch1&&!h.touch0&&(h.touch0=h.touch1,delete h.touch1),h.touch0)h.touch0[1]=this.__zoom.invert(h.touch0[0]);else if(h.end(),h.taps===2&&(S=ct(S,this),Math.hypot(p[0]-S[0],p[1]-S[1])<N)){var T=U(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return y.wheelDelta=function(u){return arguments.length?(r=typeof u=="function"?u:Kt(+u),y):r},y.filter=function(u){return arguments.length?(t=typeof u=="function"?u:Kt(!!u),y):t},y.touchable=function(u){return arguments.length?(i=typeof u=="function"?u:Kt(!!u),y):i},y.extent=function(u){return arguments.length?(e=typeof u=="function"?u:Kt([[+u[0][0],+u[0][1]],[+u[1][0],+u[1][1]]]),y):e},y.scaleExtent=function(u){return arguments.length?(a[0]=+u[0],a[1]=+u[1],y):[a[0],a[1]]},y.translateExtent=function(u){return arguments.length?(o[0][0]=+u[0][0],o[1][0]=+u[1][0],o[0][1]=+u[0][1],o[1][1]=+u[1][1],y):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},y.constrain=function(u){return arguments.length?(n=u,y):n},y.duration=function(u){return arguments.length?(s=+u,y):s},y.interpolate=function(u){return arguments.length?(l=u,y):l},y.on=function(){var u=f.on.apply(f,arguments);return u===f?y:u},y.clickDistance=function(u){return arguments.length?(v=(u=+u)*u,y):Math.sqrt(v)},y.tapDistance=function(u){return arguments.length?(N=+u,y):N},y}const q={DEFAULT_MIN_ZOOM:.1,DEFAULT_MAX_ZOOM:4,FIT_TO_VIEW_MAX_ZOOM:1,INITIAL_POSITION_X:0,INITIAL_POSITION_Y:0,SCROLL_POS_RATIO:3,DEFAULT_LAYOUT:1e6,INITIAL_SCROLLBAR_SIZE:50,MIN_SCROLLBAR_SIZE:15,SCROLL_DELTA_DIFF:1.5},zt={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center"},Z={...zt,TOP_CENTER:"top-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_RIGHT:"center-right",CENTER_CENTER:"center-center"},st={BLOCK_EVENTS:"react-infinite-canvas-block-events",BLOCK_SCROLL_CLASS:"react-infinite-canvas-block-scroll",BLOCK_ZOOM_CLASS:"react-infinite-canvas-block-zoom",BLOCK_PAN_CLASS:"react-infinite-canvas-block-pan"},Mt=({value:t,min:e=0,max:n})=>Math.min(Math.max(t,e),n),Uo=({position:t,svgBounds:e,nodeBounds:n,currentTranslateX:r,currentTranslateY:i,currentScale:a,updatedScale:o,customOffset:s})=>{let[l,f,c]=[0,0,1];switch(o!==a&&(c=o/a,r*=c,i*=c),t){case Z.TOP_LEFT:return{updatedX:r+((e.x-n.x)*c+s.x),updatedY:i+((e.y-n.y)*c+s.y)