@mosaicoo/svg-engine 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +21 -0
- package/README.md +249 -0
- package/fesm2022/mosaicoo-svg-engine-ai-nlu-ui.mjs +459 -0
- package/fesm2022/mosaicoo-svg-engine-ai-nlu-voice-wasm.mjs +1 -0
- package/fesm2022/mosaicoo-svg-engine-ai-nlu.mjs +11 -0
- package/fesm2022/mosaicoo-svg-engine-core.mjs +3 -0
- package/fesm2022/mosaicoo-svg-engine-edit.mjs +2292 -0
- package/fesm2022/mosaicoo-svg-engine-io.mjs +47 -0
- package/fesm2022/mosaicoo-svg-engine-optimize.mjs +1 -0
- package/fesm2022/mosaicoo-svg-engine-render.mjs +301 -0
- package/fesm2022/mosaicoo-svg-engine-ui.mjs +14236 -0
- package/fesm2022/mosaicoo-svg-engine.mjs +1 -0
- package/package.json +105 -0
- package/types/mosaicoo-svg-engine-ai-nlu-ui.d.ts +416 -0
- package/types/mosaicoo-svg-engine-ai-nlu-voice-wasm.d.ts +175 -0
- package/types/mosaicoo-svg-engine-ai-nlu.d.ts +1834 -0
- package/types/mosaicoo-svg-engine-core.d.ts +5139 -0
- package/types/mosaicoo-svg-engine-edit.d.ts +11922 -0
- package/types/mosaicoo-svg-engine-io.d.ts +476 -0
- package/types/mosaicoo-svg-engine-optimize.d.ts +183 -0
- package/types/mosaicoo-svg-engine-render.d.ts +628 -0
- package/types/mosaicoo-svg-engine-ui.d.ts +6861 -0
- package/types/mosaicoo-svg-engine.d.ts +30 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import*as g from"@angular/core";import{signal as P,Injectable as R}from"@angular/core";import{createGroup as O,generateNodeId as H,isAnimationDoc as Z,parseTransformAttr as Pt,SVGE_CUSTOM_ATTRS_KEY as Rt,dataNameToCustomAttr as Ot,createSymbolUse as jt,createImage as Mt,createText as Vt,createPath as Ut,createPolyline as Gt,createPolygon as zt,createLine as Bt,createEllipse as Q,createRect as Wt,SVGE_KIND_LAYER as tt,SVGE_KIND_SMART_OBJECT as et,SVGE_KIND_PAGE as nt,SVGE_KIND_KEY as j,SVGE_PAGE_VIEWBOX_KEY as qt,SVGE_PAGE_NAME_KEY as Kt,SVGE_PAGE_OPTIONS_KEY as rt,ANIMATION_KEY as it,bbox as ot,isGroupNode as st,walk as M,readAnimationDoc as Yt,animationToSmil as Jt,TRANSFORM_PROPERTY_NAMES as Xt,isLayer as Ht,isSmartObject as Zt,isPage as at,getPageViewBox as Qt,getPageName as te,getPageOptions as ee,roundPathCorners as ne,readCustomAttrs as re,customAttrToDataName as ie}from"@mosaicoo/svg-engine/core";class N{_importers=P([],...ngDevMode?[{debugName:"_importers"}]:[]);importers=this._importers.asReadonly();register(e){if(typeof e.id!="string"||e.id.length===0)throw new Error("ImporterRegistry.register: importer.id must be non-empty");if(this._importers().some(n=>n.id===e.id))throw new Error(`ImporterRegistry.register: importer "${e.id}" is already registered`);return this._importers.set([...this._importers(),e]),{dispose:()=>{this._importers.set(this._importers().filter(n=>n.id!==e.id))}}}get(e){return this._importers().find(n=>n.id===e)??null}byExtension(e){const n=e.toLowerCase().replace(/^\./,"");return this._importers().find(r=>r.extensions.some(i=>i.toLowerCase()===n))??null}byMediaType(e){return this._importers().find(n=>n.mediaTypes.includes(e))??null}static \u0275fac=g.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:N,deps:[],target:g.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=g.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:N,providedIn:"root"})}g.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:N,decorators:[{type:R,args:[{providedIn:"root"}]}]});class C{_exporters=P([],...ngDevMode?[{debugName:"_exporters"}]:[]);exporters=this._exporters.asReadonly();register(e){if(typeof e.id!="string"||e.id.length===0)throw new Error("ExporterRegistry.register: exporter.id must be non-empty");if(this._exporters().some(n=>n.id===e.id))throw new Error(`ExporterRegistry.register: exporter "${e.id}" is already registered`);return this._exporters.set([...this._exporters(),e]),{dispose:()=>{this._exporters.set(this._exporters().filter(n=>n.id!==e.id))}}}get(e){return this._exporters().find(n=>n.id===e)??null}byExtension(e){const n=e.toLowerCase().replace(/^\./,"");return this._exporters().find(r=>r.extension.toLowerCase()===n)??null}byMediaType(e){return this._exporters().find(n=>n.mediaType===e)??null}static \u0275fac=g.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:C,deps:[],target:g.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=g.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:C,providedIn:"root"})}g.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:C,decorators:[{type:R,args:[{providedIn:"root"}]}]});class oe{rules=[];nextOrder=0;get isEmpty(){return this.rules.length===0}addCss(e){const n=se(e);for(const r of ae(n)){const i=ue(r.body);if(i.size!==0)for(const o of ce(r.prelude)){const s=o.trim();s.length!==0&&this.rules.push({selector:s,declarations:i,specificity:le(s),order:this.nextOrder++})}}}resolve(e){const n=new Map,r=this.rules.filter(i=>fe(e,i.selector)).sort((i,o)=>i.specificity-o.specificity||i.order-o.order);for(const i of r)for(const[o,s]of i.declarations)n.set(o,s);return n}}function se(t){return t.replace(/\/\*[\s\S]*?\*\//g,"")}function ae(t){const e=[];let n="",r=0;const i=t.length;for(;r<i;){const o=t[r];if(o==="{"){let s=1,a=r+1;const u=a;for(;a<i&&s>0;){const l=t[a];if(l==="{"?s++:l==="}"&&s--,s===0)break;a++}const f=t.slice(u,a),m=n.trim();m.length>0&&!m.startsWith("@")&&e.push({prelude:m,body:f}),n="",r=a+1;continue}n+=o,r++}return e}function ce(t){const e=[];let n="",r=0;for(const i of t)i==="("?r++:i===")"&&(r=Math.max(0,r-1)),i===","&&r===0?(e.push(n),n=""):n+=i;return n.trim().length>0&&e.push(n),e}function ue(t){const e=new Map;for(const n of t.split(";")){const r=n.indexOf(":");if(r<=0)continue;const i=n.slice(0,r).trim().toLowerCase();let o=n.slice(r+1).trim();i.length===0||o.length===0||(o=o.replace(/\s*!\s*important\s*$/i,"").trim(),o.length!==0&&e.set(i,o))}return e}function fe(t,e){try{return t.matches(e)}catch{return!1}}function le(t){const e=(t.match(/#[\w-]+/g)??[]).length,n=(t.match(/\.[\w-]+/g)??[]).length+(t.match(/\[[^\]]*\]/g)??[]).length+(t.match(/(?<!:):[\w-]+/g)??[]).length,r=(t.match(/(?:^|[\s>+~])[a-zA-Z][\w-]*/g)??[]).length+(t.match(/::[\w-]+/g)??[]).length;return e*1e6+n*1e3+r}const pe={id:"svge.builtin.importer.svg",name:"SVG",mediaTypes:["image/svg+xml"],extensions:["svg"],import(t){if(typeof DOMParser>"u")return{ok:!1,error:"svgImporter requires a browser DOMParser"};const n=new DOMParser().parseFromString(t,"image/svg+xml"),r=n.querySelector("parsererror");if(r!==null)return{ok:!1,error:`Malformed SVG: ${r.textContent??"parse error"}`};const i=n.documentElement;if(i===null||i.tagName.toLowerCase()!=="svg")return{ok:!1,error:"Root element must be <svg>"};const o=[],s=new Set,a=Ne(i,o);he(i);const u=Ie(i,o),f=ct(i,o,s);for(const d of s)o.push(`Unsupported element <${d}> skipped`);const m=dt(i);return{ok:!0,document:u.length>0?{id:H(),viewBox:a,root:O(f,{style:m}),defs:u}:{id:H(),viewBox:a,root:O(f,{style:m})},warnings:o}}},de=new Set(["g","rect","circle","ellipse","line","path","polygon","polyline","text","image"]),me=new Set(["fill","stroke","stroke-width","opacity","fill-opacity","stroke-opacity","visibility","filter"]);function he(t){const e=t.querySelectorAll("style");if(e.length===0)return;const n=new oe;for(const r of Array.from(e))n.addCss(r.textContent??"");if(!n.isEmpty)for(const r of Array.from(t.querySelectorAll("*"))){if(!de.has(r.tagName.toLowerCase())||r.closest("defs")!==null)continue;const i=n.resolve(r);if(i.size!==0)for(const[o,s]of i)me.has(o)&&r.setAttribute(o,s)}}const ge=new Set(["metadata","title","desc","sodipodi:namedview","inkscape:path-effect","inkscape:perspective"]),V=new Set(["lineargradient","radialgradient","pattern","clippath","mask","filter","marker","symbol"]);function ct(t,e,n){const r=[];for(const i of Array.from(t.children)){const o=ke(i,e,n);o!==null&&r.push(o)}return r}function ye(t){const e=Array.from(t.children).filter(n=>n.tagName.toLowerCase()==="tspan");return e.length>0?e.map(n=>n.textContent??"").join(`
|
|
2
|
+
`):t.textContent??""}function xe(t){const e=Array.from(t.children).filter(i=>i.tagName.toLowerCase()==="tspan");if(e.length===0||e.some(i=>i.hasAttribute("dy")))return null;const n=e.map(i=>be(i));return n.some(i=>i.fill!==void 0||i.fontFamily!==void 0||i.fontSize!==void 0||i.fontWeight!==void 0||i.fontStyle!==void 0||i.textDecoration!==void 0||i.letterSpacing!==void 0||i.fontVariationSettings!==void 0||i.fontFeatureSettings!==void 0)?n:null}function be(t){return{text:t.textContent??"",fill:y(t,"fill"),fontFamily:y(t,"font-family"),fontSize:U(y(t,"font-size")),fontWeight:ut(y(t,"font-weight")),fontStyle:k(y(t,"font-style"),["normal","italic"]),textDecoration:k(y(t,"text-decoration"),["none","underline","line-through"]),letterSpacing:U(y(t,"letter-spacing")),fontVariationSettings:y(t,"font-variation-settings"),fontFeatureSettings:y(t,"font-feature-settings")}}function ve(t,e){const n=t.getAttribute("style");if(n!==null)for(const r of n.split(";")){const i=r.indexOf(":");if(!(i<=0)&&r.slice(0,i).trim().toLowerCase()===e){const o=r.slice(i+1).trim();return o.length>0?o:void 0}}}function y(t,e){const n=t.getAttribute(e);return n!==null&&n.length>0?n:ve(t,e)}function ut(t){if(t===void 0)return;const e=t.trim().toLowerCase();if(e==="normal"||e==="bold")return e;const n=Number.parseInt(e,10);return Number.isFinite(n)?n:void 0}function k(t,e){if(t===void 0)return;const n=t.trim();return e.includes(n)?n:void 0}function U(t){if(t===void 0)return;const e=Number.parseFloat(t);return Number.isFinite(e)?e:void 0}function we(t){for(const e of Array.from(t.children)){if(e.tagName.toLowerCase()!=="textpath")continue;const n=e.getAttribute("href")??e.getAttribute("xlink:href")??"",r=n.startsWith("#")?n.slice(1):n,i=e.getAttribute("startOffset");return{content:e.textContent??"",ref:r.length>0?r:void 0,startOffset:i!==null&&i.length>0?i:void 0}}return null}function $e(t){for(const r of Array.from(t.children))if(r.tagName.toLowerCase()==="title"){const i=(r.textContent??"").trim();if(i.length>0)return i}const e=t.getAttribute("inkscape:label");if(e!==null&&e.length>0)return e;const n=t.getAttribute("data-svge-name");if(n!==null&&n.length>0)return n}function Se(t){try{const e=JSON.parse(t);return Z(e)?e:null}catch{return null}}function v(t){const e={transform:Pt(t.getAttribute("transform")),style:dt(t)},n=$e(t),r=Ae(t),i=Object.keys(r).length>0;return(n!==void 0||i)&&(e.metadata={...n!==void 0?{name:n}:{},...i?{customData:{[Rt]:r}}:{}}),e}function Ae(t){const e={};for(const n of Array.from(t.attributes)){const r=Ot(n.name);r!==null&&(e[r]=n.value)}return e}function ke(t,e,n){const r=t.tagName.toLowerCase();if(r==="script")return e.push("<script> dropped for safety"),null;if(ge.has(r)||r==="defs"||V.has(r))return null;for(const i of Array.from(t.attributes))i.name.toLowerCase().startsWith("on")&&(e.push(`Removed event handler "${i.name}" on <${r}>`),t.removeAttribute(i.name));switch(r){case"g":{const i=t.getAttribute("data-svge-kind"),o=t.getAttribute("inkscape:groupmode"),s=i===tt||o==="layer",a=i===et,u=i===nt,f=v(t);if(s)f.metadata={...f.metadata??{},customData:{...f.metadata?.customData??{},[j]:tt}};else if(a)f.metadata={...f.metadata??{},customData:{...f.metadata?.customData??{},[j]:et}};else if(u){const l={...f.metadata?.customData??{},[j]:nt},d=t.getAttribute("data-svge-page-viewbox");if(d!==null){const h=d.trim().split(/[\s,]+/).map($=>Number.parseFloat($));h.length===4&&h.every($=>Number.isFinite($))&&(l[qt]={x:h[0],y:h[1],width:h[2],height:h[3]})}const x=t.getAttribute("data-svge-page-name");x!==null&&x.length>0&&(l[Kt]=x);const b=t.getAttribute("data-svge-page-options");if(b!==null&&b.length>0)try{const h=JSON.parse(b);typeof h=="object"&&h!==null&&(l[rt]=h)}catch{}f.metadata={...f.metadata??{},customData:l}}const m=t.getAttribute("data-svge-animation");if(m!==null&&m.length>0){const l=Se(m);l!==null&&(f.metadata={...f.metadata??{},customData:{...f.metadata?.customData??{},[it]:l}})}return O(ct(t,e,n),f)}case"rect":return Wt({x:p(t,"x",0,e),y:p(t,"y",0,e),width:p(t,"width",0,e),height:p(t,"height",0,e),rx:E(t,"rx",e),ry:E(t,"ry",e)},v(t));case"ellipse":return Q({cx:p(t,"cx",0,e),cy:p(t,"cy",0,e),rx:p(t,"rx",0,e),ry:p(t,"ry",0,e)},v(t));case"circle":{const i=p(t,"r",0,e);return Q({cx:p(t,"cx",0,e),cy:p(t,"cy",0,e),rx:i,ry:i},v(t))}case"line":return Bt({x1:p(t,"x1",0,e),y1:p(t,"y1",0,e),x2:p(t,"x2",0,e),y2:p(t,"y2",0,e)},v(t));case"polygon":return zt(pt(t.getAttribute("points")),v(t));case"polyline":return Gt(pt(t.getAttribute("points")),v(t));case"path":return Ut(t.getAttribute("d")??"",v(t));case"text":{const i=we(t),o=i===null?xe(t):null,s=i!==null?i.content:o!==null?o.map(a=>a.text).join(""):ye(t);return Vt({x:p(t,"x",0,e),y:p(t,"y",0,e),content:s,fontSize:E(t,"font-size",e),fontFamily:y(t,"font-family"),fontWeight:ut(y(t,"font-weight")),fontStyle:k(y(t,"font-style"),["normal","italic"]),textAnchor:k(y(t,"text-anchor"),["start","middle","end"]),textDecoration:k(y(t,"text-decoration"),["none","underline","line-through"]),letterSpacing:U(y(t,"letter-spacing")),fontVariationSettings:y(t,"font-variation-settings"),fontFeatureSettings:y(t,"font-feature-settings"),textPathRef:i?.ref,textPathStartOffset:i?.startOffset,runs:o??void 0},v(t))}case"image":{const i=Le(t.getAttribute("href")??t.getAttribute("xlink:href")??"",e,r);return Mt({x:p(t,"x",0,e),y:p(t,"y",0,e),width:p(t,"width",0,e),height:p(t,"height",0,e),href:i,preserveAspectRatio:t.getAttribute("preserveAspectRatio")??void 0},v(t))}case"use":{const i=t.getAttribute("href")??t.getAttribute("xlink:href")??"",o=i.startsWith("#")?i.slice(1):i;return o.length===0?(e.push("<use> without an href reference dropped"),null):jt({symbolId:o,x:p(t,"x",0,e),y:p(t,"y",0,e),width:E(t,"width",e),height:E(t,"height",e)},v(t))}default:return n.add(r),null}}const Ee={px:1,pt:96/72,pc:16,in:96,cm:96/2.54,mm:96/25.4,q:96/25.4/4};function ft(t){const e=t.trim().match(/^([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)\s*([a-z%]*)$/i);if(e===null)return null;const n=Number.parseFloat(e[1]);if(!Number.isFinite(n))return null;const r=(e[2]??"").toLowerCase();if(r==="")return{value:n};const i=Ee[r];return i!==void 0?{value:n*i}:{value:n,warnUnit:r}}function lt(t,e,n,r,i){i!==void 0&&i.push(`Unit "${r}" on <${t.tagName.toLowerCase()}> ${e}="${n}" not resolvable to user units \u2014 used the numeric part`)}function p(t,e,n,r){const i=t.getAttribute(e);if(i===null)return n;const o=ft(i);return o===null?n:(o.warnUnit!==void 0&<(t,e,i,o.warnUnit,r),o.value)}function E(t,e,n){const r=t.getAttribute(e);if(r===null)return;const i=ft(r);if(i!==null)return i.warnUnit!==void 0&<(t,e,r,i.warnUnit,n),i.value}function Ne(t,e){const n=t.getAttribute("viewBox");if(n!==null){const o=n.trim().split(/[\s,]+/).map(s=>Number.parseFloat(s));if(o.length===4&&o.every(s=>Number.isFinite(s)))return ot(o[0],o[1],o[2],o[3]);e.push(`Malformed viewBox="${n}" \u2014 using fallback`)}const r=p(t,"width",800),i=p(t,"height",600);return ot(0,0,r,i)}function pt(t){if(t===null)return[];const e=t.trim().split(/[\s,]+/).filter(r=>r.length>0),n=[];for(let r=0;r+1<e.length;r+=2){const i=Number.parseFloat(e[r]),o=Number.parseFloat(e[r+1]);Number.isFinite(i)&&Number.isFinite(o)&&n.push({x:i,y:o})}return n}const Ce=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","visibility","filter","clip-path","mask","vector-effect"];function dt(t){const e={};for(const r of Ce){const i=t.getAttribute(r);i!==null&&mt(e,r,i)}const n=t.getAttribute("style");if(n!==null)for(const r of n.split(";")){const i=r.indexOf(":");i<=0||mt(e,r.slice(0,i).trim().toLowerCase(),r.slice(i+1))}return e.vectorEffect===void 0&&(e.vectorEffect="none"),e}function mt(t,e,n){const r=n.trim();if(r.length!==0)switch(e){case"fill":t.fill=r;break;case"stroke":t.stroke=r;break;case"stroke-width":{const i=Number.parseFloat(r);Number.isFinite(i)&&(t.strokeWidth=i);break}case"opacity":{const i=Number.parseFloat(r);Number.isFinite(i)&&(t.opacity=i);break}case"fill-opacity":{const i=Number.parseFloat(r);Number.isFinite(i)&&(t.fillOpacity=i);break}case"stroke-opacity":{const i=Number.parseFloat(r);Number.isFinite(i)&&(t.strokeOpacity=i);break}case"fill-rule":(r==="nonzero"||r==="evenodd")&&(t.fillRule=r);break;case"stroke-linecap":(r==="butt"||r==="round"||r==="square")&&(t.strokeLinecap=r);break;case"stroke-linejoin":(r==="miter"||r==="round"||r==="bevel")&&(t.strokeLinejoin=r);break;case"stroke-miterlimit":{const i=Number.parseFloat(r);Number.isFinite(i)&&i>=1&&(t.strokeMiterlimit=i);break}case"stroke-dashoffset":{const i=Number.parseFloat(r);Number.isFinite(i)&&(t.strokeDashoffset=i);break}case"stroke-dasharray":{const i=De(r);i!==null&&(t.strokeDasharray=i);break}case"visibility":(r==="visible"||r==="hidden")&&(t.visibility=r);break;case"filter":t.filter=r;break;case"clip-path":t.clipPath=r;break;case"mask":t.mask=r;break;case"mix-blend-mode":t.mixBlendMode=r;break;case"vector-effect":(r==="non-scaling-stroke"||r==="none")&&(t.vectorEffect=r);break}}function De(t){if(t.toLowerCase()==="none")return null;const e=t.split(/[\s,]+/).filter(n=>n.length>0).map(n=>Number.parseFloat(n));return e.length===0||e.some(n=>!Number.isFinite(n)||n<0)?null:e}function Le(t,e,n){const r=t.trim();return r.toLowerCase().startsWith("javascript:")?(e.push(`Removed unsafe href on <${n}>: javascript:... payload`),""):r}function Fe(t){let e=t.parentElement;for(;e!==null;){const n=e.tagName.toLowerCase();if(n==="defs"||V.has(n))return!0;e=e.parentElement}return!1}function Ie(t,e){const n=[],r=new Set,i=Array.from(t.querySelectorAll("*"));for(const s of i)if(s.tagName.toLowerCase()==="defs")for(const a of Array.from(s.children))a.tagName.toLowerCase()!=="defs"&&(r.has(a)||(r.add(a),n.push(a)));for(const s of i)V.has(s.tagName.toLowerCase())&&(Fe(s)||r.has(s)||(r.add(s),n.push(s)));if(n.length===0)return"";const o=n.map(s=>Te(s,e)).filter(s=>s!==null);return o.length===0?"":o.map(s=>s.outerHTML).join(`
|
|
3
|
+
`)}function Te(t,e){if(t.tagName.toLowerCase()==="script")return e.push("<script> inside <defs> dropped for safety"),null;const n=t.cloneNode(!0);ht(n,e);const r=n.ownerDocument.createTreeWalker(n,1),i=[];let o=r.nextNode();for(;o!==null;){const s=o;s.tagName.toLowerCase()==="script"?i.push(s):ht(s,e),o=r.nextNode()}for(const s of i)s.remove();return n}function ht(t,e){for(const n of Array.from(t.attributes)){const r=n.name.toLowerCase();r.startsWith("on")?(e.push(`Removed event handler "${n.name}" on <defs> <${t.tagName}>`),t.removeAttribute(n.name)):(r==="href"||r==="xlink:href")&&n.value.trim().toLowerCase().startsWith("javascript:")&&(e.push(`Removed unsafe href on <defs> <${t.tagName}>: javascript:... payload`),t.setAttribute(n.name,""))}}function _e(t,e){const n=(e??"").trim();if(n.length===0)return t??"";const r=(t??"").trim();if(r.length===0)return n;const i=Pe(r),o=gt(n);if(o===null)return`${r}
|
|
4
|
+
${n}`;const s=[];for(const a of o){const u=a.getAttribute("id");u!==null&&u.length>0&&i.has(u)||s.push(a.outerHTML)}return s.length===0?t??"":`${r}
|
|
5
|
+
${s.join(`
|
|
6
|
+
`)}`}function gt(t){if(typeof DOMParser>"u")return null;try{const n=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,"image/svg+xml").documentElement;return n===null||n.getElementsByTagName("parsererror").length>0?null:Array.from(n.children)}catch{return null}}function Pe(t){const e=new Set,n=gt(t);if(n===null)return e;for(const r of n){const i=r.getAttribute("id");i!==null&&i.length>0&&e.add(i)}return e}const Re=/url\(\s*#([^)\s"']+)\s*\)/g,Oe=["fill","stroke","filter","clipPath","mask"];function yt(t,e){return t.replace(Re,(n,r)=>{const i=e.get(r);return i!==void 0?`url(#${i})`:n})}function xt(t){const e=new Set;if(t==null||t.length===0)return e;if(typeof DOMParser>"u")return wt(t,e);const n=new DOMParser().parseFromString(bt(t),"image/svg+xml");if(n.querySelector("parsererror")!==null)return wt(t,e);const r=n.querySelector("defs");if(r===null)return e;for(const i of Array.from(r.querySelectorAll("*"))){const o=i.getAttribute("id");o!==null&&o.length>0&&e.add(o)}return e}function je(t,e,n,r){const i=new Map;for(const o of xt(e))n.has(o)&&i.set(o,`${r}${o}`);return i.size===0?{root:t,defs:e,renamed:i}:{root:vt(t,i),defs:Me(e,i),renamed:i}}function bt(t){return`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs>${t}</defs></svg>`}function Me(t,e){if(typeof DOMParser>"u")return G(t,e);const n=new DOMParser().parseFromString(bt(t),"image/svg+xml");if(n.querySelector("parsererror")!==null)return G(t,e);const r=n.querySelector("defs");if(r===null)return G(t,e);for(const i of Array.from(r.querySelectorAll("*")))for(const o of Array.from(i.attributes)){const s=o.name.toLowerCase();if(s==="id"){const a=e.get(o.value);a!==void 0&&i.setAttribute(o.name,a);continue}if((s==="href"||s==="xlink:href")&&o.value.startsWith("#")){const a=e.get(o.value.slice(1));if(a!==void 0){i.setAttribute(o.name,`#${a}`);continue}}if(o.value.includes("url(#")){const a=yt(o.value,e);a!==o.value&&i.setAttribute(o.name,a)}}return Array.from(r.children).map(i=>i.outerHTML).join(`
|
|
7
|
+
`)}function vt(t,e){let n=t;const r=Ve(t.style,e);if(r!==t.style&&(n={...n,style:r}),n.type==="symbol-use"){const i=e.get(n.symbolId);i!==void 0&&(n={...n,symbolId:i})}if(st(n)){const i=n,o=i.children.map(s=>vt(s,e));o.some((s,a)=>s!==i.children[a])&&(n={...i,children:o})}return n}function Ve(t,e){let n=null;for(const r of Oe){const i=t[r];if(typeof i=="string"&&i.includes("url(#")){const o=yt(i,e);o!==i&&(n??={...t},n[r]=o)}}return n===null?t:n}function wt(t,e){const n=/\sid\s*=\s*"([^"]+)"/g;let r;for(;(r=n.exec(t))!==null;)e.add(r[1]);return e}function G(t,e){let n=t;for(const[r,i]of e){const o=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(`(\\sid\\s*=\\s*")${o}(")`,"g"),`$1${i}$2`).replace(new RegExp(`((?:xlink:)?href\\s*=\\s*")#${o}(")`,"g"),`$1#${i}$2`).replace(new RegExp(`url\\(\\s*#${o}\\s*\\)`,"g"),`url(#${i})`)}return n}const L={id:"svge.builtin.exporter.svg",name:"SVG",mediaType:"image/svg+xml",extension:"svg",export(t){const e=t.viewBox,n=`${c(e.x)} ${c(e.y)} ${c(e.width)} ${c(e.height)}`,r=Ue(t.root),i=t.exportPreferences?.emitAuthoredTitles!==!1,o=t.exportPreferences?.emitSmilAnimation===!0,s=o?ze(t.root):new Map,a={referencedIds:r,emitTitles:i,emitSmil:o,animDocByNode:s},u=[];if(u.push('<?xml version="1.0" encoding="UTF-8"?>'),u.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${n}" width="${c(e.width)}" height="${c(e.height)}">`),typeof t.defs=="string"&&t.defs.length>0){u.push(" <defs>");for(const f of t.defs.split(`
|
|
8
|
+
`)){const m=f.replace(/^\s+/,"");u.push(m.length>0?` ${m}`:"")}u.push(" </defs>")}for(const f of t.root.children)u.push(W(f,1,a));return u.push("</svg>"),u.join(`
|
|
9
|
+
`)}};function Ue(t){const e=new Set;return M(t,n=>{if(n.type==="text"){const r=n.textPathRef;r!=null&&r.length>0&&e.add(r)}}),e}function Ge(t){return W(t,0,{referencedIds:new Set,emitTitles:!1,emitSmil:!1,animDocByNode:new Map})}function ze(t){const e=new Map;return M(t,n=>{const r=Yt(n);if(r!==null)for(const i of r.tracks)e.has(i.nodeId)||e.set(i.nodeId,r)}),e}function z(t,e){if(!e.emitSmil)return null;const n=e.animDocByNode.get(t.id);if(n===void 0)return null;const r=Jt(n,t.id,t.transform);if(r.length===0)return null;const i=n.tracks.some(o=>o.nodeId===t.id&&Xt.has(o.property));return{smil:r,dropTransform:i}}function F(t,e){if(!e.emitTitles)return!1;const n=t.metadata.name;return typeof n=="string"&&n.length>0}function B(t,e,n){return F(t,n)?`${" ".repeat(e)}<title>${A(t.metadata.name)}</title>`:""}function w(t,e,n,r,i){const o=" ".repeat(n),s=z(r,i),a=S([...e,...q(r,s?.dropTransform??!1)]),u=[];if(F(r,i)&&u.push(B(r,n+1,i)),s!==null){const f=" ".repeat(n+1);for(const m of s.smil)u.push(`${f}${m}`)}return u.length===0?`${o}<${t}${a} />`:`${o}<${t}${a}>
|
|
10
|
+
${u.join(`
|
|
11
|
+
`)}
|
|
12
|
+
${o}</${t}>`}function W(t,e,n){if(t.metadata.visible===!1)return"";switch(t.type){case"group":return We(t,e,n);case"rect":return qe(t,e,n);case"ellipse":return Ke(t,e,n);case"line":return Ye(t,e,n);case"polygon":return Je(t,e,n);case"polyline":return Xe(t,e,n);case"path":return He(t,e,n);case"text":return Ze(t,e,n);case"image":return en(t,e,n);case"symbol-use":return Be(t,e,n)}}function Be(t,e,n){const r=[["href",`#${t.symbolId}`],["x",c(t.x)],["y",c(t.y)]];return t.width!==void 0&&r.push(["width",c(t.width)]),t.height!==void 0&&r.push(["height",c(t.height)]),w("use",r,e,t,n)}function We(t,e,n){const r=" ".repeat(e),i=z(t,n),o=q(t,i?.dropTransform??!1),s=t.metadata.name;if(Ht(t))o.push(["data-svge-kind","layer"]);else if(Zt(t))o.push(["data-svge-kind","smart-object"]);else if(at(t)){o.push(["data-svge-kind","page"]);const d=Qt(t);d!==null&&o.push(["data-svge-page-viewbox",`${c(d.x)} ${c(d.y)} ${c(d.width)} ${c(d.height)}`]);const x=te(t);x.length>0&&x!=="Untitled Page"&&x!==s&&o.push(["data-svge-page-name",x])}at(t)&&t.metadata.customData?.[rt]!=null&&o.push(["data-svge-page-options",JSON.stringify(ee(t))]);const a=t.metadata.customData?.[it];Z(a)&&o.push(["data-svge-animation",JSON.stringify(a)]);const u=F(t,n)?B(t,e+1,n):"",f=" ".repeat(e+1),m=i!==null?i.smil.map(d=>`${f}${d}`):[];if(!st(t)||t.children.length===0){const d=[];return u.length>0&&d.push(u),d.push(...m),d.length>0?`${r}<g${S(o)}>
|
|
13
|
+
${d.join(`
|
|
14
|
+
`)}
|
|
15
|
+
${r}</g>`:`${r}<g${S(o)} />`}const l=[`${r}<g${S(o)}>`];u.length>0&&l.push(u),l.push(...m);for(const d of t.children){const x=W(d,e+1,n);x.length>0&&l.push(x)}return l.push(`${r}</g>`),l.join(`
|
|
16
|
+
`)}function qe(t,e,n){const r=[["x",c(t.x)],["y",c(t.y)],["width",c(t.width)],["height",c(t.height)]];return t.rx!==void 0&&r.push(["rx",c(t.rx)]),t.ry!==void 0&&r.push(["ry",c(t.ry)]),w("rect",r,e,t,n)}function Ke(t,e,n){const r=[["cx",c(t.cx)],["cy",c(t.cy)],["rx",c(t.rx)],["ry",c(t.ry)]];return w("ellipse",r,e,t,n)}function Ye(t,e,n){const r=[["x1",c(t.x1)],["y1",c(t.y1)],["x2",c(t.x2)],["y2",c(t.y2)]];return w("line",r,e,t,n)}function Je(t,e,n){const i=[["points",t.points.map(o=>`${c(o.x)},${c(o.y)}`).join(" ")]];return w("polygon",i,e,t,n)}function Xe(t,e,n){const i=[["points",t.points.map(o=>`${c(o.x)},${c(o.y)}`).join(" ")]];return w("polyline",i,e,t,n)}function He(t,e,n){const r=t.cornerRadius??0,o=[["d",r>0?ne(t.d,r):t.d]];return n.referencedIds.has(t.id)&&o.push(["id",t.id]),w("path",o,e,t,n)}function Ze(t,e,n){const r=" ".repeat(e),i=[["x",c(t.x)],["y",c(t.y)]];t.fontSize!==void 0&&i.push(["font-size",c(t.fontSize)]),t.fontFamily!==void 0&&i.push(["font-family",t.fontFamily]),t.fontWeight!==void 0&&i.push(["font-weight",String(t.fontWeight)]),t.textAnchor!==void 0&&i.push(["text-anchor",t.textAnchor]),t.fontStyle!==void 0&&i.push(["font-style",t.fontStyle]),t.textDecoration!==void 0&&i.push(["text-decoration",t.textDecoration]);const o=[];t.fontVariationSettings!==void 0&&o.push(`font-variation-settings: ${t.fontVariationSettings}`),t.fontFeatureSettings!==void 0&&o.push(`font-feature-settings: ${t.fontFeatureSettings}`),t.letterSpacing!==void 0&&o.push(`letter-spacing: ${c(t.letterSpacing)}px`),o.length>0&&i.push(["style",o.join("; ")]);const s=z(t,n),a=S([...i,...q(t,s?.dropTransform??!1)]),u=" ".repeat(e+1),f=s!==null?s.smil.map(b=>`${u}${b}`):[],m=F(t,n)?B(t,e+1,n):null,l=m!==null?[m]:[],d=t.textPathRef;if(d!=null&&d!==""){const b=t.content.replace(/\s+/g," "),h=t.textPathStartOffset,$=h!=null&&h!==""?` startOffset="${K(h)}"`:"",T=d,_=[...l,...f,`${u}<textPath href="#${K(T)}"${$}>${A(b)}</textPath>`];return`${r}<text${a}>
|
|
17
|
+
${_.join(`
|
|
18
|
+
`)}
|
|
19
|
+
${r}</text>`}if(t.runs!==void 0&&t.runs.length>0){const b=t.runs.map(h=>`<tspan${tn(h)}>${A(h.text)}</tspan>`).join("");if(l.length>0||f.length>0){const h=[...l,...f,`${u}${b}`];return`${r}<text${a}>
|
|
20
|
+
${h.join(`
|
|
21
|
+
`)}
|
|
22
|
+
${r}</text>`}return`${r}<text${a}>${b}</text>`}const x=t.content.includes(`
|
|
23
|
+
`)?t.content.split(`
|
|
24
|
+
`):null;if(x!==null){const b=Qe(t),h=c(t.x),$=x.map((_,_t)=>`${u}<tspan x="${h}" dy="${_t===0?"0":b}">${A(_)}</tspan>`),T=[...l,...f,...$];return`${r}<text${a}>
|
|
25
|
+
${T.join(`
|
|
26
|
+
`)}
|
|
27
|
+
${r}</text>`}if(l.length>0||f.length>0){const b=[...l,...f,`${u}${A(t.content)}`];return`${r}<text${a}>
|
|
28
|
+
${b.join(`
|
|
29
|
+
`)}
|
|
30
|
+
${r}</text>`}return`${r}<text${a}>${A(t.content)}</text>`}function Qe(t){const e=t.lineHeight;return`${typeof e=="number"&&Number.isFinite(e)&&e>0?e:1.2}em`}function tn(t){const e=[];t.fill!==void 0&&e.push(["fill",t.fill]),t.fontFamily!==void 0&&e.push(["font-family",t.fontFamily]),t.fontSize!==void 0&&e.push(["font-size",c(t.fontSize)]),t.fontWeight!==void 0&&e.push(["font-weight",String(t.fontWeight)]),t.fontStyle!==void 0&&e.push(["font-style",t.fontStyle]),t.textDecoration!==void 0&&e.push(["text-decoration",t.textDecoration]);const n=[];return t.letterSpacing!==void 0&&n.push(`letter-spacing: ${c(t.letterSpacing)}px`),t.fontVariationSettings!==void 0&&n.push(`font-variation-settings: ${t.fontVariationSettings}`),t.fontFeatureSettings!==void 0&&n.push(`font-feature-settings: ${t.fontFeatureSettings}`),n.length>0&&e.push(["style",n.join("; ")]),S(e)}function en(t,e,n){const r=[["x",c(t.x)],["y",c(t.y)],["width",c(t.width)],["height",c(t.height)],["href",t.href]];return t.preserveAspectRatio!==void 0&&t.preserveAspectRatio.length>0&&r.push(["preserveAspectRatio",t.preserveAspectRatio]),w("image",r,e,t,n)}function q(t,e=!1){const n=[];return n.push(...rn(t.style)),!e&&!on(t.transform)&&n.push(["transform",sn(t.transform)]),n.push(...nn(t)),n}function nn(t){const e=re(t);return Object.keys(e).sort().map(n=>[ie(n),e[n]])}function rn(t){const e=[];return t.clipPath!==void 0&&e.push(["clip-path",t.clipPath]),t.fill!==void 0&&e.push(["fill",t.fill]),t.fillOpacity!==void 0&&e.push(["fill-opacity",c(t.fillOpacity)]),t.fillRule!==void 0&&e.push(["fill-rule",t.fillRule]),t.filter!==void 0&&e.push(["filter",t.filter]),t.mask!==void 0&&e.push(["mask",t.mask]),t.opacity!==void 0&&e.push(["opacity",c(t.opacity)]),t.stroke!==void 0&&e.push(["stroke",t.stroke]),t.strokeDasharray!==void 0&&t.strokeDasharray.length>0&&e.push(["stroke-dasharray",t.strokeDasharray.map(c).join(" ")]),t.strokeDashoffset!==void 0&&e.push(["stroke-dashoffset",c(t.strokeDashoffset)]),t.strokeLinecap!==void 0&&e.push(["stroke-linecap",t.strokeLinecap]),t.strokeLinejoin!==void 0&&e.push(["stroke-linejoin",t.strokeLinejoin]),t.strokeMiterlimit!==void 0&&e.push(["stroke-miterlimit",c(t.strokeMiterlimit)]),t.strokeOpacity!==void 0&&e.push(["stroke-opacity",c(t.strokeOpacity)]),t.strokeWidth!==void 0&&e.push(["stroke-width",c(t.strokeWidth)]),t.vectorEffect!==void 0&&t.vectorEffect!=="none"&&e.push(["vector-effect",t.vectorEffect]),t.visibility!==void 0&&e.push(["visibility",t.visibility]),t.mixBlendMode!==void 0&&e.push(["style",`mix-blend-mode: ${t.mixBlendMode}`]),e}function on(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0}function sn(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1?`translate(${c(t[4])},${c(t[5])})`:`matrix(${c(t[0])},${c(t[1])},${c(t[2])},${c(t[3])},${c(t[4])},${c(t[5])})`}function S(t){return t.length===0?"":" "+t.map(([e,n])=>`${e}="${K(n)}"`).join(" ")}function c(t){if(!Number.isFinite(t))return"0";const e=Math.round(t*1e6)/1e6,n=Object.is(e,-0)?0:e;return Number.isInteger(n),String(n)}function A(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function K(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function an(t){const e=[],n=new Set,r=i=>{for(const o of i.split(",")){const s=$t(o.trim());if(s.length===0)continue;const a=s.toLowerCase();n.has(a)||(n.add(a),e.push(s))}};return M(t,i=>{if(i.type==="text"){const o=i.fontFamily;typeof o=="string"&&o.length>0&&r(o)}}),e}function $t(t){if(t.length>=2){const e=t[0],n=t[t.length-1];if(e==='"'&&n==='"'||e==="'"&&n==="'")return t.slice(1,-1).trim()}return t}function cn(t,e){if(e.length===0)return t;const n=/<svg\b[^>]*>/.exec(t);if(n===null)return t;const r=n.index+n[0].length,i=`
|
|
31
|
+
<style type="text/css">
|
|
32
|
+
${e}
|
|
33
|
+
</style>`;return t.slice(0,r)+i+t.slice(r)}async function un(t,e){const n=[];for(const r of t)try{const i=await e(r);for(const o of i)o.trim().length>0&&n.push(o.trim())}catch{}return n.join(`
|
|
34
|
+
`)}async function fn(t,e,n=ln){try{const r=an(e);if(r.length===0)return t;const i=await un(r,n);return cn(t,i)}catch{return t}}async function ln(t){if(typeof document>"u"||typeof fetch>"u")return[];const e=t.toLowerCase(),n=[];for(const r of Array.from(document.styleSheets)){let i;try{i=r.cssRules}catch{continue}for(const o of Array.from(i)){if(o.type!==CSSRule.FONT_FACE_RULE)continue;const s=o,a=$t(s.style.getPropertyValue("font-family").trim());if(a.toLowerCase()!==e)continue;const u=await dn(s.style.getPropertyValue("src"));u!==null&&n.push(pn(a,s,u))}}return n}function pn(t,e,n){const r=[` font-family: '${t.replace(/'/g,"\\'")}';`,` src: url(${n});`];for(const i of["font-weight","font-style","font-stretch","unicode-range"]){const o=e.style.getPropertyValue(i).trim();o.length>0&&r.push(` ${i}: ${o};`)}return` @font-face {
|
|
35
|
+
${r.join(`
|
|
36
|
+
`)}
|
|
37
|
+
}`}async function dn(t){const e=/url\(\s*(['"]?)([^'")]+)\1\s*\)/.exec(t);if(e===null)return null;const n=e[2].trim();if(n.startsWith("data:"))return n;try{const r=await fetch(n);if(!r.ok)return null;const i=await r.arrayBuffer();return`data:${mn(n)};base64,${hn(i)}`}catch{return null}}function mn(t){const e=t.toLowerCase();return e.includes(".woff2")?"font/woff2":e.includes(".woff")?"font/woff":e.includes(".otf")?"font/otf":e.includes(".ttf")?"font/ttf":"application/octet-stream"}function hn(t){const e=new Uint8Array(t);let n="";const r=32768;for(let i=0;i<e.length;i+=r)n+=String.fromCharCode(...e.subarray(i,i+r));return btoa(n)}async function St(t,e=2){if(typeof window>"u"||typeof Image>"u")throw new Error("renderPng requires a browser environment");if(!Number.isFinite(e)||e<=0)throw new Error(`renderPng: invalid scale ${e}`);const n=L.export(t);if(typeof n!="string")throw new Error("renderPng: svgExporter returned non-string");const r=t.viewBox,i=Math.max(1,Math.round(r.width*e)),o=Math.max(1,Math.round(r.height*e)),s=await fn(n,t.root);return gn(s,i,o)}function gn(t,e,n){return new Promise((r,i)=>{const o=new Image;let s;try{s=btoa(unescape(encodeURIComponent(t)))}catch(a){i(new Error(`renderPng: failed to base64-encode SVG: ${xn(a)}`));return}o.onload=()=>{const a=window.document.createElement("canvas");a.width=e,a.height=n;const u=a.getContext("2d");if(u===null){i(new Error("renderPng: canvas 2D context unavailable"));return}u.drawImage(o,0,0,e,n),a.toBlob(f=>{f===null?i(new Error("renderPng: canvas.toBlob returned null")):r(f)},"image/png")},o.onerror=()=>{i(new Error("renderPng: Image failed to load SVG payload"))},o.src=`data:image/svg+xml;base64,${s}`})}const yn={id:"svge.builtin.exporter.png",name:"PNG (raster)",mediaType:"image/png",extension:"png",export(t){return St(t,2)}};function xn(t){return t instanceof Error?t.message:String(t)}async function At(t,e){const n=t.writable.getWriter(),r=t.readable.getReader();n.write(e),n.close();const i=[];let o=0;for(;;){const{done:u,value:f}=await r.read();if(u)break;i.push(f),o+=f.byteLength}const s=new Uint8Array(o);let a=0;for(const u of i)s.set(u,a),a+=u.byteLength;return s}async function kt(t){if(typeof CompressionStream>"u")throw new Error("gzip compression is unavailable in this environment (CompressionStream missing)");return At(new CompressionStream("gzip"),new TextEncoder().encode(t))}async function bn(t){if(typeof DecompressionStream>"u")throw new Error("gzip decompression is unavailable in this environment (DecompressionStream missing)");const e=t instanceof Uint8Array?t:new Uint8Array(t),n=await At(new DecompressionStream("gzip"),e);return new TextDecoder().decode(n)}const vn={id:"svge.builtin.exporter.svgz",name:"SVG (compressed)",mediaType:"image/svg+xml",extension:"svgz",async export(t){const e=L.export(t);if(typeof e!="string")throw new Error("svgzExporter: svgExporter returned non-string output");const n=await kt(e);return new Blob([n],{type:"image/svg+xml"})}};function wn(t){const e={};for(const n of t.options??[])e[n.key]=n.default;return e}class D{_generators=P([],...ngDevMode?[{debugName:"_generators"}]:[]);generators=this._generators.asReadonly();register(e){if(typeof e.id!="string"||e.id.length===0)throw new Error("CodeGeneratorRegistry.register: generator.id must be non-empty");if(this._generators().some(n=>n.id===e.id))throw new Error(`CodeGeneratorRegistry.register: generator "${e.id}" is already registered`);return this._generators.set([...this._generators(),e]),{dispose:()=>{this._generators.set(this._generators().filter(n=>n.id!==e.id))}}}get(e){return this._generators().find(n=>n.id===e)??null}static \u0275fac=g.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:D,deps:[],target:g.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=g.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:D,providedIn:"root"})}g.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:g,type:D,decorators:[{type:R,args:[{providedIn:"root"}]}]});const $n=/^\s*<\?xml[^>]*\?>\s*/;function I(t){return t.replace($n,"")}function Et(t){return t.replace(/\b(fill|stroke)="(?!none"|transparent"|currentColor"|url\()[^"]*"/g,'$1="currentColor"')}function Sn(t){return t.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Y(t){return t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function An(t){return t==="class"?"className":t==="for"?"htmlFor":t.startsWith("data-")||t.startsWith("aria-")?t:t.includes(":")?t.split(":").map((e,n)=>n===0?e:e.charAt(0).toUpperCase()+e.slice(1)).map(Y).join(""):t.includes("-")?Y(t):t}function kn(t){return`{{ ${Sn(t).split(";").map(n=>n.trim()).filter(n=>n.length>0).map(n=>{const r=n.indexOf(":");if(r===-1)return null;const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return`${i.startsWith("--")?`'${i}'`:Y(i)}: ${JSON.stringify(o)}`}).filter(n=>n!==null).join(", ")} }}`}const En=/<([a-zA-Z][\w:-]*)((?:\s+[:\w-]+\s*=\s*"[^"]*")*)\s*(\/?)>/g,Nn=/\s*([:\w-]+)\s*=\s*"([^"]*)"/g;function J(t){return I(t).replace(En,(n,r,i,o)=>{const s=i.replace(Nn,(a,u,f)=>u==="style"?` style=${kn(f)}`:` ${An(u)}="${f}"`);return`<${r}${s}${o?" />":">"}`})}function Cn(t){const e=new TextEncoder().encode(t);let n="";const r=32768;for(let i=0;i<e.length;i+=r)n+=String.fromCharCode(...e.subarray(i,i+r));return btoa(n)}function Nt(t,e){const n=I(t).trim();return e==="base64"?`data:image/svg+xml;base64,${Cn(n)}`:`data:image/svg+xml,${encodeURIComponent(n)}`}function Ct(t){const e=t.replace(/[^a-zA-Z0-9]+/g," ").trim();if(e.length===0)return"Icon";const n=e.split(/\s+/).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");return/^[a-zA-Z]/.test(n)?n:`Icon${n}`}function Dn(t,e){return t.split(`
|
|
38
|
+
`).map(n=>n.length>0?e+n:n).join(`
|
|
39
|
+
`)}function Ln(t){const e=t.indexOf(`
|
|
40
|
+
`),n=e===-1?t:t.slice(0,e),r=e===-1?"":t.slice(e);return n.endsWith("/>")?`${n.slice(0,-2).trimEnd()} {...props} />${r}`:n.endsWith(">")?`${n.slice(0,-1).trimEnd()} {...props}>${r}`:t}function Dt(t){const e=L.export(t);if(typeof e!="string")throw new Error("svgExporter unexpectedly returned a non-string");return e}function Lt(t,e){let n=I(Dt(t));return e&&(n=Et(n)),n}function X(t,e){return t?.[e]===!0}const Ft={id:"svge.codegen.react-jsx",name:"React JSX",description:"Inline <svg> with camelCased attributes \u2014 paste straight into JSX.",language:"jsx",extension:"jsx",options:[{kind:"boolean",key:"currentColor",label:"Use currentColor for fills/strokes",default:!1,hint:"Lets the icon inherit the surrounding text color."}],generate(t,e){return J(Lt(t,X(e,"currentColor")))}},It={id:"svge.codegen.react-component",name:"React Component",description:"A standalone component that forwards props onto the <svg> root.",language:"tsx",extension:"tsx",options:[{kind:"text",key:"componentName",label:"Component name",default:"Icon",placeholder:"Icon"},{kind:"boolean",key:"typescript",label:"TypeScript",default:!0},{kind:"boolean",key:"namedExport",label:"Named export (vs default)",default:!1},{kind:"boolean",key:"currentColor",label:"Use currentColor for fills/strokes",default:!1}],generate(t,e){const n=e?.componentName,r=Ct(typeof n=="string"&&n.trim().length>0?n:"Icon"),i=e?.typescript!==!1,o=X(e,"namedExport"),s=X(e,"currentColor"),a=Ln(J(Lt(t,s))),u=Dn(a," "),f=i?`import type { SVGProps } from 'react';
|
|
41
|
+
|
|
42
|
+
`:"",m=i?`${r}(props: SVGProps<SVGSVGElement>)`:`${r}(props)`;return`${f}${o?"export function":"export default function"} ${m} {
|
|
43
|
+
return (
|
|
44
|
+
${u}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
`}},Tt={id:"svge.codegen.data-uri",name:"Data URI",description:"A data: URI for CSS background-image or an <img> src.",language:"text",extension:"txt",options:[{kind:"select",key:"encoding",label:"Encoding",default:"url",choices:[{value:"url",label:"URL-encoded (smaller)"},{value:"base64",label:"Base64"}]}],generate(t,e){const n=e?.encoding==="base64"?"base64":"url";return Nt(Dt(t),n)}},Fn=[Ft,It,Tt];export{Fn as BUILTIN_CODE_GENERATORS,D as CodeGeneratorRegistry,C as ExporterRegistry,N as ImporterRegistry,Et as applyCurrentColor,xt as collectDefsIds,Tt as dataUriGenerator,bn as gunzipText,kt as gzipText,_e as mergeDefsFragments,je as namespaceCollidingDefs,Ge as nodeToSvgMarkup,yn as pngExporter,It as reactComponentGenerator,Ft as reactJsxGenerator,St as renderPng,wn as resolveCodeGeneratorOptionDefaults,I as stripXmlProlog,L as svgExporter,pe as svgImporter,J as svgStringToJsx,Nt as svgToDataUri,vn as svgzExporter,Ct as toPascalCaseComponentName};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as p from"@angular/core";import{signal as x,Injectable as b}from"@angular/core";import{isGroupNode as h,generateNodeId as v,ok as f}from"@mosaicoo/svg-engine/core";class c{_optimizers=x([],...ngDevMode?[{debugName:"_optimizers"}]:[]);optimizers=this._optimizers.asReadonly();register(t){if(typeof t.id!="string"||t.id.length===0)throw new Error("OptimizerRegistry.register: optimizer.id must be non-empty");if(this._optimizers().some(i=>i.id===t.id))throw new Error(`OptimizerRegistry.register: optimizer "${t.id}" is already registered`);return this._optimizers.set([...this._optimizers(),t]),{dispose:()=>{this._optimizers.set(this._optimizers().filter(i=>i.id!==t.id))}}}get(t){return this._optimizers().find(i=>i.id===t)??null}runPipeline(t,i){const s=this._optimizers().filter(a=>i==null?a.defaultEnabled??!0:i.has(a.id)).slice().sort((a,u)=>(a.order??100)-(u.order??100));let o=t;for(const a of s){const u=a.optimize(o);u!==o&&(o=u)}return o}static \u0275fac=p.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:p,type:c,deps:[],target:p.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=p.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:p,type:c,providedIn:"root"})}p.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:p,type:c,decorators:[{type:b,args:[{providedIn:"root"}]}]});const z={id:"svge.builtin.optimize.precision",name:"Round to precision",description:"Round numeric values to 3 decimals to remove floating-point drift",order:10,defaultEnabled:!0,optimize(e){const t=m(e.root,N);return t===e.root?e:{...e,root:t}}},O={id:"svge.builtin.optimize.drop-defaults",name:"Drop default values",description:"Remove redundant style attributes equal to SVG defaults",order:50,defaultEnabled:!0,optimize(e){const t=m(e.root,S);return t===e.root?e:{...e,root:t}}},D={id:"svge.builtin.optimize.strip-authored-titles",name:"Strip authored <title>",description:"Omit <title>...</title> children emitted for nodes with metadata.name. Toggles document.exportPreferences.emitAuthoredTitles.",order:80,defaultEnabled:!1,optimize(e){return e.exportPreferences?.emitAuthoredTitles===!1?e:{...e,exportPreferences:{...e.exportPreferences,emitAuthoredTitles:!1}}}},w={id:"svge.builtin.optimize.prune-empty-groups",name:"Prune empty groups",description:"Remove <g> elements with no children (recursively)",order:90,defaultEnabled:!0,optimize(e){const t=g(e.root.children);return t===e.root.children?e:{...e,root:{...e.root,children:t}}}},I=3,d=10**I;function r(e){return e===void 0||!Number.isFinite(e)?e:Math.round(e*d)/d}function N(e){switch(e.type){case"rect":{const t=e;return{...t,x:r(t.x),y:r(t.y),width:r(t.width),height:r(t.height),rx:r(t.rx),ry:r(t.ry),transform:n(t.transform),style:l(t.style)}}case"ellipse":{const t=e;return{...t,cx:r(t.cx),cy:r(t.cy),rx:r(t.rx),ry:r(t.ry),transform:n(t.transform),style:l(t.style)}}case"line":{const t=e;return{...t,x1:r(t.x1),y1:r(t.y1),x2:r(t.x2),y2:r(t.y2),transform:n(t.transform),style:l(t.style)}}case"polygon":case"polyline":{const t=e;return{...t,points:t.points.map(i=>({x:r(i.x),y:r(i.y)})),transform:n(t.transform),style:l(t.style)}}case"path":return{...e,d:E(e.d),transform:n(e.transform),style:l(e.style)};case"text":{const t=e;return{...t,x:r(t.x),y:r(t.y),fontSize:r(t.fontSize),transform:n(t.transform),style:l(t.style)}}case"image":return{...e,x:r(e.x),y:r(e.y),width:r(e.width),height:r(e.height),transform:n(e.transform),style:l(e.style)};case"group":return{...e,transform:n(e.transform),style:l(e.style)};case"symbol-use":return{...e,x:r(e.x),y:r(e.y),width:r(e.width),height:r(e.height),transform:n(e.transform),style:l(e.style)}}}function n(e){return[r(e[0]),r(e[1]),r(e[2]),r(e[3]),r(e[4]),r(e[5])]}function l(e){const t={...e};return t.strokeWidth!==void 0&&(t.strokeWidth=r(t.strokeWidth)),t.opacity!==void 0&&(t.opacity=r(t.opacity)),t.fillOpacity!==void 0&&(t.fillOpacity=r(t.fillOpacity)),t.strokeOpacity!==void 0&&(t.strokeOpacity=r(t.strokeOpacity)),t}function E(e){return e.replace(/-?\d+\.?\d*(?:[eE][+-]?\d+)?/g,t=>{const i=Number.parseFloat(t);if(!Number.isFinite(i))return t;const s=Math.round(i*d)/d;return Object.is(s,-0)?"0":String(s)})}function S(e){const t={...e.style};let i=!1;return t.fillOpacity===1&&(delete t.fillOpacity,i=!0),t.strokeOpacity===1&&(delete t.strokeOpacity,i=!0),t.opacity===1&&(delete t.opacity,i=!0),t.visibility==="visible"&&(delete t.visibility,i=!0),i?{...e,style:t}:e}function g(e){const t=[];let i=!1;for(const s of e)if(h(s)){const o=g(s.children);if(o.length===0){i=!0;continue}o!==s.children?(t.push({...s,children:o}),i=!0):t.push(s)}else t.push(s);return i?t:e}function m(e,t){if(h(e)){let i=!1;const s=[];for(const u of e.children){const y=m(u,t);y!==u&&(i=!0),s.push(y)}const o=i?{...e,children:s}:e;return t(o)}return t(e)}class k{registry;enabledIds;id=v();label="Optimize";isDestructive=!0;previousDocument=null;constructor(t,i){this.registry=t,this.enabledIds=i}execute(t){const i=t.state.document(),s=this.registry.runPipeline(i,this.enabledIds);return s===i?f():(this.previousDocument=i,t.state.setDocument(s),f())}undo(t){return this.previousDocument===null?f():(t.state.setDocument(this.previousDocument),f())}}export{k as OptimizeCommand,c as OptimizerRegistry,O as dropDefaultsOptimizer,z as precisionOptimizer,w as pruneEmptyGroupsOptimizer,D as stripAuthoredTitlesOptimizer};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import*as e from"@angular/core";import{Injectable as R,input as s,Directive as u,computed as d,inject as F,ChangeDetectionStrategy as O,Component as j,signal as y,viewChild as B,effect as L}from"@angular/core";import{NgComponentOutlet as T}from"@angular/common";import{isIdentity as _,roundPathCorners as z,isGroupNode as C,bbox as Z}from"@mosaicoo/svg-engine/core";class S{entries=new Map;register(t,n){if(this.entries.has(t))throw new Error(`NodeRendererRegistry: type "${t}" is already registered. Call unregister("${t}") first if you intend to override.`);this.entries.set(t,n)}unregister(t){this.entries.delete(t)}resolve(t){return this.entries.get(t)??null}registeredTypes(){return Array.from(this.entries.keys())}static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:S,deps:[],target:e.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=e.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:S,providedIn:"root"})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:S,decorators:[{type:R,args:[{providedIn:"root"}]}]});function A(l){if(_(l))return null;const[t,n,r,o,i,a]=l;return`matrix(${t} ${n} ${r} ${o} ${i} ${a})`}class p{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeEllipse"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:p,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:p,isStandalone:!0,selector:"[svgeEllipse]",inputs:{node:{classPropertyName:"node",publicName:"svgeEllipse",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.cx":"node().cx","attr.cy":"node().cy","attr.rx":"node().rx","attr.ry":"node().ry","attr.fill":"node().style.fill ?? null","attr.fill-rule":"node().style.fillRule ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.fill-opacity":"node().style.fillOpacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:p,decorators:[{type:u,args:[{selector:"[svgeEllipse]",standalone:!0,host:{"[attr.cx]":"node().cx","[attr.cy]":"node().cy","[attr.rx]":"node().rx","[attr.ry]":"node().ry","[attr.fill]":"node().style.fill ?? null","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.fill-opacity]":"node().style.fillOpacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeEllipse",required:!0}]}]}});class g{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeImage"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:g,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:g,isStandalone:!0,selector:"[svgeImage]",inputs:{node:{classPropertyName:"node",publicName:"svgeImage",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.x":"node().x","attr.y":"node().y","attr.width":"node().width","attr.height":"node().height","attr.href":"node().href","attr.preserveAspectRatio":"node().preserveAspectRatio ?? null","attr.opacity":"node().style.opacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null"}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:g,decorators:[{type:u,args:[{selector:"[svgeImage]",standalone:!0,host:{"[attr.x]":"node().x","[attr.y]":"node().y","[attr.width]":"node().width","[attr.height]":"node().height","[attr.href]":"node().href","[attr.preserveAspectRatio]":"node().preserveAspectRatio ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null"}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeImage",required:!0}]}]}});class h{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeLine"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:h,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:h,isStandalone:!0,selector:"[svgeLine]",inputs:{node:{classPropertyName:"node",publicName:"svgeLine",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.x1":"node().x1","attr.y1":"node().y1","attr.x2":"node().x2","attr.y2":"node().y2","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:h,decorators:[{type:u,args:[{selector:"[svgeLine]",standalone:!0,host:{"[attr.x1]":"node().x1","[attr.y1]":"node().y1","[attr.x2]":"node().x2","[attr.y2]":"node().y2","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeLine",required:!0}]}]}});class f{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgePath"});effectiveD=d(()=>{const t=this.node(),n=t.cornerRadius??0;return n<=0?t.d:z(t.d,n)},...ngDevMode?[{debugName:"effectiveD"}]:[]);static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:f,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:f,isStandalone:!0,selector:"[svgePath]",inputs:{node:{classPropertyName:"node",publicName:"svgePath",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.id":"node().id","attr.d":"effectiveD()","attr.fill":"node().style.fill ?? null","attr.fill-rule":"node().style.fillRule ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.fill-opacity":"node().style.fillOpacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:f,decorators:[{type:u,args:[{selector:"[svgePath]",standalone:!0,host:{"[attr.id]":"node().id","[attr.d]":"effectiveD()","[attr.fill]":"node().style.fill ?? null","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.fill-opacity]":"node().style.fillOpacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgePath",required:!0}]}]}});class m{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgePolygon"});pointsAttr=d(()=>this.node().points.map(t=>`${t.x},${t.y}`).join(" "),...ngDevMode?[{debugName:"pointsAttr"}]:[]);static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:m,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:m,isStandalone:!0,selector:"[svgePolygon]",inputs:{node:{classPropertyName:"node",publicName:"svgePolygon",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.points":"pointsAttr()","attr.fill":"node().style.fill ?? null","attr.fill-rule":"node().style.fillRule ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.fill-opacity":"node().style.fillOpacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:m,decorators:[{type:u,args:[{selector:"[svgePolygon]",standalone:!0,host:{"[attr.points]":"pointsAttr()","[attr.fill]":"node().style.fill ?? null","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.fill-opacity]":"node().style.fillOpacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgePolygon",required:!0}]}]}});class v{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgePolyline"});pointsAttr=d(()=>this.node().points.map(t=>`${t.x},${t.y}`).join(" "),...ngDevMode?[{debugName:"pointsAttr"}]:[]);static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:v,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:v,isStandalone:!0,selector:"[svgePolyline]",inputs:{node:{classPropertyName:"node",publicName:"svgePolyline",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.points":"pointsAttr()","attr.fill":"node().style.fill ?? 'none'","attr.fill-rule":"node().style.fillRule ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:v,decorators:[{type:u,args:[{selector:"[svgePolyline]",standalone:!0,host:{"[attr.points]":"pointsAttr()","[attr.fill]":"node().style.fill ?? 'none'","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgePolyline",required:!0}]}]}});class k{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeRect"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:k,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:k,isStandalone:!0,selector:"[svgeRect]",inputs:{node:{classPropertyName:"node",publicName:"svgeRect",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.x":"node().x","attr.y":"node().y","attr.width":"node().width","attr.height":"node().height","attr.rx":"node().rx ?? null","attr.ry":"node().ry ?? null","attr.fill":"node().style.fill ?? null","attr.fill-rule":"node().style.fillRule ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.fill-opacity":"node().style.fillOpacity ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:k,decorators:[{type:u,args:[{selector:"[svgeRect]",standalone:!0,host:{"[attr.x]":"node().x","[attr.y]":"node().y","[attr.width]":"node().width","[attr.height]":"node().height","[attr.rx]":"node().rx ?? null","[attr.ry]":"node().ry ?? null","[attr.fill]":"node().style.fill ?? null","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.fill-opacity]":"node().style.fillOpacity ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeRect",required:!0}]}]}});class x{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeSymbolUse"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:x,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:x,isStandalone:!0,selector:"[svgeSymbolUse]",inputs:{node:{classPropertyName:"node",publicName:"svgeSymbolUse",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.href":"'#' + node().symbolId","attr.x":"node().x","attr.y":"node().y","attr.width":"node().width ?? null","attr.height":"node().height ?? null","attr.fill":"node().style.fill ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.opacity":"node().style.opacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null"}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:x,decorators:[{type:u,args:[{selector:"[svgeSymbolUse]",standalone:!0,host:{"[attr.href]":"'#' + node().symbolId","[attr.x]":"node().x","[attr.y]":"node().y","[attr.width]":"node().width ?? null","[attr.height]":"node().height ?? null","[attr.fill]":"node().style.fill ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null"}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeSymbolUse",required:!0}]}]}});class w{node=s.required({...ngDevMode?{debugName:"node"}:{},alias:"svgeText"});static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:w,deps:[],target:e.\u0275\u0275FactoryTarget.Directive});static \u0275dir=e.\u0275\u0275ngDeclareDirective({minVersion:"17.1.0",version:"21.2.13",type:w,isStandalone:!0,selector:"[svgeText]",inputs:{node:{classPropertyName:"node",publicName:"svgeText",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.x":"node().x","attr.y":"node().y","attr.font-size":"node().fontSize ?? null","attr.font-family":"node().fontFamily ?? null","attr.font-weight":"node().fontWeight ?? null","attr.text-anchor":"node().textAnchor ?? null","attr.font-style":"node().fontStyle ?? null","attr.text-decoration":"node().textDecoration ?? null","style.font-variation-settings":"node().fontVariationSettings ?? null","style.font-feature-settings":"node().fontFeatureSettings ?? null","style.letter-spacing":"node().letterSpacing !== undefined ? node().letterSpacing + 'px' : null","attr.fill":"node().style.fill ?? null","attr.fill-rule":"node().style.fillRule ?? null","attr.fill-opacity":"node().style.fillOpacity ?? null","attr.stroke":"node().style.stroke ?? null","attr.stroke-width":"node().style.strokeWidth ?? null","attr.stroke-opacity":"node().style.strokeOpacity ?? null","attr.stroke-linecap":"node().style.strokeLinecap ?? null","attr.stroke-linejoin":"node().style.strokeLinejoin ?? null","attr.stroke-miterlimit":"node().style.strokeMiterlimit ?? null","attr.stroke-dasharray":'node().style.strokeDasharray?.join(" ") ?? null',"attr.stroke-dashoffset":"node().style.strokeDashoffset ?? null","attr.opacity":"node().style.opacity ?? null","attr.visibility":"node().style.visibility ?? null","attr.filter":"node().style.filter ?? null","attr.vector-effect":'node().style.vectorEffect ?? "non-scaling-stroke"'}},ngImport:e})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:w,decorators:[{type:u,args:[{selector:"[svgeText]",standalone:!0,host:{"[attr.x]":"node().x","[attr.y]":"node().y","[attr.font-size]":"node().fontSize ?? null","[attr.font-family]":"node().fontFamily ?? null","[attr.font-weight]":"node().fontWeight ?? null","[attr.text-anchor]":"node().textAnchor ?? null","[attr.font-style]":"node().fontStyle ?? null","[attr.text-decoration]":"node().textDecoration ?? null","[style.font-variation-settings]":"node().fontVariationSettings ?? null","[style.font-feature-settings]":"node().fontFeatureSettings ?? null","[style.letter-spacing]":"node().letterSpacing !== undefined ? node().letterSpacing + 'px' : null","[attr.fill]":"node().style.fill ?? null","[attr.fill-rule]":"node().style.fillRule ?? null","[attr.fill-opacity]":"node().style.fillOpacity ?? null","[attr.stroke]":"node().style.stroke ?? null","[attr.stroke-width]":"node().style.strokeWidth ?? null","[attr.stroke-opacity]":"node().style.strokeOpacity ?? null","[attr.stroke-linecap]":"node().style.strokeLinecap ?? null","[attr.stroke-linejoin]":"node().style.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"node().style.strokeMiterlimit ?? null","[attr.stroke-dasharray]":'node().style.strokeDasharray?.join(" ") ?? null',"[attr.stroke-dashoffset]":"node().style.strokeDashoffset ?? null","[attr.opacity]":"node().style.opacity ?? null","[attr.visibility]":"node().style.visibility ?? null","[attr.filter]":"node().style.filter ?? null","[attr.vector-effect]":'node().style.vectorEffect ?? "non-scaling-stroke"'}}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"svgeText",required:!0}]}]}});class c{registry=F(S);node=s.required(...ngDevMode?[{debugName:"node"}]:[]);transformAttr=d(()=>A(this.node().transform),...ngDevMode?[{debugName:"transformAttr"}]:[]);customComponent=d(()=>this.registry.resolve(this.node().type),...ngDevMode?[{debugName:"customComponent"}]:[]);groupStyle=d(()=>{const t=this.node();return C(t)?t.style:null},...ngDevMode?[{debugName:"groupStyle"}]:[]);groupDashArray(){const t=this.groupStyle();return t?.strokeDasharray===void 0||t.strokeDasharray.length===0?null:t.strokeDasharray.join(" ")}textContent(){const t=this.node();return t.type==="text"?t.content:""}textHasRuns(){const t=this.node();return t.type==="text"&&t.runs!==void 0&&t.runs.length>0}textRuns(){const t=this.node();return t.type==="text"?t.runs??[]:[]}textIsMultiLine(){return this.textContent().includes(`
|
|
2
|
+
`)}textLines(){const t=this.textContent();return t.length===0?[]:t.split(`
|
|
3
|
+
`)}textX(){const t=this.node();return t.type==="text"?t.x:0}textLineDy(){const t=this.node();if(t.type!=="text")return"1.2em";const n=t.lineHeight;return`${typeof n=="number"&&Number.isFinite(n)&&n>0?n:1.2}em`}textPathHref(){const t=this.node();if(t.type!=="text")return null;const n=t.textPathRef;return n==null||n===""?null:`#${n}`}textPathStartOffset(){const t=this.node();return t.type!=="text"?null:t.textPathStartOffset??null}textPathFlattened(){return this.textContent().replace(/\s+/g," ")}groupChildren(){const t=this.node();return C(t)?t.children:[]}static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:c,deps:[],target:e.\u0275\u0275FactoryTarget.Component});static \u0275cmp=e.\u0275\u0275ngDeclareComponent({minVersion:"17.0.0",version:"21.2.13",type:c,isStandalone:!0,selector:"g[svgeNode]",inputs:{node:{classPropertyName:"node",publicName:"node",isSignal:!0,isRequired:!0,transformFunction:null}},host:{properties:{"attr.data-node-id":"node().id","attr.transform":"transformAttr()","attr.clip-path":"node().style.clipPath ?? null","attr.mask":"node().style.mask ?? null","style.mix-blend-mode":"node().style.mixBlendMode ?? null","attr.fill":"groupStyle()?.fill ?? null","attr.fill-opacity":"groupStyle()?.fillOpacity ?? null","attr.fill-rule":"groupStyle()?.fillRule ?? null","attr.stroke":"groupStyle()?.stroke ?? null","attr.stroke-width":"groupStyle()?.strokeWidth ?? null","attr.stroke-opacity":"groupStyle()?.strokeOpacity ?? null","attr.stroke-linecap":"groupStyle()?.strokeLinecap ?? null","attr.stroke-linejoin":"groupStyle()?.strokeLinejoin ?? null","attr.stroke-miterlimit":"groupStyle()?.strokeMiterlimit ?? null","attr.stroke-dasharray":"groupDashArray()","attr.stroke-dashoffset":"groupStyle()?.strokeDashoffset ?? null","attr.opacity":"groupStyle()?.opacity ?? null","attr.filter":"groupStyle()?.filter ?? null","attr.visibility":"groupStyle()?.visibility ?? null","attr.vector-effect":"groupStyle()?.vectorEffect ?? null","style.display":"node().metadata.visible === false ? 'none' : null"}},ngImport:e,template:`
|
|
4
|
+
@switch (node().type) {
|
|
5
|
+
@case ('rect') {
|
|
6
|
+
<svg:rect [svgeRect]="$any(node())" />
|
|
7
|
+
}
|
|
8
|
+
@case ('ellipse') {
|
|
9
|
+
<svg:ellipse [svgeEllipse]="$any(node())" />
|
|
10
|
+
}
|
|
11
|
+
@case ('line') {
|
|
12
|
+
<svg:line [svgeLine]="$any(node())" />
|
|
13
|
+
}
|
|
14
|
+
@case ('polygon') {
|
|
15
|
+
<svg:polygon [svgePolygon]="$any(node())" />
|
|
16
|
+
}
|
|
17
|
+
@case ('polyline') {
|
|
18
|
+
<svg:polyline [svgePolyline]="$any(node())" />
|
|
19
|
+
}
|
|
20
|
+
@case ('path') {
|
|
21
|
+
<svg:path [svgePath]="$any(node())" />
|
|
22
|
+
}
|
|
23
|
+
@case ('text') {
|
|
24
|
+
<!--
|
|
25
|
+
Rendering order of precedence:
|
|
26
|
+
1. textPathRef set \u2192 wrap content in <textPath href="#id">
|
|
27
|
+
(D-053). textPath ignores newlines, so multi-line is
|
|
28
|
+
flattened \u2014 see TextNode JSDoc for rationale.
|
|
29
|
+
2. Multi-line content (
|
|
30
|
+
in content) \u2192 tspan per line.
|
|
31
|
+
SVG does NOT honor
|
|
32
|
+
in plain text, so we emit explicit
|
|
33
|
+
tspans with x reset + dy=lineHeight em (D-069 \u2014 default
|
|
34
|
+
1.2 when node.lineHeight is undefined).
|
|
35
|
+
3. Single-line content \u2192 bare interpolation. Preserves the
|
|
36
|
+
minimal element structure that existing specs assert on.
|
|
37
|
+
-->
|
|
38
|
+
@if (textPathHref()) {
|
|
39
|
+
<svg:text [svgeText]="$any(node())">
|
|
40
|
+
<svg:textPath
|
|
41
|
+
[attr.href]="textPathHref()"
|
|
42
|
+
[attr.startOffset]="textPathStartOffset() ?? null"
|
|
43
|
+
>
|
|
44
|
+
{{ textPathFlattened() }}
|
|
45
|
+
</svg:textPath>
|
|
46
|
+
</svg:text>
|
|
47
|
+
} @else if (textHasRuns()) {
|
|
48
|
+
<!--
|
|
49
|
+
D-100 \u2014 rich text. Emit one inline tspan per run, each
|
|
50
|
+
carrying its own style overrides; fields a run omits inherit
|
|
51
|
+
from the parent text. The run text is bound via [textContent]
|
|
52
|
+
(NOT template interpolation) so the exact run string is set
|
|
53
|
+
imperatively \u2014 template indentation/reformatting can't inject
|
|
54
|
+
spurious leading/trailing whitespace between inline runs
|
|
55
|
+
(which, unlike the multi-line dy path, are position-sensitive).
|
|
56
|
+
-->
|
|
57
|
+
<svg:text [svgeText]="$any(node())">
|
|
58
|
+
@for (run of textRuns(); track $index) {
|
|
59
|
+
<svg:tspan
|
|
60
|
+
[attr.fill]="run.fill ?? null"
|
|
61
|
+
[attr.font-family]="run.fontFamily ?? null"
|
|
62
|
+
[attr.font-size]="run.fontSize ?? null"
|
|
63
|
+
[attr.font-weight]="run.fontWeight ?? null"
|
|
64
|
+
[attr.font-style]="run.fontStyle ?? null"
|
|
65
|
+
[attr.text-decoration]="run.textDecoration ?? null"
|
|
66
|
+
[style.letter-spacing]="
|
|
67
|
+
run.letterSpacing !== undefined ? run.letterSpacing + 'px' : null
|
|
68
|
+
"
|
|
69
|
+
[style.font-variation-settings]="run.fontVariationSettings ?? null"
|
|
70
|
+
[style.font-feature-settings]="run.fontFeatureSettings ?? null"
|
|
71
|
+
[textContent]="run.text"
|
|
72
|
+
></svg:tspan>
|
|
73
|
+
}
|
|
74
|
+
</svg:text>
|
|
75
|
+
} @else if (textIsMultiLine()) {
|
|
76
|
+
<svg:text [svgeText]="$any(node())">
|
|
77
|
+
@for (line of textLines(); track $index) {
|
|
78
|
+
<svg:tspan [attr.x]="textX()" [attr.dy]="$index === 0 ? '0' : textLineDy()">
|
|
79
|
+
{{ line }}
|
|
80
|
+
</svg:tspan>
|
|
81
|
+
}
|
|
82
|
+
</svg:text>
|
|
83
|
+
} @else {
|
|
84
|
+
<svg:text [svgeText]="$any(node())">{{ textContent() }}</svg:text>
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
@case ('image') {
|
|
88
|
+
<svg:image [svgeImage]="$any(node())" />
|
|
89
|
+
}
|
|
90
|
+
@case ('symbol-use') {
|
|
91
|
+
<!--
|
|
92
|
+
D-059 \u2014 Symbol instance via SVG use href. The symbol
|
|
93
|
+
definition is contributed to defs by ActiveSymbolsService
|
|
94
|
+
(svg-engine/edit) when this id appears in the document tree.
|
|
95
|
+
Browser handles the expansion + transform/style inheritance.
|
|
96
|
+
-->
|
|
97
|
+
<svg:use [svgeSymbolUse]="$any(node())" />
|
|
98
|
+
}
|
|
99
|
+
@case ('group') {
|
|
100
|
+
<!--
|
|
101
|
+
PAGES-REFACTOR Fase 4 \u2014 the page hit-target rect that used
|
|
102
|
+
to live here (PAGES-FIX-4) was removed because it was
|
|
103
|
+
rendered inside the page's wrapper g and re-mounted on
|
|
104
|
+
every selection change, producing the visible "flicker"
|
|
105
|
+
the user reported. The same affordance now lives on the
|
|
106
|
+
projected svgePageOverlay (edit/workspace/): its existing
|
|
107
|
+
paper rect now carries data-node-id={pageId} +
|
|
108
|
+
pointer-events: all when a D-079 page is active, so it
|
|
109
|
+
serves as a persistent hit-target without re-mounting on
|
|
110
|
+
selection change. See Fase 4 in
|
|
111
|
+
docs/08-historico-de-alteracoes.md.
|
|
112
|
+
-->
|
|
113
|
+
@for (child of groupChildren(); track child.id) {
|
|
114
|
+
<svg:g svgeNode [node]="child"></svg:g>
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
@default {
|
|
118
|
+
@if (customComponent(); as comp) {
|
|
119
|
+
<ng-container *ngComponentOutlet="comp; inputs: { node: node() }" />
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`,isInline:!0,dependencies:[{kind:"component",type:c,selector:"g[svgeNode]",inputs:["node"]},{kind:"directive",type:k,selector:"[svgeRect]",inputs:["svgeRect"]},{kind:"directive",type:p,selector:"[svgeEllipse]",inputs:["svgeEllipse"]},{kind:"directive",type:h,selector:"[svgeLine]",inputs:["svgeLine"]},{kind:"directive",type:m,selector:"[svgePolygon]",inputs:["svgePolygon"]},{kind:"directive",type:v,selector:"[svgePolyline]",inputs:["svgePolyline"]},{kind:"directive",type:f,selector:"[svgePath]",inputs:["svgePath"]},{kind:"directive",type:w,selector:"[svgeText]",inputs:["svgeText"]},{kind:"directive",type:g,selector:"[svgeImage]",inputs:["svgeImage"]},{kind:"directive",type:x,selector:"[svgeSymbolUse]",inputs:["svgeSymbolUse"]},{kind:"directive",type:T,selector:"[ngComponentOutlet]",inputs:["ngComponentOutlet","ngComponentOutletInputs","ngComponentOutletInjector","ngComponentOutletEnvironmentInjector","ngComponentOutletContent","ngComponentOutletNgModule"],exportAs:["ngComponentOutlet"]}],changeDetection:e.ChangeDetectionStrategy.OnPush})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:c,decorators:[{type:j,args:[{selector:"g[svgeNode]",standalone:!0,imports:[k,p,h,m,v,f,w,g,x,T],template:`
|
|
124
|
+
@switch (node().type) {
|
|
125
|
+
@case ('rect') {
|
|
126
|
+
<svg:rect [svgeRect]="$any(node())" />
|
|
127
|
+
}
|
|
128
|
+
@case ('ellipse') {
|
|
129
|
+
<svg:ellipse [svgeEllipse]="$any(node())" />
|
|
130
|
+
}
|
|
131
|
+
@case ('line') {
|
|
132
|
+
<svg:line [svgeLine]="$any(node())" />
|
|
133
|
+
}
|
|
134
|
+
@case ('polygon') {
|
|
135
|
+
<svg:polygon [svgePolygon]="$any(node())" />
|
|
136
|
+
}
|
|
137
|
+
@case ('polyline') {
|
|
138
|
+
<svg:polyline [svgePolyline]="$any(node())" />
|
|
139
|
+
}
|
|
140
|
+
@case ('path') {
|
|
141
|
+
<svg:path [svgePath]="$any(node())" />
|
|
142
|
+
}
|
|
143
|
+
@case ('text') {
|
|
144
|
+
<!--
|
|
145
|
+
Rendering order of precedence:
|
|
146
|
+
1. textPathRef set \u2192 wrap content in <textPath href="#id">
|
|
147
|
+
(D-053). textPath ignores newlines, so multi-line is
|
|
148
|
+
flattened \u2014 see TextNode JSDoc for rationale.
|
|
149
|
+
2. Multi-line content (
|
|
150
|
+
in content) \u2192 tspan per line.
|
|
151
|
+
SVG does NOT honor
|
|
152
|
+
in plain text, so we emit explicit
|
|
153
|
+
tspans with x reset + dy=lineHeight em (D-069 \u2014 default
|
|
154
|
+
1.2 when node.lineHeight is undefined).
|
|
155
|
+
3. Single-line content \u2192 bare interpolation. Preserves the
|
|
156
|
+
minimal element structure that existing specs assert on.
|
|
157
|
+
-->
|
|
158
|
+
@if (textPathHref()) {
|
|
159
|
+
<svg:text [svgeText]="$any(node())">
|
|
160
|
+
<svg:textPath
|
|
161
|
+
[attr.href]="textPathHref()"
|
|
162
|
+
[attr.startOffset]="textPathStartOffset() ?? null"
|
|
163
|
+
>
|
|
164
|
+
{{ textPathFlattened() }}
|
|
165
|
+
</svg:textPath>
|
|
166
|
+
</svg:text>
|
|
167
|
+
} @else if (textHasRuns()) {
|
|
168
|
+
<!--
|
|
169
|
+
D-100 \u2014 rich text. Emit one inline tspan per run, each
|
|
170
|
+
carrying its own style overrides; fields a run omits inherit
|
|
171
|
+
from the parent text. The run text is bound via [textContent]
|
|
172
|
+
(NOT template interpolation) so the exact run string is set
|
|
173
|
+
imperatively \u2014 template indentation/reformatting can't inject
|
|
174
|
+
spurious leading/trailing whitespace between inline runs
|
|
175
|
+
(which, unlike the multi-line dy path, are position-sensitive).
|
|
176
|
+
-->
|
|
177
|
+
<svg:text [svgeText]="$any(node())">
|
|
178
|
+
@for (run of textRuns(); track $index) {
|
|
179
|
+
<svg:tspan
|
|
180
|
+
[attr.fill]="run.fill ?? null"
|
|
181
|
+
[attr.font-family]="run.fontFamily ?? null"
|
|
182
|
+
[attr.font-size]="run.fontSize ?? null"
|
|
183
|
+
[attr.font-weight]="run.fontWeight ?? null"
|
|
184
|
+
[attr.font-style]="run.fontStyle ?? null"
|
|
185
|
+
[attr.text-decoration]="run.textDecoration ?? null"
|
|
186
|
+
[style.letter-spacing]="
|
|
187
|
+
run.letterSpacing !== undefined ? run.letterSpacing + 'px' : null
|
|
188
|
+
"
|
|
189
|
+
[style.font-variation-settings]="run.fontVariationSettings ?? null"
|
|
190
|
+
[style.font-feature-settings]="run.fontFeatureSettings ?? null"
|
|
191
|
+
[textContent]="run.text"
|
|
192
|
+
></svg:tspan>
|
|
193
|
+
}
|
|
194
|
+
</svg:text>
|
|
195
|
+
} @else if (textIsMultiLine()) {
|
|
196
|
+
<svg:text [svgeText]="$any(node())">
|
|
197
|
+
@for (line of textLines(); track $index) {
|
|
198
|
+
<svg:tspan [attr.x]="textX()" [attr.dy]="$index === 0 ? '0' : textLineDy()">
|
|
199
|
+
{{ line }}
|
|
200
|
+
</svg:tspan>
|
|
201
|
+
}
|
|
202
|
+
</svg:text>
|
|
203
|
+
} @else {
|
|
204
|
+
<svg:text [svgeText]="$any(node())">{{ textContent() }}</svg:text>
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
@case ('image') {
|
|
208
|
+
<svg:image [svgeImage]="$any(node())" />
|
|
209
|
+
}
|
|
210
|
+
@case ('symbol-use') {
|
|
211
|
+
<!--
|
|
212
|
+
D-059 \u2014 Symbol instance via SVG use href. The symbol
|
|
213
|
+
definition is contributed to defs by ActiveSymbolsService
|
|
214
|
+
(svg-engine/edit) when this id appears in the document tree.
|
|
215
|
+
Browser handles the expansion + transform/style inheritance.
|
|
216
|
+
-->
|
|
217
|
+
<svg:use [svgeSymbolUse]="$any(node())" />
|
|
218
|
+
}
|
|
219
|
+
@case ('group') {
|
|
220
|
+
<!--
|
|
221
|
+
PAGES-REFACTOR Fase 4 \u2014 the page hit-target rect that used
|
|
222
|
+
to live here (PAGES-FIX-4) was removed because it was
|
|
223
|
+
rendered inside the page's wrapper g and re-mounted on
|
|
224
|
+
every selection change, producing the visible "flicker"
|
|
225
|
+
the user reported. The same affordance now lives on the
|
|
226
|
+
projected svgePageOverlay (edit/workspace/): its existing
|
|
227
|
+
paper rect now carries data-node-id={pageId} +
|
|
228
|
+
pointer-events: all when a D-079 page is active, so it
|
|
229
|
+
serves as a persistent hit-target without re-mounting on
|
|
230
|
+
selection change. See Fase 4 in
|
|
231
|
+
docs/08-historico-de-alteracoes.md.
|
|
232
|
+
-->
|
|
233
|
+
@for (child of groupChildren(); track child.id) {
|
|
234
|
+
<svg:g svgeNode [node]="child"></svg:g>
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
@default {
|
|
238
|
+
@if (customComponent(); as comp) {
|
|
239
|
+
<ng-container *ngComponentOutlet="comp; inputs: { node: node() }" />
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
`,host:{"[attr.data-node-id]":"node().id","[attr.transform]":"transformAttr()","[attr.clip-path]":"node().style.clipPath ?? null","[attr.mask]":"node().style.mask ?? null","[style.mix-blend-mode]":"node().style.mixBlendMode ?? null","[attr.fill]":"groupStyle()?.fill ?? null","[attr.fill-opacity]":"groupStyle()?.fillOpacity ?? null","[attr.fill-rule]":"groupStyle()?.fillRule ?? null","[attr.stroke]":"groupStyle()?.stroke ?? null","[attr.stroke-width]":"groupStyle()?.strokeWidth ?? null","[attr.stroke-opacity]":"groupStyle()?.strokeOpacity ?? null","[attr.stroke-linecap]":"groupStyle()?.strokeLinecap ?? null","[attr.stroke-linejoin]":"groupStyle()?.strokeLinejoin ?? null","[attr.stroke-miterlimit]":"groupStyle()?.strokeMiterlimit ?? null","[attr.stroke-dasharray]":"groupDashArray()","[attr.stroke-dashoffset]":"groupStyle()?.strokeDashoffset ?? null","[attr.opacity]":"groupStyle()?.opacity ?? null","[attr.filter]":"groupStyle()?.filter ?? null","[attr.visibility]":"groupStyle()?.visibility ?? null","[attr.vector-effect]":"groupStyle()?.vectorEffect ?? null","[style.display]":"node().metadata.visible === false ? 'none' : null"},changeDetection:O.OnPush}]}],propDecorators:{node:[{type:e.Input,args:[{isSignal:!0,alias:"node",required:!0}]}]}});const W=.05,X=32,E=1.2;class N{_contentBox=y(Z(0,0,800,600),...ngDevMode?[{debugName:"_contentBox"}]:[]);_zoom=y(1,...ngDevMode?[{debugName:"_zoom"}]:[]);_panX=y(0,...ngDevMode?[{debugName:"_panX"}]:[]);_panY=y(0,...ngDevMode?[{debugName:"_panY"}]:[]);_minZoom=y(W,...ngDevMode?[{debugName:"_minZoom"}]:[]);_maxZoom=y(X,...ngDevMode?[{debugName:"_maxZoom"}]:[]);_viewportSize=y({width:0,height:0},...ngDevMode?[{debugName:"_viewportSize"}]:[]);contentBox=this._contentBox.asReadonly();zoom=this._zoom.asReadonly();panX=this._panX.asReadonly();panY=this._panY.asReadonly();minZoom=this._minZoom.asReadonly();maxZoom=this._maxZoom.asReadonly();viewportSize=this._viewportSize.asReadonly();viewBox=d(()=>{const t=this._contentBox(),n=this._zoom(),r=t.width/n,o=t.height/n;return{x:t.x+this._panX()+(t.width-r)/2,y:t.y+this._panY()+(t.height-o)/2,width:r,height:o}},...ngDevMode?[{debugName:"viewBox"}]:[]);fitScale=d(()=>{const t=this._contentBox(),n=this._viewportSize();return!(n.width>0)||!(n.height>0)||!(t.width>0)||!(t.height>0)?null:Math.min(n.width/t.width,n.height/t.height)},...ngDevMode?[{debugName:"fitScale"}]:[]);displayScale=d(()=>{const t=this.fitScale();return t===null?this._zoom():this._zoom()*t},...ngDevMode?[{debugName:"displayScale"}]:[]);setContentBox(t){this._contentBox.set(t)}setViewportSize(t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t<0||n<0)return;const r=this._viewportSize();r.width===t&&r.height===n||this._viewportSize.set({width:t,height:n})}setDisplayScale(t){if(!Number.isFinite(t)||t<=0)return;const n=this.fitScale();this.setZoom(n===null?t:t/n)}actualSize(){this.setDisplayScale(1)}frameNewDocument(){this._panX.set(0),this._panY.set(0);const t=this.fitScale();this.setZoom(t===null?1:Math.min(1/t,1))}setZoom(t){this._zoom.set(this.clampZoom(t))}multiplyZoom(t){this._zoom.update(n=>this.clampZoom(n*t))}zoomIn(t=E){this.multiplyZoom(t)}zoomOut(t=E){this.multiplyZoom(1/t)}setPan(t,n){this._panX.set(t),this._panY.set(n)}pan(t,n){this._panX.update(r=>r+t),this._panY.update(r=>r+n)}zoomAt(t,n){if(!Number.isFinite(t)||t<=0)return;const r=this.viewBox(),o=this._contentBox(),i=this.clampZoom(this._zoom()*t),a=o.width/i,D=o.height/i,I=r.width>0?(n.x-r.x)/r.width:.5,M=r.height>0?(n.y-r.y)/r.height:.5,P=n.x-I*a,V=n.y-M*D,$=P-o.x-(o.width-a)/2,q=V-o.y-(o.height-D)/2;this._zoom.set(i),this._panX.set($),this._panY.set(q)}reset(){this._zoom.set(1),this._panX.set(0),this._panY.set(0)}fit(){this.reset()}fitBox(t,n=.1){const r=this._contentBox(),o=t.x+t.width/2,i=t.y+t.height/2;this._panX.set(o-r.x-r.width/2),this._panY.set(i-r.y-r.height/2);const a=1+2*Math.max(0,n),D=Math.abs(t.width)*a,I=Math.abs(t.height)*a;if(!(D>0)&&!(I>0))return;const M=D>0?r.width/D:1/0,P=I>0?r.height/I:1/0;this._zoom.set(this.clampZoom(Math.min(M,P)))}setZoomLimits(t,n){if(!(t>0)||!(n>0)||t>=n)throw new RangeError(`ViewportService.setZoomLimits: require 0 < min < max (got ${t}, ${n})`);this._minZoom.set(t),this._maxZoom.set(n),this._zoom.update(r=>this.clampZoom(r))}clampZoom(t){return Number.isFinite(t)?Math.max(this._minZoom(),Math.min(this._maxZoom(),t)):1}static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:N,deps:[],target:e.\u0275\u0275FactoryTarget.Injectable});static \u0275prov=e.\u0275\u0275ngDeclareInjectable({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:N,providedIn:"root"})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:N,decorators:[{type:R,args:[{providedIn:"root"}]}]});class b{viewport=F(N);svgRoot=B("svgRoot",...ngDevMode?[{debugName:"svgRoot"}]:[]);svgElement(){return this.svgRoot()?.nativeElement??null}tree=s.required(...ngDevMode?[{debugName:"tree"}]:[]);viewBox=s(null,...ngDevMode?[{debugName:"viewBox"}]:[]);width=s(null,...ngDevMode?[{debugName:"width"}]:[]);height=s(null,...ngDevMode?[{debugName:"height"}]:[]);ariaLabel=s(null,...ngDevMode?[{debugName:"ariaLabel"}]:[]);defs=s(null,...ngDevMode?[{debugName:"defs"}]:[]);viewBoxAttr=d(()=>{const t=this.viewport.viewBox();return`${t.x} ${t.y} ${t.width} ${t.height}`},...ngDevMode?[{debugName:"viewBoxAttr"}]:[]);static DEFS_MARKER_ATTR="data-svge-injected-defs";constructor(){L(()=>{const t=this.viewBox();t&&this.viewport.setContentBox(t)}),L(()=>{this.syncDefs(this.defs())})}syncDefs(t){const n=this.svgRoot();if(n===void 0)return;const r=n.nativeElement,o=r.querySelector(`defs[${b.DEFS_MARKER_ATTR}="1"]`);if(o!==null&&o.remove(),t===null||t.length===0)return;const i=r.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs");i.setAttribute(b.DEFS_MARKER_ATTR,"1"),i.insertAdjacentHTML("afterbegin",t),r.insertBefore(i,r.firstChild)}static \u0275fac=e.\u0275\u0275ngDeclareFactory({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:b,deps:[],target:e.\u0275\u0275FactoryTarget.Component});static \u0275cmp=e.\u0275\u0275ngDeclareComponent({minVersion:"17.2.0",version:"21.2.13",type:b,isStandalone:!0,selector:"svge-renderer",inputs:{tree:{classPropertyName:"tree",publicName:"tree",isSignal:!0,isRequired:!0,transformFunction:null},viewBox:{classPropertyName:"viewBox",publicName:"viewBox",isSignal:!0,isRequired:!1,transformFunction:null},width:{classPropertyName:"width",publicName:"width",isSignal:!0,isRequired:!1,transformFunction:null},height:{classPropertyName:"height",publicName:"height",isSignal:!0,isRequired:!1,transformFunction:null},ariaLabel:{classPropertyName:"ariaLabel",publicName:"ariaLabel",isSignal:!0,isRequired:!1,transformFunction:null},defs:{classPropertyName:"defs",publicName:"defs",isSignal:!0,isRequired:!1,transformFunction:null}},viewQueries:[{propertyName:"svgRoot",first:!0,predicate:["svgRoot"],descendants:!0,isSignal:!0}],ngImport:e,template:`
|
|
244
|
+
<svg
|
|
245
|
+
#svgRoot
|
|
246
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
247
|
+
[attr.viewBox]="viewBoxAttr()"
|
|
248
|
+
[attr.width]="width() ?? null"
|
|
249
|
+
[attr.height]="height() ?? null"
|
|
250
|
+
[attr.role]="'img'"
|
|
251
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
|
252
|
+
>
|
|
253
|
+
<!--
|
|
254
|
+
BEHIND slot: overlays projected with the svgeBehind attribute
|
|
255
|
+
render UNDER the document content. Used for "background" overlays
|
|
256
|
+
like the page rect and the grid \u2014 convention from Illustrator /
|
|
257
|
+
Affinity / Figma where the page is the "paper" beneath shapes,
|
|
258
|
+
not a semi-transparent veil over them. Without this slot the
|
|
259
|
+
page rect (which carries a fill) would tint the entire content
|
|
260
|
+
area below it.
|
|
261
|
+
-->
|
|
262
|
+
<ng-content select="[svgeBehind]" />
|
|
263
|
+
<svg:g svgeNode [node]="tree()"></svg:g>
|
|
264
|
+
<!--
|
|
265
|
+
FRONT (default) slot. Anything projected here without a
|
|
266
|
+
svgeBehind attribute renders ON TOP of the content. Used for
|
|
267
|
+
selection handles, marquee, guides, snap indicators, etc.
|
|
268
|
+
-->
|
|
269
|
+
<ng-content />
|
|
270
|
+
</svg>
|
|
271
|
+
`,isInline:!0,styles:[`:host{display:block;width:100%;height:100%}svg{display:block;width:100%;height:100%;overflow:visible}
|
|
272
|
+
`],dependencies:[{kind:"component",type:c,selector:"g[svgeNode]",inputs:["node"]}],changeDetection:e.ChangeDetectionStrategy.OnPush})}e.\u0275\u0275ngDeclareClassMetadata({minVersion:"12.0.0",version:"21.2.13",ngImport:e,type:b,decorators:[{type:j,args:[{selector:"svge-renderer",standalone:!0,imports:[c],template:`
|
|
273
|
+
<svg
|
|
274
|
+
#svgRoot
|
|
275
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
276
|
+
[attr.viewBox]="viewBoxAttr()"
|
|
277
|
+
[attr.width]="width() ?? null"
|
|
278
|
+
[attr.height]="height() ?? null"
|
|
279
|
+
[attr.role]="'img'"
|
|
280
|
+
[attr.aria-label]="ariaLabel() ?? null"
|
|
281
|
+
>
|
|
282
|
+
<!--
|
|
283
|
+
BEHIND slot: overlays projected with the svgeBehind attribute
|
|
284
|
+
render UNDER the document content. Used for "background" overlays
|
|
285
|
+
like the page rect and the grid \u2014 convention from Illustrator /
|
|
286
|
+
Affinity / Figma where the page is the "paper" beneath shapes,
|
|
287
|
+
not a semi-transparent veil over them. Without this slot the
|
|
288
|
+
page rect (which carries a fill) would tint the entire content
|
|
289
|
+
area below it.
|
|
290
|
+
-->
|
|
291
|
+
<ng-content select="[svgeBehind]" />
|
|
292
|
+
<svg:g svgeNode [node]="tree()"></svg:g>
|
|
293
|
+
<!--
|
|
294
|
+
FRONT (default) slot. Anything projected here without a
|
|
295
|
+
svgeBehind attribute renders ON TOP of the content. Used for
|
|
296
|
+
selection handles, marquee, guides, snap indicators, etc.
|
|
297
|
+
-->
|
|
298
|
+
<ng-content />
|
|
299
|
+
</svg>
|
|
300
|
+
`,changeDetection:O.OnPush,styles:[`:host{display:block;width:100%;height:100%}svg{display:block;width:100%;height:100%;overflow:visible}
|
|
301
|
+
`]}]}],ctorParameters:()=>[],propDecorators:{svgRoot:[{type:e.ViewChild,args:["svgRoot",{isSignal:!0}]}],tree:[{type:e.Input,args:[{isSignal:!0,alias:"tree",required:!0}]}],viewBox:[{type:e.Input,args:[{isSignal:!0,alias:"viewBox",required:!1}]}],width:[{type:e.Input,args:[{isSignal:!0,alias:"width",required:!1}]}],height:[{type:e.Input,args:[{isSignal:!0,alias:"height",required:!1}]}],ariaLabel:[{type:e.Input,args:[{isSignal:!0,alias:"ariaLabel",required:!1}]}],defs:[{type:e.Input,args:[{isSignal:!0,alias:"defs",required:!1}]}]}});function H(l){return{tree:l.root,viewBox:l.viewBox}}function U(l,t,n){if(l===null||typeof l.getScreenCTM!="function"||typeof l.createSVGPoint!="function")return null;const r=l.getScreenCTM();if(r===null)return null;const o=r.inverse(),i=l.createSVGPoint();i.x=t,i.y=n;const a=i.matrixTransform(o);return{x:a.x,y:a.y}}export{S as NodeRendererRegistry,p as SvgeEllipseDirective,g as SvgeImageDirective,h as SvgeLineDirective,c as SvgeNodeRenderer,f as SvgePathDirective,m as SvgePolygonDirective,v as SvgePolylineDirective,k as SvgeRectDirective,b as SvgeRenderer,x as SvgeSymbolUseDirective,w as SvgeTextDirective,N as ViewportService,H as projectDocumentToRenderer,A as renderTransformAttr,U as screenToDoc};
|