27 lines
16 KiB
JavaScript
27 lines
16 KiB
JavaScript
/*! third party licenses: js/vendor.LICENSE.txt */
|
|
import{_ as w,C as ee,D as te,G as ie,d as ce,l as X,ah as B,b as de,a as pe,p as he,q as ue,g as fe,s as me,E as ye,ai as ge,y as xe}from"./NcSelect-DXLJbwym.chunk.mjs";import{s as Se}from"./chunk-QN33PNHL-BuaC_Ajj.chunk.mjs";import{p as ve}from"./chunk-4BX2VUAB-CRQkbnhe.chunk.mjs";import{p as Ce}from"./treemap-KMMF4GRG-BMzvQTWV.chunk.mjs";import{s as K}from"./isEmpty-nTVdZyYD.chunk.mjs";import{b as V}from"./defaultLocale-slEEJlip.chunk.mjs";import{o as U}from"./ordinal-Bt1svyuw.chunk.mjs";import"./whiteboard-main.mjs";import"./index-Anv74-sp.chunk.mjs";import"./vendor-BeFBwUwf.chunk.mjs";import"./index-C0mkXnFg.chunk.mjs";import"./index-Bn0s6V7w.chunk.mjs";import"./index-vg7q3Iku.chunk.mjs";import"./translation-DoG5ZELJ-DKBzIEvm.chunk.mjs";import"./percentages-BXMCSKIN-Cw9SI0WV.chunk.mjs";import"./useJwtStore-B1DPLYgs.chunk.mjs";import"./_plugin-vue2_normalizer-CBCAj2XU.chunk.mjs";import"./line-2ECJkxIB.chunk.mjs";import"./array-Cg_lHFoG.chunk.mjs";import"./path-i7Zvihw6.chunk.mjs";import"./_baseUniq-CE6homwJ.chunk.mjs";import"./_basePickBy-0DU--7tw.chunk.mjs";import"./has-DJswI7NS.chunk.mjs";import"./clone-Dt8ItUbV.chunk.mjs";import"./init-q33yAy1W.chunk.mjs";function be(a){var t=0,r=a.children,n=r&&r.length;if(!n)t=1;else for(;--n>=0;)t+=r[n].value;a.value=t}function we(){return this.eachAfter(be)}function $e(a,t){let r=-1;for(const n of this)a.call(t,n,++r,this);return this}function Le(a,t){for(var r=this,n=[r],l,o,d=-1;r=n.pop();)if(a.call(t,r,++d,this),l=r.children)for(o=l.length-1;o>=0;--o)n.push(l[o]);return this}function Te(a,t){for(var r=this,n=[r],l=[],o,d,p,f=-1;r=n.pop();)if(l.push(r),o=r.children)for(d=0,p=o.length;d<p;++d)n.push(o[d]);for(;r=l.pop();)a.call(t,r,++f,this);return this}function Me(a,t){let r=-1;for(const n of this)if(a.call(t,n,++r,this))return n}function ke(a){return this.eachAfter(function(t){for(var r=+a(t.data)||0,n=t.children,l=n&&n.length;--l>=0;)r+=n[l].value;t.value=r})}function ze(a){return this.eachBefore(function(t){t.children&&t.children.sort(a)})}function Ae(a){for(var t=this,r=Fe(t,a),n=[t];t!==r;)t=t.parent,n.push(t);for(var l=n.length;a!==r;)n.splice(l,0,a),a=a.parent;return n}function Fe(a,t){if(a===t)return a;var r=a.ancestors(),n=t.ancestors(),l=null;for(a=r.pop(),t=n.pop();a===t;)l=a,a=r.pop(),t=n.pop();return l}function Pe(){for(var a=this,t=[a];a=a.parent;)t.push(a);return t}function Be(){return Array.from(this)}function Ne(){var a=[];return this.eachBefore(function(t){t.children||a.push(t)}),a}function We(){var a=this,t=[];return a.each(function(r){r!==a&&t.push({source:r.parent,target:r})}),t}function*De(){var a=this,t,r=[a],n,l,o;do for(t=r.reverse(),r=[];a=t.pop();)if(yield a,n=a.children)for(l=0,o=n.length;l<o;++l)r.push(n[l]);while(r.length)}function Y(a,t){a instanceof Map?(a=[void 0,a],t===void 0&&(t=Ee)):t===void 0&&(t=Ie);for(var r=new Q(a),n,l=[r],o,d,p,f;n=l.pop();)if((d=t(n.data))&&(f=(d=Array.from(d)).length))for(n.children=d,p=f-1;p>=0;--p)l.push(o=d[p]=new Q(d[p])),o.parent=n,o.depth=n.depth+1;return r.eachBefore(He)}function Re(){return Y(this).eachBefore(Ve)}function Ie(a){return a.children}function Ee(a){return Array.isArray(a)?a[1]:null}function Ve(a){a.data.value!==void 0&&(a.value=a.data.value),a.data=a.data.data}function He(a){var t=0;do a.height=t;while((a=a.parent)&&a.height<++t)}function Q(a){this.data=a,this.depth=this.height=0,this.parent=null}Q.prototype=Y.prototype={constructor:Q,count:we,each:$e,eachAfter:Te,eachBefore:Le,find:Me,sum:ke,sort:ze,path:Ae,ancestors:Pe,descendants:Be,leaves:Ne,links:We,copy:Re,[Symbol.iterator]:De};function je(a){if(typeof a!="function")throw new Error;return a}function H(){return 0}function j(a){return function(){return a}}function Ge(a){a.x0=Math.round(a.x0),a.y0=Math.round(a.y0),a.x1=Math.round(a.x1),a.y1=Math.round(a.y1)}function qe(a,t,r,n,l){for(var o=a.children,d,p=-1,f=o.length,i=a.value&&(n-t)/a.value;++p<f;)d=o[p],d.y0=r,d.y1=l,d.x0=t,d.x1=t+=d.value*i}function Oe(a,t,r,n,l){for(var o=a.children,d,p=-1,f=o.length,i=a.value&&(l-r)/a.value;++p<f;)d=o[p],d.x0=t,d.x1=n,d.y0=r,d.y1=r+=d.value*i}var _e=(1+Math.sqrt(5))/2;function Je(a,t,r,n,l,o){for(var d=[],p=t.children,f,i,h=0,C=0,s=p.length,v,g,x=t.value,u,m,F,k,P,D,T;h<s;){v=l-r,g=o-n;do u=p[C++].value;while(!u&&C<s);for(m=F=u,D=Math.max(g/v,v/g)/(x*a),T=u*u*D,P=Math.max(F/T,T/m);C<s;++C){if(u+=i=p[C].value,i<m&&(m=i),i>F&&(F=i),T=u*u*D,k=Math.max(F/T,T/m),k>P){u-=i;break}P=k}d.push(f={value:u,dice:v<g,children:p.slice(h,C)}),f.dice?qe(f,r,n,l,x?n+=g*u/x:o):Oe(f,r,n,x?r+=v*u/x:l,o),x-=u,h=C}return d}const Ke=function a(t){function r(n,l,o,d,p){Je(t,n,l,o,d,p)}return r.ratio=function(n){return a((n=+n)>1?n:1)},r}(_e);function Qe(){var a=Ke,t=!1,r=1,n=1,l=[0],o=H,d=H,p=H,f=H,i=H;function h(s){return s.x0=s.y0=0,s.x1=r,s.y1=n,s.eachBefore(C),l=[0],t&&s.eachBefore(Ge),s}function C(s){var v=l[s.depth],g=s.x0+v,x=s.y0+v,u=s.x1-v,m=s.y1-v;u<g&&(g=u=(g+u)/2),m<x&&(x=m=(x+m)/2),s.x0=g,s.y0=x,s.x1=u,s.y1=m,s.children&&(v=l[s.depth+1]=o(s)/2,g+=i(s)-v,x+=d(s)-v,u-=p(s)-v,m-=f(s)-v,u<g&&(g=u=(g+u)/2),m<x&&(x=m=(x+m)/2),a(s,g,x,u,m))}return h.round=function(s){return arguments.length?(t=!!s,h):t},h.size=function(s){return arguments.length?(r=+s[0],n=+s[1],h):[r,n]},h.tile=function(s){return arguments.length?(a=je(s),h):a},h.padding=function(s){return arguments.length?h.paddingInner(s).paddingOuter(s):h.paddingInner()},h.paddingInner=function(s){return arguments.length?(o=typeof s=="function"?s:j(+s),h):o},h.paddingOuter=function(s){return arguments.length?h.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):h.paddingTop()},h.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:j(+s),h):d},h.paddingRight=function(s){return arguments.length?(p=typeof s=="function"?s:j(+s),h):p},h.paddingBottom=function(s){return arguments.length?(f=typeof s=="function"?s:j(+s),h):f},h.paddingLeft=function(s){return arguments.length?(i=typeof s=="function"?s:j(+s),h):i},h}var W,ae=(W=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=de,this.getAccTitle=pe,this.setDiagramTitle=he,this.getDiagramTitle=ue,this.getAccDescription=fe,this.setAccDescription=me}getNodes(){return this.nodes}getConfig(){const t=ye,r=te();return ee({...t.treemap,...r.treemap??{}})}addNode(t,r){this.nodes.push(t),this.levels.set(t,r),r===0&&(this.outerNodes.push(t),this.root??(this.root=t))}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,r){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},l=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");l&&l.forEach(o=>{ge(o)&&(n?.textStyles?n.textStyles.push(o):n.textStyles=[o]),n?.styles?n.styles.push(o):n.styles=[o]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(W,"TreeMapDB"),W);function re(a){if(!a.length)return[];const t=[],r=[];return a.forEach(n=>{const l={name:n.name,children:n.type==="Leaf"?void 0:[]};for(l.classSelector=n?.classSelector,n?.cssCompiledStyles&&(l.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(l.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)t.push(l);else{const o=r[r.length-1].node;o.children?o.children.push(l):o.children=[l]}n.type!=="Leaf"&&r.push({node:l,level:n.level})}),t}w(re,"buildHierarchy");var Ue=w((a,t)=>{ve(a,t);const r=[];for(const o of a.TreemapRows??[])o.$type==="ClassDefStatement"&&t.addClass(o.className??"",o.styleText??"");for(const o of a.TreemapRows??[]){const d=o.item;if(!d)continue;const p=o.indent?parseInt(o.indent):0,f=Xe(d),i=d.classSelector?t.getStylesForClass(d.classSelector):[],h=i.length>0?i.join(";"):void 0,C={level:p,name:f,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:h};r.push(C)}const n=re(r),l=w((o,d)=>{for(const p of o)t.addNode(p,d),p.children&&p.children.length>0&&l(p.children,d+1)},"addNodesRecursively");l(n,0)},"populate"),Xe=w(a=>a.name?String(a.name):"","getItemName"),ne={parser:{yy:void 0},parse:w(async a=>{try{const t=await Ce("treemap",a);X.debug("Treemap AST:",t);const r=ne.parser?.yy;if(!(r instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ue(t,r)}catch(t){throw X.error("Error parsing treemap:",t),t}},"parse")},Ye=10,N=10,G=25,Ze=w((a,t,r,n)=>{const l=n.db,o=l.getConfig(),d=o.padding??Ye,p=l.getDiagramTitle(),f=l.getRoot(),{themeVariables:i}=te();if(!f)return;const h=p?30:0,C=ie(t),s=o.nodeWidth?o.nodeWidth*N:960,v=o.nodeHeight?o.nodeHeight*N:500,g=s,x=v+h;C.attr("viewBox",`0 0 ${g} ${x}`),ce(C,x,g,o.useMaxWidth);let u;try{const e=o.valueFormat||",";if(e==="$0,0")u=w(c=>"$"+V(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),y=c?c[0]:"";u=w($=>"$"+V(","+y)($),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);u=w(y=>"$"+V(c||"")(y),"valueFormat")}else u=V(e)}catch(e){X.error("Error creating format function:",e),u=V(",")}const m=U().range(["transparent",i.cScale0,i.cScale1,i.cScale2,i.cScale3,i.cScale4,i.cScale5,i.cScale6,i.cScale7,i.cScale8,i.cScale9,i.cScale10,i.cScale11]),F=U().range(["transparent",i.cScalePeer0,i.cScalePeer1,i.cScalePeer2,i.cScalePeer3,i.cScalePeer4,i.cScalePeer5,i.cScalePeer6,i.cScalePeer7,i.cScalePeer8,i.cScalePeer9,i.cScalePeer10,i.cScalePeer11]),k=U().range([i.cScaleLabel0,i.cScaleLabel1,i.cScaleLabel2,i.cScaleLabel3,i.cScaleLabel4,i.cScaleLabel5,i.cScaleLabel6,i.cScaleLabel7,i.cScaleLabel8,i.cScaleLabel9,i.cScaleLabel10,i.cScaleLabel11]);p&&C.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(p);const P=C.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),D=Y(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),T=Qe().size([s,v]).paddingTop(e=>e.children&&e.children.length>0?G+N:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?N:0).paddingRight(e=>e.children&&e.children.length>0?N:0).paddingBottom(e=>e.children&&e.children.length>0?N:0).round(!0)(D),se=T.descendants().filter(e=>e.children&&e.children.length>0),R=P.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,c)=>`clip-section-${t}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>m(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>F(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=K(this),y=e.data.name;c.text(y);const $=e.x1-e.x0,z=6;let A;o.showValues!==!1&&e.value?A=$-10-30-10-z:A=$-z-6;const M=Math.max(15,A),L=c.node();if(L.getComputedTextLength()>M){const S="...";let b=y;for(;b.length>0;){if(b=y.substring(0,b.length-1),b.length===0){c.text(S),L.getComputedTextLength()>M&&c.text("");break}if(c.text(b+S),L.getComputedTextLength()<=M)break}}}),o.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")});const oe=T.leaves(),q=P.selectAll(".treemapLeafGroup").data(oe).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);q.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("stroke-width",3),q.append("clipPath").attr("id",(e,c)=>`clip-${t}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),q.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${t}-${c})`).text(e=>e.data.name).each(function(e){const c=K(this),y=e.x1-e.x0,$=e.y1-e.y0,z=c.node(),A=4,M=y-2*A,L=$-2*A;if(M<10||L<10){c.style("display","none");return}let S=parseInt(c.style("font-size"),10);const b=8,I=28,O=.6,E=6,_=2;for(;z.getComputedTextLength()>M&&S>b;)S--,c.style("font-size",`${S}px`);let J=Math.max(E,Math.min(I,Math.round(S*O))),Z=S+_+J;for(;Z>L&&S>b&&(S--,J=Math.max(E,Math.min(I,Math.round(S*O))),!(J<E&&S===b));)c.style("font-size",`${S}px`),Z=S+_+J;c.style("font-size",`${S}px`),(z.getComputedTextLength()>M||S<b||L<S)&&c.style("display","none")}),o.showValues!==!1&&q.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(e.data.name)+";",y=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${t}-${c})`).text(e=>e.value?u(e.value):"").each(function(e){const c=K(this),y=this.parentNode;if(!y){c.style("display","none");return}const $=K(y).select(".treemapLabel");if($.empty()||$.style("display")==="none"){c.style("display","none");return}const z=parseFloat($.style("font-size")),A=28,M=.6,L=6,S=2,b=Math.max(L,Math.min(A,Math.round(z*M)));c.style("font-size",`${b}px`);const I=(e.y1-e.y0)/2+z/2+S;c.attr("y",I);const O=e.x1-e.x0,E=e.y1-e.y0-4,_=O-2*4;c.node().getComputedTextLength()>_||I+b>E||b<L?c.style("display","none"):c.style("display",null)});const le=o.diagramPadding??8;Se(C,le,"flowchart",o?.useMaxWidth||!1)},"draw"),et=w(function(a,t){return t.db.getClasses()},"getClasses"),tt={draw:Ze,getClasses:et},at={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},rt=w(({treemap:a}={})=>{const t=ee(at,a);return`
|
|
.treemapNode.section {
|
|
stroke: ${t.sectionStrokeColor};
|
|
stroke-width: ${t.sectionStrokeWidth};
|
|
fill: ${t.sectionFillColor};
|
|
}
|
|
.treemapNode.leaf {
|
|
stroke: ${t.leafStrokeColor};
|
|
stroke-width: ${t.leafStrokeWidth};
|
|
fill: ${t.leafFillColor};
|
|
}
|
|
.treemapLabel {
|
|
fill: ${t.labelColor};
|
|
font-size: ${t.labelFontSize};
|
|
}
|
|
.treemapValue {
|
|
fill: ${t.valueColor};
|
|
font-size: ${t.valueFontSize};
|
|
}
|
|
.treemapTitle {
|
|
fill: ${t.titleColor};
|
|
font-size: ${t.titleFontSize};
|
|
}
|
|
`},"getStyles"),nt=rt,At={parser:ne,get db(){return new ae},renderer:tt,styles:nt};export{At as diagram};
|
|
//# sourceMappingURL=diagram-PSM6KHXK-Dp3lq7K0.chunk.mjs.map
|