0?S=3*C:S=7*C,R=r.fontMetrics().denom1):(T>0?(E=r.fontMetrics().num2,S=C):(E=r.fontMetrics().num3,S=3*C),R=r.fontMetrics().denom2);var L;if(v){var M=r.fontMetrics().axisHeight;E-f.depth-(M+.5*T) 0))return[];if(t===r)return[t];let o=r {"use strict";E8n=Math.sqrt(50),S8n=Math.sqrt(10),A8n=Math.sqrt(2);i(ybe,"tickSpec");i(bbe,"ticks");i(Bee,"tickIncrement");i(tz,"tickStep")});function vbe(t,r){let a;if(r===void 0)for(let o of t)o!=null&&(a {"use strict";Kv();i(rRn,"tweenRemove");i(nRn,"tweenFunction");i(OYe,"default");i(dz,"tweenValue")});function ite(t,r){var a;return(typeof r=="number"?dm:r instanceof s4?_N:(a=s4(r))?(r=a,_N):uz)(t,r)}var PYe=ie(()=>{"use strict";lz();hz();i(ite,"default")});function iRn(t){return function(){this.removeAttribute(t)}}function aRn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sRn(t,r,a){var o,l=a+"",h;return function(){var f=this.getAttribute(t);return f===l?null:f===o?h:h=r(o=f,a)}}function oRn(t,r,a){var o,l=a+"",h;return function(){var f=this.getAttributeNS(t.space,t.local);return f===l?null:f===o?h:h=r(o=f,a)}}function lRn(t,r,a){var o,l,h;return function(){var f,p=a(this),m;return p==null?void this.removeAttribute(t):(f=this.getAttribute(t),m=p+"",f===m?null:f===o&&m===l?h:(l=m,h=r(o=f,p)))}}function cRn(t,r,a){var o,l,h;return function(){var f,p=a(this),m;return p==null?void this.removeAttributeNS(t.space,t.local):(f=this.getAttributeNS(t.space,t.local),m=p+"",f===m?null:f===o&&m===l?h:(l=m,h=r(o=f,p)))}}function BYe(t,r){var a=jE(t),o=a==="transform"?DYe:ite;return this.attrTween(t,typeof r=="function"?(a.local?cRn:lRn)(a,o,dz(this,"attr."+t,r)):r==null?(a.local?aRn:iRn)(a):(a.local?oRn:sRn)(a,o,r))}var Nur=ie(()=>{"use strict";hz();i4();nte();PYe();i(iRn,"attrRemove");i(aRn,"attrRemoveNS");i(sRn,"attrConstant");i(oRn,"attrConstantNS");i(lRn,"attrFunction");i(cRn,"attrFunctionNS");i(BYe,"default")});function uRn(t,r){return function(a){this.setAttribute(t,r.call(this,a))}}function hRn(t,r){return function(a){this.setAttributeNS(t.space,t.local,r.call(this,a))}}function fRn(t,r){var a,o;function l(){var h=r.apply(this,arguments);return h!==o&&(a=(o=h)&&hRn(t,h)),a}return i(l,"tween"),l._value=r,l}function dRn(t,r){var a,o;function l(){var h=r.apply(this,arguments);return h!==o&&(a=(o=h)&&uRn(t,h)),a}return i(l,"tween"),l._value=r,l}function FYe(t,r){var a="attr."+t;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;var o=jE(t);return this.tween(a,(o.local?fRn:dRn)(o,r))}var Our=ie(()=>{"use strict";i4();i(uRn,"attrInterpolate");i(hRn,"attrInterpolateNS");i(fRn,"attrTweenNS");i(dRn,"attrTween");i(FYe,"default")});function pRn(t,r){return function(){tte(this,t).delay=+r.apply(this,arguments)}}function gRn(t,r){return r=+r,function(){tte(this,t).delay=r}}function $Ye(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?pRn:gRn)(r,t)):g0(this.node(),r).delay}var Pur=ie(()=>{"use strict";Kv();i(pRn,"delayFunction");i(gRn,"delayConstant");i($Ye,"default")});function mRn(t,r){return function(){o1(this,t).duration=+r.apply(this,arguments)}}function yRn(t,r){return r=+r,function(){o1(this,t).duration=r}}function GYe(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?mRn:yRn)(r,t)):g0(this.node(),r).duration}var Bur=ie(()=>{"use strict";Kv();i(mRn,"durationFunction");i(yRn,"durationConstant");i(GYe,"default")});function bRn(t,r){if(typeof r!="function")throw new Error;return function(){o1(this,t).ease=r}}function jYe(t){var r=this._id;return arguments.length?this.each(bRn(r,t)):g0(this.node(),r).ease}var Fur=ie(()=>{"use strict";Kv();i(bRn,"easeConstant");i(jYe,"default")});function vRn(t,r){return function(){var a=r.apply(this,arguments);if(typeof a!="function")throw new Error;o1(this,t).ease=a}}function zYe(t){if(typeof t!="function")throw new Error;return this.each(vRn(this._id,t))}var $ur=ie(()=>{"use strict";Kv();i(vRn,"easeVarying");i(zYe,"default")});function UYe(t){typeof t!="function"&&(t=nz(t));for(var r=this._groups,a=r.length,o=new Array(a),l=0;l{"use strict";i4();IN();i(UYe,"default")});function VYe(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,a=t._groups,o=r.length,l=a.length,h=Math.min(o,l),f=new Array(o),p=0;p {"use strict";i(kKe,"default")});function CKe(t,r){let a=-1;for(let o of this)if(t.call(r,o,++a,this))return o}var Fhr=ie(()=>{"use strict";i(CKe,"default")});function EKe(t){return this.eachAfter(function(r){for(var a=+t(r.data)||0,o=r.children,l=o&&o.length;--l>=0;)a+=o[l].value;r.value=a})}var $hr=ie(()=>{"use strict";i(EKe,"default")});function SKe(t){return this.eachBefore(function(r){r.children&&r.children.sort(t)})}var Ghr=ie(()=>{"use strict";i(SKe,"default")});function AKe(t){for(var r=this,a=zRn(r,t),o=[r];r!==a;)r=r.parent,o.push(r);for(var l=o.length;t!==a;)o.splice(l,0,t),t=t.parent;return o}function zRn(t,r){if(t===r)return t;var a=t.ancestors(),o=r.ancestors(),l=null;for(t=a.pop(),r=o.pop();t===r;)l=t,t=a.pop(),r=o.pop();return l}var jhr=ie(()=>{"use strict";i(AKe,"default");i(zRn,"leastCommonAncestor")});function RKe(){for(var t=this,r=[t];t=t.parent;)r.push(t);return r}var zhr=ie(()=>{"use strict";i(RKe,"default")});function LKe(){return Array.from(this)}var Uhr=ie(()=>{"use strict";i(LKe,"default")});function DKe(){var t=[];return this.eachBefore(function(r){r.children||t.push(r)}),t}var Vhr=ie(()=>{"use strict";i(DKe,"default")});function _Ke(){var t=this,r=[];return t.each(function(a){a!==t&&r.push({source:a.parent,target:a})}),r}var Hhr=ie(()=>{"use strict";i(_Ke,"default")});function*MKe(){var t=this,r,a=[t],o,l,h;do for(r=a.reverse(),a=[];t=r.pop();)if(yield t,o=t.children)for(l=0,h=o.length;l {"use strict";pve();sXe();jKe();lte();ffr();i(SDn,"date");i(ADn,"number");i(Vfr,"calendar");i(gve,"time")});var qfr=ie(()=>{"use strict";sfr();hfr();BKe();Hfr()});function oXe(t){for(var r=t.length/6|0,a=new Array(r),o=0;o ${this.parser.parseInline(t)} An error occurred: ${t.replace(/\\n|\n/g," ${l.tokens?.map(o).join("")} 2*Math.PI&&(G=0,V=2*Math.PI);let Y=(V-G)/M.curveStepCount,K=[];for(let J=G;J<=V;J+=Y)K.push([I+O*Math.cos(J),F+P*Math.sin(J)]);return K.push([I+O*Math.cos(V),F+P*Math.sin(V)]),K.push([I,F]),Dz([K],M)})(r,a,o,l,h,f,b));return b.stroke!==Uw&&v.push(T),this._d("arc",v,b)}curve(r,a){let o=this._o(a),l=[],h=ygr(r,o);if(o.fill&&o.fill!==Uw)if(o.fillStyle==="solid"){let f=ygr(r,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else{let f=[],p=r;if(p.length){let m=typeof p[0][0]=="number"?[p]:p;for(let b of m)b.length<3?f.push(...b):b.length===3?f.push(...dQe(kgr([b[0],b[0],b[1],b[2]]),10,(1+o.roughness)/2)):f.push(...dQe(kgr(b),10,(1+o.roughness)/2))}f.length&&l.push(Dz([f],o))}return o.stroke!==Uw&&l.push(h),this._d("curve",l,o)}polygon(r,a){let o=this._o(a),l=[],h=y2e(r,!0,o);return o.fill&&(o.fillStyle==="solid"?l.push(fQe([r],o)):l.push(Dz([r],o))),o.stroke!==Uw&&l.push(h),this._d("polygon",l,o)}path(r,a){let o=this._o(a),l=[];if(!r)return this._d("path",l,o);r=(r||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let h=o.fill&&o.fill!=="transparent"&&o.fill!==Uw,f=o.stroke!==Uw,p=!!(o.simplification&&o.simplification<1),m=(function(v,T,C){let E=Egr(Cgr(EQe(v))),S=[],R=[],L=[0,0],_=[],M=i(()=>{_.length>=4&&R.push(...dQe(_,T)),_=[]},"i"),I=i(()=>{M(),R.length&&(S.push(R),R=[])},"c");for(let{key:O,data:P}of E)switch(O){case"M":I(),L=[P[0],P[1]],R.push(L);break;case"L":M(),R.push([P[0],P[1]]);break;case"C":if(!_.length){let G=R.length?R[R.length-1]:L;_.push([G[0],G[1]])}_.push([P[0],P[1]]),_.push([P[2],P[3]]),_.push([P[4],P[5]]);break;case"Z":M(),R.push([L[0],L[1]])}if(I(),!C)return S;let F=[];for(let O of S){let P=wMn(O,C);P.length&&F.push(P)}return F})(r,1,p?4-4*(o.simplification||1):(1+o.roughness)/2),b=vgr(r,o);if(h)if(o.fillStyle==="solid")if(m.length===1){let v=vgr(r,Object.assign(Object.assign({},o),{disableMultiStroke:!0,roughness:o.roughness?o.roughness+o.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(v.ops)})}else l.push(fQe(m,o));else l.push(Dz(m,o));return f&&(p?m.forEach((v=>{l.push(y2e(v,!1,o))})):l.push(b)),this._d("path",l,o)}opsToPath(r,a){let o="";for(let l of r.ops){let h=typeof a=="number"&&a>=0?l.data.map((f=>+f.toFixed(a))):l.data;switch(l.op){case"move":o+=`M${h[0]} ${h[1]} `;break;case"bcurveTo":o+=`C${h[0]} ${h[1]}, ${h[2]} ${h[3]}, ${h[4]} ${h[5]} `;break;case"lineTo":o+=`L${h[0]} ${h[1]} `}}return o.trim()}toPaths(r){let a=r.sets||[],o=r.options||this.defaultOptions,l=[];for(let h of a){let f=null;switch(h.type){case"path":f={d:this.opsToPath(h),stroke:o.stroke,strokeWidth:o.strokeWidth,fill:Uw};break;case"fillPath":f={d:this.opsToPath(h),stroke:Uw,strokeWidth:0,fill:o.fill||Uw};break;case"fillSketch":f=this.fillSketch(h,o)}f&&l.push(f)}return l}fillSketch(r,a){let o=a.fillWeight;return o<0&&(o=a.strokeWidth/2),{d:this.opsToPath(r),stroke:a.fill||Uw,strokeWidth:o,fill:Uw}}_mergedShape(r){return r.filter(((a,o)=>o===0||a.op!=="move"))}},kQe=class{static{i(this,"st")}constructor(r,a){this.canvas=r,this.ctx=this.canvas.getContext("2d"),this.gen=new _z(a)}draw(r){let a=r.sets||[],o=r.options||this.getDefaultOptions(),l=this.ctx,h=r.options.fixedDecimalPlaceDigits;for(let f of a)switch(f.type){case"path":l.save(),l.strokeStyle=o.stroke==="none"?"transparent":o.stroke,l.lineWidth=o.strokeWidth,o.strokeLineDash&&l.setLineDash(o.strokeLineDash),o.strokeLineDashOffset&&(l.lineDashOffset=o.strokeLineDashOffset),this._drawToContext(l,f,h),l.restore();break;case"fillPath":{l.save(),l.fillStyle=o.fill||"";let p=r.shape==="curve"||r.shape==="polygon"||r.shape==="path"?"evenodd":"nonzero";this._drawToContext(l,f,h,p),l.restore();break}case"fillSketch":this.fillSketch(l,f,o)}}fillSketch(r,a,o){let l=o.fillWeight;l<0&&(l=o.strokeWidth/2),r.save(),o.fillLineDash&&r.setLineDash(o.fillLineDash),o.fillLineDashOffset&&(r.lineDashOffset=o.fillLineDashOffset),r.strokeStyle=o.fill||"",r.lineWidth=l,this._drawToContext(r,a,o.fixedDecimalPlaceDigits),r.restore()}_drawToContext(r,a,o,l="nonzero"){r.beginPath();for(let h of a.ops){let f=typeof o=="number"&&o>=0?h.data.map((p=>+p.toFixed(o))):h.data;switch(h.op){case"move":r.moveTo(f[0],f[1]);break;case"bcurveTo":r.bezierCurveTo(f[0],f[1],f[2],f[3],f[4],f[5]);break;case"lineTo":r.lineTo(f[0],f[1])}}a.type==="fillPath"?r.fill(l):r.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(r,a,o,l,h){let f=this.gen.line(r,a,o,l,h);return this.draw(f),f}rectangle(r,a,o,l,h){let f=this.gen.rectangle(r,a,o,l,h);return this.draw(f),f}ellipse(r,a,o,l,h){let f=this.gen.ellipse(r,a,o,l,h);return this.draw(f),f}circle(r,a,o,l){let h=this.gen.circle(r,a,o,l);return this.draw(h),h}linearPath(r,a){let o=this.gen.linearPath(r,a);return this.draw(o),o}polygon(r,a){let o=this.gen.polygon(r,a);return this.draw(o),o}arc(r,a,o,l,h,f,p=!1,m){let b=this.gen.arc(r,a,o,l,h,f,p,m);return this.draw(b),b}curve(r,a){let o=this.gen.curve(r,a);return this.draw(o),o}path(r,a){let o=this.gen.path(r,a);return this.draw(o),o}},m2e="http://www.w3.org/2000/svg",CQe=class{static{i(this,"ot")}constructor(r,a){this.svg=r,this.gen=new _z(a)}draw(r){let a=r.sets||[],o=r.options||this.getDefaultOptions(),l=this.svg.ownerDocument||window.document,h=l.createElementNS(m2e,"g"),f=r.options.fixedDecimalPlaceDigits;for(let p of a){let m=null;switch(p.type){case"path":m=l.createElementNS(m2e,"path"),m.setAttribute("d",this.opsToPath(p,f)),m.setAttribute("stroke",o.stroke),m.setAttribute("stroke-width",o.strokeWidth+""),m.setAttribute("fill","none"),o.strokeLineDash&&m.setAttribute("stroke-dasharray",o.strokeLineDash.join(" ").trim()),o.strokeLineDashOffset&&m.setAttribute("stroke-dashoffset",`${o.strokeLineDashOffset}`);break;case"fillPath":m=l.createElementNS(m2e,"path"),m.setAttribute("d",this.opsToPath(p,f)),m.setAttribute("stroke","none"),m.setAttribute("stroke-width","0"),m.setAttribute("fill",o.fill||""),r.shape!=="curve"&&r.shape!=="polygon"||m.setAttribute("fill-rule","evenodd");break;case"fillSketch":m=this.fillSketch(l,p,o)}m&&h.appendChild(m)}return h}fillSketch(r,a,o){let l=o.fillWeight;l<0&&(l=o.strokeWidth/2);let h=r.createElementNS(m2e,"path");return h.setAttribute("d",this.opsToPath(a,o.fixedDecimalPlaceDigits)),h.setAttribute("stroke",o.fill||""),h.setAttribute("stroke-width",l+""),h.setAttribute("fill","none"),o.fillLineDash&&h.setAttribute("stroke-dasharray",o.fillLineDash.join(" ").trim()),o.fillLineDashOffset&&h.setAttribute("stroke-dashoffset",`${o.fillLineDashOffset}`),h}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(r,a){return this.gen.opsToPath(r,a)}line(r,a,o,l,h){let f=this.gen.line(r,a,o,l,h);return this.draw(f)}rectangle(r,a,o,l,h){let f=this.gen.rectangle(r,a,o,l,h);return this.draw(f)}ellipse(r,a,o,l,h){let f=this.gen.ellipse(r,a,o,l,h);return this.draw(f)}circle(r,a,o,l){let h=this.gen.circle(r,a,o,l);return this.draw(h)}linearPath(r,a){let o=this.gen.linearPath(r,a);return this.draw(o)}polygon(r,a){let o=this.gen.polygon(r,a);return this.draw(o)}arc(r,a,o,l,h,f,p=!1,m){let b=this.gen.arc(r,a,o,l,h,f,p,m);return this.draw(b)}curve(r,a){let o=this.gen.curve(r,a);return this.draw(o)}path(r,a){let o=this.gen.path(r,a);return this.draw(o)}},Kr={canvas:i((t,r)=>new kQe(t,r),"canvas"),svg:i((t,r)=>new CQe(t,r),"svg"),generator:i(t=>new _z(t),"generator"),newSeed:i(()=>_z.newSeed(),"newSeed")}});function Dgr(t,r){let{labelStyles:a}=tn(r);r.labelStyle=a;let o=Nn(r),l=o;o||(l="anchor");let h=t.insert("g").attr("class",l).attr("id",r.domId||r.id),f=1,{cssStyles:p}=r,m=Kr.svg(h),b=nn(r,{fill:"black",stroke:"none",fillStyle:"solid"});r.look!=="handDrawn"&&(b.roughness=0);let v=m.circle(0,0,f*2,b),T=h.insert(()=>v,":first-child");return T.attr("class","anchor").attr("style",Ac(p)),un(r,T),r.intersect=function(C){return Pe.info("Circle intersect",r,f,C),Vr.circle(r,f,C)},h}var _gr=ie(()=>{"use strict";Xn();na();wa();da();ba();Ia();i(Dgr,"anchor")});function Mgr(t,r,a,o,l,h,f){let m=(t+a)/2,b=(r+o)/2,v=Math.atan2(o-r,a-t),T=(a-t)/2,C=(o-r)/2,E=T/l,S=C/h,R=Math.sqrt(E**2+S**2);if(R>1)throw new Error("The given radii are too small to create an arc between the points.");let L=Math.sqrt(1-R**2),_=m+L*h*Math.sin(v)*(f?-1:1),M=b-L*l*Math.cos(v)*(f?-1:1),I=Math.atan2((r-M)/h,(t-_)/l),O=Math.atan2((o-M)/h,(a-_)/l)-I;f&&O<0&&(O+=2*Math.PI),!f&&O>0&&(O-=2*Math.PI);let P=[];for(let G=0;G<20;G++){let V=G/19,Y=I+V*O,K=_+l*Math.cos(Y),J=M+h*Math.sin(Y);P.push({x:K,y:J})}return P}function xMn(t,r,a){let[o,l]=[r,a].sort((h,f)=>f-h);return l*(1-Math.sqrt(1-(t/o/2)**2))}async function Igr(t,r){let{labelStyles:a,nodeStyles:o}=tn(r);r.labelStyle=a;let l=r.padding??0,h=r.look==="neo"?16:l,f=r.look==="neo"?12:l,p=i(Y=>Y+f,"calcTotalHeight"),m=i(Y=>{let K=Y/2;return[K/(2.5+Y/50),K]},"calcEllipseRadius"),{shapeSvg:b,bbox:v}=await In(t,r,Nn(r)),T=p(r?.height?r?.height:v.height),[C,E]=m(T),S=xMn(T,C,E),L=(r?.width?r?.width:v.width)+h*2+S-S,_=T,{cssStyles:M}=r,I=[{x:L/2,y:-_/2},{x:-L/2,y:-_/2},...Mgr(-L/2,-_/2,-L/2,_/2,C,E,!1),{x:L/2,y:_/2},...Mgr(L/2,_/2,L/2,-_/2,C,E,!0)],F=Kr.svg(b),O=nn(r,{});r.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let P=ps(I),G=F.path(P,O),V=b.insert(()=>G,":first-child");return V.attr("class","basic label-container outer-path"),M&&r.look!=="handDrawn"&&V.selectAll("path").attr("style",M),o&&r.look!=="handDrawn"&&V.selectAll("path").attr("style",o),V.attr("transform",`translate(${C/2}, 0)`),un(r,V),r.intersect=function(Y){return Vr.polygon(r,I,Y)},b}var Ngr=ie(()=>{"use strict";na();wa();da();ba();i(Mgr,"generateArcPoints");i(xMn,"calculateArcSagitta");i(Igr,"bowTieRect")});async function Ogr(t,r,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(r);r.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(t,r,Nn(r)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=r.padding??12,v=Math.max(f.width+b*2,r.width??0,80),T=Math.max(Math.min(v*.08,12),5),C=Math.max(f.height+b*2+T,r.height??0),E=-C/2+T,S=C/2,R=v*.72,L=[`M${-v/2},${E}`,`L${-R/2},${S}`,`A${R/2},${T} 0 0 0 ${R/2},${S}`,`L${v/2},${E}`,`A${v/2},${T} 0 0 0 ${-v/2},${E}`,"Z"].join(" "),{cssStyles:_}=r,M=h.insert("g",":first-child").attr("class","basic label-container");if(r.look==="handDrawn"){let V=Kr.svg(h).path(L,nn(r,{}));M.node()?.appendChild(V),_&&M.attr("style",_)}else M.append("path").attr("d",L).attr("style",l);M.append("ellipse").attr("cx",0).attr("cy",E).attr("rx",v/2).attr("ry",T).attr("style",`fill:none;stroke:${m};stroke-width:1px`),un(r,M);let I=E+(S-E)/2;p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${I-f.height/2-(f.y-(f.top??0))})`);let F=12,O=i((G,V,Y)=>Array.from({length:F+1},(K,J)=>{let H=Math.PI-J*Math.PI/F;return{x:G*Math.cos(H),y:V+Y*T*Math.sin(H)}}),"arc"),P=[...O(v/2,E,-1),...O(R/2,S,1).reverse()];return r.intersect=function(G){return Vr.polygon(r,P,G)},h}var Pgr=ie(()=>{"use strict";na();wa();da();ba();i(Ogr,"bucket")});var Md,p4=ie(()=>{"use strict";Md=i((t,r,a,o,l)=>["M",t+l,r,"H",t+a-l,"A",l,l,0,0,1,t+a,r+l,"V",r+o-l,"A",l,l,0,0,1,t+a-l,r+o,"H",t+l,"A",l,l,0,0,1,t,r+o-l,"V",r+l,"A",l,l,0,0,1,t+l,r,"Z"].join(" "),"createRoundedRectPathD")});var ere,TMn,kMn,m0,y0,CMn,Lg,QE,XT,dp,b0=ie(()=>{"use strict";ere=new Set(["redux-color","redux-dark-color"]),TMn=12,kMn=64,m0=i(t=>Array.isArray(t)&&t.length>0,"hasPalette"),y0=i((t,r)=>t!=null&&ere.has(t)&&m0(r),"isColorTheme"),CMn=/^[\w-]+$/,Lg=i(t=>{let r=typeof t=="string"||typeof t=="number"?String(t):"";return CMn.test(r)?r:"classic"},"safeLook"),QE=i(t=>m0(t)?t.length:0,"paletteSlotCount"),XT=i((t,r)=>m0(r)?QE(r):typeof t=="number"&&Number.isInteger(t)&&t>0&&t<=kMn?t:TMn,"colorSlotCount"),dp=i((t,r,a,o)=>{if(r===void 0||!y0(a,o))return;let l=r%QE(o);t.attr("data-color-id",`color-${l}`)},"stampColorSlot")});function AMn(t){let{themeVariables:r}=Zt(),a=r.clusterBkg,o=r.clusterBorder;switch(t){case"flow":return{rx:10,fill:"none",stroke:r.flowContainerStroke||r.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:SMn,fill:a,stroke:o,cssClass:"collapsed-group"}}}async function Bgr(t,r){let a=AMn(r.metadata?.containerType),{fill:o,stroke:l}=a,{nodeStyles:h}=tn(r),{shapeSvg:f,bbox:p}=await In(t,r,Nn(r)),{theme:m,themeVariables:b}=Zt();dp(f,r.colorIndex,m,b.borderColorArray);let v=r.padding??8,T=p.height,C=Math.max(p.width+v*2,EMn,r?.width??0),E=Math.max(T+AQe+SQe+v*2,r?.height??0),S=-C/2,R=-E/2,L=-(AQe+SQe)/2,_=f.select(".label");_&&(r.useHtmlLabels??$h(Zt())?_.attr("transform",`translate(${-p.width/2}, ${-p.height/2+L})`):_.attr("transform",`translate(0, ${-p.height/2+L})`));let M;if(r.look==="handDrawn"){let G=Kr.svg(f),V=nn(r,{fill:o,stroke:l,...a.strokeWidth===void 0?{}:{strokeWidth:a.strokeWidth},...o==="none"?{fillWeight:0}:{fillStyle:"solid"}}),Y=G.path(Md(S,R,C,E,a.rx),V);M=f.insert(()=>Y,":first-child"),M.attr("class","basic label-container "+a.cssClass).attr("style",Ac(r.cssStyles))}else M=f.insert("rect",":first-child"),M.attr("class","basic label-container "+a.cssClass).attr("style",h).attr("rx",a.rx).attr("ry",a.rx).attr("x",S).attr("y",R).attr("width",C).attr("height",E).attr("fill",o).attr("stroke",l),a.strokeWidth!==void 0&&M.attr("stroke-width",a.strokeWidth+"px");let I=R+v+T+AQe;f.append("line").attr("class","collapsed-separator").attr("x1",S+8).attr("y1",I).attr("x2",S+C-8).attr("y2",I).attr("stroke",l).attr("stroke-dasharray","3, 3");let F=I+SQe/2,O=2.5,P=10;for(let G=-1;G<=1;G++)f.append("circle").attr("class","collapsed-indicator").attr("cx",G*P).attr("cy",F).attr("r",O).attr("fill",l);return un(r,M),r.calcIntersect=function(G,V){return Vr.rect(G,V)},r.intersect=function(G){return Vr.rect(r,G)},f}var SQe,AQe,EMn,SMn,Fgr=ie(()=>{"use strict";ma();Qs();na();wa();p4();da();ba();Ia();b0();SQe=20,AQe=8,EMn=80,SMn=8;i(AMn,"getCollapsedStyle");i(Bgr,"collapsedGroup")});function mm(t,r,a,o){return t.insert("polygon",":first-child").attr("points",o.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-r/2+","+a/2+")")}var JE=ie(()=>{"use strict";i(mm,"insertPolygonShape")});async function Ggr(t,r){let a=r,{shapeSvg:o,bbox:l}=await In(t,a,Nn(a)),h=a.padding??0,f=l.height+2*h,p=f/2,m=l.width+2*p+h,b=a.width??0,T=a.positioned&&(a.widthInColumns??1)>1&&b>m?b:m,C=_Mn(a.directions??[],l,a,T),E=mm(o,T,f,C);return E.attr("style",a.style??null),un(a,E),a.intersect=function(S){return Vr.polygon(a,C,S)},o}var RMn,RQe,LMn,DMn,$gr,_Mn,jgr=ie(()=>{"use strict";wa();JE();na();RMn=["right","left","up","down"],RQe="point",LMn=i(t=>{let r=new Set;for(let a of t)switch(a){case"x":r.add("right"),r.add("left");break;case"y":r.add("up"),r.add("down");break;default:r.add(a);break}return r},"expandAndDeduplicateDirections"),DMn=i(t=>RMn.filter(r=>t.has(r)).join("|")||RQe,"getDirectionKey"),$gr={"right|left|up|down":i(({height:t,midpoint:r,padding:a,width:o})=>[{x:0,y:0},{x:r,y:0},{x:o/2,y:2*a},{x:o-r,y:0},{x:o,y:0},{x:o,y:-t/3},{x:o+2*a,y:-t/2},{x:o,y:-2*t/3},{x:o,y:-t},{x:o-r,y:-t},{x:o/2,y:-t-2*a},{x:r,y:-t},{x:0,y:-t},{x:0,y:-2*t/3},{x:-2*a,y:-t/2},{x:0,y:-t/3}],"right|left|up|down"),"right|left|up":i(({height:t,midpoint:r,width:a})=>[{x:r,y:0},{x:a-r,y:0},{x:a,y:-t/2},{x:a-r,y:-t},{x:r,y:-t},{x:0,y:-t/2}],"right|left|up"),"right|left|down":i(({height:t,midpoint:r,width:a})=>[{x:0,y:0},{x:r,y:-t},{x:a-r,y:-t},{x:a,y:0}],"right|left|down"),"right|up|down":i(({height:t,midpoint:r,width:a})=>[{x:0,y:0},{x:a,y:-r},{x:a,y:-t+r},{x:0,y:-t}],"right|up|down"),"left|up|down":i(({height:t,midpoint:r,width:a})=>[{x:a,y:0},{x:0,y:-r},{x:0,y:-t+r},{x:a,y:-t}],"left|up|down"),"right|left":i(({height:t,midpoint:r,padding:a,width:o})=>[{x:r,y:0},{x:r,y:-a},{x:o-r,y:-a},{x:o-r,y:0},{x:o,y:-t/2},{x:o-r,y:-t},{x:o-r,y:-t+a},{x:r,y:-t+a},{x:r,y:-t},{x:0,y:-t/2}],"right|left"),"up|down":i(({height:t,midpoint:r,padding:a,width:o})=>[{x:o/2,y:0},{x:0,y:-a},{x:r,y:-a},{x:r,y:-t+a},{x:0,y:-t+a},{x:o/2,y:-t},{x:o,y:-t+a},{x:o-r,y:-t+a},{x:o-r,y:-a},{x:o,y:-a}],"up|down"),"right|up":i(({height:t,midpoint:r,width:a})=>[{x:0,y:0},{x:a,y:-r},{x:0,y:-t}],"right|up"),"right|down":i(({height:t,width:r})=>[{x:0,y:0},{x:r,y:0},{x:0,y:-t}],"right|down"),"left|up":i(({height:t,midpoint:r,width:a})=>[{x:a,y:0},{x:0,y:-r},{x:a,y:-t}],"left|up"),"left|down":i(({height:t,width:r})=>[{x:r,y:0},{x:0,y:0},{x:r,y:-t}],"left|down"),right:i(({height:t,midpoint:r,padding:a,width:o})=>[{x:r,y:-a},{x:r,y:-a},{x:o-r,y:-a},{x:o-r,y:0},{x:o,y:-t/2},{x:o-r,y:-t},{x:o-r,y:-t+a},{x:r,y:-t+a},{x:r,y:-t+a}],"right"),left:i(({height:t,midpoint:r,padding:a,width:o})=>[{x:r,y:0},{x:r,y:-a},{x:o-r,y:-a},{x:o-r,y:-t+a},{x:r,y:-t+a},{x:r,y:-t},{x:0,y:-t/2}],"left"),up:i(({height:t,midpoint:r,padding:a,width:o})=>[{x:r,y:-a},{x:r,y:-t+a},{x:0,y:-t+a},{x:o/2,y:-t},{x:o,y:-t+a},{x:o-r,y:-t+a},{x:o-r,y:-a}],"up"),down:i(({height:t,midpoint:r,padding:a,width:o})=>[{x:o/2,y:0},{x:0,y:-a},{x:r,y:-a},{x:r,y:-t+a},{x:o-r,y:-t+a},{x:o-r,y:-a},{x:o,y:-a}],"down"),[RQe]:()=>[{x:0,y:0}]},_Mn=i((t,r,a,o)=>{let l=LMn(t),h=(a.padding??0)/2,f=r.height+4*h,p=f/2,m=o??r.width+2*p+2*h,b=DMn(l);return($gr[b]??$gr[RQe])({height:f,midpoint:p,padding:h,width:m})},"getArrowPoints");i(Ggr,"block_arrow")});async function zgr(t,r,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(r);r.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(t,r,Nn(r)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=r.padding??12,v=18,T=12,C=Math.max(f.width+b*2,r.width??0,90),E=Math.max(f.height+b*2+v,r.height??0),S=-E/2,{cssStyles:R}=r,L=h.insert("g",":first-child").attr("class","basic label-container");if(r.look==="handDrawn"){let I=Kr.svg(h).path(Md(-C/2,S,C,E,T),nn(r,{}));L.node()?.appendChild(I),R&&L.attr("style",R)}else L.append("rect").attr("x",-C/2).attr("y",S).attr("width",C).attr("height",E).attr("rx",T).attr("ry",T).attr("style",l);L.append("line").attr("x1",-C/2).attr("y1",S+v).attr("x2",C/2).attr("y2",S+v).attr("style",`stroke:${m};stroke-width:1px`);for(let M=0;M<3;M++)L.append("circle").attr("cx",-C/2+12+M*9).attr("cy",S+v/2).attr("r",2.5).attr("style",`fill:${m};stroke:none`);L.append("rect").attr("class","browser-address-bar").attr("x",-C/2+44).attr("y",S+4).attr("width",Math.max(C-56,10)).attr("height",v-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${m};stroke-width:1px;opacity:0.6`),un(r,L);let _=S+v+(E-v)/2;return p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${_-f.height/2-(f.y-(f.top??0))})`),r.intersect=function(M){return Vr.rect(r,M)},h}var Ugr=ie(()=>{"use strict";na();wa();p4();da();ba();i(zgr,"browser")});async function Vgr(t,r){let{labelStyles:a,nodeStyles:o}=tn(r);r.labelStyle=a;let l=r.padding??0,h=r.look==="neo"?28:l,f=r.look==="neo"?24:l,{shapeSvg:p,bbox:m}=await In(t,r,Nn(r)),b=(r?.width??m.width)+(r.look==="neo"?h*2:h+k2e),v=(r?.height??m.height)+(r.look==="neo"?f*2:f),T=0,C=b,E=-v,S=0,R=[{x:T+k2e,y:E},{x:C,y:E},{x:C,y:S},{x:T,y:S},{x:T,y:E+k2e},{x:T+k2e,y:E}],L,{cssStyles:_}=r;if(r.look==="handDrawn"){let M=Kr.svg(p),I=nn(r,{}),F=ps(R),O=M.path(F,I);L=p.insert(()=>O,":first-child").attr("transform",`translate(${-b/2}, ${v/2})`),_&&L.attr("style",_)}else L=mm(p,b,v,R);return o&&L.attr("style",o),un(r,L),r.intersect=function(M){return Vr.polygon(r,R,M)},p}var k2e,Hgr=ie(()=>{"use strict";na();wa();da();ba();JE();na();k2e=12;i(Vgr,"card")});function qgr(t,r){let{nodeStyles:a}=tn(r);r.label="";let o=t.insert("g").attr("class",Nn(r)).attr("id",r.domId??r.id),{cssStyles:l}=r,h=Math.max(28,r.width??0),f=[{x:0,y:h/2},{x:h/2,y:0},{x:0,y:-h/2},{x:-h/2,y:0}],p=Kr.svg(o),m=nn(r,{});r.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=ps(f),v=p.path(b,m),T=o.insert(()=>v,":first-child");return l&&r.look!=="handDrawn"&&T.selectAll("path").attr("style",l),a&&r.look!=="handDrawn"&&T.selectAll("path").attr("style",a),r.width=28,r.height=28,r.intersect=function(C){return Vr.polygon(r,f,C)},o}var Wgr=ie(()=>{"use strict";wa();ba();da();na();i(qgr,"choice")});async function C2e(t,r,a){let{labelStyles:o,nodeStyles:l}=tn(r);r.labelStyle=o;let{shapeSvg:h,bbox:f,halfPadding:p}=await In(t,r,Nn(r),{ignoreMinWidth:!0}),m=16,b=a?.padding??p,v=Math.sqrt(f.width**2+f.height**2)/2,T=r.look==="neo"?v+m:v+b,C,{cssStyles:E}=r;if(r.look==="handDrawn"){let S=Kr.svg(h),R=nn(r,{}),L=S.circle(0,0,T*2,R);C=h.insert(()=>L,":first-child"),C.attr("class","basic label-container").attr("style",Ac(E))}else C=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",l).attr("r",T).attr("cx",0).attr("cy",0);return un(r,C),r.calcIntersect=function(S,R){let L=S.width/2;return Vr.circle(S,L,R)},r.intersect=function(S){return Pe.info("Circle intersect",r,T,S),Vr.circle(r,T,S)},h}var LQe=ie(()=>{"use strict";ba();Xn();Ia();wa();da();na();i(C2e,"circle")});async function Ygr(t,r){let a=r,o=["node",a.cssClasses,a.class].filter(Boolean).join(" "),{shapeSvg:l,bbox:h,halfPadding:f}=await In(t,a,o),p=l.insert("rect",":first-child"),m=a.padding??0,b=a.positioned?a.width??0:h.width+m,v=a.positioned?a.height??0:h.height+m,T=a.positioned?-b/2:-h.width/2-f,C=a.positioned?-v/2:-h.height/2-f;return p.attr("class","basic cluster composite label-container").attr("style",a.style??null).attr("rx",a.rx??null).attr("ry",a.ry??null).attr("x",T).attr("y",C).attr("width",b).attr("height",v),un(a,p),a.intersect=function(E){return Vr.rect(a,E)},l}var Kgr=ie(()=>{"use strict";wa();na();i(Ygr,"composite")});async function Xgr(t,r,{config:{themeVariables:a}}){let{labelStyles:o,nodeStyles:l}=tn(r);r.labelStyle=o;let{shapeSvg:h,bbox:f,label:p}=await In(t,r,Nn(r)),m=a?.nodeBorder??a?.lineColor??"currentColor",b=r.padding??12,v=20,T=12,C=Math.max(f.width+b*2,r.width??0,90),E=Math.max(f.height+b*2+v,r.height??0),S=-E/2,{cssStyles:R}=r,L=h.insert("g",":first-child").attr("class","basic label-container");if(r.look==="handDrawn"){let I=Kr.svg(h).path(Md(-C/2,S,C,E,T),nn(r,{}));L.node()?.appendChild(I),R&&L.attr("style",R)}else L.append("rect").attr("x",-C/2).attr("y",S).attr("width",C).attr("height",E).attr("rx",T).attr("ry",T).attr("style",l);L.append("text").attr("x",-C/2+12).attr("y",S+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${m}`).text(">_"),un(r,L);let _=S+v+(E-v)/2;return p.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${_-f.height/2-(f.y-(f.top??0))})`),r.intersect=function(M){return Vr.rect(r,M)},h}var Qgr=ie(()=>{"use strict";na();wa();p4();da();ba();i(Xgr,"consoleWindow")});function MMn(t){let r=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),o=t*2,l={x:o/2*r,y:o/2*a},h={x:-(o/2)*r,y:o/2*a},f={x:-(o/2)*r,y:-(o/2)*a},p={x:o/2*r,y:-(o/2)*a};return`M ${h.x},${h.y} L ${p.x},${p.y}
M ${l.x},${l.y} L ${f.x},${f.y}`}function Jgr(t,r){let{labelStyles:a,nodeStyles:o}=tn(r);r.labelStyle=a,r.label="";let l=t.insert("g").attr("class",Nn(r)).attr("id",r.domId??r.id),h=Math.max(30,r?.width??0),{cssStyles:f}=r,p=Kr.svg(l),m=nn(r,{});r.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=p.circle(0,0,h*2,m),v=MMn(h),T=p.path(v,m),C=l.insert(()=>b,":first-child");return C.insert(()=>T),C.attr("class","outer-path"),f&&r.look!=="handDrawn"&&C.selectAll("path").attr("style",f),o&&r.look!=="handDrawn"&&C.selectAll("path").attr("style",o),un(r,C),r.intersect=function(E){return Pe.info("crossedCircle intersect",r,{radius:h,point:E}),Vr.circle(r,h,E)},l}var Zgr=ie(()=>{"use strict";Xn();na();da();ba();wa();i(MMn,"createLine");i(Jgr,"crossedCircle")});function OL(t,r,a,o=100,l=0,h=180){let f=[],p=l*Math.PI/180,v=(h*Math.PI/180-p)/(o-1);for(let T=0;T{var a=new $i("mfrac",[vh(t.numer,r),vh(t.denom,r)]);if(!t.hasBarLine)a.setAttribute("linethickness","0px");else if(t.barSize){var o=_d(t.barSize,r);a.setAttribute("linethickness",Ki(o))}if(t.leftDelim!=null||t.rightDelim!=null){var l=[];if(t.leftDelim!=null){var h=new $i("mo",[new hp(t.leftDelim.replace("\\",""))]);h.setAttribute("fence","true"),l.push(h)}if(l.push(a),t.rightDelim!=null){var f=new $i("mo",[new hp(t.rightDelim.replace("\\",""))]);f.setAttribute("fence","true"),l.push(f)}return Aqe(l)}return a},"mathmlBuilder$3"),Vor=i((t,r)=>{if(!r)return t;var a={type:"styling",mode:t.mode,style:r,body:[t]};return a},"wrapWithStyle");Ta({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:i((t,r)=>{var a=t.parser,o=t.funcName,l=r[0],h=r[1],f,p=null,m=null;switch(o){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":f=!0;break;case"\\\\atopfrac":f=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":f=!1,p="(",m=")";break;case"\\\\bracefrac":f=!1,p="\\{",m="\\}";break;case"\\\\brackfrac":f=!1,p="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}var b=o==="\\cfrac",v=null;return b||o.startsWith("\\d")?v="display":o.startsWith("\\t")&&(v="text"),Vor({type:"genfrac",mode:a.mode,numer:l,denom:h,continued:b,hasBarLine:f,leftDelim:p,rightDelim:m,barSize:null},v)},"handler"),htmlBuilder:rAn,mathmlBuilder:nAn});Ta({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(t){var r=t.parser,a=t.funcName,o=t.token,l;switch(a){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:l,token:o}}});Qsr=["display","text","script","scriptscript"],Jsr=i(function(r){var a=null;return r.length>0&&(a=r,a=a==="."?null:a),a},"delimFromValue");Ta({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(t,r){var a=t.parser,o=r[4],l=r[5],h=Eee(r[0]),f=h.type==="atom"&&h.family==="open"?Jsr(h.text):null,p=Eee(r[1]),m=p.type==="atom"&&p.family==="close"?Jsr(p.text):null,b=Kl(r[2],"size"),v,T=null;b.isBlank?v=!0:(T=b.value,v=T.number>0);var C=null,E=r[3];if(E.type==="ordgroup"){if(E.body.length>0){var S=Kl(E.body[0],"textord");C=Qsr[Number(S.text)]}}else E=Kl(E,"textord"),C=Qsr[Number(E.text)];return Vor({type:"genfrac",mode:a.mode,numer:o,denom:l,continued:!1,hasBarLine:v,barSize:T,leftDelim:f,rightDelim:m},C)}});Ta({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(t,r){var a=t.parser;t.funcName;var o=t.token;return{type:"infix",mode:a.mode,replaceWith:"\\\\abovefrac",size:Kl(r[0],"size").value,token:o}}});Ta({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:i((t,r)=>{var a=t.parser;t.funcName;var o=r[0],l=Kl(r[1],"infix").size;if(!l)throw new Error("\\\\abovefrac expected size, but got "+String(l));var h=r[2],f=l.number>0;return{type:"genfrac",mode:a.mode,numer:o,denom:h,continued:!1,hasBarLine:f,barSize:l,leftDelim:null,rightDelim:null}},"handler")});Hor=i((t,r)=>{var a=r.style,o,l;t.type==="supsub"?(o=t.sup?au(t.sup,r.havingStyle(a.sup()),r):au(t.sub,r.havingStyle(a.sub()),r),l=Kl(t.base,"horizBrace")):l=Kl(t,"horizBrace");var h=au(l.base,r.havingBaseStyle(Wo.DISPLAY)),f=Jye(l,r),p;if(l.isOver?p=wu({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.1},{type:"elem",elem:f,wrapperClasses:["svg-align"]}]}):p=wu({positionType:"bottom",positionData:h.depth+.1+f.height,children:[{type:"elem",elem:f,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:h}]}),o){var m=Ri(["minner",l.isOver?"mover":"munder"],[p],r);l.isOver?p=wu({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:o}]}):p=wu({positionType:"bottom",positionData:m.depth+.2+o.height+o.depth,children:[{type:"elem",elem:o},{type:"kern",size:.2},{type:"elem",elem:m}]})}return Ri(["minner",l.isOver?"mover":"munder"],[p],r)},"htmlBuilder$3"),iAn=i((t,r)=>{var a=Qye(t.label);return new $i(t.isOver?"mover":"munder",[vh(t.base,r),a])},"mathmlBuilder$2");Ta({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(t,r){var a=t.parser,o=t.funcName;return{type:"horizBrace",mode:a.mode,label:o,isOver:o.includes("\\over"),base:r[0]}},htmlBuilder:Hor,mathmlBuilder:iAn});Ta({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:i((t,r)=>{var a=t.parser,o=r[1],l=Kl(r[0],"url").url;return a.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:a.mode,href:l,body:Ag(o)}:a.formatUnsupportedCmd("\\href")},"handler"),htmlBuilder:i((t,r)=>{var a=p0(t.body,r,!1);return s6n(t.href,[],a,r)},"htmlBuilder"),mathmlBuilder:i((t,r)=>{var a=fL(t.body,r);return a instanceof $i||(a=new $i("mrow",[a])),a.setAttribute("href",t.href),a},"mathmlBuilder")});Ta({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:i((t,r)=>{var a=t.parser,o=Kl(r[0],"url").url;if(!a.settings.isTrusted({command:"\\url",url:o}))return a.formatUnsupportedCmd("\\url");for(var l=[],h=0;h
"),"placeholderToBreak"),plr=i(t=>t.replace(TN,"#br#"),"breakToPlaceholder"),Fqe=i(t=>{let r="";return t&&(r=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,r=CSS.escape(r)),r},"getUrl"),DAn=i(function(...t){let r=t.filter(a=>!isNaN(a));return Math.max(...r)},"getMax"),_An=i(function(...t){let r=t.filter(a=>!isNaN(a));return Math.min(...r)},"getMin"),GE=i(function(t){let r=t.split(/(,)/),a=[];for(let o=0;o{"use strict";n4();AWe();ecr();i(W8n,"bindIndex");i(Y8n,"bindKey");i(K8n,"datum");i(LWe,"default");i(X8n,"arraylike")});function DWe(){return new fp(this._exit||this._groups.map(Gee),this._parents)}var rcr=ie(()=>{"use strict";EWe();n4();i(DWe,"default")});function _We(t,r,a){var o=this.enter(),l=this,h=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),a==null?h.remove():a(h),o&&l?o.merge(l).order():l}var ncr=ie(()=>{"use strict";i(_We,"default")});function MWe(t){for(var r=t.selection?t.selection():t,a=this._groups,o=r._groups,l=a.length,h=o.length,f=Math.min(l,h),p=new Array(l),m=0;mW||W>57){q=(W===46?l+J.slice(Z+1):J.slice(Z))+q,J=J.slice(0,Z);break}}}M&&!L&&(J=r(J,1/0));var z=H.length+J.length+q.length,re=z<_?new Array(_-z+1).join(C):"";switch(M&&L&&(J=r(re+J,re.length?_-q.length:1/0),re=""),E){case"<":J=H+J+q+re;break;case"=":J=H+re+J+q;break;case"^":J=re.slice(0,z=re.length>>1)+H+J+q+re.slice(z);break;default:J=re+H+J+q;break}return h(J)}return i(K,"format"),K.toString=function(){return T+""},K}i(b,"newFormat");function v(T,C){var E=b((T=CL(T),T.type="f",T)),S=Math.max(-8,Math.min(8,Math.floor(o4(C)/3)))*3,R=Math.pow(10,-S),L=Ahr[8+S/3];return function(_){return E(R*_)+L}}return i(v,"formatPrefix"),{format:b,formatPrefix:v}}var Shr,Ahr,Rhr=ie(()=>{"use strict";ste();whr();xhr();hKe();Thr();Chr();gKe();Ehr();Shr=Array.prototype.map,Ahr=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];i(yKe,"default")});function bKe(t){return Zbe=yKe(t),VE=Zbe.format,eve=Zbe.formatPrefix,Zbe}var Zbe,VE,eve,Lhr=ie(()=>{"use strict";Rhr();bKe({thousands:",",grouping:[3],currency:["$",""]});i(bKe,"defaultLocale")});function tve(t){return Math.max(0,-o4(Math.abs(t)))}var Dhr=ie(()=>{"use strict";ste();i(tve,"default")});function rve(t,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(o4(r)/3)))*3-o4(Math.abs(t)))}var _hr=ie(()=>{"use strict";ste();i(rve,"default")});function nve(t,r){return t=Math.abs(t),r=Math.abs(r)-t,Math.max(0,o4(r)-o4(t))+1}var Mhr=ie(()=>{"use strict";ste();i(nve,"default")});var vKe=ie(()=>{"use strict";Lhr();hKe();Dhr();_hr();Mhr()});var Ihr=ie(()=>{"use strict"});function jRn(t){var r=0,a=t.children,o=a&&a.length;if(!o)r=1;else for(;--o>=0;)r+=a[o].value;t.value=r}function wKe(){return this.eachAfter(jRn)}var Nhr=ie(()=>{"use strict";i(jRn,"count");i(wKe,"default")});function xKe(t,r){let a=-1;for(let o of this)t.call(r,o,++a,this);return this}var Ohr=ie(()=>{"use strict";i(xKe,"default")});function TKe(t,r){for(var a=this,o=[a],l,h,f=-1;a=o.pop();)if(t.call(r,a,++f,this),l=a.children)for(h=l.length-1;h>=0;--h)o.push(l[h]);return this}var Phr=ie(()=>{"use strict";i(TKe,"default")});function kKe(t,r){for(var a=this,o=[a],l=[],h,f,p,m=-1;a=o.pop();)if(l.push(a),h=a.children)for(f=0,p=h.length;f
{"use strict";Jhr();Zhr();YRn=(1+Math.sqrt(5))/2;i(KRn,"squarifyRatio");efr=i((function t(r){function a(o,l,h,f,p){KRn(r,o,l,h,f,p)}return i(a,"squarify"),a.ratio=function(o){return t((o=+o)>1?o:1)},a}),"custom")(YRn)});function ive(){var t=efr,r=!1,a=1,o=1,l=[0],h=gz,f=gz,p=gz,m=gz,b=gz;function v(C){return C.x0=C.y0=0,C.x1=a,C.y1=o,C.eachBefore(T),l=[0],r&&C.eachBefore(IKe),C}i(v,"treemap");function T(C){var E=l[C.depth],S=C.x0+E,R=C.y0+E,L=C.x1-E,_=C.y1-E;L{"use strict";Qhr();tfr();Khr();Xhr();i(ive,"default")});var nfr=ie(()=>{"use strict";Whr();rfr()});var ifr=ie(()=>{"use strict"});var afr=ie(()=>{"use strict"});function EL(t,r){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(r).domain(t);break}return this}var lte=ie(()=>{"use strict";i(EL,"initRange")});function Bw(){var t=new ez,r=[],a=[],o=PKe;function l(h){let f=t.get(h);if(f===void 0){if(o!==PKe)return o;t.set(h,f=r.push(h)-1)}return a[f%a.length]}return i(l,"scale"),l.domain=function(h){if(!arguments.length)return r.slice();r=[],t=new ez;for(let f of h)t.has(f)||t.set(f,r.push(f)-1);return l},l.range=function(h){return arguments.length?(a=Array.from(h),l):a.slice()},l.unknown=function(h){return arguments.length?(o=h,l):o},l.copy=function(){return Bw(r,a).unknown(o)},EL.apply(l,arguments),l}var PKe,BKe=ie(()=>{"use strict";bL();lte();PKe=Symbol("implicit");i(Bw,"ordinal")});function mz(){var t=Bw().unknown(void 0),r=t.domain,a=t.range,o=0,l=1,h,f,p=!1,m=0,b=0,v=.5;delete t.unknown;function T(){var C=r().length,E=l
"},a),Wn.hasBreaks(t)))return t;let o=t.split(" ").filter(Boolean),l=[],h="";return o.forEach((f,p)=>{let m=c1(`${f} `,a),b=c1(h,a);if(m>r){let{hyphenatedStrings:C,remainingWord:E}=o_n(f,r,"-",a);l.push(h,...C),h=E}else b+m>=r?(l.push(h),h=f):h=[h,f].filter(Boolean).join(" ");p+1===o.length&&l.push(h)}),l.filter(f=>f!=="").join(a.joinWith)},(t,r,a)=>`${t}${r}${a.fontSize}${a.fontWeight}${a.fontFamily}${a.joinWith}`),o_n=QN((t,r,a="-",o)=>{o=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},o);let l=[...t],h=[],f="";return l.forEach((p,m)=>{let b=`${f}${p}`;if(c1(b,o)>=r){let T=m+1,C=l.length===T,E=`${b}${a}`;h.push(C?b:E),f=""}else f=b}),{hyphenatedStrings:h,remainingWord:f}},(t,r,a="-",o)=>`${t}${r}${a}${o.fontSize}${o.fontWeight}${o.fontFamily}`);i(r2e,"calculateTextHeight");i(c1,"calculateTextWidth");Ute=QN((t,r)=>{let{fontSize:a=12,fontFamily:o="Arial",fontWeight:l=400}=r;if(!t)return{width:0,height:0};let[,h]=Tb(a),f=["sans-serif",o],p=t.split(Wn.lineBreakRegex),m=[],b=dn("body");if(!b.remove)return{width:0,height:0,lineHeight:0};let v=b.append("svg");for(let C of f){let E=0,S={width:0,height:0,lineHeight:0};for(let R of p){let L=a_n();L.text=R||BXe;let _=s_n(v,L).style("font-size",h).style("font-weight",l).style("font-family",C),M=(_._groups||_)[0][0].getBBox();if(M.width===0&&M.height===0)throw new Error("svg element not in render tree");S.width=Math.round(Math.max(S.width,M.width)),E=Math.round(M.height),S.height+=E,S.lineHeight=Math.round(Math.max(S.lineHeight,E))}m.push(S)}v.remove();let T=isNaN(m[1].height)||isNaN(m[1].width)||isNaN(m[1].lineHeight)||m[0].height>m[1].height&&m[0].width>m[1].width&&m[0].lineHeight>m[1].lineHeight?0:1;return m[T]},(t,r)=>`${t}${r.fontSize}${r.fontWeight}${r.fontFamily}`),PXe=class{constructor(r=!1,a){this.count=0;this.count=a?a.length:0,this.next=r?()=>this.count++:()=>Date.now()}static{i(this,"InitIDGenerator")}},l_n=i(function(t){return t2e=t2e||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),t2e.innerHTML=t,unescape(t2e.textContent)},"entityDecode");i(UXe,"isDetailedError");i(bpr,"getErrorMessage");c_n=i((t,r,a,o)=>{if(!o)return;let l=t.node()?.getBBox();l&&t.append("text").text(o).attr("text-anchor","middle").attr("x",l.x+l.width/2).attr("y",-a).attr("class",r)},"insertTitle"),Tb=i(t=>{if(typeof t=="number")return[t,t+"px"];let r=parseInt(t??"",10);return Number.isNaN(r)?[void 0,void 0]:t===String(r)?[r,t+"px"]:[r,t]},"parseFontSize");i(nl,"cleanAndMerge");Ya={assignWithDepth:Fh,wrapLabel:JN,calculateTextHeight:r2e,calculateTextWidth:c1,calculateTextDimensions:Ute,cleanAndMerge:nl,detectInit:XDn,detectDirective:gpr,isSubstringInArray:QDn,interpolateToCurve:FXe,calcLabelPosition:t_n,calcCardinalityPosition:r_n,calcTerminalLabelPosition:n_n,formatUrl:JDn,getStylesFromArray:GXe,generateId:jXe,random:zXe,runFunc:ZDn,entityDecode:l_n,insertTitle:c_n,isLabelCoordinateInPath:u_n,parseFontSize:Tb,InitIDGenerator:PXe},vpr=i(function(t){let r=t;return r=r.replace(/style.*:\S*#.*;/g,function(a){return a.substring(0,a.length-1)}),r=r.replace(/classDef.*:\S*#.*;/g,function(a){return a.substring(0,a.length-1)}),r=r.replace(/#\w+;/g,function(a){let o=a.substring(1,a.length-1);return/^\+?\d+$/.test(o)?"\uFB02\xB0\xB0"+o+"\xB6\xDF":"\uFB02\xB0"+o+"\xB6\xDF"}),r},"encodeEntities"),Xv=i(function(t){return t.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Qv=i((t,r,{counter:a=0,prefix:o,suffix:l},h)=>h||`${o?`${o}_`:""}${t}_${r}_${a}${l?`_${l}`:""}`,"getEdgeId");i(Ac,"handleUndefinedAttr");i(u_n,"isLabelCoordinateInPath")});var wpr,xpr=ie(()=>{"use strict";Yo();wpr=i((t,r)=>{if(r==="sandbox"){let o=dn("#i"+t).node()?.contentDocument;if(!o)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:dn(o.body),doc:o}}return{root:dn("body"),doc:document}},"getDiagramRoot")});var npa,Lz=ie(()=>{"use strict";npa=typeof performance<"u"&&typeof performance.now=="function";globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"}});function WXe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Apr(t){eO=t}function $u(t,r=""){let a=typeof t=="string"?t:t.source,o={replace:i((l,h)=>{let f=typeof h=="string"?h:h.source;return f=f.replace(kb.caret,"$1"),a=a.replace(l,f),o},"replace"),getRegex:i(()=>new RegExp(a,r),"getRegex")};return o}function KE(t,r){if(r){if(kb.escapeTest.test(t))return t.replace(kb.escapeReplace,kpr)}else if(kb.escapeTestNoEncode.test(t))return t.replace(kb.escapeReplaceNoEncode,kpr);return t}function Cpr(t){try{t=encodeURI(t).replace(kb.percentDecode,"%")}catch{return null}return t}function Epr(t,r){let a=t.replace(kb.findPipe,(h,f,p)=>{let m=!1,b=f;for(;--b>=0&&p[b]==="\\";)m=!m;return m?"|":" |"}),o=a.split(kb.splitPipe),l=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length
`:"'+(a?l:KE(l,!0))+`
`}blockquote({tokens:t}){return`"+(a?l:KE(l,!0))+`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`
`}list(t){let r=t.ordered,a=t.start,o="";for(let f=0;f
`+r+`
`+o+`
`}tablerow({text:t}){return`
${t}
`}tablecell(t){let r=this.parser.parseInline(t.tokens),a=t.header?"th":"td";return(t.align?`<${a} align="${t.align}">`:`<${a}>`)+r+`${a}>
`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${KE(t,!0)}`}br(t){return"
"}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:a}){let o=this.parser.parseInline(a),l=Cpr(t);if(l===null)return o;t=l;let h='"+o+"",h}image({href:t,title:r,text:a,tokens:o}){o&&(a=this.parser.parseInline(o,this.parser.textRenderer));let l=Cpr(t);if(l===null)return KE(a);t=l;let h=`",h}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:KE(t.text)}},tQe=class{static{i(this,"$")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},cA=class qXe{static{i(this,"l")}options;renderer;textRenderer;constructor(r){this.options=r||eO,this.options.renderer=this.options.renderer||new s2e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tQe}static parse(r,a){return new qXe(a).parse(r)}static parseInline(r,a){return new qXe(a).parseInline(r)}parse(r,a=!0){let o="";for(let l=0;l
"+KE(a.message+"",!0)+"
";return r?Promise.resolve(o):o}if(r)return Promise.reject(a);throw a}}},ZN=new q_n;i(Tu,"d");Tu.options=Tu.setOptions=function(t){return ZN.setOptions(t),Tu.defaults=ZN.defaults,Apr(Tu.defaults),Tu};Tu.getDefaults=WXe;Tu.defaults=eO;Tu.use=function(...t){return ZN.use(...t),Tu.defaults=ZN.defaults,Apr(Tu.defaults),Tu};Tu.walkTokens=function(t,r){return ZN.walkTokens(t,r)};Tu.parseInline=ZN.parseInline;Tu.Parser=cA;Tu.parser=cA.parse;Tu.Renderer=s2e;Tu.TextRenderer=tQe;Tu.Lexer=lA;Tu.lexer=lA.lex;Tu.Tokenizer=a2e;Tu.Hooks=qte;Tu.parse=Tu;spa=Tu.options,opa=Tu.setOptions,lpa=Tu.use,cpa=Tu.walkTokens,upa=Tu.parseInline,hpa=cA.parse,fpa=lA.lex});function W_n(t,{markdownAutoWrap:r}){let o=t.replace(/
/g,`
`).replace(/\n{2,}/g,`
`);return obe(o)}function $pr(t){return t.split(/\\n|\n|
/gi).map(r=>r.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(a=>({content:a,type:"normal"}))??[])}function c2e(t,r={}){let a=W_n(t,r),o=Tu.lexer(a),l=[[]],h=0;function f(p,m="normal"){p.type==="text"?p.text.split(`
`).forEach((v,T)=>{T!==0&&(h++,l.push([])),v.split(" ").forEach(C=>{C=C.replace(/'/g,"'"),C&&l[h].push({content:C,type:m})})}):p.type==="strong"||p.type==="em"?p.tokens.forEach(b=>{f(b,p.type)}):p.type==="html"&&l[h].push({content:p.text,type:"normal"})}return i(f,"processNode"),o.forEach(p=>{p.type==="paragraph"?p.tokens?.forEach(m=>{f(m)}):p.type==="html"?l[h].push({content:p.text,type:"normal"}):l[h].push({content:p.raw,type:"normal"})}),l}function Gpr(t){return t?`
")}
").replace(/ /g," "):l.text.replace(/\n */g,"
"):l.type==="strong"?`${l.tokens?.map(o).join("")}`:l.type==="em"?`${l.tokens?.map(o).join("")}`:l.type==="paragraph"?`
/g,"
")),E=f?c2e(C.replace("
","
"),T):$pr(C),S=Z_n(m,t,E,r?v:!1,!p);if(p){/stroke:/.exec(a)&&(a=a.replace("stroke:","lineColor:"));let R=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");dn(S).attr("style",R)}else{let R=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");dn(S).select("rect").attr("style",R.replace(/background:/g,"fill:"));let L=a.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");dn(S).select("text").attr("style",L)}return o?dn(S).selectAll("tspan.text-outer-tspan").classed("title-row",!0):dn(S).selectAll("tspan.text-outer-tspan").classed("row",!0),S}},"createText")});async function h2e(t){let r=t.getElementsByTagName("img");if(!r||r.length===0)return;let a=!tgr(t);await Promise.all([...r].map(o=>new Promise(l=>{function h(){if(o.style.display="flex",o.style.flexDirection="column",a){let f=Zt().fontSize?Zt().fontSize:window.getComputedStyle(document.body).fontSize,p=5,[m=hs.fontSize]=Tb(f),b=m*p+"px";o.style.minWidth=b,o.style.maxWidth=b}else o.style.width="100%";l(o)}i(h,"setupImage"),setTimeout(()=>{o.complete&&h()}),o.addEventListener("error",h),o.addEventListener("load",h)})))}function tgr(t){return t.nodeType===rMn?t.textContent?.trim()!=="":t.nodeType!==tMn||t.tagName.toLowerCase()==="img"?!1:[...t.childNodes].some(tgr)}var tMn,rMn,sQe=ie(()=>{"use strict";ma();up();Ia();tMn=1,rMn=3;i(h2e,"configureLabelImages");i(tgr,"hasTextBesidesImages")});var rgr,nMn,ngr,igr=ie(()=>{"use strict";Yo();jw();ma();rl();Ia();rgr=3,nMn=32,ngr=i(async(t,r,a)=>{let o=Zt(),l=t.insert("g").attr("class",a??"node default").attr("id",r.domId||r.id),h=l.insert("g").attr("class","label").attr("style",Ac(r.labelStyle)),p=[{text:typeof r.label=="string"?r.label:r.label?.[0]??"",cssClass:"c4-name"},{text:r.stereotype,cssClass:"c4-type"},...(r.description??[]).map(_=>({text:_,cssClass:"c4-descr"}))].filter(_=>_.text),m=r.width?Math.max(r.width-2*(r.padding??0),nMn):Zt().flowchart?.wrappingWidth??200,v=o.c4?.wrap??!0?m:Number.POSITIVE_INFINITY,T=await Promise.all(p.map(async _=>{let M=h.append("g").attr("class",_.cssClass),I=await zh(M,Ns(Xv(_.text??""),o),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:v,style:r.labelStyle},o);return dn(I).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),dn(I).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:M,box:M.node().getBBox()}})),C=Math.max(...T.map(({box:_})=>_.width),0),E=0;for(let{el:_,box:M}of T)_.attr("transform",`translate(${C/2-M.x-M.width/2}, ${E-M.y})`),E+=M.height+rgr;let S=T.length>0?E-rgr:0;h.insert("rect",":first-child"),h.attr("transform",`translate(${-C/2}, ${-S/2})`);let R=h.node().getBBox(),L=(r.padding??0)/2;return{shapeSvg:l,bbox:R,halfPadding:L,label:h}},"c4LabelHelper")});function ps(t){let r=t.map((a,o)=>`${o===0?"M":"L"}${a.x},${a.y}`);return r.push("Z"),r.join(" ")}function YT(t,r,a,o,l,h){let f=[],m=a-t,b=o-r,v=m/h,T=2*Math.PI/v,C=r+b/2;for(let E=0;E<=50;E++){let S=E/50,R=t+S*m,L=C+l*Math.sin(T*(R-t));f.push({x:R,y:L})}return f}function zw(t,r,a,o,l,h){let f=[],p=l*Math.PI/180,v=(h*Math.PI/180-p)/(o-1);for(let T=0;T
"):C,r.labelStyle,!0,!0),R=S.children[0],L=dn(S);T=R.getBoundingClientRect(),L.attr("width",T.width),L.attr("height",T.height);let _=(r.padding||0)/2;dn(S).attr("transform","translate( "+(T.width>E.width?0:(E.width-T.width)/2)+", "+(E.height+_+5)+")"),dn(v).attr("transform","translate( "+(T.width
").length,T.innerHTML.includes("")&&(v+=T.innerHTML.split("