Socket
Socket
Sign inDemoInstall

@pixi/canvas-renderer

Package Overview
Dependencies
Maintainers
2
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/canvas-renderer - npm Package Compare versions

Comparing version 6.2.2 to 6.3.0

18

dist/browser/canvas-renderer.js
/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -580,2 +580,8 @@ * @pixi/canvas-renderer is licensed under the MIT License.

}
/**
* Adds a new system to the renderer. It does nothing in the CanvasRenderer.
*/
CanvasRenderer.prototype.addSystem = function () {
return this;
};
/** @ignore */

@@ -818,3 +824,3 @@ CanvasRenderer.prototype.render = function (displayObject, options) {

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.tintCache = texture.tintCache || {};

@@ -855,3 +861,3 @@ var cachedCanvas = texture.tintCache[stringColor];

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.patternCache = texture.patternCache || {};

@@ -890,3 +896,3 @@ var pattern = texture.patternCache[stringColor];

context.save();
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -920,3 +926,3 @@ context.globalCompositeOperation = 'multiply';

context.globalCompositeOperation = 'copy';
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -923,0 +929,0 @@ context.globalCompositeOperation = 'destination-atop';

/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/canvas-renderer is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_canvas_renderer=function(e,t,r,o,n,i){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var s=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,r=e.maskObject||e;t.context.save();var o=this._foundShapes;if(this.recursiveFindShapes(r,o),o.length>0){var n=t.context;n.beginPath();for(var i=0;i<o.length;i++){var a=o[i],s=a.transform.worldTransform;this.renderer.setContextTransform(s),this.renderGraphicsShape(a)}o.length=0,n.clip()}},e.prototype.recursiveFindShapes=function(e,t){e.geometry&&e.geometry.graphicsData&&t.push(e);var r=e.children;if(r)for(var o=0;o<r.length;o++)this.recursiveFindShapes(r[o],t)},e.prototype.renderGraphicsShape=function(e){e.finishPoly();var t=this.renderer.context,r=e.geometry.graphicsData,n=r.length;if(0!==n)for(var i=0;i<n;i++){var a=r[i],s=a.shape;if(s.type===o.SHAPES.POLY){var h=s.points,l=a.holes,c=void 0,d=void 0,u=void 0,E=void 0;t.moveTo(h[0],h[1]);for(var g=1;g<h.length/2;g++)t.lineTo(h[2*g],h[2*g+1]);if(l.length>0){c=0,u=h[0],E=h[1];for(g=2;g+2<h.length;g+=2)c+=(h[g]-u)*(h[g+3]-E)-(h[g+2]-u)*(h[g+1]-E);for(var p=0;p<l.length;p++)if(h=l[p].shape.points){d=0,u=h[0],E=h[1];for(g=2;g+2<h.length;g+=2)d+=(h[g]-u)*(h[g+3]-E)-(h[g+2]-u)*(h[g+1]-E);if(d*c<0){t.moveTo(h[0],h[1]);for(g=2;g<h.length;g+=2)t.lineTo(h[g],h[g+1])}else{t.moveTo(h[h.length-2],h[h.length-1]);for(g=h.length-4;g>=0;g-=2)t.lineTo(h[g],h[g+1])}l[p].shape.closeStroke&&t.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&t.closePath()}else if(s.type===o.SHAPES.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.SHAPES.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.SHAPES.ELIP){var D=2*s.width,v=2*s.height,_=s.x-D/2,S=s.y-v/2,f=D/2*.5522848,O=v/2*.5522848,M=_+D,m=S+v,T=_+D/2,C=S+v/2;t.moveTo(_,C),t.bezierCurveTo(_,C-O,T-f,S,T,S),t.bezierCurveTo(T+f,S,M,C-O,M,C),t.bezierCurveTo(M,C+O,T+f,m,T,m),t.bezierCurveTo(T-f,m,_,C+O,_,C),t.closePath()}else if(s.type===o.SHAPES.RREC){var N=s.x,L=s.y,y=s.width,x=s.height,B=s.radius,b=Math.min(y,x)/2;B=B>b?b:B,t.moveTo(N,L+B),t.lineTo(N,L+x-B),t.quadraticCurveTo(N,L+x,N+B,L+x),t.lineTo(N+y-B,L+x),t.quadraticCurveTo(N+y,L+x,N+y,L+x-B),t.lineTo(N+y,L+B),t.quadraticCurveTo(N+y,L,N+y-B,L),t.lineTo(N+B,L),t.quadraticCurveTo(N,L,N,L+B),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function h(e){var t=document.createElement("canvas");t.width=6,t.height=1;var r=t.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,6,1),t}function l(){if("undefined"==typeof document)return!1;var e=h("#ff00ff"),t=h("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var o=r.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(e,0,0),o.drawImage(t,2,0);var n=o.getImageData(2,0,1,1);if(!n)return!1;var i=n.data;return 255===i[0]&&0===i[1]&&0===i[2]}var c=new o.Matrix,d=function(e){function o(t){var i,a=e.call(this,n.RENDERER_TYPE.CANVAS,t)||this;if(a.refresh=!0,a.maskManager=new s(a),a.smoothProperty="imageSmoothingEnabled",a.blendModes=(void 0===i&&(i=[]),l()?(i[n.BLEND_MODES.NORMAL]="source-over",i[n.BLEND_MODES.ADD]="lighter",i[n.BLEND_MODES.MULTIPLY]="multiply",i[n.BLEND_MODES.SCREEN]="screen",i[n.BLEND_MODES.OVERLAY]="overlay",i[n.BLEND_MODES.DARKEN]="darken",i[n.BLEND_MODES.LIGHTEN]="lighten",i[n.BLEND_MODES.COLOR_DODGE]="color-dodge",i[n.BLEND_MODES.COLOR_BURN]="color-burn",i[n.BLEND_MODES.HARD_LIGHT]="hard-light",i[n.BLEND_MODES.SOFT_LIGHT]="soft-light",i[n.BLEND_MODES.DIFFERENCE]="difference",i[n.BLEND_MODES.EXCLUSION]="exclusion",i[n.BLEND_MODES.HUE]="hue",i[n.BLEND_MODES.SATURATION]="saturate",i[n.BLEND_MODES.COLOR]="color",i[n.BLEND_MODES.LUMINOSITY]="luminosity"):(i[n.BLEND_MODES.NORMAL]="source-over",i[n.BLEND_MODES.ADD]="lighter",i[n.BLEND_MODES.MULTIPLY]="source-over",i[n.BLEND_MODES.SCREEN]="source-over",i[n.BLEND_MODES.OVERLAY]="source-over",i[n.BLEND_MODES.DARKEN]="source-over",i[n.BLEND_MODES.LIGHTEN]="source-over",i[n.BLEND_MODES.COLOR_DODGE]="source-over",i[n.BLEND_MODES.COLOR_BURN]="source-over",i[n.BLEND_MODES.HARD_LIGHT]="source-over",i[n.BLEND_MODES.SOFT_LIGHT]="source-over",i[n.BLEND_MODES.DIFFERENCE]="source-over",i[n.BLEND_MODES.EXCLUSION]="source-over",i[n.BLEND_MODES.HUE]="source-over",i[n.BLEND_MODES.SATURATION]="source-over",i[n.BLEND_MODES.COLOR]="source-over",i[n.BLEND_MODES.LUMINOSITY]="source-over"),i[n.BLEND_MODES.NORMAL_NPM]=i[n.BLEND_MODES.NORMAL],i[n.BLEND_MODES.ADD_NPM]=i[n.BLEND_MODES.ADD],i[n.BLEND_MODES.SCREEN_NPM]=i[n.BLEND_MODES.SCREEN],i[n.BLEND_MODES.SRC_IN]="source-in",i[n.BLEND_MODES.SRC_OUT]="source-out",i[n.BLEND_MODES.SRC_ATOP]="source-atop",i[n.BLEND_MODES.DST_OVER]="destination-over",i[n.BLEND_MODES.DST_IN]="destination-in",i[n.BLEND_MODES.DST_OUT]="destination-out",i[n.BLEND_MODES.DST_ATOP]="destination-atop",i[n.BLEND_MODES.XOR]="xor",i[n.BLEND_MODES.SUBTRACT]="source-over",i),a.renderingToScreen=!1,a._activeBlendMode=null,a._projTransform=null,a._outerBlend=!1,a.rootContext=a.view.getContext("2d",{alpha:a.useContextAlpha}),a.context=a.rootContext,!a.rootContext.imageSmoothingEnabled){var h=a.rootContext;h.webkitImageSmoothingEnabled?a.smoothProperty="webkitImageSmoothingEnabled":h.mozImageSmoothingEnabled?a.smoothProperty="mozImageSmoothingEnabled":h.oImageSmoothingEnabled?a.smoothProperty="oImageSmoothingEnabled":h.msImageSmoothingEnabled&&(a.smoothProperty="msImageSmoothingEnabled")}return a.initPlugins(o.__plugins),r.sayHello("Canvas"),a.resize(a.options.width,a.options.height),a}return function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(o,e),o.prototype.render=function(e,o){if(this.view){var i,a,s,h;o&&(o instanceof t.RenderTexture||o instanceof t.BaseRenderTexture?(i=o,a=arguments[2],s=arguments[3],h=arguments[4]):(i=o.renderTexture,a=o.clear,s=o.transform,h=o.skipUpdateTransform)),this.renderingToScreen=!i,this.emit("prerender");var l=this.resolution;i?((i=i.castToBaseTexture())._canvasRenderTarget||(i._canvasRenderTarget=new r.CanvasRenderTarget(i.width,i.height,i.resolution),i.resource=new t.CanvasResource(i._canvasRenderTarget.canvas),i.valid=!0),this.context=i._canvasRenderTarget.context,this.resolution=i._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,i||(this._lastObjectRendered=e),!h){var d=e.enableTempParent();e.updateTransform(),e.disableTempParent(d)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=n.BLEND_MODES.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[n.BLEND_MODES.NORMAL],void 0!==a?a:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(i=i)._canvasRenderTarget.clear();var u=i.clearColor;u[3]>0&&(c.globalAlpha=this.useContextAlpha?u[3]:1,c.fillStyle=r.hex2string(r.rgb2hex(u)),c.fillRect(0,0,i.realWidth,i.realHeight),c.globalAlpha=1)}var E=this.context;this.context=c,e.renderCanvas(this),this.context=E,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},o.prototype.setContextTransform=function(e,t,r){var o=e,n=this._projTransform,i=this.resolution;r=r||i,n&&((o=c).copyFrom(e),o.prepend(n)),t?this.context.setTransform(o.a*r,o.b*r,o.c*r,o.d*r,o.tx*i|0,o.ty*i|0):this.context.setTransform(o.a*r,o.b*r,o.c*r,o.d*r,o.tx*i,o.ty*i)},o.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),e&&(r.globalAlpha=this.useContextAlpha?t:1,r.fillStyle=e,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},o.prototype.setBlendMode=function(e,t){var r=e===n.BLEND_MODES.SRC_IN||e===n.BLEND_MODES.SRC_OUT||e===n.BLEND_MODES.DST_IN||e===n.BLEND_MODES.DST_ATOP;!t&&r&&(e=n.BLEND_MODES.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[e])},o.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},o.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=i.settings.SCALE_MODE===n.SCALE_MODES.LINEAR)},o.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},o.registerPlugin=function(e,t){o.__plugins=o.__plugins||{},o.__plugins[e]=t},o}(t.AbstractRenderer),u={canvas:null,getTintedCanvas:function(e,t){var r=e.texture,o="#"+("00000"+(0|(t=u.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,i=r.tintCache[o];if(i){if(i.tintId===r._updateID)return r.tintCache[o];n=r.tintCache[o]}else n=document.createElement("canvas");if(u.tintMethod(r,t,n),n.tintId=r._updateID,u.convertTintToImage){var a=new Image;a.src=n.toDataURL(),r.tintCache[o]=a}else r.tintCache[o]=n;return n},getTintedPattern:function(e,t){var r="#"+("00000"+(0|(t=u.roundColor(t))).toString(16)).substr(-6);e.patternCache=e.patternCache||{};var o=e.patternCache[r];return o&&o.tintId===e._updateID?o:(u.canvas||(u.canvas=document.createElement("canvas")),u.tintMethod(e,t,u.canvas),(o=u.canvas.getContext("2d").createPattern(u.canvas,"repeat")).tintId=e._updateID,e.patternCache[r]=o,o)},tintWithMultiply:function(e,t,r){var o=r.getContext("2d"),n=e._frame.clone(),i=e.baseTexture.resolution;n.x*=i,n.y*=i,n.width*=i,n.height*=i,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),o.save(),o.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),o.fillRect(0,0,n.width,n.height),o.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();o.drawImage(a,n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.globalCompositeOperation="destination-atop",o.drawImage(a,n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.restore()},tintWithOverlay:function(e,t,r){var o=r.getContext("2d"),n=e._frame.clone(),i=e.baseTexture.resolution;n.x*=i,n.y*=i,n.width*=i,n.height*=i,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),o.save(),o.globalCompositeOperation="copy",o.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),o.fillRect(0,0,n.width,n.height),o.globalCompositeOperation="destination-atop",o.drawImage(e.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.restore()},tintWithPerPixel:function(e,t,o){var n=o.getContext("2d"),i=e._frame.clone(),a=e.baseTexture.resolution;i.x*=a,i.y*=a,i.width*=a,i.height*=a,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore();for(var s=r.hex2rgb(t),h=s[0],l=s[1],c=s[2],d=n.getImageData(0,0,i.width,i.height),u=d.data,E=0;E<u.length;E+=4)u[E+0]*=h,u[E+1]*=l,u[E+2]*=c;n.putImageData(d,0,0)},roundColor:function(e){var t=u.cacheStepsPerColorChannel,o=r.hex2rgb(e);return o[0]=Math.min(255,o[0]/t*t),o[1]=Math.min(255,o[1]/t*t),o[2]=Math.min(255,o[2]/t*t),r.rgb2hex(o)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:l(),tintMethod:null};u.tintMethod=u.canUseMultiply?u.tintWithMultiply:u.tintWithPerPixel;var E=t.Renderer.create;return t.Renderer.create=function(e){if(!(e&&e.forceCanvas))try{return E(e)}catch(e){}return new d(e)},t.BaseTexture.prototype.getDrawableSource=function(){var e=this.resource;return e?e.bitmap||e.source:null},t.BaseRenderTexture.prototype._canvasRenderTarget=null,t.Texture.prototype.patternCache=null,t.Texture.prototype.tintCache=null,e.CanvasRenderer=d,e.canUseNewCanvasBlendModes=l,e.canvasUtils=u,e}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_renderer);
this.PIXI=this.PIXI||{};var _pixi_canvas_renderer=function(e,t,r,o,n,i){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var s=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,r=e.maskObject||e;t.context.save();var o=this._foundShapes;if(this.recursiveFindShapes(r,o),o.length>0){var n=t.context;n.beginPath();for(var i=0;i<o.length;i++){var a=o[i],s=a.transform.worldTransform;this.renderer.setContextTransform(s),this.renderGraphicsShape(a)}o.length=0,n.clip()}},e.prototype.recursiveFindShapes=function(e,t){e.geometry&&e.geometry.graphicsData&&t.push(e);var r=e.children;if(r)for(var o=0;o<r.length;o++)this.recursiveFindShapes(r[o],t)},e.prototype.renderGraphicsShape=function(e){e.finishPoly();var t=this.renderer.context,r=e.geometry.graphicsData,n=r.length;if(0!==n)for(var i=0;i<n;i++){var a=r[i],s=a.shape;if(s.type===o.SHAPES.POLY){var h=s.points,l=a.holes,c=void 0,d=void 0,u=void 0,E=void 0;t.moveTo(h[0],h[1]);for(var p=1;p<h.length/2;p++)t.lineTo(h[2*p],h[2*p+1]);if(l.length>0){c=0,u=h[0],E=h[1];for(p=2;p+2<h.length;p+=2)c+=(h[p]-u)*(h[p+3]-E)-(h[p+2]-u)*(h[p+1]-E);for(var g=0;g<l.length;g++)if(h=l[g].shape.points){d=0,u=h[0],E=h[1];for(p=2;p+2<h.length;p+=2)d+=(h[p]-u)*(h[p+3]-E)-(h[p+2]-u)*(h[p+1]-E);if(d*c<0){t.moveTo(h[0],h[1]);for(p=2;p<h.length;p+=2)t.lineTo(h[p],h[p+1])}else{t.moveTo(h[h.length-2],h[h.length-1]);for(p=h.length-4;p>=0;p-=2)t.lineTo(h[p],h[p+1])}l[g].shape.closeStroke&&t.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&t.closePath()}else if(s.type===o.SHAPES.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.SHAPES.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.SHAPES.ELIP){var D=2*s.width,v=2*s.height,S=s.x-D/2,_=s.y-v/2,f=D/2*.5522848,O=v/2*.5522848,M=S+D,m=_+v,T=S+D/2,C=_+v/2;t.moveTo(S,C),t.bezierCurveTo(S,C-O,T-f,_,T,_),t.bezierCurveTo(T+f,_,M,C-O,M,C),t.bezierCurveTo(M,C+O,T+f,m,T,m),t.bezierCurveTo(T-f,m,S,C+O,S,C),t.closePath()}else if(s.type===o.SHAPES.RREC){var N=s.x,L=s.y,y=s.width,x=s.height,B=s.radius,R=Math.min(y,x)/2;B=B>R?R:B,t.moveTo(N,L+B),t.lineTo(N,L+x-B),t.quadraticCurveTo(N,L+x,N+B,L+x),t.lineTo(N+y-B,L+x),t.quadraticCurveTo(N+y,L+x,N+y,L+x-B),t.lineTo(N+y,L+B),t.quadraticCurveTo(N+y,L,N+y-B,L),t.lineTo(N+B,L),t.quadraticCurveTo(N,L,N,L+B),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function h(e){var t=document.createElement("canvas");t.width=6,t.height=1;var r=t.getContext("2d");return r.fillStyle=e,r.fillRect(0,0,6,1),t}function l(){if("undefined"==typeof document)return!1;var e=h("#ff00ff"),t=h("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var o=r.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(e,0,0),o.drawImage(t,2,0);var n=o.getImageData(2,0,1,1);if(!n)return!1;var i=n.data;return 255===i[0]&&0===i[1]&&0===i[2]}var c=new o.Matrix,d=function(e){function o(t){var i,a=e.call(this,n.RENDERER_TYPE.CANVAS,t)||this;if(a.refresh=!0,a.maskManager=new s(a),a.smoothProperty="imageSmoothingEnabled",a.blendModes=(void 0===i&&(i=[]),l()?(i[n.BLEND_MODES.NORMAL]="source-over",i[n.BLEND_MODES.ADD]="lighter",i[n.BLEND_MODES.MULTIPLY]="multiply",i[n.BLEND_MODES.SCREEN]="screen",i[n.BLEND_MODES.OVERLAY]="overlay",i[n.BLEND_MODES.DARKEN]="darken",i[n.BLEND_MODES.LIGHTEN]="lighten",i[n.BLEND_MODES.COLOR_DODGE]="color-dodge",i[n.BLEND_MODES.COLOR_BURN]="color-burn",i[n.BLEND_MODES.HARD_LIGHT]="hard-light",i[n.BLEND_MODES.SOFT_LIGHT]="soft-light",i[n.BLEND_MODES.DIFFERENCE]="difference",i[n.BLEND_MODES.EXCLUSION]="exclusion",i[n.BLEND_MODES.HUE]="hue",i[n.BLEND_MODES.SATURATION]="saturate",i[n.BLEND_MODES.COLOR]="color",i[n.BLEND_MODES.LUMINOSITY]="luminosity"):(i[n.BLEND_MODES.NORMAL]="source-over",i[n.BLEND_MODES.ADD]="lighter",i[n.BLEND_MODES.MULTIPLY]="source-over",i[n.BLEND_MODES.SCREEN]="source-over",i[n.BLEND_MODES.OVERLAY]="source-over",i[n.BLEND_MODES.DARKEN]="source-over",i[n.BLEND_MODES.LIGHTEN]="source-over",i[n.BLEND_MODES.COLOR_DODGE]="source-over",i[n.BLEND_MODES.COLOR_BURN]="source-over",i[n.BLEND_MODES.HARD_LIGHT]="source-over",i[n.BLEND_MODES.SOFT_LIGHT]="source-over",i[n.BLEND_MODES.DIFFERENCE]="source-over",i[n.BLEND_MODES.EXCLUSION]="source-over",i[n.BLEND_MODES.HUE]="source-over",i[n.BLEND_MODES.SATURATION]="source-over",i[n.BLEND_MODES.COLOR]="source-over",i[n.BLEND_MODES.LUMINOSITY]="source-over"),i[n.BLEND_MODES.NORMAL_NPM]=i[n.BLEND_MODES.NORMAL],i[n.BLEND_MODES.ADD_NPM]=i[n.BLEND_MODES.ADD],i[n.BLEND_MODES.SCREEN_NPM]=i[n.BLEND_MODES.SCREEN],i[n.BLEND_MODES.SRC_IN]="source-in",i[n.BLEND_MODES.SRC_OUT]="source-out",i[n.BLEND_MODES.SRC_ATOP]="source-atop",i[n.BLEND_MODES.DST_OVER]="destination-over",i[n.BLEND_MODES.DST_IN]="destination-in",i[n.BLEND_MODES.DST_OUT]="destination-out",i[n.BLEND_MODES.DST_ATOP]="destination-atop",i[n.BLEND_MODES.XOR]="xor",i[n.BLEND_MODES.SUBTRACT]="source-over",i),a.renderingToScreen=!1,a._activeBlendMode=null,a._projTransform=null,a._outerBlend=!1,a.rootContext=a.view.getContext("2d",{alpha:a.useContextAlpha}),a.context=a.rootContext,!a.rootContext.imageSmoothingEnabled){var h=a.rootContext;h.webkitImageSmoothingEnabled?a.smoothProperty="webkitImageSmoothingEnabled":h.mozImageSmoothingEnabled?a.smoothProperty="mozImageSmoothingEnabled":h.oImageSmoothingEnabled?a.smoothProperty="oImageSmoothingEnabled":h.msImageSmoothingEnabled&&(a.smoothProperty="msImageSmoothingEnabled")}return a.initPlugins(o.__plugins),r.sayHello("Canvas"),a.resize(a.options.width,a.options.height),a}return function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(o,e),o.prototype.addSystem=function(){return this},o.prototype.render=function(e,o){if(this.view){var i,a,s,h;o&&(o instanceof t.RenderTexture||o instanceof t.BaseRenderTexture?(i=o,a=arguments[2],s=arguments[3],h=arguments[4]):(i=o.renderTexture,a=o.clear,s=o.transform,h=o.skipUpdateTransform)),this.renderingToScreen=!i,this.emit("prerender");var l=this.resolution;i?((i=i.castToBaseTexture())._canvasRenderTarget||(i._canvasRenderTarget=new r.CanvasRenderTarget(i.width,i.height,i.resolution),i.resource=new t.CanvasResource(i._canvasRenderTarget.canvas),i.valid=!0),this.context=i._canvasRenderTarget.context,this.resolution=i._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,i||(this._lastObjectRendered=e),!h){var d=e.enableTempParent();e.updateTransform(),e.disableTempParent(d)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=n.BLEND_MODES.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[n.BLEND_MODES.NORMAL],void 0!==a?a:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(i=i)._canvasRenderTarget.clear();var u=i.clearColor;u[3]>0&&(c.globalAlpha=this.useContextAlpha?u[3]:1,c.fillStyle=r.hex2string(r.rgb2hex(u)),c.fillRect(0,0,i.realWidth,i.realHeight),c.globalAlpha=1)}var E=this.context;this.context=c,e.renderCanvas(this),this.context=E,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},o.prototype.setContextTransform=function(e,t,r){var o=e,n=this._projTransform,i=this.resolution;r=r||i,n&&((o=c).copyFrom(e),o.prepend(n)),t?this.context.setTransform(o.a*r,o.b*r,o.c*r,o.d*r,o.tx*i|0,o.ty*i|0):this.context.setTransform(o.a*r,o.b*r,o.c*r,o.d*r,o.tx*i,o.ty*i)},o.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),e&&(r.globalAlpha=this.useContextAlpha?t:1,r.fillStyle=e,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},o.prototype.setBlendMode=function(e,t){var r=e===n.BLEND_MODES.SRC_IN||e===n.BLEND_MODES.SRC_OUT||e===n.BLEND_MODES.DST_IN||e===n.BLEND_MODES.DST_ATOP;!t&&r&&(e=n.BLEND_MODES.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[e])},o.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},o.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=i.settings.SCALE_MODE===n.SCALE_MODES.LINEAR)},o.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},o.registerPlugin=function(e,t){o.__plugins=o.__plugins||{},o.__plugins[e]=t},o}(t.AbstractRenderer),u={canvas:null,getTintedCanvas:function(e,t){var r=e.texture,o="#"+("00000"+(0|(t=u.roundColor(t))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var n,i=r.tintCache[o];if(i){if(i.tintId===r._updateID)return r.tintCache[o];n=r.tintCache[o]}else n=document.createElement("canvas");if(u.tintMethod(r,t,n),n.tintId=r._updateID,u.convertTintToImage){var a=new Image;a.src=n.toDataURL(),r.tintCache[o]=a}else r.tintCache[o]=n;return n},getTintedPattern:function(e,t){var r="#"+("00000"+(0|(t=u.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var o=e.patternCache[r];return o&&o.tintId===e._updateID?o:(u.canvas||(u.canvas=document.createElement("canvas")),u.tintMethod(e,t,u.canvas),(o=u.canvas.getContext("2d").createPattern(u.canvas,"repeat")).tintId=e._updateID,e.patternCache[r]=o,o)},tintWithMultiply:function(e,t,r){var o=r.getContext("2d"),n=e._frame.clone(),i=e.baseTexture.resolution;n.x*=i,n.y*=i,n.width*=i,n.height*=i,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),o.save(),o.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),o.fillRect(0,0,n.width,n.height),o.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();o.drawImage(a,n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.globalCompositeOperation="destination-atop",o.drawImage(a,n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.restore()},tintWithOverlay:function(e,t,r){var o=r.getContext("2d"),n=e._frame.clone(),i=e.baseTexture.resolution;n.x*=i,n.y*=i,n.width*=i,n.height*=i,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),o.save(),o.globalCompositeOperation="copy",o.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),o.fillRect(0,0,n.width,n.height),o.globalCompositeOperation="destination-atop",o.drawImage(e.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),o.restore()},tintWithPerPixel:function(e,t,o){var n=o.getContext("2d"),i=e._frame.clone(),a=e.baseTexture.resolution;i.x*=a,i.y*=a,i.width*=a,i.height*=a,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),n.restore();for(var s=r.hex2rgb(t),h=s[0],l=s[1],c=s[2],d=n.getImageData(0,0,i.width,i.height),u=d.data,E=0;E<u.length;E+=4)u[E+0]*=h,u[E+1]*=l,u[E+2]*=c;n.putImageData(d,0,0)},roundColor:function(e){var t=u.cacheStepsPerColorChannel,o=r.hex2rgb(e);return o[0]=Math.min(255,o[0]/t*t),o[1]=Math.min(255,o[1]/t*t),o[2]=Math.min(255,o[2]/t*t),r.rgb2hex(o)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:l(),tintMethod:null};u.tintMethod=u.canUseMultiply?u.tintWithMultiply:u.tintWithPerPixel;var E=t.Renderer.create;return t.Renderer.create=function(e){if(!(e&&e.forceCanvas))try{return E(e)}catch(e){}return new d(e)},t.BaseTexture.prototype.getDrawableSource=function(){var e=this.resource;return e?e.bitmap||e.source:null},t.BaseRenderTexture.prototype._canvasRenderTarget=null,t.Texture.prototype.patternCache=null,t.Texture.prototype.tintCache=null,e.CanvasRenderer=d,e.canUseNewCanvasBlendModes=l,e.canvasUtils=u,e}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_canvas_renderer);
//# sourceMappingURL=canvas-renderer.min.js.map
/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -424,2 +424,8 @@ * @pixi/canvas-renderer is licensed under the MIT License.

}
/**
* Adds a new system to the renderer. It does nothing in the CanvasRenderer.
*/
CanvasRenderer.prototype.addSystem = function () {
return this;
};
/** @ignore */

@@ -662,3 +668,3 @@ CanvasRenderer.prototype.render = function (displayObject, options) {

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.tintCache = texture.tintCache || {};

@@ -699,3 +705,3 @@ var cachedCanvas = texture.tintCache[stringColor];

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.patternCache = texture.patternCache || {};

@@ -734,3 +740,3 @@ var pattern = texture.patternCache[stringColor];

context.save();
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -764,3 +770,3 @@ context.globalCompositeOperation = 'multiply';

context.globalCompositeOperation = 'copy';
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -767,0 +773,0 @@ context.globalCompositeOperation = 'destination-atop';

/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/canvas-renderer is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@pixi/core"),utils=require("@pixi/utils"),math=require("@pixi/math"),constants=require("@pixi/constants"),settings=require("@pixi/settings"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function __extends(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var CanvasMaskManager=function(){function t(t){this._foundShapes=[],this.renderer=t}return t.prototype.pushMask=function(t){var e=this.renderer,n=t.maskObject||t;e.context.save();var o=this._foundShapes;if(this.recursiveFindShapes(n,o),o.length>0){var a=e.context;a.beginPath();for(var r=0;r<o.length;r++){var s=o[r],i=s.transform.worldTransform;this.renderer.setContextTransform(i),this.renderGraphicsShape(s)}o.length=0,a.clip()}},t.prototype.recursiveFindShapes=function(t,e){t.geometry&&t.geometry.graphicsData&&e.push(t);var n=t.children;if(n)for(var o=0;o<n.length;o++)this.recursiveFindShapes(n[o],e)},t.prototype.renderGraphicsShape=function(t){t.finishPoly();var e=this.renderer.context,n=t.geometry.graphicsData,o=n.length;if(0!==o)for(var a=0;a<o;a++){var r=n[a],s=r.shape;if(s.type===math.SHAPES.POLY){var i=s.points,c=r.holes,h=void 0,l=void 0,d=void 0,u=void 0;e.moveTo(i[0],i[1]);for(var p=1;p<i.length/2;p++)e.lineTo(i[2*p],i[2*p+1]);if(c.length>0){h=0,d=i[0],u=i[1];for(p=2;p+2<i.length;p+=2)h+=(i[p]-d)*(i[p+3]-u)-(i[p+2]-d)*(i[p+1]-u);for(var v=0;v<c.length;v++)if(i=c[v].shape.points){l=0,d=i[0],u=i[1];for(p=2;p+2<i.length;p+=2)l+=(i[p]-d)*(i[p+3]-u)-(i[p+2]-d)*(i[p+1]-u);if(l*h<0){e.moveTo(i[0],i[1]);for(p=2;p<i.length;p+=2)e.lineTo(i[p],i[p+1])}else{e.moveTo(i[i.length-2],i[i.length-1]);for(p=i.length-4;p>=0;p-=2)e.lineTo(i[p],i[p+1])}c[v].shape.closeStroke&&e.closePath()}}i[0]===i[i.length-2]&&i[1]===i[i.length-1]&&e.closePath()}else if(s.type===math.SHAPES.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(s.type===math.SHAPES.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(s.type===math.SHAPES.ELIP){var E=2*s.width,g=2*s.height,D=s.x-E/2,S=s.y-g/2,_=E/2*.5522848,M=g/2*.5522848,f=D+E,m=S+g,O=D+E/2,C=S+g/2;e.moveTo(D,C),e.bezierCurveTo(D,C-M,O-_,S,O,S),e.bezierCurveTo(O+_,S,f,C-M,f,C),e.bezierCurveTo(f,C+M,O+_,m,O,m),e.bezierCurveTo(O-_,m,D,C+M,D,C),e.closePath()}else if(s.type===math.SHAPES.RREC){var T=s.x,N=s.y,x=s.width,L=s.height,B=s.radius,y=Math.min(x,L)/2;B=B>y?y:B,e.moveTo(T,N+B),e.lineTo(T,N+L-B),e.quadraticCurveTo(T,N+L,T+B,N+L),e.lineTo(T+x-B,N+L),e.quadraticCurveTo(T+x,N+L,T+x,N+L-B),e.lineTo(T+x,N+B),e.quadraticCurveTo(T+x,N,T+x-B,N),e.lineTo(T+B,N),e.quadraticCurveTo(T,N,T,N+B),e.closePath()}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();function createColoredCanvas(t){var e=document.createElement("canvas");e.width=6,e.height=1;var n=e.getContext("2d");return n.fillStyle=t,n.fillRect(0,0,6,1),e}function canUseNewCanvasBlendModes(){if("undefined"==typeof document)return!1;var t=createColoredCanvas("#ff00ff"),e=createColoredCanvas("#ffff00"),n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(t,0,0),o.drawImage(e,2,0);var a=o.getImageData(2,0,1,1);if(!a)return!1;var r=a.data;return 255===r[0]&&0===r[1]&&0===r[2]}function mapCanvasBlendModesToPixi(t){return void 0===t&&(t=[]),canUseNewCanvasBlendModes()?(t[constants.BLEND_MODES.NORMAL]="source-over",t[constants.BLEND_MODES.ADD]="lighter",t[constants.BLEND_MODES.MULTIPLY]="multiply",t[constants.BLEND_MODES.SCREEN]="screen",t[constants.BLEND_MODES.OVERLAY]="overlay",t[constants.BLEND_MODES.DARKEN]="darken",t[constants.BLEND_MODES.LIGHTEN]="lighten",t[constants.BLEND_MODES.COLOR_DODGE]="color-dodge",t[constants.BLEND_MODES.COLOR_BURN]="color-burn",t[constants.BLEND_MODES.HARD_LIGHT]="hard-light",t[constants.BLEND_MODES.SOFT_LIGHT]="soft-light",t[constants.BLEND_MODES.DIFFERENCE]="difference",t[constants.BLEND_MODES.EXCLUSION]="exclusion",t[constants.BLEND_MODES.HUE]="hue",t[constants.BLEND_MODES.SATURATION]="saturate",t[constants.BLEND_MODES.COLOR]="color",t[constants.BLEND_MODES.LUMINOSITY]="luminosity"):(t[constants.BLEND_MODES.NORMAL]="source-over",t[constants.BLEND_MODES.ADD]="lighter",t[constants.BLEND_MODES.MULTIPLY]="source-over",t[constants.BLEND_MODES.SCREEN]="source-over",t[constants.BLEND_MODES.OVERLAY]="source-over",t[constants.BLEND_MODES.DARKEN]="source-over",t[constants.BLEND_MODES.LIGHTEN]="source-over",t[constants.BLEND_MODES.COLOR_DODGE]="source-over",t[constants.BLEND_MODES.COLOR_BURN]="source-over",t[constants.BLEND_MODES.HARD_LIGHT]="source-over",t[constants.BLEND_MODES.SOFT_LIGHT]="source-over",t[constants.BLEND_MODES.DIFFERENCE]="source-over",t[constants.BLEND_MODES.EXCLUSION]="source-over",t[constants.BLEND_MODES.HUE]="source-over",t[constants.BLEND_MODES.SATURATION]="source-over",t[constants.BLEND_MODES.COLOR]="source-over",t[constants.BLEND_MODES.LUMINOSITY]="source-over"),t[constants.BLEND_MODES.NORMAL_NPM]=t[constants.BLEND_MODES.NORMAL],t[constants.BLEND_MODES.ADD_NPM]=t[constants.BLEND_MODES.ADD],t[constants.BLEND_MODES.SCREEN_NPM]=t[constants.BLEND_MODES.SCREEN],t[constants.BLEND_MODES.SRC_IN]="source-in",t[constants.BLEND_MODES.SRC_OUT]="source-out",t[constants.BLEND_MODES.SRC_ATOP]="source-atop",t[constants.BLEND_MODES.DST_OVER]="destination-over",t[constants.BLEND_MODES.DST_IN]="destination-in",t[constants.BLEND_MODES.DST_OUT]="destination-out",t[constants.BLEND_MODES.DST_ATOP]="destination-atop",t[constants.BLEND_MODES.XOR]="xor",t[constants.BLEND_MODES.SUBTRACT]="source-over",t}var tempMatrix=new math.Matrix,CanvasRenderer=function(t){function e(n){var o=t.call(this,constants.RENDERER_TYPE.CANVAS,n)||this;if(o.refresh=!0,o.maskManager=new CanvasMaskManager(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=mapCanvasBlendModesToPixi(),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var a=o.rootContext;a.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":a.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":a.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":a.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(e.__plugins),utils.sayHello("Canvas"),o.resize(o.options.width,o.options.height),o}return __extends(e,t),e.prototype.render=function(t,e){if(this.view){var n,o,a,r;e&&(e instanceof core.RenderTexture||e instanceof core.BaseRenderTexture?(n=e,o=arguments[2],a=arguments[3],r=arguments[4]):(n=e.renderTexture,o=e.clear,a=e.transform,r=e.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var s=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new utils.CanvasRenderTarget(n.width,n.height,n.resolution),n.resource=new core.CanvasResource(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var i=this.context;if(this._projTransform=a||null,n||(this._lastObjectRendered=t),!r){var c=t.enableTempParent();t.updateTransform(),t.disableTempParent(c)}if(i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=1,this._activeBlendMode=constants.BLEND_MODES.NORMAL,this._outerBlend=!1,i.globalCompositeOperation=this.blendModes[constants.BLEND_MODES.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)i.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(i.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,i.fillStyle=this._backgroundColorString,i.fillRect(0,0,this.width,this.height),i.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var h=n.clearColor;h[3]>0&&(i.globalAlpha=this.useContextAlpha?h[3]:1,i.fillStyle=utils.hex2string(utils.rgb2hex(h)),i.fillRect(0,0,n.realWidth,n.realHeight),i.globalAlpha=1)}var l=this.context;this.context=i,t.renderCanvas(this),this.context=l,i.restore(),this.resolution=s,this._projTransform=null,this.emit("postrender")}},e.prototype.setContextTransform=function(t,e,n){var o=t,a=this._projTransform,r=this.resolution;n=n||r,a&&((o=tempMatrix).copyFrom(t),o.prepend(a)),e?this.context.setTransform(o.a*n,o.b*n,o.c*n,o.d*n,o.tx*r|0,o.ty*r|0):this.context.setTransform(o.a*n,o.b*n,o.c*n,o.d*n,o.tx*r,o.ty*r)},e.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var n=this.context;n.clearRect(0,0,this.width,this.height),t&&(n.globalAlpha=this.useContextAlpha?e:1,n.fillStyle=t,n.fillRect(0,0,this.width,this.height),n.globalAlpha=1)},e.prototype.setBlendMode=function(t,e){var n=t===constants.BLEND_MODES.SRC_IN||t===constants.BLEND_MODES.SRC_OUT||t===constants.BLEND_MODES.DST_IN||t===constants.BLEND_MODES.DST_ATOP;!e&&n&&(t=constants.BLEND_MODES.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=n,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,n){t.prototype.resize.call(this,e,n),this.smoothProperty&&(this.rootContext[this.smoothProperty]=settings.settings.SCALE_MODE===constants.SCALE_MODES.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,n){e.__plugins=e.__plugins||{},e.__plugins[t]=n},e}(core.AbstractRenderer),canvasUtils={canvas:null,getTintedCanvas:function(t,e){var n=t.texture,o="#"+("00000"+(0|(e=canvasUtils.roundColor(e))).toString(16)).substr(-6);n.tintCache=n.tintCache||{};var a,r=n.tintCache[o];if(r){if(r.tintId===n._updateID)return n.tintCache[o];a=n.tintCache[o]}else a=document.createElement("canvas");if(canvasUtils.tintMethod(n,e,a),a.tintId=n._updateID,canvasUtils.convertTintToImage){var s=new Image;s.src=a.toDataURL(),n.tintCache[o]=s}else n.tintCache[o]=a;return a},getTintedPattern:function(t,e){var n="#"+("00000"+(0|(e=canvasUtils.roundColor(e))).toString(16)).substr(-6);t.patternCache=t.patternCache||{};var o=t.patternCache[n];return o&&o.tintId===t._updateID?o:(canvasUtils.canvas||(canvasUtils.canvas=document.createElement("canvas")),canvasUtils.tintMethod(t,e,canvasUtils.canvas),(o=canvasUtils.canvas.getContext("2d").createPattern(canvasUtils.canvas,"repeat")).tintId=t._updateID,t.patternCache[n]=o,o)},tintWithMultiply:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),o.fillRect(0,0,a.width,a.height),o.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();o.drawImage(s,a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.globalCompositeOperation="destination-atop",o.drawImage(s,a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore()},tintWithOverlay:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.globalCompositeOperation="copy",o.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),o.fillRect(0,0,a.width,a.height),o.globalCompositeOperation="destination-atop",o.drawImage(t.baseTexture.getDrawableSource(),a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore()},tintWithPerPixel:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.globalCompositeOperation="copy",o.drawImage(t.baseTexture.getDrawableSource(),a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore();for(var s=utils.hex2rgb(e),i=s[0],c=s[1],h=s[2],l=o.getImageData(0,0,a.width,a.height),d=l.data,u=0;u<d.length;u+=4)d[u+0]*=i,d[u+1]*=c,d[u+2]*=h;o.putImageData(l,0,0)},roundColor:function(t){var e=canvasUtils.cacheStepsPerColorChannel,n=utils.hex2rgb(t);return n[0]=Math.min(255,n[0]/e*e),n[1]=Math.min(255,n[1]/e*e),n[2]=Math.min(255,n[2]/e*e),utils.rgb2hex(n)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:canUseNewCanvasBlendModes(),tintMethod:null};canvasUtils.tintMethod=canvasUtils.canUseMultiply?canvasUtils.tintWithMultiply:canvasUtils.tintWithPerPixel;var parentCreate=core.Renderer.create;core.Renderer.create=function(t){if(!(t&&t.forceCanvas))try{return parentCreate(t)}catch(t){}return new CanvasRenderer(t)},core.BaseTexture.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:null},core.BaseRenderTexture.prototype._canvasRenderTarget=null,core.Texture.prototype.patternCache=null,core.Texture.prototype.tintCache=null,exports.CanvasRenderer=CanvasRenderer,exports.canUseNewCanvasBlendModes=canUseNewCanvasBlendModes,exports.canvasUtils=canvasUtils;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@pixi/core"),utils=require("@pixi/utils"),math=require("@pixi/math"),constants=require("@pixi/constants"),settings=require("@pixi/settings"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function __extends(t,e){function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var CanvasMaskManager=function(){function t(t){this._foundShapes=[],this.renderer=t}return t.prototype.pushMask=function(t){var e=this.renderer,n=t.maskObject||t;e.context.save();var o=this._foundShapes;if(this.recursiveFindShapes(n,o),o.length>0){var a=e.context;a.beginPath();for(var r=0;r<o.length;r++){var s=o[r],i=s.transform.worldTransform;this.renderer.setContextTransform(i),this.renderGraphicsShape(s)}o.length=0,a.clip()}},t.prototype.recursiveFindShapes=function(t,e){t.geometry&&t.geometry.graphicsData&&e.push(t);var n=t.children;if(n)for(var o=0;o<n.length;o++)this.recursiveFindShapes(n[o],e)},t.prototype.renderGraphicsShape=function(t){t.finishPoly();var e=this.renderer.context,n=t.geometry.graphicsData,o=n.length;if(0!==o)for(var a=0;a<o;a++){var r=n[a],s=r.shape;if(s.type===math.SHAPES.POLY){var i=s.points,c=r.holes,l=void 0,h=void 0,d=void 0,u=void 0;e.moveTo(i[0],i[1]);for(var p=1;p<i.length/2;p++)e.lineTo(i[2*p],i[2*p+1]);if(c.length>0){l=0,d=i[0],u=i[1];for(p=2;p+2<i.length;p+=2)l+=(i[p]-d)*(i[p+3]-u)-(i[p+2]-d)*(i[p+1]-u);for(var v=0;v<c.length;v++)if(i=c[v].shape.points){h=0,d=i[0],u=i[1];for(p=2;p+2<i.length;p+=2)h+=(i[p]-d)*(i[p+3]-u)-(i[p+2]-d)*(i[p+1]-u);if(h*l<0){e.moveTo(i[0],i[1]);for(p=2;p<i.length;p+=2)e.lineTo(i[p],i[p+1])}else{e.moveTo(i[i.length-2],i[i.length-1]);for(p=i.length-4;p>=0;p-=2)e.lineTo(i[p],i[p+1])}c[v].shape.closeStroke&&e.closePath()}}i[0]===i[i.length-2]&&i[1]===i[i.length-1]&&e.closePath()}else if(s.type===math.SHAPES.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(s.type===math.SHAPES.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(s.type===math.SHAPES.ELIP){var E=2*s.width,g=2*s.height,D=s.x-E/2,S=s.y-g/2,_=E/2*.5522848,M=g/2*.5522848,f=D+E,m=S+g,O=D+E/2,C=S+g/2;e.moveTo(D,C),e.bezierCurveTo(D,C-M,O-_,S,O,S),e.bezierCurveTo(O+_,S,f,C-M,f,C),e.bezierCurveTo(f,C+M,O+_,m,O,m),e.bezierCurveTo(O-_,m,D,C+M,D,C),e.closePath()}else if(s.type===math.SHAPES.RREC){var T=s.x,N=s.y,x=s.width,L=s.height,y=s.radius,B=Math.min(x,L)/2;y=y>B?B:y,e.moveTo(T,N+y),e.lineTo(T,N+L-y),e.quadraticCurveTo(T,N+L,T+y,N+L),e.lineTo(T+x-y,N+L),e.quadraticCurveTo(T+x,N+L,T+x,N+L-y),e.lineTo(T+x,N+y),e.quadraticCurveTo(T+x,N,T+x-y,N),e.lineTo(T+y,N),e.quadraticCurveTo(T,N,T,N+y),e.closePath()}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();function createColoredCanvas(t){var e=document.createElement("canvas");e.width=6,e.height=1;var n=e.getContext("2d");return n.fillStyle=t,n.fillRect(0,0,6,1),e}function canUseNewCanvasBlendModes(){if("undefined"==typeof document)return!1;var t=createColoredCanvas("#ff00ff"),e=createColoredCanvas("#ffff00"),n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(t,0,0),o.drawImage(e,2,0);var a=o.getImageData(2,0,1,1);if(!a)return!1;var r=a.data;return 255===r[0]&&0===r[1]&&0===r[2]}function mapCanvasBlendModesToPixi(t){return void 0===t&&(t=[]),canUseNewCanvasBlendModes()?(t[constants.BLEND_MODES.NORMAL]="source-over",t[constants.BLEND_MODES.ADD]="lighter",t[constants.BLEND_MODES.MULTIPLY]="multiply",t[constants.BLEND_MODES.SCREEN]="screen",t[constants.BLEND_MODES.OVERLAY]="overlay",t[constants.BLEND_MODES.DARKEN]="darken",t[constants.BLEND_MODES.LIGHTEN]="lighten",t[constants.BLEND_MODES.COLOR_DODGE]="color-dodge",t[constants.BLEND_MODES.COLOR_BURN]="color-burn",t[constants.BLEND_MODES.HARD_LIGHT]="hard-light",t[constants.BLEND_MODES.SOFT_LIGHT]="soft-light",t[constants.BLEND_MODES.DIFFERENCE]="difference",t[constants.BLEND_MODES.EXCLUSION]="exclusion",t[constants.BLEND_MODES.HUE]="hue",t[constants.BLEND_MODES.SATURATION]="saturate",t[constants.BLEND_MODES.COLOR]="color",t[constants.BLEND_MODES.LUMINOSITY]="luminosity"):(t[constants.BLEND_MODES.NORMAL]="source-over",t[constants.BLEND_MODES.ADD]="lighter",t[constants.BLEND_MODES.MULTIPLY]="source-over",t[constants.BLEND_MODES.SCREEN]="source-over",t[constants.BLEND_MODES.OVERLAY]="source-over",t[constants.BLEND_MODES.DARKEN]="source-over",t[constants.BLEND_MODES.LIGHTEN]="source-over",t[constants.BLEND_MODES.COLOR_DODGE]="source-over",t[constants.BLEND_MODES.COLOR_BURN]="source-over",t[constants.BLEND_MODES.HARD_LIGHT]="source-over",t[constants.BLEND_MODES.SOFT_LIGHT]="source-over",t[constants.BLEND_MODES.DIFFERENCE]="source-over",t[constants.BLEND_MODES.EXCLUSION]="source-over",t[constants.BLEND_MODES.HUE]="source-over",t[constants.BLEND_MODES.SATURATION]="source-over",t[constants.BLEND_MODES.COLOR]="source-over",t[constants.BLEND_MODES.LUMINOSITY]="source-over"),t[constants.BLEND_MODES.NORMAL_NPM]=t[constants.BLEND_MODES.NORMAL],t[constants.BLEND_MODES.ADD_NPM]=t[constants.BLEND_MODES.ADD],t[constants.BLEND_MODES.SCREEN_NPM]=t[constants.BLEND_MODES.SCREEN],t[constants.BLEND_MODES.SRC_IN]="source-in",t[constants.BLEND_MODES.SRC_OUT]="source-out",t[constants.BLEND_MODES.SRC_ATOP]="source-atop",t[constants.BLEND_MODES.DST_OVER]="destination-over",t[constants.BLEND_MODES.DST_IN]="destination-in",t[constants.BLEND_MODES.DST_OUT]="destination-out",t[constants.BLEND_MODES.DST_ATOP]="destination-atop",t[constants.BLEND_MODES.XOR]="xor",t[constants.BLEND_MODES.SUBTRACT]="source-over",t}var tempMatrix=new math.Matrix,CanvasRenderer=function(t){function e(n){var o=t.call(this,constants.RENDERER_TYPE.CANVAS,n)||this;if(o.refresh=!0,o.maskManager=new CanvasMaskManager(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=mapCanvasBlendModesToPixi(),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var a=o.rootContext;a.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":a.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":a.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":a.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(e.__plugins),utils.sayHello("Canvas"),o.resize(o.options.width,o.options.height),o}return __extends(e,t),e.prototype.addSystem=function(){return this},e.prototype.render=function(t,e){if(this.view){var n,o,a,r;e&&(e instanceof core.RenderTexture||e instanceof core.BaseRenderTexture?(n=e,o=arguments[2],a=arguments[3],r=arguments[4]):(n=e.renderTexture,o=e.clear,a=e.transform,r=e.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var s=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new utils.CanvasRenderTarget(n.width,n.height,n.resolution),n.resource=new core.CanvasResource(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var i=this.context;if(this._projTransform=a||null,n||(this._lastObjectRendered=t),!r){var c=t.enableTempParent();t.updateTransform(),t.disableTempParent(c)}if(i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=1,this._activeBlendMode=constants.BLEND_MODES.NORMAL,this._outerBlend=!1,i.globalCompositeOperation=this.blendModes[constants.BLEND_MODES.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)i.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(i.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,i.fillStyle=this._backgroundColorString,i.fillRect(0,0,this.width,this.height),i.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var l=n.clearColor;l[3]>0&&(i.globalAlpha=this.useContextAlpha?l[3]:1,i.fillStyle=utils.hex2string(utils.rgb2hex(l)),i.fillRect(0,0,n.realWidth,n.realHeight),i.globalAlpha=1)}var h=this.context;this.context=i,t.renderCanvas(this),this.context=h,i.restore(),this.resolution=s,this._projTransform=null,this.emit("postrender")}},e.prototype.setContextTransform=function(t,e,n){var o=t,a=this._projTransform,r=this.resolution;n=n||r,a&&((o=tempMatrix).copyFrom(t),o.prepend(a)),e?this.context.setTransform(o.a*n,o.b*n,o.c*n,o.d*n,o.tx*r|0,o.ty*r|0):this.context.setTransform(o.a*n,o.b*n,o.c*n,o.d*n,o.tx*r,o.ty*r)},e.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var n=this.context;n.clearRect(0,0,this.width,this.height),t&&(n.globalAlpha=this.useContextAlpha?e:1,n.fillStyle=t,n.fillRect(0,0,this.width,this.height),n.globalAlpha=1)},e.prototype.setBlendMode=function(t,e){var n=t===constants.BLEND_MODES.SRC_IN||t===constants.BLEND_MODES.SRC_OUT||t===constants.BLEND_MODES.DST_IN||t===constants.BLEND_MODES.DST_ATOP;!e&&n&&(t=constants.BLEND_MODES.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=n,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,n){t.prototype.resize.call(this,e,n),this.smoothProperty&&(this.rootContext[this.smoothProperty]=settings.settings.SCALE_MODE===constants.SCALE_MODES.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,n){e.__plugins=e.__plugins||{},e.__plugins[t]=n},e}(core.AbstractRenderer),canvasUtils={canvas:null,getTintedCanvas:function(t,e){var n=t.texture,o="#"+("00000"+(0|(e=canvasUtils.roundColor(e))).toString(16)).slice(-6);n.tintCache=n.tintCache||{};var a,r=n.tintCache[o];if(r){if(r.tintId===n._updateID)return n.tintCache[o];a=n.tintCache[o]}else a=document.createElement("canvas");if(canvasUtils.tintMethod(n,e,a),a.tintId=n._updateID,canvasUtils.convertTintToImage){var s=new Image;s.src=a.toDataURL(),n.tintCache[o]=s}else n.tintCache[o]=a;return a},getTintedPattern:function(t,e){var n="#"+("00000"+(0|(e=canvasUtils.roundColor(e))).toString(16)).slice(-6);t.patternCache=t.patternCache||{};var o=t.patternCache[n];return o&&o.tintId===t._updateID?o:(canvasUtils.canvas||(canvasUtils.canvas=document.createElement("canvas")),canvasUtils.tintMethod(t,e,canvasUtils.canvas),(o=canvasUtils.canvas.getContext("2d").createPattern(canvasUtils.canvas,"repeat")).tintId=t._updateID,t.patternCache[n]=o,o)},tintWithMultiply:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),o.fillRect(0,0,a.width,a.height),o.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();o.drawImage(s,a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.globalCompositeOperation="destination-atop",o.drawImage(s,a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore()},tintWithOverlay:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.globalCompositeOperation="copy",o.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),o.fillRect(0,0,a.width,a.height),o.globalCompositeOperation="destination-atop",o.drawImage(t.baseTexture.getDrawableSource(),a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore()},tintWithPerPixel:function(t,e,n){var o=n.getContext("2d"),a=t._frame.clone(),r=t.baseTexture.resolution;a.x*=r,a.y*=r,a.width*=r,a.height*=r,n.width=Math.ceil(a.width),n.height=Math.ceil(a.height),o.save(),o.globalCompositeOperation="copy",o.drawImage(t.baseTexture.getDrawableSource(),a.x,a.y,a.width,a.height,0,0,a.width,a.height),o.restore();for(var s=utils.hex2rgb(e),i=s[0],c=s[1],l=s[2],h=o.getImageData(0,0,a.width,a.height),d=h.data,u=0;u<d.length;u+=4)d[u+0]*=i,d[u+1]*=c,d[u+2]*=l;o.putImageData(h,0,0)},roundColor:function(t){var e=canvasUtils.cacheStepsPerColorChannel,n=utils.hex2rgb(t);return n[0]=Math.min(255,n[0]/e*e),n[1]=Math.min(255,n[1]/e*e),n[2]=Math.min(255,n[2]/e*e),utils.rgb2hex(n)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:canUseNewCanvasBlendModes(),tintMethod:null};canvasUtils.tintMethod=canvasUtils.canUseMultiply?canvasUtils.tintWithMultiply:canvasUtils.tintWithPerPixel;var parentCreate=core.Renderer.create;core.Renderer.create=function(t){if(!(t&&t.forceCanvas))try{return parentCreate(t)}catch(t){}return new CanvasRenderer(t)},core.BaseTexture.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:null},core.BaseRenderTexture.prototype._canvasRenderTarget=null,core.Texture.prototype.patternCache=null,core.Texture.prototype.tintCache=null,exports.CanvasRenderer=CanvasRenderer,exports.canUseNewCanvasBlendModes=canUseNewCanvasBlendModes,exports.canvasUtils=canvasUtils;
//# sourceMappingURL=canvas-renderer.min.js.map
/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -420,2 +420,8 @@ * @pixi/canvas-renderer is licensed under the MIT License.

}
/**
* Adds a new system to the renderer. It does nothing in the CanvasRenderer.
*/
CanvasRenderer.prototype.addSystem = function () {
return this;
};
/** @ignore */

@@ -658,3 +664,3 @@ CanvasRenderer.prototype.render = function (displayObject, options) {

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.tintCache = texture.tintCache || {};

@@ -695,3 +701,3 @@ var cachedCanvas = texture.tintCache[stringColor];

color = canvasUtils.roundColor(color);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
var stringColor = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
texture.patternCache = texture.patternCache || {};

@@ -730,3 +736,3 @@ var pattern = texture.patternCache[stringColor];

context.save();
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -760,3 +766,3 @@ context.globalCompositeOperation = 'multiply';

context.globalCompositeOperation = 'copy';
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).substr(-6);
context.fillStyle = "#" + ("00000" + (color | 0).toString(16)).slice(-6);
context.fillRect(0, 0, crop.width, crop.height);

@@ -763,0 +769,0 @@ context.globalCompositeOperation = 'destination-atop';

/*!
* @pixi/canvas-renderer - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/canvas-renderer - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/canvas-renderer is licensed under the MIT License.

*/
import{RenderTexture as e,BaseRenderTexture as t,CanvasResource as o,AbstractRenderer as r,Renderer as i,BaseTexture as n,Texture as a}from"@pixi/core";import{CanvasRenderTarget as h,hex2string as s,rgb2hex as l,sayHello as c,hex2rgb as d}from"@pixi/utils";import{SHAPES as u,Matrix as p}from"@pixi/math";import{BLEND_MODES as g,SCALE_MODES as v,RENDERER_TYPE as f}from"@pixi/constants";import{settings as m}from"@pixi/settings";var T=function(e,t){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};var C=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,o=e.maskObject||e;t.context.save();var r=this._foundShapes;if(this.recursiveFindShapes(o,r),r.length>0){var i=t.context;i.beginPath();for(var n=0;n<r.length;n++){var a=r[n],h=a.transform.worldTransform;this.renderer.setContextTransform(h),this.renderGraphicsShape(a)}r.length=0,i.clip()}},e.prototype.recursiveFindShapes=function(e,t){e.geometry&&e.geometry.graphicsData&&t.push(e);var o=e.children;if(o)for(var r=0;r<o.length;r++)this.recursiveFindShapes(o[r],t)},e.prototype.renderGraphicsShape=function(e){e.finishPoly();var t=this.renderer.context,o=e.geometry.graphicsData,r=o.length;if(0!==r)for(var i=0;i<r;i++){var n=o[i],a=n.shape;if(a.type===u.POLY){var h=a.points,s=n.holes,l=void 0,c=void 0,d=void 0,p=void 0;t.moveTo(h[0],h[1]);for(var g=1;g<h.length/2;g++)t.lineTo(h[2*g],h[2*g+1]);if(s.length>0){l=0,d=h[0],p=h[1];for(g=2;g+2<h.length;g+=2)l+=(h[g]-d)*(h[g+3]-p)-(h[g+2]-d)*(h[g+1]-p);for(var v=0;v<s.length;v++)if(h=s[v].shape.points){c=0,d=h[0],p=h[1];for(g=2;g+2<h.length;g+=2)c+=(h[g]-d)*(h[g+3]-p)-(h[g+2]-d)*(h[g+1]-p);if(c*l<0){t.moveTo(h[0],h[1]);for(g=2;g<h.length;g+=2)t.lineTo(h[g],h[g+1])}else{t.moveTo(h[h.length-2],h[h.length-1]);for(g=h.length-4;g>=0;g-=2)t.lineTo(h[g],h[g+1])}s[v].shape.closeStroke&&t.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&t.closePath()}else if(a.type===u.RECT)t.rect(a.x,a.y,a.width,a.height),t.closePath();else if(a.type===u.CIRC)t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.closePath();else if(a.type===u.ELIP){var f=2*a.width,m=2*a.height,T=a.x-f/2,C=a.y-m/2,y=f/2*.5522848,x=m/2*.5522848,_=T+f,b=C+m,S=T+f/2,R=C+m/2;t.moveTo(T,R),t.bezierCurveTo(T,R-x,S-y,C,S,C),t.bezierCurveTo(S+y,C,_,R-x,_,R),t.bezierCurveTo(_,R+x,S+y,b,S,b),t.bezierCurveTo(S-y,b,T,R+x,T,R),t.closePath()}else if(a.type===u.RREC){var O=a.x,w=a.y,I=a.width,M=a.height,E=a.radius,A=Math.min(I,M)/2;E=E>A?A:E,t.moveTo(O,w+E),t.lineTo(O,w+M-E),t.quadraticCurveTo(O,w+M,O+E,w+M),t.lineTo(O+I-E,w+M),t.quadraticCurveTo(O+I,w+M,O+I,w+M-E),t.lineTo(O+I,w+E),t.quadraticCurveTo(O+I,w,O+I-E,w),t.lineTo(O+E,w),t.quadraticCurveTo(O,w,O,w+E),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function y(e){var t=document.createElement("canvas");t.width=6,t.height=1;var o=t.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,6,1),t}function x(){if("undefined"==typeof document)return!1;var e=y("#ff00ff"),t=y("#ffff00"),o=document.createElement("canvas");o.width=6,o.height=1;var r=o.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(e,0,0),r.drawImage(t,2,0);var i=r.getImageData(2,0,1,1);if(!i)return!1;var n=i.data;return 255===n[0]&&0===n[1]&&0===n[2]}var _=new p,b=function(r){function i(e){var t,o=r.call(this,f.CANVAS,e)||this;if(o.refresh=!0,o.maskManager=new C(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===t&&(t=[]),x()?(t[g.NORMAL]="source-over",t[g.ADD]="lighter",t[g.MULTIPLY]="multiply",t[g.SCREEN]="screen",t[g.OVERLAY]="overlay",t[g.DARKEN]="darken",t[g.LIGHTEN]="lighten",t[g.COLOR_DODGE]="color-dodge",t[g.COLOR_BURN]="color-burn",t[g.HARD_LIGHT]="hard-light",t[g.SOFT_LIGHT]="soft-light",t[g.DIFFERENCE]="difference",t[g.EXCLUSION]="exclusion",t[g.HUE]="hue",t[g.SATURATION]="saturate",t[g.COLOR]="color",t[g.LUMINOSITY]="luminosity"):(t[g.NORMAL]="source-over",t[g.ADD]="lighter",t[g.MULTIPLY]="source-over",t[g.SCREEN]="source-over",t[g.OVERLAY]="source-over",t[g.DARKEN]="source-over",t[g.LIGHTEN]="source-over",t[g.COLOR_DODGE]="source-over",t[g.COLOR_BURN]="source-over",t[g.HARD_LIGHT]="source-over",t[g.SOFT_LIGHT]="source-over",t[g.DIFFERENCE]="source-over",t[g.EXCLUSION]="source-over",t[g.HUE]="source-over",t[g.SATURATION]="source-over",t[g.COLOR]="source-over",t[g.LUMINOSITY]="source-over"),t[g.NORMAL_NPM]=t[g.NORMAL],t[g.ADD_NPM]=t[g.ADD],t[g.SCREEN_NPM]=t[g.SCREEN],t[g.SRC_IN]="source-in",t[g.SRC_OUT]="source-out",t[g.SRC_ATOP]="source-atop",t[g.DST_OVER]="destination-over",t[g.DST_IN]="destination-in",t[g.DST_OUT]="destination-out",t[g.DST_ATOP]="destination-atop",t[g.XOR]="xor",t[g.SUBTRACT]="source-over",t),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var n=o.rootContext;n.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":n.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":n.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":n.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(i.__plugins),c("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function o(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}(i,r),i.prototype.render=function(r,i){if(this.view){var n,a,c,d;i&&(i instanceof e||i instanceof t?(n=i,a=arguments[2],c=arguments[3],d=arguments[4]):(n=i.renderTexture,a=i.clear,c=i.transform,d=i.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var u=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new h(n.width,n.height,n.resolution),n.resource=new o(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var p=this.context;if(this._projTransform=c||null,n||(this._lastObjectRendered=r),!d){var v=r.enableTempParent();r.updateTransform(),r.disableTempParent(v)}if(p.save(),p.setTransform(1,0,0,1,0,0),p.globalAlpha=1,this._activeBlendMode=g.NORMAL,this._outerBlend=!1,p.globalCompositeOperation=this.blendModes[g.NORMAL],void 0!==a?a:this.clearBeforeRender)if(this.renderingToScreen)p.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(p.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,p.fillStyle=this._backgroundColorString,p.fillRect(0,0,this.width,this.height),p.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var f=n.clearColor;f[3]>0&&(p.globalAlpha=this.useContextAlpha?f[3]:1,p.fillStyle=s(l(f)),p.fillRect(0,0,n.realWidth,n.realHeight),p.globalAlpha=1)}var m=this.context;this.context=p,r.renderCanvas(this),this.context=m,p.restore(),this.resolution=u,this._projTransform=null,this.emit("postrender")}},i.prototype.setContextTransform=function(e,t,o){var r=e,i=this._projTransform,n=this.resolution;o=o||n,i&&((r=_).copyFrom(e),r.prepend(i)),t?this.context.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*n|0,r.ty*n|0):this.context.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*n,r.ty*n)},i.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var o=this.context;o.clearRect(0,0,this.width,this.height),e&&(o.globalAlpha=this.useContextAlpha?t:1,o.fillStyle=e,o.fillRect(0,0,this.width,this.height),o.globalAlpha=1)},i.prototype.setBlendMode=function(e,t){var o=e===g.SRC_IN||e===g.SRC_OUT||e===g.DST_IN||e===g.DST_ATOP;!t&&o&&(e=g.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=o,this.context.globalCompositeOperation=this.blendModes[e])},i.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.resize=function(e,t){r.prototype.resize.call(this,e,t),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===v.LINEAR)},i.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},i.registerPlugin=function(e,t){i.__plugins=i.__plugins||{},i.__plugins[e]=t},i}(r),S={canvas:null,getTintedCanvas:function(e,t){var o=e.texture,r="#"+("00000"+(0|(t=S.roundColor(t))).toString(16)).substr(-6);o.tintCache=o.tintCache||{};var i,n=o.tintCache[r];if(n){if(n.tintId===o._updateID)return o.tintCache[r];i=o.tintCache[r]}else i=document.createElement("canvas");if(S.tintMethod(o,t,i),i.tintId=o._updateID,S.convertTintToImage){var a=new Image;a.src=i.toDataURL(),o.tintCache[r]=a}else o.tintCache[r]=i;return i},getTintedPattern:function(e,t){var o="#"+("00000"+(0|(t=S.roundColor(t))).toString(16)).substr(-6);e.patternCache=e.patternCache||{};var r=e.patternCache[o];return r&&r.tintId===e._updateID?r:(S.canvas||(S.canvas=document.createElement("canvas")),S.tintMethod(e,t,S.canvas),(r=S.canvas.getContext("2d").createPattern(S.canvas,"repeat")).tintId=e._updateID,e.patternCache[o]=r,r)},tintWithMultiply:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithOverlay:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithPerPixel:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore();for(var a=d(t),h=a[0],s=a[1],l=a[2],c=r.getImageData(0,0,i.width,i.height),u=c.data,p=0;p<u.length;p+=4)u[p+0]*=h,u[p+1]*=s,u[p+2]*=l;r.putImageData(c,0,0)},roundColor:function(e){var t=S.cacheStepsPerColorChannel,o=d(e);return o[0]=Math.min(255,o[0]/t*t),o[1]=Math.min(255,o[1]/t*t),o[2]=Math.min(255,o[2]/t*t),l(o)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:x(),tintMethod:null};S.tintMethod=S.canUseMultiply?S.tintWithMultiply:S.tintWithPerPixel;var R=i.create;i.create=function(e){if(!(e&&e.forceCanvas))try{return R(e)}catch(e){}return new b(e)},n.prototype.getDrawableSource=function(){var e=this.resource;return e?e.bitmap||e.source:null},t.prototype._canvasRenderTarget=null,a.prototype.patternCache=null,a.prototype.tintCache=null;export{b as CanvasRenderer,x as canUseNewCanvasBlendModes,S as canvasUtils};
import{RenderTexture as e,BaseRenderTexture as t,CanvasResource as o,AbstractRenderer as r,Renderer as i,BaseTexture as n,Texture as a}from"@pixi/core";import{CanvasRenderTarget as h,hex2string as s,rgb2hex as l,sayHello as c,hex2rgb as d}from"@pixi/utils";import{SHAPES as u,Matrix as p}from"@pixi/math";import{BLEND_MODES as g,SCALE_MODES as v,RENDERER_TYPE as f}from"@pixi/constants";import{settings as m}from"@pixi/settings";var T=function(e,t){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};var C=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,o=e.maskObject||e;t.context.save();var r=this._foundShapes;if(this.recursiveFindShapes(o,r),r.length>0){var i=t.context;i.beginPath();for(var n=0;n<r.length;n++){var a=r[n],h=a.transform.worldTransform;this.renderer.setContextTransform(h),this.renderGraphicsShape(a)}r.length=0,i.clip()}},e.prototype.recursiveFindShapes=function(e,t){e.geometry&&e.geometry.graphicsData&&t.push(e);var o=e.children;if(o)for(var r=0;r<o.length;r++)this.recursiveFindShapes(o[r],t)},e.prototype.renderGraphicsShape=function(e){e.finishPoly();var t=this.renderer.context,o=e.geometry.graphicsData,r=o.length;if(0!==r)for(var i=0;i<r;i++){var n=o[i],a=n.shape;if(a.type===u.POLY){var h=a.points,s=n.holes,l=void 0,c=void 0,d=void 0,p=void 0;t.moveTo(h[0],h[1]);for(var g=1;g<h.length/2;g++)t.lineTo(h[2*g],h[2*g+1]);if(s.length>0){l=0,d=h[0],p=h[1];for(g=2;g+2<h.length;g+=2)l+=(h[g]-d)*(h[g+3]-p)-(h[g+2]-d)*(h[g+1]-p);for(var v=0;v<s.length;v++)if(h=s[v].shape.points){c=0,d=h[0],p=h[1];for(g=2;g+2<h.length;g+=2)c+=(h[g]-d)*(h[g+3]-p)-(h[g+2]-d)*(h[g+1]-p);if(c*l<0){t.moveTo(h[0],h[1]);for(g=2;g<h.length;g+=2)t.lineTo(h[g],h[g+1])}else{t.moveTo(h[h.length-2],h[h.length-1]);for(g=h.length-4;g>=0;g-=2)t.lineTo(h[g],h[g+1])}s[v].shape.closeStroke&&t.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&t.closePath()}else if(a.type===u.RECT)t.rect(a.x,a.y,a.width,a.height),t.closePath();else if(a.type===u.CIRC)t.arc(a.x,a.y,a.radius,0,2*Math.PI),t.closePath();else if(a.type===u.ELIP){var f=2*a.width,m=2*a.height,T=a.x-f/2,C=a.y-m/2,y=f/2*.5522848,x=m/2*.5522848,_=T+f,S=C+m,b=T+f/2,R=C+m/2;t.moveTo(T,R),t.bezierCurveTo(T,R-x,b-y,C,b,C),t.bezierCurveTo(b+y,C,_,R-x,_,R),t.bezierCurveTo(_,R+x,b+y,S,b,S),t.bezierCurveTo(b-y,S,T,R+x,T,R),t.closePath()}else if(a.type===u.RREC){var O=a.x,w=a.y,I=a.width,M=a.height,E=a.radius,A=Math.min(I,M)/2;E=E>A?A:E,t.moveTo(O,w+E),t.lineTo(O,w+M-E),t.quadraticCurveTo(O,w+M,O+E,w+M),t.lineTo(O+I-E,w+M),t.quadraticCurveTo(O+I,w+M,O+I,w+M-E),t.lineTo(O+I,w+E),t.quadraticCurveTo(O+I,w,O+I-E,w),t.lineTo(O+E,w),t.quadraticCurveTo(O,w,O,w+E),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function y(e){var t=document.createElement("canvas");t.width=6,t.height=1;var o=t.getContext("2d");return o.fillStyle=e,o.fillRect(0,0,6,1),t}function x(){if("undefined"==typeof document)return!1;var e=y("#ff00ff"),t=y("#ffff00"),o=document.createElement("canvas");o.width=6,o.height=1;var r=o.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(e,0,0),r.drawImage(t,2,0);var i=r.getImageData(2,0,1,1);if(!i)return!1;var n=i.data;return 255===n[0]&&0===n[1]&&0===n[2]}var _=new p,S=function(r){function i(e){var t,o=r.call(this,f.CANVAS,e)||this;if(o.refresh=!0,o.maskManager=new C(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===t&&(t=[]),x()?(t[g.NORMAL]="source-over",t[g.ADD]="lighter",t[g.MULTIPLY]="multiply",t[g.SCREEN]="screen",t[g.OVERLAY]="overlay",t[g.DARKEN]="darken",t[g.LIGHTEN]="lighten",t[g.COLOR_DODGE]="color-dodge",t[g.COLOR_BURN]="color-burn",t[g.HARD_LIGHT]="hard-light",t[g.SOFT_LIGHT]="soft-light",t[g.DIFFERENCE]="difference",t[g.EXCLUSION]="exclusion",t[g.HUE]="hue",t[g.SATURATION]="saturate",t[g.COLOR]="color",t[g.LUMINOSITY]="luminosity"):(t[g.NORMAL]="source-over",t[g.ADD]="lighter",t[g.MULTIPLY]="source-over",t[g.SCREEN]="source-over",t[g.OVERLAY]="source-over",t[g.DARKEN]="source-over",t[g.LIGHTEN]="source-over",t[g.COLOR_DODGE]="source-over",t[g.COLOR_BURN]="source-over",t[g.HARD_LIGHT]="source-over",t[g.SOFT_LIGHT]="source-over",t[g.DIFFERENCE]="source-over",t[g.EXCLUSION]="source-over",t[g.HUE]="source-over",t[g.SATURATION]="source-over",t[g.COLOR]="source-over",t[g.LUMINOSITY]="source-over"),t[g.NORMAL_NPM]=t[g.NORMAL],t[g.ADD_NPM]=t[g.ADD],t[g.SCREEN_NPM]=t[g.SCREEN],t[g.SRC_IN]="source-in",t[g.SRC_OUT]="source-out",t[g.SRC_ATOP]="source-atop",t[g.DST_OVER]="destination-over",t[g.DST_IN]="destination-in",t[g.DST_OUT]="destination-out",t[g.DST_ATOP]="destination-atop",t[g.XOR]="xor",t[g.SUBTRACT]="source-over",t),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var n=o.rootContext;n.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":n.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":n.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":n.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(i.__plugins),c("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function o(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}(i,r),i.prototype.addSystem=function(){return this},i.prototype.render=function(r,i){if(this.view){var n,a,c,d;i&&(i instanceof e||i instanceof t?(n=i,a=arguments[2],c=arguments[3],d=arguments[4]):(n=i.renderTexture,a=i.clear,c=i.transform,d=i.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var u=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new h(n.width,n.height,n.resolution),n.resource=new o(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var p=this.context;if(this._projTransform=c||null,n||(this._lastObjectRendered=r),!d){var v=r.enableTempParent();r.updateTransform(),r.disableTempParent(v)}if(p.save(),p.setTransform(1,0,0,1,0,0),p.globalAlpha=1,this._activeBlendMode=g.NORMAL,this._outerBlend=!1,p.globalCompositeOperation=this.blendModes[g.NORMAL],void 0!==a?a:this.clearBeforeRender)if(this.renderingToScreen)p.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(p.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,p.fillStyle=this._backgroundColorString,p.fillRect(0,0,this.width,this.height),p.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var f=n.clearColor;f[3]>0&&(p.globalAlpha=this.useContextAlpha?f[3]:1,p.fillStyle=s(l(f)),p.fillRect(0,0,n.realWidth,n.realHeight),p.globalAlpha=1)}var m=this.context;this.context=p,r.renderCanvas(this),this.context=m,p.restore(),this.resolution=u,this._projTransform=null,this.emit("postrender")}},i.prototype.setContextTransform=function(e,t,o){var r=e,i=this._projTransform,n=this.resolution;o=o||n,i&&((r=_).copyFrom(e),r.prepend(i)),t?this.context.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*n|0,r.ty*n|0):this.context.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*n,r.ty*n)},i.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var o=this.context;o.clearRect(0,0,this.width,this.height),e&&(o.globalAlpha=this.useContextAlpha?t:1,o.fillStyle=e,o.fillRect(0,0,this.width,this.height),o.globalAlpha=1)},i.prototype.setBlendMode=function(e,t){var o=e===g.SRC_IN||e===g.SRC_OUT||e===g.DST_IN||e===g.DST_ATOP;!t&&o&&(e=g.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=o,this.context.globalCompositeOperation=this.blendModes[e])},i.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.resize=function(e,t){r.prototype.resize.call(this,e,t),this.smoothProperty&&(this.rootContext[this.smoothProperty]=m.SCALE_MODE===v.LINEAR)},i.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},i.registerPlugin=function(e,t){i.__plugins=i.__plugins||{},i.__plugins[e]=t},i}(r),b={canvas:null,getTintedCanvas:function(e,t){var o=e.texture,r="#"+("00000"+(0|(t=b.roundColor(t))).toString(16)).slice(-6);o.tintCache=o.tintCache||{};var i,n=o.tintCache[r];if(n){if(n.tintId===o._updateID)return o.tintCache[r];i=o.tintCache[r]}else i=document.createElement("canvas");if(b.tintMethod(o,t,i),i.tintId=o._updateID,b.convertTintToImage){var a=new Image;a.src=i.toDataURL(),o.tintCache[r]=a}else o.tintCache[r]=i;return i},getTintedPattern:function(e,t){var o="#"+("00000"+(0|(t=b.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var r=e.patternCache[o];return r&&r.tintId===e._updateID?r:(b.canvas||(b.canvas=document.createElement("canvas")),b.tintMethod(e,t,b.canvas),(r=b.canvas.getContext("2d").createPattern(b.canvas,"repeat")).tintId=e._updateID,e.patternCache[o]=r,r)},tintWithMultiply:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithOverlay:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithPerPixel:function(e,t,o){var r=o.getContext("2d"),i=e._frame.clone(),n=e.baseTexture.resolution;i.x*=n,i.y*=n,i.width*=n,i.height*=n,o.width=Math.ceil(i.width),o.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore();for(var a=d(t),h=a[0],s=a[1],l=a[2],c=r.getImageData(0,0,i.width,i.height),u=c.data,p=0;p<u.length;p+=4)u[p+0]*=h,u[p+1]*=s,u[p+2]*=l;r.putImageData(c,0,0)},roundColor:function(e){var t=b.cacheStepsPerColorChannel,o=d(e);return o[0]=Math.min(255,o[0]/t*t),o[1]=Math.min(255,o[1]/t*t),o[2]=Math.min(255,o[2]/t*t),l(o)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:x(),tintMethod:null};b.tintMethod=b.canUseMultiply?b.tintWithMultiply:b.tintWithPerPixel;var R=i.create;i.create=function(e){if(!(e&&e.forceCanvas))try{return R(e)}catch(e){}return new S(e)},n.prototype.getDrawableSource=function(){var e=this.resource;return e?e.bitmap||e.source:null},t.prototype._canvasRenderTarget=null,a.prototype.patternCache=null,a.prototype.tintCache=null;export{S as CanvasRenderer,x as canUseNewCanvasBlendModes,b as canvasUtils};
//# sourceMappingURL=canvas-renderer.min.js.map

@@ -131,2 +131,6 @@ /// <reference path="./global.d.ts" />

/**
* Adds a new system to the renderer. It does nothing in the CanvasRenderer.
*/
addSystem(): this;
/**
* Renders the object to its WebGL view.

@@ -133,0 +137,0 @@ *

{
"name": "@pixi/canvas-renderer",
"version": "6.2.2",
"version": "6.3.0",
"main": "dist/cjs/canvas-renderer.js",

@@ -28,9 +28,9 @@ "module": "dist/esm/canvas-renderer.js",

"peerDependencies": {
"@pixi/constants": "6.2.2",
"@pixi/core": "6.2.2",
"@pixi/math": "6.2.2",
"@pixi/settings": "6.2.2",
"@pixi/utils": "6.2.2"
"@pixi/constants": "6.3.0",
"@pixi/core": "6.3.0",
"@pixi/math": "6.3.0",
"@pixi/settings": "6.3.0",
"@pixi/utils": "6.3.0"
},
"gitHead": "23c4599ad83dbb128d71a1010aa6c4fb96779270"
"gitHead": "dc311cdd7a28e6817556cdc674fd15ef71069467"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc