television/assets/js/8565.196fffe8.js
2025-07-07 15:22:29 +00:00

1 line
11 KiB
JavaScript

"use strict";(self.webpackChunktelevision_website=self.webpackChunktelevision_website||[]).push([[8565],{160:(e,t,a)=>{function l(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>l}),(0,a(6632).K2)(l,"populateCommonDb")},5974:(e,t,a)=>{a.d(t,{m:()=>s});var l=a(6632),s=class{constructor(e){this.init=e,this.records=this.init()}static{(0,l.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},8565:(e,t,a)=>{a.d(t,{diagram:()=>T});var l=a(7682),s=a(4004),r=a(160),n=a(5974),o=a(8211),i=a(8466),c=a(6632),d=a(7076),p=a(3170),h={nodes:[],levels:new Map,outerNodes:[],classes:new Map},m=new n.m((()=>structuredClone(h))),f=(0,c.K2)((()=>{const e=c.UI,t=(0,c.zj)();return(0,o.$t)({...e.treemap,...t.treemap??{}})}),"getConfig"),y=(0,c.K2)((()=>m.records.nodes),"getNodes"),S=(0,c.K2)(((e,t)=>{const a=m.records;a.nodes.push(e),a.levels.set(e,t),0===t&&a.outerNodes.push(e),0!==t||a.root||(a.root=e)}),"addNode"),u=(0,c.K2)((()=>({name:"",children:m.records.outerNodes})),"getRoot"),g=(0,c.K2)(((e,t)=>{const a=m.records.classes,l=a.get(e)??{id:e,styles:[],textStyles:[]};a.set(e,l);const r=t.replace(/\\,/g,"\xa7\xa7\xa7").replace(/,/g,";").replace(/\xa7\xa7\xa7/g,",").split(";");r&&r.forEach((e=>{(0,s.KX)(e)&&(l?.textStyles?l.textStyles.push(e):l.textStyles=[e]),l?.styles?l.styles.push(e):l.styles=[e]})),a.set(e,l)}),"addClass"),x=(0,c.K2)((()=>m.records.classes),"getClasses"),C=(0,c.K2)((e=>m.records.classes.get(e)?.styles??[]),"getStylesForClass"),b={getNodes:y,addNode:S,getRoot:u,getConfig:f,clear:(0,c.K2)((()=>{(0,c.IU)(),m.reset()}),"clear"),setAccTitle:c.SV,getAccTitle:c.iN,setDiagramTitle:c.ke,getDiagramTitle:c.ab,getAccDescription:c.m7,setAccDescription:c.EI,addClass:g,getClasses:x,getStylesForClass:C};function v(e){if(!e.length)return[];const t=[],a=[];return e.forEach((e=>{const l={name:e.name,children:"Leaf"===e.type?void 0:[]};for(l.classSelector=e?.classSelector,e?.cssCompiledStyles&&(l.cssCompiledStyles=[e.cssCompiledStyles]),"Leaf"===e.type&&void 0!==e.value&&(l.value=e.value);a.length>0&&a[a.length-1].level>=e.level;)a.pop();if(0===a.length)t.push(l);else{const e=a[a.length-1].node;e.children?e.children.push(l):e.children=[l]}"Leaf"!==e.type&&a.push({node:l,level:e.level})})),t}(0,c.K2)(v,"buildHierarchy");var $=(0,c.K2)((e=>{(0,r.S)(e,b);const t=[];for(const s of e.TreemapRows??[])"ClassDefStatement"===s.$type&&b.addClass(s.className??"",s.styleText??"");for(const s of e.TreemapRows??[]){const e=s.item;if(!e)continue;const a=s.indent?parseInt(s.indent):0,l=w(e),r=e.classSelector?b.getStylesForClass(e.classSelector):[],n=r.length>0?r.join(";"):void 0,o={level:a,name:l,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:n};t.push(o)}const a=v(t),l=(0,c.K2)(((e,t)=>{for(const a of e)b.addNode(a,t),a.children&&a.children.length>0&&l(a.children,t+1)}),"addNodesRecursively");l(a,0)}),"populate"),w=(0,c.K2)((e=>e.name?String(e.name):""),"getItemName"),L=10,k={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},T={parser:{parse:(0,c.K2)((async e=>{try{const t=d.qg,a=await t("treemap",e);c.Rm.debug("Treemap AST:",a),$(a)}catch(t){throw c.Rm.error("Error parsing treemap:",t),t}}),"parse")},db:b,renderer:{draw:(0,c.K2)(((e,t,a,r)=>{const n=r.db,o=n.getConfig(),d=o.padding??10,h=n.getDiagramTitle(),m=n.getRoot(),{themeVariables:f}=(0,c.zj)();if(!m)return;const y=h?30:0,S=(0,i.D)(t),u=o.nodeWidth?o.nodeWidth*L:960,g=o.nodeHeight?o.nodeHeight*L:500,x=u,C=g+y;let b;S.attr("viewBox",`0 0 ${x} ${C}`),(0,c.a$)(S,C,x,o.useMaxWidth);try{const e=o.valueFormat||",";if("$0,0"===e)b=(0,c.K2)((e=>"$"+(0,p.GPZ)(",")(e)),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const t=/\.\d+/.exec(e),a=t?t[0]:"";b=(0,c.K2)((e=>"$"+(0,p.GPZ)(","+a)(e)),"valueFormat")}else if(e.startsWith("$")){const t=e.substring(1);b=(0,c.K2)((e=>"$"+(0,p.GPZ)(t||"")(e)),"valueFormat")}else b=(0,p.GPZ)(e)}catch(G){c.Rm.error("Error creating format function:",G),b=(0,p.GPZ)(",")}const v=(0,p.UMr)().range(["transparent",f.cScale0,f.cScale1,f.cScale2,f.cScale3,f.cScale4,f.cScale5,f.cScale6,f.cScale7,f.cScale8,f.cScale9,f.cScale10,f.cScale11]),$=(0,p.UMr)().range(["transparent",f.cScalePeer0,f.cScalePeer1,f.cScalePeer2,f.cScalePeer3,f.cScalePeer4,f.cScalePeer5,f.cScalePeer6,f.cScalePeer7,f.cScalePeer8,f.cScalePeer9,f.cScalePeer10,f.cScalePeer11]),w=(0,p.UMr)().range([f.cScaleLabel0,f.cScaleLabel1,f.cScaleLabel2,f.cScaleLabel3,f.cScaleLabel4,f.cScaleLabel5,f.cScaleLabel6,f.cScaleLabel7,f.cScaleLabel8,f.cScaleLabel9,f.cScaleLabel10,f.cScaleLabel11]);h&&S.append("text").attr("x",x/2).attr("y",y/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const k=S.append("g").attr("transform",`translate(0, ${y})`).attr("class","treemapContainer"),T=(0,p.Sk5)(m).sum((e=>e.value??0)).sort(((e,t)=>(t.value??0)-(e.value??0))),z=(0,p.hkb)().size([u,g]).paddingTop((e=>e.children&&e.children.length>0?35:0)).paddingInner(d).paddingLeft((e=>e.children&&e.children.length>0?L:0)).paddingRight((e=>e.children&&e.children.length>0?L:0)).paddingBottom((e=>e.children&&e.children.length>0?L:0)).round(!0)(T),K=z.descendants().filter((e=>e.children&&e.children.length>0)),P=k.selectAll(".treemapSection").data(K).enter().append("g").attr("class","treemapSection").attr("transform",(e=>`translate(${e.x0},${e.y0})`));P.append("rect").attr("width",(e=>e.x1-e.x0)).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",(e=>0===e.depth?"display: none;":"")),P.append("clipPath").attr("id",((e,a)=>`clip-section-${t}-${a}`)).append("rect").attr("width",(e=>Math.max(0,e.x1-e.x0-12))).attr("height",25),P.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=>v(e.data.name))).attr("fill-opacity",.6).attr("stroke",(e=>$(e.data.name))).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",(e=>{if(0===e.depth)return"display: none;";const t=(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")})),P.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text((e=>0===e.depth?"":e.data.name)).attr("font-weight","bold").attr("style",(e=>{if(0===e.depth)return"display: none;";return"dominant-baseline: middle; font-size: 12px; fill:"+w(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")})).each((function(e){if(0===e.depth)return;const t=(0,p.Ltv)(this),a=e.data.name;t.text(a);const l=e.x1-e.x0;let s;if(!1!==o.showValues&&e.value){s=l-10-30-10-6}else{s=l-6-6}const r=Math.max(15,s),n=t.node();if(n.getComputedTextLength()>r){const e="...";let l=a;for(;l.length>0;){if(l=a.substring(0,l.length-1),0===l.length){t.text(e),n.getComputedTextLength()>r&&t.text("");break}if(t.text(l+e),n.getComputedTextLength()<=r)break}}})),!1!==o.showValues&&P.append("text").attr("class","treemapSectionValue").attr("x",(e=>e.x1-e.x0-10)).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text((e=>e.value?b(e.value):"")).attr("font-style","italic").attr("style",(e=>{if(0===e.depth)return"display: none;";return"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+w(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")}));const M=z.leaves(),F=k.selectAll(".treemapLeafGroup").data(M).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})`));F.append("rect").attr("width",(e=>e.x1-e.x0)).attr("height",(e=>e.y1-e.y0)).attr("class","treemapLeaf").attr("fill",(e=>e.parent?v(e.parent.data.name):v(e.data.name))).attr("style",(e=>(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles)).attr("fill-opacity",.3).attr("stroke",(e=>e.parent?v(e.parent.data.name):v(e.data.name))).attr("stroke-width",3),F.append("clipPath").attr("id",((e,a)=>`clip-${t}-${a}`)).append("rect").attr("width",(e=>Math.max(0,e.x1-e.x0-4))).attr("height",(e=>Math.max(0,e.y1-e.y0-4)));if(F.append("text").attr("class","treemapLabel").attr("x",(e=>(e.x1-e.x0)/2)).attr("y",(e=>(e.y1-e.y0)/2)).attr("style",(e=>"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+w(e.data.name)+";"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"))).attr("clip-path",((e,a)=>`url(#clip-${t}-${a})`)).text((e=>e.data.name)).each((function(e){const t=(0,p.Ltv)(this),a=e.x1-e.x0,l=e.y1-e.y0,s=t.node(),r=a-8,n=l-8;if(r<10||n<10)return void t.style("display","none");let o=parseInt(t.style("font-size"),10);for(;s.getComputedTextLength()>r&&o>8;)o--,t.style("font-size",`${o}px`);let i=Math.max(6,Math.min(28,Math.round(.6*o))),c=o+2+i;for(;c>n&&o>8&&(o--,i=Math.max(6,Math.min(28,Math.round(.6*o))),!(i<6&&8===o));)t.style("font-size",`${o}px`),c=o+2+i;t.style("font-size",`${o}px`),(s.getComputedTextLength()>r||o<8||n<o)&&t.style("display","none")})),!1!==o.showValues){F.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=>"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+w(e.data.name)+";"+(0,s.GX)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"))).attr("clip-path",((e,a)=>`url(#clip-${t}-${a})`)).text((e=>e.value?b(e.value):"")).each((function(e){const t=(0,p.Ltv)(this),a=this.parentNode;if(!a)return void t.style("display","none");const l=(0,p.Ltv)(a).select(".treemapLabel");if(l.empty()||"none"===l.style("display"))return void t.style("display","none");const s=parseFloat(l.style("font-size")),r=Math.max(6,Math.min(28,Math.round(.6*s)));t.style("font-size",`${r}px`);const n=(e.y1-e.y0)/2+s/2+2;t.attr("y",n);const o=e.x1-e.x0,i=e.y1-e.y0-4,c=o-8;t.node().getComputedTextLength()>c||n+r>i||r<6?t.style("display","none"):t.style("display",null)}))}const N=o.diagramPadding??8;(0,l.P)(S,N,"flowchart",o?.useMaxWidth||!1)}),"draw"),getClasses:(0,c.K2)((function(e,t){return t.db.getClasses()}),"getClasses")},styles:(0,c.K2)((({treemap:e}={})=>{const t=(0,o.$t)(k,e);return`\n .treemapNode.section {\n stroke: ${t.sectionStrokeColor};\n stroke-width: ${t.sectionStrokeWidth};\n fill: ${t.sectionFillColor};\n }\n .treemapNode.leaf {\n stroke: ${t.leafStrokeColor};\n stroke-width: ${t.leafStrokeWidth};\n fill: ${t.leafFillColor};\n }\n .treemapLabel {\n fill: ${t.labelColor};\n font-size: ${t.labelFontSize};\n }\n .treemapValue {\n fill: ${t.valueColor};\n font-size: ${t.valueFontSize};\n }\n .treemapTitle {\n fill: ${t.titleColor};\n font-size: ${t.titleFontSize};\n }\n `}),"getStyles")}}}]);