app.tradelikecrazy.ai Open in urlscan Pro
2606:4700:3035::ac43:bdbf  Public Scan

Submitted URL: http://app.tradelikecrazy.ai/assets/structure-a19b07e4.js
Effective URL: https://app.tradelikecrazy.ai/assets/structure-a19b07e4.js
Submission: On February 18 via api from US — Scanned from US

Form analysis 0 forms found in the DOM

Text Content

import{a as hr}from"./AppDialog-c38e0908.js";import{_ as sn}from"./AppUserAvatar-78d9de21.js";import{_ as on}from"./index-a02fc8ba.js";import{d as fe,u as he,i as an,l as C,w as ln,g as un,o as I,B as Jt,C as de,b as E,e as lt,t as G,J as Qt,c as z,F as cn,r as fn,a as T,n as hn,m as dn,aE as dr,A as pe,aH as pn,f as Ht,M as pr,aG as gr,K as Ft,aI as _r,h as gn,aJ as _n,ao as _t,ap as mr,aD as vr,j as ke,at as jt,H as yr,aK as Bt,aL as xr}from"./index-d75fc5bc.js";const wr=E("div",{class:"absolute bottom-0 w-full h-50"},null,-1),br={class:"p-6 sm:p-10 relative"},Sr={class:"flex items-start gap-x-10 max-w-full sm:gap-x-14"},Er={class:"overflow-hidden flex-grow mt-1"},Tr={class:"font-semibold text-lg leading-[1] truncate text-white sm:text-[2rem]"},Ar={class:"text-sm text-purple-150 hover:text-purple-100 transition-all sm:text-base font-medium sm:mt-1.5"},kr=["href"],Cr={class:"text-sm text-purple-050 truncate sm:text-base font-medium sm:mt-1.5"},$r={class:"mt-5 md:mt-10"},Ir={class:"mt-4 grid grid-cols-1 sm:grid-cols-4 gap-x-2 flex-wrap gap-y-2 sm:mt-6"},Mr={class:"uppercase text-purple-150 font-medium text-xs mb-1 sm:text-sm sm:mb-2"},Nr=fe({__name:"AppUserDetailsPopup",props:{modelValue:{type:Boolean},user:{}},emits:["update:modelValue"],async setup(t,{emit:e}){var u,l,c,h;let n,r;const i=t,{t:s}=he();on(),an();const o=C([]);C(!1);const{data:a}=([n,r]=ln(()=>un(`/trees/${i.user.id}/unilevel/details`).json()),n=await n,r(),n);return o.value=[{name:s("structure.invested"),value:((u=a.value)==null?void 0:u.depositTotal)||"0",color:"white",prefix:"$",magnifier:.01},{name:s("structure.turnover"),value:((l=a.value)==null?void 0:l.totalTurnoverMiners)||"0",color:"white",prefix:"$",magnifier:.01},{name:s("structure.directReferrals"),value:((c=a.value)==null?void 0:c.directReferralCount)||"0",color:"white",prefix:"",magnifier:1},{name:s("structure.referrals"),value:((h=a.value)==null?void 0:h.totalReferralCount)||"0",color:"white",prefix:"",magnifier:1}],(f,d)=>{const p=sn,_=hr;return i.modelValue?(I(),Jt(_,{key:0,"model-value":i.modelValue,"content-class":"w-full max-w-120 sm:max-w-153","onUpdate:modelValue":d[0]||(d[0]=m=>e("update:modelValue",m))},{default:de(()=>[wr,E("div",br,[E("header",Sr,[lt(p,{class:"!bg-transparent flex-shrink-0 text-4xl xl:text-5xl md:text-4xl uppercase",user:i.user},null,8,["user"]),E("div",Er,[E("p",Tr,G(i.user.firstName),1),E("p",Ar,[E("a",{href:`mailto:${i.user.email}`,class:"focus:outline-none"},G(i.user.emailAddress),9,kr)]),E("p",Cr,G(i.user.nickname),1)])]),E("footer",$r,[Qt(f.$slots,"footer",{},()=>[E("ul",Ir,[(I(!0),z(cn,null,fn(T(o),m=>(I(),z("li",{key:m.name,class:"py-2.5 px-2 bg-darkGold sm:px-4 flex-grow text-center border border-[#25273b] rounded-lg min-w-40 md:min-w-30"},[E("p",Mr,G(m.name),1),E("p",{class:hn(["text-[1.25rem] font-semibold",`text-${m.color}`])},G(m.prefix)+G(m.value*m.magnifier),3)]))),128))]),Qt(f.$slots,"extendFooter")])])])]),_:3},8,["model-value"])):dn("",!0)}}});var Rr={value:()=>{}};function mn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new wt(n)}function wt(t){this._=t}function Or(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}wt.prototype=mn.prototype={constructor:wt,on:function(t,e){var n=this._,r=Or(t+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(t=r[s]).type)&&(i=Lr(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<o;)if(i=(t=r[s]).type)n[i]=Ce(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Ce(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new wt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function Lr(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Ce(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Rr,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var te="http://www.w3.org/1999/xhtml";const $e={svg:"http://www.w3.org/2000/svg",xhtml:te,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),$e.hasOwnProperty(e)?{space:$e[e],local:t}:t}function Dr(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===te&&e.documentElement.namespaceURI===te?e.createElement(t):e.createElementNS(n,t)}}function Hr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vn(t){var e=Gt(t);return(e.local?Hr:Dr)(e)}function Gr(){}function ge(t){return t==null?Gr:function(){return this.querySelector(t)}}function zr(t){typeof t!="function"&&(t=ge(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=new Array(o),u,l,c=0;c<o;++c)(u=s[c])&&(l=t.call(u,u.__data__,c,s))&&("__data__"in u&&(l.__data__=u.__data__),a[c]=l);return new M(r,this._parents)}function Pr(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Vr(){return[]}function yn(t){return t==null?Vr:function(){return this.querySelectorAll(t)}}function Fr(t){return function(){return Pr(t.apply(this,arguments))}}function Br(t){typeof t=="function"?t=Fr(t):t=yn(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var o=e[s],a=o.length,u,l=0;l<a;++l)(u=o[l])&&(r.push(t.call(u,u.__data__,l,o)),i.push(u));return new M(r,i)}function xn(t){return function(){return this.matches(t)}}function wn(t){return function(e){return e.matches(t)}}var Xr=Array.prototype.find;function Wr(t){return function(){return Xr.call(this.children,t)}}function Kr(){return this.firstElementChild}function Yr(t){return this.select(t==null?Kr:Wr(typeof t=="function"?t:wn(t)))}var Ur=Array.prototype.filter;function qr(){return Array.from(this.children)}function Zr(t){return function(){return Ur.call(this.children,t)}}function Jr(t){return this.selectAll(t==null?qr:Zr(typeof t=="function"?t:wn(t)))}function Qr(t){typeof t!="function"&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],u,l=0;l<o;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&a.push(u);return new M(r,this._parents)}function bn(t){return new Array(t.length)}function jr(){return new M(this._enter||this._groups.map(bn),this._parents)}function Ct(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ct.prototype={constructor:Ct,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ti(t){return function(){return t}}function ei(t,e,n,r,i,s){for(var o=0,a,u=e.length,l=s.length;o<l;++o)(a=e[o])?(a.__data__=s[o],r[o]=a):n[o]=new Ct(t,s[o]);for(;o<u;++o)(a=e[o])&&(i[o]=a)}function ni(t,e,n,r,i,s,o){var a,u,l=new Map,c=e.length,h=s.length,f=new Array(c),d;for(a=0;a<c;++a)(u=e[a])&&(f[a]=d=o.call(u,u.__data__,a,e)+"",l.has(d)?i[a]=u:l.set(d,u));for(a=0;a<h;++a)d=o.call(t,s[a],a,s)+"",(u=l.get(d))?(r[a]=u,u.__data__=s[a],l.delete(d)):n[a]=new Ct(t,s[a]);for(a=0;a<c;++a)(u=e[a])&&l.get(f[a])===u&&(i[a]=u)}function ri(t){return t.__data__}function ii(t,e){if(!arguments.length)return Array.from(this,ri);var n=e?ni:ei,r=this._parents,i=this._groups;typeof t!="function"&&(t=ti(t));for(var s=i.length,o=new Array(s),a=new Array(s),u=new Array(s),l=0;l<s;++l){var c=r[l],h=i[l],f=h.length,d=si(t.call(c,c&&c.__data__,l,r)),p=d.length,_=a[l]=new Array(p),m=o[l]=new Array(p),x=u[l]=new Array(f);n(c,h,_,m,x,d,e);for(var w=0,g=0,b,v;w<p;++w)if(b=_[w]){for(w>=g&&(g=w+1);!(v=m[g])&&++g<p;);b._next=v||null}}return o=new M(o,r),o._enter=a,o._exit=u,o}function si(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function oi(){return new M(this._exit||this._groups.map(bn),this._parents)}function ai(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function li(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),u=0;u<o;++u)for(var l=n[u],c=r[u],h=l.length,f=a[u]=new Array(h),d,p=0;p<h;++p)(d=l[p]||c[p])&&(f[p]=d);for(;u<i;++u)a[u]=n[u];return new M(a,this._parents)}function ui(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function ci(t){t||(t=fi);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,u=i[s]=new Array(a),l,c=0;c<a;++c)(l=o[c])&&(u[c]=l);u.sort(e)}return new M(i,this._parents).order()}function fi(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function hi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function di(){return Array.from(this)}function pi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function gi(){let t=0;for(const e of this)++t;return t}function _i(){return!this.node()}function mi(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&t.call(a,a.__data__,s,i);return this}function vi(t){return function(){this.removeAttribute(t)}}function yi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xi(t,e){return function(){this.setAttribute(t,e)}}function wi(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function bi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Si(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ei(t,e){var n=Gt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?yi:vi:typeof e=="function"?n.local?Si:bi:n.local?wi:xi)(n,e))}function Sn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ti(t){return function(){this.style.removeProperty(t)}}function Ai(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ki(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ci(t,e,n){return arguments.length>1?this.each((e==null?Ti:typeof e=="function"?ki:Ai)(t,e,n??"")):tt(this.node(),t)}function tt(t,e){return t.style.getPropertyValue(e)||Sn(t).getComputedStyle(t,null).getPropertyValue(e)}function $i(t){return function(){delete this[t]}}function Ii(t,e){return function(){this[t]=e}}function Mi(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ni(t,e){return arguments.length>1?this.each((e==null?$i:typeof e=="function"?Mi:Ii)(t,e)):this.node()[t]}function En(t){return t.trim().split(/^|\s+/)}function _e(t){return t.classList||new Tn(t)}function Tn(t){this._node=t,this._names=En(t.getAttribute("class")||"")}Tn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function An(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function kn(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ri(t){return function(){An(this,t)}}function Oi(t){return function(){kn(this,t)}}function Li(t,e){return function(){(e.apply(this,arguments)?An:kn)(this,t)}}function Di(t,e){var n=En(t+"");if(arguments.length<2){for(var r=_e(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Li:e?Ri:Oi)(n,e))}function Hi(){this.textContent=""}function Gi(t){return function(){this.textContent=t}}function zi(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Pi(t){return arguments.length?this.each(t==null?Hi:(typeof t=="function"?zi:Gi)(t)):this.node().textContent}function Vi(){this.innerHTML=""}function Fi(t){return function(){this.innerHTML=t}}function Bi(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Xi(t){return arguments.length?this.each(t==null?Vi:(typeof t=="function"?Bi:Fi)(t)):this.node().innerHTML}function Wi(){this.nextSibling&&this.parentNode.appendChild(this)}function Ki(){return this.each(Wi)}function Yi(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ui(){return this.each(Yi)}function qi(t){var e=typeof t=="function"?t:vn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Zi(){return null}function Ji(t,e){var n=typeof t=="function"?t:vn(t),r=e==null?Zi:typeof e=="function"?e:ge(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qi(){var t=this.parentNode;t&&t.removeChild(this)}function ji(){return this.each(Qi)}function ts(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function es(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ns(t){return this.select(t?es:ts)}function rs(t){return arguments.length?this.property("__data__",t):this.node().__data__}function is(t){return function(e){t.call(this,e,this.__data__)}}function ss(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function os(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function as(t,e,n){return function(){var r=this.__on,i,s=is(e);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function ls(t,e,n){var r=ss(t+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,l=a.length,c;u<l;++u)for(i=0,c=a[u];i<s;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(a=e?as:os,i=0;i<s;++i)this.each(a(r[i],e,n));return this}function Cn(t,e,n){var r=Sn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function us(t,e){return function(){return Cn(this,t,e)}}function cs(t,e){return function(){return Cn(this,t,e.apply(this,arguments))}}function fs(t,e){return this.each((typeof e=="function"?cs:us)(t,e))}function*hs(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var $n=[null];function M(t,e){this._groups=t,this._parents=e}function pt(){return new M([[document.documentElement]],$n)}function ds(){return this}M.prototype=pt.prototype={constructor:M,select:zr,selectAll:Br,selectChild:Yr,selectChildren:Jr,filter:Qr,data:ii,enter:jr,exit:oi,join:ai,merge:li,selection:ds,order:ui,sort:ci,call:hi,nodes:di,node:pi,size:gi,empty:_i,each:mi,attr:Ei,style:Ci,property:Ni,classed:Di,text:Pi,html:Xi,raise:Ki,lower:Ui,append:qi,insert:Ji,remove:ji,clone:ns,datum:rs,on:ls,dispatch:fs,[Symbol.iterator]:hs};function ps(t){return typeof t=="string"?new M([[document.querySelector(t)]],[document.documentElement]):new M([[t]],$n)}function me(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function In(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function gt(){}var ut=.7,$t=1/ut,j="\\s*([+-]?\\d+)\\s*",ct="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gs=/^#([0-9a-f]{3,8})$/,_s=new RegExp(`^rgb\\(${j},${j},${j}\\)$`),ms=new RegExp(`^rgb\\(${P},${P},${P}\\)$`),vs=new RegExp(`^rgba\\(${j},${j},${j},${ct}\\)$`),ys=new RegExp(`^rgba\\(${P},${P},${P},${ct}\\)$`),xs=new RegExp(`^hsl\\(${ct},${P},${P}\\)$`),ws=new RegExp(`^hsla\\(${ct},${P},${P},${ct}\\)$`),Ie={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};me(gt,ft,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Me,formatHex:Me,formatHex8:bs,formatHsl:Ss,formatRgb:Ne,toString:Ne});function Me(){return this.rgb().formatHex()}function bs(){return this.rgb().formatHex8()}function Ss(){return Mn(this).formatHsl()}function Ne(){return this.rgb().formatRgb()}function ft(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gs.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Re(e):n===3?new $(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?mt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?mt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=_s.exec(t))?new $(e[1],e[2],e[3],1):(e=ms.exec(t))?new $(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=vs.exec(t))?mt(e[1],e[2],e[3],e[4]):(e=ys.exec(t))?mt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=xs.exec(t))?De(e[1],e[2]/100,e[3]/100,1):(e=ws.exec(t))?De(e[1],e[2]/100,e[3]/100,e[4]):Ie.hasOwnProperty(t)?Re(Ie[t]):t==="transparent"?new $(NaN,NaN,NaN,0):null}function Re(t){return new $(t>>16&255,t>>8&255,t&255,1)}function mt(t,e,n,r){return r<=0&&(t=e=n=NaN),new $(t,e,n,r)}function Es(t){return t instanceof gt||(t=ft(t)),t?(t=t.rgb(),new $(t.r,t.g,t.b,t.opacity)):new $}function ee(t,e,n,r){return arguments.length===1?Es(t):new $(t,e,n,r??1)}function $(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}me($,ee,In(gt,{brighter(t){return t=t==null?$t:Math.pow($t,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ut:Math.pow(ut,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new $(q(this.r),q(this.g),q(this.b),It(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:Oe,formatHex:Oe,formatHex8:Ts,formatRgb:Le,toString:Le}));function Oe(){return`#${U(this.r)}${U(this.g)}${U(this.b)}`}function Ts(){return`#${U(this.r)}${U(this.g)}${U(this.b)}${U((isNaN(this.opacity)?1:this.opacity)*255)}`}function Le(){const t=It(this.opacity);return`${t===1?"rgb(":"rgba("}${q(this.r)}, ${q(this.g)}, ${q(this.b)}${t===1?")":`, ${t})`}`}function It(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function q(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function U(t){return t=q(t),(t<16?"0":"")+t.toString(16)}function De(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new N(t,e,n,r)}function Mn(t){if(t instanceof N)return new N(t.h,t.s,t.l,t.opacity);if(t instanceof gt||(t=ft(t)),!t)return new N;if(t instanceof N)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=NaN,a=s-i,u=(s+i)/2;return a?(e===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-e)/a+2:o=(e-n)/a+4,a/=u<.5?s+i:2-s-i,o*=60):a=u>0&&u<1?0:o,new N(o,a,u,t.opacity)}function As(t,e,n,r){return arguments.length===1?Mn(t):new N(t,e,n,r??1)}function N(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}me(N,As,In(gt,{brighter(t){return t=t==null?$t:Math.pow($t,t),new N(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ut:Math.pow(ut,t),new N(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new $(Xt(t>=240?t-240:t+120,i,r),Xt(t,i,r),Xt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new N(He(this.h),vt(this.s),vt(this.l),It(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=It(this.opacity);return`${t===1?"hsl(":"hsla("}${He(this.h)}, ${vt(this.s)*100}%, ${vt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function He(t){return t=(t||0)%360,t<0?t+360:t}function vt(t){return Math.max(0,Math.min(1,t||0))}function Xt(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Nn=t=>()=>t;function ks(t,e){return function(n){return t+n*e}}function Cs(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function $s(t){return(t=+t)==1?Rn:function(e,n){return n-e?Cs(e,n,t):Nn(isNaN(e)?n:e)}}function Rn(t,e){var n=e-t;return n?ks(t,n):Nn(isNaN(t)?e:t)}const Ge=function t(e){var n=$s(e);function r(i,s){var o=n((i=ee(i)).r,(s=ee(s)).r),a=n(i.g,s.g),u=n(i.b,s.b),l=Rn(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function X(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wt=new RegExp(ne.source,"g");function Is(t){return function(){return t}}function Ms(t){return function(e){return t(e)+""}}function Ns(t,e){var n=ne.lastIndex=Wt.lastIndex=0,r,i,s,o=-1,a=[],u=[];for(t=t+"",e=e+"";(r=ne.exec(t))&&(i=Wt.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,u.push({i:o,x:X(r,i)})),n=Wt.lastIndex;return n<e.length&&(s=e.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?u[0]?Ms(u[0].x):Is(e):(e=u.length,function(l){for(var c=0,h;c<e;++c)a[(h=u[c]).i]=h.x(l);return a.join("")})}var ze=180/Math.PI,re={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function On(t,e,n,r,i,s){var o,a,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*ze,skewX:Math.atan(u)*ze,scaleX:o,scaleY:a}}var yt;function Rs(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?re:On(e.a,e.b,e.c,e.d,e.e,e.f)}function Os(t){return t==null||(yt||(yt=document.createElementNS("http://www.w3.org/2000/svg","g")),yt.setAttribute("transform",t),!(t=yt.transform.baseVal.consolidate()))?re:(t=t.matrix,On(t.a,t.b,t.c,t.d,t.e,t.f))}function Ln(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function s(l,c,h,f,d,p){if(l!==h||c!==f){var _=d.push("translate(",null,e,null,n);p.push({i:_-4,x:X(l,h)},{i:_-2,x:X(c,f)})}else(h||f)&&d.push("translate("+h+e+f+n)}function o(l,c,h,f){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:X(l,c)})):c&&h.push(i(h)+"rotate("+c+r)}function a(l,c,h,f){l!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:X(l,c)}):c&&h.push(i(h)+"skewX("+c+r)}function u(l,c,h,f,d,p){if(l!==h||c!==f){var _=d.push(i(d)+"scale(",null,",",null,")");p.push({i:_-4,x:X(l,h)},{i:_-2,x:X(c,f)})}else(h!==1||f!==1)&&d.push(i(d)+"scale("+h+","+f+")")}return function(l,c){var h=[],f=[];return l=t(l),c=t(c),s(l.translateX,l.translateY,c.translateX,c.translateY,h,f),o(l.rotate,c.rotate,h,f),a(l.skewX,c.skewX,h,f),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,h,f),l=c=null,function(d){for(var p=-1,_=f.length,m;++p<_;)h[(m=f[p]).i]=m.x(d);return h.join("")}}}var Ls=Ln(Rs,"px, ","px)","deg)"),Ds=Ln(Os,", ",")",")"),et=0,st=0,nt=0,Dn=1e3,Mt,ot,Nt=0,J=0,zt=0,ht=typeof performance=="object"&&performance.now?performance:Date,Hn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ve(){return J||(Hn(Hs),J=ht.now()+zt)}function Hs(){J=0}function Rt(){this._call=this._time=this._next=null}Rt.prototype=Gn.prototype={constructor:Rt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ve():+n)+(e==null?0:+e),!this._next&&ot!==this&&(ot?ot._next=this:Mt=this,ot=this),this._call=t,this._time=n,ie()},stop:function(){this._call&&(this._call=null,this._time=1/0,ie())}};function Gn(t,e,n){var r=new Rt;return r.restart(t,e,n),r}function Gs(){ve(),++et;for(var t=Mt,e;t;)(e=J-t._time)>=0&&t._call.call(void 0,e),t=t._next;--et}function Pe(){J=(Nt=ht.now())+zt,et=st=0;try{Gs()}finally{et=0,Ps(),J=0}}function zs(){var t=ht.now(),e=t-Nt;e>Dn&&(zt-=e,Nt=t)}function Ps(){for(var t,e=Mt,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Mt=n);ot=t,ie(r)}function ie(t){if(!et){st&&(st=clearTimeout(st));var e=t-J;e>24?(t<1/0&&(st=setTimeout(Pe,t-ht.now()-zt)),nt&&(nt=clearInterval(nt))):(nt||(Nt=ht.now(),nt=setInterval(zs,Dn)),et=1,Hn(Pe))}}function Ve(t,e,n){var r=new Rt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Vs=mn("start","end","cancel","interrupt"),Fs=[],zn=0,Fe=1,se=2,bt=3,Be=4,oe=5,St=6;function Pt(t,e,n,r,i,s){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Bs(t,n,{name:e,index:r,group:i,on:Vs,tween:Fs,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:zn})}function ye(t,e){var n=R(t,e);if(n.state>zn)throw new Error("too late; already scheduled");return n}function V(t,e){var n=R(t,e);if(n.state>bt)throw new Error("too late; already running");return n}function R(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Bs(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Gn(s,0,n.time);function s(l){n.state=Fe,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var c,h,f,d;if(n.state!==Fe)return u();for(c in r)if(d=r[c],d.name===n.name){if(d.state===bt)return Ve(o);d.state===Be?(d.state=St,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c<e&&(d.state=St,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[c])}if(Ve(function(){n.state===bt&&(n.state=Be,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=se,n.on.call("start",t,t.__data__,n.index,n.group),n.state===se){for(n.state=bt,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=d);i.length=h+1}}function a(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=oe,1),h=-1,f=i.length;++h<f;)i[h].call(t,c);n.state===oe&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=St,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Xs(t,e){var n=t.__transition,r,i,s=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){s=!1;continue}i=r.state>se&&r.state<oe,r.state=St,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}s&&delete t.__transition}}function Ws(t){return this.each(function(){Xs(this,t)})}function Ks(t,e){var n,r;return function(){var i=V(this,t),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ys(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=V(this,t),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=a;break}u===l&&i.push(a)}s.tween=i}}function Us(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=R(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Ks:Ys)(n,t,e))}function xe(t,e,n){var r=t._id;return t.each(function(){var i=V(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return R(i,r).value[e]}}function Pn(t,e){var n;return(typeof e=="number"?X:e instanceof ft?Ge:(n=ft(e))?(e=n,Ge):Ns)(t,e)}function qs(t){return function(){this.removeAttribute(t)}}function Zs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Js(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttribute(t);return o===i?null:o===r?s:s=e(r=o,n)}}function Qs(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?s:s=e(r=o,n)}}function js(t,e,n){var r,i,s;return function(){var o,a=n(this),u;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),u=a+"",o===u?null:o===r&&u===i?s:(i=u,s=e(r=o,a)))}}function to(t,e,n){var r,i,s;return function(){var o,a=n(this),u;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),u=a+"",o===u?null:o===r&&u===i?s:(i=u,s=e(r=o,a)))}}function eo(t,e){var n=Gt(t),r=n==="transform"?Ds:Pn;return this.attrTween(t,typeof e=="function"?(n.local?to:js)(n,r,xe(this,"attr."+t,e)):e==null?(n.local?Zs:qs)(n):(n.local?Qs:Js)(n,r,e))}function no(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ro(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function io(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&ro(t,s)),n}return i._value=e,i}function so(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&no(t,s)),n}return i._value=e,i}function oo(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Gt(t);return this.tween(n,(r.local?io:so)(r,e))}function ao(t,e){return function(){ye(this,t).delay=+e.apply(this,arguments)}}function lo(t,e){return e=+e,function(){ye(this,t).delay=e}}function uo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ao:lo)(e,t)):R(this.node(),e).delay}function co(t,e){return function(){V(this,t).duration=+e.apply(this,arguments)}}function fo(t,e){return e=+e,function(){V(this,t).duration=e}}function ho(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?co:fo)(e,t)):R(this.node(),e).duration}function po(t,e){if(typeof e!="function")throw new Error;return function(){V(this,t).ease=e}}function go(t){var e=this._id;return arguments.length?this.each(po(e,t)):R(this.node(),e).ease}function _o(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;V(this,t).ease=n}}function mo(t){if(typeof t!="function")throw new Error;return this.each(_o(this._id,t))}function vo(t){typeof t!="function"&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],u,l=0;l<o;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&a.push(u);return new B(r,this._parents,this._name,this._id)}function yo(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var u=e[a],l=n[a],c=u.length,h=o[a]=new Array(c),f,d=0;d<c;++d)(f=u[d]||l[d])&&(h[d]=f);for(;a<r;++a)o[a]=e[a];return new B(o,this._parents,this._name,this._id)}function xo(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function wo(t,e,n){var r,i,s=xo(e)?ye:V;return function(){var o=s(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(e,n),o.on=i}}function bo(t,e){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(t):this.each(wo(n,t,e))}function So(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Eo(){return this.on("end.remove",So(this._id))}function To(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ge(t));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],u=a.length,l=s[o]=new Array(u),c,h,f=0;f<u;++f)(c=a[f])&&(h=t.call(c,c.__data__,f,a))&&("__data__"in c&&(h.__data__=c.__data__),l[f]=h,Pt(l[f],e,n,f,l,R(c,n)));return new B(s,this._parents,e,n)}function Ao(t){var e=this._name,n=this._id;typeof t!="function"&&(t=yn(t));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var u=r[a],l=u.length,c,h=0;h<l;++h)if(c=u[h]){for(var f=t.call(c,c.__data__,h,u),d,p=R(c,n),_=0,m=f.length;_<m;++_)(d=f[_])&&Pt(d,e,n,_,f,p);s.push(f),o.push(c)}return new B(s,o,e,n)}var ko=pt.prototype.constructor;function Co(){return new ko(this._groups,this._parents)}function $o(t,e){var n,r,i;return function(){var s=tt(this,t),o=(this.style.removeProperty(t),tt(this,t));return s===o?null:s===n&&o===r?i:i=e(n=s,r=o)}}function Vn(t){return function(){this.style.removeProperty(t)}}function Io(t,e,n){var r,i=n+"",s;return function(){var o=tt(this,t);return o===i?null:o===r?s:s=e(r=o,n)}}function Mo(t,e,n){var r,i,s;return function(){var o=tt(this,t),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(t),tt(this,t))),o===u?null:o===r&&u===i?s:(i=u,s=e(r=o,a))}}function No(t,e){var n,r,i,s="style."+e,o="end."+s,a;return function(){var u=V(this,t),l=u.on,c=u.value[s]==null?a||(a=Vn(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(o,i=c),u.on=r}}function Ro(t,e,n){var r=(t+="")=="transform"?Ls:Pn;return e==null?this.styleTween(t,$o(t,r)).on("end.style."+t,Vn(t)):typeof e=="function"?this.styleTween(t,Mo(t,r,xe(this,"style."+t,e))).each(No(this._id,t)):this.styleTween(t,Io(t,r,e),n).on("end.style."+t,null)}function Oo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Lo(t,e,n){var r,i;function s(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Oo(t,o,n)),r}return s._value=e,s}function Do(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Lo(t,e,n??""))}function Ho(t){return function(){this.textContent=t}}function Go(t){return function(){var e=t(this);this.textContent=e??""}}function zo(t){return this.tween("text",typeof t=="function"?Go(xe(this,"text",t)):Ho(t==null?"":t+""))}function Po(t){return function(e){this.textContent=t.call(this,e)}}function Vo(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Po(i)),e}return r._value=t,r}function Fo(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Vo(t))}function Bo(){for(var t=this._name,e=this._id,n=Fn(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,u,l=0;l<a;++l)if(u=o[l]){var c=R(u,e);Pt(u,t,n,l,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new B(r,this._parents,t,n)}function Xo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},u={value:function(){--i===0&&s()}};n.each(function(){var l=V(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(u)),l.on=e}),i===0&&s()})}var Wo=0;function B(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Fn(){return++Wo}var F=pt.prototype;B.prototype={constructor:B,select:To,selectAll:Ao,selectChild:F.selectChild,selectChildren:F.selectChildren,filter:vo,merge:yo,selection:Co,transition:Bo,call:F.call,nodes:F.nodes,node:F.node,size:F.size,empty:F.empty,each:F.each,on:bo,attr:eo,attrTween:oo,style:Ro,styleTween:Do,text:zo,textTween:Fo,remove:Eo,tween:Us,delay:uo,duration:ho,ease:go,easeVarying:mo,end:Xo,[Symbol.iterator]:F[Symbol.iterator]};function Et(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ko={time:null,delay:0,duration:250,ease:Et};function Yo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Uo(t){var e,n;t instanceof B?(e=t._id,t=t._name):(e=Fn(),(n=Ko).time=ve(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,u,l=0;l<a;++l)(u=o[l])&&Pt(u,t,e,l,o,n||Yo(u,e));return new B(r,this._parents,t,e)}pt.prototype.interrupt=Ws;pt.prototype.transition=Uo;const ae=Math.PI,le=2*ae,K=1e-6,qo=le-K;function Bn(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Zo(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bn;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class we{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Bn:Zo(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,s,o){this._append`C${+e},${+n},${+r},${+i},${this._x1=+s},${this._y1=+o}`}arcTo(e,n,r,i,s){if(e=+e,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,u=r-e,l=i-n,c=o-e,h=a-n,f=c*c+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>K)if(!(Math.abs(h*u-l*c)>K)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-o,p=i-a,_=u*u+l*l,m=d*d+p*p,x=Math.sqrt(_),w=Math.sqrt(f),g=s*Math.tan((ae-Math.acos((_+f-m)/(2*x*w)))/2),b=g/w,v=g/x;Math.abs(b-1)>K&&this._append`L${e+b*c},${n+b*h}`,this._append`A${s},${s},0,0,${+(h*d>c*p)},${this._x1=e+v*u},${this._y1=n+v*l}`}}arc(e,n,r,i,s,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),u=r*Math.sin(i),l=e+a,c=n+u,h=1^o,f=o?i-s:s-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>K||Math.abs(this._y1-c)>K)&&this._append`L${l},${c}`,r&&(f<0&&(f=f%le+le),f>qo?this._append`A${r},${r},0,1,${h},${e-a},${n-u}A${r},${r},0,1,${h},${this._x1=l},${this._y1=c}`:f>K&&this._append`A${r},${r},0,${+(f>=ae)},${h},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Xn(){return new we}Xn.prototype=we.prototype;function Jo(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function Qo(){return this.eachAfter(Jo)}function jo(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function ta(t,e){for(var n=this,r=[n],i,s,o=-1;n=r.pop();)if(t.call(e,n,++o,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function ea(t,e){for(var n=this,r=[n],i=[],s,o,a,u=-1;n=r.pop();)if(i.push(n),s=n.children)for(o=0,a=s.length;o<a;++o)r.push(s[o]);for(;n=i.pop();)t.call(e,n,++u,this);return this}function na(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function ra(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function ia(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function sa(t){for(var e=this,n=oa(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function oa(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function aa(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function la(){return Array.from(this)}function ua(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function ca(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*fa(){var t=this,e,n=[t],r,i,s;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function be(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=pa)):e===void 0&&(e=da);for(var n=new dt(t),r,i=[n],s,o,a,u;r=i.pop();)if((o=e(r.data))&&(u=(o=Array.from(o)).length))for(r.children=o,a=u-1;a>=0;--a)i.push(s=o[a]=new dt(o[a])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(_a)}function ha(){return be(this).eachBefore(ga)}function da(t){return t.children}function pa(t){return Array.isArray(t)?t[1]:null}function ga(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function _a(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function dt(t){this.data=t,this.depth=this.height=0,this.parent=null}dt.prototype=be.prototype={constructor:dt,count:Qo,each:jo,eachAfter:ea,eachBefore:ta,find:na,sum:ra,sort:ia,path:sa,ancestors:aa,descendants:la,leaves:ua,links:ca,copy:ha,[Symbol.iterator]:fa};function ma(t,e){return t.parent===e.parent?1:2}function Kt(t){var e=t.children;return e?e[0]:t.t}function Yt(t){var e=t.children;return e?e[e.length-1]:t.t}function va(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function ya(t){for(var e=0,n=0,r=t.children,i=r.length,s;--i>=0;)s=r[i],s.z+=e,s.m+=e,e+=s.s+(n+=s.c)}function xa(t,e,n){return t.a.parent===e.parent?t.a:n}function Tt(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Tt.prototype=Object.create(dt.prototype);function wa(t){for(var e=new Tt(t,0),n,r=[e],i,s,o,a;n=r.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)r.push(i=n.children[o]=new Tt(s[o],o)),i.parent=n;return(e.parent=new Tt(null,0)).children=[e],e}function ba(){var t=ma,e=1,n=1,r=null;function i(l){var c=wa(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),r)l.eachBefore(u);else{var h=l,f=l,d=l;l.eachBefore(function(w){w.x<h.x&&(h=w),w.x>f.x&&(f=w),w.depth>d.depth&&(d=w)});var p=h===f?1:t(h,f)/2,_=p-h.x,m=e/(f.x+p+_),x=n/(d.depth||1);l.eachBefore(function(w){w.x=(w.x+_)*m,w.y=w.depth*x})}return l}function s(l){var c=l.children,h=l.parent.children,f=l.i?h[l.i-1]:null;if(c){ya(l);var d=(c[0].z+c[c.length-1].z)/2;f?(l.z=f.z+t(l._,f._),l.m=l.z-d):l.z=d}else f&&(l.z=f.z+t(l._,f._));l.parent.A=a(l,f,l.parent.A||h[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,h){if(c){for(var f=l,d=l,p=c,_=f.parent.children[0],m=f.m,x=d.m,w=p.m,g=_.m,b;p=Yt(p),f=Kt(f),p&&f;)_=Kt(_),d=Yt(d),d.a=l,b=p.z+w-f.z-m+t(p._,f._),b>0&&(va(xa(p,l,h),l,b),m+=b,x+=b),w+=p.m,m+=f.m,g+=_.m,x+=d.m;p&&!Yt(d)&&(d.t=p,d.m+=w-x),f&&!Kt(_)&&(_.t=f,_.m+=m-g,h=l)}return h}function u(l){l.x*=e,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(t=l,i):t},i.size=function(l){return arguments.length?(r=!1,e=+l[0],n=+l[1],i):r?null:[e,n]},i.nodeSize=function(l){return arguments.length?(r=!0,e=+l[0],n=+l[1],i):r?[e,n]:null},i}function Xe(t){return function(){return t}}function Sa(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new we(e)}var Ea=Array.prototype.slice;function Ta(t){return t[0]}function Aa(t){return t[1]}class Wn{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function ka(t){return new Wn(t,!0)}function Ca(t){return new Wn(t,!1)}function $a(t){return t.source}function Ia(t){return t.target}function Kn(t){let e=$a,n=Ia,r=Ta,i=Aa,s=null,o=null,a=Sa(u);function u(){let l;const c=Ea.call(arguments),h=e.apply(this,c),f=n.apply(this,c);if(s==null&&(o=t(l=a())),o.lineStart(),c[0]=h,o.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,o.point(+r.apply(this,c),+i.apply(this,c)),o.lineEnd(),l)return o=null,l+""||null}return u.source=function(l){return arguments.length?(e=l,u):e},u.target=function(l){return arguments.length?(n=l,u):n},u.x=function(l){return arguments.length?(r=typeof l=="function"?l:Xe(+l),u):r},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:Xe(+l),u):i},u.context=function(l){return arguments.length?(l==null?s=o=null:o=t(s=l),u):s},u}function Ma(){return Kn(ka)}function Na(){return Kn(Ca)}function at(t,e,n){this.k=t,this.x=e,this.y=n}at.prototype={constructor:at,scale:function(t){return t===1?this:new at(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new at(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};at.prototype;var Yn=100,Un=100,qn=200,We=200,Ut=800,qt=/translate\((-?\d+)px, ?(-?\d+)px\)/i,Ke=/scale\((\S*)\)/i,k;(function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal"})(k||(k={}));var Z;(function(t){t.CURVE="curve",t.STRAIGHT="straight"})(Z||(Z={}));function Ra(){for(var t=[],e="0123456789abcdef",n=0;n<36;n++)t[n]=e.substr(Math.floor(Math.random()*16),1);return t[14]="4",t[19]=e.substr(t[19]&3|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function xt(t){var e=t.x,n=t.y;return{x:n,y:e}}function Ot(t){var e={_key:Ra()};for(var n in t)t[n]===null?e[n]=null:Array.isArray(t[n])?e[n]=t[n].map(function(r){return Ot(r)}):typeof t[n]=="object"?e[n]=Ot(t[n]):e[n]=t[n];return e}var Oa=function(){function t(e){this.treeConfig={nodeWidth:Yn,nodeHeight:Un,levelHeight:qn},this.linkStyle=Z.CURVE,this.direction=k.VERTICAL,this.collapseEnabled=!0,this.currentScale=1,e.treeConfig&&(this.treeConfig=e.treeConfig),this.collapseEnabled=e.collapseEnabled,this.svgElement=e.svgElement,this.domElement=e.domElement,this.treeContainer=e.treeContainer,this.dataset=this.updatedInternalData(e.dataset),e.direction&&(this.direction=e.direction),e.linkStyle&&(this.linkStyle=e.linkStyle)}return t.prototype.init=function(){this.draw(),this.enableDrag(),this.initTransform()},t.prototype.getNodeDataList=function(){return this.nodeDataList},t.prototype.getInitialTransformStyle=function(){return{transform:"scale(1) translate(".concat(this.initTransformX,"px, ").concat(this.initTransformY,"px)"),transformOrigin:"center"}},t.prototype.zoomIn=function(){var e=this.domElement.style.transform,n=1*1.2,r=e.match(Ke);if(r&&r.length>0){var i=parseFloat(r[1]);n*=i}this.setScale(n)},t.prototype.zoomOut=function(){var e=this.domElement.style.transform,n=1/1.2,r=e.match(Ke);if(r&&r.length>0){var i=parseFloat(r[1]);n=i/1.2}this.setScale(n)},t.prototype.restoreScale=function(){this.setScale(1)},t.prototype.setScale=function(e){if(typeof e=="number"){var n=this.getTranslate(),r="translate(".concat(n[0],"px, ").concat(n[1],"px)");this.svgElement.style.transform="scale(".concat(e,") ")+r,this.domElement.style.transform="scale(".concat(e,") ")+r,this.currentScale=e}},t.prototype.getTranslate=function(){var e=this.svgElement.style.transform,n=e.match(qt);if(n===null)return[null,null];var r=parseInt(n[1]),i=parseInt(n[2]);return[r,i]},t.prototype.isVertical=function(){return this.direction===k.VERTICAL},t.prototype.generateLinkPath=function(e){var n=this;if(this.linkStyle===Z.CURVE)return this.generateCurceLinkPath(n,e);if(this.linkStyle===Z.STRAIGHT)return this.generateStraightLinkPath(e)},t.prototype.generateCurceLinkPath=function(e,n){var r=this.isVertical()?Na():Ma();return r.x(function(i){return i.x}).y(function(i){return i.y}).source(function(i){var s={x:i.source.x,y:i.source.y};return e.direction===k.VERTICAL?s:xt(s)}).target(function(i){var s={x:i.target.x,y:i.target.y};return e.direction===k.VERTICAL?s:xt(s)}),r(n)},t.prototype.generateStraightLinkPath=function(e){var n=Xn(),r={x:e.source.x,y:e.source.y},i={x:e.target.x,y:e.target.y};this.isVertical()||(r=xt(r),i=xt(i));var s=i.x-r.x,o=i.y-r.y,a=this.isVertical()?{x:r.x,y:r.y+o/2}:{x:r.x+s/2,y:r.y},u=this.isVertical()?{x:i.x,y:r.y+o/2}:{x:r.x+s/2,y:i.y};return n.moveTo(r.x,r.y),n.lineTo(a.x,a.y),n.lineTo(u.x,u.y),n.lineTo(i.x,i.y),n.toString()},t.prototype.updateDataList=function(){var e=this.buildTree(),n=e[0],r=e[1];n.splice(0,1),r=r.filter(function(i){return i.source.data.name!=="__invisible_root"}),this.linkDataList=r,this.nodeDataList=n},t.prototype.draw=function(){this.updateDataList();var e=this.dataset.identifier,n=this.dataset.links;if(n&&e)for(var r=function(c){var h=void 0,f=void 0;if(e==="value"?(h=i.nodeDataList.find(function(x){return x[e]==c.parent}),f=i.nodeDataList.filter(function(x){return x[e]==c.child})):(h=i.nodeDataList.find(function(x){return x.data[e]==c.parent}),f=i.nodeDataList.filter(function(x){return x.data[e]==c.child})),h&&f)for(var d=0,p=f;d<p.length;d++){var _=p[d],m={source:h,target:_};i.linkDataList.push(m)}},i=this,s=0,o=n;s<o.length;s++){var a=o[s];r(a)}this.svgSelection=ps(this.svgElement);var u=this,l=this.svgSelection.selectAll(".link").data(this.linkDataList,function(c){return"".concat(c.source.data._key,"-").concat(c.target.data._key)});l.enter().append("path").style("opacity",0).transition().duration(Ut).ease(Et).style("opacity",1).attr("class","link").attr("d",function(c){return u.generateLinkPath(c)}),l.transition().duration(Ut).ease(Et).attr("d",function(c){return u.generateLinkPath(c)}),l.exit().transition().duration(Ut/2).ease(Et).style("opacity",0).remove()},t.prototype.updatedInternalData=function(e){var n={name:"__invisible_root",children:[]};if(!e)return n;if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)n.children.push(Ot(e[r]));else n.children.push(Ot(e));return n},t.prototype.buildTree=function(){var e=this.treeConfig.nodeWidth>this.treeConfig.levelHeight?[this.treeConfig.nodeWidth,this.treeConfig.levelHeight]:[this.treeConfig.nodeWidth/2,this.treeConfig.levelHeight],n=ba().nodeSize(e),r=n(be(this.dataset));return[r.descendants(),r.links()]},t.prototype.enableDrag=function(){var e=this,n=0,r=0,i=!1,s="";this.treeContainer.onpointerdown=function(o){s=e.svgElement.style.transform,n=o.clientX,r=o.clientY,i=!0},this.treeContainer.onpointermove=function(o){if(i){var a=s,u=0,l=0;if(a){var c=a.match(qt);if(c!==null&&c.length!==0){var h=c.slice(1),f=h[0],d=h[1];u=parseInt(f),l=parseInt(d)}}var p=Math.floor((o.clientX-n)/e.currentScale)+u,_=Math.floor((o.clientY-r)/e.currentScale)+l,m="translate(".concat(p,"px, ").concat(_,"px)");a&&(m=a.replace(qt,m)),e.svgElement.style.transform=m,e.domElement.style.transform=m}},this.treeContainer.onpointerup=function(){n=0,r=0,i=!1}},t.prototype.initTransform=function(){var e=this.domElement.offsetWidth,n=this.domElement.offsetHeight;this.isVertical()?(this.initTransformX=Math.floor(e/2),this.initTransformY=Math.floor(this.treeConfig.nodeHeight-We)):(this.initTransformX=Math.floor(this.treeConfig.nodeWidth-We),this.initTransformY=Math.floor(n/2))},t.prototype.onClickNode=function(e){if(this.collapseEnabled){var n=this.nodeDataList[e];n.data.children?(n.data._children=n.data.children,n.data.children=null,n.data._collapsed=!0):(n.data.children=n.data._children,n.data._children=null,n.data._collapsed=!1),this.draw()}},t.prototype.updateDataset=function(e){this.dataset=this.updatedInternalData(e),this.draw()},t.prototype.destroy=function(){this.svgElement=null,this.domElement=null,this.treeContainer=null},t}();function La(){try{return"constructor"in GestureEvent}catch{return!1}}function Da(){return typeof window<"u"&&"ontouchstart"in window}function Ha(t){return"pointerId"in t?null:t.type==="touchend"?t.changedTouches:t.targetTouches}function Se(t){return Array.from(Ha(t)).map(e=>e.identifier)}function Y(t){const e="buttons"in t?t.buttons:0,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}=t;return{buttons:e,shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}}const Ee=t=>t;function Ye(t,e,n=Ee){const[r,i]=Array.from(t.touches).filter(d=>e.includes(d.identifier));if(!r||!i)throw Error("The event doesn't have two pointers matching the pointerIds");const s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=(i.clientX+r.clientX)/2,u=(i.clientY+r.clientY)/2,l=Math.hypot(s,o),c=-(Math.atan2(s,o)*180)/Math.PI,h=n([l,c]),f=n([a,u]);return{values:h,origin:f}}const Ue=40,qe=800;function Zn(t,e=Ee){let{deltaX:n,deltaY:r,deltaMode:i}=t;return i===1?(n*=Ue,r*=Ue):i===2&&(n*=qe,r*=qe),e([n,r])}function Ze(t,e=Ee){return e([t.scale,t.rotation])}function Jn(){}function Qn(...t){return t.length===0?Jn:t.length===1?t[0]:function(){var e;for(let n of t)e=n.apply(this,arguments)||e;return e}}function rt(t,e){if(t===void 0){if(e===void 0)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function Je(t,e){return Object.assign({},e,t||{})}function Lt(t,...e){return typeof t=="function"?t(...e):t}function it(t){return{_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:Jn,canceled:!1,memo:void 0,args:void 0,...t}}function jn(){const t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},e=it({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),n=it({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=it({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=it({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),s=it({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:s}}class Ga{constructor(e){this.classes=e,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=Da(),this.supportsGestureEvents=La(),this.bind=(...n)=>{const r={};for(let i of this.classes)new i(this,n).addBindings(r);for(let i in this.nativeRefs)D(r,i,s=>this.nativeRefs[i]({...this.state.shared,event:s,args:n}));return this.config.domTarget?Fa(this,r):Ba(this,r)},this.clean=()=>{const{eventOptions:n,domTarget:r}=this.config,i=T(r);i&&Te(i,tr(this.domListeners),n),Object.values(this.timeouts).forEach(clearTimeout),Va(this)},this.classes=e,this.state=jn(),this.timeouts={},this.domListeners=[],this.windowListeners={}}}function za(t,e){"pointerId"in e?t.pointerIds.add(e.pointerId):t.touchIds=new Set(Se(e))}function Pa(t,e){"pointerId"in e?t.pointerIds.delete(e.pointerId):Se(e).forEach(n=>t.touchIds.delete(n))}function Va(t){const{config:{window:e,eventOptions:n},windowListeners:r}=t,i=T(e);if(i){for(let s in r){const o=r[s];Te(i,o,n)}t.windowListeners={}}}function Fa({config:t,domListeners:e},n){const{eventOptions:r,domTarget:i}=t,s=T(i);if(!s)throw new Error("domTarget must be defined");Te(s,tr(e),r);for(let[o,a]of Object.entries(n)){const u=o.slice(2).toLowerCase();e.push([u,Qn(...a)])}Xa(s,e,r)}function Ba({config:t},e){const n={},r=t.eventOptions.capture?"Capture":"";for(let[i,s]of Object.entries(e)){const o=Array.isArray(s)?s:[s],a=i+r;n[a]=Qn(...o)}return n}function tr(t=[]){return t.splice(0,t.length)}function D(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function Xa(t,e=[],n={}){if(t)for(let[r,i]of e)t.addEventListener(r,i,n)}function Te(t,e=[],n={}){if(t)for(let[r,i]of e)t.removeEventListener(r,i,n)}function ue(t,e){return t.map((n,r)=>n+e[r])}function Ae(t,e){return t.map((n,r)=>n-e[r])}function Dt(t){return Math.hypot(...t)}function Wa(t,e=t){const n=Dt(e),r=n===0?0:1/n,i=e.map(o=>r*o);return{distance:Dt(t),direction:i}}function er(t,e,n){const r=Dt(e),i=r===0?0:1/r,s=n===0?0:1/n,o=s*r,a=e.map(c=>s*c),u=e.map(c=>i*c),l=Dt(t);return{velocities:a,velocity:o,distance:l,direction:u}}function nr(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function Ka(t,e,n){return Math.max(e,Math.min(t,n))}function Ya(t,e){return Math.pow(t,e*5)}function Qe(t,e,n){return e===0||Math.abs(e)===1/0?Ya(t,n):t*e*n/(e+n*t)}function je(t,e,n,r=.15){return r===0?Ka(t,e,n):t<e?-Qe(e-t,n-e,r)+e:t>n?+Qe(t-n,n-e,r)+n:t}const W=new Map,Ua=t=>t;class rr{constructor(e,n=[]){this.controller=e,this.args=n,this.debounced=!0,this.setTimeout=(r,i=140,...s)=>{clearTimeout(this.controller.timeouts[this.stateKey]),this.controller.timeouts[this.stateKey]=window.setTimeout(r,i,...s)},this.clearTimeout=()=>{clearTimeout(this.controller.timeouts[this.stateKey])},this.fireGestureHandler=(r=!1)=>{if(this.state._blocked)return this.debounced||(this.state._active=!1,this.clean()),null;if(!r&&!this.state.intentional&&!this.config.triggerAllEvents)return null;if(this.state.intentional){const u=this.state.active,l=this.state._active;this.state.active=l,this.state.first=l&&!u,this.state.last=u&&!l,this.controller.state.shared[this.ingKey]=l}const i=this.controller.pointerIds.size||this.controller.touchIds.size,s=this.controller.state.shared.buttons>0||i>0,o={...this.controller.state.shared,...this.state,...this.mapStateValues(this.state),locked:!!document.pointerLockElement,touches:i,down:s},a=this.handler(o);return this.state.memo=a!==void 0?a:this.state.memo,o},this.controller=e,this.args=n}get config(){return this.controller.config[this.stateKey]}get enabled(){return this.controller.config.enabled&&this.config.enabled}get state(){return this.controller.state[this.stateKey]}get handler(){return this.controller.handlers[this.stateKey]}get transform(){return this.config.transform||this.controller.config.transform||Ua}updateSharedState(e){Object.assign(this.controller.state.shared,e)}updateGestureState(e){Object.assign(this.state,e)}checkIntentionality(e,n){return{_intentional:e,_blocked:!1}}getMovement(e){const{rubberband:n,threshold:r}=this.config,{_bounds:i,_initial:s,_active:o,_intentional:a,lastOffset:u,movement:l}=this.state,c=this.getInternalMovement(e,this.state),h=this.transform(r).map(Math.abs),f=a[0]===!1?tn(c[0],h[0]):a[0],d=a[1]===!1?tn(c[1],h[1]):a[1],p=this.checkIntentionality([f,d],c);if(p._blocked)return{...p,_movement:c,delta:[0,0]};const _=p._intentional,m=c;let x=[_[0]!==!1?c[0]-_[0]:0,_[1]!==!1?c[1]-_[1]:0];const w=ue(x,u),g=o?n:[0,0];return x=en(i,ue(x,s),g),{...p,intentional:_[0]!==!1||_[1]!==!1,_initial:s,_movement:m,movement:x,values:e,offset:en(i,w,g),delta:Ae(x,l)}}clean(){this.clearTimeout()}}function tn(t,e){return Math.abs(t)>=e?nr(t)*e:!1}function en(t,[e,n],[r,i]){const[[s,o],[a,u]]=t;return[je(e,s,o,r),je(n,a,u,i)]}function H({state:t},e,n){const{timeStamp:r,type:i}=e,s=t.values,o=n?0:r-t.startTime;return{_lastEventType:i,event:e,timeStamp:r,elapsedTime:o,previous:s}}function At({state:t,config:e,stateKey:n,args:r},i,s){const o=t.offset,a=s.timeStamp,{initial:u,bounds:l}=e,c={...jn()[n],_active:!0,args:r,values:i,initial:i,offset:o,lastOffset:o,startTime:a};return{...c,_initial:Lt(u,c),_bounds:Lt(l,c)}}class qa extends rr{getInternalMovement(e,n){return Ae(e,n.initial)}checkIntentionality(e,n){if(e[0]===!1&&e[1]===!1)return{_intentional:e,axis:this.state.axis};const[r,i]=n.map(Math.abs),s=this.state.axis||(r>i?"x":r<i?"y":void 0);return!this.config.axis&&!this.config.lockDirection?{_intentional:e,_blocked:!1,axis:s}:s?this.config.axis&&s!==this.config.axis?{_intentional:e,_blocked:!0,axis:s}:(e[s==="x"?1:0]=!1,{_intentional:e,_blocked:!1,axis:s}):{_intentional:[!1,!1],_blocked:!1,axis:s}}getKinematics(e,n){const r=this.getMovement(e);if(!r._blocked){const i=n.timeStamp-this.state.timeStamp;Object.assign(r,er(r.movement,r.delta,i))}return r}mapStateValues(e){return{xy:e.values,vxvy:e.velocities}}}function ir(t,e){let n,r=[],i,s=!1;function o(...a){return s&&n===this&&e(a,r)||(i=t.apply(this,a),s=!0,n=this,r=a),i}return o}function kt(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let n,r,i;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kt(t[r],e[r]))return!1;return!0}let s;if(typeof Map=="function"&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;for(s=t.entries();!(r=s.next()).done;)if(!kt(r.value[1],e.get(r.value[0])))return!1;return!0}if(typeof Set=="function"&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(typeof Element<"u"&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!(i[r]==="_owner"&&t.$$typeof)&&!kt(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}function sr(t,e){try{return kt(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function Vt(t={},e){const n={};for(const[r,i]of Object.entries(e))switch(typeof i){case"function":n[r]=i.call(n,t[r],r,t);break;case"object":n[r]=Vt(t[r],i);break;case"boolean":i&&(n[r]=t[r]);break}return n}const Za=.15,or={threshold(t=0){return rt(t)},rubberband(t=0){switch(t){case!0:return rt(Za);case!1:return rt(0);default:return rt(t)}},enabled(t=!0){return t},triggerAllEvents(t=!1){return t},initial(t=0){return typeof t=="function"?t:rt(t)},transform:!0},ar={...or,axis:!0,lockDirection(t=!1){return t},bounds(t={}){if(typeof t=="function")return s=>ar.bounds(t(s));const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=t;return[[e,n],[r,i]]}},Ja=typeof window<"u"&&window.document&&window.document.createElement,Qa={enabled(t=!0){return t},domTarget:!0,window(t=Ja?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform:!0},ja={...or,bounds(t,e,{distanceBounds:n={},angleBounds:r={}}){const i=o=>{const a=Je(Lt(n,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=Je(Lt(r,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[i(),s()]:o=>[i(o),s(o)]}};function lr(t){return Vt(t,Qa)}function tl(t={}){return Vt(t,ar)}function el(t={}){return Vt(t,ja)}function nl({domTarget:t,eventOptions:e,window:n,enabled:r,...i}){const s=lr({domTarget:t,eventOptions:e,window:n,enabled:r});return s.pinch=el(i),s}function rl({domTarget:t,eventOptions:e,window:n,enabled:r,...i}){const s=lr({domTarget:t,eventOptions:e,window:n,enabled:r});return s.wheel=tl(i),s}function ur(t,e,n={}){const r=il(t),i=new Ga(r);return i.config=e,i.handlers=t,i.nativeRefs=n,dr()&&!e.manual&&(pe(i.bind),pn(i.clean)),i}function il(t){const e=new Set;return t.drag&&e.add(W.get("drag")),t.wheel&&e.add(W.get("wheel")),t.scroll&&e.add(W.get("scroll")),t.move&&e.add(W.get("move")),t.pinch&&e.add(W.get("pinch")),t.hover&&e.add(W.get("hover")),e}class sl extends rr{getInternalMovement(e,n){const r=n.values[1];let[i,s=r]=e,o=s-r,a=n.turns;return Math.abs(o)>270&&(a+=nr(o)),Ae([i,s-360*a],n.initial)}getKinematics(e,n){const r=this.getMovement(e),i=(e[1]-r._movement[1]-this.state.initial[1])/360,s=n.timeStamp-this.state.timeStamp,{distance:o,velocity:a,...u}=er(r.movement,r.delta,s);return{turns:i,...r,...u}}mapStateValues(e){return{da:e.values,vdva:e.velocities}}}const ol=7,al=260;class ll extends sl{constructor(){super(...arguments),this.ingKey="pinching",this.stateKey="pinch",this.onPinchStart=e=>{za(this.controller,e);const n=this.controller.touchIds;if(!this.enabled||this.state._active&&this.state._pointerIds.every(o=>n.has(o))||n.size<2)return;const r=Array.from(n).slice(0,2),{values:i,origin:s}=Ye(e,r,this.transform);this.updateSharedState(Y(e)),this.updateGestureState({...At(this,i,e),...H(this,e,!0),_pointerIds:r,cancel:this.onCancel,origin:s}),this.updateGestureState(this.getMovement(i)),this.fireGestureHandler()},this.onPinchChange=e=>{const{canceled:n,_active:r}=this.state;if(n||!r||e.timeStamp===this.state.timeStamp)return;const i=Y(e);this.updateSharedState(i);try{const{values:s,origin:o}=Ye(e,this.state._pointerIds,this.transform),a=this.getKinematics(s,e);this.updateGestureState({...H(this,e),...a,origin:o}),this.fireGestureHandler()}catch{this.onPinchEnd(e)}},this.onPinchEnd=e=>{Pa(this.controller,e);const n=Se(e);this.state._pointerIds.every(r=>!n.includes(r))||(this.clean(),this.state._active&&(this.updateGestureState({...H(this,e),...this.getMovement(this.state.values),_active:!1}),this.fireGestureHandler()))},this.onCancel=()=>{this.state.canceled||(this.updateGestureState({_active:!1,canceled:!0}),this.fireGestureHandler())},this.onGestureStart=e=>{if(!this.enabled)return;e.preventDefault();const n=Ze(e,this.transform);this.updateSharedState(Y(e)),this.updateGestureState({...At(this,n,e),...H(this,e,!0),origin:[e.clientX,e.clientY],cancel:this.onCancel}),this.updateGestureState(this.getMovement(n)),this.fireGestureHandler()},this.onGestureChange=e=>{const{canceled:n,_active:r}=this.state;if(n||!r)return;e.preventDefault();const i=Y(e);this.updateSharedState(i);const s=Ze(e,this.transform);s[0]=(s[0]-this.state.event.scale)*al+this.state.values[0];const o=this.getKinematics(s,e);this.updateGestureState({...H(this,e),...o,origin:[e.clientX,e.clientY]}),this.fireGestureHandler()},this.onGestureEnd=e=>{this.clean(),this.state._active&&(this.updateGestureState({...H(this,e),...this.getMovement(this.state.values),_active:!1,origin:[e.clientX,e.clientY]}),this.fireGestureHandler())},this.wheelShouldRun=e=>this.enabled&&e.ctrlKey,this.getWheelValuesFromEvent=e=>{const[,n]=Zn(e,this.transform),{values:[r,i]}=this.state;return{values:[r-n*ol,i!==void 0?i:0],origin:[e.clientX,e.clientY],delta:[0,n]}},this.onWheel=e=>{this.wheelShouldRun(e)&&(this.setTimeout(this.onWheelEnd),this.state._active?this.onWheelChange(e):this.onWheelStart(e))},this.onWheelStart=e=>{const{values:n,delta:r,origin:i}=this.getWheelValuesFromEvent(e);e.cancelable&&e.preventDefault(),this.updateSharedState(Y(e)),this.updateGestureState({...At(this,n,e),...H(this,e,!0),initial:this.state.values,offset:n,delta:r,origin:i}),this.updateGestureState(this.getMovement(n)),this.fireGestureHandler()},this.onWheelChange=e=>{e.cancelable&&e.preventDefault(),this.updateSharedState(Y(e));const{values:n,origin:r,delta:i}=this.getWheelValuesFromEvent(e);this.updateGestureState({...H(this,e),...this.getKinematics(n,e),origin:r,delta:i}),this.fireGestureHandler()},this.onWheelEnd=()=>{this.clean(),this.state._active&&(this.state._active=!1,this.updateGestureState(this.getMovement(this.state.values)),this.fireGestureHandler())}}addBindings(e){this.controller.config.domTarget&&!this.controller.supportsTouchEvents&&this.controller.supportsGestureEvents?(D(e,"onGestureStart",this.onGestureStart),D(e,"onGestureChange",this.onGestureChange),D(e,"onGestureEnd",this.onGestureEnd)):(D(e,"onTouchStart",this.onPinchStart),D(e,"onTouchMove",this.onPinchChange),D(e,"onTouchEnd",this.onPinchEnd),D(e,"onTouchCancel",this.onPinchEnd),D(e,"onWheel",this.onWheel))}}class ul extends qa{constructor(){super(...arguments),this.ingKey="wheeling",this.stateKey="wheel",this.debounced=!0,this.handleEvent=e=>{if(e.ctrlKey&&"pinch"in this.controller.handlers||!this.enabled)return;this.setTimeout(this.onEnd),this.updateSharedState(Y(e));const n=ue(Zn(e,this.transform),this.state.values);if(this.state._active)this.updateGestureState({...H(this,e),...this.getKinematics(n,e)});else{this.updateGestureState({...At(this,n,e),...H(this,e,!0),initial:this.state.values});const r=this.getMovement(n),i=Wa(r.delta);this.updateGestureState(r),this.updateGestureState(i)}this.fireGestureHandler()},this.onEnd=()=>{if(this.clean(),!this.state._active)return;const e=this.getMovement(this.state.values);this.updateGestureState(e),this.updateGestureState({_active:!1,velocities:[0,0],velocity:0}),this.fireGestureHandler()}}addBindings(e){D(e,"onWheel",this.handleEvent)}}function cl(t,e={}){W.set("pinch",ll);const n=C();return n.value||(n.value=ir(nl,sr)),ur({pinch:t},n.value(e))}function fl(t,e={}){W.set("wheel",ul);const n=C();return n.value||(n.value=ir(rl,sr)),ur({wheel:t},n.value(e))}const hl=["onClick"],dl=fe({__name:"AppTree",props:{config:{default:()=>({nodeWidth:Yn,nodeHeight:Un,levelHeight:qn})},linkStyle:{default:Z.CURVE},direction:{default:k.VERTICAL},collapseEnabled:{type:Boolean,default:!0},dataset:{},pinch:{type:Boolean,default:!1}},setup(t,{expose:e}){const n=t,r=g=>typeof g=="number"?`${g}px`:g.includes("px")?g:`${g}px`,i=C(null),s=C([]),o=Ht({});pr(n.dataset,g=>{i.value&&(i.value.updateDataset(n.dataset),s.value=i.value.getNodeDataList())},{deep:!0});const a=C(),u=C(),l=C(),c=()=>{i.value=new Oa({svgElement:a.value,domElement:u.value,treeContainer:l.value,dataset:n.dataset,direction:n.direction,treeConfig:n.config,collapseEnabled:n.collapseEnabled,linkStyle:n.linkStyle}),i.value.init(),s.value=i.value.getNodeDataList(),Object.assign(o,i.value.getInitialTransformStyle())},h=()=>{var g;(g=i.value)==null||g.zoomIn()},f=()=>{var g;(g=i.value)==null||g.zoomOut()},d=()=>{var g;return(g=i.value)==null?void 0:g.currentScale},p=g=>{var b;(b=i.value)==null||b.setScale(g)},_=()=>{var g;(g=i.value)==null||g.setScale(1)},m=g=>{var b,v;(b=i.value)==null||b.onClickNode(g),s.value=((v=i.value)==null?void 0:v.getNodeDataList())||[]};pe(()=>{c()}),gr(()=>{var g;(g=i.value)==null||g.destroy()}),e({update:g=>{var b;return(b=i.value)==null?void 0:b.updateDataset(g)},toggleCollapse:m,zoomIn:h,zoomOut:f,setScale:p,restoreScale:_}),C();const x=({offset:[g,b],pinching:v})=>{console.log("xddd",g),p(Math.max(1+g/1e3,.2))},w=({movement:[g,b],wheeling:v})=>{p(Math.max(d()+b/1e4,.2))};return n.pinch&&(cl(x,{domTarget:l,eventOptions:{passive:!1}}),fl(w,{domTarget:l})),(g,b)=>(I(),z("div",{ref_key:"treeContainerRef",ref:l,class:"tree-container"},[(I(),z("svg",{ref_key:"svgElementRef",ref:a,class:"svg vue-tree",style:Ft(T(o))},null,4)),E("div",{ref_key:"domElementRef",ref:u,class:"dom-container",style:Ft(T(o))},[lt(_r,{name:"tree-node-item",tag:"div"},{default:de(()=>[(I(!0),z(cn,null,fn(T(s),(v,y)=>(I(),z("div",{key:v.data._key,class:"node-slot",style:Ft({left:r(g.direction===T(k).VERTICAL?v.x:v.y),top:r(g.direction===T(k).VERTICAL?v.y:v.x),width:r(g.config.nodeWidth),height:r(g.config.nodeHeight)})},[Qt(g.$slots,"node",{node:v,data:v.data,collapsed:v.data._collapsed,index:y,toggleCollapse:m},()=>[E("span",{onClick:()=>m(y)},G(v.data.value),9,hl)],!0)],4))),128))]),_:3})],4)],512))}}),pl=gn(dl,[["__scopeId","data-v-37513212"]]),gl={xs:500,sm:768,md:1024,lg:1366,xl:1600,xxl:1920},cr=_n(()=>Ht({...gl}));var _l="Expected a function",nn=0/0,ml="[object Symbol]",vl=/^\s+|\s+$/g,yl=/^[-+]0x[0-9a-f]+$/i,xl=/^0b[01]+$/i,wl=/^0o[0-7]+$/i,bl=parseInt,Sl=typeof _t=="object"&&_t&&_t.Object===Object&&_t,El=typeof self=="object"&&self&&self.Object===Object&&self,Tl=Sl||El||Function("return this")(),Al=Object.prototype,kl=Al.toString,Cl=Math.max,$l=Math.min,Zt=function(){return Tl.Date.now()};function Il(t,e,n){var r,i,s,o,a,u,l=0,c=!1,h=!1,f=!0;if(typeof t!="function")throw new TypeError(_l);e=rn(e)||0,ce(n)&&(c=!!n.leading,h="maxWait"in n,s=h?Cl(rn(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f);function d(y){var S=r,A=i;return r=i=void 0,l=y,o=t.apply(A,S),o}function p(y){return l=y,a=setTimeout(x,e),c?d(y):o}function _(y){var S=y-u,A=y-l,O=e-S;return h?$l(O,s-A):O}function m(y){var S=y-u,A=y-l;return u===void 0||S>=e||S<0||h&&A>=s}function x(){var y=Zt();if(m(y))return w(y);a=setTimeout(x,_(y))}function w(y){return a=void 0,f&&r?d(y):(r=i=void 0,o)}function g(){a!==void 0&&clearTimeout(a),l=0,r=u=i=a=void 0}function b(){return a===void 0?o:w(Zt())}function v(){var y=Zt(),S=m(y);if(r=arguments,i=this,u=y,S){if(a===void 0)return p(u);if(h)return a=setTimeout(x,e),d(u)}return a===void 0&&(a=setTimeout(x,e)),o}return v.cancel=g,v.flush=b,v}function ce(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ml(t){return!!t&&typeof t=="object"}function Nl(t){return typeof t=="symbol"||Ml(t)&&kl.call(t)==ml}function rn(t){if(typeof t=="number")return t;if(Nl(t))return nn;if(ce(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ce(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(vl,"");var n=xl.test(t);return n||wl.test(t)?bl(t.slice(2),n?2:8):yl.test(t)?nn:+t}var Rl=Il;const Ol=mr(Rl),Ll=_n(()=>{const t=Ht({width:0,height:0}),e=()=>{({innerWidth:t.width,innerHeight:t.height}=window)},n=Ol(e,200);return pe(()=>window.addEventListener("resize",n)),pn(()=>window.removeEventListener("resize",n)),e(),vr(t)});const Dl={class:"structure-tree__container"},Hl={key:0,class:"structure-tree__node structure-tree__node--main"},Gl=["onClick"],zl={class:"structure-tree__node justify-between overflow-hidden group"},Pl={class:"flex items-center gap-x-4 max-w-full"},Vl={class:"font-semibold overflow-hidden"},Fl={class:"text-[14px] truncate mb-[2px]"},Bl=["onClick"],Xl=fe({__name:"AppStructureTree",props:{orientation:{}},async setup(t){var b;let e,n;const r=t;on(),Ll(),cr();const i=an(),s=ke(()=>({nodeWidth:236,nodeHeight:74,levelHeight:r.orientation===k.VERTICAL?200:300})),o=ke(()=>r.orientation),a=(b=i==null?void 0:i.user)==null?void 0:b.id,u=Ht({}),l=C([]),c=async(v,y=1)=>{const{data:S}=await un(`trees/${v}/unilevel`).json();l.value.push(...S.value.children)},h=v=>new Promise(async(y,S)=>{l.value=[],await c(v);const A=l.value.map(O=>({...O.profile,...O,id:O.id,children:[],childrenFetched:!1}));y(A)}),f=()=>new Promise(async(v,y)=>{var S;try{await i.loadProfile(),console.log({id:i.accountId});const A=i.profile;A.children=await h(i.accountId),A.childrenFetched=!0,v({...A,profile:i.forAvatar,avatar:(S=i.user)==null?void 0:S.avatar})}catch(A){console.log({e:A}),y(A)}});Object.assign(u,([e,n]=ln(()=>f()),e=await e,n(),e));const d=C(),p=(v,y,S)=>{if(v.id===y){v.children=S,v.childrenFetched=!0;return}if(v.children)for(const A of v.children)p(A,y,S)},_=async(v,y)=>{if(!d.value)return;const{data:{id:S,_collapsed:A,childrenFetched:O}}=v;if(typeof A>"u"&&!O){Bt.done(),Bt.start();const Q=await h(S),L=JSON.parse(JSON.stringify(u));p(L,S,Q),d.value.update(L),Object.assign(u,L),Bt.done();return}d.value.toggleCollapse(y)},m=C(!1),x=C(),w=async v=>{x.value=v,m.value=!0},{t:g}=he();return(v,y)=>{const S=sn,A=pl,O=Nr;return I(),z("div",Dl,[(I(),Jt(A,{ref_key:"treeRef",ref:d,key:T(o),pinch:!0,class:"structure-tree max-h-[1000px]",dataset:T(u),config:T(s),"link-style":T(Z).STRAIGHT,direction:T(o),"collapse-enabled":!0},{node:de(({node:Q,data:L,index:fr})=>[L.id===T(a)?(I(),z("div",Hl,[lt(S,{class:"!w-[83px] !h-[100px]",user:L,onClick:jt(()=>w(L),["stop"])},null,8,["user","onClick"])])):(I(),z("div",{key:1,class:"w-full mx-2 sm:relative sm:left-6",onClick:()=>_(Q,fr)},[E("div",zl,[E("div",Pl,[lt(S,{class:"!w-[35px] !h-[42px] flex-shrink-0 uppercase text-md",user:L},null,8,["user"]),E("div",Vl,[E("p",Fl,G(L.nickname),1),E("button",{type:"button",class:"text-[11px] mt-1 text-purple-150 truncate underline font-bold hover:text-black transition-colors",onClick:jt(()=>w(L),["stop"])},G(T(g)("structure.showDetails")),9,Bl)])])])],8,Gl))]),_:1},8,["dataset","config","link-style","direction"])),T(m)?(I(),Jt(O,{key:0,modelValue:T(m),"onUpdate:modelValue":y[0]||(y[0]=Q=>yr(m)?m.value=Q:null),user:T(x),"content-class":"w-full max-w-120 sm:max-w-153",onClose:y[1]||(y[1]=Q=>m.value=!1)},null,8,["modelValue","user"])):dn("",!0)])}}}),Wl=gn(Xl,[["__scopeId","data-v-1a396df1"]]),Kl={class:"!px-0 !pb-0 flex-grow flex flex-col"},Yl={id:"structure-header",class:"px-6 sm:px-12 flex flex-row w-full justify-between"},Ql={__name:"structure",setup(t){const{t:e}=he(),{width:n}=xr(),{sm:r}=cr(),i=C(n.value<r?k.VERTICAL:k.HORIZONTAL),s=function(){i.value=i.value===k.HORIZONTAL?k.VERTICAL:k.HORIZONTAL};return(o,a)=>{const u=Wl;return I(),z("div",null,[E("div",Kl,[E("div",Yl,[E("span",null,G(T(e)("structure.title")),1),E("span",{class:hn(["w-5",{"rotate-270 transform":T(i)===T(k).HORIZONTAL}]),onClick:s},"|",2)])]),lt(u,{orientation:T(i),onScroll:a[0]||(a[0]=jt(()=>{},["prevent"])),class:"block"},null,8,["orientation"])])}}};export{Ql as default};