Profectus-Demo/assets/@pixi.b4dff018.js

1569 lines
508 KiB
JavaScript

import{P as Sh}from"./promise-polyfill.7a7f9c83.js";import{o as Lh}from"./object-assign.9840bf7d.js";import{E as we}from"./eventemitter3.dc5195d7.js";import{e as Do}from"./earcut.89ec12e6.js";import{i as Fh}from"./ismobilejs.5c6954b9.js";import{p as Gh,f as Bh,r as Mh}from"./url.08d1c71e.js";/*!
* @pixi/settings - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/settings is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var It=Fh(globalThis.navigator);function Xh(t){var r=!0;if(It.tablet||It.phone){if(It.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(r=!1)}}if(It.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(r=!1)}}}return r?t:4}function kh(){return!It.apple.device}/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var $n;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})($n||($n={}));var qn;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(qn||(qn={}));var Kn;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(Kn||(Kn={}));var Zn;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(Zn||(Zn={}));var Jn;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Jn||(Jn={}));var Qn;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(Qn||(Qn={}));var ta;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(ta||(ta={}));var ea;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(ea||(ea={}));var ra;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(ra||(ra={}));var bi;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(bi||(bi={}));var Ii;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ii||(Ii={}));var Ei;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(Ei||(Ei={}));var ia;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(ia||(ia={}));var na;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(na||(na={}));var Ri;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(Ri||(Ri={}));var Me;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Me||(Me={}));var aa;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(aa||(aa={}));var Ci;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(Ci||(Ci={}));var sa;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(sa||(sa={}));var N={MIPMAP_TEXTURES:Ei.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Ci.NONE,SPRITE_MAX_TEXTURES:Xh(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:Ri.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Ii.CLAMP,SCALE_MODE:bi.LINEAR,PRECISION_VERTEX:Me.HIGH,PRECISION_FRAGMENT:It.apple.device?Me.HIGH:Me.MEDIUM,CAN_UPLOAD_SAME_BUFFER:kh(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Mt;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(Mt||(Mt={}));var ke;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(ke||(ke={}));var Pr;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(Pr||(Pr={}));var P;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(P||(P={}));var vt;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(vt||(vt={}));var R;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(R||(R={}));var ae;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(ae||(ae={}));var O;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(O||(O={}));var Nr;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(Nr||(Nr={}));var Lt;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(Lt||(Lt={}));var Ft;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ft||(Ft={}));var Xt;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(Xt||(Xt={}));var _t;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(_t||(_t={}));var Vt;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(Vt||(Vt={}));var wi;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(wi||(wi={}));var Et;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Et||(Et={}));var st;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(st||(st={}));var et;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(et||(et={}));var Ct;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Ct||(Ct={}));/*!
* @pixi/utils - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/utils is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Te={parse:Gh,format:Bh,resolve:Mh};N.RETINA_PREFIX=/@([0-9\.]+)x/;N.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var oa=!1,ha="6.4.2";function Hh(t){var r;if(!oa){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=[`
%c %c %c PixiJS `+ha+" - \u2730 "+t+` \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665
`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(r=globalThis.console).log.apply(r,e)}else globalThis.console&&globalThis.console.log("PixiJS "+ha+" - "+t+" - http://www.pixijs.com/");oa=!0}}var Hr;function Dh(){return typeof Hr=="undefined"&&(Hr=function(){var r={stencil:!0,failIfMajorPerformanceCaveat:N.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),n=!!(i&&i.getContextAttributes().stencil);if(i){var a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,n}catch{return!1}}()),Hr}var Vh="#f0f8ff",jh="#faebd7",zh="#00ffff",Wh="#7fffd4",Yh="#f0ffff",$h="#f5f5dc",qh="#ffe4c4",Kh="#000000",Zh="#ffebcd",Jh="#0000ff",Qh="#8a2be2",tu="#a52a2a",eu="#deb887",ru="#5f9ea0",iu="#7fff00",nu="#d2691e",au="#ff7f50",su="#6495ed",ou="#fff8dc",hu="#dc143c",uu="#00ffff",lu="#00008b",fu="#008b8b",cu="#b8860b",du="#a9a9a9",pu="#006400",vu="#a9a9a9",_u="#bdb76b",mu="#8b008b",yu="#556b2f",gu="#ff8c00",Tu="#9932cc",xu="#8b0000",bu="#e9967a",Iu="#8fbc8f",Eu="#483d8b",Ru="#2f4f4f",Cu="#2f4f4f",wu="#00ced1",Pu="#9400d3",Nu="#ff1493",Au="#00bfff",Uu="#696969",Ou="#696969",Su="#1e90ff",Lu="#b22222",Fu="#fffaf0",Gu="#228b22",Bu="#ff00ff",Mu="#dcdcdc",Xu="#f8f8ff",ku="#daa520",Hu="#ffd700",Du="#808080",Vu="#008000",ju="#adff2f",zu="#808080",Wu="#f0fff0",Yu="#ff69b4",$u="#cd5c5c",qu="#4b0082",Ku="#fffff0",Zu="#f0e68c",Ju="#fff0f5",Qu="#e6e6fa",tl="#7cfc00",el="#fffacd",rl="#add8e6",il="#f08080",nl="#e0ffff",al="#fafad2",sl="#d3d3d3",ol="#90ee90",hl="#d3d3d3",ul="#ffb6c1",ll="#ffa07a",fl="#20b2aa",cl="#87cefa",dl="#778899",pl="#778899",vl="#b0c4de",_l="#ffffe0",ml="#00ff00",yl="#32cd32",gl="#faf0e6",Tl="#ff00ff",xl="#800000",bl="#66cdaa",Il="#0000cd",El="#ba55d3",Rl="#9370db",Cl="#3cb371",wl="#7b68ee",Pl="#00fa9a",Nl="#48d1cc",Al="#c71585",Ul="#191970",Ol="#f5fffa",Sl="#ffe4e1",Ll="#ffe4b5",Fl="#ffdead",Gl="#000080",Bl="#fdf5e6",Ml="#808000",Xl="#6b8e23",kl="#ffa500",Hl="#ff4500",Dl="#da70d6",Vl="#eee8aa",jl="#98fb98",zl="#afeeee",Wl="#db7093",Yl="#ffefd5",$l="#ffdab9",ql="#cd853f",Kl="#ffc0cb",Zl="#dda0dd",Jl="#b0e0e6",Ql="#800080",tf="#663399",ef="#ff0000",rf="#bc8f8f",nf="#4169e1",af="#8b4513",sf="#fa8072",of="#f4a460",hf="#2e8b57",uf="#fff5ee",lf="#a0522d",ff="#c0c0c0",cf="#87ceeb",df="#6a5acd",pf="#708090",vf="#708090",_f="#fffafa",mf="#00ff7f",yf="#4682b4",gf="#d2b48c",Tf="#008080",xf="#d8bfd8",bf="#ff6347",If="#40e0d0",Ef="#ee82ee",Rf="#f5deb3",Cf="#ffffff",wf="#f5f5f5",Pf="#ffff00",Nf="#9acd32",Af={aliceblue:Vh,antiquewhite:jh,aqua:zh,aquamarine:Wh,azure:Yh,beige:$h,bisque:qh,black:Kh,blanchedalmond:Zh,blue:Jh,blueviolet:Qh,brown:tu,burlywood:eu,cadetblue:ru,chartreuse:iu,chocolate:nu,coral:au,cornflowerblue:su,cornsilk:ou,crimson:hu,cyan:uu,darkblue:lu,darkcyan:fu,darkgoldenrod:cu,darkgray:du,darkgreen:pu,darkgrey:vu,darkkhaki:_u,darkmagenta:mu,darkolivegreen:yu,darkorange:gu,darkorchid:Tu,darkred:xu,darksalmon:bu,darkseagreen:Iu,darkslateblue:Eu,darkslategray:Ru,darkslategrey:Cu,darkturquoise:wu,darkviolet:Pu,deeppink:Nu,deepskyblue:Au,dimgray:Uu,dimgrey:Ou,dodgerblue:Su,firebrick:Lu,floralwhite:Fu,forestgreen:Gu,fuchsia:Bu,gainsboro:Mu,ghostwhite:Xu,goldenrod:ku,gold:Hu,gray:Du,green:Vu,greenyellow:ju,grey:zu,honeydew:Wu,hotpink:Yu,indianred:$u,indigo:qu,ivory:Ku,khaki:Zu,lavenderblush:Ju,lavender:Qu,lawngreen:tl,lemonchiffon:el,lightblue:rl,lightcoral:il,lightcyan:nl,lightgoldenrodyellow:al,lightgray:sl,lightgreen:ol,lightgrey:hl,lightpink:ul,lightsalmon:ll,lightseagreen:fl,lightskyblue:cl,lightslategray:dl,lightslategrey:pl,lightsteelblue:vl,lightyellow:_l,lime:ml,limegreen:yl,linen:gl,magenta:Tl,maroon:xl,mediumaquamarine:bl,mediumblue:Il,mediumorchid:El,mediumpurple:Rl,mediumseagreen:Cl,mediumslateblue:wl,mediumspringgreen:Pl,mediumturquoise:Nl,mediumvioletred:Al,midnightblue:Ul,mintcream:Ol,mistyrose:Sl,moccasin:Ll,navajowhite:Fl,navy:Gl,oldlace:Bl,olive:Ml,olivedrab:Xl,orange:kl,orangered:Hl,orchid:Dl,palegoldenrod:Vl,palegreen:jl,paleturquoise:zl,palevioletred:Wl,papayawhip:Yl,peachpuff:$l,peru:ql,pink:Kl,plum:Zl,powderblue:Jl,purple:Ql,rebeccapurple:tf,red:ef,rosybrown:rf,royalblue:nf,saddlebrown:af,salmon:sf,sandybrown:of,seagreen:hf,seashell:uf,sienna:lf,silver:ff,skyblue:cf,slateblue:df,slategray:pf,slategrey:vf,snow:_f,springgreen:mf,steelblue:yf,tan:gf,teal:Tf,thistle:xf,tomato:bf,turquoise:If,violet:Ef,wheat:Rf,white:Cf,whitesmoke:wf,yellow:Pf,yellowgreen:Nf};function Re(t,r){return r===void 0&&(r=[]),r[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(t&255)/255,r}function Vo(t){var r=t.toString(16);return r="000000".substring(0,6-r.length)+r,"#"+r}function jo(t){return typeof t=="string"&&(t=Af[t.toLowerCase()]||t,t[0]==="#"&&(t=t.slice(1))),parseInt(t,16)}function Uf(){for(var t=[],r=[],e=0;e<32;e++)t[e]=e,r[e]=e;t[P.NORMAL_NPM]=P.NORMAL,t[P.ADD_NPM]=P.ADD,t[P.SCREEN_NPM]=P.SCREEN,r[P.NORMAL]=P.NORMAL_NPM,r[P.ADD]=P.ADD_NPM,r[P.SCREEN]=P.SCREEN_NPM;var i=[];return i.push(r),i.push(t),i}var zo=Uf();function Wo(t,r){return zo[r?1:0][t]}function Of(t,r,e,i){return e=e||new Float32Array(4),i||i===void 0?(e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r):(e[0]=t[0],e[1]=t[1],e[2]=t[2]),e[3]=r,e}function pn(t,r){if(r===1)return(r*255<<24)+t;if(r===0)return 0;var e=t>>16&255,i=t>>8&255,n=t&255;return e=e*r+.5|0,i=i*r+.5|0,n=n*r+.5|0,(r*255<<24)+(e<<16)+(i<<8)+n}function Yo(t,r,e,i){return e=e||new Float32Array(4),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(t&255)/255,(i||i===void 0)&&(e[0]*=r,e[1]*=r,e[2]*=r),e[3]=r,e}function Sf(t,r){r===void 0&&(r=null);var e=t*6;if(r=r||new Uint16Array(e),r.length!==e)throw new Error("Out buffer length is incorrect, got "+r.length+" and expected "+e);for(var i=0,n=0;i<e;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r}function $o(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function Ar(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function ua(t){return!(t&t-1)&&!!t}function la(t){var r=(t>65535?1:0)<<4;t>>>=r;var e=(t>255?1:0)<<3;return t>>>=e,r|=e,e=(t>15?1:0)<<2,t>>>=e,r|=e,e=(t>3?1:0)<<1,t>>>=e,r|=e,r|t>>1}function Gt(t,r,e){var i=t.length,n;if(!(r>=i||e===0)){e=r+e>i?i-r:e;var a=i-e;for(n=r;n<a;++n)t[n]=t[n+e];t.length=a}}function xe(t){return t===0?0:t<0?-1:1}var Lf=0;function oe(){return++Lf}var fa={};function He(t,r,e){if(e===void 0&&(e=3),!fa[r]){var i=new Error().stack;typeof i=="undefined"?console.warn("PixiJS Deprecation Warning: ",r+`
Deprecated since v`+t):(i=i.split(`
`).splice(e).join(`
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r+`
Deprecated since v`+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r+`
Deprecated since v`+t),console.warn(i))),fa[r]=!0}}var ca={},Ot=Object.create(null),Kt=Object.create(null),da=function(){function t(r,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||N.RESOLUTION,this.resize(r,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(r,e){this.canvas.width=Math.round(r*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(r){this.canvas.width=Math.round(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(r){this.canvas.height=Math.round(r)},enumerable:!1,configurable:!0}),t}();function Ff(t){var r=t.width,e=t.height,i=t.getContext("2d"),n=i.getImageData(0,0,r,e),a=n.data,s=a.length,o={top:null,left:null,right:null,bottom:null},h=null,u,l,c;for(u=0;u<s;u+=4)a[u+3]!==0&&(l=u/4%r,c=~~(u/4/r),o.top===null&&(o.top=c),(o.left===null||l<o.left)&&(o.left=l),(o.right===null||o.right<l)&&(o.right=l+1),(o.bottom===null||o.bottom<c)&&(o.bottom=c));return o.top!==null&&(r=o.right-o.left,e=o.bottom-o.top+1,h=i.getImageData(o.left,o.top,r,e)),{height:e,width:r,data:h}}var ir;function Gf(t,r){if(r===void 0&&(r=globalThis.location),t.indexOf("data:")===0)return"";r=r||globalThis.location,ir||(ir=document.createElement("a")),ir.href=t;var e=Te.parse(ir.href),i=!e.port&&r.port===""||e.port===r.port;return e.hostname!==r.hostname||!i||e.protocol!==r.protocol?"anonymous":""}function Ur(t,r){var e=N.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):r!==void 0?r:1}/*!
* @pixi/runner - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/runner is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var ot=function(){function t(r){this.items=[],this._name=r,this._aliasCount=0}return t.prototype.emit=function(r,e,i,n,a,s,o,h){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,c=u.items;this._aliasCount++;for(var f=0,d=c.length;f<d;f++)c[f][l](r,e,i,n,a,s,o,h);return c===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(r){return r[this._name]&&(this.ensureNonAliasedItems(),this.remove(r),this.items.push(r)),this},t.prototype.remove=function(r){var e=this.items.indexOf(r);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(r){return this.items.indexOf(r)!==-1},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(ot.prototype,{dispatch:{value:ot.prototype.emit},run:{value:ot.prototype.emit}});/*!
* @pixi/ticker - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/ticker is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/N.TARGET_FPMS=.06;var kt;(function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"})(kt||(kt={}));var Dr=function(){function t(r,e,i,n){e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=r,this.context=e,this.priority=i,this.once=n}return t.prototype.match=function(r,e){return e===void 0&&(e=null),this.fn===r&&this.context===e},t.prototype.emit=function(r){this.fn&&(this.context?this.fn.call(this.context,r):this.fn(r));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(r){this.previous=r,r.next&&(r.next.previous=this),this.next=r.next,r.next=this},t.prototype.destroy=function(r){r===void 0&&(r=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=r?null:e,this.previous=null,e},t}(),at=function(){function t(){var r=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Dr(null,null,1/0),this.deltaMS=1/N.TARGET_FPMS,this.elapsedMS=1/N.TARGET_FPMS,this._tick=function(e){r._requestId=null,r.started&&(r.update(e),r.started&&r._requestId===null&&r._head.next&&(r._requestId=requestAnimationFrame(r._tick)))}}return t.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(r,e,i){return i===void 0&&(i=kt.NORMAL),this._addListener(new Dr(r,e,i))},t.prototype.addOnce=function(r,e,i){return i===void 0&&(i=kt.NORMAL),this._addListener(new Dr(r,e,i,!0))},t.prototype._addListener=function(r){var e=this._head.next,i=this._head;if(!e)r.connect(i);else{for(;e;){if(r.priority>e.priority){r.connect(i);break}i=e,e=e.next}r.previous||r.connect(i)}return this._startIfPossible(),this},t.prototype.remove=function(r,e){for(var i=this._head.next;i;)i.match(r,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var r=0,e=this._head;e=e.next;)r++;return r},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var r=this._head.next;r;)r=r.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(r){r===void 0&&(r=performance.now());var e;if(r>this.lastTime){if(e=this.elapsedMS=r-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=r-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=r-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*N.TARGET_FPMS;for(var n=this._head,a=n.next;a;)a=a.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=r},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(r){var e=Math.min(this.maxFPS,r),i=Math.min(Math.max(0,e)/1e3,N.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(r){if(r===0)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,r);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var r=t._shared=new t;r.autoStart=!0,r._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var r=t._system=new t;r.autoStart=!0,r._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),qv=function(){function t(){}return t.init=function(r){var e=this;r=Object.assign({autoStart:!0,sharedTicker:!1},r),Object.defineProperty(this,"ticker",{set:function(i){this._ticker&&this._ticker.remove(this.render,this),this._ticker=i,i&&i.add(this.render,this,kt.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=r.sharedTicker?at.shared:new at,r.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var r=this._ticker;this.ticker=null,r.destroy()}},t}();/*!
* @pixi/math - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/math is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Or=Math.PI*2,qo=180/Math.PI,Ko=Math.PI/180,Z;(function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"})(Z||(Z={}));var D=function(){function t(r,e){r===void 0&&(r=0),e===void 0&&(e=0),this.x=0,this.y=0,this.x=r,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(r){return this.set(r.x,r.y),this},t.prototype.copyTo=function(r){return r.set(this.x,this.y),r},t.prototype.equals=function(r){return r.x===this.x&&r.y===this.y},t.prototype.set=function(r,e){return r===void 0&&(r=0),e===void 0&&(e=r),this.x=r,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),nr=[new D,new D,new D,new D],M=function(){function t(r,e,i,n){r===void 0&&(r=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=Number(r),this.y=Number(e),this.width=Number(i),this.height=Number(n),this.type=Z.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(r){return this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this},t.prototype.copyTo=function(r){return r.x=this.x,r.y=this.y,r.width=this.width,r.height=this.height,r},t.prototype.contains=function(r,e){return this.width<=0||this.height<=0?!1:r>=this.x&&r<this.x+this.width&&e>=this.y&&e<this.y+this.height},t.prototype.intersects=function(r,e){if(!e){var i=this.x<r.x?r.x:this.x,n=this.right>r.right?r.right:this.right;if(n<=i)return!1;var a=this.y<r.y?r.y:this.y,s=this.bottom>r.bottom?r.bottom:this.bottom;return s>a}var o=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=o||l<=u)return!1;var c=nr[0].set(r.left,r.top),f=nr[1].set(r.left,r.bottom),d=nr[2].set(r.right,r.top),p=nr[3].set(r.right,r.bottom);if(d.x<=c.x||f.y<=c.y)return!1;var v=Math.sign(e.a*e.d-e.b*e.c);if(v===0||(e.apply(c,c),e.apply(f,f),e.apply(d,d),e.apply(p,p),Math.max(c.x,f.x,d.x,p.x)<=o||Math.min(c.x,f.x,d.x,p.x)>=h||Math.max(c.y,f.y,d.y,p.y)<=u||Math.min(c.y,f.y,d.y,p.y)>=l))return!1;var _=v*(f.y-c.y),m=v*(c.x-f.x),T=_*o+m*u,x=_*h+m*u,E=_*o+m*l,g=_*h+m*l;if(Math.max(T,x,E,g)<=_*c.x+m*c.y||Math.min(T,x,E,g)>=_*p.x+m*p.y)return!1;var y=v*(c.y-d.y),b=v*(d.x-c.x),C=y*o+b*u,I=y*h+b*u,w=y*o+b*l,S=y*h+b*l;return!(Math.max(C,I,w,S)<=y*c.x+b*c.y||Math.min(C,I,w,S)>=y*p.x+b*p.y)},t.prototype.pad=function(r,e){return r===void 0&&(r=0),e===void 0&&(e=r),this.x-=r,this.y-=e,this.width+=r*2,this.height+=e*2,this},t.prototype.fit=function(r){var e=Math.max(this.x,r.x),i=Math.min(this.x+this.width,r.x+r.width),n=Math.max(this.y,r.y),a=Math.min(this.y+this.height,r.y+r.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(a-n,0),this},t.prototype.ceil=function(r,e){r===void 0&&(r=1),e===void 0&&(e=.001);var i=Math.ceil((this.x+this.width-e)*r)/r,n=Math.ceil((this.y+this.height-e)*r)/r;return this.x=Math.floor((this.x+e)*r)/r,this.y=Math.floor((this.y+e)*r)/r,this.width=i-this.x,this.height=n-this.y,this},t.prototype.enlarge=function(r){var e=Math.min(this.x,r.x),i=Math.max(this.x+this.width,r.x+r.width),n=Math.min(this.y,r.y),a=Math.max(this.y+this.height,r.y+r.height);return this.x=e,this.width=i-e,this.y=n,this.height=a-n,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),Bf=function(){function t(r,e,i){r===void 0&&(r=0),e===void 0&&(e=0),i===void 0&&(i=0),this.x=r,this.y=e,this.radius=i,this.type=Z.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(r,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-r,a=this.y-e;return n*=n,a*=a,n+a<=i},t.prototype.getBounds=function(){return new M(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),Mf=function(){function t(r,e,i,n){r===void 0&&(r=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=r,this.y=e,this.width=i,this.height=n,this.type=Z.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(r,e){if(this.width<=0||this.height<=0)return!1;var i=(r-this.x)/this.width,n=(e-this.y)/this.height;return i*=i,n*=n,i+n<=1},t.prototype.getBounds=function(){return new M(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),Cr=function(){function t(){for(var r=arguments,e=[],i=0;i<arguments.length;i++)e[i]=r[i];var n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){for(var a=[],s=0,o=n.length;s<o;s++)a.push(n[s].x,n[s].y);n=a}this.points=n,this.type=Z.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var r=this.points.slice(),e=new t(r);return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(r,e){for(var i=!1,n=this.points.length/2,a=0,s=n-1;a<n;s=a++){var o=this.points[a*2],h=this.points[a*2+1],u=this.points[s*2],l=this.points[s*2+1],c=h>e!=l>e&&r<(u-o)*((e-h)/(l-h))+o;c&&(i=!i)}return i},t.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(r,e){return r+", "+e},"")+"]")},t}(),Xf=function(){function t(r,e,i,n,a){r===void 0&&(r=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),a===void 0&&(a=20),this.x=r,this.y=e,this.width=i,this.height=n,this.radius=a,this.type=Z.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(r,e){if(this.width<=0||this.height<=0)return!1;if(r>=this.x&&r<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||r>=this.x+i&&r<=this.x+this.width-i)return!0;var n=r-(this.x+i),a=e-(this.y+i),s=i*i;if(n*n+a*a<=s||(n=r-(this.x+this.width-i),n*n+a*a<=s)||(a=e-(this.y+this.height-i),n*n+a*a<=s)||(n=r-(this.x+i),n*n+a*a<=s))return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},t}(),be=function(){function t(r,e,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=r,this.scope=e}return t.prototype.clone=function(r,e){return r===void 0&&(r=this.cb),e===void 0&&(e=this.scope),new t(r,e,this._x,this._y)},t.prototype.set=function(r,e){return r===void 0&&(r=0),e===void 0&&(e=r),(this._x!==r||this._y!==e)&&(this._x=r,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(r){return(this._x!==r.x||this._y!==r.y)&&(this._x=r.x,this._y=r.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(r){return r.set(this._x,this._y),r},t.prototype.equals=function(r){return r.x===this._x&&r.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x="+0+" y="+0+" scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(r){this._x!==r&&(this._x=r,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(r){this._y!==r&&(this._y=r,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Q=function(){function t(r,e,i,n,a,s){r===void 0&&(r=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=0),s===void 0&&(s=0),this.array=null,this.a=r,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=s}return t.prototype.fromArray=function(r){this.a=r[0],this.b=r[1],this.c=r[3],this.d=r[4],this.tx=r[2],this.ty=r[5]},t.prototype.set=function(r,e,i,n,a,s){return this.a=r,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=s,this},t.prototype.toArray=function(r,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return r?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(r,e){e=e||new D;var i=r.x,n=r.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},t.prototype.applyInverse=function(r,e){e=e||new D;var i=1/(this.a*this.d+this.c*-this.b),n=r.x,a=r.y;return e.x=this.d*i*n+-this.c*i*a+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*a+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},t.prototype.translate=function(r,e){return this.tx+=r,this.ty+=e,this},t.prototype.scale=function(r,e){return this.a*=r,this.d*=e,this.c*=r,this.b*=e,this.tx*=r,this.ty*=e,this},t.prototype.rotate=function(r){var e=Math.cos(r),i=Math.sin(r),n=this.a,a=this.c,s=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=a*e-this.d*i,this.d=a*i+this.d*e,this.tx=s*e-this.ty*i,this.ty=s*i+this.ty*e,this},t.prototype.append=function(r){var e=this.a,i=this.b,n=this.c,a=this.d;return this.a=r.a*e+r.b*n,this.b=r.a*i+r.b*a,this.c=r.c*e+r.d*n,this.d=r.c*i+r.d*a,this.tx=r.tx*e+r.ty*n+this.tx,this.ty=r.tx*i+r.ty*a+this.ty,this},t.prototype.setTransform=function(r,e,i,n,a,s,o,h,u){return this.a=Math.cos(o+u)*a,this.b=Math.sin(o+u)*a,this.c=-Math.sin(o-h)*s,this.d=Math.cos(o-h)*s,this.tx=r-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},t.prototype.prepend=function(r){var e=this.tx;if(r.a!==1||r.b!==0||r.c!==0||r.d!==1){var i=this.a,n=this.c;this.a=i*r.a+this.b*r.c,this.b=i*r.b+this.b*r.d,this.c=n*r.a+this.d*r.c,this.d=n*r.b+this.d*r.d}return this.tx=e*r.a+this.ty*r.c+r.tx,this.ty=e*r.b+this.ty*r.d+r.ty,this},t.prototype.decompose=function(r){var e=this.a,i=this.b,n=this.c,a=this.d,s=r.pivot,o=-Math.atan2(-n,a),h=Math.atan2(i,e),u=Math.abs(o+h);return u<1e-5||Math.abs(Or-u)<1e-5?(r.rotation=h,r.skew.x=r.skew.y=0):(r.rotation=0,r.skew.x=o,r.skew.y=h),r.scale.x=Math.sqrt(e*e+i*i),r.scale.y=Math.sqrt(n*n+a*a),r.position.x=this.tx+(s.x*e+s.y*n),r.position.y=this.ty+(s.x*i+s.y*a),r},t.prototype.invert=function(){var r=this.a,e=this.b,i=this.c,n=this.d,a=this.tx,s=r*n-e*i;return this.a=n/s,this.b=-e/s,this.c=-i/s,this.d=r/s,this.tx=(i*this.ty-n*a)/s,this.ty=-(r*this.ty-e*a)/s,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var r=new t;return r.a=this.a,r.b=this.b,r.c=this.c,r.d=this.d,r.tx=this.tx,r.ty=this.ty,r},t.prototype.copyTo=function(r){return r.a=this.a,r.b=this.b,r.c=this.c,r.d=this.d,r.tx=this.tx,r.ty=this.ty,r},t.prototype.copyFrom=function(r){return this.a=r.a,this.b=r.b,this.c=r.c,this.d=r.d,this.tx=r.tx,this.ty=r.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ee=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],re=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ie=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ne=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Pi=[],Zo=[],ar=Math.sign;function kf(){for(var t=0;t<16;t++){var r=[];Pi.push(r);for(var e=0;e<16;e++)for(var i=ar(ee[t]*ee[e]+ie[t]*re[e]),n=ar(re[t]*ee[e]+ne[t]*re[e]),a=ar(ee[t]*ie[e]+ie[t]*ne[e]),s=ar(re[t]*ie[e]+ne[t]*ne[e]),o=0;o<16;o++)if(ee[o]===i&&re[o]===n&&ie[o]===a&&ne[o]===s){r.push(o);break}}for(var t=0;t<16;t++){var h=new Q;h.set(ee[t],re[t],ie[t],ne[t],0,0),Zo.push(h)}}kf();var K={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return ee[t]},uY:function(t){return re[t]},vX:function(t){return ie[t]},vY:function(t){return ne[t]},inv:function(t){return t&8?t&15:-t&7},add:function(t,r){return Pi[t][r]},sub:function(t,r){return Pi[t][K.inv(r)]},rotate180:function(t){return t^4},isVertical:function(t){return(t&3)===2},byDirection:function(t,r){return Math.abs(t)*2<=Math.abs(r)?r>=0?K.S:K.N:Math.abs(r)*2<=Math.abs(t)?t>0?K.E:K.W:r>0?t>0?K.SE:K.SW:t>0?K.NE:K.NW},matrixAppendRotationInv:function(t,r,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=Zo[K.inv(r)];n.tx=e,n.ty=i,t.append(n)}},vn=function(){function t(){this.worldTransform=new Q,this.localTransform=new Q,this.position=new be(this.onChange,this,0,0),this.scale=new be(this.onChange,this,1,1),this.pivot=new be(this.onChange,this,0,0),this.skew=new be(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},t.prototype.updateLocalTransform=function(){var r=this.localTransform;this._localID!==this._currentLocalID&&(r.a=this._cx*this.scale.x,r.b=this._sx*this.scale.x,r.c=this._cy*this.scale.y,r.d=this._sy*this.scale.y,r.tx=this.position.x-(this.pivot.x*r.a+this.pivot.y*r.c),r.ty=this.position.y-(this.pivot.x*r.b+this.pivot.y*r.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(r){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==r._worldID){var i=r.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=r._worldID,this._worldID++}},t.prototype.setFromMatrix=function(r){r.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(r){this._rotation!==r&&(this._rotation=r,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();/*!
* @pixi/core - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/core is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/N.PREFER_ENV=It.any?Mt.WEBGL:Mt.WEBGL2;N.STRICT_TEXTURE_CACHE=!1;var Ni=[];function Jo(t,r){if(!t)return null;var e="";if(typeof t=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(e=i[1].toLowerCase())}for(var n=Ni.length-1;n>=0;--n){var a=Ni[n];if(a.test&&a.test(t,e))return new a(t,r)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Ai=function(t,r){return Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Ai(t,r)};function $(t,r){Ai(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Ui=function(){return Ui=Object.assign||function(r){for(var e=arguments,i,n=1,a=arguments.length;n<a;n++){i=e[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])}return r},Ui.apply(this,arguments)};function Hf(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&(e[i[n]]=t[i[n]]);return e}var De=function(){function t(r,e){r===void 0&&(r=0),e===void 0&&(e=0),this._width=r,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new ot("setRealSize"),this.onUpdate=new ot("update"),this.onError=new ot("onError")}return t.prototype.bind=function(r){this.onResize.add(r),this.onUpdate.add(r),this.onError.add(r),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(r){this.onResize.remove(r),this.onUpdate.remove(r),this.onError.remove(r)},t.prototype.resize=function(r,e){(r!==this._width||e!==this._height)&&(this._width=r,this._height=e,this.onResize.emit(r,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(r,e,i){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(r,e){return!1},t}(),Je=function(t){$(r,t);function r(e,i){var n=this,a=i||{},s=a.width,o=a.height;if(!s||!o)throw new Error("BufferResource width or height invalid");return n=t.call(this,s,o)||this,n.data=e,n}return r.prototype.upload=function(e,i,n){var a=e.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===_t.UNPACK);var s=i.realWidth,o=i.realHeight;return n.width===s&&n.height===o?a.texSubImage2D(i.target,0,0,0,s,o,i.format,n.type,this.data):(n.width=s,n.height=o,a.texImage2D(i.target,0,n.internalFormat,s,o,0,i.format,n.type,this.data)),!0},r.prototype.dispose=function(){this.data=null},r.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},r}(De),Df={scaleMode:Lt.NEAREST,format:R.RGBA,alphaMode:_t.NPM},H=function(t){$(r,t);function r(e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=t.call(this)||this;i=i||{};var a=i.alphaMode,s=i.mipmap,o=i.anisotropicLevel,h=i.scaleMode,u=i.width,l=i.height,c=i.wrapMode,f=i.format,d=i.type,p=i.target,v=i.resolution,_=i.resourceOptions;return e&&!(e instanceof De)&&(e=Jo(e,_),e.internal=!0),n.resolution=v||N.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((l||0)*n.resolution)/n.resolution,n._mipmap=s!==void 0?s:N.MIPMAP_TEXTURES,n.anisotropicLevel=o!==void 0?o:N.ANISOTROPIC_LEVEL,n._wrapMode=c||N.WRAP_MODE,n._scaleMode=h!==void 0?h:N.SCALE_MODE,n.format=f||R.RGBA,n.type=d||O.UNSIGNED_BYTE,n.target=p||ae.TEXTURE_2D,n.alphaMode=a!==void 0?a:_t.UNPACK,n.uid=oe(),n.touched=0,n.isPowerOfTwo=!1,n._refreshPOT(),n._glTextures={},n.dirtyId=0,n.dirtyStyleId=0,n.cacheId=null,n.valid=u>0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return Object.defineProperty(r.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),r.prototype.setStyle=function(e,i){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},r.prototype.setSize=function(e,i,n){return n=n||this.resolution,this.setRealSize(e*n,i*n,n)},r.prototype.setRealSize=function(e,i,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},r.prototype._refreshPOT=function(){this.isPowerOfTwo=ua(this.realWidth)&&ua(this.realHeight)},r.prototype.setResolution=function(e){var i=this.resolution;return i===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*i)/e,this.height=Math.round(this.height*i)/e,this.emit("update",this)),this._refreshPOT(),this)},r.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},r.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},r.prototype.onError=function(e){this.emit("error",this,e)},r.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Kt[this.cacheId],delete Ot[this.cacheId],this.cacheId=null),this.dispose(),r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},r.prototype.dispose=function(){this.emit("dispose",this)},r.prototype.castToBaseTexture=function(){return this},r.from=function(e,i,n){n===void 0&&(n=N.STRICT_TEXTURE_CACHE);var a=typeof e=="string",s=null;if(a)s=e;else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+oe()}s=e._pixiId}var h=Kt[s];if(a&&n&&!h)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return h||(h=new r(e,i),h.cacheId=s,r.addToCache(h,s)),h},r.fromBuffer=function(e,i,n,a){e=e||new Float32Array(i*n*4);var s=new Je(e,{width:i,height:n}),o=e instanceof Float32Array?O.FLOAT:O.UNSIGNED_BYTE;return new r(s,Object.assign(Df,a||{width:i,height:n,type:o}))},r.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),Kt[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),Kt[i]=e)},r.removeFromCache=function(e){if(typeof e=="string"){var i=Kt[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Kt[e],i}}else if(e&&e.textureCacheIds){for(var a=0;a<e.textureCacheIds.length;++a)delete Kt[e.textureCacheIds[a]];return e.textureCacheIds.length=0,e}return null},r._globalBatch=0,r}(we),Qo=function(t){$(r,t);function r(e,i){var n=this,a=i||{},s=a.width,o=a.height;n=t.call(this,s,o)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<e;h++){var u=new H;n.items.push(u),n.itemDirtyIds.push(-2)}return n.length=e,n._load=null,n.baseTexture=null,n}return r.prototype.initFromArray=function(e,i){for(var n=0;n<this.length;n++)!e[n]||(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof De?this.addResourceAt(e[n],n):this.addResourceAt(Jo(e[n],i),n))},r.prototype.dispose=function(){for(var e=0,i=this.length;e<i;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},r.prototype.addResourceAt=function(e,i){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[i].setResource(e),this},r.prototype.bind=function(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=e,this.items[i].on("update",e.update,e)},r.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",e.update,e)},r.prototype.load=function(){var e=this;if(this._load)return this._load;var i=this.items.map(function(a){return a.resource}).filter(function(a){return a}),n=i.map(function(a){return a.load()});return this._load=Promise.all(n).then(function(){var a=e.items[0],s=a.realWidth,o=a.realHeight;return e.resize(s,o),Promise.resolve(e)}),this._load},r}(De),Vf=function(t){$(r,t);function r(e,i){var n=this,a=i||{},s=a.width,o=a.height,h,u;return Array.isArray(e)?(h=e,u=e.length):u=e,n=t.call(this,u,{width:s,height:o})||this,h&&n.initFromArray(h,i),n}return r.prototype.addBaseTextureAt=function(e,i){if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this},r.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=ae.TEXTURE_2D_ARRAY},r.prototype.upload=function(e,i,n){var a=this,s=a.length,o=a.itemDirtyIds,h=a.items,u=e.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,s,0,i.format,n.type,null);for(var l=0;l<s;l++){var c=h[l];o[l]<c.dirtyId&&(o[l]=c.dirtyId,c.valid&&u.texSubImage3D(u.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,i.format,n.type,c.resource.source))}return!0},r}(Qo),Yt=function(t){$(r,t);function r(e){var i=this,n=e,a=n.naturalWidth||n.videoWidth||n.width,s=n.naturalHeight||n.videoHeight||n.height;return i=t.call(this,a,s)||this,i.source=e,i.noSubImage=!1,i}return r.crossOrigin=function(e,i,n){n===void 0&&i.indexOf("data:")!==0?e.crossOrigin=Gf(i):n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous")},r.prototype.upload=function(e,i,n,a){var s=e.gl,o=i.realWidth,h=i.realHeight;if(a=a||this.source,a instanceof HTMLImageElement){if(!a.complete||a.naturalWidth===0)return!1}else if(a instanceof HTMLVideoElement&&a.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===_t.UNPACK),!this.noSubImage&&i.target===s.TEXTURE_2D&&n.width===o&&n.height===h?s.texSubImage2D(s.TEXTURE_2D,0,0,0,i.format,n.type,a):(n.width=o,n.height=h,s.texImage2D(i.target,0,n.internalFormat,i.format,n.type,a)),!0},r.prototype.update=function(){if(!this.destroyed){var e=this.source,i=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(i,n),t.prototype.update.call(this)}},r.prototype.dispose=function(){this.source=null},r}(De),th=function(t){$(r,t);function r(e){return t.call(this,e)||this}return r.test=function(e){var i=globalThis.OffscreenCanvas;return i&&e instanceof i?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement},r}(Yt),jf=function(t){$(r,t);function r(e,i){var n=this,a=i||{},s=a.width,o=a.height,h=a.autoLoad,u=a.linkBaseTexture;if(e&&e.length!==r.SIDES)throw new Error("Invalid length. Got "+e.length+", expected 6");n=t.call(this,6,{width:s,height:o})||this;for(var l=0;l<r.SIDES;l++)n.items[l].target=ae.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=u!==!1,e&&n.initFromArray(e,i),h!==!1&&n.load(),n}return r.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=ae.TEXTURE_CUBE_MAP},r.prototype.addBaseTextureAt=function(e,i,n){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=ae.TEXTURE_CUBE_MAP_POSITIVE_X+i,e.parentTextureArray=this.baseTexture,this.items[i]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[i]=e,this},r.prototype.upload=function(e,i,n){for(var a=this.itemDirtyIds,s=0;s<r.SIDES;s++){var o=this.items[s];a[s]<o.dirtyId&&(o.valid&&o.resource?(o.resource.upload(e,o,n),a[s]=o.dirtyId):a[s]<-1&&(e.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),a[s]=-1))}return!0},r.test=function(e){return Array.isArray(e)&&e.length===r.SIDES},r.SIDES=6,r}(Qo),eh=function(t){$(r,t);function r(e,i){var n=this;if(i=i||{},!(e instanceof HTMLImageElement)){var a=new Image;Yt.crossOrigin(a,e,i.crossorigin),a.src=e,e=a}return n=t.call(this,e)||this,!e.complete&&!!n._width&&!!n._height&&(n._width=0,n._height=0),n.url=e.src,n._process=null,n.preserveBitmap=!1,n.createBitmap=(i.createBitmap!==void 0?i.createBitmap:N.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,n.alphaMode=typeof i.alphaMode=="number"?i.alphaMode:null,n.bitmap=null,n._load=null,i.autoLoad!==!1&&n.load(),n}return r.prototype.load=function(e){var i=this;return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise(function(n,a){var s=i.source;i.url=s.src;var o=function(){i.destroyed||(s.onload=null,s.onerror=null,i.resize(s.width,s.height),i._load=null,i.createBitmap?n(i.process()):n(i))};s.complete&&s.src?o():(s.onload=o,s.onerror=function(h){a(h),i.onError.emit(h)})}),this._load)},r.prototype.process=function(){var e=this,i=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var n=globalThis.createImageBitmap,a=!i.crossOrigin||i.crossOrigin==="anonymous";return this._process=fetch(i.src,{mode:a?"cors":"no-cors"}).then(function(s){return s.blob()}).then(function(s){return n(s,0,0,i.width,i.height,{premultiplyAlpha:e.alphaMode===_t.UNPACK?"premultiply":"none"})}).then(function(s){return e.destroyed?Promise.reject():(e.bitmap=s,e.update(),e._process=null,Promise.resolve(e))}),this._process},r.prototype.upload=function(e,i,n){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,n,this.bitmap),!this.preserveBitmap){var a=!0,s=i._glTextures;for(var o in s){var h=s[o];if(h!==n&&h.dirtyId!==i.dirtyId){a=!1;break}}a&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},r.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},r.test=function(e){return typeof e=="string"||e instanceof HTMLImageElement},r}(Yt),zf=function(t){$(r,t);function r(e,i){var n=this;return i=i||{},n=t.call(this,document.createElement("canvas"))||this,n._width=0,n._height=0,n.svg=e,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,i.autoLoad!==!1&&n.load(),n}return r.prototype.load=function(){var e=this;return this._load?this._load:(this._load=new Promise(function(i){if(e._resolve=function(){e.resize(e.source.width,e.source.height),i(e)},r.SVG_XML.test(e.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");e.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e.svg)))}e._loadSvg()}),this._load)},r.prototype._loadSvg=function(){var e=this,i=new Image;Yt.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(n){!e._resolve||(i.onerror=null,e.onError.emit(n))},i.onload=function(){if(!!e._resolve){var n=i.width,a=i.height;if(!n||!a)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var s=n*e.scale,o=a*e.scale;(e._overrideWidth||e._overrideHeight)&&(s=e._overrideWidth||e._overrideHeight/a*n,o=e._overrideHeight||e._overrideWidth/n*a),s=Math.round(s),o=Math.round(o);var h=e.source;h.width=s,h.height=o,h._pixiId="canvas_"+oe(),h.getContext("2d").drawImage(i,0,0,n,a,0,0,s,o),e._resolve(),e._resolve=null}}},r.getSize=function(e){var i=r.SVG_SIZE.exec(e),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},r.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},r.test=function(e,i){return i==="svg"||typeof e=="string"&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(e)||typeof e=="string"&&r.SVG_XML.test(e)},r.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,r.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r}(Yt),Wf=function(t){$(r,t);function r(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var a=document.createElement("video");a.setAttribute("preload","auto"),a.setAttribute("webkit-playsinline",""),a.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var s=e[0].src||e[0];Yt.crossOrigin(a,s,i.crossorigin);for(var o=0;o<e.length;++o){var h=document.createElement("source"),u=e[o],l=u.src,c=u.mime;l=l||e[o];var f=l.split("?").shift().toLowerCase(),d=f.slice(f.lastIndexOf(".")+1);c=c||r.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=c,a.appendChild(h)}e=a}return n=t.call(this,e)||this,n.noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=i.autoPlay!==!1,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),i.autoLoad!==!1&&n.load(),n}return r.prototype.update=function(e){if(!this.destroyed){var i=at.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},r.prototype.load=function(){var e=this;if(this._load)return this._load;var i=this.source;return(i.readyState===i.HAVE_ENOUGH_DATA||i.readyState===i.HAVE_FUTURE_DATA)&&i.width&&i.height&&(i.complete=!0),i.addEventListener("play",this._onPlayStart.bind(this)),i.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(i.addEventListener("canplay",this._onCanPlay),i.addEventListener("canplaythrough",this._onCanPlay),i.addEventListener("error",this._onError,!0)),this._load=new Promise(function(n){e.valid?n(e):(e._resolve=n,i.load())}),this._load},r.prototype._onError=function(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)},r.prototype._isSourcePlaying=function(){var e=this.source;return e.currentTime>0&&e.paused===!1&&e.ended===!1&&e.readyState>2},r.prototype._isSourceReady=function(){var e=this.source;return e.readyState===3||e.readyState===4},r.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(at.shared.add(this.update,this),this._isConnectedToTicker=!0)},r.prototype._onPlayStop=function(){this._isConnectedToTicker&&(at.shared.remove(this.update,this),this._isConnectedToTicker=!1)},r.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(e.videoWidth,e.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},r.prototype.dispose=function(){this._isConnectedToTicker&&(at.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(at.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(at.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),r.test=function(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||r.TYPES.indexOf(i)>-1},r.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],r.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},r}(Yt),Yf=function(t){$(r,t);function r(e){return t.call(this,e)||this}return r.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},r}(Yt);Ni.push(eh,Yf,th,Wf,zf,Je,jf,Vf);var $f=function(t){$(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.prototype.upload=function(e,i,n){var a=e.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===_t.UNPACK);var s=i.realWidth,o=i.realHeight;return n.width===s&&n.height===o?a.texSubImage2D(i.target,0,0,0,s,o,i.format,n.type,this.data):(n.width=s,n.height=o,a.texImage2D(i.target,0,n.internalFormat,s,o,0,i.format,n.type,this.data)),!0},r}(Je),Oi=function(){function t(r,e){this.width=Math.round(r||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new ot("disposeFramebuffer"),this.multisample=et.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(r,e){return r===void 0&&(r=0),this.colorTextures[r]=e||new H(null,{scaleMode:Lt.NEAREST,resolution:1,mipmap:Xt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(r){return this.depthTexture=r||new H(new $f(null,{width:this.width,height:this.height}),{scaleMode:Lt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Xt.OFF,format:R.DEPTH_COMPONENT,type:O.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(r,e){if(r=Math.round(r),e=Math.round(e),!(r===this.width&&e===this.height)){this.width=r,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var n=this.colorTextures[i],a=n.resolution;n.setSize(r/a,e/a)}if(this.depthTexture){var a=this.depthTexture.resolution;this.depthTexture.setSize(r/a,e/a)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),rh=function(t){$(r,t);function r(e){e===void 0&&(e={});var i=this;if(typeof e=="number"){var n=arguments[0],a=arguments[1],s=arguments[2],o=arguments[3];e={width:n,height:a,scaleMode:s,resolution:o}}return e.width=e.width||100,e.height=e.height||100,e.multisample=e.multisample!==void 0?e.multisample:et.NONE,i=t.call(this,null,e)||this,i.mipmap=Xt.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Oi(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=e.multisample,i.maskStack=[],i.filterStack=[{}],i}return r.prototype.resize=function(e,i){this.framebuffer.resize(e*this.resolution,i*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},r.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},r}(H),ih=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(r,e,i){var n=e.width,a=e.height;if(i){var s=r.width/2/n,o=r.height/2/a,h=r.x/n+s,u=r.y/a+o;i=K.add(i,K.NW),this.x0=h+s*K.uX(i),this.y0=u+o*K.uY(i),i=K.add(i,2),this.x1=h+s*K.uX(i),this.y1=u+o*K.uY(i),i=K.add(i,2),this.x2=h+s*K.uX(i),this.y2=u+o*K.uY(i),i=K.add(i,2),this.x3=h+s*K.uX(i),this.y3=u+o*K.uY(i)}else this.x0=r.x/n,this.y0=r.y/a,this.x1=(r.x+r.width)/n,this.y1=r.y/a,this.x2=(r.x+r.width)/n,this.y2=(r.y+r.height)/a,this.x3=r.x/n,this.y3=(r.y+r.height)/a;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},t}(),pa=new ih;function sr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var F=function(t){$(r,t);function r(e,i,n,a,s,o){var h=t.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new M(0,0,1,1)),e instanceof r&&(e=e.baseTexture),h.baseTexture=e,h._frame=i,h.trim=a,h.valid=!1,h._uvs=pa,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(s||0),s===!0)h._rotate=2;else if(h._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=o?new D(o.x,o.y):new D(0,0),h._updateID=0,h.textureCacheIds=[],e.valid?h.noFrame?e.valid&&h.onBaseTextureUpdated(e):h.frame=i:e.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&e.on("update",h.onBaseTextureUpdated,h),h}return r.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},r.prototype.onBaseTextureUpdated=function(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},r.prototype.destroy=function(e){if(this.baseTexture){if(e){var i=this.baseTexture.resource;i&&i.url&&Ot[i.url]&&r.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,r.removeFromCache(this),this.textureCacheIds=null},r.prototype.clone=function(){var e=this._frame.clone(),i=this._frame===this.orig?e:this.orig.clone(),n=new r(this.baseTexture,!this.noFrame&&e,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=e),n},r.prototype.updateUvs=function(){this._uvs===pa&&(this._uvs=new ih),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},r.from=function(e,i,n){i===void 0&&(i={}),n===void 0&&(n=N.STRICT_TEXTURE_CACHE);var a=typeof e=="string",s=null;if(a)s=e;else if(e instanceof H){if(!e.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";e.cacheId=o+"-"+oe(),H.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+oe()}s=e._pixiId}var h=Ot[s];if(a&&n&&!h)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return!h&&!(e instanceof H)?(i.resolution||(i.resolution=Ur(e)),h=new r(new H(e,i)),h.baseTexture.cacheId=s,H.addToCache(h.baseTexture,s),r.addToCache(h,s)):!h&&e instanceof H&&(h=new r(e),r.addToCache(h,s)),h},r.fromURL=function(e,i){var n=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),a=r.from(e,Object.assign({resourceOptions:n},i),!1),s=a.baseTexture.resource;return a.baseTexture.valid?Promise.resolve(a):s.load().then(function(){return Promise.resolve(a)})},r.fromBuffer=function(e,i,n,a){return new r(H.fromBuffer(e,i,n,a))},r.fromLoader=function(e,i,n,a){var s=new H(e,Object.assign({scaleMode:N.SCALE_MODE,resolution:Ur(i)},a)),o=s.resource;o instanceof eh&&(o.url=i);var h=new r(s);return n||(n=i),H.addToCache(h.baseTexture,n),r.addToCache(h,n),n!==i&&(H.addToCache(h.baseTexture,i),r.addToCache(h,i)),h.baseTexture.valid?Promise.resolve(h):new Promise(function(u){h.baseTexture.once("loaded",function(){return u(h)})})},r.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),Ot[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ot[i]=e)},r.removeFromCache=function(e){if(typeof e=="string"){var i=Ot[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Ot[e],i}}else if(e&&e.textureCacheIds){for(var a=0;a<e.textureCacheIds.length;++a)Ot[e.textureCacheIds[a]]===e&&delete Ot[e.textureCacheIds[a]];return e.textureCacheIds.length=0,e}return null},Object.defineProperty(r.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"frame",{get:function(){return this._frame},set:function(e){this._frame=e,this.noFrame=!1;var i=e.x,n=e.y,a=e.width,s=e.height,o=i+a>this.baseTexture.width,h=n+s>this.baseTexture.height;if(o||h){var u=o&&h?"and":"or",l="X: "+i+" + "+a+" = "+(i+a)+" > "+this.baseTexture.width,c="Y: "+n+" + "+s+" = "+(n+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+c))}this.valid=a&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),r.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(r,"EMPTY",{get:function(){return r._EMPTY||(r._EMPTY=new r(new H),sr(r._EMPTY),sr(r._EMPTY.baseTexture)),r._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(r,"WHITE",{get:function(){if(!r._WHITE){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=16,e.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),r._WHITE=new r(new H(new th(e))),sr(r._WHITE),sr(r._WHITE.baseTexture)}return r._WHITE},enumerable:!1,configurable:!0}),r}(we),he=function(t){$(r,t);function r(e,i){var n=t.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(r.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),r.prototype.resize=function(e,i,n){n===void 0&&(n=!0);var a=this.baseTexture.resolution,s=Math.round(e*a)/a,o=Math.round(i*a)/a;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(s,o),this.updateUvs()},r.prototype.setResolution=function(e){var i=this.baseTexture;i.resolution!==e&&(i.setResolution(e),this.resize(i.width,i.height,!1))},r.create=function(e){for(var i=arguments,n=[],a=1;a<arguments.length;a++)n[a-1]=i[a];return typeof e=="number"&&(He("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),e={width:e,height:n[0],scaleMode:n[1],resolution:n[2]}),new r(new rh(e))},r}(F),qf=function(){function t(r){this.texturePool={},this.textureOptions=r||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(r,e,i){i===void 0&&(i=et.NONE);var n=new rh(Object.assign({width:r,height:e,resolution:1,multisample:i},this.textureOptions));return new he(n)},t.prototype.getOptimalTexture=function(r,e,i,n){i===void 0&&(i=1),n===void 0&&(n=et.NONE);var a;r=Math.ceil(r*i-1e-6),e=Math.ceil(e*i-1e-6),!this.enableFullScreen||r!==this._pixelsWidth||e!==this._pixelsHeight?(r=Ar(r),e=Ar(e),a=((r&65535)<<16|e&65535)>>>0,n>1&&(a+=n*4294967296)):a=n>1?-n:-1,this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(r,e,n)),s.filterPoolKey=a,s.setResolution(i),s},t.prototype.getFilterTexture=function(r,e,i){var n=this.getOptimalTexture(r.width,r.height,e||r.resolution,i||et.NONE);return n.filterFrame=r.filterFrame,n},t.prototype.returnTexture=function(r){var e=r.filterPoolKey;r.filterFrame=null,this.texturePool[e].push(r)},t.prototype.returnFilterTexture=function(r){this.returnTexture(r)},t.prototype.clear=function(r){if(r=r!==!1,r)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(r){if(!(r.width===this._pixelsWidth&&r.height===this._pixelsHeight)){this.enableFullScreen=r.width>0&&r.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=r.width,this._pixelsHeight=r.height}},t.SCREEN_KEY=-1,t}(),va=function(){function t(r,e,i,n,a,s,o){e===void 0&&(e=0),i===void 0&&(i=!1),n===void 0&&(n=O.FLOAT),this.buffer=r,this.size=e,this.normalized=i,this.type=n,this.stride=a,this.start=s,this.instance=o}return t.prototype.destroy=function(){this.buffer=null},t.from=function(r,e,i,n,a){return new t(r,e,i,n,a)},t}(),Kf=0,it=function(){function t(r,e,i){e===void 0&&(e=!0),i===void 0&&(i=!1),this.data=r||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Kf++,this.disposeRunner=new ot("disposeBuffer")}return t.prototype.update=function(r){r instanceof Array&&(r=new Float32Array(r)),this.data=r||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===Ct.ELEMENT_ARRAY_BUFFER},set:function(r){this.type=r?Ct.ELEMENT_ARRAY_BUFFER:Ct.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(r){return r instanceof Array&&(r=new Float32Array(r)),new t(r)},t}(),Zf={Float32Array,Uint32Array,Int32Array,Uint8Array};function Jf(t,r){for(var e=0,i=0,n={},a=0;a<t.length;a++)i+=r[a],e+=t[a].length;for(var s=new ArrayBuffer(e*4),o=null,h=0,a=0;a<t.length;a++){var u=r[a],l=t[a],c=$o(l);n[c]||(n[c]=new Zf[c](s)),o=n[c];for(var f=0;f<l.length;f++){var d=(f/u|0)*i+h,p=f%u;o[d+p]=l[f]}h+=u}return new Float32Array(s)}var _a={5126:4,5123:2,5121:1},Qf=0,tc={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Qe=function(){function t(r,e){r===void 0&&(r=[]),e===void 0&&(e={}),this.buffers=r,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Qf++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new ot("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(r,e,i,n,a,s,o,h){if(i===void 0&&(i=0),n===void 0&&(n=!1),h===void 0&&(h=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof it||(e instanceof Array&&(e=new Float32Array(e)),e=new it(e));var u=r.split("|");if(u.length>1){for(var l=0;l<u.length;l++)this.addAttribute(u[l],e,i,n,a);return this}var c=this.buffers.indexOf(e);return c===-1&&(this.buffers.push(e),c=this.buffers.length-1),this.attributes[r]=new va(c,i,n,a,s,o,h),this.instanced=this.instanced||h,this},t.prototype.getAttribute=function(r){return this.attributes[r]},t.prototype.getBuffer=function(r){return this.buffers[this.getAttribute(r).buffer]},t.prototype.addIndex=function(r){return r instanceof it||(r instanceof Array&&(r=new Uint16Array(r)),r=new it(r)),r.type=Ct.ELEMENT_ARRAY_BUFFER,this.indexBuffer=r,this.buffers.indexOf(r)===-1&&this.buffers.push(r),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var r=[],e=[],i=new it,n;for(n in this.attributes){var a=this.attributes[n],s=this.buffers[a.buffer];r.push(s.data),e.push(a.size*_a[a.type]/4),a.buffer=0}for(i.data=Jf(r,e),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var r in this.attributes){var e=this.attributes[r],i=this.buffers[e.buffer];return i.data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var r=new t,e=0;e<this.buffers.length;e++)r.buffers[e]=new it(this.buffers[e].data.slice(0));for(var e in this.attributes){var i=this.attributes[e];r.attributes[e]=new va(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(r.indexBuffer=r.buffers[this.buffers.indexOf(this.indexBuffer)],r.indexBuffer.type=Ct.ELEMENT_ARRAY_BUFFER),r},t.merge=function(r){for(var e=new t,i=[],n=[],a=[],s,o=0;o<r.length;o++){s=r[o];for(var h=0;h<s.buffers.length;h++)n[h]=n[h]||0,n[h]+=s.buffers[h].data.length,a[h]=0}for(var o=0;o<s.buffers.length;o++)i[o]=new tc[$o(s.buffers[o].data)](n[o]),e.buffers[o]=new it(i[o]);for(var o=0;o<r.length;o++){s=r[o];for(var h=0;h<s.buffers.length;h++)i[h].set(s.buffers[h].data,a[h]),a[h]+=s.buffers[h].data.length}if(e.attributes=s.attributes,s.indexBuffer){e.indexBuffer=e.buffers[s.buffers.indexOf(s.indexBuffer)],e.indexBuffer.type=Ct.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,c=0,f=0,o=0;o<s.buffers.length;o++)if(s.buffers[o]!==s.indexBuffer){f=o;break}for(var o in s.attributes){var d=s.attributes[o];(d.buffer|0)===f&&(l+=d.size*_a[d.type]/4)}for(var o=0;o<r.length;o++){for(var p=r[o].indexBuffer.data,h=0;h<p.length;h++)e.indexBuffer.data[h+c]+=u;u+=r[o].buffers[f].data.length/l,c+=p.length}}return e},t}(),ec=function(t){$(r,t);function r(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return r}(Qe),nh=function(t){$(r,t);function r(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new it(e.vertices),e.uvBuffer=new it(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return r.prototype.map=function(e,i){var n=0,a=0;return this.uvs[0]=n,this.uvs[1]=a,this.uvs[2]=n+i.width/e.width,this.uvs[3]=a,this.uvs[4]=n+i.width/e.width,this.uvs[5]=a+i.height/e.height,this.uvs[6]=n,this.uvs[7]=a+i.height/e.height,n=i.x,a=i.y,this.vertices[0]=n,this.vertices[1]=a,this.vertices[2]=n+i.width,this.vertices[3]=a,this.vertices[4]=n+i.width,this.vertices[5]=a+i.height,this.vertices[6]=n,this.vertices[7]=a+i.height,this.invalidate(),this},r.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},r}(Qe),rc=0,se=function(){function t(r,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=rc++,this.static=!!e,this.ubo=!!i,r instanceof it?(this.buffer=r,this.buffer.type=Ct.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=r,this.ubo&&(this.buffer=new it(new Float32Array(1)),this.buffer.type=Ct.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(r,e,i){if(!this.ubo)this.uniforms[r]=new t(e,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},t.from=function(r,e,i){return new t(r,e,i)},t.uboFrom=function(r,e){return new t(r,e!=null?e:!0,!0)},t}(),ic=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=et.NONE,this.sourceFrame=new M,this.destinationFrame=new M,this.bindingSourceFrame=new M,this.bindingDestinationFrame=new M,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),or=[new D,new D,new D,new D],Vr=new Q,nc=function(){function t(r){this.renderer=r,this.defaultFilterStack=[{}],this.texturePool=new qf,this.texturePool.setScreenSize(r.view),this.statePool=[],this.quad=new ec,this.quadUv=new nh,this.tempRect=new M,this.activeState={},this.globalUniforms=new se({outputFrame:new M,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return t.prototype.push=function(r,e){for(var i,n,a=this.renderer,s=this.defaultFilterStack,o=this.statePool.pop()||new ic,h=this.renderer.renderTexture,u=e[0].resolution,l=e[0].multisample,c=e[0].padding,f=e[0].autoFit,d=(i=e[0].legacy)!==null&&i!==void 0?i:!0,p=1;p<e.length;p++){var v=e[p];u=Math.min(u,v.resolution),l=Math.min(l,v.multisample),c=this.useMaxPadding?Math.max(c,v.padding):c+v.padding,f=f&&v.autoFit,d=d||((n=v.legacy)!==null&&n!==void 0?n:!0)}s.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),s.push(o),o.resolution=u,o.multisample=l,o.legacy=d,o.target=r,o.sourceFrame.copyFrom(r.filterArea||r.getBounds(!0)),o.sourceFrame.pad(c);var _=this.tempRect.copyFrom(h.sourceFrame);a.projection.transform&&this.transformAABB(Vr.copyFrom(a.projection.transform).invert(),_),f?(o.sourceFrame.fit(_),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(_)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,h.current?h.current.resolution:a.resolution,h.sourceFrame,h.destinationFrame,a.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,l),o.filters=e,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=o.sourceFrame.width,m.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(h.sourceFrame),o.bindingDestinationFrame.copyFrom(h.destinationFrame),o.transform=a.projection.transform,a.projection.transform=null,h.bind(o.renderTexture,o.sourceFrame,m),a.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var r=this.defaultFilterStack,e=r.pop(),i=e.filters;this.activeState=e;var n=this.globalUniforms.uniforms;n.outputFrame=e.sourceFrame,n.resolution=e.resolution;var a=n.inputSize,s=n.inputPixel,o=n.inputClamp;if(a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=1/a[0],a[3]=1/a[1],s[0]=Math.round(a[0]*e.resolution),s[1]=Math.round(a[1]*e.resolution),s[2]=1/s[0],s[3]=1/s[1],o[0]=.5*s[2],o[1]=.5*s[3],o[2]=e.sourceFrame.width*a[2]-.5*s[2],o[3]=e.sourceFrame.height*a[3]-.5*s[3],e.legacy){var h=n.filterArea;h[0]=e.destinationFrame.width,h[1]=e.destinationFrame.height,h[2]=e.sourceFrame.x,h[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=r[r.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,e.renderTexture,u.renderTexture,Vt.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,c=this.getOptimalFilterTexture(l.width,l.height,e.resolution);c.filterFrame=l.filterFrame;var f=0;for(f=0;f<i.length-1;++f){f===1&&e.multisample>1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),i[f].apply(this,l,c,Vt.CLEAR,e);var d=l;l=c,c=d}i[f].apply(this,l,u.renderTexture,Vt.BLEND,e),f>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(r,e){e===void 0&&(e=Vt.CLEAR);var i=this.renderer,n=i.renderTexture,a=i.state;if(r===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,r&&r.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=r.filterFrame.width,s.height=r.filterFrame.height,n.bind(r,r.filterFrame,s)}else r!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(r):this.renderer.renderTexture.bind(r,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=a.stateId&1||this.forceClear;(e===Vt.CLEAR||e===Vt.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(r,e,i,n){var a=this.renderer;a.state.set(r.state),this.bindAndClear(i,n),r.uniforms.uSampler=e,r.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(r),r.legacy=!!r.program.attributeData.aTextureCoord,r.legacy?(this.quadUv.map(e._frame,e.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(vt.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(vt.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(r,e){var i=this.activeState,n=i.sourceFrame,a=i.destinationFrame,s=e._texture.orig,o=r.set(a.width,0,0,a.height,n.x,n.y),h=e.worldTransform.copyTo(Q.TEMP_MATRIX);return h.invert(),o.prepend(h),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(r,e,i,n){return i===void 0&&(i=1),n===void 0&&(n=et.NONE),this.texturePool.getOptimalTexture(r,e,i,n)},t.prototype.getFilterTexture=function(r,e,i){if(typeof r=="number"){var n=r;r=e,e=n}r=r||this.activeState.renderTexture;var a=this.texturePool.getOptimalTexture(r.width,r.height,e||r.resolution,i||et.NONE);return a.filterFrame=r.filterFrame,a},t.prototype.returnFilterTexture=function(r){this.texturePool.returnTexture(r)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(r,e){var i=or[0],n=or[1],a=or[2],s=or[3];i.set(e.left,e.top),n.set(e.left,e.bottom),a.set(e.right,e.top),s.set(e.right,e.bottom),r.apply(i,i),r.apply(n,n),r.apply(a,a),r.apply(s,s);var o=Math.min(i.x,n.x,a.x,s.x),h=Math.min(i.y,n.y,a.y,s.y),u=Math.max(i.x,n.x,a.x,s.x),l=Math.max(i.y,n.y,a.y,s.y);e.x=o,e.y=h,e.width=u-o,e.height=l-h},t.prototype.roundFrame=function(r,e,i,n,a){if(!(r.width<=0||r.height<=0||i.width<=0||i.height<=0)){if(a){var s=a.a,o=a.b,h=a.c,u=a.d;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(u)>1e-4))return}a=a?Vr.copyFrom(a):Vr.identity(),a.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(a,r),r.ceil(e),this.transformAABB(a.invert(),r)}},t}(),Br=function(){function t(r){this.renderer=r}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(r){},t}(),ac=function(){function t(r){this.renderer=r,this.emptyRenderer=new Br(r),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(r){this.currentRenderer!==r&&(this.currentRenderer.stop(),this.currentRenderer=r,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(r,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)r[n]=i[n]||null,r[n]&&(r[n]._batchLocation=n)},t.prototype.boundArray=function(r,e,i,n){for(var a=r.elements,s=r.ids,o=r.count,h=0,u=0;u<o;u++){var l=a[u],c=l._batchLocation;if(c>=0&&c<n&&e[c]===l){s[u]=c;continue}for(;h<n;){var f=e[h];if(f&&f._batchEnabled===i&&f._batchLocation===h){h++;continue}s[u]=h,l._batchLocation=h,e[h]=l;break}}},t.prototype.destroy=function(){this.renderer=null},t}(),ma=0,sc=function(){function t(r){this.renderer=r,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),r.view.addEventListener("webglcontextlost",this.handleContextLost,!1),r.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(r){this.gl=r,this.renderer.gl=r,this.renderer.CONTEXT_UID=ma++,r.isContextLost()&&r.getExtension("WEBGL_lose_context")&&r.getExtension("WEBGL_lose_context").restoreContext()},t.prototype.initFromContext=function(r){this.gl=r,this.validateContext(r),this.renderer.gl=r,this.renderer.CONTEXT_UID=ma++,this.renderer.runners.contextChange.emit(r)},t.prototype.initFromOptions=function(r){var e=this.createContext(this.renderer.view,r);this.initFromContext(e)},t.prototype.createContext=function(r,e){var i;if(N.PREFER_ENV>=Mt.WEBGL2&&(i=r.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=r.getContext("webgl",e)||r.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var r=this.gl,e={anisotropicFiltering:r.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:r.getExtension("OES_texture_float_linear"),s3tc:r.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:r.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:r.getExtension("WEBGL_compressed_texture_etc"),etc1:r.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:r.getExtension("WEBGL_compressed_texture_atc"),astc:r.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:r.getExtension("WEBGL_draw_buffers"),depthTexture:r.getExtension("WEBGL_depth_texture"),loseContext:r.getExtension("WEBGL_lose_context"),vertexArrayObject:r.getExtension("OES_vertex_array_object")||r.getExtension("MOZ_OES_vertex_array_object")||r.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:r.getExtension("OES_element_index_uint"),floatTexture:r.getExtension("OES_texture_float"),floatTextureLinear:r.getExtension("OES_texture_float_linear"),textureHalfFloat:r.getExtension("OES_texture_half_float"),textureHalfFloatLinear:r.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:r.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(r){r.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var r=this.renderer.view;this.renderer=null,r.removeEventListener("webglcontextlost",this.handleContextLost),r.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(r){var e=r.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!r.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),oc=function(){function t(r){this.framebuffer=r,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=et.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return t}(),hc=new M,uc=function(){function t(r){this.renderer=r,this.managedFramebuffers=[],this.unknownFramebuffer=new Oi(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){var r=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new M,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;N.PREFER_ENV===Mt.WEBGL_LEGACY&&(e=null,i=null),e?r.drawBuffers=function(n){return e.drawBuffersWEBGL(n)}:(this.hasMRT=!1,r.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=r.getInternalformatParameter(r.RENDERBUFFER,r.RGBA8,r.SAMPLES)},t.prototype.bind=function(r,e,i){i===void 0&&(i=0);var n=this.gl;if(r){var a=r.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(r);this.current!==r&&(this.current=r,n.bindFramebuffer(n.FRAMEBUFFER,a.framebuffer)),a.mipLevel!==i&&(r.dirtyId++,r.dirtyFormat++,a.mipLevel=i),a.dirtyId!==r.dirtyId&&(a.dirtyId=r.dirtyId,a.dirtyFormat!==r.dirtyFormat?(a.dirtyFormat=r.dirtyFormat,a.dirtySize=r.dirtySize,this.updateFramebuffer(r,i)):a.dirtySize!==r.dirtySize&&(a.dirtySize=r.dirtySize,this.resizeFramebuffer(r)));for(var s=0;s<r.colorTextures.length;s++){var o=r.colorTextures[s];this.renderer.texture.unbind(o.parentTextureArray||o)}if(r.depthTexture&&this.renderer.texture.unbind(r.depthTexture),e){var h=e.width>>i,u=e.height>>i,l=h/e.width;this.setViewport(e.x*l,e.y*l,h,u)}else{var h=r.width>>i,u=r.height>>i;this.setViewport(0,0,h,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(r,e,i,n){var a=this.viewport;r=Math.round(r),e=Math.round(e),i=Math.round(i),n=Math.round(n),(a.width!==i||a.height!==n||a.x!==r||a.y!==e)&&(a.x=r,a.y=e,a.width=i,a.height=n,this.gl.viewport(r,e,i,n))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(r,e,i,n,a){a===void 0&&(a=Pr.COLOR|Pr.DEPTH);var s=this.gl;s.clearColor(r,e,i,n),s.clear(a)},t.prototype.initFramebuffer=function(r){var e=this.gl,i=new oc(e.createFramebuffer());return i.multisample=this.detectSamples(r.multisample),r.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(r),r.disposeRunner.add(this),i},t.prototype.resizeFramebuffer=function(r){var e=this.gl,i=r.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,r.width,r.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,r.width,r.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.width,r.height));var n=r.colorTextures,a=n.length;e.drawBuffers||(a=Math.min(a,1));for(var s=0;s<a;s++){var o=n[s],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0)}r.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(r.depthTexture,0)},t.prototype.updateFramebuffer=function(r,e){var i=this.gl,n=r.glFramebuffers[this.CONTEXT_UID],a=r.colorTextures,s=a.length;i.drawBuffers||(s=Math.min(s,1)),n.multisample>1&&this.canMultisampleFramebuffer(r)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,r.width,r.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var o=[],h=0;h<s;h++){var u=a[h],l=u.parentTextureArray||u;this.renderer.texture.bind(l,0),!(h===0&&n.msaaBuffer)&&(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,u.target,l._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),r.depthTexture){var c=this.writeDepthTexture;if(c){var f=r.depthTexture;this.renderer.texture.bind(f,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,f._glTextures[this.CONTEXT_UID].texture,e)}}(r.stencil||r.depth)&&!(r.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r.width,r.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},t.prototype.canMultisampleFramebuffer=function(r){return this.renderer.context.webGLVersion!==1&&r.colorTextures.length<=1&&!r.depthTexture},t.prototype.detectSamples=function(r){var e=this.msaaSamples,i=et.NONE;if(r<=1||e===null)return i;for(var n=0;n<e.length;n++)if(e[n]<=r){i=e[n];break}return i===1&&(i=et.NONE),i},t.prototype.blit=function(r,e,i){var n=this,a=n.current,s=n.renderer,o=n.gl,h=n.CONTEXT_UID;if(s.context.webGLVersion===2&&!!a){var u=a.glFramebuffers[h];if(!!u){if(!r){if(!u.msaaBuffer)return;var l=a.colorTextures[0];if(!l)return;u.blitFramebuffer||(u.blitFramebuffer=new Oi(a.width,a.height),u.blitFramebuffer.addColorTexture(0,l)),r=u.blitFramebuffer,r.colorTextures[0]!==l&&(r.colorTextures[0]=l,r.dirtyId++,r.dirtyFormat++),(r.width!==a.width||r.height!==a.height)&&(r.width=a.width,r.height=a.height,r.dirtyId++,r.dirtySize++)}e||(e=hc,e.width=a.width,e.height=a.height),i||(i=e);var c=e.width===i.width&&e.height===i.height;this.bind(r),o.bindFramebuffer(o.READ_FRAMEBUFFER,u.framebuffer),o.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.bottom,o.COLOR_BUFFER_BIT,c?o.NEAREST:o.LINEAR)}}},t.prototype.disposeFramebuffer=function(r,e){var i=r.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(!!i){delete r.glFramebuffers[this.CONTEXT_UID];var a=this.managedFramebuffers.indexOf(r);a>=0&&this.managedFramebuffers.splice(a,1),r.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(r){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],r)},t.prototype.forceStencil=function(){var r=this.current;if(!!r){var e=r.glFramebuffers[this.CONTEXT_UID];if(!(!e||e.stencil)){r.stencil=!0;var i=r.width,n=r.height,a=this.gl,s=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,s),e.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,e.multisample,a.DEPTH24_STENCIL8,i,n):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,i,n),e.stencil=s,a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,s)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new M},t.prototype.destroy=function(){this.renderer=null},t}(),jr={5126:4,5123:2,5121:1},lc=function(){function t(r){this.renderer=r,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var r=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,e.webGLVersion!==2){var i=this.renderer.context.extensions.vertexArrayObject;N.PREFER_ENV===Mt.WEBGL_LEGACY&&(i=null),i?(r.createVertexArray=function(){return i.createVertexArrayOES()},r.bindVertexArray=function(a){return i.bindVertexArrayOES(a)},r.deleteVertexArray=function(a){return i.deleteVertexArrayOES(a)}):(this.hasVao=!1,r.createVertexArray=function(){return null},r.bindVertexArray=function(){return null},r.deleteVertexArray=function(){return null})}if(e.webGLVersion!==2){var n=r.getExtension("ANGLE_instanced_arrays");n?(r.vertexAttribDivisor=function(a,s){return n.vertexAttribDivisorANGLE(a,s)},r.drawElementsInstanced=function(a,s,o,h,u){return n.drawElementsInstancedANGLE(a,s,o,h,u)},r.drawArraysInstanced=function(a,s,o,h){return n.drawArraysInstancedANGLE(a,s,o,h)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(r,e){e=e||this.renderer.shader.shader;var i=this.gl,n=r.glVertexArrayObjects[this.CONTEXT_UID],a=!1;n||(this.managedGeometries[r.id]=r,r.disposeRunner.add(this),r.glVertexArrayObjects[this.CONTEXT_UID]=n={},a=!0);var s=n[e.program.id]||this.initGeometryVao(r,e,a);this._activeGeometry=r,this._activeVao!==s&&(this._activeVao=s,this.hasVao?i.bindVertexArray(s):this.activateVao(r,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var r=this._activeGeometry,e=this.renderer.buffer,i=0;i<r.buffers.length;i++){var n=r.buffers[i];e.update(n)}},t.prototype.checkCompatibility=function(r,e){var i=r.attributes,n=e.attributeData;for(var a in n)if(!i[a])throw new Error('shader and geometry incompatible, geometry missing the "'+a+'" attribute')},t.prototype.getSignature=function(r,e){var i=r.attributes,n=e.attributeData,a=["g",r.id];for(var s in i)n[s]&&a.push(s,n[s].location);return a.join("-")},t.prototype.initGeometryVao=function(r,e,i){i===void 0&&(i=!0);var n=this.gl,a=this.CONTEXT_UID,s=this.renderer.buffer,o=e.program;o.glPrograms[a]||this.renderer.shader.generateProgram(e),this.checkCompatibility(r,o);var h=this.getSignature(r,o),u=r.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[o.id]=l,l;var c=r.buffers,f=r.attributes,d={},p={};for(var v in c)d[v]=0,p[v]=0;for(var v in f)!f[v].size&&o.attributeData[v]?f[v].size=o.attributeData[v].size:f[v].size||console.warn("PIXI Geometry attribute '"+v+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[f[v].buffer]+=f[v].size*jr[f[v].type];for(var v in f){var _=f[v],m=_.size;_.stride===void 0&&(d[_.buffer]===m*jr[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=p[_.buffer],p[_.buffer]+=m*jr[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var T=0;T<c.length;T++){var x=c[T];s.bind(x),i&&x._glBuffers[a].refCount++}return this.activateVao(r,o),this._activeVao=l,u[o.id]=l,u[h]=l,l},t.prototype.disposeGeometry=function(r,e){var i;if(!!this.managedGeometries[r.id]){delete this.managedGeometries[r.id];var n=r.glVertexArrayObjects[this.CONTEXT_UID],a=this.gl,s=r.buffers,o=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(r.disposeRunner.remove(this),!!n){if(o)for(var h=0;h<s.length;h++){var u=s[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!e&&o.dispose(s[h],e))}if(!e){for(var l in n)if(l[0]==="g"){var c=n[l];this._activeVao===c&&this.unbind(),a.deleteVertexArray(c)}}delete r.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(r){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],r)},t.prototype.activateVao=function(r,e){var i=this.gl,n=this.CONTEXT_UID,a=this.renderer.buffer,s=r.buffers,o=r.attributes;r.indexBuffer&&a.bind(r.indexBuffer);var h=null;for(var u in o){var l=o[u],c=s[l.buffer],f=c._glBuffers[n];if(e.attributeData[u]){h!==f&&(a.bind(c),h=f);var d=e.attributeData[u].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,l.size,l.type||i.FLOAT,l.normalized,l.stride,l.start),l.instance)if(this.hasInstance)i.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},t.prototype.draw=function(r,e,i,n){var a=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?s.instanced?a.drawElementsInstanced(r,e||s.indexBuffer.data.length,h,(i||0)*o,n||1):a.drawElements(r,e||s.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?a.drawArraysInstanced(r,i,e||s.getSize(),n||1):a.drawArrays(r,i,e||s.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),fc=function(){function t(r){r===void 0&&(r=null),this.type=st.NONE,this.autoDetect=!0,this.maskObject=r||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=N.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(r){r?this._filters?this._filters[0]=r:this._filters=[r]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=st.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(r){r?(this._stencilCounter=r._stencilCounter,this._scissorCounter=r._scissorCounter,this._scissorRect=r._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function ya(t,r,e){var i=t.createShader(r);return t.shaderSource(i,e),t.compileShader(i),i}function ga(t,r){var e=t.getShaderSource(r).split(`
`).map(function(u,l){return l+": "+u}),i=t.getShaderInfoLog(r),n=i.split(`
`),a={},s=n.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return u&&!a[u]?(a[u]=!0,!0):!1}),o=[""];s.forEach(function(u){e[u-1]="%c"+e[u-1]+"%c",o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=e.join(`
`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function cc(t,r,e,i){t.getProgramParameter(r,t.LINK_STATUS)||(t.getShaderParameter(e,t.COMPILE_STATUS)||ga(t,e),t.getShaderParameter(i,t.COMPILE_STATUS)||ga(t,i),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(r)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(r)))}function zr(t){for(var r=new Array(t),e=0;e<r.length;e++)r[e]=!1;return r}function ah(t,r){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*r);case"vec3":return new Float32Array(3*r);case"vec4":return new Float32Array(4*r);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*r);case"ivec3":return new Int32Array(3*r);case"ivec4":return new Int32Array(4*r);case"uvec2":return new Uint32Array(2*r);case"uvec3":return new Uint32Array(3*r);case"uvec4":return new Uint32Array(4*r);case"bool":return!1;case"bvec2":return zr(2*r);case"bvec3":return zr(3*r);case"bvec4":return zr(4*r);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var sh={},Ue=sh;function dc(){if(Ue===sh||Ue&&Ue.isContextLost()){var t=document.createElement("canvas"),r=void 0;N.PREFER_ENV>=Mt.WEBGL2&&(r=t.getContext("webgl2",{})),r||(r=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),r?r.getExtension("WEBGL_draw_buffers"):r=null),Ue=r}return Ue}var hr;function pc(){if(!hr){hr=Et.MEDIUM;var t=dc();if(t&&t.getShaderPrecisionFormat){var r=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);hr=r.precision?Et.HIGH:Et.MEDIUM}}return hr}function Ta(t,r,e){if(t.substring(0,9)!=="precision"){var i=r;return r===Et.HIGH&&e!==Et.HIGH&&(i=Et.MEDIUM),"precision "+i+` float;
`+t}else if(e!==Et.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}var vc={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function oh(t){return vc[t]}var ur=null,xa={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function hh(t,r){if(!ur){var e=Object.keys(xa);ur={};for(var i=0;i<e.length;++i){var n=e[i];ur[t[n]]=xa[n]}}return ur[r]}var Ee=[{test:function(t){return t.type==="float"&&t.size===1},code:function(t){return`
if(uv["`+t+'"] !== ud["'+t+`"].value)
{
ud["`+t+'"].value = uv["'+t+`"]
gl.uniform1f(ud["`+t+'"].location, uv["'+t+`"])
}
`}},{test:function(t){return(t.type==="sampler2D"||t.type==="samplerCube"||t.type==="sampler2DArray")&&t.size===1&&!t.isArray},code:function(t){return`t = syncData.textureCount++;
renderer.texture.bind(uv["`+t+`"], t);
if(ud["`+t+`"].value !== t)
{
ud["`+t+`"].value = t;
gl.uniform1i(ud["`+t+`"].location, t);
; // eslint-disable-line max-len
}`}},{test:function(t,r){return t.type==="mat3"&&t.size===1&&r.a!==void 0},code:function(t){return`
gl.uniformMatrix3fv(ud["`+t+'"].location, false, uv["'+t+`"].toArray(true));
`},codeUbo:function(t){return`
var `+t+"_matrix = uv."+t+`.toArray(true);
data[offset] = `+t+`_matrix[0];
data[offset+1] = `+t+`_matrix[1];
data[offset+2] = `+t+`_matrix[2];
data[offset + 4] = `+t+`_matrix[3];
data[offset + 5] = `+t+`_matrix[4];
data[offset + 6] = `+t+`_matrix[5];
data[offset + 8] = `+t+`_matrix[6];
data[offset + 9] = `+t+`_matrix[7];
data[offset + 10] = `+t+`_matrix[8];
`}},{test:function(t,r){return t.type==="vec2"&&t.size===1&&r.x!==void 0},code:function(t){return`
cv = ud["`+t+`"].value;
v = uv["`+t+`"];
if(cv[0] !== v.x || cv[1] !== v.y)
{
cv[0] = v.x;
cv[1] = v.y;
gl.uniform2f(ud["`+t+`"].location, v.x, v.y);
}`},codeUbo:function(t){return`
v = uv.`+t+`;
data[offset] = v.x;
data[offset+1] = v.y;
`}},{test:function(t){return t.type==="vec2"&&t.size===1},code:function(t){return`
cv = ud["`+t+`"].value;
v = uv["`+t+`"];
if(cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2f(ud["`+t+`"].location, v[0], v[1]);
}
`}},{test:function(t,r){return t.type==="vec4"&&t.size===1&&r.width!==void 0},code:function(t){return`
cv = ud["`+t+`"].value;
v = uv["`+t+`"];
if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
{
cv[0] = v.x;
cv[1] = v.y;
cv[2] = v.width;
cv[3] = v.height;
gl.uniform4f(ud["`+t+`"].location, v.x, v.y, v.width, v.height)
}`},codeUbo:function(t){return`
v = uv.`+t+`;
data[offset] = v.x;
data[offset+1] = v.y;
data[offset+2] = v.width;
data[offset+3] = v.height;
`}},{test:function(t){return t.type==="vec4"&&t.size===1},code:function(t){return`
cv = ud["`+t+`"].value;
v = uv["`+t+`"];
if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4f(ud["`+t+`"].location, v[0], v[1], v[2], v[3])
}`}}],_c={float:`
if (cv !== v)
{
cu.value = v;
gl.uniform1f(location, v);
}`,vec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2f(location, v[0], v[1])
}`,vec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3f(location, v[0], v[1], v[2])
}`,vec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
}`,int:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,ivec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(location, v[0], v[1]);
}`,ivec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(location, v[0], v[1], v[2]);
}`,ivec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
}`,uint:`
if (cv !== v)
{
cu.value = v;
gl.uniform1ui(location, v);
}`,uvec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2ui(location, v[0], v[1]);
}`,uvec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3ui(location, v[0], v[1], v[2]);
}`,uvec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
}`,bool:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,bvec2:`
if (cv[0] != v[0] || cv[1] != v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(location, v[0], v[1]);
}`,bvec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(location, v[0], v[1], v[2]);
}`,bvec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
}`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},mc={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function yc(t,r){var e,i=[`
var v = null;
var cv = null;
var cu = null;
var t = 0;
var gl = renderer.gl;
`];for(var n in t.uniforms){var a=r[n];if(!a){!((e=t.uniforms[n])===null||e===void 0)&&e.group&&(t.uniforms[n].ubo?i.push(`
renderer.shader.syncUniformBufferGroup(uv.`+n+", '"+n+`');
`):i.push(`
renderer.shader.syncUniformGroup(uv.`+n+`, syncData);
`));continue}for(var s=t.uniforms[n],o=!1,h=0;h<Ee.length;h++)if(Ee[h].test(a,s)){i.push(Ee[h].code(n,s)),o=!0;break}if(!o){var u=a.size===1?_c:mc,l=u[a.type].replace("location",'ud["'+n+'"].location');i.push(`
cu = ud["`+n+`"];
cv = cu.value;
v = uv["`+n+`"];
`+l+";")}}return new Function("ud","uv","renderer","syncData",i.join(`
`))}var gc=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
`);function Tc(t){for(var r="",e=0;e<t;++e)e>0&&(r+=`
else `),e<t-1&&(r+="if(test == "+e+".0){}");return r}function xc(t,r){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var e=r.createShader(r.FRAGMENT_SHADER);;){var i=gc.replace(/%forloop%/gi,Tc(t));if(r.shaderSource(e,i),r.compileShader(e),!r.getShaderParameter(e,r.COMPILE_STATUS))t=t/2|0;else break}return t}var Oe;function bc(){if(typeof Oe=="boolean")return Oe;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");Oe=t({a:"b"},"a","b")===!0}catch{Oe=!1}return Oe}var Ic=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void){
gl_FragColor *= texture2D(uSampler, vTextureCoord);
}`,Ec=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void){
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
}
`,Rc=0,lr={},tr=function(){function t(r,e,i){i===void 0&&(i="pixi-shader"),this.id=Rc++,this.vertexSrc=r||t.defaultVertexSrc,this.fragmentSrc=e||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),lr[i]?(lr[i]++,i+="-"+lr[i]):lr[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
`+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
`+this.fragmentSrc,this.vertexSrc=Ta(this.vertexSrc,N.PRECISION_VERTEX,Et.HIGH),this.fragmentSrc=Ta(this.fragmentSrc,N.PRECISION_FRAGMENT,pc())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return Ec},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return Ic},enumerable:!1,configurable:!0}),t.from=function(r,e,i){var n=r+e,a=ca[n];return a||(ca[n]=a=new t(r,e,i)),a},t}(),Wt=function(){function t(r,e){this.uniformBindCount=0,this.program=r,e?e instanceof se?this.uniformGroup=e:this.uniformGroup=new se(e):this.uniformGroup=new se({})}return t.prototype.checkUniformExists=function(r,e){if(e.uniforms[r])return!0;for(var i in e.uniforms){var n=e.uniforms[i];if(n.group&&this.checkUniformExists(r,n))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(r,e,i){var n=tr.from(r,e);return new t(n,i)},t}(),Wr=0,Yr=1,$r=2,qr=3,Kr=4,Zr=5,ue=function(){function t(){this.data=0,this.blendMode=P.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(this.data&1<<Wr)},set:function(r){!!(this.data&1<<Wr)!==r&&(this.data^=1<<Wr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(this.data&1<<Yr)},set:function(r){!!(this.data&1<<Yr)!==r&&(this.data^=1<<Yr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(this.data&1<<$r)},set:function(r){!!(this.data&1<<$r)!==r&&(this.data^=1<<$r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(this.data&1<<qr)},set:function(r){!!(this.data&1<<qr)!==r&&(this.data^=1<<qr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(this.data&1<<Zr)},set:function(r){!!(this.data&1<<Zr)!==r&&(this.data^=1<<Zr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<Kr)},set:function(r){!!(this.data&1<<Kr)!==r&&(this.data^=1<<Kr)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(r){this.blend=r!==P.NONE,this._blendMode=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(r){this.offsets=!!r,this._polygonOffset=r},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},t.for2d=function(){var r=new t;return r.depthTest=!1,r.blend=!0,r},t}(),Cc=`attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
vec2 filterTextureCoord( void )
{
return aVertexPosition * (outputFrame.zw * inputSize.zw);
}
void main(void)
{
gl_Position = filterVertexPosition();
vTextureCoord = filterTextureCoord();
}
`,wc=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void){
gl_FragColor = texture2D(uSampler, vTextureCoord);
}
`,$t=function(t){$(r,t);function r(e,i,n){var a=this,s=tr.from(e||r.defaultVertexSrc,i||r.defaultFragmentSrc);return a=t.call(this,s,n)||this,a.padding=0,a.resolution=N.FILTER_RESOLUTION,a.multisample=N.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new ue,a}return r.prototype.apply=function(e,i,n,a,s){e.applyFilter(this,i,n,a)},Object.defineProperty(r.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultVertexSrc",{get:function(){return Cc},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return wc},enumerable:!1,configurable:!0}),r}(Wt),Pc=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 otherMatrix;
varying vec2 vMaskCoord;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
}
`,Nc=`varying vec2 vMaskCoord;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform sampler2D mask;
uniform float alpha;
uniform float npmAlpha;
uniform vec4 maskClamp;
void main(void)
{
float clip = step(3.5,
step(maskClamp.x, vMaskCoord.x) +
step(maskClamp.y, vMaskCoord.y) +
step(vMaskCoord.x, maskClamp.z) +
step(vMaskCoord.y, maskClamp.w));
vec4 original = texture2D(uSampler, vTextureCoord);
vec4 masky = texture2D(mask, vMaskCoord);
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
original *= (alphaMul * masky.r * alpha * clip);
gl_FragColor = original;
}
`,ba=new Q,_n=function(){function t(r,e){this._texture=r,this.mapCoord=new Q,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e=="undefined"?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(r){this._texture=r,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(r,e){e===void 0&&(e=r);for(var i=this.mapCoord,n=0;n<r.length;n+=2){var a=r[n],s=r[n+1];e[n]=a*i.a+s*i.c+i.tx,e[n+1]=a*i.b+s*i.d+i.ty}return e},t.prototype.update=function(r){var e=this._texture;if(!e||!e.valid||!r&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=e.orig,a=e.trim;a&&(ba.set(n.width/a.width,0,0,n.height/a.height,-a.x/a.width,-a.y/a.height),this.mapCoord.append(ba));var s=e.baseTexture,o=this.uClampFrame,h=this.clampMargin/s.resolution,u=this.clampOffset;return o[0]=(e._frame.x+h+u)/s.width,o[1]=(e._frame.y+h+u)/s.height,o[2]=(e._frame.x+e._frame.width-h+u)/s.width,o[3]=(e._frame.y+e._frame.height-h+u)/s.height,this.uClampOffset[0]=u/s.realWidth,this.uClampOffset[1]=u/s.realHeight,this.isSimple=e._frame.width===s.width&&e._frame.height===s.height&&e.rotate===0,!0},t}(),Ac=function(t){$(r,t);function r(e,i,n){var a=this,s=null;return typeof e!="string"&&i===void 0&&n===void 0&&(s=e,e=void 0,i=void 0,n=void 0),a=t.call(this,e||Pc,i||Nc,n)||this,a.maskSprite=s,a.maskMatrix=new Q,a}return Object.defineProperty(r.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),r.prototype.apply=function(e,i,n,a){var s=this._maskSprite,o=s._texture;!o.valid||(o.uvMatrix||(o.uvMatrix=new _n(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,e.applyFilter(this,i,n,a))},r}($t),Uc=function(){function t(r){this.renderer=r,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(r){this.maskStack=r,this.renderer.scissor.setMaskStack(r),this.renderer.stencil.setMaskStack(r)},t.prototype.push=function(r,e){var i=e;if(!i.isMaskData){var n=this.maskDataPool.pop()||new fc;n.pooled=!0,n.maskObject=e,i=n}var a=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(a),i.autoDetect&&this.detect(i),i._target=r,i.type!==st.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case st.SCISSOR:this.renderer.scissor.push(i);break;case st.STENCIL:this.renderer.stencil.push(i);break;case st.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break}i.type===st.SPRITE&&this.maskStack.push(i)},t.prototype.pop=function(r){var e=this.maskStack.pop();if(!(!e||e._target!==r)){if(e.enabled)switch(e.type){case st.SCISSOR:this.renderer.scissor.pop();break;case st.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case st.SPRITE:this.popSpriteMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){var i=this.maskStack[this.maskStack.length-1];i.type===st.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},t.prototype.detect=function(r){var e=r.maskObject;e.isSprite?r.type=st.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(r)?r.type=st.SCISSOR:r.type=st.STENCIL},t.prototype.pushSpriteMask=function(r){var e,i,n=r.maskObject,a=r._target,s=r._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex],s||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new Ac]));var o=this.renderer,h=o.renderTexture,u,l;if(h.current){var c=h.current;u=r.resolution||c.resolution,l=(e=r.multisample)!==null&&e!==void 0?e:c.multisample}else u=r.resolution||o.resolution,l=(i=r.multisample)!==null&&i!==void 0?i:o.multisample;s[0].resolution=u,s[0].multisample=l,s[0].maskSprite=n;var f=a.filterArea;a.filterArea=n.getBounds(!0),o.filter.push(a,s),a.filterArea=f,r._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(r){this.renderer.filter.pop(),r._filters?r._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.destroy=function(){this.renderer=null},t}(),uh=function(){function t(r){this.renderer=r,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(r){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=r;var n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),Ia=new Q,Oc=function(t){$(r,t);function r(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.SCISSOR_TEST,i}return r.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},r.prototype.calcScissorRect=function(e){if(!e._scissorRectLocal){var i=e._scissorRect,n=e.maskObject,a=this.renderer,s=a.renderTexture;n.renderable=!0;var o=n.getBounds();this.roundFrameToPixels(o,s.current?s.current.resolution:a.resolution,s.sourceFrame,s.destinationFrame,a.projection.transform),n.renderable=!1,i&&o.fit(i),e._scissorRectLocal=o}},r.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,a=e.c,s=e.d;return(Math.abs(n)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(s)>1e-4)},r.prototype.testScissor=function(e){var i=e.maskObject;if(!i.isFastRect||!i.isFastRect()||r.isMatrixRotated(i.worldTransform)||r.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},r.prototype.roundFrameToPixels=function(e,i,n,a,s){r.isMatrixRotated(s)||(s=s?Ia.copyFrom(s):Ia.identity(),s.translate(-n.x,-n.y).scale(a.width/n.width,a.height/n.height).translate(a.x,a.y),this.renderer.filter.transformAABB(s,e),e.fit(a),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))},r.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var i=this.renderer.gl;e._scissorRect||i.enable(i.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},r.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},r.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=e.y:i=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,i,e.width,e.height)},r}(uh),Sc=function(t){$(r,t);function r(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.STENCIL_TEST,i}return r.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},r.prototype.push=function(e){var i=e.maskObject,n=this.renderer.gl,a=e._stencilCounter;a===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,a,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,this._useCurrent()},r.prototype.pop=function(e){var i=this.renderer.gl;this.getStackLength()===0?i.disable(i.STENCIL_TEST):(i.colorMask(!1,!1,!1,!1),i.stencilOp(i.KEEP,i.KEEP,i.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},r.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},r}(uh),Lc=function(){function t(r){this.renderer=r,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Q,this.transform=null}return t.prototype.update=function(r,e,i,n){this.destinationFrame=r||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||r,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(r,e,i,n){var a=this.projectionMatrix,s=n?-1:1;a.identity(),a.a=1/e.width*2,a.d=s*(1/e.height*2),a.tx=-1-e.x*a.a,a.ty=-s-e.y*a.d},t.prototype.setTransform=function(r){},t.prototype.destroy=function(){this.renderer=null},t}(),Zt=new M,Se=new M,Fc=function(){function t(r){this.renderer=r,this.clearColor=r._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new M,this.destinationFrame=new M,this.viewportFrame=new M}return t.prototype.bind=function(r,e,i){r===void 0&&(r=null);var n=this.renderer;this.current=r;var a,s,o;r?(a=r.baseTexture,o=a.resolution,e||(Zt.width=r.frame.width,Zt.height=r.frame.height,e=Zt),i||(Se.x=r.frame.x,Se.y=r.frame.y,Se.width=e.width,Se.height=e.height,i=Se),s=a.framebuffer):(o=n.resolution,e||(Zt.width=n.screen.width,Zt.height=n.screen.height,e=Zt),i||(i=Zt,i.width=e.width,i.height=e.height));var h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,r||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(s,h),this.renderer.projection.update(i,e,o,!s),r?this.renderer.mask.setMaskStack(a.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},t.prototype.clear=function(r,e){this.current?r=r||this.current.baseTexture.clearColor:r=r||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,a=i.width!==n.width||i.height!==n.height;if(a){var s=this.viewportFrame,o=s.x,h=s.y,u=s.width,l=s.height;o=Math.round(o),h=Math.round(h),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,h,u,l)}this.renderer.framebuffer.clear(r[0],r[1],r[2],r[3],e),a&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function Gc(t,r,e,i,n){e.buffer.update(n)}var Bc={float:`
data[offset] = v;
`,vec2:`
data[offset] = v[0];
data[offset+1] = v[1];
`,vec3:`
data[offset] = v[0];
data[offset+1] = v[1];
data[offset+2] = v[2];
`,vec4:`
data[offset] = v[0];
data[offset+1] = v[1];
data[offset+2] = v[2];
data[offset+3] = v[3];
`,mat2:`
data[offset] = v[0];
data[offset+1] = v[1];
data[offset+4] = v[2];
data[offset+5] = v[3];
`,mat3:`
data[offset] = v[0];
data[offset+1] = v[1];
data[offset+2] = v[2];
data[offset + 4] = v[3];
data[offset + 5] = v[4];
data[offset + 6] = v[5];
data[offset + 8] = v[6];
data[offset + 9] = v[7];
data[offset + 10] = v[8];
`,mat4:`
for(var i = 0; i < 16; i++)
{
data[offset + i] = v[i];
}
`},lh={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Mc(t){for(var r=t.map(function(h){return{data:h,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,a=0;a<r.length;a++){var s=r[a];if(e=lh[s.data.type],s.data.size>1&&(e=Math.max(e,16)*s.data.size),s.dataLen=e,i%e!==0&&i<16){var o=i%e%16;i+=o,n+=o}i+e>16?(n=Math.ceil(n/16)*16,s.offset=n,n+=e,i=e):(s.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:r,size:n}}function Xc(t,r){var e=[];for(var i in t)r[i]&&e.push(r[i]);return e.sort(function(n,a){return n.index-a.index}),e}function kc(t,r){if(!t.autoManage)return{size:0,syncFunc:Gc};for(var e=Xc(t.uniforms,r),i=Mc(e),n=i.uboElements,a=i.size,s=[`
var v = null;
var v2 = null;
var cv = null;
var t = 0;
var gl = renderer.gl
var index = 0;
var data = buffer.data;
`],o=0;o<n.length;o++){for(var h=n[o],u=t.uniforms[h.data.name],l=h.data.name,c=!1,f=0;f<Ee.length;f++){var d=Ee[f];if(d.codeUbo&&d.test(h.data,u)){s.push("offset = "+h.offset/4+";",Ee[f].codeUbo(h.data.name,u)),c=!0;break}}if(!c)if(h.data.size>1){var p=oh(h.data.type),v=Math.max(lh[h.data.type]/16,1),_=p/v,m=(4-_%4)%4;s.push(`
cv = ud.`+l+`.value;
v = uv.`+l+`;
offset = `+h.offset/4+`;
t = 0;
for(var i=0; i < `+h.data.size*v+`; i++)
{
for(var j = 0; j < `+_+`; j++)
{
data[offset++] = v[t++];
}
offset += `+m+`;
}
`)}else{var T=Bc[h.data.type];s.push(`
cv = ud.`+l+`.value;
v = uv.`+l+`;
offset = `+h.offset/4+`;
`+T+`;
`)}}return s.push(`
renderer.buffer.update(buffer);
`),{size:a,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
`))}}var Hc=function(){function t(r,e){this.program=r,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function Dc(t,r){for(var e={},i=r.getProgramParameter(t,r.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var a=r.getActiveAttrib(t,n);if(a.name.indexOf("gl_")!==0){var s=hh(r,a.type),o={type:s,name:a.name,size:oh(s),location:r.getAttribLocation(t,a.name)};e[a.name]=o}}return e}function Vc(t,r){for(var e={},i=r.getProgramParameter(t,r.ACTIVE_UNIFORMS),n=0;n<i;n++){var a=r.getActiveUniform(t,n),s=a.name.replace(/\[.*?\]$/,""),o=!!a.name.match(/\[.*?\]$/),h=hh(r,a.type);e[s]={name:s,index:n,type:h,size:a.size,isArray:o,value:ah(h,a.size)}}return e}function jc(t,r){var e=ya(t,t.VERTEX_SHADER,r.vertexSrc),i=ya(t,t.FRAGMENT_SHADER,r.fragmentSrc),n=t.createProgram();if(t.attachShader(n,e),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||cc(t,n,e,i),r.attributeData=Dc(n,t),r.uniformData=Vc(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(r.vertexSrc)){var a=Object.keys(r.attributeData);a.sort(function(l,c){return l>c?1:-1});for(var s=0;s<a.length;s++)r.attributeData[a[s]].location=s,t.bindAttribLocation(n,s,a[s]);t.linkProgram(n)}t.deleteShader(e),t.deleteShader(i);var o={};for(var s in r.uniformData){var h=r.uniformData[s];o[s]={location:t.getUniformLocation(n,s),value:ah(h.type,h.size)}}var u=new Hc(n,o);return u}var zc=0,fr={textureCount:0,uboCount:0},Wc=function(){function t(r){this.destroyed=!1,this.renderer=r,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=zc++}return t.prototype.systemCheck=function(){if(!bc())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(r){this.gl=r,this.reset()},t.prototype.bind=function(r,e){r.uniforms.globals=this.renderer.globalUniforms;var i=r.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(r);return this.shader=r,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(fr.textureCount=0,fr.uboCount=0,this.syncUniformGroup(r.uniformGroup,fr)),n},t.prototype.setUniforms=function(r){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,r,this.renderer)},t.prototype.syncUniformGroup=function(r,e){var i=this.getGlProgram();(!r.static||r.dirtyId!==i.uniformDirtyGroups[r.id])&&(i.uniformDirtyGroups[r.id]=r.dirtyId,this.syncUniforms(r,i,e))},t.prototype.syncUniforms=function(r,e,i){var n=r.syncUniforms[this.shader.program.id]||this.createSyncGroups(r);n(e.uniformData,r.uniforms,this.renderer,i)},t.prototype.createSyncGroups=function(r){var e=this.getSignature(r,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=yc(r,this.shader.program.uniformData)),r.syncUniforms[this.shader.program.id]=this.cache[e],r.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(r,e){var i=this.getGlProgram();if(!r.static||r.dirtyId!==0||!i.uniformGroups[r.id]){r.dirtyId=0;var n=i.uniformGroups[r.id]||this.createSyncBufferGroup(r,i,e);r.buffer.update(),n(i.uniformData,r.uniforms,this.renderer,fr,r.buffer)}this.renderer.buffer.bindBufferBase(r.buffer,i.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(r,e,i){var n=this.renderer.gl;this.renderer.buffer.bind(r.buffer);var a=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,a,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(r,this.shader.program.uniformData,"ubo"),o=this._uboCache[s];if(o||(o=this._uboCache[s]=kc(r,this.shader.program.uniformData)),r.autoManage){var h=new Float32Array(o.size/4);r.buffer.update(h)}return e.uniformGroups[r.id]=o.syncFunc,e.uniformGroups[r.id]},t.prototype.getSignature=function(r,e,i){var n=r.uniforms,a=[i+"-"];for(var s in n)a.push(s),e[s]&&a.push(e[s].type);return a.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(r){var e=this.gl,i=r.program,n=jc(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}();function Yc(t,r){return r===void 0&&(r=[]),r[P.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.ADD]=[t.ONE,t.ONE],r[P.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.NONE]=[0,0],r[P.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],r[P.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],r[P.SRC_IN]=[t.DST_ALPHA,t.ZERO],r[P.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],r[P.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],r[P.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],r[P.DST_IN]=[t.ZERO,t.SRC_ALPHA],r[P.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],r[P.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],r[P.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],r[P.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],r}var $c=0,qc=1,Kc=2,Zc=3,Jc=4,Qc=5,td=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=P.NONE,this._blendEq=!1,this.map=[],this.map[$c]=this.setBlend,this.map[qc]=this.setOffset,this.map[Kc]=this.setCullFace,this.map[Zc]=this.setDepthTest,this.map[Jc]=this.setFrontFace,this.map[Qc]=this.setDepthMask,this.checks=[],this.defaultState=new ue,this.defaultState.blend=!0}return t.prototype.contextChange=function(r){this.gl=r,this.blendModes=Yc(r),this.set(this.defaultState),this.reset()},t.prototype.set=function(r){if(r=r||this.defaultState,this.stateId!==r.data){for(var e=this.stateId^r.data,i=0;e;)e&1&&this.map[i].call(this,!!(r.data&1<<i)),e=e>>1,i++;this.stateId=r.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,r)},t.prototype.forceState=function(r){r=r||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(r.data&1<<e));for(var e=0;e<this.checks.length;e++)this.checks[e](this,r);this.stateId=r.data},t.prototype.setBlend=function(r){this.updateCheck(t.checkBlendMode,r),this.gl[r?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(r){this.updateCheck(t.checkPolygonOffset,r),this.gl[r?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(r){this.gl[r?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(r){this.gl.depthMask(r)},t.prototype.setCullFace=function(r){this.gl[r?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(r){this.gl.frontFace(this.gl[r?"CW":"CCW"])},t.prototype.setBlendMode=function(r){if(r!==this.blendMode){this.blendMode=r;var e=this.blendModes[r],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},t.prototype.setPolygonOffset=function(r,e){this.gl.polygonOffset(r,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(r,e){var i=this.checks.indexOf(r);e&&i===-1?this.checks.push(r):!e&&i!==-1&&this.checks.splice(i,1)},t.checkBlendMode=function(r,e){r.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(r,e){r.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),ed=function(){function t(r){this.renderer=r,this.count=0,this.checkCount=0,this.maxIdle=N.GC_MAX_IDLE,this.checkCountMax=N.GC_MAX_CHECK_COUNT,this.mode=N.GC_MODE}return t.prototype.postrender=function(){!this.renderer.renderingToScreen||(this.count++,this.mode!==wi.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var r=this.renderer.texture,e=r.managedTextures,i=!1,n=0;n<e.length;n++){var a=e[n];!a.framebuffer&&this.count-a.touched>this.maxIdle&&(r.destroyTexture(a,!0),e[n]=null,i=!0)}if(i){for(var s=0,n=0;n<e.length;n++)e[n]!==null&&(e[s++]=e[n]);e.length=s}},t.prototype.unload=function(r){var e=this.renderer.texture,i=r._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(var n=r.children.length-1;n>=0;n--)this.unload(r.children[n])},t.prototype.destroy=function(){this.renderer=null},t}();function rd(t){var r,e,i,n,a,s,o,h,u,l,c,f,d,p,v,_,m,T,x,E,g,y,b;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?b=(r={},r[O.UNSIGNED_BYTE]=(e={},e[R.RGBA]=t.RGBA8,e[R.RGB]=t.RGB8,e[R.RG]=t.RG8,e[R.RED]=t.R8,e[R.RGBA_INTEGER]=t.RGBA8UI,e[R.RGB_INTEGER]=t.RGB8UI,e[R.RG_INTEGER]=t.RG8UI,e[R.RED_INTEGER]=t.R8UI,e[R.ALPHA]=t.ALPHA,e[R.LUMINANCE]=t.LUMINANCE,e[R.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,e),r[O.BYTE]=(i={},i[R.RGBA]=t.RGBA8_SNORM,i[R.RGB]=t.RGB8_SNORM,i[R.RG]=t.RG8_SNORM,i[R.RED]=t.R8_SNORM,i[R.RGBA_INTEGER]=t.RGBA8I,i[R.RGB_INTEGER]=t.RGB8I,i[R.RG_INTEGER]=t.RG8I,i[R.RED_INTEGER]=t.R8I,i),r[O.UNSIGNED_SHORT]=(n={},n[R.RGBA_INTEGER]=t.RGBA16UI,n[R.RGB_INTEGER]=t.RGB16UI,n[R.RG_INTEGER]=t.RG16UI,n[R.RED_INTEGER]=t.R16UI,n[R.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,n),r[O.SHORT]=(a={},a[R.RGBA_INTEGER]=t.RGBA16I,a[R.RGB_INTEGER]=t.RGB16I,a[R.RG_INTEGER]=t.RG16I,a[R.RED_INTEGER]=t.R16I,a),r[O.UNSIGNED_INT]=(s={},s[R.RGBA_INTEGER]=t.RGBA32UI,s[R.RGB_INTEGER]=t.RGB32UI,s[R.RG_INTEGER]=t.RG32UI,s[R.RED_INTEGER]=t.R32UI,s[R.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,s),r[O.INT]=(o={},o[R.RGBA_INTEGER]=t.RGBA32I,o[R.RGB_INTEGER]=t.RGB32I,o[R.RG_INTEGER]=t.RG32I,o[R.RED_INTEGER]=t.R32I,o),r[O.FLOAT]=(h={},h[R.RGBA]=t.RGBA32F,h[R.RGB]=t.RGB32F,h[R.RG]=t.RG32F,h[R.RED]=t.R32F,h[R.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,h),r[O.HALF_FLOAT]=(u={},u[R.RGBA]=t.RGBA16F,u[R.RGB]=t.RGB16F,u[R.RG]=t.RG16F,u[R.RED]=t.R16F,u),r[O.UNSIGNED_SHORT_5_6_5]=(l={},l[R.RGB]=t.RGB565,l),r[O.UNSIGNED_SHORT_4_4_4_4]=(c={},c[R.RGBA]=t.RGBA4,c),r[O.UNSIGNED_SHORT_5_5_5_1]=(f={},f[R.RGBA]=t.RGB5_A1,f),r[O.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[R.RGBA]=t.RGB10_A2,d[R.RGBA_INTEGER]=t.RGB10_A2UI,d),r[O.UNSIGNED_INT_10F_11F_11F_REV]=(p={},p[R.RGB]=t.R11F_G11F_B10F,p),r[O.UNSIGNED_INT_5_9_9_9_REV]=(v={},v[R.RGB]=t.RGB9_E5,v),r[O.UNSIGNED_INT_24_8]=(_={},_[R.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,_),r[O.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[R.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,m),r):b=(T={},T[O.UNSIGNED_BYTE]=(x={},x[R.RGBA]=t.RGBA,x[R.RGB]=t.RGB,x[R.ALPHA]=t.ALPHA,x[R.LUMINANCE]=t.LUMINANCE,x[R.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,x),T[O.UNSIGNED_SHORT_5_6_5]=(E={},E[R.RGB]=t.RGB,E),T[O.UNSIGNED_SHORT_4_4_4_4]=(g={},g[R.RGBA]=t.RGBA,g),T[O.UNSIGNED_SHORT_5_5_5_1]=(y={},y[R.RGBA]=t.RGBA,y),T),b}var Jr=function(){function t(r){this.texture=r,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=O.UNSIGNED_BYTE,this.internalFormat=R.RGBA,this.samplerType=0}return t}(),id=function(){function t(r){this.renderer=r,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new H,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var r=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=rd(r);var e=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new Jr(r.createTexture());r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[r.TEXTURE_2D]=n,this.emptyTextures[r.TEXTURE_CUBE_MAP]=new Jr(r.createTexture()),r.bindTexture(r.TEXTURE_CUBE_MAP,this.emptyTextures[r.TEXTURE_CUBE_MAP].texture);for(var i=0;i<6;i++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,null);r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.LINEAR);for(var i=0;i<this.boundTextures.length;i++)this.bind(null,i)},t.prototype.bind=function(r,e){e===void 0&&(e=0);var i=this.gl;if(r=r==null?void 0:r.castToBaseTexture(),r&&r.valid&&!r.parentTextureArray){r.touched=this.renderer.textureGC.count;var n=r._glTextures[this.CONTEXT_UID]||this.initTexture(r);this.boundTextures[e]!==r&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(r.target,n.texture)),n.dirtyId!==r.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(r)),this.boundTextures[e]=r}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var r=0;r<this.boundTextures.length;r++)this.boundTextures[r]=this.unknownTexture},t.prototype.unbind=function(r){var e=this,i=e.gl,n=e.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var a=0;a<n.length;a++)n[a]===this.unknownTexture&&this.bind(null,a)}for(var a=0;a<n.length;a++)n[a]===r&&(this.currentLocation!==a&&(i.activeTexture(i.TEXTURE0+a),this.currentLocation=a),i.bindTexture(r.target,this.emptyTextures[r.target].texture),n[a]=null)},t.prototype.ensureSamplerType=function(r){var e=this,i=e.boundTextures,n=e.hasIntegerTextures,a=e.CONTEXT_UID;if(!!n)for(var s=r-1;s>=0;--s){var o=i[s];if(o){var h=o._glTextures[a];h.samplerType!==Nr.FLOAT&&this.renderer.texture.unbind(o)}}},t.prototype.initTexture=function(r){var e=new Jr(this.gl.createTexture());return e.dirtyId=-1,r._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(r),r.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(r,e){var i,n;e.internalFormat=(n=(i=this.internalFormats[r.type])===null||i===void 0?void 0:i[r.format])!==null&&n!==void 0?n:r.format,this.webGLVersion===2&&r.type===O.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=r.type},t.prototype.updateTexture=function(r){var e=r._glTextures[this.CONTEXT_UID];if(!!e){var i=this.renderer;if(this.initTextureType(r,e),r.resource&&r.resource.upload(i,r,e))e.samplerType!==Nr.FLOAT&&(this.hasIntegerTextures=!0);else{var n=r.realWidth,a=r.realHeight,s=i.gl;(e.width!==n||e.height!==a||e.dirtyId<0)&&(e.width=n,e.height=a,s.texImage2D(r.target,0,e.internalFormat,n,a,0,r.format,e.type,null))}r.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(r),e.dirtyId=r.dirtyId}},t.prototype.destroyTexture=function(r,e){var i=this.gl;if(r=r.castToBaseTexture(),r._glTextures[this.CONTEXT_UID]&&(this.unbind(r),i.deleteTexture(r._glTextures[this.CONTEXT_UID].texture),r.off("dispose",this.destroyTexture,this),delete r._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(r);n!==-1&&Gt(this.managedTextures,n,1)}},t.prototype.updateTextureStyle=function(r){var e=r._glTextures[this.CONTEXT_UID];!e||((r.mipmap===Xt.POW2||this.webGLVersion!==2)&&!r.isPowerOfTwo?e.mipmap=!1:e.mipmap=r.mipmap>=1,this.webGLVersion!==2&&!r.isPowerOfTwo?e.wrapMode=Ft.CLAMP:e.wrapMode=r.wrapMode,r.resource&&r.resource.style(this.renderer,r,e)||this.setStyle(r,e),e.dirtyStyleId=r.dirtyStyleId)},t.prototype.setStyle=function(r,e){var i=this.gl;if(e.mipmap&&r.mipmap!==Xt.ON_MANUAL&&i.generateMipmap(r.target),i.texParameteri(r.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(r.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(r.target,i.TEXTURE_MIN_FILTER,r.scaleMode===Lt.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&r.anisotropicLevel>0&&r.scaleMode===Lt.LINEAR){var a=Math.min(r.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(r.target,n.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else i.texParameteri(r.target,i.TEXTURE_MIN_FILTER,r.scaleMode===Lt.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(r.target,i.TEXTURE_MAG_FILTER,r.scaleMode===Lt.LINEAR?i.LINEAR:i.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),Qr=new Q,nd=function(t){$(r,t);function r(e,i){e===void 0&&(e=ke.UNKNOWN);var n=t.call(this)||this;return i=Object.assign({},N.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new M(0,0,i.width,i.height),n.view=i.view||document.createElement("canvas"),n.resolution=i.resolution||N.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(He("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return r.prototype.initPlugins=function(e){for(var i in e)this.plugins[i]=new e[i](this)},Object.defineProperty(r.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(e,i){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,a=this.view.height/this.resolution;this.screen.width=n,this.screen.height=a,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=a+"px"),this.emit("resize",n,a)},r.prototype.generateTexture=function(e,i,n,a){i===void 0&&(i={}),typeof i=="number"&&(He("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:a});var s=i.region,o=Hf(i,["region"]);a=s||e.getLocalBounds(null,!0),a.width===0&&(a.width=1),a.height===0&&(a.height=1);var h=he.create(Ui({width:a.width,height:a.height},o));return Qr.tx=-a.x,Qr.ty=-a.y,this.render(e,{renderTexture:h,clear:!1,transform:Qr,skipUpdateTransform:!!e.parent}),h},r.prototype.destroy=function(e){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=ke.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(r.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=Vo(e),Re(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),r}(we),ad=function(){function t(r){this.buffer=r||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return t}(),sd=function(){function t(r){this.renderer=r,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(r){var e=this,i=e.gl,n=e.CONTEXT_UID,a=r._glBuffers[n]||this.createGLBuffer(r);i.bindBuffer(r.type,a.buffer)},t.prototype.bindBufferBase=function(r,e){var i=this,n=i.gl,a=i.CONTEXT_UID;if(this.boundBufferBases[e]!==r){var s=r._glBuffers[a]||this.createGLBuffer(r);this.boundBufferBases[e]=r,n.bindBufferBase(n.UNIFORM_BUFFER,e,s.buffer)}},t.prototype.bindBufferRange=function(r,e,i){var n=this,a=n.gl,s=n.CONTEXT_UID;i=i||0;var o=r._glBuffers[s]||this.createGLBuffer(r);a.bindBufferRange(a.UNIFORM_BUFFER,e||0,o.buffer,i*256,256)},t.prototype.update=function(r){var e=this,i=e.gl,n=e.CONTEXT_UID,a=r._glBuffers[n];if(r._updateID!==a.updateID)if(a.updateID=r._updateID,i.bindBuffer(r.type,a.buffer),a.byteLength>=r.data.byteLength)i.bufferSubData(r.type,0,r.data);else{var s=r.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;a.byteLength=r.data.byteLength,i.bufferData(r.type,r.data,s)}},t.prototype.dispose=function(r,e){if(!!this.managedBuffers[r.id]){delete this.managedBuffers[r.id];var i=r._glBuffers[this.CONTEXT_UID],n=this.gl;r.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete r._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(r){for(var e=Object.keys(this.managedBuffers),i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],r)},t.prototype.createGLBuffer=function(r){var e=this,i=e.CONTEXT_UID,n=e.gl;return r._glBuffers[i]=new ad(n.createBuffer()),this.managedBuffers[r.id]=r,r.disposeRunner.add(this),r._glBuffers[i]},t}(),od=function(t){$(r,t);function r(e){var i=t.call(this,ke.WEBGL,e)||this;return e=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new ot("destroy"),contextChange:new ot("contextChange"),reset:new ot("reset"),update:new ot("update"),postrender:new ot("postrender"),prerender:new ot("prerender"),resize:new ot("resize")},i.runners.contextChange.add(i),i.globalUniforms=new se({projectionMatrix:new Q},!0),i.addSystem(Uc,"mask").addSystem(sc,"context").addSystem(td,"state").addSystem(Wc,"shader").addSystem(id,"texture").addSystem(sd,"buffer").addSystem(lc,"geometry").addSystem(uc,"framebuffer").addSystem(Oc,"scissor").addSystem(Sc,"stencil").addSystem(Lc,"projection").addSystem(ed,"textureGC").addSystem(nc,"filter").addSystem(Fc,"renderTexture").addSystem(ac,"batch"),i.initPlugins(r.__plugins),i.multisample=void 0,e.context?i.context.initFromContext(e.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:e.antialias,premultipliedAlpha:i.useContextAlpha&&i.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,Hh(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return r.create=function(e){if(Dh())return new r(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},r.prototype.contextChange=function(){var e=this.gl,i;if(this.context.webGLVersion===1){var n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),i=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{var n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),i=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}i>=et.HIGH?this.multisample=et.HIGH:i>=et.MEDIUM?this.multisample=et.MEDIUM:i>=et.LOW?this.multisample=et.LOW:this.multisample=et.NONE},r.prototype.addSystem=function(e,i){var n=new e(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var a in this.runners)this.runners[a].add(n);return this},r.prototype.render=function(e,i){var n,a,s,o;if(i&&(i instanceof he?(He("6.0.0","Renderer#render arguments changed, use options instead."),n=i,a=arguments[2],s=arguments[3],o=arguments[4]):(n=i.renderTexture,a=i.clear,s=i.transform,o=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(n||(this._lastObjectRendered=e),!o){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(a!==void 0?a:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},r.prototype.generateTexture=function(e,i,n,a){i===void 0&&(i={});var s=t.prototype.generateTexture.call(this,e,i,n,a);return this.framebuffer.blit(),s},r.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},r.prototype.reset=function(){return this.runners.reset.emit(),this},r.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},r.prototype.destroy=function(e){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(r.prototype,"extract",{get:function(){return He("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),r.registerPlugin=function(e,i){r.__plugins=r.__plugins||{},r.__plugins[e]=i},r}(nd);function hd(t){return od.create(t)}var ud=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
}`,ld=`attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
vec2 filterTextureCoord( void )
{
return aVertexPosition * (outputFrame.zw * inputSize.zw);
}
void main(void)
{
gl_Position = filterVertexPosition();
vTextureCoord = filterTextureCoord();
}
`,fd=ud,fh=ld,Si=function(){function t(){this.texArray=null,this.blend=0,this.type=vt.TRIANGLES,this.start=0,this.size=0,this.data=null}return t}(),Li=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var r=0;r<this.count;r++)this.elements[r]=null;this.count=0},t}(),Fi=function(){function t(r){typeof r=="number"?this.rawBinaryData=new ArrayBuffer(r):r instanceof Uint8Array?this.rawBinaryData=r.buffer:this.rawBinaryData=r,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(r){return this[r+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(r){switch(r){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(r+" isn't a valid view type")}},t}(),cd=function(t){$(r,t);function r(e){var i=t.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=ue.for2d(),i.size=N.SPRITE_BATCH_SIZE*4,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),e.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return r.prototype.contextChange=function(){var e=this.renderer.gl;N.PREFER_ENV===Mt.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),N.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=xc(this.MAX_TEXTURES,e)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var i=0;i<this._packedGeometryPoolSize;i++)this._packedGeometries[i]=new this.geometryClass;this.initFlushBuffers()},r.prototype.initFlushBuffers=function(){for(var e=r._drawCallPool,i=r._textureArrayPool,n=this.size/4,a=Math.floor(n/this.MAX_TEXTURES)+1;e.length<n;)e.push(new Si);for(;i.length<a;)i.push(new Li);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=null},r.prototype.onPrerender=function(){this._flushId=0},r.prototype.render=function(e){!e._texture.valid||(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},r.prototype.buildTexturesAndDrawCalls=function(){var e=this,i=e._bufferedTextures,n=e.MAX_TEXTURES,a=r._textureArrayPool,s=this.renderer.batch,o=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++H._globalBatch,l=0,c=a[0],f=0;s.copyBoundTextures(o,n);for(var d=0;d<this._bufferSize;++d){var p=i[d];i[d]=null,p._batchEnabled!==u&&(c.count>=n&&(s.boundArray(c,o,u,n),this.buildDrawCalls(c,f,d),f=d,c=a[++l],++u),p._batchEnabled=u,p.touched=h,c.elements[c.count++]=p)}c.count>0&&(s.boundArray(c,o,u,n),this.buildDrawCalls(c,f,this._bufferSize),++l,++u);for(var d=0;d<o.length;d++)o[d]=null;H._globalBatch=u},r.prototype.buildDrawCalls=function(e,i,n){var a=this,s=a._bufferedElements,o=a._attributeBuffer,h=a._indexBuffer,u=a.vertexSize,l=r._drawCallPool,c=this._dcIndex,f=this._aIndex,d=this._iIndex,p=l[c];p.start=this._iIndex,p.texArray=e;for(var v=i;v<n;++v){var _=s[v],m=_._texture.baseTexture,T=zo[m.alphaMode?1:0][_.blendMode];s[v]=null,i<v&&p.blend!==T&&(p.size=d-p.start,i=v,p=l[++c],p.texArray=e,p.start=d),this.packInterleavedGeometry(_,o,h,f,d),f+=_.vertexData.length/2*u,d+=_.indices.length,p.blend=T}i<n&&(p.size=d-p.start,++c),this._dcIndex=c,this._aIndex=f,this._iIndex=d},r.prototype.bindAndClearTexArray=function(e){for(var i=this.renderer.texture,n=0;n<e.count;n++)i.bind(e.elements[n],e.ids[n]),e.elements[n]=null;e.count=0},r.prototype.updateGeometry=function(){var e=this,i=e._packedGeometries,n=e._attributeBuffer,a=e._indexBuffer;N.CAN_UPLOAD_SAME_BUFFER?(i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(a),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,i[this._flushId]=new this.geometryClass),i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(a),this.renderer.geometry.bind(i[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},r.prototype.drawBatches=function(){for(var e=this._dcIndex,i=this.renderer,n=i.gl,a=i.state,s=r._drawCallPool,o=null,h=0;h<e;h++){var u=s[h],l=u.texArray,c=u.type,f=u.size,d=u.start,p=u.blend;o!==l&&(o=l,this.bindAndClearTexArray(l)),this.state.blendMode=p,a.set(this.state),n.drawElements(c,f,n.UNSIGNED_SHORT,d*2)}},r.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},r.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),N.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},r.prototype.stop=function(){this.flush()},r.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},r.prototype.getAttributeBuffer=function(e){var i=Ar(Math.ceil(e/8)),n=la(i),a=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var s=this._aBuffers[a];return s||(this._aBuffers[a]=s=new Fi(a*this.vertexSize*4)),s},r.prototype.getIndexBuffer=function(e){var i=Ar(Math.ceil(e/12)),n=la(i),a=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var s=this._iBuffers[n];return s||(this._iBuffers[n]=s=new Uint16Array(a)),s},r.prototype.packInterleavedGeometry=function(e,i,n,a,s){for(var o=i.uint32View,h=i.float32View,u=a/this.vertexSize,l=e.uvs,c=e.indices,f=e.vertexData,d=e._texture.baseTexture._batchLocation,p=Math.min(e.worldAlpha,1),v=p<1&&e._texture.baseTexture.alphaMode?pn(e._tintRGB,p):e._tintRGB+(p*255<<24),_=0;_<f.length;_+=2)h[a++]=f[_],h[a++]=f[_+1],h[a++]=l[_],h[a++]=l[_+1],o[a++]=v,h[a++]=d;for(var _=0;_<c.length;_++)n[s++]=u+c[_]},r._drawCallPool=[],r._textureArrayPool=[],r}(Br),dd=function(){function t(r,e){if(this.vertexSrc=r,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(r){if(!this.programCache[r]){for(var e=new Int32Array(r),i=0;i<r;i++)e[i]=i;this.defaultGroupCache[r]=se.from({uSamplers:e},!0);var n=this.fragTemplate;n=n.replace(/%count%/gi,""+r),n=n.replace(/%forloop%/gi,this.generateSampleSrc(r)),this.programCache[r]=new tr(this.vertexSrc,n)}var a={tint:new Float32Array([1,1,1,1]),translationMatrix:new Q,default:this.defaultGroupCache[r]};return new Wt(this.programCache[r],a)},t.prototype.generateSampleSrc=function(r){var e="";e+=`
`,e+=`
`;for(var i=0;i<r;i++)i>0&&(e+=`
else `),i<r-1&&(e+="if(vTextureId < "+i+".5)"),e+=`
{`,e+=`
color = texture2D(uSamplers[`+i+"], vTextureCoord);",e+=`
}`;return e+=`
`,e+=`
`,e},t}(),ch=function(t){$(r,t);function r(e){e===void 0&&(e=!1);var i=t.call(this)||this;return i._buffer=new it(null,e,!1),i._indexBuffer=new it(null,e,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,O.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,O.FLOAT).addAttribute("aColor",i._buffer,4,!0,O.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,O.FLOAT).addIndex(i._indexBuffer),i}return r}(Qe),Ea=`precision highp float;
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
attribute float aTextureId;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform vec4 tint;
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
void main(void){
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vTextureId = aTextureId;
vColor = aColor * tint;
}
`,Ra=`varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
uniform sampler2D uSamplers[%count%];
void main(void){
vec4 color;
%forloop%
gl_FragColor = color * vColor;
}
`,pd=function(){function t(){}return t.create=function(r){var e=Object.assign({vertex:Ea,fragment:Ra,geometryClass:ch,vertexSize:6},r),i=e.vertex,n=e.fragment,a=e.vertexSize,s=e.geometryClass;return function(o){$(h,o);function h(u){var l=o.call(this,u)||this;return l.shaderGenerator=new dd(i,n),l.geometryClass=s,l.vertexSize=a,l}return h}(cd)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return Ea},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return Ra},enumerable:!1,configurable:!0}),t}(),Kv=pd.create();/*!
* @pixi/display - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/display is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/N.SORTABLE_CHILDREN=!1;var Ve=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(r){return this.minX>this.maxX||this.minY>this.maxY?M.EMPTY:(r=r||new M(0,0,1,1),r.x=this.minX,r.y=this.minY,r.width=this.maxX-this.minX,r.height=this.maxY-this.minY,r)},t.prototype.addPoint=function(r){this.minX=Math.min(this.minX,r.x),this.maxX=Math.max(this.maxX,r.x),this.minY=Math.min(this.minY,r.y),this.maxY=Math.max(this.maxY,r.y)},t.prototype.addPointMatrix=function(r,e){var i=r.a,n=r.b,a=r.c,s=r.d,o=r.tx,h=r.ty,u=i*e.x+a*e.y+o,l=n*e.x+s*e.y+h;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},t.prototype.addQuad=function(r){var e=this.minX,i=this.minY,n=this.maxX,a=this.maxY,s=r[0],o=r[1];e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[2],o=r[3],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[4],o=r[5],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[6],o=r[7],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,this.minX=e,this.minY=i,this.maxX=n,this.maxY=a},t.prototype.addFrame=function(r,e,i,n,a){this.addFrameMatrix(r.worldTransform,e,i,n,a)},t.prototype.addFrameMatrix=function(r,e,i,n,a){var s=r.a,o=r.b,h=r.c,u=r.d,l=r.tx,c=r.ty,f=this.minX,d=this.minY,p=this.maxX,v=this.maxY,_=s*e+h*i+l,m=o*e+u*i+c;f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*n+h*i+l,m=o*n+u*i+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*e+h*a+l,m=o*e+u*a+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*n+h*a+l,m=o*n+u*a+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,this.minX=f,this.minY=d,this.maxX=p,this.maxY=v},t.prototype.addVertexData=function(r,e,i){for(var n=this.minX,a=this.minY,s=this.maxX,o=this.maxY,h=e;h<i;h+=2){var u=r[h],l=r[h+1];n=u<n?u:n,a=l<a?l:a,s=u>s?u:s,o=l>o?l:o}this.minX=n,this.minY=a,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(r,e,i,n){this.addVerticesMatrix(r.worldTransform,e,i,n)},t.prototype.addVerticesMatrix=function(r,e,i,n,a,s){a===void 0&&(a=0),s===void 0&&(s=a);for(var o=r.a,h=r.b,u=r.c,l=r.d,c=r.tx,f=r.ty,d=this.minX,p=this.minY,v=this.maxX,_=this.maxY,m=i;m<n;m+=2){var T=e[m],x=e[m+1],E=o*T+u*x+c,g=l*x+h*T+f;d=Math.min(d,E-a),v=Math.max(v,E+a),p=Math.min(p,g-s),_=Math.max(_,g+s)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=_},t.prototype.addBounds=function(r){var e=this.minX,i=this.minY,n=this.maxX,a=this.maxY;this.minX=r.minX<e?r.minX:e,this.minY=r.minY<i?r.minY:i,this.maxX=r.maxX>n?r.maxX:n,this.maxY=r.maxY>a?r.maxY:a},t.prototype.addBoundsMask=function(r,e){var i=r.minX>e.minX?r.minX:e.minX,n=r.minY>e.minY?r.minY:e.minY,a=r.maxX<e.maxX?r.maxX:e.maxX,s=r.maxY<e.maxY?r.maxY:e.maxY;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},t.prototype.addBoundsMatrix=function(r,e){this.addFrameMatrix(e,r.minX,r.minY,r.maxX,r.maxY)},t.prototype.addBoundsArea=function(r,e){var i=r.minX>e.x?r.minX:e.x,n=r.minY>e.y?r.minY:e.y,a=r.maxX<e.x+e.width?r.maxX:e.x+e.width,s=r.maxY<e.y+e.height?r.maxY:e.y+e.height;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},t.prototype.pad=function(r,e){r===void 0&&(r=0),e===void 0&&(e=r),this.isEmpty()||(this.minX-=r,this.maxX+=r,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(r,e,i,n,a,s){r-=a,e-=s,i+=a,n+=s,this.minX=this.minX<r?this.minX:r,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>n?this.maxY:n},t}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Gi=function(t,r){return Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Gi(t,r)};function mn(t,r){Gi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var tt=function(t){mn(r,t);function r(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new vn,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new Ve,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return r.mixin=function(e){for(var i=Object.keys(e),n=0;n<i.length;++n){var a=i[n];Object.defineProperty(r.prototype,a,Object.getOwnPropertyDescriptor(e,a))}},Object.defineProperty(r.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),r.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},r.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},r.prototype.getBounds=function(e,i){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new M),i=this._boundsRect),this._bounds.getRectangle(i)},r.prototype.getLocalBounds=function(e){e||(this._localBoundsRect||(this._localBoundsRect=new M),e=this._localBoundsRect),this._localBounds||(this._localBounds=new Ve);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var a=this._bounds,s=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,e);return this.parent=n,this.transform=i,this._bounds=a,this._bounds.updateID+=this._boundsID-s,o},r.prototype.toGlobal=function(e,i,n){return n===void 0&&(n=!1),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,i)},r.prototype.toLocal=function(e,i,n,a){return i&&(e=i.toGlobal(e,n,a)),a||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)},r.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},r.prototype.setTransform=function(e,i,n,a,s,o,h,u,l){return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=1),s===void 0&&(s=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=e,this.position.y=i,this.scale.x=n||1,this.scale.y=a||1,this.rotation=s,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},r.prototype.destroy=function(e){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(r.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new dh),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),r.prototype.enableTempParent=function(){var e=this.parent;return this.parent=this._tempDisplayObjectParent,e},r.prototype.disableTempParent=function(e){this.parent=e},Object.defineProperty(r.prototype,"x",{get:function(){return this.position.x},set:function(e){this.transform.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this.position.y},set:function(e){this.transform.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.transform.position},set:function(e){this.transform.position.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scale",{get:function(){return this.transform.scale},set:function(e){this.transform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(e){this.transform.pivot.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"skew",{get:function(){return this.transform.skew},set:function(e){this.transform.skew.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(e){this.transform.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"angle",{get:function(){return this.transform.rotation*qo},set:function(e){this.transform.rotation=e*Ko},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"zIndex",{get:function(){return this._zIndex},set:function(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"worldVisible",{get:function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mask",{get:function(){return this._mask},set:function(e){if(this._mask!==e){if(this._mask){var i=this._mask.maskObject||this._mask;i._maskRefCount--,i._maskRefCount===0&&(i.renderable=!0,i.isMask=!1)}if(this._mask=e,this._mask){var i=this._mask.maskObject||this._mask;i._maskRefCount===0&&(i.renderable=!1,i.isMask=!0),i._maskRefCount++}}},enumerable:!1,configurable:!0}),r}(we),dh=function(t){mn(r,t);function r(){var e=t!==null&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return r}(tt);tt.prototype.displayObjectUpdateTransform=tt.prototype.updateTransform;/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Ca;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(Ca||(Ca={}));var wa;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(wa||(wa={}));var Pa;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(Pa||(Pa={}));var Na;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(Na||(Na={}));var Aa;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Aa||(Aa={}));var Ua;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(Ua||(Ua={}));var Oa;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Oa||(Oa={}));var Sa;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(Sa||(Sa={}));var La;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(La||(La={}));var Fa;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(Fa||(Fa={}));var Ga;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ga||(Ga={}));var Ba;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(Ba||(Ba={}));var Ma;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(Ma||(Ma={}));var Xa;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(Xa||(Xa={}));var ka;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(ka||(ka={}));var Ha;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Ha||(Ha={}));var Bi;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(Bi||(Bi={}));var Da;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(Da||(Da={}));var Va;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Va||(Va={}));function vd(t,r){return t.zIndex===r.zIndex?t._lastSortedIndex-r._lastSortedIndex:t.zIndex-r.zIndex}var wt=function(t){mn(r,t);function r(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=N.SORTABLE_CHILDREN,e.sortDirty=!1,e}return r.prototype.onChildrenChange=function(e){},r.prototype.addChild=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var a=0;a<i.length;a++)this.addChild(i[a]);else{var s=i[0];s.parent&&s.parent.removeChild(s),s.parent=this,this.sortDirty=!0,s.transform._parentID=-1,this.children.push(s),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",s,this,this.children.length-1),s.emit("added",this)}return i[0]},r.prototype.addChildAt=function(e,i){if(i<0||i>this.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},r.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),a=this.getChildIndex(i);this.children[n]=i,this.children[a]=e,this.onChildrenChange(n<a?n:a)}},r.prototype.getChildIndex=function(e){var i=this.children.indexOf(e);if(i===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return i},r.prototype.setChildIndex=function(e,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Gt(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},r.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},r.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var a=0;a<i.length;a++)this.removeChild(i[a]);else{var s=i[0],o=this.children.indexOf(s);if(o===-1)return null;s.parent=null,s.transform._parentID=-1,Gt(this.children,o,1),this._boundsID++,this.onChildrenChange(o),s.emit("removed",this),this.emit("childRemoved",s,this,o)}return i[0]},r.prototype.removeChildAt=function(e){var i=this.getChildAt(e);return i.parent=null,i.transform._parentID=-1,Gt(this.children,e,1),this._boundsID++,this.onChildrenChange(e),i.emit("removed",this),this.emit("childRemoved",i,this,e),i},r.prototype.removeChildren=function(e,i){e===void 0&&(e=0),i===void 0&&(i=this.children.length);var n=e,a=i,s=a-n,o;if(s>0&&s<=a){o=this.children.splice(n,s);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(s===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},r.prototype.sortChildren=function(){for(var e=!1,i=0,n=this.children.length;i<n;++i){var a=this.children[i];a._lastSortedIndex=i,!e&&a.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(vd),this.sortDirty=!1},r.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,i=this.children.length;e<i;++e){var n=this.children[e];n.visible&&n.updateTransform()}},r.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var i=this.children[e];if(!(!i.visible||!i.renderable))if(i.calculateBounds(),i._mask){var n=i._mask.maskObject||i._mask;n.calculateBounds(),this._bounds.addBoundsMask(i._bounds,n._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._bounds.updateID=this._boundsID},r.prototype.getLocalBounds=function(e,i){i===void 0&&(i=!1);var n=t.prototype.getLocalBounds.call(this,e);if(!i)for(var a=0,s=this.children.length;a<s;++a){var o=this.children[a];o.visible&&o.updateTransform()}return n},r.prototype._calculateBounds=function(){},r.prototype._renderWithCulling=function(e){var i=e.renderTexture.sourceFrame;if(i.width>0&&i.height>0){var n,a;if(this.cullArea?(n=this.cullArea,a=this.worldTransform):this._render!==r.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,a))this._render(e);else if(this.cullArea)return;for(var s=0,o=this.children.length;s<o;++s){var h=this.children[s],u=h.cullable;h.cullable=u||!this.cullArea,h.render(e),h.cullable=u}}},r.prototype.render=function(e){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(var i=0,n=this.children.length;i<n;++i)this.children[i].render(e)}},r.prototype.renderAdvanced=function(e){var i=this.filters,n=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var a=0;a<i.length;a++)i[a].enabled&&this._enabledFilters.push(i[a])}var s=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==Bi.NONE));if(s&&e.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(var a=0,o=this.children.length;a<o;++a)this.children[a].render(e)}s&&e.batch.flush(),n&&e.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},r.prototype._render=function(e){},r.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i=typeof e=="boolean"?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(i)for(var a=0;a<n.length;++a)n[a].destroy(e)},Object.defineProperty(r.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(e){var i=this.getLocalBounds().width;i!==0?this.scale.x=e/i:this.scale.x=1,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(e){var i=this.getLocalBounds().height;i!==0?this.scale.y=e/i:this.scale.y=1,this._height=e},enumerable:!1,configurable:!0}),r}(tt);wt.prototype.containerUpdateTransform=wt.prototype.updateTransform;/*!
* @pixi/sprite - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/sprite is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Mi=function(t,r){return Mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Mi(t,r)};function _d(t,r){Mi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Le=new D,md=new Uint16Array([0,1,2,0,2,3]),Pe=function(t){_d(r,t);function r(e){var i=t.call(this)||this;return i._anchor=new be(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=P.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||F.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=md,i.pluginName="batch",i.isSprite=!0,i._roundPixels=N.ROUND_PIXELS,i}return r.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=xe(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=xe(this.scale.y)*this._height/this._texture.orig.height)},r.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},r.prototype.calculateVertices=function(){var e=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===e._updateID)){this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;var i=this.transform.worldTransform,n=i.a,a=i.b,s=i.c,o=i.d,h=i.tx,u=i.ty,l=this.vertexData,c=e.trim,f=e.orig,d=this._anchor,p=0,v=0,_=0,m=0;if(c?(v=c.x-d._x*f.width,p=v+c.width,m=c.y-d._y*f.height,_=m+c.height):(v=-d._x*f.width,p=v+f.width,m=-d._y*f.height,_=m+f.height),l[0]=n*v+s*m+h,l[1]=o*m+a*v+u,l[2]=n*p+s*m+h,l[3]=o*m+a*p+u,l[4]=n*p+s*_+h,l[5]=o*_+a*p+u,l[6]=n*v+s*_+h,l[7]=o*_+a*v+u,this._roundPixels)for(var T=N.RESOLUTION,x=0;x<l.length;++x)l[x]=Math.round((l[x]*T|0)/T)}},r.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var e=this._texture,i=this.vertexTrimmedData,n=e.orig,a=this._anchor,s=this.transform.worldTransform,o=s.a,h=s.b,u=s.c,l=s.d,c=s.tx,f=s.ty,d=-a._x*n.width,p=d+n.width,v=-a._y*n.height,_=v+n.height;i[0]=o*d+u*v+c,i[1]=l*v+h*d+f,i[2]=o*p+u*v+c,i[3]=l*v+h*p+f,i[4]=o*p+u*_+c,i[5]=l*_+h*p+f,i[6]=o*d+u*_+c,i[7]=l*_+h*d+f},r.prototype._render=function(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)},r.prototype._calculateBounds=function(){var e=this._texture.trim,i=this._texture.orig;!e||e.width===i.width&&e.height===i.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},r.prototype.getLocalBounds=function(e){return this.children.length===0?(this._localBounds||(this._localBounds=new Ve),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new M),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},r.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,Le);var i=this._texture.orig.width,n=this._texture.orig.height,a=-i*this.anchor.x,s=0;return Le.x>=a&&Le.x<a+i&&(s=-n*this.anchor.y,Le.y>=s&&Le.y<s+n)},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var i=typeof e=="boolean"?e:e&&e.texture;if(i){var n=typeof e=="boolean"?e:e&&e.baseTexture;this._texture.destroy(!!n)}this._texture=null},r.from=function(e,i){var n=e instanceof F?e:F.from(e,i);return new r(n)},Object.defineProperty(r.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){var i=xe(this.scale.x)||1;this.scale.x=i*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){var i=xe(this.scale.y)||1;this.scale.y=i*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"anchor",{get:function(){return this._anchor},set:function(e){this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||F.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),r}(wt);/*!
* @pixi/particle-emitter - v5.0.7
* Compiled Fri, 27 May 2022 02:00:12 UTC
*
* @pixi/particle-emitter is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/class Rt{constructor(r,e,i){this.value=r,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:_h(i):this.ease=null}static createList(r){if("list"in r){const i=r.list;let n;const{value:a,time:s}=i[0],o=n=new Rt(typeof a=="string"?cr(a):a,s,r.ease);if(i.length>2||i.length===2&&i[1].value!==a)for(let h=1;h<i.length;++h){const{value:u,time:l}=i[h];n.next=new Rt(typeof u=="string"?cr(u):u,l),n=n.next}return o.isStepped=!!r.isStepped,o}const e=new Rt(typeof r.start=="string"?cr(r.start):r.start,0);return r.end!==r.start&&(e.next=new Rt(typeof r.end=="string"?cr(r.end):r.end,1)),e}}let je=F.from;const bt=Math.PI/180;function Bt(t,r){if(!t)return;const e=Math.sin(t),i=Math.cos(t),n=r.x*i-r.y*e,a=r.x*e+r.y*i;r.x=n,r.y=a}function Mr(t,r,e){return t<<16|r<<8|e}function ph(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function yd(t){const r=1/ph(t);t.x*=r,t.y*=r}function vh(t,r){t.x*=r,t.y*=r}function cr(t,r){r||(r={}),t.charAt(0)==="#"?t=t.substr(1):t.indexOf("0x")===0&&(t=t.substr(2));let e;return t.length===8&&(e=t.substr(0,2),t=t.substr(2)),r.r=parseInt(t.substr(0,2),16),r.g=parseInt(t.substr(2,2),16),r.b=parseInt(t.substr(4,2),16),e&&(r.a=parseInt(e,16)),r}function _h(t){const r=t.length,e=1/r;return function(i){const n=r*i|0,a=(i-n*e)*r,s=t[n]||t[r-1];return s.s+a*(2*(1-a)*(s.cp-s.s)+a*(s.e-s.s))}}function gd(t){return t?(t=t.toUpperCase().replace(/ /g,"_"),P[t]||P.NORMAL):P.NORMAL}class ti extends Pe{constructor(r){super(),this.prevChild=this.nextChild=null,this.emitter=r,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(r){this.maxLife=r,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var Y;(function(t){t[t.Spawn=0]="Spawn",t[t.Normal=2]="Normal",t[t.Late=5]="Late"})(Y||(Y={}));const ei=at.shared,Jt=Symbol("Position particle per emitter position");class W{constructor(r,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new D,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new D,this._prevEmitterPos=new D,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=r,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(r){W.knownBehaviors[r.type]=r}get frequency(){return this._frequency}set frequency(r){typeof r=="number"&&r>0?this._frequency=r:this._frequency=1}get parent(){return this._parent}set parent(r){this.cleanup(),this._parent=r}init(r){if(!r)return;this.cleanup(),this._origConfig=r,this.minLifetime=r.lifetime.min,this.maxLifetime=r.lifetime.max,r.ease?this.customEase=typeof r.ease=="function"?r.ease:_h(r.ease):this.customEase=null,this.particlesPerWave=1,r.particlesPerWave&&r.particlesPerWave>1&&(this.particlesPerWave=r.particlesPerWave),this.frequency=r.frequency,this.spawnChance=typeof r.spawnChance=="number"&&r.spawnChance>0?r.spawnChance:1,this.emitterLifetime=r.emitterLifetime||-1,this.maxParticles=r.maxParticles>0?r.maxParticles:1e3,this.addAtBack=!!r.addAtBack,this.rotation=0,this.ownerPos.set(0),r.pos?this.spawnPos.copyFrom(r.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=r.emit===void 0?!0:!!r.emit,this.autoUpdate=!!r.autoUpdate;const e=r.behaviors.map(i=>{const n=W.knownBehaviors[i.type];return n?new n(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Jt),e.sort((i,n)=>i===Jt?n.order===Y.Spawn?1:-1:n===Jt?i.order===Y.Spawn?-1:1:i.order-n.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Jt&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Jt&&i.recycleParticle)}getBehavior(r){return W.knownBehaviors[r]&&this.initBehaviors.find(e=>e instanceof W.knownBehaviors[r])||null}fillPool(r){for(;r>0;--r){const e=new ti(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(r,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(r,!e);r.next&&(r.next.prev=r.prev),r.prev&&(r.prev.next=r.next),r===this._activeParticlesLast&&(this._activeParticlesLast=r.prev),r===this._activeParticlesFirst&&(this._activeParticlesFirst=r.next),r.prev=null,r.next=this._poolFirst,this._poolFirst=r,r.parent&&r.parent.removeChild(r),--this.particleCount}rotate(r){if(this.rotation===r)return;const e=r-this.rotation;this.rotation=r,Bt(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(r,e){this._posChanged=!0,this.spawnPos.x=r,this.spawnPos.y=e}updateOwnerPos(r,e){this._posChanged=!0,this.ownerPos.x=r,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(r){this._emit=!!r,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(r){this._autoUpdate&&!r?ei.remove(this.update,this):!this._autoUpdate&&r&&ei.add(this.update,this),this._autoUpdate=!!r}playOnceAndDestroy(r){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=r}playOnce(r){this.emit=!0,this._completeCallback=r}update(r){if(this._autoUpdate&&(r=ei.elapsedMS*.001),!this._parent)return;for(let s=this._activeParticlesFirst,o;s;s=o)if(o=s.next,s.age+=r,s.age>s.maxLife||s.age<0)this.recycle(s);else{let h=s.age*s.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),s.agePercent=h;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(s,r)){this.recycle(s);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const n=this.ownerPos.x+this.spawnPos.x,a=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=r<0?0:r;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let s,o;if(this._prevPosIsValid&&this._posChanged){const l=1+this._spawnTimer/r;s=(n-e)*l+e,o=(a-i)*l+i}else s=n,o=a;let h=null,u=null;for(let l=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),c=0;c<l;++c){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let f;if(this.minLifetime===this.maxLifetime?f=this.minLifetime:f=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=f)continue;let d;this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new ti(this),d.init(f),this.addAtBack?this._parent.addChildAt(d,0):this._parent.addChild(d),h?(u.next=d,d.prev=u,u=d):u=h=d,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=u):(this._activeParticlesFirst=h,this._activeParticlesLast=u);for(let l=0;l<this.initBehaviors.length;++l){const c=this.initBehaviors[l];if(c===Jt)for(let f=h,d;f;f=d){d=f.next,this.rotation!==0&&(Bt(this.rotation,f.position),f.rotation+=this.rotation),f.position.x+=s,f.position.y+=o,f.age+=-this._spawnTimer;let p=f.age*f.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),f.agePercent=p}else c.initParticles(h)}for(let l=h,c;l;l=c){c=l.next;for(let f=0;f<this.updateBehaviors.length;++f)if(this.updateBehaviors[f].updateParticle(l,-this._spawnTimer)){this.recycle(l);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=n,this._prevEmitterPos.y=a,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const s=this._completeCallback;this._completeCallback=null,s()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const r=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,n=null;for(let a=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),s=0;s<a;++s){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new ti(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(n.next=o,o.prev=n,n=o):n=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=n):(this._activeParticlesFirst=i,this._activeParticlesLast=n);for(let a=0;a<this.initBehaviors.length;++a){const s=this.initBehaviors[a];if(s===Jt)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Bt(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=r,o.position.y+=e;else s.initParticles(i)}}}cleanup(){let r,e;for(r=this._activeParticlesFirst;r;r=e)e=r.next,this.recycle(r,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let r;for(let e=this._poolFirst;e;e=r)r=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}W.knownBehaviors={};class yn{constructor(r){this.x=r.x,this.y=r.y,this.w=r.w,this.h=r.h}getRandPos(r){r.x=Math.random()*this.w+this.x,r.y=Math.random()*this.h+this.y}}yn.type="rect";yn.editorConfig=null;class Xr{constructor(r){this.x=r.x||0,this.y=r.y||0,this.radius=r.radius,this.innerRadius=r.innerRadius||0,this.rotation=!!r.affectRotation}getRandPos(r){this.innerRadius!==this.radius?r.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:r.x=this.radius,r.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(r.rotation+=e),Bt(e,r.position),r.position.x+=this.x,r.position.y+=this.y}}Xr.type="torus";Xr.editorConfig=null;class gn{constructor(r){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(r)}init(r){if(!r||!r.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(r[0]))for(let e=0;e<r.length;++e){const i=r[e];let n=i[0];for(let a=1;a<i.length;++a){const s=i[a];this.segments.push({p1:n,p2:s,l:0}),n=s}}else{let e=r[0];for(let i=1;i<r.length;++i){const n=r[i];this.segments.push({p1:e,p2:n,l:0}),e=n}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:n}=this.segments[e],a=Math.sqrt((n.x-i.x)*(n.x-i.x)+(n.y-i.y)*(n.y-i.y));this.segments[e].l=a,this.totalLength+=a,this.countingLengths.push(this.totalLength)}}getRandPos(r){const e=Math.random()*this.totalLength;let i,n;if(this.segments.length===1)i=this.segments[0],n=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],n=o===0?e:e-this.countingLengths[o-1];break}n/=i.l||1;const{p1:a,p2:s}=i;r.x=a.x+n*(s.x-a.x),r.y=a.y+n*(s.y-a.y)}}gn.type="polygonalChain";gn.editorConfig=null;class Tn{constructor(r){var e;this.order=Y.Late,this.minStart=r.minStart,this.maxStart=r.maxStart,this.accel=r.accel,this.rotate=!!r.rotate,this.maxSpeed=(e=r.maxSpeed)!==null&&e!==void 0?e:0}initParticles(r){let e=r;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new D(i,0),Bt(e.rotation,e.config.velocity),e=e.next}}updateParticle(r,e){const i=r.config.velocity,n=i.x,a=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const s=ph(i);s>this.maxSpeed&&vh(i,this.maxSpeed/s)}r.x+=(n+i.x)/2*e,r.y+=(a+i.y)/2*e,this.rotate&&(r.rotation=Math.atan2(i.y,i.x))}}Tn.type="moveAcceleration";Tn.editorConfig=null;function Td(t){return this.ease&&(t=this.ease(t)),(this.first.next.value-this.first.value)*t+this.first.value}function xd(t){this.ease&&(t=this.ease(t));const r=this.first.value,e=this.first.next.value,i=(e.r-r.r)*t+r.r,n=(e.g-r.g)*t+r.g,a=(e.b-r.b)*t+r.b;return Mr(i,n,a)}function bd(t){this.ease&&(t=this.ease(t));let r=this.first,e=r.next;for(;t>e.time;)r=e,e=e.next;return t=(t-r.time)/(e.time-r.time),(e.value-r.value)*t+r.value}function Id(t){this.ease&&(t=this.ease(t));let r=this.first,e=r.next;for(;t>e.time;)r=e,e=e.next;t=(t-r.time)/(e.time-r.time);const i=r.value,n=e.value,a=(n.r-i.r)*t+i.r,s=(n.g-i.g)*t+i.g,o=(n.b-i.b)*t+i.b;return Mr(a,s,o)}function Ed(t){this.ease&&(t=this.ease(t));let r=this.first;for(;r.next&&t>r.next.time;)r=r.next;return r.value}function Rd(t){this.ease&&(t=this.ease(t));let r=this.first;for(;r.next&&t>r.next.time;)r=r.next;const e=r.value;return Mr(e.r,e.g,e.b)}class er{constructor(r=!1){this.first=null,this.isColor=!!r,this.interpolate=null,this.ease=null}reset(r){this.first=r,r.next&&r.next.time>=1?this.interpolate=this.isColor?xd:Td:r.isStepped?this.interpolate=this.isColor?Rd:Ed:this.interpolate=this.isColor?Id:bd,this.ease=this.first.ease}}class xn{constructor(r){this.order=Y.Normal,this.list=new er(!1),this.list.reset(Rt.createList(r.alpha))}initParticles(r){let e=r;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(r){r.alpha=this.list.interpolate(r.agePercent)}}xn.type="alpha";xn.editorConfig=null;class bn{constructor(r){this.order=Y.Normal,this.value=r.alpha}initParticles(r){let e=r;for(;e;)e.alpha=this.value,e=e.next}}bn.type="alphaStatic";bn.editorConfig=null;function mh(t){const r=[];for(let e=0;e<t.length;++e){let i=t[e];if(typeof i=="string")r.push(je(i));else if(i instanceof F)r.push(i);else{let n=i.count||1;for(typeof i.texture=="string"?i=je(i.texture):i=i.texture;n>0;--n)r.push(i)}}return r}class In{constructor(r){this.order=Y.Normal,this.anims=[];for(let e=0;e<r.anims.length;++e){const i=r.anims[e],n=mh(i.textures),a=i.framerate<0?-1:i.framerate>0?i.framerate:60,s={textures:n,duration:a>0?n.length/a:0,framerate:a,loop:a>0?!!i.loop:!1};this.anims.push(s)}}initParticles(r){let e=r;for(;e;){const i=Math.floor(Math.random()*this.anims.length),n=e.config.anim=this.anims[i];e.texture=n.textures[0],e.config.animElapsed=0,n.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=n.textures.length/e.maxLife):(e.config.animDuration=n.duration,e.config.animFramerate=n.framerate),e=e.next}}updateParticle(r,e){const i=r.config,n=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const a=i.animElapsed*i.animFramerate+1e-7|0;r.texture=n.textures[a]||n.textures[n.textures.length-1]||F.EMPTY}}In.type="animatedRandom";In.editorConfig=null;class En{constructor(r){this.order=Y.Normal;const e=r.anim,i=mh(e.textures),n=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:n>0?i.length/n:0,framerate:n,loop:n>0?!!e.loop:!1}}initParticles(r){let e=r;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(r,e){const i=this.anim,n=r.config;n.animElapsed+=e,n.animElapsed>=n.animDuration&&(i.loop?n.animElapsed=n.animElapsed%n.animDuration:n.animElapsed=n.animDuration-1e-6);const a=n.animElapsed*n.animFramerate+1e-7|0;r.texture=i.textures[a]||i.textures[i.textures.length-1]||F.EMPTY}}En.type="animatedSingle";En.editorConfig=null;class Rn{constructor(r){this.order=Y.Normal,this.value=r.blendMode}initParticles(r){let e=r;for(;e;)e.blendMode=gd(this.value),e=e.next}}Rn.type="blendMode";Rn.editorConfig=null;class Cn{constructor(r){this.order=Y.Spawn,this.spacing=r.spacing*bt,this.start=r.start*bt,this.distance=r.distance}initParticles(r){let e=0,i=r;for(;i;){let n;this.spacing?n=this.start+this.spacing*e:n=Math.random()*Math.PI*2,i.rotation=n,this.distance&&(i.position.x=this.distance,Bt(n,i.position)),i=i.next,++e}}}Cn.type="spawnBurst";Cn.editorConfig=null;class wn{constructor(r){this.order=Y.Normal,this.list=new er(!0),this.list.reset(Rt.createList(r.color))}initParticles(r){let e=r;const i=this.list.first.value,n=Mr(i.r,i.g,i.b);for(;e;)e.tint=n,e=e.next}updateParticle(r){r.tint=this.list.interpolate(r.agePercent)}}wn.type="color";wn.editorConfig=null;class Pn{constructor(r){this.order=Y.Normal;let e=r.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(r){let e=r;for(;e;)e.tint=this.value,e=e.next}}Pn.type="colorStatic";Pn.editorConfig=null;class Nn{constructor(r){this.order=Y.Normal,this.index=0,this.textures=r.textures.map(e=>typeof e=="string"?je(e):e)}initParticles(r){let e=r;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}Nn.type="textureOrdered";Nn.editorConfig=null;const pe=new D,yh=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],Cd=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(yh).join("|"),"g");function wd(t){const r=t.match(Cd);for(let e=r.length-1;e>=0;--e)yh.indexOf(r[e])>=0&&(r[e]=`Math.${r[e]}`);return t=r.join(""),new Function("x",`return ${t};`)}class An{constructor(r){var e;if(this.order=Y.Late,r.path)if(typeof r.path=="function")this.path=r.path;else try{this.path=wd(r.path)}catch{this.path=null}else this.path=i=>i;this.list=new er(!1),this.list.reset(Rt.createList(r.speed)),this.minMult=(e=r.minMult)!==null&&e!==void 0?e:1}initParticles(r){let e=r;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new D(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(r,e){const i=this.list.interpolate(r.agePercent)*r.config.speedMult;r.config.movement+=i*e,pe.x=r.config.movement,pe.y=this.path(pe.x),Bt(r.config.initRotation,pe),r.position.x=r.config.initPosition.x+pe.x,r.position.y=r.config.initPosition.y+pe.y}}An.type="movePath";An.editorConfig=null;class Un{constructor(){this.order=Y.Spawn}initParticles(r){}}Un.type="spawnPoint";Un.editorConfig=null;class On{constructor(r){this.order=Y.Normal,this.textures=r.textures.map(e=>typeof e=="string"?je(e):e)}initParticles(r){let e=r;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}On.type="textureRandom";On.editorConfig=null;class Sn{constructor(r){this.order=Y.Normal,this.minStart=r.minStart*bt,this.maxStart=r.maxStart*bt,this.minSpeed=r.minSpeed*bt,this.maxSpeed=r.maxSpeed*bt,this.accel=r.accel*bt}initParticles(r){let e=r;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(r,e){if(this.accel){const i=r.config.rotSpeed;r.config.rotSpeed+=this.accel*e,r.rotation+=(r.config.rotSpeed+i)/2*e}else r.rotation+=r.config.rotSpeed*e}}Sn.type="rotation";Sn.editorConfig=null;class Ln{constructor(r){this.order=Y.Normal,this.min=r.min*bt,this.max=r.max*bt}initParticles(r){let e=r;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}Ln.type="rotationStatic";Ln.editorConfig=null;class Fn{constructor(r){this.order=Y.Late+1,this.rotation=(r.rotation||0)*bt}initParticles(r){let e=r;for(;e;)e.rotation=this.rotation,e=e.next}}Fn.type="noRotation";Fn.editorConfig=null;class Gn{constructor(r){var e;this.order=Y.Normal,this.list=new er(!1),this.list.reset(Rt.createList(r.scale)),this.minMult=(e=r.minMult)!==null&&e!==void 0?e:1}initParticles(r){let e=r;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(r){r.scale.x=r.scale.y=this.list.interpolate(r.agePercent)*r.config.scaleMult}}Gn.type="scale";Gn.editorConfig=null;class Bn{constructor(r){this.order=Y.Normal,this.min=r.min,this.max=r.max}initParticles(r){let e=r;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}Bn.type="scaleStatic";Bn.editorConfig=null;class mt{constructor(r){this.order=Y.Spawn;const e=mt.shapes[r.type];if(!e)throw new Error(`No shape found with type '${r.type}'`);this.shape=new e(r.data)}static registerShape(r,e){mt.shapes[e||r.type]=r}initParticles(r){let e=r;for(;e;)this.shape.getRandPos(e),e=e.next}}mt.type="spawnShape";mt.editorConfig=null;mt.shapes={};mt.registerShape(gn);mt.registerShape(yn);mt.registerShape(Xr);mt.registerShape(Xr,"circle");class Mn{constructor(r){this.order=Y.Normal,this.texture=typeof r.texture=="string"?je(r.texture):r.texture}initParticles(r){let e=r;for(;e;)e.texture=this.texture,e=e.next}}Mn.type="textureSingle";Mn.editorConfig=null;class Xn{constructor(r){var e;this.order=Y.Late,this.list=new er(!1),this.list.reset(Rt.createList(r.speed)),this.minMult=(e=r.minMult)!==null&&e!==void 0?e:1}initParticles(r){let e=r;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new D(this.list.first.value*i,0),Bt(e.rotation,e.config.velocity),e=e.next}}updateParticle(r,e){const i=this.list.interpolate(r.agePercent)*r.config.speedMult,n=r.config.velocity;yd(n),vh(n,i),r.x+=n.x*e,r.y+=n.y*e}}Xn.type="moveSpeed";Xn.editorConfig=null;class kn{constructor(r){this.order=Y.Late,this.min=r.min,this.max=r.max}initParticles(r){let e=r;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new D(i,0),Bt(e.rotation,e.config.velocity),e=e.next}}updateParticle(r,e){const i=r.config.velocity;r.x+=i.x*e,r.y+=i.y*e}}kn.type="moveSpeedStatic";kn.editorConfig=null;function Zv(t,r){var e,i,n,a,s,o,h,u,l,c,f,d,p,v,_,m,T,x,E,g,y;if("behaviors"in t)return t;const b={lifetime:t.lifetime,ease:t.ease,particlesPerWave:t.particlesPerWave,frequency:t.frequency,spawnChance:t.spawnChance,emitterLifetime:t.emitterLifetime,maxParticles:t.maxParticles,addAtBack:t.addAtBack,pos:t.pos,emit:t.emit,autoUpdate:t.autoUpdate,behaviors:[]};if(t.alpha)if("start"in t.alpha)if(t.alpha.start===t.alpha.end)t.alpha.start!==1&&b.behaviors.push({type:"alphaStatic",config:{alpha:t.alpha.start}});else{const C={list:[{time:0,value:t.alpha.start},{time:1,value:t.alpha.end}]};b.behaviors.push({type:"alpha",config:{alpha:C}})}else t.alpha.list.length===1?t.alpha.list[0].value!==1&&b.behaviors.push({type:"alphaStatic",config:{alpha:t.alpha.list[0].value}}):b.behaviors.push({type:"alpha",config:{alpha:t.alpha}});if(t.acceleration&&(t.acceleration.x||t.acceleration.y)){let C,I;"start"in t.speed?(C=t.speed.start*((e=t.speed.minimumSpeedMultiplier)!==null&&e!==void 0?e:1),I=t.speed.start):(C=t.speed.list[0].value*((i=t.minimumSpeedMultiplier)!==null&&i!==void 0?i:1),I=t.speed.list[0].value),b.behaviors.push({type:"moveAcceleration",config:{accel:t.acceleration,minStart:C,maxStart:I,rotate:!t.noRotation,maxSpeed:t.maxSpeed}})}else if(!((n=t.extraData)===null||n===void 0)&&n.path){let C,I;"start"in t.speed?(I=(a=t.speed.minimumSpeedMultiplier)!==null&&a!==void 0?a:1,t.speed.start===t.speed.end?C={list:[{time:0,value:t.speed.start}]}:C={list:[{time:0,value:t.speed.start},{time:1,value:t.speed.end}]}):(C=t.speed,I=(s=t.minimumSpeedMultiplier)!==null&&s!==void 0?s:1),b.behaviors.push({type:"movePath",config:{path:t.extraData.path,speed:C,minMult:I}})}else if(t.speed)if("start"in t.speed)if(t.speed.start===t.speed.end)b.behaviors.push({type:"moveSpeedStatic",config:{min:t.speed.start*((o=t.speed.minimumSpeedMultiplier)!==null&&o!==void 0?o:1),max:t.speed.start}});else{const C={list:[{time:0,value:t.speed.start},{time:1,value:t.speed.end}]};b.behaviors.push({type:"moveSpeed",config:{speed:C,minMult:t.speed.minimumSpeedMultiplier}})}else t.speed.list.length===1?b.behaviors.push({type:"moveSpeedStatic",config:{min:t.speed.list[0].value*((h=t.minimumSpeedMultiplier)!==null&&h!==void 0?h:1),max:t.speed.list[0].value}}):b.behaviors.push({type:"moveSpeed",config:{speed:t.speed,minMult:(u=t.minimumSpeedMultiplier)!==null&&u!==void 0?u:1}});if(t.scale)if("start"in t.scale){const C=(l=t.scale.minimumScaleMultiplier)!==null&&l!==void 0?l:1;if(t.scale.start===t.scale.end)b.behaviors.push({type:"scaleStatic",config:{min:t.scale.start*C,max:t.scale.start}});else{const I={list:[{time:0,value:t.scale.start},{time:1,value:t.scale.end}]};b.behaviors.push({type:"scale",config:{scale:I,minMult:C}})}}else if(t.scale.list.length===1){const C=(c=t.minimumScaleMultiplier)!==null&&c!==void 0?c:1,I=t.scale.list[0].value;b.behaviors.push({type:"scaleStatic",config:{min:I*C,max:I}})}else b.behaviors.push({type:"scale",config:{scale:t.scale,minMult:(f=t.minimumScaleMultiplier)!==null&&f!==void 0?f:1}});if(t.color)if("start"in t.color)if(t.color.start===t.color.end)t.color.start!=="ffffff"&&b.behaviors.push({type:"colorStatic",config:{color:t.color.start}});else{const C={list:[{time:0,value:t.color.start},{time:1,value:t.color.end}]};b.behaviors.push({type:"color",config:{color:C}})}else t.color.list.length===1?t.color.list[0].value!=="ffffff"&&b.behaviors.push({type:"colorStatic",config:{color:t.color.list[0].value}}):b.behaviors.push({type:"color",config:{color:t.color}});if(t.rotationAcceleration||((d=t.rotationSpeed)===null||d===void 0?void 0:d.min)||((p=t.rotationSpeed)===null||p===void 0?void 0:p.max)?b.behaviors.push({type:"rotation",config:{accel:t.rotationAcceleration||0,minSpeed:((v=t.rotationSpeed)===null||v===void 0?void 0:v.min)||0,maxSpeed:((_=t.rotationSpeed)===null||_===void 0?void 0:_.max)||0,minStart:((m=t.startRotation)===null||m===void 0?void 0:m.min)||0,maxStart:((T=t.startRotation)===null||T===void 0?void 0:T.max)||0}}):(((x=t.startRotation)===null||x===void 0?void 0:x.min)||((E=t.startRotation)===null||E===void 0?void 0:E.max))&&b.behaviors.push({type:"rotationStatic",config:{min:((g=t.startRotation)===null||g===void 0?void 0:g.min)||0,max:((y=t.startRotation)===null||y===void 0?void 0:y.max)||0}}),t.noRotation&&b.behaviors.push({type:"noRotation",config:{}}),t.blendMode&&t.blendMode!=="normal"&&b.behaviors.push({type:"blendMode",config:{blendMode:t.blendMode}}),Array.isArray(r)&&typeof r[0]!="string"&&"framerate"in r[0]){for(let C=0;C<r.length;++C)r[C].framerate==="matchLife"&&(r[C].framerate=-1);b.behaviors.push({type:"animatedRandom",config:{anims:r}})}else typeof r!="string"&&"framerate"in r?(r.framerate==="matchLife"&&(r.framerate=-1),b.behaviors.push({type:"animatedSingle",config:{anim:r}})):t.orderedArt&&Array.isArray(r)?b.behaviors.push({type:"textureOrdered",config:{textures:r}}):Array.isArray(r)?b.behaviors.push({type:"textureRandom",config:{textures:r}}):b.behaviors.push({type:"textureSingle",config:{texture:r}});if(t.spawnType==="burst")b.behaviors.push({type:"spawnBurst",config:{start:t.angleStart||0,spacing:t.particleSpacing,distance:0}});else if(t.spawnType==="point")b.behaviors.push({type:"spawnPoint",config:{}});else{let C;t.spawnType==="ring"?C={type:"torus",data:{x:t.spawnCircle.x,y:t.spawnCircle.y,radius:t.spawnCircle.r,innerRadius:t.spawnCircle.minR,affectRotation:!0}}:t.spawnType==="circle"?C={type:"torus",data:{x:t.spawnCircle.x,y:t.spawnCircle.y,radius:t.spawnCircle.r,innerRadius:0,affectRotation:!1}}:t.spawnType==="rect"?C={type:"rect",data:t.spawnRect}:t.spawnType==="polygonalChain"&&(C={type:"polygonalChain",data:t.spawnPolygon}),C&&b.behaviors.push({type:"spawnShape",config:C})}return b}W.registerBehavior(Tn);W.registerBehavior(xn);W.registerBehavior(bn);W.registerBehavior(In);W.registerBehavior(En);W.registerBehavior(Rn);W.registerBehavior(Cn);W.registerBehavior(wn);W.registerBehavior(Pn);W.registerBehavior(Nn);W.registerBehavior(An);W.registerBehavior(Un);W.registerBehavior(On);W.registerBehavior(Sn);W.registerBehavior(Ln);W.registerBehavior(Fn);W.registerBehavior(Gn);W.registerBehavior(Bn);W.registerBehavior(mt);W.registerBehavior(Mn);W.registerBehavior(Xn);W.registerBehavior(kn);/*!
* @pixi/polyfill - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/polyfill is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/typeof globalThis=="undefined"&&(typeof self!="undefined"?self.globalThis=self:typeof global!="undefined"&&(global.globalThis=global));globalThis.Promise||(globalThis.Promise=Sh);Object.assign||(Object.assign=Lh);var Pd=16;Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()});if(!(globalThis.performance&&globalThis.performance.now)){var Nd=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-Nd}}var ri=Date.now(),ja=["ms","moz","webkit","o"];for(var ii=0;ii<ja.length&&!globalThis.requestAnimationFrame;++ii){var ni=ja[ii];globalThis.requestAnimationFrame=globalThis[ni+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[ni+"CancelAnimationFrame"]||globalThis[ni+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(t){if(typeof t!="function")throw new TypeError(t+"is not a function");var r=Date.now(),e=Pd+ri-r;return e<0&&(e=0),ri=r,globalThis.self.setTimeout(function(){ri=Date.now(),t(performance.now())},e)});globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(t){return clearTimeout(t)});Math.sign||(Math.sign=function(r){return r=Number(r),r===0||isNaN(r)?r:r>0?1:-1});Number.isInteger||(Number.isInteger=function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r});globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array);globalThis.Float32Array||(globalThis.Float32Array=Array);globalThis.Uint32Array||(globalThis.Uint32Array=Array);globalThis.Uint16Array||(globalThis.Uint16Array=Array);globalThis.Uint8Array||(globalThis.Uint8Array=Array);globalThis.Int32Array||(globalThis.Int32Array=Array);/*!
* @pixi/accessibility - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/accessibility is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Ad={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};tt.mixin(Ad);var Ud=9,dr=100,Od=0,Sd=0,za=2,Wa=1,Ld=-1e3,Fd=-1e3,Gd=2,Jv=function(){function t(r){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(It.tablet||It.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width=dr+"px",e.style.height=dr+"px",e.style.position="absolute",e.style.top=Od+"px",e.style.left=Sd+"px",e.style.zIndex=za.toString(),this.div=e,this.renderer=r,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var r=this,e=document.createElement("button");e.style.width=Wa+"px",e.style.height=Wa+"px",e.style.position="absolute",e.style.top=Ld+"px",e.style.left=Fd+"px",e.style.zIndex=Gd.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",function(){r._isMobileAccessibility=!0,r.activate(),r.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){!this._hookDiv||(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){var r;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(r=this.renderer.view.parentNode)===null||r===void 0||r.appendChild(this.div))},t.prototype.deactivate=function(){var r;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(r=this.div.parentNode)===null||r===void 0||r.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(r){if(!(!r.visible||!r.accessibleChildren)){r.accessible&&r.interactive&&(r._accessibleActive||this.addChild(r),r.renderId=this.renderId);var e=r.children;if(e)for(var i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}},t.prototype.update=function(){var r=performance.now();if(!(It.android.device&&r<this.androidUpdateCount)&&(this.androidUpdateCount=r+this.androidUpdateFrequency,!!this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),i=e.left,n=e.top,a=e.width,s=e.height,o=this.renderer,h=o.width,u=o.height,l=o.resolution,c=a/h*l,f=s/u*l,d=this.div;d.style.left=i+"px",d.style.top=n+"px",d.style.width=h+"px",d.style.height=u+"px";for(var p=0;p<this.children.length;p++){var v=this.children[p];if(v.renderId!==this.renderId)v._accessibleActive=!1,Gt(this.children,p,1),this.div.removeChild(v._accessibleDiv),this.pool.push(v._accessibleDiv),v._accessibleDiv=null,p--;else{d=v._accessibleDiv;var _=v.hitArea,m=v.worldTransform;v.hitArea?(d.style.left=(m.tx+_.x*m.a)*c+"px",d.style.top=(m.ty+_.y*m.d)*f+"px",d.style.width=_.width*m.a*c+"px",d.style.height=_.height*m.d*f+"px"):(_=v.getBounds(),this.capHitArea(_),d.style.left=_.x*c+"px",d.style.top=_.y*f+"px",d.style.width=_.width*c+"px",d.style.height=_.height*f+"px",d.title!==v.accessibleTitle&&v.accessibleTitle!==null&&(d.title=v.accessibleTitle),d.getAttribute("aria-label")!==v.accessibleHint&&v.accessibleHint!==null&&d.setAttribute("aria-label",v.accessibleHint)),(v.accessibleTitle!==d.title||v.tabIndex!==d.tabIndex)&&(d.title=v.accessibleTitle,d.tabIndex=v.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},t.prototype.updateDebugHTML=function(r){r.innerHTML="type: "+r.type+"</br> title : "+r.title+"</br> tabIndex: "+r.tabIndex},t.prototype.capHitArea=function(r){r.x<0&&(r.width+=r.x,r.x=0),r.y<0&&(r.height+=r.y,r.y=0);var e=this.renderer,i=e.width,n=e.height;r.x+r.width>i&&(r.width=i-r.x),r.y+r.height>n&&(r.height=n-r.y)},t.prototype.addChild=function(r){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=dr+"px",e.style.height=dr+"px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=za.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=r.accessiblePointerEvents,e.type=r.accessibleType,r.accessibleTitle&&r.accessibleTitle!==null?e.title=r.accessibleTitle:(!r.accessibleHint||r.accessibleHint===null)&&(e.title="displayObject "+r.tabIndex),r.accessibleHint&&r.accessibleHint!==null&&e.setAttribute("aria-label",r.accessibleHint),this.debug&&this.updateDebugHTML(e),r._accessibleActive=!0,r._accessibleDiv=e,e.displayObject=r,this.children.push(r),this.div.appendChild(r._accessibleDiv),r._accessibleDiv.tabIndex=r.tabIndex},t.prototype._onClick=function(r){var e=this.renderer.plugins.interaction,i=r.target.displayObject,n=e.eventData;e.dispatchEvent(i,"click",n),e.dispatchEvent(i,"pointertap",n),e.dispatchEvent(i,"tap",n)},t.prototype._onFocus=function(r){r.target.getAttribute("aria-live")||r.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,i=r.target.displayObject,n=e.eventData;e.dispatchEvent(i,"mouseover",n)},t.prototype._onFocusOut=function(r){r.target.getAttribute("aria-live")||r.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,i=r.target.displayObject,n=e.eventData;e.dispatchEvent(i,"mouseout",n)},t.prototype._onKeyDown=function(r){r.keyCode===Ud&&this.activate()},t.prototype._onMouseMove=function(r){r.movementX===0&&r.movementY===0||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}();/*!
* @pixi/interaction - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/interaction is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Ya=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new D,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(r,e,i){return r.worldTransform.applyInverse(i||this.global,e)},t.prototype.copyEvent=function(r){"isPrimary"in r&&r.isPrimary&&(this.isPrimary=!0),this.button="button"in r&&r.button;var e="buttons"in r&&r.buttons;this.buttons=Number.isInteger(e)?e:"which"in r&&r.which,this.width="width"in r&&r.width,this.height="height"in r&&r.height,this.tiltX="tiltX"in r&&r.tiltX,this.tiltY="tiltY"in r&&r.tiltY,this.pointerType="pointerType"in r&&r.pointerType,this.pressure="pressure"in r&&r.pressure,this.rotationAngle="rotationAngle"in r&&r.rotationAngle,this.twist="twist"in r&&r.twist||0,this.tangentialPressure="tangentialPressure"in r&&r.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Xi=function(t,r){return Xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Xi(t,r)};function Bd(t,r){Xi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Md=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),ai=function(){function t(r){this._pointerId=r,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(r,e){e?this._flags=this._flags|r:this._flags=this._flags&~r},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(r){this._flags=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return(this._flags&t.FLAGS.OVER)!==0},set:function(r){this._doSet(t.FLAGS.OVER,r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return(this._flags&t.FLAGS.RIGHT_DOWN)!==0},set:function(r){this._doSet(t.FLAGS.RIGHT_DOWN,r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return(this._flags&t.FLAGS.LEFT_DOWN)!==0},set:function(r){this._doSet(t.FLAGS.LEFT_DOWN,r)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1<<0,LEFT_DOWN:1<<1,RIGHT_DOWN:1<<2}),t}(),Xd=function(){function t(){this._tempPoint=new D}return t.prototype.recursiveFindHit=function(r,e,i,n,a){if(!e||!e.visible)return!1;var s=r.data.global;a=e.interactive||a;var o=!1,h=a,u=!0;if(e.hitArea?(n&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?o=!0:(n=!1,u=!1)),h=!1):e._mask&&n&&(e._mask.containsPoint&&e._mask.containsPoint(s)||(n=!1)),u&&e.interactiveChildren&&e.children)for(var l=e.children,c=l.length-1;c>=0;c--){var f=l[c],d=this.recursiveFindHit(r,f,i,n,h);if(d){if(!f.parent)continue;h=!1,d&&(r.target&&(n=!1),o=!0)}}return a&&(n&&!r.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(o=!0),e.interactive&&(o&&!r.target&&(r.target=e),i&&i(r,e,!!o))),o},t.prototype.findHit=function(r,e,i,n){this.recursiveFindHit(r,e,i,n,!1)},t}(),kd={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(t){t?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};tt.mixin(kd);var pr=1,vr={target:null,data:{global:null}},Qv=function(t){Bd(r,t);function r(e,i){var n=t.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new Ya,n.mouse.identifier=pr,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[pr]=n.mouse,n.interactionDataPool=[],n.eventData=new Md,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new Xd,n._tempDisplayObject=new dh,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(r.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),r.prototype.hitTest=function(e,i){return vr.target=null,vr.data.global=e,i||(i=this.lastObjectRendered),this.processInteractive(vr,i,null,!0),vr.target},r.prototype.setTargetElement=function(e,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=i,this.addEvents(),this.addTickerListener()},r.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(at.system.add(this.tickerUpdate,this,kt.INTERACTION),this.tickerAdded=!0)},r.prototype.removeTickerListener=function(){!this.tickerAdded||(at.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},r.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},r.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},r.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())},r.prototype.update=function(){if(!!this.interactionDOMElement){if(this._didMove){this._didMove=!1;return}this.cursor=null;for(var e in this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(e)){var i=this.activeInteractionData[e];if(i.originalEvent&&i.pointerType!=="touch"){var n=this.configureInteractionEventForDOMEvent(this.eventData,i.originalEvent,i);this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},r.prototype.setCursorMode=function(e){e=e||"default";var i=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(i=!1),this.currentCursorMode!==e){this.currentCursorMode=e;var n=this.cursorStyles[e];if(n)switch(typeof n){case"string":i&&(this.interactionDOMElement.style.cursor=n);break;case"function":n(e);break;case"object":i&&Object.assign(this.interactionDOMElement.style,n);break}else i&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.interactionDOMElement.style.cursor=e)}},r.prototype.dispatchEvent=function(e,i,n){(!n.stopPropagationHint||e===n.stopsPropagatingAt)&&(n.currentTarget=e,n.type=i,e.emit(i,n),e[i]&&e[i](n))},r.prototype.delayDispatchEvent=function(e,i,n){this.delayedEvents.push({displayObject:e,eventString:i,eventData:n})},r.prototype.mapPositionToPoint=function(e,i,n){var a;this.interactionDOMElement.parentElement?a=this.interactionDOMElement.getBoundingClientRect():a={x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var s=1/this.resolution;e.x=(i-a.left)*(this.interactionDOMElement.width/a.width)*s,e.y=(n-a.top)*(this.interactionDOMElement.height/a.height)*s},r.prototype.processInteractive=function(e,i,n,a){var s=this.search.findHit(e,i,n,a),o=this.delayedEvents;if(!o.length)return s;e.stopPropagationHint=!1;var h=o.length;this.delayedEvents=[];for(var u=0;u<h;u++){var l=o[u],c=l.displayObject,f=l.eventString,d=l.eventData;d.stopsPropagatingAt===c&&(d.stopPropagationHint=!0),this.dispatchEvent(c,f,d)}return s},r.prototype.onPointerDown=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var i=this.normalizeToPointerData(e);if(this.autoPreventDefault&&i[0].isNormalized){var n=e.cancelable||!("cancelable"in e);n&&e.preventDefault()}for(var a=i.length,s=0;s<a;s++){var o=i[s],h=this.getInteractionDataForPointerId(o),u=this.configureInteractionEventForDOMEvent(this.eventData,o,h);if(u.data.originalEvent=e,this.processInteractive(u,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",u),o.pointerType==="touch")this.emit("touchstart",u);else if(o.pointerType==="mouse"||o.pointerType==="pen"){var l=o.button===2;this.emit(l?"rightdown":"mousedown",this.eventData)}}}},r.prototype.processPointerDown=function(e,i,n){var a=e.data,s=e.data.identifier;if(n){if(i.trackedPointers[s]||(i.trackedPointers[s]=new ai(s)),this.dispatchEvent(i,"pointerdown",e),a.pointerType==="touch")this.dispatchEvent(i,"touchstart",e);else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;o?i.trackedPointers[s].rightDown=!0:i.trackedPointers[s].leftDown=!0,this.dispatchEvent(i,o?"rightdown":"mousedown",e)}}},r.prototype.onPointerComplete=function(e,i,n){for(var a=this.normalizeToPointerData(e),s=a.length,o=e.target!==this.interactionDOMElement?"outside":"",h=0;h<s;h++){var u=a[h],l=this.getInteractionDataForPointerId(u),c=this.configureInteractionEventForDOMEvent(this.eventData,u,l);if(c.data.originalEvent=e,this.processInteractive(c,this.lastObjectRendered,n,i||!o),this.emit(i?"pointercancel":"pointerup"+o,c),u.pointerType==="mouse"||u.pointerType==="pen"){var f=u.button===2;this.emit(f?"rightup"+o:"mouseup"+o,c)}else u.pointerType==="touch"&&(this.emit(i?"touchcancel":"touchend"+o,c),this.releaseInteractionDataForPointerId(u.pointerId))}},r.prototype.onPointerCancel=function(e){this.supportsTouchEvents&&e.pointerType==="touch"||this.onPointerComplete(e,!0,this.processPointerCancel)},r.prototype.processPointerCancel=function(e,i){var n=e.data,a=e.data.identifier;i.trackedPointers[a]!==void 0&&(delete i.trackedPointers[a],this.dispatchEvent(i,"pointercancel",e),n.pointerType==="touch"&&this.dispatchEvent(i,"touchcancel",e))},r.prototype.onPointerUp=function(e){this.supportsTouchEvents&&e.pointerType==="touch"||this.onPointerComplete(e,!1,this.processPointerUp)},r.prototype.processPointerUp=function(e,i,n){var a=e.data,s=e.data.identifier,o=i.trackedPointers[s],h=a.pointerType==="touch",u=a.pointerType==="mouse"||a.pointerType==="pen",l=!1;if(u){var c=a.button===2,f=ai.FLAGS,d=c?f.RIGHT_DOWN:f.LEFT_DOWN,p=o!==void 0&&o.flags&d;n?(this.dispatchEvent(i,c?"rightup":"mouseup",e),p&&(this.dispatchEvent(i,c?"rightclick":"click",e),l=!0)):p&&this.dispatchEvent(i,c?"rightupoutside":"mouseupoutside",e),o&&(c?o.rightDown=!1:o.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",e),h&&this.dispatchEvent(i,"touchend",e),o&&((!u||l)&&this.dispatchEvent(i,"pointertap",e),h&&(this.dispatchEvent(i,"tap",e),o.over=!1))):o&&(this.dispatchEvent(i,"pointerupoutside",e),h&&this.dispatchEvent(i,"touchendoutside",e)),o&&o.none&&delete i.trackedPointers[s]},r.prototype.onPointerMove=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var i=this.normalizeToPointerData(e);(i[0].pointerType==="mouse"||i[0].pointerType==="pen")&&(this._didMove=!0,this.cursor=null);for(var n=i.length,a=0;a<n;a++){var s=i[a],o=this.getInteractionDataForPointerId(s),h=this.configureInteractionEventForDOMEvent(this.eventData,s,o);h.data.originalEvent=e,this.processInteractive(h,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",h),s.pointerType==="touch"&&this.emit("touchmove",h),(s.pointerType==="mouse"||s.pointerType==="pen")&&this.emit("mousemove",h)}i[0].pointerType==="mouse"&&this.setCursorMode(this.cursor)}},r.prototype.processPointerMove=function(e,i,n){var a=e.data,s=a.pointerType==="touch",o=a.pointerType==="mouse"||a.pointerType==="pen";o&&this.processPointerOverOut(e,i,n),(!this.moveWhenInside||n)&&(this.dispatchEvent(i,"pointermove",e),s&&this.dispatchEvent(i,"touchmove",e),o&&this.dispatchEvent(i,"mousemove",e))},r.prototype.onPointerOut=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var i=this.normalizeToPointerData(e),n=i[0];n.pointerType==="mouse"&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var a=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,a);s.data.originalEvent=n,this.processInteractive(s,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",s),n.pointerType==="mouse"||n.pointerType==="pen"?this.emit("mouseout",s):this.releaseInteractionDataForPointerId(a.identifier)}},r.prototype.processPointerOverOut=function(e,i,n){var a=e.data,s=e.data.identifier,o=a.pointerType==="mouse"||a.pointerType==="pen",h=i.trackedPointers[s];n&&!h&&(h=i.trackedPointers[s]=new ai(s)),h!==void 0&&(n&&this.mouseOverRenderer?(h.over||(h.over=!0,this.delayDispatchEvent(i,"pointerover",e),o&&this.delayDispatchEvent(i,"mouseover",e)),o&&this.cursor===null&&(this.cursor=i.cursor)):h.over&&(h.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),o&&this.dispatchEvent(i,"mouseout",e),h.none&&delete i.trackedPointers[s]))},r.prototype.onPointerOver=function(e){var i=this.normalizeToPointerData(e),n=i[0],a=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,a);s.data.originalEvent=n,n.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",s),(n.pointerType==="mouse"||n.pointerType==="pen")&&this.emit("mouseover",s)},r.prototype.getInteractionDataForPointerId=function(e){var i=e.pointerId,n;return i===pr||e.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new Ya,n.identifier=i,this.activeInteractionData[i]=n),n.copyEvent(e),n},r.prototype.releaseInteractionDataForPointerId=function(e){var i=this.activeInteractionData[e];i&&(delete this.activeInteractionData[e],i.reset(),this.interactionDataPool.push(i))},r.prototype.configureInteractionEventForDOMEvent=function(e,i,n){return e.data=n,this.mapPositionToPoint(n.global,i.clientX,i.clientY),i.pointerType==="touch"&&(i.globalX=n.global.x,i.globalY=n.global.y),n.originalEvent=i,e.reset(),e},r.prototype.normalizeToPointerData=function(e){var i=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(var n=0,a=e.changedTouches.length;n<a;n++){var s=e.changedTouches[n];typeof s.button=="undefined"&&(s.button=e.touches.length?1:0),typeof s.buttons=="undefined"&&(s.buttons=e.touches.length?1:0),typeof s.isPrimary=="undefined"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width=="undefined"&&(s.width=s.radiusX||1),typeof s.height=="undefined"&&(s.height=s.radiusY||1),typeof s.tiltX=="undefined"&&(s.tiltX=0),typeof s.tiltY=="undefined"&&(s.tiltY=0),typeof s.pointerType=="undefined"&&(s.pointerType="touch"),typeof s.pointerId=="undefined"&&(s.pointerId=s.identifier||0),typeof s.pressure=="undefined"&&(s.pressure=s.force||.5),typeof s.twist=="undefined"&&(s.twist=0),typeof s.tangentialPressure=="undefined"&&(s.tangentialPressure=0),typeof s.layerX=="undefined"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY=="undefined"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,i.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){var o=e;typeof o.isPrimary=="undefined"&&(o.isPrimary=!0),typeof o.width=="undefined"&&(o.width=1),typeof o.height=="undefined"&&(o.height=1),typeof o.tiltX=="undefined"&&(o.tiltX=0),typeof o.tiltY=="undefined"&&(o.tiltY=0),typeof o.pointerType=="undefined"&&(o.pointerType="mouse"),typeof o.pointerId=="undefined"&&(o.pointerId=pr),typeof o.pressure=="undefined"&&(o.pressure=.5),typeof o.twist=="undefined"&&(o.twist=0),typeof o.tangentialPressure=="undefined"&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(e);return i},r.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},r}(we);/*!
* @pixi/app - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/app is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Hd=function(){function t(r){var e=this;this.stage=new wt,r=Object.assign({forceCanvas:!1},r),this.renderer=hd(r),t._plugins.forEach(function(i){i.init.call(e,r)})}return t.registerPlugin=function(r){t._plugins.push(r)},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(r,e){var i=this,n=t._plugins.slice(0);n.reverse(),n.forEach(function(a){a.destroy.call(i)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(r),this.renderer=null},t._plugins=[],t}(),Dd=function(){function t(){}return t.init=function(r){var e=this;Object.defineProperty(this,"resizeTo",{set:function(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){!e._resizeTo||(e.cancelResize(),e._resizeId=requestAnimationFrame(function(){return e.resize()}))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(!!e._resizeTo){e.cancelResize();var i,n;if(e._resizeTo===globalThis.window)i=globalThis.innerWidth,n=globalThis.innerHeight;else{var a=e._resizeTo,s=a.clientWidth,o=a.clientHeight;i=s,n=o}e.renderer.resize(i,n)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=r.resizeTo||null},t.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t}();Hd.registerPlugin(Dd);/*!
* @pixi/extract - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/extract is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var si=/iPhone/i,$a=/iPod/i,qa=/iPad/i,Ka=/\biOS-universal(?:.+)Mac\b/i,oi=/\bAndroid(?:.+)Mobile\b/i,Za=/Android/i,ve=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,_r=/Silk/i,At=/Windows Phone/i,Ja=/\bWindows(?:.+)ARM\b/i,Qa=/BlackBerry/i,ts=/BB10/i,es=/Opera Mini/i,rs=/\b(CriOS|Chrome)(?:.+)Mobile/i,is=/Mobile(?:.+)Firefox\b/i,ns=function(t){return typeof t!="undefined"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream=="undefined"};function Vd(t){return function(r){return r.test(t)}}function jd(t){var r={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator!="undefined"?r={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?r.userAgent=t:t&&t.userAgent&&(r={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var e=r.userAgent,i=e.split("[FBAN");typeof i[1]!="undefined"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]!="undefined"&&(e=i[0]);var n=Vd(e),a={apple:{phone:n(si)&&!n(At),ipod:n($a),tablet:!n(si)&&(n(qa)||ns(r))&&!n(At),universal:n(Ka),device:(n(si)||n($a)||n(qa)||n(Ka)||ns(r))&&!n(At)},amazon:{phone:n(ve),tablet:!n(ve)&&n(_r),device:n(ve)||n(_r)},android:{phone:!n(At)&&n(ve)||!n(At)&&n(oi),tablet:!n(At)&&!n(ve)&&!n(oi)&&(n(_r)||n(Za)),device:!n(At)&&(n(ve)||n(_r)||n(oi)||n(Za))||n(/\bokhttp\b/i)},windows:{phone:n(At),tablet:n(Ja),device:n(At)||n(Ja)},other:{blackberry:n(Qa),blackberry10:n(ts),opera:n(es),firefox:n(is),chrome:n(rs),device:n(Qa)||n(ts)||n(es)||n(is)||n(rs)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}/*!
* @pixi/settings - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/settings is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Ie=jd(globalThis.navigator);function zd(t){var r=!0;if(Ie.tablet||Ie.phone){if(Ie.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(r=!1)}}if(Ie.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(r=!1)}}}return r?t:4}function Wd(){return!Ie.apple.device}/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var as;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(as||(as={}));var ss;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(ss||(ss={}));var os;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(os||(os={}));var hs;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(hs||(hs={}));var us;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(us||(us={}));var ls;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(ls||(ls={}));var fs;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(fs||(fs={}));var cs;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(cs||(cs={}));var ds;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(ds||(ds={}));var ki;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(ki||(ki={}));var Hi;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Hi||(Hi={}));var Di;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(Di||(Di={}));var ps;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(ps||(ps={}));var vs;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(vs||(vs={}));var Vi;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(Vi||(Vi={}));var Xe;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Xe||(Xe={}));var _s;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(_s||(_s={}));var ji;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(ji||(ji={}));var ms;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(ms||(ms={}));var gh={MIPMAP_TEXTURES:Di.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:ji.NONE,SPRITE_MAX_TEXTURES:zd(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:Vi.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Hi.CLAMP,SCALE_MODE:ki.LINEAR,PRECISION_VERTEX:Xe.HIGH,PRECISION_FRAGMENT:Ie.apple.device?Xe.HIGH:Xe.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Wd(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};/*!
* @pixi/display - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/display is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/gh.SORTABLE_CHILDREN=!1;var ys=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(r){return this.minX>this.maxX||this.minY>this.maxY?M.EMPTY:(r=r||new M(0,0,1,1),r.x=this.minX,r.y=this.minY,r.width=this.maxX-this.minX,r.height=this.maxY-this.minY,r)},t.prototype.addPoint=function(r){this.minX=Math.min(this.minX,r.x),this.maxX=Math.max(this.maxX,r.x),this.minY=Math.min(this.minY,r.y),this.maxY=Math.max(this.maxY,r.y)},t.prototype.addPointMatrix=function(r,e){var i=r.a,n=r.b,a=r.c,s=r.d,o=r.tx,h=r.ty,u=i*e.x+a*e.y+o,l=n*e.x+s*e.y+h;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},t.prototype.addQuad=function(r){var e=this.minX,i=this.minY,n=this.maxX,a=this.maxY,s=r[0],o=r[1];e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[2],o=r[3],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[4],o=r[5],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=r[6],o=r[7],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,this.minX=e,this.minY=i,this.maxX=n,this.maxY=a},t.prototype.addFrame=function(r,e,i,n,a){this.addFrameMatrix(r.worldTransform,e,i,n,a)},t.prototype.addFrameMatrix=function(r,e,i,n,a){var s=r.a,o=r.b,h=r.c,u=r.d,l=r.tx,c=r.ty,f=this.minX,d=this.minY,p=this.maxX,v=this.maxY,_=s*e+h*i+l,m=o*e+u*i+c;f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*n+h*i+l,m=o*n+u*i+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*e+h*a+l,m=o*e+u*a+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=s*n+h*a+l,m=o*n+u*a+c,f=_<f?_:f,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,this.minX=f,this.minY=d,this.maxX=p,this.maxY=v},t.prototype.addVertexData=function(r,e,i){for(var n=this.minX,a=this.minY,s=this.maxX,o=this.maxY,h=e;h<i;h+=2){var u=r[h],l=r[h+1];n=u<n?u:n,a=l<a?l:a,s=u>s?u:s,o=l>o?l:o}this.minX=n,this.minY=a,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(r,e,i,n){this.addVerticesMatrix(r.worldTransform,e,i,n)},t.prototype.addVerticesMatrix=function(r,e,i,n,a,s){a===void 0&&(a=0),s===void 0&&(s=a);for(var o=r.a,h=r.b,u=r.c,l=r.d,c=r.tx,f=r.ty,d=this.minX,p=this.minY,v=this.maxX,_=this.maxY,m=i;m<n;m+=2){var T=e[m],x=e[m+1],E=o*T+u*x+c,g=l*x+h*T+f;d=Math.min(d,E-a),v=Math.max(v,E+a),p=Math.min(p,g-s),_=Math.max(_,g+s)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=_},t.prototype.addBounds=function(r){var e=this.minX,i=this.minY,n=this.maxX,a=this.maxY;this.minX=r.minX<e?r.minX:e,this.minY=r.minY<i?r.minY:i,this.maxX=r.maxX>n?r.maxX:n,this.maxY=r.maxY>a?r.maxY:a},t.prototype.addBoundsMask=function(r,e){var i=r.minX>e.minX?r.minX:e.minX,n=r.minY>e.minY?r.minY:e.minY,a=r.maxX<e.maxX?r.maxX:e.maxX,s=r.maxY<e.maxY?r.maxY:e.maxY;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},t.prototype.addBoundsMatrix=function(r,e){this.addFrameMatrix(e,r.minX,r.minY,r.maxX,r.maxY)},t.prototype.addBoundsArea=function(r,e){var i=r.minX>e.x?r.minX:e.x,n=r.minY>e.y?r.minY:e.y,a=r.maxX<e.x+e.width?r.maxX:e.x+e.width,s=r.maxY<e.y+e.height?r.maxY:e.y+e.height;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},t.prototype.pad=function(r,e){r===void 0&&(r=0),e===void 0&&(e=r),this.isEmpty()||(this.minX-=r,this.maxX+=r,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(r,e,i,n,a,s){r-=a,e-=s,i+=a,n+=s,this.minX=this.minX<r?this.minX:r,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>n?this.maxY:n},t}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var zi=function(t,r){return zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},zi(t,r)};function Hn(t,r){zi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var ze=function(t){Hn(r,t);function r(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new vn,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new ys,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return r.mixin=function(e){for(var i=Object.keys(e),n=0;n<i.length;++n){var a=i[n];Object.defineProperty(r.prototype,a,Object.getOwnPropertyDescriptor(e,a))}},Object.defineProperty(r.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),r.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},r.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},r.prototype.getBounds=function(e,i){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new M),i=this._boundsRect),this._bounds.getRectangle(i)},r.prototype.getLocalBounds=function(e){e||(this._localBoundsRect||(this._localBoundsRect=new M),e=this._localBoundsRect),this._localBounds||(this._localBounds=new ys);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var a=this._bounds,s=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,e);return this.parent=n,this.transform=i,this._bounds=a,this._bounds.updateID+=this._boundsID-s,o},r.prototype.toGlobal=function(e,i,n){return n===void 0&&(n=!1),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,i)},r.prototype.toLocal=function(e,i,n,a){return i&&(e=i.toGlobal(e,n,a)),a||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)},r.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},r.prototype.setTransform=function(e,i,n,a,s,o,h,u,l){return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=1),s===void 0&&(s=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=e,this.position.y=i,this.scale.x=n||1,this.scale.y=a||1,this.rotation=s,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},r.prototype.destroy=function(e){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(r.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new Yd),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),r.prototype.enableTempParent=function(){var e=this.parent;return this.parent=this._tempDisplayObjectParent,e},r.prototype.disableTempParent=function(e){this.parent=e},Object.defineProperty(r.prototype,"x",{get:function(){return this.position.x},set:function(e){this.transform.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this.position.y},set:function(e){this.transform.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this.transform.position},set:function(e){this.transform.position.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scale",{get:function(){return this.transform.scale},set:function(e){this.transform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(e){this.transform.pivot.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"skew",{get:function(){return this.transform.skew},set:function(e){this.transform.skew.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(e){this.transform.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"angle",{get:function(){return this.transform.rotation*qo},set:function(e){this.transform.rotation=e*Ko},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"zIndex",{get:function(){return this._zIndex},set:function(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"worldVisible",{get:function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mask",{get:function(){return this._mask},set:function(e){if(this._mask!==e){if(this._mask){var i=this._mask.maskObject||this._mask;i._maskRefCount--,i._maskRefCount===0&&(i.renderable=!0,i.isMask=!1)}if(this._mask=e,this._mask){var i=this._mask.maskObject||this._mask;i._maskRefCount===0&&(i.renderable=!1,i.isMask=!0),i._maskRefCount++}}},enumerable:!1,configurable:!0}),r}(we),Yd=function(t){Hn(r,t);function r(){var e=t!==null&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return r}(ze);ze.prototype.displayObjectUpdateTransform=ze.prototype.updateTransform;/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var gs;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(gs||(gs={}));var Ts;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(Ts||(Ts={}));var xs;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(xs||(xs={}));var bs;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(bs||(bs={}));var Is;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Is||(Is={}));var Es;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(Es||(Es={}));var Rs;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Rs||(Rs={}));var Cs;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(Cs||(Cs={}));var ws;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(ws||(ws={}));var Ps;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(Ps||(Ps={}));var Ns;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ns||(Ns={}));var As;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(As||(As={}));var Us;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(Us||(Us={}));var Os;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(Os||(Os={}));var Ss;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(Ss||(Ss={}));var Ls;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Ls||(Ls={}));var Wi;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(Wi||(Wi={}));var Fs;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(Fs||(Fs={}));var Gs;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Gs||(Gs={}));function $d(t,r){return t.zIndex===r.zIndex?t._lastSortedIndex-r._lastSortedIndex:t.zIndex-r.zIndex}var Bs=function(t){Hn(r,t);function r(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=gh.SORTABLE_CHILDREN,e.sortDirty=!1,e}return r.prototype.onChildrenChange=function(e){},r.prototype.addChild=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var a=0;a<i.length;a++)this.addChild(i[a]);else{var s=i[0];s.parent&&s.parent.removeChild(s),s.parent=this,this.sortDirty=!0,s.transform._parentID=-1,this.children.push(s),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",s,this,this.children.length-1),s.emit("added",this)}return i[0]},r.prototype.addChildAt=function(e,i){if(i<0||i>this.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},r.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),a=this.getChildIndex(i);this.children[n]=i,this.children[a]=e,this.onChildrenChange(n<a?n:a)}},r.prototype.getChildIndex=function(e){var i=this.children.indexOf(e);if(i===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return i},r.prototype.setChildIndex=function(e,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Gt(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},r.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},r.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var a=0;a<i.length;a++)this.removeChild(i[a]);else{var s=i[0],o=this.children.indexOf(s);if(o===-1)return null;s.parent=null,s.transform._parentID=-1,Gt(this.children,o,1),this._boundsID++,this.onChildrenChange(o),s.emit("removed",this),this.emit("childRemoved",s,this,o)}return i[0]},r.prototype.removeChildAt=function(e){var i=this.getChildAt(e);return i.parent=null,i.transform._parentID=-1,Gt(this.children,e,1),this._boundsID++,this.onChildrenChange(e),i.emit("removed",this),this.emit("childRemoved",i,this,e),i},r.prototype.removeChildren=function(e,i){e===void 0&&(e=0),i===void 0&&(i=this.children.length);var n=e,a=i,s=a-n,o;if(s>0&&s<=a){o=this.children.splice(n,s);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(s===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},r.prototype.sortChildren=function(){for(var e=!1,i=0,n=this.children.length;i<n;++i){var a=this.children[i];a._lastSortedIndex=i,!e&&a.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort($d),this.sortDirty=!1},r.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,i=this.children.length;e<i;++e){var n=this.children[e];n.visible&&n.updateTransform()}},r.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var i=this.children[e];if(!(!i.visible||!i.renderable))if(i.calculateBounds(),i._mask){var n=i._mask.maskObject||i._mask;n.calculateBounds(),this._bounds.addBoundsMask(i._bounds,n._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._bounds.updateID=this._boundsID},r.prototype.getLocalBounds=function(e,i){i===void 0&&(i=!1);var n=t.prototype.getLocalBounds.call(this,e);if(!i)for(var a=0,s=this.children.length;a<s;++a){var o=this.children[a];o.visible&&o.updateTransform()}return n},r.prototype._calculateBounds=function(){},r.prototype._renderWithCulling=function(e){var i=e.renderTexture.sourceFrame;if(i.width>0&&i.height>0){var n,a;if(this.cullArea?(n=this.cullArea,a=this.worldTransform):this._render!==r.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,a))this._render(e);else if(this.cullArea)return;for(var s=0,o=this.children.length;s<o;++s){var h=this.children[s],u=h.cullable;h.cullable=u||!this.cullArea,h.render(e),h.cullable=u}}},r.prototype.render=function(e){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(var i=0,n=this.children.length;i<n;++i)this.children[i].render(e)}},r.prototype.renderAdvanced=function(e){var i=this.filters,n=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var a=0;a<i.length;a++)i[a].enabled&&this._enabledFilters.push(i[a])}var s=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==Wi.NONE));if(s&&e.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(var a=0,o=this.children.length;a<o;++a)this.children[a].render(e)}s&&e.batch.flush(),n&&e.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},r.prototype._render=function(e){},r.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i=typeof e=="boolean"?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(i)for(var a=0;a<n.length;++a)n[a].destroy(e)},Object.defineProperty(r.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(e){var i=this.getLocalBounds().width;i!==0?this.scale.x=e/i:this.scale.x=1,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(e){var i=this.getLocalBounds().height;i!==0?this.scale.y=e/i:this.scale.y=1,this._height=e},enumerable:!1,configurable:!0}),r}(ze);Bs.prototype.containerUpdateTransform=Bs.prototype.updateTransform;var hi=new M,Ms=4,t_=function(){function t(r){this.renderer=r}return t.prototype.image=function(r,e,i){var n=new Image;return n.src=this.base64(r,e,i),n},t.prototype.base64=function(r,e,i){return this.canvas(r).toDataURL(e,i)},t.prototype.canvas=function(r){var e=this.renderer,i,n,a=!1,s,o=!1;r&&(r instanceof he?s=r:(s=this.renderer.generateTexture(r),o=!0)),s?(i=s.baseTexture.resolution,n=s.frame,a=!1,e.renderTexture.bind(s)):(i=this.renderer.resolution,a=!0,n=hi,n.width=this.renderer.width,n.height=this.renderer.height,e.renderTexture.bind(null));var h=Math.floor(n.width*i+1e-4),u=Math.floor(n.height*i+1e-4),l=new da(h,u,1),c=new Uint8Array(Ms*h*u),f=e.gl;f.readPixels(n.x*i,n.y*i,h,u,f.RGBA,f.UNSIGNED_BYTE,c);var d=l.context.getImageData(0,0,h,u);if(t.arrayPostDivide(c,d.data),l.context.putImageData(d,0,0),a){var p=new da(l.width,l.height,1);p.context.scale(1,-1),p.context.drawImage(l.canvas,0,-u),l.destroy(),l=p}return o&&s.destroy(!0),l.canvas},t.prototype.pixels=function(r,e){var i=this.renderer,n,a,s,o=!1;r&&(r instanceof he?s=r:r instanceof ze&&(s=this.renderer.generateTexture(r),o=!0)),s?e?(n=e.resolution,a=s.frame,i.renderTexture.bind(s)):(n=s.baseTexture.resolution,a=s.frame,i.renderTexture.bind(s)):e?(n=e.resolution,a=hi,a.width=e.width,a.height=e.height,i.renderTexture.bind(null)):(n=i.resolution,a=hi,a.width=i.width,a.height=i.height,i.renderTexture.bind(null));var h=a.width*n,u=a.height*n,l=new Uint8Array(Ms*h*u),c=i.gl;return c.readPixels(a.x*n,a.y*n,h,u,c.RGBA,c.UNSIGNED_BYTE,l),o&&s.destroy(!0),t.arrayPostDivide(l,l),l},t.prototype.destroy=function(){this.renderer=null},t.arrayPostDivide=function(r,e){for(var i=0;i<r.length;i+=4){var n=e[i+3]=r[i+3];n!==0?(e[i]=Math.round(Math.min(r[i]*255/n,255)),e[i+1]=Math.round(Math.min(r[i+1]*255/n,255)),e[i+2]=Math.round(Math.min(r[i+2]*255/n,255))):(e[i]=r[i],e[i+1]=r[i+1],e[i+2]=r[i+2])}},t}();/*!
* @pixi/loaders - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/loaders is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var mr=function(){function t(r,e,i){e===void 0&&(e=!1),this._fn=r,this._once=e,this._thisArg=i,this._next=this._prev=this._owner=null}return t.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},t}();function Xs(t,r){return t._head?(t._tail._next=r,r._prev=t._tail,t._tail=r):(t._head=r,t._tail=r),r._owner=t,r}var St=function(){function t(){this._head=this._tail=void 0}return t.prototype.handlers=function(r){r===void 0&&(r=!1);var e=this._head;if(r)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i},t.prototype.has=function(r){if(!(r instanceof mr))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return r._owner===this},t.prototype.dispatch=function(){for(var r=arguments,e=[],i=0;i<arguments.length;i++)e[i]=r[i];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,e),n=n._next;return!0},t.prototype.add=function(r,e){if(e===void 0&&(e=null),typeof r!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return Xs(this,new mr(r,!1,e))},t.prototype.once=function(r,e){if(e===void 0&&(e=null),typeof r!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return Xs(this,new mr(r,!0,e))},t.prototype.detach=function(r){if(!(r instanceof mr))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return r._owner!==this?this:(r._prev&&(r._prev._next=r._next),r._next&&(r._next._prev=r._prev),r===this._head?(this._head=r._next,r._next===null&&(this._tail=null)):r===this._tail&&(this._tail=r._prev,this._tail._next=null),r._owner=null,this)},t.prototype.detachAll=function(){var r=this._head;if(!r)return this;for(this._head=this._tail=null;r;)r._owner=null,r=r._next;return this},t}();function Th(t,r){r=r||{};for(var e={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=e.parser[r.strictMode?"strict":"loose"].exec(t),n={},a=14;a--;)n[e.key[a]]=i[a]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(s,o,h){o&&(n[e.q.name][o]=h)}),n}var ui,yr=null,qd=0,ks=200,Kd=204,Zd=1223,Jd=2;function Hs(){}function Ds(t,r,e){r&&r.indexOf(".")===0&&(r=r.substring(1)),r&&(t[r]=e)}function li(t){return t.toString().replace("object ","")}var J=function(){function t(r,e,i){if(this._dequeue=Hs,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof r!="string"||typeof e!="string")throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,e.indexOf("data:")===0),this.name=r,this.url=e,this.extension=this._getExtension(),this.data=null,this.crossOrigin=i.crossOrigin===!0?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=Hs,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new St,this.onProgress=new St,this.onComplete=new St,this.onAfterMiddleware=new St}return t.setExtensionLoadType=function(r,e){Ds(t._loadTypeMap,r,e)},t.setExtensionXhrType=function(r,e){Ds(t._xhrTypeMap,r,e)},Object.defineProperty(t.prototype,"isDataUrl",{get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(r){if(!this.error){if(this.error=new Error(r),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(r){var e=this;if(!this.isLoading){if(this.isComplete){r&&setTimeout(function(){return r(e)},1);return}else r&&this.onComplete.once(r);switch(this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:typeof ui=="undefined"&&(ui=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),ui&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},t.prototype._hasFlag=function(r){return(this._flags&r)!==0},t.prototype._setFlag=function(r,e){this._flags=e?this._flags|r:this._flags&~r},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(r){this.metadata.loadElement?this.data=this.metadata.loadElement:r==="image"&&typeof globalThis.Image!="undefined"?this.data=new Image:this.data=document.createElement(r),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(r){if(this.metadata.loadElement?this.data=this.metadata.loadElement:r==="audio"&&typeof globalThis.Audio!="undefined"?this.data=new Audio:this.data=document.createElement(r),this.data===null){this.abort("Unsupported element: "+r);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(r,this.url[i],Array.isArray(e)?e[i]:e));else{var e=this.metadata.mimeType;this.data.appendChild(this._createSource(r,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var r=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(r.withCredentials=!0),r.open("GET",this.url,!0),r.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?r.responseType=t.XHR_RESPONSE_TYPE.TEXT:r.responseType=this.xhrType,r.addEventListener("error",this._boundXhrOnError,!1),r.addEventListener("timeout",this._boundXhrOnTimeout,!1),r.addEventListener("abort",this._boundXhrOnAbort,!1),r.addEventListener("progress",this._boundOnProgress,!1),r.addEventListener("load",this._boundXhrOnLoad,!1),r.send()},t.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var r=this.xhr=new globalThis.XDomainRequest;r.timeout=this.timeout||5e3,r.onerror=this._boundXhrOnError,r.ontimeout=this._boundXhrOnTimeout,r.onprogress=this._boundOnProgress,r.onload=this._boundXhrOnLoad,r.open("GET",this.url,!0),setTimeout(function(){return r.send()},1)},t.prototype._createSource=function(r,e,i){i||(i=r+"/"+this._getExtension(e));var n=document.createElement("source");return n.src=e,n.type=i,n},t.prototype._onError=function(r){this.abort("Failed to load element using: "+r.target.nodeName)},t.prototype._onProgress=function(r){r&&r.lengthComputable&&this.onProgress.dispatch(this,r.loaded/r.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var r=this.xhr;this.abort(li(r)+" Request failed. Status: "+r.status+', text: "'+r.statusText+'"')},t.prototype._xhrOnTimeout=function(){var r=this.xhr;this.abort(li(r)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var r=this.xhr;this.abort(li(r)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var r=this.xhr,e="",i=typeof r.status=="undefined"?ks:r.status;(r.responseType===""||r.responseType==="text"||typeof r.responseType=="undefined")&&(e=r.responseText),i===qd&&(e.length>0||r.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=ks:i===Zd&&(i=Kd);var n=i/100|0;if(n===Jd)if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=t.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var a=new DOMParser;this.data=a.parseFromString(e,"text/xml")}else{var s=document.createElement("div");s.innerHTML=e,this.data=s}this.type=t.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=r.response||e;else{this.abort("["+r.status+"] "+r.statusText+": "+r.responseURL);return}this.complete()},t.prototype._determineCrossOrigin=function(r,e){if(r.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,yr||(yr=document.createElement("a")),yr.href=r;var i=Th(yr.href,{strictMode:!0}),n=!i.port&&e.port===""||i.port===e.port,a=i.protocol?i.protocol+":":"";return i.host!==e.hostname||!n||a!==e.protocol?"anonymous":""},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(r){r===void 0&&(r=this.url);var e="";if(this.isDataUrl){var i=r.indexOf("/");e=r.substring(i+1,r.indexOf(";",i))}else{var n=r.indexOf("?"),a=r.indexOf("#"),s=Math.min(n>-1?n:r.length,a>-1?a:r.length);r=r.substring(0,s),e=r.substring(r.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(r){switch(r){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();(function(t){(function(r){r[r.NONE=0]="NONE",r[r.DATA_URL=1]="DATA_URL",r[r.COMPLETE=2]="COMPLETE",r[r.LOADING=4]="LOADING"})(t.STATUS_FLAGS||(t.STATUS_FLAGS={})),function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.JSON=1]="JSON",r[r.XML=2]="XML",r[r.IMAGE=3]="IMAGE",r[r.AUDIO=4]="AUDIO",r[r.VIDEO=5]="VIDEO",r[r.TEXT=6]="TEXT"}(t.TYPE||(t.TYPE={})),function(r){r[r.XHR=1]="XHR",r[r.IMAGE=2]="IMAGE",r[r.AUDIO=3]="AUDIO",r[r.VIDEO=4]="VIDEO"}(t.LOAD_TYPE||(t.LOAD_TYPE={})),function(r){r.DEFAULT="text",r.BUFFER="arraybuffer",r.BLOB="blob",r.DOCUMENT="document",r.JSON="json",r.TEXT="text"}(t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})),t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(J||(J={}));function Qt(){}function Qd(t){return function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(t===null)throw new Error("Callback was already called.");var a=t;t=null,a.apply(this,i)}}var tp=function(){function t(r,e){this.data=r,this.callback=e}return t}(),fi=function(){function t(r,e){var i=this;if(e===void 0&&(e=1),this.workers=0,this.saturated=Qt,this.unsaturated=Qt,this.empty=Qt,this.drain=Qt,this.error=Qt,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,a,s){if(s&&typeof s!="function")throw new Error("task callback must be a function");if(i.started=!0,n==null&&i.idle()){setTimeout(function(){return i.drain()},1);return}var o=new tp(n,typeof s=="function"?s:Qt);a?i._tasks.unshift(o):i._tasks.push(o),setTimeout(i.process,1)},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var n=i._tasks.shift();i._tasks.length===0&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(n.data,Qd(i._next(n)))}},this._worker=r,e===0)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return t.prototype._next=function(r){var e=this;return function(){for(var i=arguments,n=[],a=0;a<arguments.length;a++)n[a]=i[a];e.workers-=1,r.callback.apply(r,n),n[0]!=null&&e.error(n[0],r.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},t.prototype.push=function(r,e){this._insert(r,!1,e)},t.prototype.kill=function(){this.workers=0,this.drain=Qt,this.started=!1,this._tasks=[]},t.prototype.unshift=function(r,e){this._insert(r,!0,e)},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},t.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var r=1;r<=this.concurrency;r++)this.process()}},t.eachSeries=function(r,e,i,n){var a=0,s=r.length;function o(h){if(h||a===s){i&&i(h);return}n?setTimeout(function(){e(r[a++],o)},1):e(r[a++],o)}o()},t.queue=function(r,e){return new t(r,e)},t}(),ci=100,ep=/(#[\w-]+)?$/,We=function(){function t(r,e){var i=this;r===void 0&&(r=""),e===void 0&&(e=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this.resources={},this.baseUrl=r,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this._queue=fi.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new St,this.onError=new St,this.onLoad=new St,this.onStart=new St,this.onComplete=new St;for(var n=0;n<t._plugins.length;++n){var a=t._plugins[n],s=a.pre,o=a.use;s&&this.pre(s),o&&this.use(o)}this._protected=!1}return t.prototype._add=function(r,e,i,n){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[r])throw new Error('Resource named "'+r+'" already exists.');if(e=this._prepareUrl(e),this.resources[r]=new J(r,e,i),typeof n=="function"&&this.resources[r].onAfterMiddleware.once(n),this.loading){for(var a=i.parentResource,s=[],o=0;o<a.children.length;++o)a.children[o].isComplete||s.push(a.children[o]);var h=a.progressChunk*(s.length+1),u=h/(s.length+2);a.children.push(this.resources[r]),a.progressChunk=u;for(var o=0;o<s.length;++o)s[o].progressChunk=u;this.resources[r].progressChunk=u}return this._queue.push(this.resources[r]),this},t.prototype.pre=function(r){return this._beforeMiddleware.push(r),this},t.prototype.use=function(r){return this._afterMiddleware.push(r),this},t.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var r in this.resources){var e=this.resources[r];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},t.prototype.load=function(r){if(typeof r=="function"&&this.onComplete.once(r),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=this._queue._tasks.length,i=ci/e,n=0;n<this._queue._tasks.length;++n)this._queue._tasks[n].data.progressChunk=i;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(r){this._queue.concurrency=r},enumerable:!1,configurable:!0}),t.prototype._prepareUrl=function(r){var e=Th(r,{strictMode:!0}),i;if(e.protocol||!e.path||r.indexOf("//")===0?i=r:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&r.charAt(0)!=="/"?i=this.baseUrl+"/"+r:i=this.baseUrl+r,this.defaultQueryString){var n=ep.exec(i)[0];i=i.slice(0,i.length-n.length),i.indexOf("?")!==-1?i+="&"+this.defaultQueryString:i+="?"+this.defaultQueryString,i+=n}return i},t.prototype._loadResource=function(r,e){var i=this;r._dequeue=e,fi.eachSeries(this._beforeMiddleware,function(n,a){n.call(i,r,function(){a(r.isComplete?{}:null)})},function(){r.isComplete?i._onLoad(r):(r._onLoadBinding=r.onComplete.once(i._onLoad,i),r.load())},!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=ci,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(r){var e=this;r._onLoadBinding=null,this._resourcesParsing.push(r),r._dequeue(),fi.eachSeries(this._afterMiddleware,function(i,n){i.call(e,r,n)},function(){r.onAfterMiddleware.dispatch(r),e.progress=Math.min(ci,e.progress+r.progressChunk),e.onProgress.dispatch(e,r),r.error?e.onError.dispatch(r.error,e,r):e.onLoad.dispatch(e,r),e._resourcesParsing.splice(e._resourcesParsing.indexOf(r),1),e._queue.idle()&&e._resourcesParsing.length===0&&e._onComplete()},!0)},t.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(t,"shared",{get:function(){var r=t._shared;return r||(r=new t,r._protected=!0,t._shared=r),r},enumerable:!1,configurable:!0}),t.registerPlugin=function(r){return t._plugins.push(r),r.add&&r.add(),t},t._plugins=[],t}();We.prototype.add=function(r,e,i,n){if(Array.isArray(r)){for(var a=0;a<r.length;++a)this.add(r[a]);return this}if(typeof r=="object"&&(i=r,n=e||i.callback||i.onComplete,e=i.url,r=i.name||i.key||i.url),typeof e!="string"&&(n=i,i=e,e=r),typeof e!="string")throw new Error("No url passed to add resource to loader.");return typeof i=="function"&&(n=i,i=null),this._add(r,e,i,n)};var e_=function(){function t(){}return t.init=function(r){r=Object.assign({sharedLoader:!1},r),this.loader=r.sharedLoader?We.shared:new We},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t}(),rp=function(){function t(){}return t.add=function(){J.setExtensionLoadType("svg",J.LOAD_TYPE.XHR),J.setExtensionXhrType("svg",J.XHR_RESPONSE_TYPE.TEXT)},t.use=function(r,e){if(r.data&&(r.type===J.TYPE.IMAGE||r.extension==="svg")){var i=r.data,n=r.url,a=r.name,s=r.metadata;F.fromLoader(i,n,a,s).then(function(o){r.texture=o,e()}).catch(e)}else e()},t}(),ip="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function np(t){for(var r="",e=0;e<t.length;){for(var i=[0,0,0],n=[0,0,0,0],a=0;a<i.length;++a)e<t.length?i[a]=t.charCodeAt(e++)&255:i[a]=0;n[0]=i[0]>>2,n[1]=(i[0]&3)<<4|i[1]>>4,n[2]=(i[1]&15)<<2|i[2]>>6,n[3]=i[2]&63;var s=e-(t.length-1);switch(s){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var a=0;a<n.length;++a)r+=ip.charAt(n[a])}return r}function ap(t,r){if(!t.data){r();return}if(t.xhr&&t.xhrType===J.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof t.data=="string"){var e=t.xhr.getResponseHeader("content-type");if(e&&e.indexOf("image")===0){t.data=new Image,t.data.src="data:"+e+";base64,"+np(t.xhr.responseText),t.type=J.TYPE.IMAGE,t.data.onload=function(){t.data.onload=null,r()};return}}else if(t.data.type.indexOf("image")===0){var i=globalThis.URL||globalThis.webkitURL,n=i.createObjectURL(t.data);t.blob=t.data,t.data=new Image,t.data.src=n,t.type=J.TYPE.IMAGE,t.data.onload=function(){i.revokeObjectURL(n),t.data.onload=null,r()};return}}r()}We.registerPlugin({use:ap});We.registerPlugin(rp);/*!
* @pixi/compressed-textures - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/compressed-textures is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var z,B;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"})(B||(B={}));var Sr=(z={},z[B.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,z[B.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,z[B.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,z[B.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,z[B.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,z[B.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,z[B.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,z[B.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,z[B.COMPRESSED_R11_EAC]=.5,z[B.COMPRESSED_SIGNED_R11_EAC]=.5,z[B.COMPRESSED_RG11_EAC]=1,z[B.COMPRESSED_SIGNED_RG11_EAC]=1,z[B.COMPRESSED_RGB8_ETC2]=.5,z[B.COMPRESSED_RGBA8_ETC2_EAC]=1,z[B.COMPRESSED_SRGB8_ETC2]=.5,z[B.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,z[B.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[B.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[B.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,z[B.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,z[B.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,z[B.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,z[B.COMPRESSED_RGB_ETC1_WEBGL]=.5,z[B.COMPRESSED_RGB_ATC_WEBGL]=.5,z[B.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,z[B.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,z);/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Yi=function(t,r){return Yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Yi(t,r)};function xh(t,r){Yi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function sp(t,r,e,i){return new(e||(e=Promise))(function(n,a){function s(u){try{h(i.next(u))}catch(l){a(l)}}function o(u){try{h(i.throw(u))}catch(l){a(l)}}function h(u){u.done?n(u.value):new e(function(l){l(u.value)}).then(s,o)}h((i=i.apply(t,r||[])).next())})}function op(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=r.call(t,e)}catch(l){u=[6,l],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var hp=function(t){xh(r,t);function r(e,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,a,s;return typeof e=="string"?(a=e,s=new Uint8Array):(a=null,s=e),n=t.call(this,s,i)||this,n.origin=a,n.buffer=s?new Fi(s):null,n.origin&&i.autoLoad!==!1&&n.load(),s&&s.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return r.prototype.onBlobLoaded=function(e){},r.prototype.load=function(){return sp(this,void 0,Promise,function(){var e,i,n;return op(this,function(a){switch(a.label){case 0:return[4,fetch(this.origin)];case 1:return e=a.sent(),[4,e.blob()];case 2:return i=a.sent(),[4,i.arrayBuffer()];case 3:return n=a.sent(),this.data=new Uint32Array(n),this.buffer=new Fi(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},r}(Je),$i=function(t){xh(r,t);function r(e,i){var n=t.call(this,e,i)||this;return n.format=i.format,n.levels=i.levels||1,n._width=i.width,n._height=i.height,n._extension=r._formatToExtension(n.format),(i.levelBuffers||n.buffer)&&(n._levelBuffers=i.levelBuffers||r._createLevelBuffers(e instanceof Uint8Array?e:n.buffer.uint8View,n.format,n.levels,4,4,n.width,n.height)),n}return r.prototype.upload=function(e,i,n){var a=e.gl,s=e.context.extensions[this._extension];if(!s)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,h=this.levels;o<h;o++){var u=this._levelBuffers[o],l=u.levelID,c=u.levelWidth,f=u.levelHeight,d=u.levelBuffer;a.compressedTexImage2D(a.TEXTURE_2D,l,this.format,c,f,0,d)}return!0},r.prototype.onBlobLoaded=function(){this._levelBuffers=r._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},r._formatToExtension=function(e){if(e>=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},r._createLevelBuffers=function(e,i,n,a,s,o,h){for(var u=new Array(n),l=e.byteOffset,c=o,f=h,d=c+a-1&~(a-1),p=f+s-1&~(s-1),v=d*p*Sr[i],_=0;_<n;_++)u[_]={levelID:_,levelWidth:n>1?c:d,levelHeight:n>1?f:p,levelBuffer:new Uint8Array(e.buffer,l,v)},l+=v,c=c>>1||1,f=f>>1||1,d=c+a-1&~(a-1),p=f+s-1&~(s-1),v=d*p*Sr[i];return u},r}(hp),r_=function(){function t(){}return t.use=function(r,e){var i=r.data,n=this;if(r.type===J.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var a=i.textures,s=void 0,o=void 0,h=0,u=a.length;h<u;h++){var l=a[h],c=l.src,f=l.format;if(f||(o=c),t.textureFormats[f]){s=c;break}}if(s=s||o,!s){e(new Error("Cannot load compressed-textures in "+r.url+", make sure you provide a fallback"));return}if(s===r.url){e(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var d={crossOrigin:r.crossOrigin,metadata:r.metadata.imageMetadata,parentResource:r},p=Te.resolve(r.url.replace(n.baseUrl,""),s),v=i.cacheID;n.add(v,p,d,function(_){if(_.error){e(_.error);return}var m=_.texture,T=m===void 0?null:m,x=_.textures,E=x===void 0?{}:x;Object.assign(r,{texture:T,textures:E}),e()})}else e()},Object.defineProperty(t,"textureExtensions",{get:function(){if(!t._textureExtensions){var r=document.createElement("canvas"),e=r.getContext("webgl");if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var i={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};t._textureExtensions=i}return t._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(t,"textureFormats",{get:function(){if(!t._textureFormats){var r=t.textureExtensions;t._textureFormats={};for(var e in r){var i=r[e];!i||Object.assign(t._textureFormats,Object.getPrototypeOf(i))}}return t._textureFormats},enumerable:!1,configurable:!0}),t}();function bh(t,r,e){var i={textures:{},texture:null};if(!r)return i;var n=r.map(function(a){return new F(new H(a,Object.assign({mipmap:Xt.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA},e)))});return n.forEach(function(a,s){var o=a.baseTexture,h=t+"-"+(s+1);H.addToCache(o,h),F.addToCache(a,h),s===0&&(H.addToCache(o,t),F.addToCache(a,t),i.texture=a),i.textures[h]=a}),i}var Fe,ct;J.setExtensionXhrType("dds",J.XHR_RESPONSE_TYPE.BUFFER);var di=4,gr=124,up=32,Vs=20,lp=542327876,Tr={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},fp={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},xr={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},pt;(function(t){t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(pt||(pt={}));var qi;(function(t){t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(qi||(qi={}));var cp=1,dp=2,pp=4,vp=64,_p=512,mp=131072,yp=827611204,gp=861165636,Tp=894720068,xp=808540228,bp=4,Ip=(Fe={},Fe[yp]=B.COMPRESSED_RGBA_S3TC_DXT1_EXT,Fe[gp]=B.COMPRESSED_RGBA_S3TC_DXT3_EXT,Fe[Tp]=B.COMPRESSED_RGBA_S3TC_DXT5_EXT,Fe),Ep=(ct={},ct[pt.DXGI_FORMAT_BC1_TYPELESS]=B.COMPRESSED_RGBA_S3TC_DXT1_EXT,ct[pt.DXGI_FORMAT_BC1_UNORM]=B.COMPRESSED_RGBA_S3TC_DXT1_EXT,ct[pt.DXGI_FORMAT_BC2_TYPELESS]=B.COMPRESSED_RGBA_S3TC_DXT3_EXT,ct[pt.DXGI_FORMAT_BC2_UNORM]=B.COMPRESSED_RGBA_S3TC_DXT3_EXT,ct[pt.DXGI_FORMAT_BC3_TYPELESS]=B.COMPRESSED_RGBA_S3TC_DXT5_EXT,ct[pt.DXGI_FORMAT_BC3_UNORM]=B.COMPRESSED_RGBA_S3TC_DXT5_EXT,ct[pt.DXGI_FORMAT_BC1_UNORM_SRGB]=B.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ct[pt.DXGI_FORMAT_BC2_UNORM_SRGB]=B.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ct[pt.DXGI_FORMAT_BC3_UNORM_SRGB]=B.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ct),i_=function(){function t(){}return t.use=function(r,e){if(r.extension==="dds"&&r.data)try{Object.assign(r,bh(r.name||r.url,t.parse(r.data),r.metadata))}catch(i){e(i);return}e()},t.parse=function(r){var e=new Uint32Array(r),i=e[0];if(i!==lp)throw new Error("Invalid DDS file magic word");var n=new Uint32Array(r,0,gr/Uint32Array.BYTES_PER_ELEMENT),a=n[Tr.HEIGHT],s=n[Tr.WIDTH],o=n[Tr.MIPMAP_COUNT],h=new Uint32Array(r,Tr.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,up/Uint32Array.BYTES_PER_ELEMENT),u=h[cp];if(u&pp){var l=h[fp.FOURCC];if(l!==xp){var c=Ip[l],f=di+gr,d=new Uint8Array(r,f),p=new $i(d,{format:c,width:s,height:a,levels:o});return[p]}var v=di+gr,_=new Uint32Array(e.buffer,v,Vs/Uint32Array.BYTES_PER_ELEMENT),m=_[xr.DXGI_FORMAT],T=_[xr.RESOURCE_DIMENSION],x=_[xr.MISC_FLAG],E=_[xr.ARRAY_SIZE],g=Ep[m];if(g===void 0)throw new Error("DDSLoader cannot parse texture data with DXGI format "+m);if(x===bp)throw new Error("DDSLoader does not support cubemap textures");if(T===qi.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var y=new Array,b=di+gr+Vs;if(E===1)y.push(new Uint8Array(r,b));else{for(var C=Sr[g],I=0,w=s,S=a,G=0;G<o;G++){var X=Math.max(1,w+3&-4),rt=Math.max(1,S+3&-4),A=X*rt*C;I+=A,w=w>>>1,S=S>>>1}for(var U=b,G=0;G<E;G++)y.push(new Uint8Array(r,U,I)),U+=I}return y.map(function(k){return new $i(k,{format:g,width:s,height:a,levels:o})})}throw u&vp?new Error("DDSLoader does not support uncompressed texture data."):u&_p?new Error("DDSLoader does not supported YUV uncompressed texture data."):u&mp?new Error("DDSLoader does not support single-channel (lumninance) texture data!"):u&dp?new Error("DDSLoader does not support single-channel (alpha) texture data!"):new Error("DDSLoader failed to load a texture file due to an unknown reason!")},t}(),Dt,Ut,Ge;J.setExtensionXhrType("ktx",J.XHR_RESPONSE_TYPE.BUFFER);var js=[171,75,84,88,32,49,49,187,13,10,26,10],Rp=67305985,dt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},pi=64,zs=(Dt={},Dt[O.UNSIGNED_BYTE]=1,Dt[O.UNSIGNED_SHORT]=2,Dt[O.INT]=4,Dt[O.UNSIGNED_INT]=4,Dt[O.FLOAT]=4,Dt[O.HALF_FLOAT]=8,Dt),Cp=(Ut={},Ut[R.RGBA]=4,Ut[R.RGB]=3,Ut[R.RG]=2,Ut[R.RED]=1,Ut[R.LUMINANCE]=1,Ut[R.LUMINANCE_ALPHA]=2,Ut[R.ALPHA]=1,Ut),wp=(Ge={},Ge[O.UNSIGNED_SHORT_4_4_4_4]=2,Ge[O.UNSIGNED_SHORT_5_5_5_1]=2,Ge[O.UNSIGNED_SHORT_5_6_5]=2,Ge),n_=function(){function t(){}return t.use=function(r,e){if(r.extension==="ktx"&&r.data)try{var i=r.name||r.url,n=t.parse(i,r.data),a=n.compressed,s=n.uncompressed,o=n.kvData;if(a){var h=bh(i,a,r.metadata);if(o&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=o;Object.assign(r,h)}else if(s){var l={};s.forEach(function(c,f){var d=new F(new H(c.resource,{mipmap:Xt.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA,type:c.type,format:c.format})),p=i+"-"+(f+1);o&&(d.baseTexture.ktxKeyValueData=o),H.addToCache(d.baseTexture,p),F.addToCache(d,p),f===0&&(l[i]=d,H.addToCache(d.baseTexture,i),F.addToCache(d,i)),l[p]=d}),Object.assign(r,{textures:l})}}catch(c){e(c);return}e()},t.parse=function(r,e){var i=new DataView(e);if(!t.validate(r,i))return null;var n=i.getUint32(dt.ENDIANNESS,!0)===Rp,a=i.getUint32(dt.GL_TYPE,n),s=i.getUint32(dt.GL_FORMAT,n),o=i.getUint32(dt.GL_INTERNAL_FORMAT,n),h=i.getUint32(dt.PIXEL_WIDTH,n),u=i.getUint32(dt.PIXEL_HEIGHT,n)||1,l=i.getUint32(dt.PIXEL_DEPTH,n)||1,c=i.getUint32(dt.NUMBER_OF_ARRAY_ELEMENTS,n)||1,f=i.getUint32(dt.NUMBER_OF_FACES,n),d=i.getUint32(dt.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(dt.BYTES_OF_KEY_VALUE_DATA,n);if(u===0||l!==1)throw new Error("Only 2D textures are supported");if(f!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(c!==1)throw new Error("WebGL does not support array textures");var v=4,_=4,m=h+3&-4,T=u+3&-4,x=new Array(c),E=h*u;a===0&&(E=m*T);var g;if(a!==0?zs[a]?g=zs[a]*Cp[s]:g=wp[a]:g=Sr[o],g===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var y=t.loadKeyValueData?t.parseKvData(i,p,n):null,b=E*g,C=b,I=h,w=u,S=m,G=T,X=pi+p,rt=0;rt<d;rt++){for(var A=i.getUint32(X,n),U=X+4,k=0;k<c;k++){var nt=x[k];nt||(nt=x[k]=new Array(d)),nt[rt]={levelID:rt,levelWidth:d>1||a!==0?I:S,levelHeight:d>1||a!==0?w:G,levelBuffer:new Uint8Array(e,U,C)},U+=C}X+=A+4,X=X%4!==0?X+4-X%4:X,I=I>>1||1,w=w>>1||1,S=I+v-1&~(v-1),G=w+_-1&~(_-1),C=S*G*g}return a!==0?{uncompressed:x.map(function(j){var L=j[0].levelBuffer,yt=!1;return a===O.FLOAT?L=new Float32Array(j[0].levelBuffer.buffer,j[0].levelBuffer.byteOffset,j[0].levelBuffer.byteLength/4):a===O.UNSIGNED_INT?(yt=!0,L=new Uint32Array(j[0].levelBuffer.buffer,j[0].levelBuffer.byteOffset,j[0].levelBuffer.byteLength/4)):a===O.INT&&(yt=!0,L=new Int32Array(j[0].levelBuffer.buffer,j[0].levelBuffer.byteOffset,j[0].levelBuffer.byteLength/4)),{resource:new Je(L,{width:j[0].levelWidth,height:j[0].levelHeight}),type:a,format:yt?t.convertFormatToInteger(s):s}}),kvData:y}:{compressed:x.map(function(j){return new $i(null,{format:o,width:h,height:u,levels:d,levelBuffers:j})}),kvData:y}},t.validate=function(r,e){for(var i=0;i<js.length;i++)if(e.getUint8(i)!==js[i])return console.error(r+" is not a valid *.ktx file!"),!1;return!0},t.convertFormatToInteger=function(r){switch(r){case R.RGBA:return R.RGBA_INTEGER;case R.RGB:return R.RGB_INTEGER;case R.RG:return R.RG_INTEGER;case R.RED:return R.RED_INTEGER;default:return r}},t.parseKvData=function(r,e,i){for(var n=new Map,a=0;a<e;){var s=r.getUint32(pi+a,i),o=pi+a+4,h=3-(s+3)%4;if(s===0||s>e-a){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u<s&&r.getUint8(o+u)!==0;u++);if(u===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var l=new TextDecoder().decode(new Uint8Array(r.buffer,o,u)),c=new DataView(r.buffer,o+u+1,s-u-1);n.set(l,c),a+=4+s+h}return n},t.loadKeyValueData=!1,t}();/*!
* @pixi/particle-container - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/particle-container is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Ki=function(t,r){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Ki(t,r)};function Ih(t,r){Ki(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}(function(t){Ih(r,t);function r(e,i,n,a){e===void 0&&(e=1500),n===void 0&&(n=16384),a===void 0&&(a=!1);var s=t.call(this)||this,o=16384;return n>o&&(n=o),s._properties=[!1,!0,!1,!1,!1],s._maxSize=e,s._batchSize=n,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=P.NORMAL,s.autoResize=a,s.roundPixels=!0,s.baseTexture=null,s.setProperties(i),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return r.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Re(e,this.tintRgb)},enumerable:!1,configurable:!0}),r.prototype.render=function(e){var i=this;!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return i.onChildrenChange(0)})),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},r.prototype.onChildrenChange=function(e){for(var i=Math.floor(e/this._batchSize);this._bufferUpdateIDs.length<i;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[i]=++this._updateID},r.prototype.dispose=function(){if(this._buffers){for(var e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._buffers=null}},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},r})(wt);var Ws=function(){function t(r,e,i){this.geometry=new Qe,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<r.length;++n){var a=r[n];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||O.FLOAT,offset:a.offset},e[n]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var r=this.geometry,e=0;this.indexBuffer=new it(Sf(this.size),!0,!0),r.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];n.offset=e,e+=n.size,this.dynamicStride+=n.size}var a=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(a),this.dynamicDataUint32=new Uint32Array(a),this.dynamicBuffer=new it(this.dynamicData,!1,!1);var s=0;this.staticStride=0;for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];n.offset=s,s+=n.size,this.staticStride+=n.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new it(this.staticData,!0,!1);for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];r.addAttribute(n.attributeName,this.dynamicBuffer,0,n.type===O.UNSIGNED_BYTE,n.type,this.dynamicStride*4,n.offset*4)}for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];r.addAttribute(n.attributeName,this.staticBuffer,0,n.type===O.UNSIGNED_BYTE,n.type,this.staticStride*4,n.offset*4)}},t.prototype.uploadDynamic=function(r,e,i){for(var n=0;n<this.dynamicProperties.length;n++){var a=this.dynamicProperties[n];a.uploadFunction(r,e,i,a.type===O.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,a.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(r,e,i){for(var n=0;n<this.staticProperties.length;n++){var a=this.staticProperties[n];a.uploadFunction(r,e,i,a.type===O.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,a.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),Pp=`varying vec2 vTextureCoord;
varying vec4 vColor;
uniform sampler2D uSampler;
void main(void){
vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
gl_FragColor = color;
}`,Np=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
attribute vec2 aPositionCoord;
attribute float aRotation;
uniform mat3 translationMatrix;
uniform vec4 uColor;
varying vec2 vTextureCoord;
varying vec4 vColor;
void main(void){
float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
vec2 v = vec2(x, y);
v = v + aPositionCoord;
gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vColor = aColor * uColor;
}
`,a_=function(t){Ih(r,t);function r(e){var i=t.call(this,e)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Q,i.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:i.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:i.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:i.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:i.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:O.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=Wt.from(Np,Pp,{}),i.state=ue.for2d(),i}return r.prototype.render=function(e){var i=e.children,n=e._maxSize,a=e._batchSize,s=this.renderer,o=i.length;if(o!==0){o>n&&!e.autoResize&&(o=n);var h=e._buffers;h||(h=e._buffers=this.generateBuffers(e));var u=i[0]._texture.baseTexture;this.state.blendMode=Wo(e.blendMode,u.alphaMode),s.state.set(this.state);var l=s.gl,c=e.worldTransform.copyTo(this.tempMatrix);c.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=Of(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,u.alphaMode),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var f=!1,d=0,p=0;d<o;d+=a,p+=1){var v=o-d;v>a&&(v=a),p>=h.length&&h.push(this._generateOneMoreBuffer(e));var _=h[p];_.uploadDynamic(i,d,v);var m=e._bufferUpdateIDs[p]||0;f=f||_._updateID<m,f&&(_._updateID=e._updateID,_.uploadStatic(i,d,v)),s.geometry.bind(_.geometry),l.drawElements(l.TRIANGLES,v*6,l.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(e){for(var i=[],n=e._maxSize,a=e._batchSize,s=e._properties,o=0;o<n;o+=a)i.push(new Ws(this.properties,s,a));return i},r.prototype._generateOneMoreBuffer=function(e){var i=e._batchSize,n=e._properties;return new Ws(this.properties,n,i)},r.prototype.uploadVertices=function(e,i,n,a,s,o){for(var h=0,u=0,l=0,c=0,f=0;f<n;++f){var d=e[i+f],p=d._texture,v=d.scale.x,_=d.scale.y,m=p.trim,T=p.orig;m?(u=m.x-d.anchor.x*T.width,h=u+m.width,c=m.y-d.anchor.y*T.height,l=c+m.height):(h=T.width*(1-d.anchor.x),u=T.width*-d.anchor.x,l=T.height*(1-d.anchor.y),c=T.height*-d.anchor.y),a[o]=u*v,a[o+1]=c*_,a[o+s]=h*v,a[o+s+1]=c*_,a[o+s*2]=h*v,a[o+s*2+1]=l*_,a[o+s*3]=u*v,a[o+s*3+1]=l*_,o+=s*4}},r.prototype.uploadPosition=function(e,i,n,a,s,o){for(var h=0;h<n;h++){var u=e[i+h].position;a[o]=u.x,a[o+1]=u.y,a[o+s]=u.x,a[o+s+1]=u.y,a[o+s*2]=u.x,a[o+s*2+1]=u.y,a[o+s*3]=u.x,a[o+s*3+1]=u.y,o+=s*4}},r.prototype.uploadRotation=function(e,i,n,a,s,o){for(var h=0;h<n;h++){var u=e[i+h].rotation;a[o]=u,a[o+s]=u,a[o+s*2]=u,a[o+s*3]=u,o+=s*4}},r.prototype.uploadUvs=function(e,i,n,a,s,o){for(var h=0;h<n;++h){var u=e[i+h]._texture._uvs;u?(a[o]=u.x0,a[o+1]=u.y0,a[o+s]=u.x1,a[o+s+1]=u.y1,a[o+s*2]=u.x2,a[o+s*2+1]=u.y2,a[o+s*3]=u.x3,a[o+s*3+1]=u.y3,o+=s*4):(a[o]=0,a[o+1]=0,a[o+s]=0,a[o+s+1]=0,a[o+s*2]=0,a[o+s*2+1]=0,a[o+s*3]=0,a[o+s*3+1]=0,o+=s*4)}},r.prototype.uploadTint=function(e,i,n,a,s,o){for(var h=0;h<n;++h){var u=e[i+h],l=u._texture.baseTexture.alphaMode>0,c=u.alpha,f=c<1&&l?pn(u._tintRGB,c):u._tintRGB+(c*255<<24);a[o]=f,a[o+s]=f,a[o+s*2]=f,a[o+s*3]=f,o+=s*4}},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(Br);/*!
* @pixi/graphics - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/graphics is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var jt;(function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"})(jt||(jt={}));var zt;(function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"})(zt||(zt={}));var Ye={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,r){if(r===void 0&&(r=20),!this.adaptive||!t||isNaN(t))return r;var e=Math.ceil(t/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}},Eh=function(){function t(){this.color=16777215,this.alpha=1,this.texture=F.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var r=new t;return r.color=this.color,r.alpha=this.alpha,r.texture=this.texture,r.matrix=this.matrix,r.visible=this.visible,r},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=F.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Zi=function(t,r){return Zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Zi(t,r)};function Dn(t,r){Zi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function Ys(t,r){var e,i;r===void 0&&(r=!1);var n=t.length;if(!(n<6)){for(var a=0,s=0,o=t[n-2],h=t[n-1];s<n;s+=2){var u=t[s],l=t[s+1];a+=(u-o)*(l+h),o=u,h=l}if(!r&&a>0||r&&a<=0)for(var c=n/2,s=c+c%2;s<n;s+=2){var f=n-s-2,d=n-s-1,p=s,v=s+1;e=[t[p],t[f]],t[f]=e[0],t[p]=e[1],i=[t[v],t[d]],t[d]=i[0],t[v]=i[1]}}}var Rh={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,r){var e=t.points,i=t.holes,n=r.points,a=r.indices;if(e.length>=6){Ys(e,!1);for(var s=[],o=0;o<i.length;o++){var h=i[o];Ys(h.points,!0),s.push(e.length/2),e=e.concat(h.points)}var u=Do(e,s,2);if(!u)return;for(var l=n.length/2,o=0;o<u.length;o+=3)a.push(u[o]+l),a.push(u[o+1]+l),a.push(u[o+2]+l);for(var o=0;o<e.length;o++)n.push(e[o])}}},Lr={build:function(t){var r=t.points,e,i,n,a,s,o;if(t.type===Z.CIRC){var h=t.shape;e=h.x,i=h.y,s=o=h.radius,n=a=0}else if(t.type===Z.ELIP){var u=t.shape;e=u.x,i=u.y,s=u.width,o=u.height,n=a=0}else{var l=t.shape,c=l.width/2,f=l.height/2;e=l.x+c,i=l.y+f,s=o=Math.max(0,Math.min(l.radius,Math.min(c,f))),n=c-s,a=f-o}if(!(s>=0&&o>=0&&n>=0&&a>=0)){r.length=0;return}var d=Math.ceil(2.3*Math.sqrt(s+o)),p=d*8+(n?4:0)+(a?4:0);if(r.length=p,p!==0){if(d===0){r.length=8,r[0]=r[6]=e+n,r[1]=r[3]=i+a,r[2]=r[4]=e-n,r[5]=r[7]=i-a;return}var v=0,_=d*4+(n?2:0)+2,m=_,T=p;{var x=n+s,E=a,g=e+x,y=e-x,b=i+E;if(r[v++]=g,r[v++]=b,r[--_]=b,r[--_]=y,a){var C=i-E;r[m++]=y,r[m++]=C,r[--T]=C,r[--T]=g}}for(var I=1;I<d;I++){var w=Math.PI/2*(I/d),x=n+Math.cos(w)*s,E=a+Math.sin(w)*o,g=e+x,y=e-x,b=i+E,C=i-E;r[v++]=g,r[v++]=b,r[--_]=b,r[--_]=y,r[m++]=y,r[m++]=C,r[--T]=C,r[--T]=g}{var x=n,E=a+o,g=e+x,y=e-x,b=i+E,C=i-E;r[v++]=g,r[v++]=b,r[--T]=C,r[--T]=g,n&&(r[v++]=y,r[v++]=b,r[--T]=C,r[--T]=y)}}},triangulate:function(t,r){var e=t.points,i=r.points,n=r.indices,a=i.length/2,s=a,o,h;if(t.type!==Z.RREC){var u=t.shape;o=u.x,h=u.y}else{var l=t.shape;o=l.x+l.width/2,h=l.y+l.height/2}var c=t.matrix;i.push(t.matrix?c.a*o+c.c*h+c.tx:o,t.matrix?c.b*o+c.d*h+c.ty:h),a++,i.push(e[0],e[1]);for(var f=2;f<e.length;f+=2)i.push(e[f],e[f+1]),n.push(a++,s,a);n.push(s+1,s,a)}},Ap={build:function(t){var r=t.shape,e=r.x,i=r.y,n=r.width,a=r.height,s=t.points;s.length=0,s.push(e,i,e+n,i,e+n,i+a,e,i+a)},triangulate:function(t,r){var e=t.points,i=r.points,n=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),r.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function _e(t,r,e){var i=r-t;return t+i*e}function br(t,r,e,i,n,a,s){s===void 0&&(s=[]);for(var o=20,h=s,u=0,l=0,c=0,f=0,d=0,p=0,v=0,_=0;v<=o;++v)_=v/o,u=_e(t,e,_),l=_e(r,i,_),c=_e(e,n,_),f=_e(i,a,_),d=_e(u,c,_),p=_e(l,f,_),!(v===0&&h[h.length-2]===d&&h[h.length-1]===p)&&h.push(d,p);return h}var Up={build:function(t){if(Fr.nextRoundedRectBehavior){Lr.build(t);return}var r=t.shape,e=t.points,i=r.x,n=r.y,a=r.width,s=r.height,o=Math.max(0,Math.min(r.radius,Math.min(a,s)/2));e.length=0,o?(br(i,n+o,i,n,i+o,n,e),br(i+a-o,n,i+a,n,i+a,n+o,e),br(i+a,n+s-o,i+a,n+s,i+a-o,n+s,e),br(i+o,n+s,i,n+s,i,n+s-o,e)):e.push(i,n,i+a,n,i+a,n+s,i,n+s)},triangulate:function(t,r){if(Fr.nextRoundedRectBehavior){Lr.triangulate(t,r);return}for(var e=t.points,i=r.points,n=r.indices,a=i.length/2,s=Do(e,null,2),o=0,h=s.length;o<h;o+=3)n.push(s[o]+a),n.push(s[o+1]+a),n.push(s[o+2]+a);for(var o=0,h=e.length;o<h;o++)i.push(e[o],e[++o])}};function $s(t,r,e,i,n,a,s,o){var h=t-e*n,u=r-i*n,l=t+e*a,c=r+i*a,f,d;s?(f=i,d=-e):(f=-i,d=e);var p=h+f,v=u+d,_=l+f,m=c+d;return o.push(p,v),o.push(_,m),2}function me(t,r,e,i,n,a,s,o){var h=e-t,u=i-r,l=Math.atan2(h,u),c=Math.atan2(n-t,a-r);o&&l<c?l+=Math.PI*2:!o&&l>c&&(c+=Math.PI*2);var f=l,d=c-l,p=Math.abs(d),v=Math.sqrt(h*h+u*u),_=(15*p*Math.sqrt(v)/Math.PI>>0)+1,m=d/_;if(f+=m,o){s.push(t,r),s.push(e,i);for(var T=1,x=f;T<_;T++,x+=m)s.push(t,r),s.push(t+Math.sin(x)*v,r+Math.cos(x)*v);s.push(t,r),s.push(n,a)}else{s.push(e,i),s.push(t,r);for(var T=1,x=f;T<_;T++,x+=m)s.push(t+Math.sin(x)*v,r+Math.cos(x)*v),s.push(t,r);s.push(n,a),s.push(t,r)}return _*2}function Op(t,r){var e=t.shape,i=t.points||e.points.slice(),n=r.closePointEps;if(i.length!==0){var a=t.lineStyle,s=new D(i[0],i[1]),o=new D(i[i.length-2],i[i.length-1]),h=e.type!==Z.POLY||e.closeStroke,u=Math.abs(s.x-o.x)<n&&Math.abs(s.y-o.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));var l=(s.x+o.x)*.5,c=(o.y+s.y)*.5;i.unshift(l,c),i.push(l,c)}var f=r.points,d=i.length/2,p=i.length,v=f.length/2,_=a.width/2,m=_*_,T=a.miterLimit*a.miterLimit,x=i[0],E=i[1],g=i[2],y=i[3],b=0,C=0,I=-(E-y),w=x-g,S=0,G=0,X=Math.sqrt(I*I+w*w);I/=X,w/=X,I*=_,w*=_;var rt=a.alignment,A=(1-rt)*2,U=rt*2;h||(a.cap===zt.ROUND?p+=me(x-I*(A-U)*.5,E-w*(A-U)*.5,x-I*A,E-w*A,x+I*U,E+w*U,f,!0)+2:a.cap===zt.SQUARE&&(p+=$s(x,E,I,w,A,U,!0,f))),f.push(x-I*A,E-w*A),f.push(x+I*U,E+w*U);for(var k=1;k<d-1;++k){x=i[(k-1)*2],E=i[(k-1)*2+1],g=i[k*2],y=i[k*2+1],b=i[(k+1)*2],C=i[(k+1)*2+1],I=-(E-y),w=x-g,X=Math.sqrt(I*I+w*w),I/=X,w/=X,I*=_,w*=_,S=-(y-C),G=g-b,X=Math.sqrt(S*S+G*G),S/=X,G/=X,S*=_,G*=_;var nt=g-x,j=E-y,L=g-b,yt=C-y,Ht=j*L-yt*nt,Nt=Ht<0;if(Math.abs(Ht)<.1){f.push(g-I*A,y-w*A),f.push(g+I*U,y+w*U);continue}var Ae=(-I+x)*(-w+y)-(-I+g)*(-w+E),le=(-S+b)*(-G+y)-(-S+g)*(-G+C),gt=(nt*le-L*Ae)/Ht,fe=(yt*Ae-j*le)/Ht,ce=(gt-g)*(gt-g)+(fe-y)*(fe-y),lt=g+(gt-g)*A,ft=y+(fe-y)*A,ht=g-(gt-g)*U,ut=y-(fe-y)*U,q=Math.min(nt*nt+j*j,L*L+yt*yt),qt=Nt?A:U,Tt=q+qt*qt*m,V=ce<=Tt;V?a.join===jt.BEVEL||ce/m>T?(Nt?(f.push(lt,ft),f.push(g+I*U,y+w*U),f.push(lt,ft),f.push(g+S*U,y+G*U)):(f.push(g-I*A,y-w*A),f.push(ht,ut),f.push(g-S*A,y-G*A),f.push(ht,ut)),p+=2):a.join===jt.ROUND?Nt?(f.push(lt,ft),f.push(g+I*U,y+w*U),p+=me(g,y,g+I*U,y+w*U,g+S*U,y+G*U,f,!0)+4,f.push(lt,ft),f.push(g+S*U,y+G*U)):(f.push(g-I*A,y-w*A),f.push(ht,ut),p+=me(g,y,g-I*A,y-w*A,g-S*A,y-G*A,f,!1)+4,f.push(g-S*A,y-G*A),f.push(ht,ut)):(f.push(lt,ft),f.push(ht,ut)):(f.push(g-I*A,y-w*A),f.push(g+I*U,y+w*U),a.join===jt.ROUND?Nt?p+=me(g,y,g+I*U,y+w*U,g+S*U,y+G*U,f,!0)+2:p+=me(g,y,g-I*A,y-w*A,g-S*A,y-G*A,f,!1)+2:a.join===jt.MITER&&ce/m<=T&&(Nt?(f.push(ht,ut),f.push(ht,ut)):(f.push(lt,ft),f.push(lt,ft)),p+=2),f.push(g-S*A,y-G*A),f.push(g+S*U,y+G*U),p+=2)}x=i[(d-2)*2],E=i[(d-2)*2+1],g=i[(d-1)*2],y=i[(d-1)*2+1],I=-(E-y),w=x-g,X=Math.sqrt(I*I+w*w),I/=X,w/=X,I*=_,w*=_,f.push(g-I*A,y-w*A),f.push(g+I*U,y+w*U),h||(a.cap===zt.ROUND?p+=me(g-I*(A-U)*.5,y-w*(A-U)*.5,g-I*A,y-w*A,g+I*U,y+w*U,f,!1)+2:a.cap===zt.SQUARE&&(p+=$s(g,y,I,w,A,U,!1,f)));for(var xt=r.indices,de=Ye.epsilon*Ye.epsilon,k=v;k<p+v-2;++k)x=f[k*2],E=f[k*2+1],g=f[(k+1)*2],y=f[(k+1)*2+1],b=f[(k+2)*2],C=f[(k+2)*2+1],!(Math.abs(x*(y-C)+g*(C-E)+b*(E-y))<de)&&xt.push(k,k+1,k+2)}}function Sp(t,r){var e=0,i=t.shape,n=t.points||i.points,a=i.type!==Z.POLY||i.closeStroke;if(n.length!==0){var s=r.points,o=r.indices,h=n.length/2,u=s.length/2,l=u;for(s.push(n[0],n[1]),e=1;e<h;e++)s.push(n[e*2],n[e*2+1]),o.push(l,l+1),l++;a&&o.push(l,u)}}function qs(t,r){t.lineStyle.native?Sp(t,r):Op(t,r)}var Ks=function(){function t(){}return t.curveTo=function(r,e,i,n,a,s){var o=s[s.length-2],h=s[s.length-1],u=h-e,l=o-r,c=n-e,f=i-r,d=Math.abs(u*f-l*c);if(d<1e-8||a===0)return(s[s.length-2]!==r||s[s.length-1]!==e)&&s.push(r,e),null;var p=u*u+l*l,v=c*c+f*f,_=u*c+l*f,m=a*Math.sqrt(p)/d,T=a*Math.sqrt(v)/d,x=m*_/p,E=T*_/v,g=m*f+T*l,y=m*c+T*u,b=l*(T+x),C=u*(T+x),I=f*(m+E),w=c*(m+E),S=Math.atan2(C-y,b-g),G=Math.atan2(w-y,I-g);return{cx:g+r,cy:y+e,radius:a,startAngle:S,endAngle:G,anticlockwise:l*c>f*u}},t.arc=function(r,e,i,n,a,s,o,h,u){for(var l=o-s,c=Ye._segmentsCount(Math.abs(l)*a,Math.ceil(Math.abs(l)/Or)*40),f=l/(c*2),d=f*2,p=Math.cos(f),v=Math.sin(f),_=c-1,m=_%1/_,T=0;T<=_;++T){var x=T+m*T,E=f+s+d*x,g=Math.cos(E),y=-Math.sin(E);u.push((p*g+v*y)*a+i,(p*-y+v*g)*a+n)}},t}(),Lp=function(){function t(){}return t.curveLength=function(r,e,i,n,a,s,o,h){for(var u=10,l=0,c=0,f=0,d=0,p=0,v=0,_=0,m=0,T=0,x=0,E=0,g=r,y=e,b=1;b<=u;++b)c=b/u,f=c*c,d=f*c,p=1-c,v=p*p,_=v*p,m=_*r+3*v*c*i+3*p*f*a+d*o,T=_*e+3*v*c*n+3*p*f*s+d*h,x=g-m,E=y-T,g=m,y=T,l+=Math.sqrt(x*x+E*E);return l},t.curveTo=function(r,e,i,n,a,s,o){var h=o[o.length-2],u=o[o.length-1];o.length-=2;var l=Ye._segmentsCount(t.curveLength(h,u,r,e,i,n,a,s)),c=0,f=0,d=0,p=0,v=0;o.push(h,u);for(var _=1,m=0;_<=l;++_)m=_/l,c=1-m,f=c*c,d=f*c,p=m*m,v=p*m,o.push(d*h+3*f*m*r+3*c*p*i+v*a,d*u+3*f*m*e+3*c*p*n+v*s)},t}(),Fp=function(){function t(){}return t.curveLength=function(r,e,i,n,a,s){var o=r-2*i+a,h=e-2*n+s,u=2*i-2*r,l=2*n-2*e,c=4*(o*o+h*h),f=4*(o*u+h*l),d=u*u+l*l,p=2*Math.sqrt(c+f+d),v=Math.sqrt(c),_=2*c*v,m=2*Math.sqrt(d),T=f/v;return(_*p+v*f*(p-m)+(4*d*c-f*f)*Math.log((2*v+T+p)/(T+m)))/(4*_)},t.curveTo=function(r,e,i,n,a){for(var s=a[a.length-2],o=a[a.length-1],h=Ye._segmentsCount(t.curveLength(s,o,r,e,i,n)),u=0,l=0,c=1;c<=h;++c){var f=c/h;u=s+(r-s)*f,l=o+(e-o)*f,a.push(u+(r+(i-r)*f-u)*f,l+(e+(n-e)*f-l)*f)}},t}(),Gp=function(){function t(){this.reset()}return t.prototype.begin=function(r,e,i){this.reset(),this.style=r,this.start=e,this.attribStart=i},t.prototype.end=function(r,e){this.attribSize=e-this.attribStart,this.size=r-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),te,vi=(te={},te[Z.POLY]=Rh,te[Z.CIRC]=Lr,te[Z.ELIP]=Lr,te[Z.RECT]=Ap,te[Z.RREC]=Up,te),Zs=[],Ir=[],Js=function(){function t(r,e,i,n){e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=r,this.lineStyle=i,this.fillStyle=e,this.matrix=n,this.type=r.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),ye=new D,Bp=new Ve,Mp=function(t){Dn(r,t);function r(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new Ve,e.boundsDirty=-1,e}return Object.defineProperty(r.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),r.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Ir.push(this.drawCalls[e]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var i=this.batches[e];i.reset(),Zs.push(i)}this.batches.length=0},r.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},r.prototype.drawShape=function(e,i,n,a){i===void 0&&(i=null),n===void 0&&(n=null),a===void 0&&(a=null);var s=new Js(e,i,n,a);return this.graphicsData.push(s),this.dirty++,this},r.prototype.drawHole=function(e,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new Js(e,null,null,i),a=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=a.lineStyle,a.holes.push(n),this.dirty++,this},r.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},r.prototype.containsPoint=function(e){for(var i=this.graphicsData,n=0;n<i.length;++n){var a=i[n];if(!!a.fillStyle.visible&&a.shape&&(a.matrix?a.matrix.applyInverse(e,ye):ye.copyFrom(e),a.shape.contains(ye.x,ye.y))){var s=!1;if(a.holes)for(var o=0;o<a.holes.length;o++){var h=a.holes[o];if(h.shape.contains(ye.x,ye.y)){s=!0;break}}if(!s)return!0}}return!1},r.prototype.updateBatches=function(e){if(!this.graphicsData.length){this.batchable=!0;return}if(!!this.validateBatching()){this.cacheDirty=this.dirty;var i=this.uvs,n=this.graphicsData,a=null,s=null;this.batches.length>0&&(a=this.batches[this.batches.length-1],s=a.style);for(var o=this.shapeIndex;o<n.length;o++){this.shapeIndex++;var h=n[o],u=h.fillStyle,l=h.lineStyle,c=vi[h.type];c.build(h),h.matrix&&this.transformPoints(h.points,h.matrix),(u.visible||l.visible)&&this.processHoles(h.holes);for(var f=0;f<2;f++){var d=f===0?u:l;if(!!d.visible){var p=d.texture.baseTexture,v=this.indices.length,_=this.points.length/2;p.wrapMode=Ft.REPEAT,f===0?this.processFill(h):this.processLine(h);var m=this.points.length/2-_;m!==0&&(a&&!this._compareStyles(s,d)&&(a.end(v,_),a=null),a||(a=Zs.pop()||new Gp,a.begin(d,v,_),this.batches.push(a),s=d),this.addUvs(this.points,i,d.texture,_,m,d.matrix))}}}var T=this.indices.length,x=this.points.length/2;if(a&&a.end(T,x),this.batches.length===0){this.batchable=!0;return}if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var E=x>65535&&e;this.indicesUint16=E?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},r.prototype._compareStyles=function(e,i){return!(!e||!i||e.texture.baseTexture!==i.texture.baseTexture||e.color+e.alpha!==i.color+i.alpha||!!e.native!=!!i.native)},r.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,i=this.graphicsData.length;e<i;e++){var n=this.graphicsData[e],a=n.fillStyle,s=n.lineStyle;if(a&&!a.texture.baseTexture.valid||s&&!s.texture.baseTexture.valid)return!1}return!0},r.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var e=this.batches,i=0,n=e.length;i<n;i++)for(var a=e[i],s=0;s<a.size;s++){var o=a.start+s;this.indicesUint16[o]=this.indicesUint16[o]-a.attribStart}},r.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var e=this.batches,i=0;i<e.length;i++)if(e[i].style.native)return!1;return this.points.length<r.BATCHABLE_SIZE*2},r.prototype.buildDrawCalls=function(){for(var e=++H._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Ir.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,a=this.textureIds,s=Ir.pop();s||(s=new Si,s.texArray=new Li),s.texArray.count=0,s.start=0,s.size=0,s.type=vt.TRIANGLES;var o=0,h=null,u=0,l=!1,c=vt.TRIANGLES,f=0;this.drawCalls.push(s);for(var i=0;i<this.batches.length;i++){var d=this.batches[i],p=8,v=d.style,_=v.texture.baseTexture;l!==!!v.native&&(l=!!v.native,c=l?vt.LINES:vt.TRIANGLES,h=null,o=p,e++),h!==_&&(h=_,_._batchEnabled!==e&&(o===p&&(e++,o=0,s.size>0&&(s=Ir.pop(),s||(s=new Si,s.texArray=new Li),this.drawCalls.push(s)),s.start=f,s.size=0,s.texArray.count=0,s.type=c),_.touched=1,_._batchEnabled=e,_._batchLocation=o,_.wrapMode=Ft.REPEAT,s.texArray.elements[s.texArray.count++]=_,o++)),s.size+=d.size,f+=d.size,u=_._batchLocation,this.addColors(n,v.color,v.alpha,d.attribSize,d.attribStart),this.addTextureIds(a,u,d.attribSize,d.attribStart)}H._globalBatch=e,this.packAttributes()},r.prototype.packAttributes=function(){for(var e=this.points,i=this.uvs,n=this.colors,a=this.textureIds,s=new ArrayBuffer(e.length*3*4),o=new Float32Array(s),h=new Uint32Array(s),u=0,l=0;l<e.length/2;l++)o[u++]=e[l*2],o[u++]=e[l*2+1],o[u++]=i[l*2],o[u++]=i[l*2+1],h[u++]=n[l],o[u++]=a[l];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)},r.prototype.processFill=function(e){if(e.holes.length)Rh.triangulate(e,this);else{var i=vi[e.type];i.triangulate(e,this)}},r.prototype.processLine=function(e){qs(e,this);for(var i=0;i<e.holes.length;i++)qs(e.holes[i],this)},r.prototype.processHoles=function(e){for(var i=0;i<e.length;i++){var n=e[i],a=vi[n.type];a.build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}},r.prototype.calculateBounds=function(){var e=this._bounds,i=Bp,n=Q.IDENTITY;this._bounds.clear(),i.clear();for(var a=0;a<this.graphicsData.length;a++){var s=this.graphicsData[a],o=s.shape,h=s.type,u=s.lineStyle,l=s.matrix||Q.IDENTITY,c=0;if(u&&u.visible&&(c=u.width,h!==Z.POLY||s.fillStyle.visible?c*=Math.max(0,u.alignment):c*=Math.max(u.alignment,1-u.alignment)),n!==l&&(i.isEmpty()||(e.addBoundsMatrix(i,n),i.clear()),n=l),h===Z.RECT||h===Z.RREC){var f=o;i.addFramePad(f.x,f.y,f.x+f.width,f.y+f.height,c,c)}else if(h===Z.CIRC){var d=o;i.addFramePad(d.x,d.y,d.x,d.y,d.radius+c,d.radius+c)}else if(h===Z.ELIP){var p=o;i.addFramePad(p.x,p.y,p.x,p.y,p.width+c,p.height+c)}else{var v=o;e.addVerticesMatrix(n,v.points,0,v.points.length,c,c)}}i.isEmpty()||e.addBoundsMatrix(i,n),e.pad(this.boundsPadding,this.boundsPadding)},r.prototype.transformPoints=function(e,i){for(var n=0;n<e.length/2;n++){var a=e[n*2],s=e[n*2+1];e[n*2]=i.a*a+i.c*s+i.tx,e[n*2+1]=i.b*a+i.d*s+i.ty}},r.prototype.addColors=function(e,i,n,a,s){s===void 0&&(s=0);var o=(i>>16)+(i&65280)+((i&255)<<16),h=pn(o,n);e.length=Math.max(e.length,s+a);for(var u=0;u<a;u++)e[s+u]=h},r.prototype.addTextureIds=function(e,i,n,a){a===void 0&&(a=0),e.length=Math.max(e.length,a+n);for(var s=0;s<n;s++)e[a+s]=i},r.prototype.addUvs=function(e,i,n,a,s,o){o===void 0&&(o=null);for(var h=0,u=i.length,l=n.frame;h<s;){var c=e[(a+h)*2],f=e[(a+h)*2+1];if(o){var d=o.a*c+o.c*f+o.tx;f=o.b*c+o.d*f+o.ty,c=d}h++,i.push(c/l.width,f/l.height)}var p=n.baseTexture;(l.width<p.width||l.height<p.height)&&this.adjustUvs(i,n,u,s)},r.prototype.adjustUvs=function(e,i,n,a){for(var s=i.baseTexture,o=1e-6,h=n+a*2,u=i.frame,l=u.width/s.width,c=u.height/s.height,f=u.x/u.width,d=u.y/u.height,p=Math.floor(e[n]+o),v=Math.floor(e[n+1]+o),_=n+2;_<h;_+=2)p=Math.min(p,Math.floor(e[_]+o)),v=Math.min(v,Math.floor(e[_+1]+o));f-=p,d-=v;for(var _=n;_<h;_+=2)e[_]=(e[_]+f)*l,e[_+1]=(e[_+1]+d)*c},r.BATCHABLE_SIZE=100,r}(ch),Xp=function(t){Dn(r,t);function r(){var e=t!==null&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=zt.BUTT,e.join=jt.MITER,e.miterLimit=10,e}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e},r.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},r}(Eh),kp=new Float32Array(3),_i={},Fr=function(t){Dn(r,t);function r(e){e===void 0&&(e=null);var i=t.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new Eh,i._lineStyle=new Xp,i._matrix=null,i._holeMode=!1,i.state=ue.for2d(),i._geometry=e||new Mp,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=P.NORMAL,i}return Object.defineProperty(r.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return this.finishPoly(),new r(this._geometry)},Object.defineProperty(r.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),r.prototype.lineStyle=function(e,i,n,a,s){return e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=.5),s===void 0&&(s=!1),typeof e=="number"&&(e={width:e,color:i,alpha:n,alignment:a,native:s}),this.lineTextureStyle(e)},r.prototype.lineTextureStyle=function(e){e=Object.assign({width:0,texture:F.WHITE,color:e&&e.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:zt.BUTT,join:jt.MITER,miterLimit:10},e),this.currentPath&&this.startPoly();var i=e.width>0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this},r.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,i=this.currentPath.points.length;i>2&&(this.drawShape(this.currentPath),this.currentPath=new Cr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[i-2],e[i-1]))}else this.currentPath=new Cr,this.currentPath.closeStroke=!1},r.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},r.prototype.moveTo=function(e,i){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=i,this},r.prototype.lineTo=function(e,i){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,a=n[n.length-2],s=n[n.length-1];return(a!==e||s!==i)&&n.push(e,i),this},r.prototype._initCurve=function(e,i){e===void 0&&(e=0),i===void 0&&(i=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,i]):this.moveTo(e,i)},r.prototype.quadraticCurveTo=function(e,i,n,a){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),Fp.curveTo(e,i,n,a,s),this},r.prototype.bezierCurveTo=function(e,i,n,a,s,o){return this._initCurve(),Lp.curveTo(e,i,n,a,s,o,this.currentPath.points),this},r.prototype.arcTo=function(e,i,n,a,s){this._initCurve(e,i);var o=this.currentPath.points,h=Ks.curveTo(e,i,n,a,s,o);if(h){var u=h.cx,l=h.cy,c=h.radius,f=h.startAngle,d=h.endAngle,p=h.anticlockwise;this.arc(u,l,c,f,d,p)}return this},r.prototype.arc=function(e,i,n,a,s,o){if(o===void 0&&(o=!1),a===s)return this;!o&&s<=a?s+=Or:o&&a<=s&&(a+=Or);var h=s-a;if(h===0)return this;var u=e+Math.cos(a)*n,l=i+Math.sin(a)*n,c=this._geometry.closePointEps,f=this.currentPath?this.currentPath.points:null;if(f){var d=Math.abs(f[f.length-2]-u),p=Math.abs(f[f.length-1]-l);d<c&&p<c||f.push(u,l)}else this.moveTo(u,l),f=this.currentPath.points;return Ks.arc(u,l,e,i,n,a,s,o,f),this},r.prototype.beginFill=function(e,i){return e===void 0&&(e=0),i===void 0&&(i=1),this.beginTextureFill({texture:F.WHITE,color:e,alpha:i})},r.prototype.beginTextureFill=function(e){e=Object.assign({texture:F.WHITE,color:16777215,alpha:1,matrix:null},e),this.currentPath&&this.startPoly();var i=e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this},r.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},r.prototype.drawRect=function(e,i,n,a){return this.drawShape(new M(e,i,n,a))},r.prototype.drawRoundedRect=function(e,i,n,a,s){return this.drawShape(new Xf(e,i,n,a,s))},r.prototype.drawCircle=function(e,i,n){return this.drawShape(new Bf(e,i,n))},r.prototype.drawEllipse=function(e,i,n,a){return this.drawShape(new Mf(e,i,n,a))},r.prototype.drawPolygon=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];var a,s=!0,o=i[0];o.points?(s=o.closeStroke,a=o.points):Array.isArray(i[0])?a=i[0]:a=i;var h=new Cr(a);return h.closeStroke=s,this.drawShape(h),this},r.prototype.drawShape=function(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},r.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},r.prototype.isFastRect=function(){var e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Z.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)},r.prototype._render=function(e){this.finishPoly();var i=this._geometry,n=e.context.supports.uint32Indices;i.updateBatches(n),i.batchable?(this.batchDirty!==i.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))},r.prototype._populateBatches=function(){var e=this._geometry,i=this.blendMode,n=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(e.points);for(var a=0;a<n;a++){var s=e.batches[a],o=s.style.color,h=new Float32Array(this.vertexData.buffer,s.attribStart*4*2,s.attribSize*2),u=new Float32Array(e.uvsFloat32.buffer,s.attribStart*4*2,s.attribSize*2),l=new Uint16Array(e.indicesUint16.buffer,s.start*2,s.size),c={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Re(o),_tintRGB:o,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[a]=c}},r.prototype._renderBatched=function(e){if(!!this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var i=0,n=this.batches.length;i<n;i++){var a=this.batches[i];a.worldAlpha=this.worldAlpha*a.alpha,e.plugins[this.pluginName].render(a)}}},r.prototype._renderDirect=function(e){var i=this._resolveDirectShader(e),n=this._geometry,a=this.tint,s=this.worldAlpha,o=i.uniforms,h=n.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(a>>16&255)/255*s,o.tint[1]=(a>>8&255)/255*s,o.tint[2]=(a&255)/255*s,o.tint[3]=s,e.shader.bind(i),e.geometry.bind(n,i),e.state.set(this.state);for(var u=0,l=h.length;u<l;u++)this._renderDrawCallDirect(e,n.drawCalls[u])},r.prototype._renderDrawCallDirect=function(e,i){for(var n=i.texArray,a=i.type,s=i.size,o=i.start,h=n.count,u=0;u<h;u++)e.texture.bind(n.elements[u],u);e.geometry.draw(a,s,o)},r.prototype._resolveDirectShader=function(e){var i=this.shader,n=this.pluginName;if(!i){if(!_i[n]){for(var a=e.plugins[n].MAX_TEXTURES,s=new Int32Array(a),o=0;o<a;o++)s[o]=o;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new Q,default:se.from({uSamplers:s},!0)},u=e.plugins[n]._shader.program;_i[n]=new Wt(u,h)}i=_i[n]}return i},r.prototype._calculateBounds=function(){this.finishPoly();var e=this._geometry;if(!!e.graphicsData.length){var i=e.bounds,n=i.minX,a=i.minY,s=i.maxX,o=i.maxY;this._bounds.addFrame(this.transform,n,a,s,o)}},r.prototype.containsPoint=function(e){return this.worldTransform.applyInverse(e,r._TEMP_POINT),this._geometry.containsPoint(r._TEMP_POINT)},r.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var e=Re(this.tint,kp),i=0;i<this.batches.length;i++){var n=this.batches[i],a=n._batchRGB,s=e[0]*a[0]*255,o=e[1]*a[1]*255,h=e[2]*a[2]*255,u=(s<<16)+(o<<8)+(h|0);n._tintRGB=(u>>16)+(u&65280)+((u&255)<<16)}}},r.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var i=this.transform.worldTransform,n=i.a,a=i.b,s=i.c,o=i.d,h=i.tx,u=i.ty,l=this._geometry.points,c=this.vertexData,f=0,d=0;d<l.length;d+=2){var p=l[d],v=l[d+1];c[f++]=n*p+s*v+h,c[f++]=o*v+a*p+u}}},r.prototype.closePath=function(){var e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this},r.prototype.setMatrix=function(e){return this._matrix=e,this},r.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},r.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},r.prototype.destroy=function(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},r.nextRoundedRectBehavior=!1,r._TEMP_POINT=new D,r}(wt);/*!
* @pixi/text - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/text is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Ji=function(t,r){return Ji=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Ji(t,r)};function Hp(t,r){Ji(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var $e;(function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})($e||($e={}));var mi={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:$e.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Dp=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ce=function(){function t(r){this.styleID=0,this.reset(),gi(this,r,r)}return t.prototype.clone=function(){var r={};return gi(r,this,mi),new t(r)},t.prototype.reset=function(){gi(this,mi,mi)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(r){this._align!==r&&(this._align=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(r){this._breakWords!==r&&(this._breakWords=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(r){this._dropShadow!==r&&(this._dropShadow=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(r){this._dropShadowAlpha!==r&&(this._dropShadowAlpha=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(r){this._dropShadowAngle!==r&&(this._dropShadowAngle=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(r){this._dropShadowBlur!==r&&(this._dropShadowBlur=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(r){var e=yi(r);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(r){this._dropShadowDistance!==r&&(this._dropShadowDistance=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(r){var e=yi(r);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(r){this._fillGradientType!==r&&(this._fillGradientType=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(r){Vp(this._fillGradientStops,r)||(this._fillGradientStops=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(r){this.fontFamily!==r&&(this._fontFamily=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(r){this._fontSize!==r&&(this._fontSize=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(r){this._fontStyle!==r&&(this._fontStyle=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(r){this._fontVariant!==r&&(this._fontVariant=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(r){this._fontWeight!==r&&(this._fontWeight=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(r){this._letterSpacing!==r&&(this._letterSpacing=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(r){this._lineHeight!==r&&(this._lineHeight=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(r){this._leading!==r&&(this._leading=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(r){this._lineJoin!==r&&(this._lineJoin=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(r){this._miterLimit!==r&&(this._miterLimit=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(r){this._padding!==r&&(this._padding=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(r){var e=yi(r);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(r){this._strokeThickness!==r&&(this._strokeThickness=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(r){this._textBaseline!==r&&(this._textBaseline=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(r){this._trim!==r&&(this._trim=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(r){this._whiteSpace!==r&&(this._whiteSpace=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(r){this._wordWrap!==r&&(this._wordWrap=r,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(r){this._wordWrapWidth!==r&&(this._wordWrapWidth=r,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var r=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Dp.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+r+" "+e.join(",")},t}();function Qs(t){return typeof t=="number"?Vo(t):(typeof t=="string"&&t.indexOf("0x")===0&&(t=t.replace("0x","#")),t)}function yi(t){if(Array.isArray(t)){for(var r=0;r<t.length;++r)t[r]=Qs(t[r]);return t}else return Qs(t)}function Vp(t,r){if(!Array.isArray(t)||!Array.isArray(r)||t.length!==r.length)return!1;for(var e=0;e<t.length;++e)if(t[e]!==r[e])return!1;return!0}function gi(t,r,e){for(var i in e)Array.isArray(r[i])?t[i]=r[i].slice():t[i]=r[i]}var Pt=function(){function t(r,e,i,n,a,s,o,h,u){this.text=r,this.style=e,this.width=i,this.height=n,this.lines=a,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=u}return t.measureText=function(r,e,i,n){n===void 0&&(n=t._canvas),i=i==null?e.wordWrap:i;var a=e.toFontString(),s=t.measureFont(a);s.fontSize===0&&(s.fontSize=e.fontSize,s.ascent=e.fontSize);var o=n.getContext("2d");o.font=a;for(var h=i?t.wordWrap(r,e,n):r,u=h.split(/(?:\r\n|\r|\n)/),l=new Array(u.length),c=0,f=0;f<u.length;f++){var d=o.measureText(u[f]).width+(u[f].length-1)*e.letterSpacing;l[f]=d,c=Math.max(c,d)}var p=c+e.strokeThickness;e.dropShadow&&(p+=e.dropShadowDistance);var v=e.lineHeight||s.fontSize+e.strokeThickness,_=Math.max(v,s.fontSize+e.strokeThickness)+(u.length-1)*(v+e.leading);return e.dropShadow&&(_+=e.dropShadowDistance),new t(r,e,p,_,u,l,v+e.leading,c,s)},t.wordWrap=function(r,e,i){i===void 0&&(i=t._canvas);for(var n=i.getContext("2d"),a=0,s="",o="",h=Object.create(null),u=e.letterSpacing,l=e.whiteSpace,c=t.collapseSpaces(l),f=t.collapseNewlines(l),d=!c,p=e.wordWrapWidth+u,v=t.tokenize(r),_=0;_<v.length;_++){var m=v[_];if(t.isNewline(m)){if(!f){o+=t.addLine(s),d=!c,s="",a=0;continue}m=" "}if(c){var T=t.isBreakingSpace(m),x=t.isBreakingSpace(s[s.length-1]);if(T&&x)continue}var E=t.getFromCache(m,u,h,n);if(E>p)if(s!==""&&(o+=t.addLine(s),s="",a=0),t.canBreakWords(m,e.breakWords))for(var g=t.wordWrapSplit(m),y=0;y<g.length;y++){for(var b=g[y],C=1;g[y+C];){var I=g[y+C],w=b[b.length-1];if(!t.canBreakChars(w,I,m,y,e.breakWords))b+=I;else break;C++}y+=b.length-1;var S=t.getFromCache(b,u,h,n);S+a>p&&(o+=t.addLine(s),d=!1,s="",a=0),s+=b,a+=S}else{s.length>0&&(o+=t.addLine(s),s="",a=0);var G=_===v.length-1;o+=t.addLine(m,!G),d=!1,s="",a=0}else E+a>p&&(d=!1,o+=t.addLine(s),s="",a=0),(s.length>0||!t.isBreakingSpace(m)||d)&&(s+=m,a+=E)}return o+=t.addLine(s,!1),o},t.addLine=function(r,e){return e===void 0&&(e=!0),r=t.trimRight(r),r=e?r+`
`:r,r},t.getFromCache=function(r,e,i,n){var a=i[r];if(typeof a!="number"){var s=r.length*e;a=n.measureText(r).width+s,i[r]=a}return a},t.collapseSpaces=function(r){return r==="normal"||r==="pre-line"},t.collapseNewlines=function(r){return r==="normal"},t.trimRight=function(r){if(typeof r!="string")return"";for(var e=r.length-1;e>=0;e--){var i=r[e];if(!t.isBreakingSpace(i))break;r=r.slice(0,-1)}return r},t.isNewline=function(r){return typeof r!="string"?!1:t._newlines.indexOf(r.charCodeAt(0))>=0},t.isBreakingSpace=function(r,e){return typeof r!="string"?!1:t._breakingSpaces.indexOf(r.charCodeAt(0))>=0},t.tokenize=function(r){var e=[],i="";if(typeof r!="string")return e;for(var n=0;n<r.length;n++){var a=r[n],s=r[n+1];if(t.isBreakingSpace(a,s)||t.isNewline(a)){i!==""&&(e.push(i),i=""),e.push(a);continue}i+=a}return i!==""&&e.push(i),e},t.canBreakWords=function(r,e){return e},t.canBreakChars=function(r,e,i,n,a){return!0},t.wordWrapSplit=function(r){return r.split("")},t.measureFont=function(r){if(t._fonts[r])return t._fonts[r];var e={ascent:0,descent:0,fontSize:0},i=t._canvas,n=t._context;n.font=r;var a=t.METRICS_STRING+t.BASELINE_SYMBOL,s=Math.ceil(n.measureText(a).width),o=Math.ceil(n.measureText(t.BASELINE_SYMBOL).width),h=Math.ceil(t.HEIGHT_MULTIPLIER*o);o=o*t.BASELINE_MULTIPLIER|0,i.width=s,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,s,h),n.font=r,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a,0,o);var u=n.getImageData(0,0,s,h).data,l=u.length,c=s*4,f=0,d=0,p=!1;for(f=0;f<o;++f){for(var v=0;v<c;v+=4)if(u[d+v]!==255){p=!0;break}if(!p)d+=c;else break}for(e.ascent=o-f,d=l-c,p=!1,f=h;f>o;--f){for(var v=0;v<c;v+=4)if(u[d+v]!==255){p=!0;break}if(!p)d-=c;else break}return e.descent=f-o,e.fontSize=e.ascent+e.descent,t._fonts[r]=e,e},t.clearMetrics=function(r){r===void 0&&(r=""),r?delete t._fonts[r]:t._fonts={}},Object.defineProperty(t,"_canvas",{get:function(){if(!t.__canvas){var r=void 0;try{var e=new OffscreenCanvas(0,0),i=e.getContext("2d");if(i&&i.measureText)return t.__canvas=e,e;r=document.createElement("canvas")}catch{r=document.createElement("canvas")}r.width=r.height=10,t.__canvas=r}return t.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t,"_context",{get:function(){return t.__context||(t.__context=t._canvas.getContext("2d")),t.__context},enumerable:!1,configurable:!0}),t}();Pt._fonts={};Pt.METRICS_STRING="|\xC9q\xC5";Pt.BASELINE_SYMBOL="M";Pt.BASELINE_MULTIPLIER=1.4;Pt.HEIGHT_MULTIPLIER=2;Pt._newlines=[10,13];Pt._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var jp={texture:!0,children:!1,baseTexture:!0},Ch=function(t){Hp(r,t);function r(e,i,n){var a=this,s=!1;n||(n=document.createElement("canvas"),s=!0),n.width=3,n.height=3;var o=F.from(n);return o.orig=new M,o.trim=new M,a=t.call(this,o)||this,a._ownCanvas=s,a.canvas=n,a.context=a.canvas.getContext("2d"),a._resolution=N.RESOLUTION,a._autoResolution=!0,a._text=null,a._style=null,a._styleListener=null,a._font="",a.text=e,a.style=i,a.localStyleID=-1,a}return r.prototype.updateText=function(e){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),!(!this.dirty&&e)){this._font=this._style.toFontString();var n=this.context,a=Pt.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=a.width,o=a.height,h=a.lines,u=a.lineHeight,l=a.lineWidths,c=a.maxLineWidth,f=a.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+i.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=i.strokeThickness,n.textBaseline=i.textBaseline,n.lineJoin=i.lineJoin,n.miterLimit=i.miterLimit;for(var d,p,v=i.dropShadow?2:1,_=0;_<v;++_){var m=i.dropShadow&&_===0,T=m?Math.ceil(Math.max(1,o)+i.padding*2):0,x=T*this._resolution;if(m){n.fillStyle="black",n.strokeStyle="black";var E=i.dropShadowColor,g=Re(typeof E=="number"?E:jo(E)),y=i.dropShadowBlur*this._resolution,b=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+g[0]*255+","+g[1]*255+","+g[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=y,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*b,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*b+x}else n.fillStyle=this._generateFillStyle(i,h,a),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var C=(u-f.fontSize)/2;(!r.nextLineHeightBehavior||u-f.fontSize<0)&&(C=0);for(var I=0;I<h.length;I++)d=i.strokeThickness/2,p=i.strokeThickness/2+I*u+f.ascent+C,i.align==="right"?d+=c-l[I]:i.align==="center"&&(d+=(c-l[I])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[I],d+i.padding,p+i.padding-T,!0),i.fill&&this.drawLetterSpacing(h[I],d+i.padding,p+i.padding-T)}this.updateTexture()}},r.prototype.drawLetterSpacing=function(e,i,n,a){a===void 0&&(a=!1);var s=this._style,o=s.letterSpacing,h=r.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(o===0||h){h&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),a?this.context.strokeText(e,i,n):this.context.fillText(e,i,n);return}for(var u=i,l=Array.from?Array.from(e):e.split(""),c=this.context.measureText(e).width,f=0,d=0;d<l.length;++d){var p=l[d];a?this.context.strokeText(p,u,n):this.context.fillText(p,u,n);for(var v="",_=d+1;_<l.length;++_)v+=l[_];f=this.context.measureText(v).width,u+=c-f+o,c=f}},r.prototype.updateTexture=function(){var e=this.canvas;if(this._style.trim){var i=Ff(e);i.data&&(e.width=i.width,e.height=i.height,this.context.putImageData(i.data,0,0))}var n=this._texture,a=this._style,s=a.trim?0:a.padding,o=n.baseTexture;n.trim.width=n._frame.width=e.width/this._resolution,n.trim.height=n._frame.height=e.height/this._resolution,n.trim.x=-s,n.trim.y=-s,n.orig.width=n._frame.width-s*2,n.orig.height=n._frame.height-s*2,this._onTextureUpdate(),o.setRealSize(e.width,e.height,this._resolution),n.updateUvs(),this.dirty=!1},r.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},r.prototype.updateTransform=function(){this.updateText(!0),t.prototype.updateTransform.call(this)},r.prototype.getBounds=function(e,i){return this.updateText(!0),this._textureID===-1&&(e=!1),t.prototype.getBounds.call(this,e,i)},r.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},r.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},r.prototype._generateFillStyle=function(e,i,n){var a=e.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var s,o=e.dropShadow?e.dropShadowDistance:0,h=e.padding||0,u=this.canvas.width/this._resolution-o-h*2,l=this.canvas.height/this._resolution-o-h*2,c=a.slice(),f=e.fillGradientStops.slice();if(!f.length)for(var d=c.length+1,p=1;p<d;++p)f.push(p/d);if(c.unshift(a[0]),f.unshift(0),c.push(a[a.length-1]),f.push(1),e.fillGradientType===$e.LINEAR_VERTICAL){s=this.context.createLinearGradient(u/2,h,u/2,l+h);for(var v=n.fontProperties.fontSize+e.strokeThickness,p=0;p<i.length;p++){var _=n.lineHeight*(p-1)+v,m=n.lineHeight*p,T=m;p>0&&_>m&&(T=(m+_)/2);var x=m+v,E=n.lineHeight*(p+1),g=x;p+1<i.length&&E<x&&(g=(x+E)/2);for(var y=(g-T)/l,b=0;b<c.length;b++){var C=0;typeof f[b]=="number"?C=f[b]:C=b/c.length;var I=Math.min(1,Math.max(0,T/l+C*y));I=Number(I.toFixed(5)),s.addColorStop(I,c[b])}}}else{s=this.context.createLinearGradient(h,l/2,u+h,l/2);for(var w=c.length+1,S=1,p=0;p<c.length;p++){var G=void 0;typeof f[p]=="number"?G=f[p]:G=S/w,s.addColorStop(G,c[p]),S++}}return s},r.prototype.destroy=function(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},jp,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){this.updateText(!0);var i=xe(this.scale.x)||1;this.scale.x=i*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){this.updateText(!0);var i=xe(this.scale.y)||1;this.scale.y=i*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"style",{get:function(){return this._style},set:function(e){e=e||{},e instanceof Ce?this._style=e:this._style=new Ce(e),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e==null?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),r.nextLineHeightBehavior=!1,r.experimentalLetterSpacing=!1,r}(Pe);/*!
* @pixi/prepare - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/prepare is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/N.UPLOADS_PER_FRAME=4;/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var Qi=function(t,r){return Qi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Qi(t,r)};function zp(t,r){Qi(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Wp=function(){function t(r){this.maxItemsPerFrame=r,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function Yp(t,r){var e=!1;if(t&&t._textures&&t._textures.length){for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof F){var n=t._textures[i].baseTexture;r.indexOf(n)===-1&&(r.push(n),e=!0)}}return e}function $p(t,r){if(t.baseTexture instanceof H){var e=t.baseTexture;return r.indexOf(e)===-1&&r.push(e),!0}return!1}function qp(t,r){if(t._texture&&t._texture instanceof F){var e=t._texture.baseTexture;return r.indexOf(e)===-1&&r.push(e),!0}return!1}function Kp(t,r){return r instanceof Ch?(r.updateText(!0),!0):!1}function Zp(t,r){if(r instanceof Ce){var e=r.toFontString();return Pt.measureFont(e),!0}return!1}function Jp(t,r){if(t instanceof Ch){r.indexOf(t.style)===-1&&r.push(t.style),r.indexOf(t)===-1&&r.push(t);var e=t._texture.baseTexture;return r.indexOf(e)===-1&&r.push(e),!0}return!1}function Qp(t,r){return t instanceof Ce?(r.indexOf(t)===-1&&r.push(t),!0):!1}var tv=function(){function t(r){var e=this;this.limiter=new Wp(N.UPLOADS_PER_FRAME),this.renderer=r,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){!e.queue||e.prepareItems()},this.registerFindHook(Jp),this.registerFindHook(Qp),this.registerFindHook(Yp),this.registerFindHook($p),this.registerFindHook(qp),this.registerUploadHook(Kp),this.registerUploadHook(Zp)}return t.prototype.upload=function(r,e){typeof r=="function"&&(e=r,r=null),r&&this.add(r),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,at.system.addOnce(this.tick,this,kt.UTILITY))):e&&e()},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var r=this.queue[0],e=!1;if(r&&!r._destroyed){for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,r)){this.queue.shift(),e=!0;break}}e||this.queue.shift()}if(this.queue.length)at.system.addOnce(this.tick,this,kt.UTILITY);else{this.ticking=!1;var a=this.completes.slice(0);this.completes.length=0;for(var i=0,n=a.length;i<n;i++)a[i]()}},t.prototype.registerFindHook=function(r){return r&&this.addHooks.push(r),this},t.prototype.registerUploadHook=function(r){return r&&this.uploadHooks.push(r),this},t.prototype.add=function(r){for(var e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](r,this.queue);e++);if(r instanceof wt)for(var e=r.children.length-1;e>=0;e--)this.add(r.children[e]);return this},t.prototype.destroy=function(){this.ticking&&at.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function wh(t,r){return r instanceof H?(r._glTextures[t.CONTEXT_UID]||t.texture.bind(r),!0):!1}function ev(t,r){if(!(r instanceof Fr))return!1;var e=r.geometry;r.finishPoly(),e.updateBatches();for(var i=e.batches,n=0;n<i.length;n++){var a=i[n].style.texture;a&&wh(t,a.baseTexture)}return e.batchable||t.geometry.bind(e,r._resolveDirectShader(t)),!0}function rv(t,r){return t instanceof Fr?(r.push(t),!0):!1}var s_=function(t){zp(r,t);function r(e){var i=t.call(this,e)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(rv),i.registerUploadHook(wh),i.registerUploadHook(ev),i}return r}(tv);/*!
* @pixi/spritesheet - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/spritesheet is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var iv=function(){function t(r,e,i){i===void 0&&(i=null),this._texture=r instanceof F?r:null,this.baseTexture=r instanceof H?r:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(r){r===void 0&&(r=null);var e=this.data.meta.scale,i=Ur(r,null);return i===null&&(i=e!==void 0?parseFloat(e):1),i!==1&&this.baseTexture.setResolution(i),i},t.prototype.parse=function(r){this._batchIndex=0,this._callback=r,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(r){for(var e=r,i=t.BATCH_SIZE;e-r<i&&e<this._frameKeys.length;){var n=this._frameKeys[e],a=this._frames[n],s=a.frame;if(s){var o=null,h=null,u=a.trimmed!==!1&&a.sourceSize?a.sourceSize:a.frame,l=new M(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);a.rotated?o=new M(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):o=new M(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),a.trimmed!==!1&&a.spriteSourceSize&&(h=new M(Math.floor(a.spriteSourceSize.x)/this.resolution,Math.floor(a.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[n]=new F(this.baseTexture,o,l,h,a.rotated?2:0,a.anchor),F.addToCache(this.textures[n],n)}e++}},t.prototype._processAnimations=function(){var r=this.data.animations||{};for(var e in r){this.animations[e]=[];for(var i=0;i<r[e].length;i++){var n=r[e][i];this.animations[e].push(this.textures[n])}}},t.prototype._parseComplete=function(){var r=this._callback;this._callback=null,this._batchIndex=0,r.call(this,this.textures)},t.prototype._nextBatch=function(){var r=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout(function(){r._batchIndex*t.BATCH_SIZE<r._frameKeys.length?r._nextBatch():(r._processAnimations(),r._parseComplete())},0)},t.prototype.destroy=function(r){var e;r===void 0&&(r=!1);for(var i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,r&&((e=this._texture)===null||e===void 0||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},t.BATCH_SIZE=1e3,t}(),o_=function(){function t(){}return t.use=function(r,e){var i,n,a=this,s=r.name+"_image";if(!r.data||r.type!==J.TYPE.JSON||!r.data.frames||a.resources[s]){e();return}var o=(n=(i=r.data)===null||i===void 0?void 0:i.meta)===null||n===void 0?void 0:n.related_multi_packs;if(Array.isArray(o))for(var h=function(p){if(typeof p!="string")return"continue";var v=p.replace(".json",""),_=Te.resolve(r.url.replace(a.baseUrl,""),p);if(a.resources[v]||Object.values(a.resources).some(function(T){return Te.format(Te.parse(T.url))===_}))return"continue";var m={crossOrigin:r.crossOrigin,loadType:J.LOAD_TYPE.XHR,xhrType:J.XHR_RESPONSE_TYPE.JSON,parentResource:r,metadata:r.metadata};a.add(v,_,m)},u=0,l=o;u<l.length;u++){var c=l[u];h(c)}var f={crossOrigin:r.crossOrigin,metadata:r.metadata.imageMetadata,parentResource:r},d=t.getResourcePath(r,a.baseUrl);a.add(s,d,f,function(v){if(v.error){e(v.error);return}var _=new iv(v.texture,r.data,r.url);_.parse(function(){r.spritesheet=_,r.textures=_.textures,e()})})},t.getResourcePath=function(r,e){return r.isDataUrl?r.data.meta.image:Te.resolve(r.url.replace(e,""),r.data.meta.image)},t}();/*!
* @pixi/sprite-tiling - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/sprite-tiling is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var tn=function(t,r){return tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},tn(t,r)};function Ph(t,r){tn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Be=new D;(function(t){Ph(r,t);function r(e,i,n){i===void 0&&(i=100),n===void 0&&(n=100);var a=t.call(this,e)||this;return a.tileTransform=new vn,a._width=i,a._height=n,a.uvMatrix=a.texture.uvMatrix||new _n(e),a.pluginName="tilingSprite",a.uvRespectAnchor=!1,a}return Object.defineProperty(r.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(e){this.uvMatrix.clampMargin=e,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(e){this.tileTransform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(e){this.tileTransform.position.copyFrom(e)},enumerable:!1,configurable:!0}),r.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},r.prototype._render=function(e){var i=this._texture;!i||!i.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))},r.prototype._calculateBounds=function(){var e=this._width*-this._anchor._x,i=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),a=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,e,i,n,a)},r.prototype.getLocalBounds=function(e){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new M),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},r.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,Be);var i=this._width,n=this._height,a=-i*this.anchor._x;if(Be.x>=a&&Be.x<a+i){var s=-n*this.anchor._y;if(Be.y>=s&&Be.y<s+n)return!0}return!1},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},r.from=function(e,i){var n=e instanceof F?e:F.from(e,i);return new r(n,i.width,i.height)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),r})(Pe);var nv=`#version 100
#define SHADER_NAME Tiling-Sprite-Simple-100
precision lowp float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec4 uColor;
void main(void)
{
vec4 texSample = texture2D(uSampler, vTextureCoord);
gl_FragColor = texSample * uColor;
}
`,to=`#version 100
#define SHADER_NAME Tiling-Sprite-100
precision lowp float;
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTransform;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
}
`,av=`#version 100
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif
#define SHADER_NAME Tiling-Sprite-100
precision lowp float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec4 uColor;
uniform mat3 uMapCoord;
uniform vec4 uClampFrame;
uniform vec2 uClampOffset;
void main(void)
{
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
coord = (uMapCoord * vec3(coord, 1.0)).xy;
vec2 unclamped = coord;
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
#ifdef GL_EXT_shader_texture_lod
vec4 texSample = unclamped == coord
? texture2D(uSampler, coord)
: texture2DLodEXT(uSampler, coord, 0);
#else
vec4 texSample = texture2D(uSampler, coord);
#endif
gl_FragColor = texSample * uColor;
}
`,sv=`#version 300 es
#define SHADER_NAME Tiling-Sprite-300
precision lowp float;
in vec2 aVertexPosition;
in vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTransform;
out vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
}
`,ov=`#version 300 es
#define SHADER_NAME Tiling-Sprite-100
precision lowp float;
in vec2 vTextureCoord;
out vec4 fragmentColor;
uniform sampler2D uSampler;
uniform vec4 uColor;
uniform mat3 uMapCoord;
uniform vec4 uClampFrame;
uniform vec2 uClampOffset;
void main(void)
{
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
coord = (uMapCoord * vec3(coord, 1.0)).xy;
vec2 unclamped = coord;
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
fragmentColor = texSample * uColor;
}
`,Er=new Q,h_=function(t){Ph(r,t);function r(e){var i=t.call(this,e)||this;return e.runners.contextChange.add(i),i.quad=new nh,i.state=ue.for2d(),i}return r.prototype.contextChange=function(){var e=this.renderer,i={globals:e.globalUniforms};this.simpleShader=Wt.from(to,nv,i),this.shader=e.context.webGLVersion>1?Wt.from(sv,ov,i):Wt.from(to,av,i)},r.prototype.render=function(e){var i=this.renderer,n=this.quad,a=n.vertices;a[0]=a[6]=e._width*-e.anchor.x,a[1]=a[3]=e._height*-e.anchor.y,a[2]=a[4]=e._width*(1-e.anchor.x),a[5]=a[7]=e._height*(1-e.anchor.y);var s=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;a=n.uvs,a[0]=a[6]=-s,a[1]=a[3]=-o,a[2]=a[4]=1-s,a[5]=a[7]=1-o,n.invalidate();var h=e._texture,u=h.baseTexture,l=e.tileTransform.localTransform,c=e.uvMatrix,f=u.isPowerOfTwo&&h.frame.width===u.width&&h.frame.height===u.height;f&&(u._glTextures[i.CONTEXT_UID]?f=u.wrapMode!==Ft.CLAMP:u.wrapMode===Ft.CLAMP&&(u.wrapMode=Ft.REPEAT));var d=f?this.simpleShader:this.shader,p=h.width,v=h.height,_=e._width,m=e._height;Er.set(l.a*p/_,l.b*p/m,l.c*v/_,l.d*v/m,l.tx/_,l.ty/m),Er.invert(),f?Er.prepend(c.mapCoord):(d.uniforms.uMapCoord=c.mapCoord.toArray(!0),d.uniforms.uClampFrame=c.uClampFrame,d.uniforms.uClampOffset=c.uClampOffset),d.uniforms.uTransform=Er.toArray(!0),d.uniforms.uColor=Yo(e.tint,e.worldAlpha,d.uniforms.uColor,u.alphaMode),d.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),d.uniforms.uSampler=h,i.shader.bind(d),i.geometry.bind(n),this.state.blendMode=Wo(e.blendMode,u.alphaMode),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},r}(Br);/*!
* @pixi/mesh - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/mesh is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var en=function(t,r){return en=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},en(t,r)};function Vn(t,r){en(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var hv=function(){function t(r,e){this.uvBuffer=r,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(r){if(!(!r&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),Ti=new D,eo=new Cr,qe=function(t){Vn(r,t);function r(e,i,n,a){a===void 0&&(a=vt.TRIANGLES);var s=t.call(this)||this;return s.geometry=e,s.shader=i,s.state=n||ue.for2d(),s.drawMode=a,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=N.ROUND_PIXELS,s.batchUvs=null,s}return Object.defineProperty(r.prototype,"geometry",{get:function(){return this._geometry},set:function(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"material",{get:function(){return this.shader},set:function(e){this.shader=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(e){this.shader.tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(e){this.shader.texture=e},enumerable:!1,configurable:!0}),r.prototype._render=function(e){var i=this.geometry.buffers[0].data,n=this.shader;n.batchable&&this.drawMode===vt.TRIANGLES&&i.length<r.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)},r.prototype._renderDefault=function(e){var i=this.shader;i.alpha=this.worldAlpha,i.update&&i.update(),e.batch.flush(),i.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(i),e.state.set(this.state),e.geometry.bind(this.geometry,i),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(e){var i=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=i.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;var a=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[a]),e.plugins[a].render(this)},r.prototype.calculateVertices=function(){var e=this.geometry,i=e.buffers[0],n=i.data,a=i._updateID;if(!(a===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==n.length&&(this.vertexData=new Float32Array(n.length));for(var s=this.transform.worldTransform,o=s.a,h=s.b,u=s.c,l=s.d,c=s.tx,f=s.ty,d=this.vertexData,p=0;p<d.length/2;p++){var v=n[p*2],_=n[p*2+1];d[p*2]=o*v+u*_+c,d[p*2+1]=h*v+l*_+f}if(this._roundPixels)for(var m=N.RESOLUTION,p=0;p<d.length;++p)d[p]=Math.round((d[p]*m|0)/m);this.vertexDirty=a}},r.prototype.calculateUvs=function(){var e=this.geometry.buffers[1],i=this.shader;i.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new hv(e,i.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},r.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},r.prototype.containsPoint=function(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,Ti);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=eo.points,a=this.geometry.getIndex().data,s=a.length,o=this.drawMode===4?3:1,h=0;h+2<s;h+=o){var u=a[h]*2,l=a[h+1]*2,c=a[h+2]*2;if(n[0]=i[u],n[1]=i[u+1],n[2]=i[l],n[3]=i[l+1],n[4]=i[c],n[5]=i[c+1],eo.contains(Ti.x,Ti.y))return!0}return!1},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},r.BATCHABLE_SIZE=100,r}(wt),uv=`varying vec2 vTextureCoord;
uniform vec4 uColor;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
}
`,lv=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTextureMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
}
`,Ke=function(t){Vn(r,t);function r(e,i){var n=this,a={uSampler:e,alpha:1,uTextureMatrix:Q.IDENTITY,uColor:new Float32Array([1,1,1,1])};return i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i),i.uniforms&&Object.assign(a,i.uniforms),n=t.call(this,i.program||tr.from(lv,uv),a)||this,n._colorDirty=!1,n.uvMatrix=new _n(e),n.batchable=i.program===void 0,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return Object.defineProperty(r.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alpha",{get:function(){return this._alpha},set:function(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(e){e!==this._tint&&(this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),r.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Yo(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},r}(Wt),kr=function(t){Vn(r,t);function r(e,i,n){var a=t.call(this)||this,s=new it(e),o=new it(i,!0),h=new it(n,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,O.FLOAT).addAttribute("aTextureCoord",o,2,!1,O.FLOAT).addIndex(h),a._updateId=-1,a}return Object.defineProperty(r.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),r}(Qe);/*!
* @pixi/text-bitmap - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/text-bitmap is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var rn=function(t,r){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},rn(t,r)};function fv(t,r){rn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Gr=function(){function t(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return t}(),cv=function(){function t(){}return t.test=function(r){return typeof r=="string"&&r.indexOf("info face=")===0},t.parse=function(r){var e=r.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in e){var a=e[n].match(/^[a-z]+/gm)[0],s=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var h in s){var u=s[h].split("="),l=u[0],c=u[1].replace(/"/gm,""),f=parseFloat(c),d=isNaN(f)?c:f;o[l]=d}i[a].push(o)}var p=new Gr;return i.info.forEach(function(v){return p.info.push({face:v.face,size:parseInt(v.size,10)})}),i.common.forEach(function(v){return p.common.push({lineHeight:parseInt(v.lineHeight,10)})}),i.page.forEach(function(v){return p.page.push({id:parseInt(v.id,10),file:v.file})}),i.char.forEach(function(v){return p.char.push({id:parseInt(v.id,10),page:parseInt(v.page,10),x:parseInt(v.x,10),y:parseInt(v.y,10),width:parseInt(v.width,10),height:parseInt(v.height,10),xoffset:parseInt(v.xoffset,10),yoffset:parseInt(v.yoffset,10),xadvance:parseInt(v.xadvance,10)})}),i.kerning.forEach(function(v){return p.kerning.push({first:parseInt(v.first,10),second:parseInt(v.second,10),amount:parseInt(v.amount,10)})}),i.distanceField.forEach(function(v){return p.distanceField.push({distanceRange:parseInt(v.distanceRange,10),fieldType:v.fieldType})}),p},t}(),nn=function(){function t(){}return t.test=function(r){return r instanceof XMLDocument&&r.getElementsByTagName("page").length&&r.getElementsByTagName("info")[0].getAttribute("face")!==null},t.parse=function(r){for(var e=new Gr,i=r.getElementsByTagName("info"),n=r.getElementsByTagName("common"),a=r.getElementsByTagName("page"),s=r.getElementsByTagName("char"),o=r.getElementsByTagName("kerning"),h=r.getElementsByTagName("distanceField"),u=0;u<i.length;u++)e.info.push({face:i[u].getAttribute("face"),size:parseInt(i[u].getAttribute("size"),10)});for(var u=0;u<n.length;u++)e.common.push({lineHeight:parseInt(n[u].getAttribute("lineHeight"),10)});for(var u=0;u<a.length;u++)e.page.push({id:parseInt(a[u].getAttribute("id"),10)||0,file:a[u].getAttribute("file")});for(var u=0;u<s.length;u++){var l=s[u];e.char.push({id:parseInt(l.getAttribute("id"),10),page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xoffset:parseInt(l.getAttribute("xoffset"),10),yoffset:parseInt(l.getAttribute("yoffset"),10),xadvance:parseInt(l.getAttribute("xadvance"),10)})}for(var u=0;u<o.length;u++)e.kerning.push({first:parseInt(o[u].getAttribute("first"),10),second:parseInt(o[u].getAttribute("second"),10),amount:parseInt(o[u].getAttribute("amount"),10)});for(var u=0;u<h.length;u++)e.distanceField.push({fieldType:h[u].getAttribute("fieldType"),distanceRange:parseInt(h[u].getAttribute("distanceRange"),10)});return e},t}(),dv=function(){function t(){}return t.test=function(r){if(typeof r=="string"&&r.indexOf("<font>")>-1){var e=new globalThis.DOMParser().parseFromString(r,"text/xml");return nn.test(e)}return!1},t.parse=function(r){var e=new globalThis.DOMParser().parseFromString(r,"text/xml");return nn.parse(e)},t}(),xi=[cv,nn,dv];function Nh(t){for(var r=0;r<xi.length;r++)if(xi[r].test(t))return xi[r];return null}function pv(t,r,e,i,n,a){var s=e.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var o,h=e.dropShadow?e.dropShadowDistance:0,u=e.padding||0,l=t.width/i-h-u*2,c=t.height/i-h-u*2,f=s.slice(),d=e.fillGradientStops.slice();if(!d.length)for(var p=f.length+1,v=1;v<p;++v)d.push(v/p);if(f.unshift(s[0]),d.unshift(0),f.push(s[s.length-1]),d.push(1),e.fillGradientType===$e.LINEAR_VERTICAL){o=r.createLinearGradient(l/2,u,l/2,c+u);for(var _=0,m=a.fontProperties.fontSize+e.strokeThickness,T=m/c,v=0;v<n.length;v++)for(var x=a.lineHeight*v,E=0;E<f.length;E++){var g=0;typeof d[E]=="number"?g=d[E]:g=E/f.length;var y=x/c+g*T,b=Math.max(_,y);b=Math.min(b,1),o.addColorStop(b,f[E]),_=b}}else{o=r.createLinearGradient(u,c/2,l+u,c/2);for(var C=f.length+1,I=1,v=0;v<f.length;v++){var w=void 0;typeof d[v]=="number"?w=d[v]:w=I/C,o.addColorStop(w,f[v]),I++}}return o}function vv(t,r,e,i,n,a,s){var o=e.text,h=e.fontProperties;r.translate(i,n),r.scale(a,a);var u=s.strokeThickness/2,l=-(s.strokeThickness/2);if(r.font=s.toFontString(),r.lineWidth=s.strokeThickness,r.textBaseline=s.textBaseline,r.lineJoin=s.lineJoin,r.miterLimit=s.miterLimit,r.fillStyle=pv(t,r,s,a,[o],e),r.strokeStyle=s.stroke,s.dropShadow){var c=s.dropShadowColor,f=Re(typeof c=="number"?c:jo(c)),d=s.dropShadowBlur*a,p=s.dropShadowDistance*a;r.shadowColor="rgba("+f[0]*255+","+f[1]*255+","+f[2]*255+","+s.dropShadowAlpha+")",r.shadowBlur=d,r.shadowOffsetX=Math.cos(s.dropShadowAngle)*p,r.shadowOffsetY=Math.sin(s.dropShadowAngle)*p}else r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;s.stroke&&s.strokeThickness&&r.strokeText(o,u,l+e.lineHeight-h.descent),s.fill&&r.fillText(o,u,l+e.lineHeight-h.descent),r.setTransform(1,0,0,1,0,0),r.fillStyle="rgba(0, 0, 0, 0)"}function Ah(t){return Array.from?Array.from(t):t.split("")}function _v(t){typeof t=="string"&&(t=[t]);for(var r=[],e=0,i=t.length;e<i;e++){var n=t[e];if(Array.isArray(n)){if(n.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var a=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,h=s;o<=h;o++)r.push(String.fromCharCode(o))}else r.push.apply(r,Ah(n))}if(r.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return r}function wr(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}var ge=function(){function t(r,e,i){var n,a,s=r.info[0],o=r.common[0],h=r.page[0],u=r.distanceField[0],l=Ur(h.file),c={};this._ownsTextures=i,this.font=s.face,this.size=s.size,this.lineHeight=o.lineHeight/l,this.chars={},this.pageTextures=c;for(var f=0;f<r.page.length;f++){var d=r.page[f],p=d.id,v=d.file;c[p]=e instanceof Array?e[f]:e[v],(u==null?void 0:u.fieldType)&&u.fieldType!=="none"&&(c[p].baseTexture.alphaMode=_t.NO_PREMULTIPLIED_ALPHA)}for(var f=0;f<r.char.length;f++){var _=r.char[f],p=_.id,m=_.page,T=r.char[f],x=T.x,E=T.y,g=T.width,y=T.height,b=T.xoffset,C=T.yoffset,I=T.xadvance;x/=l,E/=l,g/=l,y/=l,b/=l,C/=l,I/=l;var w=new M(x+c[m].frame.x/l,E+c[m].frame.y/l,g,y);this.chars[p]={xOffset:b,yOffset:C,xAdvance:I,kerning:{},texture:new F(c[m].baseTexture,w),page:m}}for(var f=0;f<r.kerning.length;f++){var S=r.kerning[f],G=S.first,X=S.second,rt=S.amount;G/=l,X/=l,rt/=l,this.chars[X]&&(this.chars[X].kerning[G]=rt)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(a=(n=u==null?void 0:u.fieldType)===null||n===void 0?void 0:n.toLowerCase())!==null&&a!==void 0?a:"none"}return t.prototype.destroy=function(){for(var r in this.chars)this.chars[r].texture.destroy(),this.chars[r].texture=null;for(var r in this.pageTextures)this._ownsTextures&&this.pageTextures[r].destroy(!0),this.pageTextures[r]=null;this.chars=null,this.pageTextures=null},t.install=function(r,e,i){var n;if(r instanceof Gr)n=r;else{var a=Nh(r);if(!a)throw new Error("Unrecognized data format for font.");n=a.parse(r)}e instanceof F&&(e=[e]);var s=new t(n,e,i);return t.available[s.font]=s,s},t.uninstall=function(r){var e=t.available[r];if(!e)throw new Error("No font found named '"+r+"'");e.destroy(),delete t.available[r]},t.from=function(r,e,i){if(!r)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),a=n.chars,s=n.padding,o=n.resolution,h=n.textureWidth,u=n.textureHeight,l=_v(a),c=e instanceof Ce?e:new Ce(e),f=h,d=new Gr;d.info[0]={face:c.fontFamily,size:c.fontSize},d.common[0]={lineHeight:c.fontSize};for(var p=0,v=0,_,m,T,x=0,E=[],g=0;g<l.length;g++){_||(_=document.createElement("canvas"),_.width=h,_.height=u,m=_.getContext("2d"),T=new H(_,{resolution:o}),E.push(new F(T)),d.page.push({id:E.length-1,file:""}));var y=Pt.measureText(l[g],c,!1,_),b=y.width,C=Math.ceil(y.height),I=Math.ceil((c.fontStyle==="italic"?2:1)*b);if(v>=u-C*o){if(v===0)throw new Error("[BitmapFont] textureHeight "+u+"px is "+("too small for "+c.fontSize+"px fonts"));--g,_=null,m=null,T=null,v=0,p=0,x=0;continue}if(x=Math.max(C+y.fontProperties.descent,x),I*o+p>=f){--g,v+=x*o,v=Math.ceil(v),p=0,x=0;continue}vv(_,m,y,p,v,o,c);var w=wr(y.text);d.char.push({id:w,page:E.length-1,x:p/o,y:v/o,width:I,height:C,xoffset:0,yoffset:0,xadvance:Math.ceil(b-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),p+=(I+2*s)*o,p=Math.ceil(p)}for(var g=0,S=l.length;g<S;g++)for(var G=l[g],X=0;X<S;X++){var rt=l[X],A=m.measureText(G).width,U=m.measureText(rt).width,k=m.measureText(G+rt).width,nt=k-(A+U);nt&&d.kerning.push({first:wr(G),second:wr(rt),amount:nt})}var j=new t(d,E,!0);return t.available[r]!==void 0&&t.uninstall(r),t.available[r]=j,j},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),mv=`// Pixi texture info\r
varying vec2 vTextureCoord;\r
uniform sampler2D uSampler;\r
\r
// Tint\r
uniform vec4 uColor;\r
\r
// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
uniform float uFWidth;\r
\r
void main(void) {\r
\r
// To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
vec4 texColor = texture2D(uSampler, vTextureCoord);\r
\r
// MSDF\r
float median = texColor.r + texColor.g + texColor.b -\r
min(texColor.r, min(texColor.g, texColor.b)) -\r
max(texColor.r, max(texColor.g, texColor.b));\r
// SDF\r
median = min(median, texColor.a);\r
\r
float screenPxDistance = uFWidth * (median - 0.5);\r
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
\r
// NPM Textures, NPM outputs\r
gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r
\r
}\r
`,yv=`// Mesh material default fragment\r
attribute vec2 aVertexPosition;\r
attribute vec2 aTextureCoord;\r
\r
uniform mat3 projectionMatrix;\r
uniform mat3 translationMatrix;\r
uniform mat3 uTextureMatrix;\r
\r
varying vec2 vTextureCoord;\r
\r
void main(void)\r
{\r
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
\r
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
}\r
`,gv=[],Tv=[],ro=[];(function(t){fv(r,t);function r(e,i){i===void 0&&(i={});var n=t.call(this)||this;n._tint=16777215;var a=Object.assign({},r.styleDefaults,i),s=a.align,o=a.tint,h=a.maxWidth,u=a.letterSpacing,l=a.fontName,c=a.fontSize;if(!ge.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=s,n._tint=o,n._fontName=l,n._fontSize=c||ge.available[l].size,n.text=e,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=u,n._anchor=new be(function(){n.dirty=!0},n,0,0),n._roundPixels=N.ROUND_PIXELS,n.dirty=!0,n._resolution=N.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return r.prototype.updateText=function(){for(var e,i=ge.available[this._fontName],n=this._fontSize/i.size,a=new D,s=[],o=[],h=[],u=this._text.replace(/(?:\r\n|\r)/g,`
`)||" ",l=Ah(u),c=this._maxWidth*i.size/this._fontSize,f=i.distanceFieldType==="none"?gv:Tv,d=null,p=0,v=0,_=0,m=-1,T=0,x=0,E=0,g=0,y=0;y<l.length;y++){var b=l[y],C=wr(b);if(/(?:\s)/.test(b)&&(m=y,T=p,g++),b==="\r"||b===`
`){o.push(p),h.push(-1),v=Math.max(v,p),++_,++x,a.x=0,a.y+=i.lineHeight,d=null,g=0;continue}var I=i.chars[C];if(!!I){d&&I.kerning[d]&&(a.x+=I.kerning[d]);var w=ro.pop()||{texture:F.EMPTY,line:0,charCode:0,prevSpaces:0,position:new D};w.texture=I.texture,w.line=_,w.charCode=C,w.position.x=a.x+I.xOffset+this._letterSpacing/2,w.position.y=a.y+I.yOffset,w.prevSpaces=g,s.push(w),p=w.position.x+Math.max(I.xAdvance,I.texture.orig.width),a.x+=I.xAdvance+this._letterSpacing,E=Math.max(E,I.yOffset+I.texture.height),d=C,m!==-1&&c>0&&a.x>c&&(++x,Gt(s,1+m-x,1+y-m),y=m,m=-1,o.push(T),h.push(s.length>0?s[s.length-1].prevSpaces:0),v=Math.max(v,T),_++,a.x=0,a.y+=i.lineHeight,d=null,g=0)}}var S=l[l.length-1];S!=="\r"&&S!==`
`&&(/(?:\s)/.test(S)&&(p=T),o.push(p),v=Math.max(v,p),h.push(-1));for(var G=[],y=0;y<=_;y++){var X=0;this._align==="right"?X=v-o[y]:this._align==="center"?X=(v-o[y])/2:this._align==="justify"&&(X=h[y]<0?0:(v-o[y])/h[y]),G.push(X)}for(var rt=s.length,A={},U=[],k=this._activePagesMeshData,y=0;y<k.length;y++)f.push(k[y]);for(var y=0;y<rt;y++){var nt=s[y].texture,j=nt.baseTexture.uid;if(!A[j]){var L=f.pop();if(!L){var yt=new kr,Ht=void 0,Nt=void 0;i.distanceFieldType==="none"?(Ht=new Ke(F.EMPTY),Nt=P.NORMAL):(Ht=new Ke(F.EMPTY,{program:tr.from(yv,mv),uniforms:{uFWidth:0}}),Nt=P.NORMAL_NPM);var Ae=new qe(yt,Ht);Ae.blendMode=Nt,L={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:Ae,vertices:null,uvs:null,indices:null}}L.index=0,L.indexCount=0,L.vertexCount=0,L.uvsCount=0,L.total=0;var le=this._textureCache;le[j]=le[j]||new F(nt.baseTexture),L.mesh.texture=le[j],L.mesh.tint=this._tint,U.push(L),A[j]=L}A[j].total++}for(var y=0;y<k.length;y++)U.indexOf(k[y])===-1&&this.removeChild(k[y].mesh);for(var y=0;y<U.length;y++)U[y].mesh.parent!==this&&this.addChild(U[y].mesh);this._activePagesMeshData=U;for(var y in A){var L=A[y],gt=L.total;if(!(((e=L.indices)===null||e===void 0?void 0:e.length)>6*gt)||L.vertices.length<qe.BATCHABLE_SIZE*2)L.vertices=new Float32Array(4*2*gt),L.uvs=new Float32Array(4*2*gt),L.indices=new Uint16Array(6*gt);else for(var fe=L.total,ce=L.vertices,lt=fe*4*2;lt<ce.length;lt++)ce[lt]=0;L.mesh.size=6*gt}for(var y=0;y<rt;y++){var b=s[y],ft=b.position.x+G[b.line]*(this._align==="justify"?b.prevSpaces:1);this._roundPixels&&(ft=Math.round(ft));var ht=ft*n,ut=b.position.y*n,nt=b.texture,q=A[nt.baseTexture.uid],qt=nt.frame,Tt=nt._uvs,V=q.index++;q.indices[V*6+0]=0+V*4,q.indices[V*6+1]=1+V*4,q.indices[V*6+2]=2+V*4,q.indices[V*6+3]=0+V*4,q.indices[V*6+4]=2+V*4,q.indices[V*6+5]=3+V*4,q.vertices[V*8+0]=ht,q.vertices[V*8+1]=ut,q.vertices[V*8+2]=ht+qt.width*n,q.vertices[V*8+3]=ut,q.vertices[V*8+4]=ht+qt.width*n,q.vertices[V*8+5]=ut+qt.height*n,q.vertices[V*8+6]=ht,q.vertices[V*8+7]=ut+qt.height*n,q.uvs[V*8+0]=Tt.x0,q.uvs[V*8+1]=Tt.y0,q.uvs[V*8+2]=Tt.x1,q.uvs[V*8+3]=Tt.y1,q.uvs[V*8+4]=Tt.x2,q.uvs[V*8+5]=Tt.y2,q.uvs[V*8+6]=Tt.x3,q.uvs[V*8+7]=Tt.y3}this._textWidth=v*n,this._textHeight=(a.y+i.lineHeight)*n;for(var y in A){var L=A[y];if(this.anchor.x!==0||this.anchor.y!==0)for(var xt=0,de=this._textWidth*this.anchor.x,rr=this._textHeight*this.anchor.y,jn=0;jn<L.total;jn++)L.vertices[xt++]-=de,L.vertices[xt++]-=rr,L.vertices[xt++]-=de,L.vertices[xt++]-=rr,L.vertices[xt++]-=de,L.vertices[xt++]-=rr,L.vertices[xt++]-=de,L.vertices[xt++]-=rr;this._maxLineHeight=E*n;var zn=L.mesh.geometry.getBuffer("aVertexPosition"),Wn=L.mesh.geometry.getBuffer("aTextureCoord"),Yn=L.mesh.geometry.getIndex();zn.data=L.vertices,Wn.data=L.uvs,Yn.data=L.indices,zn.update(),Wn.update(),Yn.update()}for(var y=0;y<s.length;y++)ro.push(s[y])},r.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},r.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);var i=ge.available[this._fontName],n=i.distanceFieldRange,a=i.distanceFieldType,s=i.size;if(a!=="none")for(var o=this.worldTransform,h=o.a,u=o.b,l=o.c,c=o.d,f=Math.sqrt(h*h+u*u),d=Math.sqrt(l*l+c*c),p=(Math.abs(f)+Math.abs(d))/2,v=this._fontSize/s,_=0,m=this._activePagesMeshData;_<m.length;_++){var T=m[_];T.mesh.shader.uniforms.uFWidth=p*n*v*this._resolution}t.prototype._render.call(this,e)},r.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},r.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(e){if(this._tint!==e){this._tint=e;for(var i=0;i<this._activePagesMeshData.length;i++)this._activePagesMeshData[i].mesh.tint=e}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontName",{get:function(){return this._fontName},set:function(e){if(!ge.available[e])throw new Error('Missing BitmapFont "'+e+'"');this._fontName!==e&&(this._fontName=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"anchor",{get:function(){return this._anchor},set:function(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e==null?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),r.prototype.destroy=function(e){var i=this._textureCache;for(var n in i){var a=i[n];a.destroy(),delete i[n]}this._textureCache=null,t.prototype.destroy.call(this,e)},r.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},r})(wt);var u_=function(){function t(){}return t.add=function(){J.setExtensionXhrType("fnt",J.XHR_RESPONSE_TYPE.TEXT)},t.use=function(r,e){var i=Nh(r.data);if(!i){e();return}for(var n=t.getBaseUrl(this,r),a=i.parse(r.data),s={},o=function(v){s[v.metadata.pageFile]=v.texture,Object.keys(s).length===a.page.length&&(r.bitmapFont=ge.install(a,s,!0),e())},h=0;h<a.page.length;++h){var u=a.page[h].file,l=n+u,c=!1;for(var f in this.resources){var d=this.resources[f];if(d.url===l){d.metadata.pageFile=u,d.texture?o(d):d.onAfterMiddleware.add(o),c=!0;break}}if(!c){var p={crossOrigin:r.crossOrigin,loadType:J.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},r.metadata.imageMetadata),parentResource:r};this.add(l,p,o)}}},t.getBaseUrl=function(r,e){var i=e.isDataUrl?"":t.dirname(e.url);return e.isDataUrl&&(i==="."&&(i=""),r.baseUrl&&i&&r.baseUrl.charAt(r.baseUrl.length-1)==="/"&&(i+="/")),i=i.replace(r.baseUrl,""),i&&i.charAt(i.length-1)!=="/"&&(i+="/"),i},t.dirname=function(r){var e=r.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===r?".":e===""?"/":e},t}();/*!
* @pixi/filter-alpha - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-alpha is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var an=function(t,r){return an=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},an(t,r)};function xv(t,r){an(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var bv=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform float uAlpha;
void main(void)
{
gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
}
`;(function(t){xv(r,t);function r(e){e===void 0&&(e=1);var i=t.call(this,fd,bv,{uAlpha:1})||this;return i.alpha=e,i}return Object.defineProperty(r.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),r})($t);/*!
* @pixi/filter-blur - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-blur is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var sn=function(t,r){return sn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},sn(t,r)};function Uh(t,r){sn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Iv=`
attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
uniform float strength;
varying vec2 vBlurTexCoords[%size%];
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
vec2 filterTextureCoord( void )
{
return aVertexPosition * (outputFrame.zw * inputSize.zw);
}
void main(void)
{
gl_Position = filterVertexPosition();
vec2 textureCoord = filterTextureCoord();
%blur%
}`;function Ev(t,r){var e=Math.ceil(t/2),i=Iv,n="",a;r?a="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":a="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var o=a.replace("%index%",s.toString());o=o.replace("%sampleIndex%",s-(e-1)+".0"),n+=o,n+=`
`}return i=i.replace("%blur%",n),i=i.replace("%size%",t.toString()),i}var Rv={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},Cv=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
`);function wv(t){for(var r=Rv[t],e=r.length,i=Cv,n="",a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",s,o=0;o<t;o++){var h=a.replace("%index%",o.toString());s=o,o>=e&&(s=t-o-1),h=h.replace("%value%",r[s].toString()),n+=h,n+=`
`}return i=i.replace("%blur%",n),i=i.replace("%size%",t.toString()),i}/*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var io;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(io||(io={}));var no;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(no||(no={}));var ao;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(ao||(ao={}));var so;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(so||(so={}));var oo;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(oo||(oo={}));var ho;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(ho||(ho={}));var uo;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(uo||(uo={}));var lo;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(lo||(lo={}));var fo;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(fo||(fo={}));var co;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(co||(co={}));var po;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(po||(po={}));var vo;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(vo||(vo={}));var _o;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(_o||(_o={}));var Ze;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(Ze||(Ze={}));var mo;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(mo||(mo={}));var yo;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(yo||(yo={}));var go;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(go||(go={}));var To;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(To||(To={}));var xo;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(xo||(xo={}));var bo=function(t){Uh(r,t);function r(e,i,n,a,s){i===void 0&&(i=8),n===void 0&&(n=4),a===void 0&&(a=N.FILTER_RESOLUTION),s===void 0&&(s=5);var o=this,h=Ev(s,e),u=wv(s);return o=t.call(this,h,u)||this,o.horizontal=e,o.resolution=a,o._quality=0,o.quality=n,o.blur=i,o}return r.prototype.apply=function(e,i,n,a){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/i.width):this.uniforms.strength=1/n.height*(n.height/i.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/i.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/i.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,i,n,a);else{var s=e.getFilterTexture(),o=e.renderer,h=i,u=s;this.state.blend=!1,e.applyFilter(this,h,u,Ze.CLEAR);for(var l=1;l<this.passes-1;l++){e.bindAndClear(h,Ze.BLIT),this.uniforms.uSampler=u;var c=u;u=h,h=c,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,u,n,a),e.returnFilterTexture(s)}},Object.defineProperty(r.prototype,"blur",{get:function(){return this.strength},set:function(e){this.padding=1+Math.abs(e)*2,this.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"quality",{get:function(){return this._quality},set:function(e){this._quality=e,this.passes=e},enumerable:!1,configurable:!0}),r}($t);(function(t){Uh(r,t);function r(e,i,n,a){e===void 0&&(e=8),i===void 0&&(i=4),n===void 0&&(n=N.FILTER_RESOLUTION),a===void 0&&(a=5);var s=t.call(this)||this;return s.blurXFilter=new bo(!0,e,i,n,a),s.blurYFilter=new bo(!1,e,i,n,a),s.resolution=n,s.quality=i,s.blur=e,s.repeatEdgePixels=!1,s}return r.prototype.apply=function(e,i,n,a){var s=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(s&&o){var h=e.getFilterTexture();this.blurXFilter.apply(e,i,h,Ze.CLEAR),this.blurYFilter.apply(e,h,n,a),e.returnFilterTexture(h)}else o?this.blurYFilter.apply(e,i,n,a):this.blurXFilter.apply(e,i,n,a)},r.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2},Object.defineProperty(r.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(e){this.blurXFilter.quality=this.blurYFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(e){this.blurYFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(e){this.blurYFilter.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(e){this._repeatEdgePixels=e,this.updatePadding()},enumerable:!1,configurable:!0}),r})($t);/*!
* @pixi/filter-color-matrix - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-color-matrix is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var on=function(t,r){return on=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},on(t,r)};function Pv(t,r){on(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Nv=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform float m[20];
uniform float uAlpha;
void main(void)
{
vec4 c = texture2D(uSampler, vTextureCoord);
if (uAlpha == 0.0) {
gl_FragColor = c;
return;
}
// Un-premultiply alpha before applying the color matrix. See issue #3539.
if (c.a > 0.0) {
c.rgb /= c.a;
}
vec4 result;
result.r = (m[0] * c.r);
result.r += (m[1] * c.g);
result.r += (m[2] * c.b);
result.r += (m[3] * c.a);
result.r += m[4];
result.g = (m[5] * c.r);
result.g += (m[6] * c.g);
result.g += (m[7] * c.b);
result.g += (m[8] * c.a);
result.g += m[9];
result.b = (m[10] * c.r);
result.b += (m[11] * c.g);
result.b += (m[12] * c.b);
result.b += (m[13] * c.a);
result.b += m[14];
result.a = (m[15] * c.r);
result.a += (m[16] * c.g);
result.a += (m[17] * c.b);
result.a += (m[18] * c.a);
result.a += m[19];
vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
// Premultiply alpha again.
rgb *= result.a;
gl_FragColor = vec4(rgb, result.a);
}
`,Io=function(t){Pv(r,t);function r(){var e=this,i={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return e=t.call(this,fh,Nv,i)||this,e.alpha=1,e}return r.prototype._loadMatrix=function(e,i){i===void 0&&(i=!1);var n=e;i&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n},r.prototype._multiply=function(e,i,n){return e[0]=i[0]*n[0]+i[1]*n[5]+i[2]*n[10]+i[3]*n[15],e[1]=i[0]*n[1]+i[1]*n[6]+i[2]*n[11]+i[3]*n[16],e[2]=i[0]*n[2]+i[1]*n[7]+i[2]*n[12]+i[3]*n[17],e[3]=i[0]*n[3]+i[1]*n[8]+i[2]*n[13]+i[3]*n[18],e[4]=i[0]*n[4]+i[1]*n[9]+i[2]*n[14]+i[3]*n[19]+i[4],e[5]=i[5]*n[0]+i[6]*n[5]+i[7]*n[10]+i[8]*n[15],e[6]=i[5]*n[1]+i[6]*n[6]+i[7]*n[11]+i[8]*n[16],e[7]=i[5]*n[2]+i[6]*n[7]+i[7]*n[12]+i[8]*n[17],e[8]=i[5]*n[3]+i[6]*n[8]+i[7]*n[13]+i[8]*n[18],e[9]=i[5]*n[4]+i[6]*n[9]+i[7]*n[14]+i[8]*n[19]+i[9],e[10]=i[10]*n[0]+i[11]*n[5]+i[12]*n[10]+i[13]*n[15],e[11]=i[10]*n[1]+i[11]*n[6]+i[12]*n[11]+i[13]*n[16],e[12]=i[10]*n[2]+i[11]*n[7]+i[12]*n[12]+i[13]*n[17],e[13]=i[10]*n[3]+i[11]*n[8]+i[12]*n[13]+i[13]*n[18],e[14]=i[10]*n[4]+i[11]*n[9]+i[12]*n[14]+i[13]*n[19]+i[14],e[15]=i[15]*n[0]+i[16]*n[5]+i[17]*n[10]+i[18]*n[15],e[16]=i[15]*n[1]+i[16]*n[6]+i[17]*n[11]+i[18]*n[16],e[17]=i[15]*n[2]+i[16]*n[7]+i[17]*n[12]+i[18]*n[17],e[18]=i[15]*n[3]+i[16]*n[8]+i[17]*n[13]+i[18]*n[18],e[19]=i[15]*n[4]+i[16]*n[9]+i[17]*n[14]+i[18]*n[19]+i[19],e},r.prototype._colorMatrix=function(e){var i=new Float32Array(e);return i[4]/=255,i[9]/=255,i[14]/=255,i[19]/=255,i},r.prototype.brightness=function(e,i){var n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,i)},r.prototype.tint=function(e,i){var n=e>>16&255,a=e>>8&255,s=e&255,o=[n/255,0,0,0,0,0,a/255,0,0,0,0,0,s/255,0,0,0,0,0,1,0];this._loadMatrix(o,i)},r.prototype.greyscale=function(e,i){var n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,i)},r.prototype.blackAndWhite=function(e){var i=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.hue=function(e,i){e=(e||0)/180*Math.PI;var n=Math.cos(e),a=Math.sin(e),s=Math.sqrt,o=1/3,h=s(o),u=n+(1-n)*o,l=o*(1-n)-h*a,c=o*(1-n)+h*a,f=o*(1-n)+h*a,d=n+o*(1-n),p=o*(1-n)-h*a,v=o*(1-n)-h*a,_=o*(1-n)+h*a,m=n+o*(1-n),T=[u,l,c,0,0,f,d,p,0,0,v,_,m,0,0,0,0,0,1,0];this._loadMatrix(T,i)},r.prototype.contrast=function(e,i){var n=(e||0)+1,a=-.5*(n-1),s=[n,0,0,0,a,0,n,0,0,a,0,0,n,0,a,0,0,0,1,0];this._loadMatrix(s,i)},r.prototype.saturate=function(e,i){e===void 0&&(e=0);var n=e*2/3+1,a=(n-1)*-.5,s=[n,a,a,0,0,a,n,a,0,0,a,a,n,0,0,0,0,0,1,0];this._loadMatrix(s,i)},r.prototype.desaturate=function(){this.saturate(-1)},r.prototype.negative=function(e){var i=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.sepia=function(e){var i=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.technicolor=function(e){var i=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.polaroid=function(e){var i=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.toBGR=function(e){var i=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.kodachrome=function(e){var i=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.browni=function(e){var i=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.vintage=function(e){var i=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.colorTone=function(e,i,n,a,s){e=e||.2,i=i||.15,n=n||16770432,a=a||3375104;var o=(n>>16&255)/255,h=(n>>8&255)/255,u=(n&255)/255,l=(a>>16&255)/255,c=(a>>8&255)/255,f=(a&255)/255,d=[.3,.59,.11,0,0,o,h,u,e,0,l,c,f,i,0,o-l,h-c,u-f,0,0];this._loadMatrix(d,s)},r.prototype.night=function(e,i){e=e||.1;var n=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(n,i)},r.prototype.predator=function(e,i){var n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,i)},r.prototype.lsd=function(e){var i=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(i,e)},r.prototype.reset=function(){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)},Object.defineProperty(r.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),r}($t);Io.prototype.grayscale=Io.prototype.greyscale;/*!
* @pixi/filter-displacement - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-displacement is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var hn=function(t,r){return hn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},hn(t,r)};function Av(t,r){hn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Uv=`varying vec2 vFilterCoord;
varying vec2 vTextureCoord;
uniform vec2 scale;
uniform mat2 rotation;
uniform sampler2D uSampler;
uniform sampler2D mapSampler;
uniform highp vec4 inputSize;
uniform vec4 inputClamp;
void main(void)
{
vec4 map = texture2D(mapSampler, vFilterCoord);
map -= 0.5;
map.xy = scale * inputSize.zw * (rotation * map.xy);
gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
}
`,Ov=`attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
uniform mat3 filterMatrix;
varying vec2 vTextureCoord;
varying vec2 vFilterCoord;
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
vec2 filterTextureCoord( void )
{
return aVertexPosition * (outputFrame.zw * inputSize.zw);
}
void main(void)
{
gl_Position = filterVertexPosition();
vTextureCoord = filterTextureCoord();
vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
}
`;(function(t){Av(r,t);function r(e,i){var n=this,a=new Q;return e.renderable=!1,n=t.call(this,Ov,Uv,{mapSampler:e._texture,filterMatrix:a,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,n.maskSprite=e,n.maskMatrix=a,i==null&&(i=20),n.scale=new D(i,i),n}return r.prototype.apply=function(e,i,n,a){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var s=this.maskSprite.worldTransform,o=Math.sqrt(s.a*s.a+s.b*s.b),h=Math.sqrt(s.c*s.c+s.d*s.d);o!==0&&h!==0&&(this.uniforms.rotation[0]=s.a/o,this.uniforms.rotation[1]=s.b/o,this.uniforms.rotation[2]=s.c/h,this.uniforms.rotation[3]=s.d/h),e.applyFilter(this,i,n,a)},Object.defineProperty(r.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0}),r})($t);/*!
* @pixi/filter-fxaa - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-fxaa is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var un=function(t,r){return un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},un(t,r)};function Sv(t,r){un(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Lv=`
attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
varying vec2 v_rgbNW;
varying vec2 v_rgbNE;
varying vec2 v_rgbSW;
varying vec2 v_rgbSE;
varying vec2 v_rgbM;
varying vec2 vFragCoord;
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
void texcoords(vec2 fragCoord, vec2 inverseVP,
out vec2 v_rgbNW, out vec2 v_rgbNE,
out vec2 v_rgbSW, out vec2 v_rgbSE,
out vec2 v_rgbM) {
v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
v_rgbM = vec2(fragCoord * inverseVP);
}
void main(void) {
gl_Position = filterVertexPosition();
vFragCoord = aVertexPosition * outputFrame.zw;
texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
}
`,Fv=`varying vec2 v_rgbNW;
varying vec2 v_rgbNE;
varying vec2 v_rgbSW;
varying vec2 v_rgbSE;
varying vec2 v_rgbM;
varying vec2 vFragCoord;
uniform sampler2D uSampler;
uniform highp vec4 inputSize;
/**
Basic FXAA implementation based on the code on geeks3d.com with the
modification that the texture2DLod stuff was removed since it's
unsupported by WebGL.
--
From:
https://github.com/mitsuhiko/webgl-meincraft
Copyright (c) 2011 by Armin Ronacher.
Some rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* The names of the contributors may not be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef FXAA_REDUCE_MIN
#define FXAA_REDUCE_MIN (1.0/ 128.0)
#endif
#ifndef FXAA_REDUCE_MUL
#define FXAA_REDUCE_MUL (1.0 / 8.0)
#endif
#ifndef FXAA_SPAN_MAX
#define FXAA_SPAN_MAX 8.0
#endif
//optimized version for mobile, where dependent
//texture reads can be a bottleneck
vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
vec2 v_rgbNW, vec2 v_rgbNE,
vec2 v_rgbSW, vec2 v_rgbSE,
vec2 v_rgbM) {
vec4 color;
vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
vec4 texColor = texture2D(tex, v_rgbM);
vec3 rgbM = texColor.xyz;
vec3 luma = vec3(0.299, 0.587, 0.114);
float lumaNW = dot(rgbNW, luma);
float lumaNE = dot(rgbNE, luma);
float lumaSW = dot(rgbSW, luma);
float lumaSE = dot(rgbSE, luma);
float lumaM = dot(rgbM, luma);
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
mediump vec2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
(0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * inverseVP;
vec3 rgbA = 0.5 * (
texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
vec3 rgbB = rgbA * 0.5 + 0.25 * (
texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
float lumaB = dot(rgbB, luma);
if ((lumaB < lumaMin) || (lumaB > lumaMax))
color = vec4(rgbA, texColor.a);
else
color = vec4(rgbB, texColor.a);
return color;
}
void main() {
vec4 color;
color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
gl_FragColor = color;
}
`;(function(t){Sv(r,t);function r(){return t.call(this,Lv,Fv)||this}return r})($t);/*!
* @pixi/filter-noise - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/filter-noise is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var ln=function(t,r){return ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},ln(t,r)};function Gv(t,r){ln(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Bv=`precision highp float;
varying vec2 vTextureCoord;
varying vec4 vColor;
uniform float uNoise;
uniform float uSeed;
uniform sampler2D uSampler;
float rand(vec2 co)
{
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
}
void main()
{
vec4 color = texture2D(uSampler, vTextureCoord);
float randomValue = rand(gl_FragCoord.xy * uSeed);
float diff = (randomValue - 0.5) * uNoise;
// Un-premultiply alpha before applying the color matrix. See issue #3539.
if (color.a > 0.0) {
color.rgb /= color.a;
}
color.r += diff;
color.g += diff;
color.b += diff;
// Premultiply alpha again.
color.rgb *= color.a;
gl_FragColor = color;
}
`;(function(t){Gv(r,t);function r(e,i){e===void 0&&(e=.5),i===void 0&&(i=Math.random());var n=t.call(this,fh,Bv,{uNoise:0,uSeed:0})||this;return n.noise=e,n.seed=i,n}return Object.defineProperty(r.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),r})($t);/*!
* @pixi/mixin-cache-as-bitmap - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/mixin-cache-as-bitmap is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*!
* @pixi/constants - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Eo;(function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"})(Eo||(Eo={}));var Ro;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"})(Ro||(Ro={}));var Co;(function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"})(Co||(Co={}));var wo;(function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"})(wo||(wo={}));var Po;(function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Po||(Po={}));var No;(function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(No||(No={}));var Ao;(function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Ao||(Ao={}));var Uo;(function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"})(Uo||(Uo={}));var Oo;(function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"})(Oo||(Oo={}));var So;(function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"})(So||(So={}));var Lo;(function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Lo||(Lo={}));var Fo;(function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"})(Fo||(Fo={}));var Go;(function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(Go||(Go={}));var Bo;(function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"})(Bo||(Bo={}));var Mo;(function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"})(Mo||(Mo={}));var Xo;(function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"})(Xo||(Xo={}));var ko;(function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"})(ko||(ko={}));var fn;(function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"})(fn||(fn={}));var Ho;(function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Ho||(Ho={}));var Oh=new Q;tt.prototype._cacheAsBitmap=!1;tt.prototype._cacheData=null;tt.prototype._cacheAsBitmapResolution=null;tt.prototype._cacheAsBitmapMultisample=fn.NONE;var Mv=function(){function t(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return t}();Object.defineProperties(tt.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){if(this._cacheAsBitmap!==t){this._cacheAsBitmap=t;var r;t?(this._cacheData||(this._cacheData=new Mv),r=this._cacheData,r.originalRender=this.render,r.originalRenderCanvas=this.renderCanvas,r.originalUpdateTransform=this.updateTransform,r.originalCalculateBounds=this.calculateBounds,r.originalGetLocalBounds=this.getLocalBounds,r.originalDestroy=this.destroy,r.originalContainsPoint=this.containsPoint,r.originalMask=this._mask,r.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(r=this._cacheData,r.sprite&&this._destroyCachedDisplayObject(),this.render=r.originalRender,this.renderCanvas=r.originalRenderCanvas,this.calculateBounds=r.originalCalculateBounds,this.getLocalBounds=r.originalGetLocalBounds,this.destroy=r.originalDestroy,this.updateTransform=r.originalUpdateTransform,this.containsPoint=r.originalContainsPoint,this._mask=r.originalMask,this.filterArea=r.originalFilterArea)}}}});tt.prototype._renderCached=function(r){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(r),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(r))};tt.prototype._initCachedDisplayObject=function(r){var e;if(!(this._cacheData&&this._cacheData.sprite)){var i=this.alpha;this.alpha=1,r.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var a=this.filters[0].padding;n.pad(a)}n.ceil(N.RESOLUTION);var s=r.renderTexture.current,o=r.renderTexture.sourceFrame.clone(),h=r.renderTexture.destinationFrame.clone(),u=r.projection.transform,l=he.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||r.resolution,multisample:(e=this.cacheAsBitmapMultisample)!==null&&e!==void 0?e:r.multisample}),c="cacheAsBitmap_"+oe();this._cacheData.textureCacheId=c,H.addToCache(l.baseTexture,c),F.addToCache(l,c);var f=this.transform.localTransform.copyTo(Oh).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,r.render(this,{renderTexture:l,clear:!0,transform:f,skipUpdateTransform:!1}),r.framebuffer.blit(),r.projection.transform=u,r.renderTexture.bind(s,o,h),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var d=new Pe(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(n.x/n.width),d.anchor.y=-(n.y/n.height),d.alpha=i,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}};tt.prototype._renderCachedCanvas=function(r){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(r),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(r))};tt.prototype._initCachedDisplayObjectCanvas=function(r){if(!(this._cacheData&&this._cacheData.sprite)){var e=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var n=r.context,a=r._projTransform;e.ceil(N.RESOLUTION);var s=he.create({width:e.width,height:e.height}),o="cacheAsBitmap_"+oe();this._cacheData.textureCacheId=o,H.addToCache(s.baseTexture,o),F.addToCache(s,o);var h=Oh;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=e.x,h.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,r.render(this,{renderTexture:s,clear:!0,transform:h,skipUpdateTransform:!1}),r.context=n,r._projTransform=a,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var u=new Pe(s);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-(e.x/e.width),u.anchor.y=-(e.y/e.height),u.alpha=i,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=r._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}};tt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};tt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};tt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,H.removeFromCache(this._cacheData.textureCacheId),F.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};tt.prototype._cacheAsBitmapDestroy=function(r){this.cacheAsBitmap=!1,this.destroy(r)};/*!
* @pixi/mixin-get-child-by-name - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/mixin-get-child-by-name is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/tt.prototype.name=null;wt.prototype.getChildByName=function(r,e){for(var i=0,n=this.children.length;i<n;i++)if(this.children[i].name===r)return this.children[i];if(e)for(var i=0,n=this.children.length;i<n;i++){var a=this.children[i];if(!!a.getChildByName){var s=this.children[i].getChildByName(r,!0);if(s)return s}}return null};/*!
* @pixi/mixin-get-global-position - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/mixin-get-global-position is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/tt.prototype.getGlobalPosition=function(r,e){return r===void 0&&(r=new D),e===void 0&&(e=!1),this.parent?this.parent.toGlobal(this.position,r,e):(r.x=this.position.x,r.y=this.position.y),r};/*!
* @pixi/mesh-extras - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/mesh-extras is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var cn=function(t,r){return cn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},cn(t,r)};function Ne(t,r){cn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var Xv=function(t){Ne(r,t);function r(e,i,n,a){e===void 0&&(e=100),i===void 0&&(i=100),n===void 0&&(n=10),a===void 0&&(a=10);var s=t.call(this)||this;return s.segWidth=n,s.segHeight=a,s.width=e,s.height=i,s.build(),s}return r.prototype.build=function(){for(var e=this.segWidth*this.segHeight,i=[],n=[],a=[],s=this.segWidth-1,o=this.segHeight-1,h=this.width/s,u=this.height/o,l=0;l<e;l++){var c=l%this.segWidth,f=l/this.segWidth|0;i.push(c*h,f*u),n.push(c/s,f/o)}for(var d=s*o,l=0;l<d;l++){var p=l%s,v=l/s|0,_=v*this.segWidth+p,m=v*this.segWidth+p+1,T=(v+1)*this.segWidth+p,x=(v+1)*this.segWidth+p+1;a.push(_,m,T,m,x,T)}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(n),this.indexBuffer.data=new Uint16Array(a),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},r}(kr),kv=function(t){Ne(r,t);function r(e,i,n){e===void 0&&(e=200),n===void 0&&(n=0);var a=t.call(this,new Float32Array(i.length*4),new Float32Array(i.length*4),new Uint16Array((i.length-1)*6))||this;return a.points=i,a._width=e,a.textureScale=n,a.build(),a}return Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),r.prototype.build=function(){var e=this.points;if(!!e){var i=this.getBuffer("aVertexPosition"),n=this.getBuffer("aTextureCoord"),a=this.getIndex();if(!(e.length<1)){i.data.length/4!==e.length&&(i.data=new Float32Array(e.length*4),n.data=new Float32Array(e.length*4),a.data=new Uint16Array((e.length-1)*6));var s=n.data,o=a.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;for(var h=0,u=e[0],l=this._width*this.textureScale,c=e.length,f=0;f<c;f++){var d=f*4;if(this.textureScale>0){var p=u.x-e[f].x,v=u.y-e[f].y,_=Math.sqrt(p*p+v*v);u=e[f],h+=_/l}else h=f/(c-1);s[d]=h,s[d+1]=0,s[d+2]=h,s[d+3]=1}for(var m=0,f=0;f<c-1;f++){var d=f*2;o[m++]=d,o[m++]=d+1,o[m++]=d+2,o[m++]=d+2,o[m++]=d+1,o[m++]=d+3}n.update(),a.update(),this.updateVertices()}}},r.prototype.updateVertices=function(){var e=this.points;if(!(e.length<1)){for(var i=e[0],n,a=0,s=0,o=this.buffers[0].data,h=e.length,u=0;u<h;u++){var l=e[u],c=u*4;u<e.length-1?n=e[u+1]:n=l,s=-(n.x-i.x),a=n.y-i.y;var f=Math.sqrt(a*a+s*s),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;a/=f,s/=f,a*=d,s*=d,o[c]=l.x+a,o[c+1]=l.y+s,o[c+2]=l.x-a,o[c+3]=l.y-s,i=l}this.buffers[0].update()}},r.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},r}(kr);(function(t){Ne(r,t);function r(e,i,n){n===void 0&&(n=0);var a=this,s=new kv(e.height,i,n),o=new Ke(e);return n>0&&(e.baseTexture.wrapMode=Ft.REPEAT),a=t.call(this,s,o)||this,a.autoUpdate=!0,a}return r.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},r})(qe);var Hv=function(t){Ne(r,t);function r(e,i,n){var a=this,s=new Xv(e.width,e.height,i,n),o=new Ke(F.WHITE);return a=t.call(this,s,o)||this,a.texture=e,a.autoResize=!0,a}return r.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,i=this.shader.texture,n=i.width,a=i.height;this.autoResize&&(e.width!==n||e.height!==a)&&(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(r.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),r.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},r.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},r}(qe);(function(t){Ne(r,t);function r(e,i,n,a,s){e===void 0&&(e=F.EMPTY);var o=this,h=new kr(i,n,a);h.getBuffer("aVertexPosition").static=!1;var u=new Ke(e);return o=t.call(this,h,u,null,s)||this,o.autoUpdate=!0,o}return Object.defineProperty(r.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),r.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},r})(qe);var Rr=10;(function(t){Ne(r,t);function r(e,i,n,a,s){i===void 0&&(i=Rr),n===void 0&&(n=Rr),a===void 0&&(a=Rr),s===void 0&&(s=Rr);var o=t.call(this,F.WHITE,4,4)||this;return o._origWidth=e.orig.width,o._origHeight=e.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=i,o._rightWidth=a,o._topHeight=n,o._bottomHeight=s,o.texture=e,o}return r.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(r.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),r.prototype.updateHorizontalVertices=function(){var e=this.vertices,i=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*i,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*i,e[25]=e[27]=e[29]=e[31]=this._height},r.prototype.updateVerticalVertices=function(){var e=this.vertices,i=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*i,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*i,e[6]=e[14]=e[22]=e[30]=this._width},r.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e,n=this._topHeight+this._bottomHeight,a=this._height>n?1:this._height/n,s=Math.min(i,a);return s},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),r.prototype._refresh=function(){var e=this.texture,i=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var n=1/this._origWidth,a=1/this._origHeight;i[0]=i[8]=i[16]=i[24]=0,i[1]=i[3]=i[5]=i[7]=0,i[6]=i[14]=i[22]=i[30]=1,i[25]=i[27]=i[29]=i[31]=1,i[2]=i[10]=i[18]=i[26]=n*this._leftWidth,i[4]=i[12]=i[20]=i[28]=1-n*this._rightWidth,i[9]=i[11]=i[13]=i[15]=a*this._topHeight,i[17]=i[19]=i[21]=i[23]=1-a*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},r})(Hv);/*!
* @pixi/sprite-animated - v6.4.2
* Compiled Thu, 02 Jun 2022 15:39:26 UTC
*
* @pixi/sprite-animated is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var dn=function(t,r){return dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},dn(t,r)};function Dv(t,r){dn(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}(function(t){Dv(r,t);function r(e,i){i===void 0&&(i=!0);var n=t.call(this,e[0]instanceof F?e[0]:e[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=e,n}return r.prototype.stop=function(){!this._playing||(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(at.shared.remove(this.update,this),this._isConnectedToTicker=!1))},r.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(at.shared.add(this.update,this,kt.HIGH),this._isConnectedToTicker=!0))},r.prototype.gotoAndStop=function(e){this.stop();var i=this.currentFrame;this._currentTime=e,i!==this.currentFrame&&this.updateTexture()},r.prototype.gotoAndPlay=function(e){var i=this.currentFrame;this._currentTime=e,i!==this.currentFrame&&this.updateTexture(),this.play()},r.prototype.update=function(e){if(!!this._playing){var i=this.animationSpeed*e,n=this.currentFrame;if(this._durations!==null){var a=this._currentTime%1*this._durations[this.currentFrame];for(a+=i/60*1e3;a<0;)this._currentTime--,a+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);a>=this._durations[this.currentFrame];)a-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=a/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<n?this.onLoop():this.animationSpeed<0&&this.currentFrame>n&&this.onLoop()),this.updateTexture())}},r.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},r.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},r.fromFrames=function(e){for(var i=[],n=0;n<e.length;++n)i.push(F.from(e[n]));return new r(i)},r.fromImages=function(e){for(var i=[],n=0;n<e.length;++n)i.push(F.from(e[n]));return new r(i)},Object.defineProperty(r.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textures",{get:function(){return this._textures},set:function(e){if(e[0]instanceof F)this._textures=e,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<e.length;i++)this._textures.push(e[i].texture),this._durations.push(e[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentFrame",{get:function(){var e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(at.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(at.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),r})(Pe);export{Jv as A,Kv as B,r_ as C,i_ as D,t_ as E,Qv as I,n_ as K,We as L,a_ as P,od as R,o_ as S,h_ as T,s_ as a,u_ as b,Hd as c,qv as d,e_ as e,W as f,Zv as u};