@moderneinc/react-charts 1.3.0-next.d7d66e → 1.4.0-next.14720b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/d3-stacked-area-chart/d3-stacked-area-chart.types.d.ts +13 -0
- package/dist/components/d3-stacked-bar-chart/d3-stacked-bar-chart.types.d.ts +21 -0
- package/dist/components/shared/chart-tooltip.component.d.ts +15 -0
- package/dist/components/shared/chart-tooltip.types.d.ts +62 -0
- package/dist/index.cjs +9 -9
- package/dist/index.js +5007 -4824
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var By=Object.defineProperty;var Uy=(e,t,n)=>t in e?By(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mi=(e,t,n)=>Uy(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),L=require("@mui/material"),Y=require("react"),Zg=require("@mui/icons-material");function Hy(e){return e}var ws=1,Ss=2,Gu=3,Mi=4,Df=1e-6;function jy(e){return"translate("+e+",0)"}function Gy(e){return"translate(0,"+e+")"}function Yy(e){return t=>+e(t)}function Xy(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Wy(){return!this.__axis}function Qg(e,t){var n=[],r=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===ws||e===Mi?-1:1,c=e===Mi||e===Ss?"x":"y",f=e===ws||e===Gu?jy:Gy;function h(p){var g=r??(t.ticks?t.ticks.apply(t,n):t.domain()),d=i??(t.tickFormat?t.tickFormat.apply(t,n):Hy),m=Math.max(a,0)+o,x=t.range(),y=+x[0]+l,v=+x[x.length-1]+l,_=(t.bandwidth?Xy:Yy)(t.copy(),l),S=p.selection?p.selection():p,w=S.selectAll(".domain").data([null]),b=S.selectAll(".tick").data(g,t).order(),M=b.exit(),A=b.enter().append("g").attr("class","tick"),R=b.select("line"),C=b.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(c+"2",u*a)),C=C.merge(A.append("text").attr("fill","currentColor").attr(c,u*m).attr("dy",e===ws?"0em":e===Gu?"0.71em":"0.32em")),p!==S&&(w=w.transition(p),b=b.transition(p),R=R.transition(p),C=C.transition(p),M=M.transition(p).attr("opacity",Df).attr("transform",function(O){return isFinite(O=_(O))?f(O+l):this.getAttribute("transform")}),A.attr("opacity",Df).attr("transform",function(O){var D=this.parentNode.__axis;return f((D&&isFinite(D=D(O))?D:_(O))+l)})),M.remove(),w.attr("d",e===Mi||e===Ss?s?"M"+u*s+","+y+"H"+l+"V"+v+"H"+u*s:"M"+l+","+y+"V"+v:s?"M"+y+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+y+","+l+"H"+v),b.attr("opacity",1).attr("transform",function(O){return f(_(O)+l)}),R.attr(c+"2",u*a),C.attr(c,u*m).text(d),S.filter(Wy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ss?"start":e===Mi?"end":"middle"),S.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function qn(e){return Qg(Gu,e)}function In(e){return Qg(Mi,e)}var Ky={value:()=>{}};function Ec(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Sa(n)}function Sa(e){this._=e}function Vy(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Sa.prototype=Ec.prototype={constructor:Sa,on:function(e,t){var n=this._,r=Vy(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=Zy(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=Of(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Of(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Sa(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Zy(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Of(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ky,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Yu="http://www.w3.org/1999/xhtml";const Pf={svg:"http://www.w3.org/2000/svg",xhtml:Yu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ja(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Pf.hasOwnProperty(t)?{space:Pf[t],local:e}:e}function Qy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Yu&&t.documentElement.namespaceURI===Yu?t.createElement(e):t.createElementNS(n,e)}}function Jy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jg(e){var t=Ja(e);return(t.local?Jy:Qy)(t)}function t_(){}function Dc(e){return e==null?t_:function(){return this.querySelector(e)}}function e_(e){typeof e!="function"&&(e=Dc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),l,u,c=0;c<s;++c)(l=a[c])&&(u=e.call(l,l.__data__,c,a))&&("__data__"in l&&(u.__data__=l.__data__),o[c]=u);return new nn(r,this._parents)}function n_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r_(){return[]}function tm(e){return e==null?r_:function(){return this.querySelectorAll(e)}}function i_(e){return function(){return n_(e.apply(this,arguments))}}function a_(e){typeof e=="function"?e=i_(e):e=tm(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),i.push(l));return new nn(r,i)}function em(e){return function(){return this.matches(e)}}function nm(e){return function(t){return t.matches(e)}}var s_=Array.prototype.find;function o_(e){return function(){return s_.call(this.children,e)}}function l_(){return this.firstElementChild}function u_(e){return this.select(e==null?l_:o_(typeof e=="function"?e:nm(e)))}var c_=Array.prototype.filter;function f_(){return Array.from(this.children)}function h_(e){return function(){return c_.call(this.children,e)}}function p_(e){return this.selectAll(e==null?f_:h_(typeof e=="function"?e:nm(e)))}function d_(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new nn(r,this._parents)}function rm(e){return new Array(e.length)}function g_(){return new nn(this._enter||this._groups.map(rm),this._parents)}function Da(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Da.prototype={constructor:Da,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)}};function m_(e){return function(){return e}}function y_(e,t,n,r,i,a){for(var s=0,o,l=t.length,u=a.length;s<u;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new Da(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function __(e,t,n,r,i,a,s){var o,l,u=new Map,c=t.length,f=a.length,h=new Array(c),p;for(o=0;o<c;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<f;++o)p=s.call(e,a[o],o,a)+"",(l=u.get(p))?(r[o]=l,l.__data__=a[o],u.delete(p)):n[o]=new Da(e,a[o]);for(o=0;o<c;++o)(l=t[o])&&u.get(h[o])===l&&(i[o]=l)}function x_(e){return e.__data__}function v_(e,t){if(!arguments.length)return Array.from(this,x_);var n=t?__:y_,r=this._parents,i=this._groups;typeof e!="function"&&(e=m_(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),u=0;u<a;++u){var c=r[u],f=i[u],h=f.length,p=b_(e.call(c,c&&c.__data__,u,r)),g=p.length,d=o[u]=new Array(g),m=s[u]=new Array(g),x=l[u]=new Array(h);n(c,f,d,m,x,p,t);for(var y=0,v=0,_,S;y<g;++y)if(_=d[y]){for(y>=v&&(v=y+1);!(S=m[v])&&++v<g;);_._next=S||null}}return s=new nn(s,r),s._enter=o,s._exit=l,s}function b_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function w_(){return new nn(this._exit||this._groups.map(rm),this._parents)}function S_(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function T_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var u=n[l],c=r[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g]||c[g])&&(h[g]=p);for(;l<i;++l)o[l]=n[l];return new nn(o,this._parents)}function M_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function A_(e){e||(e=k_);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var s=n[a],o=s.length,l=i[a]=new Array(o),u,c=0;c<o;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new nn(i,this._parents).order()}function k_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function C_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function R_(){return Array.from(this)}function E_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function D_(){let e=0;for(const t of this)++e;return e}function O_(){return!this.node()}function P_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function F_(e){return function(){this.removeAttribute(e)}}function N_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $_(e,t){return function(){this.setAttribute(e,t)}}function L_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function q_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function I_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function z_(e,t){var n=Ja(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?N_:F_:typeof t=="function"?n.local?I_:q_:n.local?L_:$_)(n,t))}function im(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function B_(e){return function(){this.style.removeProperty(e)}}function U_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function H_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function j_(e,t,n){return arguments.length>1?this.each((t==null?B_:typeof t=="function"?H_:U_)(e,t,n??"")):Jr(this.node(),e)}function Jr(e,t){return e.style.getPropertyValue(t)||im(e).getComputedStyle(e,null).getPropertyValue(t)}function G_(e){return function(){delete this[e]}}function Y_(e,t){return function(){this[e]=t}}function X_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function W_(e,t){return arguments.length>1?this.each((t==null?G_:typeof t=="function"?X_:Y_)(e,t)):this.node()[e]}function am(e){return e.trim().split(/^|\s+/)}function Oc(e){return e.classList||new sm(e)}function sm(e){this._node=e,this._names=am(e.getAttribute("class")||"")}sm.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function om(e,t){for(var n=Oc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function lm(e,t){for(var n=Oc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function K_(e){return function(){om(this,e)}}function V_(e){return function(){lm(this,e)}}function Z_(e,t){return function(){(t.apply(this,arguments)?om:lm)(this,e)}}function Q_(e,t){var n=am(e+"");if(arguments.length<2){for(var r=Oc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Z_:t?K_:V_)(n,t))}function J_(){this.textContent=""}function t1(e){return function(){this.textContent=e}}function e1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function n1(e){return arguments.length?this.each(e==null?J_:(typeof e=="function"?e1:t1)(e)):this.node().textContent}function r1(){this.innerHTML=""}function i1(e){return function(){this.innerHTML=e}}function a1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function s1(e){return arguments.length?this.each(e==null?r1:(typeof e=="function"?a1:i1)(e)):this.node().innerHTML}function o1(){this.nextSibling&&this.parentNode.appendChild(this)}function l1(){return this.each(o1)}function u1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function c1(){return this.each(u1)}function f1(e){var t=typeof e=="function"?e:Jg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function h1(){return null}function p1(e,t){var n=typeof e=="function"?e:Jg(e),r=t==null?h1:typeof t=="function"?t:Dc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function d1(){var e=this.parentNode;e&&e.removeChild(this)}function g1(){return this.each(d1)}function m1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function y1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _1(e){return this.select(e?y1:m1)}function x1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function v1(e){return function(t){e.call(this,t,this.__data__)}}function b1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function w1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function S1(e,t,n){return function(){var r=this.__on,i,a=v1(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function T1(e,t,n){var r=b1(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,c;l<u;++l)for(i=0,c=o[l];i<a;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(o=t?S1:w1,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function um(e,t,n){var r=im(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function M1(e,t){return function(){return um(this,e,t)}}function A1(e,t){return function(){return um(this,e,t.apply(this,arguments))}}function k1(e,t){return this.each((typeof t=="function"?A1:M1)(e,t))}function*C1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var cm=[null];function nn(e,t){this._groups=e,this._parents=t}function fi(){return new nn([[document.documentElement]],cm)}function R1(){return this}nn.prototype=fi.prototype={constructor:nn,select:e_,selectAll:a_,selectChild:u_,selectChildren:p_,filter:d_,data:v_,enter:g_,exit:w_,join:S_,merge:T_,selection:R1,order:M_,sort:A_,call:C_,nodes:R_,node:E_,size:D_,empty:O_,each:P_,attr:z_,style:j_,property:W_,classed:Q_,text:n1,html:s1,raise:l1,lower:c1,append:f1,insert:p1,remove:g1,clone:_1,datum:x1,on:T1,dispatch:k1,[Symbol.iterator]:C1};function Ot(e){return typeof e=="string"?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],cm)}function E1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function tr(e,t){if(e=E1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Xu={capture:!0,passive:!1};function Wu(e){e.preventDefault(),e.stopImmediatePropagation()}function D1(e){var t=e.document.documentElement,n=Ot(e).on("dragstart.drag",Wu,Xu);"onselectstart"in t?n.on("selectstart.drag",Wu,Xu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function O1(e,t){var n=e.document.documentElement,r=Ot(e).on("dragstart.drag",null);t&&(r.on("click.drag",Wu,Xu),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 Pc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ta(){}var Ui=.7,Oa=1/Ui,Gr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",P1=/^#([0-9a-f]{3,8})$/,F1=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),N1=new RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`),$1=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${Hi}\\)$`),L1=new RegExp(`^rgba\\(${Mn},${Mn},${Mn},${Hi}\\)$`),q1=new RegExp(`^hsl\\(${Hi},${Mn},${Mn}\\)$`),I1=new RegExp(`^hsla\\(${Hi},${Mn},${Mn},${Hi}\\)$`),Ff={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};Pc(ta,Sr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Nf,formatHex:Nf,formatHex8:z1,formatHsl:B1,formatRgb:$f,toString:$f});function Nf(){return this.rgb().formatHex()}function z1(){return this.rgb().formatHex8()}function B1(){return hm(this).formatHsl()}function $f(){return this.rgb().formatRgb()}function Sr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=P1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Lf(t):n===3?new Le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?da(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?da(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=F1.exec(e))?new Le(t[1],t[2],t[3],1):(t=N1.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$1.exec(e))?da(t[1],t[2],t[3],t[4]):(t=L1.exec(e))?da(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=q1.exec(e))?zf(t[1],t[2]/100,t[3]/100,1):(t=I1.exec(e))?zf(t[1],t[2]/100,t[3]/100,t[4]):Ff.hasOwnProperty(e)?Lf(Ff[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function Lf(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function da(e,t,n,r){return r<=0&&(e=t=n=NaN),new Le(e,t,n,r)}function U1(e){return e instanceof ta||(e=Sr(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function Ku(e,t,n,r){return arguments.length===1?U1(e):new Le(e,t,n,r??1)}function Le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Pc(Le,Ku,fm(ta,{brighter(e){return e=e==null?Oa:Math.pow(Oa,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(_r(this.r),_r(this.g),_r(this.b),Pa(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:qf,formatHex:qf,formatHex8:H1,formatRgb:If,toString:If}));function qf(){return`#${gr(this.r)}${gr(this.g)}${gr(this.b)}`}function H1(){return`#${gr(this.r)}${gr(this.g)}${gr(this.b)}${gr((isNaN(this.opacity)?1:this.opacity)*255)}`}function If(){const e=Pa(this.opacity);return`${e===1?"rgb(":"rgba("}${_r(this.r)}, ${_r(this.g)}, ${_r(this.b)}${e===1?")":`, ${e})`}`}function Pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _r(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gr(e){return e=_r(e),(e<16?"0":"")+e.toString(16)}function zf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yn(e,t,n,r)}function hm(e){if(e instanceof yn)return new yn(e.h,e.s,e.l,e.opacity);if(e instanceof ta||(e=Sr(e)),!e)return new yn;if(e instanceof yn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new yn(s,o,l,e.opacity)}function j1(e,t,n,r){return arguments.length===1?hm(e):new yn(e,t,n,r??1)}function yn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Pc(yn,j1,fm(ta,{brighter(e){return e=e==null?Oa:Math.pow(Oa,e),new yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Le(Ts(e>=240?e-240:e+120,i,r),Ts(e,i,r),Ts(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new yn(Bf(this.h),ga(this.s),ga(this.l),Pa(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=Pa(this.opacity);return`${e===1?"hsl(":"hsla("}${Bf(this.h)}, ${ga(this.s)*100}%, ${ga(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bf(e){return e=(e||0)%360,e<0?e+360:e}function ga(e){return Math.max(0,Math.min(1,e||0))}function Ts(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Fc=e=>()=>e;function G1(e,t){return function(n){return e+n*t}}function Y1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function X1(e){return(e=+e)==1?pm:function(t,n){return n-t?Y1(t,n,e):Fc(isNaN(t)?n:t)}}function pm(e,t){var n=t-e;return n?G1(e,n):Fc(isNaN(e)?t:e)}const Fa=(function e(t){var n=X1(t);function r(i,a){var s=n((i=Ku(i)).r,(a=Ku(a)).r),o=n(i.g,a.g),l=n(i.b,a.b),u=pm(i.opacity,a.opacity);return function(c){return i.r=s(c),i.g=o(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r})(1);function W1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function K1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function V1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=ts(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function Z1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function mn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Q1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ts(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Vu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ms=new RegExp(Vu.source,"g");function J1(e){return function(){return e}}function tx(e){return function(t){return e(t)+""}}function dm(e,t){var n=Vu.lastIndex=Ms.lastIndex=0,r,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Vu.exec(e))&&(i=Ms.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:mn(r,i)})),n=Ms.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?tx(l[0].x):J1(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)o[(f=l[c]).i]=f.x(u);return o.join("")})}function ts(e,t){var n=typeof t,r;return t==null||n==="boolean"?Fc(t):(n==="number"?mn:n==="string"?(r=Sr(t))?(t=r,Fa):dm:t instanceof Sr?Fa:t instanceof Date?Z1:K1(t)?W1:Array.isArray(t)?V1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Q1:mn)(e,t)}function ex(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Uf=180/Math.PI,Zu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gm(e,t,n,r,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Uf,skewX:Math.atan(l)*Uf,scaleX:s,scaleY:o}}var ma;function nx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Zu:gm(t.a,t.b,t.c,t.d,t.e,t.f)}function rx(e){return e==null||(ma||(ma=document.createElementNS("http://www.w3.org/2000/svg","g")),ma.setAttribute("transform",e),!(e=ma.transform.baseVal.consolidate()))?Zu:(e=e.matrix,gm(e.a,e.b,e.c,e.d,e.e,e.f))}function mm(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push("translate(",null,t,null,n);g.push({i:d-4,x:mn(u,f)},{i:d-2,x:mn(c,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function s(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:mn(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function o(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:mn(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push(i(p)+"scale(",null,",",null,")");g.push({i:d-4,x:mn(u,f)},{i:d-2,x:mn(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),o(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var g=-1,d=h.length,m;++g<d;)f[(m=h[g]).i]=m.x(p);return f.join("")}}}var ix=mm(nx,"px, ","px)","deg)"),ax=mm(rx,", ",")",")"),ti=0,Ai=0,yi=0,ym=1e3,Na,ki,$a=0,Tr=0,es=0,ji=typeof performance=="object"&&performance.now?performance:Date,_m=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nc(){return Tr||(_m(sx),Tr=ji.now()+es)}function sx(){Tr=0}function La(){this._call=this._time=this._next=null}La.prototype=xm.prototype={constructor:La,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nc():+n)+(t==null?0:+t),!this._next&&ki!==this&&(ki?ki._next=this:Na=this,ki=this),this._call=e,this._time=n,Qu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qu())}};function xm(e,t,n){var r=new La;return r.restart(e,t,n),r}function ox(){Nc(),++ti;for(var e=Na,t;e;)(t=Tr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ti}function Hf(){Tr=($a=ji.now())+es,ti=Ai=0;try{ox()}finally{ti=0,ux(),Tr=0}}function lx(){var e=ji.now(),t=e-$a;t>ym&&(es-=t,$a=e)}function ux(){for(var e,t=Na,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Na=n);ki=e,Qu(r)}function Qu(e){if(!ti){Ai&&(Ai=clearTimeout(Ai));var t=e-Tr;t>24?(e<1/0&&(Ai=setTimeout(Hf,e-ji.now()-es)),yi&&(yi=clearInterval(yi))):(yi||($a=ji.now(),yi=setInterval(lx,ym)),ti=1,_m(Hf))}}function jf(e,t,n){var r=new La;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var cx=Ec("start","end","cancel","interrupt"),fx=[],vm=0,Gf=1,Ju=2,Ta=3,Yf=4,tc=5,Ma=6;function ns(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;hx(e,n,{name:t,index:r,group:i,on:cx,tween:fx,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:vm})}function $c(e,t){var n=_n(e,t);if(n.state>vm)throw new Error("too late; already scheduled");return n}function kn(e,t){var n=_n(e,t);if(n.state>Ta)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function hx(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=xm(a,0,n.time);function a(u){n.state=Gf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,h,p;if(n.state!==Gf)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ta)return jf(s);p.state===Yf?(p.state=Ma,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Ma,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(jf(function(){n.state===Ta&&(n.state=Yf,n.timer.restart(o,n.delay,n.time),o(u))}),n.state=Ju,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ju){for(n.state=Ta,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function o(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=tc,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);n.state===tc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ma,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function ec(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>Ju&&r.state<tc,r.state=Ma,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function px(e){return this.each(function(){ec(this,e)})}function dx(e,t){var n,r;return function(){var i=kn(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function gx(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=kn(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=o;break}l===u&&i.push(o)}a.tween=i}}function mx(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=_n(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?dx:gx)(n,e,t))}function Lc(e,t,n){var r=e._id;return e.each(function(){var i=kn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _n(i,r).value[t]}}function bm(e,t){var n;return(typeof t=="number"?mn:t instanceof Sr?Fa:(n=Sr(t))?(t=n,Fa):dm)(e,t)}function yx(e){return function(){this.removeAttribute(e)}}function _x(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xx(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function vx(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function bx(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function wx(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function Sx(e,t){var n=Ja(e),r=n==="transform"?ax:bm;return this.attrTween(e,typeof t=="function"?(n.local?wx:bx)(n,r,Lc(this,"attr."+e,t)):t==null?(n.local?_x:yx)(n):(n.local?vx:xx)(n,r,t))}function Tx(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Mx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ax(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Mx(e,a)),n}return i._value=t,i}function kx(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Tx(e,a)),n}return i._value=t,i}function Cx(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ja(e);return this.tween(n,(r.local?Ax:kx)(r,t))}function Rx(e,t){return function(){$c(this,e).delay=+t.apply(this,arguments)}}function Ex(e,t){return t=+t,function(){$c(this,e).delay=t}}function Dx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Rx:Ex)(t,e)):_n(this.node(),t).delay}function Ox(e,t){return function(){kn(this,e).duration=+t.apply(this,arguments)}}function Px(e,t){return t=+t,function(){kn(this,e).duration=t}}function Fx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ox:Px)(t,e)):_n(this.node(),t).duration}function Nx(e,t){if(typeof t!="function")throw new Error;return function(){kn(this,e).ease=t}}function $x(e){var t=this._id;return arguments.length?this.each(Nx(t,e)):_n(this.node(),t).ease}function Lx(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;kn(this,e).ease=n}}function qx(e){if(typeof e!="function")throw new Error;return this.each(Lx(this._id,e))}function Ix(e){typeof e!="function"&&(e=em(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new zn(r,this._parents,this._name,this._id)}function zx(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l=t[o],u=n[o],c=l.length,f=s[o]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;o<r;++o)s[o]=t[o];return new zn(s,this._parents,this._name,this._id)}function Bx(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ux(e,t,n){var r,i,a=Bx(t)?$c:kn;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function Hx(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(Ux(n,e,t))}function jx(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Gx(){return this.on("end.remove",jx(this._id))}function Yx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Dc(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],l=o.length,u=a[s]=new Array(l),c,f,h=0;h<l;++h)(c=o[h])&&(f=e.call(c,c.__data__,h,o))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,ns(u[h],t,n,h,u,_n(c,n)));return new zn(a,this._parents,t,n)}function Xx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tm(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var l=r[o],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,g=_n(c,n),d=0,m=h.length;d<m;++d)(p=h[d])&&ns(p,t,n,d,h,g);a.push(h),s.push(c)}return new zn(a,s,t,n)}var Wx=fi.prototype.constructor;function Kx(){return new Wx(this._groups,this._parents)}function Vx(e,t){var n,r,i;return function(){var a=Jr(this,e),s=(this.style.removeProperty(e),Jr(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function wm(e){return function(){this.style.removeProperty(e)}}function Zx(e,t,n){var r,i=n+"",a;return function(){var s=Jr(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function Qx(e,t,n){var r,i,a;return function(){var s=Jr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Jr(this,e))),s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o))}}function Jx(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var l=kn(this,e),u=l.on,c=l.value[a]==null?o||(o=wm(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(s,i=c),l.on=r}}function tv(e,t,n){var r=(e+="")=="transform"?ix:bm;return t==null?this.styleTween(e,Vx(e,r)).on("end.style."+e,wm(e)):typeof t=="function"?this.styleTween(e,Qx(e,r,Lc(this,"style."+e,t))).each(Jx(this._id,e)):this.styleTween(e,Zx(e,r,t),n).on("end.style."+e,null)}function ev(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function nv(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&ev(e,s,n)),r}return a._value=t,a}function rv(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,nv(e,t,n??""))}function iv(e){return function(){this.textContent=e}}function av(e){return function(){var t=e(this);this.textContent=t??""}}function sv(e){return this.tween("text",typeof e=="function"?av(Lc(this,"text",e)):iv(e==null?"":e+""))}function ov(e){return function(t){this.textContent=e.call(this,t)}}function lv(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ov(i)),t}return r._value=e,r}function uv(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,lv(e))}function cv(){for(var e=this._name,t=this._id,n=Sm(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var c=_n(l,t);ns(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new zn(r,this._parents,e,n)}function fv(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};n.each(function(){var u=kn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),u.on=t}),i===0&&a()})}var hv=0;function zn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qc(e){return fi().transition(e)}function Sm(){return++hv}var Dn=fi.prototype;zn.prototype=qc.prototype={constructor:zn,select:Yx,selectAll:Xx,selectChild:Dn.selectChild,selectChildren:Dn.selectChildren,filter:Ix,merge:zx,selection:Kx,transition:cv,call:Dn.call,nodes:Dn.nodes,node:Dn.node,size:Dn.size,empty:Dn.empty,each:Dn.each,on:Hx,attr:Sx,attrTween:Cx,style:tv,styleTween:rv,text:sv,textTween:uv,remove:Gx,tween:mx,delay:Dx,duration:Fx,ease:$x,easeVarying:qx,end:fv,[Symbol.iterator]:Dn[Symbol.iterator]};function pv(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var dv={time:null,delay:0,duration:250,ease:pv};function gv(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function mv(e){var t,n;e instanceof zn?(t=e._id,e=e._name):(t=Sm(),(n=dv).time=Nc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&ns(l,e,t,u,s,n||gv(l,t));return new zn(r,this._parents,e,t)}fi.prototype.interrupt=px;fi.prototype.transition=mv;const As=e=>()=>e;function yv(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function _v(e){e.stopImmediatePropagation()}function ks(e){e.preventDefault(),e.stopImmediatePropagation()}var Xf={name:"drag"},Cs={name:"space"},Nr={name:"handle"},$r={name:"center"};const{abs:Wf,max:Te,min:Me}=Math;function Kf(e){return[+e[0],+e[1]]}function Vf(e){return[Kf(e[0]),Kf(e[1])]}var Aa={name:"x",handles:["w","e"].map(nc),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Rs={},On={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Zf={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Qf={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},xv={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vv={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function nc(e){return{type:e}}function bv(e){return!e.ctrlKey&&!e.button}function wv(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Sv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Es(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Tv(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function hi(){return Mv(Aa)}function Mv(e){var t=wv,n=bv,r=Sv,i=!0,a=Ec("start","brush","end"),s=6,o;function l(m){var x=m.property("__brush",d).selectAll(".overlay").data([nc("overlay")]);x.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",On.overlay).merge(x).each(function(){var v=Es(this).extent;Ot(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([nc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",On.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(v){return v.type});y.exit().remove(),y.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return On[v.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,x,y){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,_=v.__brush,S=c(v,arguments),w=_.selection,b=e.input(typeof x=="function"?x.apply(this,arguments):x,_.extent),M=ts(w,b);function A(R){_.selection=R===1&&b===null?null:M(R),u.call(v),S.brush()}return w!==null&&b!==null?A:A(1)}):m.each(function(){var v=this,_=arguments,S=v.__brush,w=e.input(typeof x=="function"?x.apply(v,_):x,S.extent),b=c(v,_).beforestart();ec(v),S.selection=w===null?null:w,u.call(v),b.start(y).brush(y).end(y)})},l.clear=function(m,x){l.move(m,null,x)};function u(){var m=Ot(this),x=Es(this).selection;x?(m.selectAll(".selection").style("display",null).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?x[1][0]-s/2:x[0][0]-s/2}).attr("y",function(y){return y.type[0]==="s"?x[1][1]-s/2:x[0][1]-s/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?x[1][0]-x[0][0]+s:s}).attr("height",function(y){return y.type==="e"||y.type==="w"?x[1][1]-x[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,x,y){var v=m.__brush.emitter;return v&&(!y||!v.clean)?v:new f(m,x,y)}function f(m,x,y){this.that=m,this.args=x,this.state=m.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,x){return this.starting?(this.starting=!1,this.emit("start",m,x)):this.emit("brush",m),this},brush:function(m,x){return this.emit("brush",m,x),this},end:function(m,x){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,x)),this},emit:function(m,x,y){var v=Ot(this.that).datum();a.call(m,this.that,new yv(m,{sourceEvent:x,target:l,selection:e.output(this.state.selection),mode:y,dispatch:a}),v)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var x=this,y=m.target.__data__.type,v=(i&&m.metaKey?y="overlay":y)==="selection"?Xf:i&&m.altKey?$r:Nr,_=e===Rs?null:xv[y],S=e===Aa?null:vv[y],w=Es(x),b=w.extent,M=w.selection,A=b[0][0],R,C,O=b[0][1],D,N,H=b[1][0],q,F,j=b[1][1],$,it,et=0,nt=0,J,lt=_&&S&&i&&m.shiftKey,I,Q,at=Array.from(m.touches||[m],U=>{const ot=U.identifier;return U=tr(U,x),U.point0=U.slice(),U.identifier=ot,U});ec(x);var K=c(x,arguments,!0).beforestart();if(y==="overlay"){M&&(J=!0);const U=[at[0],at[1]||at[0]];w.selection=M=[[R=e===Rs?A:Me(U[0][0],U[1][0]),D=e===Aa?O:Me(U[0][1],U[1][1])],[q=e===Rs?H:Te(U[0][0],U[1][0]),$=e===Aa?j:Te(U[0][1],U[1][1])]],at.length>1&&X(m)}else R=M[0][0],D=M[0][1],q=M[1][0],$=M[1][1];C=R,N=D,F=q,it=$;var k=Ot(x).attr("pointer-events","none"),z=k.selectAll(".overlay").attr("cursor",On[y]);if(m.touches)K.moved=T,K.ended=V;else{var E=Ot(m.view).on("mousemove.brush",T,!0).on("mouseup.brush",V,!0);i&&E.on("keydown.brush",G,!0).on("keyup.brush",ut,!0),D1(m.view)}u.call(x),K.start(m,v.name);function T(U){for(const ot of U.changedTouches||[U])for(const gt of at)gt.identifier===ot.identifier&&(gt.cur=tr(ot,x));if(lt&&!I&&!Q&&at.length===1){const ot=at[0];Wf(ot.cur[0]-ot[0])>Wf(ot.cur[1]-ot[1])?Q=!0:I=!0}for(const ot of at)ot.cur&&(ot[0]=ot.cur[0],ot[1]=ot.cur[1]);J=!0,ks(U),X(U)}function X(U){const ot=at[0],gt=ot.point0;var yt;switch(et=ot[0]-gt[0],nt=ot[1]-gt[1],v){case Cs:case Xf:{_&&(et=Te(A-R,Me(H-q,et)),C=R+et,F=q+et),S&&(nt=Te(O-D,Me(j-$,nt)),N=D+nt,it=$+nt);break}case Nr:{at[1]?(_&&(C=Te(A,Me(H,at[0][0])),F=Te(A,Me(H,at[1][0])),_=1),S&&(N=Te(O,Me(j,at[0][1])),it=Te(O,Me(j,at[1][1])),S=1)):(_<0?(et=Te(A-R,Me(H-R,et)),C=R+et,F=q):_>0&&(et=Te(A-q,Me(H-q,et)),C=R,F=q+et),S<0?(nt=Te(O-D,Me(j-D,nt)),N=D+nt,it=$):S>0&&(nt=Te(O-$,Me(j-$,nt)),N=D,it=$+nt));break}case $r:{_&&(C=Te(A,Me(H,R-et*_)),F=Te(A,Me(H,q+et*_))),S&&(N=Te(O,Me(j,D-nt*S)),it=Te(O,Me(j,$+nt*S)));break}}F<C&&(_*=-1,yt=R,R=q,q=yt,yt=C,C=F,F=yt,y in Zf&&z.attr("cursor",On[y=Zf[y]])),it<N&&(S*=-1,yt=D,D=$,$=yt,yt=N,N=it,it=yt,y in Qf&&z.attr("cursor",On[y=Qf[y]])),w.selection&&(M=w.selection),I&&(C=M[0][0],F=M[1][0]),Q&&(N=M[0][1],it=M[1][1]),(M[0][0]!==C||M[0][1]!==N||M[1][0]!==F||M[1][1]!==it)&&(w.selection=[[C,N],[F,it]],u.call(x),K.brush(U,v.name))}function V(U){if(_v(U),U.touches){if(U.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else O1(U.view,J),E.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);k.attr("pointer-events","all"),z.attr("cursor",On.overlay),w.selection&&(M=w.selection),Tv(M)&&(w.selection=null,u.call(x)),K.end(U,v.name)}function G(U){switch(U.keyCode){case 16:{lt=_&&S;break}case 18:{v===Nr&&(_&&(q=F-et*_,R=C+et*_),S&&($=it-nt*S,D=N+nt*S),v=$r,X(U));break}case 32:{(v===Nr||v===$r)&&(_<0?q=F-et:_>0&&(R=C-et),S<0?$=it-nt:S>0&&(D=N-nt),v=Cs,z.attr("cursor",On.selection),X(U));break}default:return}ks(U)}function ut(U){switch(U.keyCode){case 16:{lt&&(I=Q=lt=!1,X(U));break}case 18:{v===$r&&(_<0?q=F:_>0&&(R=C),S<0?$=it:S>0&&(D=N),v=Nr,X(U));break}case 32:{v===Cs&&(U.altKey?(_&&(q=F-et*_,R=C+et*_),S&&($=it-nt*S,D=N+nt*S),v=$r):(_<0?q=F:_>0&&(R=C),S<0?$=it:S>0&&(D=N),v=Nr),z.attr("cursor",On[y]),X(U));break}default:return}ks(U)}}function p(m){c(this,arguments).moved(m)}function g(m){c(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=Vf(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:As(Vf(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:As(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:As(!!m),l):r},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}function ka(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Av(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ic(e){let t,n,r;e.length!==2?(t=ka,n=(o,l)=>ka(e(o),l),r=(o,l)=>e(o)-l):(t=e===ka||e===Av?e:kv,n=e,r=e);function i(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(o[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(o[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(o,l,u=0,c=o.length){const f=i(o,l,u,c-1);return f>u&&r(o[f-1],l)>-r(o[f],l)?f-1:f}return{left:i,center:s,right:a}}function kv(){return 0}function Cv(e){return e===null?NaN:+e}const Rv=Ic(ka),Ev=Rv.right;Ic(Cv).center;const Dv=Math.sqrt(50),Ov=Math.sqrt(10),Pv=Math.sqrt(2);function qa(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=Dv?10:a>=Ov?5:a>=Pv?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=n&&n<2?qa(e,t,n*2):[o,l,u]}function Fv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?qa(t,e,n):qa(e,t,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)l[u]=(a-u)/-s;else for(let u=0;u<o;++u)l[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(i+u)/-s;else for(let u=0;u<o;++u)l[u]=(i+u)*s;return l}function rc(e,t,n){return t=+t,e=+e,n=+n,qa(e,t,n)[2]}function ic(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?rc(t,e,n):rc(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Tm(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Nv(e){return function(){return e}}function $v(e){return+e}var Jf=[0,1];function Br(e){return e}function ac(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Nv(isNaN(t)?NaN:.5)}function Lv(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function qv(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=ac(i,r),a=n(s,a)):(r=ac(r,i),a=n(a,s)),function(o){return a(r(o))}}function Iv(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=ac(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var l=Ev(e,o,1,r)-1;return a[l](i[l](o))}}function Mm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zv(){var e=Jf,t=Jf,n=ts,r,i,a,s=Br,o,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Br&&(s=Lv(e[0],e[h-1])),o=h>2?Iv:qv,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=o(t,e.map(r),mn)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,$v),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=ex,c()},f.clamp=function(h){return arguments.length?(s=h?!0:Br,c()):s!==Br},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,c()}}function Am(){return zv()(Br,Br)}function Bv(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ia(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ei(e){return e=Ia(Math.abs(e)),e?e[1]:NaN}function Uv(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Hv(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jv=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function za(e){if(!(t=jv.exec(e)))throw new Error("invalid format: "+e);var t;return new zc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}za.prototype=zc.prototype;function zc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}zc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Gv(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var km;function Yv(e,t){var n=Ia(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(km=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ia(e,Math.max(0,t+a-1))[0]}function th(e,t){var n=Ia(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const eh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Bv,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>th(e*100,t),r:th,s:Yv,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nh(e){return e}var rh=Array.prototype.map,ih=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xv(e){var t=e.grouping===void 0||e.thousands===void 0?nh:Uv(rh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?nh:Hv(rh.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=za(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,x=f.width,y=f.comma,v=f.precision,_=f.trim,S=f.type;S==="n"?(y=!0,S="g"):eh[S]||(v===void 0&&(v=12),_=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=d==="$"?n:d==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",b=d==="$"?r:/[%p]/.test(S)?s:"",M=eh[S],A=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function R(C){var O=w,D=b,N,H,q;if(S==="c")D=M(C)+D,C="";else{C=+C;var F=C<0||1/C<0;if(C=isNaN(C)?l:M(Math.abs(C),v),_&&(C=Gv(C)),F&&+C==0&&g!=="+"&&(F=!1),O=(F?g==="("?g:o:g==="-"||g==="("?"":g)+O,D=(S==="s"?ih[8+km/3]:"")+D+(F&&g==="("?")":""),A){for(N=-1,H=C.length;++N<H;)if(q=C.charCodeAt(N),48>q||q>57){D=(q===46?i+C.slice(N+1):C.slice(N))+D,C=C.slice(0,N);break}}}y&&!m&&(C=t(C,1/0));var j=O.length+C.length+D.length,$=j<x?new Array(x-j+1).join(h):"";switch(y&&m&&(C=t($+C,$.length?x-D.length:1/0),$=""),p){case"<":C=O+C+D+$;break;case"=":C=O+$+C+D;break;case"^":C=$.slice(0,j=$.length>>1)+O+C+D+$.slice(j);break;default:C=$+O+C+D;break}return a(C)}return R.toString=function(){return f+""},R}function c(f,h){var p=u((f=za(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(ei(h)/3)))*3,d=Math.pow(10,-g),m=ih[8+g/3];return function(x){return p(d*x)+m}}return{format:u,formatPrefix:c}}var ya,Cm,Rm;Wv({thousands:",",grouping:[3],currency:["$",""]});function Wv(e){return ya=Xv(e),Cm=ya.format,Rm=ya.formatPrefix,ya}function Kv(e){return Math.max(0,-ei(Math.abs(e)))}function Vv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ei(t)/3)))*3-ei(Math.abs(e)))}function Zv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ei(t)-ei(e))+1}function Qv(e,t,n,r){var i=ic(e,t,n),a;switch(r=za(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Vv(i,s))&&(r.precision=a),Rm(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Zv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Kv(i))&&(r.precision=a-(r.type==="%")*2);break}}return Cm(r)}function Jv(e){var t=e.domain;return e.ticks=function(n){var r=t();return Fv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Qv(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],o=r[a],l,u,c=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);c-- >0;){if(u=rc(s,o,n),u===l)return r[i]=s,r[a]=o,t(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return e},e}function ni(){var e=Am();return e.copy=function(){return Mm(e,ni())},Tm.apply(e,arguments),Jv(e)}function tb(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}const Ds=new Date,Os=new Date;function fe(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let u;do l.push(u=new Date(+a)),t(a,o),e(a);while(u<a&&a<s);return l},i.filter=a=>fe(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Ds.setTime(+a),Os.setTime(+s),e(Ds),e(Os),Math.floor(n(Ds,Os))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Ba=fe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ba.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fe(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ba);Ba.range;const $n=1e3,cn=$n*60,Ln=cn*60,Bn=Ln*24,Bc=Bn*7,ah=Bn*30,Ps=Bn*365,Ur=fe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$n)},(e,t)=>(t-e)/$n,e=>e.getUTCSeconds());Ur.range;const Uc=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$n)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getMinutes());Uc.range;const eb=fe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getUTCMinutes());eb.range;const Hc=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$n-e.getMinutes()*cn)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getHours());Hc.range;const nb=fe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getUTCHours());nb.range;const ea=fe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cn)/Bn,e=>e.getDate()-1);ea.range;const jc=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bn,e=>e.getUTCDate()-1);jc.range;const rb=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bn,e=>Math.floor(e/Bn));rb.range;function kr(e){return fe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*cn)/Bc)}const rs=kr(0),Ua=kr(1),ib=kr(2),ab=kr(3),ri=kr(4),sb=kr(5),ob=kr(6);rs.range;Ua.range;ib.range;ab.range;ri.range;sb.range;ob.range;function Cr(e){return fe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Bc)}const Em=Cr(0),Ha=Cr(1),lb=Cr(2),ub=Cr(3),ii=Cr(4),cb=Cr(5),fb=Cr(6);Em.range;Ha.range;lb.range;ub.range;ii.range;cb.range;fb.range;const Gc=fe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Gc.range;const hb=fe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());hb.range;const Un=fe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Un.range;const Mr=fe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Mr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Mr.range;function pb(e,t,n,r,i,a){const s=[[Ur,1,$n],[Ur,5,5*$n],[Ur,15,15*$n],[Ur,30,30*$n],[a,1,cn],[a,5,5*cn],[a,15,15*cn],[a,30,30*cn],[i,1,Ln],[i,3,3*Ln],[i,6,6*Ln],[i,12,12*Ln],[r,1,Bn],[r,2,2*Bn],[n,1,Bc],[t,1,ah],[t,3,3*ah],[e,1,Ps]];function o(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),g=p?p.range(u,+c+1):[];return h?g.reverse():g}function l(u,c,f){const h=Math.abs(c-u)/f,p=Ic(([,,m])=>m).right(s,h);if(p===s.length)return e.every(ic(u/Ps,c/Ps,f));if(p===0)return Ba.every(Math.max(ic(u,c,f),1));const[g,d]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(d)}return[o,l]}const[db,gb]=pb(Un,Gc,rs,ea,Hc,Uc);function Fs(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ns(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _i(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function mb(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,u=xi(i),c=vi(i),f=xi(a),h=vi(a),p=xi(s),g=vi(s),d=xi(o),m=vi(o),x=xi(l),y=vi(l),v={a:F,A:j,b:$,B:it,c:null,d:fh,e:fh,f:Ib,g:Kb,G:Zb,H:$b,I:Lb,j:qb,L:Dm,m:zb,M:Bb,p:et,q:nt,Q:dh,s:gh,S:Ub,u:Hb,U:jb,V:Gb,w:Yb,W:Xb,x:null,X:null,y:Wb,Y:Vb,Z:Qb,"%":ph},_={a:J,A:lt,b:I,B:Q,c:null,d:hh,e:hh,f:nw,g:hw,G:dw,H:Jb,I:tw,j:ew,L:Pm,m:rw,M:iw,p:at,q:K,Q:dh,s:gh,S:aw,u:sw,U:ow,V:lw,w:uw,W:cw,x:null,X:null,y:fw,Y:pw,Z:gw,"%":ph},S={a:R,A:C,b:O,B:D,c:N,d:uh,e:uh,f:Ob,g:lh,G:oh,H:ch,I:ch,j:Cb,L:Db,m:kb,M:Rb,p:A,q:Ab,Q:Fb,s:Nb,S:Eb,u:bb,U:wb,V:Sb,w:vb,W:Tb,x:H,X:q,y:lh,Y:oh,Z:Mb,"%":Pb};v.x=w(n,v),v.X=w(r,v),v.c=w(t,v),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_);function w(k,z){return function(E){var T=[],X=-1,V=0,G=k.length,ut,U,ot;for(E instanceof Date||(E=new Date(+E));++X<G;)k.charCodeAt(X)===37&&(T.push(k.slice(V,X)),(U=sh[ut=k.charAt(++X)])!=null?ut=k.charAt(++X):U=ut==="e"?" ":"0",(ot=z[ut])&&(ut=ot(E,U)),T.push(ut),V=X+1);return T.push(k.slice(V,X)),T.join("")}}function b(k,z){return function(E){var T=_i(1900,void 0,1),X=M(T,k,E+="",0),V,G;if(X!=E.length)return null;if("Q"in T)return new Date(T.Q);if("s"in T)return new Date(T.s*1e3+("L"in T?T.L:0));if(z&&!("Z"in T)&&(T.Z=0),"p"in T&&(T.H=T.H%12+T.p*12),T.m===void 0&&(T.m="q"in T?T.q:0),"V"in T){if(T.V<1||T.V>53)return null;"w"in T||(T.w=1),"Z"in T?(V=Ns(_i(T.y,0,1)),G=V.getUTCDay(),V=G>4||G===0?Ha.ceil(V):Ha(V),V=jc.offset(V,(T.V-1)*7),T.y=V.getUTCFullYear(),T.m=V.getUTCMonth(),T.d=V.getUTCDate()+(T.w+6)%7):(V=Fs(_i(T.y,0,1)),G=V.getDay(),V=G>4||G===0?Ua.ceil(V):Ua(V),V=ea.offset(V,(T.V-1)*7),T.y=V.getFullYear(),T.m=V.getMonth(),T.d=V.getDate()+(T.w+6)%7)}else("W"in T||"U"in T)&&("w"in T||(T.w="u"in T?T.u%7:"W"in T?1:0),G="Z"in T?Ns(_i(T.y,0,1)).getUTCDay():Fs(_i(T.y,0,1)).getDay(),T.m=0,T.d="W"in T?(T.w+6)%7+T.W*7-(G+5)%7:T.w+T.U*7-(G+6)%7);return"Z"in T?(T.H+=T.Z/100|0,T.M+=T.Z%100,Ns(T)):Fs(T)}}function M(k,z,E,T){for(var X=0,V=z.length,G=E.length,ut,U;X<V;){if(T>=G)return-1;if(ut=z.charCodeAt(X++),ut===37){if(ut=z.charAt(X++),U=S[ut in sh?z.charAt(X++):ut],!U||(T=U(k,E,T))<0)return-1}else if(ut!=E.charCodeAt(T++))return-1}return T}function A(k,z,E){var T=u.exec(z.slice(E));return T?(k.p=c.get(T[0].toLowerCase()),E+T[0].length):-1}function R(k,z,E){var T=p.exec(z.slice(E));return T?(k.w=g.get(T[0].toLowerCase()),E+T[0].length):-1}function C(k,z,E){var T=f.exec(z.slice(E));return T?(k.w=h.get(T[0].toLowerCase()),E+T[0].length):-1}function O(k,z,E){var T=x.exec(z.slice(E));return T?(k.m=y.get(T[0].toLowerCase()),E+T[0].length):-1}function D(k,z,E){var T=d.exec(z.slice(E));return T?(k.m=m.get(T[0].toLowerCase()),E+T[0].length):-1}function N(k,z,E){return M(k,t,z,E)}function H(k,z,E){return M(k,n,z,E)}function q(k,z,E){return M(k,r,z,E)}function F(k){return s[k.getDay()]}function j(k){return a[k.getDay()]}function $(k){return l[k.getMonth()]}function it(k){return o[k.getMonth()]}function et(k){return i[+(k.getHours()>=12)]}function nt(k){return 1+~~(k.getMonth()/3)}function J(k){return s[k.getUTCDay()]}function lt(k){return a[k.getUTCDay()]}function I(k){return l[k.getUTCMonth()]}function Q(k){return o[k.getUTCMonth()]}function at(k){return i[+(k.getUTCHours()>=12)]}function K(k){return 1+~~(k.getUTCMonth()/3)}return{format:function(k){var z=w(k+="",v);return z.toString=function(){return k},z},parse:function(k){var z=b(k+="",!1);return z.toString=function(){return k},z},utcFormat:function(k){var z=w(k+="",_);return z.toString=function(){return k},z},utcParse:function(k){var z=b(k+="",!0);return z.toString=function(){return k},z}}}var sh={"-":"",_:" ",0:"0"},de=/^\s*\d+/,yb=/^%/,_b=/[\\^$*+?|[\]().{}]/g;function Ct(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function xb(e){return e.replace(_b,"\\$&")}function xi(e){return new RegExp("^(?:"+e.map(xb).join("|")+")","i")}function vi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function vb(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bb(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Sb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function oh(e,t,n){var r=de.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function lh(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mb(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ab(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function kb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uh(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cb(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ch(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Rb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Eb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Db(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ob(e,t,n){var r=de.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pb(e,t,n){var r=yb.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Fb(e,t,n){var r=de.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Nb(e,t,n){var r=de.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function fh(e,t){return Ct(e.getDate(),t,2)}function $b(e,t){return Ct(e.getHours(),t,2)}function Lb(e,t){return Ct(e.getHours()%12||12,t,2)}function qb(e,t){return Ct(1+ea.count(Un(e),e),t,3)}function Dm(e,t){return Ct(e.getMilliseconds(),t,3)}function Ib(e,t){return Dm(e,t)+"000"}function zb(e,t){return Ct(e.getMonth()+1,t,2)}function Bb(e,t){return Ct(e.getMinutes(),t,2)}function Ub(e,t){return Ct(e.getSeconds(),t,2)}function Hb(e){var t=e.getDay();return t===0?7:t}function jb(e,t){return Ct(rs.count(Un(e)-1,e),t,2)}function Om(e){var t=e.getDay();return t>=4||t===0?ri(e):ri.ceil(e)}function Gb(e,t){return e=Om(e),Ct(ri.count(Un(e),e)+(Un(e).getDay()===4),t,2)}function Yb(e){return e.getDay()}function Xb(e,t){return Ct(Ua.count(Un(e)-1,e),t,2)}function Wb(e,t){return Ct(e.getFullYear()%100,t,2)}function Kb(e,t){return e=Om(e),Ct(e.getFullYear()%100,t,2)}function Vb(e,t){return Ct(e.getFullYear()%1e4,t,4)}function Zb(e,t){var n=e.getDay();return e=n>=4||n===0?ri(e):ri.ceil(e),Ct(e.getFullYear()%1e4,t,4)}function Qb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ct(t/60|0,"0",2)+Ct(t%60,"0",2)}function hh(e,t){return Ct(e.getUTCDate(),t,2)}function Jb(e,t){return Ct(e.getUTCHours(),t,2)}function tw(e,t){return Ct(e.getUTCHours()%12||12,t,2)}function ew(e,t){return Ct(1+jc.count(Mr(e),e),t,3)}function Pm(e,t){return Ct(e.getUTCMilliseconds(),t,3)}function nw(e,t){return Pm(e,t)+"000"}function rw(e,t){return Ct(e.getUTCMonth()+1,t,2)}function iw(e,t){return Ct(e.getUTCMinutes(),t,2)}function aw(e,t){return Ct(e.getUTCSeconds(),t,2)}function sw(e){var t=e.getUTCDay();return t===0?7:t}function ow(e,t){return Ct(Em.count(Mr(e)-1,e),t,2)}function Fm(e){var t=e.getUTCDay();return t>=4||t===0?ii(e):ii.ceil(e)}function lw(e,t){return e=Fm(e),Ct(ii.count(Mr(e),e)+(Mr(e).getUTCDay()===4),t,2)}function uw(e){return e.getUTCDay()}function cw(e,t){return Ct(Ha.count(Mr(e)-1,e),t,2)}function fw(e,t){return Ct(e.getUTCFullYear()%100,t,2)}function hw(e,t){return e=Fm(e),Ct(e.getUTCFullYear()%100,t,2)}function pw(e,t){return Ct(e.getUTCFullYear()%1e4,t,4)}function dw(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ii(e):ii.ceil(e),Ct(e.getUTCFullYear()%1e4,t,4)}function gw(){return"+0000"}function ph(){return"%"}function dh(e){return+e}function gh(e){return Math.floor(+e/1e3)}var Lr,Nm;mw({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function mw(e){return Lr=mb(e),Nm=Lr.format,Lr.parse,Lr.utcFormat,Lr.utcParse,Lr}function yw(e){return new Date(e)}function _w(e){return e instanceof Date?+e:+new Date(+e)}function $m(e,t,n,r,i,a,s,o,l,u){var c=Am(),f=c.invert,h=c.domain,p=u(".%L"),g=u(":%S"),d=u("%I:%M"),m=u("%I %p"),x=u("%a %d"),y=u("%b %d"),v=u("%B"),_=u("%Y");function S(w){return(l(w)<w?p:o(w)<w?g:s(w)<w?d:a(w)<w?m:r(w)<w?i(w)<w?x:y:n(w)<w?v:_)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?h(Array.from(w,_w)):h().map(yw)},c.ticks=function(w){var b=h();return e(b[0],b[b.length-1],w??10)},c.tickFormat=function(w,b){return b==null?S:u(b)},c.nice=function(w){var b=h();return(!w||typeof w.range!="function")&&(w=t(b[0],b[b.length-1],w??10)),w?h(tb(b,w)):c},c.copy=function(){return Mm(c,$m(e,t,n,r,i,a,s,o,l,u))},c}function Yr(){return Tm.apply($m(db,gb,Un,Gc,rs,ea,Hc,Uc,Ur,Nm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Wt(e){return function(){return e}}const sc=Math.PI,oc=2*sc,pr=1e-6,xw=oc-pr;function Lm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function vw(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Lm;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class bw{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Lm:vw(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=r-t,u=i-n,c=s-t,f=o-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>pr)if(!(Math.abs(f*l-u*c)>pr)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,g=i-o,d=l*l+u*u,m=p*p+g*g,x=Math.sqrt(d),y=Math.sqrt(h),v=a*Math.tan((sc-Math.acos((d+h-m)/(2*x*y)))/2),_=v/y,S=v/x;Math.abs(_-1)>pr&&this._append`L${t+_*c},${n+_*f}`,this._append`A${a},${a},0,0,${+(f*p>c*g)},${this._x1=t+S*l},${this._y1=n+S*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),u=t+o,c=n+l,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>pr||Math.abs(this._y1-c)>pr)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%oc+oc),h>xw?this._append`A${r},${r},0,1,${f},${t-o},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>pr&&this._append`A${r},${r},0,${+(h>=sc)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function qm(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new bw(t)}function Yc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Im(e){this._context=e}Im.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ar(e){return new Im(e)}function zm(e){return e[0]}function Bm(e){return e[1]}function Um(e,t){var n=Wt(!0),r=null,i=Ar,a=null,s=qm(o);e=typeof e=="function"?e:e===void 0?zm:Wt(e),t=typeof t=="function"?t:t===void 0?Bm:Wt(t);function o(l){var u,c=(l=Yc(l)).length,f,h=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,l),+t(f,u,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Wt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Wt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Wt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function is(e,t,n){var r=null,i=Wt(!0),a=null,s=Ar,o=null,l=qm(u);e=typeof e=="function"?e:e===void 0?zm:Wt(+e),t=typeof t=="function"?t:Wt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Bm:Wt(+n);function u(f){var h,p,g,d=(f=Yc(f)).length,m,x=!1,y,v=new Array(d),_=new Array(d);for(a==null&&(o=s(y=l())),h=0;h<=d;++h){if(!(h<d&&i(m=f[h],h,f))===x)if(x=!x)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(v[g],_[g]);o.lineEnd(),o.areaEnd()}x&&(v[h]=+e(m,h,f),_[h]=+t(m,h,f),o.point(r?+r(m,h,f):v[h],n?+n(m,h,f):_[h]))}if(y)return o=null,y+""||null}function c(){return Um().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Wt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Wt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Wt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Wt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Wt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Wt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Wt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(o=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=o=null:o=s(a=f),u):a},u}function mh(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function yh(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ww(e,t){return e[t]}function Sw(e){const t=[];return t.key=e,t}function Gi(){var e=Wt([]),t=yh,n=mh,r=ww;function i(a){var s=Array.from(e.apply(this,arguments),Sw),o,l=s.length,u=-1,c;for(const f of a)for(o=0,++u;o<l;++o)(s[o][u]=[0,+r(f,s[o].key,u,a)]).data=f;for(o=0,c=Yc(t(s));o<l;++o)s[c[o]].index=o;return n(s,c),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Wt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Wt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?yh:typeof a=="function"?a:Wt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??mh,i):n},i}function Fn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
1
|
+
"use strict";var Hy=Object.defineProperty;var jy=(e,t,n)=>t in e?Hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yi=(e,t,n)=>jy(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),q=require("@mui/material"),G=require("react"),Qg=require("@mui/icons-material");function Gy(e){return e}var Ss=1,Ts=2,Yu=3,Ai=4,Of=1e-6;function Yy(e){return"translate("+e+",0)"}function Wy(e){return"translate(0,"+e+")"}function Xy(e){return t=>+e(t)}function Ky(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Vy(){return!this.__axis}function Jg(e,t){var n=[],r=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===Ss||e===Ai?-1:1,c=e===Ai||e===Ts?"x":"y",f=e===Ss||e===Yu?Yy:Wy;function h(p){var g=r??(t.ticks?t.ticks.apply(t,n):t.domain()),d=i??(t.tickFormat?t.tickFormat.apply(t,n):Gy),m=Math.max(a,0)+o,x=t.range(),y=+x[0]+l,v=+x[x.length-1]+l,_=(t.bandwidth?Ky:Xy)(t.copy(),l),S=p.selection?p.selection():p,w=S.selectAll(".domain").data([null]),b=S.selectAll(".tick").data(g,t).order(),M=b.exit(),A=b.enter().append("g").attr("class","tick"),k=b.select("line"),C=b.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(A),k=k.merge(A.append("line").attr("stroke","currentColor").attr(c+"2",u*a)),C=C.merge(A.append("text").attr("fill","currentColor").attr(c,u*m).attr("dy",e===Ss?"0em":e===Yu?"0.71em":"0.32em")),p!==S&&(w=w.transition(p),b=b.transition(p),k=k.transition(p),C=C.transition(p),M=M.transition(p).attr("opacity",Of).attr("transform",function(O){return isFinite(O=_(O))?f(O+l):this.getAttribute("transform")}),A.attr("opacity",Of).attr("transform",function(O){var P=this.parentNode.__axis;return f((P&&isFinite(P=P(O))?P:_(O))+l)})),M.remove(),w.attr("d",e===Ai||e===Ts?s?"M"+u*s+","+y+"H"+l+"V"+v+"H"+u*s:"M"+l+","+y+"V"+v:s?"M"+y+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+y+","+l+"H"+v),b.attr("opacity",1).attr("transform",function(O){return f(_(O)+l)}),k.attr(c+"2",u*a),C.attr(c,u*m).text(d),S.filter(Vy).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ts?"start":e===Ai?"end":"middle"),S.each(function(){this.__axis=_})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(a=s=+p,h):a},h.tickSizeInner=function(p){return arguments.length?(a=+p,h):a},h.tickSizeOuter=function(p){return arguments.length?(s=+p,h):s},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function qn(e){return Jg(Yu,e)}function In(e){return Jg(Ai,e)}var Zy={value:()=>{}};function Dc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ta(n)}function Ta(e){this._=e}function Qy(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ta.prototype=Dc.prototype={constructor:Ta,on:function(e,t){var n=this._,r=Qy(e+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(e=r[a]).type)&&(i=Jy(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=r[a]).type)n[i]=Pf(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Pf(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ta(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Jy(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Pf(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Zy,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Wu="http://www.w3.org/1999/xhtml";const Ff={svg:"http://www.w3.org/2000/svg",xhtml:Wu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ts(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ff.hasOwnProperty(t)?{space:Ff[t],local:e}:e}function t_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Wu&&t.documentElement.namespaceURI===Wu?t.createElement(e):t.createElementNS(n,e)}}function e_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tm(e){var t=ts(e);return(t.local?e_:t_)(t)}function n_(){}function Oc(e){return e==null?n_:function(){return this.querySelector(e)}}function r_(e){typeof e!="function"&&(e=Oc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=new Array(s),l,u,c=0;c<s;++c)(l=a[c])&&(u=e.call(l,l.__data__,c,a))&&("__data__"in l&&(u.__data__=l.__data__),o[c]=u);return new nn(r,this._parents)}function i_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function a_(){return[]}function em(e){return e==null?a_:function(){return this.querySelectorAll(e)}}function s_(e){return function(){return i_(e.apply(this,arguments))}}function o_(e){typeof e=="function"?e=s_(e):e=em(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var s=t[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),i.push(l));return new nn(r,i)}function nm(e){return function(){return this.matches(e)}}function rm(e){return function(t){return t.matches(e)}}var l_=Array.prototype.find;function u_(e){return function(){return l_.call(this.children,e)}}function c_(){return this.firstElementChild}function f_(e){return this.select(e==null?c_:u_(typeof e=="function"?e:rm(e)))}var h_=Array.prototype.filter;function p_(){return Array.from(this.children)}function d_(e){return function(){return h_.call(this.children,e)}}function g_(e){return this.selectAll(e==null?p_:d_(typeof e=="function"?e:rm(e)))}function m_(e){typeof e!="function"&&(e=nm(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new nn(r,this._parents)}function im(e){return new Array(e.length)}function y_(){return new nn(this._enter||this._groups.map(im),this._parents)}function Oa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Oa.prototype={constructor:Oa,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)}};function __(e){return function(){return e}}function x_(e,t,n,r,i,a){for(var s=0,o,l=t.length,u=a.length;s<u;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new Oa(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function v_(e,t,n,r,i,a,s){var o,l,u=new Map,c=t.length,f=a.length,h=new Array(c),p;for(o=0;o<c;++o)(l=t[o])&&(h[o]=p=s.call(l,l.__data__,o,t)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<f;++o)p=s.call(e,a[o],o,a)+"",(l=u.get(p))?(r[o]=l,l.__data__=a[o],u.delete(p)):n[o]=new Oa(e,a[o]);for(o=0;o<c;++o)(l=t[o])&&u.get(h[o])===l&&(i[o]=l)}function b_(e){return e.__data__}function w_(e,t){if(!arguments.length)return Array.from(this,b_);var n=t?v_:x_,r=this._parents,i=this._groups;typeof e!="function"&&(e=__(e));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),u=0;u<a;++u){var c=r[u],f=i[u],h=f.length,p=S_(e.call(c,c&&c.__data__,u,r)),g=p.length,d=o[u]=new Array(g),m=s[u]=new Array(g),x=l[u]=new Array(h);n(c,f,d,m,x,p,t);for(var y=0,v=0,_,S;y<g;++y)if(_=d[y]){for(y>=v&&(v=y+1);!(S=m[v])&&++v<g;);_._next=S||null}}return s=new nn(s,r),s._enter=o,s._exit=l,s}function S_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function T_(){return new nn(this._exit||this._groups.map(im),this._parents)}function M_(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function A_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var u=n[l],c=r[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g]||c[g])&&(h[g]=p);for(;l<i;++l)o[l]=n[l];return new nn(o,this._parents)}function k_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function C_(e){e||(e=R_);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var s=n[a],o=s.length,l=i[a]=new Array(o),u,c=0;c<o;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new nn(i,this._parents).order()}function R_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function E_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function D_(){return Array.from(this)}function O_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function P_(){let e=0;for(const t of this)++e;return e}function F_(){return!this.node()}function $_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function L_(e){return function(){this.removeAttribute(e)}}function N_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function q_(e,t){return function(){this.setAttribute(e,t)}}function I_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function z_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function B_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function U_(e,t){var n=ts(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?N_:L_:typeof t=="function"?n.local?B_:z_:n.local?I_:q_)(n,t))}function am(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function H_(e){return function(){this.style.removeProperty(e)}}function j_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function G_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Y_(e,t,n){return arguments.length>1?this.each((t==null?H_:typeof t=="function"?G_:j_)(e,t,n??"")):ti(this.node(),e)}function ti(e,t){return e.style.getPropertyValue(t)||am(e).getComputedStyle(e,null).getPropertyValue(t)}function W_(e){return function(){delete this[e]}}function X_(e,t){return function(){this[e]=t}}function K_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function V_(e,t){return arguments.length>1?this.each((t==null?W_:typeof t=="function"?K_:X_)(e,t)):this.node()[e]}function sm(e){return e.trim().split(/^|\s+/)}function Pc(e){return e.classList||new om(e)}function om(e){this._node=e,this._names=sm(e.getAttribute("class")||"")}om.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function lm(e,t){for(var n=Pc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function um(e,t){for(var n=Pc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Z_(e){return function(){lm(this,e)}}function Q_(e){return function(){um(this,e)}}function J_(e,t){return function(){(t.apply(this,arguments)?lm:um)(this,e)}}function t1(e,t){var n=sm(e+"");if(arguments.length<2){for(var r=Pc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?J_:t?Z_:Q_)(n,t))}function e1(){this.textContent=""}function n1(e){return function(){this.textContent=e}}function r1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function i1(e){return arguments.length?this.each(e==null?e1:(typeof e=="function"?r1:n1)(e)):this.node().textContent}function a1(){this.innerHTML=""}function s1(e){return function(){this.innerHTML=e}}function o1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function l1(e){return arguments.length?this.each(e==null?a1:(typeof e=="function"?o1:s1)(e)):this.node().innerHTML}function u1(){this.nextSibling&&this.parentNode.appendChild(this)}function c1(){return this.each(u1)}function f1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h1(){return this.each(f1)}function p1(e){var t=typeof e=="function"?e:tm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function d1(){return null}function g1(e,t){var n=typeof e=="function"?e:tm(e),r=t==null?d1:typeof t=="function"?t:Oc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function m1(){var e=this.parentNode;e&&e.removeChild(this)}function y1(){return this.each(m1)}function _1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function x1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function v1(e){return this.select(e?x1:_1)}function b1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function w1(e){return function(t){e.call(this,t,this.__data__)}}function S1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function T1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function M1(e,t,n){return function(){var r=this.__on,i,a=w1(t);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function A1(e,t,n){var r=S1(e+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,c;l<u;++l)for(i=0,c=o[l];i<a;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(o=t?M1:T1,i=0;i<a;++i)this.each(o(r[i],t,n));return this}function cm(e,t,n){var r=am(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function k1(e,t){return function(){return cm(this,e,t)}}function C1(e,t){return function(){return cm(this,e,t.apply(this,arguments))}}function R1(e,t){return this.each((typeof t=="function"?C1:k1)(e,t))}function*E1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var fm=[null];function nn(e,t){this._groups=e,this._parents=t}function hi(){return new nn([[document.documentElement]],fm)}function D1(){return this}nn.prototype=hi.prototype={constructor:nn,select:r_,selectAll:o_,selectChild:f_,selectChildren:g_,filter:m_,data:w_,enter:y_,exit:T_,join:M_,merge:A_,selection:D1,order:k_,sort:C_,call:E_,nodes:D_,node:O_,size:P_,empty:F_,each:$_,attr:U_,style:Y_,property:V_,classed:t1,text:i1,html:l1,raise:c1,lower:h1,append:p1,insert:g1,remove:y1,clone:v1,datum:b1,on:A1,dispatch:R1,[Symbol.iterator]:E1};function Ot(e){return typeof e=="string"?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],fm)}function O1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=O1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Xu={capture:!0,passive:!1};function Ku(e){e.preventDefault(),e.stopImmediatePropagation()}function P1(e){var t=e.document.documentElement,n=Ot(e).on("dragstart.drag",Ku,Xu);"onselectstart"in t?n.on("selectstart.drag",Ku,Xu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function F1(e,t){var n=e.document.documentElement,r=Ot(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ku,Xu),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 Fc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ea(){}var Hi=.7,Pa=1/Hi,Yr="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$1=/^#([0-9a-f]{3,8})$/,L1=new RegExp(`^rgb\\(${Yr},${Yr},${Yr}\\)$`),N1=new RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`),q1=new RegExp(`^rgba\\(${Yr},${Yr},${Yr},${ji}\\)$`),I1=new RegExp(`^rgba\\(${Mn},${Mn},${Mn},${ji}\\)$`),z1=new RegExp(`^hsl\\(${ji},${Mn},${Mn}\\)$`),B1=new RegExp(`^hsla\\(${ji},${Mn},${Mn},${ji}\\)$`),$f={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};Fc(ea,Tr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lf,formatHex:Lf,formatHex8:U1,formatHsl:H1,formatRgb:Nf,toString:Nf});function Lf(){return this.rgb().formatHex()}function U1(){return this.rgb().formatHex8()}function H1(){return pm(this).formatHsl()}function Nf(){return this.rgb().formatRgb()}function Tr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qf(t):n===3?new Ne(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ga(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ga(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=L1.exec(e))?new Ne(t[1],t[2],t[3],1):(t=N1.exec(e))?new Ne(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=q1.exec(e))?ga(t[1],t[2],t[3],t[4]):(t=I1.exec(e))?ga(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=z1.exec(e))?Bf(t[1],t[2]/100,t[3]/100,1):(t=B1.exec(e))?Bf(t[1],t[2]/100,t[3]/100,t[4]):$f.hasOwnProperty(e)?qf($f[e]):e==="transparent"?new Ne(NaN,NaN,NaN,0):null}function qf(e){return new Ne(e>>16&255,e>>8&255,e&255,1)}function ga(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ne(e,t,n,r)}function j1(e){return e instanceof ea||(e=Tr(e)),e?(e=e.rgb(),new Ne(e.r,e.g,e.b,e.opacity)):new Ne}function Vu(e,t,n,r){return arguments.length===1?j1(e):new Ne(e,t,n,r??1)}function Ne(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fc(Ne,Vu,hm(ea,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hi:Math.pow(Hi,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ne(xr(this.r),xr(this.g),xr(this.b),Fa(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:If,formatHex:If,formatHex8:G1,formatRgb:zf,toString:zf}));function If(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function G1(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function zf(){const e=Fa(this.opacity);return`${e===1?"rgb(":"rgba("}${xr(this.r)}, ${xr(this.g)}, ${xr(this.b)}${e===1?")":`, ${e})`}`}function Fa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=xr(e),(e<16?"0":"")+e.toString(16)}function Bf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yn(e,t,n,r)}function pm(e){if(e instanceof yn)return new yn(e.h,e.s,e.l,e.opacity);if(e instanceof ea||(e=Tr(e)),!e)return new yn;if(e instanceof yn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new yn(s,o,l,e.opacity)}function Y1(e,t,n,r){return arguments.length===1?pm(e):new yn(e,t,n,r??1)}function yn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fc(yn,Y1,hm(ea,{brighter(e){return e=e==null?Pa:Math.pow(Pa,e),new yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hi:Math.pow(Hi,e),new yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ne(Ms(e>=240?e-240:e+120,i,r),Ms(e,i,r),Ms(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new yn(Uf(this.h),ma(this.s),ma(this.l),Fa(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=Fa(this.opacity);return`${e===1?"hsl(":"hsla("}${Uf(this.h)}, ${ma(this.s)*100}%, ${ma(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Uf(e){return e=(e||0)%360,e<0?e+360:e}function ma(e){return Math.max(0,Math.min(1,e||0))}function Ms(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $c=e=>()=>e;function W1(e,t){return function(n){return e+n*t}}function X1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function K1(e){return(e=+e)==1?dm:function(t,n){return n-t?X1(t,n,e):$c(isNaN(t)?n:t)}}function dm(e,t){var n=t-e;return n?W1(e,n):$c(isNaN(e)?t:e)}const $a=(function e(t){var n=K1(t);function r(i,a){var s=n((i=Vu(i)).r,(a=Vu(a)).r),o=n(i.g,a.g),l=n(i.b,a.b),u=dm(i.opacity,a.opacity);return function(c){return i.r=s(c),i.g=o(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r})(1);function V1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Z1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Q1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=es(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function J1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function mn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function tx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=es(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Zu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,As=new RegExp(Zu.source,"g");function ex(e){return function(){return e}}function nx(e){return function(t){return e(t)+""}}function gm(e,t){var n=Zu.lastIndex=As.lastIndex=0,r,i,a,s=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Zu.exec(e))&&(i=As.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:mn(r,i)})),n=As.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?nx(l[0].x):ex(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)o[(f=l[c]).i]=f.x(u);return o.join("")})}function es(e,t){var n=typeof t,r;return t==null||n==="boolean"?$c(t):(n==="number"?mn:n==="string"?(r=Tr(t))?(t=r,$a):gm:t instanceof Tr?$a:t instanceof Date?J1:Z1(t)?V1:Array.isArray(t)?Q1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?tx:mn)(e,t)}function rx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Hf=180/Math.PI,Qu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mm(e,t,n,r,i,a){var s,o,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Hf,skewX:Math.atan(l)*Hf,scaleX:s,scaleY:o}}var ya;function ix(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qu:mm(t.a,t.b,t.c,t.d,t.e,t.f)}function ax(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?Qu:(e=e.matrix,mm(e.a,e.b,e.c,e.d,e.e,e.f))}function ym(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push("translate(",null,t,null,n);g.push({i:d-4,x:mn(u,f)},{i:d-2,x:mn(c,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function s(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:mn(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function o(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:mn(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,g){if(u!==f||c!==h){var d=p.push(i(p)+"scale(",null,",",null,")");g.push({i:d-4,x:mn(u,f)},{i:d-2,x:mn(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),o(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var g=-1,d=h.length,m;++g<d;)f[(m=h[g]).i]=m.x(p);return f.join("")}}}var sx=ym(ix,"px, ","px)","deg)"),ox=ym(ax,", ",")",")"),ei=0,ki=0,_i=0,_m=1e3,La,Ci,Na=0,Mr=0,ns=0,Gi=typeof performance=="object"&&performance.now?performance:Date,xm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Lc(){return Mr||(xm(lx),Mr=Gi.now()+ns)}function lx(){Mr=0}function qa(){this._call=this._time=this._next=null}qa.prototype=vm.prototype={constructor:qa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Lc():+n)+(t==null?0:+t),!this._next&&Ci!==this&&(Ci?Ci._next=this:La=this,Ci=this),this._call=e,this._time=n,Ju()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ju())}};function vm(e,t,n){var r=new qa;return r.restart(e,t,n),r}function ux(){Lc(),++ei;for(var e=La,t;e;)(t=Mr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ei}function jf(){Mr=(Na=Gi.now())+ns,ei=ki=0;try{ux()}finally{ei=0,fx(),Mr=0}}function cx(){var e=Gi.now(),t=e-Na;t>_m&&(ns-=t,Na=e)}function fx(){for(var e,t=La,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:La=n);Ci=e,Ju(r)}function Ju(e){if(!ei){ki&&(ki=clearTimeout(ki));var t=e-Mr;t>24?(e<1/0&&(ki=setTimeout(jf,e-Gi.now()-ns)),_i&&(_i=clearInterval(_i))):(_i||(Na=Gi.now(),_i=setInterval(cx,_m)),ei=1,xm(jf))}}function Gf(e,t,n){var r=new qa;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var hx=Dc("start","end","cancel","interrupt"),px=[],bm=0,Yf=1,tc=2,Ma=3,Wf=4,ec=5,Aa=6;function rs(e,t,n,r,i,a){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;dx(e,n,{name:t,index:r,group:i,on:hx,tween:px,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:bm})}function Nc(e,t){var n=_n(e,t);if(n.state>bm)throw new Error("too late; already scheduled");return n}function kn(e,t){var n=_n(e,t);if(n.state>Ma)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function dx(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vm(a,0,n.time);function a(u){n.state=Yf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,h,p;if(n.state!==Yf)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ma)return Gf(s);p.state===Wf?(p.state=Aa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Aa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(Gf(function(){n.state===Ma&&(n.state=Wf,n.timer.restart(o,n.delay,n.time),o(u))}),n.state=tc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tc){for(n.state=Ma,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function o(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ec,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);n.state===ec&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Aa,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function nc(e,t){var n=e.__transition,r,i,a=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){a=!1;continue}i=r.state>tc&&r.state<ec,r.state=Aa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}a&&delete e.__transition}}function gx(e){return this.each(function(){nc(this,e)})}function mx(e,t){var n,r;return function(){var i=kn(this,e),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function yx(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=kn(this,e),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=o;break}l===u&&i.push(o)}a.tween=i}}function _x(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=_n(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?mx:yx)(n,e,t))}function qc(e,t,n){var r=e._id;return e.each(function(){var i=kn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _n(i,r).value[t]}}function wm(e,t){var n;return(typeof t=="number"?mn:t instanceof Tr?$a:(n=Tr(t))?(t=n,$a):gm)(e,t)}function xx(e){return function(){this.removeAttribute(e)}}function vx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bx(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===r?a:a=t(r=s,n)}}function wx(e,t,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?a:a=t(r=s,n)}}function Sx(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function Tx(e,t,n){var r,i,a;return function(){var s,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=o+"",s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o)))}}function Mx(e,t){var n=ts(e),r=n==="transform"?ox:wm;return this.attrTween(e,typeof t=="function"?(n.local?Tx:Sx)(n,r,qc(this,"attr."+e,t)):t==null?(n.local?vx:xx)(n):(n.local?wx:bx)(n,r,t))}function Ax(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function kx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Cx(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&kx(e,a)),n}return i._value=t,i}function Rx(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Ax(e,a)),n}return i._value=t,i}function Ex(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ts(e);return this.tween(n,(r.local?Cx:Rx)(r,t))}function Dx(e,t){return function(){Nc(this,e).delay=+t.apply(this,arguments)}}function Ox(e,t){return t=+t,function(){Nc(this,e).delay=t}}function Px(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Dx:Ox)(t,e)):_n(this.node(),t).delay}function Fx(e,t){return function(){kn(this,e).duration=+t.apply(this,arguments)}}function $x(e,t){return t=+t,function(){kn(this,e).duration=t}}function Lx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fx:$x)(t,e)):_n(this.node(),t).duration}function Nx(e,t){if(typeof t!="function")throw new Error;return function(){kn(this,e).ease=t}}function qx(e){var t=this._id;return arguments.length?this.each(Nx(t,e)):_n(this.node(),t).ease}function Ix(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;kn(this,e).ease=n}}function zx(e){if(typeof e!="function")throw new Error;return this.each(Ix(this._id,e))}function Bx(e){typeof e!="function"&&(e=nm(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],s=a.length,o=r[i]=[],l,u=0;u<s;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&o.push(l);return new zn(r,this._parents,this._name,this._id)}function Ux(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var l=t[o],u=n[o],c=l.length,f=s[o]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;o<r;++o)s[o]=t[o];return new zn(s,this._parents,this._name,this._id)}function Hx(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function jx(e,t,n){var r,i,a=Hx(t)?Nc:kn;return function(){var s=a(this,e),o=s.on;o!==r&&(i=(r=o).copy()).on(t,n),s.on=i}}function Gx(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(jx(n,e,t))}function Yx(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Wx(){return this.on("end.remove",Yx(this._id))}function Xx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oc(e));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],l=o.length,u=a[s]=new Array(l),c,f,h=0;h<l;++h)(c=o[h])&&(f=e.call(c,c.__data__,h,o))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,rs(u[h],t,n,h,u,_n(c,n)));return new zn(a,this._parents,t,n)}function Kx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=em(e));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var l=r[o],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,g=_n(c,n),d=0,m=h.length;d<m;++d)(p=h[d])&&rs(p,t,n,d,h,g);a.push(h),s.push(c)}return new zn(a,s,t,n)}var Vx=hi.prototype.constructor;function Zx(){return new Vx(this._groups,this._parents)}function Qx(e,t){var n,r,i;return function(){var a=ti(this,e),s=(this.style.removeProperty(e),ti(this,e));return a===s?null:a===n&&s===r?i:i=t(n=a,r=s)}}function Sm(e){return function(){this.style.removeProperty(e)}}function Jx(e,t,n){var r,i=n+"",a;return function(){var s=ti(this,e);return s===i?null:s===r?a:a=t(r=s,n)}}function tv(e,t,n){var r,i,a;return function(){var s=ti(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),ti(this,e))),s===l?null:s===r&&l===i?a:(i=l,a=t(r=s,o))}}function ev(e,t){var n,r,i,a="style."+t,s="end."+a,o;return function(){var l=kn(this,e),u=l.on,c=l.value[a]==null?o||(o=Sm(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(s,i=c),l.on=r}}function nv(e,t,n){var r=(e+="")=="transform"?sx:wm;return t==null?this.styleTween(e,Qx(e,r)).on("end.style."+e,Sm(e)):typeof t=="function"?this.styleTween(e,tv(e,r,qc(this,"style."+e,t))).each(ev(this._id,e)):this.styleTween(e,Jx(e,r,t),n).on("end.style."+e,null)}function rv(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function iv(e,t,n){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&rv(e,s,n)),r}return a._value=t,a}function av(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,iv(e,t,n??""))}function sv(e){return function(){this.textContent=e}}function ov(e){return function(){var t=e(this);this.textContent=t??""}}function lv(e){return this.tween("text",typeof e=="function"?ov(qc(this,"text",e)):sv(e==null?"":e+""))}function uv(e){return function(t){this.textContent=e.call(this,t)}}function cv(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&uv(i)),t}return r._value=e,r}function fv(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cv(e))}function hv(){for(var e=this._name,t=this._id,n=Tm(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var c=_n(l,t);rs(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new zn(r,this._parents,e,n)}function pv(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};n.each(function(){var u=kn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),u.on=t}),i===0&&a()})}var dv=0;function zn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ic(e){return hi().transition(e)}function Tm(){return++dv}var Dn=hi.prototype;zn.prototype=Ic.prototype={constructor:zn,select:Xx,selectAll:Kx,selectChild:Dn.selectChild,selectChildren:Dn.selectChildren,filter:Bx,merge:Ux,selection:Zx,transition:hv,call:Dn.call,nodes:Dn.nodes,node:Dn.node,size:Dn.size,empty:Dn.empty,each:Dn.each,on:Gx,attr:Mx,attrTween:Ex,style:nv,styleTween:av,text:lv,textTween:fv,remove:Wx,tween:_x,delay:Px,duration:Lx,ease:qx,easeVarying:zx,end:pv,[Symbol.iterator]:Dn[Symbol.iterator]};function gv(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mv={time:null,delay:0,duration:250,ease:gv};function yv(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function _v(e){var t,n;e instanceof zn?(t=e._id,e=e._name):(t=Tm(),(n=mv).time=Lc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&rs(l,e,t,u,s,n||yv(l,t));return new zn(r,this._parents,e,t)}hi.prototype.interrupt=gx;hi.prototype.transition=_v;const ks=e=>()=>e;function xv(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function vv(e){e.stopImmediatePropagation()}function Cs(e){e.preventDefault(),e.stopImmediatePropagation()}var Xf={name:"drag"},Rs={name:"space"},Lr={name:"handle"},Nr={name:"center"};const{abs:Kf,max:Te,min:Me}=Math;function Vf(e){return[+e[0],+e[1]]}function Zf(e){return[Vf(e[0]),Vf(e[1])]}var ka={name:"x",handles:["w","e"].map(rc),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Es={},On={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Qf={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Jf={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},bv={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},wv={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function rc(e){return{type:e}}function Sv(e){return!e.ctrlKey&&!e.button}function Tv(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Mv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ds(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Av(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function pi(){return kv(ka)}function kv(e){var t=Tv,n=Sv,r=Mv,i=!0,a=Dc("start","brush","end"),s=6,o;function l(m){var x=m.property("__brush",d).selectAll(".overlay").data([rc("overlay")]);x.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",On.overlay).merge(x).each(function(){var v=Ds(this).extent;Ot(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([rc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",On.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=m.selectAll(".handle").data(e.handles,function(v){return v.type});y.exit().remove(),y.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return On[v.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,x,y){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,_=v.__brush,S=c(v,arguments),w=_.selection,b=e.input(typeof x=="function"?x.apply(this,arguments):x,_.extent),M=es(w,b);function A(k){_.selection=k===1&&b===null?null:M(k),u.call(v),S.brush()}return w!==null&&b!==null?A:A(1)}):m.each(function(){var v=this,_=arguments,S=v.__brush,w=e.input(typeof x=="function"?x.apply(v,_):x,S.extent),b=c(v,_).beforestart();nc(v),S.selection=w===null?null:w,u.call(v),b.start(y).brush(y).end(y)})},l.clear=function(m,x){l.move(m,null,x)};function u(){var m=Ot(this),x=Ds(this).selection;x?(m.selectAll(".selection").style("display",null).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?x[1][0]-s/2:x[0][0]-s/2}).attr("y",function(y){return y.type[0]==="s"?x[1][1]-s/2:x[0][1]-s/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?x[1][0]-x[0][0]+s:s}).attr("height",function(y){return y.type==="e"||y.type==="w"?x[1][1]-x[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,x,y){var v=m.__brush.emitter;return v&&(!y||!v.clean)?v:new f(m,x,y)}function f(m,x,y){this.that=m,this.args=x,this.state=m.__brush,this.active=0,this.clean=y}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,x){return this.starting?(this.starting=!1,this.emit("start",m,x)):this.emit("brush",m),this},brush:function(m,x){return this.emit("brush",m,x),this},end:function(m,x){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,x)),this},emit:function(m,x,y){var v=Ot(this.that).datum();a.call(m,this.that,new xv(m,{sourceEvent:x,target:l,selection:e.output(this.state.selection),mode:y,dispatch:a}),v)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var x=this,y=m.target.__data__.type,v=(i&&m.metaKey?y="overlay":y)==="selection"?Xf:i&&m.altKey?Nr:Lr,_=e===Es?null:bv[y],S=e===ka?null:wv[y],w=Ds(x),b=w.extent,M=w.selection,A=b[0][0],k,C,O=b[0][1],P,F,B=b[1][0],L,$,Y=b[1][1],I,et,K=0,J=0,st,lt=_&&S&&i&&m.shiftKey,N,j,nt=Array.from(m.touches||[m],H=>{const ot=H.identifier;return H=er(H,x),H.point0=H.slice(),H.identifier=ot,H});nc(x);var Z=c(x,arguments,!0).beforestart();if(y==="overlay"){M&&(st=!0);const H=[nt[0],nt[1]||nt[0]];w.selection=M=[[k=e===Es?A:Me(H[0][0],H[1][0]),P=e===ka?O:Me(H[0][1],H[1][1])],[L=e===Es?B:Te(H[0][0],H[1][0]),I=e===ka?Y:Te(H[0][1],H[1][1])]],nt.length>1&&X(m)}else k=M[0][0],P=M[0][1],L=M[1][0],I=M[1][1];C=k,F=P,$=L,et=I;var R=Ot(x).attr("pointer-events","none"),z=R.selectAll(".overlay").attr("cursor",On[y]);if(m.touches)Z.moved=T,Z.ended=Q;else{var D=Ot(m.view).on("mousemove.brush",T,!0).on("mouseup.brush",Q,!0);i&&D.on("keydown.brush",W,!0).on("keyup.brush",ut,!0),P1(m.view)}u.call(x),Z.start(m,v.name);function T(H){for(const ot of H.changedTouches||[H])for(const gt of nt)gt.identifier===ot.identifier&&(gt.cur=er(ot,x));if(lt&&!N&&!j&&nt.length===1){const ot=nt[0];Kf(ot.cur[0]-ot[0])>Kf(ot.cur[1]-ot[1])?j=!0:N=!0}for(const ot of nt)ot.cur&&(ot[0]=ot.cur[0],ot[1]=ot.cur[1]);st=!0,Cs(H),X(H)}function X(H){const ot=nt[0],gt=ot.point0;var yt;switch(K=ot[0]-gt[0],J=ot[1]-gt[1],v){case Rs:case Xf:{_&&(K=Te(A-k,Me(B-L,K)),C=k+K,$=L+K),S&&(J=Te(O-P,Me(Y-I,J)),F=P+J,et=I+J);break}case Lr:{nt[1]?(_&&(C=Te(A,Me(B,nt[0][0])),$=Te(A,Me(B,nt[1][0])),_=1),S&&(F=Te(O,Me(Y,nt[0][1])),et=Te(O,Me(Y,nt[1][1])),S=1)):(_<0?(K=Te(A-k,Me(B-k,K)),C=k+K,$=L):_>0&&(K=Te(A-L,Me(B-L,K)),C=k,$=L+K),S<0?(J=Te(O-P,Me(Y-P,J)),F=P+J,et=I):S>0&&(J=Te(O-I,Me(Y-I,J)),F=P,et=I+J));break}case Nr:{_&&(C=Te(A,Me(B,k-K*_)),$=Te(A,Me(B,L+K*_))),S&&(F=Te(O,Me(Y,P-J*S)),et=Te(O,Me(Y,I+J*S)));break}}$<C&&(_*=-1,yt=k,k=L,L=yt,yt=C,C=$,$=yt,y in Qf&&z.attr("cursor",On[y=Qf[y]])),et<F&&(S*=-1,yt=P,P=I,I=yt,yt=F,F=et,et=yt,y in Jf&&z.attr("cursor",On[y=Jf[y]])),w.selection&&(M=w.selection),N&&(C=M[0][0],$=M[1][0]),j&&(F=M[0][1],et=M[1][1]),(M[0][0]!==C||M[0][1]!==F||M[1][0]!==$||M[1][1]!==et)&&(w.selection=[[C,F],[$,et]],u.call(x),Z.brush(H,v.name))}function Q(H){if(vv(H),H.touches){if(H.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else F1(H.view,st),D.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);R.attr("pointer-events","all"),z.attr("cursor",On.overlay),w.selection&&(M=w.selection),Av(M)&&(w.selection=null,u.call(x)),Z.end(H,v.name)}function W(H){switch(H.keyCode){case 16:{lt=_&&S;break}case 18:{v===Lr&&(_&&(L=$-K*_,k=C+K*_),S&&(I=et-J*S,P=F+J*S),v=Nr,X(H));break}case 32:{(v===Lr||v===Nr)&&(_<0?L=$-K:_>0&&(k=C-K),S<0?I=et-J:S>0&&(P=F-J),v=Rs,z.attr("cursor",On.selection),X(H));break}default:return}Cs(H)}function ut(H){switch(H.keyCode){case 16:{lt&&(N=j=lt=!1,X(H));break}case 18:{v===Nr&&(_<0?L=$:_>0&&(k=C),S<0?I=et:S>0&&(P=F),v=Lr,X(H));break}case 32:{v===Rs&&(H.altKey?(_&&(L=$-K*_,k=C+K*_),S&&(I=et-J*S,P=F+J*S),v=Nr):(_<0?L=$:_>0&&(k=C),S<0?I=et:S>0&&(P=F),v=Lr),z.attr("cursor",On[y]),X(H));break}default:return}Cs(H)}}function p(m){c(this,arguments).moved(m)}function g(m){c(this,arguments).ended(m)}function d(){var m=this.__brush||{selection:null};return m.extent=Zf(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:ks(Zf(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:ks(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:ks(!!m),l):r},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=a.on.apply(a,arguments);return m===a?l:m},l}function Ca(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Cv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zc(e){let t,n,r;e.length!==2?(t=Ca,n=(o,l)=>Ca(e(o),l),r=(o,l)=>e(o)-l):(t=e===Ca||e===Cv?e:Rv,n=e,r=e);function i(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(o[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(o,l,u=0,c=o.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(o[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(o,l,u=0,c=o.length){const f=i(o,l,u,c-1);return f>u&&r(o[f-1],l)>-r(o[f],l)?f-1:f}return{left:i,center:s,right:a}}function Rv(){return 0}function Ev(e){return e===null?NaN:+e}const Dv=zc(Ca),Ov=Dv.right;zc(Ev).center;const Pv=Math.sqrt(50),Fv=Math.sqrt(10),$v=Math.sqrt(2);function Ia(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=Pv?10:a>=Fv?5:a>=$v?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>t&&--l),l<o&&.5<=n&&n<2?Ia(e,t,n*2):[o,l,u]}function Lv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?Ia(t,e,n):Ia(e,t,n);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)l[u]=(a-u)/-s;else for(let u=0;u<o;++u)l[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(i+u)/-s;else for(let u=0;u<o;++u)l[u]=(i+u)*s;return l}function ic(e,t,n){return t=+t,e=+e,n=+n,Ia(e,t,n)[2]}function ac(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ic(t,e,n):ic(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Mm(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Nv(e){return function(){return e}}function qv(e){return+e}var th=[0,1];function Ur(e){return e}function sc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Nv(isNaN(t)?NaN:.5)}function Iv(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zv(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=sc(i,r),a=n(s,a)):(r=sc(r,i),a=n(a,s)),function(o){return a(r(o))}}function Bv(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=sc(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var l=Ov(e,o,1,r)-1;return a[l](i[l](o))}}function Am(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Uv(){var e=th,t=th,n=es,r,i,a,s=Ur,o,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Ur&&(s=Iv(e[0],e[h-1])),o=h>2?Bv:zv,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=o(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=o(t,e.map(r),mn)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,qv),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=rx,c()},f.clamp=function(h){return arguments.length?(s=h?!0:Ur,c()):s!==Ur},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,c()}}function km(){return Uv()(Ur,Ur)}function Hv(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function za(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ni(e){return e=za(Math.abs(e)),e?e[1]:NaN}function jv(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),a.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Gv(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Yv=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ba(e){if(!(t=Yv.exec(e)))throw new Error("invalid format: "+e);var t;return new Bc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ba.prototype=Bc.prototype;function Bc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Bc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Wv(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Cm;function Xv(e,t){var n=za(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(Cm=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+za(e,Math.max(0,t+a-1))[0]}function eh(e,t){var n=za(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const nh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Hv,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eh(e*100,t),r:eh,s:Xv,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function rh(e){return e}var ih=Array.prototype.map,ah=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Kv(e){var t=e.grouping===void 0||e.thousands===void 0?rh:jv(ih.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?rh:Gv(ih.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Ba(f);var h=f.fill,p=f.align,g=f.sign,d=f.symbol,m=f.zero,x=f.width,y=f.comma,v=f.precision,_=f.trim,S=f.type;S==="n"?(y=!0,S="g"):nh[S]||(v===void 0&&(v=12),_=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=d==="$"?n:d==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",b=d==="$"?r:/[%p]/.test(S)?s:"",M=nh[S],A=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function k(C){var O=w,P=b,F,B,L;if(S==="c")P=M(C)+P,C="";else{C=+C;var $=C<0||1/C<0;if(C=isNaN(C)?l:M(Math.abs(C),v),_&&(C=Wv(C)),$&&+C==0&&g!=="+"&&($=!1),O=($?g==="("?g:o:g==="-"||g==="("?"":g)+O,P=(S==="s"?ah[8+Cm/3]:"")+P+($&&g==="("?")":""),A){for(F=-1,B=C.length;++F<B;)if(L=C.charCodeAt(F),48>L||L>57){P=(L===46?i+C.slice(F+1):C.slice(F))+P,C=C.slice(0,F);break}}}y&&!m&&(C=t(C,1/0));var Y=O.length+C.length+P.length,I=Y<x?new Array(x-Y+1).join(h):"";switch(y&&m&&(C=t(I+C,I.length?x-P.length:1/0),I=""),p){case"<":C=O+C+P+I;break;case"=":C=O+I+C+P;break;case"^":C=I.slice(0,Y=I.length>>1)+O+C+P+I.slice(Y);break;default:C=I+O+C+P;break}return a(C)}return k.toString=function(){return f+""},k}function c(f,h){var p=u((f=Ba(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(ni(h)/3)))*3,d=Math.pow(10,-g),m=ah[8+g/3];return function(x){return p(d*x)+m}}return{format:u,formatPrefix:c}}var _a,Rm,Em;Vv({thousands:",",grouping:[3],currency:["$",""]});function Vv(e){return _a=Kv(e),Rm=_a.format,Em=_a.formatPrefix,_a}function Zv(e){return Math.max(0,-ni(Math.abs(e)))}function Qv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ni(t)/3)))*3-ni(Math.abs(e)))}function Jv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ni(t)-ni(e))+1}function tb(e,t,n,r){var i=ac(e,t,n),a;switch(r=Ba(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Qv(i,s))&&(r.precision=a),Em(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Jv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Zv(i))&&(r.precision=a-(r.type==="%")*2);break}}return Rm(r)}function eb(e){var t=e.domain;return e.ticks=function(n){var r=t();return Lv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return tb(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],o=r[a],l,u,c=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);c-- >0;){if(u=ic(s,o,n),u===l)return r[i]=s,r[a]=o,t(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return e},e}function ri(){var e=km();return e.copy=function(){return Am(e,ri())},Mm.apply(e,arguments),eb(e)}function nb(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}const Os=new Date,Ps=new Date;function fe(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let u;do l.push(u=new Date(+a)),t(a,o),e(a);while(u<a&&a<s);return l},i.filter=a=>fe(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(Os.setTime(+a),Ps.setTime(+s),e(Os),e(Ps),Math.floor(n(Os,Ps))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Ua=fe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ua.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fe(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ua);Ua.range;const Ln=1e3,cn=Ln*60,Nn=cn*60,Bn=Nn*24,Uc=Bn*7,sh=Bn*30,Fs=Bn*365,Hr=fe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ln)},(e,t)=>(t-e)/Ln,e=>e.getUTCSeconds());Hr.range;const Hc=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ln)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getMinutes());Hc.range;const rb=fe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getUTCMinutes());rb.range;const jc=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ln-e.getMinutes()*cn)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getHours());jc.range;const ib=fe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getUTCHours());ib.range;const na=fe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cn)/Bn,e=>e.getDate()-1);na.range;const Gc=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bn,e=>e.getUTCDate()-1);Gc.range;const ab=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bn,e=>Math.floor(e/Bn));ab.range;function Cr(e){return fe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*cn)/Uc)}const is=Cr(0),Ha=Cr(1),sb=Cr(2),ob=Cr(3),ii=Cr(4),lb=Cr(5),ub=Cr(6);is.range;Ha.range;sb.range;ob.range;ii.range;lb.range;ub.range;function Rr(e){return fe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Uc)}const Dm=Rr(0),ja=Rr(1),cb=Rr(2),fb=Rr(3),ai=Rr(4),hb=Rr(5),pb=Rr(6);Dm.range;ja.range;cb.range;fb.range;ai.range;hb.range;pb.range;const Yc=fe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Yc.range;const db=fe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());db.range;const Un=fe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Un.range;const Ar=fe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ar.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ar.range;function gb(e,t,n,r,i,a){const s=[[Hr,1,Ln],[Hr,5,5*Ln],[Hr,15,15*Ln],[Hr,30,30*Ln],[a,1,cn],[a,5,5*cn],[a,15,15*cn],[a,30,30*cn],[i,1,Nn],[i,3,3*Nn],[i,6,6*Nn],[i,12,12*Nn],[r,1,Bn],[r,2,2*Bn],[n,1,Uc],[t,1,sh],[t,3,3*sh],[e,1,Fs]];function o(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),g=p?p.range(u,+c+1):[];return h?g.reverse():g}function l(u,c,f){const h=Math.abs(c-u)/f,p=zc(([,,m])=>m).right(s,h);if(p===s.length)return e.every(ac(u/Fs,c/Fs,f));if(p===0)return Ua.every(Math.max(ac(u,c,f),1));const[g,d]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(d)}return[o,l]}const[mb,yb]=gb(Un,Yc,is,na,jc,Hc);function $s(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ls(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function xi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function _b(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,l=e.shortMonths,u=vi(i),c=bi(i),f=vi(a),h=bi(a),p=vi(s),g=bi(s),d=vi(o),m=bi(o),x=vi(l),y=bi(l),v={a:$,A:Y,b:I,B:et,c:null,d:hh,e:hh,f:Bb,g:Zb,G:Jb,H:qb,I:Ib,j:zb,L:Om,m:Ub,M:Hb,p:K,q:J,Q:gh,s:mh,S:jb,u:Gb,U:Yb,V:Wb,w:Xb,W:Kb,x:null,X:null,y:Vb,Y:Qb,Z:tw,"%":dh},_={a:st,A:lt,b:N,B:j,c:null,d:ph,e:ph,f:iw,g:dw,G:mw,H:ew,I:nw,j:rw,L:Fm,m:aw,M:sw,p:nt,q:Z,Q:gh,s:mh,S:ow,u:lw,U:uw,V:cw,w:fw,W:hw,x:null,X:null,y:pw,Y:gw,Z:yw,"%":dh},S={a:k,A:C,b:O,B:P,c:F,d:ch,e:ch,f:Fb,g:uh,G:lh,H:fh,I:fh,j:Eb,L:Pb,m:Rb,M:Db,p:A,q:Cb,Q:Lb,s:Nb,S:Ob,u:Sb,U:Tb,V:Mb,w:wb,W:Ab,x:B,X:L,y:uh,Y:lh,Z:kb,"%":$b};v.x=w(n,v),v.X=w(r,v),v.c=w(t,v),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_);function w(R,z){return function(D){var T=[],X=-1,Q=0,W=R.length,ut,H,ot;for(D instanceof Date||(D=new Date(+D));++X<W;)R.charCodeAt(X)===37&&(T.push(R.slice(Q,X)),(H=oh[ut=R.charAt(++X)])!=null?ut=R.charAt(++X):H=ut==="e"?" ":"0",(ot=z[ut])&&(ut=ot(D,H)),T.push(ut),Q=X+1);return T.push(R.slice(Q,X)),T.join("")}}function b(R,z){return function(D){var T=xi(1900,void 0,1),X=M(T,R,D+="",0),Q,W;if(X!=D.length)return null;if("Q"in T)return new Date(T.Q);if("s"in T)return new Date(T.s*1e3+("L"in T?T.L:0));if(z&&!("Z"in T)&&(T.Z=0),"p"in T&&(T.H=T.H%12+T.p*12),T.m===void 0&&(T.m="q"in T?T.q:0),"V"in T){if(T.V<1||T.V>53)return null;"w"in T||(T.w=1),"Z"in T?(Q=Ls(xi(T.y,0,1)),W=Q.getUTCDay(),Q=W>4||W===0?ja.ceil(Q):ja(Q),Q=Gc.offset(Q,(T.V-1)*7),T.y=Q.getUTCFullYear(),T.m=Q.getUTCMonth(),T.d=Q.getUTCDate()+(T.w+6)%7):(Q=$s(xi(T.y,0,1)),W=Q.getDay(),Q=W>4||W===0?Ha.ceil(Q):Ha(Q),Q=na.offset(Q,(T.V-1)*7),T.y=Q.getFullYear(),T.m=Q.getMonth(),T.d=Q.getDate()+(T.w+6)%7)}else("W"in T||"U"in T)&&("w"in T||(T.w="u"in T?T.u%7:"W"in T?1:0),W="Z"in T?Ls(xi(T.y,0,1)).getUTCDay():$s(xi(T.y,0,1)).getDay(),T.m=0,T.d="W"in T?(T.w+6)%7+T.W*7-(W+5)%7:T.w+T.U*7-(W+6)%7);return"Z"in T?(T.H+=T.Z/100|0,T.M+=T.Z%100,Ls(T)):$s(T)}}function M(R,z,D,T){for(var X=0,Q=z.length,W=D.length,ut,H;X<Q;){if(T>=W)return-1;if(ut=z.charCodeAt(X++),ut===37){if(ut=z.charAt(X++),H=S[ut in oh?z.charAt(X++):ut],!H||(T=H(R,D,T))<0)return-1}else if(ut!=D.charCodeAt(T++))return-1}return T}function A(R,z,D){var T=u.exec(z.slice(D));return T?(R.p=c.get(T[0].toLowerCase()),D+T[0].length):-1}function k(R,z,D){var T=p.exec(z.slice(D));return T?(R.w=g.get(T[0].toLowerCase()),D+T[0].length):-1}function C(R,z,D){var T=f.exec(z.slice(D));return T?(R.w=h.get(T[0].toLowerCase()),D+T[0].length):-1}function O(R,z,D){var T=x.exec(z.slice(D));return T?(R.m=y.get(T[0].toLowerCase()),D+T[0].length):-1}function P(R,z,D){var T=d.exec(z.slice(D));return T?(R.m=m.get(T[0].toLowerCase()),D+T[0].length):-1}function F(R,z,D){return M(R,t,z,D)}function B(R,z,D){return M(R,n,z,D)}function L(R,z,D){return M(R,r,z,D)}function $(R){return s[R.getDay()]}function Y(R){return a[R.getDay()]}function I(R){return l[R.getMonth()]}function et(R){return o[R.getMonth()]}function K(R){return i[+(R.getHours()>=12)]}function J(R){return 1+~~(R.getMonth()/3)}function st(R){return s[R.getUTCDay()]}function lt(R){return a[R.getUTCDay()]}function N(R){return l[R.getUTCMonth()]}function j(R){return o[R.getUTCMonth()]}function nt(R){return i[+(R.getUTCHours()>=12)]}function Z(R){return 1+~~(R.getUTCMonth()/3)}return{format:function(R){var z=w(R+="",v);return z.toString=function(){return R},z},parse:function(R){var z=b(R+="",!1);return z.toString=function(){return R},z},utcFormat:function(R){var z=w(R+="",_);return z.toString=function(){return R},z},utcParse:function(R){var z=b(R+="",!0);return z.toString=function(){return R},z}}}var oh={"-":"",_:" ",0:"0"},de=/^\s*\d+/,xb=/^%/,vb=/[\\^$*+?|[\]().{}]/g;function Ct(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function bb(e){return e.replace(vb,"\\$&")}function vi(e){return new RegExp("^(?:"+e.map(bb).join("|")+")","i")}function bi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function wb(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Sb(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Tb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Mb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ab(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function lh(e,t,n){var r=de.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function uh(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kb(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Cb(e,t,n){var r=de.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Rb(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ch(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Eb(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function fh(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Db(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ob(e,t,n){var r=de.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Pb(e,t,n){var r=de.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Fb(e,t,n){var r=de.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $b(e,t,n){var r=xb.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Lb(e,t,n){var r=de.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Nb(e,t,n){var r=de.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hh(e,t){return Ct(e.getDate(),t,2)}function qb(e,t){return Ct(e.getHours(),t,2)}function Ib(e,t){return Ct(e.getHours()%12||12,t,2)}function zb(e,t){return Ct(1+na.count(Un(e),e),t,3)}function Om(e,t){return Ct(e.getMilliseconds(),t,3)}function Bb(e,t){return Om(e,t)+"000"}function Ub(e,t){return Ct(e.getMonth()+1,t,2)}function Hb(e,t){return Ct(e.getMinutes(),t,2)}function jb(e,t){return Ct(e.getSeconds(),t,2)}function Gb(e){var t=e.getDay();return t===0?7:t}function Yb(e,t){return Ct(is.count(Un(e)-1,e),t,2)}function Pm(e){var t=e.getDay();return t>=4||t===0?ii(e):ii.ceil(e)}function Wb(e,t){return e=Pm(e),Ct(ii.count(Un(e),e)+(Un(e).getDay()===4),t,2)}function Xb(e){return e.getDay()}function Kb(e,t){return Ct(Ha.count(Un(e)-1,e),t,2)}function Vb(e,t){return Ct(e.getFullYear()%100,t,2)}function Zb(e,t){return e=Pm(e),Ct(e.getFullYear()%100,t,2)}function Qb(e,t){return Ct(e.getFullYear()%1e4,t,4)}function Jb(e,t){var n=e.getDay();return e=n>=4||n===0?ii(e):ii.ceil(e),Ct(e.getFullYear()%1e4,t,4)}function tw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ct(t/60|0,"0",2)+Ct(t%60,"0",2)}function ph(e,t){return Ct(e.getUTCDate(),t,2)}function ew(e,t){return Ct(e.getUTCHours(),t,2)}function nw(e,t){return Ct(e.getUTCHours()%12||12,t,2)}function rw(e,t){return Ct(1+Gc.count(Ar(e),e),t,3)}function Fm(e,t){return Ct(e.getUTCMilliseconds(),t,3)}function iw(e,t){return Fm(e,t)+"000"}function aw(e,t){return Ct(e.getUTCMonth()+1,t,2)}function sw(e,t){return Ct(e.getUTCMinutes(),t,2)}function ow(e,t){return Ct(e.getUTCSeconds(),t,2)}function lw(e){var t=e.getUTCDay();return t===0?7:t}function uw(e,t){return Ct(Dm.count(Ar(e)-1,e),t,2)}function $m(e){var t=e.getUTCDay();return t>=4||t===0?ai(e):ai.ceil(e)}function cw(e,t){return e=$m(e),Ct(ai.count(Ar(e),e)+(Ar(e).getUTCDay()===4),t,2)}function fw(e){return e.getUTCDay()}function hw(e,t){return Ct(ja.count(Ar(e)-1,e),t,2)}function pw(e,t){return Ct(e.getUTCFullYear()%100,t,2)}function dw(e,t){return e=$m(e),Ct(e.getUTCFullYear()%100,t,2)}function gw(e,t){return Ct(e.getUTCFullYear()%1e4,t,4)}function mw(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ai(e):ai.ceil(e),Ct(e.getUTCFullYear()%1e4,t,4)}function yw(){return"+0000"}function dh(){return"%"}function gh(e){return+e}function mh(e){return Math.floor(+e/1e3)}var qr,Lm;_w({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _w(e){return qr=_b(e),Lm=qr.format,qr.parse,qr.utcFormat,qr.utcParse,qr}function xw(e){return new Date(e)}function vw(e){return e instanceof Date?+e:+new Date(+e)}function Nm(e,t,n,r,i,a,s,o,l,u){var c=km(),f=c.invert,h=c.domain,p=u(".%L"),g=u(":%S"),d=u("%I:%M"),m=u("%I %p"),x=u("%a %d"),y=u("%b %d"),v=u("%B"),_=u("%Y");function S(w){return(l(w)<w?p:o(w)<w?g:s(w)<w?d:a(w)<w?m:r(w)<w?i(w)<w?x:y:n(w)<w?v:_)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?h(Array.from(w,vw)):h().map(xw)},c.ticks=function(w){var b=h();return e(b[0],b[b.length-1],w??10)},c.tickFormat=function(w,b){return b==null?S:u(b)},c.nice=function(w){var b=h();return(!w||typeof w.range!="function")&&(w=t(b[0],b[b.length-1],w??10)),w?h(nb(b,w)):c},c.copy=function(){return Am(c,Nm(e,t,n,r,i,a,s,o,l,u))},c}function Wr(){return Mm.apply(Nm(mb,yb,Un,Yc,is,na,jc,Hc,Hr,Lm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Xt(e){return function(){return e}}const oc=Math.PI,lc=2*oc,dr=1e-6,bw=lc-dr;function qm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ww(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return qm;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Sw{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?qm:ww(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=r-t,u=i-n,c=s-t,f=o-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>dr)if(!(Math.abs(f*l-u*c)>dr)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,g=i-o,d=l*l+u*u,m=p*p+g*g,x=Math.sqrt(d),y=Math.sqrt(h),v=a*Math.tan((oc-Math.acos((d+h-m)/(2*x*y)))/2),_=v/y,S=v/x;Math.abs(_-1)>dr&&this._append`L${t+_*c},${n+_*f}`,this._append`A${a},${a},0,0,${+(f*p>c*g)},${this._x1=t+S*l},${this._y1=n+S*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),u=t+o,c=n+l,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>dr||Math.abs(this._y1-c)>dr)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%lc+lc),h>bw?this._append`A${r},${r},0,1,${f},${t-o},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>dr&&this._append`A${r},${r},0,${+(h>=oc)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Im(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Sw(t)}function Wc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zm(e){this._context=e}zm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function kr(e){return new zm(e)}function Bm(e){return e[0]}function Um(e){return e[1]}function Hm(e,t){var n=Xt(!0),r=null,i=kr,a=null,s=Im(o);e=typeof e=="function"?e:e===void 0?Bm:Xt(e),t=typeof t=="function"?t:t===void 0?Um:Xt(t);function o(l){var u,c=(l=Wc(l)).length,f,h=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,l),+t(f,u,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Xt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Xt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Xt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),o):r},o}function as(e,t,n){var r=null,i=Xt(!0),a=null,s=kr,o=null,l=Im(u);e=typeof e=="function"?e:e===void 0?Bm:Xt(+e),t=typeof t=="function"?t:Xt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Um:Xt(+n);function u(f){var h,p,g,d=(f=Wc(f)).length,m,x=!1,y,v=new Array(d),_=new Array(d);for(a==null&&(o=s(y=l())),h=0;h<=d;++h){if(!(h<d&&i(m=f[h],h,f))===x)if(x=!x)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(v[g],_[g]);o.lineEnd(),o.areaEnd()}x&&(v[h]=+e(m,h,f),_[h]=+t(m,h,f),o.point(r?+r(m,h,f):v[h],n?+n(m,h,f):_[h]))}if(y)return o=null,y+""||null}function c(){return Hm().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Xt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Xt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Xt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Xt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Xt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Xt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Xt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(o=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=o=null:o=s(a=f),u):a},u}function yh(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function _h(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Tw(e,t){return e[t]}function Mw(e){const t=[];return t.key=e,t}function Yi(){var e=Xt([]),t=_h,n=yh,r=Tw;function i(a){var s=Array.from(e.apply(this,arguments),Mw),o,l=s.length,u=-1,c;for(const f of a)for(o=0,++u;o<l;++o)(s[o][u]=[0,+r(f,s[o].key,u,a)]).data=f;for(o=0,c=Wc(t(s));o<l;++o)s[c[o]].index=o;return n(s,c),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Xt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Xt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?_h:typeof a=="function"?a:Xt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yh,i):n},i}function Fn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
2
2
|
* GSAP 3.14.2
|
|
3
3
|
* https://gsap.com
|
|
4
4
|
*
|
|
5
5
|
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
6
6
|
* Subject to the terms at https://gsap.com/standard-license
|
|
7
7
|
* @author: Jack Doyle, jack@greensock.com
|
|
8
|
-
*/var en={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ai={duration:.5,overwrite:!1,delay:0},Xc,be,Ut,fn=1e8,Nt=1/fn,lc=Math.PI*2,Tw=lc/4,Mw=0,jm=Math.sqrt,Aw=Math.cos,kw=Math.sin,pe=function(t){return typeof t=="string"},Kt=function(t){return typeof t=="function"},Hn=function(t){return typeof t=="number"},Wc=function(t){return typeof t>"u"},An=function(t){return typeof t=="object"},Ie=function(t){return t!==!1},Kc=function(){return typeof window<"u"},_a=function(t){return Kt(t)||pe(t)},Gm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ce=Array.isArray,Cw=/random\([^)]+\)/g,Rw=/,\s*/g,_h=/(?:-?\.?\d|\.)+/gi,Ym=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Hr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$s=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Xm=/[+-]=-?[.\d]+/,Ew=/[^,'"\[\]\s]+/gi,Dw=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,jt,wn,uc,Vc,rn={},ja={},Wm,Km=function(t){return(ja=si(t,rn))&&He},Zc=function(t,n){return console.warn("Invalid property",t,"set to",n,"Missing plugin? gsap.registerPlugin()")},Yi=function(t,n){return!n&&console.warn(t)},Vm=function(t,n){return t&&(rn[t]=n)&&ja&&(ja[t]=n)||rn},Xi=function(){return 0},Ow={suppressEvents:!0,isStart:!0,kill:!1},Ca={suppressEvents:!0,kill:!1},Pw={suppressEvents:!0},Qc={},Qn=[],cc={},Zm,Ze={},Ls={},xh=30,Ra=[],Jc="",tf=function(t){var n=t[0],r,i;if(An(n)||Kt(n)||(t=[t]),!(r=(n._gsap||{}).harness)){for(i=Ra.length;i--&&!Ra[i].targetTest(n););r=Ra[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new b0(t[i],r)))||t.splice(i,1);return t},xr=function(t){return t._gsap||tf(hn(t))[0]._gsap},Qm=function(t,n,r){return(r=t[n])&&Kt(r)?t[n]():Wc(r)&&t.getAttribute&&t.getAttribute(n)||r},ze=function(t,n){return(t=t.split(",")).forEach(n)||t},te=function(t){return Math.round(t*1e5)/1e5||0},Ht=function(t){return Math.round(t*1e7)/1e7||0},Xr=function(t,n){var r=n.charAt(0),i=parseFloat(n.substr(2));return t=parseFloat(t),r==="+"?t+i:r==="-"?t-i:r==="*"?t*i:t/i},Fw=function(t,n){for(var r=n.length,i=0;t.indexOf(n[i])<0&&++i<r;);return i<r},Ga=function(){var t=Qn.length,n=Qn.slice(0),r,i;for(cc={},Qn.length=0,r=0;r<t;r++)i=n[r],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},ef=function(t){return!!(t._initted||t._startAt||t.add)},Jm=function(t,n,r,i){Qn.length&&!be&&Ga(),t.render(n,r,!!(be&&n<0&&ef(t))),Qn.length&&!be&&Ga()},t0=function(t){var n=parseFloat(t);return(n||n===0)&&(t+"").match(Ew).length<2?n:pe(t)?t.trim():t},e0=function(t){return t},an=function(t,n){for(var r in n)r in t||(t[r]=n[r]);return t},Nw=function(t){return function(n,r){for(var i in r)i in n||i==="duration"&&t||i==="ease"||(n[i]=r[i])}},si=function(t,n){for(var r in n)t[r]=n[r];return t},vh=function e(t,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=An(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},Ya=function(t,n){var r={},i;for(i in t)i in n||(r[i]=t[i]);return r},Oi=function(t){var n=t.parent||jt,r=t.keyframes?Nw(Ce(t.keyframes)):an;if(Ie(t.inherit))for(;n;)r(t,n.vars.defaults),n=n.parent||n._dp;return t},$w=function(t,n){for(var r=t.length,i=r===n.length;i&&r--&&t[r]===n[r];);return r<0},n0=function(t,n,r,i,a){var s=t[i],o;if(a)for(o=n[a];s&&s[a]>o;)s=s._prev;return s?(n._next=s._next,s._next=n):(n._next=t[r],t[r]=n),n._next?n._next._prev=n:t[i]=n,n._prev=s,n.parent=n._dp=t,n},as=function(t,n,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var a=n._prev,s=n._next;a?a._next=s:t[r]===n&&(t[r]=s),s?s._prev=a:t[i]===n&&(t[i]=a),n._next=n._prev=n.parent=null},er=function(t,n){t.parent&&(!n||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},vr=function(t,n){if(t&&(!n||n._end>t._dur||n._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Lw=function(t){for(var n=t.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return t},fc=function(t,n,r,i){return t._startAt&&(be?t._startAt.revert(Ca):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(n,!0,i))},qw=function e(t){return!t||t._ts&&e(t.parent)},bh=function(t){return t._repeat?oi(t._tTime,t=t.duration()+t._rDelay)*t:0},oi=function(t,n){var r=Math.floor(t=Ht(t/n));return t&&r===t?r-1:r},Xa=function(t,n){return(t-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},ss=function(t){return t._end=Ht(t._start+(t._tDur/Math.abs(t._ts||t._rts||Nt)||0))},os=function(t,n){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ht(r._time-(t._ts>0?n/t._ts:((t._dirty?t.totalDuration():t._tDur)-n)/-t._ts)),ss(t),r._dirty||vr(r,t)),t},r0=function(t,n){var r;if((n._time||!n._dur&&n._initted||n._start<t._time&&(n._dur||!n.add))&&(r=Xa(t.rawTime(),n),(!n._dur||na(0,n.totalDuration(),r)-n._tTime>Nt)&&n.render(r,!0)),vr(t,n)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-Nt}},Sn=function(t,n,r,i){return n.parent&&er(n),n._start=Ht((Hn(r)?r:r||t!==jt?un(t,r,n):t._time)+n._delay),n._end=Ht(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),n0(t,n,"_first","_last",t._sort?"_start":0),hc(n)||(t._recent=n),i||r0(t,n),t._ts<0&&os(t,t._tTime),t},i0=function(t,n){return(rn.ScrollTrigger||Zc("scrollTrigger",n))&&rn.ScrollTrigger.create(n,t)},a0=function(t,n,r,i,a){if(rf(t,n,a),!t._initted)return 1;if(!r&&t._pt&&!be&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Zm!==Qe.frame)return Qn.push(t),t._lazy=[a,i],1},Iw=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))},hc=function(t){var n=t.data;return n==="isFromStart"||n==="isStart"},zw=function(t,n,r,i){var a=t.ratio,s=n<0||!n&&(!t._start&&Iw(t)&&!(!t._initted&&hc(t))||(t._ts<0||t._dp._ts<0)&&!hc(t))?0:1,o=t._rDelay,l=0,u,c,f;if(o&&t._repeat&&(l=na(0,t._tDur,n),c=oi(l,o),t._yoyo&&c&1&&(s=1-s),c!==oi(t._tTime,o)&&(a=1-s,t.vars.repeatRefresh&&t._initted&&t.invalidate())),s!==a||be||i||t._zTime===Nt||!n&&t._zTime){if(!t._initted&&a0(t,n,i,r,l))return;for(f=t._zTime,t._zTime=n||(r?Nt:0),r||(r=n&&!f),t.ratio=s,t._from&&(s=1-s),t._time=0,t._tTime=l,u=t._pt;u;)u.r(s,u.d),u=u._next;n<0&&fc(t,n,r,!0),t._onUpdate&&!r&&Je(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Je(t,"onRepeat"),(n>=t._tDur||n<0)&&t.ratio===s&&(s&&er(t,1),!r&&!be&&(Je(t,s?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=n)},Bw=function(t,n,r){var i;if(r>n)for(i=t._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>n)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start<n)return i;i=i._prev}},li=function(t,n,r,i){var a=t._repeat,s=Ht(n)||0,o=t._tTime/t._tDur;return o&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=a?a<0?1e10:Ht(s*(a+1)+t._rDelay*a):s,o>0&&!i&&os(t,t._tTime=t._tDur*o),t.parent&&ss(t),r||vr(t.parent,t),t},wh=function(t){return t instanceof Oe?vr(t):li(t,t._dur)},Uw={_start:0,endTime:Xi,totalDuration:Xi},un=function e(t,n,r){var i=t.labels,a=t._recent||Uw,s=t.duration()>=fn?a.endTime(!1):t._dur,o,l,u;return pe(n)&&(isNaN(n)||n in i)?(l=n.charAt(0),u=n.substr(-1)==="%",o=n.indexOf("="),l==="<"||l===">"?(o>=0&&(n=n.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0)*(u?(o<0?a:r).totalDuration()/100:1)):o<0?(n in i||(i[n]=s),i[n]):(l=parseFloat(n.charAt(o-1)+n.substr(o+1)),u&&r&&(l=l/100*(Ce(r)?r[0]:r).totalDuration()),o>1?e(t,n.substr(0,o-1),r)+l:s+l)):n==null?s:+n},Pi=function(t,n,r){var i=Hn(n[1]),a=(i?2:1)+(t<2?0:1),s=n[a],o,l;if(i&&(s.duration=n[1]),s.parent=r,t){for(o=s,l=r;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Ie(l.vars.inherit)&&l.parent;s.immediateRender=Ie(o.immediateRender),t<2?s.runBackwards=1:s.startAt=n[a-1]}return new se(n[0],s,n[a+1])},ir=function(t,n){return t||t===0?n(t):n},na=function(t,n,r){return r<t?t:r>n?n:r},ke=function(t,n){return!pe(t)||!(n=Dw.exec(t))?"":n[1]},Hw=function(t,n,r){return ir(r,function(i){return na(t,n,i)})},pc=[].slice,s0=function(t,n){return t&&An(t)&&"length"in t&&(!n&&!t.length||t.length-1 in t&&An(t[0]))&&!t.nodeType&&t!==wn},jw=function(t,n,r){return r===void 0&&(r=[]),t.forEach(function(i){var a;return pe(i)&&!n||s0(i,1)?(a=r).push.apply(a,hn(i)):r.push(i)})||r},hn=function(t,n,r){return Ut&&!n&&Ut.selector?Ut.selector(t):pe(t)&&!r&&(uc||!ui())?pc.call((n||Vc).querySelectorAll(t),0):Ce(t)?jw(t,r):s0(t)?pc.call(t,0):t?[t]:[]},dc=function(t){return t=hn(t)[0]||Yi("Invalid scope")||{},function(n){var r=t.current||t.nativeElement||t;return hn(n,r.querySelectorAll?r:r===t?Yi("Invalid scope")||Vc.createElement("div"):t)}},o0=function(t){return t.sort(function(){return .5-Math.random()})},l0=function(t){if(Kt(t))return t;var n=An(t)?t:{each:t},r=br(n.ease),i=n.from||0,a=parseFloat(n.base)||0,s={},o=i>0&&i<1,l=isNaN(i)||o,u=n.axis,c=i,f=i;return pe(i)?c=f={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(c=i[0],f=i[1]),function(h,p,g){var d=(g||n).length,m=s[d],x,y,v,_,S,w,b,M,A;if(!m){if(A=n.grid==="auto"?0:(n.grid||[1,fn])[1],!A){for(b=-fn;b<(b=g[A++].getBoundingClientRect().left)&&A<d;);A<d&&A--}for(m=s[d]=[],x=l?Math.min(A,d)*c-.5:i%A,y=A===fn?0:l?d*f/A-.5:i/A|0,b=0,M=fn,w=0;w<d;w++)v=w%A-x,_=y-(w/A|0),m[w]=S=u?Math.abs(u==="y"?_:v):jm(v*v+_*_),S>b&&(b=S),S<M&&(M=S);i==="random"&&o0(m),m.max=b-M,m.min=M,m.v=d=(parseFloat(n.amount)||parseFloat(n.each)*(A>d?d-1:u?u==="y"?d/A:A:Math.max(A,d/A))||0)*(i==="edges"?-1:1),m.b=d<0?a-d:a,m.u=ke(n.amount||n.each)||0,r=r&&d<0?_0(r):r}return d=(m[h]-m.min)/m.max||0,Ht(m.b+(r?r(d):d)*m.v)+m.u}},gc=function(t){var n=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var i=Ht(Math.round(parseFloat(r)/t)*t*n);return(i-i%1)/n+(Hn(r)?0:ke(r))}},u0=function(t,n){var r=Ce(t),i,a;return!r&&An(t)&&(i=r=t.radius||fn,t.values?(t=hn(t.values),(a=!Hn(t[0]))&&(i*=i)):t=gc(t.increment)),ir(n,r?Kt(t)?function(s){return a=t(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),l=parseFloat(a?s.y:0),u=fn,c=0,f=t.length,h,p;f--;)a?(h=t[f].x-o,p=t[f].y-l,h=h*h+p*p):h=Math.abs(t[f]-o),h<u&&(u=h,c=f);return c=!i||u<=i?t[c]:s,a||c===s||Hn(s)?c:c+ke(s)}:gc(t))},c0=function(t,n,r,i){return ir(Ce(t)?!n:r===!0?!!(r=0):!i,function(){return Ce(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(n-t+r*.99))/r)*r*i)/i})},Gw=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduce(function(a,s){return s(a)},i)}},Yw=function(t,n){return function(r){return t(parseFloat(r))+(n||ke(r))}},Xw=function(t,n,r){return h0(t,n,0,1,r)},f0=function(t,n,r){return ir(r,function(i){return t[~~n(i)]})},Ww=function e(t,n,r){var i=n-t;return Ce(t)?f0(t,e(0,t.length),n):ir(r,function(a){return(i+(a-t)%i)%i+t})},Kw=function e(t,n,r){var i=n-t,a=i*2;return Ce(t)?f0(t,e(0,t.length-1),n):ir(r,function(s){return s=(a+(s-t)%a)%a||0,t+(s>i?a-s:s)})},Wi=function(t){return t.replace(Cw,function(n){var r=n.indexOf("[")+1,i=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Rw);return c0(r?i:+i[0],r?0:+i[1],+i[2]||1e-5)})},h0=function(t,n,r,i,a){var s=n-t,o=i-r;return ir(a,function(l){return r+((l-t)/s*o||0)})},Vw=function e(t,n,r,i){var a=isNaN(t+n)?0:function(p){return(1-p)*t+p*n};if(!a){var s=pe(t),o={},l,u,c,f,h;if(r===!0&&(i=1)&&(r=null),s)t={p:t},n={p:n};else if(Ce(t)&&!Ce(n)){for(c=[],f=t.length,h=f-2,u=1;u<f;u++)c.push(e(t[u-1],t[u]));f--,a=function(g){g*=f;var d=Math.min(h,~~g);return c[d](g-d)},r=n}else i||(t=si(Ce(t)?[]:{},t));if(!c){for(l in n)nf.call(o,t,l,"get",n[l]);a=function(g){return of(g,o)||(s?t.p:t)}}}return ir(r,a)},Sh=function(t,n,r){var i=t.labels,a=fn,s,o,l;for(s in i)o=i[s]-n,o<0==!!r&&o&&a>(o=Math.abs(o))&&(l=s,a=o);return l},Je=function(t,n,r){var i=t.vars,a=i[n],s=Ut,o=t._ctx,l,u,c;if(a)return l=i[n+"Params"],u=i.callbackScope||t,r&&Qn.length&&Ga(),o&&(Ut=o),c=l?a.apply(u,l):a.call(u),Ut=s,c},Ci=function(t){return er(t),t.scrollTrigger&&t.scrollTrigger.kill(!!be),t.progress()<1&&Je(t,"onInterrupt"),t},jr,p0=[],d0=function(t){if(t)if(t=!t.name&&t.default||t,Kc()||t.headless){var n=t.name,r=Kt(t),i=n&&!r&&t.init?function(){this._props=[]}:t,a={init:Xi,render:of,add:nf,kill:hS,modifier:fS,rawVars:0},s={targetTest:0,get:0,getSetter:sf,aliases:{},register:0};if(ui(),t!==i){if(Ze[n])return;an(i,an(Ya(t,a),s)),si(i.prototype,si(a,Ya(t,s))),Ze[i.prop=n]=i,t.targetTest&&(Ra.push(i),Qc[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}Vm(n,i),t.register&&t.register(He,i,Be)}else p0.push(t)},Ft=255,Ri={aqua:[0,Ft,Ft],lime:[0,Ft,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ft],navy:[0,0,128],white:[Ft,Ft,Ft],olive:[128,128,0],yellow:[Ft,Ft,0],orange:[Ft,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ft,0,0],pink:[Ft,192,203],cyan:[0,Ft,Ft],transparent:[Ft,Ft,Ft,0]},qs=function(t,n,r){return t+=t<0?1:t>1?-1:0,(t*6<1?n+(r-n)*t*6:t<.5?r:t*3<2?n+(r-n)*(2/3-t)*6:n)*Ft+.5|0},g0=function(t,n,r){var i=t?Hn(t)?[t>>16,t>>8&Ft,t&Ft]:0:Ri.black,a,s,o,l,u,c,f,h,p,g;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ri[t])i=Ri[t];else if(t.charAt(0)==="#"){if(t.length<6&&(a=t.charAt(1),s=t.charAt(2),o=t.charAt(3),t="#"+a+a+s+s+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&Ft,i&Ft,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Ft,t&Ft]}else if(t.substr(0,3)==="hsl"){if(i=g=t.match(_h),!n)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,s=c<=.5?c*(u+1):c+u-c*u,a=c*2-s,i.length>3&&(i[3]*=1),i[0]=qs(l+1/3,a,s),i[1]=qs(l,a,s),i[2]=qs(l-1/3,a,s);else if(~t.indexOf("="))return i=t.match(Ym),r&&i.length<4&&(i[3]=1),i}else i=t.match(_h)||Ri.transparent;i=i.map(Number)}return n&&!g&&(a=i[0]/Ft,s=i[1]/Ft,o=i[2]/Ft,f=Math.max(a,s,o),h=Math.min(a,s,o),c=(f+h)/2,f===h?l=u=0:(p=f-h,u=c>.5?p/(2-f-h):p/(f+h),l=f===a?(s-o)/p+(s<o?6:0):f===s?(o-a)/p+2:(a-s)/p+4,l*=60),i[0]=~~(l+.5),i[1]=~~(u*100+.5),i[2]=~~(c*100+.5)),r&&i.length<4&&(i[3]=1),i},m0=function(t){var n=[],r=[],i=-1;return t.split(Jn).forEach(function(a){var s=a.match(Hr)||[];n.push.apply(n,s),r.push(i+=s.length+1)}),n.c=r,n},Th=function(t,n,r){var i="",a=(t+i).match(Jn),s=n?"hsla(":"rgba(",o=0,l,u,c,f;if(!a)return t;if(a=a.map(function(h){return(h=g0(h,n,1))&&s+(n?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),r&&(c=m0(t),l=r.c,l.join(i)!==c.c.join(i)))for(u=t.replace(Jn,"1").split(Hr),f=u.length-1;o<f;o++)i+=u[o]+(~l.indexOf(o)?a.shift()||s+"0,0,0,0)":(c.length?c:a.length?a:r).shift());if(!u)for(u=t.split(Jn),f=u.length-1;o<f;o++)i+=u[o]+a[o];return i+u[f]},Jn=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ri)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),Zw=/hsl[a]?\(/,y0=function(t){var n=t.join(" "),r;if(Jn.lastIndex=0,Jn.test(n))return r=Zw.test(n),t[1]=Th(t[1],r),t[0]=Th(t[0],r,m0(t[1])),!0},Ki,Qe=(function(){var e=Date.now,t=500,n=33,r=e(),i=r,a=1e3/240,s=a,o=[],l,u,c,f,h,p,g=function d(m){var x=e()-i,y=m===!0,v,_,S,w;if((x>t||x<0)&&(r+=x-n),i+=x,S=i-r,v=S-s,(v>0||y)&&(w=++f.frame,h=S-f.time*1e3,f.time=S=S/1e3,s+=v+(v>=a?4:a-v),_=1),y||(l=u(d)),_)for(p=0;p<o.length;p++)o[p](S,h,w,m)};return f={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(m){return h/(1e3/(m||60))},wake:function(){Wm&&(!uc&&Kc()&&(wn=uc=window,Vc=wn.document||{},rn.gsap=He,(wn.gsapVersions||(wn.gsapVersions=[])).push(He.version),Km(ja||wn.GreenSockGlobals||!wn.gsap&&wn||{}),p0.forEach(d0)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),u=c||function(m){return setTimeout(m,s-f.time*1e3+1|0)},Ki=1,g(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Ki=0,u=Xi},lagSmoothing:function(m,x){t=m||1/0,n=Math.min(x||33,t)},fps:function(m){a=1e3/(m||240),s=f.time*1e3+a},add:function(m,x,y){var v=x?function(_,S,w,b){m(_,S,w,b),f.remove(v)}:m;return f.remove(m),o[y?"unshift":"push"](v),ui(),v},remove:function(m,x){~(x=o.indexOf(m))&&o.splice(x,1)&&p>=x&&p--},_listeners:o},f})(),ui=function(){return!Ki&&Qe.wake()},Tt={},Qw=/^[\d.\-M][\d.\-,\s]/,Jw=/["']/g,tS=function(t){for(var n={},r=t.substr(1,t.length-3).split(":"),i=r[0],a=1,s=r.length,o,l,u;a<s;a++)l=r[a],o=a!==s-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),n[i]=isNaN(u)?u.replace(Jw,"").trim():+u,i=l.substr(o+1).trim();return n},eS=function(t){var n=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",n);return t.substring(n,~i&&i<r?t.indexOf(")",r+1):r)},nS=function(t){var n=(t+"").split("("),r=Tt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[tS(n[1])]:eS(t).split(",").map(t0)):Tt._CE&&Qw.test(t)?Tt._CE("",t):r},_0=function(t){return function(n){return 1-t(1-n)}},x0=function e(t,n){for(var r=t._first,i;r;)r instanceof Oe?e(r,n):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==n&&(r.timeline?e(r.timeline,n):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=n)),r=r._next},br=function(t,n){return t&&(Kt(t)?t:Tt[t]||nS(t))||n},Rr=function(t,n,r,i){r===void 0&&(r=function(l){return 1-n(1-l)}),i===void 0&&(i=function(l){return l<.5?n(l*2)/2:1-n((1-l)*2)/2});var a={easeIn:n,easeOut:r,easeInOut:i},s;return ze(t,function(o){Tt[o]=rn[o]=a,Tt[s=o.toLowerCase()]=r;for(var l in a)Tt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Tt[o+"."+l]=a[l]}),a},v0=function(t){return function(n){return n<.5?(1-t(1-n*2))/2:.5+t((n-.5)*2)/2}},Is=function e(t,n,r){var i=n>=1?n:1,a=(r||(t?.3:.45))/(n<1?n:1),s=a/lc*(Math.asin(1/i)||0),o=function(c){return c===1?1:i*Math.pow(2,-10*c)*kw((c-s)*a)+1},l=t==="out"?o:t==="in"?function(u){return 1-o(1-u)}:v0(o);return a=lc/a,l.config=function(u,c){return e(t,u,c)},l},zs=function e(t,n){n===void 0&&(n=1.70158);var r=function(s){return s?--s*s*((n+1)*s+n)+1:0},i=t==="out"?r:t==="in"?function(a){return 1-r(1-a)}:v0(r);return i.config=function(a){return e(t,a)},i};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var n=t<5?t+1:t;Rr(e+",Power"+(n-1),t?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});Tt.Linear.easeNone=Tt.none=Tt.Linear.easeIn;Rr("Elastic",Is("in"),Is("out"),Is());(function(e,t){var n=1/t,r=2*n,i=2.5*n,a=function(o){return o<n?e*o*o:o<r?e*Math.pow(o-1.5/t,2)+.75:o<i?e*(o-=2.25/t)*o+.9375:e*Math.pow(o-2.625/t,2)+.984375};Rr("Bounce",function(s){return 1-a(1-s)},a)})(7.5625,2.75);Rr("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Rr("Circ",function(e){return-(jm(1-e*e)-1)});Rr("Sine",function(e){return e===1?1:-Aw(e*Tw)+1});Rr("Back",zs("in"),zs("out"),zs());Tt.SteppedEase=Tt.steps=rn.SteppedEase={config:function(t,n){t===void 0&&(t=1);var r=1/t,i=t+(n?0:1),a=n?1:0,s=1-Nt;return function(o){return((i*na(0,s,o)|0)+a)*r}}};ai.ease=Tt["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Jc+=e+","+e+"Params,"});var b0=function(t,n){this.id=Mw++,t._gsap=this,this.target=t,this.harness=n,this.get=n?n.get:Qm,this.set=n?n.getSetter:sf},Vi=(function(){function e(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,li(this,+n.duration,1,1),this.data=n.data,Ut&&(this._ctx=Ut,Ut.data.push(this)),Ki||Qe.wake()}var t=e.prototype;return t.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},t.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},t.totalDuration=function(r){return arguments.length?(this._dirty=0,li(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(r,i){if(ui(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(os(this,r),!a._dp||a.parent||r0(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Sn(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Nt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),Jm(this,r,i)),this},t.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+bh(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},t.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+bh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(r,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*a,i):this._repeat?oi(this._tTime,a)+1:1},t.timeScale=function(r,i){if(!arguments.length)return this._rts===-Nt?0:this._rts;if(this._rts===r)return this;var a=this.parent&&this._ts?Xa(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Nt?0:this._rts,this.totalTime(na(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),ss(this),Lw(this)},t.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ui(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Nt&&(this._tTime-=Nt)))),this):this._ps},t.startTime=function(r){if(arguments.length){this._start=Ht(r);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Sn(i,this,this._start-this._delay),this}return this._start},t.endTime=function(r){return this._start+(Ie(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Xa(i.rawTime(r),this):this._tTime:this._tTime},t.revert=function(r){r===void 0&&(r=Pw);var i=be;return be=r,ef(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),be=i,this},t.globalTime=function(r){for(var i=this,a=arguments.length?r:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):a},t.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,wh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,wh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},t.seek=function(r,i){return this.totalTime(un(this,r),Ie(i))},t.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Ie(i)),this._dur||(this._zTime=-Nt),this},t.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},t.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Nt:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Nt,this},t.isActive=function(){var r=this.parent||this._dp,i=this._start,a;return!!(!r||this._ts&&this._initted&&r.isActive()&&(a=r.rawTime(!0))>=i&&a<this.endTime(!0)-Nt)},t.eventCallback=function(r,i,a){var s=this.vars;return arguments.length>1?(i?(s[r]=i,a&&(s[r+"Params"]=a),r==="onUpdate"&&(this._onUpdate=i)):delete s[r],this):s[r]},t.then=function(r){var i=this,a=i._prom;return new Promise(function(s){var o=Kt(r)?r:e0,l=function(){var c=i.then;i.then=null,a&&a(),Kt(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},t.kill=function(){Ci(this)},e})();an(Vi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Nt,_prom:0,_ps:!1,_rts:1});var Oe=(function(e){Hm(t,e);function t(r,i){var a;return r===void 0&&(r={}),a=e.call(this,r)||this,a.labels={},a.smoothChildTiming=!!r.smoothChildTiming,a.autoRemoveChildren=!!r.autoRemoveChildren,a._sort=Ie(r.sortChildren),jt&&Sn(r.parent||jt,Fn(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),r.scrollTrigger&&i0(Fn(a),r.scrollTrigger),a}var n=t.prototype;return n.to=function(i,a,s){return Pi(0,arguments,this),this},n.from=function(i,a,s){return Pi(1,arguments,this),this},n.fromTo=function(i,a,s,o){return Pi(2,arguments,this),this},n.set=function(i,a,s){return a.duration=0,a.parent=this,Oi(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new se(i,a,un(this,s),1),this},n.call=function(i,a,s){return Sn(this,se.delayedCall(0,i,a),s)},n.staggerTo=function(i,a,s,o,l,u,c){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new se(i,s,un(this,l)),this},n.staggerFrom=function(i,a,s,o,l,u,c){return s.runBackwards=1,Oi(s).immediateRender=Ie(s.immediateRender),this.staggerTo(i,a,s,o,l,u,c)},n.staggerFromTo=function(i,a,s,o,l,u,c,f){return o.startAt=s,Oi(o).immediateRender=Ie(o.immediateRender),this.staggerTo(i,a,o,l,u,c,f)},n.render=function(i,a,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:Ht(i),f=this._zTime<0!=i<0&&(this._initted||!u),h,p,g,d,m,x,y,v,_,S,w,b;if(this!==jt&&c>l&&i>=0&&(c=l),c!==this._tTime||s||f){if(o!==this._time&&u&&(c+=this._time-o,i+=this._time-o),h=c,_=this._start,v=this._ts,x=!v,f&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(w=this._yoyo,m=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,a,s);if(h=Ht(c%m),c===l?(d=this._repeat,h=u):(S=Ht(c/m),d=~~S,d&&d===S&&(h=u,d--),h>u&&(h=u)),S=oi(this._tTime,m),!o&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),w&&d&1&&(h=u-h,b=1),d!==S&&!this._lock){var M=w&&S&1,A=M===(w&&d&1);if(d<S&&(M=!M),o=M?0:c%u?u:c,this._lock=1,this.render(o||(b?0:Ht(d*m)),a,!u)._lock=0,this._tTime=c,!a&&this.parent&&Je(this,"onRepeat"),this.vars.repeatRefresh&&!b&&(this.invalidate()._lock=1,S=d),o&&o!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,A&&(this._lock=2,o=M?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!b&&this.invalidate()),this._lock=0,!this._ts&&!x)return this;x0(this,b)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=Bw(this,Ht(o),Ht(h)),y&&(c-=h-(h=y._start))),this._tTime=c,this._time=h,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&c&&u&&!a&&!S&&(Je(this,"onStart"),this._tTime!==c))return this;if(h>=o&&i>=0)for(p=this._first;p;){if(g=p._next,(p._act||h>=p._start)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(h-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(h-p._start)*p._ts,a,s),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=-Nt);break}}p=g}else{p=this._last;for(var R=i<0?i:h;p;){if(g=p._prev,(p._act||R<=p._end)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(R-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(R-p._start)*p._ts,a,s||be&&ef(p)),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=R?-Nt:Nt);break}}p=g}}if(y&&!a&&(this.pause(),y.render(h>=o?0:-Nt)._zTime=h>=o?1:-1,this._ts))return this._start=_,ss(this),this.render(i,a,s);this._onUpdate&&!a&&Je(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(_===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&er(this,1),!a&&!(i<0&&!o)&&(c||o||!l)&&(Je(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(i,a){var s=this;if(Hn(a)||(a=un(this,a,i)),!(i instanceof Vi)){if(Ce(i))return i.forEach(function(o){return s.add(o,a)}),this;if(pe(i))return this.addLabel(i,a);if(Kt(i))i=se.delayedCall(0,i);else return this}return this!==i?Sn(this,i,a):this},n.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-fn);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof se?a&&l.push(u):(s&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,s)))),u=u._next;return l},n.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},n.remove=function(i){return pe(i)?this.removeLabel(i):Kt(i)?this.killTweensOf(i):(i.parent===this&&as(this,i),i===this._recent&&(this._recent=this._last),vr(this))},n.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(Qe.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),e.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},n.addLabel=function(i,a){return this.labels[i]=un(this,a),this},n.removeLabel=function(i){return delete this.labels[i],this},n.addPause=function(i,a,s){var o=se.delayedCall(0,a||Xi,s);return o.data="isPause",this._hasPause=1,Sn(this,o,un(this,i))},n.removePause=function(i){var a=this._first;for(i=un(this,i);a;)a._start===i&&a.data==="isPause"&&er(a),a=a._next},n.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),l=o.length;l--;)Kn!==o[l]&&o[l].kill(i,a);return this},n.getTweensOf=function(i,a){for(var s=[],o=hn(i),l=this._first,u=Hn(a),c;l;)l instanceof se?Fw(l._targets,o)&&(u?(!Kn||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&s.push(l):(c=l.getTweensOf(o,a)).length&&s.push.apply(s,c),l=l._next;return s},n.tweenTo=function(i,a){a=a||{};var s=this,o=un(s,i),l=a,u=l.startAt,c=l.onStart,f=l.onStartParams,h=l.immediateRender,p,g=se.to(s,an({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||Nt,onStart:function(){if(s.pause(),!p){var m=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());g._dur!==m&&li(g,m,0,1).render(g._time,!0,!0),p=1}c&&c.apply(g,f||[])}},a));return h?g.render(0):g},n.tweenFromTo=function(i,a,s){return this.tweenTo(a,an({startAt:{time:un(this,i)}},s))},n.recent=function(){return this._recent},n.nextLabel=function(i){return i===void 0&&(i=this._time),Sh(this,un(this,i))},n.previousLabel=function(i){return i===void 0&&(i=this._time),Sh(this,un(this,i),1)},n.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Nt)},n.shiftChildren=function(i,a,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(i=Ht(i);o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in l)l[u]>=s&&(l[u]+=i);return vr(this)},n.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return e.prototype.invalidate.call(this,i)},n.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),vr(this)},n.totalDuration=function(i){var a=0,s=this,o=s._last,l=fn,u,c,f;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(f=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,Sn(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(a-=c,(!f&&!s._dp||f&&f.smoothChildTiming)&&(s._start+=Ht(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>a&&o._ts&&(a=o._end),o=u;li(s,s===jt&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(i){if(jt._ts&&(Jm(jt,Xa(i,jt)),Zm=Qe.frame),Qe.frame>=xh){xh+=en.autoSleep||120;var a=jt._first;if((!a||!a._ts)&&en.autoSleep&&Qe._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||Qe.sleep()}}},t})(Vi);an(Oe.prototype,{_lock:0,_hasPause:0,_forcing:0});var rS=function(t,n,r,i,a,s,o){var l=new Be(this._pt,t,n,0,1,k0,null,a),u=0,c=0,f,h,p,g,d,m,x,y;for(l.b=r,l.e=i,r+="",i+="",(x=~i.indexOf("random("))&&(i=Wi(i)),s&&(y=[r,i],s(y,t,n),r=y[0],i=y[1]),h=r.match($s)||[];f=$s.exec(i);)g=f[0],d=i.substring(u,f.index),p?p=(p+1)%5:d.substr(-5)==="rgba("&&(p=1),g!==h[c++]&&(m=parseFloat(h[c-1])||0,l._pt={_next:l._pt,p:d||c===1?d:",",s:m,c:g.charAt(1)==="="?Xr(m,g)-m:parseFloat(g)-m,m:p&&p<4?Math.round:0},u=$s.lastIndex);return l.c=u<i.length?i.substring(u,i.length):"",l.fp=o,(Xm.test(i)||x)&&(l.e=0),this._pt=l,l},nf=function(t,n,r,i,a,s,o,l,u,c){Kt(i)&&(i=i(a||0,t,s));var f=t[n],h=r!=="get"?r:Kt(f)?u?t[n.indexOf("set")||!Kt(t["get"+n.substr(3)])?n:"get"+n.substr(3)](u):t[n]():f,p=Kt(f)?u?lS:M0:af,g;if(pe(i)&&(~i.indexOf("random(")&&(i=Wi(i)),i.charAt(1)==="="&&(g=Xr(h,i)+(ke(h)||0),(g||g===0)&&(i=g))),!c||h!==i||mc)return!isNaN(h*i)&&i!==""?(g=new Be(this._pt,t,n,+h||0,i-(h||0),typeof f=="boolean"?cS:A0,0,p),u&&(g.fp=u),o&&g.modifier(o,this,t),this._pt=g):(!f&&!(n in t)&&Zc(n,i),rS.call(this,t,n,h,i,p,l||en.stringFilter,u))},iS=function(t,n,r,i,a){if(Kt(t)&&(t=Fi(t,a,n,r,i)),!An(t)||t.style&&t.nodeType||Ce(t)||Gm(t))return pe(t)?Fi(t,a,n,r,i):t;var s={},o;for(o in t)s[o]=Fi(t[o],a,n,r,i);return s},w0=function(t,n,r,i,a,s){var o,l,u,c;if(Ze[t]&&(o=new Ze[t]).init(a,o.rawVars?n[t]:iS(n[t],i,a,s,r),r,i,s)!==!1&&(r._pt=l=new Be(r._pt,a,t,0,1,o.render,o,0,o.priority),r!==jr))for(u=r._ptLookup[r._targets.indexOf(a)],c=o._props.length;c--;)u[o._props[c]]=l;return o},Kn,mc,rf=function e(t,n,r){var i=t.vars,a=i.ease,s=i.startAt,o=i.immediateRender,l=i.lazy,u=i.onUpdate,c=i.runBackwards,f=i.yoyoEase,h=i.keyframes,p=i.autoRevert,g=t._dur,d=t._startAt,m=t._targets,x=t.parent,y=x&&x.data==="nested"?x.vars.targets:m,v=t._overwrite==="auto"&&!Xc,_=t.timeline,S,w,b,M,A,R,C,O,D,N,H,q,F;if(_&&(!h||!a)&&(a="none"),t._ease=br(a,ai.ease),t._yEase=f?_0(br(f===!0?a:f,ai.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!_&&!!i.runBackwards,!_||h&&!i.stagger){if(O=m[0]?xr(m[0]).harness:0,q=O&&i[O.prop],S=Ya(i,Qc),d&&(d._zTime<0&&d.progress(1),n<0&&c&&o&&!p?d.render(-1,!0):d.revert(c&&g?Ca:Ow),d._lazy=0),s){if(er(t._startAt=se.set(m,an({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!d&&Ie(l),startAt:null,delay:0,onUpdate:u&&function(){return Je(t,"onUpdate")},stagger:0},s))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(be||!o&&!p)&&t._startAt.revert(Ca),o&&g&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(c&&g&&!d){if(n&&(o=!1),b=an({overwrite:!1,data:"isFromStart",lazy:o&&!d&&Ie(l),immediateRender:o,stagger:0,parent:x},S),q&&(b[O.prop]=q),er(t._startAt=se.set(m,b)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(be?t._startAt.revert(Ca):t._startAt.render(-1,!0)),t._zTime=n,!o)e(t._startAt,Nt,Nt);else if(!n)return}for(t._pt=t._ptCache=0,l=g&&Ie(l)||l&&!g,w=0;w<m.length;w++){if(A=m[w],C=A._gsap||tf(m)[w]._gsap,t._ptLookup[w]=N={},cc[C.id]&&Qn.length&&Ga(),H=y===m?w:y.indexOf(A),O&&(D=new O).init(A,q||S,t,H,y)!==!1&&(t._pt=M=new Be(t._pt,A,D.name,0,1,D.render,D,0,D.priority),D._props.forEach(function(j){N[j]=M}),D.priority&&(R=1)),!O||q)for(b in S)Ze[b]&&(D=w0(b,S,t,H,A,y))?D.priority&&(R=1):N[b]=M=nf.call(t,A,b,"get",S[b],H,y,0,i.stringFilter);t._op&&t._op[w]&&t.kill(A,t._op[w]),v&&t._pt&&(Kn=t,jt.killTweensOf(A,N,t.globalTime(n)),F=!t.parent,Kn=0),t._pt&&l&&(cc[C.id]=1)}R&&C0(t),t._onInit&&t._onInit(t)}t._onUpdate=u,t._initted=(!t._op||t._pt)&&!F,h&&n<=0&&_.render(fn,!0,!0)},aS=function(t,n,r,i,a,s,o,l){var u=(t._pt&&t._ptCache||(t._ptCache={}))[n],c,f,h,p;if(!u)for(u=t._ptCache[n]=[],h=t._ptLookup,p=t._targets.length;p--;){if(c=h[p][n],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==n&&c.fp!==n;)c=c._next;if(!c)return mc=1,t.vars[n]="+=0",rf(t,o),mc=0,l?Yi(n+" not eligible for reset"):1;u.push(c)}for(p=u.length;p--;)f=u[p],c=f._pt||f,c.s=(i||i===0)&&!a?i:c.s+(i||0)+s*c.c,c.c=r-c.s,f.e&&(f.e=te(r)+ke(f.e)),f.b&&(f.b=c.s+ke(f.b))},sS=function(t,n){var r=t[0]?xr(t[0]).harness:0,i=r&&r.aliases,a,s,o,l;if(!i)return n;a=si({},n);for(s in i)if(s in a)for(l=i[s].split(","),o=l.length;o--;)a[l[o]]=a[s];return a},oS=function(t,n,r,i){var a=n.ease||i||"power1.inOut",s,o;if(Ce(n))o=r[t]||(r[t]=[]),n.forEach(function(l,u){return o.push({t:u/(n.length-1)*100,v:l,e:a})});else for(s in n)o=r[s]||(r[s]=[]),s==="ease"||o.push({t:parseFloat(t),v:n[s],e:a})},Fi=function(t,n,r,i,a){return Kt(t)?t.call(n,r,i,a):pe(t)&&~t.indexOf("random(")?Wi(t):t},S0=Jc+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",T0={};ze(S0+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return T0[e]=1});var se=(function(e){Hm(t,e);function t(r,i,a,s){var o;typeof i=="number"&&(a.duration=i,i=a,a=null),o=e.call(this,s?i:Oi(i))||this;var l=o.vars,u=l.duration,c=l.delay,f=l.immediateRender,h=l.stagger,p=l.overwrite,g=l.keyframes,d=l.defaults,m=l.scrollTrigger,x=l.yoyoEase,y=i.parent||jt,v=(Ce(r)||Gm(r)?Hn(r[0]):"length"in i)?[r]:hn(r),_,S,w,b,M,A,R,C;if(o._targets=v.length?tf(v):Yi("GSAP target "+r+" not found. https://gsap.com",!en.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||h||_a(u)||_a(c)){if(i=o.vars,_=o.timeline=new Oe({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:v}),_.kill(),_.parent=_._dp=Fn(o),_._start=0,h||_a(u)||_a(c)){if(b=v.length,R=h&&l0(h),An(h))for(M in h)~S0.indexOf(M)&&(C||(C={}),C[M]=h[M]);for(S=0;S<b;S++)w=Ya(i,T0),w.stagger=0,x&&(w.yoyoEase=x),C&&si(w,C),A=v[S],w.duration=+Fi(u,Fn(o),S,A,v),w.delay=(+Fi(c,Fn(o),S,A,v)||0)-o._delay,!h&&b===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),_.to(A,w,R?R(S,A,v):0),_._ease=Tt.none;_.duration()?u=c=0:o.timeline=0}else if(g){Oi(an(_.vars.defaults,{ease:"none"})),_._ease=br(g.ease||i.ease||"none");var O=0,D,N,H;if(Ce(g))g.forEach(function(q){return _.to(v,q,">")}),_.duration();else{w={};for(M in g)M==="ease"||M==="easeEach"||oS(M,g[M],w,g.easeEach);for(M in w)for(D=w[M].sort(function(q,F){return q.t-F.t}),O=0,S=0;S<D.length;S++)N=D[S],H={ease:N.e,duration:(N.t-(S?D[S-1].t:0))/100*u},H[M]=N.v,_.to(v,H,O),O+=H.duration;_.duration()<u&&_.to({},{duration:u-_.duration()})}}u||o.duration(u=_.duration())}else o.timeline=0;return p===!0&&!Xc&&(Kn=Fn(o),jt.killTweensOf(v),Kn=0),Sn(y,Fn(o),a),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(f||!u&&!g&&o._start===Ht(y._time)&&Ie(f)&&qw(Fn(o))&&y.data!=="nested")&&(o._tTime=-Nt,o.render(Math.max(0,-c)||0)),m&&i0(Fn(o),m),o}var n=t.prototype;return n.render=function(i,a,s){var o=this._time,l=this._tDur,u=this._dur,c=i<0,f=i>l-Nt&&!c?l:i<Nt?0:i,h,p,g,d,m,x,y,v,_;if(!u)zw(this,i,a,s);else if(f!==this._tTime||!i||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(h=f,v=this.timeline,this._repeat){if(d=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+i,a,s);if(h=Ht(f%d),f===l?(g=this._repeat,h=u):(m=Ht(f/d),g=~~m,g&&g===m?(h=u,g--):h>u&&(h=u)),x=this._yoyo&&g&1,x&&(_=this._yEase,h=u-h),m=oi(this._tTime,d),h===o&&!s&&this._initted&&g===m)return this._tTime=f,this;g!==m&&(v&&this._yEase&&x0(v,x),this.vars.repeatRefresh&&!x&&!this._lock&&h!==d&&this._initted&&(this._lock=s=1,this.render(Ht(d*g),!0).invalidate()._lock=0))}if(!this._initted){if(a0(this,c?i:h,s,a,f))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==m))return this;if(u!==this._dur)return this.render(i,a,s)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(_||this._ease)(h/u),this._from&&(this.ratio=y=1-y),!o&&f&&!a&&!m&&(Je(this,"onStart"),this._tTime!==f))return this;for(p=this._pt;p;)p.r(y,p.d),p=p._next;v&&v.render(i<0?i:v._dur*v._ease(h/this._dur),a,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&fc(this,i,a,s),Je(this,"onUpdate")),this._repeat&&g!==m&&this.vars.onRepeat&&!a&&this.parent&&Je(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&fc(this,i,!0,!0),(i||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&er(this,1),!a&&!(c&&!o)&&(f||o||x)&&(Je(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),e.prototype.invalidate.call(this,i)},n.resetTo=function(i,a,s,o,l){Ki||Qe.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||rf(this,u),c=this._ease(u/this._dur),aS(this,i,a,s,o,c,u,l)?this.resetTo(i,a,s,o,1):(os(this,0),this.parent||n0(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?Ci(this):this.scrollTrigger&&this.scrollTrigger.kill(!!be),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Kn&&Kn.vars.overwrite!==!0)._first||Ci(this),this.parent&&s!==this.timeline.totalDuration()&&li(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=i?hn(i):o,u=this._ptLookup,c=this._pt,f,h,p,g,d,m,x;if((!a||a==="all")&&$w(o,l))return a==="all"&&(this._pt=0),Ci(this);for(f=this._op=this._op||[],a!=="all"&&(pe(a)&&(d={},ze(a,function(y){return d[y]=1}),a=d),a=sS(o,a)),x=o.length;x--;)if(~l.indexOf(o[x])){h=u[x],a==="all"?(f[x]=a,g=h,p={}):(p=f[x]=f[x]||{},g=a);for(d in g)m=h&&h[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&as(this,m,"_pt"),delete h[d]),p!=="all"&&(p[d]=1)}return this._initted&&!this._pt&&c&&Ci(this),this},t.to=function(i,a){return new t(i,a,arguments[2])},t.from=function(i,a){return Pi(1,arguments)},t.delayedCall=function(i,a,s,o){return new t(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},t.fromTo=function(i,a,s){return Pi(2,arguments)},t.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new t(i,a)},t.killTweensOf=function(i,a,s){return jt.killTweensOf(i,a,s)},t})(Vi);an(se.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(e){se[e]=function(){var t=new Oe,n=pc.call(arguments,0);return n.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,n)}});var af=function(t,n,r){return t[n]=r},M0=function(t,n,r){return t[n](r)},lS=function(t,n,r,i){return t[n](i.fp,r)},uS=function(t,n,r){return t.setAttribute(n,r)},sf=function(t,n){return Kt(t[n])?M0:Wc(t[n])&&t.setAttribute?uS:af},A0=function(t,n){return n.set(n.t,n.p,Math.round((n.s+n.c*t)*1e6)/1e6,n)},cS=function(t,n){return n.set(n.t,n.p,!!(n.s+n.c*t),n)},k0=function(t,n){var r=n._pt,i="";if(!t&&n.b)i=n.b;else if(t===1&&n.e)i=n.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+i,r=r._next;i+=n.c}n.set(n.t,n.p,i,n)},of=function(t,n){for(var r=n._pt;r;)r.r(t,r.d),r=r._next},fS=function(t,n,r,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(t,n,r),a=s},hS=function(t){for(var n=this._pt,r,i;n;)i=n._next,n.p===t&&!n.op||n.op===t?as(this,n,"_pt"):n.dep||(r=1),n=i;return!r},pS=function(t,n,r,i){i.mSet(t,n,i.m.call(i.tween,r,i.mt),i)},C0=function(t){for(var n=t._pt,r,i,a,s;n;){for(r=n._next,i=a;i&&i.pr>n.pr;)i=i._next;(n._prev=i?i._prev:s)?n._prev._next=n:a=n,(n._next=i)?i._prev=n:s=n,n=r}t._pt=a},Be=(function(){function e(n,r,i,a,s,o,l,u,c){this.t=r,this.s=a,this.c=s,this.p=i,this.r=o||A0,this.d=l||this,this.set=u||af,this.pr=c||0,this._next=n,n&&(n._prev=this)}var t=e.prototype;return t.modifier=function(r,i,a){this.mSet=this.mSet||this.set,this.set=pS,this.m=r,this.mt=a,this.tween=i},e})();ze(Jc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(e){return Qc[e]=1});rn.TweenMax=rn.TweenLite=se;rn.TimelineLite=rn.TimelineMax=Oe;jt=new Oe({sortChildren:!1,defaults:ai,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});en.stringFilter=y0;var wr=[],Ea={},dS=[],Mh=0,gS=0,Bs=function(t){return(Ea[t]||dS).map(function(n){return n()})},yc=function(){var t=Date.now(),n=[];t-Mh>2&&(Bs("matchMediaInit"),wr.forEach(function(r){var i=r.queries,a=r.conditions,s,o,l,u;for(o in i)s=wn.matchMedia(i[o]).matches,s&&(l=1),s!==a[o]&&(a[o]=s,u=1);u&&(r.revert(),l&&n.push(r))}),Bs("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),Mh=t,Bs("matchMedia"))},R0=(function(){function e(n,r){this.selector=r&&dc(r),this.data=[],this._r=[],this.isReverted=!1,this.id=gS++,n&&this.add(n)}var t=e.prototype;return t.add=function(r,i,a){Kt(r)&&(a=i,i=r,r=Kt);var s=this,o=function(){var u=Ut,c=s.selector,f;return u&&u!==s&&u.data.push(s),a&&(s.selector=dc(a)),Ut=s,f=i.apply(s,arguments),Kt(f)&&s._r.push(f),Ut=u,s.selector=c,s.isReverted=!1,f};return s.last=o,r===Kt?o(s,function(l){return s.add(null,l)}):r?s[r]=o:o},t.ignore=function(r){var i=Ut;Ut=null,r(this),Ut=i},t.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof e?r.push.apply(r,i.getTweens()):i instanceof se&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(r,i){var a=this;if(r?(function(){for(var o=a.getTweens(),l=a.data.length,u;l--;)u=a.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),l=a.data.length;l--;)u=a.data[l],u instanceof Oe?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof se)&&u.revert&&u.revert(r);a._r.forEach(function(c){return c(r,a)}),a.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=wr.length;s--;)wr[s].id===this.id&&wr.splice(s,1)},t.revert=function(r){this.kill(r||{})},e})(),mS=(function(){function e(n){this.contexts=[],this.scope=n,Ut&&Ut.data.push(this)}var t=e.prototype;return t.add=function(r,i,a){An(r)||(r={matches:r});var s=new R0(0,a||this.scope),o=s.conditions={},l,u,c;Ut&&!s.selector&&(s.selector=Ut.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=r;for(u in r)u==="all"?c=1:(l=wn.matchMedia(r[u]),l&&(wr.indexOf(s)<0&&wr.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(yc):l.addEventListener("change",yc)));return c&&i(s,function(f){return s.add(null,f)}),this},t.revert=function(r){this.kill(r||{})},t.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},e})(),Wa={registerPlugin:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(i){return d0(i)})},timeline:function(t){return new Oe(t)},getTweensOf:function(t,n){return jt.getTweensOf(t,n)},getProperty:function(t,n,r,i){pe(t)&&(t=hn(t)[0]);var a=xr(t||{}).get,s=r?e0:t0;return r==="native"&&(r=""),t&&(n?s((Ze[n]&&Ze[n].get||a)(t,n,r,i)):function(o,l,u){return s((Ze[o]&&Ze[o].get||a)(t,o,l,u))})},quickSetter:function(t,n,r){if(t=hn(t),t.length>1){var i=t.map(function(c){return He.quickSetter(c,n,r)}),a=i.length;return function(c){for(var f=a;f--;)i[f](c)}}t=t[0]||{};var s=Ze[n],o=xr(t),l=o.harness&&(o.harness.aliases||{})[n]||n,u=s?function(c){var f=new s;jr._pt=0,f.init(t,r?c+r:c,jr,0,[t]),f.render(1,f),jr._pt&&of(1,jr)}:o.set(t,l);return s?u:function(c){return u(t,l,r?c+r:c,o,1)}},quickTo:function(t,n,r){var i,a=He.to(t,an((i={},i[n]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(l,u,c){return a.resetTo(n,l,u,c)};return s.tween=a,s},isTweening:function(t){return jt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=br(t.ease,ai.ease)),vh(ai,t||{})},config:function(t){return vh(en,t||{})},registerEffect:function(t){var n=t.name,r=t.effect,i=t.plugins,a=t.defaults,s=t.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Ze[o]&&!rn[o]&&Yi(n+" effect requires "+o+" plugin.")}),Ls[n]=function(o,l,u){return r(hn(o),an(l||{},a),u)},s&&(Oe.prototype[n]=function(o,l,u){return this.add(Ls[n](o,An(l)?l:(u=l)&&{},this),u)})},registerEase:function(t,n){Tt[t]=br(n)},parseEase:function(t,n){return arguments.length?br(t,n):Tt},getById:function(t){return jt.getById(t)},exportRoot:function(t,n){t===void 0&&(t={});var r=new Oe(t),i,a;for(r.smoothChildTiming=Ie(t.smoothChildTiming),jt.remove(r),r._dp=0,r._time=r._tTime=jt._time,i=jt._first;i;)a=i._next,(n||!(!i._dur&&i instanceof se&&i.vars.onComplete===i._targets[0]))&&Sn(r,i,i._start-i._delay),i=a;return Sn(jt,r,0),r},context:function(t,n){return t?new R0(t,n):Ut},matchMedia:function(t){return new mS(t)},matchMediaRefresh:function(){return wr.forEach(function(t){var n=t.conditions,r,i;for(i in n)n[i]&&(n[i]=!1,r=1);r&&t.revert()})||yc()},addEventListener:function(t,n){var r=Ea[t]||(Ea[t]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(t,n){var r=Ea[t],i=r&&r.indexOf(n);i>=0&&r.splice(i,1)},utils:{wrap:Ww,wrapYoyo:Kw,distribute:l0,random:c0,snap:u0,normalize:Xw,getUnit:ke,clamp:Hw,splitColor:g0,toArray:hn,selector:dc,mapRange:h0,pipe:Gw,unitize:Yw,interpolate:Vw,shuffle:o0},install:Km,effects:Ls,ticker:Qe,updateRoot:Oe.updateRoot,plugins:Ze,globalTimeline:jt,core:{PropTween:Be,globals:Vm,Tween:se,Timeline:Oe,Animation:Vi,getCache:xr,_removeLinkedListItem:as,reverting:function(){return be},context:function(t){return t&&Ut&&(Ut.data.push(t),t._ctx=Ut),Ut},suppressOverwrites:function(t){return Xc=t}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return Wa[e]=se[e]});Qe.add(Oe.updateRoot);jr=Wa.to({},{duration:0});var yS=function(t,n){for(var r=t._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},_S=function(t,n){var r=t._targets,i,a,s;for(i in n)for(a=r.length;a--;)s=t._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=yS(s,i)),s&&s.modifier&&s.modifier(n[i],t,r[a],i))},Us=function(t,n){return{name:t,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var l,u;if(pe(a)&&(l={},ze(a,function(c){return l[c]=1}),a=l),n){l={};for(u in a)l[u]=n(a[u]);a=l}_S(o,a)}}}},He=Wa.registerPlugin({name:"attr",init:function(t,n,r,i,a){var s,o,l;this.tween=r;for(s in n)l=t.getAttribute(s)||"",o=this.add(t,"setAttribute",(l||0)+"",n[s],i,a,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(t,n){for(var r=n._pt;r;)be?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,n){for(var r=n.length;r--;)this.add(t,r,t[r]||0,n[r],0,0,0,0,0,1)}},Us("roundProps",gc),Us("modifiers"),Us("snap",u0))||Wa;se.version=Oe.version=He.version="3.14.2";Wm=1;Kc()&&ui();Tt.Power0;Tt.Power1;Tt.Power2;Tt.Power3;Tt.Power4;Tt.Linear;Tt.Quad;Tt.Cubic;Tt.Quart;Tt.Quint;Tt.Strong;Tt.Elastic;Tt.Back;Tt.SteppedEase;Tt.Bounce;Tt.Sine;Tt.Expo;Tt.Circ;/*!
|
|
8
|
+
*/var en={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},si={duration:.5,overwrite:!1,delay:0},Xc,be,Ut,fn=1e8,$t=1/fn,uc=Math.PI*2,Aw=uc/4,kw=0,Gm=Math.sqrt,Cw=Math.cos,Rw=Math.sin,pe=function(t){return typeof t=="string"},Kt=function(t){return typeof t=="function"},Hn=function(t){return typeof t=="number"},Kc=function(t){return typeof t>"u"},An=function(t){return typeof t=="object"},Ie=function(t){return t!==!1},Vc=function(){return typeof window<"u"},xa=function(t){return Kt(t)||pe(t)},Ym=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Ce=Array.isArray,Ew=/random\([^)]+\)/g,Dw=/,\s*/g,xh=/(?:-?\.?\d|\.)+/gi,Wm=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,jr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ns=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Xm=/[+-]=-?[.\d]+/,Ow=/[^,'"\[\]\s]+/gi,Pw=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,jt,wn,cc,Zc,rn={},Ga={},Km,Vm=function(t){return(Ga=oi(t,rn))&&He},Qc=function(t,n){return console.warn("Invalid property",t,"set to",n,"Missing plugin? gsap.registerPlugin()")},Wi=function(t,n){return!n&&console.warn(t)},Zm=function(t,n){return t&&(rn[t]=n)&&Ga&&(Ga[t]=n)||rn},Xi=function(){return 0},Fw={suppressEvents:!0,isStart:!0,kill:!1},Ra={suppressEvents:!0,kill:!1},$w={suppressEvents:!0},Jc={},Jn=[],fc={},Qm,Ze={},qs={},vh=30,Ea=[],tf="",ef=function(t){var n=t[0],r,i;if(An(n)||Kt(n)||(t=[t]),!(r=(n._gsap||{}).harness)){for(i=Ea.length;i--&&!Ea[i].targetTest(n););r=Ea[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new w0(t[i],r)))||t.splice(i,1);return t},vr=function(t){return t._gsap||ef(hn(t))[0]._gsap},Jm=function(t,n,r){return(r=t[n])&&Kt(r)?t[n]():Kc(r)&&t.getAttribute&&t.getAttribute(n)||r},ze=function(t,n){return(t=t.split(",")).forEach(n)||t},te=function(t){return Math.round(t*1e5)/1e5||0},Ht=function(t){return Math.round(t*1e7)/1e7||0},Xr=function(t,n){var r=n.charAt(0),i=parseFloat(n.substr(2));return t=parseFloat(t),r==="+"?t+i:r==="-"?t-i:r==="*"?t*i:t/i},Lw=function(t,n){for(var r=n.length,i=0;t.indexOf(n[i])<0&&++i<r;);return i<r},Ya=function(){var t=Jn.length,n=Jn.slice(0),r,i;for(fc={},Jn.length=0,r=0;r<t;r++)i=n[r],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},nf=function(t){return!!(t._initted||t._startAt||t.add)},t0=function(t,n,r,i){Jn.length&&!be&&Ya(),t.render(n,r,!!(be&&n<0&&nf(t))),Jn.length&&!be&&Ya()},e0=function(t){var n=parseFloat(t);return(n||n===0)&&(t+"").match(Ow).length<2?n:pe(t)?t.trim():t},n0=function(t){return t},an=function(t,n){for(var r in n)r in t||(t[r]=n[r]);return t},Nw=function(t){return function(n,r){for(var i in r)i in n||i==="duration"&&t||i==="ease"||(n[i]=r[i])}},oi=function(t,n){for(var r in n)t[r]=n[r];return t},bh=function e(t,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=An(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},Wa=function(t,n){var r={},i;for(i in t)i in n||(r[i]=t[i]);return r},Pi=function(t){var n=t.parent||jt,r=t.keyframes?Nw(Ce(t.keyframes)):an;if(Ie(t.inherit))for(;n;)r(t,n.vars.defaults),n=n.parent||n._dp;return t},qw=function(t,n){for(var r=t.length,i=r===n.length;i&&r--&&t[r]===n[r];);return r<0},r0=function(t,n,r,i,a){var s=t[i],o;if(a)for(o=n[a];s&&s[a]>o;)s=s._prev;return s?(n._next=s._next,s._next=n):(n._next=t[r],t[r]=n),n._next?n._next._prev=n:t[i]=n,n._prev=s,n.parent=n._dp=t,n},ss=function(t,n,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var a=n._prev,s=n._next;a?a._next=s:t[r]===n&&(t[r]=s),s?s._prev=a:t[i]===n&&(t[i]=a),n._next=n._prev=n.parent=null},nr=function(t,n){t.parent&&(!n||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},br=function(t,n){if(t&&(!n||n._end>t._dur||n._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Iw=function(t){for(var n=t.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return t},hc=function(t,n,r,i){return t._startAt&&(be?t._startAt.revert(Ra):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(n,!0,i))},zw=function e(t){return!t||t._ts&&e(t.parent)},wh=function(t){return t._repeat?li(t._tTime,t=t.duration()+t._rDelay)*t:0},li=function(t,n){var r=Math.floor(t=Ht(t/n));return t&&r===t?r-1:r},Xa=function(t,n){return(t-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},os=function(t){return t._end=Ht(t._start+(t._tDur/Math.abs(t._ts||t._rts||$t)||0))},ls=function(t,n){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ht(r._time-(t._ts>0?n/t._ts:((t._dirty?t.totalDuration():t._tDur)-n)/-t._ts)),os(t),r._dirty||br(r,t)),t},i0=function(t,n){var r;if((n._time||!n._dur&&n._initted||n._start<t._time&&(n._dur||!n.add))&&(r=Xa(t.rawTime(),n),(!n._dur||ra(0,n.totalDuration(),r)-n._tTime>$t)&&n.render(r,!0)),br(t,n)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-$t}},Sn=function(t,n,r,i){return n.parent&&nr(n),n._start=Ht((Hn(r)?r:r||t!==jt?un(t,r,n):t._time)+n._delay),n._end=Ht(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),r0(t,n,"_first","_last",t._sort?"_start":0),pc(n)||(t._recent=n),i||i0(t,n),t._ts<0&&ls(t,t._tTime),t},a0=function(t,n){return(rn.ScrollTrigger||Qc("scrollTrigger",n))&&rn.ScrollTrigger.create(n,t)},s0=function(t,n,r,i,a){if(af(t,n,a),!t._initted)return 1;if(!r&&t._pt&&!be&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Qm!==Qe.frame)return Jn.push(t),t._lazy=[a,i],1},Bw=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))},pc=function(t){var n=t.data;return n==="isFromStart"||n==="isStart"},Uw=function(t,n,r,i){var a=t.ratio,s=n<0||!n&&(!t._start&&Bw(t)&&!(!t._initted&&pc(t))||(t._ts<0||t._dp._ts<0)&&!pc(t))?0:1,o=t._rDelay,l=0,u,c,f;if(o&&t._repeat&&(l=ra(0,t._tDur,n),c=li(l,o),t._yoyo&&c&1&&(s=1-s),c!==li(t._tTime,o)&&(a=1-s,t.vars.repeatRefresh&&t._initted&&t.invalidate())),s!==a||be||i||t._zTime===$t||!n&&t._zTime){if(!t._initted&&s0(t,n,i,r,l))return;for(f=t._zTime,t._zTime=n||(r?$t:0),r||(r=n&&!f),t.ratio=s,t._from&&(s=1-s),t._time=0,t._tTime=l,u=t._pt;u;)u.r(s,u.d),u=u._next;n<0&&hc(t,n,r,!0),t._onUpdate&&!r&&Je(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Je(t,"onRepeat"),(n>=t._tDur||n<0)&&t.ratio===s&&(s&&nr(t,1),!r&&!be&&(Je(t,s?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=n)},Hw=function(t,n,r){var i;if(r>n)for(i=t._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>n)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start<n)return i;i=i._prev}},ui=function(t,n,r,i){var a=t._repeat,s=Ht(n)||0,o=t._tTime/t._tDur;return o&&!i&&(t._time*=s/t._dur),t._dur=s,t._tDur=a?a<0?1e10:Ht(s*(a+1)+t._rDelay*a):s,o>0&&!i&&ls(t,t._tTime=t._tDur*o),t.parent&&os(t),r||br(t.parent,t),t},Sh=function(t){return t instanceof Oe?br(t):ui(t,t._dur)},jw={_start:0,endTime:Xi,totalDuration:Xi},un=function e(t,n,r){var i=t.labels,a=t._recent||jw,s=t.duration()>=fn?a.endTime(!1):t._dur,o,l,u;return pe(n)&&(isNaN(n)||n in i)?(l=n.charAt(0),u=n.substr(-1)==="%",o=n.indexOf("="),l==="<"||l===">"?(o>=0&&(n=n.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0)*(u?(o<0?a:r).totalDuration()/100:1)):o<0?(n in i||(i[n]=s),i[n]):(l=parseFloat(n.charAt(o-1)+n.substr(o+1)),u&&r&&(l=l/100*(Ce(r)?r[0]:r).totalDuration()),o>1?e(t,n.substr(0,o-1),r)+l:s+l)):n==null?s:+n},Fi=function(t,n,r){var i=Hn(n[1]),a=(i?2:1)+(t<2?0:1),s=n[a],o,l;if(i&&(s.duration=n[1]),s.parent=r,t){for(o=s,l=r;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Ie(l.vars.inherit)&&l.parent;s.immediateRender=Ie(o.immediateRender),t<2?s.runBackwards=1:s.startAt=n[a-1]}return new se(n[0],s,n[a+1])},ar=function(t,n){return t||t===0?n(t):n},ra=function(t,n,r){return r<t?t:r>n?n:r},ke=function(t,n){return!pe(t)||!(n=Pw.exec(t))?"":n[1]},Gw=function(t,n,r){return ar(r,function(i){return ra(t,n,i)})},dc=[].slice,o0=function(t,n){return t&&An(t)&&"length"in t&&(!n&&!t.length||t.length-1 in t&&An(t[0]))&&!t.nodeType&&t!==wn},Yw=function(t,n,r){return r===void 0&&(r=[]),t.forEach(function(i){var a;return pe(i)&&!n||o0(i,1)?(a=r).push.apply(a,hn(i)):r.push(i)})||r},hn=function(t,n,r){return Ut&&!n&&Ut.selector?Ut.selector(t):pe(t)&&!r&&(cc||!ci())?dc.call((n||Zc).querySelectorAll(t),0):Ce(t)?Yw(t,r):o0(t)?dc.call(t,0):t?[t]:[]},gc=function(t){return t=hn(t)[0]||Wi("Invalid scope")||{},function(n){var r=t.current||t.nativeElement||t;return hn(n,r.querySelectorAll?r:r===t?Wi("Invalid scope")||Zc.createElement("div"):t)}},l0=function(t){return t.sort(function(){return .5-Math.random()})},u0=function(t){if(Kt(t))return t;var n=An(t)?t:{each:t},r=wr(n.ease),i=n.from||0,a=parseFloat(n.base)||0,s={},o=i>0&&i<1,l=isNaN(i)||o,u=n.axis,c=i,f=i;return pe(i)?c=f={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(c=i[0],f=i[1]),function(h,p,g){var d=(g||n).length,m=s[d],x,y,v,_,S,w,b,M,A;if(!m){if(A=n.grid==="auto"?0:(n.grid||[1,fn])[1],!A){for(b=-fn;b<(b=g[A++].getBoundingClientRect().left)&&A<d;);A<d&&A--}for(m=s[d]=[],x=l?Math.min(A,d)*c-.5:i%A,y=A===fn?0:l?d*f/A-.5:i/A|0,b=0,M=fn,w=0;w<d;w++)v=w%A-x,_=y-(w/A|0),m[w]=S=u?Math.abs(u==="y"?_:v):Gm(v*v+_*_),S>b&&(b=S),S<M&&(M=S);i==="random"&&l0(m),m.max=b-M,m.min=M,m.v=d=(parseFloat(n.amount)||parseFloat(n.each)*(A>d?d-1:u?u==="y"?d/A:A:Math.max(A,d/A))||0)*(i==="edges"?-1:1),m.b=d<0?a-d:a,m.u=ke(n.amount||n.each)||0,r=r&&d<0?x0(r):r}return d=(m[h]-m.min)/m.max||0,Ht(m.b+(r?r(d):d)*m.v)+m.u}},mc=function(t){var n=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var i=Ht(Math.round(parseFloat(r)/t)*t*n);return(i-i%1)/n+(Hn(r)?0:ke(r))}},c0=function(t,n){var r=Ce(t),i,a;return!r&&An(t)&&(i=r=t.radius||fn,t.values?(t=hn(t.values),(a=!Hn(t[0]))&&(i*=i)):t=mc(t.increment)),ar(n,r?Kt(t)?function(s){return a=t(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),l=parseFloat(a?s.y:0),u=fn,c=0,f=t.length,h,p;f--;)a?(h=t[f].x-o,p=t[f].y-l,h=h*h+p*p):h=Math.abs(t[f]-o),h<u&&(u=h,c=f);return c=!i||u<=i?t[c]:s,a||c===s||Hn(s)?c:c+ke(s)}:mc(t))},f0=function(t,n,r,i){return ar(Ce(t)?!n:r===!0?!!(r=0):!i,function(){return Ce(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(n-t+r*.99))/r)*r*i)/i})},Ww=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduce(function(a,s){return s(a)},i)}},Xw=function(t,n){return function(r){return t(parseFloat(r))+(n||ke(r))}},Kw=function(t,n,r){return p0(t,n,0,1,r)},h0=function(t,n,r){return ar(r,function(i){return t[~~n(i)]})},Vw=function e(t,n,r){var i=n-t;return Ce(t)?h0(t,e(0,t.length),n):ar(r,function(a){return(i+(a-t)%i)%i+t})},Zw=function e(t,n,r){var i=n-t,a=i*2;return Ce(t)?h0(t,e(0,t.length-1),n):ar(r,function(s){return s=(a+(s-t)%a)%a||0,t+(s>i?a-s:s)})},Ki=function(t){return t.replace(Ew,function(n){var r=n.indexOf("[")+1,i=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Dw);return f0(r?i:+i[0],r?0:+i[1],+i[2]||1e-5)})},p0=function(t,n,r,i,a){var s=n-t,o=i-r;return ar(a,function(l){return r+((l-t)/s*o||0)})},Qw=function e(t,n,r,i){var a=isNaN(t+n)?0:function(p){return(1-p)*t+p*n};if(!a){var s=pe(t),o={},l,u,c,f,h;if(r===!0&&(i=1)&&(r=null),s)t={p:t},n={p:n};else if(Ce(t)&&!Ce(n)){for(c=[],f=t.length,h=f-2,u=1;u<f;u++)c.push(e(t[u-1],t[u]));f--,a=function(g){g*=f;var d=Math.min(h,~~g);return c[d](g-d)},r=n}else i||(t=oi(Ce(t)?[]:{},t));if(!c){for(l in n)rf.call(o,t,l,"get",n[l]);a=function(g){return lf(g,o)||(s?t.p:t)}}}return ar(r,a)},Th=function(t,n,r){var i=t.labels,a=fn,s,o,l;for(s in i)o=i[s]-n,o<0==!!r&&o&&a>(o=Math.abs(o))&&(l=s,a=o);return l},Je=function(t,n,r){var i=t.vars,a=i[n],s=Ut,o=t._ctx,l,u,c;if(a)return l=i[n+"Params"],u=i.callbackScope||t,r&&Jn.length&&Ya(),o&&(Ut=o),c=l?a.apply(u,l):a.call(u),Ut=s,c},Ri=function(t){return nr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!be),t.progress()<1&&Je(t,"onInterrupt"),t},Gr,d0=[],g0=function(t){if(t)if(t=!t.name&&t.default||t,Vc()||t.headless){var n=t.name,r=Kt(t),i=n&&!r&&t.init?function(){this._props=[]}:t,a={init:Xi,render:lf,add:rf,kill:dS,modifier:pS,rawVars:0},s={targetTest:0,get:0,getSetter:of,aliases:{},register:0};if(ci(),t!==i){if(Ze[n])return;an(i,an(Wa(t,a),s)),oi(i.prototype,oi(a,Wa(t,s))),Ze[i.prop=n]=i,t.targetTest&&(Ea.push(i),Jc[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}Zm(n,i),t.register&&t.register(He,i,Be)}else d0.push(t)},Ft=255,Ei={aqua:[0,Ft,Ft],lime:[0,Ft,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ft],navy:[0,0,128],white:[Ft,Ft,Ft],olive:[128,128,0],yellow:[Ft,Ft,0],orange:[Ft,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ft,0,0],pink:[Ft,192,203],cyan:[0,Ft,Ft],transparent:[Ft,Ft,Ft,0]},Is=function(t,n,r){return t+=t<0?1:t>1?-1:0,(t*6<1?n+(r-n)*t*6:t<.5?r:t*3<2?n+(r-n)*(2/3-t)*6:n)*Ft+.5|0},m0=function(t,n,r){var i=t?Hn(t)?[t>>16,t>>8&Ft,t&Ft]:0:Ei.black,a,s,o,l,u,c,f,h,p,g;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ei[t])i=Ei[t];else if(t.charAt(0)==="#"){if(t.length<6&&(a=t.charAt(1),s=t.charAt(2),o=t.charAt(3),t="#"+a+a+s+s+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&Ft,i&Ft,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Ft,t&Ft]}else if(t.substr(0,3)==="hsl"){if(i=g=t.match(xh),!n)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,s=c<=.5?c*(u+1):c+u-c*u,a=c*2-s,i.length>3&&(i[3]*=1),i[0]=Is(l+1/3,a,s),i[1]=Is(l,a,s),i[2]=Is(l-1/3,a,s);else if(~t.indexOf("="))return i=t.match(Wm),r&&i.length<4&&(i[3]=1),i}else i=t.match(xh)||Ei.transparent;i=i.map(Number)}return n&&!g&&(a=i[0]/Ft,s=i[1]/Ft,o=i[2]/Ft,f=Math.max(a,s,o),h=Math.min(a,s,o),c=(f+h)/2,f===h?l=u=0:(p=f-h,u=c>.5?p/(2-f-h):p/(f+h),l=f===a?(s-o)/p+(s<o?6:0):f===s?(o-a)/p+2:(a-s)/p+4,l*=60),i[0]=~~(l+.5),i[1]=~~(u*100+.5),i[2]=~~(c*100+.5)),r&&i.length<4&&(i[3]=1),i},y0=function(t){var n=[],r=[],i=-1;return t.split(tr).forEach(function(a){var s=a.match(jr)||[];n.push.apply(n,s),r.push(i+=s.length+1)}),n.c=r,n},Mh=function(t,n,r){var i="",a=(t+i).match(tr),s=n?"hsla(":"rgba(",o=0,l,u,c,f;if(!a)return t;if(a=a.map(function(h){return(h=m0(h,n,1))&&s+(n?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),r&&(c=y0(t),l=r.c,l.join(i)!==c.c.join(i)))for(u=t.replace(tr,"1").split(jr),f=u.length-1;o<f;o++)i+=u[o]+(~l.indexOf(o)?a.shift()||s+"0,0,0,0)":(c.length?c:a.length?a:r).shift());if(!u)for(u=t.split(tr),f=u.length-1;o<f;o++)i+=u[o]+a[o];return i+u[f]},tr=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Ei)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),Jw=/hsl[a]?\(/,_0=function(t){var n=t.join(" "),r;if(tr.lastIndex=0,tr.test(n))return r=Jw.test(n),t[1]=Mh(t[1],r),t[0]=Mh(t[0],r,y0(t[1])),!0},Vi,Qe=(function(){var e=Date.now,t=500,n=33,r=e(),i=r,a=1e3/240,s=a,o=[],l,u,c,f,h,p,g=function d(m){var x=e()-i,y=m===!0,v,_,S,w;if((x>t||x<0)&&(r+=x-n),i+=x,S=i-r,v=S-s,(v>0||y)&&(w=++f.frame,h=S-f.time*1e3,f.time=S=S/1e3,s+=v+(v>=a?4:a-v),_=1),y||(l=u(d)),_)for(p=0;p<o.length;p++)o[p](S,h,w,m)};return f={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(m){return h/(1e3/(m||60))},wake:function(){Km&&(!cc&&Vc()&&(wn=cc=window,Zc=wn.document||{},rn.gsap=He,(wn.gsapVersions||(wn.gsapVersions=[])).push(He.version),Vm(Ga||wn.GreenSockGlobals||!wn.gsap&&wn||{}),d0.forEach(g0)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),u=c||function(m){return setTimeout(m,s-f.time*1e3+1|0)},Vi=1,g(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Vi=0,u=Xi},lagSmoothing:function(m,x){t=m||1/0,n=Math.min(x||33,t)},fps:function(m){a=1e3/(m||240),s=f.time*1e3+a},add:function(m,x,y){var v=x?function(_,S,w,b){m(_,S,w,b),f.remove(v)}:m;return f.remove(m),o[y?"unshift":"push"](v),ci(),v},remove:function(m,x){~(x=o.indexOf(m))&&o.splice(x,1)&&p>=x&&p--},_listeners:o},f})(),ci=function(){return!Vi&&Qe.wake()},Tt={},tS=/^[\d.\-M][\d.\-,\s]/,eS=/["']/g,nS=function(t){for(var n={},r=t.substr(1,t.length-3).split(":"),i=r[0],a=1,s=r.length,o,l,u;a<s;a++)l=r[a],o=a!==s-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),n[i]=isNaN(u)?u.replace(eS,"").trim():+u,i=l.substr(o+1).trim();return n},rS=function(t){var n=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",n);return t.substring(n,~i&&i<r?t.indexOf(")",r+1):r)},iS=function(t){var n=(t+"").split("("),r=Tt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[nS(n[1])]:rS(t).split(",").map(e0)):Tt._CE&&tS.test(t)?Tt._CE("",t):r},x0=function(t){return function(n){return 1-t(1-n)}},v0=function e(t,n){for(var r=t._first,i;r;)r instanceof Oe?e(r,n):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==n&&(r.timeline?e(r.timeline,n):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=n)),r=r._next},wr=function(t,n){return t&&(Kt(t)?t:Tt[t]||iS(t))||n},Er=function(t,n,r,i){r===void 0&&(r=function(l){return 1-n(1-l)}),i===void 0&&(i=function(l){return l<.5?n(l*2)/2:1-n((1-l)*2)/2});var a={easeIn:n,easeOut:r,easeInOut:i},s;return ze(t,function(o){Tt[o]=rn[o]=a,Tt[s=o.toLowerCase()]=r;for(var l in a)Tt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Tt[o+"."+l]=a[l]}),a},b0=function(t){return function(n){return n<.5?(1-t(1-n*2))/2:.5+t((n-.5)*2)/2}},zs=function e(t,n,r){var i=n>=1?n:1,a=(r||(t?.3:.45))/(n<1?n:1),s=a/uc*(Math.asin(1/i)||0),o=function(c){return c===1?1:i*Math.pow(2,-10*c)*Rw((c-s)*a)+1},l=t==="out"?o:t==="in"?function(u){return 1-o(1-u)}:b0(o);return a=uc/a,l.config=function(u,c){return e(t,u,c)},l},Bs=function e(t,n){n===void 0&&(n=1.70158);var r=function(s){return s?--s*s*((n+1)*s+n)+1:0},i=t==="out"?r:t==="in"?function(a){return 1-r(1-a)}:b0(r);return i.config=function(a){return e(t,a)},i};ze("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var n=t<5?t+1:t;Er(e+",Power"+(n-1),t?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});Tt.Linear.easeNone=Tt.none=Tt.Linear.easeIn;Er("Elastic",zs("in"),zs("out"),zs());(function(e,t){var n=1/t,r=2*n,i=2.5*n,a=function(o){return o<n?e*o*o:o<r?e*Math.pow(o-1.5/t,2)+.75:o<i?e*(o-=2.25/t)*o+.9375:e*Math.pow(o-2.625/t,2)+.984375};Er("Bounce",function(s){return 1-a(1-s)},a)})(7.5625,2.75);Er("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Er("Circ",function(e){return-(Gm(1-e*e)-1)});Er("Sine",function(e){return e===1?1:-Cw(e*Aw)+1});Er("Back",Bs("in"),Bs("out"),Bs());Tt.SteppedEase=Tt.steps=rn.SteppedEase={config:function(t,n){t===void 0&&(t=1);var r=1/t,i=t+(n?0:1),a=n?1:0,s=1-$t;return function(o){return((i*ra(0,s,o)|0)+a)*r}}};si.ease=Tt["quad.out"];ze("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return tf+=e+","+e+"Params,"});var w0=function(t,n){this.id=kw++,t._gsap=this,this.target=t,this.harness=n,this.get=n?n.get:Jm,this.set=n?n.getSetter:of},Zi=(function(){function e(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,ui(this,+n.duration,1,1),this.data=n.data,Ut&&(this._ctx=Ut,Ut.data.push(this)),Vi||Qe.wake()}var t=e.prototype;return t.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},t.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},t.totalDuration=function(r){return arguments.length?(this._dirty=0,ui(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(r,i){if(ci(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(ls(this,r),!a._dp||a.parent||i0(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Sn(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===$t||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),t0(this,r,i)),this},t.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+wh(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},t.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+wh(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(r,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*a,i):this._repeat?li(this._tTime,a)+1:1},t.timeScale=function(r,i){if(!arguments.length)return this._rts===-$t?0:this._rts;if(this._rts===r)return this;var a=this.parent&&this._ts?Xa(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-$t?0:this._rts,this.totalTime(ra(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),os(this),Iw(this)},t.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ci(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==$t&&(this._tTime-=$t)))),this):this._ps},t.startTime=function(r){if(arguments.length){this._start=Ht(r);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Sn(i,this,this._start-this._delay),this}return this._start},t.endTime=function(r){return this._start+(Ie(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Xa(i.rawTime(r),this):this._tTime:this._tTime},t.revert=function(r){r===void 0&&(r=$w);var i=be;return be=r,nf(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),be=i,this},t.globalTime=function(r){for(var i=this,a=arguments.length?r:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):a},t.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,Sh(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,Sh(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},t.seek=function(r,i){return this.totalTime(un(this,r),Ie(i))},t.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Ie(i)),this._dur||(this._zTime=-$t),this},t.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},t.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-$t:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-$t,this},t.isActive=function(){var r=this.parent||this._dp,i=this._start,a;return!!(!r||this._ts&&this._initted&&r.isActive()&&(a=r.rawTime(!0))>=i&&a<this.endTime(!0)-$t)},t.eventCallback=function(r,i,a){var s=this.vars;return arguments.length>1?(i?(s[r]=i,a&&(s[r+"Params"]=a),r==="onUpdate"&&(this._onUpdate=i)):delete s[r],this):s[r]},t.then=function(r){var i=this,a=i._prom;return new Promise(function(s){var o=Kt(r)?r:n0,l=function(){var c=i.then;i.then=null,a&&a(),Kt(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},t.kill=function(){Ri(this)},e})();an(Zi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-$t,_prom:0,_ps:!1,_rts:1});var Oe=(function(e){jm(t,e);function t(r,i){var a;return r===void 0&&(r={}),a=e.call(this,r)||this,a.labels={},a.smoothChildTiming=!!r.smoothChildTiming,a.autoRemoveChildren=!!r.autoRemoveChildren,a._sort=Ie(r.sortChildren),jt&&Sn(r.parent||jt,Fn(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),r.scrollTrigger&&a0(Fn(a),r.scrollTrigger),a}var n=t.prototype;return n.to=function(i,a,s){return Fi(0,arguments,this),this},n.from=function(i,a,s){return Fi(1,arguments,this),this},n.fromTo=function(i,a,s,o){return Fi(2,arguments,this),this},n.set=function(i,a,s){return a.duration=0,a.parent=this,Pi(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new se(i,a,un(this,s),1),this},n.call=function(i,a,s){return Sn(this,se.delayedCall(0,i,a),s)},n.staggerTo=function(i,a,s,o,l,u,c){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new se(i,s,un(this,l)),this},n.staggerFrom=function(i,a,s,o,l,u,c){return s.runBackwards=1,Pi(s).immediateRender=Ie(s.immediateRender),this.staggerTo(i,a,s,o,l,u,c)},n.staggerFromTo=function(i,a,s,o,l,u,c,f){return o.startAt=s,Pi(o).immediateRender=Ie(o.immediateRender),this.staggerTo(i,a,o,l,u,c,f)},n.render=function(i,a,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:Ht(i),f=this._zTime<0!=i<0&&(this._initted||!u),h,p,g,d,m,x,y,v,_,S,w,b;if(this!==jt&&c>l&&i>=0&&(c=l),c!==this._tTime||s||f){if(o!==this._time&&u&&(c+=this._time-o,i+=this._time-o),h=c,_=this._start,v=this._ts,x=!v,f&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(w=this._yoyo,m=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,a,s);if(h=Ht(c%m),c===l?(d=this._repeat,h=u):(S=Ht(c/m),d=~~S,d&&d===S&&(h=u,d--),h>u&&(h=u)),S=li(this._tTime,m),!o&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),w&&d&1&&(h=u-h,b=1),d!==S&&!this._lock){var M=w&&S&1,A=M===(w&&d&1);if(d<S&&(M=!M),o=M?0:c%u?u:c,this._lock=1,this.render(o||(b?0:Ht(d*m)),a,!u)._lock=0,this._tTime=c,!a&&this.parent&&Je(this,"onRepeat"),this.vars.repeatRefresh&&!b&&(this.invalidate()._lock=1,S=d),o&&o!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,A&&(this._lock=2,o=M?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!b&&this.invalidate()),this._lock=0,!this._ts&&!x)return this;v0(this,b)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=Hw(this,Ht(o),Ht(h)),y&&(c-=h-(h=y._start))),this._tTime=c,this._time=h,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&c&&u&&!a&&!S&&(Je(this,"onStart"),this._tTime!==c))return this;if(h>=o&&i>=0)for(p=this._first;p;){if(g=p._next,(p._act||h>=p._start)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(h-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(h-p._start)*p._ts,a,s),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=-$t);break}}p=g}else{p=this._last;for(var k=i<0?i:h;p;){if(g=p._prev,(p._act||k<=p._end)&&p._ts&&y!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(k-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(k-p._start)*p._ts,a,s||be&&nf(p)),h!==this._time||!this._ts&&!x){y=0,g&&(c+=this._zTime=k?-$t:$t);break}}p=g}}if(y&&!a&&(this.pause(),y.render(h>=o?0:-$t)._zTime=h>=o?1:-1,this._ts))return this._start=_,os(this),this.render(i,a,s);this._onUpdate&&!a&&Je(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(_===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&nr(this,1),!a&&!(i<0&&!o)&&(c||o||!l)&&(Je(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(i,a){var s=this;if(Hn(a)||(a=un(this,a,i)),!(i instanceof Zi)){if(Ce(i))return i.forEach(function(o){return s.add(o,a)}),this;if(pe(i))return this.addLabel(i,a);if(Kt(i))i=se.delayedCall(0,i);else return this}return this!==i?Sn(this,i,a):this},n.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-fn);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof se?a&&l.push(u):(s&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,s)))),u=u._next;return l},n.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},n.remove=function(i){return pe(i)?this.removeLabel(i):Kt(i)?this.killTweensOf(i):(i.parent===this&&ss(this,i),i===this._recent&&(this._recent=this._last),br(this))},n.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(Qe.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),e.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},n.addLabel=function(i,a){return this.labels[i]=un(this,a),this},n.removeLabel=function(i){return delete this.labels[i],this},n.addPause=function(i,a,s){var o=se.delayedCall(0,a||Xi,s);return o.data="isPause",this._hasPause=1,Sn(this,o,un(this,i))},n.removePause=function(i){var a=this._first;for(i=un(this,i);a;)a._start===i&&a.data==="isPause"&&nr(a),a=a._next},n.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),l=o.length;l--;)Vn!==o[l]&&o[l].kill(i,a);return this},n.getTweensOf=function(i,a){for(var s=[],o=hn(i),l=this._first,u=Hn(a),c;l;)l instanceof se?Lw(l._targets,o)&&(u?(!Vn||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&s.push(l):(c=l.getTweensOf(o,a)).length&&s.push.apply(s,c),l=l._next;return s},n.tweenTo=function(i,a){a=a||{};var s=this,o=un(s,i),l=a,u=l.startAt,c=l.onStart,f=l.onStartParams,h=l.immediateRender,p,g=se.to(s,an({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||$t,onStart:function(){if(s.pause(),!p){var m=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());g._dur!==m&&ui(g,m,0,1).render(g._time,!0,!0),p=1}c&&c.apply(g,f||[])}},a));return h?g.render(0):g},n.tweenFromTo=function(i,a,s){return this.tweenTo(a,an({startAt:{time:un(this,i)}},s))},n.recent=function(){return this._recent},n.nextLabel=function(i){return i===void 0&&(i=this._time),Th(this,un(this,i))},n.previousLabel=function(i){return i===void 0&&(i=this._time),Th(this,un(this,i),1)},n.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+$t)},n.shiftChildren=function(i,a,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(i=Ht(i);o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in l)l[u]>=s&&(l[u]+=i);return br(this)},n.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return e.prototype.invalidate.call(this,i)},n.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),br(this)},n.totalDuration=function(i){var a=0,s=this,o=s._last,l=fn,u,c,f;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(f=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,Sn(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(a-=c,(!f&&!s._dp||f&&f.smoothChildTiming)&&(s._start+=Ht(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>a&&o._ts&&(a=o._end),o=u;ui(s,s===jt&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(i){if(jt._ts&&(t0(jt,Xa(i,jt)),Qm=Qe.frame),Qe.frame>=vh){vh+=en.autoSleep||120;var a=jt._first;if((!a||!a._ts)&&en.autoSleep&&Qe._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||Qe.sleep()}}},t})(Zi);an(Oe.prototype,{_lock:0,_hasPause:0,_forcing:0});var aS=function(t,n,r,i,a,s,o){var l=new Be(this._pt,t,n,0,1,C0,null,a),u=0,c=0,f,h,p,g,d,m,x,y;for(l.b=r,l.e=i,r+="",i+="",(x=~i.indexOf("random("))&&(i=Ki(i)),s&&(y=[r,i],s(y,t,n),r=y[0],i=y[1]),h=r.match(Ns)||[];f=Ns.exec(i);)g=f[0],d=i.substring(u,f.index),p?p=(p+1)%5:d.substr(-5)==="rgba("&&(p=1),g!==h[c++]&&(m=parseFloat(h[c-1])||0,l._pt={_next:l._pt,p:d||c===1?d:",",s:m,c:g.charAt(1)==="="?Xr(m,g)-m:parseFloat(g)-m,m:p&&p<4?Math.round:0},u=Ns.lastIndex);return l.c=u<i.length?i.substring(u,i.length):"",l.fp=o,(Xm.test(i)||x)&&(l.e=0),this._pt=l,l},rf=function(t,n,r,i,a,s,o,l,u,c){Kt(i)&&(i=i(a||0,t,s));var f=t[n],h=r!=="get"?r:Kt(f)?u?t[n.indexOf("set")||!Kt(t["get"+n.substr(3)])?n:"get"+n.substr(3)](u):t[n]():f,p=Kt(f)?u?cS:A0:sf,g;if(pe(i)&&(~i.indexOf("random(")&&(i=Ki(i)),i.charAt(1)==="="&&(g=Xr(h,i)+(ke(h)||0),(g||g===0)&&(i=g))),!c||h!==i||yc)return!isNaN(h*i)&&i!==""?(g=new Be(this._pt,t,n,+h||0,i-(h||0),typeof f=="boolean"?hS:k0,0,p),u&&(g.fp=u),o&&g.modifier(o,this,t),this._pt=g):(!f&&!(n in t)&&Qc(n,i),aS.call(this,t,n,h,i,p,l||en.stringFilter,u))},sS=function(t,n,r,i,a){if(Kt(t)&&(t=$i(t,a,n,r,i)),!An(t)||t.style&&t.nodeType||Ce(t)||Ym(t))return pe(t)?$i(t,a,n,r,i):t;var s={},o;for(o in t)s[o]=$i(t[o],a,n,r,i);return s},S0=function(t,n,r,i,a,s){var o,l,u,c;if(Ze[t]&&(o=new Ze[t]).init(a,o.rawVars?n[t]:sS(n[t],i,a,s,r),r,i,s)!==!1&&(r._pt=l=new Be(r._pt,a,t,0,1,o.render,o,0,o.priority),r!==Gr))for(u=r._ptLookup[r._targets.indexOf(a)],c=o._props.length;c--;)u[o._props[c]]=l;return o},Vn,yc,af=function e(t,n,r){var i=t.vars,a=i.ease,s=i.startAt,o=i.immediateRender,l=i.lazy,u=i.onUpdate,c=i.runBackwards,f=i.yoyoEase,h=i.keyframes,p=i.autoRevert,g=t._dur,d=t._startAt,m=t._targets,x=t.parent,y=x&&x.data==="nested"?x.vars.targets:m,v=t._overwrite==="auto"&&!Xc,_=t.timeline,S,w,b,M,A,k,C,O,P,F,B,L,$;if(_&&(!h||!a)&&(a="none"),t._ease=wr(a,si.ease),t._yEase=f?x0(wr(f===!0?a:f,si.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!_&&!!i.runBackwards,!_||h&&!i.stagger){if(O=m[0]?vr(m[0]).harness:0,L=O&&i[O.prop],S=Wa(i,Jc),d&&(d._zTime<0&&d.progress(1),n<0&&c&&o&&!p?d.render(-1,!0):d.revert(c&&g?Ra:Fw),d._lazy=0),s){if(nr(t._startAt=se.set(m,an({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!d&&Ie(l),startAt:null,delay:0,onUpdate:u&&function(){return Je(t,"onUpdate")},stagger:0},s))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(be||!o&&!p)&&t._startAt.revert(Ra),o&&g&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(c&&g&&!d){if(n&&(o=!1),b=an({overwrite:!1,data:"isFromStart",lazy:o&&!d&&Ie(l),immediateRender:o,stagger:0,parent:x},S),L&&(b[O.prop]=L),nr(t._startAt=se.set(m,b)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(be?t._startAt.revert(Ra):t._startAt.render(-1,!0)),t._zTime=n,!o)e(t._startAt,$t,$t);else if(!n)return}for(t._pt=t._ptCache=0,l=g&&Ie(l)||l&&!g,w=0;w<m.length;w++){if(A=m[w],C=A._gsap||ef(m)[w]._gsap,t._ptLookup[w]=F={},fc[C.id]&&Jn.length&&Ya(),B=y===m?w:y.indexOf(A),O&&(P=new O).init(A,L||S,t,B,y)!==!1&&(t._pt=M=new Be(t._pt,A,P.name,0,1,P.render,P,0,P.priority),P._props.forEach(function(Y){F[Y]=M}),P.priority&&(k=1)),!O||L)for(b in S)Ze[b]&&(P=S0(b,S,t,B,A,y))?P.priority&&(k=1):F[b]=M=rf.call(t,A,b,"get",S[b],B,y,0,i.stringFilter);t._op&&t._op[w]&&t.kill(A,t._op[w]),v&&t._pt&&(Vn=t,jt.killTweensOf(A,F,t.globalTime(n)),$=!t.parent,Vn=0),t._pt&&l&&(fc[C.id]=1)}k&&R0(t),t._onInit&&t._onInit(t)}t._onUpdate=u,t._initted=(!t._op||t._pt)&&!$,h&&n<=0&&_.render(fn,!0,!0)},oS=function(t,n,r,i,a,s,o,l){var u=(t._pt&&t._ptCache||(t._ptCache={}))[n],c,f,h,p;if(!u)for(u=t._ptCache[n]=[],h=t._ptLookup,p=t._targets.length;p--;){if(c=h[p][n],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==n&&c.fp!==n;)c=c._next;if(!c)return yc=1,t.vars[n]="+=0",af(t,o),yc=0,l?Wi(n+" not eligible for reset"):1;u.push(c)}for(p=u.length;p--;)f=u[p],c=f._pt||f,c.s=(i||i===0)&&!a?i:c.s+(i||0)+s*c.c,c.c=r-c.s,f.e&&(f.e=te(r)+ke(f.e)),f.b&&(f.b=c.s+ke(f.b))},lS=function(t,n){var r=t[0]?vr(t[0]).harness:0,i=r&&r.aliases,a,s,o,l;if(!i)return n;a=oi({},n);for(s in i)if(s in a)for(l=i[s].split(","),o=l.length;o--;)a[l[o]]=a[s];return a},uS=function(t,n,r,i){var a=n.ease||i||"power1.inOut",s,o;if(Ce(n))o=r[t]||(r[t]=[]),n.forEach(function(l,u){return o.push({t:u/(n.length-1)*100,v:l,e:a})});else for(s in n)o=r[s]||(r[s]=[]),s==="ease"||o.push({t:parseFloat(t),v:n[s],e:a})},$i=function(t,n,r,i,a){return Kt(t)?t.call(n,r,i,a):pe(t)&&~t.indexOf("random(")?Ki(t):t},T0=tf+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",M0={};ze(T0+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return M0[e]=1});var se=(function(e){jm(t,e);function t(r,i,a,s){var o;typeof i=="number"&&(a.duration=i,i=a,a=null),o=e.call(this,s?i:Pi(i))||this;var l=o.vars,u=l.duration,c=l.delay,f=l.immediateRender,h=l.stagger,p=l.overwrite,g=l.keyframes,d=l.defaults,m=l.scrollTrigger,x=l.yoyoEase,y=i.parent||jt,v=(Ce(r)||Ym(r)?Hn(r[0]):"length"in i)?[r]:hn(r),_,S,w,b,M,A,k,C;if(o._targets=v.length?ef(v):Wi("GSAP target "+r+" not found. https://gsap.com",!en.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||h||xa(u)||xa(c)){if(i=o.vars,_=o.timeline=new Oe({data:"nested",defaults:d||{},targets:y&&y.data==="nested"?y.vars.targets:v}),_.kill(),_.parent=_._dp=Fn(o),_._start=0,h||xa(u)||xa(c)){if(b=v.length,k=h&&u0(h),An(h))for(M in h)~T0.indexOf(M)&&(C||(C={}),C[M]=h[M]);for(S=0;S<b;S++)w=Wa(i,M0),w.stagger=0,x&&(w.yoyoEase=x),C&&oi(w,C),A=v[S],w.duration=+$i(u,Fn(o),S,A,v),w.delay=(+$i(c,Fn(o),S,A,v)||0)-o._delay,!h&&b===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),_.to(A,w,k?k(S,A,v):0),_._ease=Tt.none;_.duration()?u=c=0:o.timeline=0}else if(g){Pi(an(_.vars.defaults,{ease:"none"})),_._ease=wr(g.ease||i.ease||"none");var O=0,P,F,B;if(Ce(g))g.forEach(function(L){return _.to(v,L,">")}),_.duration();else{w={};for(M in g)M==="ease"||M==="easeEach"||uS(M,g[M],w,g.easeEach);for(M in w)for(P=w[M].sort(function(L,$){return L.t-$.t}),O=0,S=0;S<P.length;S++)F=P[S],B={ease:F.e,duration:(F.t-(S?P[S-1].t:0))/100*u},B[M]=F.v,_.to(v,B,O),O+=B.duration;_.duration()<u&&_.to({},{duration:u-_.duration()})}}u||o.duration(u=_.duration())}else o.timeline=0;return p===!0&&!Xc&&(Vn=Fn(o),jt.killTweensOf(v),Vn=0),Sn(y,Fn(o),a),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(f||!u&&!g&&o._start===Ht(y._time)&&Ie(f)&&zw(Fn(o))&&y.data!=="nested")&&(o._tTime=-$t,o.render(Math.max(0,-c)||0)),m&&a0(Fn(o),m),o}var n=t.prototype;return n.render=function(i,a,s){var o=this._time,l=this._tDur,u=this._dur,c=i<0,f=i>l-$t&&!c?l:i<$t?0:i,h,p,g,d,m,x,y,v,_;if(!u)Uw(this,i,a,s);else if(f!==this._tTime||!i||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(h=f,v=this.timeline,this._repeat){if(d=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+i,a,s);if(h=Ht(f%d),f===l?(g=this._repeat,h=u):(m=Ht(f/d),g=~~m,g&&g===m?(h=u,g--):h>u&&(h=u)),x=this._yoyo&&g&1,x&&(_=this._yEase,h=u-h),m=li(this._tTime,d),h===o&&!s&&this._initted&&g===m)return this._tTime=f,this;g!==m&&(v&&this._yEase&&v0(v,x),this.vars.repeatRefresh&&!x&&!this._lock&&h!==d&&this._initted&&(this._lock=s=1,this.render(Ht(d*g),!0).invalidate()._lock=0))}if(!this._initted){if(s0(this,c?i:h,s,a,f))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==m))return this;if(u!==this._dur)return this.render(i,a,s)}if(this._tTime=f,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(_||this._ease)(h/u),this._from&&(this.ratio=y=1-y),!o&&f&&!a&&!m&&(Je(this,"onStart"),this._tTime!==f))return this;for(p=this._pt;p;)p.r(y,p.d),p=p._next;v&&v.render(i<0?i:v._dur*v._ease(h/this._dur),a,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&hc(this,i,a,s),Je(this,"onUpdate")),this._repeat&&g!==m&&this.vars.onRepeat&&!a&&this.parent&&Je(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&hc(this,i,!0,!0),(i||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&nr(this,1),!a&&!(c&&!o)&&(f||o||x)&&(Je(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),e.prototype.invalidate.call(this,i)},n.resetTo=function(i,a,s,o,l){Vi||Qe.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||af(this,u),c=this._ease(u/this._dur),oS(this,i,a,s,o,c,u,l)?this.resetTo(i,a,s,o,1):(ls(this,0),this.parent||r0(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?Ri(this):this.scrollTrigger&&this.scrollTrigger.kill(!!be),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Vn&&Vn.vars.overwrite!==!0)._first||Ri(this),this.parent&&s!==this.timeline.totalDuration()&&ui(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=i?hn(i):o,u=this._ptLookup,c=this._pt,f,h,p,g,d,m,x;if((!a||a==="all")&&qw(o,l))return a==="all"&&(this._pt=0),Ri(this);for(f=this._op=this._op||[],a!=="all"&&(pe(a)&&(d={},ze(a,function(y){return d[y]=1}),a=d),a=lS(o,a)),x=o.length;x--;)if(~l.indexOf(o[x])){h=u[x],a==="all"?(f[x]=a,g=h,p={}):(p=f[x]=f[x]||{},g=a);for(d in g)m=h&&h[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&ss(this,m,"_pt"),delete h[d]),p!=="all"&&(p[d]=1)}return this._initted&&!this._pt&&c&&Ri(this),this},t.to=function(i,a){return new t(i,a,arguments[2])},t.from=function(i,a){return Fi(1,arguments)},t.delayedCall=function(i,a,s,o){return new t(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},t.fromTo=function(i,a,s){return Fi(2,arguments)},t.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new t(i,a)},t.killTweensOf=function(i,a,s){return jt.killTweensOf(i,a,s)},t})(Zi);an(se.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ze("staggerTo,staggerFrom,staggerFromTo",function(e){se[e]=function(){var t=new Oe,n=dc.call(arguments,0);return n.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,n)}});var sf=function(t,n,r){return t[n]=r},A0=function(t,n,r){return t[n](r)},cS=function(t,n,r,i){return t[n](i.fp,r)},fS=function(t,n,r){return t.setAttribute(n,r)},of=function(t,n){return Kt(t[n])?A0:Kc(t[n])&&t.setAttribute?fS:sf},k0=function(t,n){return n.set(n.t,n.p,Math.round((n.s+n.c*t)*1e6)/1e6,n)},hS=function(t,n){return n.set(n.t,n.p,!!(n.s+n.c*t),n)},C0=function(t,n){var r=n._pt,i="";if(!t&&n.b)i=n.b;else if(t===1&&n.e)i=n.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+i,r=r._next;i+=n.c}n.set(n.t,n.p,i,n)},lf=function(t,n){for(var r=n._pt;r;)r.r(t,r.d),r=r._next},pS=function(t,n,r,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(t,n,r),a=s},dS=function(t){for(var n=this._pt,r,i;n;)i=n._next,n.p===t&&!n.op||n.op===t?ss(this,n,"_pt"):n.dep||(r=1),n=i;return!r},gS=function(t,n,r,i){i.mSet(t,n,i.m.call(i.tween,r,i.mt),i)},R0=function(t){for(var n=t._pt,r,i,a,s;n;){for(r=n._next,i=a;i&&i.pr>n.pr;)i=i._next;(n._prev=i?i._prev:s)?n._prev._next=n:a=n,(n._next=i)?i._prev=n:s=n,n=r}t._pt=a},Be=(function(){function e(n,r,i,a,s,o,l,u,c){this.t=r,this.s=a,this.c=s,this.p=i,this.r=o||k0,this.d=l||this,this.set=u||sf,this.pr=c||0,this._next=n,n&&(n._prev=this)}var t=e.prototype;return t.modifier=function(r,i,a){this.mSet=this.mSet||this.set,this.set=gS,this.m=r,this.mt=a,this.tween=i},e})();ze(tf+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(e){return Jc[e]=1});rn.TweenMax=rn.TweenLite=se;rn.TimelineLite=rn.TimelineMax=Oe;jt=new Oe({sortChildren:!1,defaults:si,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});en.stringFilter=_0;var Sr=[],Da={},mS=[],Ah=0,yS=0,Us=function(t){return(Da[t]||mS).map(function(n){return n()})},_c=function(){var t=Date.now(),n=[];t-Ah>2&&(Us("matchMediaInit"),Sr.forEach(function(r){var i=r.queries,a=r.conditions,s,o,l,u;for(o in i)s=wn.matchMedia(i[o]).matches,s&&(l=1),s!==a[o]&&(a[o]=s,u=1);u&&(r.revert(),l&&n.push(r))}),Us("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),Ah=t,Us("matchMedia"))},E0=(function(){function e(n,r){this.selector=r&&gc(r),this.data=[],this._r=[],this.isReverted=!1,this.id=yS++,n&&this.add(n)}var t=e.prototype;return t.add=function(r,i,a){Kt(r)&&(a=i,i=r,r=Kt);var s=this,o=function(){var u=Ut,c=s.selector,f;return u&&u!==s&&u.data.push(s),a&&(s.selector=gc(a)),Ut=s,f=i.apply(s,arguments),Kt(f)&&s._r.push(f),Ut=u,s.selector=c,s.isReverted=!1,f};return s.last=o,r===Kt?o(s,function(l){return s.add(null,l)}):r?s[r]=o:o},t.ignore=function(r){var i=Ut;Ut=null,r(this),Ut=i},t.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof e?r.push.apply(r,i.getTweens()):i instanceof se&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(r,i){var a=this;if(r?(function(){for(var o=a.getTweens(),l=a.data.length,u;l--;)u=a.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),l=a.data.length;l--;)u=a.data[l],u instanceof Oe?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof se)&&u.revert&&u.revert(r);a._r.forEach(function(c){return c(r,a)}),a.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=Sr.length;s--;)Sr[s].id===this.id&&Sr.splice(s,1)},t.revert=function(r){this.kill(r||{})},e})(),_S=(function(){function e(n){this.contexts=[],this.scope=n,Ut&&Ut.data.push(this)}var t=e.prototype;return t.add=function(r,i,a){An(r)||(r={matches:r});var s=new E0(0,a||this.scope),o=s.conditions={},l,u,c;Ut&&!s.selector&&(s.selector=Ut.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=r;for(u in r)u==="all"?c=1:(l=wn.matchMedia(r[u]),l&&(Sr.indexOf(s)<0&&Sr.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(_c):l.addEventListener("change",_c)));return c&&i(s,function(f){return s.add(null,f)}),this},t.revert=function(r){this.kill(r||{})},t.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},e})(),Ka={registerPlugin:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(i){return g0(i)})},timeline:function(t){return new Oe(t)},getTweensOf:function(t,n){return jt.getTweensOf(t,n)},getProperty:function(t,n,r,i){pe(t)&&(t=hn(t)[0]);var a=vr(t||{}).get,s=r?n0:e0;return r==="native"&&(r=""),t&&(n?s((Ze[n]&&Ze[n].get||a)(t,n,r,i)):function(o,l,u){return s((Ze[o]&&Ze[o].get||a)(t,o,l,u))})},quickSetter:function(t,n,r){if(t=hn(t),t.length>1){var i=t.map(function(c){return He.quickSetter(c,n,r)}),a=i.length;return function(c){for(var f=a;f--;)i[f](c)}}t=t[0]||{};var s=Ze[n],o=vr(t),l=o.harness&&(o.harness.aliases||{})[n]||n,u=s?function(c){var f=new s;Gr._pt=0,f.init(t,r?c+r:c,Gr,0,[t]),f.render(1,f),Gr._pt&&lf(1,Gr)}:o.set(t,l);return s?u:function(c){return u(t,l,r?c+r:c,o,1)}},quickTo:function(t,n,r){var i,a=He.to(t,an((i={},i[n]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(l,u,c){return a.resetTo(n,l,u,c)};return s.tween=a,s},isTweening:function(t){return jt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=wr(t.ease,si.ease)),bh(si,t||{})},config:function(t){return bh(en,t||{})},registerEffect:function(t){var n=t.name,r=t.effect,i=t.plugins,a=t.defaults,s=t.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Ze[o]&&!rn[o]&&Wi(n+" effect requires "+o+" plugin.")}),qs[n]=function(o,l,u){return r(hn(o),an(l||{},a),u)},s&&(Oe.prototype[n]=function(o,l,u){return this.add(qs[n](o,An(l)?l:(u=l)&&{},this),u)})},registerEase:function(t,n){Tt[t]=wr(n)},parseEase:function(t,n){return arguments.length?wr(t,n):Tt},getById:function(t){return jt.getById(t)},exportRoot:function(t,n){t===void 0&&(t={});var r=new Oe(t),i,a;for(r.smoothChildTiming=Ie(t.smoothChildTiming),jt.remove(r),r._dp=0,r._time=r._tTime=jt._time,i=jt._first;i;)a=i._next,(n||!(!i._dur&&i instanceof se&&i.vars.onComplete===i._targets[0]))&&Sn(r,i,i._start-i._delay),i=a;return Sn(jt,r,0),r},context:function(t,n){return t?new E0(t,n):Ut},matchMedia:function(t){return new _S(t)},matchMediaRefresh:function(){return Sr.forEach(function(t){var n=t.conditions,r,i;for(i in n)n[i]&&(n[i]=!1,r=1);r&&t.revert()})||_c()},addEventListener:function(t,n){var r=Da[t]||(Da[t]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(t,n){var r=Da[t],i=r&&r.indexOf(n);i>=0&&r.splice(i,1)},utils:{wrap:Vw,wrapYoyo:Zw,distribute:u0,random:f0,snap:c0,normalize:Kw,getUnit:ke,clamp:Gw,splitColor:m0,toArray:hn,selector:gc,mapRange:p0,pipe:Ww,unitize:Xw,interpolate:Qw,shuffle:l0},install:Vm,effects:qs,ticker:Qe,updateRoot:Oe.updateRoot,plugins:Ze,globalTimeline:jt,core:{PropTween:Be,globals:Zm,Tween:se,Timeline:Oe,Animation:Zi,getCache:vr,_removeLinkedListItem:ss,reverting:function(){return be},context:function(t){return t&&Ut&&(Ut.data.push(t),t._ctx=Ut),Ut},suppressOverwrites:function(t){return Xc=t}}};ze("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return Ka[e]=se[e]});Qe.add(Oe.updateRoot);Gr=Ka.to({},{duration:0});var xS=function(t,n){for(var r=t._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},vS=function(t,n){var r=t._targets,i,a,s;for(i in n)for(a=r.length;a--;)s=t._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=xS(s,i)),s&&s.modifier&&s.modifier(n[i],t,r[a],i))},Hs=function(t,n){return{name:t,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var l,u;if(pe(a)&&(l={},ze(a,function(c){return l[c]=1}),a=l),n){l={};for(u in a)l[u]=n(a[u]);a=l}vS(o,a)}}}},He=Ka.registerPlugin({name:"attr",init:function(t,n,r,i,a){var s,o,l;this.tween=r;for(s in n)l=t.getAttribute(s)||"",o=this.add(t,"setAttribute",(l||0)+"",n[s],i,a,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(t,n){for(var r=n._pt;r;)be?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,n){for(var r=n.length;r--;)this.add(t,r,t[r]||0,n[r],0,0,0,0,0,1)}},Hs("roundProps",mc),Hs("modifiers"),Hs("snap",c0))||Ka;se.version=Oe.version=He.version="3.14.2";Km=1;Vc()&&ci();Tt.Power0;Tt.Power1;Tt.Power2;Tt.Power3;Tt.Power4;Tt.Linear;Tt.Quad;Tt.Cubic;Tt.Quart;Tt.Quint;Tt.Strong;Tt.Elastic;Tt.Back;Tt.SteppedEase;Tt.Bounce;Tt.Sine;Tt.Expo;Tt.Circ;/*!
|
|
9
9
|
* CSSPlugin 3.14.2
|
|
10
10
|
* https://gsap.com
|
|
11
11
|
*
|
|
12
12
|
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
13
13
|
* Subject to the terms at https://gsap.com/standard-license
|
|
14
14
|
* @author: Jack Doyle, jack@greensock.com
|
|
15
|
-
*/var Ah,Vn,Wr,lf,mr,kh,uf,xS=function(){return typeof window<"u"},jn={},dr=180/Math.PI,Kr=Math.PI/180,qr=Math.atan2,Ch=1e8,cf=/([A-Z])/g,vS=/(left|right|width|margin|padding|x)/i,bS=/[\s,\(]\S/,Tn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_c=function(t,n){return n.set(n.t,n.p,Math.round((n.s+n.c*t)*1e4)/1e4+n.u,n)},wS=function(t,n){return n.set(n.t,n.p,t===1?n.e:Math.round((n.s+n.c*t)*1e4)/1e4+n.u,n)},SS=function(t,n){return n.set(n.t,n.p,t?Math.round((n.s+n.c*t)*1e4)/1e4+n.u:n.b,n)},TS=function(t,n){return n.set(n.t,n.p,t===1?n.e:t?Math.round((n.s+n.c*t)*1e4)/1e4+n.u:n.b,n)},MS=function(t,n){var r=n.s+n.c*t;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},E0=function(t,n){return n.set(n.t,n.p,t?n.e:n.b,n)},D0=function(t,n){return n.set(n.t,n.p,t!==1?n.b:n.e,n)},AS=function(t,n,r){return t.style[n]=r},kS=function(t,n,r){return t.style.setProperty(n,r)},CS=function(t,n,r){return t._gsap[n]=r},RS=function(t,n,r){return t._gsap.scaleX=t._gsap.scaleY=r},ES=function(t,n,r,i,a){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(a,s)},DS=function(t,n,r,i,a){var s=t._gsap;s[n]=r,s.renderTransform(a,s)},Gt="transform",Ue=Gt+"Origin",OS=function e(t,n){var r=this,i=this.target,a=i.style,s=i._gsap;if(t in jn&&a){if(this.tfm=this.tfm||{},t!=="transform")t=Tn[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return r.tfm[o]=Nn(i,o)}):this.tfm[t]=s.x?s[t]:Nn(i,t),t===Ue&&(this.tfm.zOrigin=s.zOrigin);else return Tn.transform.split(",").forEach(function(o){return e.call(r,o,n)});if(this.props.indexOf(Gt)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ue,n,"")),t=Gt}(a||n)&&this.props.push(t,n,a[t])},O0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},PS=function(){var t=this.props,n=this.target,r=n.style,i=n._gsap,a,s;for(a=0;a<t.length;a+=3)t[a+1]?t[a+1]===2?n[t[a]](t[a+2]):n[t[a]]=t[a+2]:t[a+2]?r[t[a]]=t[a+2]:r.removeProperty(t[a].substr(0,2)==="--"?t[a]:t[a].replace(cf,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)i[s]=this.tfm[s];i.svg&&(i.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),a=uf(),(!a||!a.isStart)&&!r[Gt]&&(O0(r),i.zOrigin&&r[Ue]&&(r[Ue]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},P0=function(t,n){var r={target:t,props:[],revert:PS,save:OS};return t._gsap||He.core.getCache(t),n&&t.style&&t.nodeType&&n.split(",").forEach(function(i){return r.save(i)}),r},F0,xc=function(t,n){var r=Vn.createElementNS?Vn.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Vn.createElement(t);return r&&r.style?r:Vn.createElement(t)},tn=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(cf,"-$1").toLowerCase())||i.getPropertyValue(n)||!r&&e(t,ci(n)||n,1)||""},Rh="O,Moz,ms,Ms,Webkit".split(","),ci=function(t,n,r){var i=n||mr,a=i.style,s=5;if(t in a&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);s--&&!(Rh[s]+t in a););return s<0?null:(s===3?"ms":s>=0?Rh[s]:"")+t},vc=function(){xS()&&window.document&&(Ah=window,Vn=Ah.document,Wr=Vn.documentElement,mr=xc("div")||{style:{}},xc("div"),Gt=ci(Gt),Ue=Gt+"Origin",mr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",F0=!!ci("perspective"),uf=He.core.reverting,lf=1)},Eh=function(t){var n=t.ownerSVGElement,r=xc("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0),a;i.style.display="block",r.appendChild(i),Wr.appendChild(r);try{a=i.getBBox()}catch{}return r.removeChild(i),Wr.removeChild(r),a},Dh=function(t,n){for(var r=n.length;r--;)if(t.hasAttribute(n[r]))return t.getAttribute(n[r])},N0=function(t){var n,r;try{n=t.getBBox()}catch{n=Eh(t),r=1}return n&&(n.width||n.height)||r||(n=Eh(t)),n&&!n.width&&!n.x&&!n.y?{x:+Dh(t,["x","cx","x1"])||0,y:+Dh(t,["y","cy","y1"])||0,width:0,height:0}:n},$0=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&N0(t))},nr=function(t,n){if(n){var r=t.style,i;n in jn&&n!==Ue&&(n=Gt),r.removeProperty?(i=n.substr(0,2),(i==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(i==="--"?n:n.replace(cf,"-$1").toLowerCase())):r.removeAttribute(n)}},Zn=function(t,n,r,i,a,s){var o=new Be(t._pt,n,r,0,1,s?D0:E0);return t._pt=o,o.b=i,o.e=a,t._props.push(r),o},Oh={deg:1,rad:1,turn:1},FS={grid:1,flex:1},rr=function e(t,n,r,i){var a=parseFloat(r)||0,s=(r+"").trim().substr((a+"").length)||"px",o=mr.style,l=vS.test(n),u=t.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),f=100,h=i==="px",p=i==="%",g,d,m,x;if(i===s||!a||Oh[i]||Oh[s])return a;if(s!=="px"&&!h&&(a=e(t,n,r,"px")),x=t.getCTM&&$0(t),(p||s==="%")&&(jn[n]||~n.indexOf("adius")))return g=x?t.getBBox()[l?"width":"height"]:t[c],te(p?a/g*f:a/100*g);if(o[l?"width":"height"]=f+(h?s:i),d=i!=="rem"&&~n.indexOf("adius")||i==="em"&&t.appendChild&&!u?t:t.parentNode,x&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===Vn||!d.appendChild)&&(d=Vn.body),m=d._gsap,m&&p&&m.width&&l&&m.time===Qe.time&&!m.uncache)return te(a/m.width*f);if(p&&(n==="height"||n==="width")){var y=t.style[n];t.style[n]=f+i,g=t[c],y?t.style[n]=y:nr(t,n)}else(p||s==="%")&&!FS[tn(d,"display")]&&(o.position=tn(t,"position")),d===t&&(o.position="static"),d.appendChild(mr),g=mr[c],d.removeChild(mr),o.position="absolute";return l&&p&&(m=xr(d),m.time=Qe.time,m.width=d[c]),te(h?g*a/f:g&&a?f/g*a:0)},Nn=function(t,n,r,i){var a;return lf||vc(),n in Tn&&n!=="transform"&&(n=Tn[n],~n.indexOf(",")&&(n=n.split(",")[0])),jn[n]&&n!=="transform"?(a=Qi(t,i),a=n!=="transformOrigin"?a[n]:a.svg?a.origin:Va(tn(t,Ue))+" "+a.zOrigin+"px"):(a=t.style[n],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=Ka[n]&&Ka[n](t,n,r)||tn(t,n)||Qm(t,n)||(n==="opacity"?1:0))),r&&!~(a+"").trim().indexOf(" ")?rr(t,n,a,r)+r:a},NS=function(t,n,r,i){if(!r||r==="none"){var a=ci(n,t,1),s=a&&tn(t,a,1);s&&s!==r?(n=a,r=s):n==="borderColor"&&(r=tn(t,"borderTopColor"))}var o=new Be(this._pt,t.style,n,0,1,k0),l=0,u=0,c,f,h,p,g,d,m,x,y,v,_,S;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=tn(t,i.substring(4,i.indexOf(")")))),i==="auto"&&(d=t.style[n],t.style[n]=i,i=tn(t,n)||i,d?t.style[n]=d:nr(t,n)),c=[r,i],y0(c),r=c[0],i=c[1],h=r.match(Hr)||[],S=i.match(Hr)||[],S.length){for(;f=Hr.exec(i);)m=f[0],y=i.substring(l,f.index),g?g=(g+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(g=1),m!==(d=h[u++]||"")&&(p=parseFloat(d)||0,_=d.substr((p+"").length),m.charAt(1)==="="&&(m=Xr(p,m)+_),x=parseFloat(m),v=m.substr((x+"").length),l=Hr.lastIndex-v.length,v||(v=v||en.units[n]||_,l===i.length&&(i+=v,o.e+=v)),_!==v&&(p=rr(t,n,d,v)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:p,c:x-p,m:g&&g<4||n==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=n==="display"&&i==="none"?D0:E0;return Xm.test(i)&&(o.e=0),this._pt=o,o},Ph={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},$S=function(t){var n=t.split(" "),r=n[0],i=n[1]||"50%";return(r==="top"||r==="bottom"||i==="left"||i==="right")&&(t=r,r=i,i=t),n[0]=Ph[r]||r,n[1]=Ph[i]||i,n.join(" ")},LS=function(t,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,i=r.style,a=n.u,s=r._gsap,o,l,u;if(a==="all"||a===!0)i.cssText="",l=1;else for(a=a.split(","),u=a.length;--u>-1;)o=a[u],jn[o]&&(l=1,o=o==="transformOrigin"?Ue:Gt),nr(r,o);l&&(nr(r,Gt),s&&(s.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Qi(r,1),s.uncache=1,O0(i)))}},Ka={clearProps:function(t,n,r,i,a){if(a.data!=="isFromStart"){var s=t._pt=new Be(t._pt,n,r,0,0,LS);return s.u=i,s.pr=-10,s.tween=a,t._props.push(r),1}}},Zi=[1,0,0,1,0,0],L0={},q0=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Fh=function(t){var n=tn(t,Gt);return q0(n)?Zi:n.substr(7).match(Ym).map(te)},ff=function(t,n){var r=t._gsap||xr(t),i=t.style,a=Fh(t),s,o,l,u;return r.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,a=[l.a,l.b,l.c,l.d,l.e,l.f],a.join(",")==="1,0,0,1,0,0"?Zi:a):(a===Zi&&!t.offsetParent&&t!==Wr&&!r.svg&&(l=i.display,i.display="block",s=t.parentNode,(!s||!t.offsetParent&&!t.getBoundingClientRect().width)&&(u=1,o=t.nextElementSibling,Wr.appendChild(t)),a=Fh(t),l?i.display=l:nr(t,"display"),u&&(o?s.insertBefore(t,o):s?s.appendChild(t):Wr.removeChild(t))),n&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},bc=function(t,n,r,i,a,s){var o=t._gsap,l=a||ff(t,!0),u=o.xOrigin||0,c=o.yOrigin||0,f=o.xOffset||0,h=o.yOffset||0,p=l[0],g=l[1],d=l[2],m=l[3],x=l[4],y=l[5],v=n.split(" "),_=parseFloat(v[0])||0,S=parseFloat(v[1])||0,w,b,M,A;r?l!==Zi&&(b=p*m-g*d)&&(M=_*(m/b)+S*(-d/b)+(d*y-m*x)/b,A=_*(-g/b)+S*(p/b)-(p*y-g*x)/b,_=M,S=A):(w=N0(t),_=w.x+(~v[0].indexOf("%")?_/100*w.width:_),S=w.y+(~(v[1]||v[0]).indexOf("%")?S/100*w.height:S)),i||i!==!1&&o.smooth?(x=_-u,y=S-c,o.xOffset=f+(x*p+y*d)-x,o.yOffset=h+(x*g+y*m)-y):o.xOffset=o.yOffset=0,o.xOrigin=_,o.yOrigin=S,o.smooth=!!i,o.origin=n,o.originIsAbsolute=!!r,t.style[Ue]="0px 0px",s&&(Zn(s,o,"xOrigin",u,_),Zn(s,o,"yOrigin",c,S),Zn(s,o,"xOffset",f,o.xOffset),Zn(s,o,"yOffset",h,o.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},Qi=function(t,n){var r=t._gsap||new b0(t);if("x"in r&&!n&&!r.uncache)return r;var i=t.style,a=r.scaleX<0,s="px",o="deg",l=getComputedStyle(t),u=tn(t,Ue)||"0",c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,A,R,C,O,D,N,H,q,F,j,$,it,et,nt,J,lt,I;return c=f=h=d=m=x=y=v=_=0,p=g=1,r.svg=!!(t.getCTM&&$0(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Gt]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Gt]!=="none"?l[Gt]:"")),i.scale=i.rotate=i.translate="none"),b=ff(t,r.svg),r.svg&&(r.uncache?(j=t.getBBox(),u=r.xOrigin-j.x+"px "+(r.yOrigin-j.y)+"px",F=""):F=!n&&t.getAttribute("data-svg-origin"),bc(t,F||u,!!F||r.originIsAbsolute,r.smooth!==!1,b)),S=r.xOrigin||0,w=r.yOrigin||0,b!==Zi&&(C=b[0],O=b[1],D=b[2],N=b[3],c=H=b[4],f=q=b[5],b.length===6?(p=Math.sqrt(C*C+O*O),g=Math.sqrt(N*N+D*D),d=C||O?qr(O,C)*dr:0,y=D||N?qr(D,N)*dr+d:0,y&&(g*=Math.abs(Math.cos(y*Kr))),r.svg&&(c-=S-(S*C+w*D),f-=w-(S*O+w*N))):(I=b[6],J=b[7],it=b[8],et=b[9],nt=b[10],lt=b[11],c=b[12],f=b[13],h=b[14],M=qr(I,nt),m=M*dr,M&&(A=Math.cos(-M),R=Math.sin(-M),F=H*A+it*R,j=q*A+et*R,$=I*A+nt*R,it=H*-R+it*A,et=q*-R+et*A,nt=I*-R+nt*A,lt=J*-R+lt*A,H=F,q=j,I=$),M=qr(-D,nt),x=M*dr,M&&(A=Math.cos(-M),R=Math.sin(-M),F=C*A-it*R,j=O*A-et*R,$=D*A-nt*R,lt=N*R+lt*A,C=F,O=j,D=$),M=qr(O,C),d=M*dr,M&&(A=Math.cos(M),R=Math.sin(M),F=C*A+O*R,j=H*A+q*R,O=O*A-C*R,q=q*A-H*R,C=F,H=j),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,x=180-x),p=te(Math.sqrt(C*C+O*O+D*D)),g=te(Math.sqrt(q*q+I*I)),M=qr(H,q),y=Math.abs(M)>2e-4?M*dr:0,_=lt?1/(lt<0?-lt:lt):0),r.svg&&(F=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!q0(tn(t,Gt)),F&&t.setAttribute("transform",F))),Math.abs(y)>90&&Math.abs(y)<270&&(a?(p*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(g*=-1,y+=y<=0?180:-180)),n=n||r.uncache,r.x=c-((r.xPercent=c&&(!n&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+s,r.y=f-((r.yPercent=f&&(!n&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+s,r.z=h+s,r.scaleX=te(p),r.scaleY=te(g),r.rotation=te(d)+o,r.rotationX=te(m)+o,r.rotationY=te(x)+o,r.skewX=y+o,r.skewY=v+o,r.transformPerspective=_+s,(r.zOrigin=parseFloat(u.split(" ")[2])||!n&&r.zOrigin||0)&&(i[Ue]=Va(u)),r.xOffset=r.yOffset=0,r.force3D=en.force3D,r.renderTransform=r.svg?IS:F0?I0:qS,r.uncache=0,r},Va=function(t){return(t=t.split(" "))[0]+" "+t[1]},Hs=function(t,n,r){var i=ke(n);return te(parseFloat(n)+parseFloat(rr(t,"x",r+"px",i)))+i},qS=function(t,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,I0(t,n)},fr="0deg",bi="0px",hr=") ",I0=function(t,n){var r=n||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.z,u=r.rotation,c=r.rotationY,f=r.rotationX,h=r.skewX,p=r.skewY,g=r.scaleX,d=r.scaleY,m=r.transformPerspective,x=r.force3D,y=r.target,v=r.zOrigin,_="",S=x==="auto"&&t&&t!==1||x===!0;if(v&&(f!==fr||c!==fr)){var w=parseFloat(c)*Kr,b=Math.sin(w),M=Math.cos(w),A;w=parseFloat(f)*Kr,A=Math.cos(w),s=Hs(y,s,b*A*-v),o=Hs(y,o,-Math.sin(w)*-v),l=Hs(y,l,M*A*-v+v)}m!==bi&&(_+="perspective("+m+hr),(i||a)&&(_+="translate("+i+"%, "+a+"%) "),(S||s!==bi||o!==bi||l!==bi)&&(_+=l!==bi||S?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+hr),u!==fr&&(_+="rotate("+u+hr),c!==fr&&(_+="rotateY("+c+hr),f!==fr&&(_+="rotateX("+f+hr),(h!==fr||p!==fr)&&(_+="skew("+h+", "+p+hr),(g!==1||d!==1)&&(_+="scale("+g+", "+d+hr),y.style[Gt]=_||"translate(0, 0)"},IS=function(t,n){var r=n||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.rotation,u=r.skewX,c=r.skewY,f=r.scaleX,h=r.scaleY,p=r.target,g=r.xOrigin,d=r.yOrigin,m=r.xOffset,x=r.yOffset,y=r.forceCSS,v=parseFloat(s),_=parseFloat(o),S,w,b,M,A;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=Kr,u*=Kr,S=Math.cos(l)*f,w=Math.sin(l)*f,b=Math.sin(l-u)*-h,M=Math.cos(l-u)*h,u&&(c*=Kr,A=Math.tan(u-c),A=Math.sqrt(1+A*A),b*=A,M*=A,c&&(A=Math.tan(c),A=Math.sqrt(1+A*A),S*=A,w*=A)),S=te(S),w=te(w),b=te(b),M=te(M)):(S=f,M=h,w=b=0),(v&&!~(s+"").indexOf("px")||_&&!~(o+"").indexOf("px"))&&(v=rr(p,"x",s,"px"),_=rr(p,"y",o,"px")),(g||d||m||x)&&(v=te(v+g-(g*S+d*b)+m),_=te(_+d-(g*w+d*M)+x)),(i||a)&&(A=p.getBBox(),v=te(v+i/100*A.width),_=te(_+a/100*A.height)),A="matrix("+S+","+w+","+b+","+M+","+v+","+_+")",p.setAttribute("transform",A),y&&(p.style[Gt]=A)},zS=function(t,n,r,i,a){var s=360,o=pe(a),l=parseFloat(a)*(o&&~a.indexOf("rad")?dr:1),u=l-i,c=i+u+"deg",f,h;return o&&(f=a.split("_")[1],f==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),f==="cw"&&u<0?u=(u+s*Ch)%s-~~(u/s)*s:f==="ccw"&&u>0&&(u=(u-s*Ch)%s-~~(u/s)*s)),t._pt=h=new Be(t._pt,n,r,i,u,wS),h.e=c,h.u="deg",t._props.push(r),h},Nh=function(t,n){for(var r in n)t[r]=n[r];return t},BS=function(t,n,r){var i=Nh({},r._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=r.style,o,l,u,c,f,h,p,g;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),s[Gt]=n,o=Qi(r,1),nr(r,Gt),r.setAttribute("transform",u)):(u=getComputedStyle(r)[Gt],s[Gt]=n,o=Qi(r,1),s[Gt]=u);for(l in jn)u=i[l],c=o[l],u!==c&&a.indexOf(l)<0&&(p=ke(u),g=ke(c),f=p!==g?rr(r,l,u,g):parseFloat(u),h=parseFloat(c),t._pt=new Be(t._pt,o,l,f,h-f,_c),t._pt.u=g||0,t._props.push(l));Nh(o,i)};ze("padding,margin,Width,Radius",function(e,t){var n="Top",r="Right",i="Bottom",a="Left",s=(t<3?[n,r,i,a]:[n+a,n+r,i+r,i+a]).map(function(o){return t<2?e+o:"border"+o+e});Ka[t>1?"border"+e:e]=function(o,l,u,c,f){var h,p;if(arguments.length<4)return h=s.map(function(g){return Nn(o,g,u)}),p=h.join(" "),p.split(h[0]).length===5?h[0]:p;h=(c+"").split(" "),p={},s.forEach(function(g,d){return p[g]=h[d]=h[d]||h[(d-1)/2|0]}),o.init(l,p,f)}});var z0={name:"css",register:vc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,n,r,i,a){var s=this._props,o=t.style,l=r.vars.startAt,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,A;lf||vc(),this.styles=this.styles||P0(t),M=this.styles.props,this.tween=r;for(d in n)if(d!=="autoRound"&&(c=n[d],!(Ze[d]&&w0(d,n,r,i,t,a)))){if(p=typeof c,g=Ka[d],p==="function"&&(c=c.call(r,i,t,a),p=typeof c),p==="string"&&~c.indexOf("random(")&&(c=Wi(c)),g)g(this,t,d,c,r)&&(b=1);else if(d.substr(0,2)==="--")u=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",Jn.lastIndex=0,Jn.test(u)||(m=ke(u),x=ke(c),x?m!==x&&(u=rr(t,d,u,x)+x):m&&(c+=m)),this.add(o,"setProperty",u,c,i,a,0,0,d),s.push(d),M.push(d,0,o[d]);else if(p!=="undefined"){if(l&&d in l?(u=typeof l[d]=="function"?l[d].call(r,i,t,a):l[d],pe(u)&&~u.indexOf("random(")&&(u=Wi(u)),ke(u+"")||u==="auto"||(u+=en.units[d]||ke(Nn(t,d))||""),(u+"").charAt(1)==="="&&(u=Nn(t,d))):u=Nn(t,d),h=parseFloat(u),y=p==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),f=parseFloat(c),d in Tn&&(d==="autoAlpha"&&(h===1&&Nn(t,"visibility")==="hidden"&&f&&(h=0),M.push("visibility",0,o.visibility),Zn(this,o,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Tn[d],~d.indexOf(",")&&(d=d.split(",")[0]))),v=d in jn,v){if(this.styles.save(d),A=c,p==="string"&&c.substring(0,6)==="var(--"){if(c=tn(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var R=t.style.perspective;t.style.perspective=c,c=tn(t,"perspective"),R?t.style.perspective=R:nr(t,"perspective")}f=parseFloat(c)}if(_||(S=t._gsap,S.renderTransform&&!n.parseTransform||Qi(t,n.parseTransform),w=n.smoothOrigin!==!1&&S.smooth,_=this._pt=new Be(this._pt,o,Gt,0,1,S.renderTransform,S,0,-1),_.dep=1),d==="scale")this._pt=new Be(this._pt,S,"scaleY",S.scaleY,(y?Xr(S.scaleY,y+f):f)-S.scaleY||0,_c),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){M.push(Ue,0,o[Ue]),c=$S(c),S.svg?bc(t,c,0,w,0,this):(x=parseFloat(c.split(" ")[2])||0,x!==S.zOrigin&&Zn(this,S,"zOrigin",S.zOrigin,x),Zn(this,o,d,Va(u),Va(c)));continue}else if(d==="svgOrigin"){bc(t,c,1,w,0,this);continue}else if(d in L0){zS(this,S,d,h,y?Xr(h,y+c):c);continue}else if(d==="smoothOrigin"){Zn(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){BS(this,c,t);continue}}else d in o||(d=ci(d)||d);if(v||(f||f===0)&&(h||h===0)&&!bS.test(c)&&d in o)m=(u+"").substr((h+"").length),f||(f=0),x=ke(c)||(d in en.units?en.units[d]:m),m!==x&&(h=rr(t,d,u,x)),this._pt=new Be(this._pt,v?S:o,d,h,(y?Xr(h,y+f):f)-h,!v&&(x==="px"||d==="zIndex")&&n.autoRound!==!1?MS:_c),this._pt.u=x||0,v&&A!==c?(this._pt.b=u,this._pt.e=A,this._pt.r=TS):m!==x&&x!=="%"&&(this._pt.b=u,this._pt.r=SS);else if(d in o)NS.call(this,t,d,u,y?y+c:c);else if(d in t)this.add(t,d,u||t[d],y?y+c:c,i,a);else if(d!=="parseTransform"){Zc(d,c);continue}v||(d in o?M.push(d,0,o[d]):typeof t[d]=="function"?M.push(d,2,t[d]()):M.push(d,1,u||t[d])),s.push(d)}}b&&C0(this)},render:function(t,n){if(n.tween._time||!uf())for(var r=n._pt;r;)r.r(t,r.d),r=r._next;else n.styles.revert()},get:Nn,aliases:Tn,getSetter:function(t,n,r){var i=Tn[n];return i&&i.indexOf(",")<0&&(n=i),n in jn&&n!==Ue&&(t._gsap.x||Nn(t,"x"))?r&&kh===r?n==="scale"?RS:CS:(kh=r||{})&&(n==="scale"?ES:DS):t.style&&!Wc(t.style[n])?AS:~n.indexOf("-")?kS:sf(t,n)},core:{_removeProperty:nr,_getMatrix:ff}};He.utils.checkPrefix=ci;He.core.getStyleSaver=P0;(function(e,t,n,r){var i=ze(e+","+t+","+n,function(a){jn[a]=1});ze(t,function(a){en.units[a]="deg",L0[a]=1}),Tn[i[13]]=e+","+t,ze(r,function(a){var s=a.split(":");Tn[s[1]]=i[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ze("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){en.units[e]="px"});He.registerPlugin(z0);var wc=He.registerPlugin(z0)||He;wc.core.Tween;const Ir={IN_OUT:"power2.inOut",OUT:"power2.out"},wi={NO_STAGGER:0,RIPPLE_STAGGER_DELAY:.05};class B0{constructor(t,n={}){mi(this,"timeline");mi(this,"currentStage","");mi(this,"callbacks");mi(this,"durations");this.durations=t,this.callbacks=n,this.timeline=wc.timeline({paused:!0,onUpdate:()=>this.handleProgress(),onComplete:()=>{var i,a,s,o;(a=(i=this.callbacks).onComplete)==null||a.call(i),(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"complete")}});let r=0;this.timeline.addLabel("seatsToRings",r),r+=t.seatsToRings/1e3,this.timeline.addLabel("ringsToBar",r),r+=t.ringsToBar/1e3,this.timeline.addLabel("axesReveal",r),r+=t.axesReveal/1e3,this.timeline.addLabel("barSlide",r),r+=t.barSlide/1e3,this.timeline.addLabel("barsGrow",r),r+=t.barsGrow/1e3,this.timeline.addLabel("barsToArea",r)}animateSeatsToRings(t,n){const r=this.durations.seatsToRings/1e3;return t.each(function(){const i=this;if(!i.getAttribute("data-orig-x")){const a=i.getAttribute("x"),s=i.getAttribute("y"),o=i.getAttribute("width"),l=i.getAttribute("height");i.setAttribute("data-orig-x",a||"0"),i.setAttribute("data-orig-y",s||"0"),i.setAttribute("data-orig-width",o||"0"),i.setAttribute("data-orig-height",l||"0")}}),this.timeline.to(t.nodes(),{width:2,y:(i,a)=>parseFloat(a.getAttribute("y")||"0"),height:(i,a)=>{const s=parseFloat(a.getAttribute("y")||"0");return n-s},duration:r,ease:Ir.IN_OUT,stagger:wi.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="seatsToRings",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"seatsToRings")}},"seatsToRings"),this}animateRingsToBar(t,n){const r=this.durations.ringsToBar/1e3;return t.each(function(i,a){const s=this;if(!n[a])return;const l=s.getAttribute("x"),u=s.getAttribute("y"),c=s.getAttribute("width"),f=s.getAttribute("height");s.setAttribute("data-orig-x",l||"0"),s.setAttribute("data-orig-y",u||"0"),s.setAttribute("data-orig-width",c||"0"),s.setAttribute("data-orig-height",f||"0")}),this.timeline.to(t.nodes(),{x:i=>{var a;return((a=n[i])==null?void 0:a.x)??0},y:i=>{var a;return((a=n[i])==null?void 0:a.y)??0},width:i=>{var a;return((a=n[i])==null?void 0:a.width)??0},height:i=>{var a;return((a=n[i])==null?void 0:a.height)??0},duration:r,ease:Ir.IN_OUT,stagger:wi.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="ringsToBar",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"ringsToBar")}},"ringsToBar"),this}animateAxesReveal(t,n){const r=this.durations.axesReveal/1e3;return this.timeline.to([t.node(),n.node()],{opacity:1,duration:r,ease:Ir.IN_OUT,stagger:wi.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="axesReveal",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"axesReveal")}},"axesReveal"),this}animateBarSlide(t,n){const r=this.durations.barSlide/1e3;return this.timeline.to(t.nodes(),{x:n,duration:r,ease:Ir.OUT,stagger:wi.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="barSlide",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"barSlide")}},"barSlide"),this}animateBarsGrow(t,n,r=wi.RIPPLE_STAGGER_DELAY){const i=this.durations.barsGrow/1e3;return t.nodes().forEach((s,o)=>{const l=s,u=l.getAttribute("data-final-y")||"0",c=l.getAttribute("data-final-height")||"0",f=parseInt(l.getAttribute("data-timestamp-index")||"0"),p=Math.abs(f-n)*r;this.timeline.fromTo(l,{height:0,y:parseFloat(l.getAttribute("data-chart-baseline")||"400")},{y:parseFloat(u),height:parseFloat(c),duration:i,delay:p,ease:Ir.OUT},"barsGrow")}),this.timeline.call(()=>{var s,o;this.currentStage="barsGrow",(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"barsGrow")},[],"barsGrow"),this}animateBarsToArea(t,n,r,i){const a=this.durations.barsToArea/1e3,s=new Map;return t.each(function(){var c;const o=this,l=o.getAttribute("class");if(!l)return;const u=l.match(/category-([\w-]+)/);if(u&&u[1]){const f=u[1];s.has(f)||s.set(f,[]),(c=s.get(f))==null||c.push(o)}}),this.timeline.set(t.nodes(),{opacity:0},"barsToArea"),this.timeline.set(n.nodes(),{opacity:1},"barsToArea"),n.each(function(){const o=this,l=o.getAttribute("data-category");if(!l)return;const u=r.get(l);u&&wc.to(o,{attr:{d:u},duration:a,ease:Ir.IN_OUT})}),this.timeline.call(()=>{var o,l;this.currentStage="barsToArea",(l=(o=this.callbacks).onStageComplete)==null||l.call(o,"barsToArea")},[],"barsToArea"),this}handleProgress(){var n,r;const t=this.timeline.progress();(r=(n=this.callbacks).onProgress)==null||r.call(n,t)}getControls(){return{play:()=>this.timeline.play(),pause:()=>this.timeline.pause(),reverse:()=>this.timeline.reverse(),restart:()=>this.timeline.restart(),seek:t=>this.timeline.progress(t),seekToStage:t=>{const n=this.timeline.labels[t];n!==void 0&&this.timeline.seek(n)},kill:()=>this.timeline.kill(),getProgress:()=>this.timeline.progress(),getCurrentStage:()=>this.currentStage,getTimeline:()=>this.timeline}}play(){this.timeline.play()}destroy(){this.timeline.kill()}}function US(e,t){const{arcAngle:n,arcAngleFlexibility:r=5,radius:i,seatSize:a,minSeatSize:s,maxSeatSize:o,spacing:l,innerRadiusRatio:u}=t,c=i*u,f=e.reduce((O,D)=>O+D.seats,0);let h={seatSize:a,arcAngle:n,score:-1};const p=n-r,g=n+r;for(let O=p;O<=g;O+=2.5){const D=O*Math.PI/180;for(let N=o;N>=s;N-=.1){const H=N*2,q=H*l,F=Math.floor((i-c)/q);for(let j=1;j<=Math.min(F,10);j++){let $=0;for(let it=0;it<j;it++){const et=c+(it+.5)*q,nt=H*l/et,J=Math.floor(D/nt);$+=J}if($>=f){const it=f/$,et=(N-s)/(o-s),nt=($-f)/f,J=nt<.15?1:nt<.3?.7:nt<.5?.4:.1,lt=1-Math.abs(O-n)/r,I=J*.5+et*.3+it*.15+lt*.05;I>h.score&&(h={seatSize:N,arcAngle:O,rings:j,score:I})}}}}const d=h.seatSize,m=h.arcAngle,x=m*Math.PI/180,y=d*2,v=y*l,_=Math.floor((i-c)/v),S=[],w=-x/2-Math.PI/2,b=[];let M=0,A=[];for(let O=1;O<=_;O++){let D=0;const N=[];for(let H=0;H<O;H++){const q=c+(H+.5)*v,F=y*l/q,j=Math.floor(x/F);N.push(j),D+=j}if(D>=f){M=O,A=N;break}}if(M>0)b.push(...A);else for(let O=0;O<_;O++){const D=c+(O+.5)*v,N=y*l/D,H=Math.floor(x/N);b.push(H)}for(let O=0;O<b.length;O++){const D=c+(O+.5)*v,N=b[O]??0;if(N>0){const H=x/N;for(let q=0;q<N;q++){const F=w+(q+.5)*H,j=Math.cos(F)*D,$=Math.sin(F)*D;S.push({ring:O,index:q,angle:F,x:j,y:$})}}}S.sort((O,D)=>{const N=O.angle-D.angle;return Math.abs(N)>.001?N:O.ring-D.ring});const R=[];let C=0;return e.forEach((O,D)=>{const N=Math.min(O.seats,S.length-C);for(let H=0;H<N&&C<S.length;H++){const q=S[C++];q&&R.push({x:q.x,y:q.y,category:O.name,categoryIndex:D,seatIndex:H,ring:q.ring,angle:q.angle,radius:d})}}),{arcAngle:m,radius:i,innerRadius:c,centerX:i,centerY:i,seatSize:d,seats:R,totalSeats:f}}function HS(e,t,n){const r=t<=n?1:n/t;return e.filter(i=>i.value>0).map(i=>{const a=t<=n?i.value:Math.max(1,Math.floor(i.value*r));return{id:i.dataKey,name:i.label,seats:a,colour:i.color}})}function Za({svg:e,events:t,xScale:n,chartHeight:r,chartWidth:i,timelineHeight:a,timelineOffset:s,instanceId:o,setHoveredTimelineEvent:l,enableBrush:u=!1,onTimeRangeChange:c,minAllowedTime:f,maxAllowedTime:h,brushColor:p="#69b3a2",mainGroupSelector:g}){const d=r+s,m=o?`.main-chart-group-${o}`:".main-chart-group",x=e.select(g??m),y=o?`timeline-track timeline-track-${o}`:"timeline-track",v=x.append("g").attr("class",y),_=6,S=o?`timeline-clip-${o}`:`timeline-clip-${Math.random().toString(36).substr(2,9)}`;e.append("defs").append("clipPath").attr("id",S).append("rect").attr("x",0).attr("y",d).attr("width",i+_).attr("height",a),v.append("rect").attr("class","timeline-background").attr("x",0).attr("y",d).attr("width",i).attr("height",a).attr("fill","#FFFFFF").attr("stroke","#9CA3AF").attr("stroke-width",1);const w=v.append("g").attr("clip-path",`url(#${S})`),b=3,M=w.selectAll(".timeline-event").data(t).enter().append("rect").attr("class","timeline-event").attr("x",R=>n(new Date(R.timestamp))-b/2).attr("y",d).attr("width",b).attr("height",a).attr("fill",R=>R.color||"#2F42FF").attr("stroke","none").attr("cursor","pointer").attr("data-timestamp",R=>R.timestamp).attr("data-event-name",R=>R.eventName),A=6;if(M.on("mouseenter",function(R,C){const O=Ot(this),D=n(new Date(C.timestamp));O.transition().duration(150).attr("x",D-A/2).attr("width",A),l&&l({timestamp:C.timestamp,eventName:C.eventName,x:D})}).on("mouseleave",function(R,C){const O=Ot(this),D=n(new Date(C.timestamp));O.transition().duration(150).attr("x",D-b/2).attr("width",b),l&&l(null)}),u&&c){const R=f,C=h,O=hi().extent([[0,d],[i,d+a]]).on("start",H=>{if(!H.selection&&R!==void 0&&C!==void 0){const q=H.sourceEvent;if(q){const F=q.offsetX,j=+n.invert(F);if(j<R||j>C){const $=o?`.timeline-brush-${o}`:".timeline-brush";e.select($).call(O.move,null);return}}}}).on("brush",H=>{if(!H.selection)return;const[q,F]=H.selection;let j=+n.invert(q),$=+n.invert(F);R!==void 0&&(j=Math.max(j,R),$=Math.max($,R)),C!==void 0&&(j=Math.min(j,C),$=Math.min($,C));const it=n(new Date(j)),et=n(new Date($));if(it!==q||et!==F){const nt=o?`.timeline-brush-${o}`:".timeline-brush";e.select(nt).call(O.move,[it,et])}}).on("end",H=>{if(!H.selection)return;const[q,F]=H.selection,j=[+n.invert(q),+n.invert(F)];R!==void 0&&(j[0]=Math.max(j[0],R)),C!==void 0&&(j[1]=Math.min(j[1],C)),c(j);const $=o?`.timeline-brush-${o}`:".timeline-brush";e.select($).call(O.move,null)}),D=o?`timeline-brush timeline-brush-${o}`:"timeline-brush",N=x.append("g").attr("class",D).call(O);N.selectAll(".selection").attr("fill",p).attr("fill-opacity",.2).attr("stroke",p).attr("stroke-width",1),N.selectAll(".handle").attr("fill",p).attr("fill-opacity",.8),N.on("dblclick",()=>{const H=n.domain(),q=[+H[0],+H[1]];c(q)})}}const pn={neoGrey:{200:"#EDEFEF",400:"#ADB5BD"},neoDigitalGreen:{600:"#40c048"}},Ni=["#4CA75A","#FDDA04","#FFC008","#FF9800","#F9A91B","#FF5C24","#ED4134","#CB3446"],qe={greyHatch:{background:pn.neoGrey[200],lines:pn.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}};function jS(e,t){const n=e.append("pattern").attr("id",`${t}-greyHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.greyHatch.background),n.append("path").attr("d","M0,2 L8,2").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M0,6 L8,6").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5)}function GS(e,t){const n=e.append("pattern").attr("id",`${t}-dataMissingHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.dataMissingHatch.background),n.append("path").attr("d","M0,8 L8,0").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M-2,2 L2,-2").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M6,10 L10,6").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5)}function YS(e,t){const n=e.append("pattern").attr("id",`${t}-noLstHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.noLstHatch.background),n.append("path").attr("d","M0,0 L8,8").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M-2,6 L2,10").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M6,-2 L10,2").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5)}function xa(e,t){let n=e.select("defs");n.empty()&&(n=e.append("defs")),jS(n,t),GS(n,t),YS(n,t)}function $h(e,t){if(e.startsWith("url(#")&&e.endsWith(")")){const n=e.slice(5,-1);return`url(#${t}-${n})`}return e}function hf(e){return e.includes("greyHatchPattern")?qe.greyHatch.lines:e.includes("dataMissingHatchPattern")?qe.dataMissingHatch.lines:e.includes("noLstHatchPattern")?qe.noLstHatch.lines:e}function Sc(e,t,n,r){const{xScale:i,yScale:a,addClasses:s=!0,instanceId:o}=r,l=is().x(h=>i(new Date(h.data.timestamp))).y0(h=>a(h[0])).y1(h=>a(h[1])).curve(Ar),u=Um().x(h=>i(new Date(h.data.timestamp))).y(h=>a(h[1])).curve(Ar),c=o?`areas areas-${o}`:"areas";let f=e.select(o?`.areas-${o}`:".areas");f.empty()&&(f=e.append("g").attr("class",c)),t.forEach((h,p)=>{var x;const g=n[p];if(!g)return;const d=((x=g.parliamentMapping)==null?void 0:x.isSpecialCategory)??!1,m=hf(g.color);if(d){const y=f.append("path").datum(h).attr("fill","none").attr("stroke",m).attr("stroke-width",3).attr("stroke-dasharray","15 8").attr("d",u).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}else{const y=f.append("path").datum(h).attr("fill",g.color).attr("fill-opacity",g.fillOpacity??.7).attr("stroke",m).attr("stroke-width",g.strokeWidth??1.5).attr("d",l).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}})}function XS(e,t){var r;const n=[];for(const i of e){let a=0;for(const s of t){const o=i[s.dataKey]||0,l=a,u=a+o;n.push({timestamp:i.timestamp,category:s.label,dataKey:s.dataKey,y0:l,y1:u,value:o,color:s.color,isSpecialCategory:((r=s.parliamentMapping)==null?void 0:r.isSpecialCategory)??!1}),a+=o}}return n}function Ae(e){return e.replace(/[^a-zA-Z0-9-_]/g,"-")}function U0(e,t,n,r){const{centerX:i,centerY:a,addClasses:s=!0,instanceId:o,parliamentRadius:l=200}=r,u=o?`parliament parliament-${o}`:"parliament";let c=e.select(o?`.parliament-${o}`:".parliament");c.empty()&&(c=e.append("g").attr("class",u)),t.seats.forEach(p=>{const g=n.find(x=>x.label===p.category);if(!g)return;const d=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius).attr("fill",g.color).attr("stroke",g.color).attr("stroke-width",.5),m=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius*2.5).attr("fill","transparent").attr("stroke","none").attr("pointer-events","all");if(s){const x=o?`seat seat-${o} seat-${Ae(p.category)}`:`seat seat-${Ae(p.category)}`;d.attr("class",x),m.attr("class",x)}});const f=o?`parliament-label parliament-label-${o}`:"parliament-label";if(e.select(`.${f.split(" ")[0]}`).empty()){const p=e.append("g").attr("class",f).attr("transform",`translate(${i},${a-l*.15})`).style("opacity","0").style("pointer-events","none");p.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),p.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const g=p.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");g.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),g.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}}function WS(e,t,n,r,i,a,s=!1){var f;const o=new Map;let l=i;if(t.length>0&&((f=t[0])==null?void 0:f.timestamp)!==void 0){const h=t[0].timestamp;l=n(new Date(h))}const u=new Map;for(const h of e.seats)u.has(h.category)||u.set(h.category,[]),u.get(h.category).push(h);const c=new Map;for(const h of t)c.set(h.dataKey,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory}),h.label&&h.label!==h.dataKey&&c.set(h.label,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory});for(const h of e.seats){const p=c.get(h.category);if(!p){o.set(h,{x:l,y:a/2});continue}const g=r(p.y0),d=r(p.y1);let m;if(s){const x=u.get(h.category)??[],y=h.seatIndex,v=x.length;if(v===1)m=(g+d)/2;else{const _=y/(v-1);m=g+(d-g)*_}}else m=d;o.set(h,{x:l,y:m})}return o}function KS(e,t,n){var s;if(e.length===0)return[];const r=e[e.length-1],i=[];let a=0;for(const o of t){const l=r[o.dataKey]||0,u=a,c=a+l;i.push({dataKey:o.dataKey,label:o.label,y0:u,y1:c,value:l,timestamp:r.timestamp,isSpecialCategory:((s=o.parliamentMapping)==null?void 0:s.isSpecialCategory)??!1}),a+=l}return i}function VS(e){const t=e;return{seatsToLines:t*.2,seatsToBar:t*.07,crossFadePause:t*.003,barSlideToTimeline:t*.22,axesAndBarsGrow:t*.22,barsToArea:t*.287}}const yr=new Map;Ot.prototype.transition=qc;const ZS=({containerRef:e,data:t,categories:n,mode:r,width:i,height:a,margin:s,timeRange:o,showGrid:l=!0,showAxes:u=!0,axisLabelColor:c,axisLabelSize:f=14,formatDate:h,formatValue:p,markers:g=[],arcAngle:d=200,parliamentRadius:m=200,seatSize:x=4.5,animationDuration:y=900,onMorphComplete:v,onAnimationStateChange:_,onTimelineReady:S,onAnimationProgress:w,onHoveredDataChange:b,hoveredCategory:M,maxSeats:A=2e3,parliamentTimestamp:R,enableBrush:C=!1,onTimeRangeChange:O,minAllowedTime:D,maxAllowedTime:N,showScaleIndicator:H=!1,reposPerSeat:q=1,timelineEvents:F=[],showTimeline:j=!1,timelineHeight:$=40,timelineOffset:it=35,brushColor:et="#69b3a2",showCrosshair:nt=!1,onCrosshairMove:J})=>{const[lt,I]=Y.useState("area"),[Q,at]=Y.useState(!1),[K,k]=Y.useState(null),[z,E]=Y.useState(0),[T,X]=Y.useState(null),[V,G]=Y.useState(null),[ut,U]=Y.useState([]),ot=Y.useRef(null),gt=Y.useRef(r),yt=Y.useRef(!0),vt=Y.useRef(!1),tt=Y.useRef(`morph-${Math.random().toString(36).substr(2,9)}`),st=Y.useRef(void 0),_t=Y.useRef(o),dt=Y.useRef(g),xt=Y.useRef(F),Et=Y.useRef(v),At=Y.useRef(_),ee=Y.useRef(S),ne=Y.useRef(w),Pt=Y.useRef(b),ge=Y.useRef(J);Y.useEffect(()=>{Et.current=v,At.current=_,ee.current=S,ne.current=w,Pt.current=b,ge.current=J},[v,_,S,w,b,J]),Y.useEffect(()=>{if(e.current&<==="parliament")if(M){const Rt=n.find(It=>It.dataKey===M);if(Rt){const It=Rt.label;if(k(It),qi(e.current,It),t.length>0){const Re=t[t.length-1],Qt=Math.round(Re.values[Rt.dataKey]||0),oe={label:Rt.label,value:Qt,color:hf(Rt.color)};Li(e.current,oe,H,q,tt.current)}}}else k(null),qi(e.current,null),Li(e.current,null,H,q,tt.current)},[M,lt,n,t,H,q]);const Vt=i-s.left-s.right,Zt=a-s.top-s.bottom;return Y.useEffect(()=>{var le;if(!e.current||t.length===0||n.length===0||(st.current&&(st.current(),st.current=void 0),vt.current))return;const Rt=Ot(e.current),It=r!==gt.current;yt.current?(Rt.selectAll("*").remove(),xa(Rt,tt.current),yt.current=!1):It||(Rt.selectAll("*").remove(),xa(Rt,tt.current));const Re=t[t.length-1],Qt=n.reduce((ht,Lt)=>ht+(Re.values[Lt.dataKey]||0),0),oe=t.map(ht=>{const Lt={timestamp:ht.timestamp};for(const ue of n)Lt[ue.dataKey]=ht.values[ue.dataKey]||0;return Lt}),we=n.map(ht=>ht.dataKey),me=Gi().keys(we),Ge=me(oe),sn=t.map(ht=>ht.timestamp),Ye=It||!o?Math.min(...sn):o[0],Fe=It||!o?Math.max(...sn):o[1],on=[...sn].sort((ht,Lt)=>ht-Lt),ye=[];for(let ht=0;ht<on.length-1;ht++)ye.push(on[ht+1]-on[ht]);const kt=ye.length>0?ye.reduce((ht,Lt)=>ht+Lt,0)/ye.length:0,$t=Fe+kt*1.15,Mt=Yr().domain([new Date(Ye),new Date($t)]).range([0,Vt]),Yt=oe.filter(ht=>ht.timestamp>=Ye&&ht.timestamp<=Fe),_e=me(Yt),Xt=_e.length>0?Math.max(..._e[_e.length-1].map(ht=>ht[1]??0)):0,B=ni().domain([0,Xt*1.15]).range([Zt,0]),ct=n.map(ht=>({...ht,color:$h(ht.color,tt.current)})),ft=ct.map(ht=>({dataKey:ht.dataKey,label:ht.label,color:ht.color,value:Re.values[ht.dataKey]||0})),wt=HS(ft,Qt,A).reverse(),St=US(wt,{arcAngle:d,radius:m,seatSize:x,minSeatSize:4,maxSeatSize:30,spacing:1.1,innerRadiusRatio:.4});ot.current=St;const zt=KS(oe,n),re=WS(St,zt,Mt,B,Vt,Zt);if(It&&!vt.current){vt.current=!0,at(!0),(le=At.current)==null||le.call(At,!0),X(null),U([]),E(0);let ht=Rt.select("g[transform]");if(ht.empty()&&(ht=Rt.select("g")),ht.empty()){Rt.selectAll("*").remove(),xa(Rt,tt.current),js(Rt,r==="parliament"?"parliament":"area",Ge,ct,St,Mt,B,Vt,Zt,s,l,u,c,f,h,p,C,O,tt.current,g,o,U,X,F,j,$,it,G,D,N,et,nt,J),at(!1),I(r==="parliament"?"parliament":"area"),E(r==="parliament"?1:0),gt.current=r;return}const Lt=setTimeout(()=>{vt.current=!1,at(!1),gt.current=r},y*3);JS(Rt,r,Ge,ct,St,re,Mt,B,Vt,Zt,s,y,()=>{var ue,Ee,De;if(clearTimeout(Lt),vt.current=!1,at(!1),I(r==="parliament"?"parliament":"area"),r==="parliament"&&E(1),(ue=At.current)==null||ue.call(At,!1),(Ee=Et.current)==null||Ee.call(Et),gt.current=r,r==="parliament"&&e.current&&Pt.current&&(st.current=Gs(e.current,ct,t,K,k,Pt.current,H,q,tt.current)),r!=="parliament"&&e.current){k(null),(De=Pt.current)==null||De.call(Pt,null),Li(e.current,null,H,q,tt.current);const Xe=Ot(e.current),Ne=Xe.select(tt.current?`.main-chart-group-${tt.current}`:".main-chart-group");if(j){const Rn=tt.current?`.timeline-track-${tt.current}`:".timeline-track",We=tt.current?`.timeline-brush-${tt.current}`:".timeline-brush";Ne.select(Rn).remove(),Ne.select(We).remove(),Za({svg:Xe,events:F,xScale:Mt,chartHeight:Zt,chartWidth:Vt,timelineHeight:$,timelineOffset:it,instanceId:tt.current,setHoveredTimelineEvent:G,enableBrush:C,onTimeRangeChange:O,minAllowedTime:D,maxAllowedTime:N,brushColor:et})}if(C&&O){const Rn=Ne.select(tt.current?`.chart-content-group-${tt.current}`:".chart-content-group");QS(Rn,Vt,Zt,Mt,O,tt.current,Xe,D,N,et)}if(g.length>0&&U&&X&&o){const We=g.filter(ln=>ln.timestamp>=(o[0]??0)-1&&ln.timestamp<=(o[1]??1/0)+1).map(ln=>({...ln,x:Mt(new Date(ln.timestamp))}));if(U(We),We.length>0){Lh(Ne,We,Zt,Vt,C,X,tt.current);const ln=Ne.select(tt.current?`.markers-${tt.current}`:".markers");if(!ln.empty()){Ne.selectAll(".marker-hover-overlay").remove();const ar=Ne.select(tt.current?`.chart-content-group-${tt.current}`:".chart-content-group");H0(ar.empty()?Ne:ar,ln,We,Vt,Zt,C,X,s,nt,J)}}}}},u,f,h,p,ee.current,(ue,Ee)=>{var De;if(r==="parliament"&&ue>=.95){const Xe=(ue-.95)/.05;E(Math.min(Xe,1))}(De=ne.current)==null||De.call(ne,ue,Ee)},R,tt.current)}else gt.current=r,r==="parliament"&&(X(null),U([])),js(Rt,r==="parliament"?"parliament":"area",Ge,ct,St,Mt,B,Vt,Zt,s,l,u,c,f,h,p,C,O,tt.current,g,o,U,X,F,j,$,it,G,D,N,et,nt,J),I(r==="parliament"?"parliament":"area"),E(r==="parliament"?1:0),r==="parliament"&&e.current&&Pt.current&&(st.current=Gs(e.current,ct,t,K,k,Pt.current,H,q,tt.current));return()=>{st.current&&(st.current(),st.current=void 0)}},[r]),Y.useEffect(()=>{var Yt,_e;if(!e.current||t.length===0||vt.current)return;if(yt.current){_t.current=o;return}if(!(o!==_t.current&&((o==null?void 0:o[0])!==((Yt=_t.current)==null?void 0:Yt[0])||(o==null?void 0:o[1])!==((_e=_t.current)==null?void 0:_e[1]))))return;_t.current=o;const It=Ot(e.current),Re=t.map(Xt=>{const B={timestamp:Xt.timestamp};for(const ct of n)B[ct.dataKey]=Xt.values[ct.dataKey]||0;return B}),Qt=n.map(Xt=>Xt.dataKey),we=Gi().keys(Qt)(Re),me=t.map(Xt=>Xt.timestamp),Ge=o?o[0]:Math.min(...me),sn=o?o[1]:Math.max(...me),Fe=(me.length>1?(me[me.length-1]-me[0])/(me.length-1):0)*.5,on=Yr().domain([new Date(Ge-Fe),new Date(sn+Fe)]).range([0,i-s.left-s.right]),ye=Math.max(...we[we.length-1].map(Xt=>Xt[1])),kt=ni().domain([0,ye*1.1]).range([a-s.top-s.bottom,0]);if(!ot.current)return;const $t=ot.current,Mt=n.map(Xt=>({...Xt,color:$h(Xt.color,tt.current)}));It.selectAll("*").remove(),xa(It,tt.current),js(It,lt==="parliament"?"parliament":"area",we,Mt,$t,on,kt,i-s.left-s.right,a-s.top-s.bottom,s,l,u,c,f,h,p,C,O,tt.current,g,o,U,X,F,j,$,it,G,D,N,et,nt,J),lt==="parliament"&&e.current&&Pt.current&&(st.current=Gs(e.current,Mt,t,K,k,Pt.current,H,q,tt.current))},[o]),Y.useEffect(()=>{if(!e.current||t.length===0||vt.current)return;if(yt.current){dt.current=g,xt.current=F;return}if(lt==="parliament"){dt.current=g,xt.current=F;return}const Rt=g.length!==dt.current.length||g.some((kt,$t)=>{var Mt,Yt;return kt.timestamp!==((Mt=dt.current[$t])==null?void 0:Mt.timestamp)||kt.label!==((Yt=dt.current[$t])==null?void 0:Yt.label)}),It=F.length!==xt.current.length||F.some((kt,$t)=>{var Mt,Yt;return kt.timestamp!==((Mt=xt.current[$t])==null?void 0:Mt.timestamp)||kt.eventName!==((Yt=xt.current[$t])==null?void 0:Yt.eventName)});if(!Rt&&!It)return;dt.current=g,xt.current=F;const Re=Ot(e.current),Qt=Re.select(tt.current?`.main-chart-group-${tt.current}`:".main-chart-group");if(Qt.empty())return;const oe=t.map(kt=>kt.timestamp),we=o?o[0]:Math.min(...oe),me=o?o[1]:Math.max(...oe),sn=(oe.length>1?(oe[oe.length-1]-oe[0])/(oe.length-1):0)*.5,Ye=i-s.left-s.right,Fe=a-s.top-s.bottom,on=Yr().domain([new Date(we-sn),new Date(me+sn)]).range([0,Ye]);if(It&&j){const kt=tt.current?`.timeline-track-${tt.current}`:".timeline-track",$t=tt.current?`.timeline-brush-${tt.current}`:".timeline-brush";Qt.select(kt).remove(),Qt.select($t).remove(),Za({svg:Re,events:F,xScale:on,chartHeight:Fe,chartWidth:Ye,timelineHeight:$,timelineOffset:it,instanceId:tt.current,setHoveredTimelineEvent:G,enableBrush:C,onTimeRangeChange:O,minAllowedTime:D,maxAllowedTime:N,brushColor:et})}let ye=[];if(Rt&&g.length>0&&o){const kt=tt.current?`.markers-${tt.current}`:".markers";Qt.select(kt).remove();const $t=1;ye=g.filter(Mt=>Mt.timestamp>=(o[0]??0)-$t&&Mt.timestamp<=(o[1]??1/0)+$t).map(Mt=>({...Mt,x:on(new Date(Mt.timestamp))})),U(ye),ye.length>0&&Lh(Qt,ye,Fe,Ye,C,X,tt.current)}if(ye.length>0){const kt=Qt.select(tt.current?`.markers-${tt.current}`:".markers");if(!kt.empty()){Qt.selectAll(".marker-hover-overlay").remove();const $t=Qt.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",Ye).attr("height",Fe).attr("fill","none").attr("pointer-events","all");let Mt=null;$t.on("mousemove",function(Yt){const[_e]=tr(Yt,this);let Xt=null,B=1/0;if(ye.forEach(wt=>{const St=Math.abs(_e-wt.x);St<B&&(B=St,Xt=wt)}),!Xt||B>50){Mt!==null&&(Mt=null,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),X(null));return}const ft=Xt;Mt!==ft.timestamp&&(Mt=ft.timestamp,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),kt.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(ft.timestamp)}).attr("opacity",.6),kt.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(ft.timestamp)}).attr("opacity",1),X(ft))}),$t.on("mouseleave",function(){Mt=null,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),X(null)})}}},[g,F,Q]),{isMorphing:Q,currentMode:lt,hoveredCategory:K,scaleIndicatorOpacity:z,visibleMarkers:ut,hoveredMarker:T,setHoveredMarker:X,hoveredTimelineEvent:V,setHoveredTimelineEvent:G}};function QS(e,t,n,r,i,a,s,o,l,u){const c=o,f=l,h=hi().extent([[0,0],[t,n]]).on("start",g=>{if(!g.selection&&c!==void 0&&f!==void 0){const d=g.sourceEvent;if(d){const m=d.offsetX,x=+r.invert(m);if(x<c||x>f){s.select(".brush").call(h.move,null);return}}}}).on("brush",g=>{if(!g.selection)return;const[d,m]=g.selection;let x=+r.invert(d),y=+r.invert(m);c!==void 0&&(x=Math.max(x,c),y=Math.max(y,c)),f!==void 0&&(x=Math.min(x,f),y=Math.min(y,f));const v=r(new Date(x)),_=r(new Date(y));(v!==d||_!==m)&&s.select(".brush").call(h.move,[v,_])}).on("end",g=>{if(!g.selection)return;const[d,m]=g.selection,x=[+r.invert(d),+r.invert(m)];c!==void 0&&(x[0]=Math.max(x[0],c)),f!==void 0&&(x[1]=Math.min(x[1],f)),i(x),s.select(".brush").call(h.move,null)}),p=e.append("g").attr("class","brush").call(h);p.selectAll(".selection").attr("fill",u).attr("fill-opacity",.2).attr("stroke",u).attr("stroke-width",1),p.selectAll(".handle").attr("fill",u).attr("fill-opacity",.8),p.on("dblclick",()=>{const g=r.domain(),d=[+g[0],+g[1]];o!==void 0&&(d[0]=Math.max(d[0],o)),l!==void 0&&(d[1]=Math.min(d[1],l)),i(d)})}function Lh(e,t,n,r,i,a,s){const o=s?`markers markers-${s}`:"markers",l=e.append("g").attr("class",o);t.forEach(u=>{l.append("line").attr("class","marker-line").attr("data-timestamp",u.timestamp).attr("x1",u.x).attr("x2",u.x).attr("y1",0).attr("y2",n).attr("stroke",u.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),u.label&&l.append("text").attr("class","marker-label").attr("data-timestamp",u.timestamp).attr("x",u.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",u.color??"#2F42FF").attr("opacity",0)})}function H0(e,t,n,r,i,a,s,o,l=!1,u){let c=null,f;a?f=e.select(".brush .overlay"):f=e.append("rect").attr("class","marker-hover-overlay").attr("width",r).attr("height",i).attr("fill","none").attr("pointer-events","all");const h=p=>{let g=null,d=1/0;if(n.forEach(y=>{const v=Math.abs(p-y.x);v<d&&(d=v,g=y)}),!g||d>50)return c!==null&&(c=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)),!1;const x=g;return c===x.timestamp||(c=x.timestamp,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),t.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(x.timestamp)}).attr("opacity",.6),t.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(x.timestamp)}).attr("opacity",1),s(x)),!0};f.on("mousemove",function(p){const[g,d]=tr(p,this);h(g),l&&u&&u({x:g+o.left,y:d+o.top})}),f.on("mouseleave",function(){c=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null),u&&u(null)})}function js(e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m=!1,x,y,v=[],_=[0,0],S,w,b=[],M=!1,A=40,R=15,C,O,D,N="#69b3a2",H=!1,q){const F=O,j=D;let $=null;const it=y?`main-chart-group main-chart-group-${y}`:"main-chart-group",et=e.append("g").attr("class",it).attr("transform",`translate(${u.left},${u.top})`),nt=y?`chart-clip-${y}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`;e.select("defs").append("clipPath").attr("id",nt).append("rect").attr("x",0).attr("y",0).attr("width",o).attr("height",l);const J=y?`chart-content-group chart-content-group-${y}`:"chart-content-group",lt=et.append("g").attr("class",J).attr("clip-path",`url(#${nt})`);if(c&&t!=="parliament"&&(lt.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(a).ticks(6).tickSize(l).tickFormat(()=>"")),lt.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(s).ticks(5).tickSize(-o).tickFormat(()=>""))),t==="area"&&(Sc(lt,n,r,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),v.length>0)){const Q=v.filter(at=>at.timestamp>=_[0]-1&&at.timestamp<=_[1]+1).map(at=>({...at,x:a(new Date(at.timestamp))}));$={markersGroup:null,visibleMarkers:Q},S&&S(Q)}if(t==="parliament"){const I=o/2,Q=i.radius+10,at=l-i.radius*.3,K=Math.max(Q,at);U0(lt,i,r,{centerX:I,centerY:K,addClasses:!0,instanceId:y,parliamentRadius:i.radius})}if(f&&t!=="parliament"){const Q=qn(a).ticks(6).tickPadding(12);g&&Q.tickFormat(T=>g(+T));const K=et.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).call(Q).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&K.attr("fill",h);const k=In(s).ticks(5);k.tickFormat(T=>+T==0?"":d?d(+T):String(T));const E=et.append("g").attr("class","axis axis-y").call(k).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&E.attr("fill",h)}if(m&&x&&t==="area"){const I=F,Q=j,at=hi().extent([[0,0],[o,l]]).on("start",k=>{if(!k.selection&&I!==void 0&&Q!==void 0){const z=k.sourceEvent;if(z){const E=z.offsetX-((u==null?void 0:u.left)||0),T=+a.invert(E);if(T<I||T>Q){e.select(".brush").call(at.move,null);return}}}}).on("brush",k=>{if(!k.selection)return;const[z,E]=k.selection;let T=+a.invert(z),X=+a.invert(E);I!==void 0&&(T=Math.max(T,I),X=Math.max(X,I)),Q!==void 0&&(T=Math.min(T,Q),X=Math.min(X,Q));const V=a(new Date(T)),G=a(new Date(X));(V!==z||G!==E)&&e.select(".brush").call(at.move,[V,G])}).on("end",k=>{if(!k.selection)return;const[z,E]=k.selection,T=[+a.invert(z),+a.invert(E)];I!==void 0&&(T[0]=Math.max(T[0],I)),Q!==void 0&&(T[1]=Math.min(T[1],Q)),x(T),e.select(".brush").call(at.move,null)}),K=lt.append("g").attr("class","brush").call(at);K.selectAll(".selection").attr("fill",N).attr("fill-opacity",.2).attr("stroke",N).attr("stroke-width",1),K.selectAll(".handle").attr("fill",N).attr("fill-opacity",.8),K.on("dblclick",()=>{const k=a.domain(),z=[+k[0],+k[1]];x(z)})}if(t==="area"&&$&&$.visibleMarkers.length>0){const I=et.append("g").attr("class","markers").attr("clip-path",`url(#${nt})`);$.visibleMarkers.forEach(Q=>{I.append("line").attr("class","marker-line").attr("data-timestamp",Q.timestamp).attr("x1",Q.x).attr("x2",Q.x).attr("y1",0).attr("y2",l).attr("stroke",Q.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),Q.label&&I.append("text").attr("class","marker-label").attr("data-timestamp",Q.timestamp).attr("x",Q.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",Q.color??"#2F42FF").attr("opacity",0)}),$.markersGroup=I}if(t==="area"&&M&&C&&Za({svg:e,events:b,xScale:a,chartHeight:l,chartWidth:o,timelineHeight:A,timelineOffset:R,instanceId:y,setHoveredTimelineEvent:C,enableBrush:m,onTimeRangeChange:x,minAllowedTime:F,maxAllowedTime:j,brushColor:N}),t==="area"){const I=($==null?void 0:$.markersGroup)??lt.append("g").attr("class","empty-markers-group"),Q=($==null?void 0:$.visibleMarkers)??[];H0(lt,I,Q,o,l,m,w??(()=>{}),u,H,q)}}function JS(e,t,n,r,i,a,s,o,l,u,c,f,h,p=!0,g=14,d,m,x,y,v,_){const S=e.select(_?`.main-chart-group-${_}`:".main-chart-group");S.selectAll(".markers").remove(),S.selectAll(".marker-hover-overlay").remove(),S.selectAll(".brush").remove(),t==="stacked-area"||t==="area"?tT(S,n,r,i,a,s,o,l,u,f,h,p,g,d,m,x,y,v,_):eT(S,n,r,i,a,s,o,l,u,f,h,p,g,d,m,x,y,v,_)}function $i(e,t,n,r,i,a,s,o){const l=e[a];if(!l)return"";const u=l.find(w=>w.data.timestamp===s);if(!u)return"";const c=u.data,f=t[a];if(!f)return"";const h=f.dataKey,p=c[h];if(!p||p<=0)return"";const g=n.get(s);if(!g)return"";const d=g.x,m=g.width,x=u[0],y=u[1],v=o?i:r(x),_=o?i:r(y),S=[];return S.push(`M ${d} ${v}`),S.push(`L ${d} ${_}`),S.push(`L ${d+m} ${_}`),S.push(`L ${d+m} ${v}`),S.push("Z"),S.join(" ")}function tT(e,t,n,r,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var fa;const v=y?`.seat-${y}`:".seat",_=e.selectAll(v),S=y?`.chart-content-group-${y}`:".chart-content-group";let w=e.select(S);if(w.empty()){const W=e.attr("clip-path"),rt=W?((fa=W.match(/url\(#(.+)\)/))==null?void 0:fa[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,pt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";w=e.append("g").attr("class",pt).attr("clip-path",`url(#${rt})`)}if(_.size()===0){Sc(e,t,n,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),c();return}const b=VS(u),M=y?yr.get(y):void 0;M&&(M.destroy(),y&&yr.delete(y));const A=W=>W<.2?"seatsToRings":W<.35?"ringsToBar":W<.464?"axesReveal":W<.6?"barSlide":W<.82?"barsGrow":"barsToArea",R=new B0({seatsToRings:b.seatsToLines,ringsToBar:b.seatsToBar,axesReveal:b.barSlideToTimeline*.3,barSlide:b.barSlideToTimeline*.7,barsGrow:b.axesAndBarsGrow,barsToArea:b.barsToArea},{onStageComplete:W=>{},onProgress:W=>{if(m){const rt=A(W);m(W,rt)}},onComplete:()=>{c()}});y&&yr.set(y,R),d&&d(R.getControls().getTimeline());const C=t[0].map(W=>W.data),O=XS(C,n),D=o/2,N=r.radius+10,H=l-r.radius*.3,q=Math.max(N,H),F=C.map(W=>W.timestamp),j=x??Math.max(...F),$=new Map,it=[];F.forEach((W,rt)=>{const pt=a(new Date(W)),bt=F[rt+1];if(bt){const Bt=a(new Date(bt))-pt;it.push(Bt)}});const et=it.length>0?it.reduce((W,rt)=>W+rt,0)/it.length:30;F.forEach((W,rt)=>{const pt=a(new Date(W)),bt=F[rt+1],Bt=rt===F.length-1?et:a(new Date(bt))-pt;$.set(W,{x:pt,width:Bt})});const nt=O.filter(W=>W.timestamp===j),J=$.get(j),lt=666,I=y?`parliament-bar-path parliament-bar-path-${y}`:"parliament-bar-path",Q=w.append("g").attr("class",I);nt.sort((W,rt)=>rt.y0-W.y0),new Map().set(j,{x:lt-J.width/2,width:J.width});const K=[],k=(r.radius-r.innerRadius)*.6,E=l*.8,T=q,X=nt.reduce((W,rt)=>W+(rt.y1-rt.y0),0);let V=0;n.forEach(W=>{const rt=nt.find(ve=>ve.dataKey===W.dataKey);if(!rt)return;const Jt=(rt.y1-rt.y0)/X*E,Bt=T-V,Se=T-V-Jt,xe=lt-k/2,$e=`M ${xe} ${Bt} L ${xe} ${Se} L ${xe+k} ${Se} L ${xe+k} ${Bt} Z`;V+=Jt;const Ke=Q.append("path").attr("class",`parliament-bar-segment category-${Ae(rt.dataKey)}`).attr("d",$e).attr("fill",rt.color).style("opacity",0).node();Ke&&K.push(Ke)}),y&&(window.orchestratorMap=yr);const G=R.getControls().getTimeline(),ut=b.seatsToLines/1e3,U=b.seatsToBar/1e3;G.call(()=>{m==null||m(G.progress(),"seatsToRings")},[],"seatsToRings");const ot=_.nodes(),gt=D,yt=q,vt=Math.max(...r.seats.map(W=>W.ring)),tt=r.seats.filter(W=>W.ring===vt),st=e.append("g").attr("class",`seat-lines-${y||"default"}`),_t=n.map(W=>{const rt=_.filter(`.seat-${Ae(W.dataKey)}`).size();return rt>0?{name:W.dataKey,seatCount:rt,color:W.color}:null}).filter(W=>W!==null).reverse(),dt=_t.reduce((W,rt)=>W+rt.seatCount,0),xt=tt.length,Et=r.radius-r.innerRadius,At=Et*.6,ee=At/2,ne=Et*.6,Pt=[];let ge=0;_t.forEach(W=>{const rt=Math.max(1,Math.round(W.seatCount/dt*xt));for(let pt=0;pt<rt;pt++){const bt=(ge+pt)/xt,Jt=r.arcAngle*Math.PI/180,Se=-Jt/2-Math.PI/2+bt*Jt,xe=(r.innerRadius+r.radius)/2,$e=gt+Math.cos(Se)*xe,Ke=yt+Math.sin(Se)*xe,ve=Math.cos(Se),Gn=Math.sin(Se),or=$e-ee*ve,Pr=Ke-ee*Gn,ce=$e+ee*ve,Yn=Ke+ee*Gn,Xn=st.append("line").attr("class","seat-line").attr("x1",or).attr("y1",Pr).attr("x2",ce).attr("y2",Yn).attr("stroke",W.color).attr("stroke-width",r.seatSize*2).attr("stroke-linecap","butt").style("opacity",0).attr("data-angle",Se*180/Math.PI).attr("data-center-x",$e).attr("data-center-y",Ke).attr("data-initial-length",At).node();Pt.push({element:Xn,angle:Se})}ge+=rt});const Vt=()=>{st.remove()},Zt=ut*.5,Rt=0,It=[];if(It.push(...ot),It.sort((W,rt)=>{const pt=parseInt(W.getAttribute("data-layout-index")||"-1",10),bt=parseInt(rt.getAttribute("data-layout-index")||"-1",10);return pt-bt}),It.length>0&&Pt.length>0){const W=Pt.map(rt=>rt.element);G.to(It,{attr:{r:1.5},duration:Zt*.3,ease:"power2.in"},`seatsToRings+=${Rt}`),W.forEach(rt=>{const pt=rt.getAttribute("x1")||"0",bt=rt.getAttribute("y1")||"0",Jt=rt.getAttribute("x2")||"0",Bt=rt.getAttribute("y2")||"0";rt.setAttribute("data-final-x1",pt),rt.setAttribute("data-final-y1",bt),rt.setAttribute("data-final-x2",Jt),rt.setAttribute("data-final-y2",Bt),rt.setAttribute("x1",pt),rt.setAttribute("y1",bt),rt.setAttribute("x2",pt),rt.setAttribute("y2",bt)}),G.to(W,{attr:{x2:(rt,pt)=>parseFloat(pt.getAttribute("data-final-x2")||"0"),y2:(rt,pt)=>parseFloat(pt.getAttribute("data-final-y2")||"0")},opacity:.9,duration:Zt*.6,ease:"power2.out"},`seatsToRings+=${Rt+Zt*.2}`),G.to(It,{opacity:0,duration:Zt*.3,ease:"power2.out"},`seatsToRings+=${Rt+Zt*.3}`)}const Re=ut*.05,Qt=ut*.7,oe=Rt+Zt+Re;if(Pt.length>0){const W=lt,rt=q,bt=l*.8/Pt.length,Jt=rt,Bt=[...Pt].sort(($e,Ke)=>Ke.angle-$e.angle),xe=.6/Bt.length;Bt.forEach(($e,Ke)=>{const ve=W,or=Jt-Ke*bt,Pr=xe*Ke*Qt,ce=$e.element,Yn=parseFloat(ce.getAttribute("data-final-x1")||"0"),Xn=parseFloat(ce.getAttribute("data-final-y1")||"0"),gi=parseFloat(ce.getAttribute("data-final-x2")||"0"),Fr=parseFloat(ce.getAttribute("data-final-y2")||"0"),ha=(Yn+gi)/2,xn=(Xn+Fr)/2,Wn=Math.atan2(Fr-Xn,gi-Yn),lr=Math.sqrt(Math.pow(gi-Yn,2)+Math.pow(Fr-Xn,2));G.to({progress:0},{progress:1,duration:Qt*.5,ease:"power2.inOut",delay:Pr,onUpdate:function(){const ie=this.progress(),_s=ha+(ve-ha)*ie,xs=xn+(or-xn)*ie,vn=40*4*ie*(1-ie),ur=_s,cr=xs-vn,bs=0-Wn,En=Wn+bs*ie*ie,pa=(lr+(ne-lr)*ie)/2,Ly=ur-pa*Math.cos(En),qy=cr-pa*Math.sin(En),Iy=ur+pa*Math.cos(En),zy=cr+pa*Math.sin(En);ce.setAttribute("x1",Ly.toString()),ce.setAttribute("y1",qy.toString()),ce.setAttribute("x2",Iy.toString()),ce.setAttribute("y2",zy.toString())},onComplete:function(){const ie=ne/2;ce.setAttribute("x1",(ve-ie).toString()),ce.setAttribute("y1",or.toString()),ce.setAttribute("x2",(ve+ie).toString()),ce.setAttribute("y2",or.toString())}},`seatsToRings+=${oe}`),G.to($e.element,{opacity:.95,duration:Qt*.3,ease:"power2.out",delay:Pr},`seatsToRings+=${oe}`)})}const we=st,me=[];nt.forEach((W,rt)=>{const pt=_.filter(`.seat-${Ae(W.category)}`),bt=pt.size();if(bt===0)return;const Jt=s(W.y1),Bt=s(W.y0)-s(W.y1),Se=pt.nodes().sort((xn,Wn)=>{const lr=parseInt(xn.getAttribute("data-layout-index")||"-1",10),ie=parseInt(Wn.getAttribute("data-layout-index")||"-1",10);return lr-ie}),xe=Math.max(J.width,100),$e=Bt,Ke=xe/Math.max($e,1),ve=Math.max(2,Math.ceil(Math.sqrt(bt*Ke))),Gn=Math.ceil(bt/ve),or=xe*.8,Pr=$e*.8,ce=ve>1?or/(ve-1):0,Yn=Gn>1?Pr/(Gn-1):0,Xn=ve>1?(ve-1)*ce:0,gi=Gn>1?(Gn-1)*Yn:0,Fr=lt-xe/2+(xe-Xn)/2,ha=Jt+($e-gi)/2;Se.forEach((xn,Wn)=>{const lr=parseInt(xn.getAttribute("data-layout-index")||"-1",10),ie=lr>=0?r.seats[lr]:void 0,_s=ie?D+ie.x:parseFloat(xn.getAttribute("cx")||"0"),xs=ie?q+ie.y:parseFloat(xn.getAttribute("cy")||"0"),Rf=(ie==null?void 0:ie.radius)||parseFloat(xn.getAttribute("r")||"4"),vn=bt%ve;let ur,cr;if(vn>0&&Wn<vn)cr=0,ur=Wn;else{const En=Wn-(vn>0?vn:0);ur=En%ve,cr=Math.floor(En/ve)+(vn>0?1:0)}let vs=Fr+ur*ce;if(vn>0&&cr===0){const En=vn>1?(vn-1)*ce:0,Ef=(Xn-En)/2;vs=Fr+Ef+ur*ce}const bs=ha+cr*Yn;me.push({element:xn,startX:_s,startY:xs,startRadius:Rf,category:W.dataKey,segmentIndex:rt,endY:bs,endX:vs})})});const Ge=me.map(W=>{const rt=W.startX-D,pt=W.startY-q,bt=Math.atan2(pt,rt);return{...W,angle:bt}});Ge.sort((W,rt)=>rt.angle-W.angle);const sn=U*.8,Ye=.6,Fe=Ge.length,ye=sn/Math.max(Fe,1)*(Fe-1)+Ye,kt=U*.3,$t=ye;G.to(K,{opacity:1,duration:kt,ease:"power2.inOut"},`seatsToBar+=${$t}`),we&&(G.to(we.selectAll(".seat-line").nodes(),{opacity:0,duration:kt,ease:"power2.inOut"},`seatsToBar+=${$t}`),G.call(()=>{Vt()},[],`seatsToBar+=${$t+kt}`));const Mt=b.barSlideToTimeline/1e3;let Yt=null,_e=null;if(f){const rt=qn(a).ticks(6).tickPadding(12);p&&rt.tickFormat(bt=>p(bt.getTime())),Yt=e.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).attr("opacity",0),Yt.call(rt).selectAll("text").attr("font-size",h).attr("font-weight",500);const pt=In(s).ticks(5);pt.tickFormat(bt=>+bt==0?"":g?g(bt):String(bt)),_e=e.append("g").attr("class","axis axis-y").attr("opacity",0),_e.call(pt).selectAll("text").attr("font-size",h).attr("font-weight",500)}const Xt=b.crossFadePause/1e3,B=$t+kt+Xt;K.forEach(W=>{const rt=Array.from(W.classList).find(Bt=>Bt.startsWith("category-"));if(!rt||!nt.find(Bt=>Ae(Bt.dataKey)===rt.replace("category-","")))return;const bt=n.findIndex(Bt=>Ae(Bt.dataKey)===rt.replace("category-",""));if(bt===-1)return;const Jt=$i(t,n,$,s,l,bt,j,!1);Jt&&G.to(W,{attr:{d:Jt},duration:Mt,ease:"power2.out"},`seatsToBar+=${B}`)});const ct=is().x(W=>a(W.data.timestamp)).y0(W=>s(W[0])).y1(W=>s(W[1])).curve(Ar),ft=new Map;t.forEach((W,rt)=>{const pt=n[rt];if(pt){const bt=ct(W)||"";ft.set(pt.dataKey,bt)}});const wt=B+Mt;f&&Yt&&_e&&G.to([Yt.node(),_e.node()],{opacity:1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${B}`);const St=w.select(".grid-vertical"),zt=w.select(".grid-horizontal");if(!St.empty()||!zt.empty()){const rt=[];St.empty()||rt.push(St.node()),zt.empty()||rt.push(zt.node()),G.to(rt,{opacity:.1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${B}`)}const re=b.axesAndBarsGrow/1e3,le=b.barsToArea/1e3,ht=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",Lt=w.append("g").attr("class",ht);F.forEach(W=>{if(W===j)return;const rt=$.get(W);rt&&n.forEach((pt,bt)=>{const Jt=$i(t,n,$,s,l,bt,W,!0),Bt=$i(t,n,$,s,l,bt,W,!1);if(!Jt||!Bt)return;const Se=y?`histogram-path histogram-path-${y} category-${Ae(pt.dataKey)}`:`histogram-path category-${Ae(pt.dataKey)}`;Lt.append("path").attr("class",Se).attr("d",Jt).attr("fill",pt.color).attr("stroke",pt.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",pt.dataKey).attr("data-timestamp",W).attr("data-x-position",rt.x).attr("data-full-height-path",Bt)})});const ue=y?`.histogram-path-${y}`:".histogram-path",Ee=Lt.selectAll(ue);G.to(Ee.nodes(),{opacity:1,duration:.3,ease:"power2.inOut"},`seatsToBar+=${wt}`);const De=J.x+J.width/2;Ee.each(function(){var xe;const W=this.getAttribute("data-full-height-path");if(!W)return;const rt=parseFloat(this.getAttribute("data-x-position")||"0"),pt=parseFloat(this.getAttribute("data-timestamp")||"0"),bt=((xe=$.get(pt))==null?void 0:xe.width)||0,Jt=rt+bt/2,Se=Math.abs(Jt-De)*8e-4;G.to(this,{attr:{d:W},duration:re,ease:"power2.out"},`seatsToBar+=${wt+Se}`)});const Xe=wt+re,Ne=F[F.length-1],We=a(new Date(Ne))+et,ar=a.invert(We).getTime(),Or=t.map(W=>{const rt=W[W.length-1],pt={...rt,data:{...rt.data,timestamp:ar}};return[...W,pt]});Sc(e,Or,n,{xScale:a,yScale:s,addClasses:!0,instanceId:y});const Cf=y?`.area-${y}`:".area",sr=e.selectAll(Cf);sr.attr("opacity",0),G.to(Ee.nodes(),{opacity:0,duration:le,ease:"power2.inOut"},`seatsToBar+=${Xe}`);const ca=Q.selectAll("path").nodes();ca.length>0&&G.to(ca,{opacity:0,duration:le,ease:"power2.inOut"},`seatsToBar+=${Xe}`),G.to(sr.nodes(),{opacity:1,duration:le,ease:"power2.inOut"},`seatsToBar+=${Xe}`);const ys=c;R.getControls().getTimeline().eventCallback("onComplete",()=>{const W=y?`.morph-bar-${y}`:".morph-bar";e.selectAll(W).remove();const rt=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(rt).remove();const pt=y?`.seat-${y}`:".seat";e.selectAll(pt).style("pointer-events","none"),f&&(Yt&&Yt.attr("opacity",1),_e&&_e.attr("opacity",1)),ys()}),R.play()}function eT(e,t,n,r,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var Xt;const v=y?`.chart-content-group-${y}`:".chart-content-group";let _=e.select(v);if(_.empty()){const B=e.attr("clip-path"),ct=B?((Xt=B.match(/url\(#(.+)\)/))==null?void 0:Xt[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,ft=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";_=e.append("g").attr("class",ft).attr("clip-path",`url(#${ct})`)}const S=y?`.area-${y}`:".area",w=e.selectAll(S);if(w.size()===0){nT(e,n,r,o,l,y),c();return}const b={areaToBar:u*.18,barsShrink:u*.22,barSlide:u*.22,axesHide:u*.03,barToRings:u*.07,ringsExpand:u*.18,ringsHold:u*.05,ringsToSeats:u*.07},M=y?yr.get(y):void 0;M&&(M.destroy(),y&&yr.delete(y));const A=B=>B<.18?"areaToBar":B<.4?"barsShrink":B<.62?"barSlide":B<.65?"axesHide":B<.72?"barToRings":B<.9?"ringsExpand":B<.95?"ringsHold":"ringsToSeats",R=new B0({seatsToRings:b.ringsToSeats,ringsHold:b.ringsHold,ringsToBar:b.barToRings,axesReveal:b.axesHide,barSlide:b.barSlide,barsGrow:b.barsShrink,barsToArea:b.areaToBar},{onStageComplete:B=>{},onProgress:B=>{if(m){const ct=A(B);m(B,ct)}},onComplete:()=>{c()}});y&&yr.set(y,R),d&&d(R.getControls().getTimeline());const O=t[0].map(B=>B.data).map(B=>B.timestamp),D=x??Math.max(...O),N=new Map,H=[];O.forEach((B,ct)=>{const ft=a(new Date(B)),wt=O[ct+1];if(wt){const zt=a(new Date(wt))-ft;H.push(zt)}});const q=H.length>0?H.reduce((B,ct)=>B+ct,0)/H.length:30;O.forEach((B,ct)=>{const ft=a(new Date(B)),wt=O[ct+1],zt=ct===O.length-1?q:a(new Date(wt))-ft;N.set(B,{x:ft,width:zt})});const F=R.getControls().getTimeline(),j=b.areaToBar/1e3,$=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",it=_.append("g").attr("class",$);O.forEach(B=>{const ct=N.get(B);ct&&n.forEach((ft,wt)=>{const St=$i(t,n,N,s,l,wt,B,!1);if(!St)return;const zt=y?`histogram-path histogram-path-${y} category-${Ae(ft.dataKey)}`:`histogram-path category-${Ae(ft.dataKey)}`;it.append("path").attr("class",zt).attr("d",St).attr("fill",ft.color).attr("stroke",ft.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",ft.dataKey).attr("data-timestamp",B).attr("data-x-position",ct.x)})});const et=y?`.histogram-path-${y}`:".histogram-path",nt=it.selectAll(et);F.to(w.nodes(),{opacity:0,duration:j,ease:"power2.inOut"},"areaToBar"),F.to(nt.nodes(),{opacity:1,duration:j,ease:"power2.inOut"},"areaToBar");const J=b.barsShrink/1e3,lt=j;nt.each(function(){const B=parseFloat(this.getAttribute("data-timestamp")||"0");if(B===D)return;const ct=n.find(St=>this.classList.contains(`category-${Ae(St.dataKey)}`));if(!ct)return;const ft=n.indexOf(ct),wt=$i(t,n,N,s,l,ft,B,!0);wt&&F.to(this,{attr:{d:wt},duration:J,ease:"power2.in"},lt)});const I=b.axesHide/1e3,Q=lt+J;if(f){const B=e.select(".axis-x"),ct=e.select(".axis-y");B.empty()||F.to(B.node(),{opacity:0,duration:I,ease:"power2.inOut"},Q),ct.empty()||F.to(ct.node(),{opacity:0,duration:I,ease:"power2.inOut"},Q)}const at=_.select(".grid-vertical"),K=_.select(".grid-horizontal");at.empty()||F.to(at.node(),{opacity:0,duration:I,ease:"power2.inOut"},Q),K.empty()||F.to(K.node(),{opacity:0,duration:I,ease:"power2.inOut"},Q);const k=[];t.forEach((B,ct)=>{const ft=B.find(St=>St.data.timestamp===D);if(!ft)return;const wt=n[ct];wt&&k.push({category:wt.label,dataKey:wt.dataKey,color:wt.color,y0:ft[0],y1:ft[1]})}),k.sort((B,ct)=>ct.y0-B.y0);const z=k.reduce((B,ct)=>B+(ct.y1-ct.y0),0),E=r.radius-r.innerRadius,T=o/2,X=r.radius+10,V=l-r.radius*.3,G=Math.max(X,V),ut=E*.6,ot=l*.8,gt=G,yt=b.barSlide/1e3,vt=Q+I,tt=666,st=nt.nodes().filter(B=>parseFloat(B.getAttribute("data-timestamp")||"0")!==D);F.to(st,{opacity:0,duration:yt*.2,ease:"power2.out"},vt);const _t=nt.nodes().filter(B=>parseFloat(B.getAttribute("data-timestamp")||"0")===D);_t.forEach(B=>{const ct=B.getAttribute("data-category");if(!ct)return;const ft=k.find(Ee=>Ee.dataKey===ct);if(!ft)return;const zt=(ft.y1-ft.y0)/z*ot;let re=0;for(const Ee of n){const De=k.find(Rn=>Rn.dataKey===Ee.dataKey);if(!De)continue;if(De.dataKey===ft.dataKey)break;const Ne=(De.y1-De.y0)/z;re+=Ne*ot}const le=gt-re,ht=gt-re-zt,Lt=tt-ut/2,ue=`M ${Lt} ${le} L ${Lt} ${ht} L ${Lt+ut} ${ht} L ${Lt+ut} ${le} Z`;F.to(B,{attr:{d:ue},duration:yt,ease:"power2.inOut"},vt)});const dt=b.barToRings/1e3,xt=vt+yt,Et=b.ringsExpand/1e3,At=xt+dt,ee=b.ringsHold/1e3,ne=At+Et,Pt=b.ringsToSeats/1e3,ge=ne+ee,Vt=Math.max(...r.seats.map(B=>B.ring)),Zt=r.seats.filter(B=>B.ring===Vt),Rt=_.append("g").attr("class",`slinky-${y||"h2p-default"}`),It=()=>{Rt.remove()};Zt.forEach((B,ct)=>{const ft=n.find(wt=>wt.label===B.category);ft&&Rt.append("line").attr("class","slinky-ring").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0).attr("stroke",ft.color).attr("stroke-width",r.seatSize*2).attr("stroke-linecap","butt").attr("data-category",B.category).attr("data-category-index",B.categoryIndex).attr("data-ring-index",ct).attr("data-seat-x",T+B.x).attr("data-seat-y",G+B.y).attr("data-seat-angle",Math.atan2(B.y,B.x)).style("opacity",0)});const Re=Rt.selectAll(".slinky-ring").nodes(),Qt=tt,oe=ot/Re.length,we=[...Re].sort((B,ct)=>{const ft=parseFloat(B.getAttribute("data-seat-angle")||"0");return parseFloat(ct.getAttribute("data-seat-angle")||"0")-ft}),me=gt;we.forEach((B,ct)=>{const ft=me-ct*oe,St=ut/2,zt=Qt-St,re=Qt+St;B.setAttribute("x1",zt.toString()),B.setAttribute("y1",ft.toString()),B.setAttribute("x2",re.toString()),B.setAttribute("y2",ft.toString()),B.style.opacity="0"}),F.to(_t,{opacity:0,duration:dt*.7,ease:"power2.out"},xt+dt*.3),F.to(we,{opacity:1,duration:dt,ease:"power2.in",stagger:.005},xt);const Ge=E*.8;we.forEach((B,ct)=>{const ft=parseFloat(B.getAttribute("data-seat-x")||"0"),wt=parseFloat(B.getAttribute("data-seat-y")||"0"),St=parseFloat(B.getAttribute("data-seat-angle")||"0"),zt=(we.length-1-ct)/we.length*(Et*.4),re=parseFloat(B.getAttribute("x1")||"0"),le=parseFloat(B.getAttribute("y1")||"0"),ht=parseFloat(B.getAttribute("x2")||"0"),Lt=parseFloat(B.getAttribute("y2")||"0"),ue=(re+ht)/2,Ee=(le+Lt)/2,De=Math.atan2(Lt-le,ht-re),Xe=Math.sqrt(Math.pow(ht-re,2)+Math.pow(Lt-le,2)),Ne=ft-Ge/2*Math.cos(St),Rn=wt-Ge/2*Math.sin(St);F.to({progress:0},{progress:1,duration:Et*.7,ease:"power2.out",onUpdate:function(){const We=this.progress(),ln=ue+(Ne-ue)*We,ar=Ee+(Rn-Ee)*We,Or=De+(St-De)*We,sr=(Xe+(Ge-Xe)*We)/2,ca=ln-sr*Math.cos(Or),ys=ar-sr*Math.sin(Or),fa=ln+sr*Math.cos(Or),W=ar+sr*Math.sin(Or);B.setAttribute("x1",ca.toString()),B.setAttribute("y1",ys.toString()),B.setAttribute("x2",fa.toString()),B.setAttribute("y2",W.toString())}},At+zt),F.to(B,{opacity:.9,duration:Et*.3,ease:"power2.in"},At+zt)}),F.call(()=>{m&&m(F.progress(),"ringsHold")},[],ne);const sn=y?`parliament parliament-${y}`:"parliament",Ye=_.append("g").attr("class",sn);r.seats.forEach((B,ct)=>{const ft=n.find(ht=>ht.label===B.category);if(!ft)return;const wt=T+B.x,St=G+B.y;let zt,re,le;B.ring===Vt?(zt=wt,re=St,le=2):(zt=wt,re=St,le=B.radius),Ye.append("circle").attr("cx",zt).attr("cy",re).attr("r",le).attr("fill",ft.color).attr("stroke",ft.color).attr("stroke-width",.5).attr("opacity",0).attr("class",()=>y?`seat seat-${y} seat-${Ae(B.category)}`:`seat seat-${Ae(B.category)}`).attr("data-layout-index",ct).attr("data-ring",B.ring).attr("data-final-x",wt).attr("data-final-y",St).attr("data-final-r",B.radius)});const Fe=y?`.seat-${y}`:".seat",on=Ye.selectAll(Fe);F.to(Re,{opacity:0,duration:Pt*.2,ease:"power3.out"},ge),F.to(on.nodes(),{opacity:.8,duration:Pt*.3,ease:"power2.in"},ge+Pt*.25);const ye=on.nodes(),kt=[],$t=[];ye.forEach(B=>{parseInt(B.getAttribute("data-ring")||"0")===Vt?kt.push(B):$t.push(B)});const Mt=Pt*.2,Yt=Pt*.7;kt.forEach(B=>{const ct=parseFloat(B.getAttribute("data-final-r")||"4");F.to(B,{attr:{r:ct},opacity:1,duration:Yt*.6,ease:"power2.out"},ge+Mt)}),$t.length>0&&F.to($t,{opacity:1,duration:Yt*.5,ease:"power2.in"},ge+Mt+Pt*.15);const _e=c;R.getControls().getTimeline().eventCallback("onComplete",()=>{const B=y?`.areas-${y}`:".areas",ct=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(B).remove(),e.selectAll(ct).remove(),It(),e.selectAll(".axis-x").remove(),e.selectAll(".axis-y").remove(),_.selectAll(".grid-vertical").remove(),_.selectAll(".grid-horizontal").remove();const ft=y?`.parliament-label-${y}`:".parliament-label";if(e.select(ft).empty()){const St=o/2,zt=r.radius+10,re=l-r.radius*.3,le=Math.max(zt,re),ht=y?`parliament-label parliament-label-${y}`:"parliament-label",Lt=e.append("g").attr("class",ht).attr("transform",`translate(${St},${le-r.radius*.15})`).style("opacity","0").style("pointer-events","none");Lt.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),Lt.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const ue=Lt.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");ue.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),ue.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}_e()}),R.play()}function nT(e,t,n,r,i,a){const s=r/2,o=n.radius+10,l=i-n.radius*.3,u=Math.max(o,l);U0(e,n,t,{centerX:s,centerY:u,addClasses:!0,instanceId:a,parliamentRadius:n.radius})}function Li(e,t,n,r,i){const a=i?`.parliament-label-${i}`:".parliament-label",s=Ot(e).select(a);if(!s.empty())if(t){s.style("opacity","1"),s.select(".label-category").text(t.label).style("fill","#666");const o=t.value>1?"repos":"repo";s.select(".label-value").text(`${t.value} ${o}`).style("fill",t.color);const l=s.select(".scale-indicator");n?l.style("opacity","1").select("text").text(`= ~${r} repos`):l.style("opacity","0")}else s.style("opacity","0")}function Gs(e,t,n,r,i,a,s,o,l){const u=e.querySelectorAll(".seat");if(!u||u.length===0)return;const c=n[n.length-1];if(!c)return;const f=[];u.forEach(p=>{const g=p;g.style.cursor="pointer",g.style.transition="fill-opacity 150ms ease, stroke-opacity 150ms ease"}),u.forEach(p=>{const m=(p.getAttribute("class")||"").split(/\s+/).filter(S=>S.startsWith("seat-")),x=m[m.length-1];if(!x)return;const y=x.substring(5),v=t.find(S=>Ae(S.label)===y);if(!v)return;const _=()=>{i(v.label);const S=Math.round(c.values[v.dataKey]||0),w=hf(v.color),b={label:v.label,value:S,color:w};a&&a(b),Li(e,b,s??!1,o??1,l),qi(e,v.label)};p.addEventListener("mouseenter",_),f.push({element:p,handler:_})});const h=()=>{i(null),a&&a(null),Li(e,null,!1,1,l),qi(e,null)};return e.addEventListener("mouseleave",h),r&&qi(e,r),()=>{f.forEach(({element:p,handler:g})=>{p.removeEventListener("mouseenter",g)}),e.removeEventListener("mouseleave",h),u.forEach(p=>{const g=p;g.style.cursor="",g.style.transition=""})}}function qi(e,t){const n=e.querySelectorAll(".seat"),r=t?Ae(t):null;n.forEach(i=>{const a=i,l=(i.getAttribute("class")||"").split(/\s+/).filter(f=>f.startsWith("seat-")),u=l[l.length-1];if(!u)return;const c=u.substring(5);r?c===r?(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1")):(a.setAttribute("fill-opacity","0.3"),a.setAttribute("stroke-opacity","0.2")):(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1"))})}const j0=({data:e,categories:t,mode:n,width:r=900,height:i=400,margin:a={top:10,right:30,bottom:40,left:60},timeRange:s,showGrid:o=!0,showAxes:l=!0,axisLabelColor:u,axisLabelSize:c=14,formatDate:f,formatValue:h,markers:p=[],arcAngle:g=200,parliamentRadius:d=200,seatSize:m=4.5,animationDuration:x=900,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:w,hoveredCategory:b,maxSeats:M=500,showTooltip:A=!0,showTable:R=!1,showScaledIndicator:C=!0,parliamentTimestamp:O,enableBrush:D=!1,onTimeRangeChange:N,minAllowedTime:H,maxAllowedTime:q,timelineEvents:F=[],showTimeline:j=!1,timelineHeight:$=40,timelineOffset:it,brushColor:et="#69b3a2",showCrosshair:nt=!1,crosshairColor:J="#666",crosshairDashArray:lt="4,4"})=>{const I=Y.useRef(null),[Q,at]=Y.useState(null),K=Y.useCallback(tt=>{w&&w(tt)},[w]),k=12,E=it??6+k+c+k,T=e[e.length-1],X=T?t.reduce((tt,st)=>tt+(T.values[st.dataKey]||0),0):0,V=X>M,G=V?Math.round(X/M):1,ut=j&&n==="stacked-area"?i+$+E:i,{isMorphing:U,currentMode:ot,visibleMarkers:gt,hoveredMarker:yt,hoveredTimelineEvent:vt}=ZS({containerRef:I,data:e,categories:t,mode:n,width:r,height:i,margin:a,timeRange:s,showGrid:o,showAxes:l,axisLabelColor:u,axisLabelSize:c,formatDate:f,formatValue:h,markers:p,arcAngle:g,parliamentRadius:d,seatSize:m,animationDuration:x,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:K,hoveredCategory:b,maxSeats:M,parliamentTimestamp:O,enableBrush:D,onTimeRangeChange:N,minAllowedTime:H,maxAllowedTime:q,showScaleIndicator:C&&V,reposPerSeat:G,timelineEvents:F,showTimeline:j,timelineHeight:$,timelineOffset:E,brushColor:et,showCrosshair:nt,onCrosshairMove:nt?at:void 0});return P.jsxs(L.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[P.jsx("svg",{ref:I,viewBox:`0 0 ${r} ${ut}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),nt&&Q&&ot==="area"&&!U&&P.jsxs("svg",{viewBox:`0 0 ${r} ${ut}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,width:"100%",height:"auto",pointerEvents:"none"},children:[P.jsx("line",{x1:Q.x,y1:a.top,x2:Q.x,y2:i-a.bottom,stroke:J,strokeDasharray:lt,strokeWidth:1}),P.jsx("line",{x1:a.left,y1:Q.y,x2:r-a.right,y2:Q.y,stroke:J,strokeDasharray:lt,strokeWidth:1})]}),ot==="area"&>.map(tt=>{const st=(tt.x+a.left)/r*100,_t=a.top/i*100,dt=new Date(tt.timestamp),xt=f?f(tt.timestamp):dt.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),Et=P.jsxs(L.Box,{children:[P.jsx(L.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:tt.label?.5:0},children:xt}),tt.label&&P.jsx(L.Box,{sx:{color:"white",fontWeight:500},children:tt.label})]});return P.jsx(L.Tooltip,{title:Et,open:(yt==null?void 0:yt.timestamp)===tt.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:P.jsx(L.Box,{sx:{position:"absolute",left:`${st}%`,top:`${_t}%`,width:"1px",height:`${(i-a.top-a.bottom)/i*100}%`,pointerEvents:"none"}})},tt.timestamp)}),vt&&ot==="area"&&P.jsx(L.Tooltip,{title:P.jsxs(L.Box,{children:[P.jsx(L.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:f?f(vt.timestamp):new Date(vt.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),P.jsx(L.Box,{sx:{color:"white",fontWeight:500},children:vt.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:P.jsx(L.Box,{sx:{position:"absolute",left:`${(vt.x+a.left)/r*100}%`,top:`${(i+E+$/2)/ut*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})}),U&&P.jsxs(L.Box,{sx:{position:"absolute",top:8,right:8,padding:"4px 8px",backgroundColor:"rgba(0,0,0,0.7)",color:"white",borderRadius:"4px",fontSize:"12px",pointerEvents:"none",display:"none"},children:["Morphing: ",ot," → ",n]})]})},G0=[{minRepos:0,maxRepos:10,minArc:90,maxArc:90,minSeatSize:28,maxSeatSize:28},{minRepos:10,maxRepos:25,minArc:90,maxArc:110,minSeatSize:24,maxSeatSize:24},{minRepos:25,maxRepos:50,minArc:110,maxArc:120,minSeatSize:20,maxSeatSize:20},{minRepos:50,maxRepos:100,minArc:120,maxArc:150,minSeatSize:16.5,maxSeatSize:16.5},{minRepos:100,maxRepos:200,minArc:150,maxArc:180,minSeatSize:15,maxSeatSize:15},{minRepos:200,maxRepos:1/0,minArc:180,maxArc:180,minSeatSize:14.5,maxSeatSize:14.5}],pf=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 180;if(t.minArc===t.maxArc)return t.minArc;const n=t.maxRepos-t.minRepos,i=(e-t.minRepos)/n,a=t.maxArc-t.minArc,s=t.minArc+a*i;return Math.round(s)},df=({repositoryCount:e})=>{const t=G0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 6.5;if(t.minSeatSize===t.maxSeatSize)return t.minSeatSize;const n=t.maxRepos-t.minRepos,i=(e-t.minRepos)/n,a=t.maxSeatSize-t.minSeatSize,s=t.minSeatSize+a*i;return Math.round(s*10)/10};class ra{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ra.prototype.normal={};ra.prototype.property={};ra.prototype.space=void 0;function Y0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ra(n,r,t)}function Ji(e){return e.toLowerCase()}class je{constructor(t,n){this.attribute=n,this.property=t}}je.prototype.attribute="";je.prototype.booleanish=!1;je.prototype.boolean=!1;je.prototype.commaOrSpaceSeparated=!1;je.prototype.commaSeparated=!1;je.prototype.defined=!1;je.prototype.mustUseProperty=!1;je.prototype.number=!1;je.prototype.overloadedBoolean=!1;je.prototype.property="";je.prototype.spaceSeparated=!1;je.prototype.space=void 0;let rT=0;const mt=Er(),ae=Er(),Tc=Er(),Z=Er(),qt=Er(),Vr=Er(),Ve=Er();function Er(){return 2**++rT}const Mc=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:ae,commaOrSpaceSeparated:Ve,commaSeparated:Vr,number:Z,overloadedBoolean:Tc,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),Ys=Object.keys(Mc);class gf extends je{constructor(t,n,r,i){let a=-1;if(super(t,n),qh(this,"space",i),typeof r=="number")for(;++a<Ys.length;){const s=Ys[a];qh(this,Ys[a],(r&Mc[s])===Mc[s])}}}gf.prototype.defined=!0;function qh(e,t,n){n&&(e[t]=n)}function pi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new gf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ji(r)]=r,n[Ji(a.attribute)]=r}return new ra(t,n,e.space)}const X0=pi({properties:{ariaActiveDescendant:null,ariaAtomic:ae,ariaAutoComplete:null,ariaBusy:ae,ariaChecked:ae,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:ae,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:ae,ariaFlowTo:qt,ariaGrabbed:ae,ariaHasPopup:null,ariaHidden:ae,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:Z,ariaLive:null,ariaModal:ae,ariaMultiLine:ae,ariaMultiSelectable:ae,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:ae,ariaReadOnly:ae,ariaRelevant:null,ariaRequired:ae,ariaRoleDescription:qt,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:ae,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function W0(e,t){return t in e?e[t]:t}function K0(e,t){return W0(e,t.toLowerCase())}const iT=pi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vr,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:qt,autoFocus:mt,autoPlay:mt,blocking:qt,capture:null,charSet:null,checked:mt,cite:null,className:qt,cols:Z,colSpan:null,content:null,contentEditable:ae,controls:mt,controlsList:qt,coords:Z|Vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:Tc,draggable:ae,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:qt,height:Z,hidden:Tc,high:Z,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:qt,itemRef:qt,itemScope:mt,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mt,optimum:Z,pattern:null,ping:qt,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:qt,required:mt,reversed:mt,rows:Z,rowSpan:Z,sandbox:qt,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:ae,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:ae,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:ae,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:K0}),aT=pi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ve,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vr,g2:Vr,glyphName:Vr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Ve,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ve,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ve,rev:Ve,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ve,requiredFeatures:Ve,requiredFonts:Ve,requiredFormats:Ve,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Ve,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ve,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ve,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:W0}),V0=pi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Z0=pi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:K0}),Q0=pi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),sT=/[A-Z]/g,Ih=/-[a-z]/g,oT=/^data[-\w.:]+$/i;function J0(e,t){const n=Ji(t);let r=t,i=je;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oT.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ih,uT);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ih.test(a)){let s=a.replace(sT,lT);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=gf}return new i(r,t)}function lT(e){return"-"+e.toLowerCase()}function uT(e){return e.charAt(1).toUpperCase()}const ty=Y0([X0,iT,V0,Z0,Q0],"html"),mf=Y0([X0,aT,V0,Z0,Q0],"svg");function zh(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function cT(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Bh=/[#.]/g;function fT(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Bh.lastIndex=i;const o=Bh.exec(n),l=n.slice(i,o?o.index:n.length);l&&(a?a==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function Uh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function hT(e){return e.join(" ").trim()}function ey(e,t,n){const r=n?mT(n):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=fT(a,t);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,pT(s))o.unshift(s);else for(const[f,h]of Object.entries(s))dT(e,l.properties,f,h)}for(const u of o)Ac(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function pT(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function dT(e,t,n,r){const i=J0(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=Uh(r):i.commaSeparated?a=zh(r):i.commaOrSpaceSeparated?a=Uh(zh(r).join(" ")):a=Hh(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?gT(r):String(r);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Hh(i,i.property,o));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Ac(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Ac(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Ac(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Hh(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Ji(n)===Ji(t)))return!0}return n}function gT(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function mT(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const yT=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"];ey(ty,"div");const ia=ey(mf,"g",yT),ny=(e=ia)=>e("pattern",{id:"greyHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:pn.neoGrey[200]}),e("path",{d:"M0,2 L8,2",stroke:pn.neoGrey[400],"stroke-width":.5}),e("path",{d:"M0,6 L8,6",stroke:pn.neoGrey[400],"stroke-width":.5})]),ry=(e=ia)=>e("pattern",{id:"dataMissingHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFF3CC"}),e("path",{d:"M0,8 L8,0",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M-2,2 L2,-2",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M6,10 L10,6",stroke:"#FFB800","stroke-width":.5})]),iy=(e=ia)=>e("pattern",{id:"noLstHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFE5E5"}),e("path",{d:"M0,0 L8,8",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M-2,6 L2,10",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M6,-2 L10,2",stroke:"#ED4134","stroke-width":.5})]),Dt={greyHatch:{background:pn.neoGrey[200],lines:pn.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}},_T=({categories:e,activeCategory:t,onCategoryHover:n,mode:r,visible:i=!0})=>P.jsx(L.Box,{className:"category-table",sx:{width:"100%",display:"flex",justifyContent:"center",opacity:i?1:0,transition:"opacity 0.3s ease-in-out","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>n(null),children:P.jsxs(L.Table,{"aria-label":"Categories summary",className:"category-summary-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[P.jsx("thead",{children:P.jsxs(L.TableRow,{children:[P.jsx(L.TableCell,{}),P.jsx(L.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),r==="point-in-time"?P.jsxs(P.Fragment,{children:[P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"#"}),P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"%"})]}):P.jsxs(P.Fragment,{children:[P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Last"}),P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Max"}),P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Min"})]})]})}),P.jsx("tbody",{children:e.map(a=>{const s=a.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:a.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:a.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:a.color;return P.jsxs(L.TableRow,{onMouseEnter:()=>n(a.id),sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:t===a.id?`${s}15`:"transparent","&:hover":{backgroundColor:`${s}15`}},children:[P.jsx(L.TableCell,{align:"center",sx:{width:20},children:P.jsx(L.Box,{sx:{width:r==="historical"?4:12,height:12,backgroundColor:a.color==="url(#greyHatchPattern)"?Dt.greyHatch.background:a.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.background:a.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.background:a.color,borderRadius:r==="historical"?2:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:t===a.id?"scale(1.2)":"scale(1)",...a.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
15
|
+
*/var kh,Zn,Kr,uf,yr,Ch,cf,bS=function(){return typeof window<"u"},jn={},gr=180/Math.PI,Vr=Math.PI/180,Ir=Math.atan2,Rh=1e8,ff=/([A-Z])/g,wS=/(left|right|width|margin|padding|x)/i,SS=/[\s,\(]\S/,Tn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},xc=function(t,n){return n.set(n.t,n.p,Math.round((n.s+n.c*t)*1e4)/1e4+n.u,n)},TS=function(t,n){return n.set(n.t,n.p,t===1?n.e:Math.round((n.s+n.c*t)*1e4)/1e4+n.u,n)},MS=function(t,n){return n.set(n.t,n.p,t?Math.round((n.s+n.c*t)*1e4)/1e4+n.u:n.b,n)},AS=function(t,n){return n.set(n.t,n.p,t===1?n.e:t?Math.round((n.s+n.c*t)*1e4)/1e4+n.u:n.b,n)},kS=function(t,n){var r=n.s+n.c*t;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},D0=function(t,n){return n.set(n.t,n.p,t?n.e:n.b,n)},O0=function(t,n){return n.set(n.t,n.p,t!==1?n.b:n.e,n)},CS=function(t,n,r){return t.style[n]=r},RS=function(t,n,r){return t.style.setProperty(n,r)},ES=function(t,n,r){return t._gsap[n]=r},DS=function(t,n,r){return t._gsap.scaleX=t._gsap.scaleY=r},OS=function(t,n,r,i,a){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(a,s)},PS=function(t,n,r,i,a){var s=t._gsap;s[n]=r,s.renderTransform(a,s)},Gt="transform",Ue=Gt+"Origin",FS=function e(t,n){var r=this,i=this.target,a=i.style,s=i._gsap;if(t in jn&&a){if(this.tfm=this.tfm||{},t!=="transform")t=Tn[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return r.tfm[o]=$n(i,o)}):this.tfm[t]=s.x?s[t]:$n(i,t),t===Ue&&(this.tfm.zOrigin=s.zOrigin);else return Tn.transform.split(",").forEach(function(o){return e.call(r,o,n)});if(this.props.indexOf(Gt)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ue,n,"")),t=Gt}(a||n)&&this.props.push(t,n,a[t])},P0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},$S=function(){var t=this.props,n=this.target,r=n.style,i=n._gsap,a,s;for(a=0;a<t.length;a+=3)t[a+1]?t[a+1]===2?n[t[a]](t[a+2]):n[t[a]]=t[a+2]:t[a+2]?r[t[a]]=t[a+2]:r.removeProperty(t[a].substr(0,2)==="--"?t[a]:t[a].replace(ff,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)i[s]=this.tfm[s];i.svg&&(i.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),a=cf(),(!a||!a.isStart)&&!r[Gt]&&(P0(r),i.zOrigin&&r[Ue]&&(r[Ue]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},F0=function(t,n){var r={target:t,props:[],revert:$S,save:FS};return t._gsap||He.core.getCache(t),n&&t.style&&t.nodeType&&n.split(",").forEach(function(i){return r.save(i)}),r},$0,vc=function(t,n){var r=Zn.createElementNS?Zn.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Zn.createElement(t);return r&&r.style?r:Zn.createElement(t)},tn=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(ff,"-$1").toLowerCase())||i.getPropertyValue(n)||!r&&e(t,fi(n)||n,1)||""},Eh="O,Moz,ms,Ms,Webkit".split(","),fi=function(t,n,r){var i=n||yr,a=i.style,s=5;if(t in a&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);s--&&!(Eh[s]+t in a););return s<0?null:(s===3?"ms":s>=0?Eh[s]:"")+t},bc=function(){bS()&&window.document&&(kh=window,Zn=kh.document,Kr=Zn.documentElement,yr=vc("div")||{style:{}},vc("div"),Gt=fi(Gt),Ue=Gt+"Origin",yr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",$0=!!fi("perspective"),cf=He.core.reverting,uf=1)},Dh=function(t){var n=t.ownerSVGElement,r=vc("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0),a;i.style.display="block",r.appendChild(i),Kr.appendChild(r);try{a=i.getBBox()}catch{}return r.removeChild(i),Kr.removeChild(r),a},Oh=function(t,n){for(var r=n.length;r--;)if(t.hasAttribute(n[r]))return t.getAttribute(n[r])},L0=function(t){var n,r;try{n=t.getBBox()}catch{n=Dh(t),r=1}return n&&(n.width||n.height)||r||(n=Dh(t)),n&&!n.width&&!n.x&&!n.y?{x:+Oh(t,["x","cx","x1"])||0,y:+Oh(t,["y","cy","y1"])||0,width:0,height:0}:n},N0=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&L0(t))},rr=function(t,n){if(n){var r=t.style,i;n in jn&&n!==Ue&&(n=Gt),r.removeProperty?(i=n.substr(0,2),(i==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(i==="--"?n:n.replace(ff,"-$1").toLowerCase())):r.removeAttribute(n)}},Qn=function(t,n,r,i,a,s){var o=new Be(t._pt,n,r,0,1,s?O0:D0);return t._pt=o,o.b=i,o.e=a,t._props.push(r),o},Ph={deg:1,rad:1,turn:1},LS={grid:1,flex:1},ir=function e(t,n,r,i){var a=parseFloat(r)||0,s=(r+"").trim().substr((a+"").length)||"px",o=yr.style,l=wS.test(n),u=t.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),f=100,h=i==="px",p=i==="%",g,d,m,x;if(i===s||!a||Ph[i]||Ph[s])return a;if(s!=="px"&&!h&&(a=e(t,n,r,"px")),x=t.getCTM&&N0(t),(p||s==="%")&&(jn[n]||~n.indexOf("adius")))return g=x?t.getBBox()[l?"width":"height"]:t[c],te(p?a/g*f:a/100*g);if(o[l?"width":"height"]=f+(h?s:i),d=i!=="rem"&&~n.indexOf("adius")||i==="em"&&t.appendChild&&!u?t:t.parentNode,x&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===Zn||!d.appendChild)&&(d=Zn.body),m=d._gsap,m&&p&&m.width&&l&&m.time===Qe.time&&!m.uncache)return te(a/m.width*f);if(p&&(n==="height"||n==="width")){var y=t.style[n];t.style[n]=f+i,g=t[c],y?t.style[n]=y:rr(t,n)}else(p||s==="%")&&!LS[tn(d,"display")]&&(o.position=tn(t,"position")),d===t&&(o.position="static"),d.appendChild(yr),g=yr[c],d.removeChild(yr),o.position="absolute";return l&&p&&(m=vr(d),m.time=Qe.time,m.width=d[c]),te(h?g*a/f:g&&a?f/g*a:0)},$n=function(t,n,r,i){var a;return uf||bc(),n in Tn&&n!=="transform"&&(n=Tn[n],~n.indexOf(",")&&(n=n.split(",")[0])),jn[n]&&n!=="transform"?(a=Ji(t,i),a=n!=="transformOrigin"?a[n]:a.svg?a.origin:Za(tn(t,Ue))+" "+a.zOrigin+"px"):(a=t.style[n],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=Va[n]&&Va[n](t,n,r)||tn(t,n)||Jm(t,n)||(n==="opacity"?1:0))),r&&!~(a+"").trim().indexOf(" ")?ir(t,n,a,r)+r:a},NS=function(t,n,r,i){if(!r||r==="none"){var a=fi(n,t,1),s=a&&tn(t,a,1);s&&s!==r?(n=a,r=s):n==="borderColor"&&(r=tn(t,"borderTopColor"))}var o=new Be(this._pt,t.style,n,0,1,C0),l=0,u=0,c,f,h,p,g,d,m,x,y,v,_,S;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=tn(t,i.substring(4,i.indexOf(")")))),i==="auto"&&(d=t.style[n],t.style[n]=i,i=tn(t,n)||i,d?t.style[n]=d:rr(t,n)),c=[r,i],_0(c),r=c[0],i=c[1],h=r.match(jr)||[],S=i.match(jr)||[],S.length){for(;f=jr.exec(i);)m=f[0],y=i.substring(l,f.index),g?g=(g+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(g=1),m!==(d=h[u++]||"")&&(p=parseFloat(d)||0,_=d.substr((p+"").length),m.charAt(1)==="="&&(m=Xr(p,m)+_),x=parseFloat(m),v=m.substr((x+"").length),l=jr.lastIndex-v.length,v||(v=v||en.units[n]||_,l===i.length&&(i+=v,o.e+=v)),_!==v&&(p=ir(t,n,d,v)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:p,c:x-p,m:g&&g<4||n==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=n==="display"&&i==="none"?O0:D0;return Xm.test(i)&&(o.e=0),this._pt=o,o},Fh={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},qS=function(t){var n=t.split(" "),r=n[0],i=n[1]||"50%";return(r==="top"||r==="bottom"||i==="left"||i==="right")&&(t=r,r=i,i=t),n[0]=Fh[r]||r,n[1]=Fh[i]||i,n.join(" ")},IS=function(t,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,i=r.style,a=n.u,s=r._gsap,o,l,u;if(a==="all"||a===!0)i.cssText="",l=1;else for(a=a.split(","),u=a.length;--u>-1;)o=a[u],jn[o]&&(l=1,o=o==="transformOrigin"?Ue:Gt),rr(r,o);l&&(rr(r,Gt),s&&(s.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Ji(r,1),s.uncache=1,P0(i)))}},Va={clearProps:function(t,n,r,i,a){if(a.data!=="isFromStart"){var s=t._pt=new Be(t._pt,n,r,0,0,IS);return s.u=i,s.pr=-10,s.tween=a,t._props.push(r),1}}},Qi=[1,0,0,1,0,0],q0={},I0=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},$h=function(t){var n=tn(t,Gt);return I0(n)?Qi:n.substr(7).match(Wm).map(te)},hf=function(t,n){var r=t._gsap||vr(t),i=t.style,a=$h(t),s,o,l,u;return r.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,a=[l.a,l.b,l.c,l.d,l.e,l.f],a.join(",")==="1,0,0,1,0,0"?Qi:a):(a===Qi&&!t.offsetParent&&t!==Kr&&!r.svg&&(l=i.display,i.display="block",s=t.parentNode,(!s||!t.offsetParent&&!t.getBoundingClientRect().width)&&(u=1,o=t.nextElementSibling,Kr.appendChild(t)),a=$h(t),l?i.display=l:rr(t,"display"),u&&(o?s.insertBefore(t,o):s?s.appendChild(t):Kr.removeChild(t))),n&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},wc=function(t,n,r,i,a,s){var o=t._gsap,l=a||hf(t,!0),u=o.xOrigin||0,c=o.yOrigin||0,f=o.xOffset||0,h=o.yOffset||0,p=l[0],g=l[1],d=l[2],m=l[3],x=l[4],y=l[5],v=n.split(" "),_=parseFloat(v[0])||0,S=parseFloat(v[1])||0,w,b,M,A;r?l!==Qi&&(b=p*m-g*d)&&(M=_*(m/b)+S*(-d/b)+(d*y-m*x)/b,A=_*(-g/b)+S*(p/b)-(p*y-g*x)/b,_=M,S=A):(w=L0(t),_=w.x+(~v[0].indexOf("%")?_/100*w.width:_),S=w.y+(~(v[1]||v[0]).indexOf("%")?S/100*w.height:S)),i||i!==!1&&o.smooth?(x=_-u,y=S-c,o.xOffset=f+(x*p+y*d)-x,o.yOffset=h+(x*g+y*m)-y):o.xOffset=o.yOffset=0,o.xOrigin=_,o.yOrigin=S,o.smooth=!!i,o.origin=n,o.originIsAbsolute=!!r,t.style[Ue]="0px 0px",s&&(Qn(s,o,"xOrigin",u,_),Qn(s,o,"yOrigin",c,S),Qn(s,o,"xOffset",f,o.xOffset),Qn(s,o,"yOffset",h,o.yOffset)),t.setAttribute("data-svg-origin",_+" "+S)},Ji=function(t,n){var r=t._gsap||new w0(t);if("x"in r&&!n&&!r.uncache)return r;var i=t.style,a=r.scaleX<0,s="px",o="deg",l=getComputedStyle(t),u=tn(t,Ue)||"0",c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,A,k,C,O,P,F,B,L,$,Y,I,et,K,J,st,lt,N;return c=f=h=d=m=x=y=v=_=0,p=g=1,r.svg=!!(t.getCTM&&N0(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Gt]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Gt]!=="none"?l[Gt]:"")),i.scale=i.rotate=i.translate="none"),b=hf(t,r.svg),r.svg&&(r.uncache?(Y=t.getBBox(),u=r.xOrigin-Y.x+"px "+(r.yOrigin-Y.y)+"px",$=""):$=!n&&t.getAttribute("data-svg-origin"),wc(t,$||u,!!$||r.originIsAbsolute,r.smooth!==!1,b)),S=r.xOrigin||0,w=r.yOrigin||0,b!==Qi&&(C=b[0],O=b[1],P=b[2],F=b[3],c=B=b[4],f=L=b[5],b.length===6?(p=Math.sqrt(C*C+O*O),g=Math.sqrt(F*F+P*P),d=C||O?Ir(O,C)*gr:0,y=P||F?Ir(P,F)*gr+d:0,y&&(g*=Math.abs(Math.cos(y*Vr))),r.svg&&(c-=S-(S*C+w*P),f-=w-(S*O+w*F))):(N=b[6],st=b[7],et=b[8],K=b[9],J=b[10],lt=b[11],c=b[12],f=b[13],h=b[14],M=Ir(N,J),m=M*gr,M&&(A=Math.cos(-M),k=Math.sin(-M),$=B*A+et*k,Y=L*A+K*k,I=N*A+J*k,et=B*-k+et*A,K=L*-k+K*A,J=N*-k+J*A,lt=st*-k+lt*A,B=$,L=Y,N=I),M=Ir(-P,J),x=M*gr,M&&(A=Math.cos(-M),k=Math.sin(-M),$=C*A-et*k,Y=O*A-K*k,I=P*A-J*k,lt=F*k+lt*A,C=$,O=Y,P=I),M=Ir(O,C),d=M*gr,M&&(A=Math.cos(M),k=Math.sin(M),$=C*A+O*k,Y=B*A+L*k,O=O*A-C*k,L=L*A-B*k,C=$,B=Y),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,x=180-x),p=te(Math.sqrt(C*C+O*O+P*P)),g=te(Math.sqrt(L*L+N*N)),M=Ir(B,L),y=Math.abs(M)>2e-4?M*gr:0,_=lt?1/(lt<0?-lt:lt):0),r.svg&&($=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!I0(tn(t,Gt)),$&&t.setAttribute("transform",$))),Math.abs(y)>90&&Math.abs(y)<270&&(a?(p*=-1,y+=d<=0?180:-180,d+=d<=0?180:-180):(g*=-1,y+=y<=0?180:-180)),n=n||r.uncache,r.x=c-((r.xPercent=c&&(!n&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+s,r.y=f-((r.yPercent=f&&(!n&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+s,r.z=h+s,r.scaleX=te(p),r.scaleY=te(g),r.rotation=te(d)+o,r.rotationX=te(m)+o,r.rotationY=te(x)+o,r.skewX=y+o,r.skewY=v+o,r.transformPerspective=_+s,(r.zOrigin=parseFloat(u.split(" ")[2])||!n&&r.zOrigin||0)&&(i[Ue]=Za(u)),r.xOffset=r.yOffset=0,r.force3D=en.force3D,r.renderTransform=r.svg?BS:$0?z0:zS,r.uncache=0,r},Za=function(t){return(t=t.split(" "))[0]+" "+t[1]},js=function(t,n,r){var i=ke(n);return te(parseFloat(n)+parseFloat(ir(t,"x",r+"px",i)))+i},zS=function(t,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,z0(t,n)},hr="0deg",wi="0px",pr=") ",z0=function(t,n){var r=n||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.z,u=r.rotation,c=r.rotationY,f=r.rotationX,h=r.skewX,p=r.skewY,g=r.scaleX,d=r.scaleY,m=r.transformPerspective,x=r.force3D,y=r.target,v=r.zOrigin,_="",S=x==="auto"&&t&&t!==1||x===!0;if(v&&(f!==hr||c!==hr)){var w=parseFloat(c)*Vr,b=Math.sin(w),M=Math.cos(w),A;w=parseFloat(f)*Vr,A=Math.cos(w),s=js(y,s,b*A*-v),o=js(y,o,-Math.sin(w)*-v),l=js(y,l,M*A*-v+v)}m!==wi&&(_+="perspective("+m+pr),(i||a)&&(_+="translate("+i+"%, "+a+"%) "),(S||s!==wi||o!==wi||l!==wi)&&(_+=l!==wi||S?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+pr),u!==hr&&(_+="rotate("+u+pr),c!==hr&&(_+="rotateY("+c+pr),f!==hr&&(_+="rotateX("+f+pr),(h!==hr||p!==hr)&&(_+="skew("+h+", "+p+pr),(g!==1||d!==1)&&(_+="scale("+g+", "+d+pr),y.style[Gt]=_||"translate(0, 0)"},BS=function(t,n){var r=n||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.rotation,u=r.skewX,c=r.skewY,f=r.scaleX,h=r.scaleY,p=r.target,g=r.xOrigin,d=r.yOrigin,m=r.xOffset,x=r.yOffset,y=r.forceCSS,v=parseFloat(s),_=parseFloat(o),S,w,b,M,A;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=Vr,u*=Vr,S=Math.cos(l)*f,w=Math.sin(l)*f,b=Math.sin(l-u)*-h,M=Math.cos(l-u)*h,u&&(c*=Vr,A=Math.tan(u-c),A=Math.sqrt(1+A*A),b*=A,M*=A,c&&(A=Math.tan(c),A=Math.sqrt(1+A*A),S*=A,w*=A)),S=te(S),w=te(w),b=te(b),M=te(M)):(S=f,M=h,w=b=0),(v&&!~(s+"").indexOf("px")||_&&!~(o+"").indexOf("px"))&&(v=ir(p,"x",s,"px"),_=ir(p,"y",o,"px")),(g||d||m||x)&&(v=te(v+g-(g*S+d*b)+m),_=te(_+d-(g*w+d*M)+x)),(i||a)&&(A=p.getBBox(),v=te(v+i/100*A.width),_=te(_+a/100*A.height)),A="matrix("+S+","+w+","+b+","+M+","+v+","+_+")",p.setAttribute("transform",A),y&&(p.style[Gt]=A)},US=function(t,n,r,i,a){var s=360,o=pe(a),l=parseFloat(a)*(o&&~a.indexOf("rad")?gr:1),u=l-i,c=i+u+"deg",f,h;return o&&(f=a.split("_")[1],f==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),f==="cw"&&u<0?u=(u+s*Rh)%s-~~(u/s)*s:f==="ccw"&&u>0&&(u=(u-s*Rh)%s-~~(u/s)*s)),t._pt=h=new Be(t._pt,n,r,i,u,TS),h.e=c,h.u="deg",t._props.push(r),h},Lh=function(t,n){for(var r in n)t[r]=n[r];return t},HS=function(t,n,r){var i=Lh({},r._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=r.style,o,l,u,c,f,h,p,g;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),s[Gt]=n,o=Ji(r,1),rr(r,Gt),r.setAttribute("transform",u)):(u=getComputedStyle(r)[Gt],s[Gt]=n,o=Ji(r,1),s[Gt]=u);for(l in jn)u=i[l],c=o[l],u!==c&&a.indexOf(l)<0&&(p=ke(u),g=ke(c),f=p!==g?ir(r,l,u,g):parseFloat(u),h=parseFloat(c),t._pt=new Be(t._pt,o,l,f,h-f,xc),t._pt.u=g||0,t._props.push(l));Lh(o,i)};ze("padding,margin,Width,Radius",function(e,t){var n="Top",r="Right",i="Bottom",a="Left",s=(t<3?[n,r,i,a]:[n+a,n+r,i+r,i+a]).map(function(o){return t<2?e+o:"border"+o+e});Va[t>1?"border"+e:e]=function(o,l,u,c,f){var h,p;if(arguments.length<4)return h=s.map(function(g){return $n(o,g,u)}),p=h.join(" "),p.split(h[0]).length===5?h[0]:p;h=(c+"").split(" "),p={},s.forEach(function(g,d){return p[g]=h[d]=h[d]||h[(d-1)/2|0]}),o.init(l,p,f)}});var B0={name:"css",register:bc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,n,r,i,a){var s=this._props,o=t.style,l=r.vars.startAt,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,A;uf||bc(),this.styles=this.styles||F0(t),M=this.styles.props,this.tween=r;for(d in n)if(d!=="autoRound"&&(c=n[d],!(Ze[d]&&S0(d,n,r,i,t,a)))){if(p=typeof c,g=Va[d],p==="function"&&(c=c.call(r,i,t,a),p=typeof c),p==="string"&&~c.indexOf("random(")&&(c=Ki(c)),g)g(this,t,d,c,r)&&(b=1);else if(d.substr(0,2)==="--")u=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",tr.lastIndex=0,tr.test(u)||(m=ke(u),x=ke(c),x?m!==x&&(u=ir(t,d,u,x)+x):m&&(c+=m)),this.add(o,"setProperty",u,c,i,a,0,0,d),s.push(d),M.push(d,0,o[d]);else if(p!=="undefined"){if(l&&d in l?(u=typeof l[d]=="function"?l[d].call(r,i,t,a):l[d],pe(u)&&~u.indexOf("random(")&&(u=Ki(u)),ke(u+"")||u==="auto"||(u+=en.units[d]||ke($n(t,d))||""),(u+"").charAt(1)==="="&&(u=$n(t,d))):u=$n(t,d),h=parseFloat(u),y=p==="string"&&c.charAt(1)==="="&&c.substr(0,2),y&&(c=c.substr(2)),f=parseFloat(c),d in Tn&&(d==="autoAlpha"&&(h===1&&$n(t,"visibility")==="hidden"&&f&&(h=0),M.push("visibility",0,o.visibility),Qn(this,o,"visibility",h?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Tn[d],~d.indexOf(",")&&(d=d.split(",")[0]))),v=d in jn,v){if(this.styles.save(d),A=c,p==="string"&&c.substring(0,6)==="var(--"){if(c=tn(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var k=t.style.perspective;t.style.perspective=c,c=tn(t,"perspective"),k?t.style.perspective=k:rr(t,"perspective")}f=parseFloat(c)}if(_||(S=t._gsap,S.renderTransform&&!n.parseTransform||Ji(t,n.parseTransform),w=n.smoothOrigin!==!1&&S.smooth,_=this._pt=new Be(this._pt,o,Gt,0,1,S.renderTransform,S,0,-1),_.dep=1),d==="scale")this._pt=new Be(this._pt,S,"scaleY",S.scaleY,(y?Xr(S.scaleY,y+f):f)-S.scaleY||0,xc),this._pt.u=0,s.push("scaleY",d),d+="X";else if(d==="transformOrigin"){M.push(Ue,0,o[Ue]),c=qS(c),S.svg?wc(t,c,0,w,0,this):(x=parseFloat(c.split(" ")[2])||0,x!==S.zOrigin&&Qn(this,S,"zOrigin",S.zOrigin,x),Qn(this,o,d,Za(u),Za(c)));continue}else if(d==="svgOrigin"){wc(t,c,1,w,0,this);continue}else if(d in q0){US(this,S,d,h,y?Xr(h,y+c):c);continue}else if(d==="smoothOrigin"){Qn(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){HS(this,c,t);continue}}else d in o||(d=fi(d)||d);if(v||(f||f===0)&&(h||h===0)&&!SS.test(c)&&d in o)m=(u+"").substr((h+"").length),f||(f=0),x=ke(c)||(d in en.units?en.units[d]:m),m!==x&&(h=ir(t,d,u,x)),this._pt=new Be(this._pt,v?S:o,d,h,(y?Xr(h,y+f):f)-h,!v&&(x==="px"||d==="zIndex")&&n.autoRound!==!1?kS:xc),this._pt.u=x||0,v&&A!==c?(this._pt.b=u,this._pt.e=A,this._pt.r=AS):m!==x&&x!=="%"&&(this._pt.b=u,this._pt.r=MS);else if(d in o)NS.call(this,t,d,u,y?y+c:c);else if(d in t)this.add(t,d,u||t[d],y?y+c:c,i,a);else if(d!=="parseTransform"){Qc(d,c);continue}v||(d in o?M.push(d,0,o[d]):typeof t[d]=="function"?M.push(d,2,t[d]()):M.push(d,1,u||t[d])),s.push(d)}}b&&R0(this)},render:function(t,n){if(n.tween._time||!cf())for(var r=n._pt;r;)r.r(t,r.d),r=r._next;else n.styles.revert()},get:$n,aliases:Tn,getSetter:function(t,n,r){var i=Tn[n];return i&&i.indexOf(",")<0&&(n=i),n in jn&&n!==Ue&&(t._gsap.x||$n(t,"x"))?r&&Ch===r?n==="scale"?DS:ES:(Ch=r||{})&&(n==="scale"?OS:PS):t.style&&!Kc(t.style[n])?CS:~n.indexOf("-")?RS:of(t,n)},core:{_removeProperty:rr,_getMatrix:hf}};He.utils.checkPrefix=fi;He.core.getStyleSaver=F0;(function(e,t,n,r){var i=ze(e+","+t+","+n,function(a){jn[a]=1});ze(t,function(a){en.units[a]="deg",q0[a]=1}),Tn[i[13]]=e+","+t,ze(r,function(a){var s=a.split(":");Tn[s[1]]=i[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ze("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){en.units[e]="px"});He.registerPlugin(B0);var Sc=He.registerPlugin(B0)||He;Sc.core.Tween;const zr={IN_OUT:"power2.inOut",OUT:"power2.out"},Si={NO_STAGGER:0,RIPPLE_STAGGER_DELAY:.05};class U0{constructor(t,n={}){yi(this,"timeline");yi(this,"currentStage","");yi(this,"callbacks");yi(this,"durations");this.durations=t,this.callbacks=n,this.timeline=Sc.timeline({paused:!0,onUpdate:()=>this.handleProgress(),onComplete:()=>{var i,a,s,o;(a=(i=this.callbacks).onComplete)==null||a.call(i),(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"complete")}});let r=0;this.timeline.addLabel("seatsToRings",r),r+=t.seatsToRings/1e3,this.timeline.addLabel("ringsToBar",r),r+=t.ringsToBar/1e3,this.timeline.addLabel("axesReveal",r),r+=t.axesReveal/1e3,this.timeline.addLabel("barSlide",r),r+=t.barSlide/1e3,this.timeline.addLabel("barsGrow",r),r+=t.barsGrow/1e3,this.timeline.addLabel("barsToArea",r)}animateSeatsToRings(t,n){const r=this.durations.seatsToRings/1e3;return t.each(function(){const i=this;if(!i.getAttribute("data-orig-x")){const a=i.getAttribute("x"),s=i.getAttribute("y"),o=i.getAttribute("width"),l=i.getAttribute("height");i.setAttribute("data-orig-x",a||"0"),i.setAttribute("data-orig-y",s||"0"),i.setAttribute("data-orig-width",o||"0"),i.setAttribute("data-orig-height",l||"0")}}),this.timeline.to(t.nodes(),{width:2,y:(i,a)=>parseFloat(a.getAttribute("y")||"0"),height:(i,a)=>{const s=parseFloat(a.getAttribute("y")||"0");return n-s},duration:r,ease:zr.IN_OUT,stagger:Si.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="seatsToRings",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"seatsToRings")}},"seatsToRings"),this}animateRingsToBar(t,n){const r=this.durations.ringsToBar/1e3;return t.each(function(i,a){const s=this;if(!n[a])return;const l=s.getAttribute("x"),u=s.getAttribute("y"),c=s.getAttribute("width"),f=s.getAttribute("height");s.setAttribute("data-orig-x",l||"0"),s.setAttribute("data-orig-y",u||"0"),s.setAttribute("data-orig-width",c||"0"),s.setAttribute("data-orig-height",f||"0")}),this.timeline.to(t.nodes(),{x:i=>{var a;return((a=n[i])==null?void 0:a.x)??0},y:i=>{var a;return((a=n[i])==null?void 0:a.y)??0},width:i=>{var a;return((a=n[i])==null?void 0:a.width)??0},height:i=>{var a;return((a=n[i])==null?void 0:a.height)??0},duration:r,ease:zr.IN_OUT,stagger:Si.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="ringsToBar",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"ringsToBar")}},"ringsToBar"),this}animateAxesReveal(t,n){const r=this.durations.axesReveal/1e3;return this.timeline.to([t.node(),n.node()],{opacity:1,duration:r,ease:zr.IN_OUT,stagger:Si.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="axesReveal",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"axesReveal")}},"axesReveal"),this}animateBarSlide(t,n){const r=this.durations.barSlide/1e3;return this.timeline.to(t.nodes(),{x:n,duration:r,ease:zr.OUT,stagger:Si.NO_STAGGER,onStart:()=>{var i,a;this.currentStage="barSlide",(a=(i=this.callbacks).onStageComplete)==null||a.call(i,"barSlide")}},"barSlide"),this}animateBarsGrow(t,n,r=Si.RIPPLE_STAGGER_DELAY){const i=this.durations.barsGrow/1e3;return t.nodes().forEach((s,o)=>{const l=s,u=l.getAttribute("data-final-y")||"0",c=l.getAttribute("data-final-height")||"0",f=parseInt(l.getAttribute("data-timestamp-index")||"0"),p=Math.abs(f-n)*r;this.timeline.fromTo(l,{height:0,y:parseFloat(l.getAttribute("data-chart-baseline")||"400")},{y:parseFloat(u),height:parseFloat(c),duration:i,delay:p,ease:zr.OUT},"barsGrow")}),this.timeline.call(()=>{var s,o;this.currentStage="barsGrow",(o=(s=this.callbacks).onStageComplete)==null||o.call(s,"barsGrow")},[],"barsGrow"),this}animateBarsToArea(t,n,r,i){const a=this.durations.barsToArea/1e3,s=new Map;return t.each(function(){var c;const o=this,l=o.getAttribute("class");if(!l)return;const u=l.match(/category-([\w-]+)/);if(u&&u[1]){const f=u[1];s.has(f)||s.set(f,[]),(c=s.get(f))==null||c.push(o)}}),this.timeline.set(t.nodes(),{opacity:0},"barsToArea"),this.timeline.set(n.nodes(),{opacity:1},"barsToArea"),n.each(function(){const o=this,l=o.getAttribute("data-category");if(!l)return;const u=r.get(l);u&&Sc.to(o,{attr:{d:u},duration:a,ease:zr.IN_OUT})}),this.timeline.call(()=>{var o,l;this.currentStage="barsToArea",(l=(o=this.callbacks).onStageComplete)==null||l.call(o,"barsToArea")},[],"barsToArea"),this}handleProgress(){var n,r;const t=this.timeline.progress();(r=(n=this.callbacks).onProgress)==null||r.call(n,t)}getControls(){return{play:()=>this.timeline.play(),pause:()=>this.timeline.pause(),reverse:()=>this.timeline.reverse(),restart:()=>this.timeline.restart(),seek:t=>this.timeline.progress(t),seekToStage:t=>{const n=this.timeline.labels[t];n!==void 0&&this.timeline.seek(n)},kill:()=>this.timeline.kill(),getProgress:()=>this.timeline.progress(),getCurrentStage:()=>this.currentStage,getTimeline:()=>this.timeline}}play(){this.timeline.play()}destroy(){this.timeline.kill()}}function jS(e,t){const{arcAngle:n,arcAngleFlexibility:r=5,radius:i,seatSize:a,minSeatSize:s,maxSeatSize:o,spacing:l,innerRadiusRatio:u}=t,c=i*u,f=e.reduce((O,P)=>O+P.seats,0);let h={seatSize:a,arcAngle:n,score:-1};const p=n-r,g=n+r;for(let O=p;O<=g;O+=2.5){const P=O*Math.PI/180;for(let F=o;F>=s;F-=.1){const B=F*2,L=B*l,$=Math.floor((i-c)/L);for(let Y=1;Y<=Math.min($,10);Y++){let I=0;for(let et=0;et<Y;et++){const K=c+(et+.5)*L,J=B*l/K,st=Math.floor(P/J);I+=st}if(I>=f){const et=f/I,K=(F-s)/(o-s),J=(I-f)/f,st=J<.15?1:J<.3?.7:J<.5?.4:.1,lt=1-Math.abs(O-n)/r,N=st*.5+K*.3+et*.15+lt*.05;N>h.score&&(h={seatSize:F,arcAngle:O,rings:Y,score:N})}}}}const d=h.seatSize,m=h.arcAngle,x=m*Math.PI/180,y=d*2,v=y*l,_=Math.floor((i-c)/v),S=[],w=-x/2-Math.PI/2,b=[];let M=0,A=[];for(let O=1;O<=_;O++){let P=0;const F=[];for(let B=0;B<O;B++){const L=c+(B+.5)*v,$=y*l/L,Y=Math.floor(x/$);F.push(Y),P+=Y}if(P>=f){M=O,A=F;break}}if(M>0)b.push(...A);else for(let O=0;O<_;O++){const P=c+(O+.5)*v,F=y*l/P,B=Math.floor(x/F);b.push(B)}for(let O=0;O<b.length;O++){const P=c+(O+.5)*v,F=b[O]??0;if(F>0){const B=x/F;for(let L=0;L<F;L++){const $=w+(L+.5)*B,Y=Math.cos($)*P,I=Math.sin($)*P;S.push({ring:O,index:L,angle:$,x:Y,y:I})}}}S.sort((O,P)=>{const F=O.angle-P.angle;return Math.abs(F)>.001?F:O.ring-P.ring});const k=[];let C=0;return e.forEach((O,P)=>{const F=Math.min(O.seats,S.length-C);for(let B=0;B<F&&C<S.length;B++){const L=S[C++];L&&k.push({x:L.x,y:L.y,category:O.name,categoryIndex:P,seatIndex:B,ring:L.ring,angle:L.angle,radius:d})}}),{arcAngle:m,radius:i,innerRadius:c,centerX:i,centerY:i,seatSize:d,seats:k,totalSeats:f}}function GS(e,t,n){const r=t<=n?1:n/t;return e.filter(i=>i.value>0).map(i=>{const a=t<=n?i.value:Math.max(1,Math.floor(i.value*r));return{id:i.dataKey,name:i.label,seats:a,colour:i.color}})}function Qa({svg:e,events:t,xScale:n,chartHeight:r,chartWidth:i,timelineHeight:a,timelineOffset:s,instanceId:o,setHoveredTimelineEvent:l,enableBrush:u=!1,onTimeRangeChange:c,minAllowedTime:f,maxAllowedTime:h,brushColor:p="#69b3a2",mainGroupSelector:g}){const d=r+s,m=o?`.main-chart-group-${o}`:".main-chart-group",x=e.select(g??m),y=o?`timeline-track timeline-track-${o}`:"timeline-track",v=x.append("g").attr("class",y),_=6,S=o?`timeline-clip-${o}`:`timeline-clip-${Math.random().toString(36).substr(2,9)}`;e.append("defs").append("clipPath").attr("id",S).append("rect").attr("x",0).attr("y",d).attr("width",i+_).attr("height",a),v.append("rect").attr("class","timeline-background").attr("x",0).attr("y",d).attr("width",i).attr("height",a).attr("fill","#FFFFFF").attr("stroke","#9CA3AF").attr("stroke-width",1);const w=v.append("g").attr("clip-path",`url(#${S})`),b=3,M=w.selectAll(".timeline-event").data(t).enter().append("rect").attr("class","timeline-event").attr("x",k=>n(new Date(k.timestamp))-b/2).attr("y",d).attr("width",b).attr("height",a).attr("fill",k=>k.color||"#2F42FF").attr("stroke","none").attr("cursor","pointer").attr("data-timestamp",k=>k.timestamp).attr("data-event-name",k=>k.eventName),A=6;if(M.on("mouseenter",function(k,C){const O=Ot(this),P=n(new Date(C.timestamp));O.transition().duration(150).attr("x",P-A/2).attr("width",A),l&&l({timestamp:C.timestamp,eventName:C.eventName,x:P})}).on("mouseleave",function(k,C){const O=Ot(this),P=n(new Date(C.timestamp));O.transition().duration(150).attr("x",P-b/2).attr("width",b),l&&l(null)}),u&&c){const k=f,C=h,O=pi().extent([[0,d],[i,d+a]]).on("start",B=>{if(!B.selection&&k!==void 0&&C!==void 0){const L=B.sourceEvent;if(L){const $=L.offsetX,Y=+n.invert($);if(Y<k||Y>C){const I=o?`.timeline-brush-${o}`:".timeline-brush";e.select(I).call(O.move,null);return}}}}).on("brush",B=>{if(!B.selection)return;const[L,$]=B.selection;let Y=+n.invert(L),I=+n.invert($);k!==void 0&&(Y=Math.max(Y,k),I=Math.max(I,k)),C!==void 0&&(Y=Math.min(Y,C),I=Math.min(I,C));const et=n(new Date(Y)),K=n(new Date(I));if(et!==L||K!==$){const J=o?`.timeline-brush-${o}`:".timeline-brush";e.select(J).call(O.move,[et,K])}}).on("end",B=>{if(!B.selection)return;const[L,$]=B.selection,Y=[+n.invert(L),+n.invert($)];k!==void 0&&(Y[0]=Math.max(Y[0],k)),C!==void 0&&(Y[1]=Math.min(Y[1],C)),c(Y);const I=o?`.timeline-brush-${o}`:".timeline-brush";e.select(I).call(O.move,null)}),P=o?`timeline-brush timeline-brush-${o}`:"timeline-brush",F=x.append("g").attr("class",P).call(O);F.selectAll(".selection").attr("fill",p).attr("fill-opacity",.2).attr("stroke",p).attr("stroke-width",1),F.selectAll(".handle").attr("fill",p).attr("fill-opacity",.8),F.select(".overlay").style("cursor","default"),F.on("dblclick",()=>{const B=n.domain(),L=[+B[0],+B[1]];c(L)})}}const pn={neoGrey:{200:"#EDEFEF",400:"#ADB5BD"},neoDigitalGreen:{600:"#40c048"}},Li=["#4CA75A","#FDDA04","#FFC008","#FF9800","#F9A91B","#FF5C24","#ED4134","#CB3446"],qe={greyHatch:{background:pn.neoGrey[200],lines:pn.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}};function YS(e,t){const n=e.append("pattern").attr("id",`${t}-greyHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.greyHatch.background),n.append("path").attr("d","M0,2 L8,2").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M0,6 L8,6").attr("stroke",qe.greyHatch.lines).attr("stroke-width",.5)}function WS(e,t){const n=e.append("pattern").attr("id",`${t}-dataMissingHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.dataMissingHatch.background),n.append("path").attr("d","M0,8 L8,0").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M-2,2 L2,-2").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M6,10 L10,6").attr("stroke",qe.dataMissingHatch.lines).attr("stroke-width",.5)}function XS(e,t){const n=e.append("pattern").attr("id",`${t}-noLstHatchPattern`).attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("patternUnits","userSpaceOnUse");n.append("rect").attr("x",0).attr("y",0).attr("width",8).attr("height",8).attr("fill",qe.noLstHatch.background),n.append("path").attr("d","M0,0 L8,8").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M-2,6 L2,10").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5),n.append("path").attr("d","M6,-2 L10,2").attr("stroke",qe.noLstHatch.lines).attr("stroke-width",.5)}function va(e,t){let n=e.select("defs");n.empty()&&(n=e.append("defs")),YS(n,t),WS(n,t),XS(n,t)}function Nh(e,t){if(e.startsWith("url(#")&&e.endsWith(")")){const n=e.slice(5,-1);return`url(#${t}-${n})`}return e}function pf(e){return e.includes("greyHatchPattern")?qe.greyHatch.lines:e.includes("dataMissingHatchPattern")?qe.dataMissingHatch.lines:e.includes("noLstHatchPattern")?qe.noLstHatch.lines:e}function Tc(e,t,n,r){const{xScale:i,yScale:a,addClasses:s=!0,instanceId:o}=r,l=as().x(h=>i(new Date(h.data.timestamp))).y0(h=>a(h[0])).y1(h=>a(h[1])).curve(kr),u=Hm().x(h=>i(new Date(h.data.timestamp))).y(h=>a(h[1])).curve(kr),c=o?`areas areas-${o}`:"areas";let f=e.select(o?`.areas-${o}`:".areas");f.empty()&&(f=e.append("g").attr("class",c)),t.forEach((h,p)=>{var x;const g=n[p];if(!g)return;const d=((x=g.parliamentMapping)==null?void 0:x.isSpecialCategory)??!1,m=pf(g.color);if(d){const y=f.append("path").datum(h).attr("fill","none").attr("stroke",m).attr("stroke-width",3).attr("stroke-dasharray","15 8").attr("d",u).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}else{const y=f.append("path").datum(h).attr("fill",g.color).attr("fill-opacity",g.fillOpacity??.7).attr("stroke",m).attr("stroke-width",g.strokeWidth??1.5).attr("d",l).style("pointer-events","none");if(s){const v=o?`area area-${o} area-${g.dataKey}`:`area area-${g.dataKey}`;y.attr("class",v)}}})}function KS(e,t){var r;const n=[];for(const i of e){let a=0;for(const s of t){const o=i[s.dataKey]||0,l=a,u=a+o;n.push({timestamp:i.timestamp,category:s.label,dataKey:s.dataKey,y0:l,y1:u,value:o,color:s.color,isSpecialCategory:((r=s.parliamentMapping)==null?void 0:r.isSpecialCategory)??!1}),a+=o}}return n}function Ae(e){return e.replace(/[^a-zA-Z0-9-_]/g,"-")}function H0(e,t,n,r){const{centerX:i,centerY:a,addClasses:s=!0,instanceId:o,parliamentRadius:l=200}=r,u=o?`parliament parliament-${o}`:"parliament";let c=e.select(o?`.parliament-${o}`:".parliament");c.empty()&&(c=e.append("g").attr("class",u)),t.seats.forEach(p=>{const g=n.find(x=>x.label===p.category);if(!g)return;const d=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius).attr("fill",g.color).attr("stroke",g.color).attr("stroke-width",.5),m=c.append("circle").attr("cx",i+p.x).attr("cy",a+p.y).attr("r",p.radius*2.5).attr("fill","transparent").attr("stroke","none").attr("pointer-events","all");if(s){const x=o?`seat seat-${o} seat-${Ae(p.category)}`:`seat seat-${Ae(p.category)}`;d.attr("class",x),m.attr("class",x)}});const f=o?`parliament-label parliament-label-${o}`:"parliament-label";if(e.select(`.${f.split(" ")[0]}`).empty()){const p=e.append("g").attr("class",f).attr("transform",`translate(${i},${a-l*.15})`).style("opacity","0").style("pointer-events","none");p.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),p.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const g=p.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");g.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),g.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}}function VS(e,t,n,r,i,a,s=!1){var f;const o=new Map;let l=i;if(t.length>0&&((f=t[0])==null?void 0:f.timestamp)!==void 0){const h=t[0].timestamp;l=n(new Date(h))}const u=new Map;for(const h of e.seats)u.has(h.category)||u.set(h.category,[]),u.get(h.category).push(h);const c=new Map;for(const h of t)c.set(h.dataKey,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory}),h.label&&h.label!==h.dataKey&&c.set(h.label,{y0:h.y0,y1:h.y1,isSpecialCategory:h.isSpecialCategory});for(const h of e.seats){const p=c.get(h.category);if(!p){o.set(h,{x:l,y:a/2});continue}const g=r(p.y0),d=r(p.y1);let m;if(s){const x=u.get(h.category)??[],y=h.seatIndex,v=x.length;if(v===1)m=(g+d)/2;else{const _=y/(v-1);m=g+(d-g)*_}}else m=d;o.set(h,{x:l,y:m})}return o}function ZS(e,t,n){var s;if(e.length===0)return[];const r=e[e.length-1],i=[];let a=0;for(const o of t){const l=r[o.dataKey]||0,u=a,c=a+l;i.push({dataKey:o.dataKey,label:o.label,y0:u,y1:c,value:l,timestamp:r.timestamp,isSpecialCategory:((s=o.parliamentMapping)==null?void 0:s.isSpecialCategory)??!1}),a+=l}return i}function QS(e){const t=e;return{seatsToLines:t*.2,seatsToBar:t*.07,crossFadePause:t*.003,barSlideToTimeline:t*.22,axesAndBarsGrow:t*.22,barsToArea:t*.287}}const _r=new Map;Ot.prototype.transition=Ic;const JS=({containerRef:e,data:t,categories:n,mode:r,width:i,height:a,margin:s,timeRange:o,showGrid:l=!0,showAxes:u=!0,axisLabelColor:c,axisLabelSize:f=14,formatDate:h,formatValue:p,markers:g=[],arcAngle:d=200,parliamentRadius:m=200,seatSize:x=4.5,animationDuration:y=900,onMorphComplete:v,onAnimationStateChange:_,onTimelineReady:S,onAnimationProgress:w,onHoveredDataChange:b,hoveredCategory:M,maxSeats:A=2e3,parliamentTimestamp:k,enableBrush:C=!1,onTimeRangeChange:O,minAllowedTime:P,maxAllowedTime:F,showScaleIndicator:B=!1,reposPerSeat:L=1,timelineEvents:$=[],showTimeline:Y=!1,timelineHeight:I=40,timelineOffset:et=35,brushColor:K="#69b3a2",showCrosshair:J=!1,onCrosshairMove:st})=>{const[lt,N]=G.useState("area"),[j,nt]=G.useState(!1),[Z,R]=G.useState(null),[z,D]=G.useState(0),[T,X]=G.useState(null),[Q,W]=G.useState(null),[ut,H]=G.useState([]),ot=G.useRef(null),gt=G.useRef(r),yt=G.useRef(!0),vt=G.useRef(!1),rt=G.useRef(`morph-${Math.random().toString(36).substr(2,9)}`),at=G.useRef(void 0),_t=G.useRef(o),dt=G.useRef(g),xt=G.useRef($),Et=G.useRef(v),At=G.useRef(_),ee=G.useRef(S),ne=G.useRef(w),Pt=G.useRef(b),ge=G.useRef(st);G.useEffect(()=>{Et.current=v,At.current=_,ee.current=S,ne.current=w,Pt.current=b,ge.current=st},[v,_,S,w,b,st]),G.useEffect(()=>{if(e.current&<==="parliament")if(M){const Rt=n.find(It=>It.dataKey===M);if(Rt){const It=Rt.label;if(R(It),Ii(e.current,It),t.length>0){const Re=t[t.length-1],Qt=Math.round(Re.values[Rt.dataKey]||0),oe={label:Rt.label,value:Qt,color:pf(Rt.color)};qi(e.current,oe,B,L,rt.current)}}}else R(null),Ii(e.current,null),qi(e.current,null,B,L,rt.current)},[M,lt,n,t,B,L]);const Vt=i-s.left-s.right,Zt=a-s.top-s.bottom;return G.useEffect(()=>{var le;if(!e.current||t.length===0||n.length===0||(at.current&&(at.current(),at.current=void 0),vt.current))return;const Rt=Ot(e.current),It=r!==gt.current;yt.current?(Rt.selectAll("*").remove(),va(Rt,rt.current),yt.current=!1):It||(Rt.selectAll("*").remove(),va(Rt,rt.current));const Re=t[t.length-1],Qt=n.reduce((ht,Nt)=>ht+(Re.values[Nt.dataKey]||0),0),oe=t.map(ht=>{const Nt={timestamp:ht.timestamp};for(const ue of n)Nt[ue.dataKey]=ht.values[ue.dataKey]||0;return Nt}),we=n.map(ht=>ht.dataKey),me=Yi().keys(we),Ge=me(oe),sn=t.map(ht=>ht.timestamp),Ye=It||!o?Math.min(...sn):o[0],Fe=It||!o?Math.max(...sn):o[1],on=[...sn].sort((ht,Nt)=>ht-Nt),ye=[];for(let ht=0;ht<on.length-1;ht++)ye.push(on[ht+1]-on[ht]);const kt=ye.length>0?ye.reduce((ht,Nt)=>ht+Nt,0)/ye.length:0,Lt=Fe+kt*1.15,Mt=Wr().domain([new Date(Ye),new Date(Lt)]).range([0,Vt]),Yt=oe.filter(ht=>ht.timestamp>=Ye&&ht.timestamp<=Fe),_e=me(Yt),Wt=_e.length>0?Math.max(..._e[_e.length-1].map(ht=>ht[1]??0)):0,U=ri().domain([0,Wt*1.15]).range([Zt,0]),ct=n.map(ht=>({...ht,color:Nh(ht.color,rt.current)})),ft=ct.map(ht=>({dataKey:ht.dataKey,label:ht.label,color:ht.color,value:Re.values[ht.dataKey]||0})),wt=GS(ft,Qt,A).reverse(),St=jS(wt,{arcAngle:d,radius:m,seatSize:x,minSeatSize:4,maxSeatSize:30,spacing:1.1,innerRadiusRatio:.4});ot.current=St;const zt=ZS(oe,n),re=VS(St,zt,Mt,U,Vt,Zt);if(It&&!vt.current){vt.current=!0,nt(!0),(le=At.current)==null||le.call(At,!0),X(null),H([]),D(0);let ht=Rt.select("g[transform]");if(ht.empty()&&(ht=Rt.select("g")),ht.empty()){Rt.selectAll("*").remove(),va(Rt,rt.current),Gs(Rt,r==="parliament"?"parliament":"area",Ge,ct,St,Mt,U,Vt,Zt,s,l,u,c,f,h,p,C,O,rt.current,g,o,H,X,$,Y,I,et,W,P,F,K,J,st),nt(!1),N(r==="parliament"?"parliament":"area"),D(r==="parliament"?1:0),gt.current=r;return}const Nt=setTimeout(()=>{vt.current=!1,nt(!1),gt.current=r},y*3);eT(Rt,r,Ge,ct,St,re,Mt,U,Vt,Zt,s,y,()=>{var ue,Ee,De;if(clearTimeout(Nt),vt.current=!1,nt(!1),N(r==="parliament"?"parliament":"area"),r==="parliament"&&D(1),(ue=At.current)==null||ue.call(At,!1),(Ee=Et.current)==null||Ee.call(Et),gt.current=r,r==="parliament"&&e.current&&Pt.current&&(at.current=Ys(e.current,ct,t,Z,R,Pt.current,B,L,rt.current)),r!=="parliament"&&e.current){R(null),(De=Pt.current)==null||De.call(Pt,null),qi(e.current,null,B,L,rt.current);const We=Ot(e.current),$e=We.select(rt.current?`.main-chart-group-${rt.current}`:".main-chart-group");if(Y){const Rn=rt.current?`.timeline-track-${rt.current}`:".timeline-track",Xe=rt.current?`.timeline-brush-${rt.current}`:".timeline-brush";$e.select(Rn).remove(),$e.select(Xe).remove(),Qa({svg:We,events:$,xScale:Mt,chartHeight:Zt,chartWidth:Vt,timelineHeight:I,timelineOffset:et,instanceId:rt.current,setHoveredTimelineEvent:W,enableBrush:C,onTimeRangeChange:O,minAllowedTime:P,maxAllowedTime:F,brushColor:K})}if(C&&O){const Rn=$e.select(rt.current?`.chart-content-group-${rt.current}`:".chart-content-group");tT(Rn,Vt,Zt,Mt,O,rt.current,We,P,F,K)}if(g.length>0&&H&&X&&o){const Xe=g.filter(ln=>ln.timestamp>=(o[0]??0)-1&&ln.timestamp<=(o[1]??1/0)+1).map(ln=>({...ln,x:Mt(new Date(ln.timestamp))}));if(H(Xe),Xe.length>0){qh($e,Xe,Zt,Vt,C,X,rt.current);const ln=$e.select(rt.current?`.markers-${rt.current}`:".markers");if(!ln.empty()){$e.selectAll(".marker-hover-overlay").remove();const sr=$e.select(rt.current?`.chart-content-group-${rt.current}`:".chart-content-group");j0(sr.empty()?$e:sr,ln,Xe,Vt,Zt,C,X,s,J,st)}}}}},u,f,h,p,ee.current,(ue,Ee)=>{var De;if(r==="parliament"&&ue>=.95){const We=(ue-.95)/.05;D(Math.min(We,1))}(De=ne.current)==null||De.call(ne,ue,Ee)},k,rt.current)}else gt.current=r,r==="parliament"&&(X(null),H([])),Gs(Rt,r==="parliament"?"parliament":"area",Ge,ct,St,Mt,U,Vt,Zt,s,l,u,c,f,h,p,C,O,rt.current,g,o,H,X,$,Y,I,et,W,P,F,K,J,st),N(r==="parliament"?"parliament":"area"),D(r==="parliament"?1:0),r==="parliament"&&e.current&&Pt.current&&(at.current=Ys(e.current,ct,t,Z,R,Pt.current,B,L,rt.current));return()=>{at.current&&(at.current(),at.current=void 0)}},[r]),G.useEffect(()=>{var Yt,_e;if(!e.current||t.length===0||vt.current)return;if(yt.current){_t.current=o;return}if(!(o!==_t.current&&((o==null?void 0:o[0])!==((Yt=_t.current)==null?void 0:Yt[0])||(o==null?void 0:o[1])!==((_e=_t.current)==null?void 0:_e[1]))))return;_t.current=o;const It=Ot(e.current),Re=t.map(Wt=>{const U={timestamp:Wt.timestamp};for(const ct of n)U[ct.dataKey]=Wt.values[ct.dataKey]||0;return U}),Qt=n.map(Wt=>Wt.dataKey),we=Yi().keys(Qt)(Re),me=t.map(Wt=>Wt.timestamp),Ge=o?o[0]:Math.min(...me),sn=o?o[1]:Math.max(...me),Fe=(me.length>1?(me[me.length-1]-me[0])/(me.length-1):0)*.5,on=Wr().domain([new Date(Ge-Fe),new Date(sn+Fe)]).range([0,i-s.left-s.right]),ye=Math.max(...we[we.length-1].map(Wt=>Wt[1])),kt=ri().domain([0,ye*1.1]).range([a-s.top-s.bottom,0]);if(!ot.current)return;const Lt=ot.current,Mt=n.map(Wt=>({...Wt,color:Nh(Wt.color,rt.current)}));It.selectAll("*").remove(),va(It,rt.current),Gs(It,lt==="parliament"?"parliament":"area",we,Mt,Lt,on,kt,i-s.left-s.right,a-s.top-s.bottom,s,l,u,c,f,h,p,C,O,rt.current,g,o,H,X,$,Y,I,et,W,P,F,K,J,st),lt==="parliament"&&e.current&&Pt.current&&(at.current=Ys(e.current,Mt,t,Z,R,Pt.current,B,L,rt.current))},[o]),G.useEffect(()=>{if(!e.current||t.length===0||vt.current)return;if(yt.current){dt.current=g,xt.current=$;return}if(lt==="parliament"){dt.current=g,xt.current=$;return}const Rt=g.length!==dt.current.length||g.some((kt,Lt)=>{var Mt,Yt;return kt.timestamp!==((Mt=dt.current[Lt])==null?void 0:Mt.timestamp)||kt.label!==((Yt=dt.current[Lt])==null?void 0:Yt.label)}),It=$.length!==xt.current.length||$.some((kt,Lt)=>{var Mt,Yt;return kt.timestamp!==((Mt=xt.current[Lt])==null?void 0:Mt.timestamp)||kt.eventName!==((Yt=xt.current[Lt])==null?void 0:Yt.eventName)});if(!Rt&&!It)return;dt.current=g,xt.current=$;const Re=Ot(e.current),Qt=Re.select(rt.current?`.main-chart-group-${rt.current}`:".main-chart-group");if(Qt.empty())return;const oe=t.map(kt=>kt.timestamp),we=o?o[0]:Math.min(...oe),me=o?o[1]:Math.max(...oe),sn=(oe.length>1?(oe[oe.length-1]-oe[0])/(oe.length-1):0)*.5,Ye=i-s.left-s.right,Fe=a-s.top-s.bottom,on=Wr().domain([new Date(we-sn),new Date(me+sn)]).range([0,Ye]);if(It&&Y){const kt=rt.current?`.timeline-track-${rt.current}`:".timeline-track",Lt=rt.current?`.timeline-brush-${rt.current}`:".timeline-brush";Qt.select(kt).remove(),Qt.select(Lt).remove(),Qa({svg:Re,events:$,xScale:on,chartHeight:Fe,chartWidth:Ye,timelineHeight:I,timelineOffset:et,instanceId:rt.current,setHoveredTimelineEvent:W,enableBrush:C,onTimeRangeChange:O,minAllowedTime:P,maxAllowedTime:F,brushColor:K})}let ye=[];if(Rt&&g.length>0&&o){const kt=rt.current?`.markers-${rt.current}`:".markers";Qt.select(kt).remove();const Lt=1;ye=g.filter(Mt=>Mt.timestamp>=(o[0]??0)-Lt&&Mt.timestamp<=(o[1]??1/0)+Lt).map(Mt=>({...Mt,x:on(new Date(Mt.timestamp))})),H(ye),ye.length>0&&qh(Qt,ye,Fe,Ye,C,X,rt.current)}if(ye.length>0){const kt=Qt.select(rt.current?`.markers-${rt.current}`:".markers");if(!kt.empty()){Qt.selectAll(".marker-hover-overlay").remove();const Lt=Qt.append("rect").attr("class","marker-hover-overlay").attr("x",0).attr("y",0).attr("width",Ye).attr("height",Fe).attr("fill","none").attr("pointer-events","all");let Mt=null;Lt.on("mousemove",function(Yt){const[_e]=er(Yt,this);let Wt=null,U=1/0;if(ye.forEach(wt=>{const St=Math.abs(_e-wt.x);St<U&&(U=St,Wt=wt)}),!Wt||U>50){Mt!==null&&(Mt=null,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),X(null));return}const ft=Wt;Mt!==ft.timestamp&&(Mt=ft.timestamp,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),kt.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(ft.timestamp)}).attr("opacity",.6),kt.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(ft.timestamp)}).attr("opacity",1),X(ft))}),Lt.on("mouseleave",function(){Mt=null,kt.selectAll(".marker-line").attr("opacity",0),kt.selectAll(".marker-label").attr("opacity",0),X(null)})}}},[g,$,j]),{isMorphing:j,currentMode:lt,hoveredCategory:Z,scaleIndicatorOpacity:z,visibleMarkers:ut,hoveredMarker:T,setHoveredMarker:X,hoveredTimelineEvent:Q,setHoveredTimelineEvent:W}};function tT(e,t,n,r,i,a,s,o,l,u){const c=o,f=l,h=pi().extent([[0,0],[t,n]]).on("start",g=>{if(!g.selection&&c!==void 0&&f!==void 0){const d=g.sourceEvent;if(d){const m=d.offsetX,x=+r.invert(m);if(x<c||x>f){s.select(".brush").call(h.move,null);return}}}}).on("brush",g=>{if(!g.selection)return;const[d,m]=g.selection;let x=+r.invert(d),y=+r.invert(m);c!==void 0&&(x=Math.max(x,c),y=Math.max(y,c)),f!==void 0&&(x=Math.min(x,f),y=Math.min(y,f));const v=r(new Date(x)),_=r(new Date(y));(v!==d||_!==m)&&s.select(".brush").call(h.move,[v,_])}).on("end",g=>{if(!g.selection)return;const[d,m]=g.selection,x=[+r.invert(d),+r.invert(m)];c!==void 0&&(x[0]=Math.max(x[0],c)),f!==void 0&&(x[1]=Math.min(x[1],f)),i(x),s.select(".brush").call(h.move,null)}),p=e.append("g").attr("class","brush").call(h);p.selectAll(".selection").attr("fill",u).attr("fill-opacity",.2).attr("stroke",u).attr("stroke-width",1),p.selectAll(".handle").attr("fill",u).attr("fill-opacity",.8),p.select(".overlay").style("cursor","default"),p.on("dblclick",()=>{const g=r.domain(),d=[+g[0],+g[1]];o!==void 0&&(d[0]=Math.max(d[0],o)),l!==void 0&&(d[1]=Math.min(d[1],l)),i(d)})}function qh(e,t,n,r,i,a,s){const o=s?`markers markers-${s}`:"markers",l=e.append("g").attr("class",o);t.forEach(u=>{l.append("line").attr("class","marker-line").attr("data-timestamp",u.timestamp).attr("x1",u.x).attr("x2",u.x).attr("y1",0).attr("y2",n).attr("stroke",u.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),u.label&&l.append("text").attr("class","marker-label").attr("data-timestamp",u.timestamp).attr("x",u.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",u.color??"#2F42FF").attr("opacity",0)})}function j0(e,t,n,r,i,a,s,o,l=!1,u){let c=null,f;a?f=e.select(".brush .overlay"):f=e.append("rect").attr("class","marker-hover-overlay").attr("width",r).attr("height",i).attr("fill","none").attr("pointer-events","all");const h=p=>{let g=null,d=1/0;if(n.forEach(y=>{const v=Math.abs(p-y.x);v<d&&(d=v,g=y)}),!g||d>50)return c!==null&&(c=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null)),!1;const x=g;return c===x.timestamp||(c=x.timestamp,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),t.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(x.timestamp)}).attr("opacity",.6),t.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(x.timestamp)}).attr("opacity",1),s(x)),!0};f.on("mousemove",function(p){const[g,d]=er(p,this);h(g),l&&u&&u({x:g+o.left,y:d+o.top})}),f.on("mouseleave",function(){c=null,t.selectAll(".marker-line").attr("opacity",0),t.selectAll(".marker-label").attr("opacity",0),s(null),u&&u(null)})}function Gs(e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m=!1,x,y,v=[],_=[0,0],S,w,b=[],M=!1,A=40,k=15,C,O,P,F="#69b3a2",B=!1,L){const $=O,Y=P;let I=null;const et=y?`main-chart-group main-chart-group-${y}`:"main-chart-group",K=e.append("g").attr("class",et).attr("transform",`translate(${u.left},${u.top})`),J=y?`chart-clip-${y}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`;e.select("defs").append("clipPath").attr("id",J).append("rect").attr("x",0).attr("y",0).attr("width",o).attr("height",l);const st=y?`chart-content-group chart-content-group-${y}`:"chart-content-group",lt=K.append("g").attr("class",st).attr("clip-path",`url(#${J})`);if(c&&t!=="parliament"&&(lt.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(a).ticks(6).tickSize(l).tickFormat(()=>"")),lt.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(s).ticks(5).tickSize(-o).tickFormat(()=>""))),t==="area"&&(Tc(lt,n,r,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),v.length>0)){const j=v.filter(nt=>nt.timestamp>=_[0]-1&&nt.timestamp<=_[1]+1).map(nt=>({...nt,x:a(new Date(nt.timestamp))}));I={markersGroup:null,visibleMarkers:j},S&&S(j)}if(t==="parliament"){const N=o/2,j=i.radius+10,nt=l-i.radius*.3,Z=Math.max(j,nt);H0(lt,i,r,{centerX:N,centerY:Z,addClasses:!0,instanceId:y,parliamentRadius:i.radius})}if(f&&t!=="parliament"){const j=qn(a).ticks(6).tickPadding(12);g&&j.tickFormat(T=>g(+T));const Z=K.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).call(j).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&Z.attr("fill",h);const R=In(s).ticks(5);R.tickFormat(T=>+T==0?"":d?d(+T):String(T));const D=K.append("g").attr("class","axis axis-y").call(R).selectAll("text").attr("font-size",p).attr("font-weight",500);h&&D.attr("fill",h)}if(m&&x&&t==="area"){const N=$,j=Y,nt=pi().extent([[0,0],[o,l]]).on("start",R=>{if(!R.selection&&N!==void 0&&j!==void 0){const z=R.sourceEvent;if(z){const D=z.offsetX-((u==null?void 0:u.left)||0),T=+a.invert(D);if(T<N||T>j){e.select(".brush").call(nt.move,null);return}}}}).on("brush",R=>{if(!R.selection)return;const[z,D]=R.selection;let T=+a.invert(z),X=+a.invert(D);N!==void 0&&(T=Math.max(T,N),X=Math.max(X,N)),j!==void 0&&(T=Math.min(T,j),X=Math.min(X,j));const Q=a(new Date(T)),W=a(new Date(X));(Q!==z||W!==D)&&e.select(".brush").call(nt.move,[Q,W])}).on("end",R=>{if(!R.selection)return;const[z,D]=R.selection,T=[+a.invert(z),+a.invert(D)];N!==void 0&&(T[0]=Math.max(T[0],N)),j!==void 0&&(T[1]=Math.min(T[1],j)),x(T),e.select(".brush").call(nt.move,null)}),Z=lt.append("g").attr("class","brush").call(nt);Z.selectAll(".selection").attr("fill",F).attr("fill-opacity",.2).attr("stroke",F).attr("stroke-width",1),Z.selectAll(".handle").attr("fill",F).attr("fill-opacity",.8),Z.select(".overlay").style("cursor","default"),Z.on("dblclick",()=>{const R=a.domain(),z=[+R[0],+R[1]];x(z)})}if(t==="area"&&I&&I.visibleMarkers.length>0){const N=K.append("g").attr("class","markers").attr("clip-path",`url(#${J})`);I.visibleMarkers.forEach(j=>{N.append("line").attr("class","marker-line").attr("data-timestamp",j.timestamp).attr("x1",j.x).attr("x2",j.x).attr("y1",0).attr("y2",l).attr("stroke",j.color??"#2F42FF").attr("stroke-width",2).attr("opacity",0),j.label&&N.append("text").attr("class","marker-label").attr("data-timestamp",j.timestamp).attr("x",j.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",j.color??"#2F42FF").attr("opacity",0)}),I.markersGroup=N}if(t==="area"&&M&&C&&Qa({svg:e,events:b,xScale:a,chartHeight:l,chartWidth:o,timelineHeight:A,timelineOffset:k,instanceId:y,setHoveredTimelineEvent:C,enableBrush:m,onTimeRangeChange:x,minAllowedTime:$,maxAllowedTime:Y,brushColor:F}),t==="area"){const N=(I==null?void 0:I.markersGroup)??lt.append("g").attr("class","empty-markers-group"),j=(I==null?void 0:I.visibleMarkers)??[];j0(lt,N,j,o,l,m,w??(()=>{}),u,B,L)}}function eT(e,t,n,r,i,a,s,o,l,u,c,f,h,p=!0,g=14,d,m,x,y,v,_){const S=e.select(_?`.main-chart-group-${_}`:".main-chart-group");S.selectAll(".markers").remove(),S.selectAll(".marker-hover-overlay").remove(),S.selectAll(".brush").remove(),t==="stacked-area"||t==="area"?nT(S,n,r,i,a,s,o,l,u,f,h,p,g,d,m,x,y,v,_):rT(S,n,r,i,a,s,o,l,u,f,h,p,g,d,m,x,y,v,_)}function Ni(e,t,n,r,i,a,s,o){const l=e[a];if(!l)return"";const u=l.find(w=>w.data.timestamp===s);if(!u)return"";const c=u.data,f=t[a];if(!f)return"";const h=f.dataKey,p=c[h];if(!p||p<=0)return"";const g=n.get(s);if(!g)return"";const d=g.x,m=g.width,x=u[0],y=u[1],v=o?i:r(x),_=o?i:r(y),S=[];return S.push(`M ${d} ${v}`),S.push(`L ${d} ${_}`),S.push(`L ${d+m} ${_}`),S.push(`L ${d+m} ${v}`),S.push("Z"),S.join(" ")}function nT(e,t,n,r,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var ha;const v=y?`.seat-${y}`:".seat",_=e.selectAll(v),S=y?`.chart-content-group-${y}`:".chart-content-group";let w=e.select(S);if(w.empty()){const V=e.attr("clip-path"),it=V?((ha=V.match(/url\(#(.+)\)/))==null?void 0:ha[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,pt=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";w=e.append("g").attr("class",pt).attr("clip-path",`url(#${it})`)}if(_.size()===0){Tc(e,t,n,{xScale:a,yScale:s,addClasses:!0,instanceId:y}),c();return}const b=QS(u),M=y?_r.get(y):void 0;M&&(M.destroy(),y&&_r.delete(y));const A=V=>V<.2?"seatsToRings":V<.35?"ringsToBar":V<.464?"axesReveal":V<.6?"barSlide":V<.82?"barsGrow":"barsToArea",k=new U0({seatsToRings:b.seatsToLines,ringsToBar:b.seatsToBar,axesReveal:b.barSlideToTimeline*.3,barSlide:b.barSlideToTimeline*.7,barsGrow:b.axesAndBarsGrow,barsToArea:b.barsToArea},{onStageComplete:V=>{},onProgress:V=>{if(m){const it=A(V);m(V,it)}},onComplete:()=>{c()}});y&&_r.set(y,k),d&&d(k.getControls().getTimeline());const C=t[0].map(V=>V.data),O=KS(C,n),P=o/2,F=r.radius+10,B=l-r.radius*.3,L=Math.max(F,B),$=C.map(V=>V.timestamp),Y=x??Math.max(...$),I=new Map,et=[];$.forEach((V,it)=>{const pt=a(new Date(V)),bt=$[it+1];if(bt){const Bt=a(new Date(bt))-pt;et.push(Bt)}});const K=et.length>0?et.reduce((V,it)=>V+it,0)/et.length:30;$.forEach((V,it)=>{const pt=a(new Date(V)),bt=$[it+1],Bt=it===$.length-1?K:a(new Date(bt))-pt;I.set(V,{x:pt,width:Bt})});const J=O.filter(V=>V.timestamp===Y),st=I.get(Y),lt=666,N=y?`parliament-bar-path parliament-bar-path-${y}`:"parliament-bar-path",j=w.append("g").attr("class",N);J.sort((V,it)=>it.y0-V.y0),new Map().set(Y,{x:lt-st.width/2,width:st.width});const Z=[],R=(r.radius-r.innerRadius)*.6,D=l*.8,T=L,X=J.reduce((V,it)=>V+(it.y1-it.y0),0);let Q=0;n.forEach(V=>{const it=J.find(ve=>ve.dataKey===V.dataKey);if(!it)return;const Jt=(it.y1-it.y0)/X*D,Bt=T-Q,Se=T-Q-Jt,xe=lt-R/2,Le=`M ${xe} ${Bt} L ${xe} ${Se} L ${xe+R} ${Se} L ${xe+R} ${Bt} Z`;Q+=Jt;const Ke=j.append("path").attr("class",`parliament-bar-segment category-${Ae(it.dataKey)}`).attr("d",Le).attr("fill",it.color).style("opacity",0).node();Ke&&Z.push(Ke)}),y&&(window.orchestratorMap=_r);const W=k.getControls().getTimeline(),ut=b.seatsToLines/1e3,H=b.seatsToBar/1e3;W.call(()=>{m==null||m(W.progress(),"seatsToRings")},[],"seatsToRings");const ot=_.nodes(),gt=P,yt=L,vt=Math.max(...r.seats.map(V=>V.ring)),rt=r.seats.filter(V=>V.ring===vt),at=e.append("g").attr("class",`seat-lines-${y||"default"}`),_t=n.map(V=>{const it=_.filter(`.seat-${Ae(V.dataKey)}`).size();return it>0?{name:V.dataKey,seatCount:it,color:V.color}:null}).filter(V=>V!==null).reverse(),dt=_t.reduce((V,it)=>V+it.seatCount,0),xt=rt.length,Et=r.radius-r.innerRadius,At=Et*.6,ee=At/2,ne=Et*.6,Pt=[];let ge=0;_t.forEach(V=>{const it=Math.max(1,Math.round(V.seatCount/dt*xt));for(let pt=0;pt<it;pt++){const bt=(ge+pt)/xt,Jt=r.arcAngle*Math.PI/180,Se=-Jt/2-Math.PI/2+bt*Jt,xe=(r.innerRadius+r.radius)/2,Le=gt+Math.cos(Se)*xe,Ke=yt+Math.sin(Se)*xe,ve=Math.cos(Se),Gn=Math.sin(Se),lr=Le-ee*ve,Fr=Ke-ee*Gn,ce=Le+ee*ve,Yn=Ke+ee*Gn,Wn=at.append("line").attr("class","seat-line").attr("x1",lr).attr("y1",Fr).attr("x2",ce).attr("y2",Yn).attr("stroke",V.color).attr("stroke-width",r.seatSize*2).attr("stroke-linecap","butt").style("opacity",0).attr("data-angle",Se*180/Math.PI).attr("data-center-x",Le).attr("data-center-y",Ke).attr("data-initial-length",At).node();Pt.push({element:Wn,angle:Se})}ge+=it});const Vt=()=>{at.remove()},Zt=ut*.5,Rt=0,It=[];if(It.push(...ot),It.sort((V,it)=>{const pt=parseInt(V.getAttribute("data-layout-index")||"-1",10),bt=parseInt(it.getAttribute("data-layout-index")||"-1",10);return pt-bt}),It.length>0&&Pt.length>0){const V=Pt.map(it=>it.element);W.to(It,{attr:{r:1.5},duration:Zt*.3,ease:"power2.in"},`seatsToRings+=${Rt}`),V.forEach(it=>{const pt=it.getAttribute("x1")||"0",bt=it.getAttribute("y1")||"0",Jt=it.getAttribute("x2")||"0",Bt=it.getAttribute("y2")||"0";it.setAttribute("data-final-x1",pt),it.setAttribute("data-final-y1",bt),it.setAttribute("data-final-x2",Jt),it.setAttribute("data-final-y2",Bt),it.setAttribute("x1",pt),it.setAttribute("y1",bt),it.setAttribute("x2",pt),it.setAttribute("y2",bt)}),W.to(V,{attr:{x2:(it,pt)=>parseFloat(pt.getAttribute("data-final-x2")||"0"),y2:(it,pt)=>parseFloat(pt.getAttribute("data-final-y2")||"0")},opacity:.9,duration:Zt*.6,ease:"power2.out"},`seatsToRings+=${Rt+Zt*.2}`),W.to(It,{opacity:0,duration:Zt*.3,ease:"power2.out"},`seatsToRings+=${Rt+Zt*.3}`)}const Re=ut*.05,Qt=ut*.7,oe=Rt+Zt+Re;if(Pt.length>0){const V=lt,it=L,bt=l*.8/Pt.length,Jt=it,Bt=[...Pt].sort((Le,Ke)=>Ke.angle-Le.angle),xe=.6/Bt.length;Bt.forEach((Le,Ke)=>{const ve=V,lr=Jt-Ke*bt,Fr=xe*Ke*Qt,ce=Le.element,Yn=parseFloat(ce.getAttribute("data-final-x1")||"0"),Wn=parseFloat(ce.getAttribute("data-final-y1")||"0"),mi=parseFloat(ce.getAttribute("data-final-x2")||"0"),$r=parseFloat(ce.getAttribute("data-final-y2")||"0"),pa=(Yn+mi)/2,xn=(Wn+$r)/2,Xn=Math.atan2($r-Wn,mi-Yn),ur=Math.sqrt(Math.pow(mi-Yn,2)+Math.pow($r-Wn,2));W.to({progress:0},{progress:1,duration:Qt*.5,ease:"power2.inOut",delay:Fr,onUpdate:function(){const ie=this.progress(),xs=pa+(ve-pa)*ie,vs=xn+(lr-xn)*ie,vn=40*4*ie*(1-ie),cr=xs,fr=vs-vn,ws=0-Xn,En=Xn+ws*ie*ie,da=(ur+(ne-ur)*ie)/2,Iy=cr-da*Math.cos(En),zy=fr-da*Math.sin(En),By=cr+da*Math.cos(En),Uy=fr+da*Math.sin(En);ce.setAttribute("x1",Iy.toString()),ce.setAttribute("y1",zy.toString()),ce.setAttribute("x2",By.toString()),ce.setAttribute("y2",Uy.toString())},onComplete:function(){const ie=ne/2;ce.setAttribute("x1",(ve-ie).toString()),ce.setAttribute("y1",lr.toString()),ce.setAttribute("x2",(ve+ie).toString()),ce.setAttribute("y2",lr.toString())}},`seatsToRings+=${oe}`),W.to(Le.element,{opacity:.95,duration:Qt*.3,ease:"power2.out",delay:Fr},`seatsToRings+=${oe}`)})}const we=at,me=[];J.forEach((V,it)=>{const pt=_.filter(`.seat-${Ae(V.category)}`),bt=pt.size();if(bt===0)return;const Jt=s(V.y1),Bt=s(V.y0)-s(V.y1),Se=pt.nodes().sort((xn,Xn)=>{const ur=parseInt(xn.getAttribute("data-layout-index")||"-1",10),ie=parseInt(Xn.getAttribute("data-layout-index")||"-1",10);return ur-ie}),xe=Math.max(st.width,100),Le=Bt,Ke=xe/Math.max(Le,1),ve=Math.max(2,Math.ceil(Math.sqrt(bt*Ke))),Gn=Math.ceil(bt/ve),lr=xe*.8,Fr=Le*.8,ce=ve>1?lr/(ve-1):0,Yn=Gn>1?Fr/(Gn-1):0,Wn=ve>1?(ve-1)*ce:0,mi=Gn>1?(Gn-1)*Yn:0,$r=lt-xe/2+(xe-Wn)/2,pa=Jt+(Le-mi)/2;Se.forEach((xn,Xn)=>{const ur=parseInt(xn.getAttribute("data-layout-index")||"-1",10),ie=ur>=0?r.seats[ur]:void 0,xs=ie?P+ie.x:parseFloat(xn.getAttribute("cx")||"0"),vs=ie?L+ie.y:parseFloat(xn.getAttribute("cy")||"0"),Ef=(ie==null?void 0:ie.radius)||parseFloat(xn.getAttribute("r")||"4"),vn=bt%ve;let cr,fr;if(vn>0&&Xn<vn)fr=0,cr=Xn;else{const En=Xn-(vn>0?vn:0);cr=En%ve,fr=Math.floor(En/ve)+(vn>0?1:0)}let bs=$r+cr*ce;if(vn>0&&fr===0){const En=vn>1?(vn-1)*ce:0,Df=(Wn-En)/2;bs=$r+Df+cr*ce}const ws=pa+fr*Yn;me.push({element:xn,startX:xs,startY:vs,startRadius:Ef,category:V.dataKey,segmentIndex:it,endY:ws,endX:bs})})});const Ge=me.map(V=>{const it=V.startX-P,pt=V.startY-L,bt=Math.atan2(pt,it);return{...V,angle:bt}});Ge.sort((V,it)=>it.angle-V.angle);const sn=H*.8,Ye=.6,Fe=Ge.length,ye=sn/Math.max(Fe,1)*(Fe-1)+Ye,kt=H*.3,Lt=ye;W.to(Z,{opacity:1,duration:kt,ease:"power2.inOut"},`seatsToBar+=${Lt}`),we&&(W.to(we.selectAll(".seat-line").nodes(),{opacity:0,duration:kt,ease:"power2.inOut"},`seatsToBar+=${Lt}`),W.call(()=>{Vt()},[],`seatsToBar+=${Lt+kt}`));const Mt=b.barSlideToTimeline/1e3;let Yt=null,_e=null;if(f){const it=qn(a).ticks(6).tickPadding(12);p&&it.tickFormat(bt=>p(bt.getTime())),Yt=e.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${l})`).attr("opacity",0),Yt.call(it).selectAll("text").attr("font-size",h).attr("font-weight",500);const pt=In(s).ticks(5);pt.tickFormat(bt=>+bt==0?"":g?g(bt):String(bt)),_e=e.append("g").attr("class","axis axis-y").attr("opacity",0),_e.call(pt).selectAll("text").attr("font-size",h).attr("font-weight",500)}const Wt=b.crossFadePause/1e3,U=Lt+kt+Wt;Z.forEach(V=>{const it=Array.from(V.classList).find(Bt=>Bt.startsWith("category-"));if(!it||!J.find(Bt=>Ae(Bt.dataKey)===it.replace("category-","")))return;const bt=n.findIndex(Bt=>Ae(Bt.dataKey)===it.replace("category-",""));if(bt===-1)return;const Jt=Ni(t,n,I,s,l,bt,Y,!1);Jt&&W.to(V,{attr:{d:Jt},duration:Mt,ease:"power2.out"},`seatsToBar+=${U}`)});const ct=as().x(V=>a(V.data.timestamp)).y0(V=>s(V[0])).y1(V=>s(V[1])).curve(kr),ft=new Map;t.forEach((V,it)=>{const pt=n[it];if(pt){const bt=ct(V)||"";ft.set(pt.dataKey,bt)}});const wt=U+Mt;f&&Yt&&_e&&W.to([Yt.node(),_e.node()],{opacity:1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${U}`);const St=w.select(".grid-vertical"),zt=w.select(".grid-horizontal");if(!St.empty()||!zt.empty()){const it=[];St.empty()||it.push(St.node()),zt.empty()||it.push(zt.node()),W.to(it,{opacity:.1,duration:.6,ease:"power2.inOut"},`seatsToBar+=${U}`)}const re=b.axesAndBarsGrow/1e3,le=b.barsToArea/1e3,ht=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",Nt=w.append("g").attr("class",ht);$.forEach(V=>{if(V===Y)return;const it=I.get(V);it&&n.forEach((pt,bt)=>{const Jt=Ni(t,n,I,s,l,bt,V,!0),Bt=Ni(t,n,I,s,l,bt,V,!1);if(!Jt||!Bt)return;const Se=y?`histogram-path histogram-path-${y} category-${Ae(pt.dataKey)}`:`histogram-path category-${Ae(pt.dataKey)}`;Nt.append("path").attr("class",Se).attr("d",Jt).attr("fill",pt.color).attr("stroke",pt.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",pt.dataKey).attr("data-timestamp",V).attr("data-x-position",it.x).attr("data-full-height-path",Bt)})});const ue=y?`.histogram-path-${y}`:".histogram-path",Ee=Nt.selectAll(ue);W.to(Ee.nodes(),{opacity:1,duration:.3,ease:"power2.inOut"},`seatsToBar+=${wt}`);const De=st.x+st.width/2;Ee.each(function(){var xe;const V=this.getAttribute("data-full-height-path");if(!V)return;const it=parseFloat(this.getAttribute("data-x-position")||"0"),pt=parseFloat(this.getAttribute("data-timestamp")||"0"),bt=((xe=I.get(pt))==null?void 0:xe.width)||0,Jt=it+bt/2,Se=Math.abs(Jt-De)*8e-4;W.to(this,{attr:{d:V},duration:re,ease:"power2.out"},`seatsToBar+=${wt+Se}`)});const We=wt+re,$e=$[$.length-1],Xe=a(new Date($e))+K,sr=a.invert(Xe).getTime(),Pr=t.map(V=>{const it=V[V.length-1],pt={...it,data:{...it.data,timestamp:sr}};return[...V,pt]});Tc(e,Pr,n,{xScale:a,yScale:s,addClasses:!0,instanceId:y});const Rf=y?`.area-${y}`:".area",or=e.selectAll(Rf);or.attr("opacity",0),W.to(Ee.nodes(),{opacity:0,duration:le,ease:"power2.inOut"},`seatsToBar+=${We}`);const fa=j.selectAll("path").nodes();fa.length>0&&W.to(fa,{opacity:0,duration:le,ease:"power2.inOut"},`seatsToBar+=${We}`),W.to(or.nodes(),{opacity:1,duration:le,ease:"power2.inOut"},`seatsToBar+=${We}`);const _s=c;k.getControls().getTimeline().eventCallback("onComplete",()=>{const V=y?`.morph-bar-${y}`:".morph-bar";e.selectAll(V).remove();const it=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(it).remove();const pt=y?`.seat-${y}`:".seat";e.selectAll(pt).style("pointer-events","none"),f&&(Yt&&Yt.attr("opacity",1),_e&&_e.attr("opacity",1)),_s()}),k.play()}function rT(e,t,n,r,i,a,s,o,l,u,c,f=!0,h=14,p,g,d,m,x,y){var Wt;const v=y?`.chart-content-group-${y}`:".chart-content-group";let _=e.select(v);if(_.empty()){const U=e.attr("clip-path"),ct=U?((Wt=U.match(/url\(#(.+)\)/))==null?void 0:Wt[1])||`chart-clip-${Math.random().toString(36).substr(2,9)}`:`chart-clip-${Math.random().toString(36).substr(2,9)}`,ft=y?`chart-content-group chart-content-group-${y}`:"chart-content-group";_=e.append("g").attr("class",ft).attr("clip-path",`url(#${ct})`)}const S=y?`.area-${y}`:".area",w=e.selectAll(S);if(w.size()===0){iT(e,n,r,o,l,y),c();return}const b={areaToBar:u*.18,barsShrink:u*.22,barSlide:u*.22,axesHide:u*.03,barToRings:u*.07,ringsExpand:u*.18,ringsHold:u*.05,ringsToSeats:u*.07},M=y?_r.get(y):void 0;M&&(M.destroy(),y&&_r.delete(y));const A=U=>U<.18?"areaToBar":U<.4?"barsShrink":U<.62?"barSlide":U<.65?"axesHide":U<.72?"barToRings":U<.9?"ringsExpand":U<.95?"ringsHold":"ringsToSeats",k=new U0({seatsToRings:b.ringsToSeats,ringsHold:b.ringsHold,ringsToBar:b.barToRings,axesReveal:b.axesHide,barSlide:b.barSlide,barsGrow:b.barsShrink,barsToArea:b.areaToBar},{onStageComplete:U=>{},onProgress:U=>{if(m){const ct=A(U);m(U,ct)}},onComplete:()=>{c()}});y&&_r.set(y,k),d&&d(k.getControls().getTimeline());const O=t[0].map(U=>U.data).map(U=>U.timestamp),P=x??Math.max(...O),F=new Map,B=[];O.forEach((U,ct)=>{const ft=a(new Date(U)),wt=O[ct+1];if(wt){const zt=a(new Date(wt))-ft;B.push(zt)}});const L=B.length>0?B.reduce((U,ct)=>U+ct,0)/B.length:30;O.forEach((U,ct)=>{const ft=a(new Date(U)),wt=O[ct+1],zt=ct===O.length-1?L:a(new Date(wt))-ft;F.set(U,{x:ft,width:zt})});const $=k.getControls().getTimeline(),Y=b.areaToBar/1e3,I=y?`histogram-paths histogram-paths-${y}`:"histogram-paths",et=_.append("g").attr("class",I);O.forEach(U=>{const ct=F.get(U);ct&&n.forEach((ft,wt)=>{const St=Ni(t,n,F,s,l,wt,U,!1);if(!St)return;const zt=y?`histogram-path histogram-path-${y} category-${Ae(ft.dataKey)}`:`histogram-path category-${Ae(ft.dataKey)}`;et.append("path").attr("class",zt).attr("d",St).attr("fill",ft.color).attr("stroke",ft.color).attr("stroke-width",.5).attr("shape-rendering","crispEdges").attr("opacity",0).attr("data-category",ft.dataKey).attr("data-timestamp",U).attr("data-x-position",ct.x)})});const K=y?`.histogram-path-${y}`:".histogram-path",J=et.selectAll(K);$.to(w.nodes(),{opacity:0,duration:Y,ease:"power2.inOut"},"areaToBar"),$.to(J.nodes(),{opacity:1,duration:Y,ease:"power2.inOut"},"areaToBar");const st=b.barsShrink/1e3,lt=Y;J.each(function(){const U=parseFloat(this.getAttribute("data-timestamp")||"0");if(U===P)return;const ct=n.find(St=>this.classList.contains(`category-${Ae(St.dataKey)}`));if(!ct)return;const ft=n.indexOf(ct),wt=Ni(t,n,F,s,l,ft,U,!0);wt&&$.to(this,{attr:{d:wt},duration:st,ease:"power2.in"},lt)});const N=b.axesHide/1e3,j=lt+st;if(f){const U=e.select(".axis-x"),ct=e.select(".axis-y");U.empty()||$.to(U.node(),{opacity:0,duration:N,ease:"power2.inOut"},j),ct.empty()||$.to(ct.node(),{opacity:0,duration:N,ease:"power2.inOut"},j)}const nt=_.select(".grid-vertical"),Z=_.select(".grid-horizontal");nt.empty()||$.to(nt.node(),{opacity:0,duration:N,ease:"power2.inOut"},j),Z.empty()||$.to(Z.node(),{opacity:0,duration:N,ease:"power2.inOut"},j);const R=[];t.forEach((U,ct)=>{const ft=U.find(St=>St.data.timestamp===P);if(!ft)return;const wt=n[ct];wt&&R.push({category:wt.label,dataKey:wt.dataKey,color:wt.color,y0:ft[0],y1:ft[1]})}),R.sort((U,ct)=>ct.y0-U.y0);const z=R.reduce((U,ct)=>U+(ct.y1-ct.y0),0),D=r.radius-r.innerRadius,T=o/2,X=r.radius+10,Q=l-r.radius*.3,W=Math.max(X,Q),ut=D*.6,ot=l*.8,gt=W,yt=b.barSlide/1e3,vt=j+N,rt=666,at=J.nodes().filter(U=>parseFloat(U.getAttribute("data-timestamp")||"0")!==P);$.to(at,{opacity:0,duration:yt*.2,ease:"power2.out"},vt);const _t=J.nodes().filter(U=>parseFloat(U.getAttribute("data-timestamp")||"0")===P);_t.forEach(U=>{const ct=U.getAttribute("data-category");if(!ct)return;const ft=R.find(Ee=>Ee.dataKey===ct);if(!ft)return;const zt=(ft.y1-ft.y0)/z*ot;let re=0;for(const Ee of n){const De=R.find(Rn=>Rn.dataKey===Ee.dataKey);if(!De)continue;if(De.dataKey===ft.dataKey)break;const $e=(De.y1-De.y0)/z;re+=$e*ot}const le=gt-re,ht=gt-re-zt,Nt=rt-ut/2,ue=`M ${Nt} ${le} L ${Nt} ${ht} L ${Nt+ut} ${ht} L ${Nt+ut} ${le} Z`;$.to(U,{attr:{d:ue},duration:yt,ease:"power2.inOut"},vt)});const dt=b.barToRings/1e3,xt=vt+yt,Et=b.ringsExpand/1e3,At=xt+dt,ee=b.ringsHold/1e3,ne=At+Et,Pt=b.ringsToSeats/1e3,ge=ne+ee,Vt=Math.max(...r.seats.map(U=>U.ring)),Zt=r.seats.filter(U=>U.ring===Vt),Rt=_.append("g").attr("class",`slinky-${y||"h2p-default"}`),It=()=>{Rt.remove()};Zt.forEach((U,ct)=>{const ft=n.find(wt=>wt.label===U.category);ft&&Rt.append("line").attr("class","slinky-ring").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0).attr("stroke",ft.color).attr("stroke-width",r.seatSize*2).attr("stroke-linecap","butt").attr("data-category",U.category).attr("data-category-index",U.categoryIndex).attr("data-ring-index",ct).attr("data-seat-x",T+U.x).attr("data-seat-y",W+U.y).attr("data-seat-angle",Math.atan2(U.y,U.x)).style("opacity",0)});const Re=Rt.selectAll(".slinky-ring").nodes(),Qt=rt,oe=ot/Re.length,we=[...Re].sort((U,ct)=>{const ft=parseFloat(U.getAttribute("data-seat-angle")||"0");return parseFloat(ct.getAttribute("data-seat-angle")||"0")-ft}),me=gt;we.forEach((U,ct)=>{const ft=me-ct*oe,St=ut/2,zt=Qt-St,re=Qt+St;U.setAttribute("x1",zt.toString()),U.setAttribute("y1",ft.toString()),U.setAttribute("x2",re.toString()),U.setAttribute("y2",ft.toString()),U.style.opacity="0"}),$.to(_t,{opacity:0,duration:dt*.7,ease:"power2.out"},xt+dt*.3),$.to(we,{opacity:1,duration:dt,ease:"power2.in",stagger:.005},xt);const Ge=D*.8;we.forEach((U,ct)=>{const ft=parseFloat(U.getAttribute("data-seat-x")||"0"),wt=parseFloat(U.getAttribute("data-seat-y")||"0"),St=parseFloat(U.getAttribute("data-seat-angle")||"0"),zt=(we.length-1-ct)/we.length*(Et*.4),re=parseFloat(U.getAttribute("x1")||"0"),le=parseFloat(U.getAttribute("y1")||"0"),ht=parseFloat(U.getAttribute("x2")||"0"),Nt=parseFloat(U.getAttribute("y2")||"0"),ue=(re+ht)/2,Ee=(le+Nt)/2,De=Math.atan2(Nt-le,ht-re),We=Math.sqrt(Math.pow(ht-re,2)+Math.pow(Nt-le,2)),$e=ft-Ge/2*Math.cos(St),Rn=wt-Ge/2*Math.sin(St);$.to({progress:0},{progress:1,duration:Et*.7,ease:"power2.out",onUpdate:function(){const Xe=this.progress(),ln=ue+($e-ue)*Xe,sr=Ee+(Rn-Ee)*Xe,Pr=De+(St-De)*Xe,or=(We+(Ge-We)*Xe)/2,fa=ln-or*Math.cos(Pr),_s=sr-or*Math.sin(Pr),ha=ln+or*Math.cos(Pr),V=sr+or*Math.sin(Pr);U.setAttribute("x1",fa.toString()),U.setAttribute("y1",_s.toString()),U.setAttribute("x2",ha.toString()),U.setAttribute("y2",V.toString())}},At+zt),$.to(U,{opacity:.9,duration:Et*.3,ease:"power2.in"},At+zt)}),$.call(()=>{m&&m($.progress(),"ringsHold")},[],ne);const sn=y?`parliament parliament-${y}`:"parliament",Ye=_.append("g").attr("class",sn);r.seats.forEach((U,ct)=>{const ft=n.find(ht=>ht.label===U.category);if(!ft)return;const wt=T+U.x,St=W+U.y;let zt,re,le;U.ring===Vt?(zt=wt,re=St,le=2):(zt=wt,re=St,le=U.radius),Ye.append("circle").attr("cx",zt).attr("cy",re).attr("r",le).attr("fill",ft.color).attr("stroke",ft.color).attr("stroke-width",.5).attr("opacity",0).attr("class",()=>y?`seat seat-${y} seat-${Ae(U.category)}`:`seat seat-${Ae(U.category)}`).attr("data-layout-index",ct).attr("data-ring",U.ring).attr("data-final-x",wt).attr("data-final-y",St).attr("data-final-r",U.radius)});const Fe=y?`.seat-${y}`:".seat",on=Ye.selectAll(Fe);$.to(Re,{opacity:0,duration:Pt*.2,ease:"power3.out"},ge),$.to(on.nodes(),{opacity:.8,duration:Pt*.3,ease:"power2.in"},ge+Pt*.25);const ye=on.nodes(),kt=[],Lt=[];ye.forEach(U=>{parseInt(U.getAttribute("data-ring")||"0")===Vt?kt.push(U):Lt.push(U)});const Mt=Pt*.2,Yt=Pt*.7;kt.forEach(U=>{const ct=parseFloat(U.getAttribute("data-final-r")||"4");$.to(U,{attr:{r:ct},opacity:1,duration:Yt*.6,ease:"power2.out"},ge+Mt)}),Lt.length>0&&$.to(Lt,{opacity:1,duration:Yt*.5,ease:"power2.in"},ge+Mt+Pt*.15);const _e=c;k.getControls().getTimeline().eventCallback("onComplete",()=>{const U=y?`.areas-${y}`:".areas",ct=y?`.histogram-paths-${y}`:".histogram-paths";e.selectAll(U).remove(),e.selectAll(ct).remove(),It(),e.selectAll(".axis-x").remove(),e.selectAll(".axis-y").remove(),_.selectAll(".grid-vertical").remove(),_.selectAll(".grid-horizontal").remove();const ft=y?`.parliament-label-${y}`:".parliament-label";if(e.select(ft).empty()){const St=o/2,zt=r.radius+10,re=l-r.radius*.3,le=Math.max(zt,re),ht=y?`parliament-label parliament-label-${y}`:"parliament-label",Nt=e.append("g").attr("class",ht).attr("transform",`translate(${St},${le-r.radius*.15})`).style("opacity","0").style("pointer-events","none");Nt.append("text").attr("class","label-category").attr("text-anchor","middle").attr("dy","-15").style("font-size","22px").style("fill","#666").style("font-family","system-ui, -apple-system, sans-serif"),Nt.append("text").attr("class","label-value").attr("text-anchor","middle").attr("dy","35").style("font-size","48px").style("font-weight","bold").style("font-family","system-ui, -apple-system, sans-serif");const ue=Nt.append("g").attr("class","scale-indicator").attr("transform","translate(0, 65)").style("opacity","0");ue.append("circle").attr("r",4).attr("cx",-30).attr("cy",0).style("fill","#888"),ue.append("text").attr("x",-20).attr("y",0).attr("dy","0.35em").attr("text-anchor","start").style("font-size","18px").style("fill","#666").style("font-style","italic").style("font-family","system-ui, -apple-system, sans-serif")}_e()}),k.play()}function iT(e,t,n,r,i,a){const s=r/2,o=n.radius+10,l=i-n.radius*.3,u=Math.max(o,l);H0(e,n,t,{centerX:s,centerY:u,addClasses:!0,instanceId:a,parliamentRadius:n.radius})}function qi(e,t,n,r,i){const a=i?`.parliament-label-${i}`:".parliament-label",s=Ot(e).select(a);if(!s.empty())if(t){s.style("opacity","1"),s.select(".label-category").text(t.label).style("fill","#666");const o=t.value>1?"repos":"repo";s.select(".label-value").text(`${t.value} ${o}`).style("fill",t.color);const l=s.select(".scale-indicator");n?l.style("opacity","1").select("text").text(`= ~${r} repos`):l.style("opacity","0")}else s.style("opacity","0")}function Ys(e,t,n,r,i,a,s,o,l){const u=e.querySelectorAll(".seat");if(!u||u.length===0)return;const c=n[n.length-1];if(!c)return;const f=[];u.forEach(p=>{const g=p;g.style.cursor="pointer",g.style.transition="fill-opacity 150ms ease, stroke-opacity 150ms ease"}),u.forEach(p=>{const m=(p.getAttribute("class")||"").split(/\s+/).filter(S=>S.startsWith("seat-")),x=m[m.length-1];if(!x)return;const y=x.substring(5),v=t.find(S=>Ae(S.label)===y);if(!v)return;const _=()=>{i(v.label);const S=Math.round(c.values[v.dataKey]||0),w=pf(v.color),b={label:v.label,value:S,color:w};a&&a(b),qi(e,b,s??!1,o??1,l),Ii(e,v.label)};p.addEventListener("mouseenter",_),f.push({element:p,handler:_})});const h=()=>{i(null),a&&a(null),qi(e,null,!1,1,l),Ii(e,null)};return e.addEventListener("mouseleave",h),r&&Ii(e,r),()=>{f.forEach(({element:p,handler:g})=>{p.removeEventListener("mouseenter",g)}),e.removeEventListener("mouseleave",h),u.forEach(p=>{const g=p;g.style.cursor="",g.style.transition=""})}}function Ii(e,t){const n=e.querySelectorAll(".seat"),r=t?Ae(t):null;n.forEach(i=>{const a=i,l=(i.getAttribute("class")||"").split(/\s+/).filter(f=>f.startsWith("seat-")),u=l[l.length-1];if(!u)return;const c=u.substring(5);r?c===r?(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1")):(a.setAttribute("fill-opacity","0.3"),a.setAttribute("stroke-opacity","0.2")):(a.setAttribute("fill-opacity","1"),a.setAttribute("stroke-opacity","1"))})}const G0=({data:e,categories:t,mode:n,width:r=900,height:i=400,margin:a={top:10,right:30,bottom:40,left:60},timeRange:s,showGrid:o=!0,showAxes:l=!0,axisLabelColor:u,axisLabelSize:c=14,formatDate:f,formatValue:h,markers:p=[],arcAngle:g=200,parliamentRadius:d=200,seatSize:m=4.5,animationDuration:x=900,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:w,hoveredCategory:b,maxSeats:M=500,showTooltip:A=!0,showTable:k=!1,showScaledIndicator:C=!0,parliamentTimestamp:O,enableBrush:P=!1,onTimeRangeChange:F,minAllowedTime:B,maxAllowedTime:L,timelineEvents:$=[],showTimeline:Y=!1,timelineHeight:I=40,timelineOffset:et,brushColor:K="#69b3a2",showCrosshair:J=!1,crosshairColor:st="#666",crosshairDashArray:lt="4,4"})=>{const N=G.useRef(null),[j,nt]=G.useState(null),Z=G.useCallback(rt=>{w&&w(rt)},[w]),R=12,D=et??6+R+c+R,T=e[e.length-1],X=T?t.reduce((rt,at)=>rt+(T.values[at.dataKey]||0),0):0,Q=X>M,W=Q?Math.round(X/M):1,ut=Y&&n==="stacked-area"?i+I+D:i,{isMorphing:H,currentMode:ot,visibleMarkers:gt,hoveredMarker:yt,hoveredTimelineEvent:vt}=JS({containerRef:N,data:e,categories:t,mode:n,width:r,height:i,margin:a,timeRange:s,showGrid:o,showAxes:l,axisLabelColor:u,axisLabelSize:c,formatDate:f,formatValue:h,markers:p,arcAngle:g,parliamentRadius:d,seatSize:m,animationDuration:x,onMorphComplete:y,onAnimationStateChange:v,onTimelineReady:_,onAnimationProgress:S,onHoveredDataChange:Z,hoveredCategory:b,maxSeats:M,parliamentTimestamp:O,enableBrush:P,onTimeRangeChange:F,minAllowedTime:B,maxAllowedTime:L,showScaleIndicator:C&&Q,reposPerSeat:W,timelineEvents:$,showTimeline:Y,timelineHeight:I,timelineOffset:D,brushColor:K,showCrosshair:J,onCrosshairMove:J?nt:void 0});return E.jsxs(q.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[E.jsx("svg",{ref:N,viewBox:`0 0 ${r} ${ut}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),J&&j&&ot==="area"&&!H&&E.jsxs("svg",{viewBox:`0 0 ${r} ${ut}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,width:"100%",height:"auto",pointerEvents:"none"},children:[E.jsx("line",{x1:j.x,y1:a.top,x2:j.x,y2:i-a.bottom,stroke:st,strokeDasharray:lt,strokeWidth:1}),E.jsx("line",{x1:a.left,y1:j.y,x2:r-a.right,y2:j.y,stroke:st,strokeDasharray:lt,strokeWidth:1})]}),ot==="area"&>.map(rt=>{const at=(rt.x+a.left)/r*100,_t=a.top/i*100,dt=new Date(rt.timestamp),xt=f?f(rt.timestamp):dt.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),Et=E.jsxs(q.Box,{children:[E.jsx(q.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:rt.label?.5:0},children:xt}),rt.label&&E.jsx(q.Box,{sx:{color:"white",fontWeight:500},children:rt.label})]});return E.jsx(q.Tooltip,{title:Et,open:(yt==null?void 0:yt.timestamp)===rt.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:E.jsx(q.Box,{sx:{position:"absolute",left:`${at}%`,top:`${_t}%`,width:"1px",height:`${(i-a.top-a.bottom)/i*100}%`,pointerEvents:"none"}})},rt.timestamp)}),vt&&ot==="area"&&E.jsx(q.Tooltip,{title:E.jsxs(q.Box,{children:[E.jsx(q.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:f?f(vt.timestamp):new Date(vt.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),E.jsx(q.Box,{sx:{color:"white",fontWeight:500},children:vt.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:E.jsx(q.Box,{sx:{position:"absolute",left:`${(vt.x+a.left)/r*100}%`,top:`${(i+D+I/2)/ut*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})}),H&&E.jsxs(q.Box,{sx:{position:"absolute",top:8,right:8,padding:"4px 8px",backgroundColor:"rgba(0,0,0,0.7)",color:"white",borderRadius:"4px",fontSize:"12px",pointerEvents:"none",display:"none"},children:["Morphing: ",ot," → ",n]})]})},Y0=[{minRepos:0,maxRepos:10,minArc:90,maxArc:90,minSeatSize:28,maxSeatSize:28},{minRepos:10,maxRepos:25,minArc:90,maxArc:110,minSeatSize:24,maxSeatSize:24},{minRepos:25,maxRepos:50,minArc:110,maxArc:120,minSeatSize:20,maxSeatSize:20},{minRepos:50,maxRepos:100,minArc:120,maxArc:150,minSeatSize:16.5,maxSeatSize:16.5},{minRepos:100,maxRepos:200,minArc:150,maxArc:180,minSeatSize:15,maxSeatSize:15},{minRepos:200,maxRepos:1/0,minArc:180,maxArc:180,minSeatSize:14.5,maxSeatSize:14.5}],df=({repositoryCount:e})=>{const t=Y0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 180;if(t.minArc===t.maxArc)return t.minArc;const n=t.maxRepos-t.minRepos,i=(e-t.minRepos)/n,a=t.maxArc-t.minArc,s=t.minArc+a*i;return Math.round(s)},gf=({repositoryCount:e})=>{const t=Y0.find(o=>e>=o.minRepos&&e<o.maxRepos);if(!t)return 6.5;if(t.minSeatSize===t.maxSeatSize)return t.minSeatSize;const n=t.maxRepos-t.minRepos,i=(e-t.minRepos)/n,a=t.maxSeatSize-t.minSeatSize,s=t.minSeatSize+a*i;return Math.round(s*10)/10};class ia{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ia.prototype.normal={};ia.prototype.property={};ia.prototype.space=void 0;function W0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ia(n,r,t)}function ta(e){return e.toLowerCase()}class je{constructor(t,n){this.attribute=n,this.property=t}}je.prototype.attribute="";je.prototype.booleanish=!1;je.prototype.boolean=!1;je.prototype.commaOrSpaceSeparated=!1;je.prototype.commaSeparated=!1;je.prototype.defined=!1;je.prototype.mustUseProperty=!1;je.prototype.number=!1;je.prototype.overloadedBoolean=!1;je.prototype.property="";je.prototype.spaceSeparated=!1;je.prototype.space=void 0;let aT=0;const mt=Dr(),ae=Dr(),Mc=Dr(),tt=Dr(),qt=Dr(),Zr=Dr(),Ve=Dr();function Dr(){return 2**++aT}const Ac=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:ae,commaOrSpaceSeparated:Ve,commaSeparated:Zr,number:tt,overloadedBoolean:Mc,spaceSeparated:qt},Symbol.toStringTag,{value:"Module"})),Ws=Object.keys(Ac);class mf extends je{constructor(t,n,r,i){let a=-1;if(super(t,n),Ih(this,"space",i),typeof r=="number")for(;++a<Ws.length;){const s=Ws[a];Ih(this,Ws[a],(r&Ac[s])===Ac[s])}}}mf.prototype.defined=!0;function Ih(e,t,n){n&&(e[t]=n)}function di(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new mf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ta(r)]=r,n[ta(a.attribute)]=r}return new ia(t,n,e.space)}const X0=di({properties:{ariaActiveDescendant:null,ariaAtomic:ae,ariaAutoComplete:null,ariaBusy:ae,ariaChecked:ae,ariaColCount:tt,ariaColIndex:tt,ariaColSpan:tt,ariaControls:qt,ariaCurrent:null,ariaDescribedBy:qt,ariaDetails:null,ariaDisabled:ae,ariaDropEffect:qt,ariaErrorMessage:null,ariaExpanded:ae,ariaFlowTo:qt,ariaGrabbed:ae,ariaHasPopup:null,ariaHidden:ae,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qt,ariaLevel:tt,ariaLive:null,ariaModal:ae,ariaMultiLine:ae,ariaMultiSelectable:ae,ariaOrientation:null,ariaOwns:qt,ariaPlaceholder:null,ariaPosInSet:tt,ariaPressed:ae,ariaReadOnly:ae,ariaRelevant:null,ariaRequired:ae,ariaRoleDescription:qt,ariaRowCount:tt,ariaRowIndex:tt,ariaRowSpan:tt,ariaSelected:ae,ariaSetSize:tt,ariaSort:null,ariaValueMax:tt,ariaValueMin:tt,ariaValueNow:tt,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function K0(e,t){return t in e?e[t]:t}function V0(e,t){return K0(e,t.toLowerCase())}const sT=di({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zr,acceptCharset:qt,accessKey:qt,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:qt,autoFocus:mt,autoPlay:mt,blocking:qt,capture:null,charSet:null,checked:mt,cite:null,className:qt,cols:tt,colSpan:null,content:null,contentEditable:ae,controls:mt,controlsList:qt,coords:tt|Zr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:Mc,draggable:ae,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:qt,height:tt,hidden:Mc,high:tt,href:null,hrefLang:null,htmlFor:qt,httpEquiv:qt,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:qt,itemRef:qt,itemScope:mt,itemType:qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:tt,manifest:null,max:null,maxLength:tt,media:null,method:null,min:null,minLength:tt,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:mt,optimum:tt,pattern:null,ping:qt,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:qt,required:mt,reversed:mt,rows:tt,rowSpan:tt,sandbox:qt,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:tt,sizes:null,slot:null,span:tt,spellCheck:ae,src:null,srcDoc:null,srcLang:null,srcSet:null,start:tt,step:null,style:null,tabIndex:tt,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:ae,width:tt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qt,axis:null,background:null,bgColor:null,border:tt,borderColor:null,bottomMargin:tt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:tt,leftMargin:tt,link:null,longDesc:null,lowSrc:null,marginHeight:tt,marginWidth:tt,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:tt,rules:null,scheme:null,scrolling:ae,standby:null,summary:null,text:null,topMargin:tt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:tt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:tt,security:null,unselectable:null},space:"html",transform:V0}),oT=di({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ve,accentHeight:tt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:tt,amplitude:tt,arabicForm:null,ascent:tt,attributeName:null,attributeType:null,azimuth:tt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:tt,by:null,calcMode:null,capHeight:tt,className:qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:tt,diffuseConstant:tt,direction:null,display:null,dur:null,divisor:tt,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:tt,enableBackground:null,end:null,event:null,exponent:tt,externalResourcesRequired:null,fill:null,fillOpacity:tt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zr,g2:Zr,glyphName:Zr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:tt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:tt,horizOriginX:tt,horizOriginY:tt,id:null,ideographic:tt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:tt,k:tt,k1:tt,k2:tt,k3:tt,k4:tt,kernelMatrix:Ve,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:tt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:tt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:tt,overlineThickness:tt,paintOrder:null,panose1:null,path:null,pathLength:tt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:tt,pointsAtY:tt,pointsAtZ:tt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ve,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ve,rev:Ve,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ve,requiredFeatures:Ve,requiredFonts:Ve,requiredFormats:Ve,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:tt,specularExponent:tt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:tt,strikethroughThickness:tt,string:null,stroke:null,strokeDashArray:Ve,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:tt,strokeOpacity:tt,strokeWidth:null,style:null,surfaceScale:tt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ve,tabIndex:tt,tableValues:null,target:null,targetX:tt,targetY:tt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ve,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:tt,underlineThickness:tt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:tt,values:null,vAlphabetic:tt,vMathematical:tt,vectorEffect:null,vHanging:tt,vIdeographic:tt,version:null,vertAdvY:tt,vertOriginX:tt,vertOriginY:tt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:tt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:K0}),Z0=di({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Q0=di({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:V0}),J0=di({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lT=/[A-Z]/g,zh=/-[a-z]/g,uT=/^data[-\w.:]+$/i;function ty(e,t){const n=ta(t);let r=t,i=je;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&uT.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(zh,fT);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!zh.test(a)){let s=a.replace(lT,cT);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=mf}return new i(r,t)}function cT(e){return"-"+e.toLowerCase()}function fT(e){return e.charAt(1).toUpperCase()}const ey=W0([X0,sT,Z0,Q0,J0],"html"),yf=W0([X0,oT,Z0,Q0,J0],"svg");function Bh(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function hT(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Uh=/[#.]/g;function pT(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Uh.lastIndex=i;const o=Uh.exec(n),l=n.slice(i,o?o.index:n.length);l&&(a?a==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function Hh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function dT(e){return e.join(" ").trim()}function ny(e,t,n){const r=n?_T(n):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=pT(a,t);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,gT(s))o.unshift(s);else for(const[f,h]of Object.entries(s))mT(e,l.properties,f,h)}for(const u of o)kc(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function gT(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function mT(e,t,n,r){const i=ty(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=Hh(r):i.commaSeparated?a=Bh(r):i.commaOrSpaceSeparated?a=Hh(Bh(r).join(" ")):a=jh(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?yT(r):String(r);if(Array.isArray(a)){const s=[];for(const o of a)s.push(jh(i,i.property,o));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function kc(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)kc(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?kc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function jh(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ta(n)===ta(t)))return!0}return n}function yT(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function _T(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const xT=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"];ny(ey,"div");const aa=ny(yf,"g",xT),ry=(e=aa)=>e("pattern",{id:"greyHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:pn.neoGrey[200]}),e("path",{d:"M0,2 L8,2",stroke:pn.neoGrey[400],"stroke-width":.5}),e("path",{d:"M0,6 L8,6",stroke:pn.neoGrey[400],"stroke-width":.5})]),iy=(e=aa)=>e("pattern",{id:"dataMissingHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFF3CC"}),e("path",{d:"M0,8 L8,0",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M-2,2 L2,-2",stroke:"#FFB800","stroke-width":.5}),e("path",{d:"M6,10 L10,6",stroke:"#FFB800","stroke-width":.5})]),ay=(e=aa)=>e("pattern",{id:"noLstHatchPattern",x:0,y:0,width:8,height:8,patternUnits:"userSpaceOnUse"},[e("rect",{x:0,y:0,width:8,height:8,fill:"#FFE5E5"}),e("path",{d:"M0,0 L8,8",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M-2,6 L2,10",stroke:"#ED4134","stroke-width":.5}),e("path",{d:"M6,-2 L10,2",stroke:"#ED4134","stroke-width":.5})]),Dt={greyHatch:{background:pn.neoGrey[200],lines:pn.neoGrey[400]},dataMissingHatch:{background:"#FFF3CC",lines:"#FFB800"},noLstHatch:{background:"#FFE5E5",lines:"#ED4134"}},vT=({categories:e,activeCategory:t,onCategoryHover:n,mode:r,visible:i=!0})=>E.jsx(q.Box,{className:"category-table",sx:{width:"100%",display:"flex",justifyContent:"center",opacity:i?1:0,transition:"opacity 0.3s ease-in-out","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>n(null),children:E.jsxs(q.Table,{"aria-label":"Categories summary",className:"category-summary-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[E.jsx("thead",{children:E.jsxs(q.TableRow,{children:[E.jsx(q.TableCell,{}),E.jsx(q.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),r==="point-in-time"?E.jsxs(E.Fragment,{children:[E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"#"}),E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"%"})]}):E.jsxs(E.Fragment,{children:[E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Last"}),E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Max"}),E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"Min"})]})]})}),E.jsx("tbody",{children:e.map(a=>{const s=a.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:a.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:a.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:a.color;return E.jsxs(q.TableRow,{onMouseEnter:()=>n(a.id),sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:t===a.id?`${s}15`:"transparent","&:hover":{backgroundColor:`${s}15`}},children:[E.jsx(q.TableCell,{align:"center",sx:{width:20},children:E.jsx(q.Box,{sx:{width:r==="historical"?4:12,height:12,backgroundColor:a.color==="url(#greyHatchPattern)"?Dt.greyHatch.background:a.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.background:a.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.background:a.color,borderRadius:r==="historical"?2:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:t===a.id?"scale(1.2)":"scale(1)",...a.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
16
16
|
0deg,
|
|
17
17
|
transparent,
|
|
18
18
|
transparent 3px,
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
transparent 3px,
|
|
31
31
|
${Dt.noLstHatch.lines} 3px,
|
|
32
32
|
${Dt.noLstHatch.lines} 4px
|
|
33
|
-
)`,borderRadius:r==="historical"?2:"50%"}}}})}),P.jsx(L.TableCell,{children:P.jsxs(L.Stack,{direction:"row",alignItems:"center",gap:.5,children:[P.jsx("span",{children:a.label}),a.tooltip&&P.jsx(L.Tooltip,{title:a.tooltip,placement:"right",arrow:!0,children:P.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),r==="point-in-time"?P.jsxs(P.Fragment,{children:[P.jsx(L.TableCell,{align:"right",children:a.value}),P.jsxs(L.TableCell,{align:"right",children:[a.percentage,"%"]})]}):P.jsxs(P.Fragment,{children:[P.jsx(L.TableCell,{align:"right",children:a.value}),P.jsx(L.TableCell,{align:"right",children:a.max??"-"}),P.jsx(L.TableCell,{align:"right",children:a.min??"-"})]})]},a.id)})})]})}),jh={"N/A":"Items that aren't applicable to this migration.","No LST":"There are no LSTs for these items.","Data Missing":"There is data missing in the LSTs."},xT=(e,t="point-in-time")=>{const n=e.timeSeries[e.timeSeries.length-1];if(!n)return[];const r=e.categories.filter(f=>{var h;return!((h=f.parliamentMapping)!=null&&h.isSpecialCategory)}),i=r.reduce((f,h)=>f+(n.values[h.id]??0),0),a=e.metadata.specialCounts,s=a?(a.notApplicable??0)+(a.noLst??0)+(a.unavailable??0):0,o=i+s,l=t==="historical"?new Map(r.map(f=>{const h=e.timeSeries.map(p=>Math.round(p.values[f.id]??0)).filter(p=>p!==void 0);return[f.id,{max:Math.max(...h),min:Math.min(...h)}]})):null,u=r.map(f=>{const h=Math.round(n.values[f.id]??0),p=h/o*100,g=p>0&&p<1?"< 1":p.toFixed(0),d={id:f.id,label:f.label,value:h,percentage:Number.parseFloat(g),color:f.color,tooltip:jh[f.label]};if(l){const m=l.get(f.id);m&&(d.max=m.max,d.min=m.min)}return d}),c=[];if(a){const f=e.categories.filter(h=>{var p;return(p=h.parliamentMapping)==null?void 0:p.isSpecialCategory});for(const h of f){let p=0;if(h.label==="N/A"?p=Math.round(a.notApplicable??0):h.label==="No LST"?p=Math.round(a.noLst??0):h.label==="Data Missing"&&(p=Math.round(a.unavailable??0)),p>0){const g=p/o*100,d=g>0&&g<1?"< 1":g.toFixed(0);c.push({id:h.id,label:h.label,value:p,percentage:Number.parseFloat(d),color:h.color,tooltip:jh[h.label]})}}}return[...u,...c]},vT=e=>{if(!e.timeSeries[e.timeSeries.length-1])throw new Error("ChronoChart: No data points available");const n=e.timeSeries.map(i=>({timestamp:i.timestamp,values:i.values})),r=e.categories.map(i=>{var a;return{dataKey:i.id,label:i.label,color:i.color,fillOpacity:.7,strokeWidth:(a=i.parliamentMapping)!=null&&a.isSpecialCategory?3:1.5,strokeDasharray:i.strokeDasharray,parliamentMapping:i.parliamentMapping}});return{data:n,categories:r}},bT=e=>{if(!e.timeSeries||e.timeSeries.length===0)throw new Error("ChronoChart: timeSeries must not be empty");if(!e.categories||e.categories.length===0)throw new Error("ChronoChart: categories must not be empty");if(!e.metadata||typeof e.metadata.total!="number")throw new Error("ChronoChart: metadata.total is required");if(!e.timeSeries.every((r,i)=>i===0||r.timestamp>=e.timeSeries[i-1].timestamp))throw new Error("ChronoChart: timeSeries must be sorted by timestamp (ascending)");const n=e.timeSeries[0];if(n){for(const r of e.categories.filter(i=>{var a;return!((a=i.parliamentMapping)!=null&&a.isSpecialCategory)}))if(!(r.id in n.values))throw new Error(`ChronoChart: Category "${r.id}" not found in timeSeries data`)}},ay=({data:e,selectedIndex:t,title:n,subtitle:r,showHeader:i=!0,width:a=960,height:s=400,timeRange:o,onTimeRangeChange:l,minAllowedTime:u,maxAllowedTime:c,enableBrush:f=!1,showLegend:h=!0,showTooltip:p=!0,showGrid:g=!0,axisLabelColor:d,axisLabelSize:m=14,enableAnimation:x=!0,animationDuration:y=5439,disableTimeline:v=!1,formatDate:_,formatValue:S,onAnimationStateChange:w,onTimelineReady:b,onAnimationProgress:M,brushColor:A="#69b3a2",showCrosshair:R=!0,crosshairColor:C="#666",crosshairDashArray:O="4,4"})=>{bT(e);const[D,N]=Y.useState(null),[H,q]=Y.useState(!0),F=Y.useRef("historical"),j=Y.useRef(void 0),$=Y.useMemo(()=>e.timeSeries.length===1||t!==void 0?"point-in-time":"historical",[t,e.timeSeries.length]),it=Y.useMemo(()=>{var ot;let U;return t!==void 0&&e.timeSeries[t]?(U=e.timeSeries[t].timestamp,j.current=U):F.current==="point-in-time"&&$==="historical"&&j.current!==void 0?U=j.current:U=(ot=e.timeSeries[e.timeSeries.length-1])==null?void 0:ot.timestamp,F.current=$,U},[t,e.timeSeries,$]),et=e.timeSeries[0].timestamp,nt=e.timeSeries[e.timeSeries.length-1].timestamp,[J,lt]=Y.useState([et,nt]),I=o??J,Q=Y.useCallback(U=>{const ot=[u!==void 0?Math.max(U[0],u):U[0],c!==void 0?Math.min(U[1],c):U[1]];l?l(ot):lt(ot)},[l,u,c]);Y.useEffect(()=>{N(null)},[$]);const at=Y.useMemo(()=>({top:10,right:30,left:60,bottom:30}),[]),K=Y.useMemo(()=>vT(e),[e]),k=Y.useMemo(()=>xT(e,$),[e,$]),z=Y.useMemo(()=>{const U=e.timeSeries[e.timeSeries.length-1];return U?Object.values(U.values).reduce((ot,gt)=>ot+gt,0):0},[e.timeSeries]),E=Y.useMemo(()=>pf({repositoryCount:z}),[z]),T=Y.useMemo(()=>df({repositoryCount:z}),[z]),X=Y.useMemo(()=>{const U=s-at.top-at.bottom;return Math.round(U*.9)},[s,at]),V=Y.useMemo(()=>e.events?e.events.map(U=>({timestamp:U.timestamp,label:U.eventName,color:typeof U.color=="string"?U.color:"#2F42FF"})):[],[e.events]),G=Y.useCallback(U=>{if(U){const ot=e.categories.find(gt=>gt.label===U.label);N((ot==null?void 0:ot.id)??null)}else N(null)},[e.categories]),ut=Y.useCallback(U=>{q(!U),w&&w(U)},[w]);return P.jsxs(L.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&P.jsxs(L.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&P.jsx(L.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&P.jsx(L.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),P.jsx(L.Box,{sx:{position:"relative",width:"100%"},children:P.jsx(j0,{data:K.data,categories:K.categories,mode:$==="point-in-time"?"parliament":"stacked-area",width:a,height:s,timeRange:I,onTimeRangeChange:Q,minAllowedTime:u,maxAllowedTime:c,enableBrush:f,showGrid:g,showAxes:!0,axisLabelColor:d,axisLabelSize:m,margin:at,markers:V,formatDate:_,formatValue:S,animationDuration:y,onAnimationStateChange:ut,onTimelineReady:b,onAnimationProgress:M,onHoveredDataChange:G,hoveredCategory:D,arcAngle:E,parliamentRadius:X,seatSize:T,parliamentTimestamp:it,timelineEvents:e.events??[],showTimeline:$==="historical"&&!v,brushColor:A,showCrosshair:R,crosshairColor:C,crosshairDashArray:O})}),P.jsx(_T,{categories:k,activeCategory:D,onCategoryHover:N,mode:$,visible:H})]})},wT=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,markers:d=[],markerVisibilityMode:m="hover",onMarkerHoverChange:x,brushColor:y="#69b3a2",showCrosshair:v=!1,onHoveredAreaChange:_,onCrosshairMove:S})=>{Y.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const w=Ot(e.current),b=r-a.left-a.right,M=i-a.top-a.bottom;w.selectAll("*").remove();const A=w.append("g").attr("transform",`translate(${a.left},${a.top})`),R=`d3-chart-clip-${Math.random().toString(36).substr(2,9)}`;w.append("defs").append("clipPath").attr("id",R).append("rect").attr("x",0).attr("y",0).attr("width",b).attr("height",M);const C=A.append("g").attr("clip-path",`url(#${R})`),O=[...t].sort((k,z)=>k.timestamp-z.timestamp),D=n.map(k=>k.dataKey),N=Gi().keys(D),H=N(O),q=t.map(k=>k.timestamp),F=s?s[0]:Math.min(...q),j=s?s[1]:Math.max(...q),$=Yr().domain([new Date(F),new Date(j)]).range([0,b]),it=O.filter(k=>k.timestamp>=F&&k.timestamp<=j),et=N(it),nt=et.length>0?Math.max(...et[et.length-1].map(k=>k[1]??0)):0,J=ni().domain([0,nt*1.1]).range([M,0]).nice();o&&(C.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn($).ticks(6).tickSize(M).tickFormat(()=>"")),C.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(J).ticks(5).tickSize(-b).tickFormat(()=>"")));const lt=is().x(k=>$(new Date(k.data.timestamp))).y0(k=>J(k[0])).y1(k=>J(k[1])).curve(Ar),I=C.append("g").attr("class","areas");if(H.forEach((k,z)=>{const E=n[z];if(!E)return;const T=I.append("path").datum(k).attr("class",`area area-${E.dataKey}`).attr("fill",E.color).attr("fill-opacity",E.fillOpacity??.7).attr("stroke",E.color).attr("stroke-width",E.strokeWidth??1.5).attr("d",lt).attr("pointer-events","none");E.strokeDasharray&&T.attr("stroke-dasharray",E.strokeDasharray)}),d.length>0){const k=C.append("g").attr("class","markers"),z=m==="hover"?0:.6,E=d.filter(T=>T.timestamp>=F&&T.timestamp<=j).map(T=>({...T,x:$(new Date(T.timestamp))}));if(E.forEach(T=>{const X=k.append("line").attr("class","marker-line").attr("data-timestamp",T.timestamp).attr("x1",T.x).attr("x2",T.x).attr("y1",0).attr("y2",M).attr("stroke",T.color??"#131E7A").attr("stroke-width",2).attr("opacity",z);T.strokeDasharray&&X.attr("stroke-dasharray",T.strokeDasharray),T.label&&k.append("text").attr("class","marker-label").attr("data-timestamp",T.timestamp).attr("x",T.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",T.color??"#131E7A").attr("opacity",z).text(T.label)}),m==="hover"&&E.length>0){const T=w.append("g").attr("class","marker-tooltip").attr("transform",`translate(${a.left},${a.top})`).style("pointer-events","none").style("display","none"),X=T.append("rect").attr("fill","#131E7A").attr("rx",4).attr("ry",4).attr("filter","drop-shadow(0px 2px 4px rgba(0,0,0,0.2))"),V=T.append("text").attr("fill","white").attr("font-size",12).attr("font-weight",500).attr("text-anchor","middle");let G=null;const ut=C.append("rect").attr("class","marker-hover-overlay").attr("width",b).attr("height",M).attr("fill","none").attr("pointer-events","all"),U=ot=>{let gt=null,yt=1/0;if(E.forEach(ge=>{const Vt=Math.abs(ot-ge.x);Vt<yt&&(yt=Vt,gt=ge)}),!gt||yt>50)return G!==null&&(G=null,k.selectAll(".marker-line").attr("opacity",0),k.selectAll(".marker-label").attr("opacity",0),T.style("display","none"),x==null||x(!1)),!1;const tt=gt;if(G===null&&(x==null||x(!0)),G===tt.timestamp)return!0;G=tt.timestamp,k.selectAll(".marker-line").attr("opacity",0),k.selectAll(".marker-label").attr("opacity",0),k.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(tt.timestamp)}).attr("opacity",.6),k.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(tt.timestamp)}).attr("opacity",1);const st=new Date(tt.timestamp),_t=p?p(tt.timestamp):st.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),dt=tt.label?`${tt.label}: ${_t}`:_t;V.text(dt);const xt=V.node().getBBox(),Et=8,At=xt.width+Et*2,ee=xt.height+Et*2;X.attr("width",At).attr("height",ee);let ne=tt.x-At/2;const Pt=10;return ne<0?ne=0:ne+At>b&&(ne=b-At),T.attr("transform",`translate(${a.left+ne},${a.top+Pt})`),V.attr("x",At/2).attr("y",ee/2+4),T.style("display","block"),!0};ut.on("mousemove",function(ot){const[gt]=tr(ot,this);U(gt)&&ot.stopPropagation()}),ut.on("mouseleave",function(){G=null,k.selectAll(".marker-line").attr("opacity",0),k.selectAll(".marker-label").attr("opacity",0),T.style("display","none"),x==null||x(!1)})}}if(l){const k=qn($).ticks(6);p&&k.tickFormat(z=>p(+z)),A.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${M})`).call(k).selectAll("text").attr("font-size",11)}if(u){const k=In(J).ticks(5);g&&k.tickFormat(z=>g(+z)),A.append("g").attr("class","axis axis-y").call(k).selectAll("text").attr("font-size",11)}const Q=(k,z)=>{const E=+$.invert(k);let T=-1;for(let U=0;U<O.length-1;U++)if(O[U].timestamp<=E&&O[U+1].timestamp>=E){T=U;break}T===-1&&(E<=O[0].timestamp?T=0:T=O.length-2);const X=O[T],V=O[T+1];if(!X||!V)return null;const G=V.timestamp-X.timestamp,ut=G>0?(E-X.timestamp)/G:0;for(let U=H.length-1;U>=0;U--){const ot=H[U],gt=n[U];if(!ot||!gt)continue;const yt=ot[T],vt=ot[T+1];if(!yt||!vt)continue;const tt=yt[0]+ut*(vt[0]-yt[0]),st=yt[1]+ut*(vt[1]-yt[1]),_t=J(tt),dt=J(st);if(z>=dt&&z<=_t){const xt=st-tt;return{timestamp:E,category:{label:gt.label,color:gt.color},value:xt}}}return null},at=(k,z)=>{const[E,T]=tr(k,z);v&&(S==null||S({x:E+a.left,y:T+a.top}));const X=Q(E,T);_==null||_(X)},K=()=>{S==null||S(null),_==null||_(null)};if(!c){const k=C.append("rect").attr("class","mouse-overlay").attr("width",b).attr("height",M).attr("fill","none").attr("pointer-events","all");k.on("mousemove",function(z){at(z,this)}),k.on("mouseleave",K)}if(c&&h){const k=hi().extent([[0,0],[b,M]]).on("brush",()=>{}).on("end",E=>{if(!E.selection)return;const[T,X]=E.selection,V=[+$.invert(T),+$.invert(X)];h(V),f&&w.select(".brush").call(k.move,null)}),z=w.append("g").attr("class","brush").attr("transform",`translate(${a.left},${a.top})`).call(k);z.select(".selection").style("fill",y).style("fill-opacity","0.4").style("stroke",y).style("stroke-width","2px"),z.selectAll(".handle").style("fill",y).style("fill-opacity","0.9"),z.select(".overlay").on("mousemove",function(E){at(E,this)}).on("mouseleave",K)}return()=>{w.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S])},ST=({data:e,categories:t,title:n,subtitle:r,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,markers:_=[],markerVisibilityMode:S="hover",brushColor:w="#69b3a2",showCrosshair:b=!1,crosshairColor:M="#666",crosshairDashArray:A="4,4"})=>{const R=Y.useRef(null),[C,O]=Y.useState(null),[D,N]=Y.useState(null),[H,q]=Y.useState(!1),F=Y.useCallback(J=>{H||O(J)},[H]),j=Y.useCallback(J=>{H||N(J)},[H]),$=Y.useCallback(J=>{q(J),J&&(O(null),N(null))},[]);wT({containerRef:R,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,markers:_,markerVisibilityMode:S,onMarkerHoverChange:$,brushColor:w,showCrosshair:b,onHoveredAreaChange:F,onCrosshairMove:j});const nt=J=>d?d(J):new Date(J).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0});return P.jsxs(L.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&P.jsxs(L.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&P.jsx(L.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&P.jsx(L.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),P.jsxs(L.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[P.jsx("svg",{ref:R,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),b&&D&&P.jsxs("svg",{viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",pointerEvents:"none"},children:[P.jsx("line",{x1:D.x,y1:u.top,x2:D.x,y2:l-u.bottom,stroke:M,strokeDasharray:A,strokeWidth:1}),P.jsx("line",{x1:u.left,y1:D.y,x2:o-u.right,y2:D.y,stroke:M,strokeDasharray:A,strokeWidth:1})]}),s&&C&&D&&P.jsxs(L.Paper,{elevation:3,sx:{position:"absolute",left:D.x+10,top:D.y-10,pointerEvents:"none",p:2,whiteSpace:"nowrap",zIndex:1e3,transform:D.x>o/2?"translateX(-100%) translateX(-20px)":"none"},children:[P.jsx(L.Typography,{sx:{fontFamily:"monospace",fontSize:"0.875rem",color:"text.secondary",mb:1.5},children:nt(C.timestamp)}),P.jsxs(L.Stack,{direction:"row",spacing:1.5,children:[P.jsx(L.Box,{sx:{width:5,backgroundColor:C.category.color,borderRadius:1}}),P.jsxs(L.Stack,{children:[P.jsx(L.Typography,{sx:{fontWeight:700,fontSize:"1.125rem"},children:C.category.label}),P.jsx(L.Typography,{sx:{fontSize:"1rem",textDecoration:"underline"},children:m?m(C.value):C.value.toLocaleString()})]})]})]})]}),a&&P.jsx(L.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(J=>P.jsxs(L.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[P.jsx(L.Box,{sx:{width:16,height:16,backgroundColor:J.color,opacity:J.fillOpacity??.7,border:`2px solid ${J.color}`,borderRadius:"2px",...J.strokeDasharray&&{backgroundImage:`repeating-linear-gradient(
|
|
33
|
+
)`,borderRadius:r==="historical"?2:"50%"}}}})}),E.jsx(q.TableCell,{children:E.jsxs(q.Stack,{direction:"row",alignItems:"center",gap:.5,children:[E.jsx("span",{children:a.label}),a.tooltip&&E.jsx(q.Tooltip,{title:a.tooltip,placement:"right",arrow:!0,children:E.jsx(Qg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),r==="point-in-time"?E.jsxs(E.Fragment,{children:[E.jsx(q.TableCell,{align:"right",children:a.value}),E.jsxs(q.TableCell,{align:"right",children:[a.percentage,"%"]})]}):E.jsxs(E.Fragment,{children:[E.jsx(q.TableCell,{align:"right",children:a.value}),E.jsx(q.TableCell,{align:"right",children:a.max??"-"}),E.jsx(q.TableCell,{align:"right",children:a.min??"-"})]})]},a.id)})})]})}),Gh={"N/A":"Items that aren't applicable to this migration.","No LST":"There are no LSTs for these items.","Data Missing":"There is data missing in the LSTs."},bT=(e,t="point-in-time")=>{const n=e.timeSeries[e.timeSeries.length-1];if(!n)return[];const r=e.categories.filter(f=>{var h;return!((h=f.parliamentMapping)!=null&&h.isSpecialCategory)}),i=r.reduce((f,h)=>f+(n.values[h.id]??0),0),a=e.metadata.specialCounts,s=a?(a.notApplicable??0)+(a.noLst??0)+(a.unavailable??0):0,o=i+s,l=t==="historical"?new Map(r.map(f=>{const h=e.timeSeries.map(p=>Math.round(p.values[f.id]??0)).filter(p=>p!==void 0);return[f.id,{max:Math.max(...h),min:Math.min(...h)}]})):null,u=r.map(f=>{const h=Math.round(n.values[f.id]??0),p=h/o*100,g=p>0&&p<1?"< 1":p.toFixed(0),d={id:f.id,label:f.label,value:h,percentage:Number.parseFloat(g),color:f.color,tooltip:Gh[f.label]};if(l){const m=l.get(f.id);m&&(d.max=m.max,d.min=m.min)}return d}),c=[];if(a){const f=e.categories.filter(h=>{var p;return(p=h.parliamentMapping)==null?void 0:p.isSpecialCategory});for(const h of f){let p=0;if(h.label==="N/A"?p=Math.round(a.notApplicable??0):h.label==="No LST"?p=Math.round(a.noLst??0):h.label==="Data Missing"&&(p=Math.round(a.unavailable??0)),p>0){const g=p/o*100,d=g>0&&g<1?"< 1":g.toFixed(0);c.push({id:h.id,label:h.label,value:p,percentage:Number.parseFloat(d),color:h.color,tooltip:Gh[h.label]})}}}return[...u,...c]},wT=e=>{if(!e.timeSeries[e.timeSeries.length-1])throw new Error("ChronoChart: No data points available");const n=e.timeSeries.map(i=>({timestamp:i.timestamp,values:i.values})),r=e.categories.map(i=>{var a;return{dataKey:i.id,label:i.label,color:i.color,fillOpacity:.7,strokeWidth:(a=i.parliamentMapping)!=null&&a.isSpecialCategory?3:1.5,strokeDasharray:i.strokeDasharray,parliamentMapping:i.parliamentMapping}});return{data:n,categories:r}},ST=e=>{if(!e.timeSeries||e.timeSeries.length===0)throw new Error("ChronoChart: timeSeries must not be empty");if(!e.categories||e.categories.length===0)throw new Error("ChronoChart: categories must not be empty");if(!e.metadata||typeof e.metadata.total!="number")throw new Error("ChronoChart: metadata.total is required");if(!e.timeSeries.every((r,i)=>i===0||r.timestamp>=e.timeSeries[i-1].timestamp))throw new Error("ChronoChart: timeSeries must be sorted by timestamp (ascending)");const n=e.timeSeries[0];if(n){for(const r of e.categories.filter(i=>{var a;return!((a=i.parliamentMapping)!=null&&a.isSpecialCategory)}))if(!(r.id in n.values))throw new Error(`ChronoChart: Category "${r.id}" not found in timeSeries data`)}},sy=({data:e,selectedIndex:t,title:n,subtitle:r,showHeader:i=!0,width:a=960,height:s=400,timeRange:o,onTimeRangeChange:l,minAllowedTime:u,maxAllowedTime:c,enableBrush:f=!1,showLegend:h=!0,showTooltip:p=!0,showGrid:g=!0,axisLabelColor:d,axisLabelSize:m=14,enableAnimation:x=!0,animationDuration:y=5439,disableTimeline:v=!1,formatDate:_,formatValue:S,onAnimationStateChange:w,onTimelineReady:b,onAnimationProgress:M,brushColor:A="#69b3a2",showCrosshair:k=!0,crosshairColor:C="#666",crosshairDashArray:O="4,4"})=>{ST(e);const[P,F]=G.useState(null),[B,L]=G.useState(!0),$=G.useRef("historical"),Y=G.useRef(void 0),I=G.useMemo(()=>e.timeSeries.length===1||t!==void 0?"point-in-time":"historical",[t,e.timeSeries.length]),et=G.useMemo(()=>{var ot;let H;return t!==void 0&&e.timeSeries[t]?(H=e.timeSeries[t].timestamp,Y.current=H):$.current==="point-in-time"&&I==="historical"&&Y.current!==void 0?H=Y.current:H=(ot=e.timeSeries[e.timeSeries.length-1])==null?void 0:ot.timestamp,$.current=I,H},[t,e.timeSeries,I]),K=e.timeSeries[0].timestamp,J=e.timeSeries[e.timeSeries.length-1].timestamp,[st,lt]=G.useState([K,J]),N=o??st,j=G.useCallback(H=>{const ot=[u!==void 0?Math.max(H[0],u):H[0],c!==void 0?Math.min(H[1],c):H[1]];l?l(ot):lt(ot)},[l,u,c]);G.useEffect(()=>{F(null)},[I]);const nt=G.useMemo(()=>({top:10,right:30,left:60,bottom:30}),[]),Z=G.useMemo(()=>wT(e),[e]),R=G.useMemo(()=>bT(e,I),[e,I]),z=G.useMemo(()=>{const H=e.timeSeries[e.timeSeries.length-1];return H?Object.values(H.values).reduce((ot,gt)=>ot+gt,0):0},[e.timeSeries]),D=G.useMemo(()=>df({repositoryCount:z}),[z]),T=G.useMemo(()=>gf({repositoryCount:z}),[z]),X=G.useMemo(()=>{const H=s-nt.top-nt.bottom;return Math.round(H*.9)},[s,nt]),Q=G.useMemo(()=>e.events?e.events.map(H=>({timestamp:H.timestamp,label:H.eventName,color:typeof H.color=="string"?H.color:"#2F42FF"})):[],[e.events]),W=G.useCallback(H=>{if(H){const ot=e.categories.find(gt=>gt.label===H.label);F((ot==null?void 0:ot.id)??null)}else F(null)},[e.categories]),ut=G.useCallback(H=>{L(!H),w&&w(H)},[w]);return E.jsxs(q.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&E.jsxs(q.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&E.jsx(q.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&E.jsx(q.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),E.jsx(q.Box,{sx:{position:"relative",width:"100%"},children:E.jsx(G0,{data:Z.data,categories:Z.categories,mode:I==="point-in-time"?"parliament":"stacked-area",width:a,height:s,timeRange:N,onTimeRangeChange:j,minAllowedTime:u,maxAllowedTime:c,enableBrush:f,showGrid:g,showAxes:!0,axisLabelColor:d,axisLabelSize:m,margin:nt,markers:Q,formatDate:_,formatValue:S,animationDuration:y,onAnimationStateChange:ut,onTimelineReady:b,onAnimationProgress:M,onHoveredDataChange:W,hoveredCategory:P,arcAngle:D,parliamentRadius:X,seatSize:T,parliamentTimestamp:et,timelineEvents:e.events??[],showTimeline:I==="historical"&&!v,brushColor:A,showCrosshair:k,crosshairColor:C,crosshairDashArray:O})}),E.jsx(vT,{categories:R,activeCategory:P,onCategoryHover:F,mode:I,visible:B})]})},Kn=20,oy=({visible:e,x:t,y:n,containerRef:r,viewBoxWidth:i,viewBoxHeight:a,usePortal:s=!1,scale:o=1,flipThreshold:l,anchorPosition:u="cursor",chartTopMargin:c=20,children:f})=>{const h=G.useRef(null),[p,g]=G.useState(0),[d,m]=G.useState(null),x=G.useCallback(()=>{if(r.current){const k=r.current.getBoundingClientRect();m({width:k.width,height:k.height,left:k.left,top:k.top})}},[r]);if(G.useLayoutEffect(()=>{x();const k=()=>x();return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[x]),G.useLayoutEffect(()=>{e&&x()},[e,x]),G.useLayoutEffect(()=>{h.current&&e&&g(h.current.offsetWidth)},[e]),!e||!d)return null;const y=d.width/i,v=d.height/a,_=t*y,S=n*v,w={pointerEvents:"none",zIndex:1e3,p:2*o,whiteSpace:"nowrap"};if(s){const k=d.left+_,C=d.top+S;if(u==="top"){const et=d.top+c*v,J=(p>0?p:400)/2,st=k+J>window.innerWidth-Kn,lt=k-J<Kn;let N="translateX(-50%)";return st&&!lt?N=`translateX(-50%) translateX(-${k+J-window.innerWidth+Kn}px)`:lt&&!st&&(N=`translateX(-50%) translateX(${Kn-(k-J)}px)`),E.jsx(q.Portal,{children:E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"fixed",left:k,top:et,transform:`${N} translateY(-100%) translateY(-10px)`},children:f})})}if(u==="bottom-corner"){const et=p>0?p:400,K=10,J=k+K+et,st=k-K-et,lt=J>window.innerWidth-Kn,N=st<Kn;let j,nt;return lt?N?(j=window.innerWidth-Kn-et,nt="none"):(j=k-K,nt="translateX(-100%)"):(j=k+K,nt="none"),E.jsx(q.Portal,{children:E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"fixed",left:j,top:C+K,transform:nt},children:f})})}const O=p>0?p:450,F=k+10+O>window.innerWidth-Kn,B=k>window.innerWidth-500,L=l!==void 0?l*y:void 0,$=L!==void 0&&_>L,I=F||B||$?"translateX(-100%) translateX(-20px)":"none";return E.jsx(q.Portal,{children:E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"fixed",left:k+10,top:C-10,transform:I},children:f})})}if(u==="top"){const k=c*v;return E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"absolute",left:_,top:k,transform:"translateX(-50%) translateY(-100%) translateY(-10px)"},children:f})}if(u==="bottom-corner"){const k=p>0?p:400,C=10,O=_+C+k,P=_-C-k,F=O>d.width,B=P<0;let L,$;return F?B?(L=d.width-k,$="none"):(L=_-C,$="translateX(-100%)"):(L=_+C,$="none"),E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"absolute",left:L,top:S+C,transform:$},children:f})}const b=l!==void 0?l*y:void 0,A=b!==void 0&&_>b?"translateX(-100%) translateX(-20px)":"none";return E.jsx(q.Paper,{ref:h,elevation:3,sx:{...w,position:"absolute",left:_+10,top:S-10,transform:A},children:f})},TT=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,markers:d=[],markerVisibilityMode:m="hover",onMarkerHoverChange:x,brushColor:y="#69b3a2",showCrosshair:v=!1,onHoveredAreaChange:_,onCrosshairMove:S})=>{G.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const w=Ot(e.current),b=r-a.left-a.right,M=i-a.top-a.bottom;w.selectAll("*").remove();const A=w.append("g").attr("transform",`translate(${a.left},${a.top})`),k=`d3-chart-clip-${Math.random().toString(36).substr(2,9)}`;w.append("defs").append("clipPath").attr("id",k).append("rect").attr("x",0).attr("y",0).attr("width",b).attr("height",M);const C=A.append("g").attr("clip-path",`url(#${k})`),O=[...t].sort((R,z)=>R.timestamp-z.timestamp),P=n.map(R=>R.dataKey),F=Yi().keys(P),B=F(O),L=t.map(R=>R.timestamp),$=s?s[0]:Math.min(...L),Y=s?s[1]:Math.max(...L),I=Wr().domain([new Date($),new Date(Y)]).range([0,b]),et=O.filter(R=>R.timestamp>=$&&R.timestamp<=Y),K=F(et),J=K.length>0?Math.max(...K[K.length-1].map(R=>R[1]??0)):0,st=ri().domain([0,J*1.1]).range([M,0]).nice();o&&(C.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(I).ticks(6).tickSize(M).tickFormat(()=>"")),C.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(st).ticks(5).tickSize(-b).tickFormat(()=>"")));const lt=as().x(R=>I(new Date(R.data.timestamp))).y0(R=>st(R[0])).y1(R=>st(R[1])).curve(kr),N=C.append("g").attr("class","areas");if(B.forEach((R,z)=>{const D=n[z];if(!D)return;const T=N.append("path").datum(R).attr("class",`area area-${D.dataKey}`).attr("fill",D.color).attr("fill-opacity",D.fillOpacity??.7).attr("stroke",D.color).attr("stroke-width",D.strokeWidth??1.5).attr("d",lt).attr("pointer-events","none");D.strokeDasharray&&T.attr("stroke-dasharray",D.strokeDasharray)}),d.length>0){const R=C.append("g").attr("class","markers"),z=m==="hover"?0:.6,D=d.filter(T=>T.timestamp>=$&&T.timestamp<=Y).map(T=>({...T,x:I(new Date(T.timestamp))}));if(D.forEach(T=>{const X=R.append("line").attr("class","marker-line").attr("data-timestamp",T.timestamp).attr("x1",T.x).attr("x2",T.x).attr("y1",0).attr("y2",M).attr("stroke",T.color??"#131E7A").attr("stroke-width",2).attr("opacity",z);T.strokeDasharray&&X.attr("stroke-dasharray",T.strokeDasharray),T.label&&R.append("text").attr("class","marker-label").attr("data-timestamp",T.timestamp).attr("x",T.x).attr("y",-5).attr("text-anchor","middle").attr("font-size",10).attr("fill",T.color??"#131E7A").attr("opacity",z).text(T.label)}),m==="hover"&&D.length>0){const T=w.append("g").attr("class","marker-tooltip").attr("transform",`translate(${a.left},${a.top})`).style("pointer-events","none").style("display","none"),X=T.append("rect").attr("fill","#131E7A").attr("rx",4).attr("ry",4).attr("filter","drop-shadow(0px 2px 4px rgba(0,0,0,0.2))"),Q=T.append("text").attr("fill","white").attr("font-size",12).attr("font-weight",500).attr("text-anchor","middle");let W=null;const ut=C.append("rect").attr("class","marker-hover-overlay").attr("width",b).attr("height",M).attr("fill","none").attr("pointer-events","all"),H=ot=>{let gt=null,yt=1/0;if(D.forEach(ge=>{const Vt=Math.abs(ot-ge.x);Vt<yt&&(yt=Vt,gt=ge)}),!gt||yt>50)return W!==null&&(W=null,R.selectAll(".marker-line").attr("opacity",0),R.selectAll(".marker-label").attr("opacity",0),T.style("display","none"),x==null||x(!1)),!1;const rt=gt;if(W===null&&(x==null||x(!0)),W===rt.timestamp)return!0;W=rt.timestamp,R.selectAll(".marker-line").attr("opacity",0),R.selectAll(".marker-label").attr("opacity",0),R.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(rt.timestamp)}).attr("opacity",.6),R.selectAll(".marker-label").filter(function(){return Ot(this).attr("data-timestamp")===String(rt.timestamp)}).attr("opacity",1);const at=new Date(rt.timestamp),_t=p?p(rt.timestamp):at.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),dt=rt.label?`${rt.label}: ${_t}`:_t;Q.text(dt);const xt=Q.node().getBBox(),Et=8,At=xt.width+Et*2,ee=xt.height+Et*2;X.attr("width",At).attr("height",ee);let ne=rt.x-At/2;const Pt=10;return ne<0?ne=0:ne+At>b&&(ne=b-At),T.attr("transform",`translate(${a.left+ne},${a.top+Pt})`),Q.attr("x",At/2).attr("y",ee/2+4),T.style("display","block"),!0};ut.on("mousemove",function(ot){const[gt]=er(ot,this);H(gt)&&ot.stopPropagation()}),ut.on("mouseleave",function(){W=null,R.selectAll(".marker-line").attr("opacity",0),R.selectAll(".marker-label").attr("opacity",0),T.style("display","none"),x==null||x(!1)})}}if(l){const R=qn(I).ticks(6);p&&R.tickFormat(z=>p(+z)),A.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${M})`).call(R).selectAll("text").attr("font-size",11)}if(u){const R=In(st).ticks(5);g&&R.tickFormat(z=>g(+z)),A.append("g").attr("class","axis axis-y").call(R).selectAll("text").attr("font-size",11)}const j=(R,z)=>{const D=+I.invert(R);let T=-1;for(let H=0;H<O.length-1;H++)if(O[H].timestamp<=D&&O[H+1].timestamp>=D){T=H;break}T===-1&&(D<=O[0].timestamp?T=0:T=O.length-2);const X=O[T],Q=O[T+1];if(!X||!Q)return null;const W=Q.timestamp-X.timestamp,ut=W>0?(D-X.timestamp)/W:0;for(let H=B.length-1;H>=0;H--){const ot=B[H],gt=n[H];if(!ot||!gt)continue;const yt=ot[T],vt=ot[T+1];if(!yt||!vt)continue;const rt=yt[0]+ut*(vt[0]-yt[0]),at=yt[1]+ut*(vt[1]-yt[1]),_t=st(rt),dt=st(at);if(z>=dt&&z<=_t){const xt=at-rt;return{timestamp:D,category:{label:gt.label,color:gt.color},value:xt}}}return null},nt=(R,z)=>{const[D,T]=er(R,z);v&&(S==null||S({x:D+a.left,y:T+a.top}));const X=j(D,T);_==null||_(X)},Z=()=>{S==null||S(null),_==null||_(null)};if(!c){const R=C.append("rect").attr("class","mouse-overlay").attr("width",b).attr("height",M).attr("fill","none").attr("pointer-events","all");R.on("mousemove",function(z){nt(z,this)}),R.on("mouseleave",Z)}if(c&&h){const R=pi().extent([[0,0],[b,M]]).on("brush",()=>{}).on("end",D=>{if(!D.selection)return;const[T,X]=D.selection,Q=[+I.invert(T),+I.invert(X)];h(Q),f&&w.select(".brush").call(R.move,null)}),z=w.append("g").attr("class","brush").attr("transform",`translate(${a.left},${a.top})`).call(R);z.select(".selection").style("fill",y).style("fill-opacity","0.4").style("stroke",y).style("stroke-width","2px"),z.selectAll(".handle").style("fill",y).style("fill-opacity","0.9"),z.select(".overlay").style("cursor","default"),z.select(".overlay").on("mousemove",function(D){nt(D,this)}).on("mouseleave",Z)}return w.on("mouseleave",()=>{S==null||S(null),_==null||_(null)}),()=>{w.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S])},MT=({data:e,categories:t,title:n,subtitle:r,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,markers:_=[],markerVisibilityMode:S="hover",brushColor:w="#69b3a2",showCrosshair:b=!1,crosshairColor:M="#666",crosshairDashArray:A="4,4",tooltipScale:k=1,usePortalTooltip:C=!1})=>{const O=G.useRef(null),P=G.useRef(null),[F,B]=G.useState(null),[L,$]=G.useState(null),[Y,I]=G.useState(!1),et=G.useCallback(j=>{Y||B(j)},[Y]),K=G.useCallback(j=>{Y||$(j)},[Y]),J=G.useCallback(j=>{I(j),j&&(B(null),$(null))},[]);TT({containerRef:O,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,markers:_,markerVisibilityMode:S,onMarkerHoverChange:J,brushColor:w,showCrosshair:b,onHoveredAreaChange:et,onCrosshairMove:K});const N=j=>d?d(j):new Date(j).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0});return E.jsxs(q.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&E.jsxs(q.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&E.jsx(q.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&E.jsx(q.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),E.jsxs(q.Box,{ref:P,sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start",position:"relative"},children:[E.jsx("svg",{ref:O,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),b&&L&&E.jsxs("svg",{viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,right:0,width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",pointerEvents:"none",margin:"0 auto"},children:[E.jsx("line",{x1:L.x,y1:u.top,x2:L.x,y2:l-u.bottom,stroke:M,strokeDasharray:A,strokeWidth:1}),E.jsx("line",{x1:u.left,y1:L.y,x2:o-u.right,y2:L.y,stroke:M,strokeDasharray:A,strokeWidth:1})]}),s&&F&&L&&E.jsxs(oy,{visible:!0,x:L.x,y:L.y,containerRef:P,viewBoxWidth:o,viewBoxHeight:l,usePortal:C,scale:k,flipThreshold:o/2,children:[E.jsx(q.Typography,{sx:{fontFamily:"monospace",fontSize:`${.875*k}rem`,color:"text.secondary",mb:1.5*k},children:N(F.timestamp)}),E.jsxs(q.Stack,{direction:"row",spacing:1.5*k,children:[E.jsx(q.Box,{sx:{width:5*k,backgroundColor:F.category.color,borderRadius:1,flexShrink:0}}),E.jsxs(q.Stack,{children:[E.jsx(q.Typography,{sx:{fontWeight:700,fontSize:`${1.125*k}rem`,lineHeight:1.3},children:F.category.label}),E.jsx(q.Typography,{sx:{fontSize:`${1*k}rem`,color:"text.primary",textDecoration:"underline",textDecorationColor:"rgba(0,0,0,0.2)",textUnderlineOffset:"3px"},children:m?m(F.value):F.value.toLocaleString()})]})]})]})]}),a&&E.jsx(q.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(j=>E.jsxs(q.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[E.jsx(q.Box,{sx:{width:16,height:16,backgroundColor:j.color,opacity:j.fillOpacity??.7,border:`2px solid ${j.color}`,borderRadius:"2px",...j.strokeDasharray&&{backgroundImage:`repeating-linear-gradient(
|
|
34
34
|
45deg,
|
|
35
35
|
transparent,
|
|
36
36
|
transparent 4px,
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
-
)`}}}),P.jsx(L.Typography,{variant:"body2",children:J.label})]},J.dataKey))})]})},TT=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,showCrosshair:d=!0,brushColor:m="#69b3a2",onTooltipChange:x,minBarWidth:y,onCrosshairPositionChange:v})=>{Y.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const _=Ot(e.current),S=r-a.left-a.right,w=i-a.top-a.bottom;_.selectAll("*").remove();const b=_.append("g").attr("transform",`translate(${a.left},${a.top})`),M=`d3-bar-clip-${Math.random().toString(36).substr(2,9)}`;_.append("defs").append("clipPath").attr("id",M).append("rect").attr("x",0).attr("y",0).attr("width",S).attr("height",w);const A=b.append("g").attr("clip-path",`url(#${M})`),R=[...t].sort((E,T)=>E.timestamp-T.timestamp),C=n.map(E=>E.dataKey),O=Gi().keys(C),D=O(R),N=t.map(E=>E.timestamp),H=s?s[0]:Math.min(...N),q=s?s[1]:Math.max(...N),F=Yr().domain([new Date(H),new Date(q)]).range([0,S]),j=R.filter(E=>E.timestamp>=H&&E.timestamp<=q),$=O(j),it=$.length>0?Math.max(...$[$.length-1].map(E=>E[1]??0)):0,et=ni().domain([0,it*1.1]).range([w,0]).nice();o&&(A.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(F).ticks(6).tickSize(w).tickFormat(()=>"")),A.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(et).ticks(5).tickSize(-S).tickFormat(()=>"")));const nt=A.append("g").attr("class","bars"),J=[];D.forEach((E,T)=>{const X=n[T];X&&E.forEach((V,G)=>{const ut=R[G];if(!ut)return;const U=ut.timestamp,ot=R[G+1],gt=ot?ot.timestamp:q;if(gt<H||U>q)return;const yt=Math.max(U,H),vt=Math.min(gt,q),tt=F(new Date(yt)),st=F(new Date(vt))-tt;if(st<=0)return;const _t=et(V[0]),dt=et(V[1]),xt=_t-dt;if(xt<=0)return;const Et=V[1]-V[0];J.push({barIndex:G,categoryIndex:T,category:X,x:tt,width:st,y:dt,height:xt,value:Et,startTime:U,endTime:gt})})});const lt=1,I=2160*60*60*1e3,at=q-H>I?2:0,K=y!==void 0?y:at;nt.selectAll(".bar-segment").data(J).enter().append("rect").attr("class","bar-segment").attr("data-bar-index",E=>E.barIndex).attr("data-category-index",E=>E.categoryIndex).attr("x",E=>E.x).attr("y",E=>E.y).attr("width",E=>Math.max(K,E.width-lt)).attr("height",E=>E.height).attr("fill",E=>E.category.color).attr("fill-opacity",E=>E.category.fillOpacity??.8).attr("pointer-events","none");const k=(E,T)=>{const[X,V]=tr(E,T);d&&v&&v({x:X+a.left,y:V+a.top});const G=J.find(ut=>X>=ut.x&&X<=ut.x+ut.width&&V>=ut.y&&V<=ut.y+ut.height);G&&x?x({visible:!0,x:X+a.left,y:V+a.top,category:{label:G.category.label,color:G.category.color},value:G.value,startTime:G.startTime,endTime:G.endTime}):x&&x(null)},z=()=>{v&&v(null),x&&x(null)};if(c&&h){const E=hi().extent([[0,0],[S,w]]).on("brush",()=>{}).on("end",X=>{if(!X.selection)return;const[V,G]=X.selection,ut=[+F.invert(V),+F.invert(G)];h(ut),f&&_.select(".brush").call(E.move,null)}),T=b.append("g").attr("class","brush").call(E);T.selectAll(".selection").attr("fill",m).attr("fill-opacity",.3).attr("stroke",m).attr("stroke-width",2),T.selectAll(".handle").attr("fill",m).attr("fill-opacity",.8),T.select(".overlay").on("mousemove",function(X){k(X,this)}).on("mouseleave",z)}else{const E=A.append("rect").attr("class","mouse-overlay").attr("width",S).attr("height",w).attr("fill","none").attr("pointer-events","all");E.on("mousemove",function(T){k(T,this)}),E.on("mouseleave",z)}if(l){const E=qn(F).ticks(6);p&&E.tickFormat(T=>p(+T)),b.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${w})`).call(E).selectAll("text").attr("font-size",11)}if(u){const E=In(et).ticks(5);g&&E.tickFormat(T=>g(+T)),b.append("g").attr("class","axis axis-y").call(E).selectAll("text").attr("font-size",11)}return()=>{_.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v])},MT=({data:e,categories:t,title:n,subtitle:r,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,brushColor:_="#69b3a2",showCrosshair:S=!0,crosshairColor:w="#666",crosshairDashArray:b="4,4",minBarWidth:M})=>{const A=Y.useRef(null),[R,C]=Y.useState(null),[O,D]=Y.useState(null);TT({containerRef:A,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,showCrosshair:S,brushColor:_,onTooltipChange:s?C:void 0,minBarWidth:M,onCrosshairPositionChange:S?D:void 0});const q=F=>{if(d)return d(F);const j=new Date(F),$=j.getFullYear(),it=String(j.getMonth()+1).padStart(2,"0"),et=String(j.getDate()).padStart(2,"0");return`${$}-${it}-${et}`};return P.jsxs(L.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&P.jsxs(L.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&P.jsx(L.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&P.jsx(L.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),P.jsxs(L.Box,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[P.jsx("svg",{ref:A,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),S&&O&&P.jsxs("svg",{viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",pointerEvents:"none"},children:[P.jsx("line",{x1:O.x,y1:u.top,x2:O.x,y2:l-u.bottom,stroke:w,strokeDasharray:b,strokeWidth:1}),P.jsx("line",{x1:u.left,y1:O.y,x2:o-u.right,y2:O.y,stroke:w,strokeDasharray:b,strokeWidth:1})]}),s&&R&&R.visible&&P.jsxs(L.Paper,{elevation:3,sx:{position:"absolute",left:R.x+10,top:R.y-10,pointerEvents:"none",zIndex:1e3,transform:R.x>o/2?"translateX(-100%) translateX(-20px)":"none",p:2,whiteSpace:"nowrap"},children:[P.jsx(L.Typography,{sx:{fontFamily:"monospace",fontSize:"0.875rem",color:"text.secondary",mb:1.5},children:q(R.startTime)}),P.jsxs(L.Stack,{direction:"row",spacing:1.5,children:[P.jsx(L.Box,{sx:{width:5,backgroundColor:R.category.color,borderRadius:1,flexShrink:0}}),P.jsxs(L.Stack,{children:[P.jsx(L.Typography,{sx:{fontWeight:700,fontSize:"1.125rem",lineHeight:1.3},children:R.category.label}),P.jsx(L.Typography,{sx:{fontSize:"1rem",color:"text.primary",textDecoration:"underline",textDecorationColor:"rgba(0,0,0,0.2)",textUnderlineOffset:"3px"},children:m?m(R.value):R.value.toLocaleString()})]})]})]})]}),a&&P.jsx(L.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(F=>P.jsxs(L.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[P.jsx(L.Box,{sx:{width:16,height:16,backgroundColor:F.color,opacity:F.fillOpacity??.8,border:`1px solid ${F.color}`,borderRadius:"2px"}}),P.jsx(L.Typography,{variant:"body2",children:F.label})]},F.dataKey))})]})},AT=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Gh={}.hasOwnProperty;function kT(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const o=r.handlers;if(i&&Gh.call(i,e)){const l=String(i[e]);s=Gh.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const CT=/["&'<>`]/g,RT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ET=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,DT=/[|\\{}()[\]^$+*?.]/g,Yh=new WeakMap;function OT(e,t){if(e=e.replace(t.subset?PT(t.subset):CT,r),t.subset||t.escapeOnly)return e;return e.replace(RT,n).replace(ET,r);function n(i,a,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),t)}function r(i,a,s){return t.format(i.charCodeAt(0),s.charCodeAt(a+1),t)}}function PT(e){let t=Yh.get(e);return t||(t=FT(e),Yh.set(e,t)),t}function FT(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(DT,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const NT=/[\dA-Fa-f]/;function $T(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!NT.test(String.fromCharCode(t))?r:r+";"}const LT=/\d/;function qT(e,t,n){const r="&#"+String(e);return n&&t&&!LT.test(String.fromCharCode(t))?r:r+";"}const IT=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Xs={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zT=["cent","copy","divide","gt","lt","not","para","times"],sy={}.hasOwnProperty,kc={};let va;for(va in Xs)sy.call(Xs,va)&&(kc[Xs[va]]=va);const BT=/[^\dA-Za-z]/;function UT(e,t,n,r){const i=String.fromCharCode(e);if(sy.call(kc,i)){const a=kc[i],s="&"+a;return n&&IT.includes(a)&&!zT.includes(a)&&(!r||t&&t!==61&&BT.test(String.fromCharCode(t)))?s:s+";"}return""}function HT(e,t,n){let r=$T(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=UT(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const a=qT(e,t,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Zr(e,t){return OT(e,Object.assign({format:HT},t))}const jT=/^>|^->|<!--|-->|--!>|<!-$/g,GT=[">"],YT=["<",">"];function XT(e,t,n,r){return r.settings.bogusComments?"<?"+Zr(e.value,Object.assign({},r.settings.characterReferences,{subset:GT}))+">":"<!--"+e.value.replace(jT,i)+"-->";function i(a){return Zr(a,Object.assign({},r.settings.characterReferences,{subset:YT}))}}function WT(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Xh(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const KT=/[ \t\n\f\r]/g;function yf(e){return typeof e=="object"?e.type==="text"?Wh(e.value):!1:Wh(e)}function Wh(e){return e.replace(KT,"")===""}const he=ly(1),oy=ly(-1),VT=[];function ly(e){return t;function t(n,r,i){const a=n?n.children:VT;let s=(r||0)+e,o=a[s];if(!i)for(;o&&yf(o);)s+=e,o=a[s];return o}}const ZT={}.hasOwnProperty;function uy(e){return t;function t(n,r,i){return ZT.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const _f=uy({body:JT,caption:Ws,colgroup:Ws,dd:rM,dt:nM,head:Ws,html:QT,li:eM,optgroup:iM,option:aM,p:tM,rp:Kh,rt:Kh,tbody:oM,td:Vh,tfoot:lM,th:Vh,thead:sM,tr:uM});function Ws(e,t,n){const r=he(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&yf(r.value.charAt(0)))}function QT(e,t,n){const r=he(n,t);return!r||r.type!=="comment"}function JT(e,t,n){const r=he(n,t);return!r||r.type!=="comment"}function tM(e,t,n){const r=he(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function eM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="li"}function nM(e,t,n){const r=he(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function rM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Kh(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function iM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function aM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function sM(e,t,n){const r=he(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function oM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function lM(e,t,n){return!he(n,t)}function uM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Vh(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const cM=uy({body:pM,colgroup:dM,head:hM,html:fM,tbody:gM});function fM(e){const t=he(e,-1);return!t||t.type!=="comment"}function hM(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function pM(e){const t=he(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&yf(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function dM(e,t,n){const r=oy(n,t),i=he(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&_f(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function gM(e,t,n){const r=oy(n,t),i=he(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&_f(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const ba={name:[[`
|
|
37
|
+
${j.color} 4px,
|
|
38
|
+
${j.color} 8px
|
|
39
|
+
)`}}}),E.jsx(q.Typography,{variant:"body2",children:j.label})]},j.dataKey))})]})},AT=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timeRange:s,showGrid:o=!0,showXAxis:l=!0,showYAxis:u=!0,enableBrush:c=!1,zoomToSelection:f=!1,onTimeRangeChange:h,formatDate:p,formatValue:g,showCrosshair:d=!0,brushColor:m="#69b3a2",onTooltipChange:x,minBarWidth:y,onCrosshairPositionChange:v})=>{G.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const _=Ot(e.current),S=r-a.left-a.right,w=i-a.top-a.bottom;_.selectAll("*").remove();const b=_.append("g").attr("transform",`translate(${a.left},${a.top})`),M=`d3-bar-clip-${Math.random().toString(36).substr(2,9)}`;_.append("defs").append("clipPath").attr("id",M).append("rect").attr("x",0).attr("y",0).attr("width",S).attr("height",w);const A=b.append("g").attr("clip-path",`url(#${M})`),k=[...t].sort((D,T)=>D.timestamp-T.timestamp),C=n.map(D=>D.dataKey),O=Yi().keys(C),P=O(k),F=t.map(D=>D.timestamp),B=s?s[0]:Math.min(...F),L=s?s[1]:Math.max(...F),$=Wr().domain([new Date(B),new Date(L)]).range([0,S]),Y=k.filter(D=>D.timestamp>=B&&D.timestamp<=L),I=O(Y),et=I.length>0?Math.max(...I[I.length-1].map(D=>D[1]??0)):0,K=ri().domain([0,et*1.1]).range([w,0]).nice();o&&(A.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn($).ticks(6).tickSize(w).tickFormat(()=>"")),A.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(K).ticks(5).tickSize(-S).tickFormat(()=>"")));const J=A.append("g").attr("class","bars"),st=[];P.forEach((D,T)=>{const X=n[T];X&&D.forEach((Q,W)=>{const ut=k[W];if(!ut)return;const H=ut.timestamp,ot=k[W+1],gt=ot?ot.timestamp:L;if(gt<B||H>L)return;const yt=Math.max(H,B),vt=Math.min(gt,L),rt=$(new Date(yt)),at=$(new Date(vt))-rt;if(at<=0)return;const _t=K(Q[0]),dt=K(Q[1]),xt=_t-dt;if(xt<=0)return;const Et=Q[1]-Q[0];st.push({barIndex:W,categoryIndex:T,category:X,x:rt,width:at,y:dt,height:xt,value:Et,startTime:H,endTime:gt})})});const lt=1,N=2160*60*60*1e3,nt=L-B>N?2:0,Z=y!==void 0?y:nt;J.selectAll(".bar-segment").data(st).enter().append("rect").attr("class","bar-segment").attr("data-bar-index",D=>D.barIndex).attr("data-category-index",D=>D.categoryIndex).attr("x",D=>D.x).attr("y",D=>D.y).attr("width",D=>Math.max(Z,D.width-lt)).attr("height",D=>D.height).attr("fill",D=>D.category.color).attr("fill-opacity",D=>D.category.fillOpacity??.8).attr("pointer-events","none");const R=(D,T)=>{const[X,Q]=er(D,T);d&&v&&v({x:X+a.left,y:Q+a.top});const W=st.find(ut=>X>=ut.x&&X<=ut.x+ut.width&&Q>=ut.y&&Q<=ut.y+ut.height);W&&x?x({visible:!0,x:X+a.left,y:Q+a.top,category:{label:W.category.label,color:W.category.color},value:W.value,startTime:W.startTime,endTime:W.endTime}):x&&x(null)},z=()=>{v&&v(null),x&&x(null)};if(c&&h){const D=pi().extent([[0,0],[S,w]]).on("brush",()=>{}).on("end",X=>{if(!X.selection)return;const[Q,W]=X.selection,ut=[+$.invert(Q),+$.invert(W)];h(ut),f&&_.select(".brush").call(D.move,null)}),T=b.append("g").attr("class","brush").call(D);T.selectAll(".selection").attr("fill",m).attr("fill-opacity",.3).attr("stroke",m).attr("stroke-width",2),T.selectAll(".handle").attr("fill",m).attr("fill-opacity",.8),T.select(".overlay").style("cursor","default"),T.select(".overlay").on("mousemove",function(X){R(X,this)}).on("mouseleave",z)}else{const D=A.append("rect").attr("class","mouse-overlay").attr("width",S).attr("height",w).attr("fill","none").attr("pointer-events","all");D.on("mousemove",function(T){R(T,this)}),D.on("mouseleave",z)}if(_.on("mouseleave",()=>{v&&v(null),x&&x(null)}),l){const D=qn($).ticks(6);p&&D.tickFormat(T=>p(+T)),b.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${w})`).call(D).selectAll("text").attr("font-size",11)}if(u){const D=In(K).ticks(5);g&&D.tickFormat(T=>g(+T)),b.append("g").attr("class","axis axis-y").call(D).selectAll("text").attr("font-size",11)}return()=>{_.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v])},kT=({data:e,categories:t,title:n,subtitle:r,showHeader:i=!0,showLegend:a=!0,showTooltip:s=!0,width:o=800,height:l=400,margin:u={top:20,right:30,bottom:40,left:60},timeRange:c,showGrid:f=!0,showAxes:h=!0,showXAxis:p,showYAxis:g,formatDate:d,formatValue:m,onTimeRangeChange:x,enableBrush:y=!1,zoomToSelection:v=!1,brushColor:_="#69b3a2",showCrosshair:S=!0,crosshairColor:w="#666",crosshairDashArray:b="4,4",minBarWidth:M,tooltipScale:A=1,usePortalTooltip:k=!1,tooltipAnchor:C="cursor"})=>{const O=G.useRef(null),P=G.useRef(null),[F,B]=G.useState(null),[L,$]=G.useState(null);AT({containerRef:O,data:e,categories:t,width:o,height:l,margin:u,timeRange:c,showGrid:f,showXAxis:p!==void 0?p:h,showYAxis:g!==void 0?g:h,enableBrush:y,zoomToSelection:v,onTimeRangeChange:x,formatDate:d,formatValue:m,showCrosshair:S,brushColor:_,onTooltipChange:s?B:void 0,minBarWidth:M,onCrosshairPositionChange:S?$:void 0});const et=K=>{if(d)return d(K);const J=new Date(K),st=J.getFullYear(),lt=String(J.getMonth()+1).padStart(2,"0"),N=String(J.getDate()).padStart(2,"0");return`${st}-${lt}-${N}`};return E.jsxs(q.Stack,{sx:{width:"100%",alignItems:"center",gap:2},children:[i&&(n||r)&&E.jsxs(q.Stack,{spacing:.5,sx:{mb:2,width:"100%",alignItems:"center"},children:[n&&E.jsx(q.Typography,{variant:"h5",sx:{fontWeight:500},children:n}),r&&E.jsx(q.Typography,{variant:"body2",sx:{color:"text.secondary"},children:r})]}),E.jsxs(q.Box,{ref:P,sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start",position:"relative"},children:[E.jsx("svg",{ref:O,viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",display:"block"}}),S&&L&&E.jsxs("svg",{viewBox:`0 0 ${o} ${l}`,preserveAspectRatio:"xMidYMid meet",style:{position:"absolute",top:0,left:0,right:0,width:"100%",maxWidth:"1200px",minWidth:"400px",height:"auto",pointerEvents:"none",margin:"0 auto"},children:[E.jsx("line",{x1:L.x,y1:u.top,x2:L.x,y2:l-u.bottom,stroke:w,strokeDasharray:b,strokeWidth:1}),E.jsx("line",{x1:u.left,y1:L.y,x2:o-u.right,y2:L.y,stroke:w,strokeDasharray:b,strokeWidth:1})]}),s&&F&&E.jsxs(oy,{visible:F.visible,x:F.x,y:F.y,containerRef:P,viewBoxWidth:o,viewBoxHeight:l,usePortal:k,scale:A,flipThreshold:o/2,anchorPosition:C,chartTopMargin:u.top,children:[E.jsx(q.Typography,{sx:{fontFamily:"monospace",fontSize:`${.875*A}rem`,color:"text.secondary",mb:1.5*A},children:et(F.startTime)}),E.jsxs(q.Stack,{direction:"row",spacing:1.5*A,children:[E.jsx(q.Box,{sx:{width:5*A,backgroundColor:F.category.color,borderRadius:1,flexShrink:0}}),E.jsxs(q.Stack,{children:[E.jsx(q.Typography,{sx:{fontWeight:700,fontSize:`${1.125*A}rem`,lineHeight:1.3},children:F.category.label}),E.jsx(q.Typography,{sx:{fontSize:`${1*A}rem`,color:"text.primary",textDecoration:"underline",textDecorationColor:"rgba(0,0,0,0.2)",textUnderlineOffset:"3px"},children:m?m(F.value):F.value.toLocaleString()})]})]})]})]}),a&&E.jsx(q.Stack,{direction:"row",spacing:3,sx:{flexWrap:"wrap",justifyContent:"center",gap:2},children:t.map(K=>E.jsxs(q.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{cursor:"pointer","&:hover":{opacity:.7}},children:[E.jsx(q.Box,{sx:{width:16,height:16,backgroundColor:K.color,opacity:K.fillOpacity??.8,border:`1px solid ${K.color}`,borderRadius:"2px"}}),E.jsx(q.Typography,{variant:"body2",children:K.label})]},K.dataKey))})]})},CT=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Yh={}.hasOwnProperty;function RT(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const o=r.handlers;if(i&&Yh.call(i,e)){const l=String(i[e]);s=Yh.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const ET=/["&'<>`]/g,DT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,OT=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,PT=/[|\\{}()[\]^$+*?.]/g,Wh=new WeakMap;function FT(e,t){if(e=e.replace(t.subset?$T(t.subset):ET,r),t.subset||t.escapeOnly)return e;return e.replace(DT,n).replace(OT,r);function n(i,a,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),t)}function r(i,a,s){return t.format(i.charCodeAt(0),s.charCodeAt(a+1),t)}}function $T(e){let t=Wh.get(e);return t||(t=LT(e),Wh.set(e,t)),t}function LT(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(PT,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const NT=/[\dA-Fa-f]/;function qT(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!NT.test(String.fromCharCode(t))?r:r+";"}const IT=/\d/;function zT(e,t,n){const r="&#"+String(e);return n&&t&&!IT.test(String.fromCharCode(t))?r:r+";"}const BT=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Xs={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},UT=["cent","copy","divide","gt","lt","not","para","times"],ly={}.hasOwnProperty,Cc={};let ba;for(ba in Xs)ly.call(Xs,ba)&&(Cc[Xs[ba]]=ba);const HT=/[^\dA-Za-z]/;function jT(e,t,n,r){const i=String.fromCharCode(e);if(ly.call(Cc,i)){const a=Cc[i],s="&"+a;return n&&BT.includes(a)&&!UT.includes(a)&&(!r||t&&t!==61&&HT.test(String.fromCharCode(t)))?s:s+";"}return""}function GT(e,t,n){let r=qT(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=jT(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const a=zT(e,t,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Qr(e,t){return FT(e,Object.assign({format:GT},t))}const YT=/^>|^->|<!--|-->|--!>|<!-$/g,WT=[">"],XT=["<",">"];function KT(e,t,n,r){return r.settings.bogusComments?"<?"+Qr(e.value,Object.assign({},r.settings.characterReferences,{subset:WT}))+">":"<!--"+e.value.replace(YT,i)+"-->";function i(a){return Qr(a,Object.assign({},r.settings.characterReferences,{subset:XT}))}}function VT(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Xh(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ZT=/[ \t\n\f\r]/g;function _f(e){return typeof e=="object"?e.type==="text"?Kh(e.value):!1:Kh(e)}function Kh(e){return e.replace(ZT,"")===""}const he=cy(1),uy=cy(-1),QT=[];function cy(e){return t;function t(n,r,i){const a=n?n.children:QT;let s=(r||0)+e,o=a[s];if(!i)for(;o&&_f(o);)s+=e,o=a[s];return o}}const JT={}.hasOwnProperty;function fy(e){return t;function t(n,r,i){return JT.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const xf=fy({body:eM,caption:Ks,colgroup:Ks,dd:aM,dt:iM,head:Ks,html:tM,li:rM,optgroup:sM,option:oM,p:nM,rp:Vh,rt:Vh,tbody:uM,td:Zh,tfoot:cM,th:Zh,thead:lM,tr:fM});function Ks(e,t,n){const r=he(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&_f(r.value.charAt(0)))}function tM(e,t,n){const r=he(n,t);return!r||r.type!=="comment"}function eM(e,t,n){const r=he(n,t);return!r||r.type!=="comment"}function nM(e,t,n){const r=he(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function rM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="li"}function iM(e,t,n){const r=he(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function aM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Vh(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function sM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function oM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function lM(e,t,n){const r=he(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function uM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function cM(e,t,n){return!he(n,t)}function fM(e,t,n){const r=he(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Zh(e,t,n){const r=he(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const hM=fy({body:gM,colgroup:mM,head:dM,html:pM,tbody:yM});function pM(e){const t=he(e,-1);return!t||t.type!=="comment"}function dM(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function gM(e){const t=he(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&_f(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function mM(e,t,n){const r=uy(n,t),i=he(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&xf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function yM(e,t,n){const r=uy(n,t),i=he(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&xf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const wa={name:[[`
|
|
40
40
|
\f\r &/=>`.split(""),`
|
|
41
41
|
\f\r "&'/=>\``.split("")],[`\0
|
|
42
42
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
\f\r &>`.split(""),`\0
|
|
45
45
|
\f\r "&'<=>\``.split("")],[`\0
|
|
46
46
|
\f\r "&'<=>\``.split(""),`\0
|
|
47
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function mM(e,t,n,r){const i=r.schema,a=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=mf);const u=yM(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(s=!1),(u||!a||!cM(e,t,n))&&(o.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!s&&(!a||!_f(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function yM(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const a=_M(e,i,t[i]);a&&n.push(a)}}for(;++r<n.length;){const a=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&a!=='"'&&a!=="'"&&(n[r]+=" ")}return n.join("")}function _M(e,t,n){const r=J0(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Zr(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ba.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?cT:hT)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=Zr(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ba.unquoted[i][a]}))),o!==n&&(e.settings.quoteSmart&&Xh(n,s)>Xh(n,e.alternative)&&(s=e.alternative),o=s+Zr(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?ba.single:ba.double)[i][a],attribute:!0}))+s),l+(o&&"="+o))}const xM=["<","&"];function cy(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Zr(e.value,Object.assign({},r.settings.characterReferences,{subset:xM}))}function vM(e,t,n,r){return r.settings.allowDangerousHtml?e.value:cy(e,t,n,r)}function bM(e,t,n,r){return r.all(e)}const wM=kT("type",{invalid:SM,unknown:TM,handlers:{comment:XT,doctype:WT,element:mM,raw:vM,root:bM,text:cy}});function SM(e){throw new Error("Expected node, not `"+e+"`")}function TM(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const MM={},AM={},kM=[];function CM(e,t){const n=MM,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:RM,all:EM,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||AT,characterReferences:n.characterReferences||AM,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?mf:ty,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function RM(e,t,n){return wM(e,t,n,this)}function EM(e){const t=[],n=e&&e.children||kM;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const Pe={arcAngle:180,maxSeats:200,useEnhanced:!0,chartConfig:{radius:220,seatSize:5,minSeatSize:4,maxSeatSize:18,spacing:1.1,innerRadiusRatio:.4,arcAngleFlexibility:5},colors:{emptySeats:"#f8f8f8",emptySeatsBorder:"#d8d8d8",seatBorder:"#fff"},animation:{transitionDuration:"0.2s",hoverOpacity:{active:"1",dimmed:"0.2",empty:"0.3"}},scaling:{enableScaling:!0,scaleThreshold:200}},Qr={COMPLETED:pn.neoDigitalGreen[600],NOT_APPLICABLE:"url(#greyHatchPattern)",NO_LST:"url(#noLstHatchPattern)",DATA_MISSING:"url(#dataMissingHatchPattern)"},Ii="N/A",zi="No LST",Bi="Data Missing";function DM(e,t,n,r="left-to-right",i=900,a){Ot.prototype.transition=qc;const s=t*Math.PI/180,o=-s/2-Math.PI/2,l=s/2-Math.PI/2;let u=e.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.appendChild(u));const c="arc-sweep-clip";let f=u.querySelector(`#${c}`);f||(f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),f.setAttribute("id",c),u.appendChild(f));const h=document.createElementNS("http://www.w3.org/2000/svg","path");f.innerHTML="",f.appendChild(h);const p=e.querySelector(".arc-container"),g=e.querySelector(".points-container");if(g&&p)if(g.setAttribute("clip-path",`url(#${c})`),r==="left-to-right"){const m=y=>{const v=n*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,M=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${M},1 ${w},${b} Z`};h.setAttribute("d",m(o)),Ot(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=o+(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{a&&a(),setTimeout(()=>{g.removeAttribute("clip-path")},50)})}else{const m=y=>{const v=n*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,M=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${M},1 ${w},${b} Z`};h.setAttribute("d",m(l)),Ot(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=l-(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{g.removeAttribute("clip-path"),a&&a()})}}var wa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function di(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ks,Zh;function fy(){if(Zh)return Ks;Zh=1;var e=typeof wa=="object"&&wa&&wa.Object===Object&&wa;return Ks=e,Ks}var Vs,Qh;function Cn(){if(Qh)return Vs;Qh=1;var e=fy(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Vs=n,Vs}var Zs,Jh;function OM(){if(Jh)return Zs;Jh=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Zs=t,Zs}var Qs,tp;function PM(){if(tp)return Qs;tp=1;var e=OM(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Qs=n,Qs}var Js,ep;function aa(){if(ep)return Js;ep=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Js=e,Js}var to,np;function sa(){if(np)return to;np=1;var e=Cn(),t=e.Symbol;return to=t,to}var eo,rp;function FM(){if(rp)return eo;rp=1;var e=sa(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(s){var o=n.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var c=r.call(s);return u&&(o?s[i]=l:delete s[i]),c}return eo=a,eo}var no,ip;function NM(){if(ip)return no;ip=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return no=n,no}var ro,ap;function oa(){if(ap)return ro;ap=1;var e=sa(),t=FM(),n=NM(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?i:r:a&&a in Object(o)?t(o):n(o)}return ro=s,ro}var io,sp;function la(){if(sp)return io;sp=1;function e(t){return t!=null&&typeof t=="object"}return io=e,io}var ao,op;function ua(){if(op)return ao;op=1;var e=oa(),t=la(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return ao=r,ao}var so,lp;function hy(){if(lp)return so;lp=1;var e=PM(),t=aa(),n=ua(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||s.test(u)?o(u.slice(2),f?2:8):i.test(u)?r:+u}return so=l,so}var oo,up;function py(){if(up)return oo;up=1;var e=hy(),t=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*n}return i===i?i:0}return oo=r,oo}var lo,cp;function dy(){if(cp)return lo;cp=1;var e=py();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return lo=t,lo}var uo,fp;function ls(){if(fp)return uo;fp=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return uo=e,uo}var co,hp;function dn(){if(hp)return co;hp=1;var e=Array.isArray;return co=e,co}var fo,pp;function $M(){if(pp)return fo;pp=1;var e=sa(),t=ls(),n=dn(),r=ua(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(n(o))return t(o,s)+"";if(r(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return fo=s,fo}var ho,dp;function gy(){if(dp)return ho;dp=1;var e=$M();function t(n){return n==null?"":e(n)}return ho=t,ho}var po,gp;function LM(){if(gp)return po;gp=1;var e=Cn(),t=dy(),n=hy(),r=gy(),i=e.isFinite,a=Math.min;function s(o){var l=Math[o];return function(u,c){if(u=n(u),c=c==null?0:a(t(c),292),c&&i(u)){var f=(r(u)+"e").split("e"),h=l(f[0]+"e"+(+f[1]+c));return f=(r(h)+"e").split("e"),+(f[0]+"e"+(+f[1]-c))}return l(u)}}return po=s,po}var go,mp;function qM(){if(mp)return go;mp=1;var e=LM(),t=e("round");return go=t,go}var IM=qM();const zM=di(IM);var mo,yp;function my(){if(yp)return mo;yp=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return mo=e,mo}var yo,_p;function BM(){if(_p)return yo;_p=1;var e=oa(),t=la(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return yo=r,yo}var _o,xp;function xf(){if(xp)return _o;xp=1;var e=BM(),t=la(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(s){return t(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return _o=a,_o}var xo,vp;function UM(){if(vp)return xo;vp=1;var e=sa(),t=xf(),n=dn(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return xo=i,xo}var vo,bp;function yy(){if(bp)return vo;bp=1;var e=my(),t=UM();function n(r,i,a,s,o){var l=-1,u=r.length;for(a||(a=t),o||(o=[]);++l<u;){var c=r[l];i>0&&a(c)?i>1?n(c,i-1,a,s,o):e(o,c):s||(o[o.length]=c)}return o}return vo=n,vo}var bo,wp;function vf(){if(wp)return bo;wp=1;var e=dn(),t=ua(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){if(e(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||s!=null&&a in Object(s)}return bo=i,bo}var wo,Sp;function _y(){if(Sp)return wo;Sp=1;var e=oa(),t=aa(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==r||l==i||l==n||l==a}return wo=s,wo}var So,Tp;function HM(){if(Tp)return So;Tp=1;var e=Cn(),t=e["__core-js_shared__"];return So=t,So}var To,Mp;function jM(){if(Mp)return To;Mp=1;var e=HM(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return To=n,To}var Mo,Ap;function xy(){if(Ap)return Mo;Ap=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Mo=n,Mo}var Ao,kp;function GM(){if(kp)return Ao;kp=1;var e=_y(),t=jM(),n=aa(),r=xy(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!n(h)||t(h))return!1;var p=e(h)?c:a;return p.test(r(h))}return Ao=f,Ao}var ko,Cp;function YM(){if(Cp)return ko;Cp=1;function e(t,n){return t==null?void 0:t[n]}return ko=e,ko}var Co,Rp;function Dr(){if(Rp)return Co;Rp=1;var e=GM(),t=YM();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return Co=n,Co}var Ro,Ep;function us(){if(Ep)return Ro;Ep=1;var e=Dr(),t=e(Object,"create");return Ro=t,Ro}var Eo,Dp;function XM(){if(Dp)return Eo;Dp=1;var e=us();function t(){this.__data__=e?e(null):{},this.size=0}return Eo=t,Eo}var Do,Op;function WM(){if(Op)return Do;Op=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Do=e,Do}var Oo,Pp;function KM(){if(Pp)return Oo;Pp=1;var e=us(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var s=this.__data__;if(e){var o=s[a];return o===t?void 0:o}return r.call(s,a)?s[a]:void 0}return Oo=i,Oo}var Po,Fp;function VM(){if(Fp)return Po;Fp=1;var e=us(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return Po=r,Po}var Fo,Np;function ZM(){if(Np)return Fo;Np=1;var e=us(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return Fo=n,Fo}var No,$p;function QM(){if($p)return No;$p=1;var e=XM(),t=WM(),n=KM(),r=VM(),i=ZM();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,No=a,No}var $o,Lp;function JM(){if(Lp)return $o;Lp=1;function e(){this.__data__=[],this.size=0}return $o=e,$o}var Lo,qp;function bf(){if(qp)return Lo;qp=1;function e(t,n){return t===n||t!==t&&n!==n}return Lo=e,Lo}var qo,Ip;function cs(){if(Ip)return qo;Ip=1;var e=bf();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return qo=t,qo}var Io,zp;function tA(){if(zp)return Io;zp=1;var e=cs(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,s=e(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():n.call(a,s,1),--this.size,!0}return Io=r,Io}var zo,Bp;function eA(){if(Bp)return zo;Bp=1;var e=cs();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return zo=t,zo}var Bo,Up;function nA(){if(Up)return Bo;Up=1;var e=cs();function t(n){return e(this.__data__,n)>-1}return Bo=t,Bo}var Uo,Hp;function rA(){if(Hp)return Uo;Hp=1;var e=cs();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return Uo=t,Uo}var Ho,jp;function fs(){if(jp)return Ho;jp=1;var e=JM(),t=tA(),n=eA(),r=nA(),i=rA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Ho=a,Ho}var jo,Gp;function wf(){if(Gp)return jo;Gp=1;var e=Dr(),t=Cn(),n=e(t,"Map");return jo=n,jo}var Go,Yp;function iA(){if(Yp)return Go;Yp=1;var e=QM(),t=fs(),n=wf();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Go=r,Go}var Yo,Xp;function aA(){if(Xp)return Yo;Xp=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Yo=e,Yo}var Xo,Wp;function hs(){if(Wp)return Xo;Wp=1;var e=aA();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Xo=t,Xo}var Wo,Kp;function sA(){if(Kp)return Wo;Kp=1;var e=hs();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Wo=t,Wo}var Ko,Vp;function oA(){if(Vp)return Ko;Vp=1;var e=hs();function t(n){return e(this,n).get(n)}return Ko=t,Ko}var Vo,Zp;function lA(){if(Zp)return Vo;Zp=1;var e=hs();function t(n){return e(this,n).has(n)}return Vo=t,Vo}var Zo,Qp;function uA(){if(Qp)return Zo;Qp=1;var e=hs();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return Zo=t,Zo}var Qo,Jp;function Sf(){if(Jp)return Qo;Jp=1;var e=iA(),t=sA(),n=oA(),r=lA(),i=uA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Qo=a,Qo}var Jo,td;function cA(){if(td)return Jo;td=1;var e=Sf(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=r.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,Jo=n,Jo}var tl,ed;function fA(){if(ed)return tl;ed=1;var e=cA(),t=500;function n(r){var i=e(r,function(s){return a.size===t&&a.clear(),s}),a=i.cache;return i}return tl=n,tl}var el,nd;function hA(){if(nd)return el;nd=1;var e=fA(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(s,o,l,u){a.push(l?u.replace(n,"$1"):o||s)}),a});return el=r,el}var nl,rd;function vy(){if(rd)return nl;rd=1;var e=dn(),t=vf(),n=hA(),r=gy();function i(a,s){return e(a)?a:t(a,s)?[a]:n(r(a))}return nl=i,nl}var rl,id;function ps(){if(id)return rl;id=1;var e=ua();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return rl=t,rl}var il,ad;function Tf(){if(ad)return il;ad=1;var e=vy(),t=ps();function n(r,i){i=e(i,r);for(var a=0,s=i.length;r!=null&&a<s;)r=r[t(i[a++])];return a&&a==s?r:void 0}return il=n,il}var al,sd;function pA(){if(sd)return al;sd=1;var e=fs();function t(){this.__data__=new e,this.size=0}return al=t,al}var sl,od;function dA(){if(od)return sl;od=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return sl=e,sl}var ol,ld;function gA(){if(ld)return ol;ld=1;function e(t){return this.__data__.get(t)}return ol=e,ol}var ll,ud;function mA(){if(ud)return ll;ud=1;function e(t){return this.__data__.has(t)}return ll=e,ll}var ul,cd;function yA(){if(cd)return ul;cd=1;var e=fs(),t=wf(),n=Sf(),r=200;function i(a,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<r-1)return l.push([a,s]),this.size=++o.size,this;o=this.__data__=new n(l)}return o.set(a,s),this.size=o.size,this}return ul=i,ul}var cl,fd;function by(){if(fd)return cl;fd=1;var e=fs(),t=pA(),n=dA(),r=gA(),i=mA(),a=yA();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,cl=s,cl}var fl,hd;function _A(){if(hd)return fl;hd=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return fl=t,fl}var hl,pd;function xA(){if(pd)return hl;pd=1;function e(t){return this.__data__.has(t)}return hl=e,hl}var pl,dd;function vA(){if(dd)return pl;dd=1;var e=Sf(),t=_A(),n=xA();function r(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new e;++a<s;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,pl=r,pl}var dl,gd;function bA(){if(gd)return dl;gd=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return dl=e,dl}var gl,md;function wA(){if(md)return gl;md=1;function e(t,n){return t.has(n)}return gl=e,gl}var ml,yd;function wy(){if(yd)return ml;yd=1;var e=vA(),t=bA(),n=wA(),r=1,i=2;function a(s,o,l,u,c,f){var h=l&r,p=s.length,g=o.length;if(p!=g&&!(h&&g>p))return!1;var d=f.get(s),m=f.get(o);if(d&&m)return d==o&&m==s;var x=-1,y=!0,v=l&i?new e:void 0;for(f.set(s,o),f.set(o,s);++x<p;){var _=s[x],S=o[x];if(u)var w=h?u(S,_,x,o,s,f):u(_,S,x,s,o,f);if(w!==void 0){if(w)continue;y=!1;break}if(v){if(!t(o,function(b,M){if(!n(v,M)&&(_===b||c(_,b,l,u,f)))return v.push(M)})){y=!1;break}}else if(!(_===S||c(_,S,l,u,f))){y=!1;break}}return f.delete(s),f.delete(o),y}return ml=a,ml}var yl,_d;function SA(){if(_d)return yl;_d=1;var e=Cn(),t=e.Uint8Array;return yl=t,yl}var _l,xd;function TA(){if(xd)return _l;xd=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return _l=e,_l}var xl,vd;function MA(){if(vd)return xl;vd=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return xl=e,xl}var vl,bd;function AA(){if(bd)return vl;bd=1;var e=sa(),t=SA(),n=bf(),r=wy(),i=TA(),a=MA(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",g="[object Set]",d="[object String]",m="[object Symbol]",x="[object ArrayBuffer]",y="[object DataView]",v=e?e.prototype:void 0,_=v?v.valueOf:void 0;function S(w,b,M,A,R,C,O){switch(M){case y:if(w.byteLength!=b.byteLength||w.byteOffset!=b.byteOffset)return!1;w=w.buffer,b=b.buffer;case x:return!(w.byteLength!=b.byteLength||!C(new t(w),new t(b)));case l:case u:case h:return n(+w,+b);case c:return w.name==b.name&&w.message==b.message;case p:case d:return w==b+"";case f:var D=i;case g:var N=A&s;if(D||(D=a),w.size!=b.size&&!N)return!1;var H=O.get(w);if(H)return H==b;A|=o,O.set(w,b);var q=r(D(w),D(b),A,R,C,O);return O.delete(w),q;case m:if(_)return _.call(w)==_.call(b)}return!1}return vl=S,vl}var bl,wd;function kA(){if(wd)return bl;wd=1;var e=my(),t=dn();function n(r,i,a){var s=i(r);return t(r)?s:e(s,a(r))}return bl=n,bl}var wl,Sd;function CA(){if(Sd)return wl;Sd=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,s=[];++r<i;){var o=t[r];n(o,r,t)&&(s[a++]=o)}return s}return wl=e,wl}var Sl,Td;function RA(){if(Td)return Sl;Td=1;function e(){return[]}return Sl=e,Sl}var Tl,Md;function EA(){if(Md)return Tl;Md=1;var e=CA(),t=RA(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(o){return r.call(s,o)}))}:t;return Tl=a,Tl}var Ml,Ad;function DA(){if(Ad)return Ml;Ad=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return Ml=e,Ml}var Ei={exports:{}},Al,kd;function OA(){if(kd)return Al;kd=1;function e(){return!1}return Al=e,Al}Ei.exports;var Cd;function Sy(){return Cd||(Cd=1,(function(e,t){var n=Cn(),r=OA(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,o=s?n.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;e.exports=u})(Ei,Ei.exports)),Ei.exports}var kl,Rd;function Mf(){if(Rd)return kl;Rd=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return kl=n,kl}var Cl,Ed;function Af(){if(Ed)return Cl;Ed=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Cl=t,Cl}var Rl,Dd;function PA(){if(Dd)return Rl;Dd=1;var e=oa(),t=Af(),n=la(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",d="[object WeakMap]",m="[object ArrayBuffer]",x="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",b="[object Uint8Array]",M="[object Uint8ClampedArray]",A="[object Uint16Array]",R="[object Uint32Array]",C={};C[y]=C[v]=C[_]=C[S]=C[w]=C[b]=C[M]=C[A]=C[R]=!0,C[r]=C[i]=C[m]=C[a]=C[x]=C[s]=C[o]=C[l]=C[u]=C[c]=C[f]=C[h]=C[p]=C[g]=C[d]=!1;function O(D){return n(D)&&t(D.length)&&!!C[e(D)]}return Rl=O,Rl}var El,Od;function Ty(){if(Od)return El;Od=1;function e(t){return function(n){return t(n)}}return El=e,El}var Di={exports:{}};Di.exports;var Pd;function FA(){return Pd||(Pd=1,(function(e,t){var n=fy(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,s=a&&n.process,o=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(Di,Di.exports)),Di.exports}var Dl,Fd;function My(){if(Fd)return Dl;Fd=1;var e=PA(),t=Ty(),n=FA(),r=n&&n.isTypedArray,i=r?t(r):e;return Dl=i,Dl}var Ol,Nd;function NA(){if(Nd)return Ol;Nd=1;var e=DA(),t=xf(),n=dn(),r=Sy(),i=Mf(),a=My(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var f=n(u),h=!f&&t(u),p=!f&&!h&&r(u),g=!f&&!h&&!p&&a(u),d=f||h||p||g,m=d?e(u.length,String):[],x=m.length;for(var y in u)(c||o.call(u,y))&&!(d&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,x)))&&m.push(y);return m}return Ol=l,Ol}var Pl,$d;function $A(){if($d)return Pl;$d=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return Pl=t,Pl}var Fl,Ld;function LA(){if(Ld)return Fl;Ld=1;function e(t,n){return function(r){return t(n(r))}}return Fl=e,Fl}var Nl,qd;function qA(){if(qd)return Nl;qd=1;var e=LA(),t=e(Object.keys,Object);return Nl=t,Nl}var $l,Id;function IA(){if(Id)return $l;Id=1;var e=$A(),t=qA(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var s=[];for(var o in Object(a))r.call(a,o)&&o!="constructor"&&s.push(o);return s}return $l=i,$l}var Ll,zd;function ds(){if(zd)return Ll;zd=1;var e=_y(),t=Af();function n(r){return r!=null&&t(r.length)&&!e(r)}return Ll=n,Ll}var ql,Bd;function gs(){if(Bd)return ql;Bd=1;var e=NA(),t=IA(),n=ds();function r(i){return n(i)?e(i):t(i)}return ql=r,ql}var Il,Ud;function zA(){if(Ud)return Il;Ud=1;var e=kA(),t=EA(),n=gs();function r(i){return e(i,n,t)}return Il=r,Il}var zl,Hd;function BA(){if(Hd)return zl;Hd=1;var e=zA(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,s,o,l,u,c){var f=o&t,h=e(a),p=h.length,g=e(s),d=g.length;if(p!=d&&!f)return!1;for(var m=p;m--;){var x=h[m];if(!(f?x in s:r.call(s,x)))return!1}var y=c.get(a),v=c.get(s);if(y&&v)return y==s&&v==a;var _=!0;c.set(a,s),c.set(s,a);for(var S=f;++m<p;){x=h[m];var w=a[x],b=s[x];if(l)var M=f?l(b,w,x,s,a,c):l(w,b,x,a,s,c);if(!(M===void 0?w===b||u(w,b,o,l,c):M)){_=!1;break}S||(S=x=="constructor")}if(_&&!S){var A=a.constructor,R=s.constructor;A!=R&&"constructor"in a&&"constructor"in s&&!(typeof A=="function"&&A instanceof A&&typeof R=="function"&&R instanceof R)&&(_=!1)}return c.delete(a),c.delete(s),_}return zl=i,zl}var Bl,jd;function UA(){if(jd)return Bl;jd=1;var e=Dr(),t=Cn(),n=e(t,"DataView");return Bl=n,Bl}var Ul,Gd;function HA(){if(Gd)return Ul;Gd=1;var e=Dr(),t=Cn(),n=e(t,"Promise");return Ul=n,Ul}var Hl,Yd;function jA(){if(Yd)return Hl;Yd=1;var e=Dr(),t=Cn(),n=e(t,"Set");return Hl=n,Hl}var jl,Xd;function GA(){if(Xd)return jl;Xd=1;var e=Dr(),t=Cn(),n=e(t,"WeakMap");return jl=n,jl}var Gl,Wd;function YA(){if(Wd)return Gl;Wd=1;var e=UA(),t=wf(),n=HA(),r=jA(),i=GA(),a=oa(),s=xy(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),g=s(t),d=s(n),m=s(r),x=s(i),y=a;return(e&&y(new e(new ArrayBuffer(1)))!=h||t&&y(new t)!=o||n&&y(n.resolve())!=u||r&&y(new r)!=c||i&&y(new i)!=f)&&(y=function(v){var _=a(v),S=_==l?v.constructor:void 0,w=S?s(S):"";if(w)switch(w){case p:return h;case g:return o;case d:return u;case m:return c;case x:return f}return _}),Gl=y,Gl}var Yl,Kd;function XA(){if(Kd)return Yl;Kd=1;var e=by(),t=wy(),n=AA(),r=BA(),i=YA(),a=dn(),s=Sy(),o=My(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function g(d,m,x,y,v,_){var S=a(d),w=a(m),b=S?c:i(d),M=w?c:i(m);b=b==u?f:b,M=M==u?f:M;var A=b==f,R=M==f,C=b==M;if(C&&s(d)){if(!s(m))return!1;S=!0,A=!1}if(C&&!A)return _||(_=new e),S||o(d)?t(d,m,x,y,v,_):n(d,m,b,x,y,v,_);if(!(x&l)){var O=A&&p.call(d,"__wrapped__"),D=R&&p.call(m,"__wrapped__");if(O||D){var N=O?d.value():d,H=D?m.value():m;return _||(_=new e),v(N,H,x,y,_)}}return C?(_||(_=new e),r(d,m,x,y,v,_)):!1}return Yl=g,Yl}var Xl,Vd;function Ay(){if(Vd)return Xl;Vd=1;var e=XA(),t=la();function n(r,i,a,s,o){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,s,n,o)}return Xl=n,Xl}var Wl,Zd;function WA(){if(Zd)return Wl;Zd=1;var e=by(),t=Ay(),n=1,r=2;function i(a,s,o,l){var u=o.length,c=u,f=!l;if(a==null)return!c;for(a=Object(a);u--;){var h=o[u];if(f&&h[2]?h[1]!==a[h[0]]:!(h[0]in a))return!1}for(;++u<c;){h=o[u];var p=h[0],g=a[p],d=h[1];if(f&&h[2]){if(g===void 0&&!(p in a))return!1}else{var m=new e;if(l)var x=l(g,d,p,a,s,m);if(!(x===void 0?t(d,g,n|r,l,m):x))return!1}}return!0}return Wl=i,Wl}var Kl,Qd;function ky(){if(Qd)return Kl;Qd=1;var e=aa();function t(n){return n===n&&!e(n)}return Kl=t,Kl}var Vl,Jd;function KA(){if(Jd)return Vl;Jd=1;var e=ky(),t=gs();function n(r){for(var i=t(r),a=i.length;a--;){var s=i[a],o=r[s];i[a]=[s,o,e(o)]}return i}return Vl=n,Vl}var Zl,tg;function Cy(){if(tg)return Zl;tg=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Zl=e,Zl}var Ql,eg;function VA(){if(eg)return Ql;eg=1;var e=WA(),t=KA(),n=Cy();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(s){return s===i||e(s,i,a)}}return Ql=r,Ql}var Jl,ng;function ZA(){if(ng)return Jl;ng=1;var e=Tf();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return Jl=t,Jl}var tu,rg;function QA(){if(rg)return tu;rg=1;function e(t,n){return t!=null&&n in Object(t)}return tu=e,tu}var eu,ig;function JA(){if(ig)return eu;ig=1;var e=vy(),t=xf(),n=dn(),r=Mf(),i=Af(),a=ps();function s(o,l,u){l=e(l,o);for(var c=-1,f=l.length,h=!1;++c<f;){var p=a(l[c]);if(!(h=o!=null&&u(o,p)))break;o=o[p]}return h||++c!=f?h:(f=o==null?0:o.length,!!f&&i(f)&&r(p,f)&&(n(o)||t(o)))}return eu=s,eu}var nu,ag;function tk(){if(ag)return nu;ag=1;var e=QA(),t=JA();function n(r,i){return r!=null&&t(r,i,e)}return nu=n,nu}var ru,sg;function ek(){if(sg)return ru;sg=1;var e=Ay(),t=ZA(),n=tk(),r=vf(),i=ky(),a=Cy(),s=ps(),o=1,l=2;function u(c,f){return r(c)&&i(f)?a(s(c),f):function(h){var p=t(h,c);return p===void 0&&p===f?n(h,c):e(f,p,o|l)}}return ru=u,ru}var iu,og;function ms(){if(og)return iu;og=1;function e(t){return t}return iu=e,iu}var au,lg;function nk(){if(lg)return au;lg=1;function e(t){return function(n){return n==null?void 0:n[t]}}return au=e,au}var su,ug;function rk(){if(ug)return su;ug=1;var e=Tf();function t(n){return function(r){return e(r,n)}}return su=t,su}var ou,cg;function ik(){if(cg)return ou;cg=1;var e=nk(),t=rk(),n=vf(),r=ps();function i(a){return n(a)?e(r(a)):t(a)}return ou=i,ou}var lu,fg;function Ry(){if(fg)return lu;fg=1;var e=VA(),t=ek(),n=ms(),r=dn(),i=ik();function a(s){return typeof s=="function"?s:s==null?n:typeof s=="object"?r(s)?t(s[0],s[1]):e(s):i(s)}return lu=a,lu}var uu,hg;function ak(){if(hg)return uu;hg=1;function e(t){return function(n,r,i){for(var a=-1,s=Object(n),o=i(n),l=o.length;l--;){var u=o[t?l:++a];if(r(s[u],u,s)===!1)break}return n}}return uu=e,uu}var cu,pg;function sk(){if(pg)return cu;pg=1;var e=ak(),t=e();return cu=t,cu}var fu,dg;function ok(){if(dg)return fu;dg=1;var e=sk(),t=gs();function n(r,i){return r&&e(r,i,t)}return fu=n,fu}var hu,gg;function lk(){if(gg)return hu;gg=1;var e=ds();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var s=i.length,o=r?s:-1,l=Object(i);(r?o--:++o<s)&&a(l[o],o,l)!==!1;);return i}}return hu=t,hu}var pu,mg;function uk(){if(mg)return pu;mg=1;var e=ok(),t=lk(),n=t(e);return pu=n,pu}var du,yg;function Ey(){if(yg)return du;yg=1;var e=uk(),t=ds();function n(r,i){var a=-1,s=t(r)?Array(r.length):[];return e(r,function(o,l,u){s[++a]=i(o,l,u)}),s}return du=n,du}var gu,_g;function ck(){if(_g)return gu;_g=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return gu=e,gu}var mu,xg;function fk(){if(xg)return mu;xg=1;var e=ua();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,s=n===n,o=e(n),l=r!==void 0,u=r===null,c=r===r,f=e(r);if(!u&&!f&&!o&&n>r||o&&l&&c&&!u&&!f||a&&l&&c||!i&&c||!s)return 1;if(!a&&!o&&!f&&n<r||f&&i&&s&&!a&&!o||u&&i&&s||!l&&s||!c)return-1}return 0}return mu=t,mu}var yu,vg;function hk(){if(vg)return yu;vg=1;var e=fk();function t(n,r,i){for(var a=-1,s=n.criteria,o=r.criteria,l=s.length,u=i.length;++a<l;){var c=e(s[a],o[a]);if(c){if(a>=u)return c;var f=i[a];return c*(f=="desc"?-1:1)}}return n.index-r.index}return yu=t,yu}var _u,bg;function pk(){if(bg)return _u;bg=1;var e=ls(),t=Tf(),n=Ry(),r=Ey(),i=ck(),a=Ty(),s=hk(),o=ms(),l=dn();function u(c,f,h){f.length?f=e(f,function(d){return l(d)?function(m){return t(m,d.length===1?d[0]:d)}:d}):f=[o];var p=-1;f=e(f,a(n));var g=r(c,function(d,m,x){var y=e(f,function(v){return v(d)});return{criteria:y,index:++p,value:d}});return i(g,function(d,m){return s(d,m,h)})}return _u=u,_u}var xu,wg;function dk(){if(wg)return xu;wg=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return xu=e,xu}var vu,Sg;function gk(){if(Sg)return vu;Sg=1;var e=dk(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var s=arguments,o=-1,l=t(s.length-i,0),u=Array(l);++o<l;)u[o]=s[i+o];o=-1;for(var c=Array(i+1);++o<i;)c[o]=s[o];return c[i]=a(u),e(r,this,c)}}return vu=n,vu}var bu,Tg;function mk(){if(Tg)return bu;Tg=1;function e(t){return function(){return t}}return bu=e,bu}var wu,Mg;function yk(){if(Mg)return wu;Mg=1;var e=Dr(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return wu=t,wu}var Su,Ag;function _k(){if(Ag)return Su;Ag=1;var e=mk(),t=yk(),n=ms(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return Su=r,Su}var Tu,kg;function xk(){if(kg)return Tu;kg=1;var e=800,t=16,n=Date.now;function r(i){var a=0,s=0;return function(){var o=n(),l=t-(o-s);if(s=o,l>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Tu=r,Tu}var Mu,Cg;function vk(){if(Cg)return Mu;Cg=1;var e=_k(),t=xk(),n=t(e);return Mu=n,Mu}var Au,Rg;function bk(){if(Rg)return Au;Rg=1;var e=ms(),t=gk(),n=vk();function r(i,a){return n(t(i,a,e),i+"")}return Au=r,Au}var ku,Eg;function kf(){if(Eg)return ku;Eg=1;var e=bf(),t=ds(),n=Mf(),r=aa();function i(a,s,o){if(!r(o))return!1;var l=typeof s;return(l=="number"?t(o)&&n(s,o.length):l=="string"&&s in o)?e(o[s],a):!1}return ku=i,ku}var Cu,Dg;function wk(){if(Dg)return Cu;Dg=1;var e=yy(),t=pk(),n=bk(),r=kf(),i=n(function(a,s){if(a==null)return[];var o=s.length;return o>1&&r(a,s[0],s[1])?s=[]:o>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return Cu=i,Cu}var Sk=wk();const Tk=di(Sk);var Ru,Og;function Mk(){if(Og)return Ru;Og=1;function e(t){for(var n=-1,r=t==null?0:t.length,i={};++n<r;){var a=t[n];i[a[0]]=a[1]}return i}return Ru=e,Ru}var Ak=Mk();const Pg=di(Ak);var Eu,Fg;function kk(){if(Fg)return Eu;Fg=1;var e=Math.ceil,t=Math.max;function n(r,i,a,s){for(var o=-1,l=t(e((i-r)/(a||1)),0),u=Array(l);l--;)u[s?l:++o]=r,r+=a;return u}return Eu=n,Eu}var Du,Ng;function Ck(){if(Ng)return Du;Ng=1;var e=kk(),t=kf(),n=py();function r(i){return function(a,s,o){return o&&typeof o!="number"&&t(a,s,o)&&(s=o=void 0),a=n(a),s===void 0?(s=a,a=0):s=n(s),o=o===void 0?a<s?1:-1:n(o),e(a,s,o,i)}}return Du=r,Du}var Ou,$g;function Rk(){if($g)return Ou;$g=1;var e=Ck(),t=e();return Ou=t,Ou}var Ek=Rk();const Dk=di(Ek);var Pu,Lg;function Ok(){if(Lg)return Pu;Lg=1;var e=ls(),t=Ry(),n=Ey(),r=dn();function i(a,s){var o=r(a)?e:n;return o(a,t(s,3))}return Pu=i,Pu}var Fu,qg;function Pk(){if(qg)return Fu;qg=1;var e=yy(),t=Ok();function n(r,i){return e(t(r,i),1)}return Fu=n,Fu}var Fk=Pk();const Nk=di(Fk);var Nu,Ig;function Dy(){if(Ig)return Nu;Ig=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return Nu=e,Nu}var $u,zg;function $k(){if(zg)return $u;zg=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return $u=e,$u}var Lu,Bg;function Lk(){if(Bg)return Lu;Bg=1;var e=Math.floor,t=Math.random;function n(r,i){return r+e(t()*(i-r+1))}return Lu=n,Lu}var qu,Ug;function Oy(){if(Ug)return qu;Ug=1;var e=Lk();function t(n,r){var i=-1,a=n.length,s=a-1;for(r=r===void 0?a:r;++i<r;){var o=e(i,s),l=n[o];n[o]=n[i],n[i]=l}return n.length=r,n}return qu=t,qu}var Iu,Hg;function qk(){if(Hg)return Iu;Hg=1;var e=Dy(),t=$k(),n=Oy();function r(i,a){return n(t(i),e(a,0,i.length))}return Iu=r,Iu}var zu,jg;function Ik(){if(jg)return zu;jg=1;var e=ls();function t(n,r){return e(r,function(i){return n[i]})}return zu=t,zu}var Bu,Gg;function zk(){if(Gg)return Bu;Gg=1;var e=Ik(),t=gs();function n(r){return r==null?[]:e(r,t(r))}return Bu=n,Bu}var Uu,Yg;function Bk(){if(Yg)return Uu;Yg=1;var e=Dy(),t=Oy(),n=zk();function r(i,a){var s=n(i);return t(s,e(a,0,s.length))}return Uu=r,Uu}var Hu,Xg;function Uk(){if(Xg)return Hu;Xg=1;var e=qk(),t=Bk(),n=dn(),r=kf(),i=dy();function a(s,o,l){(l?r(s,o,l):o===void 0)?o=1:o=i(o);var u=n(s)?e:t;return u(s,o)}return Hu=a,Hu}var Hk=Uk();const jk=di(Hk),Gk=e=>zM(e,14),Wg=e=>Object.values(e).reduce((t,n)=>t+n,0),Yk=(e,t,n={})=>{const r=Object.assign({draw:!1},n);if(Object.values(e).length<1)throw new Error("vote distribution must contain at least one party");if(!Object.values(e).every(g=>typeof g=="number"&&g>=0))throw new Error("party vote counts must be non-negative integers");if(!Number.isInteger(t)||t<=0)throw new Error("seats must be a positive integer");if(typeof r.draw!="boolean")throw new Error("opt.draw must be a boolean");const i=Wg(e),a=Pg(Object.entries(e).map(([g,d])=>{const m=Math.max(t-Object.keys(e).length,0),x=Math.round(m*d/i);return[g,x]})),s=Pg(Object.entries(e).map(([g,d])=>{const m=t+Object.keys(e).length,x=Math.min(Math.round(m*d/i),t);return[g,x]})),o=Nk(Object.entries(e).map(([g,d])=>{const m=a[g],x=s[g];return Dk(m,x).map(y=>{const v=Gk(d/(y+.5));return{party:g,quotient:v}})})),l=Wg(a),u=t-l,c=Tk(o,({quotient:g})=>-g),f=c[u-1].quotient,h=c.filter(({quotient:g})=>g>f),p=c.filter(({quotient:g})=>g===f);if(h.length+p.length===u)h.push(...p);else{if(!r.draw)throw new Error("result is ambiguous, a draw would need to be made, but opt.draw is disabled");h.push(...jk(p,u-h.length))}return h.reduce((g,{party:d})=>(g[d]+=1,g),a)},Qa=e=>Math.round(e*1e10)/1e10,Xk=e=>e.reduce((t,n)=>t+n.seats,0),Wk=e=>e.flat(),Kk=(e,t,n)=>{const r=(Math.PI-n)/2,i=t/e+r-Math.PI;return{x:Qa(e*Math.cos(i)),y:Qa(e*Math.sin(i))}},Py=(e,t,n,r)=>{const i=r*t*n/(e-t),a=1+r*(t-1)*t/2/(e-t);return i/a},Si=(e,t,n,r)=>{const i=r/Math.PI*.7142857142857143;return Math.abs(Py(e,t,n,r)*t/n-i)},Vk=(e,t,n)=>{let r=Math.floor(Math.log(e)/Math.log(2))||1,i=Si(e,r,t,n),a=0;for(Si(e,r+1,t,n)<i&&(a=1),Si(e,r-1,t,n)<i&&r>1&&(a=-1);Si(e,r+a,t,n)<i&&r>0;)i=Si(e,r+a,t,n),r+=a;return r},Zk=(e,t)=>{var i,a;let n,r;for(let s=0;s<e.length;s++)r=Qa((t[s]||0)/(((i=e[s])==null?void 0:i.length)??1)),(!n||r<n)&&(n=r);for(let s=0;s<e.length;s++)if(r=Qa((t[s]||0)/(((a=e[s])==null?void 0:a.length)??1)),r===n)return s;return 0},Qk=(e,t,n)=>{const r=Xk(e),i=Vk(r,t,n),a=Py(r,i,t,n);let s={};for(let h=1;h<=i;h++)s[h]=t-(h-1)*a;s=Yk(s,r);const o=[];let l,u,c;for(let h=1;h<=i;h++){const p=[];l=t-(h-1)*a,u=n*l/((s[h]??1)-1||1);for(let g=0;g<=(s[h]??1)-1;g++)c={...Kk(l,g*u,n),r:.4*a},p.push(c);o.push(p)}const f=Array(o.length).fill(0);for(const h of e)for(let p=0;p<h.seats;p++){const g=Zk(o,f),d=o[g],m=f[g]??0,x=d==null?void 0:d[m];x&&(x.fill=h.colour,x.party=String(h.id)),f[g]=m+1}return Wk(o)},Jk=e=>t=>e("circle",{cx:t.x,cy:t.y,r:t.r,fill:t.fill,class:t.party}),tC={seatCount:!1,arcAngle:180,hFunction:ia},eC=(e,t={})=>{var m;const{seatCount:n,arcAngle:r,hFunction:i}=Object.assign({},tC,t);if(typeof n!="boolean")throw new Error("`seatCount` option must be a boolean");if(typeof i!="function")throw new Error("`hFunction` option must be a function");if(typeof r!="number"||r<=0||r>360)throw new Error("`arcAngle` option must be a number between 0 and 360");const a=r*Math.PI/180,s=20,o=Qk(e,s,a),l=(((m=o[0])==null?void 0:m.r)??0)/.4||0,u=o.map(Jk(i));n&&u.push(i("text",{x:0,y:0,"text-anchor":"middle",style:{"font-family":"Helvetica","font-size":.25*s+"px"},class:"seatNumber"},String(u.length)));const c=r<=180?s+l:s*(1+Math.sin((a-Math.PI)/2))+l,f=s+l,h=Math.max(c,f),p=r<=180?-s-l/2:-s*(1+Math.sin((a-Math.PI)/2))-l/2,g=i("defs",[ny(i),ry(i),iy(i)]);return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:[-s-l/2,p,2*s+l,h].join(",")},[g,...u])},nC={seatCount:!1,arcAngle:200,arcAngleFlexibility:5,radius:380,seatSize:4.5,minSeatSize:1.8,maxSeatSize:3,spacing:1.8,innerRadiusRatio:.6,showLabels:!0,hFunction:ia},rC=(e,t={})=>{const n={...nC,...t},{arcAngle:r,arcAngleFlexibility:i,radius:a,seatSize:s,minSeatSize:o,maxSeatSize:l,spacing:u,innerRadiusRatio:c,showLabels:f,hFunction:h}=n,p=a*c,g=e.reduce((K,k)=>K+k.seats,0);let d={seatSize:s,arcAngle:r,score:-1};const m=r-i,x=r+i;for(let K=m;K<=x;K+=2.5){const k=K*Math.PI/180;for(let z=l;z>=o;z-=.1){const E=z*2,T=E*u,X=Math.floor((a-p)/T);for(let V=1;V<=Math.min(X,10);V++){let G=0;for(let ut=0;ut<V;ut++){const U=p+(ut+.5)*T,ot=E*u/U,gt=Math.floor(k/ot);G+=gt}if(G>=g){const ut=g/G,U=(z-o)/(l-o),ot=(G-g)/g,gt=ot<.15?1:ot<.3?.7:ot<.5?.4:.1,yt=1-Math.abs(K-r)/i,vt=gt*.5+U*.3+ut*.15+yt*.05;vt>d.score&&(d={seatSize:z,arcAngle:K,rings:V,score:vt})}}}}const y=d.seatSize,v=d.arcAngle,_=v*Math.PI/180,S=y*2,w=S*u,b=Math.floor((a-p)/w),M=[],A=-_/2-Math.PI/2,R=[];let C=0,O=[];for(let K=1;K<=b;K++){let k=0;const z=[];for(let E=0;E<K;E++){const T=p+(E+.5)*w,X=S*u/T,V=Math.floor(_/X);z.push(V),k+=V}if(k>=g){C=K,O=z;break}}if(C>0)R.push(...O);else for(let K=0;K<b;K++){const k=p+(K+.5)*w,z=S*u/k,E=Math.floor(_/z);R.push(E)}for(let K=0;K<R.length;K++){const k=p+(K+.5)*w,z=R[K]??0;if(z>0){const E=_/z;for(let T=0;T<z;T++){const X=A+(T+.5)*E,V=Math.cos(X)*k,G=Math.sin(X)*k;M.push({ring:K,index:T,angle:X,x:V,y:G})}}}M.sort((K,k)=>{const z=K.angle-k.angle;return Math.abs(z)>.001?z:K.ring-k.ring});const D=[];let N=0;e.forEach(K=>{const k=[],z=Math.min(K.seats,M.length-N);let E=1/0,T=-1/0;for(let V=0;V<z&&N<M.length;V++){const G=M[N++];G&&(E=Math.min(E,G.angle),T=Math.max(T,G.angle),Math.sqrt(G.x*G.x+G.y*G.y),k.push(h("circle",{fill:K.colour,stroke:K.colour,className:"circle seat-visual seat-hover-zone",transform:`translate(${G.x}, ${G.y})`,r:y,"data-party":K.name,"data-party-id":String(K.id),style:"pointer-events: all; cursor: pointer;"})))}const X=k;D.push(h("g",{className:"party-group","data-party":K.name,style:"opacity: 1; outline: none;"},X))});const H=h("g",{className:"arc-bg"},[h("circle",{className:"outer",cx:0,cy:0,fill:"#ffffff",r:a}),h("circle",{className:"inner",cx:0,cy:0,fill:"#ffffff",r:p})]),q=h("g",{className:"points-container"},D),F=f?h("g",{className:"label-container",mask:"url(#label-clip)",style:"pointer-events: none;"},[h("text",{className:"party_count",dy:"-0.05em",style:"font-size: 24vw; font-weight: bold; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"}),h("text",{className:"party_name",y:0,dy:"1em",style:"font-size: 6vw; font-weight: normal; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"})]):null,j=h("defs",[h("radialGradient",{id:"label-gradient"},[h("stop",{offset:"0%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"80%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"90%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"}),h("stop",{offset:"100%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0;"})]),h("mask",{id:"label-clip"},[h("circle",{fill:"url(#label-gradient)",r:p})]),ny(h),ry(h),iy(h)]),et=h("g",{className:"arc-container",transform:`translate(${a}, ${a})`},[H,q,F].filter(Boolean)),nt=_/2;let J;if(v<=180)J=a*Math.sin(nt)+y;else{const K=nt-Math.PI/2;J=a*(1+Math.sin(K))+y}const lt=a+y,I=a*2,Q=Math.max(J,lt);return h("svg",{id:"chart-container","font-family":"Canva Sans Variable",viewBox:`0 0 ${I} ${Q}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg"},[et,j])};function Fy(e){return!e||!e.color?"#cccccc":e.color==="url(#hatchPattern)"?Qr.COMPLETED:e.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:e.color}function Cc(e,t){if(!e)return;const n=e.querySelectorAll(".party-group");n&&n.length>0&&n.forEach(r=>{if(!r)return;const i=r,a=i.getAttribute("data-party");t?a===t?i.style.opacity=Pe.animation.hoverOpacity.active:i.style.opacity=Pe.animation.hoverOpacity.dimmed:i.style.opacity="1"})}function Rc(e,t){e.forEach(n=>{const r=n,i=n.getAttribute("class")||"";t?i===t?(r.setAttribute("fill-opacity","1"),r.setAttribute("stroke-opacity","1")):(r.setAttribute("fill-opacity",Pe.animation.hoverOpacity.dimmed),r.setAttribute("stroke-opacity","0.2")):(r.setAttribute("fill-opacity","1"),r.setAttribute("stroke-opacity","1"))})}const iC=({containerRef:e,processedData:t,totalRepositories:n,arcAngle:r,useEnhanced:i,maxSeats:a,setHoveredData:s,activePartyName:o,setActivePartyName:l,chartConfig:u,seatSize:c,shouldAnimate:f=!1,animationDirection:h="left-to-right",onAnimationComplete:p})=>{Y.useEffect(()=>{if(!e.current||t.length===0)return;for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const g=n<=a?1:a/n,d=t.filter(w=>w.value>0).map(w=>{const b=n<=a?w.value:Math.max(1,Math.floor(w.value*g));return{id:String(w.id),name:w.label,seats:b,colour:w.color==="url(#hatchPattern)"?Qr.COMPLETED:w.color}}),m=i?rC(d,{arcAngle:r,arcAngleFlexibility:u.arcAngleFlexibility,radius:u.radius,seatSize:c,minSeatSize:u.minSeatSize,maxSeatSize:u.maxSeatSize,spacing:u.spacing,innerRadiusRatio:u.innerRadiusRatio,showLabels:!0}):eC(d,{arcAngle:r});m.properties&&(m.properties.width="100%",m.properties.height="100%",m.properties.style="display: block; width: 100%; max-width: 100%; height: auto;",m.properties.preserveAspectRatio="xMidYMid meet");const x=CM(m),_=new DOMParser().parseFromString(x,"image/svg+xml").documentElement;if(!_)return;_.setAttribute("width","100%"),_.setAttribute("height","100%"),_.style.width="100%",_.style.height="auto",_.style.display="block",i?aC(_,d,t,s,o,l):sC(_,d,t,s,o,l);const S=()=>{if(s(null),l(null),i)Cc(_,null);else{const w=_.querySelectorAll("circle");Rc(w,null)}};return _&&_.addEventListener("mouseleave",S),e.current.appendChild(_),f&&_&&DM(_,r,u.radius,h,900,p),()=>{if(_&&_.removeEventListener("mouseleave",S),e.current)for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild)}},[t,n,r,i,a,s,o,l,e,u,c,f,h,p])};function aC(e,t,n,r,i,a){if(!e)return;const s=e.querySelectorAll(".seat-hover-zone"),o=e.querySelectorAll(".party-group circle.seat-visual");o&&o.length>0&&o.forEach(l=>{if(l){const u=l;u.style.stroke=Pe.colors.seatBorder,u.style.strokeWidth="0.5",u.setAttribute("fill-opacity","1"),u.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s&&s.length>0&&s.forEach(l=>{if(!l)return;const u=l.getAttribute("data-party"),c=l.getAttribute("data-party-id"),f=()=>{if(u&&u!==i){const h=t.find(p=>p.name===u||String(p.id)===c);if(h){const p=n.find(g=>g.label===h.name||String(g.id)===h.id);if(p){const g=Fy(p);r({label:p.label||"Unknown",value:p.value||0,color:g}),a(h.name),Cc(e,h.name)}}}};l.addEventListener("mouseenter",f)}),i&&Cc(e,i)}function sC(e,t,n,r,i,a){if(!e)return;const s=e.querySelectorAll("circle");if(s&&s.length>0&&(s.forEach(o=>{if(o){const l=o;l.style.cursor="pointer",l.style.stroke=Pe.colors.seatBorder,l.style.strokeWidth="0.5",l.setAttribute("fill-opacity","1"),l.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s.forEach(o=>{if(!o)return;const l=o.getAttribute("class")||"",u=parseInt(l,10),c=t[u],f=()=>{if(c){const h=c.name;if(h&&h!==i){const p=n.find(g=>g.label===c.name||String(g.id)===c.id);if(p){const g=Fy(p);r({label:p.label||"Unknown",value:p.value||0,color:g}),a(h),Rc(s,l)}}}};o.addEventListener("mouseenter",f)})),i){const o=t.find(l=>l.name===i);if(o){const l=t.indexOf(o);Rc(s,String(l))}}}const ju=Ni,Kg={[Ii]:Qr.NOT_APPLICABLE,[zi]:Qr.NO_LST,[Bi]:Qr.DATA_MISSING},Ti=(e,t,n)=>{if(e in Kg)return Kg[e];const r=n-1-t,i=ju.length,a=Math.floor(r/Math.max(1,n-1)*(i-1)),s=Math.min(Math.max(0,a),i-1);return ju[s]??ju[0]??"#000000"},Ny=({dataSeries:e,notApplicableRepositories:t,noLstRepositories:n,unavailableRepositories:r})=>{const{special:i,regular:a}=e.reduce((p,g,d)=>([Ii,zi,Bi].includes(g.label)?p.special.push({...g,originalIndex:d}):p.regular.push({...g,originalIndex:d}),p),{special:[],regular:[]}),s=a.reverse().map((p,g)=>({id:`measure-${g}`,label:p.label,value:p.value,color:Ti(p.label,a.length-1-g,a.length)})),o=i.map((p,g)=>({id:p.label.toLowerCase().replace(" ","-"),label:p.label,value:p.value,color:Ti(p.label,g,i.length)})),l=r,u={id:"no-lst",label:zi,value:n,color:Ti(zi,0,1)},c={id:"data-missing",label:Bi,value:l,color:Ti(Bi,0,1)},f={id:"n/a",label:Ii,value:t,color:Ti(Ii,0,1)},h=[];return f.value>0&&h.push(f),u.value>0&&h.push(u),c.value>0&&h.push(c),h.push(...o),h.push(...s),h},Vg={"N/A":"Repos that aren't applicable to this migration.","No LST":"There are no LSTs for these repos.","Data Missing":"There is data missing in the LSTs."},oC=({dataSeries:e,totalRepositories:t,notApplicableRepositories:n,noLstRepositories:r,unavailableRepositories:i,arcAngle:a,useEnhanced:s=Pe.useEnhanced,showTable:o=!0,shouldAnimate:l=!1,animationDirection:u="left-to-right",onAnimationComplete:c})=>{const f=Y.useRef(null),[h,p]=Y.useState(null),[g,d]=Y.useState(null),x=Ny({dataSeries:e,notApplicableRepositories:n,noLstRepositories:r,unavailableRepositories:i}).map(b=>{const M=typeof b.color=="function"?b.color("arc"):b.color,A=typeof b.label=="function"?b.label("arc"):b.label;return{...b,color:M,label:A}}),y=a??pf({repositoryCount:t}),v=df({repositoryCount:t});iC({containerRef:f,processedData:x,totalRepositories:t,arcAngle:y,useEnhanced:s,maxSeats:Pe.maxSeats,setHoveredData:p,activePartyName:g,setActivePartyName:d,chartConfig:Pe.chartConfig,seatSize:v,shouldAnimate:l,animationDirection:u,onAnimationComplete:c});const _=x.map(b=>{const M=b.value/t*100,A=M>0&&M<1?"< 1":M.toFixed(0);return{id:String(b.id),label:b.label,value:b.value,percentage:A,color:b.color}}),S=t>Pe.maxSeats,w=S?Math.round(t/Pe.maxSeats):1;return P.jsxs(L.Stack,{sx:{width:"100%",alignItems:"center",gap:{xs:.5,sm:.75,md:1,lg:1},py:0,"@media (min-width: 1024px) and (max-width: 1225px)":{gap:.25}},children:[P.jsxs(L.Box,{className:"parliament-chart-container",sx:{position:"relative",width:"100%",minHeight:"200px",mb:{xs:.5,sm:.75,md:1},"@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"250px",mb:.25}},children:[P.jsx(L.Box,{className:"parliament-chart-svg-container",ref:f,sx:{width:"100%",height:"100%",position:"relative",display:"flex",justifyContent:"center",alignItems:"center","& svg":{width:"100%",height:"100%",maxWidth:"100%","@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"230px"}}}}),P.jsxs(L.Box,{className:"parliament-chart-tooltip",sx:{position:"absolute",bottom:"0%",left:"50%",transform:"translate(-50%, 0%)",pointerEvents:"none",textAlign:"center",zIndex:10,"@media (min-width: 1024px) and (max-width: 1225px)":{bottom:"5%"}},children:[h&&P.jsxs(Y.Fragment,{children:[P.jsx(L.Typography,{sx:{color:"text.secondary",mb:.3,fontSize:"clamp(0.75rem, 1.5vw, 0.85rem)",display:"block","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"0.7rem",mb:.2}},children:h.label}),P.jsxs(L.Typography,{sx:{fontWeight:"bold",color:h.color,lineHeight:1,fontSize:"clamp(1.1rem, 2.2vw, 1.3rem)","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"1rem"}},children:[h.value," ",h.value>1?"repos":"repo"]})]}),S&&P.jsxs(L.Box,{className:"parliament-chart-scaled-indicator",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,mt:h?.5:0,color:"text.secondary",fontSize:"clamp(0.65rem, 1.2vw, 0.72rem)"},children:[P.jsx(L.Box,{className:"parliament-chart-scaled-indicator-dot",sx:{width:8,height:8,borderRadius:"50%",backgroundColor:"#888888",flexShrink:0}}),P.jsxs(L.Typography,{variant:"caption",sx:{fontSize:"inherit",fontStyle:"italic"},children:["= ~",w," repos"]})]})]})]}),o&&P.jsx(L.Box,{className:"parliament-chart-data-table",sx:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>{p(null),d(null)},children:P.jsxs(L.Table,{"aria-label":"Repository categories summary",className:"parliament-chart-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[P.jsx("thead",{children:P.jsxs(L.TableRow,{children:[P.jsx(L.TableCell,{}),P.jsx(L.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"# of repos"}),P.jsx(L.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"% of org"})]})}),P.jsx("tbody",{children:_.map(b=>{const M=b.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:b.color;return P.jsxs(L.TableRow,{onMouseEnter:()=>{d(b.label),p({label:b.label,value:b.value,color:b.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:b.color})},sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:g===b.label?`${M}15`:"transparent","&:hover":{backgroundColor:`${M}15`}},children:[P.jsx(L.TableCell,{align:"center",sx:{width:20},children:P.jsx(L.Box,{sx:{width:12,height:12,backgroundColor:b.color==="url(#greyHatchPattern)"?Dt.greyHatch.background:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.background:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.background:b.color,borderRadius:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:g===b.label?"scale(1.2)":"scale(1)",...b.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
47
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function _M(e,t,n,r){const i=r.schema,a=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=yf);const u=xM(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(s=!1),(u||!a||!hM(e,t,n))&&(o.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!s&&(!a||!xf(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function xM(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const a=vM(e,i,t[i]);a&&n.push(a)}}for(;++r<n.length;){const a=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&a!=='"'&&a!=="'"&&(n[r]+=" ")}return n.join("")}function vM(e,t,n){const r=ty(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Qr(r.attribute,Object.assign({},e.settings.characterReferences,{subset:wa.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?hT:dT)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=Qr(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:wa.unquoted[i][a]}))),o!==n&&(e.settings.quoteSmart&&Xh(n,s)>Xh(n,e.alternative)&&(s=e.alternative),o=s+Qr(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?wa.single:wa.double)[i][a],attribute:!0}))+s),l+(o&&"="+o))}const bM=["<","&"];function hy(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Qr(e.value,Object.assign({},r.settings.characterReferences,{subset:bM}))}function wM(e,t,n,r){return r.settings.allowDangerousHtml?e.value:hy(e,t,n,r)}function SM(e,t,n,r){return r.all(e)}const TM=RT("type",{invalid:MM,unknown:AM,handlers:{comment:KT,doctype:VT,element:_M,raw:wM,root:SM,text:hy}});function MM(e){throw new Error("Expected node, not `"+e+"`")}function AM(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const kM={},CM={},RM=[];function EM(e,t){const n=kM,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:DM,all:OM,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||CT,characterReferences:n.characterReferences||CM,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?yf:ey,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function DM(e,t,n){return TM(e,t,n,this)}function OM(e){const t=[],n=e&&e.children||RM;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const Pe={arcAngle:180,maxSeats:200,useEnhanced:!0,chartConfig:{radius:220,seatSize:5,minSeatSize:4,maxSeatSize:18,spacing:1.1,innerRadiusRatio:.4,arcAngleFlexibility:5},colors:{emptySeats:"#f8f8f8",emptySeatsBorder:"#d8d8d8",seatBorder:"#fff"},animation:{transitionDuration:"0.2s",hoverOpacity:{active:"1",dimmed:"0.2",empty:"0.3"}},scaling:{enableScaling:!0,scaleThreshold:200}},Jr={COMPLETED:pn.neoDigitalGreen[600],NOT_APPLICABLE:"url(#greyHatchPattern)",NO_LST:"url(#noLstHatchPattern)",DATA_MISSING:"url(#dataMissingHatchPattern)"},zi="N/A",Bi="No LST",Ui="Data Missing";function PM(e,t,n,r="left-to-right",i=900,a){Ot.prototype.transition=Ic;const s=t*Math.PI/180,o=-s/2-Math.PI/2,l=s/2-Math.PI/2;let u=e.querySelector("defs");u||(u=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.appendChild(u));const c="arc-sweep-clip";let f=u.querySelector(`#${c}`);f||(f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),f.setAttribute("id",c),u.appendChild(f));const h=document.createElementNS("http://www.w3.org/2000/svg","path");f.innerHTML="",f.appendChild(h);const p=e.querySelector(".arc-container"),g=e.querySelector(".points-container");if(g&&p)if(g.setAttribute("clip-path",`url(#${c})`),r==="left-to-right"){const m=y=>{const v=n*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,M=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${M},1 ${w},${b} Z`};h.setAttribute("d",m(o)),Ot(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=o+(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{a&&a(),setTimeout(()=>{g.removeAttribute("clip-path")},50)})}else{const m=y=>{const v=n*1.5,_=Math.cos(y)*v,S=Math.sin(y)*v,w=Math.cos(l)*v,b=Math.sin(l)*v,M=l-y>Math.PI?1:0;return`M 0,0 L ${_},${S} A ${v},${v} 0 ${M},1 ${w},${b} Z`};h.setAttribute("d",m(l)),Ot(h).transition().duration(i).ease(y=>1-Math.pow(1-y,3)).tween("arc-sweep",()=>y=>{const v=l-(l-o)*y;h.setAttribute("d",m(v))}).on("end",()=>{g.removeAttribute("clip-path"),a&&a()})}}var Sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vs,Qh;function py(){if(Qh)return Vs;Qh=1;var e=typeof Sa=="object"&&Sa&&Sa.Object===Object&&Sa;return Vs=e,Vs}var Zs,Jh;function Cn(){if(Jh)return Zs;Jh=1;var e=py(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Zs=n,Zs}var Qs,tp;function FM(){if(tp)return Qs;tp=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Qs=t,Qs}var Js,ep;function $M(){if(ep)return Js;ep=1;var e=FM(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Js=n,Js}var to,np;function sa(){if(np)return to;np=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return to=e,to}var eo,rp;function oa(){if(rp)return eo;rp=1;var e=Cn(),t=e.Symbol;return eo=t,eo}var no,ip;function LM(){if(ip)return no;ip=1;var e=oa(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(s){var o=n.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var c=r.call(s);return u&&(o?s[i]=l:delete s[i]),c}return no=a,no}var ro,ap;function NM(){if(ap)return ro;ap=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return ro=n,ro}var io,sp;function la(){if(sp)return io;sp=1;var e=oa(),t=LM(),n=NM(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function s(o){return o==null?o===void 0?i:r:a&&a in Object(o)?t(o):n(o)}return io=s,io}var ao,op;function ua(){if(op)return ao;op=1;function e(t){return t!=null&&typeof t=="object"}return ao=e,ao}var so,lp;function ca(){if(lp)return so;lp=1;var e=la(),t=ua(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return so=r,so}var oo,up;function dy(){if(up)return oo;up=1;var e=$M(),t=sa(),n=ca(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||s.test(u)?o(u.slice(2),f?2:8):i.test(u)?r:+u}return oo=l,oo}var lo,cp;function gy(){if(cp)return lo;cp=1;var e=dy(),t=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*n}return i===i?i:0}return lo=r,lo}var uo,fp;function my(){if(fp)return uo;fp=1;var e=gy();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return uo=t,uo}var co,hp;function us(){if(hp)return co;hp=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return co=e,co}var fo,pp;function dn(){if(pp)return fo;pp=1;var e=Array.isArray;return fo=e,fo}var ho,dp;function qM(){if(dp)return ho;dp=1;var e=oa(),t=us(),n=dn(),r=ca(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(n(o))return t(o,s)+"";if(r(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return ho=s,ho}var po,gp;function yy(){if(gp)return po;gp=1;var e=qM();function t(n){return n==null?"":e(n)}return po=t,po}var go,mp;function IM(){if(mp)return go;mp=1;var e=Cn(),t=my(),n=dy(),r=yy(),i=e.isFinite,a=Math.min;function s(o){var l=Math[o];return function(u,c){if(u=n(u),c=c==null?0:a(t(c),292),c&&i(u)){var f=(r(u)+"e").split("e"),h=l(f[0]+"e"+(+f[1]+c));return f=(r(h)+"e").split("e"),+(f[0]+"e"+(+f[1]-c))}return l(u)}}return go=s,go}var mo,yp;function zM(){if(yp)return mo;yp=1;var e=IM(),t=e("round");return mo=t,mo}var BM=zM();const UM=gi(BM);var yo,_p;function _y(){if(_p)return yo;_p=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return yo=e,yo}var _o,xp;function HM(){if(xp)return _o;xp=1;var e=la(),t=ua(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return _o=r,_o}var xo,vp;function vf(){if(vp)return xo;vp=1;var e=HM(),t=ua(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(s){return t(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return xo=a,xo}var vo,bp;function jM(){if(bp)return vo;bp=1;var e=oa(),t=vf(),n=dn(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return vo=i,vo}var bo,wp;function xy(){if(wp)return bo;wp=1;var e=_y(),t=jM();function n(r,i,a,s,o){var l=-1,u=r.length;for(a||(a=t),o||(o=[]);++l<u;){var c=r[l];i>0&&a(c)?i>1?n(c,i-1,a,s,o):e(o,c):s||(o[o.length]=c)}return o}return bo=n,bo}var wo,Sp;function bf(){if(Sp)return wo;Sp=1;var e=dn(),t=ca(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){if(e(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||s!=null&&a in Object(s)}return wo=i,wo}var So,Tp;function vy(){if(Tp)return So;Tp=1;var e=la(),t=sa(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!t(o))return!1;var l=e(o);return l==r||l==i||l==n||l==a}return So=s,So}var To,Mp;function GM(){if(Mp)return To;Mp=1;var e=Cn(),t=e["__core-js_shared__"];return To=t,To}var Mo,Ap;function YM(){if(Ap)return Mo;Ap=1;var e=GM(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Mo=n,Mo}var Ao,kp;function by(){if(kp)return Ao;kp=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ao=n,Ao}var ko,Cp;function WM(){if(Cp)return ko;Cp=1;var e=vy(),t=YM(),n=sa(),r=by(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!n(h)||t(h))return!1;var p=e(h)?c:a;return p.test(r(h))}return ko=f,ko}var Co,Rp;function XM(){if(Rp)return Co;Rp=1;function e(t,n){return t==null?void 0:t[n]}return Co=e,Co}var Ro,Ep;function Or(){if(Ep)return Ro;Ep=1;var e=WM(),t=XM();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return Ro=n,Ro}var Eo,Dp;function cs(){if(Dp)return Eo;Dp=1;var e=Or(),t=e(Object,"create");return Eo=t,Eo}var Do,Op;function KM(){if(Op)return Do;Op=1;var e=cs();function t(){this.__data__=e?e(null):{},this.size=0}return Do=t,Do}var Oo,Pp;function VM(){if(Pp)return Oo;Pp=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Oo=e,Oo}var Po,Fp;function ZM(){if(Fp)return Po;Fp=1;var e=cs(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var s=this.__data__;if(e){var o=s[a];return o===t?void 0:o}return r.call(s,a)?s[a]:void 0}return Po=i,Po}var Fo,$p;function QM(){if($p)return Fo;$p=1;var e=cs(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return Fo=r,Fo}var $o,Lp;function JM(){if(Lp)return $o;Lp=1;var e=cs(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return $o=n,$o}var Lo,Np;function tA(){if(Np)return Lo;Np=1;var e=KM(),t=VM(),n=ZM(),r=QM(),i=JM();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Lo=a,Lo}var No,qp;function eA(){if(qp)return No;qp=1;function e(){this.__data__=[],this.size=0}return No=e,No}var qo,Ip;function wf(){if(Ip)return qo;Ip=1;function e(t,n){return t===n||t!==t&&n!==n}return qo=e,qo}var Io,zp;function fs(){if(zp)return Io;zp=1;var e=wf();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return Io=t,Io}var zo,Bp;function nA(){if(Bp)return zo;Bp=1;var e=fs(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,s=e(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():n.call(a,s,1),--this.size,!0}return zo=r,zo}var Bo,Up;function rA(){if(Up)return Bo;Up=1;var e=fs();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return Bo=t,Bo}var Uo,Hp;function iA(){if(Hp)return Uo;Hp=1;var e=fs();function t(n){return e(this.__data__,n)>-1}return Uo=t,Uo}var Ho,jp;function aA(){if(jp)return Ho;jp=1;var e=fs();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return Ho=t,Ho}var jo,Gp;function hs(){if(Gp)return jo;Gp=1;var e=eA(),t=nA(),n=rA(),r=iA(),i=aA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,jo=a,jo}var Go,Yp;function Sf(){if(Yp)return Go;Yp=1;var e=Or(),t=Cn(),n=e(t,"Map");return Go=n,Go}var Yo,Wp;function sA(){if(Wp)return Yo;Wp=1;var e=tA(),t=hs(),n=Sf();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Yo=r,Yo}var Wo,Xp;function oA(){if(Xp)return Wo;Xp=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Wo=e,Wo}var Xo,Kp;function ps(){if(Kp)return Xo;Kp=1;var e=oA();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Xo=t,Xo}var Ko,Vp;function lA(){if(Vp)return Ko;Vp=1;var e=ps();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Ko=t,Ko}var Vo,Zp;function uA(){if(Zp)return Vo;Zp=1;var e=ps();function t(n){return e(this,n).get(n)}return Vo=t,Vo}var Zo,Qp;function cA(){if(Qp)return Zo;Qp=1;var e=ps();function t(n){return e(this,n).has(n)}return Zo=t,Zo}var Qo,Jp;function fA(){if(Jp)return Qo;Jp=1;var e=ps();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return Qo=t,Qo}var Jo,td;function Tf(){if(td)return Jo;td=1;var e=sA(),t=lA(),n=uA(),r=cA(),i=fA();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,Jo=a,Jo}var tl,ed;function hA(){if(ed)return tl;ed=1;var e=Tf(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=r.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,tl=n,tl}var el,nd;function pA(){if(nd)return el;nd=1;var e=hA(),t=500;function n(r){var i=e(r,function(s){return a.size===t&&a.clear(),s}),a=i.cache;return i}return el=n,el}var nl,rd;function dA(){if(rd)return nl;rd=1;var e=pA(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(s,o,l,u){a.push(l?u.replace(n,"$1"):o||s)}),a});return nl=r,nl}var rl,id;function wy(){if(id)return rl;id=1;var e=dn(),t=bf(),n=dA(),r=yy();function i(a,s){return e(a)?a:t(a,s)?[a]:n(r(a))}return rl=i,rl}var il,ad;function ds(){if(ad)return il;ad=1;var e=ca();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return il=t,il}var al,sd;function Mf(){if(sd)return al;sd=1;var e=wy(),t=ds();function n(r,i){i=e(i,r);for(var a=0,s=i.length;r!=null&&a<s;)r=r[t(i[a++])];return a&&a==s?r:void 0}return al=n,al}var sl,od;function gA(){if(od)return sl;od=1;var e=hs();function t(){this.__data__=new e,this.size=0}return sl=t,sl}var ol,ld;function mA(){if(ld)return ol;ld=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return ol=e,ol}var ll,ud;function yA(){if(ud)return ll;ud=1;function e(t){return this.__data__.get(t)}return ll=e,ll}var ul,cd;function _A(){if(cd)return ul;cd=1;function e(t){return this.__data__.has(t)}return ul=e,ul}var cl,fd;function xA(){if(fd)return cl;fd=1;var e=hs(),t=Sf(),n=Tf(),r=200;function i(a,s){var o=this.__data__;if(o instanceof e){var l=o.__data__;if(!t||l.length<r-1)return l.push([a,s]),this.size=++o.size,this;o=this.__data__=new n(l)}return o.set(a,s),this.size=o.size,this}return cl=i,cl}var fl,hd;function Sy(){if(hd)return fl;hd=1;var e=hs(),t=gA(),n=mA(),r=yA(),i=_A(),a=xA();function s(o){var l=this.__data__=new e(o);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=a,fl=s,fl}var hl,pd;function vA(){if(pd)return hl;pd=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return hl=t,hl}var pl,dd;function bA(){if(dd)return pl;dd=1;function e(t){return this.__data__.has(t)}return pl=e,pl}var dl,gd;function wA(){if(gd)return dl;gd=1;var e=Tf(),t=vA(),n=bA();function r(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new e;++a<s;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,dl=r,dl}var gl,md;function SA(){if(md)return gl;md=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return gl=e,gl}var ml,yd;function TA(){if(yd)return ml;yd=1;function e(t,n){return t.has(n)}return ml=e,ml}var yl,_d;function Ty(){if(_d)return yl;_d=1;var e=wA(),t=SA(),n=TA(),r=1,i=2;function a(s,o,l,u,c,f){var h=l&r,p=s.length,g=o.length;if(p!=g&&!(h&&g>p))return!1;var d=f.get(s),m=f.get(o);if(d&&m)return d==o&&m==s;var x=-1,y=!0,v=l&i?new e:void 0;for(f.set(s,o),f.set(o,s);++x<p;){var _=s[x],S=o[x];if(u)var w=h?u(S,_,x,o,s,f):u(_,S,x,s,o,f);if(w!==void 0){if(w)continue;y=!1;break}if(v){if(!t(o,function(b,M){if(!n(v,M)&&(_===b||c(_,b,l,u,f)))return v.push(M)})){y=!1;break}}else if(!(_===S||c(_,S,l,u,f))){y=!1;break}}return f.delete(s),f.delete(o),y}return yl=a,yl}var _l,xd;function MA(){if(xd)return _l;xd=1;var e=Cn(),t=e.Uint8Array;return _l=t,_l}var xl,vd;function AA(){if(vd)return xl;vd=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return xl=e,xl}var vl,bd;function kA(){if(bd)return vl;bd=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return vl=e,vl}var bl,wd;function CA(){if(wd)return bl;wd=1;var e=oa(),t=MA(),n=wf(),r=Ty(),i=AA(),a=kA(),s=1,o=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",g="[object Set]",d="[object String]",m="[object Symbol]",x="[object ArrayBuffer]",y="[object DataView]",v=e?e.prototype:void 0,_=v?v.valueOf:void 0;function S(w,b,M,A,k,C,O){switch(M){case y:if(w.byteLength!=b.byteLength||w.byteOffset!=b.byteOffset)return!1;w=w.buffer,b=b.buffer;case x:return!(w.byteLength!=b.byteLength||!C(new t(w),new t(b)));case l:case u:case h:return n(+w,+b);case c:return w.name==b.name&&w.message==b.message;case p:case d:return w==b+"";case f:var P=i;case g:var F=A&s;if(P||(P=a),w.size!=b.size&&!F)return!1;var B=O.get(w);if(B)return B==b;A|=o,O.set(w,b);var L=r(P(w),P(b),A,k,C,O);return O.delete(w),L;case m:if(_)return _.call(w)==_.call(b)}return!1}return bl=S,bl}var wl,Sd;function RA(){if(Sd)return wl;Sd=1;var e=_y(),t=dn();function n(r,i,a){var s=i(r);return t(r)?s:e(s,a(r))}return wl=n,wl}var Sl,Td;function EA(){if(Td)return Sl;Td=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,s=[];++r<i;){var o=t[r];n(o,r,t)&&(s[a++]=o)}return s}return Sl=e,Sl}var Tl,Md;function DA(){if(Md)return Tl;Md=1;function e(){return[]}return Tl=e,Tl}var Ml,Ad;function OA(){if(Ad)return Ml;Ad=1;var e=EA(),t=DA(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(o){return r.call(s,o)}))}:t;return Ml=a,Ml}var Al,kd;function PA(){if(kd)return Al;kd=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return Al=e,Al}var Di={exports:{}},kl,Cd;function FA(){if(Cd)return kl;Cd=1;function e(){return!1}return kl=e,kl}Di.exports;var Rd;function My(){return Rd||(Rd=1,(function(e,t){var n=Cn(),r=FA(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,o=s?n.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||r;e.exports=u})(Di,Di.exports)),Di.exports}var Cl,Ed;function Af(){if(Ed)return Cl;Ed=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return Cl=n,Cl}var Rl,Dd;function kf(){if(Dd)return Rl;Dd=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Rl=t,Rl}var El,Od;function $A(){if(Od)return El;Od=1;var e=la(),t=kf(),n=ua(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",g="[object String]",d="[object WeakMap]",m="[object ArrayBuffer]",x="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",w="[object Int32Array]",b="[object Uint8Array]",M="[object Uint8ClampedArray]",A="[object Uint16Array]",k="[object Uint32Array]",C={};C[y]=C[v]=C[_]=C[S]=C[w]=C[b]=C[M]=C[A]=C[k]=!0,C[r]=C[i]=C[m]=C[a]=C[x]=C[s]=C[o]=C[l]=C[u]=C[c]=C[f]=C[h]=C[p]=C[g]=C[d]=!1;function O(P){return n(P)&&t(P.length)&&!!C[e(P)]}return El=O,El}var Dl,Pd;function Ay(){if(Pd)return Dl;Pd=1;function e(t){return function(n){return t(n)}}return Dl=e,Dl}var Oi={exports:{}};Oi.exports;var Fd;function LA(){return Fd||(Fd=1,(function(e,t){var n=py(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,s=a&&n.process,o=(function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})(Oi,Oi.exports)),Oi.exports}var Ol,$d;function ky(){if($d)return Ol;$d=1;var e=$A(),t=Ay(),n=LA(),r=n&&n.isTypedArray,i=r?t(r):e;return Ol=i,Ol}var Pl,Ld;function NA(){if(Ld)return Pl;Ld=1;var e=PA(),t=vf(),n=dn(),r=My(),i=Af(),a=ky(),s=Object.prototype,o=s.hasOwnProperty;function l(u,c){var f=n(u),h=!f&&t(u),p=!f&&!h&&r(u),g=!f&&!h&&!p&&a(u),d=f||h||p||g,m=d?e(u.length,String):[],x=m.length;for(var y in u)(c||o.call(u,y))&&!(d&&(y=="length"||p&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,x)))&&m.push(y);return m}return Pl=l,Pl}var Fl,Nd;function qA(){if(Nd)return Fl;Nd=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return Fl=t,Fl}var $l,qd;function IA(){if(qd)return $l;qd=1;function e(t,n){return function(r){return t(n(r))}}return $l=e,$l}var Ll,Id;function zA(){if(Id)return Ll;Id=1;var e=IA(),t=e(Object.keys,Object);return Ll=t,Ll}var Nl,zd;function BA(){if(zd)return Nl;zd=1;var e=qA(),t=zA(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var s=[];for(var o in Object(a))r.call(a,o)&&o!="constructor"&&s.push(o);return s}return Nl=i,Nl}var ql,Bd;function gs(){if(Bd)return ql;Bd=1;var e=vy(),t=kf();function n(r){return r!=null&&t(r.length)&&!e(r)}return ql=n,ql}var Il,Ud;function ms(){if(Ud)return Il;Ud=1;var e=NA(),t=BA(),n=gs();function r(i){return n(i)?e(i):t(i)}return Il=r,Il}var zl,Hd;function UA(){if(Hd)return zl;Hd=1;var e=RA(),t=OA(),n=ms();function r(i){return e(i,n,t)}return zl=r,zl}var Bl,jd;function HA(){if(jd)return Bl;jd=1;var e=UA(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,s,o,l,u,c){var f=o&t,h=e(a),p=h.length,g=e(s),d=g.length;if(p!=d&&!f)return!1;for(var m=p;m--;){var x=h[m];if(!(f?x in s:r.call(s,x)))return!1}var y=c.get(a),v=c.get(s);if(y&&v)return y==s&&v==a;var _=!0;c.set(a,s),c.set(s,a);for(var S=f;++m<p;){x=h[m];var w=a[x],b=s[x];if(l)var M=f?l(b,w,x,s,a,c):l(w,b,x,a,s,c);if(!(M===void 0?w===b||u(w,b,o,l,c):M)){_=!1;break}S||(S=x=="constructor")}if(_&&!S){var A=a.constructor,k=s.constructor;A!=k&&"constructor"in a&&"constructor"in s&&!(typeof A=="function"&&A instanceof A&&typeof k=="function"&&k instanceof k)&&(_=!1)}return c.delete(a),c.delete(s),_}return Bl=i,Bl}var Ul,Gd;function jA(){if(Gd)return Ul;Gd=1;var e=Or(),t=Cn(),n=e(t,"DataView");return Ul=n,Ul}var Hl,Yd;function GA(){if(Yd)return Hl;Yd=1;var e=Or(),t=Cn(),n=e(t,"Promise");return Hl=n,Hl}var jl,Wd;function YA(){if(Wd)return jl;Wd=1;var e=Or(),t=Cn(),n=e(t,"Set");return jl=n,jl}var Gl,Xd;function WA(){if(Xd)return Gl;Xd=1;var e=Or(),t=Cn(),n=e(t,"WeakMap");return Gl=n,Gl}var Yl,Kd;function XA(){if(Kd)return Yl;Kd=1;var e=jA(),t=Sf(),n=GA(),r=YA(),i=WA(),a=la(),s=by(),o="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),g=s(t),d=s(n),m=s(r),x=s(i),y=a;return(e&&y(new e(new ArrayBuffer(1)))!=h||t&&y(new t)!=o||n&&y(n.resolve())!=u||r&&y(new r)!=c||i&&y(new i)!=f)&&(y=function(v){var _=a(v),S=_==l?v.constructor:void 0,w=S?s(S):"";if(w)switch(w){case p:return h;case g:return o;case d:return u;case m:return c;case x:return f}return _}),Yl=y,Yl}var Wl,Vd;function KA(){if(Vd)return Wl;Vd=1;var e=Sy(),t=Ty(),n=CA(),r=HA(),i=XA(),a=dn(),s=My(),o=ky(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function g(d,m,x,y,v,_){var S=a(d),w=a(m),b=S?c:i(d),M=w?c:i(m);b=b==u?f:b,M=M==u?f:M;var A=b==f,k=M==f,C=b==M;if(C&&s(d)){if(!s(m))return!1;S=!0,A=!1}if(C&&!A)return _||(_=new e),S||o(d)?t(d,m,x,y,v,_):n(d,m,b,x,y,v,_);if(!(x&l)){var O=A&&p.call(d,"__wrapped__"),P=k&&p.call(m,"__wrapped__");if(O||P){var F=O?d.value():d,B=P?m.value():m;return _||(_=new e),v(F,B,x,y,_)}}return C?(_||(_=new e),r(d,m,x,y,v,_)):!1}return Wl=g,Wl}var Xl,Zd;function Cy(){if(Zd)return Xl;Zd=1;var e=KA(),t=ua();function n(r,i,a,s,o){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,s,n,o)}return Xl=n,Xl}var Kl,Qd;function VA(){if(Qd)return Kl;Qd=1;var e=Sy(),t=Cy(),n=1,r=2;function i(a,s,o,l){var u=o.length,c=u,f=!l;if(a==null)return!c;for(a=Object(a);u--;){var h=o[u];if(f&&h[2]?h[1]!==a[h[0]]:!(h[0]in a))return!1}for(;++u<c;){h=o[u];var p=h[0],g=a[p],d=h[1];if(f&&h[2]){if(g===void 0&&!(p in a))return!1}else{var m=new e;if(l)var x=l(g,d,p,a,s,m);if(!(x===void 0?t(d,g,n|r,l,m):x))return!1}}return!0}return Kl=i,Kl}var Vl,Jd;function Ry(){if(Jd)return Vl;Jd=1;var e=sa();function t(n){return n===n&&!e(n)}return Vl=t,Vl}var Zl,tg;function ZA(){if(tg)return Zl;tg=1;var e=Ry(),t=ms();function n(r){for(var i=t(r),a=i.length;a--;){var s=i[a],o=r[s];i[a]=[s,o,e(o)]}return i}return Zl=n,Zl}var Ql,eg;function Ey(){if(eg)return Ql;eg=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Ql=e,Ql}var Jl,ng;function QA(){if(ng)return Jl;ng=1;var e=VA(),t=ZA(),n=Ey();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(s){return s===i||e(s,i,a)}}return Jl=r,Jl}var tu,rg;function JA(){if(rg)return tu;rg=1;var e=Mf();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return tu=t,tu}var eu,ig;function tk(){if(ig)return eu;ig=1;function e(t,n){return t!=null&&n in Object(t)}return eu=e,eu}var nu,ag;function ek(){if(ag)return nu;ag=1;var e=wy(),t=vf(),n=dn(),r=Af(),i=kf(),a=ds();function s(o,l,u){l=e(l,o);for(var c=-1,f=l.length,h=!1;++c<f;){var p=a(l[c]);if(!(h=o!=null&&u(o,p)))break;o=o[p]}return h||++c!=f?h:(f=o==null?0:o.length,!!f&&i(f)&&r(p,f)&&(n(o)||t(o)))}return nu=s,nu}var ru,sg;function nk(){if(sg)return ru;sg=1;var e=tk(),t=ek();function n(r,i){return r!=null&&t(r,i,e)}return ru=n,ru}var iu,og;function rk(){if(og)return iu;og=1;var e=Cy(),t=JA(),n=nk(),r=bf(),i=Ry(),a=Ey(),s=ds(),o=1,l=2;function u(c,f){return r(c)&&i(f)?a(s(c),f):function(h){var p=t(h,c);return p===void 0&&p===f?n(h,c):e(f,p,o|l)}}return iu=u,iu}var au,lg;function ys(){if(lg)return au;lg=1;function e(t){return t}return au=e,au}var su,ug;function ik(){if(ug)return su;ug=1;function e(t){return function(n){return n==null?void 0:n[t]}}return su=e,su}var ou,cg;function ak(){if(cg)return ou;cg=1;var e=Mf();function t(n){return function(r){return e(r,n)}}return ou=t,ou}var lu,fg;function sk(){if(fg)return lu;fg=1;var e=ik(),t=ak(),n=bf(),r=ds();function i(a){return n(a)?e(r(a)):t(a)}return lu=i,lu}var uu,hg;function Dy(){if(hg)return uu;hg=1;var e=QA(),t=rk(),n=ys(),r=dn(),i=sk();function a(s){return typeof s=="function"?s:s==null?n:typeof s=="object"?r(s)?t(s[0],s[1]):e(s):i(s)}return uu=a,uu}var cu,pg;function ok(){if(pg)return cu;pg=1;function e(t){return function(n,r,i){for(var a=-1,s=Object(n),o=i(n),l=o.length;l--;){var u=o[t?l:++a];if(r(s[u],u,s)===!1)break}return n}}return cu=e,cu}var fu,dg;function lk(){if(dg)return fu;dg=1;var e=ok(),t=e();return fu=t,fu}var hu,gg;function uk(){if(gg)return hu;gg=1;var e=lk(),t=ms();function n(r,i){return r&&e(r,i,t)}return hu=n,hu}var pu,mg;function ck(){if(mg)return pu;mg=1;var e=gs();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var s=i.length,o=r?s:-1,l=Object(i);(r?o--:++o<s)&&a(l[o],o,l)!==!1;);return i}}return pu=t,pu}var du,yg;function fk(){if(yg)return du;yg=1;var e=uk(),t=ck(),n=t(e);return du=n,du}var gu,_g;function Oy(){if(_g)return gu;_g=1;var e=fk(),t=gs();function n(r,i){var a=-1,s=t(r)?Array(r.length):[];return e(r,function(o,l,u){s[++a]=i(o,l,u)}),s}return gu=n,gu}var mu,xg;function hk(){if(xg)return mu;xg=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return mu=e,mu}var yu,vg;function pk(){if(vg)return yu;vg=1;var e=ca();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,s=n===n,o=e(n),l=r!==void 0,u=r===null,c=r===r,f=e(r);if(!u&&!f&&!o&&n>r||o&&l&&c&&!u&&!f||a&&l&&c||!i&&c||!s)return 1;if(!a&&!o&&!f&&n<r||f&&i&&s&&!a&&!o||u&&i&&s||!l&&s||!c)return-1}return 0}return yu=t,yu}var _u,bg;function dk(){if(bg)return _u;bg=1;var e=pk();function t(n,r,i){for(var a=-1,s=n.criteria,o=r.criteria,l=s.length,u=i.length;++a<l;){var c=e(s[a],o[a]);if(c){if(a>=u)return c;var f=i[a];return c*(f=="desc"?-1:1)}}return n.index-r.index}return _u=t,_u}var xu,wg;function gk(){if(wg)return xu;wg=1;var e=us(),t=Mf(),n=Dy(),r=Oy(),i=hk(),a=Ay(),s=dk(),o=ys(),l=dn();function u(c,f,h){f.length?f=e(f,function(d){return l(d)?function(m){return t(m,d.length===1?d[0]:d)}:d}):f=[o];var p=-1;f=e(f,a(n));var g=r(c,function(d,m,x){var y=e(f,function(v){return v(d)});return{criteria:y,index:++p,value:d}});return i(g,function(d,m){return s(d,m,h)})}return xu=u,xu}var vu,Sg;function mk(){if(Sg)return vu;Sg=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return vu=e,vu}var bu,Tg;function yk(){if(Tg)return bu;Tg=1;var e=mk(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var s=arguments,o=-1,l=t(s.length-i,0),u=Array(l);++o<l;)u[o]=s[i+o];o=-1;for(var c=Array(i+1);++o<i;)c[o]=s[o];return c[i]=a(u),e(r,this,c)}}return bu=n,bu}var wu,Mg;function _k(){if(Mg)return wu;Mg=1;function e(t){return function(){return t}}return wu=e,wu}var Su,Ag;function xk(){if(Ag)return Su;Ag=1;var e=Or(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Su=t,Su}var Tu,kg;function vk(){if(kg)return Tu;kg=1;var e=_k(),t=xk(),n=ys(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return Tu=r,Tu}var Mu,Cg;function bk(){if(Cg)return Mu;Cg=1;var e=800,t=16,n=Date.now;function r(i){var a=0,s=0;return function(){var o=n(),l=t-(o-s);if(s=o,l>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Mu=r,Mu}var Au,Rg;function wk(){if(Rg)return Au;Rg=1;var e=vk(),t=bk(),n=t(e);return Au=n,Au}var ku,Eg;function Sk(){if(Eg)return ku;Eg=1;var e=ys(),t=yk(),n=wk();function r(i,a){return n(t(i,a,e),i+"")}return ku=r,ku}var Cu,Dg;function Cf(){if(Dg)return Cu;Dg=1;var e=wf(),t=gs(),n=Af(),r=sa();function i(a,s,o){if(!r(o))return!1;var l=typeof s;return(l=="number"?t(o)&&n(s,o.length):l=="string"&&s in o)?e(o[s],a):!1}return Cu=i,Cu}var Ru,Og;function Tk(){if(Og)return Ru;Og=1;var e=xy(),t=gk(),n=Sk(),r=Cf(),i=n(function(a,s){if(a==null)return[];var o=s.length;return o>1&&r(a,s[0],s[1])?s=[]:o>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return Ru=i,Ru}var Mk=Tk();const Ak=gi(Mk);var Eu,Pg;function kk(){if(Pg)return Eu;Pg=1;function e(t){for(var n=-1,r=t==null?0:t.length,i={};++n<r;){var a=t[n];i[a[0]]=a[1]}return i}return Eu=e,Eu}var Ck=kk();const Fg=gi(Ck);var Du,$g;function Rk(){if($g)return Du;$g=1;var e=Math.ceil,t=Math.max;function n(r,i,a,s){for(var o=-1,l=t(e((i-r)/(a||1)),0),u=Array(l);l--;)u[s?l:++o]=r,r+=a;return u}return Du=n,Du}var Ou,Lg;function Ek(){if(Lg)return Ou;Lg=1;var e=Rk(),t=Cf(),n=gy();function r(i){return function(a,s,o){return o&&typeof o!="number"&&t(a,s,o)&&(s=o=void 0),a=n(a),s===void 0?(s=a,a=0):s=n(s),o=o===void 0?a<s?1:-1:n(o),e(a,s,o,i)}}return Ou=r,Ou}var Pu,Ng;function Dk(){if(Ng)return Pu;Ng=1;var e=Ek(),t=e();return Pu=t,Pu}var Ok=Dk();const Pk=gi(Ok);var Fu,qg;function Fk(){if(qg)return Fu;qg=1;var e=us(),t=Dy(),n=Oy(),r=dn();function i(a,s){var o=r(a)?e:n;return o(a,t(s,3))}return Fu=i,Fu}var $u,Ig;function $k(){if(Ig)return $u;Ig=1;var e=xy(),t=Fk();function n(r,i){return e(t(r,i),1)}return $u=n,$u}var Lk=$k();const Nk=gi(Lk);var Lu,zg;function Py(){if(zg)return Lu;zg=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return Lu=e,Lu}var Nu,Bg;function qk(){if(Bg)return Nu;Bg=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return Nu=e,Nu}var qu,Ug;function Ik(){if(Ug)return qu;Ug=1;var e=Math.floor,t=Math.random;function n(r,i){return r+e(t()*(i-r+1))}return qu=n,qu}var Iu,Hg;function Fy(){if(Hg)return Iu;Hg=1;var e=Ik();function t(n,r){var i=-1,a=n.length,s=a-1;for(r=r===void 0?a:r;++i<r;){var o=e(i,s),l=n[o];n[o]=n[i],n[i]=l}return n.length=r,n}return Iu=t,Iu}var zu,jg;function zk(){if(jg)return zu;jg=1;var e=Py(),t=qk(),n=Fy();function r(i,a){return n(t(i),e(a,0,i.length))}return zu=r,zu}var Bu,Gg;function Bk(){if(Gg)return Bu;Gg=1;var e=us();function t(n,r){return e(r,function(i){return n[i]})}return Bu=t,Bu}var Uu,Yg;function Uk(){if(Yg)return Uu;Yg=1;var e=Bk(),t=ms();function n(r){return r==null?[]:e(r,t(r))}return Uu=n,Uu}var Hu,Wg;function Hk(){if(Wg)return Hu;Wg=1;var e=Py(),t=Fy(),n=Uk();function r(i,a){var s=n(i);return t(s,e(a,0,s.length))}return Hu=r,Hu}var ju,Xg;function jk(){if(Xg)return ju;Xg=1;var e=zk(),t=Hk(),n=dn(),r=Cf(),i=my();function a(s,o,l){(l?r(s,o,l):o===void 0)?o=1:o=i(o);var u=n(s)?e:t;return u(s,o)}return ju=a,ju}var Gk=jk();const Yk=gi(Gk),Wk=e=>UM(e,14),Kg=e=>Object.values(e).reduce((t,n)=>t+n,0),Xk=(e,t,n={})=>{const r=Object.assign({draw:!1},n);if(Object.values(e).length<1)throw new Error("vote distribution must contain at least one party");if(!Object.values(e).every(g=>typeof g=="number"&&g>=0))throw new Error("party vote counts must be non-negative integers");if(!Number.isInteger(t)||t<=0)throw new Error("seats must be a positive integer");if(typeof r.draw!="boolean")throw new Error("opt.draw must be a boolean");const i=Kg(e),a=Fg(Object.entries(e).map(([g,d])=>{const m=Math.max(t-Object.keys(e).length,0),x=Math.round(m*d/i);return[g,x]})),s=Fg(Object.entries(e).map(([g,d])=>{const m=t+Object.keys(e).length,x=Math.min(Math.round(m*d/i),t);return[g,x]})),o=Nk(Object.entries(e).map(([g,d])=>{const m=a[g],x=s[g];return Pk(m,x).map(y=>{const v=Wk(d/(y+.5));return{party:g,quotient:v}})})),l=Kg(a),u=t-l,c=Ak(o,({quotient:g})=>-g),f=c[u-1].quotient,h=c.filter(({quotient:g})=>g>f),p=c.filter(({quotient:g})=>g===f);if(h.length+p.length===u)h.push(...p);else{if(!r.draw)throw new Error("result is ambiguous, a draw would need to be made, but opt.draw is disabled");h.push(...Yk(p,u-h.length))}return h.reduce((g,{party:d})=>(g[d]+=1,g),a)},Ja=e=>Math.round(e*1e10)/1e10,Kk=e=>e.reduce((t,n)=>t+n.seats,0),Vk=e=>e.flat(),Zk=(e,t,n)=>{const r=(Math.PI-n)/2,i=t/e+r-Math.PI;return{x:Ja(e*Math.cos(i)),y:Ja(e*Math.sin(i))}},$y=(e,t,n,r)=>{const i=r*t*n/(e-t),a=1+r*(t-1)*t/2/(e-t);return i/a},Ti=(e,t,n,r)=>{const i=r/Math.PI*.7142857142857143;return Math.abs($y(e,t,n,r)*t/n-i)},Qk=(e,t,n)=>{let r=Math.floor(Math.log(e)/Math.log(2))||1,i=Ti(e,r,t,n),a=0;for(Ti(e,r+1,t,n)<i&&(a=1),Ti(e,r-1,t,n)<i&&r>1&&(a=-1);Ti(e,r+a,t,n)<i&&r>0;)i=Ti(e,r+a,t,n),r+=a;return r},Jk=(e,t)=>{var i,a;let n,r;for(let s=0;s<e.length;s++)r=Ja((t[s]||0)/(((i=e[s])==null?void 0:i.length)??1)),(!n||r<n)&&(n=r);for(let s=0;s<e.length;s++)if(r=Ja((t[s]||0)/(((a=e[s])==null?void 0:a.length)??1)),r===n)return s;return 0},t2=(e,t,n)=>{const r=Kk(e),i=Qk(r,t,n),a=$y(r,i,t,n);let s={};for(let h=1;h<=i;h++)s[h]=t-(h-1)*a;s=Xk(s,r);const o=[];let l,u,c;for(let h=1;h<=i;h++){const p=[];l=t-(h-1)*a,u=n*l/((s[h]??1)-1||1);for(let g=0;g<=(s[h]??1)-1;g++)c={...Zk(l,g*u,n),r:.4*a},p.push(c);o.push(p)}const f=Array(o.length).fill(0);for(const h of e)for(let p=0;p<h.seats;p++){const g=Jk(o,f),d=o[g],m=f[g]??0,x=d==null?void 0:d[m];x&&(x.fill=h.colour,x.party=String(h.id)),f[g]=m+1}return Vk(o)},e2=e=>t=>e("circle",{cx:t.x,cy:t.y,r:t.r,fill:t.fill,class:t.party}),n2={seatCount:!1,arcAngle:180,hFunction:aa},r2=(e,t={})=>{var m;const{seatCount:n,arcAngle:r,hFunction:i}=Object.assign({},n2,t);if(typeof n!="boolean")throw new Error("`seatCount` option must be a boolean");if(typeof i!="function")throw new Error("`hFunction` option must be a function");if(typeof r!="number"||r<=0||r>360)throw new Error("`arcAngle` option must be a number between 0 and 360");const a=r*Math.PI/180,s=20,o=t2(e,s,a),l=(((m=o[0])==null?void 0:m.r)??0)/.4||0,u=o.map(e2(i));n&&u.push(i("text",{x:0,y:0,"text-anchor":"middle",style:{"font-family":"Helvetica","font-size":.25*s+"px"},class:"seatNumber"},String(u.length)));const c=r<=180?s+l:s*(1+Math.sin((a-Math.PI)/2))+l,f=s+l,h=Math.max(c,f),p=r<=180?-s-l/2:-s*(1+Math.sin((a-Math.PI)/2))-l/2,g=i("defs",[ry(i),iy(i),ay(i)]);return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:[-s-l/2,p,2*s+l,h].join(",")},[g,...u])},i2={seatCount:!1,arcAngle:200,arcAngleFlexibility:5,radius:380,seatSize:4.5,minSeatSize:1.8,maxSeatSize:3,spacing:1.8,innerRadiusRatio:.6,showLabels:!0,hFunction:aa},a2=(e,t={})=>{const n={...i2,...t},{arcAngle:r,arcAngleFlexibility:i,radius:a,seatSize:s,minSeatSize:o,maxSeatSize:l,spacing:u,innerRadiusRatio:c,showLabels:f,hFunction:h}=n,p=a*c,g=e.reduce((Z,R)=>Z+R.seats,0);let d={seatSize:s,arcAngle:r,score:-1};const m=r-i,x=r+i;for(let Z=m;Z<=x;Z+=2.5){const R=Z*Math.PI/180;for(let z=l;z>=o;z-=.1){const D=z*2,T=D*u,X=Math.floor((a-p)/T);for(let Q=1;Q<=Math.min(X,10);Q++){let W=0;for(let ut=0;ut<Q;ut++){const H=p+(ut+.5)*T,ot=D*u/H,gt=Math.floor(R/ot);W+=gt}if(W>=g){const ut=g/W,H=(z-o)/(l-o),ot=(W-g)/g,gt=ot<.15?1:ot<.3?.7:ot<.5?.4:.1,yt=1-Math.abs(Z-r)/i,vt=gt*.5+H*.3+ut*.15+yt*.05;vt>d.score&&(d={seatSize:z,arcAngle:Z,rings:Q,score:vt})}}}}const y=d.seatSize,v=d.arcAngle,_=v*Math.PI/180,S=y*2,w=S*u,b=Math.floor((a-p)/w),M=[],A=-_/2-Math.PI/2,k=[];let C=0,O=[];for(let Z=1;Z<=b;Z++){let R=0;const z=[];for(let D=0;D<Z;D++){const T=p+(D+.5)*w,X=S*u/T,Q=Math.floor(_/X);z.push(Q),R+=Q}if(R>=g){C=Z,O=z;break}}if(C>0)k.push(...O);else for(let Z=0;Z<b;Z++){const R=p+(Z+.5)*w,z=S*u/R,D=Math.floor(_/z);k.push(D)}for(let Z=0;Z<k.length;Z++){const R=p+(Z+.5)*w,z=k[Z]??0;if(z>0){const D=_/z;for(let T=0;T<z;T++){const X=A+(T+.5)*D,Q=Math.cos(X)*R,W=Math.sin(X)*R;M.push({ring:Z,index:T,angle:X,x:Q,y:W})}}}M.sort((Z,R)=>{const z=Z.angle-R.angle;return Math.abs(z)>.001?z:Z.ring-R.ring});const P=[];let F=0;e.forEach(Z=>{const R=[],z=Math.min(Z.seats,M.length-F);let D=1/0,T=-1/0;for(let Q=0;Q<z&&F<M.length;Q++){const W=M[F++];W&&(D=Math.min(D,W.angle),T=Math.max(T,W.angle),Math.sqrt(W.x*W.x+W.y*W.y),R.push(h("circle",{fill:Z.colour,stroke:Z.colour,className:"circle seat-visual seat-hover-zone",transform:`translate(${W.x}, ${W.y})`,r:y,"data-party":Z.name,"data-party-id":String(Z.id),style:"pointer-events: all; cursor: pointer;"})))}const X=R;P.push(h("g",{className:"party-group","data-party":Z.name,style:"opacity: 1; outline: none;"},X))});const B=h("g",{className:"arc-bg"},[h("circle",{className:"outer",cx:0,cy:0,fill:"#ffffff",r:a}),h("circle",{className:"inner",cx:0,cy:0,fill:"#ffffff",r:p})]),L=h("g",{className:"points-container"},P),$=f?h("g",{className:"label-container",mask:"url(#label-clip)",style:"pointer-events: none;"},[h("text",{className:"party_count",dy:"-0.05em",style:"font-size: 24vw; font-weight: bold; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"}),h("text",{className:"party_name",y:0,dy:"1em",style:"font-size: 6vw; font-weight: normal; text-anchor: middle; display: none; opacity: 0; fill: rgb(19, 90, 225); transform: scale(1);"})]):null,Y=h("defs",[h("radialGradient",{id:"label-gradient"},[h("stop",{offset:"0%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"80%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 1;"}),h("stop",{offset:"90%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"}),h("stop",{offset:"100%",style:"stop-color: rgb(255, 255, 255); stop-opacity: 0;"})]),h("mask",{id:"label-clip"},[h("circle",{fill:"url(#label-gradient)",r:p})]),ry(h),iy(h),ay(h)]),K=h("g",{className:"arc-container",transform:`translate(${a}, ${a})`},[B,L,$].filter(Boolean)),J=_/2;let st;if(v<=180)st=a*Math.sin(J)+y;else{const Z=J-Math.PI/2;st=a*(1+Math.sin(Z))+y}const lt=a+y,N=a*2,j=Math.max(st,lt);return h("svg",{id:"chart-container","font-family":"Canva Sans Variable",viewBox:`0 0 ${N} ${j}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg"},[K,Y])};function Ly(e){return!e||!e.color?"#cccccc":e.color==="url(#hatchPattern)"?Jr.COMPLETED:e.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:e.color}function Rc(e,t){if(!e)return;const n=e.querySelectorAll(".party-group");n&&n.length>0&&n.forEach(r=>{if(!r)return;const i=r,a=i.getAttribute("data-party");t?a===t?i.style.opacity=Pe.animation.hoverOpacity.active:i.style.opacity=Pe.animation.hoverOpacity.dimmed:i.style.opacity="1"})}function Ec(e,t){e.forEach(n=>{const r=n,i=n.getAttribute("class")||"";t?i===t?(r.setAttribute("fill-opacity","1"),r.setAttribute("stroke-opacity","1")):(r.setAttribute("fill-opacity",Pe.animation.hoverOpacity.dimmed),r.setAttribute("stroke-opacity","0.2")):(r.setAttribute("fill-opacity","1"),r.setAttribute("stroke-opacity","1"))})}const s2=({containerRef:e,processedData:t,totalRepositories:n,arcAngle:r,useEnhanced:i,maxSeats:a,setHoveredData:s,activePartyName:o,setActivePartyName:l,chartConfig:u,seatSize:c,shouldAnimate:f=!1,animationDirection:h="left-to-right",onAnimationComplete:p})=>{G.useEffect(()=>{if(!e.current||t.length===0)return;for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const g=n<=a?1:a/n,d=t.filter(w=>w.value>0).map(w=>{const b=n<=a?w.value:Math.max(1,Math.floor(w.value*g));return{id:String(w.id),name:w.label,seats:b,colour:w.color==="url(#hatchPattern)"?Jr.COMPLETED:w.color}}),m=i?a2(d,{arcAngle:r,arcAngleFlexibility:u.arcAngleFlexibility,radius:u.radius,seatSize:c,minSeatSize:u.minSeatSize,maxSeatSize:u.maxSeatSize,spacing:u.spacing,innerRadiusRatio:u.innerRadiusRatio,showLabels:!0}):r2(d,{arcAngle:r});m.properties&&(m.properties.width="100%",m.properties.height="100%",m.properties.style="display: block; width: 100%; max-width: 100%; height: auto;",m.properties.preserveAspectRatio="xMidYMid meet");const x=EM(m),_=new DOMParser().parseFromString(x,"image/svg+xml").documentElement;if(!_)return;_.setAttribute("width","100%"),_.setAttribute("height","100%"),_.style.width="100%",_.style.height="auto",_.style.display="block",i?o2(_,d,t,s,o,l):l2(_,d,t,s,o,l);const S=()=>{if(s(null),l(null),i)Rc(_,null);else{const w=_.querySelectorAll("circle");Ec(w,null)}};return _&&_.addEventListener("mouseleave",S),e.current.appendChild(_),f&&_&&PM(_,r,u.radius,h,900,p),()=>{if(_&&_.removeEventListener("mouseleave",S),e.current)for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild)}},[t,n,r,i,a,s,o,l,e,u,c,f,h,p])};function o2(e,t,n,r,i,a){if(!e)return;const s=e.querySelectorAll(".seat-hover-zone"),o=e.querySelectorAll(".party-group circle.seat-visual");o&&o.length>0&&o.forEach(l=>{if(l){const u=l;u.style.stroke=Pe.colors.seatBorder,u.style.strokeWidth="0.5",u.setAttribute("fill-opacity","1"),u.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s&&s.length>0&&s.forEach(l=>{if(!l)return;const u=l.getAttribute("data-party"),c=l.getAttribute("data-party-id"),f=()=>{if(u&&u!==i){const h=t.find(p=>p.name===u||String(p.id)===c);if(h){const p=n.find(g=>g.label===h.name||String(g.id)===h.id);if(p){const g=Ly(p);r({label:p.label||"Unknown",value:p.value||0,color:g}),a(h.name),Rc(e,h.name)}}}};l.addEventListener("mouseenter",f)}),i&&Rc(e,i)}function l2(e,t,n,r,i,a){if(!e)return;const s=e.querySelectorAll("circle");if(s&&s.length>0&&(s.forEach(o=>{if(o){const l=o;l.style.cursor="pointer",l.style.stroke=Pe.colors.seatBorder,l.style.strokeWidth="0.5",l.setAttribute("fill-opacity","1"),l.style.transition=`fill-opacity ${Pe.animation.transitionDuration} ease, stroke-opacity ${Pe.animation.transitionDuration} ease`}}),s.forEach(o=>{if(!o)return;const l=o.getAttribute("class")||"",u=parseInt(l,10),c=t[u],f=()=>{if(c){const h=c.name;if(h&&h!==i){const p=n.find(g=>g.label===c.name||String(g.id)===c.id);if(p){const g=Ly(p);r({label:p.label||"Unknown",value:p.value||0,color:g}),a(h),Ec(s,l)}}}};o.addEventListener("mouseenter",f)})),i){const o=t.find(l=>l.name===i);if(o){const l=t.indexOf(o);Ec(s,String(l))}}}const Gu=Li,Vg={[zi]:Jr.NOT_APPLICABLE,[Bi]:Jr.NO_LST,[Ui]:Jr.DATA_MISSING},Mi=(e,t,n)=>{if(e in Vg)return Vg[e];const r=n-1-t,i=Gu.length,a=Math.floor(r/Math.max(1,n-1)*(i-1)),s=Math.min(Math.max(0,a),i-1);return Gu[s]??Gu[0]??"#000000"},Ny=({dataSeries:e,notApplicableRepositories:t,noLstRepositories:n,unavailableRepositories:r})=>{const{special:i,regular:a}=e.reduce((p,g,d)=>([zi,Bi,Ui].includes(g.label)?p.special.push({...g,originalIndex:d}):p.regular.push({...g,originalIndex:d}),p),{special:[],regular:[]}),s=a.reverse().map((p,g)=>({id:`measure-${g}`,label:p.label,value:p.value,color:Mi(p.label,a.length-1-g,a.length)})),o=i.map((p,g)=>({id:p.label.toLowerCase().replace(" ","-"),label:p.label,value:p.value,color:Mi(p.label,g,i.length)})),l=r,u={id:"no-lst",label:Bi,value:n,color:Mi(Bi,0,1)},c={id:"data-missing",label:Ui,value:l,color:Mi(Ui,0,1)},f={id:"n/a",label:zi,value:t,color:Mi(zi,0,1)},h=[];return f.value>0&&h.push(f),u.value>0&&h.push(u),c.value>0&&h.push(c),h.push(...o),h.push(...s),h},Zg={"N/A":"Repos that aren't applicable to this migration.","No LST":"There are no LSTs for these repos.","Data Missing":"There is data missing in the LSTs."},u2=({dataSeries:e,totalRepositories:t,notApplicableRepositories:n,noLstRepositories:r,unavailableRepositories:i,arcAngle:a,useEnhanced:s=Pe.useEnhanced,showTable:o=!0,shouldAnimate:l=!1,animationDirection:u="left-to-right",onAnimationComplete:c})=>{const f=G.useRef(null),[h,p]=G.useState(null),[g,d]=G.useState(null),x=Ny({dataSeries:e,notApplicableRepositories:n,noLstRepositories:r,unavailableRepositories:i}).map(b=>{const M=typeof b.color=="function"?b.color("arc"):b.color,A=typeof b.label=="function"?b.label("arc"):b.label;return{...b,color:M,label:A}}),y=a??df({repositoryCount:t}),v=gf({repositoryCount:t});s2({containerRef:f,processedData:x,totalRepositories:t,arcAngle:y,useEnhanced:s,maxSeats:Pe.maxSeats,setHoveredData:p,activePartyName:g,setActivePartyName:d,chartConfig:Pe.chartConfig,seatSize:v,shouldAnimate:l,animationDirection:u,onAnimationComplete:c});const _=x.map(b=>{const M=b.value/t*100,A=M>0&&M<1?"< 1":M.toFixed(0);return{id:String(b.id),label:b.label,value:b.value,percentage:A,color:b.color}}),S=t>Pe.maxSeats,w=S?Math.round(t/Pe.maxSeats):1;return E.jsxs(q.Stack,{sx:{width:"100%",alignItems:"center",gap:{xs:.5,sm:.75,md:1,lg:1},py:0,"@media (min-width: 1024px) and (max-width: 1225px)":{gap:.25}},children:[E.jsxs(q.Box,{className:"parliament-chart-container",sx:{position:"relative",width:"100%",minHeight:"200px",mb:{xs:.5,sm:.75,md:1},"@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"250px",mb:.25}},children:[E.jsx(q.Box,{className:"parliament-chart-svg-container",ref:f,sx:{width:"100%",height:"100%",position:"relative",display:"flex",justifyContent:"center",alignItems:"center","& svg":{width:"100%",height:"100%",maxWidth:"100%","@media (min-width: 1024px) and (max-width: 1225px)":{maxHeight:"230px"}}}}),E.jsxs(q.Box,{className:"parliament-chart-tooltip",sx:{position:"absolute",bottom:"0%",left:"50%",transform:"translate(-50%, 0%)",pointerEvents:"none",textAlign:"center",zIndex:10,"@media (min-width: 1024px) and (max-width: 1225px)":{bottom:"5%"}},children:[h&&E.jsxs(G.Fragment,{children:[E.jsx(q.Typography,{sx:{color:"text.secondary",mb:.3,fontSize:"clamp(0.75rem, 1.5vw, 0.85rem)",display:"block","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"0.7rem",mb:.2}},children:h.label}),E.jsxs(q.Typography,{sx:{fontWeight:"bold",color:h.color,lineHeight:1,fontSize:"clamp(1.1rem, 2.2vw, 1.3rem)","@media (min-width: 1024px) and (max-width: 1225px)":{fontSize:"1rem"}},children:[h.value," ",h.value>1?"repos":"repo"]})]}),S&&E.jsxs(q.Box,{className:"parliament-chart-scaled-indicator",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5,mt:h?.5:0,color:"text.secondary",fontSize:"clamp(0.65rem, 1.2vw, 0.72rem)"},children:[E.jsx(q.Box,{className:"parliament-chart-scaled-indicator-dot",sx:{width:8,height:8,borderRadius:"50%",backgroundColor:"#888888",flexShrink:0}}),E.jsxs(q.Typography,{variant:"caption",sx:{fontSize:"inherit",fontStyle:"italic"},children:["= ~",w," repos"]})]})]})]}),o&&E.jsx(q.Box,{className:"parliament-chart-data-table",sx:{width:"100%",display:"flex",justifyContent:"center","@media (min-width: 1024px) and (max-width: 1225px)":{overflowX:"auto",maxWidth:"100%"}},onMouseLeave:()=>{p(null),d(null)},children:E.jsxs(q.Table,{"aria-label":"Repository categories summary",className:"parliament-chart-table",size:"small",sx:{maxWidth:{xs:"clamp(360px, 90%, 400px)",sm:"clamp(360px, 90%, 400px)",md:"clamp(360px, 85%, 420px)",lg:"clamp(360px, 90%, 400px)"},"@media (min-width: 1024px) and (max-width: 1225px)":{maxWidth:"360px","& .MuiTableCell-root":{padding:"1px 4px",fontSize:"9.5px"}},"& .MuiTableCell-root":{padding:"2px 8px",borderBottom:"none",fontSize:"clamp(10px, 1.8vw, 11.5px)"}},children:[E.jsx("thead",{children:E.jsxs(q.TableRow,{children:[E.jsx(q.TableCell,{}),E.jsx(q.TableCell,{sx:{fontWeight:"bold"},children:"Category"}),E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"# of repos"}),E.jsx(q.TableCell,{align:"right",sx:{fontWeight:"bold"},children:"% of org"})]})}),E.jsx("tbody",{children:_.map(b=>{const M=b.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:b.color;return E.jsxs(q.TableRow,{onMouseEnter:()=>{d(b.label),p({label:b.label,value:b.value,color:b.color==="url(#greyHatchPattern)"?Dt.greyHatch.lines:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.lines:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.lines:b.color})},sx:{cursor:"pointer",transition:"background-color 0.15s ease",backgroundColor:g===b.label?`${M}15`:"transparent","&:hover":{backgroundColor:`${M}15`}},children:[E.jsx(q.TableCell,{align:"center",sx:{width:20},children:E.jsx(q.Box,{sx:{width:12,height:12,backgroundColor:b.color==="url(#greyHatchPattern)"?Dt.greyHatch.background:b.color==="url(#dataMissingHatchPattern)"?Dt.dataMissingHatch.background:b.color==="url(#noLstHatchPattern)"?Dt.noLstHatch.background:b.color,borderRadius:"50%",position:"relative",overflow:"hidden",transition:"transform 0.15s ease",transform:g===b.label?"scale(1.2)":"scale(1)",...b.label==="N/A"&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`repeating-linear-gradient(
|
|
48
48
|
0deg,
|
|
49
49
|
transparent,
|
|
50
50
|
transparent 3px,
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
transparent 3px,
|
|
63
63
|
${Dt.noLstHatch.lines} 3px,
|
|
64
64
|
${Dt.noLstHatch.lines} 4px
|
|
65
|
-
)`,borderRadius:"50%"}}}})}),P.jsx(L.TableCell,{children:P.jsxs(L.Stack,{direction:"row",alignItems:"center",gap:.5,children:[P.jsx("span",{children:b.label}),Vg[b.label]&&P.jsx(L.Tooltip,{title:Vg[b.label],placement:"right",arrow:!0,children:P.jsx(Zg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),P.jsx(L.TableCell,{align:"right",children:b.value}),P.jsxs(L.TableCell,{align:"right",children:[b.percentage,"%"]})]},b.id)})})]})})]})},lC=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timelineEvents:s=[],showTimeline:o=!0,timelineHeight:l=40,timelineOffset:u=35,timeRange:c,showGrid:f=!0,showAxes:h=!0,axisLabelColor:p,axisLabelSize:g=14,enableBrush:d=!1,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v="#69b3a2",formatDate:_,formatValue:S,markers:w=[],onHoveredDataChange:b,hoveredCategory:M,onTimelineEventHover:A})=>{const[R,C]=Y.useState(null),[O,D]=Y.useState(null),[N,H]=Y.useState([]),q=Y.useRef(`sawt-${Math.random().toString(36).substr(2,9)}`),F=Y.useCallback(j=>{C(j),A==null||A(j)},[A]);return Y.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const j=Ot(e.current),$=r-a.left-a.right,it=i-a.top-a.bottom,et=q.current;j.selectAll("*").remove();const nt=`main-chart-group main-chart-group-${et}`,J=j.append("g").attr("class",nt).attr("transform",`translate(${a.left},${a.top})`),lt=`sawt-clip-${et}`;j.append("defs").append("clipPath").attr("id",lt).append("rect").attr("x",0).attr("y",0).attr("width",$).attr("height",it);const I=J.append("g").attr("clip-path",`url(#${lt})`),at=[...t.map(st=>({timestamp:st.timestamp,...st.values}))].sort((st,_t)=>st.timestamp-_t.timestamp),K=n.map(st=>st.dataKey),k=Gi().keys(K),z=k(at),E=t.map(st=>st.timestamp),T=c?c[0]:Math.min(...E),X=c?c[1]:Math.max(...E),V=Yr().domain([new Date(T),new Date(X)]).range([0,$]),G=at.filter(st=>st.timestamp>=T&&st.timestamp<=X),ut=k(G),U=ut.length>0?Math.max(...ut[ut.length-1].map(st=>st[1]??0)):0,ot=ni().domain([0,U*1.1]).range([it,0]).nice();f&&(I.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(V).ticks(6).tickSize(it).tickFormat(()=>"")),I.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(ot).ticks(5).tickSize(-$).tickFormat(()=>"")));const gt=is().x(st=>V(new Date(st.data.timestamp))).y0(st=>ot(st[0])).y1(st=>ot(st[1])).curve(Ar),yt=I.append("g").attr("class","areas");z.forEach((st,_t)=>{const dt=n[_t];if(!dt)return;const xt=M===dt.dataKey,Et=M!=null;yt.append("path").datum(st).attr("class",`area area-${dt.dataKey}`).attr("fill",dt.color).attr("fill-opacity",Et?xt?.9:.3:.7).attr("stroke",dt.color).attr("stroke-width",xt?2:1.5).attr("d",gt).on("mouseenter",()=>{const At=G[G.length-1],ee=At?At[dt.dataKey]??0:0;b==null||b({label:dt.label,value:ee,color:dt.color})}).on("mouseleave",()=>{b==null||b(null)})});const vt=w.filter(st=>st.timestamp>=T&&st.timestamp<=X).map(st=>({...st,x:V(new Date(st.timestamp))}));H(st=>st.length!==vt.length||st.some((_t,dt)=>{var xt,Et;return _t.timestamp!==((xt=vt[dt])==null?void 0:xt.timestamp)||_t.x!==((Et=vt[dt])==null?void 0:Et.x)})?vt:st);let tt=null;if(vt.length>0&&(tt=I.append("g").attr("class","markers"),vt.forEach(st=>{tt.append("line").attr("class","marker-line").attr("data-timestamp",st.timestamp).attr("x1",st.x).attr("x2",st.x).attr("y1",0).attr("y2",it).attr("stroke",st.color??"#131E7A").attr("stroke-width",2).attr("opacity",0)})),h){const _t=qn(V).ticks(6).tickPadding(12);_&&_t.tickFormat(xt=>_(+xt)),J.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${it})`).call(_t).selectAll("text").attr("font-size",g).attr("fill",p??null);const dt=In(ot).ticks(5);dt.tickFormat(xt=>+xt==0?"":S?S(+xt):String(xt)),J.append("g").attr("class","axis axis-y").call(dt).selectAll("text").attr("font-size",g).attr("fill",p??null)}if(d&&m){const st=hi().extent([[0,0],[$,it]]).on("end",dt=>{if(!dt.selection)return;const[xt,Et]=dt.selection,At=[+V.invert(xt),+V.invert(Et)];x!==void 0&&(At[0]=Math.max(At[0],x)),y!==void 0&&(At[1]=Math.min(At[1],y)),m(At),j.select(".brush").call(st.move,null)}),_t=I.append("g").attr("class","brush").call(st);_t.selectAll(".selection").attr("fill",v).attr("fill-opacity",.2).attr("stroke",v).attr("stroke-width",1),_t.selectAll(".handle").attr("fill",v).attr("fill-opacity",.8)}if(o&&Za({svg:j,events:s,xScale:V,chartHeight:it,chartWidth:$,timelineHeight:l,timelineOffset:u,instanceId:et,setHoveredTimelineEvent:F,enableBrush:d,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v,mainGroupSelector:`.main-chart-group-${et}`}),vt.length>0&&tt){let st=null,_t;d?_t=I.select(".brush .overlay"):_t=J.append("rect").attr("class","marker-hover-overlay").attr("width",$).attr("height",it).attr("fill","none").attr("pointer-events","all");const dt=tt,xt=At=>{let ee=null,ne=1/0;if(vt.forEach(Vt=>{const Zt=Math.abs(At-Vt.x);Zt<ne&&(ne=Zt,ee=Vt)}),!ee||ne>50)return st!==null&&(st=null,dt.selectAll(".marker-line").attr("opacity",0),D(null)),!1;const ge=ee;return st===ge.timestamp||(st=ge.timestamp,dt.selectAll(".marker-line").attr("opacity",0),dt.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(ge.timestamp)}).attr("opacity",.6),D(ge)),!0},Et=function(At){const[ee]=tr(At,this);xt(ee)};_t.on("mouseenter",Et),_t.on("mousemove",Et),_t.on("mouseleave",function(){st=null,dt.selectAll(".marker-line").attr("opacity",0),D(null)})}return()=>{j.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,F]),{hoveredTimelineEvent:R,hoveredMarker:O,visibleMarkers:N}},uC=({data:e,categories:t,timelineEvents:n=[],showTimeline:r=!0,timelineHeight:i=40,timelineOffset:a,width:s=900,height:o=400,margin:l={top:10,right:30,bottom:40,left:60},showGrid:u=!0,showAxes:c=!0,axisLabelColor:f,axisLabelSize:h=14,formatDate:p,formatValue:g,timeRange:d,enableBrush:m=!1,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_="#69b3a2",markers:S=[],onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:M})=>{const A=Y.useRef(null),R=12,O=a??6+R+h+R,D=r?o+i+O:o,{hoveredTimelineEvent:N,hoveredMarker:H,visibleMarkers:q}=lC({containerRef:A,data:e,categories:t,width:s,height:o,margin:l,timelineEvents:n,showTimeline:r,timelineHeight:i,timelineOffset:O,timeRange:d,showGrid:u,showAxes:c,axisLabelColor:f,axisLabelSize:h,enableBrush:m,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_,formatDate:p,formatValue:g,markers:S,onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:M});return P.jsxs(L.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[P.jsx("svg",{ref:A,viewBox:`0 0 ${s} ${D}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),q.map(F=>{const j=(F.x+l.left)/s*100,$=l.top/D*100,it=new Date(F.timestamp),et=p?p(F.timestamp):it.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),nt=P.jsxs(L.Box,{children:[P.jsx(L.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:F.label?.5:0},children:et}),F.label&&P.jsx(L.Box,{sx:{color:"white",fontWeight:500},children:F.label})]});return P.jsx(L.Tooltip,{title:nt,open:(H==null?void 0:H.timestamp)===F.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:P.jsx(L.Box,{sx:{position:"absolute",left:`${j}%`,top:`${$}%`,width:"1px",height:`${(o-l.top-l.bottom)/D*100}%`,pointerEvents:"none"}})},F.timestamp)}),N&&r&&!H&&P.jsx(L.Tooltip,{title:P.jsxs(L.Box,{children:[P.jsx(L.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:p?p(N.timestamp):new Date(N.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),P.jsx(L.Box,{sx:{color:"white",fontWeight:500},children:N.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:P.jsx(L.Box,{sx:{position:"absolute",left:`${(N.x+l.left)/s*100}%`,top:`${(o+O+i/2)/D*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})})]})},bn={colors:{primary:"#992FB9",background:"#FFFFFF",border:"#9CA3AF",highlightBackground:"rgba(31, 41, 55, 0.14)",monthLabel:"#9ca3af",tooltipText:"#6b7280"},dimensions:{height:32,eventWidth:2}},cC=(e="#4B5563")=>({startHandle:{sx:{position:"absolute",left:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}},endHandle:{sx:{position:"absolute",right:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}}}),gn={header:{sx:{}},title:{sx:{m:0}},instructions:{sx:{color:"text.secondary",minHeight:"40px",display:"flex",alignItems:"center"}},monthLabelsContainer:{sx:{justifyContent:"space-between",px:1.25,height:"20px",fontSize:"11px",color:bn.colors.monthLabel,mb:1}},monthLabel:{sx:{fontSize:"11px"}},timeline:{sx:{position:"relative",height:`${bn.dimensions.height}px`,backgroundColor:bn.colors.background,borderRadius:0,overflow:"visible",border:`1px solid ${bn.colors.border}`}},event:{sx:{position:"absolute",top:0,width:`${bn.dimensions.eventWidth}px`,height:"100%",backgroundColor:bn.colors.primary,cursor:"pointer",transition:"transform 0.2s",transformOrigin:"center"}},selection:{sx:{position:"absolute",top:0,height:"100%",backgroundColor:bn.colors.highlightBackground,pointerEvents:"none"}},tooltip:{sx:{position:"absolute",bottom:"-40px",backgroundColor:"white",p:"6px 10px",borderRadius:.5,boxShadow:"0 2px 8px rgba(0,0,0,0.15)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,border:`1px solid ${bn.colors.border}`}},tooltipEventName:{sx:{fontWeight:600}},tooltipDate:{sx:{color:bn.colors.tooltipText,fontSize:"11px"}}},fC=(e="#9CA3AF")=>({startHandle:{sx:{position:"absolute",left:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}},endHandle:{sx:{position:"absolute",right:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}}}),hC=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},pC=({events:e,selectedRange:t,onSelectionChange:n,enableZoom:r,zoomToSelection:i,visibleRange:a,onVisibleRangeChange:s})=>{hC()&&e.length>1&&(e.every((Q,at)=>at===0||Q.timestamp>=e[at-1].timestamp)||console.warn("TimelineChart: events array should be sorted by timestamp for optimal performance and correct behavior."));const[o,l]=Y.useState(!1),[u,c]=Y.useState(null),[f,h]=Y.useState(null),[p,g]=Y.useState({start:null,end:null}),[d,m]=Y.useState({start:null,end:null}),[x,y]=Y.useState(null),v=Y.useRef(null),_=t??p,S=a??d,w=Y.useMemo(()=>{var I;return e.length>0?((I=e[0])==null?void 0:I.timestamp)??0:0},[e]),b=Y.useMemo(()=>{var I;return e.length>0?((I=e[e.length-1])==null?void 0:I.timestamp)??0:0},[e]),M=Y.useMemo(()=>i&&S.start&&S.end?S.start:w,[i,S,w]),A=Y.useMemo(()=>i&&S.start&&S.end?S.end:b,[i,S,b]),R=Y.useMemo(()=>A-M,[A,M]),C=Y.useMemo(()=>!r&&_.start!==null&&_.end!==null,[r,_]),O=Y.useCallback(I=>R===0?0:(I-M)/R*100,[M,R]),D=Y.useCallback((I,Q)=>{const at=I/Q*100;return M+at/100*R},[M,R]),N=Y.useCallback(I=>{t===void 0&&g(I),n==null||n(I)},[t,n]),H=Y.useCallback(I=>{const Q=I.currentTarget.getBoundingClientRect(),at=I.clientX-Q.left,K=D(at,Q.width);l(!0),c(K),N({start:K,end:K})},[D,N]),q=Y.useCallback(I=>{if(!o||u===null)return;const Q=I.currentTarget.getBoundingClientRect(),at=I.clientX-Q.left,K=D(at,Q.width);if(f==="start"){const k=Math.min(K,_.end-R*.01);N({start:Math.max(k,M),end:_.end})}else if(f==="end"){const k=Math.max(K,_.start+R*.01);N({start:_.start,end:Math.min(k,A)})}else if(f==="body"){const k=K-u,z=_.end-_.start;let E=_.start+k,T=_.end+k;E<M&&(E=M,T=M+z),T>A&&(T=A,E=A-z),N({start:E,end:T}),c(K)}else N({start:Math.min(u,K),end:Math.max(u,K)})},[o,u,f,_,R,M,A,D,N]),F=Y.useCallback(()=>{const I=o;if(l(!1),h(null),I&&i&&_.start&&_.end&&_.start!==_.end){const Q={start:_.start,end:_.end};a===void 0&&m(Q),s==null||s(Q)}},[o,i,_,a,s]);Y.useEffect(()=>{if(!o||u===null||!v.current)return;const I=at=>{const K=v.current;if(!K)return;const k=K.getBoundingClientRect(),z=at.clientX-k.left,E=D(z,k.width);if(f==="start"){const T=Math.min(E,_.end-R*.01);N({start:Math.max(T,M),end:_.end})}else if(f==="end"){const T=Math.max(E,_.start+R*.01);N({start:_.start,end:Math.min(T,A)})}else if(f==="body"){const T=E-u,X=_.end-_.start;let V=_.start+T,G=_.end+T;V<M&&(V=M,G=M+X),G>A&&(G=A,V=A-X),N({start:V,end:G}),c(E)}else N({start:Math.min(u,E),end:Math.max(u,E)})},Q=()=>{F()};return document.addEventListener("mousemove",I),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",Q)}},[o,u,f,_,R,M,A,D,N,F]);const j=Y.useCallback(I=>{I.stopPropagation(),_.start!==null&&(l(!0),c(_.start),h("start"))},[_]),$=Y.useCallback(I=>{I.stopPropagation(),_.end!==null&&(l(!0),c(_.end),h("end"))},[_]),it=Y.useCallback(I=>{I.stopPropagation();const Q=v.current;if(!Q)return;const at=Q.getBoundingClientRect(),K=I.clientX-at.left,k=D(K,at.width);l(!0),c(k),h("body")},[D]),et=Y.useCallback(I=>{if(I.cancelable&&r&&I.preventDefault(),!r||!_.start||!_.end||R===0)return;const Q=(_.start+_.end)/2,at=_.end-_.start,K=I.deltaY>0?1.1:.9,k=Math.max(at*K,R*.01),z=R*1.5,E=Math.min(k,z);let T=Q-E/2,X=Q+E/2;T<M&&(T=M,X=Math.min(M+E,A)),X>A&&(X=A,T=Math.max(A-E,M)),N({start:T,end:X})},[r,_,R,M,A,N]),nt=Y.useCallback(()=>!_.start||!_.end?[]:e.filter(I=>I.timestamp>=_.start&&I.timestamp<=_.end),[e,_]),J=Y.useCallback(()=>{const I={start:w,end:b};a===void 0&&m({start:null,end:null}),s==null||s(I)},[w,b,a,s]),lt=Y.useCallback(()=>{i&&J()},[i,J]);return{isDragging:o,dragStart:u,dragHandleType:f,internalSelectedRange:_,internalVisibleRange:S,hoveredEvent:x,minDate:M,maxDate:A,timeSpan:R,timelineContainerRef:v,getPositionFromTimestamp:O,getTimestampFromPosition:D,handleMouseDown:H,handleMouseMove:q,handleMouseUp:F,handleWheel:et,handleDoubleClick:lt,handleStartHandleMouseDown:j,handleEndHandleMouseDown:$,handleSelectionBodyMouseDown:it,setHoveredEvent:y,getEventsInRange:nt,resetZoom:J,showHandles:C}},dC=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),gC=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),mC=e=>{const t=e/864e5;return t>60?n=>new Date(n).toLocaleDateString("en-US",{month:"short",year:"numeric"}):t>7?n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric"}):n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",hour12:!0})},yC=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},_C=(e,t="arrow",n)=>{const r=t==="grip"?fC(n||"#9CA3AF"):cC(n||"#4B5563");return{header:{...gn.header,...e==null?void 0:e.header},title:{...gn.title,...e==null?void 0:e.title},instructions:{...gn.instructions,...e==null?void 0:e.instructions},monthLabelsContainer:{...gn.monthLabelsContainer,...e==null?void 0:e.monthLabelsContainer},monthLabel:{...gn.monthLabel,...e==null?void 0:e.monthLabel},timeline:{...gn.timeline,...e==null?void 0:e.timeline},event:{...gn.event,...e==null?void 0:e.event},selection:{...gn.selection,...e==null?void 0:e.selection},startHandle:{...r.startHandle,...e==null?void 0:e.startHandle},endHandle:{...r.endHandle,...e==null?void 0:e.endHandle},tooltip:{...gn.tooltip,...e==null?void 0:e.tooltip},tooltipEventName:{...gn.tooltipEventName,...e==null?void 0:e.tooltipEventName},tooltipDate:{...gn.tooltipDate,...e==null?void 0:e.tooltipDate}}},xC=({events:e,onSelectionChange:t,selectedRange:n,height:r=bn.dimensions.height,margin:i={top:0,right:0,bottom:0,left:0},formatDate:a=dC,formatMonthYear:s=gC,showMonthLabels:o=!0,monthLabelCount:l=6,enableZoom:u=!0,dragHandleVariant:c="arrow",dragHandleColor:f,showHeader:h=!0,title:p="Event Timeline Selector",zoomToSelection:g=!1,visibleRange:d,onVisibleRangeChange:m,timeRange:x,onTimeRangeChange:y,slotProps:v})=>{const _=x?{start:x[0],end:x[1]}:d,S=y?I=>{I.start!==null&&I.end!==null&&y([I.start,I.end])}:m;yC()&&e.length>500&&console.warn(`TimelineChart: Rendering ${e.length} events may impact performance. Consider implementing virtualization or canvas rendering for datasets larger than 500 events.`);const w=Y.useMemo(()=>_C(v,c,f),[v,c,f]),{isDragging:b,dragHandleType:M,internalSelectedRange:A,hoveredEvent:R,minDate:C,timeSpan:O,timelineContainerRef:D,getPositionFromTimestamp:N,handleMouseDown:H,handleWheel:q,handleDoubleClick:F,handleStartHandleMouseDown:j,handleEndHandleMouseDown:$,handleSelectionBodyMouseDown:it,setHoveredEvent:et,getEventsInRange:nt,showHandles:J}=pC({events:e,selectedRange:n,onSelectionChange:t,enableZoom:u,zoomToSelection:g,visibleRange:_,onVisibleRangeChange:S}),lt=A.start&&A.end?`Selected: ${a(A.start)} - ${a(A.end)} (${nt().length} events)`:"Click and drag on the timeline below to select a date range. Use mouse wheel to zoom in/out.";return P.jsxs(L.Stack,{sx:{width:"100%"},children:[h&&P.jsxs(L.Stack,{spacing:1,sx:{mb:3},...w.header,children:[P.jsx(L.Typography,{variant:"h5",...w.title,children:p}),P.jsx(L.Typography,{variant:"body2",...w.instructions,children:lt})]}),o&&P.jsx(L.Stack,{direction:"row",...w.monthLabelsContainer,sx:{...w.monthLabelsContainer.sx,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:Array.from({length:l},(I,Q)=>{const at=C+O/(l-1)*Q,K=mC(O);return P.jsx(L.Typography,{variant:"caption",...w.monthLabel,children:K(at)},Q)})}),P.jsxs(L.Box,{...w.timeline,sx:{...w.timeline.sx,height:`${r}px`,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:[P.jsx(L.Box,{sx:{position:"absolute",top:i.top,left:0,right:0,bottom:i.bottom},children:e.map((I,Q)=>{const at=N(I.timestamp);return P.jsx(L.Box,{onMouseEnter:()=>et(I),onMouseLeave:()=>et(null),"aria-label":`Event: ${I.eventName} at ${a(I.timestamp)}`,...w.event,sx:{...w.event.sx,left:`${at}%`,transform:(R==null?void 0:R.timestamp)===I.timestamp?"scaleX(2)":"scaleX(1)"}},`${I.timestamp}-${Q}`)})}),A.start&&A.end&&(!g||b)&&P.jsx(L.Box,{...w.selection,onMouseDown:J&&!b?it:void 0,sx:{...w.selection.sx,left:`${N(A.start)}%`,width:`${N(A.end)-N(A.start)}%`,pointerEvents:J?"all":"none",zIndex:2,cursor:J&&!b?M==="body"?"grabbing":"grab":"default"},children:J&&!(b&&M===null)&&P.jsxs(P.Fragment,{children:[P.jsx(L.Box,{...w.startHandle,onMouseDown:j,sx:{...w.startHandle.sx,cursor:"ew-resize",opacity:b&&M!=="start"?.5:1},"aria-label":"Drag to adjust start of selection"}),P.jsx(L.Box,{...w.endHandle,onMouseDown:$,sx:{...w.endHandle.sx,cursor:"ew-resize",opacity:b&&M!=="end"?.5:1},"aria-label":"Drag to adjust end of selection"})]})}),P.jsx(L.Box,{ref:D,role:"application","aria-label":"Interactive timeline - click and drag to select date range","aria-describedby":h?void 0:"timeline-instructions",tabIndex:0,sx:{position:"absolute",top:0,left:0,right:0,height:"100%",cursor:"crosshair",pointerEvents:"all",zIndex:1},onMouseDown:H,onWheel:q,onDoubleClick:F}),!h&&P.jsx("span",{id:"timeline-instructions",style:{display:"none"},children:lt}),R&&P.jsxs(L.Box,{role:"tooltip","aria-live":"polite",...w.tooltip,sx:{...w.tooltip.sx,left:`${N(R.timestamp)}%`,transform:"translateX(-50%)"},children:[P.jsx(L.Typography,{variant:"body2",...w.tooltipEventName,children:R.eventName}),P.jsx(L.Typography,{variant:"caption",...w.tooltipDate,children:a(R.timestamp)})]})]})]})},vC="#8b5cf6",bC=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),wC=({events:e,title:t="Events in Selected Range",maxHeight:n="200px",formatDate:r=bC,primaryColor:i=vC})=>e.length===0?null:P.jsxs("div",{style:{marginTop:"24px",padding:"20px",backgroundColor:"#f9fafb",borderRadius:"8px",border:"1px solid #e5e7eb"},children:[P.jsxs("h3",{style:{margin:"0 0 12px 0",fontSize:"16px",color:"#374151"},children:[t," (",e.length,")"]}),P.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"8px",maxHeight:n,overflowY:"auto"},children:e.map((a,s)=>P.jsxs("div",{style:{padding:"8px 12px",backgroundColor:"white",borderRadius:"4px",fontSize:"13px",border:"1px solid #e5e7eb"},children:[P.jsx("div",{style:{fontWeight:500,color:i},children:a.eventName}),P.jsx("div",{style:{color:"#6b7280",fontSize:"12px",marginTop:"2px"},children:r(a.timestamp)})]},`${a.timestamp}-${s}`))})]});function SC(e,t){const n=t-1-e,r=Ni.length,i=Math.floor(n/Math.max(1,t-1)*(r-1)),a=Math.min(Math.max(0,i),r-1);return Ni[a]??Ni[0]??"#000000"}function $y(e){return Array.from({length:e},(t,n)=>SC(n,e))}const zr=$y(5),Pn={critical:"#dc3545",high:"#fd7e14",medium:"#ffc107",low:"#17a2b8",complete:pn.neoDigitalGreen[600],inProgress:"#007bff",farthest:zr[0],far:zr[1],close:zr[2],closest:zr[3],completed:zr[4],primary:"#007bff",secondary:"#6c757d",success:pn.neoDigitalGreen[600],danger:"#dc3545",warning:"#ffc107",info:"#17a2b8",light:pn.neoGrey[200],dark:"#343a40"},TC={migration:zr,severity:[Pn.critical,Pn.high,Pn.medium,Pn.low,Pn.info],status:[Pn.danger,Pn.warning,Pn.success],extended:["#e74c3c","#e67e22","#f39c12","#2ecc71","#3498db","#9b59b6","#1abc9c","#95a5a6"],colorblindSafe:["#0173B2","#DE8F05","#029E73","#CC78BC","#CA9161","#FBAFE4","#949494","#ECE133"]},MC={FARTHEST:"Farthest",FAR:"Far",CLOSE:"Close",CLOSEST:"Closest",COMPLETE:"Complete",CRITICAL:"Critical",HIGH:"High",MEDIUM:"Medium",LOW:"Low",INFO:"Info",NOT_APPLICABLE:"N/A",NO_LST:"No LST",DATA_MISSING:"Data Missing"};exports.CAMPAIGN_DATA_MISSING=Bi;exports.CAMPAIGN_NOT_APPLICABLE=Ii;exports.CAMPAIGN_NO_LST=zi;exports.CATEGORY_LABELS=MC;exports.ChronoChart=ay;exports.ChronoPerspectiveChart=ay;exports.D3StackedAreaChart=ST;exports.D3StackedBarChart=MT;exports.DEFAULT_CHART_COLORS=pn;exports.DEFAULT_CHART_CONFIG=Pe;exports.DEFAULT_STACKED_AREA_COLORS=Pn;exports.MEASURE_GRADIENT_COLORS=Ni;exports.MODERNE_VULNERABILITY_COLORS=Qr;exports.MorphChart=j0;exports.ParliamentChart=oC;exports.STACKED_AREA_PALETTES=TC;exports.StackedAreaWithTimeline=uC;exports.TimelineChart=xC;exports.TimelineSelectedEvents=wC;exports.calculateDataSeries=Ny;exports.calculateOptimalArcAngle=pf;exports.calculateOptimalSeatSize=df;exports.generateMeasureGradient=$y;
|
|
65
|
+
)`,borderRadius:"50%"}}}})}),E.jsx(q.TableCell,{children:E.jsxs(q.Stack,{direction:"row",alignItems:"center",gap:.5,children:[E.jsx("span",{children:b.label}),Zg[b.label]&&E.jsx(q.Tooltip,{title:Zg[b.label],placement:"right",arrow:!0,children:E.jsx(Qg.InfoOutlined,{sx:{fontSize:".875rem",color:"text.secondary"}})})]})}),E.jsx(q.TableCell,{align:"right",children:b.value}),E.jsxs(q.TableCell,{align:"right",children:[b.percentage,"%"]})]},b.id)})})]})})]})},c2=({containerRef:e,data:t,categories:n,width:r,height:i,margin:a,timelineEvents:s=[],showTimeline:o=!0,timelineHeight:l=40,timelineOffset:u=35,timeRange:c,showGrid:f=!0,showAxes:h=!0,axisLabelColor:p,axisLabelSize:g=14,enableBrush:d=!1,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v="#69b3a2",formatDate:_,formatValue:S,markers:w=[],onHoveredDataChange:b,hoveredCategory:M,onTimelineEventHover:A})=>{const[k,C]=G.useState(null),[O,P]=G.useState(null),[F,B]=G.useState([]),L=G.useRef(`sawt-${Math.random().toString(36).substr(2,9)}`),$=G.useCallback(Y=>{C(Y),A==null||A(Y)},[A]);return G.useEffect(()=>{if(!e.current||t.length===0||n.length===0)return;const Y=Ot(e.current),I=r-a.left-a.right,et=i-a.top-a.bottom,K=L.current;Y.selectAll("*").remove();const J=`main-chart-group main-chart-group-${K}`,st=Y.append("g").attr("class",J).attr("transform",`translate(${a.left},${a.top})`),lt=`sawt-clip-${K}`;Y.append("defs").append("clipPath").attr("id",lt).append("rect").attr("x",0).attr("y",0).attr("width",I).attr("height",et);const N=st.append("g").attr("clip-path",`url(#${lt})`),nt=[...t.map(at=>({timestamp:at.timestamp,...at.values}))].sort((at,_t)=>at.timestamp-_t.timestamp),Z=n.map(at=>at.dataKey),R=Yi().keys(Z),z=R(nt),D=t.map(at=>at.timestamp),T=c?c[0]:Math.min(...D),X=c?c[1]:Math.max(...D),Q=Wr().domain([new Date(T),new Date(X)]).range([0,I]),W=nt.filter(at=>at.timestamp>=T&&at.timestamp<=X),ut=R(W),H=ut.length>0?Math.max(...ut[ut.length-1].map(at=>at[1]??0)):0,ot=ri().domain([0,H*1.1]).range([et,0]).nice();f&&(N.append("g").attr("class","grid grid-vertical").attr("opacity",.1).call(qn(Q).ticks(6).tickSize(et).tickFormat(()=>"")),N.append("g").attr("class","grid grid-horizontal").attr("opacity",.1).call(In(ot).ticks(5).tickSize(-I).tickFormat(()=>"")));const gt=as().x(at=>Q(new Date(at.data.timestamp))).y0(at=>ot(at[0])).y1(at=>ot(at[1])).curve(kr),yt=N.append("g").attr("class","areas");z.forEach((at,_t)=>{const dt=n[_t];if(!dt)return;const xt=M===dt.dataKey,Et=M!=null;yt.append("path").datum(at).attr("class",`area area-${dt.dataKey}`).attr("fill",dt.color).attr("fill-opacity",Et?xt?.9:.3:.7).attr("stroke",dt.color).attr("stroke-width",xt?2:1.5).attr("d",gt).on("mouseenter",()=>{const At=W[W.length-1],ee=At?At[dt.dataKey]??0:0;b==null||b({label:dt.label,value:ee,color:dt.color})}).on("mouseleave",()=>{b==null||b(null)})});const vt=w.filter(at=>at.timestamp>=T&&at.timestamp<=X).map(at=>({...at,x:Q(new Date(at.timestamp))}));B(at=>at.length!==vt.length||at.some((_t,dt)=>{var xt,Et;return _t.timestamp!==((xt=vt[dt])==null?void 0:xt.timestamp)||_t.x!==((Et=vt[dt])==null?void 0:Et.x)})?vt:at);let rt=null;if(vt.length>0&&(rt=N.append("g").attr("class","markers"),vt.forEach(at=>{rt.append("line").attr("class","marker-line").attr("data-timestamp",at.timestamp).attr("x1",at.x).attr("x2",at.x).attr("y1",0).attr("y2",et).attr("stroke",at.color??"#131E7A").attr("stroke-width",2).attr("opacity",0)})),h){const _t=qn(Q).ticks(6).tickPadding(12);_&&_t.tickFormat(xt=>_(+xt)),st.append("g").attr("class","axis axis-x").attr("transform",`translate(0,${et})`).call(_t).selectAll("text").attr("font-size",g).attr("fill",p??null);const dt=In(ot).ticks(5);dt.tickFormat(xt=>+xt==0?"":S?S(+xt):String(xt)),st.append("g").attr("class","axis axis-y").call(dt).selectAll("text").attr("font-size",g).attr("fill",p??null)}if(d&&m){const at=pi().extent([[0,0],[I,et]]).on("end",dt=>{if(!dt.selection)return;const[xt,Et]=dt.selection,At=[+Q.invert(xt),+Q.invert(Et)];x!==void 0&&(At[0]=Math.max(At[0],x)),y!==void 0&&(At[1]=Math.min(At[1],y)),m(At),Y.select(".brush").call(at.move,null)}),_t=N.append("g").attr("class","brush").call(at);_t.selectAll(".selection").attr("fill",v).attr("fill-opacity",.2).attr("stroke",v).attr("stroke-width",1),_t.selectAll(".handle").attr("fill",v).attr("fill-opacity",.8),_t.select(".overlay").style("cursor","default")}if(o&&Qa({svg:Y,events:s,xScale:Q,chartHeight:et,chartWidth:I,timelineHeight:l,timelineOffset:u,instanceId:K,setHoveredTimelineEvent:$,enableBrush:d,onTimeRangeChange:m,minAllowedTime:x,maxAllowedTime:y,brushColor:v,mainGroupSelector:`.main-chart-group-${K}`}),vt.length>0&&rt){let at=null,_t;d?_t=N.select(".brush .overlay"):_t=st.append("rect").attr("class","marker-hover-overlay").attr("width",I).attr("height",et).attr("fill","none").attr("pointer-events","all");const dt=rt,xt=At=>{let ee=null,ne=1/0;if(vt.forEach(Vt=>{const Zt=Math.abs(At-Vt.x);Zt<ne&&(ne=Zt,ee=Vt)}),!ee||ne>50)return at!==null&&(at=null,dt.selectAll(".marker-line").attr("opacity",0),P(null)),!1;const ge=ee;return at===ge.timestamp||(at=ge.timestamp,dt.selectAll(".marker-line").attr("opacity",0),dt.selectAll(".marker-line").filter(function(){return Ot(this).attr("data-timestamp")===String(ge.timestamp)}).attr("opacity",.6),P(ge)),!0},Et=function(At){const[ee]=er(At,this);xt(ee)};_t.on("mouseenter",Et),_t.on("mousemove",Et),_t.on("mouseleave",function(){at=null,dt.selectAll(".marker-line").attr("opacity",0),P(null)})}return()=>{Y.selectAll("*").remove()}},[e,t,n,r,i,a,s,o,l,u,c,f,h,p,g,d,m,x,y,v,_,S,w,b,M,$]),{hoveredTimelineEvent:k,hoveredMarker:O,visibleMarkers:F}},f2=({data:e,categories:t,timelineEvents:n=[],showTimeline:r=!0,timelineHeight:i=40,timelineOffset:a,width:s=900,height:o=400,margin:l={top:10,right:30,bottom:40,left:60},showGrid:u=!0,showAxes:c=!0,axisLabelColor:f,axisLabelSize:h=14,formatDate:p,formatValue:g,timeRange:d,enableBrush:m=!1,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_="#69b3a2",markers:S=[],onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:M})=>{const A=G.useRef(null),k=12,O=a??6+k+h+k,P=r?o+i+O:o,{hoveredTimelineEvent:F,hoveredMarker:B,visibleMarkers:L}=c2({containerRef:A,data:e,categories:t,width:s,height:o,margin:l,timelineEvents:n,showTimeline:r,timelineHeight:i,timelineOffset:O,timeRange:d,showGrid:u,showAxes:c,axisLabelColor:f,axisLabelSize:h,enableBrush:m,onTimeRangeChange:x,minAllowedTime:y,maxAllowedTime:v,brushColor:_,formatDate:p,formatValue:g,markers:S,onHoveredDataChange:w,hoveredCategory:b,onTimelineEventHover:M});return E.jsxs(q.Box,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[E.jsx("svg",{ref:A,viewBox:`0 0 ${s} ${P}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",display:"block"}}),L.map($=>{const Y=($.x+l.left)/s*100,I=l.top/P*100,et=new Date($.timestamp),K=p?p($.timestamp):et.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),J=E.jsxs(q.Box,{children:[E.jsx(q.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:$.label?.5:0},children:K}),$.label&&E.jsx(q.Box,{sx:{color:"white",fontWeight:500},children:$.label})]});return E.jsx(q.Tooltip,{title:J,open:(B==null?void 0:B.timestamp)===$.timestamp,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:E.jsx(q.Box,{sx:{position:"absolute",left:`${Y}%`,top:`${I}%`,width:"1px",height:`${(o-l.top-l.bottom)/P*100}%`,pointerEvents:"none"}})},$.timestamp)}),F&&r&&!B&&E.jsx(q.Tooltip,{title:E.jsxs(q.Box,{children:[E.jsx(q.Box,{sx:{color:"#B6BFFF",fontFamily:"monospace",fontSize:"0.8125rem",mb:.5},children:p?p(F.timestamp):new Date(F.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),E.jsx(q.Box,{sx:{color:"white",fontWeight:500},children:F.eventName})]}),open:!0,placement:"top",arrow:!0,slotProps:{tooltip:{sx:{bgcolor:"#131E7A",fontSize:"0.875rem",px:2,py:1,borderRadius:1,boxShadow:"0px 2px 8px rgba(0,0,0,0.15)","& .MuiTooltip-arrow":{color:"#131E7A"}}},popper:{sx:{pointerEvents:"none"}}},children:E.jsx(q.Box,{sx:{position:"absolute",left:`${(F.x+l.left)/s*100}%`,top:`${(o+O+i/2)/P*100}%`,width:"1px",height:"1px",pointerEvents:"none"}})})]})},bn={colors:{primary:"#992FB9",background:"#FFFFFF",border:"#9CA3AF",highlightBackground:"rgba(31, 41, 55, 0.14)",monthLabel:"#9ca3af",tooltipText:"#6b7280"},dimensions:{height:32,eventWidth:2}},h2=(e="#4B5563")=>({startHandle:{sx:{position:"absolute",left:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}},endHandle:{sx:{position:"absolute",right:"-6px",top:"-10px",width:"14px",height:"calc(100% + 10px)",zIndex:3,display:"flex",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${e}`,transition:"border-top-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"8px",left:"50%",transform:"translateX(-50%)",width:"2px",height:"calc(100% - 8px)",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&:hover::before":{borderTopColor:e},"&:hover::after":{backgroundColor:e},"&:active::before":{borderTopColor:e},"&:active::after":{backgroundColor:e}}}}),gn={header:{sx:{}},title:{sx:{m:0}},instructions:{sx:{color:"text.secondary",minHeight:"40px",display:"flex",alignItems:"center"}},monthLabelsContainer:{sx:{justifyContent:"space-between",px:1.25,height:"20px",fontSize:"11px",color:bn.colors.monthLabel,mb:1}},monthLabel:{sx:{fontSize:"11px"}},timeline:{sx:{position:"relative",height:`${bn.dimensions.height}px`,backgroundColor:bn.colors.background,borderRadius:0,overflow:"visible",border:`1px solid ${bn.colors.border}`}},event:{sx:{position:"absolute",top:0,width:`${bn.dimensions.eventWidth}px`,height:"100%",backgroundColor:bn.colors.primary,cursor:"pointer",transition:"transform 0.2s",transformOrigin:"center"}},selection:{sx:{position:"absolute",top:0,height:"100%",backgroundColor:bn.colors.highlightBackground,pointerEvents:"none"}},tooltip:{sx:{position:"absolute",bottom:"-40px",backgroundColor:"white",p:"6px 10px",borderRadius:.5,boxShadow:"0 2px 8px rgba(0,0,0,0.15)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,border:`1px solid ${bn.colors.border}`}},tooltipEventName:{sx:{fontWeight:600}},tooltipDate:{sx:{color:bn.colors.tooltipText,fontSize:"11px"}}},p2=(e="#9CA3AF")=>({startHandle:{sx:{position:"absolute",left:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}},endHandle:{sx:{position:"absolute",right:"-8px",top:0,width:"20px",height:"100%",zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s","&::before":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"1px",height:"100%",backgroundColor:e,transition:"background-color 0.2s",pointerEvents:"none"},"&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"9px",height:"16px",backgroundColor:"#F9FAFB",border:`1px solid ${e}`,transition:"border-color 0.2s, background-color 0.2s",pointerEvents:"none",backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`,backgroundPosition:"35% center, 65% center",backgroundSize:"1px 50%, 1px 50%",backgroundRepeat:"no-repeat"},"&:hover::before":{backgroundColor:e},"&:hover::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`},"&:active::before":{backgroundColor:e},"&:active::after":{borderColor:e,backgroundImage:`linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%), linear-gradient(to bottom, transparent 0%, transparent 25%, ${e} 25%, ${e} 75%, transparent 75%)`}}}}),d2=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},g2=({events:e,selectedRange:t,onSelectionChange:n,enableZoom:r,zoomToSelection:i,visibleRange:a,onVisibleRangeChange:s})=>{d2()&&e.length>1&&(e.every((j,nt)=>nt===0||j.timestamp>=e[nt-1].timestamp)||console.warn("TimelineChart: events array should be sorted by timestamp for optimal performance and correct behavior."));const[o,l]=G.useState(!1),[u,c]=G.useState(null),[f,h]=G.useState(null),[p,g]=G.useState({start:null,end:null}),[d,m]=G.useState({start:null,end:null}),[x,y]=G.useState(null),v=G.useRef(null),_=t??p,S=a??d,w=G.useMemo(()=>{var N;return e.length>0?((N=e[0])==null?void 0:N.timestamp)??0:0},[e]),b=G.useMemo(()=>{var N;return e.length>0?((N=e[e.length-1])==null?void 0:N.timestamp)??0:0},[e]),M=G.useMemo(()=>i&&S.start&&S.end?S.start:w,[i,S,w]),A=G.useMemo(()=>i&&S.start&&S.end?S.end:b,[i,S,b]),k=G.useMemo(()=>A-M,[A,M]),C=G.useMemo(()=>!r&&_.start!==null&&_.end!==null,[r,_]),O=G.useCallback(N=>k===0?0:(N-M)/k*100,[M,k]),P=G.useCallback((N,j)=>{const nt=N/j*100;return M+nt/100*k},[M,k]),F=G.useCallback(N=>{t===void 0&&g(N),n==null||n(N)},[t,n]),B=G.useCallback(N=>{const j=N.currentTarget.getBoundingClientRect(),nt=N.clientX-j.left,Z=P(nt,j.width);l(!0),c(Z),F({start:Z,end:Z})},[P,F]),L=G.useCallback(N=>{if(!o||u===null)return;const j=N.currentTarget.getBoundingClientRect(),nt=N.clientX-j.left,Z=P(nt,j.width);if(f==="start"){const R=Math.min(Z,_.end-k*.01);F({start:Math.max(R,M),end:_.end})}else if(f==="end"){const R=Math.max(Z,_.start+k*.01);F({start:_.start,end:Math.min(R,A)})}else if(f==="body"){const R=Z-u,z=_.end-_.start;let D=_.start+R,T=_.end+R;D<M&&(D=M,T=M+z),T>A&&(T=A,D=A-z),F({start:D,end:T}),c(Z)}else F({start:Math.min(u,Z),end:Math.max(u,Z)})},[o,u,f,_,k,M,A,P,F]),$=G.useCallback(()=>{const N=o;if(l(!1),h(null),N&&i&&_.start&&_.end&&_.start!==_.end){const j={start:_.start,end:_.end};a===void 0&&m(j),s==null||s(j)}},[o,i,_,a,s]);G.useEffect(()=>{if(!o||u===null||!v.current)return;const N=nt=>{const Z=v.current;if(!Z)return;const R=Z.getBoundingClientRect(),z=nt.clientX-R.left,D=P(z,R.width);if(f==="start"){const T=Math.min(D,_.end-k*.01);F({start:Math.max(T,M),end:_.end})}else if(f==="end"){const T=Math.max(D,_.start+k*.01);F({start:_.start,end:Math.min(T,A)})}else if(f==="body"){const T=D-u,X=_.end-_.start;let Q=_.start+T,W=_.end+T;Q<M&&(Q=M,W=M+X),W>A&&(W=A,Q=A-X),F({start:Q,end:W}),c(D)}else F({start:Math.min(u,D),end:Math.max(u,D)})},j=()=>{$()};return document.addEventListener("mousemove",N),document.addEventListener("mouseup",j),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",j)}},[o,u,f,_,k,M,A,P,F,$]);const Y=G.useCallback(N=>{N.stopPropagation(),_.start!==null&&(l(!0),c(_.start),h("start"))},[_]),I=G.useCallback(N=>{N.stopPropagation(),_.end!==null&&(l(!0),c(_.end),h("end"))},[_]),et=G.useCallback(N=>{N.stopPropagation();const j=v.current;if(!j)return;const nt=j.getBoundingClientRect(),Z=N.clientX-nt.left,R=P(Z,nt.width);l(!0),c(R),h("body")},[P]),K=G.useCallback(N=>{if(N.cancelable&&r&&N.preventDefault(),!r||!_.start||!_.end||k===0)return;const j=(_.start+_.end)/2,nt=_.end-_.start,Z=N.deltaY>0?1.1:.9,R=Math.max(nt*Z,k*.01),z=k*1.5,D=Math.min(R,z);let T=j-D/2,X=j+D/2;T<M&&(T=M,X=Math.min(M+D,A)),X>A&&(X=A,T=Math.max(A-D,M)),F({start:T,end:X})},[r,_,k,M,A,F]),J=G.useCallback(()=>!_.start||!_.end?[]:e.filter(N=>N.timestamp>=_.start&&N.timestamp<=_.end),[e,_]),st=G.useCallback(()=>{const N={start:w,end:b};a===void 0&&m({start:null,end:null}),s==null||s(N)},[w,b,a,s]),lt=G.useCallback(()=>{i&&st()},[i,st]);return{isDragging:o,dragStart:u,dragHandleType:f,internalSelectedRange:_,internalVisibleRange:S,hoveredEvent:x,minDate:M,maxDate:A,timeSpan:k,timelineContainerRef:v,getPositionFromTimestamp:O,getTimestampFromPosition:P,handleMouseDown:B,handleMouseMove:L,handleMouseUp:$,handleWheel:K,handleDoubleClick:lt,handleStartHandleMouseDown:Y,handleEndHandleMouseDown:I,handleSelectionBodyMouseDown:et,setHoveredEvent:y,getEventsInRange:J,resetZoom:st,showHandles:C}},m2=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),y2=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),_2=e=>{const t=e/864e5;return t>60?n=>new Date(n).toLocaleDateString("en-US",{month:"short",year:"numeric"}):t>7?n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric"}):n=>new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",hour12:!0})},x2=()=>{var e,t;try{return((t=(e=globalThis.process)==null?void 0:e.env)==null?void 0:t.NODE_ENV)==="development"}catch{return!1}},v2=(e,t="arrow",n)=>{const r=t==="grip"?p2(n||"#9CA3AF"):h2(n||"#4B5563");return{header:{...gn.header,...e==null?void 0:e.header},title:{...gn.title,...e==null?void 0:e.title},instructions:{...gn.instructions,...e==null?void 0:e.instructions},monthLabelsContainer:{...gn.monthLabelsContainer,...e==null?void 0:e.monthLabelsContainer},monthLabel:{...gn.monthLabel,...e==null?void 0:e.monthLabel},timeline:{...gn.timeline,...e==null?void 0:e.timeline},event:{...gn.event,...e==null?void 0:e.event},selection:{...gn.selection,...e==null?void 0:e.selection},startHandle:{...r.startHandle,...e==null?void 0:e.startHandle},endHandle:{...r.endHandle,...e==null?void 0:e.endHandle},tooltip:{...gn.tooltip,...e==null?void 0:e.tooltip},tooltipEventName:{...gn.tooltipEventName,...e==null?void 0:e.tooltipEventName},tooltipDate:{...gn.tooltipDate,...e==null?void 0:e.tooltipDate}}},b2=({events:e,onSelectionChange:t,selectedRange:n,height:r=bn.dimensions.height,margin:i={top:0,right:0,bottom:0,left:0},formatDate:a=m2,formatMonthYear:s=y2,showMonthLabels:o=!0,monthLabelCount:l=6,enableZoom:u=!0,dragHandleVariant:c="arrow",dragHandleColor:f,showHeader:h=!0,title:p="Event Timeline Selector",zoomToSelection:g=!1,visibleRange:d,onVisibleRangeChange:m,timeRange:x,onTimeRangeChange:y,slotProps:v})=>{const _=x?{start:x[0],end:x[1]}:d,S=y?N=>{N.start!==null&&N.end!==null&&y([N.start,N.end])}:m;x2()&&e.length>500&&console.warn(`TimelineChart: Rendering ${e.length} events may impact performance. Consider implementing virtualization or canvas rendering for datasets larger than 500 events.`);const w=G.useMemo(()=>v2(v,c,f),[v,c,f]),{isDragging:b,dragHandleType:M,internalSelectedRange:A,hoveredEvent:k,minDate:C,timeSpan:O,timelineContainerRef:P,getPositionFromTimestamp:F,handleMouseDown:B,handleWheel:L,handleDoubleClick:$,handleStartHandleMouseDown:Y,handleEndHandleMouseDown:I,handleSelectionBodyMouseDown:et,setHoveredEvent:K,getEventsInRange:J,showHandles:st}=g2({events:e,selectedRange:n,onSelectionChange:t,enableZoom:u,zoomToSelection:g,visibleRange:_,onVisibleRangeChange:S}),lt=A.start&&A.end?`Selected: ${a(A.start)} - ${a(A.end)} (${J().length} events)`:"Click and drag on the timeline below to select a date range. Use mouse wheel to zoom in/out.";return E.jsxs(q.Stack,{sx:{width:"100%"},children:[h&&E.jsxs(q.Stack,{spacing:1,sx:{mb:3},...w.header,children:[E.jsx(q.Typography,{variant:"h5",...w.title,children:p}),E.jsx(q.Typography,{variant:"body2",...w.instructions,children:lt})]}),o&&E.jsx(q.Stack,{direction:"row",...w.monthLabelsContainer,sx:{...w.monthLabelsContainer.sx,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:Array.from({length:l},(N,j)=>{const nt=C+O/(l-1)*j,Z=_2(O);return E.jsx(q.Typography,{variant:"caption",...w.monthLabel,children:Z(nt)},j)})}),E.jsxs(q.Box,{...w.timeline,sx:{...w.timeline.sx,height:`${r}px`,paddingLeft:`${i.left}px`,paddingRight:`${i.right}px`},children:[E.jsx(q.Box,{sx:{position:"absolute",top:i.top,left:0,right:0,bottom:i.bottom},children:e.map((N,j)=>{const nt=F(N.timestamp);return E.jsx(q.Box,{onMouseEnter:()=>K(N),onMouseLeave:()=>K(null),"aria-label":`Event: ${N.eventName} at ${a(N.timestamp)}`,...w.event,sx:{...w.event.sx,left:`${nt}%`,transform:(k==null?void 0:k.timestamp)===N.timestamp?"scaleX(2)":"scaleX(1)"}},`${N.timestamp}-${j}`)})}),A.start&&A.end&&(!g||b)&&E.jsx(q.Box,{...w.selection,onMouseDown:st&&!b?et:void 0,sx:{...w.selection.sx,left:`${F(A.start)}%`,width:`${F(A.end)-F(A.start)}%`,pointerEvents:st?"all":"none",zIndex:2,cursor:st&&!b?M==="body"?"grabbing":"grab":"default"},children:st&&!(b&&M===null)&&E.jsxs(E.Fragment,{children:[E.jsx(q.Box,{...w.startHandle,onMouseDown:Y,sx:{...w.startHandle.sx,cursor:"ew-resize",opacity:b&&M!=="start"?.5:1},"aria-label":"Drag to adjust start of selection"}),E.jsx(q.Box,{...w.endHandle,onMouseDown:I,sx:{...w.endHandle.sx,cursor:"ew-resize",opacity:b&&M!=="end"?.5:1},"aria-label":"Drag to adjust end of selection"})]})}),E.jsx(q.Box,{ref:P,role:"application","aria-label":"Interactive timeline - click and drag to select date range","aria-describedby":h?void 0:"timeline-instructions",tabIndex:0,sx:{position:"absolute",top:0,left:0,right:0,height:"100%",cursor:"crosshair",pointerEvents:"all",zIndex:1},onMouseDown:B,onWheel:L,onDoubleClick:$}),!h&&E.jsx("span",{id:"timeline-instructions",style:{display:"none"},children:lt}),k&&E.jsxs(q.Box,{role:"tooltip","aria-live":"polite",...w.tooltip,sx:{...w.tooltip.sx,left:`${F(k.timestamp)}%`,transform:"translateX(-50%)"},children:[E.jsx(q.Typography,{variant:"body2",...w.tooltipEventName,children:k.eventName}),E.jsx(q.Typography,{variant:"caption",...w.tooltipDate,children:a(k.timestamp)})]})]})]})},w2="#8b5cf6",S2=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),T2=({events:e,title:t="Events in Selected Range",maxHeight:n="200px",formatDate:r=S2,primaryColor:i=w2})=>e.length===0?null:E.jsxs("div",{style:{marginTop:"24px",padding:"20px",backgroundColor:"#f9fafb",borderRadius:"8px",border:"1px solid #e5e7eb"},children:[E.jsxs("h3",{style:{margin:"0 0 12px 0",fontSize:"16px",color:"#374151"},children:[t," (",e.length,")"]}),E.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"8px",maxHeight:n,overflowY:"auto"},children:e.map((a,s)=>E.jsxs("div",{style:{padding:"8px 12px",backgroundColor:"white",borderRadius:"4px",fontSize:"13px",border:"1px solid #e5e7eb"},children:[E.jsx("div",{style:{fontWeight:500,color:i},children:a.eventName}),E.jsx("div",{style:{color:"#6b7280",fontSize:"12px",marginTop:"2px"},children:r(a.timestamp)})]},`${a.timestamp}-${s}`))})]});function M2(e,t){const n=t-1-e,r=Li.length,i=Math.floor(n/Math.max(1,t-1)*(r-1)),a=Math.min(Math.max(0,i),r-1);return Li[a]??Li[0]??"#000000"}function qy(e){return Array.from({length:e},(t,n)=>M2(n,e))}const Br=qy(5),Pn={critical:"#dc3545",high:"#fd7e14",medium:"#ffc107",low:"#17a2b8",complete:pn.neoDigitalGreen[600],inProgress:"#007bff",farthest:Br[0],far:Br[1],close:Br[2],closest:Br[3],completed:Br[4],primary:"#007bff",secondary:"#6c757d",success:pn.neoDigitalGreen[600],danger:"#dc3545",warning:"#ffc107",info:"#17a2b8",light:pn.neoGrey[200],dark:"#343a40"},A2={migration:Br,severity:[Pn.critical,Pn.high,Pn.medium,Pn.low,Pn.info],status:[Pn.danger,Pn.warning,Pn.success],extended:["#e74c3c","#e67e22","#f39c12","#2ecc71","#3498db","#9b59b6","#1abc9c","#95a5a6"],colorblindSafe:["#0173B2","#DE8F05","#029E73","#CC78BC","#CA9161","#FBAFE4","#949494","#ECE133"]},k2={FARTHEST:"Farthest",FAR:"Far",CLOSE:"Close",CLOSEST:"Closest",COMPLETE:"Complete",CRITICAL:"Critical",HIGH:"High",MEDIUM:"Medium",LOW:"Low",INFO:"Info",NOT_APPLICABLE:"N/A",NO_LST:"No LST",DATA_MISSING:"Data Missing"};exports.CAMPAIGN_DATA_MISSING=Ui;exports.CAMPAIGN_NOT_APPLICABLE=zi;exports.CAMPAIGN_NO_LST=Bi;exports.CATEGORY_LABELS=k2;exports.ChronoChart=sy;exports.ChronoPerspectiveChart=sy;exports.D3StackedAreaChart=MT;exports.D3StackedBarChart=kT;exports.DEFAULT_CHART_COLORS=pn;exports.DEFAULT_CHART_CONFIG=Pe;exports.DEFAULT_STACKED_AREA_COLORS=Pn;exports.MEASURE_GRADIENT_COLORS=Li;exports.MODERNE_VULNERABILITY_COLORS=Jr;exports.MorphChart=G0;exports.ParliamentChart=u2;exports.STACKED_AREA_PALETTES=A2;exports.StackedAreaWithTimeline=f2;exports.TimelineChart=b2;exports.TimelineSelectedEvents=T2;exports.calculateDataSeries=Ny;exports.calculateOptimalArcAngle=df;exports.calculateOptimalSeatSize=gf;exports.generateMeasureGradient=qy;
|