@tsparticles/plugin-polygon-mask 4.0.0-alpha.2 → 4.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/185.min.js +1 -0
- package/459.min.js +2 -0
- package/browser/Options/Classes/PolygonMask.js +9 -0
- package/browser/Options/Classes/PolygonMaskDraw.js +2 -0
- package/browser/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/browser/Options/Classes/PolygonMaskInline.js +1 -0
- package/browser/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/browser/Options/Classes/PolygonMaskMove.js +2 -0
- package/browser/PolygonMaskInstance.js +313 -308
- package/browser/PolygonMaskPlugin.js +6 -5
- package/browser/index.js +3 -3
- package/browser/pathseg.js +5 -15
- package/browser/utils.js +4 -2
- package/cjs/Options/Classes/PolygonMask.js +9 -0
- package/cjs/Options/Classes/PolygonMaskDraw.js +2 -0
- package/cjs/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/cjs/Options/Classes/PolygonMaskInline.js +1 -0
- package/cjs/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/cjs/Options/Classes/PolygonMaskMove.js +2 -0
- package/cjs/PolygonMaskInstance.js +313 -308
- package/cjs/PolygonMaskPlugin.js +6 -5
- package/cjs/index.js +3 -3
- package/cjs/pathseg.js +5 -15
- package/cjs/utils.js +4 -2
- package/dist_browser_PolygonMaskInstance_js.js +50 -0
- package/dist_browser_PolygonMaskPlugin_js.js +8 -38
- package/esm/Options/Classes/PolygonMask.js +9 -0
- package/esm/Options/Classes/PolygonMaskDraw.js +2 -0
- package/esm/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/esm/Options/Classes/PolygonMaskInline.js +1 -0
- package/esm/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/esm/Options/Classes/PolygonMaskMove.js +2 -0
- package/esm/PolygonMaskInstance.js +313 -308
- package/esm/PolygonMaskPlugin.js +6 -5
- package/esm/index.js +3 -3
- package/esm/pathseg.js +5 -15
- package/esm/utils.js +4 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.polygon-mask.js +15 -15
- package/tsparticles.plugin.polygon-mask.min.js +2 -2
- package/types/PolygonMaskPlugin.d.ts +4 -5
- package/types/index.d.ts +1 -1
- package/umd/Options/Classes/PolygonMask.js +9 -0
- package/umd/Options/Classes/PolygonMaskDraw.js +2 -0
- package/umd/Options/Classes/PolygonMaskDrawStroke.js +4 -0
- package/umd/Options/Classes/PolygonMaskInline.js +1 -0
- package/umd/Options/Classes/PolygonMaskLocalSvg.js +2 -0
- package/umd/Options/Classes/PolygonMaskMove.js +2 -0
- package/umd/PolygonMaskInstance.js +312 -307
- package/umd/PolygonMaskPlugin.js +41 -6
- package/umd/index.js +3 -3
- package/umd/pathseg.js +5 -15
- package/umd/utils.js +4 -2
- package/409.min.js +0 -2
- package/409.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.polygon-mask.min.js.LICENSE.txt +0 -1
package/185.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_polygon_mask=this.webpackChunk_tsparticles_plugin_polygon_mask||[]).push([[185],{185(i,t,e){e.d(t,{PolygonMaskPlugin:()=>u});var s=e(303);class o{color;opacity;width;_engine;constructor(i){this._engine=i,this.color=new s.OptionsColor,this.width=.5,this.opacity=1}load(i){(0,s.isNull)(i)||(this.color=s.OptionsColor.create(this.color,i.color),(0,s.isString)(this.color.value)&&(this.opacity=(0,s.stringToAlpha)(this._engine,this.color.value)??this.opacity),void 0!==i.opacity&&(this.opacity=i.opacity),void 0!==i.width&&(this.width=i.width))}}class n{enable;stroke;constructor(i){this.enable=!1,this.stroke=new o(i)}load(i){if((0,s.isNull)(i))return;void 0!==i.enable&&(this.enable=i.enable);let t=i.stroke;this.stroke.load(t)}}var a=e(173);class l{arrangement;constructor(){this.arrangement=a.G.onePerPoint}load(i){(0,s.isNull)(i)||void 0!==i.arrangement&&(this.arrangement=i.arrangement)}}class h{path;size;constructor(){this.path=[],this.size={height:0,width:0}}load(i){(0,s.isNull)(i)||(void 0!==i.path&&(this.path=i.path),void 0!==i.size&&(void 0!==i.size.width&&(this.size.width=i.size.width),void 0!==i.size.height&&(this.size.height=i.size.height)))}}var r=e(441);class d{radius;type;constructor(){this.radius=10,this.type=r.O.path}load(i){(0,s.isNull)(i)||(void 0!==i.radius&&(this.radius=i.radius),void 0!==i.type&&(this.type=i.type))}}var p=e(468);class c{data;draw;enable;inline;move;position;scale;type;url;constructor(i){this.draw=new n(i),this.enable=!1,this.inline=new l,this.move=new d,this.scale=1,this.type=p.T.none}load(i){(0,s.isNull)(i)||(this.draw.load(i.draw),this.inline.load(i.inline),this.move.load(i.move),void 0!==i.scale&&(this.scale=i.scale),void 0!==i.type&&(this.type=i.type),void 0!==i.enable?this.enable=i.enable:this.enable=this.type!==p.T.none,void 0!==i.url&&(this.url=i.url),void 0!==i.data&&((0,s.isString)(i.data)?this.data=i.data:(this.data=new h,this.data.load(i.data))),void 0!==i.position&&(this.position=(0,s.deepExtend)({},i.position)))}}class u{id="polygon-mask";_engine;constructor(i){this._engine=i}async getPlugin(i){let{PolygonMaskInstance:t}=await e.e(459).then(e.bind(e,459));return new t(i,this._engine)}loadOptions(i,t,e){if(!this.needsPlugin(t)&&!this.needsPlugin(e))return;let s=t.polygon;s?.load===void 0&&(t.polygon=s=new c(this._engine)),s.load(e?.polygon)}needsPlugin(i){return i?.polygon?.enable??(i?.polygon?.type!==void 0&&i.polygon.type!==p.T.none)}}}}]);
|
package/459.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_polygon_mask=this.webpackChunk_tsparticles_plugin_polygon_mask||[]).push([[459],{459(t,e,i){i.d(e,{PolygonMaskInstance:()=>s}),function(){try{if("u"<typeof window)return;!("SVGPathSeg"in window)&&(window.SVGPathSeg=function(t,e,i){this.pathSegType=t,this.pathSegTypeAsLetter=e,this._owningPathSegList=i},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(t){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",t)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",t),this._x=e,this._y=i},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",t),this._x=e,this._y=i},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",t),this._x=e,this._y=i},window.SVGPathSegLinetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},window.SVGPathSegLinetoAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegLinetoAbs.prototype.clone=function(){return new window.SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_REL,"l",t),this._x=e,this._y=i},window.SVGPathSegLinetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},window.SVGPathSegLinetoRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegLinetoRel.prototype.clone=function(){return new window.SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicAbs=function(t,e,i,n,o,r,h){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",t),this._x=e,this._y=i,this._x1=n,this._y1=o,this._x2=r,this._y2=h},window.SVGPathSegCurvetoCubicAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},window.SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`},window.SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicRel=function(t,e,i,n,o,r,h){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",t),this._x=e,this._y=i,this._x1=n,this._y1=o,this._x2=r,this._y2=h},window.SVGPathSegCurvetoCubicRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},window.SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x2} ${this._y2} ${this._x} ${this._y}`},window.SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticAbs=function(t,e,i,n,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t),this._x=e,this._y=i,this._x1=n,this._y1=o},window.SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`},window.SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticRel=function(t,e,i,n,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",t),this._x=e,this._y=i,this._x1=n,this._y1=o},window.SVGPathSegCurvetoQuadraticRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x1} ${this._y1} ${this._x} ${this._y}`},window.SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcAbs=function(t,e,i,n,o,r,h,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_ABS,"A",t),this._x=e,this._y=i,this._r1=n,this._r2=o,this._angle=r,this._largeArcFlag=h,this._sweepFlag=s},window.SVGPathSegArcAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},window.SVGPathSegArcAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag?"1":"0"} ${this._sweepFlag?"1":"0"} ${this._x} ${this._y}`},window.SVGPathSegArcAbs.prototype.clone=function(){return new window.SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcRel=function(t,e,i,n,o,r,h,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_REL,"a",t),this._x=e,this._y=i,this._r1=n,this._r2=o,this._angle=r,this._largeArcFlag=h,this._sweepFlag=s},window.SVGPathSegArcRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},window.SVGPathSegArcRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._r1} ${this._r2} ${this._angle} ${this._largeArcFlag?"1":"0"} ${this._sweepFlag?"1":"0"} ${this._x} ${this._y}`},window.SVGPathSegArcRel.prototype.clone=function(){return new window.SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t),this._x=e},window.SVGPathSegLinetoHorizontalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x}`},window.SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",t),this._x=e},window.SVGPathSegLinetoHorizontalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},window.SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x}`},window.SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",t),this._y=e},window.SVGPathSegLinetoVerticalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},window.SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._y}`},window.SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",t),this._y=e},window.SVGPathSegLinetoVerticalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},window.SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._y}`},window.SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t),this._x=e,this._y=i,this._x2=n,this._y2=o},window.SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`},window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t),this._x=e,this._y=i,this._x2=n,this._y2=o},window.SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x2} ${this._y2} ${this._x} ${this._y}`},window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return`${this.pathSegTypeAsLetter} ${this._x} ${this._y}`},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(t,e){return new window.SVGPathSegMovetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegMovetoRel=function(t,e){return new window.SVGPathSegMovetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(t,e){return new window.SVGPathSegLinetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoRel=function(t,e){return new window.SVGPathSegLinetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(t,e,i,n,o,r){return new window.SVGPathSegCurvetoCubicAbs(void 0,t,e,i,n,o,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(t,e,i,n,o,r){return new window.SVGPathSegCurvetoCubicRel(void 0,t,e,i,n,o,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegArcAbs=function(t,e,i,n,o,r,h){return new window.SVGPathSegArcAbs(void 0,t,e,i,n,o,r,h)},window.SVGPathElement.prototype.createSVGPathSegArcRel=function(t,e,i,n,o,r,h){return new window.SVGPathSegArcRel(void 0,t,e,i,n,o,r,h)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(t){return new window.SVGPathSegLinetoHorizontalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(t){return new window.SVGPathSegLinetoHorizontalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(t){return new window.SVGPathSegLinetoVerticalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(t){return new window.SVGPathSegLinetoVerticalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,t,e)},"getPathSegAtLength"in window.SVGPathElement.prototype||(window.SVGPathElement.prototype.getPathSegAtLength=function(t){if(void 0===t||!isFinite(t))throw"Invalid arguments.";let e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",this.getAttribute("d"));let i=e.pathSegList.numberOfItems-1;if(i<=0)return 0;do{if(e.pathSegList.removeItem(i),t>e.getTotalLength())break;i--}while(i>0)return i})),"SVGPathSegList"in window&&"appendItem"in window.SVGPathSegList.prototype||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathSegList.prototype,"length",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(!this._pathElement)return;let e=!1;t.forEach(function(t){"d"==t.attributeName&&(e=!0)}),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(t){t._owningPathSegList=null}),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);let e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){let e="",i=!0;return t.forEach(function(t){i?(i=!1,e+=t._asPathString()):e+=` ${t._asPathString()}`}),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t?.length)return[];let e=this,i=function(){this.pathSegList=[]};i.prototype.appendSegment=function(t){this.pathSegList.push(t)};let n=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};n.prototype._isCurrentSpace=function(){let t=this._string[this._currentIndex];return t<=" "&&(" "==t||`
|
|
2
|
+
`==t||" "==t||`\r`==t||"\f"==t)},n.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},n.prototype._skipOptionalSpacesOrDelimiter=function(){return(!(this._currentIndex<this._endIndex)||!!this._isCurrentSpace()||","==this._string.charAt(this._currentIndex))&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},n.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},n.prototype.peekSegmentType=function(){let t=this._string[this._currentIndex];return this._pathSegTypeFromChar(t)},n.prototype._pathSegTypeFromChar=function(t){switch(t){case"Z":case"z":return window.SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return window.SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return window.SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return window.SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return window.SVGPathSeg.PATHSEG_LINETO_REL;case"C":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return window.SVGPathSeg.PATHSEG_ARC_ABS;case"a":return window.SVGPathSeg.PATHSEG_ARC_REL;case"H":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return window.SVGPathSeg.PATHSEG_UNKNOWN}},n.prototype._nextCommandHelper=function(t,e){return("+"==t||"-"==t||"."==t||t>="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},n.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;let t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},n.prototype._parseNumber=function(){let t=0,e=0,i=1,n=0,o=1,r=1,h=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,o=-1),this._currentIndex==this._endIndex||("0">this._string.charAt(this._currentIndex)||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))return;let s=this._currentIndex;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&"9">=this._string.charAt(this._currentIndex);)this._currentIndex++;if(this._currentIndex!=s){let t=this._currentIndex-1,i=1;for(;t>=s;)e+=i*(this._string.charAt(t--)-0),i*=10}if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||"0">this._string.charAt(this._currentIndex)||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&"9">=this._string.charAt(this._currentIndex);)i*=10,n+=(this._string.charAt(this._currentIndex)-0)/i,this._currentIndex+=1}if(this._currentIndex!=h&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,r=-1),this._currentIndex>=this._endIndex||"0">this._string.charAt(this._currentIndex)||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&"9">=this._string.charAt(this._currentIndex);)t*=10,t+=this._string.charAt(this._currentIndex)-0,this._currentIndex++}let a=e+n;if(a*=o,t&&(a*=Math.pow(10,r*t)),h!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),a},n.prototype._parseArcFlag=function(){if(this._currentIndex>=this._endIndex)return;let t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t},n.prototype.parseSegment=function(){let t,i=this._string[this._currentIndex],n=this._pathSegTypeFromChar(i);if(n==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN||(n=this._nextCommandHelper(i,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:return t={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicRel(e,t.x,t.y,t.x1,t.y1,t.x2,t.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return t={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,t.x,t.y,t.x1,t.y1,t.x2,t.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return t={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,t.x,t.y,t.x2,t.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return t={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,t.x,t.y,t.x2,t.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return t={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,t.x,t.y,t.x1,t.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return t={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,t.x,t.y,t.x1,t.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return t={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,t.x,t.y,t.x1,t.y1,t.arcAngle,t.arcLarge,t.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return t={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,t.x,t.y,t.x1,t.y1,t.arcAngle,t.arcLarge,t.arcSweep);default:throw"Unknown path seg type."}};let o=new i,r=new n(t);if(!r.initialCommandIsMoveTo())return[];for(;r.hasMoreData();){let t=r.parseSegment();if(!t)return[];o.appendSegment(t)}return o.pathSegList})}catch(t){console.warn("An error occurred in tsParticles pathseg polyfill. If the Polygon Mask is not working, please open an issue here: https://github.com/tsparticles/tsparticles",t)}}();var n=i(303),o=i(173),r=i(468);let h="No polygon data loaded.";class s{dimension;offset;paths;raw;redrawTimeout;_container;_engine;_moveRadius;_scale;constructor(t,e){this._container=t,this._engine=e,this.dimension={height:0,width:0},this._moveRadius=0,this._scale=1}clickPositionValid(t){let e=this._container.actualOptions.polygon;return!!e?.enable&&e.type!==r.T.none&&e.type!==r.T.inline&&this._checkInsidePolygon(t)}draw(t){if(!this.paths?.length)return;let e=this._container.actualOptions.polygon;if(!e?.enable)return;let i=e.draw;if(!i.enable)return;let o=this.raw;for(let e of this.paths){let r=e.path2d;r&&this.offset?function(t,e,i,o,r,h=!1){e.setTransform(1,0,0,1,r.x,r.y);let s=(0,n.rangeColorToRgb)(t,o.color);s&&(e.strokeStyle=(0,n.getStyleFromRgb)(s,h,o.opacity),e.lineWidth=o.width,e.stroke(i),e.resetTransform())}(this._engine,t,r,i.stroke,this.offset,this._container.hdr):o&&function(t,e,i,o,r=!1){let h=(0,n.rangeColorToRgb)(t,o.color);if(!h)return;let s=i[0];if(s){for(let t of(e.beginPath(),e.moveTo(s.x,s.y),i))e.lineTo(t.x,t.y);e.closePath(),e.strokeStyle=(0,n.getStyleFromRgb)(h,r),e.lineWidth=o.width,e.stroke()}}(this._engine,t,o,i.stroke,this._container.hdr)}}async init(){let t=this._container,e=t.actualOptions.polygon,i=t.retina.pixelRatio;e&&(this._moveRadius=e.move.radius*i,this._scale=e.scale*i,e.enable&&await this._initRawData())}particleBounce(t,e,i){return this._polygonBounce(t,e,i)}particlePosition(t){let e=this._container.actualOptions.polygon;if(e?.enable&&(this.raw?.length??0)>0)return(0,n.deepExtend)({},t??this._randomPoint())}particlesInitialization(){let t=this._container.actualOptions.polygon;return!!t?.enable&&t.type===r.T.inline&&(t.inline.arrangement===o.G.onePerPoint||t.inline.arrangement===o.G.perPoint)&&(this._drawPoints(),!0)}resize(){let t=this._container,e=t.actualOptions.polygon;e?.enable&&e.type!==r.T.none&&(this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=setTimeout(()=>{(async()=>{await this._initRawData(!0),await t.particles.redraw()})()},250))}stop(){delete this.raw,delete this.paths}_checkInsidePolygon=t=>{let e=this._container,i=e.actualOptions.polygon;if(!i?.enable||i.type===r.T.none||i.type===r.T.inline)return!0;if(!this.raw)throw Error("No polygon found, you need to specify SVG url in config.");let o=e.canvas.size,h=t?.x??(0,n.getRandom)()*o.width,s=t?.y??(0,n.getRandom)()*o.height,a=!1;for(let t=0,e=this.raw.length-1;t<this.raw.length;e=t++){let i=this.raw[t],n=this.raw[e];i&&n&&i.y>s!=n.y>s&&h<(n.x-i.x)*(s-i.y)/(n.y-i.y)+i.x&&(a=!a)}return i.type===r.T.inside?a:!a};_createPath2D=()=>{if(this._container.actualOptions.polygon&&this.paths?.length)for(let t of this.paths){let e=t.element.getAttribute("d");if(e){let i=new Path2D(e),o=(0,n.safeDocument)().createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),r=new Path2D,h=o.scale(this._scale);r.addPath(i,h),t.path2d=r}else delete t.path2d;if(t.path2d??!this.raw)continue;t.path2d=new Path2D;let i=this.raw[0];i&&(t.path2d.moveTo(i.x,i.y),this.raw.forEach((e,i)=>{i>0&&t.path2d?.lineTo(e.x,e.y)}),t.path2d.closePath())}};_downloadSvgPath=async(t,e)=>{let i=this._container.actualOptions.polygon;if(!i)return;let n=t??i.url,o=e??!1;if(!n||void 0!==this.paths&&!o)return this.raw;let r=await fetch(n);if(!r.ok)throw Error("Error occurred during polygon mask download");return this._parseSvgPath(await r.text(),e)};_drawPoints=()=>{if(this.raw)for(let t of this.raw)this._container.particles.addParticle({x:t.x,y:t.y})};_getEquidistantPointByIndex=t=>{let e=this._container.actualOptions;if(!e.polygon)return;if(!this.raw?.length||!this.paths?.length)throw Error(h);let i=0,o,r=this.paths.reduce((t,e)=>t+e.length,0)/e.particles.number.value;for(let e of this.paths){let n=r*t-i;if(n<=e.length){o=e.element.getPointAtLength(n);break}i+=e.length}let s=this._scale;return{x:(o?.x??n.originPoint.x)*s+(this.offset?.x??n.originPoint.x),y:(o?.y??n.originPoint.y)*s+(this.offset?.y??n.originPoint.y)}};_getPointByIndex=t=>{if(!this.raw?.length)throw Error(h);let e=this.raw[t%this.raw.length];if(e)return{x:e.x,y:e.y}};_getRandomPoint=()=>{if(!this.raw?.length)throw Error(h);let t=(0,n.itemFromArray)(this.raw);if(t)return{x:t.x,y:t.y}};_getRandomPointByLength=()=>{if(!this._container.actualOptions.polygon)return;if(!this.raw?.length||!this.paths?.length)throw Error(h);let t=(0,n.itemFromArray)(this.paths);if(!t)return;let e=Math.floor((0,n.getRandom)()*t.length)+1,i=t.element.getPointAtLength(e),o=this._scale;return{x:i.x*o+(this.offset?.x??n.originPoint.x),y:i.y*o+(this.offset?.y??n.originPoint.y)}};_initRawData=async t=>{let e=this._container.actualOptions.polygon;if(e){if(e.url)this.raw=await this._downloadSvgPath(e.url,t);else if(e.data){let i,o=e.data;if((0,n.isString)(o))i=o;else{let t=t=>`<path d="${t}" />`,e=(0,n.isArray)(o.path)?o.path.map(t).join(""):t(o.path);i=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${o.size.width.toString()}" height="${o.size.height.toString()}">${e}</svg>`}this.raw=this._parseSvgPath(i,t)}this._createPath2D(),this._engine.dispatchEvent("polygonMaskLoaded",{container:this._container})}};_parseSvgPath=(t,e)=>{if(void 0!==this.paths&&!e)return this.raw;let i=this._container,o=i.actualOptions.polygon;if(!o)return;let r=new DOMParser().parseFromString(t,"image/svg+xml"),h=r.getElementsByTagName("svg")[0];if(!h)return;let s=h.getElementsByTagName("path");s.length||(s=r.getElementsByTagName("path")),this.paths=[];for(let t=0;t<s.length;t++){let e=s.item(t);e&&this.paths.push({element:e,length:e.getTotalLength()})}let a=this._scale;this.dimension.width=parseFloat(h.getAttribute("width")??"0")*a,this.dimension.height=parseFloat(h.getAttribute("height")??"0")*a;let S=o.position??{x:50,y:50},u=i.canvas.size;return this.offset={x:u.width*S.x/n.percentDenominator-this.dimension.width*n.half,y:u.height*S.y/n.percentDenominator-this.dimension.height*n.half},function(t,e,i){let n=[];for(let o of t){let t=o.element.pathSegList,r=t?.numberOfItems??0,h={x:0,y:0};for(let o=0;o<r;o++){let r=t?.getItem(o),s=globalThis.SVGPathSeg;switch(r?.pathSegType){case s.PATHSEG_MOVETO_ABS:case s.PATHSEG_LINETO_ABS:case s.PATHSEG_CURVETO_CUBIC_ABS:case s.PATHSEG_CURVETO_QUADRATIC_ABS:case s.PATHSEG_ARC_ABS:case s.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:case s.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:h.x=r.x,h.y=r.y;break;case s.PATHSEG_LINETO_HORIZONTAL_ABS:h.x=r.x;break;case s.PATHSEG_LINETO_VERTICAL_ABS:h.y=r.y;break;case s.PATHSEG_LINETO_REL:case s.PATHSEG_MOVETO_REL:case s.PATHSEG_CURVETO_CUBIC_REL:case s.PATHSEG_CURVETO_QUADRATIC_REL:case s.PATHSEG_ARC_REL:case s.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:case s.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:h.x+=r.x,h.y+=r.y;break;case s.PATHSEG_LINETO_HORIZONTAL_REL:h.x+=r.x;break;case s.PATHSEG_LINETO_VERTICAL_REL:h.y+=r.y;break;case s.PATHSEG_UNKNOWN:case s.PATHSEG_CLOSEPATH:default:continue}n.push({x:h.x*e+i.x,y:h.y*e+i.y})}}return n}(this.paths,a,this.offset)};_polygonBounce=(t,e,i)=>{let o=this._container.actualOptions.polygon;if(!this.raw||!o?.enable||i!==n.OutModeDirection.top)return!1;if(o.type===r.T.inside||o.type===r.T.outside){let e,i,o,r=t.getPosition(),h=t.getRadius();for(let s=0,a=this.raw.length-1;s<this.raw.length;a=s++){let S=this.raw[s],u=this.raw[a];if(!S||!u)continue;e=function(t,e,i){let{dx:o,dy:r}=(0,n.getDistances)(i,t),{dx:h,dy:s}=(0,n.getDistances)(e,t),a=(o*h+r*s)/(h**2+s**2),S={x:t.x+h*a,y:t.y+s*a,isOnSegment:a>=0&&a<=1};return a<0?(S.x=t.x,S.y=t.y):a>1&&(S.x=e.x,S.y=e.y),S}(S,u,r);let _=(0,n.getDistances)(r,e);if([i,o]=[_.dx,_.dy],_.distance<h)return!function(t,e,i){let{dx:o,dy:r}=(0,n.getDistances)(t,e),h=Math.atan2(r,o),s=n.Vector.create(Math.sin(h),-Math.cos(h)),a=n.double*(i.x*s.x+i.y*s.y);s.multTo(a),i.subFrom(s)}(S,u,t.velocity),!0}if(e&&void 0!==i&&void 0!==o&&!this._checkInsidePolygon(r)){let i={x:1,y:1},o=h*n.double;return r.x>=e.x&&(i.x=-1),r.y>=e.y&&(i.y=-1),t.position.x=e.x+o*i.x,t.position.y=e.y+o*i.y,t.velocity.mult(-1),!0}}else if(o.type===r.T.inline){let e=(0,n.getDistance)(t.initialPosition,t.getPosition()),{velocity:i}=t;if(e>this._moveRadius)return i.x=i.y*n.half-i.x,i.y=i.x*n.half-i.y,!0}return!1};_randomPoint=()=>{let t,e=this._container,i=e.actualOptions.polygon;if(i){if(i.type===r.T.inline)switch(i.inline.arrangement){case o.G.randomPoint:t=this._getRandomPoint();break;case o.G.randomLength:t=this._getRandomPointByLength();break;case o.G.equidistant:t=this._getEquidistantPointByIndex(e.particles.count);break;case o.G.onePerPoint:case o.G.perPoint:default:t=this._getPointByIndex(e.particles.count)}else{let i=e.canvas.size;t={x:(0,n.getRandom)()*i.width,y:(0,n.getRandom)()*i.height}}return this._checkInsidePolygon(t)?t:this._randomPoint()}}}}}]);
|
|
@@ -5,6 +5,15 @@ import { PolygonMaskLocalSvg } from "./PolygonMaskLocalSvg.js";
|
|
|
5
5
|
import { PolygonMaskMove } from "./PolygonMaskMove.js";
|
|
6
6
|
import { PolygonMaskType } from "../../Enums/PolygonMaskType.js";
|
|
7
7
|
export class PolygonMask {
|
|
8
|
+
data;
|
|
9
|
+
draw;
|
|
10
|
+
enable;
|
|
11
|
+
inline;
|
|
12
|
+
move;
|
|
13
|
+
position;
|
|
14
|
+
scale;
|
|
15
|
+
type;
|
|
16
|
+
url;
|
|
8
17
|
constructor(engine) {
|
|
9
18
|
this.draw = new PolygonMaskDraw(engine);
|
|
10
19
|
this.enable = false;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isNull } from "@tsparticles/engine";
|
|
2
2
|
import { PolygonMaskDrawStroke } from "./PolygonMaskDrawStroke.js";
|
|
3
3
|
export class PolygonMaskDraw {
|
|
4
|
+
enable;
|
|
5
|
+
stroke;
|
|
4
6
|
constructor(engine) {
|
|
5
7
|
this.enable = false;
|
|
6
8
|
this.stroke = new PolygonMaskDrawStroke(engine);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isNull } from "@tsparticles/engine";
|
|
2
2
|
import { PolygonMaskInlineArrangement, } from "../../Enums/PolygonMaskInlineArrangement.js";
|
|
3
3
|
export class PolygonMaskInline {
|
|
4
|
+
arrangement;
|
|
4
5
|
constructor() {
|
|
5
6
|
this.arrangement = PolygonMaskInlineArrangement.onePerPoint;
|
|
6
7
|
}
|