import{E as Vr}from"./eventemitter3.dc5195d7.js";import{e as Ns}from"./earcut.03899505.js";import{p as ba,f as xa,r as Ea}from"./url.1821b64b.js";/*! * @pixi/constants - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var zt;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(zt||(zt={}));var Ye;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Ye||(Ye={}));var Cr;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(Cr||(Cr={}));var B;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(B||(B={}));var Tt;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Tt||(Tt={}));var S;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(S||(S={}));var pe;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(pe||(pe={}));var M;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(M||(M={}));var Ir;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(Ir||(Ir={}));var It;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(It||(It={}));var Be;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Be||(Be={}));var ut;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(ut||(ut={}));var ct;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(ct||(ct={}));var Qt;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(Qt||(Qt={}));var Or;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(Or||(Or={}));var pt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(pt||(pt={}));var nt;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(nt||(nt={}));var On;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(On||(On={}));var rt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(rt||(rt={}));var Bt;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Bt||(Bt={}));/*! * @pixi/settings - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var Ta={createCanvas:function(r,t){var e=document.createElement("canvas");return e.width=r,e.height=t,e},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,t){return fetch(r,t)}},Zr=/iPhone/i,Bn=/iPod/i,Mn=/iPad/i,Ln=/\biOS-universal(?:.+)Mac\b/i,Qr=/\bAndroid(?:.+)Mobile\b/i,Nn=/Android/i,Te=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ar=/Silk/i,Nt=/Windows Phone/i,Fn=/\bWindows(?:.+)ARM\b/i,Dn=/BlackBerry/i,Un=/BB10/i,Gn=/Opera Mini/i,kn=/\b(CriOS|Chrome)(?:.+)Mobile/i,Xn=/Mobile(?:.+)Firefox\b/i,Hn=function(r){return typeof r!="undefined"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream=="undefined"};function wa(r){return function(t){return t.test(r)}}function Aa(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator!="undefined"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.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=wa(e),s={apple:{phone:n(Zr)&&!n(Nt),ipod:n(Bn),tablet:!n(Zr)&&(n(Mn)||Hn(t))&&!n(Nt),universal:n(Ln),device:(n(Zr)||n(Bn)||n(Mn)||n(Ln)||Hn(t))&&!n(Nt)},amazon:{phone:n(Te),tablet:!n(Te)&&n(ar),device:n(Te)||n(ar)},android:{phone:!n(Nt)&&n(Te)||!n(Nt)&&n(Qr),tablet:!n(Nt)&&!n(Te)&&!n(Qr)&&(n(ar)||n(Nn)),device:!n(Nt)&&(n(Te)||n(ar)||n(Qr)||n(Nn))||n(/\bokhttp\b/i)},windows:{phone:n(Nt),tablet:n(Fn),device:n(Nt)||n(Fn)},other:{blackberry:n(Dn),blackberry10:n(Un),opera:n(Gn),firefox:n(Xn),chrome:n(kn),device:n(Dn)||n(Un)||n(Gn)||n(Xn)||n(kn)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var de=Aa(globalThis.navigator);function Sa(){return!de.apple.device}function Ra(r){var t=!0;if(de.tablet||de.phone){if(de.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(t=!1)}}if(de.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(t=!1)}}}return t?r:4}var P={ADAPTER:Ta,MIPMAP_TEXTURES:ut.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:rt.NONE,SPRITE_MAX_TEXTURES:Ra(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:Or.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Be.CLAMP,SCALE_MODE:It.LINEAR,PRECISION_VERTEX:pt.HIGH,PRECISION_FRAGMENT:de.apple.device?pt.HIGH:pt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Sa(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};/*! * @pixi/utils - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var Pe={parse:ba,format:xa,resolve:Ea};function yt(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function jn(r){var t=r.split("?")[0];return t.split("#")[0]}function Pa(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ca(r,t,e){return r.replace(new RegExp(Pa(t),"g"),e)}function Ia(r,t){for(var e="",i=0,n=-1,s=0,a,o=0;o<=r.length;++o){if(o2){var h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),n=o,s=0;continue}}else if(e.length===2||e.length===1){e="",i=0,n=o,s=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+="/"+r.slice(n+1,o):e=r.slice(n+1,o),i=o-n-1;n=o,s=0}else a===46&&s!==-1?++s:s=-1}return e}var ht={toPosix:function(r){return Ca(r,"\\","/")},isUrl:function(r){return/^https?:/.test(this.toPosix(r))},isDataUrl:function(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},hasProtocol:function(r){return/^[^/:]+:\//.test(this.toPosix(r))},getProtocol:function(r){yt(r),r=this.toPosix(r);var t="",e=/^file:\/\/\//.exec(r),i=/^[^/:]+:\/\//.exec(r),n=/^[^/:]+:\//.exec(r);if(e||i||n){var s=(e==null?void 0:e[0])||(i==null?void 0:i[0])||(n==null?void 0:n[0]);t=s,r=r.slice(s.length)}return t},toAbsolute:function(r,t,e){if(this.isDataUrl(r))return r;var i=jn(this.toPosix(t!=null?t:P.ADAPTER.getBaseUrl())),n=jn(this.toPosix(e!=null?e:this.rootname(i)));if(yt(r),r=this.toPosix(r),r.startsWith("/"))return ht.join(n,r.slice(1));var s=this.isAbsolute(r)?r:this.join(i,r);return s},normalize:function(r){if(r=this.toPosix(r),yt(r),r.length===0)return".";var t="",e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));var i=r.endsWith("/");return r=Ia(r,!1),r.length>0&&i&&(r+="/"),e?"/"+r:t+r},isAbsolute:function(r){return yt(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join:function(){for(var r=arguments,t,e=[],i=0;i0)if(n===void 0)n=a;else{var o=(t=e[s-1])!==null&&t!==void 0?t:"";this.extname(o)?n+="/../"+a:n+="/"+a}}return n===void 0?".":this.normalize(n)},dirname:function(r){if(yt(r),r.length===0)return".";r=this.toPosix(r);var t=r.charCodeAt(0),e=t===47,i=-1,n=!0,s=this.getProtocol(r),a=r;r=r.slice(s.length);for(var o=r.length-1;o>=1;--o)if(t=r.charCodeAt(o),t===47){if(!n){i=o;break}}else n=!1;return i===-1?e?"/":this.isUrl(a)?s+r:s:e&&i===1?"//":s+r.slice(0,i)},rootname:function(r){yt(r),r=this.toPosix(r);var t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){var e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename:function(r,t){yt(r),t&&yt(t),r=this.toPosix(r);var e=0,i=-1,n=!0,s;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";var a=t.length-1,o=-1;for(s=r.length-1;s>=0;--s){var h=r.charCodeAt(s);if(h===47){if(!n){e=s+1;break}}else o===-1&&(n=!1,o=s+1),a>=0&&(h===t.charCodeAt(a)?--a===-1&&(i=s):(a=-1,i=o))}return e===i?i=o:i===-1&&(i=r.length),r.slice(e,i)}for(s=r.length-1;s>=0;--s)if(r.charCodeAt(s)===47){if(!n){e=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":r.slice(e,i)},extname:function(r){yt(r),r=this.toPosix(r);for(var t=-1,e=0,i=-1,n=!0,s=0,a=r.length-1;a>=0;--a){var o=r.charCodeAt(a);if(o===47){if(!n){e=a+1;break}continue}i===-1&&(n=!1,i=a+1),o===46?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||i===-1||s===0||s===1&&t===i-1&&t===e+1?"":r.slice(t,i)},parse:function(r){yt(r);var t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=this.toPosix(r);var e=r.charCodeAt(0),i=this.isAbsolute(r),n;t.root=this.rootname(r),i||this.hasProtocol(r)?n=1:n=0;for(var s=-1,a=0,o=-1,h=!0,u=r.length-1,l=0;u>=n;--u){if(e=r.charCodeAt(u),e===47){if(!h){a=u+1;break}continue}o===-1&&(h=!1,o=u+1),e===46?s===-1?s=u:l!==1&&(l=1):s!==-1&&(l=-1)}return s===-1||o===-1||l===0||l===1&&s===o-1&&s===a+1?o!==-1&&(a===0&&i?t.base=t.name=r.slice(1,o):t.base=t.name=r.slice(a,o)):(a===0&&i?(t.name=r.slice(1,s),t.base=r.slice(1,o)):(t.name=r.slice(a,s),t.base=r.slice(a,o)),t.ext=r.slice(s,o)),t.dir=this.dirname(r),t},sep:"/",delimiter:":"};P.RETINA_PREFIX=/@([0-9\.]+)x/;P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Wn=!1,Vn="6.5.8";function Oa(r){var t;if(!Wn){if(P.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[` %c %c %c PixiJS `+Vn+" - \u2730 "+r+` \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;"];(t=globalThis.console).log.apply(t,e)}else globalThis.console&&globalThis.console.log("PixiJS "+Vn+" - "+r+" - http://www.pixijs.com/");Wn=!0}}var Jr;function Ba(){return typeof Jr=="undefined"&&(Jr=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!P.ADAPTER.getWebGLRenderingContext())return!1;var e=P.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),Jr}var Ma="#f0f8ff",La="#faebd7",Na="#00ffff",Fa="#7fffd4",Da="#f0ffff",Ua="#f5f5dc",Ga="#ffe4c4",ka="#000000",Xa="#ffebcd",Ha="#0000ff",ja="#8a2be2",Wa="#a52a2a",Va="#deb887",Ya="#5f9ea0",za="#7fff00",qa="#d2691e",$a="#ff7f50",Ka="#6495ed",Za="#fff8dc",Qa="#dc143c",Ja="#00ffff",to="#00008b",eo="#008b8b",ro="#b8860b",io="#a9a9a9",no="#006400",so="#a9a9a9",ao="#bdb76b",oo="#8b008b",ho="#556b2f",uo="#ff8c00",lo="#9932cc",fo="#8b0000",co="#e9967a",po="#8fbc8f",vo="#483d8b",_o="#2f4f4f",mo="#2f4f4f",go="#00ced1",yo="#9400d3",bo="#ff1493",xo="#00bfff",Eo="#696969",To="#696969",wo="#1e90ff",Ao="#b22222",So="#fffaf0",Ro="#228b22",Po="#ff00ff",Co="#dcdcdc",Io="#f8f8ff",Oo="#daa520",Bo="#ffd700",Mo="#808080",Lo="#008000",No="#adff2f",Fo="#808080",Do="#f0fff0",Uo="#ff69b4",Go="#cd5c5c",ko="#4b0082",Xo="#fffff0",Ho="#f0e68c",jo="#fff0f5",Wo="#e6e6fa",Vo="#7cfc00",Yo="#fffacd",zo="#add8e6",qo="#f08080",$o="#e0ffff",Ko="#fafad2",Zo="#d3d3d3",Qo="#90ee90",Jo="#d3d3d3",th="#ffb6c1",eh="#ffa07a",rh="#20b2aa",ih="#87cefa",nh="#778899",sh="#778899",ah="#b0c4de",oh="#ffffe0",hh="#00ff00",uh="#32cd32",lh="#faf0e6",fh="#ff00ff",ch="#800000",dh="#66cdaa",ph="#0000cd",vh="#ba55d3",_h="#9370db",mh="#3cb371",gh="#7b68ee",yh="#00fa9a",bh="#48d1cc",xh="#c71585",Eh="#191970",Th="#f5fffa",wh="#ffe4e1",Ah="#ffe4b5",Sh="#ffdead",Rh="#000080",Ph="#fdf5e6",Ch="#808000",Ih="#6b8e23",Oh="#ffa500",Bh="#ff4500",Mh="#da70d6",Lh="#eee8aa",Nh="#98fb98",Fh="#afeeee",Dh="#db7093",Uh="#ffefd5",Gh="#ffdab9",kh="#cd853f",Xh="#ffc0cb",Hh="#dda0dd",jh="#b0e0e6",Wh="#800080",Vh="#663399",Yh="#ff0000",zh="#bc8f8f",qh="#4169e1",$h="#8b4513",Kh="#fa8072",Zh="#f4a460",Qh="#2e8b57",Jh="#fff5ee",tu="#a0522d",eu="#c0c0c0",ru="#87ceeb",iu="#6a5acd",nu="#708090",su="#708090",au="#fffafa",ou="#00ff7f",hu="#4682b4",uu="#d2b48c",lu="#008080",fu="#d8bfd8",cu="#ff6347",du="#40e0d0",pu="#ee82ee",vu="#f5deb3",_u="#ffffff",mu="#f5f5f5",gu="#ffff00",yu="#9acd32",bu={aliceblue:Ma,antiquewhite:La,aqua:Na,aquamarine:Fa,azure:Da,beige:Ua,bisque:Ga,black:ka,blanchedalmond:Xa,blue:Ha,blueviolet:ja,brown:Wa,burlywood:Va,cadetblue:Ya,chartreuse:za,chocolate:qa,coral:$a,cornflowerblue:Ka,cornsilk:Za,crimson:Qa,cyan:Ja,darkblue:to,darkcyan:eo,darkgoldenrod:ro,darkgray:io,darkgreen:no,darkgrey:so,darkkhaki:ao,darkmagenta:oo,darkolivegreen:ho,darkorange:uo,darkorchid:lo,darkred:fo,darksalmon:co,darkseagreen:po,darkslateblue:vo,darkslategray:_o,darkslategrey:mo,darkturquoise:go,darkviolet:yo,deeppink:bo,deepskyblue:xo,dimgray:Eo,dimgrey:To,dodgerblue:wo,firebrick:Ao,floralwhite:So,forestgreen:Ro,fuchsia:Po,gainsboro:Co,ghostwhite:Io,goldenrod:Oo,gold:Bo,gray:Mo,green:Lo,greenyellow:No,grey:Fo,honeydew:Do,hotpink:Uo,indianred:Go,indigo:ko,ivory:Xo,khaki:Ho,lavenderblush:jo,lavender:Wo,lawngreen:Vo,lemonchiffon:Yo,lightblue:zo,lightcoral:qo,lightcyan:$o,lightgoldenrodyellow:Ko,lightgray:Zo,lightgreen:Qo,lightgrey:Jo,lightpink:th,lightsalmon:eh,lightseagreen:rh,lightskyblue:ih,lightslategray:nh,lightslategrey:sh,lightsteelblue:ah,lightyellow:oh,lime:hh,limegreen:uh,linen:lh,magenta:fh,maroon:ch,mediumaquamarine:dh,mediumblue:ph,mediumorchid:vh,mediumpurple:_h,mediumseagreen:mh,mediumslateblue:gh,mediumspringgreen:yh,mediumturquoise:bh,mediumvioletred:xh,midnightblue:Eh,mintcream:Th,mistyrose:wh,moccasin:Ah,navajowhite:Sh,navy:Rh,oldlace:Ph,olive:Ch,olivedrab:Ih,orange:Oh,orangered:Bh,orchid:Mh,palegoldenrod:Lh,palegreen:Nh,paleturquoise:Fh,palevioletred:Dh,papayawhip:Uh,peachpuff:Gh,peru:kh,pink:Xh,plum:Hh,powderblue:jh,purple:Wh,rebeccapurple:Vh,red:Yh,rosybrown:zh,royalblue:qh,saddlebrown:$h,salmon:Kh,sandybrown:Zh,seagreen:Qh,seashell:Jh,sienna:tu,silver:eu,skyblue:ru,slateblue:iu,slategray:nu,slategrey:su,snow:au,springgreen:ou,steelblue:hu,tan:uu,teal:lu,thistle:fu,tomato:cu,turquoise:du,violet:pu,wheat:vu,white:_u,whitesmoke:mu,yellow:gu,yellowgreen:yu};function ze(r,t){return t===void 0&&(t=[]),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,t}function Fs(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function Ds(r){return typeof r=="string"&&(r=bu[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function xu(){for(var r=[],t=[],e=0;e<32;e++)r[e]=e,t[e]=e;r[B.NORMAL_NPM]=B.NORMAL,r[B.ADD_NPM]=B.ADD,r[B.SCREEN_NPM]=B.SCREEN,t[B.NORMAL]=B.NORMAL_NPM,t[B.ADD]=B.ADD_NPM,t[B.SCREEN]=B.SCREEN_NPM;var i=[];return i.push(t),i.push(r),i}var Eu=xu();function Us(r,t){if(t===1)return(t*255<<24)+r;if(t===0)return 0;var e=r>>16&255,i=r>>8&255,n=r&255;return e=e*t+.5|0,i=i*t+.5|0,n=n*t+.5|0,(t*255<<24)+(e<<16)+(i<<8)+n}function Tu(r,t,e,i){return e=e||new Float32Array(4),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,(i||i===void 0)&&(e[0]*=t,e[1]*=t,e[2]*=t),e[3]=t,e}function Gs(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function Br(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Yn(r){return!(r&r-1)&&!!r}function zn(r){var t=(r>65535?1:0)<<4;r>>>=t;var e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function je(r,t,e){var i=r.length,n;if(!(t>=i||e===0)){e=t+e>i?i-t:e;var s=i-e;for(n=t;n8)throw new Error("max arguments reached");var u=this,l=u.name,f=u.items;this._aliasCount++;for(var c=0,d=f.length;c0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},r.prototype.remove=function(t){var e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},r.prototype.contains=function(t){return this.items.indexOf(t)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(ot.prototype,{dispatch:{value:ot.prototype.emit},run:{value:ot.prototype.emit}});/*! * @pixi/ticker - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/ticker is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */P.TARGET_FPMS=.06;var $e;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})($e||($e={}));var ti=function(){function r(t,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=t,this.context=e,this.priority=i,this.once=n}return r.prototype.match=function(t,e){return e===void 0&&(e=null),this.fn===t&&this.context===e},r.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},r.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},r.prototype.destroy=function(t){t===void 0&&(t=!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=t?null:e,this.previous=null,e},r}(),Xt=function(){function r(){var t=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 ti(null,null,1/0),this.deltaMS=1/P.TARGET_FPMS,this.elapsedMS=1/P.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&t._requestId===null&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(t,e,i){return i===void 0&&(i=$e.NORMAL),this._addListener(new ti(t,e,i))},r.prototype.addOnce=function(t,e,i){return i===void 0&&(i=$e.NORMAL),this._addListener(new ti(t,e,i,!0))},r.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(t,e){for(var i=this._head.next;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(t){t===void 0&&(t=performance.now());var e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i=this.x&&t=this.y&&et.right?t.right:this.right;if(n<=i)return!1;var s=this.yt.bottom?t.bottom:this.bottom;return a>s}var o=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=o||l<=u)return!1;var f=hr[0].set(t.left,t.top),c=hr[1].set(t.left,t.bottom),d=hr[2].set(t.right,t.top),p=hr[3].set(t.right,t.bottom);if(d.x<=f.x||c.y<=f.y)return!1;var v=Math.sign(e.a*e.d-e.b*e.c);if(v===0||(e.apply(f,f),e.apply(c,c),e.apply(d,d),e.apply(p,p),Math.max(f.x,c.x,d.x,p.x)<=o||Math.min(f.x,c.x,d.x,p.x)>=h||Math.max(f.y,c.y,d.y,p.y)<=u||Math.min(f.y,c.y,d.y,p.y)>=l))return!1;var _=v*(c.y-f.y),m=v*(f.x-c.x),x=_*o+m*u,E=_*h+m*u,w=_*o+m*l,y=_*h+m*l;if(Math.max(x,E,w,y)<=_*f.x+m*f.y||Math.min(x,E,w,y)>=_*p.x+m*p.y)return!1;var b=v*(f.y-d.y),g=v*(d.x-f.x),A=b*o+g*u,T=b*h+g*u,R=b*o+g*l,O=b*h+g*l;return!(Math.max(A,T,R,O)<=b*f.x+g*f.y||Math.min(A,T,R,O)>=b*p.x+g*p.y)},r.prototype.pad=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this},r.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(t,e){t===void 0&&(t=1),e===void 0&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Cu=function(){function r(t,e,i){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=at.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-t,s=this.y-e;return n*=n,s*=s,n+s<=i},r.prototype.getBounds=function(){return new W(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r}(),Iu=function(){function r(t,e,i,n){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n,this.type=at.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,n=(e-this.y)/this.height;return i*=i,n*=n,i+n<=1},r.prototype.getBounds=function(){return new W(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Sr=function(){function r(){for(var t=arguments,e=[],i=0;ie!=l>e&&t<(u-o)*((e-h)/(l-h))+o;f&&(i=!i)}return i},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(t,e){return t+", "+e},"")+"]")},r}(),Ou=function(){function r(t,e,i,n,s){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),s===void 0&&(s=20),this.x=t,this.y=e,this.width=i,this.height=n,this.radius=s,this.type=at.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=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||t>=this.x+i&&t<=this.x+this.width-i)return!0;var n=t-(this.x+i),s=e-(this.y+i),a=i*i;if(n*n+s*s<=a||(n=t-(this.x+this.width-i),n*n+s*s<=a)||(s=e-(this.y+this.height-i),n*n+s*s<=a)||(n=t-(this.x+i),n*n+s*s<=a))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r}(),Ie=function(){function r(t,e,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return r.prototype.clone=function(t,e){return t===void 0&&(t=this.cb),e===void 0&&(e=this.scope),new r(t,e,this._x,this._y)},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(t){return t.set(this._x,this._y),t},r.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x="+0+" y="+0+" scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),dt=function(){function r(t,e,i,n,s,a){t===void 0&&(t=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),a===void 0&&(a=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=a}return r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.set=function(t,e,i,n,s,a){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=a,this},r.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(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},r.prototype.apply=function(t,e){e=e||new q;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new q;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,a=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=a*e-this.ty*i,this.ty=a*i+this.ty*e,this},r.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this},r.prototype.setTransform=function(t,e,i,n,s,a,o,h,u){return this.a=Math.cos(o+u)*s,this.b=Math.sin(o+u)*s,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},r.prototype.prepend=function(t){var e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,s=this.d,a=t.pivot,o=-Math.atan2(-n,s),h=Math.atan2(i,e),u=Math.abs(o+h);return u<1e-5||Math.abs(Mr-u)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=h),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(a.x*e+a.y*n),t.position.y=this.ty+(a.x*i+a.y*s),t},r.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,a=t*n-e*i;return this.a=n/a,this.b=-e/a,this.c=-i/a,this.d=t/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(t*this.ty-e*s)/a,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},r.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(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),ue=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],le=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],fe=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ce=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ci=[],ks=[],ur=Math.sign;function Bu(){for(var r=0;r<16;r++){var t=[];Ci.push(t);for(var e=0;e<16;e++)for(var i=ur(ue[r]*ue[e]+fe[r]*le[e]),n=ur(le[r]*ue[e]+ce[r]*le[e]),s=ur(ue[r]*fe[e]+fe[r]*ce[e]),a=ur(le[r]*fe[e]+ce[r]*ce[e]),o=0;o<16;o++)if(ue[o]===i&&le[o]===n&&fe[o]===s&&ce[o]===a){t.push(o);break}}for(var r=0;r<16;r++){var h=new dt;h.set(ue[r],le[r],fe[r],ce[r],0,0),ks.push(h)}}Bu();var tt={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(r){return ue[r]},uY:function(r){return le[r]},vX:function(r){return fe[r]},vY:function(r){return ce[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return Ci[r][t]},sub:function(r,t){return Ci[r][tt.inv(t)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,t){return Math.abs(r)*2<=Math.abs(t)?t>=0?tt.S:tt.N:Math.abs(t)*2<=Math.abs(r)?r>0?tt.E:tt.W:t>0?r>0?tt.SE:tt.SW:r>0?tt.NE:tt.NW},matrixAppendRotationInv:function(r,t,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=ks[tt.inv(t)];n.tx=e,n.ty=i,r.append(n)}},Mu=function(){function r(){this.worldTransform=new dt,this.localTransform=new dt,this.position=new Ie(this.onChange,this,0,0),this.scale=new Ie(this.onChange,this,1,1),this.pivot=new Ie(this.onChange,this,0,0),this.skew=new Ie(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 r.prototype.onChange=function(){this._localID++},r.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++},r.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+") ")+"]"},r.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(t){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!==t._worldID){var i=t.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=t._worldID,this._worldID++}},r.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*! * @pixi/core - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/core is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */P.PREFER_ENV=de.any?zt.WEBGL:zt.WEBGL2;P.STRICT_TEXTURE_CACHE=!1;var Ii=[];function Xs(r,t){if(!r)return null;var e="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(e=i[1].toLowerCase())}for(var n=Ii.length-1;n>=0;--n){var s=Ii[n];if(s.test&&s.test(r,e))return new s(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Oi=function(r,t){return Oi=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])},Oi(r,t)};function Z(r,t){Oi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Bi=function(){return Bi=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n0&&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(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.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},t.prototype.setSize=function(e,i,n){return n=n||this.resolution,this.setRealSize(e*n,i*n,n)},t.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},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Yn(this.realWidth)&&Yn(this.realHeight)},t.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)},t.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},t.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))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ie[this.cacheId],delete Ut[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,i,n){n===void 0&&(n=P.STRICT_TEXTURE_CACHE);var s=typeof e=="string",a=null;if(s)a=e;else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+qe()}a=e._pixiId}var h=ie[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return h||(h=new t(e,i),h.cacheId=a,t.addToCache(h,a)),h},t.fromBuffer=function(e,i,n,s){e=e||new Float32Array(i*n*4);var a=new _e(e,{width:i,height:n}),o=e instanceof Float32Array?M.FLOAT:M.UNSIGNED_BYTE;return new t(a,Object.assign({},Nu,s||{width:i,height:n,type:o}))},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),ie[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),ie[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=ie[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete ie[e],i}}else if(e&&e.textureCacheIds){for(var s=0;s0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=pe.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},t.prototype.upload=function(e,i,n){for(var s=this.itemDirtyIds,a=0;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(ee),Gu=function(r){Z(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var a=e[0].src||e[0];ee.crossOrigin(s,a,i.crossorigin);for(var o=0;o2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Xt.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Xt.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.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()},t.prototype.dispose=function(){this._isConnectedToTicker&&(Xt.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()),r.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Xt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Xt.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(i)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(ee),ku=function(r){Z(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap},t}(ee);Ii.push(js,ku,Du,Gu,Mi,_e,Uu,Fu);var Xu=function(r){Z(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,i,n){var s=e.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ct.UNPACK);var a=i.realWidth,o=i.realHeight;return n.width===a&&n.height===o?s.texSubImage2D(i.target,0,0,0,a,o,i.format,n.type,this.data):(n.width=a,n.height=o,s.texImage2D(i.target,0,n.internalFormat,a,o,0,i.format,n.type,this.data)),!0},t}(_e),Li=function(){function r(t,e){this.width=Math.round(t||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=rt.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(t,e){return t===void 0&&(t=0),this.colorTextures[t]=e||new X(null,{scaleMode:It.NEAREST,resolution:1,mipmap:ut.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new X(new Xu(null,{width:this.width,height:this.height}),{scaleMode:It.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ut.OFF,format:S.DEPTH_COMPONENT,type:M.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&i.textureCacheIds.splice(n,1),delete Ut[e],i}}else if(e&&e.textureCacheIds){for(var s=0;sthis.baseTexture.width,h=n+a>this.baseTexture.height;if(o||h){var u=o&&h?"and":"or",l="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,f="Y: "+n+" + "+a+" = "+(n+a)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=s&&a&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new X),lr(t._EMPTY),lr(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=P.ADAPTER.createCanvas(16,16),i=e.getContext("2d");e.width=16,e.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),t._WHITE=new t(X.from(e)),lr(t._WHITE),lr(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(Vr),$i=function(r){Z(t,r);function t(e,i){var n=r.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,a=Math.round(e*s)/s,o=Math.round(i*s)/s;this.valid=a>0&&o>0,this._frame.width=this.orig.width=a,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(a,o),this.updateUvs()},t.prototype.setResolution=function(e){var i=this.baseTexture;i.resolution!==e&&(i.setResolution(e),this.resize(i.width,i.height,!1))},t.create=function(e){for(var i=arguments,n=[],s=1;s>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var a=this.texturePool[s].pop();return a||(a=this.createTexture(t,e,n)),a.filterPoolKey=s,a.setResolution(i),a},r.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||rt.NONE);return n.filterFrame=t.filterFrame,n},r.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},r.prototype.returnFilterTexture=function(t){this.returnTexture(t)},r.prototype.clear=function(t){if(t=t!==!1,t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n1){for(var l=0;l1&&(f=this.getOptimalFilterTexture(l.width,l.height,e.resolution),f.filterFrame=l.filterFrame),i[c].apply(this,l,f,Qt.CLEAR,e);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,Qt.BLEND,e),c>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(f)}e.clear(),this.statePool.push(e)},r.prototype.bindAndClear=function(t,e){e===void 0&&(e=Qt.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,n.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=s.stateId&1||this.forceClear;(e===Qt.CLEAR||e===Qt.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,i,n){var s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Tt.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Tt.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,a=e._texture.orig,o=t.set(s.width,0,0,s.height,n.x,n.y),h=e.worldTransform.copyTo(dt.TEMP_MATRIX);return h.invert(),o.prepend(h),o.scale(1/a.width,1/a.height),o.translate(e.anchor.x,e.anchor.y),o},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(t,e,i,n){return i===void 0&&(i=1),n===void 0&&(n=rt.NONE),this.texturePool.getOptimalTexture(t,e,i,n)},r.prototype.getFilterTexture=function(t,e,i){if(typeof t=="number"){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||rt.NONE);return s.filterFrame=t.filterFrame,s},r.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(t,e){var i=fr[0],n=fr[1],s=fr[2],a=fr[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),a.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(a,a);var o=Math.min(i.x,n.x,s.x,a.x),h=Math.min(i.y,n.y,s.y,a.y),u=Math.max(i.x,n.x,s.x,a.x),l=Math.max(i.y,n.y,s.y,a.y);e.x=o,e.y=h,e.width=u-o,e.height=l-h},r.prototype.roundFrame=function(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){var a=s.a,o=s.b,h=s.c,u=s.d;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(u)>1e-4))return}s=s?ei.copyFrom(s):ei.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}},r}(),Ys=function(){function r(t){this.renderer=t}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(t){},r}(),Ju=function(){function r(t){this.renderer=t,this.emptyRenderer=new Ys(t),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},r.prototype.boundArray=function(t,e,i,n){for(var s=t.elements,a=t.ids,o=t.count,h=0,u=0;u=0&&f=zt.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.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},r.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(t){t.preventDefault()},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t 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||!!t.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")},r}(),el=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=rt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),rl=new W,il=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Li(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new W,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;P.PREFER_ENV===zt.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(n){return e.drawBuffersWEBGL(n)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},r.prototype.bind=function(t,e,i){i===void 0&&(i=0);var n=this.gl;if(t){var s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var a=0;a>i,u=e.height>>i,l=h/e.width;this.setViewport(e.x*l,e.y*l,h,u)}else{var h=t.width>>i,u=t.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)},r.prototype.setViewport=function(t,e,i,n){var s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(r.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}),r.prototype.clear=function(t,e,i,n,s){s===void 0&&(s=Cr.COLOR|Cr.DEPTH);var a=this.gl;a.clearColor(t,e,i,n),a.clear(s)},r.prototype.initFramebuffer=function(t){var e=this.gl,i=new el(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,s=n.length;e.drawBuffers||(s=Math.min(s,1));for(var a=0;a1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,t.width,t.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;h1&&i.drawBuffers(o),t.depthTexture){var f=this.writeDepthTexture;if(f){var c=t.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,e)}}(t.stencil||t.depth)&&!(t.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,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture},r.prototype.detectSamples=function(t){var e=this.msaaSamples,i=rt.NONE;if(t<=1||e===null)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(s,1),t.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()}},r.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=zt.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Le=t}return Le}var cr;function hl(){if(!cr){cr=pt.MEDIUM;var r=ol();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);cr=t.precision?pt.HIGH:pt.MEDIUM}}return cr}function is(r,t,e){if(r.substring(0,9)!=="precision"){var i=t;return t===pt.HIGH&&e!==pt.HIGH&&(i=pt.MEDIUM),"precision "+i+` float; `+r}else if(e!==pt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var ul={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 $s(r){return ul[r]}var dr=null,ns={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 Ks(r,t){if(!dr){var e=Object.keys(ns);dr={};for(var i=0;i0&&(t+=` else `),e0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),Qs=function(){function r(t){this.renderer=t,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),as=new dt,os=[],Rl=function(r){Z(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=P.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var i;if(!e._scissorRectLocal){var n=e._scissorRect,s=e.maskObject,a=this.renderer,o=a.renderTexture,h=s.getBounds(!0,(i=os.pop())!==null&&i!==void 0?i:new W);this.roundFrameToPixels(h,o.current?o.current.resolution:a.resolution,o.sourceFrame,o.destinationFrame,a.projection.transform),n&&h.fit(n),e._scissorRectLocal=h}},t.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,s=e.c,a=e.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(a)>1e-4)},t.prototype.testScissor=function(e){var i=e.maskObject;if(!i.isFastRect||!i.isFastRect()||t.isMatrixRotated(i.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,i,n,s,a){t.isMatrixRotated(a)||(a=a?as.copyFrom(a):as.identity(),a.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(a,e),e.fit(s),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))},t.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()},t.prototype.pop=function(e){var i=this.renderer.gl;e&&os.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},t.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)},t}(Qs),Pl=function(r){Z(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=P.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var i=e.maskObject,n=this.renderer.gl,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var a=e._colorMask;a!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,a!==0&&(e._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,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,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Qs),Cl=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new dt,this.transform=null}return r.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,i,n){var s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=a*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-a-e.y*s.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),ne=new W,Fe=new W,Il=function(){function r(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new W,this.destinationFrame=new W,this.viewportFrame=new W}return r.prototype.bind=function(t,e,i){t===void 0&&(t=null);var n=this.renderer;this.current=t;var s,a,o;t?(s=t.baseTexture,o=s.resolution,e||(ne.width=t.frame.width,ne.height=t.frame.height,e=ne),i||(Fe.x=t.frame.x,Fe.y=t.frame.y,Fe.width=e.width,Fe.height=e.height,i=Fe),a=s.framebuffer):(o=n.resolution,e||(ne.width=n.screen.width,ne.height=n.screen.height,e=ne),i||(i=ne,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,t||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,e,o,!a),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(t,e){this.current?t=t||this.current.baseTexture.clearColor:t=t||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var a=this.viewportFrame,o=a.x,h=a.y,u=a.width,l=a.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(t[0],t[1],t[2],t[3],e),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function Ol(r,t,e,i,n){e.buffer.update(n)}var Bl={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]; } `},Js={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 Ml(r){for(var t=r.map(function(h){return{data:h,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,s=0;s1&&(e=Math.max(e,16)*a.data.size),a.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,a.offset=n,n+=e,i=e):(a.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function Ll(r,t){var e=[];for(var i in r)t[i]&&e.push(t[i]);return e.sort(function(n,s){return n.index-s.index}),e}function Nl(r,t){if(!r.autoManage)return{size:0,syncFunc:Ol};for(var e=Ll(r.uniforms,t),i=Ml(e),n=i.uboElements,s=i.size,a=[` 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;o1){var p=$s(h.data.type),v=Math.max(Js[h.data.type]/16,1),_=p/v,m=(4-_%4)%4;a.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 x=Bl[h.data.type];a.push(` cv = ud.`+l+`.value; v = uv.`+l+`; offset = `+h.offset/4+`; `+x+`; `)}}return a.push(` renderer.buffer.update(buffer); `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",a.join(` `))}}var Fl=function(){function r(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function Dl(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),n=0;nf?1:-1});for(var a=0;a>1,i++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){for(var a=0,n=0;n=0;n--)this.unload(t.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function Zl(r){var t,e,i,n,s,a,o,h,u,l,f,c,d,p,v,_,m,x,E,w,y,b,g;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?g=(t={},t[M.UNSIGNED_BYTE]=(e={},e[S.RGBA]=r.RGBA8,e[S.RGB]=r.RGB8,e[S.RG]=r.RG8,e[S.RED]=r.R8,e[S.RGBA_INTEGER]=r.RGBA8UI,e[S.RGB_INTEGER]=r.RGB8UI,e[S.RG_INTEGER]=r.RG8UI,e[S.RED_INTEGER]=r.R8UI,e[S.ALPHA]=r.ALPHA,e[S.LUMINANCE]=r.LUMINANCE,e[S.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[M.BYTE]=(i={},i[S.RGBA]=r.RGBA8_SNORM,i[S.RGB]=r.RGB8_SNORM,i[S.RG]=r.RG8_SNORM,i[S.RED]=r.R8_SNORM,i[S.RGBA_INTEGER]=r.RGBA8I,i[S.RGB_INTEGER]=r.RGB8I,i[S.RG_INTEGER]=r.RG8I,i[S.RED_INTEGER]=r.R8I,i),t[M.UNSIGNED_SHORT]=(n={},n[S.RGBA_INTEGER]=r.RGBA16UI,n[S.RGB_INTEGER]=r.RGB16UI,n[S.RG_INTEGER]=r.RG16UI,n[S.RED_INTEGER]=r.R16UI,n[S.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),t[M.SHORT]=(s={},s[S.RGBA_INTEGER]=r.RGBA16I,s[S.RGB_INTEGER]=r.RGB16I,s[S.RG_INTEGER]=r.RG16I,s[S.RED_INTEGER]=r.R16I,s),t[M.UNSIGNED_INT]=(a={},a[S.RGBA_INTEGER]=r.RGBA32UI,a[S.RGB_INTEGER]=r.RGB32UI,a[S.RG_INTEGER]=r.RG32UI,a[S.RED_INTEGER]=r.R32UI,a[S.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,a),t[M.INT]=(o={},o[S.RGBA_INTEGER]=r.RGBA32I,o[S.RGB_INTEGER]=r.RGB32I,o[S.RG_INTEGER]=r.RG32I,o[S.RED_INTEGER]=r.R32I,o),t[M.FLOAT]=(h={},h[S.RGBA]=r.RGBA32F,h[S.RGB]=r.RGB32F,h[S.RG]=r.RG32F,h[S.RED]=r.R32F,h[S.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),t[M.HALF_FLOAT]=(u={},u[S.RGBA]=r.RGBA16F,u[S.RGB]=r.RGB16F,u[S.RG]=r.RG16F,u[S.RED]=r.R16F,u),t[M.UNSIGNED_SHORT_5_6_5]=(l={},l[S.RGB]=r.RGB565,l),t[M.UNSIGNED_SHORT_4_4_4_4]=(f={},f[S.RGBA]=r.RGBA4,f),t[M.UNSIGNED_SHORT_5_5_5_1]=(c={},c[S.RGBA]=r.RGB5_A1,c),t[M.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[S.RGBA]=r.RGB10_A2,d[S.RGBA_INTEGER]=r.RGB10_A2UI,d),t[M.UNSIGNED_INT_10F_11F_11F_REV]=(p={},p[S.RGB]=r.R11F_G11F_B10F,p),t[M.UNSIGNED_INT_5_9_9_9_REV]=(v={},v[S.RGB]=r.RGB9_E5,v),t[M.UNSIGNED_INT_24_8]=(_={},_[S.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),t[M.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[S.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),t):g=(x={},x[M.UNSIGNED_BYTE]=(E={},E[S.RGBA]=r.RGBA,E[S.RGB]=r.RGB,E[S.ALPHA]=r.ALPHA,E[S.LUMINANCE]=r.LUMINANCE,E[S.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,E),x[M.UNSIGNED_SHORT_5_6_5]=(w={},w[S.RGB]=r.RGB,w),x[M.UNSIGNED_SHORT_4_4_4_4]=(y={},y[S.RGBA]=r.RGBA,y),x[M.UNSIGNED_SHORT_5_5_5_1]=(b={},b[S.RGBA]=r.RGBA,b),x),g}var li=function(){function r(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=M.UNSIGNED_BYTE,this.internalFormat=S.RGBA,this.samplerType=0}return r}(),Ql=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new X,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Zl(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=0;--a){var o=i[a];if(o){var h=o._glTextures[s];h.samplerType!==Ir.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(t){var e=new li(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},r.prototype.initTextureType=function(t,e){var i,n;e.internalFormat=(n=(i=this.internalFormats[t.type])===null||i===void 0?void 0:i[t.format])!==null&&n!==void 0?n:t.format,this.webGLVersion===2&&t.type===M.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},r.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(!!e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==Ir.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,s=t.realHeight,a=i.gl;(e.width!==n||e.height!==s||e.dirtyId<0)&&(e.width=n,e.height=s,a.texImage2D(t.target,0,e.internalFormat,n,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},r.prototype.destroyTexture=function(t,e){var i=this.gl;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);n!==-1&&je(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];!e||((t.mipmap===ut.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Be.CLAMP:e.wrapMode=t.wrapMode,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},r.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==ut.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===It.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===It.LINEAR){var s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===It.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===It.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),fi=new dt,Jl=function(r){Z(t,r);function t(e,i){e===void 0&&(e=Ye.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},P.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new W(0,0,i.width,i.height),n.view=i.view||P.ADAPTER.createCanvas(),n.resolution=i.resolution||P.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&&(Mt("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 t.prototype.initPlugins=function(e){for(var i in e)this.plugins[i]=new e[i](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.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,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(Mt("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var a=i.region,o=Lu(i,["region"]);s=a||e.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=$i.create(Bi({width:s.width,height:s.height},o));return fi.tx=-s.x,fi.ty=-s.y,this.render(e,{renderTexture:h,clear:!1,transform:fi,skipUpdateTransform:!!e.parent}),h},t.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=Ye.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=Fs(e),ze(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(Vr),tf=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),ef=function(){function r(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n]||this.createGLBuffer(t);i.bindBuffer(t.type,s.buffer)},r.prototype.bindBufferBase=function(t,e){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var a=t._glBuffers[s]||this.createGLBuffer(t);this.boundBufferBases[e]=t,n.bindBufferBase(n.UNIFORM_BUFFER,e,a.buffer)}},r.prototype.bindBufferRange=function(t,e,i){var n=this,s=n.gl,a=n.CONTEXT_UID;i=i||0;var o=t._glBuffers[a]||this.createGLBuffer(t);s.bindBufferRange(s.UNIFORM_BUFFER,e||0,o.buffer,i*256,256)},r.prototype.update=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n];if(t._updateID!==s.updateID)if(s.updateID=t._updateID,i.bindBuffer(t.type,s.buffer),s.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var a=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,a)}},r.prototype.dispose=function(t,e){if(!!this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=rt.HIGH?this.multisample=rt.HIGH:i>=rt.MEDIUM?this.multisample=rt.MEDIUM:i>=rt.LOW?this.multisample=rt.LOW:this.multisample=rt.NONE},t.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 s in this.runners)this.runners[s].add(n);return this},t.prototype.render=function(e,i){var n,s,a,o;if(i&&(i instanceof $i?(Mt("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],a=arguments[3],o=arguments[4]):(n=i.renderTexture,s=i.clear,a=i.transform,o=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=a,!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(),(s!==void 0?s: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")}},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={});var a=r.prototype.generateTexture.call(this,e,i,n,s);return this.framebuffer.blit(),a},t.prototype.resize=function(e,i){r.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(e){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Mt("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,i){Mt("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),At.add({name:e,type:F.RendererPlugin,ref:i})},t.__plugins={},t}(Jl);At.handleByMap(F.RendererPlugin,ta.__plugins);function rf(r){return ta.create(r)}var Ni=function(){function r(){this.texArray=null,this.blend=0,this.type=Tt.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),Fi=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var t=0;tthis.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)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,i=e._bufferedTextures,n=e.MAX_TEXTURES,s=t._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++X._globalBatch,l=0,f=s[0],c=0;a.copyBoundTextures(o,n);for(var d=0;d=n&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,d),c=d,f=s[++l],++u),p._batchEnabled=u,p.touched=h,f.elements[f.count++]=p)}f.count>0&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d0&&(e+=` else `),ithis.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?W.EMPTY:(t=t||new W(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},r.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},r.prototype.addPointMatrix=function(t,e){var i=t.a,n=t.b,s=t.c,a=t.d,o=t.tx,h=t.ty,u=i*e.x+s*e.y+o,l=n*e.x+a*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)},r.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=t[0],o=t[1];e=an?a:n,s=o>s?o:s,a=t[2],o=t[3],e=an?a:n,s=o>s?o:s,a=t[4],o=t[5],e=an?a:n,s=o>s?o:s,a=t[6],o=t[7],e=an?a:n,s=o>s?o:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)},r.prototype.addFrameMatrix=function(t,e,i,n,s){var a=t.a,o=t.b,h=t.c,u=t.d,l=t.tx,f=t.ty,c=this.minX,d=this.minY,p=this.maxX,v=this.maxY,_=a*e+h*i+l,m=o*e+u*i+f;c=_p?_:p,v=m>v?m:v,_=a*n+h*i+l,m=o*n+u*i+f,c=_p?_:p,v=m>v?m:v,_=a*e+h*s+l,m=o*e+u*s+f,c=_p?_:p,v=m>v?m:v,_=a*n+h*s+l,m=o*n+u*s+f,c=_p?_:p,v=m>v?m:v,this.minX=c,this.minY=d,this.maxX=p,this.maxY=v},r.prototype.addVertexData=function(t,e,i){for(var n=this.minX,s=this.minY,a=this.maxX,o=this.maxY,h=e;ha?u:a,o=l>o?l:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o},r.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},r.prototype.addVerticesMatrix=function(t,e,i,n,s,a){s===void 0&&(s=0),a===void 0&&(a=s);for(var o=t.a,h=t.b,u=t.c,l=t.d,f=t.tx,c=t.ty,d=this.minX,p=this.minY,v=this.maxX,_=this.maxY,m=i;mn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},r.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXu?s:u,this.maxY=a>l?a:l}},r.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},r.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXu?s:u,this.maxY=a>l?a:l}},r.prototype.pad=function(t,e){t===void 0&&(t=0),e===void 0&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},r.prototype.addFramePad=function(t,e,i,n,s,a){t-=s,e-=a,i+=s,n+=a,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n},r}();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Ui=function(r,t){return Ui=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])},Ui(r,t)};function Ki(r,t){Ui(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Nr=function(r){Ki(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new Mu,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 Lr,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 t.mixin=function(e){for(var i=Object.keys(e),n=0;n1)for(var s=0;sthis.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},t.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);je(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n1)for(var s=0;s0&&a<=s){o=this.children.splice(n,a);for(var h=0;h1&&this.children.sort(uf),this.sortDirty=!1},t.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;e0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(e);else if(this.cullArea)return;for(var a=0,o=this.children.length;a=s&&De.x=a&&De.y>16)+(e&65280)+((e&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.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||k.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}),t}(me);/*! * @pixi/particle-emitter - v5.0.8 * Compiled Mon, 28 Nov 2022 04:01:38 UTC * * @pixi/particle-emitter is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */class Ot{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:sa(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let n;const{value:s,time:a}=i[0],o=n=new Ot(typeof s=="string"?_r(s):s,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==s)for(let h=1;h0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:sa(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const n=$.knownBehaviors[i.type];return n?new n(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(se),e.sort((i,n)=>i===se?n.order===K.Spawn?1:-1:n===se?i.order===K.Spawn?-1:1:i.order-n.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==se&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==se&&i.recycleParticle)}getBehavior(t){return $.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof $.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new ci(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;ia.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let u=0;u=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 a,o;if(this._prevPosIsValid&&this._posChanged){const l=1+this._spawnTimer/t;a=(n-e)*l+e,o=(s-i)*l+i}else a=n,o=s;let h=null,u=null;for(let l=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),f=0;f=this.spawnChance)continue;let c;if(this.minLifetime===this.maxLifetime?c=this.minLifetime:c=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=c)continue;let d;this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new ci(this),d.init(c),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.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new ci(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 s=0;sthis.maxSpeed&&na(i,this.maxSpeed/a)}t.x+=(n+i.x)/2*e,t.y+=(s+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}Ji.type="moveAcceleration";Ji.editorConfig=null;function pf(r){return this.ease&&(r=this.ease(r)),(this.first.next.value-this.first.value)*r+this.first.value}function vf(r){this.ease&&(r=this.ease(r));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*r+t.r,n=(e.g-t.g)*r+t.g,s=(e.b-t.b)*r+t.b;return qr(i,n,s)}function _f(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;return r=(r-t.time)/(e.time-t.time),(e.value-t.value)*r+t.value}function mf(r){this.ease&&(r=this.ease(r));let t=this.first,e=t.next;for(;r>e.time;)t=e,e=e.next;r=(r-t.time)/(e.time-t.time);const i=t.value,n=e.value,s=(n.r-i.r)*r+i.r,a=(n.g-i.g)*r+i.g,o=(n.b-i.b)*r+i.b;return qr(s,a,o)}function gf(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;return t.value}function yf(r){this.ease&&(r=this.ease(r));let t=this.first;for(;t.next&&r>t.next.time;)t=t.next;const e=t.value;return qr(e.r,e.g,e.b)}class rr{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?vf:pf:t.isStepped?this.interpolate=this.isColor?yf:gf:this.interpolate=this.isColor?mf:_f,this.ease=this.first.ease}}class tn{constructor(t){this.order=K.Normal,this.list=new rr(!1),this.list.reset(Ot.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}tn.type="alpha";tn.editorConfig=null;class en{constructor(t){this.order=K.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}en.type="alphaStatic";en.editorConfig=null;function aa(r){const t=[];for(let e=0;e0;--n)t.push(i)}}return t}class rn{constructor(t){this.order=K.Normal,this.anims=[];for(let e=0;e0?i.framerate:60,a={textures:n,duration:s>0?n.length/s:0,framerate:s,loop:s>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;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(t,e){const i=t.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 s=i.animElapsed*i.animFramerate+1e-7|0;t.texture=n.textures[s]||n.textures[n.textures.length-1]||k.EMPTY}}rn.type="animatedRandom";rn.editorConfig=null;class nn{constructor(t){this.order=K.Normal;const e=t.anim,i=aa(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(t){let e=t;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(t,e){const i=this.anim,n=t.config;n.animElapsed+=e,n.animElapsed>=n.animDuration&&(i.loop?n.animElapsed=n.animElapsed%n.animDuration:n.animElapsed=n.animDuration-1e-6);const s=n.animElapsed*n.animFramerate+1e-7|0;t.texture=i.textures[s]||i.textures[i.textures.length-1]||k.EMPTY}}nn.type="animatedSingle";nn.editorConfig=null;class sn{constructor(t){this.order=K.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=df(this.value),e=e.next}}sn.type="blendMode";sn.editorConfig=null;class an{constructor(t){this.order=K.Spawn,this.spacing=t.spacing*Ct,this.start=t.start*Ct,this.distance=t.distance}initParticles(t){let e=0,i=t;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,Vt(n,i.position)),i=i.next,++e}}}an.type="spawnBurst";an.editorConfig=null;class on{constructor(t){this.order=K.Normal,this.list=new rr(!0),this.list.reset(Ot.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,n=qr(i.r,i.g,i.b);for(;e;)e.tint=n,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}on.type="color";on.editorConfig=null;class hn{constructor(t){this.order=K.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}hn.type="colorStatic";hn.editorConfig=null;class un{constructor(t){this.order=K.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?Ze(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}un.type="textureOrdered";un.editorConfig=null;const we=new q,oa=["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"],bf=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(oa).join("|"),"g");function xf(r){const t=r.match(bf);for(let e=t.length-1;e>=0;--e)oa.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return r=t.join(""),new Function("x",`return ${r};`)}class ln{constructor(t){var e;if(this.order=K.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=xf(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new rr(!1),this.list.reset(Ot.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new q(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(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,we.x=t.config.movement,we.y=this.path(we.x),Vt(t.config.initRotation,we),t.position.x=t.config.initPosition.x+we.x,t.position.y=t.config.initPosition.y+we.y}}ln.type="movePath";ln.editorConfig=null;class fn{constructor(){this.order=K.Spawn}initParticles(t){}}fn.type="spawnPoint";fn.editorConfig=null;class cn{constructor(t){this.order=K.Normal,this.textures=t.textures.map(e=>typeof e=="string"?Ze(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}cn.type="textureRandom";cn.editorConfig=null;class dn{constructor(t){this.order=K.Normal,this.minStart=t.minStart*Ct,this.maxStart=t.maxStart*Ct,this.minSpeed=t.minSpeed*Ct,this.maxSpeed=t.maxSpeed*Ct,this.accel=t.accel*Ct}initParticles(t){let e=t;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(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}dn.type="rotation";dn.editorConfig=null;class pn{constructor(t){this.order=K.Normal,this.min=t.min*Ct,this.max=t.max*Ct}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}pn.type="rotationStatic";pn.editorConfig=null;class vn{constructor(t){this.order=K.Late+1,this.rotation=(t.rotation||0)*Ct}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}vn.type="noRotation";vn.editorConfig=null;class _n{constructor(t){var e;this.order=K.Normal,this.list=new rr(!1),this.list.reset(Ot.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;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(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}_n.type="scale";_n.editorConfig=null;class mn{constructor(t){this.order=K.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}mn.type="scaleStatic";mn.editorConfig=null;class wt{constructor(t){this.order=K.Spawn;const e=wt.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){wt.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}wt.type="spawnShape";wt.editorConfig=null;wt.shapes={};wt.registerShape(Qi);wt.registerShape(Zi);wt.registerShape($r);wt.registerShape($r,"circle");class gn{constructor(t){this.order=K.Normal,this.texture=typeof t.texture=="string"?Ze(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}gn.type="textureSingle";gn.editorConfig=null;class yn{constructor(t){var e;this.order=K.Late,this.list=new rr(!1),this.list.reset(Ot.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;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 q(this.list.first.value*i,0),Vt(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,n=t.config.velocity;cf(n),na(n,i),t.x+=n.x*e,t.y+=n.y*e}}yn.type="moveSpeed";yn.editorConfig=null;class bn{constructor(t){this.order=K.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;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 q(i,0),Vt(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}bn.type="moveSpeedStatic";bn.editorConfig=null;function cd(r,t){var e,i,n,s,a,o,h,u,l,f,c,d,p,v,_,m,x,E,w,y,b;if("behaviors"in r)return r;const g={lifetime:r.lifetime,ease:r.ease,particlesPerWave:r.particlesPerWave,frequency:r.frequency,spawnChance:r.spawnChance,emitterLifetime:r.emitterLifetime,maxParticles:r.maxParticles,addAtBack:r.addAtBack,pos:r.pos,emit:r.emit,autoUpdate:r.autoUpdate,behaviors:[]};if(r.alpha)if("start"in r.alpha)if(r.alpha.start===r.alpha.end)r.alpha.start!==1&&g.behaviors.push({type:"alphaStatic",config:{alpha:r.alpha.start}});else{const A={list:[{time:0,value:r.alpha.start},{time:1,value:r.alpha.end}]};g.behaviors.push({type:"alpha",config:{alpha:A}})}else r.alpha.list.length===1?r.alpha.list[0].value!==1&&g.behaviors.push({type:"alphaStatic",config:{alpha:r.alpha.list[0].value}}):g.behaviors.push({type:"alpha",config:{alpha:r.alpha}});if(r.acceleration&&(r.acceleration.x||r.acceleration.y)){let A,T;"start"in r.speed?(A=r.speed.start*((e=r.speed.minimumSpeedMultiplier)!==null&&e!==void 0?e:1),T=r.speed.start):(A=r.speed.list[0].value*((i=r.minimumSpeedMultiplier)!==null&&i!==void 0?i:1),T=r.speed.list[0].value),g.behaviors.push({type:"moveAcceleration",config:{accel:r.acceleration,minStart:A,maxStart:T,rotate:!r.noRotation,maxSpeed:r.maxSpeed}})}else if(!((n=r.extraData)===null||n===void 0)&&n.path){let A,T;"start"in r.speed?(T=(s=r.speed.minimumSpeedMultiplier)!==null&&s!==void 0?s:1,r.speed.start===r.speed.end?A={list:[{time:0,value:r.speed.start}]}:A={list:[{time:0,value:r.speed.start},{time:1,value:r.speed.end}]}):(A=r.speed,T=(a=r.minimumSpeedMultiplier)!==null&&a!==void 0?a:1),g.behaviors.push({type:"movePath",config:{path:r.extraData.path,speed:A,minMult:T}})}else if(r.speed)if("start"in r.speed)if(r.speed.start===r.speed.end)g.behaviors.push({type:"moveSpeedStatic",config:{min:r.speed.start*((o=r.speed.minimumSpeedMultiplier)!==null&&o!==void 0?o:1),max:r.speed.start}});else{const A={list:[{time:0,value:r.speed.start},{time:1,value:r.speed.end}]};g.behaviors.push({type:"moveSpeed",config:{speed:A,minMult:r.speed.minimumSpeedMultiplier}})}else r.speed.list.length===1?g.behaviors.push({type:"moveSpeedStatic",config:{min:r.speed.list[0].value*((h=r.minimumSpeedMultiplier)!==null&&h!==void 0?h:1),max:r.speed.list[0].value}}):g.behaviors.push({type:"moveSpeed",config:{speed:r.speed,minMult:(u=r.minimumSpeedMultiplier)!==null&&u!==void 0?u:1}});if(r.scale)if("start"in r.scale){const A=(l=r.scale.minimumScaleMultiplier)!==null&&l!==void 0?l:1;if(r.scale.start===r.scale.end)g.behaviors.push({type:"scaleStatic",config:{min:r.scale.start*A,max:r.scale.start}});else{const T={list:[{time:0,value:r.scale.start},{time:1,value:r.scale.end}]};g.behaviors.push({type:"scale",config:{scale:T,minMult:A}})}}else if(r.scale.list.length===1){const A=(f=r.minimumScaleMultiplier)!==null&&f!==void 0?f:1,T=r.scale.list[0].value;g.behaviors.push({type:"scaleStatic",config:{min:T*A,max:T}})}else g.behaviors.push({type:"scale",config:{scale:r.scale,minMult:(c=r.minimumScaleMultiplier)!==null&&c!==void 0?c:1}});if(r.color)if("start"in r.color)if(r.color.start===r.color.end)r.color.start!=="ffffff"&&g.behaviors.push({type:"colorStatic",config:{color:r.color.start}});else{const A={list:[{time:0,value:r.color.start},{time:1,value:r.color.end}]};g.behaviors.push({type:"color",config:{color:A}})}else r.color.list.length===1?r.color.list[0].value!=="ffffff"&&g.behaviors.push({type:"colorStatic",config:{color:r.color.list[0].value}}):g.behaviors.push({type:"color",config:{color:r.color}});if(r.rotationAcceleration||((d=r.rotationSpeed)===null||d===void 0?void 0:d.min)||((p=r.rotationSpeed)===null||p===void 0?void 0:p.max)?g.behaviors.push({type:"rotation",config:{accel:r.rotationAcceleration||0,minSpeed:((v=r.rotationSpeed)===null||v===void 0?void 0:v.min)||0,maxSpeed:((_=r.rotationSpeed)===null||_===void 0?void 0:_.max)||0,minStart:((m=r.startRotation)===null||m===void 0?void 0:m.min)||0,maxStart:((x=r.startRotation)===null||x===void 0?void 0:x.max)||0}}):(((E=r.startRotation)===null||E===void 0?void 0:E.min)||((w=r.startRotation)===null||w===void 0?void 0:w.max))&&g.behaviors.push({type:"rotationStatic",config:{min:((y=r.startRotation)===null||y===void 0?void 0:y.min)||0,max:((b=r.startRotation)===null||b===void 0?void 0:b.max)||0}}),r.noRotation&&g.behaviors.push({type:"noRotation",config:{}}),r.blendMode&&r.blendMode!=="normal"&&g.behaviors.push({type:"blendMode",config:{blendMode:r.blendMode}}),Array.isArray(t)&&typeof t[0]!="string"&&"framerate"in t[0]){for(let A=0;A0||t.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=fs:i===Sf&&(i=Af);var n=i/100|0;if(n===Rf)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=r.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var s=new DOMParser;this.data=s.parseFromString(e,"text/xml")}else{var a=document.createElement("div");a.innerHTML=e,this.data=a}this.type=r.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=t.response||e;else{this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(t,e){if(t.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,gr||(gr=document.createElement("a")),gr.href=t;var i=ha(gr.href,{strictMode:!0}),n=!i.port&&e.port===""||i.port===e.port,s=i.protocol?i.protocol+":":"";return i.host!==e.hostname||!n||s!==e.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(t){t===void 0&&(t=this.url);var e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var n=t.indexOf("?"),s=t.indexOf("#"),a=Math.min(n>-1?n:t.length,s>-1?s:t.length);t=t.substring(0,a),e=t.substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},r.prototype._getMimeFromXhrType=function(t){switch(t){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r}();(function(r){(function(t){t[t.NONE=0]="NONE",t[t.DATA_URL=1]="DATA_URL",t[t.COMPLETE=2]="COMPLETE",t[t.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.JSON=1]="JSON",t[t.XML=2]="XML",t[t.IMAGE=3]="IMAGE",t[t.AUDIO=4]="AUDIO",t[t.VIDEO=5]="VIDEO",t[t.TEXT=6]="TEXT"}(r.TYPE||(r.TYPE={})),function(t){t[t.XHR=1]="XHR",t[t.IMAGE=2]="IMAGE",t[t.AUDIO=3]="AUDIO",t[t.VIDEO=4]="VIDEO"}(r.LOAD_TYPE||(r.LOAD_TYPE={})),function(t){t.DEFAULT="text",t.BUFFER="arraybuffer",t.BLOB="blob",t.DOCUMENT="document",t.JSON="json",t.TEXT="text"}(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(J||(J={}));function ae(){}function Pf(r){return function(){for(var e=arguments,i=[],n=0;n>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 a=e-(r.length-1);switch(a){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var s=0;s0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]=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!")},t._createLevelBuffers=function(e,i,n,s,a,o,h){for(var u=new Array(n),l=e.byteOffset,f=o,c=h,d=f+s-1&~(s-1),p=c+a-1&~(a-1),v=d*p*Dr[i],_=0;_1?f:d,levelHeight:n>1?c:p,levelBuffer:new Uint8Array(e.buffer,l,v)},l+=v,f=f>>1||1,c=c>>1||1,d=f+s-1&~(s-1),p=c+a-1&~(a-1),v=d*p*Dr[i];return u},t}(Uf);(function(){function r(){}return r.use=function(t,e){var i=t.data,n=this;if(t.type===J.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var s=i.textures,a=void 0,o=void 0,h=0,u=s.length;h>>1,R=R>>>1}for(var C=b,O=0;O1||s!==0?T:O,levelHeight:d>1||s!==0?R:D,levelBuffer:new Uint8Array(t,I,A)},I+=A}j+=C+4,j=j%4!==0?j+4-j%4:j,T=T>>1||1,R=R>>1||1,O=T+v-1&~(v-1),D=R+_-1&~(_-1),A=O*D*y}return s!==0?{uncompressed:E.map(function(V){var it=V[0].levelBuffer,N=!1;return s===M.FLOAT?it=new Float32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4):s===M.UNSIGNED_INT?(N=!0,it=new Uint32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4)):s===M.INT&&(N=!0,it=new Int32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4)),{resource:new _e(it,{width:V[0].levelWidth,height:V[0].levelHeight}),type:s,format:N?sc(a):a}}),kvData:b}:{compressed:E.map(function(V){return new ge(null,{format:o,width:h,height:u,levels:d,levelBuffers:V})}),kvData:b}}function nc(r,t){for(var e=0;et-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]12,h)u=o.map(function(p){return new _e(new Uint16Array(p.levelArray[0].levelBuffer.buffer),{width:p.width,height:p.height})});else for(l=kr[s.basisFormat],u=new Array(o.length),f=0,c=o.length;f1?ut.ON_MANUAL:ut.OFF,alphaMode:ct.NO_PREMULTIPLIED_ALPHA,type:s,format:a},i)))});return h.forEach(function(u,l){var f=u.baseTexture,c=t+"-"+(l+1);X.addToCache(f,c),k.addToCache(u,c),l===0&&(X.addToCache(f,t),k.addToCache(u,t),n.texture=u),n.textures[c]=u}),n},r.bindTranscoder=function(t){Ht.basisBinding=t},r.loadTranscoder=function(t,e){return Ht.TranscoderWorker.loadTranscoder(t,e)},r.setTranscoder=function(t,e){Ht.TranscoderWorker.setTranscoder(t,e)},r.extension=F.Loader,r}();At.add(uc);/*! * @pixi/mesh - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var ji=function(r,t){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(r,t)};function En(r,t){ji(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var lc=function(){function r(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(t){if(!(!t&&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++}},r}(),yi=new q,gs=new Sr,ys=function(r){En(t,r);function t(e,i,n,s){s===void 0&&(s=Tt.TRIANGLES);var a=r.call(this)||this;return a.geometry=e,a.shader=i,a.state=n||er.for2d(),a.drawMode=s,a.start=0,a.size=0,a.uvs=null,a.indices=null,a.vertexData=new Float32Array(1),a.vertexDirty=-1,a._transformID=-1,a._roundPixels=P.ROUND_PIXELS,a.batchUvs=null,a}return Object.defineProperty(t.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(t.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this.shader},set:function(e){this.shader=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.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(t.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(e){this.shader.texture=e},enumerable:!1,configurable:!0}),t.prototype._render=function(e){var i=this.geometry.buffers[0].data,n=this.shader;n.batchable&&this.drawMode===Tt.TRIANGLES&&i.length>16)+(e&65280)+((e&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Tu(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(zr),dc=function(r){En(t,r);function t(e,i,n){var s=r.call(this)||this,a=new ft(e),o=new ft(i,!0),h=new ft(n,!0,!0);return s.addAttribute("aVertexPosition",a,2,!1,M.FLOAT).addAttribute("aTextureCoord",o,2,!1,M.FLOAT).addIndex(h),s._updateId=-1,s}return Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(Yr);/*! * @pixi/text - v6.5.8 * Compiled Sun, 23 Oct 2022 23:01:45 UTC * * @pixi/text is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Wi=function(r,t){return Wi=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])},Wi(r,t)};function pc(r,t){Wi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Qe;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Qe||(Qe={}));var bi={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Qe.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},vc=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Xr=function(){function r(t){this.styleID=0,this.reset(),Ei(this,t,t)}return r.prototype.clone=function(){var t={};return Ei(t,this,bi),new r(t)},r.prototype.reset=function(){Ei(this,bi,bi)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=xi(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=xi(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){_c(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=xi(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var t=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)&&vc.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},r}();function xs(r){return typeof r=="number"?Fs(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function xi(r){if(Array.isArray(r)){for(var t=0;tp)if(a!==""&&(o+=r.addLine(a),a="",s=0),r.canBreakWords(m,e.breakWords))for(var y=r.wordWrapSplit(m),b=0;bp&&(o+=r.addLine(a),d=!1,a="",s=0),a+=g,s+=O}else{a.length>0&&(o+=r.addLine(a),a="",s=0);var D=_===v.length-1;o+=r.addLine(m,!D),d=!1,a="",s=0}else w+s>p&&(d=!1,o+=r.addLine(a),a="",s=0),(a.length>0||!r.isBreakingSpace(m)||d)&&(a+=m,s+=w)}return o+=r.addLine(a,!1),o},r.addLine=function(t,e){return e===void 0&&(e=!0),t=r.trimRight(t),t=e?t+` `:t,t},r.getFromCache=function(t,e,i,n){var s=i[t];if(typeof s!="number"){var a=t.length*e;s=n.measureText(t).width+a,i[t]=s}return s},r.collapseSpaces=function(t){return t==="normal"||t==="pre-line"},r.collapseNewlines=function(t){return t==="normal"},r.trimRight=function(t){if(typeof t!="string")return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!r.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},r.isNewline=function(t){return typeof t!="string"?!1:r._newlines.indexOf(t.charCodeAt(0))>=0},r.isBreakingSpace=function(t,e){return typeof t!="string"?!1:r._breakingSpaces.indexOf(t.charCodeAt(0))>=0},r.tokenize=function(t){var e=[],i="";if(typeof t!="string")return e;for(var n=0;no;--c){for(var v=0;v0&&_>m&&(x=(m+_)/2);var E=m+v,w=n.lineHeight*(p+1),y=E;p+1")>-1){var e=new globalThis.DOMParser().parseFromString(t,"text/xml");return Yi.test(e)}return!1},r.parse=function(t){var e=new globalThis.DOMParser().parseFromString(t,"text/xml");return Yi.parse(e)},r}(),Ti=[Rr,Yi,zi];function pa(r){for(var t=0;t=u-T*o){if(v===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+b+"')"));--y,_=null,m=null,x=null,v=0,p=0,E=0;continue}if(E=Math.max(T+g.fontProperties.descent,E),R*o+p>=c){if(p===0)throw new Error("[BitmapFont] textureWidth "+h+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+b+"')"));--y,v+=E*o,v=Math.ceil(v),p=0,E=0;continue}bc(_,m,g,p,v,o,f);var O=Pr(g.text);d.char.push({id:O,page:w.length-1,x:p/o,y:v/o,width:R,height:T,xoffset:0,yoffset:0,xadvance:Math.ceil(A-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),p+=(R+2*a)*o,p=Math.ceil(p)}for(var y=0,D=l.length;y 0.99) {\r alpha = 1.0;\r }\r \r // NPM Textures, NPM outputs\r gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r \r }\r `,Tc=`// 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 `,Es=[],Ts=[],ws=[];(function(r){gc(t,r);function t(e,i){i===void 0&&(i={});var n=r.call(this)||this;n._tint=16777215;var s=Object.assign({},t.styleDefaults,i),a=s.align,o=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,f=s.fontSize;if(!kt.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=a,n._tint=o,n._font=void 0,n._fontName=l,n._fontSize=f,n.text=e,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=u,n._anchor=new Ie(function(){n.dirty=!0},n,0,0),n._roundPixels=P.ROUND_PIXELS,n.dirty=!0,n._resolution=P.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return t.prototype.updateText=function(){for(var e,i=kt.available[this._fontName],n=this.fontSize,s=n/i.size,a=new q,o=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,` `)||" ",f=va(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?Es:Ts,p=null,v=0,_=0,m=0,x=-1,E=0,w=0,y=0,b=0,g=0;g0&&a.x>c&&(++w,je(o,1+x-w,1+g-x),g=x,x=-1,h.push(E),u.push(o.length>0?o[o.length-1].prevSpaces:0),_=Math.max(_,E),m++,a.x=0,a.y+=i.lineHeight,p=null,b=0)}}var D=f[f.length-1];D!=="\r"&&D!==` `&&(/(?:\s)/.test(D)&&(v=E),h.push(v),_=Math.max(_,v),u.push(-1));for(var j=[],g=0;g<=m;g++){var et=0;this._align==="right"?et=_-h[g]:this._align==="center"?et=(_-h[g])/2:this._align==="justify"&&(et=u[g]<0?0:(_-h[g])/u[g]),j.push(et)}var C=o.length,I={},H=[],lt=this._activePagesMeshData;d.push.apply(d,lt);for(var g=0;g6*St)||N.vertices.length0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1] { self.postMessage(result); }); `},Hc={id:"loadImageBitmap",code:` async function loadImageBitmap(url) { const response = await fetch(url); if (!response.ok) { throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \` + \`\${response.status} \${response.statusText}\`); } const imageBlob = await response.blob(); const imageBitmap = await createImageBitmap(imageBlob); return imageBitmap; } self.onmessage = async (event) => { try { const imageBitmap = await loadImageBitmap(event.data.data[0]); self.postMessage({ data: imageBitmap, uuid: event.data.uuid, id: event.data.id, }, [imageBitmap]); } catch(e) { self.postMessage({ error: e, uuid: event.data.uuid, id: event.data.id, }); } };`},Ai,jc=function(){function r(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return r.prototype.isImageBitmapSupported=function(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(function(t){var e=URL.createObjectURL(new Blob([Xc.code],{type:"application/javascript"})),i=new Worker(e);i.addEventListener("message",function(n){i.terminate(),URL.revokeObjectURL(e),t(n.data)})}),this._isImageBitmapSupported)},r.prototype.loadImageBitmap=function(t){return this._run("loadImageBitmap",[t])},r.prototype._initWorkers=function(){return U(this,void 0,void 0,function(){return G(this,function(t){return this._initialized?[2]:(this._initialized=!0,[2])})})},r.prototype.getWorker=function(){var t=this;wi===void 0&&(wi=navigator.hardwareConcurrency||4);var e=this.workerPool.pop();return!e&&this._createdWorkersthis.maxSegments&&(e=this.maxSegments),e}},ga=function(){function r(){this.color=16777215,this.alpha=1,this.texture=k.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var t=new r;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=k.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var qi=function(r,t){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(r,t)};function Sn(r,t){qi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ps(r,t){var e,i;t===void 0&&(t=!1);var n=r.length;if(!(n<6)){for(var s=0,a=0,o=r[n-2],h=r[n-1];a0||t&&s<=0)for(var f=n/2,a=f+f%2;a=6){Ps(e,!1);for(var a=[],o=0;o=0&&o>=0&&n>=0&&s>=0)){t.length=0;return}var d=Math.ceil(2.3*Math.sqrt(a+o)),p=d*8+(n?4:0)+(s?4:0);if(t.length=p,p!==0){if(d===0){t.length=8,t[0]=t[6]=e+n,t[1]=t[3]=i+s,t[2]=t[4]=e-n,t[5]=t[7]=i-s;return}var v=0,_=d*4+(n?2:0)+2,m=_,x=p;{var E=n+a,w=s,y=e+E,b=e-E,g=i+w;if(t[v++]=y,t[v++]=g,t[--_]=g,t[--_]=b,s){var A=i-w;t[m++]=b,t[m++]=A,t[--x]=A,t[--x]=y}}for(var T=1;Tf&&(f+=Math.PI*2);var c=l,d=f-l,p=Math.abs(d),v=Math.sqrt(h*h+u*u),_=(15*p*Math.sqrt(v)/Math.PI>>0)+1,m=d/_;if(c+=m,o){a.push(r,t),a.push(e,i);for(var x=1,E=c;x<_;x++,E+=m)a.push(r,t),a.push(r+Math.sin(E)*v,t+Math.cos(E)*v);a.push(r,t),a.push(n,s)}else{a.push(e,i),a.push(r,t);for(var x=1,E=c;x<_;x++,E+=m)a.push(r+Math.sin(E)*v,t+Math.cos(E)*v),a.push(r,t);a.push(n,s),a.push(r,t)}return _*2}function td(r,t){var e=r.shape,i=r.points||e.points.slice(),n=t.closePointEps;if(i.length!==0){var s=r.lineStyle,a=new q(i[0],i[1]),o=new q(i[i.length-2],i[i.length-1]),h=e.type!==at.POLY||e.closeStroke,u=Math.abs(a.x-o.x)=0&&(s.join===Wt.ROUND?p+=oe(y,b,y-T*C,b-R*C,y-O*C,b-D*C,c,!1)+4:p+=2,c.push(y-O*I,b-D*I),c.push(y+O*C,b+D*C));continue}var Me=(-T+E)*(-R+b)-(-T+y)*(-R+w),ye=(-O+g)*(-D+b)-(-O+y)*(-D+A),St=(lt*ye-it*Me)/Kt,be=(N*Me-V*ye)/Kt,xe=(St-y)*(St-y)+(be-b)*(be-b),mt=y+(St-y)*C,gt=b+(be-b)*C,vt=y-(St-y)*I,_t=b-(be-b)*I,Q=Math.min(lt*lt+V*V,it*it+N*N),re=Lt?C:I,Rt=Q+re*re*m,Y=xe<=Rt;Y?s.join===Wt.BEVEL||xe/m>x?(Lt?(c.push(mt,gt),c.push(y+T*I,b+R*I),c.push(mt,gt),c.push(y+O*I,b+D*I)):(c.push(y-T*C,b-R*C),c.push(vt,_t),c.push(y-O*C,b-D*C),c.push(vt,_t)),p+=2):s.join===Wt.ROUND?Lt?(c.push(mt,gt),c.push(y+T*I,b+R*I),p+=oe(y,b,y+T*I,b+R*I,y+O*I,b+D*I,c,!0)+4,c.push(mt,gt),c.push(y+O*I,b+D*I)):(c.push(y-T*C,b-R*C),c.push(vt,_t),p+=oe(y,b,y-T*C,b-R*C,y-O*C,b-D*C,c,!1)+4,c.push(y-O*C,b-D*C),c.push(vt,_t)):(c.push(mt,gt),c.push(vt,_t)):(c.push(y-T*C,b-R*C),c.push(y+T*I,b+R*I),s.join===Wt.ROUND?Lt?p+=oe(y,b,y+T*I,b+R*I,y+O*I,b+D*I,c,!0)+2:p+=oe(y,b,y-T*C,b-R*C,y-O*C,b-D*C,c,!1)+2:s.join===Wt.MITER&&xe/m<=x&&(Lt?(c.push(vt,_t),c.push(vt,_t)):(c.push(mt,gt),c.push(mt,gt)),p+=2),c.push(y-O*C,b-D*C),c.push(y+O*I,b+D*I),p+=2)}E=i[(d-2)*2],w=i[(d-2)*2+1],y=i[(d-1)*2],b=i[(d-1)*2+1],T=-(w-b),R=E-y,j=Math.sqrt(T*T+R*R),T/=j,R/=j,T*=_,R*=_,c.push(y-T*C,b-R*C),c.push(y+T*I,b+R*I),h||(s.cap===Jt.ROUND?p+=oe(y-T*(C-I)*.5,b-R*(C-I)*.5,y-T*C,b-R*C,y+T*I,b+R*I,c,!1)+2:s.cap===Jt.SQUARE&&(p+=Cs(y,b,T,R,C,I,!1,c)));for(var Pt=t.indices,Ee=Je.epsilon*Je.epsilon,H=v;Hc*u}},r.arc=function(t,e,i,n,s,a,o,h,u){for(var l=o-a,f=Je._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/Mr)*40),c=l/(f*2),d=c*2,p=Math.cos(c),v=Math.sin(c),_=f-1,m=_%1/_,x=0;x<=_;++x){var E=x+m*x,w=c+a+d*E,y=Math.cos(w),b=-Math.sin(w);u.push((p*y+v*b)*s+i,(p*-b+v*y)*s+n)}},r}(),rd=function(){function r(){}return r.curveLength=function(t,e,i,n,s,a,o,h){for(var u=10,l=0,f=0,c=0,d=0,p=0,v=0,_=0,m=0,x=0,E=0,w=0,y=t,b=e,g=1;g<=u;++g)f=g/u,c=f*f,d=c*f,p=1-f,v=p*p,_=v*p,m=_*t+3*v*f*i+3*p*c*s+d*o,x=_*e+3*v*f*n+3*p*c*a+d*h,E=y-m,w=b-x,y=m,b=x,l+=Math.sqrt(E*E+w*w);return l},r.curveTo=function(t,e,i,n,s,a,o){var h=o[o.length-2],u=o[o.length-1];o.length-=2;var l=Je._segmentsCount(r.curveLength(h,u,t,e,i,n,s,a)),f=0,c=0,d=0,p=0,v=0;o.push(h,u);for(var _=1,m=0;_<=l;++_)m=_/l,f=1-m,c=f*f,d=c*f,p=m*m,v=p*m,o.push(d*h+3*c*m*t+3*f*p*i+v*s,d*u+3*c*m*e+3*f*p*n+v*a)},r}(),id=function(){function r(){}return r.curveLength=function(t,e,i,n,s,a){var o=t-2*i+s,h=e-2*n+a,u=2*i-2*t,l=2*n-2*e,f=4*(o*o+h*h),c=4*(o*u+h*l),d=u*u+l*l,p=2*Math.sqrt(f+c+d),v=Math.sqrt(f),_=2*f*v,m=2*Math.sqrt(d),x=c/v;return(_*p+v*c*(p-m)+(4*d*f-c*c)*Math.log((2*v+x+p)/(x+m)))/(4*_)},r.curveTo=function(t,e,i,n,s){for(var a=s[s.length-2],o=s[s.length-1],h=Je._segmentsCount(r.curveLength(a,o,t,e,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=a+(t-a)*c,l=o+(e-o)*c,s.push(u+(t+(i-t)*c-u)*c,l+(e+(n-e)*c-l)*c)}},r}(),nd=function(){function r(){this.reset()}return r.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},r.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),he,Ri=(he={},he[at.POLY]=ya,he[at.CIRC]=Wr,he[at.ELIP]=Wr,he[at.RECT]=Qc,he[at.RREC]=Jc,he),Bs=[],Ar=[],Ms=function(){function r(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=n,this.type=t.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.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},r}(),Se=new q,sd=function(r){Sn(t,r);function t(){var e=r.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 Lr,e.boundsDirty=-1,e}return Object.defineProperty(t.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.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;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,i,n,s){i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=null);var a=new Ms(e,i,n,s);return this.graphicsData.push(a),this.dirty++,this},t.prototype.drawHole=function(e,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new Ms(e,null,null,i),s=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=s.lineStyle,s.holes.push(n),this.dirty++,this},t.prototype.destroy=function(){r.prototype.destroy.call(this);for(var e=0;e0&&(n=this.batches[this.batches.length-1],s=n.style);for(var a=this.shapeIndex;a65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&E===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=E?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},t.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)},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,i=this.graphicsData.length;e65535*2)return!1;for(var e=this.batches,i=0;i0&&(a=Ar.pop(),a||(a=new Ni,a.texArray=new Fi),this.drawCalls.push(a)),a.start=c,a.size=0,a.texArray.count=0,a.type=f),_.touched=1,_._batchEnabled=e,_._batchLocation=o,_.wrapMode=Be.REPEAT,a.texArray.elements[a.texArray.count++]=_,o++)),a.size+=d.size,c+=d.size,u=_._batchLocation,this.addColors(n,v.color,v.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,u,d.attribSize,d.attribStart)}X._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,i=this.uvs,n=this.colors,s=this.textureIds,a=new ArrayBuffer(e.length*3*4),o=new Float32Array(a),h=new Uint32Array(a),u=0,l=0;l>16)+(i&65280)+((i&255)<<16),h=Us(o,n);e.length=Math.max(e.length,a+s);for(var u=0;u0&&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},t.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 Sr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[i-2],e[i-1]))}else this.currentPath=new Sr,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,i){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=i,this},t.prototype.lineTo=function(e,i){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,s=n[n.length-2],a=n[n.length-1];return(s!==e||a!==i)&&n.push(e,i),this},t.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)},t.prototype.quadraticCurveTo=function(e,i,n,s){this._initCurve();var a=this.currentPath.points;return a.length===0&&this.moveTo(0,0),id.curveTo(e,i,n,s,a),this},t.prototype.bezierCurveTo=function(e,i,n,s,a,o){return this._initCurve(),rd.curveTo(e,i,n,s,a,o,this.currentPath.points),this},t.prototype.arcTo=function(e,i,n,s,a){this._initCurve(e,i);var o=this.currentPath.points,h=Os.curveTo(e,i,n,s,a,o);if(h){var u=h.cx,l=h.cy,f=h.radius,c=h.startAngle,d=h.endAngle,p=h.anticlockwise;this.arc(u,l,f,c,d,p)}return this},t.prototype.arc=function(e,i,n,s,a,o){if(o===void 0&&(o=!1),s===a)return this;!o&&a<=s?a+=Mr:o&&s<=a&&(s+=Mr);var h=a-s;if(h===0)return this;var u=e+Math.cos(s)*n,l=i+Math.sin(s)*n,f=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var d=Math.abs(c[c.length-2]-u),p=Math.abs(c[c.length-1]-l);d0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,i,n,s){return this.drawShape(new W(e,i,n,s))},t.prototype.drawRoundedRect=function(e,i,n,s,a){return this.drawShape(new Ou(e,i,n,s,a))},t.prototype.drawCircle=function(e,i,n){return this.drawShape(new Cu(e,i,n))},t.prototype.drawEllipse=function(e,i,n,s){return this.drawShape(new Iu(e,i,n,s))},t.prototype.drawPolygon=function(){for(var e=arguments,i=[],n=0;n>16&255)/255*a,o.tint[1]=(s>>8&255)/255*a,o.tint[2]=(s&255)/255*a,o.tint[3]=a,e.shader.bind(i),e.geometry.bind(n,i),e.state.set(this.state);for(var u=0,l=h.length;u>16)+(u&65280)+((u&255)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this._geometry.points,f=this.vertexData,c=0,d=0;d