import{a as l,b as d,c as n,d as p,e as i,f as m,m as c,n as u,p as T}from"./chunk-YFOJOJKZ.js";import{h as s}from"./chunk-7DHJDT2N.js";var v=class extends T{static{s(this,"TreemapTokenBuilder")}static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},g=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,h=class extends u{static{s(this,"TreemapValueConverter")}static{i(this,"TreemapValueConverter")}runCustomConverter(t,e,a){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR"||t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;let r=g.exec(e);if(r)return{$type:"ClassDefStatement",className:r[1],styleText:r[2]||void 0}}}};function o(t){let e=t.validation.TreemapValidator,a=t.validation.ValidationRegistry;if(a){let r={Treemap:e.checkSingleRoot.bind(e)};a.register(r,e)}}s(o,"registerValidationChecks");i(o,"registerValidationChecks");var V=class{static{s(this,"TreemapValidator")}static{i(this,"TreemapValidator")}checkSingleRoot(t,e){let a;for(let r of t.TreemapRows)r.item&&(a===void 0&&r.indent===void 0?a=0:r.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}):a!==void 0&&a>=parseInt(r.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"}))}},C={parser:{TokenBuilder:i(()=>new v,"TokenBuilder"),ValueConverter:i(()=>new h,"ValueConverter")},validation:{TreemapValidator:i(()=>new V,"TreemapValidator")}};function f(t=p){let e=n(d(t),m),a=n(l({shared:e}),c,C);return e.ServiceRegistry.register(a),o(a),{shared:e,Treemap:a}}s(f,"createTreemapServices");i(f,"createTreemapServices");export{C as a,f as b};
