@antv/g-lite 2.2.17 → 2.2.18

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.
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-lite
3
3
  * @description A core module for rendering engine implements DOM API.
4
- * @version 2.2.17
5
- * @date 4/11/2025, 8:15:28 AM
4
+ * @version 2.2.18
5
+ * @date 4/14/2025, 2:53:27 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -11,8 +11,8 @@
11
11
  * @antv/g-math
12
12
  * @description Geometry util
13
13
  * @version 3.0.0
14
- * @date 4/11/2025, 8:15:23 AM
14
+ * @date 4/14/2025, 2:53:22 AM
15
15
  * @author AntVis
16
16
  * @docs https://g.antv.antgroup.com/
17
- */function ui(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function li(t,e){var n=Math.min.apply(Math,g(t)),r=Math.min.apply(Math,g(e));return{x:n,y:r,width:Math.max.apply(Math,g(t))-n,height:Math.max.apply(Math,g(e))-r}}function ci(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function hi(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function fi(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=ci(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,g=-1/0,m=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var x=p+k;o>a?x>a&&o>x&&m.push(x):x>o&&a>x&&m.push(x)}for(var E=0;m.length>E;E++){var b=hi(0,e,n,r,i,m[E]);y>b&&(y=b),b>g&&(g=b)}return{x:u,y:y,width:l-u,height:g-y}}function di(t,e,n,r){return ui(t,e,n,r)}function vi(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function pi(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function yi(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(oe(s,0))oe(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;oe(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function gi(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=yi(t,n,i,o),h=yi(e,r,a,s),f=0;c.length>f;f++)u.push(pi(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(pi(e,r,a,s,h[d]));return li(u,l)}function mi(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=ui(r[0],r[1],i[0],i[1])}return e}(t)}function ki(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function xi(t,e,n){var r=t+n-2*e;if(oe(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ei(t,e,n,r,i,a){var o=xi(t,n,i)[0],s=xi(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(ki(t,n,i,o)),void 0!==s&&l.push(ki(e,r,a,s)),li(u,l)}function bi(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Xe(t.parsedStyle.d.absolutePath,void 0,ce(ce({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Mi(t,e){return t[0]===e[0]&&t[1]===e[1]}function wi(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||oe(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Ti(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}ir((function(t){return re(t)?t.split(" ").map(ii):t.map(ii)}));var Si=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Ni=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=Qe(r=se(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),y=v*(-n*h.x/e),g={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},m={x:(h.x-p)/e,y:(h.y-y)/n},k=Si({x:1,y:0},m),x=Si(m,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&x>0?x-=2*Math.PI:a&&0>x&&(x+=2*Math.PI);var E=k+(x%=2*Math.PI)*s,b=e*Math.cos(E),M=n*Math.sin(E);return{x:Math.cos(u)*b-Math.sin(u)*M+g.x,y:Math.sin(u)*b+Math.cos(u)*M+g.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+x,ellipticalArcAngle:E,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Pi(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Ni({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Ni({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Ci(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ai(t,e){return Ci(t)*Ci(e)?(t[0]*e[0]+t[1]*e[1])/(Ci(t)*Ci(e)):1}function Ri(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ai(t,e))}function Oi(t,e){var n=e[1],r=e[2],i=se(Qe(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=r?p*n*f/r:0,g=n?p*-r*h/n:0,m=(s+l)/2+Math.cos(i)*y-Math.sin(i)*g,k=(u+c)/2+Math.sin(i)*y+Math.cos(i)*g,x=[(h-y)/n,(f-g)/r],E=[(-1*h-y)/n,(-1*f-g)/r],b=Ri([1,0],x),M=Ri(x,E);return Ai(x,E)>-1||(M=Math.PI),1>Ai(x,E)||(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&0>M&&(M+=2*Math.PI),{cx:m,cy:k,rx:Mi(t,[l,c])?0:n,ry:Mi(t,[l,c])?0:r,startAngle:b,endAngle:b+M,xRotation:i,arcFlag:a,sweepFlag:o}}function Li(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var Ii=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Pe(t)}catch(n){e=Pe(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Mi([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Oi(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Mi(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],y=Ti(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var g=[u[1],u[2]],m=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-m[0],g[1]-m[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[m[0]-g[0],m[1]-g[1]])}else if("S"===l){var k=e[s-1],x=Ti(k.currentPoint,d),E=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]]):(c.command="SQ",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]])}else if("A"===l){var b=Pi(c,0),M=b.x,w=b.y,T=Pi(c,1,!1),S=T.x,N=T.y;c.startTangent=[M,w],c.endTangent=[S,N]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Ei(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=gi(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=fi(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=ne(n),d=ne(r),v=ee(n),p=ee(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var g=i[y],m=g.currentPoint;m[0]===f?f-=wi(g,e).xExtra:m[0]===v&&(v+=wi(g,e).xExtra),m[1]===d?d-=wi(g,e).yExtra:m[1]===p&&(p+=wi(g,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Di=ir(Ii);function _i(t){return re(t)?Di(t):Ii(t)}function Gi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Ie(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Ie(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=We(r,i));var o,s,u,l,c,h,f,d,v=He(a[0])!==He(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=De(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Fi(t,e){return[t.points,e.points,function(t){return t}]}var Bi=null,Yi=/\s*(\w+)\(([^)]*)\)/g;function Vi(t){return function(e){var n=0;return t.map((function(t){return t===Bi?e[n++]:t}))}}function Ui(t){return t}var ji={matrix:["NNNNNN",[Bi,Bi,0,0,Bi,Bi,0,0,0,0,1,0,Bi,Bi,0,1],Ui],matrix3d:["NNNNNNNNNNNNNNNN",Ui],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Vi([Bi,Bi,new xr(1)]),Ui],scaleX:["N",Vi([Bi,new xr(1),new xr(1)]),Vi([Bi,new xr(1)])],scaleY:["N",Vi([new xr(1),Bi,new xr(1)]),Vi([new xr(1),Bi])],scaleZ:["N",Vi([new xr(1),new xr(1),Bi])],scale3d:["NNN",Ui],skew:["Aa",null,Ui],skewX:["A",null,Vi([Bi,br])],skewY:["A",null,Vi([br,Bi])],translate:["Tt",Vi([Bi,Bi,Er]),Ui],translateX:["T",Vi([Bi,Er,Er]),Vi([Bi,Er])],translateY:["T",Vi([Er,Bi,Er]),Vi([Er,Bi])],translateZ:["L",Vi([Er,Er,Bi])],translate3d:["TTL",Ui]};function Xi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!ji[a])return[];var s=o.map((function(t){return Cr(t)}));e.push({t:a,d:s})}return e}function Hi(t){if(Array.isArray(t))return Xi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Yi.lastIndex=0;e=Yi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?br:$r(t)},N:ii,T:qr,L:zr}[h.toUpperCase()](c):{a:br,n:u[0],t:Er}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Yi.lastIndex===t.length)return n}return[]}function zi(t){if(Array.isArray(t))return Xi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Yi.lastIndex=0;e=Yi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?br:Zr(t)},N:ri,T:Wr,L:Hr}[h.toUpperCase()](c):{a:br,n:u[0],t:Er}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Yi.lastIndex===t.length)return n}return[]}function Wi(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Qe(Qr(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Qe(Qr(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Qe(Qr(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Qe(Qr(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=Qe(Qr(t.d[0])),h=Qe(Qr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Qe(Qr(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Qe(Qr(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,n=ti(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=ti(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=ti(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,n=ti(t.d[1],0,null)||0,r=ti(t.d[2],0,null)||0,1];case"perspective":var f=ti(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function qi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Zi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(sn,t))return!1;if(R(un,sn),un[3]=0,un[7]=0,un[11]=0,un[15]=1,1e-8>Math.abs(_(un)))return!1;var o,s,u=sn[3],l=sn[7],c=sn[11],h=sn[12],f=sn[13],d=sn[14],v=sn[15];if(0!==u||0!==l||0!==c){if(ln[0]=u,ln[1]=l,ln[2]=c,ln[3]=v,!D(un,un))return!1;I(un,un),wt(i,ln,un)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=cn)[0][0]=(s=sn)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=ut(cn[0]),pt(cn[0],cn[0]),r[0]=yt(cn[0],cn[1]),fn(cn[1],cn[1],cn[0],1,-r[0]),n[1]=ut(cn[1]),pt(cn[1],cn[1]),r[0]/=n[1],r[1]=yt(cn[0],cn[2]),fn(cn[2],cn[2],cn[0],1,-r[1]),r[2]=yt(cn[1],cn[2]),fn(cn[2],cn[2],cn[1],1,-r[2]),n[2]=ut(cn[2]),pt(cn[2],cn[2]),r[1]/=n[2],r[2]/=n[2],gt(hn,cn[1],cn[2]),0>yt(cn[0],hn))for(var p=0;3>p;p++)n[p]*=-1,cn[p][0]*=-1,cn[p][1]*=-1,cn[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+cn[0][0]-cn[1][1]-cn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-cn[0][0]+cn[1][1]-cn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-cn[0][0]-cn[1][1]+cn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+cn[0][0]+cn[1][1]+cn[2][2],0)),cn[2][1]>cn[1][2]&&(a[0]=-a[0]),cn[0][2]>cn[2][0]&&(a[1]=-a[1]),cn[1][0]>cn[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Wi).reduce(qi)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var $i=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)o[g][m]*=n[g];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function Ki(t){return t.toFixed(6).replace(".000000","")}function Qi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Zi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Zi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=ie(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return $i(t[0],t[1],t[2],e,t[4]).map(Ki).join(",")}])}function Ji(t){return t.replace(/[XY]/,"")}function ta(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ea(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Cr(o):Cr(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=Qi(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,v=e[f].t,p=t[f].d,y=e[f].d,g=ji[d],m=ji[v],k=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=Qi([t[f]],[e[f]]);u.push(x[0]),l.push(x[1]),c.push(["matrix",[x[2]]])}else{if(d===v)k=d;else if(g[2]&&m[2]&&Ji(d)===Ji(v))k=Ji(d),p=g[2](p),y=m[2](y);else{if(!g[1]||!m[1]||ta(d)!==ta(v)){var E=Qi(t,e);u=[E[0]],l=[E[1]],c=[["matrix",[E[2]]]];break}k=ta(d),p=g[1](p),y=m[1](y)}for(var b=[],M=[],w=[],T=0;p.length>T;T++){var S=Kr(p[T],y[T],n,!1,T);b[T]=S[0],M[T]=S[1],w.push(S[2])}u.push(b),l.push(M),c.push([k,w])}}if(r){var N=u;u=l,l=N}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(n,")")})).join(" ")}]}var na=ir((function(t){if(re(t)){if("text-anchor"===t)return[Cr(0,"px"),Cr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[qr(ra(e[0])),qr(ra(e[1]))]}return[Cr(t[0]||0,"px"),Cr(t[1]||0,"px")]}));function ra(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var ia=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:wn.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:wn.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:wn.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:wn.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:wn.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:wn.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:wn.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:wn.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:wn.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:wn.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:wn.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:wn.FILTER},{n:"clipPath",syntax:wn.DEFINED_PATH},{n:"textPath",syntax:wn.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:wn.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:wn.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"y1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"z1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"x2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"y2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"z2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:wn.PATH,p:50},{n:"points",int:!0,l:!0,syntax:wn.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:wn.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:wn.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:wn.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:wn.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:wn.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:wn.NUMBER,d:function(t){return t===h.PATH||t===h.POLYGON||t===h.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:wn.MARKER},{n:"markerEnd",syntax:wn.MARKER},{n:"markerMid",syntax:wn.MARKER},{n:"markerStartOffset",syntax:wn.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:wn.LENGTH,l:!0,int:!0,d:"0"}],aa=new Set(ia.filter((function(t){return!!t.l})).map((function(t){return t.n}))),oa={},sa=function(){return c((function t(e){var n=this;u(this,t),this.runtime=e,ia.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(g(t.a||[])).forEach((function(e){oa[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=ua(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(aa.has(o)){a=!0;break}var u,l=ua(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=Ur(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Ur(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Ur(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,ei.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Xr(/deg|rad|grad|turn|px|%/g,t)||Ur(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!Kt(e.radius)&&(t.parsedStyle.radius=Jr(e.radius,4)),l.has("lineDash")&&!Kt(e.lineDash)&&(t.parsedStyle.lineDash=Jr(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points={points:re(u=e.points)?u.split(" ").map((function(t){var e=w(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):u,totalLength:0,segments:[]}),l.has("d")&&""===e.d&&(t.parsedStyle.d=s({},Mn)),l.has("d")&&e.d&&(t.parsedStyle.d=_i(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[wn.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!le(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[wn.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[wn.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=Hi(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=na(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!Kt(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[wn.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!Kt(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[wn.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[wn.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[wn.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Ut),r.renderBounds||(r.renderBounds=new Ut);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,u=a.cy,l=void 0===u?0:u,c=a.cz,f=void 0===c?0:c,d=a.hwidth,v=void 0===d?0:d,p=a.hheight,y=void 0===p?0:p,g=a.hdepth,m=void 0===g?0:g,k=[Math.abs(v),Math.abs(y),m],x=i.stroke,E=i.lineWidth,b=void 0===E?1:E,M=i.increasedLineWidthForHitTesting,w=void 0===M?0:M,T=i.shadowType,S=void 0===T?"outer":T,N=i.shadowColor,P=i.filter,C=void 0===P?[]:P,A=i.transformOrigin,R=[s,l,f];if(r.contentBounds.update(R,k),x&&!x.isNone){var O=((b||0)+(w||0))*(e===h.POLYLINE||e===h.POLYGON||e===h.PATH?Math.SQRT2:.5);k[0]+=O,k[1]+=O}if(r.renderBounds.update(R,k),N&&S&&"inner"!==S){var L=r.renderBounds,I=L.min,D=L.max,_=i.shadowBlur||0,G=i.shadowOffsetX||0,F=i.shadowOffsetY||0,B=D[0]+_+G,Y=I[1]-_+F,V=D[1]+_+F;I[0]=Math.min(I[0],I[0]-_+G),D[0]=Math.max(D[0],B),I[1]=Math.min(I[1],Y),D[1]=Math.max(D[1],V),r.renderBounds.setMinMax(I,D)}C.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ft(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}})),t.geometry.dirty=!1;var U=0>y,j=(0>v?-1:1)*(A?ti(A[0],0,t,!0):0),X=(U?-1:1)*(A?ti(A[1],1,t,!0):0);(j||X)&&t.setOrigin(j,X)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===h.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===h.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function ua(t){return t.constructor.PARSED_STYLE_LIST}var la=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n,r){return Qr(n)}}])}(),ca=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof mr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),ha=function(){return c((function t(){u(this,t),this.parser=Ur,this.mixer=jr}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?"none"===n.value?Sr:Nr:n}}])}(),fa=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof mr?[]:n}}])}();function da(t){var e=t.parsedStyle.fontSize;return Kt(e)?null:e}var va=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n,r,i){if(ae(n))return n;if(!xr.isRelativeUnit(n.unit))return n.value;if(n.unit===ar.kPercentage)return 0;if(n.unit===ar.kEms){if(r.parentNode){var a=da(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===ar.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=da(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),pa=function(){return c((function t(){u(this,t),this.mixer=si}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),ya=function(){return c((function t(){u(this,t),this.mixer=si}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),ga=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof mr&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),ma=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ka=function(){return c((function t(){u(this,t),this.mixer=oi(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===h.LINE||r===h.PATH||r===h.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),xa=function(){return c((function t(){u(this,t),this.mixer=oi(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ea=function(){return c((function t(){u(this,t),this.parser=_i,this.mixer=Gi}),[{key:"calculator",value:function(t,e,n){return n instanceof mr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wt(0,0,0,0)}:n}}])}(),ba=c((function t(){u(this,t),this.mixer=Fi})),Ma=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).mixer=oi(0,1/0),t}return M(e,t),c(e)}(va),wa=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ta=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Sa=new WeakMap;var Na="undefined"!=typeof window&&void 0!==window.document;function Pa(t){return!!t.getAttribute}function Ca(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Aa(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Ra(t,e){if(Na)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Oa={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},La="object"==typeof performance&&performance.now?performance:Date;function Ia(t){return t.nodeName===h.FRAGMENT||t.getRootNode().nodeName===h.FRAGMENT}var Da=1,_a="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},Ga=Date.now(),Fa={},Ba=Date.now(),Ya=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ba,r=n>16?0:16-n,i=Da++;return Fa[i]=t,Object.keys(Fa).length>1||setTimeout((function(){Ba=e;var t=Fa;Fa={},Object.keys(t).forEach((function(e){return t[e](_a.performance&&"function"==typeof _a.performance.now?_a.performance.now():Date.now()-Ga)}))}),r),i},Va=function(t){delete Fa[t]},Ua=function(t){return"string"!=typeof t?Ya:""===t?_a.requestAnimationFrame:_a["".concat(t,"RequestAnimationFrame")]},ja=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Ua(t)})),Xa=Ua(ja),Ha=function(t){return"string"!=typeof t?Va:""===t?_a.cancelAnimationFrame:_a["".concat(t,"CancelAnimationFrame")]||_a["".concat(t,"CancelRequestAnimationFrame")]}(ja);_a.requestAnimationFrame=Xa,_a.cancelAnimationFrame=Ha;var za=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}();function Wa(){Wa=function(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=Object.create((e&&e.prototype instanceof m?e:m).prototype),o=new R(r||[]);return a(i,"_invoke",{value:N(t,n,o)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",y="completed",g={};function m(){}function k(){}function x(){}var E={};c(E,s,(function(){return this}));var b=Object.getPrototypeOf,M=b&&b(b(O([])));M&&M!==n&&i.call(M,s)&&(E=M);var w=x.prototype=m.prototype=Object.create(E);function T(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(a,o,s,u){var l=f(t[a],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==r(h)&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function N(e,n,r){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?y:v,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(i.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return k.prototype=x,a(w,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:k,configurable:!0}),k.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},T(S.prototype),c(S.prototype,u,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new S(h(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},T(w),c(w,l,"Generator"),c(w,s,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var u=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&i.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var a=r;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function qa(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Za(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){qa(a,r,i,o,s,"next",t)}function s(t){qa(a,r,i,o,s,"throw",t)}o(void 0)}))}}var $a=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Za(Wa().mark((function t(){var e,n,r,i,a=arguments;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(r>=this.callbacks.length-1){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),Ka=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),Qa=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=0;this.callbacks.length-1>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),Ja=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],to=/([\"\'])[^\'\"]+\1/;function eo(t,e,n){return L(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var no=A(),ro=A(),io={scale:function(t){U(no,[t[0].value,t[1].value,1])},scaleX:function(t){U(no,[t[0].value,1,1])},scaleY:function(t){U(no,[1,t[0].value,1])},scaleZ:function(t){U(no,[1,1,t[0].value])},scale3d:function(t){U(no,[t[0].value,t[1].value,t[2].value])},translate:function(t){V(no,[t[0].value,t[1].value,0])},translateX:function(t){V(no,[t[0].value,0,0])},translateY:function(t){V(no,[0,t[0].value,0])},translateZ:function(t){V(no,[0,0,t[0].value])},translate3d:function(t){V(no,[t[0].value,t[1].value,t[2].value])},rotate:function(t){z(no,Qe(Qr(t[0])))},rotateX:function(t){X(no,Qe(Qr(t[0])))},rotateY:function(t){H(no,Qe(Qr(t[0])))},rotateZ:function(t){z(no,Qe(Qr(t[0])))},rotate3d:function(t){j(no,Qe(Qr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){eo(no,Qe(t[0].value),Qe(t[1].value))},skewX:function(t){eo(no,Qe(t[0].value),0)},skewY:function(t){eo(no,0,Qe(t[0].value))},matrix:function(t){O(no,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){O.apply(ot,[no].concat(g(t.map((function(t){return t.value})))))}},ao=lt(1,1,1),oo=st(),so={translate:function(t,e){vs.sceneGraphService.setLocalScale(t,ao,!1),vs.sceneGraphService.setLocalEulerAngles(t,oo,void 0,void 0,!1),vs.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),vs.sceneGraphService.dirtifyLocal(t,t.transformable)}};function uo(t,e){if(t.length){if(1===t.length&&so[t[0].t])return void so[t[0].t](e,t[0].d);for(var n=L(ro),r=0;t.length>r;r++){var i=t[r],a=io[i.t];a&&(a(i.d),at(n,n,no))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var lo=function(){return c((function t(){u(this,t),this.parser=zi,this.mixer=ea}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?[]:n}},{key:"postProcessor",value:function(t){uo(t.parsedStyle.transform,t)}}])}(),co=function(){return c((function t(){u(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===ar.kPixels&&e[1].unit===ar.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ho=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=bn.Z_INDEX_CHANGED)}}}])}(),fo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),vo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),po=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),yo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),go=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){if(t.points&&Qt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,g(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,g(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,g(e.map((function(t){return t[1]})))),a=(r-n)/2,o=(Math.max.apply(Math,g(e.map((function(t){return t[1]}))))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),mo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!re(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),ko=function(){return c((function t(e){u(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,y=t.y,g=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var m=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,m.offscreenCanvas);t.metrics=k;var x=k.width/2,E=k.height/2,b=p+x;"center"===a||"middle"===a?b+=s/2-x:"right"!==a&&"end"!==a||(b+=s-2*x);var M=g-E;return"middle"===l?M+=E:"top"===l||"hanging"===l?M+=2*E:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),h&&(b+=h),d&&(M+=d),{cx:b,cy:M,hwidth:x,hheight:E}}}])}(),xo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Eo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var bo=function(){return c((function t(e){u(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new zt,this.page=new zt,this.canvas=new zt,this.viewport=new zt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(qt)}}])}(),Mo=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).client=new zt,t.movement=new zt,t.offset=new zt,t.global=new zt,t.screen=new zt,t}return M(e,t),c(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(qt)}}])}(bo),wo=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return M(e,t),c(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Mo),To=function(t){function e(){return u(this,e),E(this,e,arguments)}return M(e,t),c(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Mo);function So(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var No=function(t){function e(t,n){var r;return u(this,e),(r=E(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return M(e,t),c(e)}(bo),Po=new WeakMap,Co=function(){return c((function t(){u(this,t),this.emitter=new S}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(ue(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=$t(e)?e:e.handleEvent;var s=$t(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(ue(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=$t(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=$t(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new No(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Po.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Po.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Ao=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return M(e,t),c(e,[{key:"textContent",get:function(){var t="";this.nodeName===h.TEXT&&(t+=this.style.text);var e,n=So(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===h.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===h.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(qt)}},{key:"lookupNamespaceURI",value:function(t){throw Error(qt)}},{key:"lookupPrefix",value:function(t){throw Error(qt)}},{key:"normalize",value:function(){throw Error(qt)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Co);Ao.DOCUMENT_POSITION_DISCONNECTED=1,Ao.DOCUMENT_POSITION_PRECEDING=2,Ao.DOCUMENT_POSITION_FOLLOWING=4,Ao.DOCUMENT_POSITION_CONTAINS=8,Ao.DOCUMENT_POSITION_CONTAINED_BY=16,Ao.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ro=function(){return c((function t(e,n){var r=this;u(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=A(),this.tmpVec3=st(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=La.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Ao.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&e-c.timeStamp<r.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Ao.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Ao.isNode(a)&&a.parentNode;l&&l!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Ao.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Ao.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Ao.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ao.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new zt((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new zt((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=G(this.tmpMatrix,u,s),c=ht(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return mt(c,c,l),new zt(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=G(this.tmpMatrix,n,r),a=ht(this.tmpVec3,t.x,t.y,0);mt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new zt((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e))}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Ao.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(wo);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(To);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(To);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(wo);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=La.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ao.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Pa(e)&&e.getAttribute("cursor");if(n)return n;e=Ao.isNode(e)&&e.parentNode}}}])}(),Oo=function(){return c((function t(){u(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||vs.offscreenCanvas)this.canvas=t||vs.offscreenCanvas,this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Lo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Io=function(){return c((function t(e,n){u(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ka,initAsync:new za,dirtycheck:new Qa,cull:new Qa,beginFrame:new Ka,beforeRender:new Ka,render:new Ka,afterRender:new Ka,endFrame:new Ka,destroy:new Ka,pick:new $a,pickSync:new Qa,pointerDown:new Ka,pointerUp:new Ka,pointerMove:new Ka,pointerOut:new Ka,pointerOver:new Ka,pointerWheel:new Ka,pointerCancel:new Ka,click:new Ka},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=s(s({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Lo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Lo.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=o?r.hooks.cull.call(s,r.context.camera):s;u&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(u))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l,c=u.pop();s(c);for(var h=(null===(l=c.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?c.sortable.sorted:c.childNodes,f=h.length-1;f>=0;f--)u.push(h[f])}}},{key:"sort",value:function(t,e){var n;e.sorted&&e.dirtyReason!==bn.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Ca(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Ca),(null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&0===t.childNodes.filter((function(t){return t.parsedStyle.zIndex})).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Lo.DISPLAY_OBJECT_CHANGED)}}])}(),Do=/\[\s*(.*)=(.*)\s*\]/,_o=function(){return c((function t(){u(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Do),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Kt(n)?"":n.toString?""+n:""}}])}(),Go=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Fo=function(t){function e(t,n,r,i,a,o,s,l){var c;return u(this,e),(c=E(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=l,c.type=t,c}return M(e,t),c(e)}(bo);function Bo(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Fo.ADDITION=2,Fo.MODIFICATION=1,Fo.REMOVAL=3;var Yo,Vo,Uo,jo=new Fo(Go.REPARENT,null,"","","",0,"",""),Xo=Dt(),Ho=st(),zo=lt(1,1,1),Wo=A(),qo=Dt(),Zo=st(),$o=A(),Ko=Tt(),Qo=st(),Jo=Tt(),ts=st(),es=st(),ns=st(),rs=A(),is=Tt(),as=Tt(),os=Tt(),ss={affectChildren:!0},us=function(){return c((function t(e){u(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new No(Go.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===h.FRAGMENT,o=Ia(e);t.parentNode=e;var s=a?t.childNodes:[t];ae(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=bn.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(jo)}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=bn.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=Ko;Ct(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);Rt(os,a),Pt(os,os),Nt(r,os,r),Nt(n.localRotation,r,i),It(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Ct(as,e[0],e[1],e[2]),Lt(n.localRotation,n.localRotation,as),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Ct(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Rt(is,Pt(Ko,r)),Lt(n.localRotation,n.localRotation,is),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Ct(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;kt(e,Ho)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),ft(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ns[0]=e[0],ns[1]=e[1],ns[2]=null!==(n=e[2])&&void 0!==n?n:0,!kt(this.getPosition(t),ns)){if(ct(r.position,ns),null!==t.parentNode&&t.parentNode.transformable)R(rs,t.parentNode.transformable.worldTransform),D(rs,rs),mt(r.localPosition,ns,rs);else ct(r.localPosition,ns);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;es[0]=e[0],es[1]=e[1],es[2]=null!==(n=e[2])&&void 0!==n?n:0,kt(i.localPosition,es)||(ct(i.localPosition,es),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=ht(Zo,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ht(Zo,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),kt(Zo,i.localScale)||(ct(i.localScale,Zo),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ht(Zo,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),kt(e,Ho)||(ft(Zo,this.getPosition(t),e),this.setPosition(t,Zo))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=At(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Rt(Ko,o),Pt(Ko,Ko),Nt(a.localRotation,Ko,e),It(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ot(Ko,e,n,r,i));var o=t.transformable;Rt(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(qo,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){Ia(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;r>i;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===h.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==h.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==h.FRAGMENT&&(ss.affectChildren=t,t?e.forEach((function(t){n(t,ss)})):n(e,ss))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Bo(n),n=n.parentNode;e&&t.forEach((function(t){Bo(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Fo(Go.ATTR_MODIFIED,n,e,e,t,Fo.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return q(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return $(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return Z(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){K(t.localTransform,t.localRotation,t.localPosition,lt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(L($o),$o[4]=Math.tan(t.localSkew[0]),$o[1]=Math.tan(t.localSkew[1]),G(t.localTransform,t.localTransform,$o));var e=K($o,Ot(Ko,0,0,0,1),ht(Zo,1,1,1),t.localScale,t.origin);G(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?K(n,i,r,a,o):s?V(n,r):L(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=q(Qo,e),r=$(Jo,e),i=Z(ts,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,zo,!1),this.setLocalPosition(t,Ho,!1),this.setLocalEulerAngles(t,Ho,void 0,void 0,!1),this.setLocalSkew(t,Xo,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Ut.isEmpty(n)){var r=e||new Ut;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&vs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Ut}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Ut).update(r.center,r.halfExtents))})),a||(a=new Ut),n){var o=Aa(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Wo;t.parentNode.transformable&&(e=D($o,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ut.isEmpty(n)){var r=new Ut;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Ut.isEmpty(r)||(n=new Ut).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=w(n.getMin(),2),o=a[0],s=a[1],u=w(n.getMax(),2);return new Wt(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new Wt((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?G(e.worldTransform,r.worldTransform,e.localTransform):R(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),ls={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},cs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,hs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),fs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ds=function(){return c((function t(e){var n=this;u(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!fs.exec(e)&&!hs.exec(t))},this.trimByKinsokuShorui=function(t){var e=g(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=ls.MetricsString+ls.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ls.BaselineSymbol).width),u=ls.HeightMultiplier*s;s=s*ls.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==l[d+y]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,y=e.textPath,g=e.leading,m=void 0===g?0:g,k=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,u=void 0===s?"normal":s,l=t.fontWeight,c=void 0===l?"normal":l,h=ae(n)&&"".concat(n,"px")||"16px",f=i.split(","),d=f.length-1;d>=0;d--){var v=f[d].trim();!to.test(v)&&0>Ja.indexOf(v)&&(v='"'.concat(v,'"')),f[d]=v}return"".concat(o," ").concat(u," ").concat(c," ").concat(h," ").concat(f.join(","))}(e),x=this.measureFont(k,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var E=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);E.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=Array(b.length),w=0;if(!y){for(var T=0;b.length>T;T++){var S=E.measureText(b[T]).width+(b[T].length-1)*p;M[T]=S,w=Math.max(w,S)}var N=w+l,P=s||x.fontSize+l,C=Math.max(P,x.fontSize+l)+(b.length-1)*(P+m),A=0;return"middle"===h?A=-C/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?A=-C:"top"!==h&&"hanging"!==h||(A=0),{font:k,width:N,height:C,lines:b,lineWidths:M,lineHeight:P+=m,maxLineWidth:w,fontProperties:x,lineMetrics:M.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Wt(n-l/2,A+e*P,t+l,P)}))}}y.getTotalLength();for(var R=0;b.length>R;R++)E.measureText(b[R])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=this,a=e.wordWrapWidth,o=void 0===a?0:a,s=e.letterSpacing,u=void 0===s?0:s,l=e.maxLines,c=void 0===l?1/0:l,h=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=o+u,v="";"ellipsis"===h?v="...":h&&"clip"!==h&&(v=h);var p=Array.from(t),y=[],g=0,m=0,k=0,x={},E=function(t){return r.getFromCache(t,u,x,f)},b=E(v);function M(t,e,n,r){for(;E(t)<r&&p.length-1>e&&!i.isNewline(p[e+1]);)t+=p[e+=1];for(;E(t)>r&&e>n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(b>0&&d>=b)if(y[t]){var n=M(y[t],e,k+1,d-b);y[t]=n.lineTxt+v}else y[t]=v}for(var T=0;p.length>T;T++){var S=p[T],N=p[T-1],P=p[T+1],C=E(S);if(this.isNewline(S)){if(g+1>=c){e.isOverflowing=!0,p.length-1>T&&w(g,T-1);break}k=T-1,m=0,y[g+=1]=""}else{if(m>0&&m+C>d){var A=M(y[g],T-1,k+1,d);if(A.txtLastCharIndex!==T-1){if(y[g]=A.lineTxt,A.txtLastCharIndex===p.length-1)break;N=p[(T=A.txtLastCharIndex+1)-1],P=p[T+1],C=E(S=p[T])}if(g+1>=c){e.isOverflowing=!0,w(g,T-1);break}if(k=T-1,m=0,y[g+=1]="",this.isBreakingSpace(S))continue;this.canBreakInLastChar(S)||(y=this.trimToBreakable(y),m=this.sumTextWidthByCache(y[g]||"",E)),this.shouldBreakByKinsokuShorui(S,P)&&(y=this.trimByKinsokuShorui(y),m+=E(N||""))}m+=C,y[g]=(y[g]||"")+S}}return y.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ls.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ls.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=g(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!cs.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!cs.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e,o=r.measureText(t);n[t]=i=o.width+a}return i}}])}(),vs={},ps=(Vo=new mo,Uo=new go,a(a(a(a(a(a(a(a(a(a(Yo={},h.FRAGMENT,null),h.CIRCLE,new fo),h.ELLIPSE,new vo),h.RECT,Vo),h.IMAGE,Vo),h.GROUP,new xo),h.LINE,new po),h.TEXT,new ko(vs)),h.POLYLINE,Uo),h.POLYGON,Uo),a(a(a(Yo,h.PATH,new yo),h.HTML,new Eo),h.MESH,null)),ys=function(t){var e=new ha,n=new va;return a(a(a(a(a(a(a(a(a(a(t={},wn.PERCENTAGE,null),wn.NUMBER,new ma),wn.ANGLE,new la),wn.DEFINED_PATH,new ca),wn.PAINT,e),wn.COLOR,e),wn.FILTER,new fa),wn.LENGTH,n),wn.LENGTH_PERCENTAGE,n),wn.LENGTH_PERCENTAGE_12,new pa),a(a(a(a(a(a(a(a(a(a(t,wn.LENGTH_PERCENTAGE_14,new ya),wn.COORDINATE,new va),wn.OFFSET_DISTANCE,new ka),wn.OPACITY_VALUE,new xa),wn.PATH,new Ea),wn.LIST_OF_POINTS,new ba),wn.SHADOW_BLUR,new Ma),wn.TEXT,new wa),wn.TEXT_TRANSFORM,new Ta),wn.TRANSFORM,new lo),a(a(a(t,wn.TRANSFORM_ORIGIN,new co),wn.Z_INDEX,new ho),wn.MARKER,new ga)}();vs.CameraContribution=mn,vs.AnimationTimeline=null,vs.EasingFunction=null,vs.offscreenCanvasCreator=new Oo,vs.sceneGraphSelector=new _o,vs.sceneGraphService=new us(vs),vs.textService=new ds(vs),vs.geometryUpdaterFactory=ps,vs.CSSPropertySyntaxFactory=ys,vs.styleValueRegistry=new sa(vs),vs.layoutRegistry=null,vs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},vs.enableStyleSyntax=!0,vs.enableSizeAttenuation=!1;var gs=0;var ms=new Fo(Go.INSERTED,null,"","","",0,"",""),ks=new Fo(Go.REMOVED,null,"","","",0,"",""),xs=new No(Go.DESTROY),Es=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).entity=gs++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:En.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return M(e,t),c(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return vs.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ia(this)||t.nodeName!==h.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(ms.relatedNode=this,t.dispatchEvent(ms)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return ks.relatedNode=this,t.dispatchEvent(ks),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),vs.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return vs.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return vs.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return vs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return vs.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return vs.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return vs.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return vs.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(vs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,g(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(xs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return vs.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return vs.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return vs.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return vs.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return vs.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(qt)}},{key:"getAttributeNode",value:function(t){throw Error(qt)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(qt)}},{key:"hasAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(qt)}},{key:"setAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNodeNS",value:function(t){throw Error(qt)}},{key:"toggleAttribute",value:function(t,e){throw Error(qt)}}])}(Ao);function bs(t){return!(null==t||!t.nodeName)}var Ms=vs.globalThis.Proxy?vs.globalThis.Proxy:function(){},ws=new Fo(Go.ATTR_MODIFIED,null,null,null,null,Fo.MODIFICATION,null,null),Ts=st(),Ss=Tt(),Ns=function(t){function e(t){var n;return u(this,e),(n=E(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||h.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),vs.enableStyleSyntax&&(n.style=new Ms({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return M(e,t),c(e,[{key:"destroy",value:function(){xn(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=s({},this.attributes);for(var r in n){var i=n[r];bs(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(s(s({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){vs.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];le(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),xn(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];vs.styleValueRegistry.processProperties(this,a({},t,e),n),r.dirty=!0;var s,u=this.parsedStyle[t];(this.isConnected&&(ws.relatedNode=this,ws.prevValue=i,ws.newValue=e,ws.attrName=t,ws.prevParsedValue=o,ws.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(ws):(ws.target=this,this.ownerDocument.defaultView.dispatchEvent(ws,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(s=this.attributeChangedCallback)||void 0===s||s.call(this,t,i,e,o,u))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=w(t.getMin(),2),n=e[0],r=e[1],i=w(t.getMax(),2);return new Wt(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return vs.sceneGraphService.setOrigin(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return vs.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return vs.sceneGraphService.setPosition(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return vs.sceneGraphService.setLocalPosition(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return vs.sceneGraphService.translate(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return vs.sceneGraphService.translateLocal(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return vs.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return vs.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=$e(t,e=e||t,n=n||t,!1)),vs.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=$e(t,e=e||t,n=n||t,!1)),vs.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return vs.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return vs.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return tn(w(rn(Ts,vs.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return tn(w(rn(Ts,vs.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return vs.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return vs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return Kt(e)&&Kt(n)?vs.sceneGraphService.rotateLocal(this,0,0,t):vs.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return Kt(e)&&Kt(n)?vs.sceneGraphService.rotate(this,0,0,t):vs.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return vs.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return vs.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return vs.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return vs.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return vs.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return vs.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return vs.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return vs.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return vs.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){vs.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,g(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,g(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=w(q(Ts,e),2),r=n[0],i=n[1],a=w(Z(Ts,e),2),o=a[0],s=a[1],u=$(Ss,e),l=w(rn(Ts,u),3);return an(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=w(on(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=w(on(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Es);Ns.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ps=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.CIRCLE},t)])}return M(e,t),c(e)}(Ns);function Cs(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}Ps.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var As=["style"],Rs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,As);return u(this,e),(t=E(this,e,[s({style:r},i)])).isCustomElement=!0,t}return M(e,t),c(e)}(Ns);Rs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Os=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.ELLIPSE},t)])}return M(e,t),c(e)}(Ns);Os.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Ls=function(t){function e(){return u(this,e),E(this,e,[{type:h.FRAGMENT}])}return M(e,t),c(e)}(Ns);Ls.PARSED_STYLE_LIST=new Set(["class","className"]);var Is=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.GROUP},t)])}return M(e,t),c(e)}(Ns);Is.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Ds=["style"],_s=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Ds);return u(this,e),(t=E(this,e,[s({type:h.HTML,style:r},i)])).cullable.enable=!1,t}return M(e,t),c(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=D(A(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ut.isEmpty(e)){var n=new Ut;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ns);_s.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Gs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.IMAGE},t)])}return M(e,t),c(e)}(Ns);Gs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Fs=["style"],Bs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Fs);u(this,e),(t=E(this,e,[s({type:h.LINE,style:s({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&bs(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=vi(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=mt(st(),lt(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return di(t.x1,t.y1,t.x2,t.y2)}}])}(Ns);Bs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Ys=["style"],Vs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Ys);u(this,e),(t=E(this,e,[s({type:h.PATH,style:r,initialParsedStyle:{miterLimit:4,d:s({},Mn)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd,c=a.markerMid;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&bs(c)&&t.placeMarkerMid(c),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&bs(i)){var a,o,s,u,l,c,h;if(t){var f=w(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=w(this.getEndTangent(),2),y=p[0],g=p[1];u=g[0],l=g[1],o=y[0]-g[0],s=y[1]-g[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&bs(t))for(var n=1;e.length-1>n;n++){var r=w(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return bi(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Xe(t,e,ce(ce({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=mt(st(),lt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*bi(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ns);Vs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Us=["style"],js=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Us);u(this,e),(t=E(this,e,[s({type:h.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd,c=a.markerMid;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&bs(c)&&t.placeMarkerMid(c),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&bs(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&bs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ns);js.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Xs=["style"],Hs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Cs(t,Xs);return u(this,e),E(this,e,[s({type:h.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return M(e,t),c(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=mi(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=di(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))})),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)}));var c=vi(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=mt(st(),lt(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(js);Hs.PARSED_STYLE_LIST=new Set([].concat(g(js.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var zs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.RECT},t)])}return M(e,t),c(e)}(Ns);zs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Ws=["style"],qs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Cs(t,Ws);return u(this,e),E(this,e,[s({type:h.TEXT,style:s({fill:"black"},n)},r)])}return M(e,t),c(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ns);qs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var Zs=function(){return c((function t(){u(this,t),this.registry={},this.define(h.CIRCLE,Ps),this.define(h.ELLIPSE,Os),this.define(h.RECT,zs),this.define(h.IMAGE,Gs),this.define(h.LINE,Bs),this.define(h.GROUP,Is),this.define(h.PATH,Vs),this.define(h.POLYGON,js),this.define(h.POLYLINE,Hs),this.define(h.TEXT,qs),this.define(h.HTML,_s)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),$s={number:function(t){return new xr(t)},percent:function(t){return new xr(t,"%")},px:function(t){return new xr(t,"px")},em:function(t){return new xr(t,"em")},rem:function(t){return new xr(t,"rem")},deg:function(t){return new xr(t,"deg")},grad:function(t){return new xr(t,"grad")},rad:function(t){return new xr(t,"rad")},turn:function(t){return new xr(t,"turn")},s:function(t){return new xr(t,"s")},ms:function(t){return new xr(t,"ms")},registerProperty:function(t){vs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){vs.layoutRegistry.registerLayout(t,e)}},Ks=function(t){function e(){var t;u(this,e),(t=E(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new vs.AnimationTimeline(t)}catch(t){}var n={};return ia.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=$t(e)?e(h.GROUP):e)})),t.documentElement=new Is({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return M(e,t),c(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?qs:Is);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Za(Wa().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=Za(Wa().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Zt)}},{key:"insertBefore",value:function(t,e){throw Error(Zt)}},{key:"removeChild",value:function(t,e){throw Error(Zt)}},{key:"replaceChild",value:function(t,e,n){throw Error(Zt)}},{key:"append",value:function(){throw Error(Zt)}},{key:"prepend",value:function(){throw Error(Zt)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Ao),Qs=function(){function t(e){u(this,t),this.strategies=e}return c(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===a.length?i.unculledEntities.indexOf(t.entity)>-1:a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new No(Go.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();Qs.tag="Culling";var Js=function(){function t(){var e=this;u(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new wo(null),this.rootWheelEvent=new To(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=So(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=So(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return c(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=So(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=So(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=So(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Oa[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=La.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];le(i.button)&&(i.button=0),le(i.buttons)&&(i.buttons=1),le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),le(i.width)&&(i.width=i.radiusX||1),le(i.height)&&(i.height=i.radiusY||1),le(i.tiltX)&&(i.tiltX=0),le(i.tiltY)&&(i.tiltY=0),le(i.pointerType)&&(i.pointerType="touch"),le(i.pointerId)&&(i.pointerId=i.identifier||0),le(i.pressure)&&(i.pressure=i.force||.5),le(i.twist)&&(i.twist=0),le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;le(a.isPrimary)&&(a.isPrimary=!0),le(a.width)&&(a.width=1),le(a.height)&&(a.height=1),le(a.tiltX)&&(a.tiltX=0),le(a.tiltY)&&(a.tiltY=0),le(a.pointerType)&&(a.pointerType="mouse"),le(a.pointerId)&&(a.pointerId=1),le(a.pressure)&&(a.pressure=.5),le(a.twist)&&(a.twist=0),le(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();Js.tag="Event";var tu=[h.CIRCLE,h.ELLIPSE,h.IMAGE,h.RECT,h.LINE,h.POLYLINE,h.POLYGON,h.TEXT,h.PATH,h.HTML],eu=function(){return c((function t(){u(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Ut.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Xt.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Xt.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Xt.OUTSIDE||n===Xt.INSIDE)return n;for(var i=Xt.INSIDE,a=tu.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(n&u&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>yt(c,e.getPositiveFarPoint(r[o]))+h)return Xt.OUTSIDE;0>yt(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),nu=function(){function t(){u(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return c(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){vs.enableSizeAttenuation&&vs.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),vs.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){a.addEventListener(Go.MOUNTED,u),a.addEventListener(Go.UNMOUNTED,l),a.addEventListener(Go.ATTR_MODIFIED,o),a.addEventListener(Go.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Go.MOUNTED,u),a.removeEventListener(Go.UNMOUNTED,l),a.removeEventListener(Go.ATTR_MODIFIED,o),a.removeEventListener(Go.BOUNDS_CHANGED,s),r.syncTasks.clear()}));var c=null!==(n=vs.globalThis.requestIdleCallback)&&void 0!==n?n:Xa.bind(vs.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,c((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Ut),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=w(r.getMin(),2),o=a[0],s=a[1],u=w(r.getMax(),2),l=u[0],c=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=c}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();nu.tag="Prepare";var ru=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),iu=new No(Go.MOUNTED),au=new No(Go.UNMOUNTED),ou=new No(ru.BEFORE_RENDER),su=new No(ru.RERENDER),uu=new No(ru.AFTER_RENDER),lu=function(t){function e(t){var n;u(this,e),(n=E(this,e)).Element=Ns,n.inited=!1,n.context={};var r=t.container,i=t.canvas,a=t.renderer,o=t.width,l=t.height,c=t.background,h=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,d=t.cleanUpOnDestroy,v=void 0===d||d,p=t.offscreenCanvas,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,m=t.createImage,k=t.supportsTouchEvents,x=t.supportsPointerEvents,b=t.isTouchEvent,M=t.isMouseEvent,w=t.dblClickSpeed,T=o,S=l,N=t.devicePixelRatio||Na&&window.devicePixelRatio||1;return N=1>N?1:Math.ceil(N),i&&(T=o||function(t){var e=Ra(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/N,S=l||function(t){var e=Ra(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/N),n.customElements=new Zs,n.devicePixelRatio=N,n.requestAnimationFrame=null!=y?y:Xa.bind(vs.globalThis),n.cancelAnimationFrame=null!=g?g:Ha.bind(vs.globalThis),n.supportsTouchEvents=null!=k?k:"ontouchstart"in vs.globalThis,n.supportsPointerEvents=null!=x?x:!!vs.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof vs.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!vs.globalThis.MouseEvent||t instanceof vs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof vs.globalThis.PointerEvent))},p&&(vs.offscreenCanvas=p),n.document=new Ks,n.document.defaultView=n,f||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Sa.has(r)&&Sa.get(r).destroy(n),Sa.set(r,e)}}(r,n,v),n.initRenderingContext(s(s({},t),{},{width:T,height:S,background:null!=c?c:"transparent",cursor:null!=h?h:"default",cleanUpOnDestroy:v,devicePixelRatio:N,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=w?w:200,createImage:null!=m?m:function(){return new window.Image}})),n.initDefaultCamera(T,S,a.clipSpaceNearZ),n.initRenderer(a,!0),n}return M(e,t),c(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new vs.CameraContribution;i.clipSpaceNearZ=n,i.setType(dn.EXPLORING,vn.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(yn.UPDATED,(function(){r.context.renderingContext.renderReasons.add(Lo.CAMERA_CHANGED),vs.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){vs.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;ir.clearCache(),e||this.dispatchEvent(new No(ru.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new No(ru.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(iu),r(au),r(ou),r(su),r(uu),r(ws),r(ms),r(ks),r(xs)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===pn.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new No(ru.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(ou.detail=t,uu.detail=t),this.dispatchEvent(ou),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(su)})),this.dispatchEvent(uu)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Js,new nu,new Qs([new eu])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(s(s({},vs),this.context)),this.context.renderingService=new Io(vs,this.context),this.context.eventService=new Ro(vs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,r,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,r)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new No(ru.READY))})):e.dispatchEvent(new No(ru.READY)):e.dispatchEvent(new No(ru.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(vs)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),g((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(vs)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(au):(au.target=t,this.dispatchEvent(au,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ia(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(iu):(iu.target=t,this.dispatchEvent(iu,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Co);t.AABB=Ut,t.AbstractRenderer=v,t.AbstractRendererPlugin=d,t.BUILT_IN_PROPERTIES=ia,t.CSS=$s,t.CSSGradientValue=gr,t.CSSKeywordValue=mr,t.CSSRGB=Mr,t.CSSStyleValue=vr,t.CSSUnitValue=xr,t.Camera=mn,t.CameraEvent=yn,t.CameraProjectionMode=pn,t.CameraTrackingMode=vn,t.CameraType=dn,t.Canvas=lu,t.CanvasEvent=ru,t.Circle=Ps,t.CircleUpdater=fo,t.ClipSpaceNearZ=f,t.CustomElement=Rs,t.CustomElementRegistry=Zs,t.CustomEvent=No,t.DefaultSceneGraphSelector=_o,t.DefaultSceneGraphService=us,t.DisplayObject=Ns,t.Document=Ks,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=qt,t.Element=Es,t.ElementEvent=Go,t.Ellipse=Os,t.EllipseUpdater=vo,t.EventService=Ro,t.EventTarget=Co,t.FederatedEvent=bo,t.FederatedMouseEvent=Mo,t.FederatedPointerEvent=wo,t.FederatedWheelEvent=To,t.Fragment=Ls,t.Frustum=Ht,t.GradientType=yr,t.Group=Is,t.GroupUpdater=xo,t.HTML=_s,t.HTMLUpdater=Eo,t.Image=Gs,t.Line=Bs,t.LineUpdater=po,t.Mask=Xt,t.MutationEvent=Fo,t.Node=Ao,t.OffscreenCanvasCreator=Oo,t.Path=Vs,t.PathUpdater=yo,t.Plane=jt,t.Point=zt,t.Polygon=js,t.Polyline=Hs,t.PolylineUpdater=go,t.PropertySyntax=wn,t.RBush=n,t.Rect=zs,t.RectUpdater=mo,t.Rectangle=Wt,t.RenderReason=Lo,t.RenderingService=Io,t.Shape=h,t.SortReason=bn,t.Strategy=En,t.Text=qs,t.TextService=ds,t.TextUpdater=ko,t.UnitType=ar,t.attrModifiedEvent=ws,t.computeLinearGradient=function(t,e,n,r){var i=Qe(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}},t.computeRadialGradient=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===ar.kPercentage&&(o=r.value/100*e),i.unit===ar.kPercentage&&(s=i.value/100*n);var u=Math.max(De([0,0],[o,s]),De([0,n],[o,s]),De([e,n],[o,s]),De([e,0],[o,s]));return a&&(a instanceof xr?u=a.value:a instanceof mr&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(De([0,0],[o,s]),De([0,n],[o,s]),De([e,n],[o,s]),De([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case h.LINE:var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case h.CIRCLE:var u=t.parsedStyle,l=u.r,c=void 0===l?0:l,f=u.cx,d=u.cy;n=Li(c,c,void 0===f?0:f,void 0===d?0:d);break;case h.ELLIPSE:var v=t.parsedStyle,p=v.rx,y=v.ry,m=v.cx,k=v.cy;n=Li(void 0===p?0:p,void 0===y?0:y,void 0===m?0:m,void 0===k?0:k);break;case h.POLYLINE:case h.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===h.POLYGON);break;case h.RECT:var x=t.parsedStyle,E=x.width,b=void 0===E?0:E,M=x.height,T=void 0===M?0:M,S=x.x,N=void 0===S?0:S,P=x.y,C=void 0===P?0:P,A=x.radius,R=A&&A.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var a=w(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(b,T,N,C,R&&A.map((function(t){return ie(t,0,Math.min(Math.abs(b)/2,Math.abs(T)/2))})));break;case h.PATH:n=g(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=lt(e[1],e[2],0);n&&mt(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=lt(e[1],e[2],0),o=lt(e[3],e[4],0),s=lt(e[5],e[6],0);n&&(mt(a,a,n),mt(o,o,n),mt(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=lt(e[6],e[7],0);n&&mt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=lt(e[1],e[2],0),c=lt(e[3],e[4],0);n&&(mt(l,l,n),mt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)},t.createVec3=$e,t.decompose=on,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==w(t,2)[1]})))},t.deg2rad=Qe,t.deg2turn=function(t){return t/360},t.destroyEvent=xs,t.findClosestClipPathTarget=Aa,t.fromRotationTranslationScale=an,t.getAngle=qe,t.getEuler=rn,t.getOrCalculatePathTotalLength=bi,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=ms,t.isBrowser=Na,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Vr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=bs,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Yr,t.mergeColors=jr,t.parseColor=Ur,t.parseLength=zr,t.parsePath=_i,t.parseTransform=Hi,t.parsedTransformToMat4=uo,t.propertyMetadataCache=oa,t.rad2deg=tn,t.removedEvent=ks,t.resetEntityCounter=function(){gs=0},t.runtime=vs,t.setDOMSize=function(t,e,n){Na&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map((function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==r&&0!==i,c=w(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=w(l?[r,i]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+r,",").concat(a[7]+i):"");case"Z":return"Z";default:return null}})).filter((function(t){return null!==t})).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=en}));
17
+ */function ui(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function li(t,e){var n=Math.min.apply(Math,g(t)),r=Math.min.apply(Math,g(e));return{x:n,y:r,width:Math.max.apply(Math,g(t))-n,height:Math.max.apply(Math,g(e))-r}}function ci(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function hi(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function fi(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=ci(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,g=-1/0,m=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var x=p+k;o>a?x>a&&o>x&&m.push(x):x>o&&a>x&&m.push(x)}for(var E=0;m.length>E;E++){var b=hi(0,e,n,r,i,m[E]);y>b&&(y=b),b>g&&(g=b)}return{x:u,y:y,width:l-u,height:g-y}}function di(t,e,n,r){return ui(t,e,n,r)}function vi(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function pi(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function yi(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(oe(s,0))oe(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;oe(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function gi(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=yi(t,n,i,o),h=yi(e,r,a,s),f=0;c.length>f;f++)u.push(pi(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(pi(e,r,a,s,h[d]));return li(u,l)}function mi(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=ui(r[0],r[1],i[0],i[1])}return e}(t)}function ki(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function xi(t,e,n){var r=t+n-2*e;if(oe(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ei(t,e,n,r,i,a){var o=xi(t,n,i)[0],s=xi(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(ki(t,n,i,o)),void 0!==s&&l.push(ki(e,r,a,s)),li(u,l)}function bi(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Xe(t.parsedStyle.d.absolutePath,void 0,ce(ce({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Mi(t,e){return t[0]===e[0]&&t[1]===e[1]}function wi(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||oe(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Ti(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}ir((function(t){return re(t)?t.split(" ").map(ii):t.map(ii)}));var Si=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Ni=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=Qe(r=se(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),y=v*(-n*h.x/e),g={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},m={x:(h.x-p)/e,y:(h.y-y)/n},k=Si({x:1,y:0},m),x=Si(m,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&x>0?x-=2*Math.PI:a&&0>x&&(x+=2*Math.PI);var E=k+(x%=2*Math.PI)*s,b=e*Math.cos(E),M=n*Math.sin(E);return{x:Math.cos(u)*b-Math.sin(u)*M+g.x,y:Math.sin(u)*b+Math.cos(u)*M+g.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+x,ellipticalArcAngle:E,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Pi(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Ni({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Ni({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Ci(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ai(t,e){return Ci(t)*Ci(e)?(t[0]*e[0]+t[1]*e[1])/(Ci(t)*Ci(e)):1}function Ri(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ai(t,e))}function Oi(t,e){var n=e[1],r=e[2],i=se(Qe(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=r?p*n*f/r:0,g=n?p*-r*h/n:0,m=(s+l)/2+Math.cos(i)*y-Math.sin(i)*g,k=(u+c)/2+Math.sin(i)*y+Math.cos(i)*g,x=[(h-y)/n,(f-g)/r],E=[(-1*h-y)/n,(-1*f-g)/r],b=Ri([1,0],x),M=Ri(x,E);return Ai(x,E)>-1||(M=Math.PI),1>Ai(x,E)||(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&0>M&&(M+=2*Math.PI),{cx:m,cy:k,rx:Mi(t,[l,c])?0:n,ry:Mi(t,[l,c])?0:r,startAngle:b,endAngle:b+M,xRotation:i,arcFlag:a,sweepFlag:o}}function Li(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var Ii=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Pe(t)}catch(n){e=Pe(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Mi([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Oi(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Mi(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],y=Ti(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var g=[u[1],u[2]],m=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-m[0],g[1]-m[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[m[0]-g[0],m[1]-g[1]])}else if("S"===l){var k=e[s-1],x=Ti(k.currentPoint,d),E=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]]):(c.command="SQ",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]])}else if("A"===l){var b=Pi(c,0),M=b.x,w=b.y,T=Pi(c,1,!1),S=T.x,N=T.y;c.startTangent=[M,w],c.endTangent=[S,N]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Ei(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=gi(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=fi(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=ne(n),d=ne(r),v=ee(n),p=ee(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var g=i[y],m=g.currentPoint;m[0]===f?f-=wi(g,e).xExtra:m[0]===v&&(v+=wi(g,e).xExtra),m[1]===d?d-=wi(g,e).yExtra:m[1]===p&&(p+=wi(g,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Di=ir(Ii);function _i(t){return re(t)?Di(t):Ii(t)}function Gi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Ie(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Ie(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=We(r,i));var o,s,u,l,c,h,f,d,v=He(a[0])!==He(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=De(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Fi(t,e){return[t.points,e.points,function(t){return t}]}var Bi=null,Yi=/\s*(\w+)\(([^)]*)\)/g;function Vi(t){return function(e){var n=0;return t.map((function(t){return t===Bi?e[n++]:t}))}}function Ui(t){return t}var ji={matrix:["NNNNNN",[Bi,Bi,0,0,Bi,Bi,0,0,0,0,1,0,Bi,Bi,0,1],Ui],matrix3d:["NNNNNNNNNNNNNNNN",Ui],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Vi([Bi,Bi,new xr(1)]),Ui],scaleX:["N",Vi([Bi,new xr(1),new xr(1)]),Vi([Bi,new xr(1)])],scaleY:["N",Vi([new xr(1),Bi,new xr(1)]),Vi([new xr(1),Bi])],scaleZ:["N",Vi([new xr(1),new xr(1),Bi])],scale3d:["NNN",Ui],skew:["Aa",null,Ui],skewX:["A",null,Vi([Bi,br])],skewY:["A",null,Vi([br,Bi])],translate:["Tt",Vi([Bi,Bi,Er]),Ui],translateX:["T",Vi([Bi,Er,Er]),Vi([Bi,Er])],translateY:["T",Vi([Er,Bi,Er]),Vi([Er,Bi])],translateZ:["L",Vi([Er,Er,Bi])],translate3d:["TTL",Ui]};function Xi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!ji[a])return[];var s=o.map((function(t){return Cr(t)}));e.push({t:a,d:s})}return e}function Hi(t){if(Array.isArray(t))return Xi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Yi.lastIndex=0;e=Yi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?br:$r(t)},N:ii,T:qr,L:zr}[h.toUpperCase()](c):{a:br,n:u[0],t:Er}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Yi.lastIndex===t.length)return n}return[]}function zi(t){if(Array.isArray(t))return Xi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Yi.lastIndex=0;e=Yi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ji[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?br:Zr(t)},N:ri,T:Wr,L:Hr}[h.toUpperCase()](c):{a:br,n:u[0],t:Er}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Yi.lastIndex===t.length)return n}return[]}function Wi(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Qe(Qr(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Qe(Qr(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Qe(Qr(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Qe(Qr(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=Qe(Qr(t.d[0])),h=Qe(Qr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Qe(Qr(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Qe(Qr(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,n=ti(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=ti(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=ti(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ti(t.d[0],0,null)||0,n=ti(t.d[1],0,null)||0,r=ti(t.d[2],0,null)||0,1];case"perspective":var f=ti(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function qi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Zi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(sn,t))return!1;if(R(un,sn),un[3]=0,un[7]=0,un[11]=0,un[15]=1,1e-8>Math.abs(_(un)))return!1;var o,s,u=sn[3],l=sn[7],c=sn[11],h=sn[12],f=sn[13],d=sn[14],v=sn[15];if(0!==u||0!==l||0!==c){if(ln[0]=u,ln[1]=l,ln[2]=c,ln[3]=v,!D(un,un))return!1;I(un,un),wt(i,ln,un)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=cn)[0][0]=(s=sn)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=ut(cn[0]),pt(cn[0],cn[0]),r[0]=yt(cn[0],cn[1]),fn(cn[1],cn[1],cn[0],1,-r[0]),n[1]=ut(cn[1]),pt(cn[1],cn[1]),r[0]/=n[1],r[1]=yt(cn[0],cn[2]),fn(cn[2],cn[2],cn[0],1,-r[1]),r[2]=yt(cn[1],cn[2]),fn(cn[2],cn[2],cn[1],1,-r[2]),n[2]=ut(cn[2]),pt(cn[2],cn[2]),r[1]/=n[2],r[2]/=n[2],gt(hn,cn[1],cn[2]),0>yt(cn[0],hn))for(var p=0;3>p;p++)n[p]*=-1,cn[p][0]*=-1,cn[p][1]*=-1,cn[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+cn[0][0]-cn[1][1]-cn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-cn[0][0]+cn[1][1]-cn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-cn[0][0]-cn[1][1]+cn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+cn[0][0]+cn[1][1]+cn[2][2],0)),cn[2][1]>cn[1][2]&&(a[0]=-a[0]),cn[0][2]>cn[2][0]&&(a[1]=-a[1]),cn[1][0]>cn[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Wi).reduce(qi)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var $i=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)o[g][m]*=n[g];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function Ki(t){return t.toFixed(6).replace(".000000","")}function Qi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Zi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Zi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=ie(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return $i(t[0],t[1],t[2],e,t[4]).map(Ki).join(",")}])}function Ji(t){return t.replace(/[XY]/,"")}function ta(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ea(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Cr(o):Cr(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=Qi(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,v=e[f].t,p=t[f].d,y=e[f].d,g=ji[d],m=ji[v],k=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=Qi([t[f]],[e[f]]);u.push(x[0]),l.push(x[1]),c.push(["matrix",[x[2]]])}else{if(d===v)k=d;else if(g[2]&&m[2]&&Ji(d)===Ji(v))k=Ji(d),p=g[2](p),y=m[2](y);else{if(!g[1]||!m[1]||ta(d)!==ta(v)){var E=Qi(t,e);u=[E[0]],l=[E[1]],c=[["matrix",[E[2]]]];break}k=ta(d),p=g[1](p),y=m[1](y)}for(var b=[],M=[],w=[],T=0;p.length>T;T++){var S=Kr(p[T],y[T],n,!1,T);b[T]=S[0],M[T]=S[1],w.push(S[2])}u.push(b),l.push(M),c.push([k,w])}}if(r){var N=u;u=l,l=N}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(n,")")})).join(" ")}]}var na=ir((function(t){if(re(t)){if("text-anchor"===t)return[Cr(0,"px"),Cr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[qr(ra(e[0])),qr(ra(e[1]))]}return[Cr(t[0]||0,"px"),Cr(t[1]||0,"px")]}));function ra(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var ia=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:wn.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:wn.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:wn.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:wn.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:wn.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:wn.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:wn.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:wn.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:wn.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:wn.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:wn.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:wn.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:wn.FILTER},{n:"clipPath",syntax:wn.DEFINED_PATH},{n:"textPath",syntax:wn.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:wn.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:wn.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:wn.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wn.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:wn.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"y1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"z1",int:!0,l:!0,syntax:wn.COORDINATE},{n:"x2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"y2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"z2",int:!0,l:!0,syntax:wn.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:wn.PATH,p:50},{n:"points",int:!0,l:!0,syntax:wn.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:wn.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:wn.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:wn.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:wn.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:wn.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:wn.NUMBER,d:function(t){return t===h.PATH||t===h.POLYGON||t===h.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:wn.MARKER},{n:"markerEnd",syntax:wn.MARKER},{n:"markerMid",syntax:wn.MARKER},{n:"markerStartOffset",syntax:wn.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:wn.LENGTH,l:!0,int:!0,d:"0"}],aa=new Set(ia.filter((function(t){return!!t.l})).map((function(t){return t.n}))),oa={},sa=function(){return c((function t(e){var n=this;u(this,t),this.runtime=e,ia.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(g(t.a||[])).forEach((function(e){oa[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=ua(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(aa.has(o)){a=!0;break}var u,l=ua(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=Ur(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Ur(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Ur(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,ei.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Xr(/deg|rad|grad|turn|px|%/g,t)||Ur(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!Kt(e.radius)&&(t.parsedStyle.radius=Jr(e.radius,4)),l.has("lineDash")&&!Kt(e.lineDash)&&(t.parsedStyle.lineDash=Jr(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points={points:re(u=e.points)?u.split(" ").map((function(t){var e=w(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):u,totalLength:0,segments:[]}),l.has("d")&&""===e.d&&(t.parsedStyle.d=s({},Mn)),l.has("d")&&e.d&&(t.parsedStyle.d=_i(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[wn.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!le(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[wn.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[wn.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=Hi(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=na(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[wn.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!Kt(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[wn.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!Kt(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[wn.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[wn.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[wn.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Ut),r.renderBounds||(r.renderBounds=new Ut);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,u=a.cy,l=void 0===u?0:u,c=a.cz,f=void 0===c?0:c,d=a.hwidth,v=void 0===d?0:d,p=a.hheight,y=void 0===p?0:p,g=a.hdepth,m=void 0===g?0:g,k=[Math.abs(v),Math.abs(y),m],x=i.stroke,E=i.lineWidth,b=void 0===E?1:E,M=i.increasedLineWidthForHitTesting,w=void 0===M?0:M,T=i.shadowType,S=void 0===T?"outer":T,N=i.shadowColor,P=i.filter,C=void 0===P?[]:P,A=i.transformOrigin,R=[s,l,f];if(r.contentBounds.update(R,k),x&&!x.isNone){var O=((b||0)+(w||0))*(e===h.POLYLINE||e===h.POLYGON||e===h.PATH?Math.SQRT2:.5);k[0]+=O,k[1]+=O}if(r.renderBounds.update(R,k),N&&S&&"inner"!==S){var L=r.renderBounds,I=L.min,D=L.max,_=i.shadowBlur||0,G=i.shadowOffsetX||0,F=i.shadowOffsetY||0,B=D[0]+_+G,Y=I[1]-_+F,V=D[1]+_+F;I[0]=Math.min(I[0],I[0]-_+G),D[0]=Math.max(D[0],B),I[1]=Math.min(I[1],Y),D[1]=Math.max(D[1],V),r.renderBounds.setMinMax(I,D)}C.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ft(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}})),t.geometry.dirty=!1;var U=0>y,j=(0>v?-1:1)*(A?ti(A[0],0,t,!0):0),X=(U?-1:1)*(A?ti(A[1],1,t,!0):0);(j||X)&&t.setOrigin(j,X)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===h.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===h.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function ua(t){return t.constructor.PARSED_STYLE_LIST}var la=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n,r){return Qr(n)}}])}(),ca=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof mr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),ha=function(){return c((function t(){u(this,t),this.parser=Ur,this.mixer=jr}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?"none"===n.value?Sr:Nr:n}}])}(),fa=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof mr?[]:n}}])}();function da(t){var e=t.parsedStyle.fontSize;return Kt(e)?null:e}var va=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n,r,i){if(ae(n))return n;if(!xr.isRelativeUnit(n.unit))return n.value;if(n.unit===ar.kPercentage)return 0;if(n.unit===ar.kEms){if(r.parentNode){var a=da(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===ar.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=da(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),pa=function(){return c((function t(){u(this,t),this.mixer=si}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),ya=function(){return c((function t(){u(this,t),this.mixer=si}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),ga=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof mr&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),ma=function(){return c((function t(){u(this,t),this.mixer=ai}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ka=function(){return c((function t(){u(this,t),this.mixer=oi(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===h.LINE||r===h.PATH||r===h.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),xa=function(){return c((function t(){u(this,t),this.mixer=oi(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ea=function(){return c((function t(){u(this,t),this.parser=_i,this.mixer=Gi}),[{key:"calculator",value:function(t,e,n){return n instanceof mr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wt(0,0,0,0)}:n}}])}(),ba=c((function t(){u(this,t),this.mixer=Fi})),Ma=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).mixer=oi(0,1/0),t}return M(e,t),c(e)}(va),wa=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ta=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Sa=new WeakMap;var Na="undefined"!=typeof window&&void 0!==window.document;function Pa(t){return!!t.getAttribute}function Ca(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Aa(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Ra(t,e){if(Na)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Oa={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},La="object"==typeof performance&&performance.now?performance:Date;function Ia(t){return t.nodeName===h.FRAGMENT||t.getRootNode().nodeName===h.FRAGMENT}var Da=1,_a="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},Ga=Date.now(),Fa={},Ba=Date.now(),Ya=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ba,r=n>16?0:16-n,i=Da++;return Fa[i]=t,Object.keys(Fa).length>1||setTimeout((function(){Ba=e;var t=Fa;Fa={},Object.keys(t).forEach((function(e){return t[e](_a.performance&&"function"==typeof _a.performance.now?_a.performance.now():Date.now()-Ga)}))}),r),i},Va=function(t){delete Fa[t]},Ua=function(t){return"string"!=typeof t?Ya:""===t?_a.requestAnimationFrame:_a["".concat(t,"RequestAnimationFrame")]},ja=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Ua(t)})),Xa=Ua(ja),Ha=function(t){return"string"!=typeof t?Va:""===t?_a.cancelAnimationFrame:_a["".concat(t,"CancelAnimationFrame")]||_a["".concat(t,"CancelRequestAnimationFrame")]}(ja);_a.requestAnimationFrame=Xa,_a.cancelAnimationFrame=Ha;var za=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}();function Wa(){Wa=function(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=Object.create((e&&e.prototype instanceof m?e:m).prototype),o=new R(r||[]);return a(i,"_invoke",{value:N(t,n,o)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",y="completed",g={};function m(){}function k(){}function x(){}var E={};c(E,s,(function(){return this}));var b=Object.getPrototypeOf,M=b&&b(b(O([])));M&&M!==n&&i.call(M,s)&&(E=M);var w=x.prototype=m.prototype=Object.create(E);function T(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(a,o,s,u){var l=f(t[a],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==r(h)&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function N(e,n,r){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=P(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?y:v,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function P(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(i.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return k.prototype=x,a(w,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:k,configurable:!0}),k.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},T(S.prototype),c(S.prototype,u,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new S(h(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},T(w),c(w,l,"Generator"),c(w,s,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var u=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&i.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var a=r;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function qa(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Za(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){qa(a,r,i,o,s,"next",t)}function s(t){qa(a,r,i,o,s,"throw",t)}o(void 0)}))}}var $a=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Za(Wa().mark((function t(){var e,n,r,i,a=arguments;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(r>=this.callbacks.length-1){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),Ka=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),Qa=function(){return c((function t(){u(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=0;this.callbacks.length-1>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),Ja=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],to=/([\"\'])[^\'\"]+\1/;function eo(t,e,n){return L(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var no=A(),ro=A(),io={scale:function(t){U(no,[t[0].value,t[1].value,1])},scaleX:function(t){U(no,[t[0].value,1,1])},scaleY:function(t){U(no,[1,t[0].value,1])},scaleZ:function(t){U(no,[1,1,t[0].value])},scale3d:function(t){U(no,[t[0].value,t[1].value,t[2].value])},translate:function(t){V(no,[t[0].value,t[1].value,0])},translateX:function(t){V(no,[t[0].value,0,0])},translateY:function(t){V(no,[0,t[0].value,0])},translateZ:function(t){V(no,[0,0,t[0].value])},translate3d:function(t){V(no,[t[0].value,t[1].value,t[2].value])},rotate:function(t){z(no,Qe(Qr(t[0])))},rotateX:function(t){X(no,Qe(Qr(t[0])))},rotateY:function(t){H(no,Qe(Qr(t[0])))},rotateZ:function(t){z(no,Qe(Qr(t[0])))},rotate3d:function(t){j(no,Qe(Qr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){eo(no,Qe(t[0].value),Qe(t[1].value))},skewX:function(t){eo(no,Qe(t[0].value),0)},skewY:function(t){eo(no,0,Qe(t[0].value))},matrix:function(t){O(no,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){O.apply(ot,[no].concat(g(t.map((function(t){return t.value})))))}},ao=lt(1,1,1),oo=st(),so={translate:function(t,e){vs.sceneGraphService.setLocalScale(t,ao,!1),vs.sceneGraphService.setLocalEulerAngles(t,oo,void 0,void 0,!1),vs.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),vs.sceneGraphService.dirtifyLocal(t,t.transformable)}};function uo(t,e){if(t.length){if(1===t.length&&so[t[0].t])return void so[t[0].t](e,t[0].d);for(var n=L(ro),r=0;t.length>r;r++){var i=t[r],a=io[i.t];a&&(a(i.d),at(n,n,no))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var lo=function(){return c((function t(){u(this,t),this.parser=zi,this.mixer=ea}),[{key:"calculator",value:function(t,e,n,r){return n instanceof mr?[]:n}},{key:"postProcessor",value:function(t){uo(t.parsedStyle.transform,t)}}])}(),co=function(){return c((function t(){u(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===ar.kPixels&&e[1].unit===ar.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ho=function(){return c((function t(){u(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=bn.Z_INDEX_CHANGED)}}}])}(),fo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),vo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),po=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),yo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),go=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t){if(t.points&&Qt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,g(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,g(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,g(e.map((function(t){return t[1]})))),a=(r-n)/2,o=(Math.max.apply(Math,g(e.map((function(t){return t[1]}))))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),mo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!re(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),ko=function(){return c((function t(e){u(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,y=t.y,g=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var m=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,m.offscreenCanvas);t.metrics=k;var x=k.width/2,E=k.height/2,b=p+x;"center"===a||"middle"===a?b+=s/2-x:"right"!==a&&"end"!==a||(b+=s-2*x);var M=g-E;return"middle"===l?M+=E:"top"===l||"hanging"===l?M+=2*E:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),h&&(b+=h),d&&(M+=d),{cx:b,cy:M,hwidth:x,hheight:E}}}])}(),xo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Eo=function(){return c((function t(){u(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var bo=function(){return c((function t(e){u(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new zt,this.page=new zt,this.canvas=new zt,this.viewport=new zt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(qt)}}])}(),Mo=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).client=new zt,t.movement=new zt,t.offset=new zt,t.global=new zt,t.screen=new zt,t}return M(e,t),c(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(qt)}}])}(bo),wo=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return M(e,t),c(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Mo),To=function(t){function e(){return u(this,e),E(this,e,arguments)}return M(e,t),c(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Mo);function So(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var No=function(t){function e(t,n){var r;return u(this,e),(r=E(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return M(e,t),c(e)}(bo),Po=new WeakMap,Co=function(){return c((function t(){u(this,t),this.emitter=new S}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(ue(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=$t(e)?e:e.handleEvent;var s=$t(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(ue(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=$t(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=$t(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new No(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Po.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Po.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Ao=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return M(e,t),c(e,[{key:"textContent",get:function(){var t="";this.nodeName===h.TEXT&&(t+=this.style.text);var e,n=So(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===h.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===h.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(qt)}},{key:"lookupNamespaceURI",value:function(t){throw Error(qt)}},{key:"lookupPrefix",value:function(t){throw Error(qt)}},{key:"normalize",value:function(){throw Error(qt)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Co);Ao.DOCUMENT_POSITION_DISCONNECTED=1,Ao.DOCUMENT_POSITION_PRECEDING=2,Ao.DOCUMENT_POSITION_FOLLOWING=4,Ao.DOCUMENT_POSITION_CONTAINS=8,Ao.DOCUMENT_POSITION_CONTAINED_BY=16,Ao.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ro=function(){return c((function t(e,n){var r=this;u(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=A(),this.tmpVec3=st(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=La.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Ao.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&e-c.timeStamp<r.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Ao.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Ao.isNode(a)&&a.parentNode;l&&l!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Ao.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Ao.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ao.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Ao.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ao.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new zt((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new zt((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=G(this.tmpMatrix,u,s),c=ht(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return mt(c,c,l),new zt(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=G(this.tmpMatrix,n,r),a=ht(this.tmpVec3,t.x,t.y,0);mt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new zt((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e))}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Ao.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(wo);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(To);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(To);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(wo);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=La.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ao.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Pa(e)&&e.getAttribute("cursor");if(n)return n;e=Ao.isNode(e)&&e.parentNode}}}])}(),Oo=function(){return c((function t(){u(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||vs.offscreenCanvas)this.canvas=t||vs.offscreenCanvas,this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Lo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Io=function(){return c((function t(e,n){u(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ka,initAsync:new za,dirtycheck:new Qa,cull:new Qa,beginFrame:new Ka,beforeRender:new Ka,render:new Ka,afterRender:new Ka,endFrame:new Ka,destroy:new Ka,pick:new $a,pickSync:new Qa,pointerDown:new Ka,pointerUp:new Ka,pointerMove:new Ka,pointerOut:new Ka,pointerOver:new Ka,pointerWheel:new Ka,pointerCancel:new Ka,click:new Ka},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=s(s({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Lo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Lo.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=o?r.hooks.cull.call(s,r.context.camera):s;u&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(u))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l,c=u.pop();s(c);for(var h=(null===(l=c.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?c.sortable.sorted:c.childNodes,f=h.length-1;f>=0;f--)u.push(h[f])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==bn.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Ca(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Ca),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter((function(t){return t.parsedStyle.zIndex})).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Lo.DISPLAY_OBJECT_CHANGED)}}])}(),Do=/\[\s*(.*)=(.*)\s*\]/,_o=function(){return c((function t(){u(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Do),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Kt(n)?"":n.toString?""+n:""}}])}(),Go=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Fo=function(t){function e(t,n,r,i,a,o,s,l){var c;return u(this,e),(c=E(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=l,c.type=t,c}return M(e,t),c(e)}(bo);function Bo(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Fo.ADDITION=2,Fo.MODIFICATION=1,Fo.REMOVAL=3;var Yo,Vo,Uo,jo=new Fo(Go.REPARENT,null,"","","",0,"",""),Xo=Dt(),Ho=st(),zo=lt(1,1,1),Wo=A(),qo=Dt(),Zo=st(),$o=A(),Ko=Tt(),Qo=st(),Jo=Tt(),ts=st(),es=st(),ns=st(),rs=A(),is=Tt(),as=Tt(),os=Tt(),ss={affectChildren:!0},us=function(){return c((function t(e){u(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new No(Go.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===h.FRAGMENT,o=Ia(e);t.parentNode=e;var s=a?t.childNodes:[t];ae(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=bn.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(jo)}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=bn.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=Ko;Ct(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);Rt(os,a),Pt(os,os),Nt(r,os,r),Nt(n.localRotation,r,i),It(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Ct(as,e[0],e[1],e[2]),Lt(n.localRotation,n.localRotation,as),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Ct(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Rt(is,Pt(Ko,r)),Lt(n.localRotation,n.localRotation,is),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Ct(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=lt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;kt(e,Ho)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),ft(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ns[0]=e[0],ns[1]=e[1],ns[2]=null!==(n=e[2])&&void 0!==n?n:0,!kt(this.getPosition(t),ns)){if(ct(r.position,ns),null!==t.parentNode&&t.parentNode.transformable)R(rs,t.parentNode.transformable.worldTransform),D(rs,rs),mt(r.localPosition,ns,rs);else ct(r.localPosition,ns);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;es[0]=e[0],es[1]=e[1],es[2]=null!==(n=e[2])&&void 0!==n?n:0,kt(i.localPosition,es)||(ct(i.localPosition,es),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=ht(Zo,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ht(Zo,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),kt(Zo,i.localScale)||(ct(i.localScale,Zo),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ht(Zo,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),kt(e,Ho)||(ft(Zo,this.getPosition(t),e),this.setPosition(t,Zo))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=At(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Rt(Ko,o),Pt(Ko,Ko),Nt(a.localRotation,Ko,e),It(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ot(Ko,e,n,r,i));var o=t.transformable;Rt(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(qo,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){Ia(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;r>i;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===h.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==h.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==h.FRAGMENT&&(ss.affectChildren=t,t?e.forEach((function(t){n(t,ss)})):n(e,ss))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Bo(n),n=n.parentNode;e&&t.forEach((function(t){Bo(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Fo(Go.ATTR_MODIFIED,n,e,e,t,Fo.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return q(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return $(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return Z(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){K(t.localTransform,t.localRotation,t.localPosition,lt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(L($o),$o[4]=Math.tan(t.localSkew[0]),$o[1]=Math.tan(t.localSkew[1]),G(t.localTransform,t.localTransform,$o));var e=K($o,Ot(Ko,0,0,0,1),ht(Zo,1,1,1),t.localScale,t.origin);G(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?K(n,i,r,a,o):s?V(n,r):L(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=q(Qo,e),r=$(Jo,e),i=Z(ts,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,zo,!1),this.setLocalPosition(t,Ho,!1),this.setLocalEulerAngles(t,Ho,void 0,void 0,!1),this.setLocalSkew(t,Xo,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Ut.isEmpty(n)){var r=e||new Ut;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&vs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Ut}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Ut).update(r.center,r.halfExtents))})),a||(a=new Ut),n){var o=Aa(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Wo;t.parentNode.transformable&&(e=D($o,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ut.isEmpty(n)){var r=new Ut;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Ut.isEmpty(r)||(n=new Ut).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=w(n.getMin(),2),o=a[0],s=a[1],u=w(n.getMax(),2);return new Wt(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new Wt((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?G(e.worldTransform,r.worldTransform,e.localTransform):R(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),ls={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},cs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,hs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),fs=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ds=function(){return c((function t(e){var n=this;u(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!fs.exec(e)&&!hs.exec(t))},this.trimByKinsokuShorui=function(t){var e=g(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=ls.MetricsString+ls.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ls.BaselineSymbol).width),u=ls.HeightMultiplier*s;s=s*ls.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==l[d+y]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,y=e.textPath,g=e.leading,m=void 0===g?0:g,k=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,u=void 0===s?"normal":s,l=t.fontWeight,c=void 0===l?"normal":l,h=ae(n)&&"".concat(n,"px")||"16px",f=i.split(","),d=f.length-1;d>=0;d--){var v=f[d].trim();!to.test(v)&&0>Ja.indexOf(v)&&(v='"'.concat(v,'"')),f[d]=v}return"".concat(o," ").concat(u," ").concat(c," ").concat(h," ").concat(f.join(","))}(e),x=this.measureFont(k,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var E=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);E.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=Array(b.length),w=0;if(!y){for(var T=0;b.length>T;T++){var S=E.measureText(b[T]).width+(b[T].length-1)*p;M[T]=S,w=Math.max(w,S)}var N=w+l,P=s||x.fontSize+l,C=Math.max(P,x.fontSize+l)+(b.length-1)*(P+m),A=0;return"middle"===h?A=-C/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?A=-C:"top"!==h&&"hanging"!==h||(A=0),{font:k,width:N,height:C,lines:b,lineWidths:M,lineHeight:P+=m,maxLineWidth:w,fontProperties:x,lineMetrics:M.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Wt(n-l/2,A+e*P,t+l,P)}))}}y.getTotalLength();for(var R=0;b.length>R;R++)E.measureText(b[R])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=this,a=e.wordWrapWidth,o=void 0===a?0:a,s=e.letterSpacing,u=void 0===s?0:s,l=e.maxLines,c=void 0===l?1/0:l,h=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=o+u,v="";"ellipsis"===h?v="...":h&&"clip"!==h&&(v=h);var p=Array.from(t),y=[],g=0,m=0,k=0,x={},E=function(t){return r.getFromCache(t,u,x,f)},b=E(v);function M(t,e,n,r){for(;E(t)<r&&p.length-1>e&&!i.isNewline(p[e+1]);)t+=p[e+=1];for(;E(t)>r&&e>n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(b>0&&d>=b)if(y[t]){var n=M(y[t],e,k+1,d-b);y[t]=n.lineTxt+v}else y[t]=v}for(var T=0;p.length>T;T++){var S=p[T],N=p[T-1],P=p[T+1],C=E(S);if(this.isNewline(S)){if(g+1>=c){e.isOverflowing=!0,p.length-1>T&&w(g,T-1);break}k=T-1,m=0,y[g+=1]=""}else{if(m>0&&m+C>d){var A=M(y[g],T-1,k+1,d);if(A.txtLastCharIndex!==T-1){if(y[g]=A.lineTxt,A.txtLastCharIndex===p.length-1)break;N=p[(T=A.txtLastCharIndex+1)-1],P=p[T+1],C=E(S=p[T])}if(g+1>=c){e.isOverflowing=!0,w(g,T-1);break}if(k=T-1,m=0,y[g+=1]="",this.isBreakingSpace(S))continue;this.canBreakInLastChar(S)||(y=this.trimToBreakable(y),m=this.sumTextWidthByCache(y[g]||"",E)),this.shouldBreakByKinsokuShorui(S,P)&&(y=this.trimByKinsokuShorui(y),m+=E(N||""))}m+=C,y[g]=(y[g]||"")+S}}return y.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ls.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ls.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=g(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!cs.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!cs.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e,o=r.measureText(t);n[t]=i=o.width+a}return i}}])}(),vs={},ps=(Vo=new mo,Uo=new go,a(a(a(a(a(a(a(a(a(a(Yo={},h.FRAGMENT,null),h.CIRCLE,new fo),h.ELLIPSE,new vo),h.RECT,Vo),h.IMAGE,Vo),h.GROUP,new xo),h.LINE,new po),h.TEXT,new ko(vs)),h.POLYLINE,Uo),h.POLYGON,Uo),a(a(a(Yo,h.PATH,new yo),h.HTML,new Eo),h.MESH,null)),ys=function(t){var e=new ha,n=new va;return a(a(a(a(a(a(a(a(a(a(t={},wn.PERCENTAGE,null),wn.NUMBER,new ma),wn.ANGLE,new la),wn.DEFINED_PATH,new ca),wn.PAINT,e),wn.COLOR,e),wn.FILTER,new fa),wn.LENGTH,n),wn.LENGTH_PERCENTAGE,n),wn.LENGTH_PERCENTAGE_12,new pa),a(a(a(a(a(a(a(a(a(a(t,wn.LENGTH_PERCENTAGE_14,new ya),wn.COORDINATE,new va),wn.OFFSET_DISTANCE,new ka),wn.OPACITY_VALUE,new xa),wn.PATH,new Ea),wn.LIST_OF_POINTS,new ba),wn.SHADOW_BLUR,new Ma),wn.TEXT,new wa),wn.TEXT_TRANSFORM,new Ta),wn.TRANSFORM,new lo),a(a(a(t,wn.TRANSFORM_ORIGIN,new co),wn.Z_INDEX,new ho),wn.MARKER,new ga)}();vs.CameraContribution=mn,vs.AnimationTimeline=null,vs.EasingFunction=null,vs.offscreenCanvasCreator=new Oo,vs.sceneGraphSelector=new _o,vs.sceneGraphService=new us(vs),vs.textService=new ds(vs),vs.geometryUpdaterFactory=ps,vs.CSSPropertySyntaxFactory=ys,vs.styleValueRegistry=new sa(vs),vs.layoutRegistry=null,vs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},vs.enableStyleSyntax=!0,vs.enableSizeAttenuation=!1;var gs=0;var ms=new Fo(Go.INSERTED,null,"","","",0,"",""),ks=new Fo(Go.REMOVED,null,"","","",0,"",""),xs=new No(Go.DESTROY),Es=function(t){function e(){var t;u(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=E(this,e,[].concat(r))).entity=gs++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:En.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return M(e,t),c(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return vs.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ia(this)||t.nodeName!==h.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(ms.relatedNode=this,t.dispatchEvent(ms)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return ks.relatedNode=this,t.dispatchEvent(ks),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),vs.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return vs.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return vs.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return vs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return vs.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return vs.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return vs.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return vs.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(vs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,g(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(xs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return vs.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return vs.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return vs.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return vs.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return vs.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(qt)}},{key:"getAttributeNode",value:function(t){throw Error(qt)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(qt)}},{key:"hasAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(qt)}},{key:"setAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNodeNS",value:function(t){throw Error(qt)}},{key:"toggleAttribute",value:function(t,e){throw Error(qt)}}])}(Ao);function bs(t){return!(null==t||!t.nodeName)}var Ms=vs.globalThis.Proxy?vs.globalThis.Proxy:function(){},ws=new Fo(Go.ATTR_MODIFIED,null,null,null,null,Fo.MODIFICATION,null,null),Ts=st(),Ss=Tt(),Ns=function(t){function e(t){var n;return u(this,e),(n=E(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||h.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),vs.enableStyleSyntax&&(n.style=new Ms({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return M(e,t),c(e,[{key:"destroy",value:function(){xn(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=s({},this.attributes);for(var r in n){var i=n[r];bs(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(s(s({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){vs.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];le(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),xn(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];vs.styleValueRegistry.processProperties(this,a({},t,e),n),r.dirty=!0;var s,u=this.parsedStyle[t];(this.isConnected&&(ws.relatedNode=this,ws.prevValue=i,ws.newValue=e,ws.attrName=t,ws.prevParsedValue=o,ws.newParsedValue=u,this.isMutationObserved?this.dispatchEvent(ws):(ws.target=this,this.ownerDocument.defaultView.dispatchEvent(ws,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(s=this.attributeChangedCallback)||void 0===s||s.call(this,t,i,e,o,u))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=w(t.getMin(),2),n=e[0],r=e[1],i=w(t.getMax(),2);return new Wt(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return vs.sceneGraphService.setOrigin(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return vs.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return vs.sceneGraphService.setPosition(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return vs.sceneGraphService.setLocalPosition(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return vs.sceneGraphService.translate(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return vs.sceneGraphService.translateLocal(this,$e(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return vs.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return vs.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=$e(t,e=e||t,n=n||t,!1)),vs.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=$e(t,e=e||t,n=n||t,!1)),vs.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return vs.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return vs.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return tn(w(rn(Ts,vs.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return tn(w(rn(Ts,vs.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return vs.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return vs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return Kt(e)&&Kt(n)?vs.sceneGraphService.rotateLocal(this,0,0,t):vs.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return Kt(e)&&Kt(n)?vs.sceneGraphService.rotate(this,0,0,t):vs.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return vs.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return vs.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return vs.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return vs.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return vs.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return vs.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return vs.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return vs.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return vs.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){vs.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,g(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,g(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=w(q(Ts,e),2),r=n[0],i=n[1],a=w(Z(Ts,e),2),o=a[0],s=a[1],u=$(Ss,e),l=w(rn(Ts,u),3);return an(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=w(on(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=w(on(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Es);Ns.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ps=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.CIRCLE},t)])}return M(e,t),c(e)}(Ns);function Cs(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}Ps.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var As=["style"],Rs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,As);return u(this,e),(t=E(this,e,[s({style:r},i)])).isCustomElement=!0,t}return M(e,t),c(e)}(Ns);Rs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Os=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.ELLIPSE},t)])}return M(e,t),c(e)}(Ns);Os.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Ls=function(t){function e(){return u(this,e),E(this,e,[{type:h.FRAGMENT}])}return M(e,t),c(e)}(Ns);Ls.PARSED_STYLE_LIST=new Set(["class","className"]);var Is=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.GROUP},t)])}return M(e,t),c(e)}(Ns);Is.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Ds=["style"],_s=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Ds);return u(this,e),(t=E(this,e,[s({type:h.HTML,style:r},i)])).cullable.enable=!1,t}return M(e,t),c(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=D(A(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ut.isEmpty(e)){var n=new Ut;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ns);_s.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Gs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.IMAGE},t)])}return M(e,t),c(e)}(Ns);Gs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Fs=["style"],Bs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Fs);u(this,e),(t=E(this,e,[s({type:h.LINE,style:s({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&bs(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=vi(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=mt(st(),lt(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return di(t.x1,t.y1,t.x2,t.y2)}}])}(Ns);Bs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Ys=["style"],Vs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Ys);u(this,e),(t=E(this,e,[s({type:h.PATH,style:r,initialParsedStyle:{miterLimit:4,d:s({},Mn)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd,c=a.markerMid;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&bs(c)&&t.placeMarkerMid(c),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&bs(i)){var a,o,s,u,l,c,h;if(t){var f=w(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=w(this.getEndTangent(),2),y=p[0],g=p[1];u=g[0],l=g[1],o=y[0]-g[0],s=y[1]-g[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&bs(t))for(var n=1;e.length-1>n;n++){var r=w(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return bi(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Xe(t,e,ce(ce({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=mt(st(),lt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*bi(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ns);Vs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Us=["style"],js=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Cs(n,Us);u(this,e),(t=E(this,e,[s({type:h.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,l=a.markerEnd,c=a.markerMid;return o&&bs(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&bs(c)&&t.placeMarkerMid(c),l&&bs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return M(e,t),c(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&bs(r)&&(this.markerStartAngle=0,r.remove()),i&&bs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&bs(r)&&(this.markerEndAngle=0,r.remove()),i&&bs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&bs(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&bs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ns);js.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Xs=["style"],Hs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Cs(t,Xs);return u(this,e),E(this,e,[s({type:h.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return M(e,t),c(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=mi(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=di(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))})),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)}));var c=vi(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=mt(st(),lt(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new zt(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(js);Hs.PARSED_STYLE_LIST=new Set([].concat(g(js.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var zs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,e),E(this,e,[s({type:h.RECT},t)])}return M(e,t),c(e)}(Ns);zs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Ws=["style"],qs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Cs(t,Ws);return u(this,e),E(this,e,[s({type:h.TEXT,style:s({fill:"black"},n)},r)])}return M(e,t),c(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ns);qs.PARSED_STYLE_LIST=new Set([].concat(g(Ns.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var Zs=function(){return c((function t(){u(this,t),this.registry={},this.define(h.CIRCLE,Ps),this.define(h.ELLIPSE,Os),this.define(h.RECT,zs),this.define(h.IMAGE,Gs),this.define(h.LINE,Bs),this.define(h.GROUP,Is),this.define(h.PATH,Vs),this.define(h.POLYGON,js),this.define(h.POLYLINE,Hs),this.define(h.TEXT,qs),this.define(h.HTML,_s)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),$s={number:function(t){return new xr(t)},percent:function(t){return new xr(t,"%")},px:function(t){return new xr(t,"px")},em:function(t){return new xr(t,"em")},rem:function(t){return new xr(t,"rem")},deg:function(t){return new xr(t,"deg")},grad:function(t){return new xr(t,"grad")},rad:function(t){return new xr(t,"rad")},turn:function(t){return new xr(t,"turn")},s:function(t){return new xr(t,"s")},ms:function(t){return new xr(t,"ms")},registerProperty:function(t){vs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){vs.layoutRegistry.registerLayout(t,e)}},Ks=function(t){function e(){var t;u(this,e),(t=E(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new vs.AnimationTimeline(t)}catch(t){}var n={};return ia.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=$t(e)?e(h.GROUP):e)})),t.documentElement=new Is({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return M(e,t),c(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?qs:Is);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Za(Wa().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=Za(Wa().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return Wa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Zt)}},{key:"insertBefore",value:function(t,e){throw Error(Zt)}},{key:"removeChild",value:function(t,e){throw Error(Zt)}},{key:"replaceChild",value:function(t,e,n){throw Error(Zt)}},{key:"append",value:function(){throw Error(Zt)}},{key:"prepend",value:function(){throw Error(Zt)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Ao),Qs=function(){function t(e){u(this,t),this.strategies=e}return c(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===a.length?i.unculledEntities.indexOf(t.entity)>-1:a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new No(Go.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();Qs.tag="Culling";var Js=function(){function t(){var e=this;u(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new wo(null),this.rootWheelEvent=new To(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=So(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=So(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return c(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=So(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=So(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=So(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Oa[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=La.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];le(i.button)&&(i.button=0),le(i.buttons)&&(i.buttons=1),le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),le(i.width)&&(i.width=i.radiusX||1),le(i.height)&&(i.height=i.radiusY||1),le(i.tiltX)&&(i.tiltX=0),le(i.tiltY)&&(i.tiltY=0),le(i.pointerType)&&(i.pointerType="touch"),le(i.pointerId)&&(i.pointerId=i.identifier||0),le(i.pressure)&&(i.pressure=i.force||.5),le(i.twist)&&(i.twist=0),le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;le(a.isPrimary)&&(a.isPrimary=!0),le(a.width)&&(a.width=1),le(a.height)&&(a.height=1),le(a.tiltX)&&(a.tiltX=0),le(a.tiltY)&&(a.tiltY=0),le(a.pointerType)&&(a.pointerType="mouse"),le(a.pointerId)&&(a.pointerId=1),le(a.pressure)&&(a.pressure=.5),le(a.twist)&&(a.twist=0),le(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();Js.tag="Event";var tu=[h.CIRCLE,h.ELLIPSE,h.IMAGE,h.RECT,h.LINE,h.POLYLINE,h.POLYGON,h.TEXT,h.PATH,h.HTML],eu=function(){return c((function t(){u(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Ut.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Xt.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Xt.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Xt.OUTSIDE||n===Xt.INSIDE)return n;for(var i=Xt.INSIDE,a=tu.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(n&u&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>yt(c,e.getPositiveFarPoint(r[o]))+h)return Xt.OUTSIDE;0>yt(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),nu=function(){function t(){u(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return c(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){vs.enableSizeAttenuation&&vs.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),vs.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){a.addEventListener(Go.MOUNTED,u),a.addEventListener(Go.UNMOUNTED,l),a.addEventListener(Go.ATTR_MODIFIED,o),a.addEventListener(Go.BOUNDS_CHANGED,s)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Go.MOUNTED,u),a.removeEventListener(Go.UNMOUNTED,l),a.removeEventListener(Go.ATTR_MODIFIED,o),a.removeEventListener(Go.BOUNDS_CHANGED,s),r.syncTasks.clear()}));var c=null!==(n=vs.globalThis.requestIdleCallback)&&void 0!==n?n:Xa.bind(vs.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,c((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Ut),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=w(r.getMin(),2),o=a[0],s=a[1],u=w(r.getMax(),2),l=u[0],c=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=c}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();nu.tag="Prepare";var ru=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),iu=new No(Go.MOUNTED),au=new No(Go.UNMOUNTED),ou=new No(ru.BEFORE_RENDER),su=new No(ru.RERENDER),uu=new No(ru.AFTER_RENDER),lu=function(t){function e(t){var n;u(this,e),(n=E(this,e)).Element=Ns,n.inited=!1,n.context={};var r=t.container,i=t.canvas,a=t.renderer,o=t.width,l=t.height,c=t.background,h=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,d=t.cleanUpOnDestroy,v=void 0===d||d,p=t.offscreenCanvas,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,m=t.createImage,k=t.supportsTouchEvents,x=t.supportsPointerEvents,b=t.isTouchEvent,M=t.isMouseEvent,w=t.dblClickSpeed,T=o,S=l,N=t.devicePixelRatio||Na&&window.devicePixelRatio||1;return N=1>N?1:Math.ceil(N),i&&(T=o||function(t){var e=Ra(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/N,S=l||function(t){var e=Ra(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/N),n.customElements=new Zs,n.devicePixelRatio=N,n.requestAnimationFrame=null!=y?y:Xa.bind(vs.globalThis),n.cancelAnimationFrame=null!=g?g:Ha.bind(vs.globalThis),n.supportsTouchEvents=null!=k?k:"ontouchstart"in vs.globalThis,n.supportsPointerEvents=null!=x?x:!!vs.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof vs.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!vs.globalThis.MouseEvent||t instanceof vs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof vs.globalThis.PointerEvent))},p&&(vs.offscreenCanvas=p),n.document=new Ks,n.document.defaultView=n,f||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Sa.has(r)&&Sa.get(r).destroy(n),Sa.set(r,e)}}(r,n,v),n.initRenderingContext(s(s({},t),{},{width:T,height:S,background:null!=c?c:"transparent",cursor:null!=h?h:"default",cleanUpOnDestroy:v,devicePixelRatio:N,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=w?w:200,createImage:null!=m?m:function(){return new window.Image}})),n.initDefaultCamera(T,S,a.clipSpaceNearZ),n.initRenderer(a,!0),n}return M(e,t),c(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new vs.CameraContribution;i.clipSpaceNearZ=n,i.setType(dn.EXPLORING,vn.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(yn.UPDATED,(function(){r.context.renderingContext.renderReasons.add(Lo.CAMERA_CHANGED),vs.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){vs.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;ir.clearCache(),e||this.dispatchEvent(new No(ru.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new No(ru.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(iu),r(au),r(ou),r(su),r(uu),r(ws),r(ms),r(ks),r(xs)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===pn.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new No(ru.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(ou.detail=t,uu.detail=t),this.dispatchEvent(ou),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(su)})),this.dispatchEvent(uu)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Js,new nu,new Qs([new eu])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(s(s({},vs),this.context)),this.context.renderingService=new Io(vs,this.context),this.context.eventService=new Ro(vs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,r,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,r)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new No(ru.READY))})):e.dispatchEvent(new No(ru.READY)):e.dispatchEvent(new No(ru.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(vs)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),g((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(vs)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(au):(au.target=t,this.dispatchEvent(au,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ia(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(iu):(iu.target=t,this.dispatchEvent(iu,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Co);t.AABB=Ut,t.AbstractRenderer=v,t.AbstractRendererPlugin=d,t.BUILT_IN_PROPERTIES=ia,t.CSS=$s,t.CSSGradientValue=gr,t.CSSKeywordValue=mr,t.CSSRGB=Mr,t.CSSStyleValue=vr,t.CSSUnitValue=xr,t.Camera=mn,t.CameraEvent=yn,t.CameraProjectionMode=pn,t.CameraTrackingMode=vn,t.CameraType=dn,t.Canvas=lu,t.CanvasEvent=ru,t.Circle=Ps,t.CircleUpdater=fo,t.ClipSpaceNearZ=f,t.CustomElement=Rs,t.CustomElementRegistry=Zs,t.CustomEvent=No,t.DefaultSceneGraphSelector=_o,t.DefaultSceneGraphService=us,t.DisplayObject=Ns,t.Document=Ks,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=qt,t.Element=Es,t.ElementEvent=Go,t.Ellipse=Os,t.EllipseUpdater=vo,t.EventService=Ro,t.EventTarget=Co,t.FederatedEvent=bo,t.FederatedMouseEvent=Mo,t.FederatedPointerEvent=wo,t.FederatedWheelEvent=To,t.Fragment=Ls,t.Frustum=Ht,t.GradientType=yr,t.Group=Is,t.GroupUpdater=xo,t.HTML=_s,t.HTMLUpdater=Eo,t.Image=Gs,t.Line=Bs,t.LineUpdater=po,t.Mask=Xt,t.MutationEvent=Fo,t.Node=Ao,t.OffscreenCanvasCreator=Oo,t.Path=Vs,t.PathUpdater=yo,t.Plane=jt,t.Point=zt,t.Polygon=js,t.Polyline=Hs,t.PolylineUpdater=go,t.PropertySyntax=wn,t.RBush=n,t.Rect=zs,t.RectUpdater=mo,t.Rectangle=Wt,t.RenderReason=Lo,t.RenderingService=Io,t.Shape=h,t.SortReason=bn,t.Strategy=En,t.Text=qs,t.TextService=ds,t.TextUpdater=ko,t.UnitType=ar,t.attrModifiedEvent=ws,t.computeLinearGradient=function(t,e,n,r){var i=Qe(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}},t.computeRadialGradient=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===ar.kPercentage&&(o=r.value/100*e),i.unit===ar.kPercentage&&(s=i.value/100*n);var u=Math.max(De([0,0],[o,s]),De([0,n],[o,s]),De([e,n],[o,s]),De([e,0],[o,s]));return a&&(a instanceof xr?u=a.value:a instanceof mr&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(De([0,0],[o,s]),De([0,n],[o,s]),De([e,n],[o,s]),De([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case h.LINE:var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case h.CIRCLE:var u=t.parsedStyle,l=u.r,c=void 0===l?0:l,f=u.cx,d=u.cy;n=Li(c,c,void 0===f?0:f,void 0===d?0:d);break;case h.ELLIPSE:var v=t.parsedStyle,p=v.rx,y=v.ry,m=v.cx,k=v.cy;n=Li(void 0===p?0:p,void 0===y?0:y,void 0===m?0:m,void 0===k?0:k);break;case h.POLYLINE:case h.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===h.POLYGON);break;case h.RECT:var x=t.parsedStyle,E=x.width,b=void 0===E?0:E,M=x.height,T=void 0===M?0:M,S=x.x,N=void 0===S?0:S,P=x.y,C=void 0===P?0:P,A=x.radius,R=A&&A.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var a=w(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(b,T,N,C,R&&A.map((function(t){return ie(t,0,Math.min(Math.abs(b)/2,Math.abs(T)/2))})));break;case h.PATH:n=g(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=lt(e[1],e[2],0);n&&mt(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=lt(e[1],e[2],0),o=lt(e[3],e[4],0),s=lt(e[5],e[6],0);n&&(mt(a,a,n),mt(o,o,n),mt(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=lt(e[6],e[7],0);n&&mt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=lt(e[1],e[2],0),c=lt(e[3],e[4],0);n&&(mt(l,l,n),mt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)},t.createVec3=$e,t.decompose=on,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==w(t,2)[1]})))},t.deg2rad=Qe,t.deg2turn=function(t){return t/360},t.destroyEvent=xs,t.findClosestClipPathTarget=Aa,t.fromRotationTranslationScale=an,t.getAngle=qe,t.getEuler=rn,t.getOrCalculatePathTotalLength=bi,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=ms,t.isBrowser=Na,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Vr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=bs,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Yr,t.mergeColors=jr,t.parseColor=Ur,t.parseLength=zr,t.parsePath=_i,t.parseTransform=Hi,t.parsedTransformToMat4=uo,t.propertyMetadataCache=oa,t.rad2deg=tn,t.removedEvent=ks,t.resetEntityCounter=function(){gs=0},t.runtime=vs,t.setDOMSize=function(t,e,n){Na&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map((function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==r&&0!==i,c=w(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=w(l?[r,i]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+r,",").concat(a[7]+i):"");case"Z":return"Z";default:return null}})).filter((function(t){return null!==t})).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=en}));
18
18
  //# sourceMappingURL=index.umd.min.js.map