Ad&&a?(y=u*u+h*h,i=(n=n-s)*n+(s=i-l)*s,l=Math.sqrt(y),b=Math.sqrt(p),p=(y=a*Math.tan((H_-Math.acos((y+p-i)/(2*l*b)))/2))/b,i=y/l,Math.abs(p-1)>Ad&&this._append`L${e+p*f},${r+p*d}`,this._append`A${a},${a},0,0,${+(f*s {MY(),IY(),r6e=(1+Math.sqrt(5))/2,o(n6e,"squarifyRatio"),OY=o(function t(e){function r(n,i,a,s,l){n6e(e,n,i,a,s,l)}return o(r,"squarify"),r.ratio=function(n){return t(1<(n=+n)?n:1)},r},"custom")(r6e)});function R5(){var t=OY,e=!1,r=1,n=1,i=[0],a=H0,s=H0,l=H0,u=H0,h=H0;function f(p){return p.x0=p.y0=0,p.x1=r,p.y1=n,p.eachBefore(d),i=[0],e&&p.eachBefore(vD),p}function d(p){var m=i[p.depth],g=p.x0+m,y=p.y0+m,v=p.x1-m,x=p.y1-m;v{Ch(),CD(),Mv(),qY(),o(l6e,"linearish"),o(Tl,"linear")});function _D(t,e){var s,r=0,n=(t=t.slice()).length-1,i=t[r],a=t[n];return a{o(_D,"nice")});function En(t,e,r,n){function i(a){return t(a=0===arguments.length?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{var s=i(a),l=i.ceil(a);return a-sEn(s=>{if(s<=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s<=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;0<=--l;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(DD.setTime(+a),LD.setTime(+s),t(DD),t(LD),Math.floor(r(DD,LD))),i.every=a=>(a=Math.floor(a),isFinite(a)&&0n(s)%a==0:s=>i.count(0,s)%a==0):i:null)),i}var DD,LD,uc,io,ku,M5,Eu,I5,Ro,Pv,O5,wu=N(()=>{DD=new Date,LD=new Date,o(En,"timeInterval")}),RD=N(()=>{wu(),(uc=En(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t)).every=t=>(t=Math.floor(t),isFinite(t)&&0{Ch(),RD(),ND(),MD(),ID(),OD(),PD(),BD(),FD(),o(iX,"ticker"),[M6e,I6e]=iX(kl,z5,Od,O5,I5,M5),[$D,zD]=iX(ao,Su,wl,Ro,Eu,ku)}),G5=N(()=>{RD(),ND(),MD(),ID(),OD(),PD(),BD(),FD(),aX()});function GD(t){var e;return 0<=t.y&&t.y<100?((e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L)).setFullYear(t.y),e):new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VD(t){var e;return 0<=t.y&&t.y<100?((e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L))).setUTCFullYear(t.y),e):new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Bv(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function UD(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=Fv(i),f=$v(i),d=Fv(a),p=$v(a),m=Fv(s),g=$v(s),y=Fv(l),v=$v(l),x=Fv(u),b=$v(u),T={a:P,A:B,b:F,B:G,c:null,d:hX,e:hX,f:nCe,g:dCe,G:mCe,H:eCe,I:tCe,j:rCe,L:gX,m:iCe,M:aCe,p:$,q:U,Q:pX,s:mX,S:sCe,u:oCe,U:lCe,V:cCe,w:uCe,W:hCe,x:null,X:null,y:fCe,Y:pCe,Z:gCe,"%":dX},S={a:j,A:te,b:Y,B:oe,c:null,d:fX,e:fX,f:bCe,g:LCe,G:NCe,H:yCe,I:vCe,j:xCe,L:vX,m:TCe,M:wCe,p:J,q:ue,Q:pX,s:mX,S:kCe,u:ECe,U:SCe,V:CCe,w:ACe,W:_Ce,x:null,X:null,y:DCe,Y:RCe,Z:MCe,"%":dX},w={a:I,A:L,b:E,B:D,c:_,d:cX,e:cX,f:K6e,g:lX,G:oX,H:uX,I:uX,j:W6e,L:j6e,m:q6e,M:Y6e,p:R,q:H6e,Q:Z6e,s:J6e,S:X6e,u:$6e,U:z6e,V:G6e,w:F6e,W:V6e,x:O,X:M,y:lX,Y:oX,Z:U6e,"%":Q6e};function k(re,ee){return function(Z){var ne,Te,q,K=[],ae=-1,Q=0,de=re.length;for(Z instanceof Date||(Z=new Date(+Z));++ae{ym(),lm(),o(B8e,"copyObject"),$o=B8e});function F8e(t,e){for(var r=-1,n=Array(t);++r
"},r),tt.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{var p,m,u=Zi(s+" ",r),h=Zi(a,r);a=e""!==s).join(r.joinWith)},(t,e,r)=>""+t+e+r.fontSize+r.fontWeight+r.fontFamily+r.joinWith),S_e=am((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{var m,l=""+s+l;s=Zi(l,n)>=e?(u=u+1,u=i.length===u,m=l+r,a.push(u?l:m),""):l}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>""+t+e+r+n.fontSize+n.fontWeight+n.fontFamily),o(DT,"calculateTextHeight"),o(Zi,"calculateTextWidth"),HL=am((t,e)=>{var{fontSize:e=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};var[,a]=vc(e),e=["sans-serif",n],l=t.split(tt.lineBreakRegex),u=[],n=qe("body");if(!n.remove)return{width:0,height:0,lineHeight:0};var p,f=n.append("svg");for(p of e){var y,g={width:0,height:0,lineHeight:0};for(y of l){var v=k_e(),v=(v.text=y||BL,E_e(f,v).style("font-size",a).style("font-weight",i).style("font-family",p)),v=(v._groups||v)[0][0].getBBox();if(0===v.width&&0===v.height)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,v.width)),v=Math.round(v.height),g.height+=v,g.lineHeight=Math.round(Math.max(g.lineHeight,v))}u.push(g)}return f.remove(),u[isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1]},(t,e)=>""+t+e.fontSize+e.fontWeight+e.fontFamily),PL=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},C_e=o(function(t){return _T=_T||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),_T.innerHTML=t,unescape(_T.textContent)},"entityDecode"),o(qL,"isDetailedError"),A_e=o((t,e,r,n)=>{var i;n&&(i=t.node()?.getBBox())&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),vc=o(t=>{var e;return"number"==typeof t?[t,t+"px"]:(e=parseInt(t??"",10),Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t])},"parseFontSize"),o(Vn,"cleanAndMerge"),qt={assignWithDepth:Rn,wrapLabel:UL,calculateTextHeight:DT,calculateTextWidth:Zi,calculateTextDimensions:HL,cleanAndMerge:Vn,detectInit:p_e,detectDirective:xQ,isSubstringInArray:m_e,interpolateToCurve:FL,calcLabelPosition:x_e,calcCardinalityPosition:b_e,calcTerminalLabelPosition:T_e,formatUrl:g_e,getStylesFromArray:zL,generateId:GL,random:VL,runFunc:y_e,entityDecode:C_e,insertTitle:A_e,isLabelCoordinateInPath:__e,parseFontSize:vc,InitIDGenerator:PL},wQ=o(function(t){let e=t;return e=(e=(e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)})).replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)})).replace(/#\w+;/g,function(r){r=r.substring(1,r.length-1);return/^\+?\d+$/.test(r)?"fl°°"+r+"¶ß":"fl°"+r+"¶ß"})},"encodeEntities"),Ji=o(function(t){return t.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),xc=o((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||(n?n+"_":"")+t+`_${e}_`+r+(i?"_"+i:""),"getEdgeId"),o(Cn,"handleUndefinedAttr"),o(__e,"isLabelCoordinateInPath")});function Ll(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=UL(e[t].text,i,n),e[t].textLines=e[t].text.split(tt.lineBreakRegex).length,e[t].width=i,e[t].height=DT(e[t].text,n);else{var s,l,r=e[t].text.split(tt.lineBreakRegex);e[t].textLines=r.length;e[t].height=0,e[t].width=0;for(l of r)e[t].width=Math.max(Zi(l,n),e[t].width),s=DT(l,n),e[t].height=e[t].height+s}}function AQ(t,e,r,n,i){var s,l,a=new MT(i);a.data.widthLimit=r.data.widthLimit/Math.min(WL,n.length);for([s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);var h=l.wrap&&Wt.wrap,f=LT(Wt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",Ll("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&""!==l.type.text&&(l.type.text="["+l.type.text+"]",f=LT(Wt),Ll("type",l,h,f,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height),l.descr&&""!==l.descr.text){let g=LT(Wt);g.fontSize=g.fontSize-2,Ll("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(0==s||s%WL==0){let g=r.data.startx+Wt.diagramMarginX,y=r.data.stopy+Wt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Wt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;f=i.db.getC4ShapeArray(l.alias),h=i.db.getC4ShapeKeys(l.alias),f=(0