@reactflow/background
Version:
Background component with different variants for React Flow
10 lines • 137 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFlowBackground={},e.React)}(this,(function(e,t){"use strict";function n(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let o,r=0;r<e.length;r++)""!==(o=n(e[r]))&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r,i,a,s={},l={},c={},u={get exports(){return c},set exports(e){c=e}},d={};function h(){return i||(i=1,function(e){e.exports=function(){if(r)return d;r=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!n(e,o)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return a((function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})}),[e,n,t]),i((function(){return l(c)&&u({inst:c}),e((function(){l(c)&&u({inst:c})}))}),[e]),s(n),n};return d.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,d}()}(u)),c}
/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/!function(e){e.exports=function(){if(a)return l;a=1;var e=t,n=h(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,c=e.useMemo,u=e.useDebugValue;return l.useSyncExternalStoreWithSelector=function(e,t,n,a,l){var d=i(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c((function(){function e(e){if(!s){if(s=!0,r=e,e=a(e),void 0!==l&&h.hasValue){var t=h.value;if(l(t,e))return i=t}return i=e}if(t=i,o(r,e))return t;var n=a(e);return void 0!==l&&l(t,n)?t:(r=e,i=n)}var r,i,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,a,l]);var f=r(e,d[0],d[1]);return s((function(){h.hasValue=!0,h.value=f}),[f]),u(f),f},l}()}({get exports(){return s},set exports(e){s=e}});var f=o(s);const g=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r)?r:Object.assign({},t,r),n.forEach((n=>n(t,e)))}},r=()=>t,i={setState:o,getState:r,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(o,r,i),i},{useSyncExternalStoreWithSelector:p}=f;function m(e,n=e.getState,o){const r=p(e.subscribe,e.getState,e.getServerState||e.getState,n,o);return t.useDebugValue(r),r}const y=(e,t)=>{const n=(e=>e?g(e):g)(e),o=(e,o=t)=>m(n,e,o);return Object.assign(o,n),o};function v(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}var b={value:()=>{}};function x(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new w(o)}function w(e){this._=e}function S(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function E(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function _(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=b,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}w.prototype=x.prototype={constructor:w,on:function(e,t){var n,o=this._,r=S(e+"",o),i=-1,a=r.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<a;)if(n=(e=r[i]).type)o[n]=_(o[n],e.name,t);else if(null==t)for(n in o)o[n]=_(o[n],e.name,null);return this}for(;++i<a;)if((n=(e=r[i]).type)&&(n=E(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new w(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(o=this._[e]).length;i<n;++i)o[i].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};var C="http://www.w3.org/1999/xhtml",M={svg:"http://www.w3.org/2000/svg",xhtml:C,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function N(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),M.hasOwnProperty(t)?{space:M[t],local:e}:e}function k(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===C&&t.documentElement.namespaceURI===C?t.createElement(e):t.createElementNS(n,e)}}function P(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function A(e){var t=N(e);return(t.local?P:k)(t)}function O(){}function I(e){return null==e?O:function(){return this.querySelector(e)}}function D(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function R(){return[]}function z(e){return null==e?R:function(){return this.querySelectorAll(e)}}function $(e){return function(){return this.matches(e)}}function B(e){return function(t){return t.matches(e)}}var T=Array.prototype.find;function L(){return this.firstElementChild}var X=Array.prototype.filter;function Y(){return Array.from(this.children)}function H(e){return new Array(e.length)}function V(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function K(e){return function(){return e}}function F(e,t,n,o,r,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new V(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Z(e,t,n,o,r,i,a){var s,l,c,u=new Map,d=t.length,h=i.length,f=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(f[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<h;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(o[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new V(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(f[s])===l&&(r[s]=l)}function j(e){return e.__data__}function W(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function q(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function U(e){return function(){this.removeAttribute(e)}}function G(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q(e,t){return function(){this.setAttribute(e,t)}}function J(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ee(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function te(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ne(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function oe(e){return function(){this.style.removeProperty(e)}}function re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ie(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ae(e,t){return e.style.getPropertyValue(t)||ne(e).getComputedStyle(e,null).getPropertyValue(t)}function se(e){return function(){delete this[e]}}function le(e,t){return function(){this[e]=t}}function ce(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ue(e){return e.trim().split(/^|\s+/)}function de(e){return e.classList||new he(e)}function he(e){this._node=e,this._names=ue(e.getAttribute("class")||"")}function fe(e,t){for(var n=de(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ge(e,t){for(var n=de(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function pe(e){return function(){fe(this,e)}}function me(e){return function(){ge(this,e)}}function ye(e,t){return function(){(t.apply(this,arguments)?fe:ge)(this,e)}}function ve(){this.textContent=""}function be(e){return function(){this.textContent=e}}function xe(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function we(){this.innerHTML=""}function Se(e){return function(){this.innerHTML=e}}function Ee(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function _e(){this.nextSibling&&this.parentNode.appendChild(this)}function Ce(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Me(){return null}function Ne(){var e=this.parentNode;e&&e.removeChild(this)}function ke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ae(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function Oe(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,i=t.length;o<i;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function Ie(e,t,n){return function(){var o,r=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=t);this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function De(e,t,n){var o=ne(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Re(e,t){return function(){return De(this,e,t)}}function ze(e,t){return function(){return De(this,e,t.apply(this,arguments))}}V.prototype={constructor:V,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},he.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var $e=[null];function Be(e,t){this._groups=e,this._parents=t}function Te(){return new Be([[document.documentElement]],$e)}function Le(e){return"string"==typeof e?new Be([[document.querySelector(e)]],[document.documentElement]):new Be([[e]],$e)}function Xe(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}Be.prototype=Te.prototype={constructor:Be,select:function(e){"function"!=typeof e&&(e=I(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new Be(o,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return D(e.apply(this,arguments))}}(e):z(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(o.push(e.call(a,a.__data__,c,s)),r.push(a));return new Be(o,r)},selectChild:function(e){return this.select(null==e?L:function(e){return function(){return T.call(this.children,e)}}("function"==typeof e?e:B(e)))},selectChildren:function(e){return this.selectAll(null==e?Y:function(e){return function(){return X.call(this.children,e)}}("function"==typeof e?e:B(e)))},filter:function(e){"function"!=typeof e&&(e=$(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Be(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,j);var n=t?Z:F,o=this._parents,r=this._groups;"function"!=typeof e&&(e=K(e));for(var i=r.length,a=new Array(i),s=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],h=d.length,f=W(e.call(u,u&&u.__data__,c,o)),g=f.length,p=s[c]=new Array(g),m=a[c]=new Array(g),y=l[c]=new Array(h);n(u,d,p,m,y,f,t);for(var v,b,x=0,w=0;x<g;++x)if(v=p[x]){for(x>=w&&(w=x+1);!(b=m[w])&&++w<g;);v._next=b||null}}return(a=new Be(a,o))._enter=s,a._exit=l,a},enter:function(){return new Be(this._enter||this._groups.map(H),this._parents)},exit:function(){return new Be(this._exit||this._groups.map(H),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),l=0;l<a;++l)for(var c,u=n[l],d=o[l],h=u.length,f=s[l]=new Array(h),g=0;g<h;++g)(c=u[g]||d[g])&&(f[g]=c);for(;l<r;++l)s[l]=n[l];return new Be(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=q);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new Be(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,i=t[n],a=0,s=i.length;a<s;++a)(r=i[a])&&e.call(r,r.__data__,a,i);return this},attr:function(e,t){var n=N(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?G:U:"function"==typeof t?n.local?te:ee:n.local?J:Q)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?oe:"function"==typeof t?ie:re)(e,t,null==n?"":n)):ae(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?se:"function"==typeof t?ce:le)(e,t)):this.node()[e]},classed:function(e,t){var n=ue(e+"");if(arguments.length<2){for(var o=de(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?ye:t?pe:me)(n,t))},text:function(e){return arguments.length?this.each(null==e?ve:("function"==typeof e?xe:be)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?we:("function"==typeof e?Ee:Se)(e)):this.node().innerHTML},raise:function(){return this.each(_e)},lower:function(){return this.each(Ce)},append:function(e){var t="function"==typeof e?e:A(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:A(e),o=null==t?Me:"function"==typeof t?t:I(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(Ne)},clone:function(e){return this.select(e?Pe:ke)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,i=Ae(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?Ie:Oe,o=0;o<a;++o)this.each(s(i[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<a;++o)if((r=i[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?ze:Re)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const Ye={passive:!1},He={capture:!0,passive:!1};function Ve(e){e.stopImmediatePropagation()}function Ke(e){e.preventDefault(),e.stopImmediatePropagation()}function Fe(e){var t=e.document.documentElement,n=Le(e).on("dragstart.drag",Ke,He);"onselectstart"in t?n.on("selectstart.drag",Ke,He):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ze(e,t){var n=e.document.documentElement,o=Le(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ke,He),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var je=e=>()=>e;function We(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function qe(e){return!e.ctrlKey&&!e.button}function Ue(){return this.parentNode}function Ge(e,t){return null==t?{x:e.x,y:e.y}:t}function Qe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Je(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function et(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function tt(){}We.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var nt=.7,ot=1/nt,rt="\\s*([+-]?\\d+)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",at="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",st=/^#([0-9a-f]{3,8})$/,lt=new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`),ct=new RegExp(`^rgb\\(${at},${at},${at}\\)$`),ut=new RegExp(`^rgba\\(${rt},${rt},${rt},${it}\\)$`),dt=new RegExp(`^rgba\\(${at},${at},${at},${it}\\)$`),ht=new RegExp(`^hsl\\(${it},${at},${at}\\)$`),ft=new RegExp(`^hsla\\(${it},${at},${at},${it}\\)$`),gt={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};function pt(){return this.rgb().formatHex()}function mt(){return this.rgb().formatRgb()}function yt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=st.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vt(t):3===n?new St(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?bt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?bt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=lt.exec(e))?new St(t[1],t[2],t[3],1):(t=ct.exec(e))?new St(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ut.exec(e))?bt(t[1],t[2],t[3],t[4]):(t=dt.exec(e))?bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ht.exec(e))?kt(t[1],t[2]/100,t[3]/100,1):(t=ft.exec(e))?kt(t[1],t[2]/100,t[3]/100,t[4]):gt.hasOwnProperty(e)?vt(gt[e]):"transparent"===e?new St(NaN,NaN,NaN,0):null}function vt(e){return new St(e>>16&255,e>>8&255,255&e,1)}function bt(e,t,n,o){return o<=0&&(e=t=n=NaN),new St(e,t,n,o)}function xt(e){return e instanceof tt||(e=yt(e)),e?new St((e=e.rgb()).r,e.g,e.b,e.opacity):new St}function wt(e,t,n,o){return 1===arguments.length?xt(e):new St(e,t,n,null==o?1:o)}function St(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Et(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}`}function _t(){const e=Ct(this.opacity);return`${1===e?"rgb(":"rgba("}${Mt(this.r)}, ${Mt(this.g)}, ${Mt(this.b)}${1===e?")":`, ${e})`}`}function Ct(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nt(e){return((e=Mt(e))<16?"0":"")+e.toString(16)}function kt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new At(e,t,n,o)}function Pt(e){if(e instanceof At)return new At(e.h,e.s,e.l,e.opacity);if(e instanceof tt||(e=yt(e)),!e)return new At;if(e instanceof At)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,s=i-r,l=(i+r)/2;return s?(a=t===i?(n-o)/s+6*(n<o):n===i?(o-t)/s+2:(t-n)/s+4,s/=l<.5?i+r:2-i-r,a*=60):s=l>0&&l<1?0:a,new At(a,s,l,e.opacity)}function At(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function Ot(e){return(e=(e||0)%360)<0?e+360:e}function It(e){return Math.max(0,Math.min(1,e||0))}function Dt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Je(tt,yt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pt,formatHex:pt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pt(this).formatHsl()},formatRgb:mt,toString:mt}),Je(St,wt,et(tt,{brighter(e){return e=null==e?ot:Math.pow(ot,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?nt:Math.pow(nt,e),new St(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new St(Mt(this.r),Mt(this.g),Mt(this.b),Ct(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:Et,formatHex:Et,formatHex8:function(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}${Nt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_t,toString:_t})),Je(At,(function(e,t,n,o){return 1===arguments.length?Pt(e):new At(e,t,n,null==o?1:o)}),et(tt,{brighter(e){return e=null==e?ot:Math.pow(ot,e),new At(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?nt:Math.pow(nt,e),new At(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new St(Dt(e>=240?e-240:e+120,r,o),Dt(e,r,o),Dt(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new At(Ot(this.h),It(this.s),It(this.l),Ct(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 e=Ct(this.opacity);return`${1===e?"hsl(":"hsla("}${Ot(this.h)}, ${100*It(this.s)}%, ${100*It(this.l)}%${1===e?")":`, ${e})`}`}}));var Rt=e=>()=>e;function zt(e){return 1==(e=+e)?$t:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Rt(isNaN(t)?n:t)}}function $t(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Rt(isNaN(e)?t:e)}var Bt=function e(t){var n=zt(t);function o(e,t){var o=n((e=wt(e)).r,(t=wt(t)).r),r=n(e.g,t.g),i=n(e.b,t.b),a=$t(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function Tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Lt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xt=new RegExp(Lt.source,"g");function Yt(e,t){var n,o,r,i=Lt.lastIndex=Xt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Lt.exec(e))&&(o=Xt.exec(t));)(r=o.index)>i&&(r=t.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Tt(n,o)})),i=Xt.lastIndex;return i<t.length&&(r=t.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var Ht,Vt=180/Math.PI,Kt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ft(e,t,n,o,r,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Vt,skewX:Math.atan(l)*Vt,scaleX:a,scaleY:s}}function Zt(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,o,r,i,a,s){if(e!==r||o!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:Tt(e,r)},{i:l-2,x:Tt(o,i)})}else(r||i)&&a.push("translate("+r+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Tt(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Tt(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(i.skewX,a.skewX,s,l),function(e,t,n,o,i,a){if(e!==n||t!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Tt(e,n)},{i:s-2,x:Tt(t,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var jt=Zt((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Kt:Ft(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),Wt=Zt((function(e){return null==e?Kt:(Ht||(Ht=document.createElementNS("http://www.w3.org/2000/svg","g")),Ht.setAttribute("transform",e),(e=Ht.transform.baseVal.consolidate())?Ft((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Kt)}),", ",")",")");function qt(e){return((e=Math.exp(e))+1/e)/2}var Ut,Gt,Qt=function e(t,n,o){function r(e,r){var i,a,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],h=r[2],f=u-s,g=d-l,p=f*f+g*g;if(p<1e-12)a=Math.log(h/c)/t,i=function(e){return[s+e*f,l+e*g,c*Math.exp(t*e*a)]};else{var m=Math.sqrt(p),y=(h*h-c*c+o*p)/(2*c*n*m),v=(h*h-c*c-o*p)/(2*h*n*m),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/t,i=function(e){var o,r=e*a,i=qt(b),u=c/(n*m)*(i*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*f,l+u*g,c*i/qt(t*r+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),Jt=0,en=0,tn=0,nn=0,on=0,rn=0,an="object"==typeof performance&&performance.now?performance:Date,sn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ln(){return on||(sn(cn),on=an.now()+rn)}function cn(){on=0}function un(){this._call=this._time=this._next=null}function dn(e,t,n){var o=new un;return o.restart(e,t,n),o}function hn(){on=(nn=an.now())+rn,Jt=en=0;try{!function(){ln(),++Jt;for(var e,t=Ut;t;)(e=on-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Jt}()}finally{Jt=0,function(){var e,t,n=Ut,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Ut=t);Gt=e,gn(o)}(),on=0}}function fn(){var e=an.now(),t=e-nn;t>1e3&&(rn-=t,nn=e)}function gn(e){Jt||(en&&(en=clearTimeout(en)),e-on>24?(e<1/0&&(en=setTimeout(hn,e-an.now()-rn)),tn&&(tn=clearInterval(tn))):(tn||(nn=an.now(),tn=setInterval(fn,1e3)),Jt=1,sn(hn)))}function pn(e,t,n){var o=new un;return t=null==t?0:+t,o.restart((n=>{o.stop(),e(n+t)}),t,n),o}un.prototype=dn.prototype={constructor:un,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?ln():+n)+(null==t?0:+t),this._next||Gt===this||(Gt?Gt._next=this:Ut=this,Gt=this),this._call=e,this._time=n,gn()},stop:function(){this._call&&(this._call=null,this._time=1/0,gn())}};var mn=x("start","end","cancel","interrupt"),yn=[];function vn(e,t,n,o,r,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,h;if(1!==n.state)return l();for(c in r)if((h=r[c]).name===n.name){if(3===h.state)return pn(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(pn((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=h);o.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=o.length;++i<a;)o[i].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=dn(i,0,n.time)}(e,n,{name:t,index:o,group:r,on:mn,tween:yn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function bn(e,t){var n=wn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function xn(e,t){var n=wn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function wn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Sn(e,t){var n,o,r,i=e.__transition,a=!0;if(i){for(r in t=null==t?null:t+"",i)(n=i[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete e.__transition}}function En(e,t){var n,o;return function(){var r=xn(this,e),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===t){(o=o.slice()).splice(a,1);break}r.tween=o}}function _n(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=xn(this,e),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}i.tween=r}}function Cn(e,t,n){var o=e._id;return e.each((function(){var e=xn(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return wn(e,o).value[t]}}function Mn(e,t){var n;return("number"==typeof t?Tt:t instanceof yt?Bt:(n=yt(t))?(t=n,Bt):Yt)(e,t)}function Nn(e){return function(){this.removeAttribute(e)}}function kn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pn(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function An(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function On(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttribute(e)}}function In(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttributeNS(e.space,e.local)}}function Dn(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Rn(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function zn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Rn(e,r)),n}return r._value=t,r}function $n(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Dn(e,r)),n}return r._value=t,r}function Bn(e,t){return function(){bn(this,e).delay=+t.apply(this,arguments)}}function Tn(e,t){return t=+t,function(){bn(this,e).delay=t}}function Ln(e,t){return function(){xn(this,e).duration=+t.apply(this,arguments)}}function Xn(e,t){return t=+t,function(){xn(this,e).duration=t}}function Yn(e,t){if("function"!=typeof t)throw new Error;return function(){xn(this,e).ease=t}}function Hn(e,t,n){var o,r,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?bn:xn;return function(){var a=i(this,e),s=a.on;s!==o&&(r=(o=s).copy()).on(t,n),a.on=r}}var Vn=Te.prototype.constructor;function Kn(e){return function(){this.style.removeProperty(e)}}function Fn(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Zn(e,t,n){var o,r;function i(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&Fn(e,i,n)),o}return i._value=t,i}function jn(e){return function(t){this.textContent=e.call(this,t)}}function Wn(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&jn(o)),t}return o._value=e,o}var qn=0;function Un(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Gn(){return++qn}var Qn=Te.prototype;Un.prototype={constructor:Un,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=I(e));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,l,c=o[a],u=c.length,d=i[a]=new Array(u),h=0;h<u;++h)(s=c[h])&&(l=e.call(s,s.__data__,h,c))&&("__data__"in s&&(l.__data__=s.__data__),d[h]=l,vn(d[h],t,n,h,d,wn(s,n)));return new Un(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=z(e));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var h,f=e.call(l,l.__data__,d,c),g=wn(l,n),p=0,m=f.length;p<m;++p)(h=f[p])&&vn(h,t,n,p,f,g);i.push(f),a.push(l)}return new Un(i,a,t,n)},selectChild:Qn.selectChild,selectChildren:Qn.selectChildren,filter:function(e){"function"!=typeof e&&(e=$(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Un(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,h=a[s]=new Array(d),f=0;f<d;++f)(l=c[f]||u[f])&&(h[f]=l);for(;s<o;++s)a[s]=t[s];return new Un(a,this._parents,this._name,this._id)},selection:function(){return new Vn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Gn(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=wn(a,t);vn(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Un(o,this._parents,e,n)},call:Qn.call,nodes:Qn.nodes,node:Qn.node,size:Qn.size,empty:Qn.empty,each:Qn.each,on:function(e,t){var n=this._id;return arguments.length<2?wn(this.node(),n).on.on(e):this.each(Hn(n,e,t))},attr:function(e,t){var n=N(e),o="transform"===n?Wt:Mn;return this.attrTween(e,"function"==typeof t?(n.local?In:On)(n,o,Cn(this,"attr."+e,t)):null==t?(n.local?kn:Nn)(n):(n.local?An:Pn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=N(e);return this.tween(n,(o.local?zn:$n)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?jt:Mn;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var i=ae(this,e),a=(this.style.removeProperty(e),ae(this,e));return i===a?null:i===n&&a===o?r:r=t(n=i,o=a)}}(e,o)).on("end.style."+e,Kn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,i;return function(){var a=ae(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=ae(this,e)),a===l?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}}(e,o,Cn(this,"style."+e,t))).each(function(e,t){var n,o,r,i,a="style."+t,s="end."+a;return function(){var l=xn(this,e),c=l.on,u=null==l.value[a]?i||(i=Kn(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,i=n+"";return function(){var a=ae(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,Zn(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Cn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,Wn(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=wn(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((null==t?En:_n)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Bn:Tn)(t,e)):wn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Ln:Xn)(t,e)):wn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(Yn(t,e)):wn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;xn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise((function(i,a){var s={value:a},l={value:function(){0==--r&&i()}};n.each((function(){var n=xn(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===r&&i()}))},[Symbol.iterator]:Qn[Symbol.iterator]};var Jn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function eo(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Te.prototype.interrupt=function(e){return this.each((function(){Sn(this,e)}))},Te.prototype.transition=function(e){var t,n;e instanceof Un?(t=e._id,e=e._name):(t=Gn(),(n=Jn).time=ln(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)(a=s[c])&&vn(a,e,t,c,s,n||eo(a,t));return new Un(o,this._parents,e,t)};var to=e=>()=>e;function no(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function oo(e,t,n){this.k=e,this.x=t,this.y=n}oo.prototype={constructor:oo,scale:function(e){return 1===e?this:new oo(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new oo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ro=new oo(1,0,0);function io(e){e.stopImmediatePropagation()}function ao(e){e.preventDefault(),e.stopImmediatePropagation()}function so(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function lo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function co(){return this.__zoom||ro}function uo(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ho(){return navigator.maxTouchPoints||"ontouchstart"in this}function fo(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}oo.prototype;const go=t.createContext(null),po=go.Provider,mo=e=>`Node type "${e}" not found. Using fallback type "default".`,yo=()=>"The React Flow parent container needs a width and a height to render the graph.",vo=()=>"Only child nodes can use a parent extent.",bo=e=>`Marker type "${e}" doesn't exist.`,xo=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,wo=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",So=e=>`Edge type "${e}" not found. Using fallback type "default".`,Eo=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,_o=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Co(e,n){const o=t.useContext(go);if(null===o)throw new Error(_o);return m(o,e,n)}const Mo=()=>{const e=t.useContext(go);if(null===e)throw new Error(_o);return t.useMemo((()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy})),[e])},No=e=>e.userSelectionActive?"none":"all";function ko({position:e,children:o,className:r,style:i,...a}){const s=Co(No),l=`${e}`.split("-");return t.createElement("div",{className:n(["react-flow__panel",r,...l]),style:{...i,pointerEvents:s},...a},o)}function Po({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(ko,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},t.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Ao=t.memo((({x:e,y:o,label:r,labelStyle:i={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...h})=>{const f=t.useRef(null),[g,p]=t.useState({x:0,y:0,width:0,height:0}),m=n(["react-flow__edge-textwrapper",d]);return t.useEffect((()=>{if(f.current){const e=f.current.getBBox();p({x:e.x,y:e.y,width:e.width,height:e.height})}}),[r]),void 0!==r&&r?t.createElement("g",{transform:`translate(${e-g.width/2} ${o-g.height/2})`,className:m,visibility:g.width?"visible":"hidden",...h},a&&t.createElement("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),t.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:f,style:i},r),u):null}));const Oo=e=>({width:e.offsetWidth,height:e.offsetHeight}),Io=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Do=(e={x:0,y:0},t)=>({x:Io(e.x,t[0][0],t[1][0]),y:Io(e.y,t[0][1],t[1][1])}),Ro=(e,t,n)=>e<t?Io(Math.abs(e-t),1,50)/50:e>n?-Io(Math.abs(e-n),1,50)/50:0,zo=(e,t)=>[20*Ro(e.x,35,t.width-35),20*Ro(e.y,35,t.height-35)],$o=e=>e.getRootNode?.()||window?.document,Bo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),To=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Lo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Xo=e=>!isNaN(e)&&isFinite(e),Yo=Symbol.for("internals"),Ho=["Enter"," ","Escape"];function Vo(e){const t=((e=>"nativeEvent"in e)(e)?e.nativeEvent:e).composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(t?.nodeName)||t?.hasAttribute("contenteditable")||!!t?.closest(".nokey")}const Ko=e=>"clientX"in e,Fo=(e,t)=>{const n=Ko(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Zo=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,jo=({id:e,path:n,labelX:o,labelY:r,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:f,interactionWidth:g=20})=>t.createElement(t.Fragment,null,t.createElement("path",{id:e,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:h,markerStart:f}),g&&t.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}),i&&Xo(o)&&Xo(r)?t.createElement(Ao,{x:o,y:r,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function Wo(e,t,n){return void 0===n?n:o=>{const r=t().edges.find((t=>t.id===e));r&&n(o,{...r})}}function qo({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,a=Math.abs(o-t)/2;return[i,o<t?o+a:o-a,r,a]}function Uo({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*r+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var Go,Qo,Jo,er,tr,nr;function or({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===nr.Left||e===nr.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function rr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:i=nr.Top}){const[a,s]=or({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=or({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,d,h,f]=Uo({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${o},${r}`,u,d,h,f]}jo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Go||(Go={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Qo||(Qo={