Files
Awperative/_site/public/diagram-PSM6KHXK-ADGLBAYB.min.js
2026-02-09 16:52:39 -05:00

26 lines
11 KiB
JavaScript
Executable File

import{a as ce}from"./chunk-V3WVIUUL.min.js";import{a as pe}from"./chunk-I6VG5SPK.min.js";import"./chunk-LK7NMYKK.min.js";import{a as ne}from"./chunk-7EBV5LUJ.min.js";import{a as ie}from"./chunk-ORLGEIQN.min.js";import"./chunk-6RTTMAJH.min.js";import"./chunk-LGVO22YL.min.js";import"./chunk-HVSI2YYT.min.js";import"./chunk-6B6J5Z6Z.min.js";import"./chunk-EU44H33B.min.js";import"./chunk-CQUFH26W.min.js";import"./chunk-LBFZT66H.min.js";import{c as oe,d as T}from"./chunk-OEBO5CRK.min.js";import"./chunk-R5JLOOQ4.min.js";import"./chunk-PTL4EUOE.min.js";import{l as O}from"./chunk-QZZKR5JD.min.js";import"./chunk-CM5D5KZN.min.js";import{L as J,P as K,Q,R as Z,S as ee,T as te,U as ae,V as le,q,y as I}from"./chunk-3EE2TK35.min.js";import"./chunk-E5F23VE2.min.js";import{b as d,d as H,j as D,l as F,m as se,n as re,o as R}from"./chunk-6TVUEPFY.min.js";import"./chunk-OSRY5VT3.min.js";var de=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Q,this.getAccTitle=Z,this.setDiagramTitle=ae,this.getDiagramTitle=le,this.getAccDescription=te,this.setAccDescription=ee}static{d(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let s=q,a=I();return O({...s.treemap,...a.treemap??{}})}addNode(s,a){this.nodes.push(s),this.levels.set(s,a),a===0&&(this.outerNodes.push(s),this.root??=s)}getRoot(){return{name:"",children:this.outerNodes}}addClass(s,a){let o=this.classes.get(s)??{id:s,styles:[],textStyles:[]},i=a.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(p=>{oe(p)&&(o?.textStyles?o.textStyles.push(p):o.textStyles=[p]),o?.styles?o.styles.push(p):o.styles=[p]}),this.classes.set(s,o)}getClasses(){return this.classes}getStylesForClass(s){return this.classes.get(s)?.styles??[]}clear(){K(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function he(s){if(!s.length)return[];let a=[],o=[];return s.forEach(i=>{let p={name:i.name,children:i.type==="Leaf"?void 0:[]};for(p.classSelector=i?.classSelector,i?.cssCompiledStyles&&(p.cssCompiledStyles=[i.cssCompiledStyles]),i.type==="Leaf"&&i.value!==void 0&&(p.value=i.value);o.length>0&&o[o.length-1].level>=i.level;)o.pop();if(o.length===0)a.push(p);else{let n=o[o.length-1].node;n.children?n.children.push(p):n.children=[p]}i.type!=="Leaf"&&o.push({node:p,level:i.level})}),a}d(he,"buildHierarchy");var ve=d((s,a)=>{ce(s,a);let o=[];for(let n of s.TreemapRows??[])n.$type==="ClassDefStatement"&&a.addClass(n.className??"",n.styleText??"");for(let n of s.TreemapRows??[]){let h=n.item;if(!h)continue;let u=n.indent?parseInt(n.indent):0,V=Ce(h),l=h.classSelector?a.getStylesForClass(h.classSelector):[],N=l.length>0?l.join(";"):void 0,v={level:u,name:V,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:N};o.push(v)}let i=he(o),p=d((n,h)=>{for(let u of n)a.addNode(u,h),u.children&&u.children.length>0&&p(u.children,h+1)},"addNodesRecursively");p(i,0)},"populate"),Ce=d(s=>s.name?String(s.name):"","getItemName"),me={parser:{yy:void 0},parse:d(async s=>{try{let o=await pe("treemap",s);H.debug("Treemap AST:",o);let i=me.parser?.yy;if(!(i instanceof de))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.");ve(o,i)}catch(a){throw H.error("Error parsing treemap:",a),a}},"parse")},we=10,z=10,M=25,Te=d((s,a,o,i)=>{let p=i.db,n=p.getConfig(),h=n.padding??we,u=p.getDiagramTitle(),V=p.getRoot(),{themeVariables:l}=I();if(!V)return;let N=u?30:0,v=ne(a),G=n.nodeWidth?n.nodeWidth*z:960,X=n.nodeHeight?n.nodeHeight*z:500,B=G,Y=X+N;v.attr("viewBox",`0 0 ${B} ${Y}`),J(v,Y,B,n.useMaxWidth);let C;try{let e=n.valueFormat||",";if(e==="$0,0")C=d(t=>"$"+F(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),r=t?t[0]:"";C=d(m=>"$"+F(","+r)(m),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);C=d(r=>"$"+F(t||"")(r),"valueFormat")}else C=F(e)}catch(e){H.error("Error creating format function:",e),C=F(",")}let A=R().range(["transparent",l.cScale0,l.cScale1,l.cScale2,l.cScale3,l.cScale4,l.cScale5,l.cScale6,l.cScale7,l.cScale8,l.cScale9,l.cScale10,l.cScale11]),ue=R().range(["transparent",l.cScalePeer0,l.cScalePeer1,l.cScalePeer2,l.cScalePeer3,l.cScalePeer4,l.cScalePeer5,l.cScalePeer6,l.cScalePeer7,l.cScalePeer8,l.cScalePeer9,l.cScalePeer10,l.cScalePeer11]),W=R().range([l.cScaleLabel0,l.cScaleLabel1,l.cScaleLabel2,l.cScaleLabel3,l.cScaleLabel4,l.cScaleLabel5,l.cScaleLabel6,l.cScaleLabel7,l.cScaleLabel8,l.cScaleLabel9,l.cScaleLabel10,l.cScaleLabel11]);u&&v.append("text").attr("x",B/2).attr("y",N/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);let j=v.append("g").attr("transform",`translate(0, ${N})`).attr("class","treemapContainer"),fe=se(V).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),U=re().size([G,X]).paddingTop(e=>e.children&&e.children.length>0?M+z:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?z:0).paddingRight(e=>e.children&&e.children.length>0?z:0).paddingBottom(e=>e.children&&e.children.length>0?z:0).round(!0)(fe),ye=U.descendants().filter(e=>e.children&&e.children.length>0),k=j.selectAll(".treemapSection").data(ye).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);k.append("rect").attr("width",e=>e.x1-e.x0).attr("height",M).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),k.append("clipPath").attr("id",(e,t)=>`clip-section-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",M),k.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>A(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>ue(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=T({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),k.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",M/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;";let t="dominant-baseline: middle; font-size: 12px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",r=T({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=D(this),r=e.data.name;t.text(r);let m=e.x1-e.x0,g=6,S;n.showValues!==!1&&e.value?S=m-10-30-10-g:S=m-g-6;let f=Math.max(15,S),c=t.node();if(c.getComputedTextLength()>f){let y=r;for(;y.length>0;){if(y=r.substring(0,y.length-1),y.length===0){t.text("..."),c.getComputedTextLength()>f&&t.text("");break}if(t.text(y+"..."),c.getComputedTextLength()<=f)break}}}),n.showValues!==!1&&k.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",M/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?C(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",r=T({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")});let ge=U.leaves(),E=j.selectAll(".treemapLeafGroup").data(ge).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?A(e.parent.data.name):A(e.data.name)).attr("style",e=>T({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?A(e.parent.data.name):A(e.data.name)).attr("stroke-width",3),E.append("clipPath").attr("id",(e,t)=>`clip-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),E.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+W(e.data.name)+";",r=T({cssCompiledStyles:e.data.cssCompiledStyles});return t+r.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.data.name).each(function(e){let t=D(this),r=e.x1-e.x0,m=e.y1-e.y0,g=t.node(),S=4,L=r-2*S,f=m-2*S;if(L<10||f<10){t.style("display","none");return}let c=parseInt(t.style("font-size"),10),w=8,x=28,y=.6,b=6,P=2;for(;g.getComputedTextLength()>L&&c>w;)c--,t.style("font-size",`${c}px`);let $=Math.max(b,Math.min(x,Math.round(c*y))),_=c+P+$;for(;_>f&&c>w&&(c--,$=Math.max(b,Math.min(x,Math.round(c*y))),!($<b&&c===w));)t.style("font-size",`${c}px`),_=c+P+$,$<=b&&_>f;t.style("font-size",`${c}px`),(g.getComputedTextLength()>L||c<w||f<c)&&t.style("display","none")}),n.showValues!==!1&&E.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let r="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+W(t.data.name)+";",m=T({cssCompiledStyles:t.data.cssCompiledStyles});return r+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,r)=>`url(#clip-${a}-${r})`).text(t=>t.value?C(t.value):"").each(function(t){let r=D(this),m=this.parentNode;if(!m){r.style("display","none");return}let g=D(m).select(".treemapLabel");if(g.empty()||g.style("display")==="none"){r.style("display","none");return}let S=parseFloat(g.style("font-size")),L=28,f=.6,c=6,w=2,x=Math.max(c,Math.min(L,Math.round(S*f)));r.style("font-size",`${x}px`);let b=(t.y1-t.y0)/2+S/2+w;r.attr("y",b);let P=t.x1-t.x0,xe=t.y1-t.y0-4,be=P-8;r.node().getComputedTextLength()>be||b+x>xe||x<c?r.style("display","none"):r.style("display",null)});let Se=n.diagramPadding??8;ie(v,Se,"flowchart",n?.useMaxWidth||!1)},"draw"),Le=d(function(s,a){return a.db.getClasses()},"getClasses"),$e={draw:Te,getClasses:Le},Fe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},ze=d(({treemap:s}={})=>{let a=O(Fe,s);return`
.treemapNode.section {
stroke: ${a.sectionStrokeColor};
stroke-width: ${a.sectionStrokeWidth};
fill: ${a.sectionFillColor};
}
.treemapNode.leaf {
stroke: ${a.leafStrokeColor};
stroke-width: ${a.leafStrokeWidth};
fill: ${a.leafFillColor};
}
.treemapLabel {
fill: ${a.labelColor};
font-size: ${a.labelFontSize};
}
.treemapValue {
fill: ${a.valueColor};
font-size: ${a.valueFontSize};
}
.treemapTitle {
fill: ${a.titleColor};
font-size: ${a.titleFontSize};
}
`},"getStyles"),Ne=ze,Be={parser:me,get db(){return new de},renderer:$e,styles:Ne};export{Be as diagram};
//# sourceMappingURL=diagram-PSM6KHXK-ADGLBAYB.min.js.map