Advent-Incremental/assets/@pixi.051d1bd4.js

857 lines
407 KiB
JavaScript

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(o<r.length)a=r.charCodeAt(o);else{if(a===47)break;a=47}if(a===47){if(!(n===o-1||s===1))if(n!==o-1&&s===2){if(e.length<2||i!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){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;i<arguments.length;i++)e[i]=r[i];if(e.length===0)return".";for(var n,s=0;s<e.length;++s){var a=e[s];if(yt(a),a.length>0)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;n<s;++n)r[n]=r[n+e];r.length=s}}function Ce(r){return r===0?0:r<0?-1:1}var wu=0;function qe(){return++wu}var qn={};function Mt(r,t,e){if(e===void 0&&(e=3),!qn[t]){var i=new Error().stack;typeof i=="undefined"?console.warn("PixiJS Deprecation Warning: ",t+`
Deprecated since v`+r):(i=i.split(`
`).splice(e).join(`
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+`
Deprecated since v`+r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+`
Deprecated since v`+r),console.warn(i))),qn[t]=!0}}var $n={},Ut=Object.create(null),ie=Object.create(null);(function(){function r(t,e,i){this.canvas=P.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||P.RESOLUTION,this.resize(t,e)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),r})();function Au(r){var t=r.width,e=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,t,e),s=n.data,a=s.length,o={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<a;u+=4)s[u+3]!==0&&(l=u/4%t,f=~~(u/4/t),o.top===null&&(o.top=f),(o.left===null||l<o.left)&&(o.left=l),(o.right===null||o.right<l)&&(o.right=l+1),(o.bottom===null||o.bottom<f)&&(o.bottom=f));return o.top!==null&&(t=o.right-o.left,e=o.bottom-o.top+1,h=i.getImageData(o.left,o.top,t,e)),{height:e,width:t,data:h}}var or;function Su(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,or||(or=document.createElement("a")),or.href=r;var e=Pe.parse(or.href),i=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!i||e.protocol!==t.protocol?"anonymous":""}function te(r,t){var e=P.RETINA_PREFIX.exec(r);return e?parseFloat(e[1]):t!==void 0?t:1}/*!
* @pixi/extensions - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/extensions 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 We=function(){return We=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n<s;n++){i=e[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},We.apply(this,arguments)},F;(function(r){r.Application="application",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Loader="loader",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser"})(F||(F={}));var Kn=function(r){if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");var t=typeof r.extension!="object"?{type:r.extension}:r.extension;r=We(We({},t),{ref:r})}if(typeof r=="object")r=We({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},At={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var r=arguments,t=this,e=[],i=0;i<arguments.length;i++)e[i]=r[i];return e.map(Kn).forEach(function(n){n.type.forEach(function(s){var a,o;return(o=(a=t._removeHandlers)[s])===null||o===void 0?void 0:o.call(a,n)})}),this},add:function(){for(var r=arguments,t=this,e=[],i=0;i<arguments.length;i++)e[i]=r[i];return e.map(Kn).forEach(function(n){n.type.forEach(function(s){var a=t._addHandlers,o=t._queue;a[s]?a[s](n):(o[s]=o[s]||[],o[s].push(n))})}),this},handle:function(r,t,e){var i=this._addHandlers=this._addHandlers||{},n=this._removeHandlers=this._removeHandlers||{};if(i[r]||n[r])throw new Error("Extension type "+r+" already has a handler");i[r]=t,n[r]=e;var s=this._queue;return s[r]&&(s[r].forEach(function(a){return t(a)}),delete s[r]),this},handleByMap:function(r,t){return this.handle(r,function(e){t[e.name]=e.ref},function(e){delete t[e.name]})},handleByList:function(r,t){return this.handle(r,function(e){var i,n;t.push(e.ref),r===F.Loader&&((n=(i=e.ref).add)===null||n===void 0||n.call(i))},function(e){var i=t.indexOf(e.ref);i!==-1&&t.splice(i,1)})}};/*!
* @pixi/runner - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/runner is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var ot=function(){function r(t){this.items=[],this._name=t,this._aliasCount=0}return r.prototype.emit=function(t,e,i,n,s,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,f=u.items;this._aliasCount++;for(var c=0,d=f.length;c<d;c++)f[c][l](t,e,i,n,s,a,o,h);return f===this.items&&this._aliasCount--,this},r.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&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._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*P.TARGET_FPMS;for(var n=this._head,s=n.next;s;)s=s.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(r.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,P.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(t===0)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"shared",{get:function(){if(!r._shared){var t=r._shared=new r;t.autoStart=!0,t._protected=!0}return r._shared},enumerable:!1,configurable:!0}),Object.defineProperty(r,"system",{get:function(){if(!r._system){var t=r._system=new r;t.autoStart=!0,t._protected=!0}return r._system},enumerable:!1,configurable:!0}),r}(),fd=function(){function r(){}return r.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(i){this._ticker&&this._ticker.remove(this.render,this),this._ticker=i,i&&i.add(this.render,this,$e.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Xt.shared:new Xt,t.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},r.extension=F.Application,r}();/*!
* @pixi/math - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/math is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Mr=Math.PI*2,Ru=180/Math.PI,Pu=Math.PI/180,at;(function(r){r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC"})(at||(at={}));var q=function(){function r(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copyFrom=function(t){return this.set(t.x,t.y),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.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x=t,this.y=e,this},r.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},r}(),hr=[new q,new q,new q,new q],W=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=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(n),this.type=at.RECT}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r,"EMPTY",{get:function(){return new r(0,0,0,0)},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},r.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},r.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height},r.prototype.intersects=function(t,e){if(!e){var i=this.x<t.x?t.x:this.x,n=this.right>t.right?t.right:this.right;if(n<=i)return!1;var s=this.y<t.y?t.y:this.y,a=this.bottom>t.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;i<arguments.length;i++)e[i]=t[i];var n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){for(var s=[],a=0,o=n.length;a<o;a++)s.push(n[a].x,n[a].y);n=s}this.points=n,this.type=at.POLY,this.closeStroke=!0}return r.prototype.clone=function(){var t=this.points.slice(),e=new r(t);return e.closeStroke=this.closeStroke,e},r.prototype.contains=function(t,e){for(var i=!1,n=this.points.length/2,s=0,a=n-1;s<n;a=s++){var o=this.points[s*2],h=this.points[s*2+1],u=this.points[a*2],l=this.points[a*2+1],f=h>e!=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;n<s;n++){i=e[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},Bi.apply(this,arguments)};function Lu(r,t){var e={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(e[i[n]]=r[i[n]]);return e}var Ke=function(){function r(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new ot("setRealSize"),this.onUpdate=new ot("update"),this.onError=new ot("onError")}return r.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},r.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},r.prototype.resize=function(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(r.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),r.prototype.update=function(){this.destroyed||this.onUpdate.emit()},r.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),r.prototype.style=function(t,e,i){return!1},r.prototype.dispose=function(){},r.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},r.test=function(t,e){return!1},r}(),_e=function(r){Z(t,r);function t(e,i){var n=this,s=i||{},a=s.width,o=s.height;if(!a||!o)throw new Error("BufferResource width or height invalid");return n=r.call(this,a,o)||this,n.data=e,n}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.prototype.dispose=function(){this.data=null},t.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},t}(Ke),Nu={scaleMode:It.NEAREST,format:S.RGBA,alphaMode:ct.NPM},X=function(r){Z(t,r);function t(e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=r.call(this)||this;i=i||{};var s=i.alphaMode,a=i.mipmap,o=i.anisotropicLevel,h=i.scaleMode,u=i.width,l=i.height,f=i.wrapMode,c=i.format,d=i.type,p=i.target,v=i.resolution,_=i.resourceOptions;return e&&!(e instanceof Ke)&&(e=Xs(e,_),e.internal=!0),n.resolution=v||P.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((l||0)*n.resolution)/n.resolution,n._mipmap=a!==void 0?a:P.MIPMAP_TEXTURES,n.anisotropicLevel=o!==void 0?o:P.ANISOTROPIC_LEVEL,n._wrapMode=f||P.WRAP_MODE,n._scaleMode=h!==void 0?h:P.SCALE_MODE,n.format=c||S.RGBA,n.type=d||M.UNSIGNED_BYTE,n.target=p||pe.TEXTURE_2D,n.alphaMode=s!==void 0?s:ct.UNPACK,n.uid=qe(),n.touched=0,n.isPowerOfTwo=!1,n._refreshPOT(),n._glTextures={},n.dirtyId=0,n.dirtyStyleId=0,n.cacheId=null,n.valid=u>0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return Object.defineProperty(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;s<e.textureCacheIds.length;++s)delete ie[e.textureCacheIds[s]];return e.textureCacheIds.length=0,e}return null},t._globalBatch=0,t}(Vr),Hs=function(r){Z(t,r);function t(e,i){var n=this,s=i||{},a=s.width,o=s.height;n=r.call(this,a,o)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<e;h++){var u=new X;n.items.push(u),n.itemDirtyIds.push(-2)}return n.length=e,n._load=null,n.baseTexture=null,n}return t.prototype.initFromArray=function(e,i){for(var n=0;n<this.length;n++)!e[n]||(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof Ke?this.addResourceAt(e[n],n):this.addResourceAt(Xs(e[n],i),n))},t.prototype.dispose=function(){for(var e=0,i=this.length;e<i;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},t.prototype.addResourceAt=function(e,i){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[i].setResource(e),this},t.prototype.bind=function(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");r.prototype.bind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=e,this.items[i].on("update",e.update,e)},t.prototype.unbind=function(e){r.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",e.update,e)},t.prototype.load=function(){var e=this;if(this._load)return this._load;var i=this.items.map(function(s){return s.resource}).filter(function(s){return s}),n=i.map(function(s){return s.load()});return this._load=Promise.all(n).then(function(){var s=e.items[0],a=s.realWidth,o=s.realHeight;return e.resize(a,o),Promise.resolve(e)}),this._load},t}(Ke),Fu=function(r){Z(t,r);function t(e,i){var n=this,s=i||{},a=s.width,o=s.height,h,u;return Array.isArray(e)?(h=e,u=e.length):u=e,n=r.call(this,u,{width:a,height:o})||this,h&&n.initFromArray(h,i),n}return t.prototype.addBaseTextureAt=function(e,i){if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this},t.prototype.bind=function(e){r.prototype.bind.call(this,e),e.target=pe.TEXTURE_2D_ARRAY},t.prototype.upload=function(e,i,n){var s=this,a=s.length,o=s.itemDirtyIds,h=s.items,u=e.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,a,0,i.format,n.type,null);for(var l=0;l<a;l++){var f=h[l];o[l]<f.dirtyId&&(o[l]=f.dirtyId,f.valid&&u.texSubImage3D(u.TEXTURE_2D_ARRAY,0,0,0,l,f.resource.width,f.resource.height,1,i.format,n.type,f.resource.source))}return!0},t}(Hs),ee=function(r){Z(t,r);function t(e){var i=this,n=e,s=n.naturalWidth||n.videoWidth||n.width,a=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,s,a)||this,i.source=e,i.noSubImage=!1,i}return t.crossOrigin=function(e,i,n){n===void 0&&i.indexOf("data:")!==0?e.crossOrigin=Su(i):n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous")},t.prototype.upload=function(e,i,n,s){var a=e.gl,o=i.realWidth,h=i.realHeight;if(s=s||this.source,s instanceof HTMLImageElement){if(!s.complete||s.naturalWidth===0)return!1}else if(s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ct.UNPACK),!this.noSubImage&&i.target===a.TEXTURE_2D&&n.width===o&&n.height===h?a.texSubImage2D(a.TEXTURE_2D,0,0,0,i.format,n.type,s):(n.width=o,n.height=h,a.texImage2D(i.target,0,n.internalFormat,i.format,n.type,s)),!0},t.prototype.update=function(){if(!this.destroyed){var e=this.source,i=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(i,n),r.prototype.update.call(this)}},t.prototype.dispose=function(){this.source=null},t}(Ke),Du=function(r){Z(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){var i=globalThis.OffscreenCanvas;return i&&e instanceof i?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement},t}(ee),Uu=function(r){Z(t,r);function t(e,i){var n=this,s=i||{},a=s.width,o=s.height,h=s.autoLoad,u=s.linkBaseTexture;if(e&&e.length!==t.SIDES)throw new Error("Invalid length. Got "+e.length+", expected 6");n=r.call(this,6,{width:a,height:o})||this;for(var l=0;l<t.SIDES;l++)n.items[l].target=pe.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=u!==!1,e&&n.initFromArray(e,i),h!==!1&&n.load(),n}return t.prototype.bind=function(e){r.prototype.bind.call(this,e),e.target=pe.TEXTURE_CUBE_MAP},t.prototype.addBaseTextureAt=function(e,i,n){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=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<t.SIDES;a++){var o=this.items[a];(s[a]<o.dirtyId||n.dirtyId<i.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(e,o,n),s[a]=o.dirtyId):s[a]<-1&&(e.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),s[a]=-1))}return!0},t.test=function(e){return Array.isArray(e)&&e.length===t.SIDES},t.SIDES=6,t}(Hs),js=function(r){Z(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLImageElement)){var s=new Image;ee.crossOrigin(s,e,i.crossorigin),s.src=e,e=s}return n=r.call(this,e)||this,!e.complete&&!!n._width&&!!n._height&&(n._width=0,n._height=0),n.url=e.src,n._process=null,n.preserveBitmap=!1,n.createBitmap=(i.createBitmap!==void 0?i.createBitmap:P.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,n.alphaMode=typeof i.alphaMode=="number"?i.alphaMode:null,n.bitmap=null,n._load=null,i.autoLoad!==!1&&n.load(),n}return t.prototype.load=function(e){var i=this;return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise(function(n,s){var a=i.source;i.url=a.src;var o=function(){i.destroyed||(a.onload=null,a.onerror=null,i.resize(a.width,a.height),i._load=null,i.createBitmap?n(i.process()):n(i))};a.complete&&a.src?o():(a.onload=o,a.onerror=function(h){s(h),i.onError.emit(h)})}),this._load)},t.prototype.process=function(){var e=this,i=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var n=globalThis.createImageBitmap,s=!i.crossOrigin||i.crossOrigin==="anonymous";return this._process=fetch(i.src,{mode:s?"cors":"no-cors"}).then(function(a){return a.blob()}).then(function(a){return n(a,0,0,i.width,i.height,{premultiplyAlpha:e.alphaMode===null||e.alphaMode===ct.UNPACK?"premultiply":"none"})}).then(function(a){return e.destroyed?Promise.reject():(e.bitmap=a,e.update(),e._process=null,Promise.resolve(e))}),this._process},t.prototype.upload=function(e,i,n){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return r.prototype.upload.call(this,e,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(r.prototype.upload.call(this,e,i,n,this.bitmap),!this.preserveBitmap){var s=!0,a=i._glTextures;for(var o in a){var h=a[o];if(h!==n&&h.dirtyId!==i.dirtyId){s=!1;break}}s&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},t.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,r.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},t.test=function(e){return typeof e=="string"||e instanceof HTMLImageElement},t}(ee),Mi=function(r){Z(t,r);function t(e,i){var n=this;return i=i||{},n=r.call(this,P.ADAPTER.createCanvas())||this,n._width=0,n._height=0,n.svg=e,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,i.autoLoad!==!1&&n.load(),n}return t.prototype.load=function(){var e=this;return this._load?this._load:(this._load=new Promise(function(i){if(e._resolve=function(){e.resize(e.source.width,e.source.height),i(e)},t.SVG_XML.test(e.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");e.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e.svg)))}e._loadSvg()}),this._load)},t.prototype._loadSvg=function(){var e=this,i=new Image;ee.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(n){!e._resolve||(i.onerror=null,e.onError.emit(n))},i.onload=function(){if(!!e._resolve){var n=i.width,s=i.height;if(!n||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var a=n*e.scale,o=s*e.scale;(e._overrideWidth||e._overrideHeight)&&(a=e._overrideWidth||e._overrideHeight/s*n,o=e._overrideHeight||e._overrideWidth/n*s),a=Math.round(a),o=Math.round(o);var h=e.source;h.width=a,h.height=o,h._pixiId="canvas_"+qe(),h.getContext("2d").drawImage(i,0,0,n,s,0,0,a,o),e._resolve(),e._resolve=null}}},t.getSize=function(e){var i=t.SVG_SIZE.exec(e),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},t.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},t.test=function(e,i){return i==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&t.SVG_XML.test(e)},t.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,t.SVG_SIZE=/<svg[^>]*(?:\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;o<e.length;++o){var h=document.createElement("source"),u=e[o],l=u.src,f=u.mime;l=l||e[o];var c=l.split("?").shift().toLowerCase(),d=c.slice(c.lastIndexOf(".")+1);f=f||t.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=f,s.appendChild(h)}e=s}return n=r.call(this,e)||this,n.noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=i.autoPlay!==!1,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),i.autoLoad!==!1&&n.load(),n}return t.prototype.update=function(e){if(!this.destroyed){var i=Xt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(r.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},t.prototype.load=function(){var e=this;if(this._load)return this._load;var i=this.source;return(i.readyState===i.HAVE_ENOUGH_DATA||i.readyState===i.HAVE_FUTURE_DATA)&&i.width&&i.height&&(i.complete=!0),i.addEventListener("play",this._onPlayStart.bind(this)),i.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(i.addEventListener("canplay",this._onCanPlay),i.addEventListener("canplaythrough",this._onCanPlay),i.addEventListener("error",this._onError,!0)),this._load=new Promise(function(n){e.valid?n(e):(e._resolve=n,i.load())}),this._load},t.prototype._onError=function(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)},t.prototype._isSourcePlaying=function(){var e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()},t.prototype._isSourceReady=function(){var e=this.source;return e.readyState>2},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<this.colorTextures.length;i++){var n=this.colorTextures[i],s=n.resolution;n.setSize(t/s,e/s)}if(this.depthTexture){var s=this.depthTexture.resolution;this.depthTexture.setSize(t/s,e/s)}}},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},r}(),Ws=function(r){Z(t,r);function t(e){e===void 0&&(e={});var i=this;if(typeof e=="number"){var n=arguments[0],s=arguments[1],a=arguments[2],o=arguments[3];e={width:n,height:s,scaleMode:a,resolution:o}}return e.width=e.width||100,e.height=e.height||100,e.multisample=e.multisample!==void 0?e.multisample:rt.NONE,i=r.call(this,null,e)||this,i.mipmap=ut.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Li(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=e.multisample,i.maskStack=[],i.filterStack=[{}],i}return t.prototype.resize=function(e,i){this.framebuffer.resize(e*this.resolution,i*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},t.prototype.dispose=function(){this.framebuffer.dispose(),r.prototype.dispose.call(this)},t.prototype.destroy=function(){r.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},t}(X),Vs=function(){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return r.prototype.set=function(t,e,i){var n=e.width,s=e.height;if(i){var a=t.width/2/n,o=t.height/2/s,h=t.x/n+a,u=t.y/s+o;i=tt.add(i,tt.NW),this.x0=h+a*tt.uX(i),this.y0=u+o*tt.uY(i),i=tt.add(i,2),this.x1=h+a*tt.uX(i),this.y1=u+o*tt.uY(i),i=tt.add(i,2),this.x2=h+a*tt.uX(i),this.y2=u+o*tt.uY(i),i=tt.add(i,2),this.x3=h+a*tt.uX(i),this.y3=u+o*tt.uY(i)}else this.x0=t.x/n,this.y0=t.y/s,this.x1=(t.x+t.width)/n,this.y1=t.y/s,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/s,this.x3=t.x/n,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},r.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},r}(),Zn=new Vs;function lr(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var k=function(r){Z(t,r);function t(e,i,n,s,a,o){var h=r.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new W(0,0,1,1)),e instanceof t&&(e=e.baseTexture),h.baseTexture=e,h._frame=i,h.trim=s,h.valid=!1,h._uvs=Zn,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(a||0),a===!0)h._rotate=2;else if(h._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=o?new q(o.x,o.y):new q(0,0),h._updateID=0,h.textureCacheIds=[],e.valid?h.noFrame?e.valid&&h.onBaseTextureUpdated(e):h.frame=i:e.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&e.on("update",h.onBaseTextureUpdated,h),h}return t.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},t.prototype.onBaseTextureUpdated=function(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},t.prototype.destroy=function(e){if(this.baseTexture){if(e){var i=this.baseTexture.resource;i&&i.url&&Ut[i.url]&&t.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,t.removeFromCache(this),this.textureCacheIds=null},t.prototype.clone=function(){var e=this._frame.clone(),i=this._frame===this.orig?e:this.orig.clone(),n=new t(this.baseTexture,!this.noFrame&&e,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=e),n},t.prototype.updateUvs=function(){this._uvs===Zn&&(this._uvs=new Vs),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},t.from=function(e,i,n){i===void 0&&(i={}),n===void 0&&(n=P.STRICT_TEXTURE_CACHE);var s=typeof e=="string",a=null;if(s)a=e;else if(e instanceof X){if(!e.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";e.cacheId=o+"-"+qe(),X.addToCache(e,e.cacheId)}a=e.cacheId}else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+qe()}a=e._pixiId}var h=Ut[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in TextureCache.');return!h&&!(e instanceof X)?(i.resolution||(i.resolution=te(e)),h=new t(new X(e,i)),h.baseTexture.cacheId=a,X.addToCache(h.baseTexture,a),t.addToCache(h,a)):!h&&e instanceof X&&(h=new t(e),t.addToCache(h,a)),h},t.fromURL=function(e,i){var n=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),s=t.from(e,Object.assign({resourceOptions:n},i),!1),a=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):a.load().then(function(){return Promise.resolve(s)})},t.fromBuffer=function(e,i,n,s){return new t(X.fromBuffer(e,i,n,s))},t.fromLoader=function(e,i,n,s){var a=new X(e,Object.assign({scaleMode:P.SCALE_MODE,resolution:te(i)},s)),o=a.resource;o instanceof js&&(o.url=i);var h=new t(a);return n||(n=i),X.addToCache(h.baseTexture,n),t.addToCache(h,n),n!==i&&(X.addToCache(h.baseTexture,i),t.addToCache(h,i)),h.baseTexture.valid?Promise.resolve(h):new Promise(function(u){h.baseTexture.once("loaded",function(){return u(h)})})},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),Ut[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ut[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=Ut[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Ut[e],i}}else if(e&&e.textureCacheIds){for(var s=0;s<e.textureCacheIds.length;++s)Ut[e.textureCacheIds[s]]===e&&delete Ut[e.textureCacheIds[s]];return e.textureCacheIds.length=0,e}return null},Object.defineProperty(t.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frame",{get:function(){return this._frame},set:function(e){this._frame=e,this.noFrame=!1;var i=e.x,n=e.y,s=e.width,a=e.height,o=i+s>this.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<arguments.length;s++)n[s-1]=i[s];return typeof e=="number"&&(Mt("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),e={width:e,height:n[0],scaleMode:n[1],resolution:n[2]}),new t(new Ws(e))},t}(k),Hu=function(){function r(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return r.prototype.createTexture=function(t,e,i){i===void 0&&(i=rt.NONE);var n=new Ws(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new $i(n)},r.prototype.getOptimalTexture=function(t,e,i,n){i===void 0&&(i=1),n===void 0&&(n=rt.NONE);var s;t=Math.ceil(t*i-1e-6),e=Math.ceil(e*i-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Br(t),e=Br(e),s=((t&65535)<<16|e&65535)>>>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;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},r.prototype.setScreenSize=function(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},r.SCREEN_KEY=-1,r}(),Qn=function(){function r(t,e,i,n,s,a,o){e===void 0&&(e=0),i===void 0&&(i=!1),n===void 0&&(n=M.FLOAT),this.buffer=t,this.size=e,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o}return r.prototype.destroy=function(){this.buffer=null},r.from=function(t,e,i,n,s){return new r(t,e,i,n,s)},r}(),ju=0,ft=function(){function r(t,e,i){e===void 0&&(e=!0),i===void 0&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=ju++,this.disposeRunner=new ot("disposeBuffer")}return r.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(r.prototype,"index",{get:function(){return this.type===Bt.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?Bt.ELEMENT_ARRAY_BUFFER:Bt.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new r(t)},r}(),Wu={Float32Array,Uint32Array,Int32Array,Uint8Array};function Vu(r,t){for(var e=0,i=0,n={},s=0;s<r.length;s++)i+=t[s],e+=r[s].length;for(var a=new ArrayBuffer(e*4),o=null,h=0,s=0;s<r.length;s++){var u=t[s],l=r[s],f=Gs(l);n[f]||(n[f]=new Wu[f](a)),o=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,p=c%u;o[d+p]=l[c]}h+=u}return new Float32Array(a)}var Jn={5126:4,5123:2,5121:1},Yu=0,zu={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Yr=function(){function r(t,e){t===void 0&&(t=[]),e===void 0&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Yu++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new ot("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(t,e,i,n,s,a,o,h){if(i===void 0&&(i=0),n===void 0&&(n=!1),h===void 0&&(h=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof ft||(e instanceof Array&&(e=new Float32Array(e)),e=new ft(e));var u=t.split("|");if(u.length>1){for(var l=0;l<u.length;l++)this.addAttribute(u[l],e,i,n,s);return this}var f=this.buffers.indexOf(e);return f===-1&&(this.buffers.push(e),f=this.buffers.length-1),this.attributes[t]=new Qn(f,i,n,s,a,o,h),this.instanced=this.instanced||h,this},r.prototype.getAttribute=function(t){return this.attributes[t]},r.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},r.prototype.addIndex=function(t){return t instanceof ft||(t instanceof Array&&(t=new Uint16Array(t)),t=new ft(t)),t.type=Bt.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.indexOf(t)===-1&&this.buffers.push(t),this},r.prototype.getIndex=function(){return this.indexBuffer},r.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var t=[],e=[],i=new ft,n;for(n in this.attributes){var s=this.attributes[n],a=this.buffers[s.buffer];t.push(a.data),e.push(s.size*Jn[s.type]/4),s.buffer=0}for(i.data=Vu(t,e),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},r.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t],i=this.buffers[e.buffer];return i.data.length/(e.stride/4||e.size)}return 0},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},r.prototype.clone=function(){for(var t=new r,e=0;e<this.buffers.length;e++)t.buffers[e]=new ft(this.buffers[e].data.slice(0));for(var e in this.attributes){var i=this.attributes[e];t.attributes[e]=new Qn(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=Bt.ELEMENT_ARRAY_BUFFER),t},r.merge=function(t){for(var e=new r,i=[],n=[],s=[],a,o=0;o<t.length;o++){a=t[o];for(var h=0;h<a.buffers.length;h++)n[h]=n[h]||0,n[h]+=a.buffers[h].data.length,s[h]=0}for(var o=0;o<a.buffers.length;o++)i[o]=new zu[Gs(a.buffers[o].data)](n[o]),e.buffers[o]=new ft(i[o]);for(var o=0;o<t.length;o++){a=t[o];for(var h=0;h<a.buffers.length;h++)i[h].set(a.buffers[h].data,s[h]),s[h]+=a.buffers[h].data.length}if(e.attributes=a.attributes,a.indexBuffer){e.indexBuffer=e.buffers[a.buffers.indexOf(a.indexBuffer)],e.indexBuffer.type=Bt.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,o=0;o<a.buffers.length;o++)if(a.buffers[o]!==a.indexBuffer){c=o;break}for(var o in a.attributes){var d=a.attributes[o];(d.buffer|0)===c&&(l+=d.size*Jn[d.type]/4)}for(var o=0;o<t.length;o++){for(var p=t[o].indexBuffer.data,h=0;h<p.length;h++)e.indexBuffer.data[h+f]+=u;u+=t[o].buffers[c].data.length/l,f+=p.length}}return e},r}(),qu=function(r){Z(t,r);function t(){var e=r.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return t}(Yr),$u=function(r){Z(t,r);function t(){var e=r.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new ft(e.vertices),e.uvBuffer=new ft(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return t.prototype.map=function(e,i){var n=0,s=0;return this.uvs[0]=n,this.uvs[1]=s,this.uvs[2]=n+i.width/e.width,this.uvs[3]=s,this.uvs[4]=n+i.width/e.width,this.uvs[5]=s+i.height/e.height,this.uvs[6]=n,this.uvs[7]=s+i.height/e.height,n=i.x,s=i.y,this.vertices[0]=n,this.vertices[1]=s,this.vertices[2]=n+i.width,this.vertices[3]=s,this.vertices[4]=n+i.width,this.vertices[5]=s+i.height,this.vertices[6]=n,this.vertices[7]=s+i.height,this.invalidate(),this},t.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},t}(Yr),Ku=0,ve=function(){function r(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Ku++,this.static=!!e,this.ubo=!!i,t instanceof ft?(this.buffer=t,this.buffer.type=Bt.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new ft(new Float32Array(1)),this.buffer.type=Bt.UNIFORM_BUFFER,this.autoManage=!0))}return r.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},r.prototype.add=function(t,e,i){if(!this.ubo)this.uniforms[t]=new r(e,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},r.from=function(t,e,i){return new r(t,e,i)},r.uboFrom=function(t,e){return new r(t,e!=null?e:!0,!0)},r}(),Zu=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=rt.NONE,this.sourceFrame=new W,this.destinationFrame=new W,this.bindingSourceFrame=new W,this.bindingDestinationFrame=new W,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),fr=[new q,new q,new q,new q],ei=new dt,Qu=function(){function r(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new Hu,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new qu,this.quadUv=new $u,this.tempRect=new W,this.activeState={},this.globalUniforms=new ve({outputFrame:new W,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return r.prototype.push=function(t,e){for(var i,n,s=this.renderer,a=this.defaultFilterStack,o=this.statePool.pop()||new Zu,h=this.renderer.renderTexture,u=e[0].resolution,l=e[0].multisample,f=e[0].padding,c=e[0].autoFit,d=(i=e[0].legacy)!==null&&i!==void 0?i:!0,p=1;p<e.length;p++){var v=e[p];u=Math.min(u,v.resolution),l=Math.min(l,v.multisample),f=this.useMaxPadding?Math.max(f,v.padding):f+v.padding,c=c&&v.autoFit,d=d||((n=v.legacy)!==null&&n!==void 0?n:!0)}a.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),a.push(o),o.resolution=u,o.multisample=l,o.legacy=d,o.target=t,o.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),o.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);s.projection.transform&&this.transformAABB(ei.copyFrom(s.projection.transform).invert(),_),c?(o.sourceFrame.fit(_),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(_)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,h.current?h.current.resolution:s.resolution,h.sourceFrame,h.destinationFrame,s.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,l),o.filters=e,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=o.sourceFrame.width,m.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(h.sourceFrame),o.bindingDestinationFrame.copyFrom(h.destinationFrame),o.transform=s.projection.transform,s.projection.transform=null,h.bind(o.renderTexture,o.sourceFrame,m),s.framebuffer.clear(0,0,0,0)},r.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var n=this.globalUniforms.uniforms;n.outputFrame=e.sourceFrame,n.resolution=e.resolution;var s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=e.destinationFrame.width,s[1]=e.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*e.resolution),a[1]=Math.round(s[1]*e.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=e.sourceFrame.width*s[2]-.5*a[2],o[3]=e.sourceFrame.height*s[3]-.5*a[3],e.legacy){var h=n.filterArea;h[0]=e.destinationFrame.width,h[1]=e.destinationFrame.height,h[2]=e.sourceFrame.x,h[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,e.renderTexture,u.renderTexture,Qt.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,f=this.getOptimalFilterTexture(l.width,l.height,e.resolution);f.filterFrame=l.filterFrame;var c=0;for(c=0;c<i.length-1;++c){c===1&&e.multisample>1&&(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<o;u++){var l=s[u],f=l._batchLocation;if(f>=0&&f<n&&e[f]===l){a[u]=f;continue}for(;h<n;){var c=e[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}a[u]=h,l._batchLocation=h,e[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),ts=0,tl=function(){function r(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(r.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),r.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=ts++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},r.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=ts++,this.renderer.runners.contextChange.emit(t)},r.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},r.prototype.createContext=function(t,e){var i;if(P.PREFER_ENV>=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<t.colorTextures.length;a++){var o=t.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var h=e.width>>i,u=e.height>>i,l=h/e.width;this.setViewport(e.x*l,e.y*l,h,u)}else{var h=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;a<s;a++){var o=n[a],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},r.prototype.updateFramebuffer=function(t,e){var i=this.gl,n=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures,a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&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;h<a;h++){var u=s[h],l=u.parentTextureArray||u;this.renderer.texture.bind(l,0),!(h===0&&n.msaaBuffer)&&(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,u.target,l._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),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<e.length;n++)if(e[n]<=t){i=e[n];break}return i===1&&(i=rt.NONE),i},r.prototype.blit=function(t,e,i){var n=this,s=n.current,a=n.renderer,o=n.gl,h=n.CONTEXT_UID;if(a.context.webGLVersion===2&&!!s){var u=s.glFramebuffers[h];if(!!u){if(!t){if(!u.msaaBuffer)return;var l=s.colorTextures[0];if(!l)return;u.blitFramebuffer||(u.blitFramebuffer=new Li(s.width,s.height),u.blitFramebuffer.addColorTexture(0,l)),t=u.blitFramebuffer,t.colorTextures[0]!==l&&(t.colorTextures[0]=l,t.dirtyId++,t.dirtyFormat++),(t.width!==s.width||t.height!==s.height)&&(t.width=s.width,t.height=s.height,t.dirtyId++,t.dirtySize++)}e||(e=rl,e.width=s.width,e.height=s.height),i||(i=e);var f=e.width===i.width&&e.height===i.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,u.framebuffer),o.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.bottom,o.COLOR_BUFFER_BIT,f?o.NEAREST:o.LINEAR)}}},r.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(!!i){delete t.glFramebuffers[this.CONTEXT_UID];var s=this.managedFramebuffers.indexOf(t);s>=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<e.length;i++)this.disposeFramebuffer(e[i],t)},r.prototype.forceStencil=function(){var t=this.current;if(!!t){var e=t.glFramebuffers[this.CONTEXT_UID];if(!(!e||e.stencil)){t.stencil=!0;var i=t.width,n=t.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),e.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,e.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),e.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new W},r.prototype.destroy=function(){this.renderer=null},r}(),ri={5126:4,5123:2,5121:1},nl=function(){function r(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,e.webGLVersion!==2){var i=this.renderer.context.extensions.vertexArrayObject;P.PREFER_ENV===zt.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(s){return i.bindVertexArrayOES(s)},t.deleteVertexArray=function(s){return i.deleteVertexArrayOES(s)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(e.webGLVersion!==2){var n=t.getExtension("ANGLE_instanced_arrays");n?(t.vertexAttribDivisor=function(s,a){return n.vertexAttribDivisorANGLE(s,a)},t.drawElementsInstanced=function(s,a,o,h,u){return n.drawElementsInstancedANGLE(s,a,o,h,u)},t.drawArraysInstanced=function(s,a,o,h){return n.drawArraysInstancedANGLE(s,a,o,h)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex},r.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,n=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);var a=n[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()},r.prototype.reset=function(){this.unbind()},r.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,i=0;i<t.buffers.length;i++){var n=t.buffers[i];e.update(n)}},r.prototype.checkCompatibility=function(t,e){var i=t.attributes,n=e.attributeData;for(var s in n)if(!i[s])throw new Error('shader and geometry incompatible, geometry missing the "'+s+'" attribute')},r.prototype.getSignature=function(t,e){var i=t.attributes,n=e.attributeData,s=["g",t.id];for(var a in i)n[a]&&s.push(a,n[a].location);return s.join("-")},r.prototype.initGeometryVao=function(t,e,i){i===void 0&&(i=!0);var n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=e.program;o.glPrograms[s]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);var h=this.getSignature(t,o),u=t.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[o.id]=l,l;var f=t.buffers,c=t.attributes,d={},p={};for(var v in f)d[v]=0,p[v]=0;for(var v in c)!c[v].size&&o.attributeData[v]?c[v].size=o.attributeData[v].size:c[v].size||console.warn("PIXI Geometry attribute '"+v+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[v].buffer]+=c[v].size*ri[c[v].type];for(var v in c){var _=c[v],m=_.size;_.stride===void 0&&(d[_.buffer]===m*ri[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=p[_.buffer],p[_.buffer]+=m*ri[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var x=0;x<f.length;x++){var E=f[x];a.bind(E),i&&E._glBuffers[s].refCount++}return this.activateVao(t,o),this._activeVao=l,u[o.id]=l,u[h]=l,l},r.prototype.disposeGeometry=function(t,e){var i;if(!!this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var n=t.glVertexArrayObjects[this.CONTEXT_UID],s=this.gl,a=t.buffers,o=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(t.disposeRunner.remove(this),!!n){if(o)for(var h=0;h<a.length;h++){var u=a[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!e&&o.dispose(a[h],e))}if(!e){for(var l in n)if(l[0]==="g"){var f=n[l];this._activeVao===f&&this.unbind(),s.deleteVertexArray(f)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)},r.prototype.activateVao=function(t,e){var i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);var h=null;for(var u in o){var l=o[u],f=a[l.buffer],c=f._glBuffers[n];if(e.attributeData[u]){h!==c&&(s.bind(f),h=c);var d=e.attributeData[u].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,l.size,l.type||i.FLOAT,l.normalized,l.stride,l.start),l.instance)if(this.hasInstance)i.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},r.prototype.draw=function(t,e,i,n){var s=this.gl,a=this._activeGeometry;if(a.indexBuffer){var o=a.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(t,e||a.indexBuffer.data.length,h,(i||0)*o,n||1):s.drawElements(t,e||a.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(t,i,e||a.getSize(),n||1):s.drawArrays(t,i,e||a.getSize());return this},r.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},r.prototype.destroy=function(){this.renderer=null},r}(),sl=function(){function r(t){t===void 0&&(t=null),this.type=nt.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=P.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(r.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=nt.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},r.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},r}();function es(r,t,e){var i=r.createShader(t);return r.shaderSource(i,e),r.compileShader(i),i}function rs(r,t){var e=r.getShaderSource(t).split(`
`).map(function(u,l){return l+": "+u}),i=r.getShaderInfoLog(t),n=i.split(`
`),s={},a=n.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return u&&!s[u]?(s[u]=!0,!0):!1}),o=[""];a.forEach(function(u){e[u-1]="%c"+e[u-1]+"%c",o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=e.join(`
`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function al(r,t,e,i){r.getProgramParameter(t,r.LINK_STATUS)||(r.getShaderParameter(e,r.COMPILE_STATUS)||rs(r,e),r.getShaderParameter(i,r.COMPILE_STATUS)||rs(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(t)))}function ii(r){for(var t=new Array(r),e=0;e<t.length;e++)t[e]=!1;return t}function zs(r,t){switch(r){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return ii(2*t);case"bvec3":return ii(3*t);case"bvec4":return ii(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var qs={},Le=qs;function ol(){if(Le===qs||Le&&Le.isContextLost()){var r=P.ADAPTER.createCanvas(),t=void 0;P.PREFER_ENV>=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;i<e.length;++i){var n=e[i];dr[r[n]]=ns[n]}}return dr[t]}var Oe=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
if(uv["`+r+'"] !== ud["'+r+`"].value)
{
ud["`+r+'"].value = uv["'+r+`"]
gl.uniform1f(ud["`+r+'"].location, uv["'+r+`"])
}
`}},{test:function(r,t){return(r.type==="sampler2D"||r.type==="samplerCube"||r.type==="sampler2DArray")&&r.size===1&&!r.isArray&&(t==null||t.castToBaseTexture!==void 0)},code:function(r){return`t = syncData.textureCount++;
renderer.texture.bind(uv["`+r+`"], t);
if(ud["`+r+`"].value !== t)
{
ud["`+r+`"].value = t;
gl.uniform1i(ud["`+r+`"].location, t);
; // eslint-disable-line max-len
}`}},{test:function(r,t){return r.type==="mat3"&&r.size===1&&!r.isArray&&t.a!==void 0},code:function(r){return`
gl.uniformMatrix3fv(ud["`+r+'"].location, false, uv["'+r+`"].toArray(true));
`},codeUbo:function(r){return`
var `+r+"_matrix = uv."+r+`.toArray(true);
data[offset] = `+r+`_matrix[0];
data[offset+1] = `+r+`_matrix[1];
data[offset+2] = `+r+`_matrix[2];
data[offset + 4] = `+r+`_matrix[3];
data[offset + 5] = `+r+`_matrix[4];
data[offset + 6] = `+r+`_matrix[5];
data[offset + 8] = `+r+`_matrix[6];
data[offset + 9] = `+r+`_matrix[7];
data[offset + 10] = `+r+`_matrix[8];
`}},{test:function(r,t){return r.type==="vec2"&&r.size===1&&!r.isArray&&t.x!==void 0},code:function(r){return`
cv = ud["`+r+`"].value;
v = uv["`+r+`"];
if(cv[0] !== v.x || cv[1] !== v.y)
{
cv[0] = v.x;
cv[1] = v.y;
gl.uniform2f(ud["`+r+`"].location, v.x, v.y);
}`},codeUbo:function(r){return`
v = uv.`+r+`;
data[offset] = v.x;
data[offset+1] = v.y;
`}},{test:function(r){return r.type==="vec2"&&r.size===1&&!r.isArray},code:function(r){return`
cv = ud["`+r+`"].value;
v = uv["`+r+`"];
if(cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2f(ud["`+r+`"].location, v[0], v[1]);
}
`}},{test:function(r,t){return r.type==="vec4"&&r.size===1&&!r.isArray&&t.width!==void 0},code:function(r){return`
cv = ud["`+r+`"].value;
v = uv["`+r+`"];
if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
{
cv[0] = v.x;
cv[1] = v.y;
cv[2] = v.width;
cv[3] = v.height;
gl.uniform4f(ud["`+r+`"].location, v.x, v.y, v.width, v.height)
}`},codeUbo:function(r){return`
v = uv.`+r+`;
data[offset] = v.x;
data[offset+1] = v.y;
data[offset+2] = v.width;
data[offset+3] = v.height;
`}},{test:function(r){return r.type==="vec4"&&r.size===1&&!r.isArray},code:function(r){return`
cv = ud["`+r+`"].value;
v = uv["`+r+`"];
if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4f(ud["`+r+`"].location, v[0], v[1], v[2], v[3])
}`}}],ll={float:`
if (cv !== v)
{
cu.value = v;
gl.uniform1f(location, v);
}`,vec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2f(location, v[0], v[1])
}`,vec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3f(location, v[0], v[1], v[2])
}`,vec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
}`,int:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,ivec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(location, v[0], v[1]);
}`,ivec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(location, v[0], v[1], v[2]);
}`,ivec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
}`,uint:`
if (cv !== v)
{
cu.value = v;
gl.uniform1ui(location, v);
}`,uvec2:`
if (cv[0] !== v[0] || cv[1] !== v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2ui(location, v[0], v[1]);
}`,uvec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3ui(location, v[0], v[1], v[2]);
}`,uvec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
}`,bool:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,bvec2:`
if (cv[0] != v[0] || cv[1] != v[1])
{
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(location, v[0], v[1]);
}`,bvec3:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(location, v[0], v[1], v[2]);
}`,bvec4:`
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
{
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
}`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,samplerCube:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`,sampler2DArray:`
if (cv !== v)
{
cu.value = v;
gl.uniform1i(location, v);
}`},fl={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function cl(r,t){var e,i=[`
var v = null;
var cv = null;
var cu = null;
var t = 0;
var gl = renderer.gl;
`];for(var n in r.uniforms){var s=t[n];if(!s){!((e=r.uniforms[n])===null||e===void 0)&&e.group&&(r.uniforms[n].ubo?i.push(`
renderer.shader.syncUniformBufferGroup(uv.`+n+", '"+n+`');
`):i.push(`
renderer.shader.syncUniformGroup(uv.`+n+`, syncData);
`));continue}for(var a=r.uniforms[n],o=!1,h=0;h<Oe.length;h++)if(Oe[h].test(s,a)){i.push(Oe[h].code(n,a)),o=!0;break}if(!o){var u=s.size===1&&!s.isArray?ll:fl,l=u[s.type].replace("location",'ud["'+n+'"].location');i.push(`
cu = ud["`+n+`"];
cv = cu.value;
v = uv["`+n+`"];
`+l+";")}}return new Function("ud","uv","renderer","syncData",i.join(`
`))}var dl=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
`);function pl(r){for(var t="",e=0;e<r;++e)e>0&&(t+=`
else `),e<r-1&&(t+="if(test == "+e+".0){}");return t}function vl(r,t){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var e=t.createShader(t.FRAGMENT_SHADER);;){var i=dl.replace(/%forloop%/gi,pl(r));if(t.shaderSource(e,i),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))r=r/2|0;else break}return r}var Ne;function _l(){if(typeof Ne=="boolean")return Ne;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Ne=r({a:"b"},"a","b")===!0}catch{Ne=!1}return Ne}var ml=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void){
gl_FragColor *= texture2D(uSampler, vTextureCoord);
}`,gl=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void){
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
}
`,yl=0,pr={},tr=function(){function r(t,e,i){i===void 0&&(i="pixi-shader"),this.id=yl++,this.vertexSrc=t||r.defaultVertexSrc,this.fragmentSrc=e||r.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),pr[i]?(pr[i]++,i+="-"+pr[i]):pr[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
`+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
`+this.fragmentSrc,this.vertexSrc=is(this.vertexSrc,P.PRECISION_VERTEX,pt.HIGH),this.fragmentSrc=is(this.fragmentSrc,P.PRECISION_FRAGMENT,hl())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return gl},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return ml},enumerable:!1,configurable:!0}),r.from=function(t,e,i){var n=t+e,s=$n[n];return s||($n[n]=s=new r(t,e,i)),s},r}(),zr=function(){function r(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof ve?this.uniformGroup=e:this.uniformGroup=new ve(e):this.uniformGroup=new ve({}),this.disposeRunner=new ot("disposeShader")}return r.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var n=e.uniforms[i];if(n.group&&this.checkUniformExists(t,n))return!0}return!1},r.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),r.from=function(t,e,i){var n=tr.from(t,e);return new r(n,i)},r}(),ni=0,si=1,ai=2,oi=3,hi=4,ui=5,er=function(){function r(){this.data=0,this.blendMode=B.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<ni)},set:function(t){!!(this.data&1<<ni)!==t&&(this.data^=1<<ni)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<si)},set:function(t){!!(this.data&1<<si)!==t&&(this.data^=1<<si)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<ai)},set:function(t){!!(this.data&1<<ai)!==t&&(this.data^=1<<ai)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<oi)},set:function(t){!!(this.data&1<<oi)!==t&&(this.data^=1<<oi)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<ui)},set:function(t){!!(this.data&1<<ui)!==t&&(this.data^=1<<ui)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<hi)},set:function(t){!!(this.data&1<<hi)!==t&&(this.data^=1<<hi)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==B.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},r.for2d=function(){var t=new r;return t.depthTest=!1,t.blend=!0,t},r}(),bl=`varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void){
gl_FragColor = texture2D(uSampler, vTextureCoord);
}
`,xl=`attribute vec2 aVertexPosition;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
uniform vec4 inputSize;
uniform vec4 outputFrame;
vec4 filterVertexPosition( void )
{
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
}
vec2 filterTextureCoord( void )
{
return aVertexPosition * (outputFrame.zw * inputSize.zw);
}
void main(void)
{
gl_Position = filterVertexPosition();
vTextureCoord = filterTextureCoord();
}
`,El=function(r){Z(t,r);function t(e,i,n){var s=this,a=tr.from(e||t.defaultVertexSrc,i||t.defaultFragmentSrc);return s=r.call(this,a,n)||this,s.padding=0,s.resolution=P.FILTER_RESOLUTION,s.multisample=P.FILTER_MULTISAMPLE,s.enabled=!0,s.autoFit=!0,s.state=new er,s}return t.prototype.apply=function(e,i,n,s,a){e.applyFilter(this,i,n,s)},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,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return xl},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return bl},enumerable:!1,configurable:!0}),t}(zr),Tl=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 otherMatrix;
varying vec2 vMaskCoord;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
}
`,wl=`varying vec2 vMaskCoord;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform sampler2D mask;
uniform float alpha;
uniform float npmAlpha;
uniform vec4 maskClamp;
void main(void)
{
float clip = step(3.5,
step(maskClamp.x, vMaskCoord.x) +
step(maskClamp.y, vMaskCoord.y) +
step(vMaskCoord.x, maskClamp.z) +
step(vMaskCoord.y, maskClamp.w));
vec4 original = texture2D(uSampler, vTextureCoord);
vec4 masky = texture2D(mask, vMaskCoord);
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
original *= (alphaMul * masky.r * alpha * clip);
gl_FragColor = original;
}
`,ss=new dt,Zs=function(){function r(t,e){this._texture=t,this.mapCoord=new dt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e=="undefined"?.5:e,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(t,e){e===void 0&&(e=t);for(var i=this.mapCoord,n=0;n<t.length;n+=2){var s=t[n],a=t[n+1];e[n]=s*i.a+a*i.c+i.tx,e[n+1]=s*i.b+a*i.d+i.ty}return e},r.prototype.update=function(t){var e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=e.orig,s=e.trim;s&&(ss.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(ss));var a=e.baseTexture,o=this.uClampFrame,h=this.clampMargin/a.resolution,u=this.clampOffset;return o[0]=(e._frame.x+h+u)/a.width,o[1]=(e._frame.y+h+u)/a.height,o[2]=(e._frame.x+e._frame.width-h+u)/a.width,o[3]=(e._frame.y+e._frame.height-h+u)/a.height,this.uClampOffset[0]=u/a.realWidth,this.uClampOffset[1]=u/a.realHeight,this.isSimple=e._frame.width===a.width&&e._frame.height===a.height&&e.rotate===0,!0},r}(),Al=function(r){Z(t,r);function t(e,i,n){var s=this,a=null;return typeof e!="string"&&i===void 0&&n===void 0&&(a=e,e=void 0,i=void 0,n=void 0),s=r.call(this,e||Tl,i||wl,n)||this,s.maskSprite=a,s.maskMatrix=new dt,s}return Object.defineProperty(t.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),t.prototype.apply=function(e,i,n,s){var a=this._maskSprite,o=a._texture;!o.valid||(o.uvMatrix||(o.uvMatrix=new Zs(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,a).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=a.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,e.applyFilter(this,i,n,s))},t}(El),Sl=function(){function r(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return r.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},r.prototype.push=function(t,e){var i=e;if(!i.isMaskData){var n=this.maskDataPool.pop()||new sl;n.pooled=!0,n.maskObject=e,i=n}var s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i._colorMask=s?s._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==nt.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case nt.SCISSOR:this.renderer.scissor.push(i);break;case nt.STENCIL:this.renderer.stencil.push(i);break;case nt.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case nt.COLOR:this.pushColorMask(i);break}i.type===nt.SPRITE&&this.maskStack.push(i)},r.prototype.pop=function(t){var e=this.maskStack.pop();if(!(!e||e._target!==t)){if(e.enabled)switch(e.type){case nt.SCISSOR:this.renderer.scissor.pop(e);break;case nt.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case nt.SPRITE:this.popSpriteMask(e);break;case nt.COLOR:this.popColorMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){var i=this.maskStack[this.maskStack.length-1];i.type===nt.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(t){var e=t.maskObject;e?e.isSprite?t.type=nt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=nt.SCISSOR:t.type=nt.STENCIL:t.type=nt.COLOR},r.prototype.pushSpriteMask=function(t){var e,i,n=t.maskObject,s=t._target,a=t._filters;a||(a=this.alphaMaskPool[this.alphaMaskIndex],a||(a=this.alphaMaskPool[this.alphaMaskIndex]=[new Al]));var o=this.renderer,h=o.renderTexture,u,l;if(h.current){var f=h.current;u=t.resolution||f.resolution,l=(e=t.multisample)!==null&&e!==void 0?e:f.multisample}else u=t.resolution||o.resolution,l=(i=t.multisample)!==null&&i!==void 0?i:o.multisample;a[0].resolution=u,a[0].multisample=l,a[0].maskSprite=n;var c=s.filterArea;s.filterArea=n.getBounds(!0),o.filter.push(s,a),s.filterArea=c,t._filters||this.alphaMaskIndex++},r.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},r.prototype.pushColorMask=function(t){var e=t._colorMask,i=t._colorMask=e&t.colorMask;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.popColorMask=function(t){var e=t._colorMask,i=this.maskStack.length>0?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;s<t.length;s++){var a=t[s];if(e=Js[a.data.type],a.data.size>1&&(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;o<n.length;o++){for(var h=n[o],u=r.uniforms[h.data.name],l=h.data.name,f=!1,c=0;c<Oe.length;c++){var d=Oe[c];if(d.codeUbo&&d.test(h.data,u)){a.push("offset = "+h.offset/4+";",Oe[c].codeUbo(h.data.name,u)),f=!0;break}}if(!f)if(h.data.size>1){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;n<i;n++){var s=t.getActiveAttrib(r,n);if(s.name.indexOf("gl_")!==0){var a=Ks(t,s.type),o={type:a,name:s.name,size:$s(a),location:t.getAttribLocation(r,s.name)};e[s.name]=o}}return e}function Ul(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),n=0;n<i;n++){var s=t.getActiveUniform(r,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),h=Ks(t,s.type);e[a]={name:a,index:n,type:h,size:s.size,isArray:o,value:zs(h,s.size)}}return e}function Gl(r,t){var e=es(r,r.VERTEX_SHADER,t.vertexSrc),i=es(r,r.FRAGMENT_SHADER,t.fragmentSrc),n=r.createProgram();if(r.attachShader(n,e),r.attachShader(n,i),r.linkProgram(n),r.getProgramParameter(n,r.LINK_STATUS)||al(r,n,e,i),t.attributeData=Dl(n,r),t.uniformData=Ul(n,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){var s=Object.keys(t.attributeData);s.sort(function(l,f){return l>f?1:-1});for(var a=0;a<s.length;a++)t.attributeData[s[a]].location=a,r.bindAttribLocation(n,a,s[a]);r.linkProgram(n)}r.deleteShader(e),r.deleteShader(i);var o={};for(var a in t.uniformData){var h=t.uniformData[a];o[a]={location:r.getUniformLocation(n,a),value:zs(h.type,h.size)}}var u=new Fl(n,o);return u}var kl=0,vr={textureCount:0,uboCount:0},Xl=function(){function r(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=kl++}return r.prototype.systemCheck=function(){if(!_l())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},r.prototype.contextChange=function(t){this.gl=t,this.reset()},r.prototype.bind=function(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(vr.textureCount=0,vr.uboCount=0,this.syncUniformGroup(t.uniformGroup,vr)),n},r.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},r.prototype.syncUniformGroup=function(t,e){var i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))},r.prototype.syncUniforms=function(t,e,i){var n=t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t);n(e.uniformData,t.uniforms,this.renderer,i)},r.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=cl(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},r.prototype.syncUniformBufferGroup=function(t,e){var i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;var n=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),n(i.uniformData,t.uniforms,this.renderer,vr,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])},r.prototype.createSyncBufferGroup=function(t,e,i){var n=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var s=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;var a=this.getSignature(t,this.shader.program.uniformData,"ubo"),o=this._uboCache[a];if(o||(o=this._uboCache[a]=Nl(t,this.shader.program.uniformData)),t.autoManage){var h=new Float32Array(o.size/4);t.buffer.update(h)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]},r.prototype.getSignature=function(t,e,i){var n=t.uniforms,s=[i+"-"];for(var a in n)s.push(a),e[a]&&s.push(e[a].type);return s.join("-")},r.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},r.prototype.generateProgram=function(t){var e=this.gl,i=t.program,n=Gl(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n},r.prototype.reset=function(){this.program=null,this.shader=null},r.prototype.disposeShader=function(t){this.shader===t&&(this.shader=null)},r.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},r}();function Hl(r,t){return t===void 0&&(t=[]),t[B.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.ADD]=[r.ONE,r.ONE],t[B.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.NONE]=[0,0],t[B.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t[B.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[B.SRC_IN]=[r.DST_ALPHA,r.ZERO],t[B.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],t[B.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[B.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],t[B.DST_IN]=[r.ZERO,r.SRC_ALPHA],t[B.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t[B.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],t[B.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[B.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],t}var jl=0,Wl=1,Vl=2,Yl=3,zl=4,ql=5,$l=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=B.NONE,this._blendEq=!1,this.map=[],this.map[jl]=this.setBlend,this.map[Wl]=this.setOffset,this.map[Vl]=this.setCullFace,this.map[Yl]=this.setDepthTest,this.map[zl]=this.setFrontFace,this.map[ql]=this.setDepthMask,this.checks=[],this.defaultState=new er,this.defaultState.blend=!0}return r.prototype.contextChange=function(t){this.gl=t,this.blendModes=Hl(t),this.set(this.defaultState),this.reset()},r.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;this.stateId=t.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,t)},r.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(var e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},r.prototype.setBlend=function(t){this.updateCheck(r.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(t){this.updateCheck(r.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setDepthMask=function(t){this.gl.depthMask(t)},r.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},r.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},r.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(t,e){var i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)},r.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},r.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},r.prototype.destroy=function(){this.gl=null},r}(),Kl=function(){function r(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=P.GC_MAX_IDLE,this.checkCountMax=P.GC_MAX_CHECK_COUNT,this.mode=P.GC_MODE}return r.prototype.postrender=function(){!this.renderer.renderingToScreen||(this.count++,this.mode!==Or.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;n<e.length;n++){var s=e[n];!s.framebuffer&&this.count-s.touched>this.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){for(var a=0,n=0;n<e.length;n++)e[n]!==null&&(e[a++]=e[n]);e.length=a}},r.prototype.unload=function(t){var e=this.renderer.texture,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(var n=t.children.length-1;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<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new li(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new li(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(var i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(var i=0;i<this.boundTextures.length;i++)this.bind(null,i)},r.prototype.bind=function(t,e){e===void 0&&(e=0);var i=this.gl;if(t=t==null?void 0:t.castToBaseTexture(),t&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var n=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,n.texture)),n.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)):n.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},r.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},r.prototype.unbind=function(t){var e=this,i=e.gl,n=e.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var s=0;s<n.length;s++)n[s]===this.unknownTexture&&this.bind(null,s)}for(var s=0;s<n.length;s++)n[s]===t&&(this.currentLocation!==s&&(i.activeTexture(i.TEXTURE0+s),this.currentLocation=s),i.bindTexture(t.target,this.emptyTextures[t.target].texture),n[s]=null)},r.prototype.ensureSamplerType=function(t){var e=this,i=e.boundTextures,n=e.hasIntegerTextures,s=e.CONTEXT_UID;if(!!n)for(var a=t-1;a>=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<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)},r.prototype.createGLBuffer=function(t){var e=this,i=e.CONTEXT_UID,n=e.gl;return t._glBuffers[i]=new tf(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[i]},r}(),ta=function(r){Z(t,r);function t(e){var i=r.call(this,Ye.WEBGL,e)||this;return e=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new ot("destroy"),contextChange:new ot("contextChange"),reset:new ot("reset"),update:new ot("update"),postrender:new ot("postrender"),prerender:new ot("prerender"),resize:new ot("resize")},i.runners.contextChange.add(i),i.globalUniforms=new ve({projectionMatrix:new dt},!0),i.addSystem(Sl,"mask").addSystem(tl,"context").addSystem($l,"state").addSystem(Xl,"shader").addSystem(Ql,"texture").addSystem(ef,"buffer").addSystem(nl,"geometry").addSystem(il,"framebuffer").addSystem(Rl,"scissor").addSystem(Pl,"stencil").addSystem(Cl,"projection").addSystem(Kl,"textureGC").addSystem(Qu,"filter").addSystem(Il,"renderTexture").addSystem(Ju,"batch"),i.initPlugins(t.__plugins),i.multisample=void 0,e.context?i.context.initFromContext(e.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:e.antialias,premultipliedAlpha:i.useContextAlpha&&i.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,Oa(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return t.create=function(e){if(Ba())return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e=this.gl,i;if(this.context.webGLVersion===1){var n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),i=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{var n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),i=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}i>=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;t<this.count;t++)this.elements[t]=null;this.count=0},r}(),Di=function(){function r(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(r.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),r.prototype.view=function(t){return this[t+"View"]},r.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},r.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},r}(),nf=function(r){Z(t,r);function t(e){var i=r.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=er.for2d(),i.size=P.SPRITE_BATCH_SIZE*4,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),e.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return t.prototype.contextChange=function(){var e=this.renderer.gl;P.PREFER_ENV===zt.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),P.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=vl(this.MAX_TEXTURES,e)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var i=0;i<this._packedGeometryPoolSize;i++)this._packedGeometries[i]=new this.geometryClass;this.initFlushBuffers()},t.prototype.initFlushBuffers=function(){for(var e=t._drawCallPool,i=t._textureArrayPool,n=this.size/4,s=Math.floor(n/this.MAX_TEXTURES)+1;e.length<n;)e.push(new Ni);for(;i.length<s;)i.push(new Fi);for(var a=0;a<this.MAX_TEXTURES;a++)this._tempBoundTextures[a]=null},t.prototype.onPrerender=function(){this._flushId=0},t.prototype.render=function(e){!e._texture.valid||(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},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<this._bufferSize;++d){var p=i[d];i[d]=null,p._batchEnabled!==u&&(f.count>=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;d<o.length;d++)o[d]=null;X._globalBatch=u},t.prototype.buildDrawCalls=function(e,i,n){var s=this,a=s._bufferedElements,o=s._attributeBuffer,h=s._indexBuffer,u=s.vertexSize,l=t._drawCallPool,f=this._dcIndex,c=this._aIndex,d=this._iIndex,p=l[f];p.start=this._iIndex,p.texArray=e;for(var v=i;v<n;++v){var _=a[v],m=_._texture.baseTexture,x=Eu[m.alphaMode?1:0][_.blendMode];a[v]=null,i<v&&p.blend!==x&&(p.size=d-p.start,i=v,p=l[++f],p.texArray=e,p.start=d),this.packInterleavedGeometry(_,o,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,p.blend=x}i<n&&(p.size=d-p.start,++f),this._dcIndex=f,this._aIndex=c,this._iIndex=d},t.prototype.bindAndClearTexArray=function(e){for(var i=this.renderer.texture,n=0;n<e.count;n++)i.bind(e.elements[n],e.ids[n]),e.elements[n]=null;e.count=0},t.prototype.updateGeometry=function(){var e=this,i=e._packedGeometries,n=e._attributeBuffer,s=e._indexBuffer;P.CAN_UPLOAD_SAME_BUFFER?(i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,i[this._flushId]=new this.geometryClass),i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.bind(i[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},t.prototype.drawBatches=function(){for(var e=this._dcIndex,i=this.renderer,n=i.gl,s=i.state,a=t._drawCallPool,o=null,h=0;h<e;h++){var u=a[h],l=u.texArray,f=u.type,c=u.size,d=u.start,p=u.blend;o!==l&&(o=l,this.bindAndClearTexArray(l)),this.state.blendMode=p,s.set(this.state),n.drawElements(f,c,n.UNSIGNED_SHORT,d*2)}},t.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},t.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),P.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},t.prototype.stop=function(){this.flush()},t.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),r.prototype.destroy.call(this)},t.prototype.getAttributeBuffer=function(e){var i=Br(Math.ceil(e/8)),n=zn(i),s=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._aBuffers[s];return a||(this._aBuffers[s]=a=new Di(s*this.vertexSize*4)),a},t.prototype.getIndexBuffer=function(e){var i=Br(Math.ceil(e/12)),n=zn(i),s=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._iBuffers[n];return a||(this._iBuffers[n]=a=new Uint16Array(s)),a},t.prototype.packInterleavedGeometry=function(e,i,n,s,a){for(var o=i.uint32View,h=i.float32View,u=s/this.vertexSize,l=e.uvs,f=e.indices,c=e.vertexData,d=e._texture.baseTexture._batchLocation,p=Math.min(e.worldAlpha,1),v=p<1&&e._texture.baseTexture.alphaMode?Us(e._tintRGB,p):e._tintRGB+(p*255<<24),_=0;_<c.length;_+=2)h[s++]=c[_],h[s++]=c[_+1],h[s++]=l[_],h[s++]=l[_+1],o[s++]=v,h[s++]=d;for(var _=0;_<f.length;_++)n[a++]=u+f[_]},t._drawCallPool=[],t._textureArrayPool=[],t}(Ys),sf=function(){function r(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return r.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=ve.from({uSamplers:e},!0);var n=this.fragTemplate;n=n.replace(/%count%/gi,""+t),n=n.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new tr(this.vertexSrc,n)}var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new dt,default:this.defaultGroupCache[t]};return new zr(this.programCache[t],s)},r.prototype.generateSampleSrc=function(t){var e="";e+=`
`,e+=`
`;for(var i=0;i<t;i++)i>0&&(e+=`
else `),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+=`
{`,e+=`
color = texture2D(uSamplers[`+i+"], vTextureCoord);",e+=`
}`;return e+=`
`,e+=`
`,e},r}(),ea=function(r){Z(t,r);function t(e){e===void 0&&(e=!1);var i=r.call(this)||this;return i._buffer=new ft(null,e,!1),i._indexBuffer=new ft(null,e,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,M.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,M.FLOAT).addAttribute("aColor",i._buffer,4,!0,M.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,M.FLOAT).addIndex(i._indexBuffer),i}return t}(Yr),hs=`precision highp float;
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
attribute float aTextureId;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform vec4 tint;
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
void main(void){
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
vTextureId = aTextureId;
vColor = aColor * tint;
}
`,us=`varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
uniform sampler2D uSamplers[%count%];
void main(void){
vec4 color;
%forloop%
gl_FragColor = color * vColor;
}
`,af=function(){function r(){}return r.create=function(t){var e=Object.assign({vertex:hs,fragment:us,geometryClass:ea,vertexSize:6},t),i=e.vertex,n=e.fragment,s=e.vertexSize,a=e.geometryClass;return function(o){Z(h,o);function h(u){var l=o.call(this,u)||this;return l.shaderGenerator=new sf(i,n),l.geometryClass=a,l.vertexSize=s,l}return h}(nf)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return hs},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return us},enumerable:!1,configurable:!0}),r}(),of=af.create();Object.assign(of,{extension:{name:"batch",type:F.RendererPlugin}});/*!
* @pixi/display - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/display is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/P.SORTABLE_CHILDREN=!1;var Lr=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.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=a<e?a:e,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=t[2],o=t[3],e=a<e?a:e,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=t[4],o=t[5],e=a<e?a:e,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=t[6],o=t[7],e=a<e?a:e,i=o<i?o:i,n=a>n?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=_<c?_:c,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=a*n+h*i+l,m=o*n+u*i+f,c=_<c?_:c,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=a*e+h*s+l,m=o*e+u*s+f,c=_<c?_:c,d=m<d?m:d,p=_>p?_:p,v=m>v?m:v,_=a*n+h*s+l,m=o*n+u*s+f,c=_<c?_:c,d=m<d?m:d,p=_>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;h<i;h+=2){var u=t[h],l=t[h+1];n=u<n?u:n,s=l<s?l:s,a=u>a?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;m<n;m+=2){var x=e[m],E=e[m+1],w=o*x+u*E+f,y=l*E+h*x+c;d=Math.min(d,w-s),v=Math.max(v,w+s),p=Math.min(p,y-a),_=Math.max(_,y+a)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=_},r.prototype.addBounds=function(t){var e=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>n?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.maxX<e.maxX?t.maxX:e.maxX,a=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?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.maxX<e.x+e.width?t.maxX:e.x+e.width,a=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?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.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>n?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;n<i.length;++n){var s=i[n];Object.defineProperty(t.prototype,s,Object.getOwnPropertyDescriptor(e,s))}},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),t.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},t.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},t.prototype.getBounds=function(e,i){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new W),i=this._boundsRect),this._bounds.getRectangle(i)},t.prototype.getLocalBounds=function(e){e||(this._localBoundsRect||(this._localBoundsRect=new W),e=this._localBoundsRect),this._localBounds||(this._localBounds=new Lr);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var s=this._bounds,a=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,e);return this.parent=n,this.transform=i,this._bounds=s,this._bounds.updateID+=this._boundsID-a,o},t.prototype.toGlobal=function(e,i,n){return n===void 0&&(n=!1),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,i)},t.prototype.toLocal=function(e,i,n,s){return i&&(e=i.toGlobal(e,n,s)),s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)},t.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},t.prototype.setTransform=function(e,i,n,s,a,o,h,u,l){return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=1),a===void 0&&(a=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=e,this.position.y=i,this.scale.x=n||1,this.scale.y=s||1,this.rotation=a,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},t.prototype.destroy=function(e){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(t.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new hf),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),t.prototype.enableTempParent=function(){var e=this.parent;return this.parent=this._tempDisplayObjectParent,e},t.prototype.disableTempParent=function(e){this.parent=e},Object.defineProperty(t.prototype,"x",{get:function(){return this.position.x},set:function(e){this.transform.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.position.y},set:function(e){this.transform.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.transform.position},set:function(e){this.transform.position.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.transform.scale},set:function(e){this.transform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(e){this.transform.pivot.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skew",{get:function(){return this.transform.skew},set:function(e){this.transform.skew.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(e){this.transform.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.transform.rotation*Ru},set:function(e){this.transform.rotation=e*Pu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zIndex",{get:function(){return this._zIndex},set:function(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldVisible",{get:function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mask",{get:function(){return this._mask},set:function(e){if(this._mask!==e){if(this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount--,i._maskRefCount===0&&(i.renderable=!0,i.isMask=!1))}if(this._mask=e,this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount===0&&(i.renderable=!1,i.isMask=!0),i._maskRefCount++)}}},enumerable:!1,configurable:!0}),t}(Vr),hf=function(r){Ki(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.sortDirty=null,e}return t}(Nr);Nr.prototype.displayObjectUpdateTransform=Nr.prototype.updateTransform;function uf(r,t){return r.zIndex===t.zIndex?r._lastSortedIndex-t._lastSortedIndex:r.zIndex-t.zIndex}var me=function(r){Ki(t,r);function t(){var e=r.call(this)||this;return e.children=[],e.sortableChildren=P.SORTABLE_CHILDREN,e.sortDirty=!1,e}return t.prototype.onChildrenChange=function(e){},t.prototype.addChild=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var s=0;s<i.length;s++)this.addChild(i[s]);else{var a=i[0];a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.push(a),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",a,this,this.children.length-1),a.emit("added",this)}return i[0]},t.prototype.addChildAt=function(e,i){if(i<0||i>this.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},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<s?n:s)}},t.prototype.getChildIndex=function(e){var i=this.children.indexOf(e);if(i===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return i},t.prototype.setChildIndex=function(e,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);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;n<arguments.length;n++)i[n]=e[n];if(i.length>1)for(var s=0;s<i.length;s++)this.removeChild(i[s]);else{var a=i[0],o=this.children.indexOf(a);if(o===-1)return null;a.parent=null,a.transform._parentID=-1,je(this.children,o,1),this._boundsID++,this.onChildrenChange(o),a.emit("removed",this),this.emit("childRemoved",a,this,o)}return i[0]},t.prototype.removeChildAt=function(e){var i=this.getChildAt(e);return i.parent=null,i.transform._parentID=-1,je(this.children,e,1),this._boundsID++,this.onChildrenChange(e),i.emit("removed",this),this.emit("childRemoved",i,this,e),i},t.prototype.removeChildren=function(e,i){e===void 0&&(e=0),i===void 0&&(i=this.children.length);var n=e,s=i,a=s-n,o;if(a>0&&a<=s){o=this.children.splice(n,a);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(a===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},t.prototype.sortChildren=function(){for(var e=!1,i=0,n=this.children.length;i<n;++i){var s=this.children[i];s._lastSortedIndex=i,!e&&s.zIndex!==0&&(e=!0)}e&&this.children.length>1&&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;e<i;++e){var n=this.children[e];n.visible&&n.updateTransform()}},t.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var i=this.children[e];if(!(!i.visible||!i.renderable))if(i.calculateBounds(),i._mask){var n=i._mask.isMaskData?i._mask.maskObject:i._mask;n?(n.calculateBounds(),this._bounds.addBoundsMask(i._bounds,n._bounds)):this._bounds.addBounds(i._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._bounds.updateID=this._boundsID},t.prototype.getLocalBounds=function(e,i){i===void 0&&(i=!1);var n=r.prototype.getLocalBounds.call(this,e);if(!i)for(var s=0,a=this.children.length;s<a;++s){var o=this.children[s];o.visible&&o.updateTransform()}return n},t.prototype._calculateBounds=function(){},t.prototype._renderWithCulling=function(e){var i=e.renderTexture.sourceFrame;if(i.width>0&&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<o;++a){var h=this.children[a],u=h.cullable;h.cullable=u||!this.cullArea,h.render(e),h.cullable=u}}},t.prototype.render=function(e){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(var i=0,n=this.children.length;i<n;++i)this.children[i].render(e)}},t.prototype.renderAdvanced=function(e){var i=this.filters,n=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var s=0;s<i.length;s++)i[s].enabled&&this._enabledFilters.push(i[s])}var a=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==nt.NONE));if(a&&e.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(var s=0,o=this.children.length;s<o;++s)this.children[s].render(e)}a&&e.batch.flush(),n&&e.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},t.prototype._render=function(e){},t.prototype.destroy=function(e){r.prototype.destroy.call(this),this.sortDirty=!1;var i=typeof e=="boolean"?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(i)for(var s=0;s<n.length;++s)n[s].destroy(e)},Object.defineProperty(t.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(e){var i=this.getLocalBounds().width;i!==0?this.scale.x=e/i:this.scale.x=1,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(e){var i=this.getLocalBounds().height;i!==0?this.scale.y=e/i:this.scale.y=1,this._height=e},enumerable:!1,configurable:!0}),t}(Nr);me.prototype.containerUpdateTransform=me.prototype.updateTransform;/*!
* @pixi/sprite - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/sprite 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 Gi=function(r,t){return Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Gi(r,t)};function lf(r,t){Gi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var De=new q,ff=new Uint16Array([0,1,2,0,2,3]),ra=function(r){lf(t,r);function t(e){var i=r.call(this)||this;return i._anchor=new Ie(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=B.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||k.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=ff,i.pluginName="batch",i.isSprite=!0,i._roundPixels=P.ROUND_PIXELS,i}return t.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Ce(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Ce(this.scale.y)*this._height/this._texture.orig.height)},t.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},t.prototype.calculateVertices=function(){var e=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===e._updateID)){this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this.vertexData,f=e.trim,c=e.orig,d=this._anchor,p=0,v=0,_=0,m=0;if(f?(v=f.x-d._x*c.width,p=v+f.width,m=f.y-d._y*c.height,_=m+f.height):(v=-d._x*c.width,p=v+c.width,m=-d._y*c.height,_=m+c.height),l[0]=n*v+a*m+h,l[1]=o*m+s*v+u,l[2]=n*p+a*m+h,l[3]=o*m+s*p+u,l[4]=n*p+a*_+h,l[5]=o*_+s*p+u,l[6]=n*v+a*_+h,l[7]=o*_+s*v+u,this._roundPixels)for(var x=P.RESOLUTION,E=0;E<l.length;++E)l[E]=Math.round((l[E]*x|0)/x)}},t.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var e=this._texture,i=this.vertexTrimmedData,n=e.orig,s=this._anchor,a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=-s._x*n.width,p=d+n.width,v=-s._y*n.height,_=v+n.height;i[0]=o*d+u*v+f,i[1]=l*v+h*d+c,i[2]=o*p+u*v+f,i[3]=l*v+h*p+c,i[4]=o*p+u*_+f,i[5]=l*_+h*p+c,i[6]=o*d+u*_+f,i[7]=l*_+h*d+c},t.prototype._render=function(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)},t.prototype._calculateBounds=function(){var e=this._texture.trim,i=this._texture.orig;!e||e.width===i.width&&e.height===i.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},t.prototype.getLocalBounds=function(e){return this.children.length===0?(this._localBounds||(this._localBounds=new Lr),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new W),e=this._localBoundsRect),this._localBounds.getRectangle(e)):r.prototype.getLocalBounds.call(this,e)},t.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,De);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,a=0;return De.x>=s&&De.x<s+i&&(a=-n*this.anchor.y,De.y>=a&&De.y<a+n)},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var i=typeof e=="boolean"?e:e&&e.texture;if(i){var n=typeof e=="boolean"?e:e&&e.baseTexture;this._texture.destroy(!!n)}this._texture=null},t.from=function(e,i){var n=e instanceof k?e:k.from(e,i);return new t(n)},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,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){var i=Ce(this.scale.x)||1;this.scale.x=i*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){var i=Ce(this.scale.y)||1;this.scale.y=i*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anchor",{get:function(){return this._anchor},set:function(e){this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(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;h<i.length;++h){const{value:u,time:l}=i[h];n.next=new Ot(typeof u=="string"?_r(u):u,l),n=n.next}return o.isStepped=!!t.isStepped,o}const e=new Ot(typeof t.start=="string"?_r(t.start):t.start,0);return t.end!==t.start&&(e.next=new Ot(typeof t.end=="string"?_r(t.end):t.end,1)),e}}let Ze=k.from;const Ct=Math.PI/180;function Vt(r,t){if(!r)return;const e=Math.sin(r),i=Math.cos(r),n=t.x*i-t.y*e,s=t.x*e+t.y*i;t.x=n,t.y=s}function qr(r,t,e){return r<<16|t<<8|e}function ia(r){return Math.sqrt(r.x*r.x+r.y*r.y)}function cf(r){const t=1/ia(r);r.x*=t,r.y*=t}function na(r,t){r.x*=t,r.y*=t}function _r(r,t){t||(t={}),r.charAt(0)==="#"?r=r.substr(1):r.indexOf("0x")===0&&(r=r.substr(2));let e;return r.length===8&&(e=r.substr(0,2),r=r.substr(2)),t.r=parseInt(r.substr(0,2),16),t.g=parseInt(r.substr(2,2),16),t.b=parseInt(r.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function sa(r){const t=r.length,e=1/t;return function(i){const n=t*i|0,s=(i-n*e)*t,a=r[n]||r[t-1];return a.s+s*(2*(1-s)*(a.cp-a.s)+s*(a.e-a.s))}}function df(r){return r?(r=r.toUpperCase().replace(/ /g,"_"),B[r]||B.NORMAL):B.NORMAL}class ci extends ra{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var K;(function(r){r[r.Spawn=0]="Spawn",r[r.Normal=2]="Normal",r[r.Late=5]="Late"})(K||(K={}));const di=Xt.shared,se=Symbol("Position particle per emitter position");class ${constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new q,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new q,this._prevEmitterPos=new q,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){$.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?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;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Vt(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?di.remove(this.update,this):!this._autoUpdate&&t&&di.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=di.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.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<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const n=this.ownerPos.x+this.spawnPos.x,s=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let 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<l;++f){if(this.spawnChance<1&&Math.random()>=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.initBehaviors.length;++l){const f=this.initBehaviors[l];if(f===se)for(let c=h,d;c;c=d){d=c.next,this.rotation!==0&&(Vt(this.rotation,c.position),c.rotation+=this.rotation),c.position.x+=a,c.position.y+=o,c.age+=-this._spawnTimer;let p=c.age*c.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),c.agePercent=p}else f.initParticles(h)}for(let l=h,f;l;l=f){f=l.next;for(let c=0;c<this.updateBehaviors.length;++c)if(this.updateBehaviors[c].updateParticle(l,-this._spawnTimer)){this.recycle(l);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=n,this._prevEmitterPos.y=s,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,n=null;for(let s=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<s;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new 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;s<this.initBehaviors.length;++s){const a=this.initBehaviors[s];if(a===se)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Vt(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}$.knownBehaviors={};class Zi{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}Zi.type="rect";Zi.editorConfig=null;class $r{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Vt(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}$r.type="torus";$r.editorConfig=null;class Qi{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let n=i[0];for(let s=1;s<i.length;++s){const a=i[s];this.segments.push({p1:n,p2:a,l:0}),n=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const n=t[i];this.segments.push({p1:e,p2:n,l:0}),e=n}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:n}=this.segments[e],s=Math.sqrt((n.x-i.x)*(n.x-i.x)+(n.y-i.y)*(n.y-i.y));this.segments[e].l=s,this.totalLength+=s,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,n;if(this.segments.length===1)i=this.segments[0],n=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],n=o===0?e:e-this.countingLengths[o-1];break}n/=i.l||1;const{p1:s,p2:a}=i;t.x=s.x+n*(a.x-s.x),t.y=s.y+n*(a.y-s.y)}}Qi.type="polygonalChain";Qi.editorConfig=null;class Ji{constructor(t){var e;this.order=K.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new q(i,0),Vt(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,n=i.x,s=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=ia(i);a>this.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;e<r.length;++e){let i=r[e];if(typeof i=="string")t.push(Ze(i));else if(i instanceof k)t.push(i);else{let n=i.count||1;for(typeof i.texture=="string"?i=Ze(i.texture):i=i.texture;n>0;--n)t.push(i)}}return t}class rn{constructor(t){this.order=K.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],n=aa(i.textures),s=i.framerate<0?-1:i.framerate>0?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;A<t.length;++A)t[A].framerate==="matchLife"&&(t[A].framerate=-1);g.behaviors.push({type:"animatedRandom",config:{anims:t}})}else typeof t!="string"&&"framerate"in t?(t.framerate==="matchLife"&&(t.framerate=-1),g.behaviors.push({type:"animatedSingle",config:{anim:t}})):r.orderedArt&&Array.isArray(t)?g.behaviors.push({type:"textureOrdered",config:{textures:t}}):Array.isArray(t)?g.behaviors.push({type:"textureRandom",config:{textures:t}}):g.behaviors.push({type:"textureSingle",config:{texture:t}});if(r.spawnType==="burst")g.behaviors.push({type:"spawnBurst",config:{start:r.angleStart||0,spacing:r.particleSpacing,distance:0}});else if(r.spawnType==="point")g.behaviors.push({type:"spawnPoint",config:{}});else{let A;r.spawnType==="ring"?A={type:"torus",data:{x:r.spawnCircle.x,y:r.spawnCircle.y,radius:r.spawnCircle.r,innerRadius:r.spawnCircle.minR,affectRotation:!0}}:r.spawnType==="circle"?A={type:"torus",data:{x:r.spawnCircle.x,y:r.spawnCircle.y,radius:r.spawnCircle.r,innerRadius:0,affectRotation:!1}}:r.spawnType==="rect"?A={type:"rect",data:r.spawnRect}:r.spawnType==="polygonalChain"&&(A={type:"polygonalChain",data:r.spawnPolygon}),A&&g.behaviors.push({type:"spawnShape",config:A})}return g}$.registerBehavior(Ji);$.registerBehavior(tn);$.registerBehavior(en);$.registerBehavior(rn);$.registerBehavior(nn);$.registerBehavior(sn);$.registerBehavior(an);$.registerBehavior(on);$.registerBehavior(hn);$.registerBehavior(un);$.registerBehavior(ln);$.registerBehavior(fn);$.registerBehavior(cn);$.registerBehavior(dn);$.registerBehavior(pn);$.registerBehavior(vn);$.registerBehavior(_n);$.registerBehavior(mn);$.registerBehavior(wt);$.registerBehavior(gn);$.registerBehavior(yn);$.registerBehavior(bn);/*!
* @pixi/app - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/app is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Ef=function(){function r(){}return r.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){!e._resizeTo||(e.cancelResize(),e._resizeId=requestAnimationFrame(function(){return e.resize()}))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(!!e._resizeTo){e.cancelResize();var i,n;if(e._resizeTo===globalThis.window)i=globalThis.innerWidth,n=globalThis.innerHeight;else{var s=e._resizeTo,a=s.clientWidth,o=s.clientHeight;i=a,n=o}e.renderer.resize(i,n)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},r.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},r.extension=F.Application,r}(),Tf=function(){function r(t){var e=this;this.stage=new me,t=Object.assign({forceCanvas:!1},t),this.renderer=rf(t),r._plugins.forEach(function(i){i.init.call(e,t)})}return r.registerPlugin=function(t){Mt("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),At.add({type:F.Application,ref:t})},r.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(r.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),r.prototype.destroy=function(t,e){var i=this,n=r._plugins.slice(0);n.reverse(),n.forEach(function(s){s.destroy.call(i)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null},r._plugins=[],r}();At.handleByList(F.Application,Tf._plugins);At.add(Ef);/*!
* @pixi/loaders - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/loaders is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var mr=function(){function r(t,e,i){e===void 0&&(e=!1),this._fn=t,this._once=e,this._thisArg=i,this._next=this._prev=this._owner=null}return r.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},r}();function ls(r,t){return r._head?(r._tail._next=t,t._prev=r._tail,r._tail=t):(r._head=t,r._tail=t),t._owner=r,t}var jt=function(){function r(){this._head=this._tail=void 0}return r.prototype.handlers=function(t){t===void 0&&(t=!1);var e=this._head;if(t)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i},r.prototype.has=function(t){if(!(t instanceof mr))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},r.prototype.dispatch=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,e),n=n._next;return!0},r.prototype.add=function(t,e){if(e===void 0&&(e=null),typeof t!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return ls(this,new mr(t,!1,e))},r.prototype.once=function(t,e){if(e===void 0&&(e=null),typeof t!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return ls(this,new mr(t,!0,e))},r.prototype.detach=function(t){if(!(t instanceof mr))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this?this:(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,t._next===null&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null,this)},r.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},r}();function ha(r,t){t=t||{};for(var e={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=e.parser[t.strictMode?"strict":"loose"].exec(r),n={},s=14;s--;)n[e.key[s]]=i[s]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(a,o,h){o&&(n[e.q.name][o]=h)}),n}var pi,gr=null,wf=0,fs=200,Af=204,Sf=1223,Rf=2;function cs(){}function ds(r,t,e){t&&t.indexOf(".")===0&&(t=t.substring(1)),t&&(r[t]=e)}function vi(r){return r.toString().replace("object ","")}var J=function(){function r(t,e,i){if(this._dequeue=cs,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof t!="string"||typeof e!="string")throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(r.STATUS_FLAGS.DATA_URL,e.indexOf("data:")===0),this.name=t,this.url=e,this.extension=this._getExtension(),this.data=null,this.crossOrigin=i.crossOrigin===!0?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=r.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=cs,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new jt,this.onProgress=new jt,this.onComplete=new jt,this.onAfterMiddleware=new jt}return r.setExtensionLoadType=function(t,e){ds(r._loadTypeMap,t,e)},r.setExtensionXhrType=function(t,e){ds(r._xhrTypeMap,t,e)},Object.defineProperty(r.prototype,"isDataUrl",{get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isComplete",{get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),r.prototype.complete=function(){this._clearEvents(),this._finish()},r.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=r.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},r.prototype.load=function(t){var e=this;if(!this.isLoading){if(this.isComplete){t&&setTimeout(function(){return t(e)},1);return}else t&&this.onComplete.once(t);switch(this._setFlag(r.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case r.LOAD_TYPE.IMAGE:this.type=r.TYPE.IMAGE,this._loadElement("image");break;case r.LOAD_TYPE.AUDIO:this.type=r.TYPE.AUDIO,this._loadSourceElement("audio");break;case r.LOAD_TYPE.VIDEO:this.type=r.TYPE.VIDEO,this._loadSourceElement("video");break;case r.LOAD_TYPE.XHR:default:typeof pi=="undefined"&&(pi=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),pi&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(t){return(this._flags&t)!==0},r.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:t==="image"&&typeof globalThis.Image!="undefined"?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:t==="audio"&&typeof globalThis.Audio!="undefined"?this.data=new Audio:this.data=document.createElement(t),this.data===null){this.abort("Unsupported element: "+t);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else{var e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(t.withCredentials=!0),t.open("GET",this.url,!0),t.timeout=this.timeout,this.xhrType===r.XHR_RESPONSE_TYPE.JSON||this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=r.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("timeout",this._boundXhrOnTimeout,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},r.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},r.prototype._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var n=document.createElement("source");return n.src=e,n.type=i,n},r.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},r.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},r.prototype._onTimeout=function(){this.abort("Load timed out.")},r.prototype._xhrOnError=function(){var t=this.xhr;this.abort(vi(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},r.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(vi(t)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(vi(t)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var t=this.xhr,e="",i=typeof t.status=="undefined"?fs:t.status;(t.responseType===""||t.responseType==="text"||typeof t.responseType=="undefined")&&(e=t.responseText),i===wf&&(e.length>0||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<arguments.length;n++)i[n]=e[n];if(r===null)throw new Error("Callback was already called.");var s=r;r=null,s.apply(this,i)}}var Cf=function(){function r(t,e){this.data=t,this.callback=e}return r}(),_i=function(){function r(t,e){var i=this;if(e===void 0&&(e=1),this.workers=0,this.saturated=ae,this.unsaturated=ae,this.empty=ae,this.drain=ae,this.error=ae,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,s,a){if(a&&typeof a!="function")throw new Error("task callback must be a function");if(i.started=!0,n==null&&i.idle()){setTimeout(function(){return i.drain()},1);return}var o=new Cf(n,typeof a=="function"?a:ae);s?i._tasks.unshift(o):i._tasks.push(o),setTimeout(i.process,1)},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var n=i._tasks.shift();i._tasks.length===0&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(n.data,Pf(i._next(n)))}},this._worker=t,e===0)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return r.prototype._next=function(t){var e=this;return function(){for(var i=arguments,n=[],s=0;s<arguments.length;s++)n[s]=i[s];e.workers-=1,t.callback.apply(t,n),n[0]!=null&&e.error(n[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},r.prototype.push=function(t,e){this._insert(t,!1,e)},r.prototype.kill=function(){this.workers=0,this.drain=ae,this.started=!1,this._tasks=[]},r.prototype.unshift=function(t,e){this._insert(t,!0,e)},r.prototype.length=function(){return this._tasks.length},r.prototype.running=function(){return this.workers},r.prototype.idle=function(){return this._tasks.length+this.workers===0},r.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},r.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},r.eachSeries=function(t,e,i,n){var s=0,a=t.length;function o(h){if(h||s===a){i&&i(h);return}n?setTimeout(function(){e(t[s++],o)},1):e(t[s++],o)}o()},r.queue=function(t,e){return new r(t,e)},r}(),mi=100,If=/(#[\w-]+)?$/,Fr=function(){function r(t,e){var i=this;t===void 0&&(t=""),e===void 0&&(e=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this.resources={},this.baseUrl=t,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this._queue=_i.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new jt,this.onError=new jt,this.onLoad=new jt,this.onStart=new jt,this.onComplete=new jt;for(var n=0;n<r._plugins.length;++n){var s=r._plugins[n],a=s.pre,o=s.use;a&&this.pre(a),o&&this.use(o)}this._protected=!1}return r.prototype._add=function(t,e,i,n){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new J(t,e,i),typeof n=="function"&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,a=[],o=0;o<s.children.length;++o)s.children[o].isComplete||a.push(s.children[o]);var h=s.progressChunk*(a.length+1),u=h/(a.length+2);s.children.push(this.resources[t]),s.progressChunk=u;for(var o=0;o<a.length;++o)a[o].progressChunk=u;this.resources[t].progressChunk=u}return this._queue.push(this.resources[t]),this},r.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},r.prototype.use=function(t){return this._afterMiddleware.push(t),this},r.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var t in this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},r.prototype.load=function(t){if(Mt("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),typeof t=="function"&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=this._queue._tasks.length,i=mi/e,n=0;n<this._queue._tasks.length;++n)this._queue._tasks[n].data.progressChunk=i;this._onStart(),this._queue.resume()}return this},Object.defineProperty(r.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),r.prototype._prepareUrl=function(t){var e=ha(t,{strictMode:!0}),i;if(e.protocol||!e.path||t.indexOf("//")===0?i=t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&t.charAt(0)!=="/"?i=this.baseUrl+"/"+t:i=this.baseUrl+t,this.defaultQueryString){var n=If.exec(i)[0];i=i.slice(0,i.length-n.length),i.indexOf("?")!==-1?i+="&"+this.defaultQueryString:i+="?"+this.defaultQueryString,i+=n}return i},r.prototype._loadResource=function(t,e){var i=this;t._dequeue=e,_i.eachSeries(this._beforeMiddleware,function(n,s){n.call(i,t,function(){s(t.isComplete?{}:null)})},function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())},!0)},r.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},r.prototype._onComplete=function(){this.progress=mi,this.loading=!1,this.onComplete.dispatch(this,this.resources)},r.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),_i.eachSeries(this._afterMiddleware,function(i,n){i.call(e,t,n)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(mi,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&e._resourcesParsing.length===0&&e._onComplete()},!0)},r.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(r,"shared",{get:function(){var t=r._shared;return t||(t=new r,t._protected=!0,r._shared=t),t},enumerable:!1,configurable:!0}),r.registerPlugin=function(t){return Mt("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),At.add({type:F.Loader,ref:t}),r},r._plugins=[],r}();At.handleByList(F.Loader,Fr._plugins);Fr.prototype.add=function(t,e,i,n){if(Array.isArray(t)){for(var s=0;s<t.length;++s)this.add(t[s]);return this}if(typeof t=="object"&&(i=t,n=e||i.callback||i.onComplete,e=i.url,t=i.name||i.key||i.url),typeof e!="string"&&(n=i,i=e,e=t),typeof e!="string")throw new Error("No url passed to add resource to loader.");return typeof i=="function"&&(n=i,i=null),this._add(t,e,i,n)};(function(){function r(){}return r.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Fr.shared:new Fr},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=F.Application,r})();var Of=function(){function r(){}return r.add=function(){J.setExtensionLoadType("svg",J.LOAD_TYPE.XHR),J.setExtensionXhrType("svg",J.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){if(t.data&&(t.type===J.TYPE.IMAGE||t.extension==="svg")){var i=t.data,n=t.url,s=t.name,a=t.metadata;k.fromLoader(i,n,s,a).then(function(o){t.texture=o,e()}).catch(e)}else e()},r.extension=F.Loader,r}(),Bf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Mf(r){for(var t="",e=0;e<r.length;){for(var i=[0,0,0],n=[0,0,0,0],s=0;s<i.length;++s)e<r.length?i[s]=r.charCodeAt(e++)&255:i[s]=0;n[0]=i[0]>>2,n[1]=(i[0]&3)<<4|i[1]>>4,n[2]=(i[1]&15)<<2|i[2]>>6,n[3]=i[2]&63;var 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;s<n.length;++s)t+=Bf.charAt(n[s])}return t}function Lf(r,t){if(!r.data){t();return}if(r.xhr&&r.xhrType===J.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof r.data=="string"){var e=r.xhr.getResponseHeader("content-type");if(e&&e.indexOf("image")===0){r.data=new Image,r.data.src="data:"+e+";base64,"+Mf(r.xhr.responseText),r.type=J.TYPE.IMAGE,r.data.onload=function(){r.data.onload=null,t()};return}}else if(r.data.type.indexOf("image")===0){var i=globalThis.URL||globalThis.webkitURL,n=i.createObjectURL(r.data);r.blob=r.data,r.data=new Image,r.data.src=n,r.type=J.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,t()};return}}t()}var Nf=function(){function r(){}return r.extension=F.Loader,r.use=Lf,r}();At.add(Of,Nf);/*!
* @pixi/spritesheet - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/spritesheet is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var xn=function(){function r(t,e,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=t instanceof k?t:null,this.baseTexture=t instanceof X?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return r.prototype._updateResolution=function(t){t===void 0&&(t=null);var e=this.data.meta.scale,i=te(t,null);return i===null&&(i=e!==void 0?parseFloat(e):1),i!==1&&this.baseTexture.setResolution(i),i},r.prototype.parse=function(t){var e=this;return t&&Mt("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise(function(i){e._callback=function(n){t==null||t(n),i(n)},e._batchIndex=0,e._frameKeys.length<=r.BATCH_SIZE?(e._processFrames(0),e._processAnimations(),e._parseComplete()):e._nextBatch()})},r.prototype._processFrames=function(t){for(var e=t,i=r.BATCH_SIZE;e-t<i&&e<this._frameKeys.length;){var n=this._frameKeys[e],s=this._frames[n],a=s.frame;if(a){var o=null,h=null,u=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,l=new W(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?o=new W(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):o=new W(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new W(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[n]=new k(this.baseTexture,o,l,h,s.rotated?2:0,s.anchor),k.addToCache(this.textures[n],n)}e++}},r.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var i=0;i<t[e].length;i++){var n=t[e][i];this.animations[e].push(this.textures[n])}}},r.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},r.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*r.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},r.prototype.destroy=function(t){var e;t===void 0&&(t=!1);for(var i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((e=this._texture)===null||e===void 0||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r}();(function(){function r(){}return r.use=function(t,e){var i,n,s=this,a=t.name+"_image";if(!t.data||t.type!==J.TYPE.JSON||!t.data.frames||s.resources[a]){e();return}var o=(n=(i=t.data)===null||i===void 0?void 0:i.meta)===null||n===void 0?void 0:n.related_multi_packs;if(Array.isArray(o))for(var h=function(p){if(typeof p!="string")return"continue";var v=p.replace(".json",""),_=Pe.resolve(t.url.replace(s.baseUrl,""),p);if(s.resources[v]||Object.values(s.resources).some(function(x){return Pe.format(Pe.parse(x.url))===_}))return"continue";var m={crossOrigin:t.crossOrigin,loadType:J.LOAD_TYPE.XHR,xhrType:J.XHR_RESPONSE_TYPE.JSON,parentResource:t,metadata:t.metadata};s.add(v,_,m)},u=0,l=o;u<l.length;u++){var f=l[u];h(f)}var c={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},d=r.getResourcePath(t,s.baseUrl);s.add(a,d,c,function(v){if(v.error){e(v.error);return}var _=new xn(v.texture,t.data,t.url);_.parse().then(function(){t.spritesheet=_,t.textures=_.textures,e()})})},r.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:Pe.resolve(t.url.replace(e,""),t.data.meta.image)},r.extension=F.Loader,r})();/*!
* @pixi/compressed-textures - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/compressed-textures is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var z,L;(function(r){r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"})(L||(L={}));var Dr=(z={},z[L.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,z[L.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,z[L.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,z[L.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,z[L.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,z[L.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,z[L.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,z[L.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,z[L.COMPRESSED_R11_EAC]=.5,z[L.COMPRESSED_SIGNED_R11_EAC]=.5,z[L.COMPRESSED_RG11_EAC]=1,z[L.COMPRESSED_SIGNED_RG11_EAC]=1,z[L.COMPRESSED_RGB8_ETC2]=.5,z[L.COMPRESSED_RGBA8_ETC2_EAC]=1,z[L.COMPRESSED_SRGB8_ETC2]=.5,z[L.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,z[L.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[L.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[L.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,z[L.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,z[L.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,z[L.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,z[L.COMPRESSED_RGB_ETC1_WEBGL]=.5,z[L.COMPRESSED_RGB_ATC_WEBGL]=.5,z[L.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,z[L.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,z[L.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,z);/*! *****************************************************************************
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 ki=function(r,t){return ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},ki(r,t)};function ua(r,t){ki(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ff(r,t,e,i){function n(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(l){try{u(i.next(l))}catch(f){a(f)}}function h(l){try{u(i.throw(l))}catch(f){a(f)}}function u(l){l.done?s(l.value):n(l.value).then(o,h)}u((i=i.apply(r,t||[])).next())})}function Df(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Uf=function(r){ua(t,r);function t(e,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,s,a;return typeof e=="string"?(s=e,a=new Uint8Array):(s=null,a=e),n=r.call(this,a,i)||this,n.origin=s,n.buffer=a?new Di(a):null,n.origin&&i.autoLoad!==!1&&n.load(),a&&a.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return Ff(this,void 0,Promise,function(){var e,i,n;return Df(this,function(s){switch(s.label){case 0:return[4,fetch(this.origin)];case 1:return e=s.sent(),[4,e.blob()];case 2:return i=s.sent(),[4,i.arrayBuffer()];case 3:return n=s.sent(),this.data=new Uint32Array(n),this.buffer=new Di(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},t}(_e),ge=function(r){ua(t,r);function t(e,i){var n=r.call(this,e,i)||this;return n.format=i.format,n.levels=i.levels||1,n._width=i.width,n._height=i.height,n._extension=t._formatToExtension(n.format),(i.levelBuffers||n.buffer)&&(n._levelBuffers=i.levelBuffers||t._createLevelBuffers(e instanceof Uint8Array?e:n.buffer.uint8View,n.format,n.levels,4,4,n.width,n.height)),n}return t.prototype.upload=function(e,i,n){var s=e.gl,a=e.context.extensions[this._extension];if(!a)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,h=this.levels;o<h;o++){var u=this._levelBuffers[o],l=u.levelID,f=u.levelWidth,c=u.levelHeight,d=u.levelBuffer;s.compressedTexImage2D(s.TEXTURE_2D,l,this.format,f,c,0,d)}return!0},t.prototype.onBlobLoaded=function(){this._levelBuffers=t._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},t._formatToExtension=function(e){if(e>=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},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;_<n;_++)u[_]={levelID:_,levelWidth:n>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<u;h++){var l=s[h],f=l.src,c=l.format;if(c||(o=f),r.textureFormats[c]){a=f;break}}if(a=a||o,!a){e(new Error("Cannot load compressed-textures in "+t.url+", make sure you provide a fallback"));return}if(a===t.url){e(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var d={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},p=Pe.resolve(t.url.replace(n.baseUrl,""),a),v=i.cacheID;n.add(v,p,d,function(_){if(_.error){e(_.error);return}var m=_.texture,x=m===void 0?null:m,E=_.textures,w=E===void 0?{}:E;Object.assign(t,{texture:x,textures:w}),e()})}else e()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var t=P.ADAPTER.createCanvas(),e=t.getContext("webgl");if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var i={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};r._textureExtensions=i}return r._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(r,"textureFormats",{get:function(){if(!r._textureFormats){var t=r.textureExtensions;r._textureFormats={};for(var e in t){var i=t[e];!i||Object.assign(r._textureFormats,Object.getPrototypeOf(i))}}return r._textureFormats},enumerable:!1,configurable:!0}),r.extension=F.Loader,r})();function la(r,t,e){var i={textures:{},texture:null};if(!t)return i;var n=t.map(function(s){return new k(new X(s,Object.assign({mipmap:ut.OFF,alphaMode:ct.NO_PREMULTIPLIED_ALPHA},e)))});return n.forEach(function(s,a){var o=s.baseTexture,h=r+"-"+(a+1);X.addToCache(o,h),k.addToCache(s,h),a===0&&(X.addToCache(o,r),k.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Ue,bt,gi=4,yr=124,Gf=32,ps=20,kf=542327876,br={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},Xf={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},xr={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Et;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(Et||(Et={}));var Xi;(function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(Xi||(Xi={}));var Hf=1,jf=2,Wf=4,Vf=64,Yf=512,zf=131072,qf=827611204,$f=861165636,Kf=894720068,Zf=808540228,Qf=4,Jf=(Ue={},Ue[qf]=L.COMPRESSED_RGBA_S3TC_DXT1_EXT,Ue[$f]=L.COMPRESSED_RGBA_S3TC_DXT3_EXT,Ue[Kf]=L.COMPRESSED_RGBA_S3TC_DXT5_EXT,Ue),tc=(bt={},bt[Et.DXGI_FORMAT_BC1_TYPELESS]=L.COMPRESSED_RGBA_S3TC_DXT1_EXT,bt[Et.DXGI_FORMAT_BC1_UNORM]=L.COMPRESSED_RGBA_S3TC_DXT1_EXT,bt[Et.DXGI_FORMAT_BC2_TYPELESS]=L.COMPRESSED_RGBA_S3TC_DXT3_EXT,bt[Et.DXGI_FORMAT_BC2_UNORM]=L.COMPRESSED_RGBA_S3TC_DXT3_EXT,bt[Et.DXGI_FORMAT_BC3_TYPELESS]=L.COMPRESSED_RGBA_S3TC_DXT5_EXT,bt[Et.DXGI_FORMAT_BC3_UNORM]=L.COMPRESSED_RGBA_S3TC_DXT5_EXT,bt[Et.DXGI_FORMAT_BC1_UNORM_SRGB]=L.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,bt[Et.DXGI_FORMAT_BC2_UNORM_SRGB]=L.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,bt[Et.DXGI_FORMAT_BC3_UNORM_SRGB]=L.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,bt);function fa(r){var t=new Uint32Array(r),e=t[0];if(e!==kf)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,yr/Uint32Array.BYTES_PER_ELEMENT),n=i[br.HEIGHT],s=i[br.WIDTH],a=i[br.MIPMAP_COUNT],o=new Uint32Array(r,br.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Gf/Uint32Array.BYTES_PER_ELEMENT),h=o[Hf];if(h&Wf){var u=o[Xf.FOURCC];if(u!==Zf){var l=Jf[u],f=gi+yr,c=new Uint8Array(r,f),d=new ge(c,{format:l,width:s,height:n,levels:a});return[d]}var p=gi+yr,v=new Uint32Array(t.buffer,p,ps/Uint32Array.BYTES_PER_ELEMENT),_=v[xr.DXGI_FORMAT],m=v[xr.RESOURCE_DIMENSION],x=v[xr.MISC_FLAG],E=v[xr.ARRAY_SIZE],w=tc[_];if(w===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(x===Qf)throw new Error("DDSParser does not support cubemap textures");if(m===Xi.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var y=new Array,b=gi+yr+ps;if(E===1)y.push(new Uint8Array(r,b));else{for(var g=Dr[w],A=0,T=s,R=n,O=0;O<a;O++){var D=Math.max(1,T+3&-4),j=Math.max(1,R+3&-4),et=D*j*g;A+=et,T=T>>>1,R=R>>>1}for(var C=b,O=0;O<E;O++)y.push(new Uint8Array(r,C,A)),C+=A}return y.map(function(I){return new ge(I,{format:w,width:s,height:n,levels:a})})}throw h&Vf?new Error("DDSParser does not support uncompressed texture data."):h&Yf?new Error("DDSParser does not supported YUV uncompressed texture data."):h&zf?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&jf?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}var Zt,Ft,Ge,vs=[171,75,84,88,32,49,49,187,13,10,26,10],ec=67305985,xt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Hi=64,_s=(Zt={},Zt[M.UNSIGNED_BYTE]=1,Zt[M.UNSIGNED_SHORT]=2,Zt[M.INT]=4,Zt[M.UNSIGNED_INT]=4,Zt[M.FLOAT]=4,Zt[M.HALF_FLOAT]=8,Zt),rc=(Ft={},Ft[S.RGBA]=4,Ft[S.RGB]=3,Ft[S.RG]=2,Ft[S.RED]=1,Ft[S.LUMINANCE]=1,Ft[S.LUMINANCE_ALPHA]=2,Ft[S.ALPHA]=1,Ft),ic=(Ge={},Ge[M.UNSIGNED_SHORT_4_4_4_4]=2,Ge[M.UNSIGNED_SHORT_5_5_5_1]=2,Ge[M.UNSIGNED_SHORT_5_6_5]=2,Ge);function ca(r,t,e){e===void 0&&(e=!1);var i=new DataView(t);if(!nc(r,i))return null;var n=i.getUint32(xt.ENDIANNESS,!0)===ec,s=i.getUint32(xt.GL_TYPE,n),a=i.getUint32(xt.GL_FORMAT,n),o=i.getUint32(xt.GL_INTERNAL_FORMAT,n),h=i.getUint32(xt.PIXEL_WIDTH,n),u=i.getUint32(xt.PIXEL_HEIGHT,n)||1,l=i.getUint32(xt.PIXEL_DEPTH,n)||1,f=i.getUint32(xt.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(xt.NUMBER_OF_FACES,n),d=i.getUint32(xt.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(xt.BYTES_OF_KEY_VALUE_DATA,n);if(u===0||l!==1)throw new Error("Only 2D textures are supported");if(c!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(f!==1)throw new Error("WebGL does not support array textures");var v=4,_=4,m=h+3&-4,x=u+3&-4,E=new Array(f),w=h*u;s===0&&(w=m*x);var y;if(s!==0?_s[s]?y=_s[s]*rc[a]:y=ic[s]:y=Dr[o],y===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var b=e?ac(i,p,n):null,g=w*y,A=g,T=h,R=u,O=m,D=x,j=Hi+p,et=0;et<d;et++){for(var C=i.getUint32(j,n),I=j+4,H=0;H<f;H++){var lt=E[H];lt||(lt=E[H]=new Array(d)),lt[et]={levelID:et,levelWidth:d>1||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;e<vs.length;e++)if(t.getUint8(e)!==vs[e])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function sc(r){switch(r){case S.RGBA:return S.RGBA_INTEGER;case S.RGB:return S.RGB_INTEGER;case S.RG:return S.RG_INTEGER;case S.RED:return S.RED_INTEGER;default:return r}}function ac(r,t,e){for(var i=new Map,n=0;n<t;){var s=r.getUint32(Hi+n,e),a=Hi+n+4,o=3-(s+3)%4;if(s===0||s>t-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h<s&&r.getUint8(a+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var u=new TextDecoder().decode(new Uint8Array(r.buffer,a,h)),l=new DataView(r.buffer,a+h+1,s-h-1);i.set(u,l),n+=4+s+o}return i}J.setExtensionXhrType("dds",J.XHR_RESPONSE_TYPE.BUFFER);(function(){function r(){}return r.use=function(t,e){if(t.extension==="dds"&&t.data)try{Object.assign(t,la(t.name||t.url,fa(t.data),t.metadata))}catch(i){e(i);return}e()},r.extension=F.Loader,r})();J.setExtensionXhrType("ktx",J.XHR_RESPONSE_TYPE.BUFFER);(function(){function r(){}return r.use=function(t,e){if(t.extension==="ktx"&&t.data)try{var i=t.name||t.url,n=ca(i,t.data,this.loadKeyValueData),s=n.compressed,a=n.uncompressed,o=n.kvData;if(s){var h=la(i,s,t.metadata);if(o&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=o;Object.assign(t,h)}else if(a){var l={};a.forEach(function(f,c){var d=new k(new X(f.resource,{mipmap:ut.OFF,alphaMode:ct.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),p=i+"-"+(c+1);o&&(d.baseTexture.ktxKeyValueData=o),X.addToCache(d.baseTexture,p),k.addToCache(d,p),c===0&&(l[i]=d,X.addToCache(d.baseTexture,i),k.addToCache(d,i)),l[p]=d}),Object.assign(t,{textures:l})}}catch(f){e(f);return}e()},r.extension=F.Loader,r.loadKeyValueData=!1,r})();/*!
* @pixi/basis - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/basis 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.
***************************************************************************** */function Ur(r,t,e,i){function n(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(l){try{u(i.next(l))}catch(f){a(f)}}function h(l){try{u(i.throw(l))}catch(f){a(f)}}function u(l){l.done?s(l.value):n(l.value).then(o,h)}u((i=i.apply(r,t||[])).next())})}function Gr(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Dt,ke,Xe,st;(function(r){r[r.cTFETC1=0]="cTFETC1",r[r.cTFETC2=1]="cTFETC2",r[r.cTFBC1=2]="cTFBC1",r[r.cTFBC3=3]="cTFBC3",r[r.cTFBC4=4]="cTFBC4",r[r.cTFBC5=5]="cTFBC5",r[r.cTFBC7=6]="cTFBC7",r[r.cTFPVRTC1_4_RGB=8]="cTFPVRTC1_4_RGB",r[r.cTFPVRTC1_4_RGBA=9]="cTFPVRTC1_4_RGBA",r[r.cTFASTC_4x4=10]="cTFASTC_4x4",r[r.cTFATC_RGB=11]="cTFATC_RGB",r[r.cTFATC_RGBA_INTERPOLATED_ALPHA=12]="cTFATC_RGBA_INTERPOLATED_ALPHA",r[r.cTFRGBA32=13]="cTFRGBA32",r[r.cTFRGB565=14]="cTFRGB565",r[r.cTFBGR565=15]="cTFBGR565",r[r.cTFRGBA4444=16]="cTFRGBA4444"})(st||(st={}));var kr=(Dt={},Dt[st.cTFETC1]=L.COMPRESSED_RGB_ETC1_WEBGL,Dt[st.cTFBC1]=L.COMPRESSED_RGB_S3TC_DXT1_EXT,Dt[st.cTFBC3]=L.COMPRESSED_RGBA_S3TC_DXT5_EXT,Dt[st.cTFPVRTC1_4_RGB]=L.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,Dt[st.cTFPVRTC1_4_RGBA]=L.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,Dt[st.cTFATC_RGB]=L.COMPRESSED_RGB_ATC_WEBGL,Dt[st.cTFASTC_4x4]=L.COMPRESSED_RGBA_ASTC_4x4_KHR,Dt),da=(ke={},ke[st.cTFRGBA32]=M.UNSIGNED_BYTE,ke[st.cTFRGB565]=M.UNSIGNED_SHORT_5_6_5,ke[st.cTFRGBA4444]=M.UNSIGNED_SHORT_4_4_4_4,ke),oc=Object.keys(kr).map(function(r){return Number(r)}).reduce(function(r,t){return r[kr[t]]=t,r},{}),ms=(Xe={},Xe[st.cTFBC3]=!0,Xe[st.cTFPVRTC1_4_RGBA]=!0,Xe[st.cTFASTC_4x4]=!0,Xe);function hc(){var r,t={init:function(e){return self.BASIS?(self.BASIS({wasmBinary:e.wasmSource}).then(function(i){i.initializeBasis(),r=i,self.postMessage({type:"init",success:!0})}),null):(console.warn("jsSource was not prepended?"),{type:"init",success:!1})},transcode:function(e){var i=e.basisData,n=r,s=i,a=new n.BasisFile(s),o=a.getNumImages(),h=a.getHasAlpha(),u=h?e.rgbaFormat:e.rgbFormat,l=14,f=new Array(o),c=!1;if(!a.startTranscoding())return a.close(),a.delete(),{type:"transcode",requestID:e.requestID,success:!1,imageArray:null};for(var d=0;d<o;d++){for(var p=a.getNumLevels(d),v={imageID:d,levelArray:new Array,width:null,height:null},_=0;_<p;_++){var m=c?l:u,x=a.getImageWidth(d,_),E=a.getImageHeight(d,_),w=a.getImageTranscodedSizeInBytes(d,_,m),y=x+3&-4,b=E+3&-4;_===0&&(v.width=y,v.height=b);var g=new Uint8Array(w);if(!a.transcodeImage(g,d,_,m,!1,!1)){if(c)return console.error("Basis failed to transcode image "+d+", level "+_+"!"),{type:"transcode",requestID:e.requestID,success:!1};console.warn("Basis failed to transcode image "+d+", level "+_+"! Retrying to an uncompressed texture format!"),d=-1,c=!0;break}v.levelArray.push({levelID:_,levelWidth:x,levelHeight:E,levelBuffer:g})}f[d]=v}return a.close(),a.delete(),{type:"transcode",requestID:e.requestID,success:!0,basisFormat:c?l:u,imageArray:f}}};self.onmessage=function(e){var i=e.data,n=t[i.type](i);n&&self.postMessage(n)}}var Ve=function(){function r(){var t=this;this.requests={},this.onMessage=function(e){var i=e.data;if(i.type==="init"){if(!i.success)throw new Error("BasisResource.TranscoderWorker failed to initialize.");t.isInit=!0,t.onInit()}else if(i.type==="transcode"){--t.load;var n=i.requestID;i.success?t.requests[n].resolve(i):t.requests[n].reject(),delete t.requests[n]}},this.isInit=!1,this.load=0,this.initPromise=new Promise(function(e){t.onInit=e}),r.wasmSource||console.warn("PIXI.resources.BasisResource.TranscoderWorker has not been given the transcoder WASM binary!"),this.worker=new Worker(r.workerURL),this.worker.onmessage=this.onMessage,this.worker.postMessage({type:"init",jsSource:r.jsSource,wasmSource:r.wasmSource})}return Object.defineProperty(r,"workerURL",{get:function(){if(!r._workerURL){var t=hc.toString(),e=t.indexOf("{"),i=t.lastIndexOf("}");t=t.slice(e+1,i),r.jsSource&&(t=r.jsSource+`
`+t),r._workerURL=URL.createObjectURL(new Blob([t]))}return r._workerURL},enumerable:!1,configurable:!0}),r.prototype.initAsync=function(){return this.initPromise},r.prototype.transcodeAsync=function(t,e,i){return Ur(this,void 0,Promise,function(){var n,s,a=this;return Gr(this,function(o){return++this.load,n=r._tempID++,s=new Promise(function(h,u){a.requests[n]={resolve:h,reject:u}}),this.worker.postMessage({requestID:n,basisData:t,rgbaFormat:e,rgbFormat:i,type:"transcode"}),[2,s]})})},r.loadTranscoder=function(t,e){var i=this,n=fetch(t).then(function(a){return a.text()}).then(function(a){r.jsSource=a}),s=fetch(e).then(function(a){return a.arrayBuffer()}).then(function(a){r.wasmSource=a});return Promise.all([n,s]).then(function(a){return i._onTranscoderInitializedResolve(),a})},r.setTranscoder=function(t,e){r.jsSource=t,r.wasmSource=e},r.onTranscoderInitialized=new Promise(function(t){r._onTranscoderInitializedResolve=t}),r._tempID=0,r}(),Ht=function(){function r(){}return r.transcode=function(t){return Ur(this,void 0,Promise,function(){var e;return Gr(this,function(i){switch(i.label){case 0:return typeof Worker!="undefined"&&r.TranscoderWorker.wasmSource?[4,r.transcodeAsync(t)]:[3,2];case 1:return e=i.sent(),[3,3];case 2:e=r.transcodeSync(t),i.label=3;case 3:return[2,e]}})})},r.transcodeAsync=function(t){return Ur(this,void 0,Promise,function(){var e,i,n,f,c,s,a,o,h,u,l,f,c;return Gr(this,function(d){switch(d.label){case 0:for(!r.defaultRGBAFormat&&!r.defaultRGBFormat&&r.autoDetectFormats(),e=r.workerPool,i=268435456,n=null,f=0,c=e.length;f<c;f++)e[f].load<i&&(n=e[f],i=n.load);return n||(n=new Ve,e.push(n)),[4,n.initAsync()];case 1:return d.sent(),[4,n.transcodeAsync(new Uint8Array(t),r.defaultRGBAFormat.basisFormat,r.defaultRGBFormat.basisFormat)];case 2:if(s=d.sent(),a=s.basisFormat,o=s.imageArray,h=a>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;f<c;f++)u[f]=new ge(null,{format:l,width:o[f].width,height:o[f].height,levelBuffers:o[f].levelArray,levels:o[f].levelArray.length});return u.basisFormat=a,[2,u]}})})},r.transcodeSync=function(t){!r.defaultRGBAFormat&&!r.defaultRGBFormat&&r.autoDetectFormats();var e=r.basisBinding,i=new Uint8Array(t),n=new e.BasisFile(i),s=n.getNumImages(),a=n.getHasAlpha(),o=a?r.defaultRGBAFormat.basisFormat:r.defaultRGBFormat.basisFormat,h=st.cTFRGB565,u=new Array(s),l=r.fallbackMode;if(!n.startTranscoding())return console.error("Basis failed to start transcoding!"),n.close(),n.delete(),null;for(var f=0;f<s;f++){for(var c=l?1:n.getNumLevels(f),d=n.getImageWidth(f,0),p=n.getImageHeight(f,0),v=d+3&-4,_=p+3&-4,m=new Array(c),x=0;x<c;x++){var E=n.getImageWidth(f,x),w=n.getImageHeight(f,x),y=n.getImageTranscodedSizeInBytes(f,0,l?h:o);if(m[x]={levelID:x,levelBuffer:new Uint8Array(y),levelWidth:E,levelHeight:w},!n.transcodeImage(m[x].levelBuffer,f,0,l?h:o,!1,!1))if(l){console.error("Basis failed to transcode image "+f+", level "+0+"!");break}else{f=-1,l=!0,console.warn("Basis failed to transcode image "+f+", level "+0+" to a compressed texture format. Retrying to an uncompressed fallback format!");continue}}var b=void 0;l?b=new _e(new Uint16Array(m[0].levelBuffer.buffer),{width:d,height:p}):b=new ge(null,{format:kr[o],width:v,height:_,levelBuffers:m,levels:c}),u[f]=b}n.close(),n.delete();var g=u;return g.basisFormat=l?h:o,g},r.autoDetectFormats=function(t){if(!t){var e=P.ADAPTER.createCanvas(),i=e.getContext("webgl");if(!i){console.error("WebGL not available for BASIS transcoding. Silently failing.");return}t={s3tc:i.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:i.getExtension("WEBGL_compressed_texture_s3tc_srgb"),astc:i.getExtension("WEBGL_compressed_texture_astc"),etc:i.getExtension("WEBGL_compressed_texture_etc"),etc1:i.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:i.getExtension("WEBGL_compressed_texture_atc")}}var n={};for(var s in t){var a=t[s];!a||Object.assign(n,Object.getPrototypeOf(a))}for(var o=0;o<2;o++){var h=!!o,u=void 0,l=void 0;for(var f in n)if(u=n[f],l=oc[u],l!==void 0&&(h&&ms[l]||!h&&!ms[l]))break;u?r[h?"defaultRGBAFormat":"defaultRGBFormat"]={textureFormat:u,basisFormat:l}:(r[h?"defaultRGBAFormat":"defaultRGBFormat"]={textureFormat:M.UNSIGNED_SHORT_5_6_5,basisFormat:st.cTFRGB565},r.fallbackMode=!0)}},r.bindTranscoder=function(t){r.basisBinding=t},r.loadTranscoder=function(t,e){return r.TranscoderWorker.loadTranscoder(t,e)},r.setTranscoder=function(t,e){r.TranscoderWorker.setTranscoder(t,e)},Object.defineProperty(r,"TRANSCODER_WORKER_POOL_LIMIT",{get:function(){return this.workerPool.length||1},set:function(t){for(var e=this.workerPool.length;e<t;e++)this.workerPool[e]=new Ve,this.workerPool[e].initAsync()},enumerable:!1,configurable:!0}),r.extension=F.Loader,r.fallbackMode=!1,r.workerPool=[],r.TranscoderWorker=Ve,r}();J.setExtensionXhrType("basis",J.XHR_RESPONSE_TYPE.BUFFER);var uc=function(){function r(){}return r.use=function(t,e){var i=this;t.extension==="basis"&&t.data?function(){return Ur(i,void 0,void 0,function(){var n;return Gr(this,function(s){switch(s.label){case 0:return!Ht.basisBinding&&!Ht.TranscoderWorker.wasmSource?[4,Ve.onTranscoderInitialized]:[3,2];case 1:s.sent(),s.label=2;case 2:return[4,Ht.transcode(t.data)];case 3:return n=s.sent(),Object.assign(t,r.registerTextures(t.url,n,t.metadata)),e(),[2]}})})}():e()},r.registerTextures=function(t,e,i){var n={textures:{},texture:null};if(!e)return n;var s=da[e.basisFormat],a=e.basisFormat!==st.cTFRGBA32?S.RGB:S.RGBA,o=e,h=o.map(function(u){return new k(new X(u,Object.assign({mipmap:u instanceof ge&&u.levels>1?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<t.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)},t.prototype._renderDefault=function(e){var i=this.shader;i.alpha=this.worldAlpha,i.update&&i.update(),e.batch.flush(),i.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(i),e.state.set(this.state),e.geometry.bind(this.geometry,i),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},t.prototype._renderToBatch=function(e){var i=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=i.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;var s=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[s]),e.plugins[s].render(this)},t.prototype.calculateVertices=function(){var e=this.geometry,i=e.buffers[0],n=i.data,s=i._updateID;if(!(s===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==n.length&&(this.vertexData=new Float32Array(n.length));for(var a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=this.vertexData,p=0;p<d.length/2;p++){var v=n[p*2],_=n[p*2+1];d[p*2]=o*v+u*_+f,d[p*2+1]=h*v+l*_+c}if(this._roundPixels)for(var m=P.RESOLUTION,p=0;p<d.length;++p)d[p]=Math.round((d[p]*m|0)/m);this.vertexDirty=s}},t.prototype.calculateUvs=function(){var e=this.geometry.buffers[1],i=this.shader;i.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new lc(e,i.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},t.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},t.prototype.containsPoint=function(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,yi);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=gs.points,s=this.geometry.getIndex().data,a=s.length,o=this.drawMode===4?3:1,h=0;h+2<a;h+=o){var u=s[h]*2,l=s[h+1]*2,f=s[h+2]*2;if(n[0]=i[u],n[1]=i[u+1],n[2]=i[l],n[3]=i[l+1],n[4]=i[f],n[5]=i[f+1],gs.contains(yi.x,yi.y))return!0}return!1},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},t.BATCHABLE_SIZE=100,t}(me),fc=`varying vec2 vTextureCoord;
uniform vec4 uColor;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
}
`,cc=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTextureMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
}
`,bs=function(r){En(t,r);function t(e,i){var n=this,s={uSampler:e,alpha:1,uTextureMatrix:dt.IDENTITY,uColor:new Float32Array([1,1,1,1])};return i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i),i.uniforms&&Object.assign(s,i.uniforms),n=r.call(this,i.program||tr.from(cc,fc),s)||this,n._colorDirty=!1,n.uvMatrix=new Zs(e),n.batchable=i.program===void 0,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return Object.defineProperty(t.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},set:function(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){e!==this._tint&&(this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),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;t<r.length;++t)r[t]=xs(r[t]);return r}else return xs(r)}function _c(r,t){if(!Array.isArray(r)||!Array.isArray(t)||r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}function Ei(r,t,e){for(var i in e)Array.isArray(t[i])?r[i]=t[i].slice():r[i]=t[i]}var Er={willReadFrequently:!0},$t=function(){function r(t,e,i,n,s,a,o,h,u){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=u}return r.measureText=function(t,e,i,n){n===void 0&&(n=r._canvas),i=i==null?e.wordWrap:i;var s=e.toFontString(),a=r.measureFont(s);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);var o=n.getContext("2d",Er);o.font=s;for(var h=i?r.wordWrap(t,e,n):t,u=h.split(/(?:\r\n|\r|\n)/),l=new Array(u.length),f=0,c=0;c<u.length;c++){var d=o.measureText(u[c]).width+(u[c].length-1)*e.letterSpacing;l[c]=d,f=Math.max(f,d)}var p=f+e.strokeThickness;e.dropShadow&&(p+=e.dropShadowDistance);var v=e.lineHeight||a.fontSize+e.strokeThickness,_=Math.max(v,a.fontSize+e.strokeThickness)+(u.length-1)*(v+e.leading);return e.dropShadow&&(_+=e.dropShadowDistance),new r(t,e,p,_,u,l,v+e.leading,f,a)},r.wordWrap=function(t,e,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",Er),s=0,a="",o="",h=Object.create(null),u=e.letterSpacing,l=e.whiteSpace,f=r.collapseSpaces(l),c=r.collapseNewlines(l),d=!f,p=e.wordWrapWidth+u,v=r.tokenize(t),_=0;_<v.length;_++){var m=v[_];if(r.isNewline(m)){if(!c){o+=r.addLine(a),d=!f,a="",s=0;continue}m=" "}if(f){var x=r.isBreakingSpace(m),E=r.isBreakingSpace(a[a.length-1]);if(x&&E)continue}var w=r.getFromCache(m,u,h,n);if(w>p)if(a!==""&&(o+=r.addLine(a),a="",s=0),r.canBreakWords(m,e.breakWords))for(var y=r.wordWrapSplit(m),b=0;b<y.length;b++){for(var g=y[b],A=1;y[b+A];){var T=y[b+A],R=g[g.length-1];if(!r.canBreakChars(R,T,m,b,e.breakWords))g+=T;else break;A++}b+=g.length-1;var O=r.getFromCache(g,u,h,n);O+s>p&&(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;n<t.length;n++){var s=t[n],a=t[n+1];if(r.isBreakingSpace(s,a)||r.isNewline(s)){i!==""&&(e.push(i),i=""),e.push(s);continue}i+=s}return i!==""&&e.push(i),e},r.canBreakWords=function(t,e){return e},r.canBreakChars=function(t,e,i,n,s){return!0},r.wordWrapSplit=function(t){return t.split("")},r.measureFont=function(t){if(r._fonts[t])return r._fonts[t];var e={ascent:0,descent:0,fontSize:0},i=r._canvas,n=r._context;n.font=t;var s=r.METRICS_STRING+r.BASELINE_SYMBOL,a=Math.ceil(n.measureText(s).width),o=Math.ceil(n.measureText(r.BASELINE_SYMBOL).width),h=Math.ceil(r.HEIGHT_MULTIPLIER*o);o=o*r.BASELINE_MULTIPLIER|0,i.width=a,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,a,h),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,o);var u=n.getImageData(0,0,a,h).data,l=u.length,f=a*4,c=0,d=0,p=!1;for(c=0;c<o;++c){for(var v=0;v<f;v+=4)if(u[d+v]!==255){p=!0;break}if(!p)d+=f;else break}for(e.ascent=o-c,d=l-f,p=!1,c=h;c>o;--c){for(var v=0;v<f;v+=4)if(u[d+v]!==255){p=!0;break}if(!p)d-=f;else break}return e.descent=c-o,e.fontSize=e.ascent+e.descent,r._fonts[t]=e,e},r.clearMetrics=function(t){t===void 0&&(t=""),t?delete r._fonts[t]:r._fonts={}},Object.defineProperty(r,"_canvas",{get:function(){if(!r.__canvas){var t=void 0;try{var e=new OffscreenCanvas(0,0),i=e.getContext("2d",Er);if(i&&i.measureText)return r.__canvas=e,e;t=P.ADAPTER.createCanvas()}catch{t=P.ADAPTER.createCanvas()}t.width=t.height=10,r.__canvas=t}return r.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(r,"_context",{get:function(){return r.__context||(r.__context=r._canvas.getContext("2d",Er)),r.__context},enumerable:!1,configurable:!0}),r}();$t._fonts={};$t.METRICS_STRING="|\xC9q\xC5";$t.BASELINE_SYMBOL="M";$t.BASELINE_MULTIPLIER=1.4;$t.HEIGHT_MULTIPLIER=2;$t._newlines=[10,13];$t._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var mc={texture:!0,children:!1,baseTexture:!0};(function(r){pc(t,r);function t(e,i,n){var s=this,a=!1;n||(n=P.ADAPTER.createCanvas(),a=!0),n.width=3,n.height=3;var o=k.from(n);return o.orig=new W,o.trim=new W,s=r.call(this,o)||this,s._ownCanvas=a,s.canvas=n,s.context=n.getContext("2d",{willReadFrequently:!0}),s._resolution=P.RESOLUTION,s._autoResolution=!0,s._text=null,s._style=null,s._styleListener=null,s._font="",s.text=e,s.style=i,s.localStyleID=-1,s}return t.prototype.updateText=function(e){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),!(!this.dirty&&e)){this._font=this._style.toFontString();var n=this.context,s=$t.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=s.width,o=s.height,h=s.lines,u=s.lineHeight,l=s.lineWidths,f=s.maxLineWidth,c=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+i.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=i.strokeThickness,n.textBaseline=i.textBaseline,n.lineJoin=i.lineJoin,n.miterLimit=i.miterLimit;for(var d,p,v=i.dropShadow?2:1,_=0;_<v;++_){var m=i.dropShadow&&_===0,x=m?Math.ceil(Math.max(1,o)+i.padding*2):0,E=x*this._resolution;if(m){n.fillStyle="black",n.strokeStyle="black";var w=i.dropShadowColor,y=ze(typeof w=="number"?w:Ds(w)),b=i.dropShadowBlur*this._resolution,g=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+y[0]*255+","+y[1]*255+","+y[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=b,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*g,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*g+E}else n.fillStyle=this._generateFillStyle(i,h,s),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var A=(u-c.fontSize)/2;(!t.nextLineHeightBehavior||u-c.fontSize<0)&&(A=0);for(var T=0;T<h.length;T++)d=i.strokeThickness/2,p=i.strokeThickness/2+T*u+c.ascent+A,i.align==="right"?d+=f-l[T]:i.align==="center"&&(d+=(f-l[T])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[T],d+i.padding,p+i.padding-x,!0),i.fill&&this.drawLetterSpacing(h[T],d+i.padding,p+i.padding-x)}this.updateTexture()}},t.prototype.drawLetterSpacing=function(e,i,n,s){s===void 0&&(s=!1);var a=this._style,o=a.letterSpacing,h=t.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(o===0||h){h&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),s?this.context.strokeText(e,i,n):this.context.fillText(e,i,n);return}for(var u=i,l=Array.from?Array.from(e):e.split(""),f=this.context.measureText(e).width,c=0,d=0;d<l.length;++d){var p=l[d];s?this.context.strokeText(p,u,n):this.context.fillText(p,u,n);for(var v="",_=d+1;_<l.length;++_)v+=l[_];c=this.context.measureText(v).width,u+=f-c+o,f=c}},t.prototype.updateTexture=function(){var e=this.canvas;if(this._style.trim){var i=Au(e);i.data&&(e.width=i.width,e.height=i.height,this.context.putImageData(i.data,0,0))}var n=this._texture,s=this._style,a=s.trim?0:s.padding,o=n.baseTexture;n.trim.width=n._frame.width=e.width/this._resolution,n.trim.height=n._frame.height=e.height/this._resolution,n.trim.x=-a,n.trim.y=-a,n.orig.width=n._frame.width-a*2,n.orig.height=n._frame.height-a*2,this._onTextureUpdate(),o.setRealSize(e.width,e.height,this._resolution),n.updateUvs(),this.dirty=!1},t.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,e)},t.prototype.updateTransform=function(){this.updateText(!0),r.prototype.updateTransform.call(this)},t.prototype.getBounds=function(e,i){return this.updateText(!0),this._textureID===-1&&(e=!1),r.prototype.getBounds.call(this,e,i)},t.prototype.getLocalBounds=function(e){return this.updateText(!0),r.prototype.getLocalBounds.call(this,e)},t.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},t.prototype._generateFillStyle=function(e,i,n){var s=e.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var a,o=e.dropShadow?e.dropShadowDistance:0,h=e.padding||0,u=this.canvas.width/this._resolution-o-h*2,l=this.canvas.height/this._resolution-o-h*2,f=s.slice(),c=e.fillGradientStops.slice();if(!c.length)for(var d=f.length+1,p=1;p<d;++p)c.push(p/d);if(f.unshift(s[0]),c.unshift(0),f.push(s[s.length-1]),c.push(1),e.fillGradientType===Qe.LINEAR_VERTICAL){a=this.context.createLinearGradient(u/2,h,u/2,l+h);for(var v=n.fontProperties.fontSize+e.strokeThickness,p=0;p<i.length;p++){var _=n.lineHeight*(p-1)+v,m=n.lineHeight*p,x=m;p>0&&_>m&&(x=(m+_)/2);var E=m+v,w=n.lineHeight*(p+1),y=E;p+1<i.length&&w<E&&(y=(E+w)/2);for(var b=(y-x)/l,g=0;g<f.length;g++){var A=0;typeof c[g]=="number"?A=c[g]:A=g/f.length;var T=Math.min(1,Math.max(0,x/l+A*b));T=Number(T.toFixed(5)),a.addColorStop(T,f[g])}}}else{a=this.context.createLinearGradient(h,l/2,u+h,l/2);for(var R=f.length+1,O=1,p=0;p<f.length;p++){var D=void 0;typeof c[p]=="number"?D=c[p]:D=O/R,a.addColorStop(D,f[p]),O++}}return a},t.prototype.destroy=function(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},mc,e),r.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){this.updateText(!0);var i=Ce(this.scale.x)||1;this.scale.x=i*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){this.updateText(!0);var i=Ce(this.scale.y)||1;this.scale.y=i*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._style},set:function(e){e=e||{},e instanceof Xr?this._style=e:this._style=new Xr(e),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e==null?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),t.nextLineHeightBehavior=!1,t.experimentalLetterSpacing=!1,t})(ra);/*!
* @pixi/text-bitmap - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/text-bitmap 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 Vi=function(r,t){return Vi=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])},Vi(r,t)};function gc(r,t){Vi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Hr=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),Rr=function(){function r(){}return r.test=function(t){return typeof t=="string"&&t.indexOf("info face=")===0},r.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in e){var s=e[n].match(/^[a-z]+/gm)[0],a=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var h in a){var u=a[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;o[l]=d}i[s].push(o)}var p=new Hr;return i.info.forEach(function(v){return p.info.push({face:v.face,size:parseInt(v.size,10)})}),i.common.forEach(function(v){return p.common.push({lineHeight:parseInt(v.lineHeight,10)})}),i.page.forEach(function(v){return p.page.push({id:parseInt(v.id,10),file:v.file})}),i.char.forEach(function(v){return p.char.push({id:parseInt(v.id,10),page:parseInt(v.page,10),x:parseInt(v.x,10),y:parseInt(v.y,10),width:parseInt(v.width,10),height:parseInt(v.height,10),xoffset:parseInt(v.xoffset,10),yoffset:parseInt(v.yoffset,10),xadvance:parseInt(v.xadvance,10)})}),i.kerning.forEach(function(v){return p.kerning.push({first:parseInt(v.first,10),second:parseInt(v.second,10),amount:parseInt(v.amount,10)})}),i.distanceField.forEach(function(v){return p.distanceField.push({distanceRange:parseInt(v.distanceRange,10),fieldType:v.fieldType})}),p},r}(),Yi=function(){function r(){}return r.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(t){for(var e=new Hr,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField"),u=0;u<i.length;u++)e.info.push({face:i[u].getAttribute("face"),size:parseInt(i[u].getAttribute("size"),10)});for(var u=0;u<n.length;u++)e.common.push({lineHeight:parseInt(n[u].getAttribute("lineHeight"),10)});for(var u=0;u<s.length;u++)e.page.push({id:parseInt(s[u].getAttribute("id"),10)||0,file:s[u].getAttribute("file")});for(var u=0;u<a.length;u++){var l=a[u];e.char.push({id:parseInt(l.getAttribute("id"),10),page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xoffset:parseInt(l.getAttribute("xoffset"),10),yoffset:parseInt(l.getAttribute("yoffset"),10),xadvance:parseInt(l.getAttribute("xadvance"),10)})}for(var u=0;u<o.length;u++)e.kerning.push({first:parseInt(o[u].getAttribute("first"),10),second:parseInt(o[u].getAttribute("second"),10),amount:parseInt(o[u].getAttribute("amount"),10)});for(var u=0;u<h.length;u++)e.distanceField.push({fieldType:h[u].getAttribute("fieldType"),distanceRange:parseInt(h[u].getAttribute("distanceRange"),10)});return e},r}(),zi=function(){function r(){}return r.test=function(t){if(typeof t=="string"&&t.indexOf("<font>")>-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<Ti.length;t++)if(Ti[t].test(r))return Ti[t];return null}function yc(r,t,e,i,n,s){var a=e.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var o,h=e.dropShadow?e.dropShadowDistance:0,u=e.padding||0,l=r.width/i-h-u*2,f=r.height/i-h-u*2,c=a.slice(),d=e.fillGradientStops.slice();if(!d.length)for(var p=c.length+1,v=1;v<p;++v)d.push(v/p);if(c.unshift(a[0]),d.unshift(0),c.push(a[a.length-1]),d.push(1),e.fillGradientType===Qe.LINEAR_VERTICAL){o=t.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,m=s.fontProperties.fontSize+e.strokeThickness,x=m/f,v=0;v<n.length;v++)for(var E=s.lineHeight*v,w=0;w<c.length;w++){var y=0;typeof d[w]=="number"?y=d[w]:y=w/c.length;var b=E/f+y*x,g=Math.max(_,b);g=Math.min(g,1),o.addColorStop(g,c[w]),_=g}}else{o=t.createLinearGradient(u,f/2,l+u,f/2);for(var A=c.length+1,T=1,v=0;v<c.length;v++){var R=void 0;typeof d[v]=="number"?R=d[v]:R=T/A,o.addColorStop(R,c[v]),T++}}return o}function bc(r,t,e,i,n,s,a){var o=e.text,h=e.fontProperties;t.translate(i,n),t.scale(s,s);var u=a.strokeThickness/2,l=-(a.strokeThickness/2);if(t.font=a.toFontString(),t.lineWidth=a.strokeThickness,t.textBaseline=a.textBaseline,t.lineJoin=a.lineJoin,t.miterLimit=a.miterLimit,t.fillStyle=yc(r,t,a,s,[o],e),t.strokeStyle=a.stroke,a.dropShadow){var f=a.dropShadowColor,c=ze(typeof f=="number"?f:Ds(f)),d=a.dropShadowBlur*s,p=a.dropShadowDistance*s;t.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+a.dropShadowAlpha+")",t.shadowBlur=d,t.shadowOffsetX=Math.cos(a.dropShadowAngle)*p,t.shadowOffsetY=Math.sin(a.dropShadowAngle)*p}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;a.stroke&&a.strokeThickness&&t.strokeText(o,u,l+e.lineHeight-h.descent),a.fill&&t.fillText(o,u,l+e.lineHeight-h.descent),t.setTransform(1,0,0,1,0,0),t.fillStyle="rgba(0, 0, 0, 0)"}function va(r){return Array.from?Array.from(r):r.split("")}function xc(r){typeof r=="string"&&(r=[r]);for(var t=[],e=0,i=r.length;e<i;e++){var n=r[e];if(Array.isArray(n)){if(n.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var s=n[0].charCodeAt(0),a=n[1].charCodeAt(0);if(a<s)throw new Error("[BitmapFont]: Invalid character range.");for(var o=s,h=a;o<=h;o++)t.push(String.fromCharCode(o))}else t.push.apply(t,va(n))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}function Pr(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var kt=function(){function r(t,e,i){var n,s,a=t.info[0],o=t.common[0],h=t.page[0],u=t.distanceField[0],l=te(h.file),f={};this._ownsTextures=i,this.font=a.face,this.size=a.size,this.lineHeight=o.lineHeight/l,this.chars={},this.pageTextures=f;for(var c=0;c<t.page.length;c++){var d=t.page[c],p=d.id,v=d.file;f[p]=e instanceof Array?e[c]:e[v],(u==null?void 0:u.fieldType)&&u.fieldType!=="none"&&(f[p].baseTexture.alphaMode=ct.NO_PREMULTIPLIED_ALPHA,f[p].baseTexture.mipmap=ut.OFF)}for(var c=0;c<t.char.length;c++){var _=t.char[c],p=_.id,m=_.page,x=t.char[c],E=x.x,w=x.y,y=x.width,b=x.height,g=x.xoffset,A=x.yoffset,T=x.xadvance;E/=l,w/=l,y/=l,b/=l,g/=l,A/=l,T/=l;var R=new W(E+f[m].frame.x/l,w+f[m].frame.y/l,y,b);this.chars[p]={xOffset:g,yOffset:A,xAdvance:T,kerning:{},texture:new k(f[m].baseTexture,R),page:m}}for(var c=0;c<t.kerning.length;c++){var O=t.kerning[c],D=O.first,j=O.second,et=O.amount;D/=l,j/=l,et/=l,this.chars[j]&&(this.chars[j].kerning[D]=et)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(s=(n=u==null?void 0:u.fieldType)===null||n===void 0?void 0:n.toLowerCase())!==null&&s!==void 0?s:"none"}return r.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},r.install=function(t,e,i){var n;if(t instanceof Hr)n=t;else{var s=pa(t);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(t)}e instanceof k&&(e=[e]);var a=new r(n,e,i);return r.available[a.font]=a,a},r.uninstall=function(t){var e=r.available[t];if(!e)throw new Error("No font found named '"+t+"'");e.destroy(),delete r.available[t]},r.from=function(t,e,i){if(!t)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},r.defaultOptions,i),s=n.chars,a=n.padding,o=n.resolution,h=n.textureWidth,u=n.textureHeight,l=xc(s),f=e instanceof Xr?e:new Xr(e),c=h,d=new Hr;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var p=0,v=0,_,m,x,E=0,w=[],y=0;y<l.length;y++){_||(_=P.ADAPTER.createCanvas(),_.width=h,_.height=u,m=_.getContext("2d"),x=new X(_,{resolution:o}),w.push(new k(x)),d.page.push({id:w.length-1,file:""}));var b=l[y],g=$t.measureText(b,f,!1,_),A=g.width,T=Math.ceil(g.height),R=Math.ceil((f.fontStyle==="italic"?2:1)*A);if(v>=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<D;y++)for(var j=l[y],et=0;et<D;et++){var C=l[et],I=m.measureText(j).width,H=m.measureText(C).width,lt=m.measureText(j+C).width,V=lt-(I+H);V&&d.kerning.push({first:Pr(j),second:Pr(C),amount:V})}var it=new r(d,w,!0);return r.available[t]!==void 0&&r.uninstall(t),r.available[t]=it,it},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),Ec=`// Pixi texture info\r
varying vec2 vTextureCoord;\r
uniform sampler2D uSampler;\r
\r
// Tint\r
uniform vec4 uColor;\r
\r
// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
uniform float uFWidth;\r
\r
void main(void) {\r
\r
// To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
vec4 texColor = texture2D(uSampler, vTextureCoord);\r
\r
// MSDF\r
float median = texColor.r + texColor.g + texColor.b -\r
min(texColor.r, min(texColor.g, texColor.b)) -\r
max(texColor.r, max(texColor.g, texColor.b));\r
// SDF\r
median = min(median, texColor.a);\r
\r
float screenPxDistance = uFWidth * (median - 0.5);\r
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
if (median < 0.01) {\r
alpha = 0.0;\r
} else if (median > 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;g<f.length;g++){var A=f[g],T=Pr(A);if(/(?:\s)/.test(A)&&(x=g,E=v,b++),A==="\r"||A===`
`){h.push(v),u.push(-1),_=Math.max(_,v),++m,++w,a.x=0,a.y+=i.lineHeight,p=null,b=0;continue}var R=i.chars[T];if(!!R){p&&R.kerning[p]&&(a.x+=R.kerning[p]);var O=ws.pop()||{texture:k.EMPTY,line:0,charCode:0,prevSpaces:0,position:new q};O.texture=R.texture,O.line=m,O.charCode=T,O.position.x=a.x+R.xOffset+this._letterSpacing/2,O.position.y=a.y+R.yOffset,O.prevSpaces=b,o.push(O),v=O.position.x+Math.max(R.xAdvance-R.xOffset,R.texture.orig.width),a.x+=R.xAdvance+this._letterSpacing,y=Math.max(y,R.yOffset+R.texture.height),p=T,x!==-1&&c>0&&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;g<C;g++){var V=o[g].texture,it=V.baseTexture.uid;if(!I[it]){var N=d.pop();if(!N){var nr=new dc,Kt=void 0,Lt=void 0;i.distanceFieldType==="none"?(Kt=new bs(k.EMPTY),Lt=B.NORMAL):(Kt=new bs(k.EMPTY,{program:tr.from(Tc,Ec),uniforms:{uFWidth:0}}),Lt=B.NORMAL_NPM);var Me=new ys(nr,Kt);Me.blendMode=Lt,N={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:Me,vertices:null,uvs:null,indices:null}}N.index=0,N.indexCount=0,N.vertexCount=0,N.uvsCount=0,N.total=0;var ye=this._textureCache;ye[it]=ye[it]||new k(V.baseTexture),N.mesh.texture=ye[it],N.mesh.tint=this._tint,H.push(N),I[it]=N}I[it].total++}for(var g=0;g<lt.length;g++)H.indexOf(lt[g])===-1&&this.removeChild(lt[g].mesh);for(var g=0;g<H.length;g++)H[g].mesh.parent!==this&&this.addChild(H[g].mesh);this._activePagesMeshData=H;for(var g in I){var N=I[g],St=N.total;if(!(((e=N.indices)===null||e===void 0?void 0:e.length)>6*St)||N.vertices.length<ys.BATCHABLE_SIZE*2)N.vertices=new Float32Array(4*2*St),N.uvs=new Float32Array(4*2*St),N.indices=new Uint16Array(6*St);else for(var be=N.total,xe=N.vertices,mt=be*4*2;mt<xe.length;mt++)xe[mt]=0;N.mesh.size=6*St}for(var g=0;g<C;g++){var A=o[g],gt=A.position.x+j[A.line]*(this._align==="justify"?A.prevSpaces:1);this._roundPixels&&(gt=Math.round(gt));var vt=gt*s,_t=A.position.y*s,V=A.texture,Q=I[V.baseTexture.uid],re=V.frame,Rt=V._uvs,Y=Q.index++;Q.indices[Y*6+0]=0+Y*4,Q.indices[Y*6+1]=1+Y*4,Q.indices[Y*6+2]=2+Y*4,Q.indices[Y*6+3]=0+Y*4,Q.indices[Y*6+4]=2+Y*4,Q.indices[Y*6+5]=3+Y*4,Q.vertices[Y*8+0]=vt,Q.vertices[Y*8+1]=_t,Q.vertices[Y*8+2]=vt+re.width*s,Q.vertices[Y*8+3]=_t,Q.vertices[Y*8+4]=vt+re.width*s,Q.vertices[Y*8+5]=_t+re.height*s,Q.vertices[Y*8+6]=vt,Q.vertices[Y*8+7]=_t+re.height*s,Q.uvs[Y*8+0]=Rt.x0,Q.uvs[Y*8+1]=Rt.y0,Q.uvs[Y*8+2]=Rt.x1,Q.uvs[Y*8+3]=Rt.y1,Q.uvs[Y*8+4]=Rt.x2,Q.uvs[Y*8+5]=Rt.y2,Q.uvs[Y*8+6]=Rt.x3,Q.uvs[Y*8+7]=Rt.y3}this._textWidth=_*s,this._textHeight=(a.y+i.lineHeight)*s;for(var g in I){var N=I[g];if(this.anchor.x!==0||this.anchor.y!==0)for(var Pt=0,Ee=this._textWidth*this.anchor.x,sr=this._textHeight*this.anchor.y,Rn=0;Rn<N.total;Rn++)N.vertices[Pt++]-=Ee,N.vertices[Pt++]-=sr,N.vertices[Pt++]-=Ee,N.vertices[Pt++]-=sr,N.vertices[Pt++]-=Ee,N.vertices[Pt++]-=sr,N.vertices[Pt++]-=Ee,N.vertices[Pt++]-=sr;this._maxLineHeight=y*s;var Pn=N.mesh.geometry.getBuffer("aVertexPosition"),Cn=N.mesh.geometry.getBuffer("aTextureCoord"),In=N.mesh.geometry.getIndex();Pn.data=N.vertices,Cn.data=N.uvs,In.data=N.indices,Pn.update(),Cn.update(),In.update()}for(var g=0;g<o.length;g++)ws.push(o[g]);this._font=i,this.dirty=!1},t.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},t.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);var i=kt.available[this._fontName],n=i.distanceFieldRange,s=i.distanceFieldType,a=i.size;if(s!=="none")for(var o=this.worldTransform,h=o.a,u=o.b,l=o.c,f=o.d,c=Math.sqrt(h*h+u*u),d=Math.sqrt(l*l+f*f),p=(Math.abs(c)+Math.abs(d))/2,v=this.fontSize/a,_=0,m=this._activePagesMeshData;_<m.length;_++){var x=m[_];x.mesh.shader.uniforms.uFWidth=p*n*v*this._resolution}r.prototype._render.call(this,e)},t.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},t.prototype.validate=function(){var e=kt.available[this._fontName];if(!e)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){if(this._tint!==e){this._tint=e;for(var i=0;i<this._activePagesMeshData.length;i++)this._activePagesMeshData[i].mesh.tint=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},set:function(e){if(!kt.available[e])throw new Error('Missing BitmapFont "'+e+'"');this._fontName!==e&&(this._fontName=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){var e;return(e=this._fontSize)!==null&&e!==void 0?e:kt.available[this._fontName].size},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anchor",{get:function(){return this._anchor},set:function(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e==null?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e){var i=this._textureCache,n=kt.available[this._fontName],s=n.distanceFieldType==="none"?Es:Ts;s.push.apply(s,this._activePagesMeshData);for(var a=0,o=this._activePagesMeshData;a<o.length;a++){var h=o[a];this.removeChild(h.mesh)}this._activePagesMeshData=[],s.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=k.EMPTY});for(var u in i){var l=i[u];l.destroy(),delete i[u]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,e)},t.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},t})(me);(function(){function r(){}return r.add=function(){J.setExtensionXhrType("fnt",J.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){var i=pa(t.data);if(!i){e();return}for(var n=r.getBaseUrl(this,t),s=i.parse(t.data),a={},o=function(v){a[v.metadata.pageFile]=v.texture,Object.keys(a).length===s.page.length&&(t.bitmapFont=kt.install(s,a,!0),e())},h=0;h<s.page.length;++h){var u=s.page[h].file,l=n+u,f=!1;for(var c in this.resources){var d=this.resources[c];if(d.url===l){d.metadata.pageFile=u,d.texture?o(d):d.onAfterMiddleware.add(o),f=!0;break}}if(!f){var p={crossOrigin:t.crossOrigin,loadType:J.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},t.metadata.imageMetadata),parentResource:t};this.add(l,p,o)}}},r.getBaseUrl=function(t,e){var i=e.isDataUrl?"":r.dirname(e.url);return e.isDataUrl&&(i==="."&&(i=""),t.baseUrl&&i&&t.baseUrl.charAt(t.baseUrl.length-1)==="/"&&(i+="/")),i=i.replace(t.baseUrl,""),i&&i.charAt(i.length-1)!=="/"&&(i+="/"),i},r.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":e===""?"/":e},r.extension=F.Loader,r})();/*!
* @pixi/assets - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/assets 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 qt=function(){return qt=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n<s;n++){i=e[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},qt.apply(this,arguments)};function U(r,t,e,i){function n(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(l){try{u(i.next(l))}catch(f){a(f)}}function h(l){try{u(i.throw(l))}catch(f){a(f)}}function u(l){l.done?s(l.value):n(l.value).then(o,h)}u((i=i.apply(r,t||[])).next())})}function G(r,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var wc=function(){function r(t,e){e===void 0&&(e=!1),this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}return r.prototype.add=function(t){var e=this;t.forEach(function(i){e._assetList.push(i)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()},r.prototype._next=function(){return U(this,void 0,Promise,function(){var t,e,i;return G(this,function(n){switch(n.label){case 0:if(!(this._assetList.length&&this._isActive))return[3,2];for(this._isLoading=!0,t=[],e=Math.min(this._assetList.length,this._maxConcurrent),i=0;i<e;i++)t.push(this._assetList.pop());return[4,this._loader.load(t)];case 1:n.sent(),this._isLoading=!1,this._next(),n.label=2;case 2:return[2]}})})},Object.defineProperty(r.prototype,"active",{get:function(){return this._isActive},set:function(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())},enumerable:!1,configurable:!0}),r}(),Yt=function(r,t){return Array.isArray(r)||(r=[r]),t?r.map(function(e){return typeof e=="string"?t(e):e}):r};function _a(r,t,e,i,n){for(var s=t[e],a=0;a<s.length;a++){var o=s[a];e<t.length-1?_a(r.replace(i[e],o),t,e+1,i,n):n.push(r.replace(i[e],o))}}function Ac(r){var t=/\{(.*?)\}/g,e=r.match(t),i=[];if(e){var n=[];e.forEach(function(s){var a=s.substring(1,s.length-1).split(",");n.push(a)}),_a(r,n,0,e,i)}else i.push(r);return i}var jr=function(r){return!Array.isArray(r)},Sc=function(){function r(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return r.prototype.reset=function(){this._cacheMap.clear(),this._cache.clear()},r.prototype.has=function(t){return this._cache.has(t)},r.prototype.get=function(t){var e=this._cache.get(t);return e||console.warn("[Assets] Asset id "+t+" was not found in the Cache"),e},r.prototype.set=function(t,e){for(var i=this,n=Yt(t),s,a=0;a<this.parsers.length;a++){var o=this.parsers[a];if(o.test(e)){s=o.getCacheableAssets(n,e);break}}s||(s={},n.forEach(function(f){s[f]=e}));var h=Object.keys(s),u={cacheKeys:h,keys:n};if(n.forEach(function(f){i._cacheMap.set(f,u)}),h.forEach(function(f){i._cache.has(f)&&i._cache.get(f)!==e&&console.warn("[Cache] already has key:",f),i._cache.set(f,s[f])}),e instanceof k){var l=e;n.forEach(function(f){l.baseTexture!==k.EMPTY.baseTexture&&X.addToCache(l.baseTexture,f),k.addToCache(l,f)})}},r.prototype.remove=function(t){var e=this;if(this._cacheMap.get(t),!this._cacheMap.has(t)){console.warn("[Assets] Asset id "+t+" was not found in the Cache");return}var i=this._cacheMap.get(t),n=i.cacheKeys;n.forEach(function(s){e._cache.delete(s)}),i.keys.forEach(function(s){e._cacheMap.delete(s)})},Object.defineProperty(r.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),r}(),He=new Sc;function ma(r,t,e){var i={};if(r.forEach(function(s){i[s]=t}),Object.keys(t.textures).forEach(function(s){i[s]=t.textures[s]}),!e){var n=ht.dirname(r[0]);t.linkedSheets.forEach(function(s,a){var o=ma([n+"/"+t.data.meta.related_multi_packs[a]],s,!0);Object.assign(i,o)})}return i}var Rc={extension:F.CacheParser,test:function(r){return r instanceof xn},getCacheableAssets:function(r,t){return ma(r,t,!1)}},Pc={extension:F.CacheParser,test:function(r){return Array.isArray(r)&&r.every(function(t){return t instanceof k})},getCacheableAssets:function(r,t){var e={};return r.forEach(function(i){t.forEach(function(n,s){e[i+(s===0?"":s+1)]=n})}),e}};function Tn(){for(var r=arguments,t=this,e=[],i=0;i<arguments.length;i++)e[i]=r[i];return function(n){return U(t,void 0,void 0,function(){return G(this,function(s){return n.unshift.apply(n,e),[2,n]})})}}function wn(){for(var r=arguments,t=this,e=[],i=0;i<arguments.length;i++)e[i]=r[i];return function(n){return U(t,void 0,void 0,function(){var s,a,o,h;return G(this,function(u){for(s=0,a=e;s<a.length;s++)o=a[s],h=n.indexOf(o),h!==-1&&n.splice(h,1);return[2,n]})})}}var Cc={extension:F.DetectionParser,test:function(){return U(void 0,void 0,Promise,function(){var r,t;return G(this,function(e){switch(e.label){case 0:return globalThis.createImageBitmap?(r="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",[4,P.ADAPTER.fetch(r).then(function(i){return i.blob()})]):[2,!1];case 1:return t=e.sent(),[2,createImageBitmap(t).then(function(){return!0},function(){return!1})]}})})},add:Tn("avif"),remove:wn("avif")},Gt,Re;function As(){Re={s3tc:Gt.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Gt.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:Gt.getExtension("WEBGL_compressed_texture_etc"),etc1:Gt.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:Gt.getExtension("WEBGL_compressed_texture_pvrtc")||Gt.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:Gt.getExtension("WEBGL_compressed_texture_atc"),astc:Gt.getExtension("WEBGL_compressed_texture_astc")}}F.DetectionParser;F.DetectionParser,Tn("basis"),wn("basis");var Ic={extension:F.DetectionParser,test:function(){return U(void 0,void 0,Promise,function(){var r,t;return G(this,function(e){switch(e.label){case 0:return globalThis.createImageBitmap?(r="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",[4,P.ADAPTER.fetch(r).then(function(i){return i.blob()})]):[2,!1];case 1:return t=e.sent(),[2,createImageBitmap(t).then(function(){return!0},function(){return!1})]}})})},add:Tn("webp"),remove:wn("webp")},Oc=[".xml",".fnt"],Bc={extension:F.LoadParser,test:function(r){return Oc.includes(ht.extname(r))},testParse:function(r){return U(this,void 0,Promise,function(){return G(this,function(t){return[2,Rr.test(r)||zi.test(r)]})})},parse:function(r,t,e){return U(this,void 0,Promise,function(){var i,n,s,a,o,h,u,l,f;return G(this,function(c){switch(c.label){case 0:for(i=Rr.test(r)?Rr.parse(r):zi.parse(r),n=t.src,s=i.page,a=[],o=0;o<s.length;++o)h=s[o].file,u=ht.join(ht.dirname(n),h),a.push(u);return[4,e.load(a)];case 1:return l=c.sent(),f=a.map(function(d){return l[d]}),[2,kt.install(i,f,!0)]}})})},load:function(r,t){return U(this,void 0,Promise,function(){var e;return G(this,function(i){switch(i.label){case 0:return[4,P.ADAPTER.fetch(r)];case 1:return e=i.sent(),[2,e.text()]}})})},unload:function(r){r.destroy()}},Mc={extension:F.LoadParser,test:function(r){return ht.extname(r).includes(".json")},load:function(r){return U(this,void 0,Promise,function(){var t,e;return G(this,function(i){switch(i.label){case 0:return[4,P.ADAPTER.fetch(r)];case 1:return t=i.sent(),[4,t.json()];case 2:return e=i.sent(),[2,e]}})})}},Lc={extension:F.LoadParser,testParse:function(r,t){return U(this,void 0,Promise,function(){return G(this,function(e){return[2,ht.extname(t.src).includes(".json")&&!!r.frames]})})},parse:function(r,t,e){var i,n;return U(this,void 0,Promise,function(){var s,a,o,h,u,l,f,c,d,p,v,_;return G(this,function(m){switch(m.label){case 0:return s=ht.dirname(t.src),s&&s.lastIndexOf("/")!==s.length-1&&(s+="/"),a=s+r.meta.image,[4,e.load([a])];case 1:return o=m.sent(),h=o[a],u=new xn(h.baseTexture,r,t.src),[4,u.parse()];case 2:if(m.sent(),l=(i=r==null?void 0:r.meta)===null||i===void 0?void 0:i.related_multi_packs,!Array.isArray(l))return[3,4];for(f=[],c=0,d=l;c<d.length;c++)p=d[c],typeof p=="string"&&(v=s+p,!(!((n=t.data)===null||n===void 0)&&n.ignoreMultiPack)&&f.push(e.load({src:v,data:{ignoreMultiPack:!0}})));return[4,Promise.all(f)];case 3:_=m.sent(),u.linkedSheets=_,_.forEach(function(x){x.linkedSheets=[u].concat(u.linkedSheets.filter(function(E){return E!==x}))}),m.label=4;case 4:return[2,u]}})})},unload:function(r){r.destroy(!0)}},Nc={extension:F.LoadParser,test:function(r){return ht.extname(r).includes(".txt")},load:function(r){return U(this,void 0,Promise,function(){var t,e;return G(this,function(i){switch(i.label){case 0:return[4,P.ADAPTER.fetch(r)];case 1:return t=i.sent(),[4,t.text()];case 2:return e=i.sent(),[2,e]}})})}},Fc=["normal","bold","100","200","300","400","500","600","700","800","900"],Dc=["woff","woff2","ttf","otf"];function Uc(r){var t=ht.extname(r),e=ht.basename(r,t),i=e.replace(/(-|_)/g," "),n=i.toLowerCase().split(" ").map(function(s){return s.charAt(0).toUpperCase()+s.slice(1)}).join(" ");return n}var Gc={extension:F.LoadParser,test:function(r){var t=r.split("?")[0],e=t.split(".").pop();return Dc.includes(e)},load:function(r,t){var e,i,n,s,a,o;return U(this,void 0,Promise,function(){var h,u,l,f,c,d,p;return G(this,function(v){switch(v.label){case 0:if(!window.navigator.onLine)throw new Error("[loadWebFont] Cannot load font - navigator is offline");if(!("FontFace"in window))return[3,5];h=[],u=(i=(e=t.data)===null||e===void 0?void 0:e.family)!==null&&i!==void 0?i:Uc(r),l=(a=(s=(n=t.data)===null||n===void 0?void 0:n.weights)===null||s===void 0?void 0:s.filter(function(_){return Fc.includes(_)}))!==null&&a!==void 0?a:["normal"],f=(o=t.data)!==null&&o!==void 0?o:{},c=0,v.label=1;case 1:return c<l.length?(d=l[c],p=new FontFace(u,"url("+r+")",qt(qt({},f),{weight:d})),[4,p.load()]):[3,4];case 2:v.sent(),document.fonts.add(p),h.push(p),v.label=3;case 3:return c++,[3,1];case 4:return[2,h.length===1?h[0]:h];case 5:return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),[2,null]}})})},unload:function(r){(Array.isArray(r)?r:[r]).forEach(function(t){return document.fonts.delete(t)})}};function Kr(r,t){var e=r.split("?")[0],i=ht.extname(e).toLowerCase();return Array.isArray(t)?t.includes(i.toLowerCase()):i.toLowerCase()===t}function ir(r,t,e){var i=new k(r);return i.baseTexture.on("dispose",function(){delete t.promiseCache[e]}),i}F.LoadParser;F.LoadParser;F.LoadParser;var Ss=0,wi,kc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",Xc={id:"checkImageBitmap",code:`
async function checkImageBitmap()
{
try
{
if (typeof createImageBitmap !== 'function') return false;
const response = await fetch('`+kc+`');
const imageBlob = await response.blob();
const imageBitmap = await createImageBitmap(imageBlob);
return imageBitmap.width === 1 && imageBitmap.height === 1;
}
catch (e)
{
return false;
}
}
checkImageBitmap().then((result) => { 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._createdWorkers<wi&&(Ai||(Ai=URL.createObjectURL(new Blob([Hc.code],{type:"application/javascript"}))),this._createdWorkers++,e=new Worker(Ai),e.addEventListener("message",function(i){t.complete(i.data),t.returnWorker(i.target),t.next()})),e},r.prototype.returnWorker=function(t){this.workerPool.push(t)},r.prototype.complete=function(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null},r.prototype._run=function(t,e){return U(this,void 0,Promise,function(){var i,n=this;return G(this,function(s){switch(s.label){case 0:return[4,this._initWorkers()];case 1:return s.sent(),i=new Promise(function(a,o){n.queue.push({id:t,arguments:e,resolve:a,reject:o})}),this.next(),[2,i]}})})},r.prototype.next=function(){if(!!this.queue.length){var t=this.getWorker();if(!!t){var e=this.queue.pop(),i=e.id;this.resolveHash[Ss]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Ss++,id:i})}}},r}(),Rs=new jc,Si=[".jpg",".png",".jpeg",".avif",".webp"];function Wc(r){return U(this,void 0,Promise,function(){var t,e,i;return G(this,function(n){switch(n.label){case 0:return[4,P.ADAPTER.fetch(r)];case 1:if(t=n.sent(),!t.ok)throw new Error("[loadImageBitmap] Failed to fetch "+r+": "+(t.status+" "+t.statusText));return[4,t.blob()];case 2:return e=n.sent(),[4,createImageBitmap(e)];case 3:return i=n.sent(),[2,i]}})})}var An={extension:F.LoadParser,config:{preferWorkers:!0},test:function(r){for(var t=!1,e=0;e<Si.length;e++)if(r.indexOf("data:image/"+Si[e].slice(1))===0){t=!0;break}return t||Kr(r,Si)},load:function(r,t,e){return U(this,void 0,Promise,function(){var i,n,s;return G(this,function(a){switch(a.label){case 0:return i=null,window.createImageBitmap?(n=this.config.preferWorkers,n?[4,Rs.isImageBitmapSupported()]:[3,2]):[3,7];case 1:n=a.sent(),a.label=2;case 2:return n?[4,Rs.loadImageBitmap(r)]:[3,4];case 3:return i=a.sent(),[3,6];case 4:return[4,Wc(r)];case 5:i=a.sent(),a.label=6;case 6:return[3,9];case 7:return[4,new Promise(function(o){i=new Image,i.crossOrigin="anonymous",i.src=r,i.complete?o(i):i.onload=function(){o(i)}})];case 8:i=a.sent(),a.label=9;case 9:return s=new X(i,qt({resolution:te(r)},t.data)),s.resource.src=r,[2,ir(s,e,r)]}})})},unload:function(r){r.destroy(!0)}},Vc={extension:F.LoadParser,test:function(r){return ht.extname(r).includes(".svg")},testParse:function(r){return U(this,void 0,Promise,function(){return G(this,function(t){return[2,Mi.test(r)]})})},parse:function(r,t,e){var i,n,s;return U(this,void 0,Promise,function(){var a,o,h;return G(this,function(u){switch(u.label){case 0:return a=new Mi(r,(i=t==null?void 0:t.data)===null||i===void 0?void 0:i.resourceOptions),o=new X(a,qt({resolution:te(r)},t==null?void 0:t.data)),o.resource.src=r,h=ir(o,e,r),!((s=(n=t==null?void 0:t.data)===null||n===void 0?void 0:n.resourceOptions)===null||s===void 0)&&s.autoLoad?[3,2]:[4,a.load()];case 1:u.sent(),u.label=2;case 2:return[2,h]}})})},load:function(r,t){return U(this,void 0,Promise,function(){var e;return G(this,function(i){switch(i.label){case 0:return[4,P.ADAPTER.fetch(r)];case 1:return e=i.sent(),[2,e.text()]}})})},unload:An.unload},Yc=function(){function r(){this._parsers=[],this.promiseCache={}}return r.prototype.reset=function(){this.promiseCache={}},r.prototype._getLoadPromiseAndParser=function(t,e){var i=this,n={promise:null,parser:null};return n.promise=function(){return U(i,void 0,void 0,function(){var s,a,o,a,o,h,u,l;return G(this,function(f){switch(f.label){case 0:s=null,a=0,f.label=1;case 1:return a<this.parsers.length?(o=this.parsers[a],o.load&&((u=o.test)===null||u===void 0?void 0:u.call(o,t,e,this))?[4,o.load(t,e,this)]:[3,3]):[3,4];case 2:return s=f.sent(),n.parser=o,[3,4];case 3:return a++,[3,1];case 4:if(!n.parser)return console.warn("[Assets] "+t+" could not be loaded as we don't know how to parse it, ensure the correct parser has being added"),[2,null];a=0,f.label=5;case 5:return a<this.parsers.length?(o=this.parsers[a],o.parse?(h=o.parse,h?[4,(l=o.testParse)===null||l===void 0?void 0:l.call(o,s,e,this)]:[3,7]):[3,9]):[3,10];case 6:h=f.sent(),f.label=7;case 7:return h?[4,o.parse(s,e,this)]:[3,9];case 8:s=f.sent()||s,n.parser=o,f.label=9;case 9:return a++,[3,5];case 10:return[2,s]}})})}(),n},r.prototype.load=function(t,e){return U(this,void 0,Promise,function(){var i,n,s,a,o,h,u=this;return G(this,function(l){switch(l.label){case 0:return i=0,n={},s=jr(t),a=Yt(t,function(f){return{src:f}}),o=a.length,h=a.map(function(f){return U(u,void 0,void 0,function(){var c,d,p,v;return G(this,function(_){switch(_.label){case 0:if(c=ht.toAbsolute(f.src),n[f.src])return[3,4];_.label=1;case 1:return _.trys.push([1,3,,4]),this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,f)),d=n,p=f.src,[4,this.promiseCache[c].promise];case 2:return d[p]=_.sent(),e&&e(++i/o),[3,4];case 3:throw v=_.sent(),delete this.promiseCache[c],delete n[f.src],new Error("[Loader.load] Failed to load "+c+`.
`+v);case 4:return[2]}})})}),[4,Promise.all(h)];case 1:return l.sent(),[2,s?n[a[0].src]:n]}})})},r.prototype.unload=function(t){return U(this,void 0,Promise,function(){var e,i,n=this;return G(this,function(s){switch(s.label){case 0:return e=Yt(t,function(a){return{src:a}}),i=e.map(function(a){return U(n,void 0,void 0,function(){var o,h,u,l,f;return G(this,function(c){switch(c.label){case 0:return o=ht.toAbsolute(a.src),h=this.promiseCache[o],h?[4,h.promise]:[3,2];case 1:u=c.sent(),(f=(l=h.parser)===null||l===void 0?void 0:l.unload)===null||f===void 0||f.call(l,u,a,this),delete this.promiseCache[o],c.label=2;case 2:return[2]}})})}),[4,Promise.all(i)];case 1:return s.sent(),[2]}})})},Object.defineProperty(r.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),r}(),zc=["jpg","png","jpeg","avif","webp"],qc={extension:F.ResolveParser,test:function(r){var t=r.split("?")[0],e=t.split("."),i=e.pop(),n=e.pop();return i==="json"&&zc.includes(n)},parse:function(r){var t,e,i=r.split(".");return{resolution:parseFloat((e=(t=P.RETINA_PREFIX.exec(r))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:"1"),format:i[i.length-2],src:r}}},$c={extension:F.ResolveParser,test:An.test,parse:function(r){var t,e;return{resolution:parseFloat((e=(t=P.RETINA_PREFIX.exec(r))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:"1"),format:r.split(".").pop(),src:r}}};F.ResolveParser;var Kc=function(){function r(){this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}return r.prototype.prefer=function(){for(var t=arguments,e=this,i=[],n=0;n<arguments.length;n++)i[n]=t[n];i.forEach(function(s){e._preferredOrder.push(s),s.priority||(s.priority=Object.keys(s.params))}),this._resolverHash={}},Object.defineProperty(r.prototype,"basePath",{get:function(){return this._basePath},set:function(t){this._basePath=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rootPath",{get:function(){return this._rootPath},set:function(t){this._rootPath=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this._preferredOrder=[],this._resolverHash={},this._assetMap={},this._rootPath=null,this._basePath=null,this._manifest=null},r.prototype.addManifest=function(t){var e=this;this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(function(i){e.addBundle(i.name,i.assets)})},r.prototype.addBundle=function(t,e){var i=this,n=[];Array.isArray(e)?e.forEach(function(s){typeof s.name=="string"?n.push(s.name):n.push.apply(n,s.name),i.add(s.name,s.srcs)}):Object.keys(e).forEach(function(s){n.push(s),i.add(s,e[s])}),this._bundles[t]=n},r.prototype.add=function(t,e,i){var n=this,s=Yt(t);s.forEach(function(o){n._assetMap[o]&&console.warn("[Resolver] already has key: "+o+" overwriting")}),Array.isArray(e)||(typeof e=="string"?e=Ac(e):e=[e]);var a=e.map(function(o){var h,u=o;if(typeof o=="string"){for(var l=!1,f=0;f<n._parsers.length;f++){var c=n._parsers[f];if(c.test(o)){u=c.parse(o),l=!0;break}}l||(u={src:o})}return u.format||(u.format=u.src.split(".").pop()),u.alias||(u.alias=s),(n._basePath||n._rootPath)&&(u.src=ht.toAbsolute(u.src,n._basePath,n._rootPath)),u.data=(h=u.data)!==null&&h!==void 0?h:i,u});s.forEach(function(o){n._assetMap[o]=a})},r.prototype.resolveBundle=function(t){var e=this,i=jr(t);t=Yt(t);var n={};return t.forEach(function(s){var a=e._bundles[s];a&&(n[s]=e.resolve(a))}),i?n[t[0]]:n},r.prototype.resolveUrl=function(t){var e=this.resolve(t);if(typeof t!="string"){var i={};for(var n in e)i[n]=e[n].src;return i}return e.src},r.prototype.resolve=function(t){var e=this,i=jr(t);t=Yt(t);var n={};return t.forEach(function(s){var a;if(!e._resolverHash[s])if(e._assetMap[s]){var o=e._assetMap[s],h=e._getPreferredOrder(o),u=o[0];h==null||h.priority.forEach(function(f){h.params[f].forEach(function(c){var d=o.filter(function(p){return p[f]?p[f]===c:!1});d.length&&(o=d)})}),e._resolverHash[s]=(a=o[0])!==null&&a!==void 0?a:u}else{var l=s;(e._basePath||e._rootPath)&&(l=ht.toAbsolute(l,e._basePath,e._rootPath)),e._resolverHash[s]={src:l}}n[s]=e._resolverHash[s]}),i?n[t[0]]:n},r.prototype._getPreferredOrder=function(t){for(var e=function(a){var o=t[0],h=i._preferredOrder.find(function(u){return u.params.format.includes(o.format)});if(h)return{value:h}},i=this,n=0;n<t.length;n++){var s=e();if(typeof s=="object")return s.value}return this._preferredOrder[0]},r}(),Zc=function(){function r(){this._detections=[],this._initialized=!1,this.resolver=new Kc,this.loader=new Yc,this.cache=He,this._backgroundLoader=new wc(this.loader),this._backgroundLoader.active=!0,this.reset()}return r.prototype.init=function(t){var e,i,n,s;return t===void 0&&(t={}),U(this,void 0,Promise,function(){var a,o,h,u,l,f,c,v,d,p,v;return G(this,function(_){switch(_.label){case 0:return this._initialized?(console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?"),[2]):(this._initialized=!0,t.basePath&&(this.resolver.basePath=t.basePath),t.manifest?(a=t.manifest,typeof a!="string"?[3,2]:[4,this.load(a)]):[3,3]);case 1:a=_.sent(),_.label=2;case 2:this.resolver.addManifest(a),_.label=3;case 3:if(o=(i=(e=t.texturePreference)===null||e===void 0?void 0:e.resolution)!==null&&i!==void 0?i:1,h=typeof o=="number"?[o]:o,!(!((n=t.texturePreference)===null||n===void 0)&&n.format))return[3,9];l=(s=t.texturePreference)===null||s===void 0?void 0:s.format,u=typeof l=="string"?[l]:l,f=0,c=this._detections,_.label=4;case 4:return f<c.length?(v=c[f],[4,v.test()]):[3,8];case 5:return _.sent()?[3,7]:[4,v.remove(u)];case 6:u=_.sent(),_.label=7;case 7:return f++,[3,4];case 8:return[3,14];case 9:u=["png","jpg","jpeg"],d=0,p=this._detections,_.label=10;case 10:return d<p.length?(v=p[d],[4,v.test()]):[3,14];case 11:return _.sent()?[4,v.add(u)]:[3,13];case 12:u=_.sent(),_.label=13;case 13:return d++,[3,10];case 14:return this.resolver.prefer({params:{format:u,resolution:h}}),[2]}})})},r.prototype.add=function(t,e,i){this.resolver.add(t,e,i)},r.prototype.load=function(t,e){return U(this,void 0,Promise,function(){var i,n,s,a,o=this;return G(this,function(h){switch(h.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:h.sent(),h.label=2;case 2:return i=jr(t),n=Yt(t).map(function(u){return typeof u!="string"?(o.resolver.add(u.src,u),u.src):u}),s=this.resolver.resolve(n),[4,this._mapLoadToResolve(s,e)];case 3:return a=h.sent(),[2,i?a[n[0]]:a]}})})},r.prototype.addBundle=function(t,e){this.resolver.addBundle(t,e)},r.prototype.loadBundle=function(t,e){return U(this,void 0,Promise,function(){var i,n,s,a,o,h,u,l,f=this;return G(this,function(c){switch(c.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:c.sent(),c.label=2;case 2:return i=!1,typeof t=="string"&&(i=!0,t=[t]),n=this.resolver.resolveBundle(t),s={},a=Object.keys(n),o=0,h=0,u=function(){e==null||e(++o/h)},l=a.map(function(d){var p=n[d];return h+=Object.keys(p).length,f._mapLoadToResolve(p,u).then(function(v){s[d]=v})}),[4,Promise.all(l)];case 3:return c.sent(),[2,i?s[t[0]]:s]}})})},r.prototype.backgroundLoad=function(t){return U(this,void 0,Promise,function(){var e;return G(this,function(i){switch(i.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:i.sent(),i.label=2;case 2:return typeof t=="string"&&(t=[t]),e=this.resolver.resolve(t),this._backgroundLoader.add(Object.values(e)),[2]}})})},r.prototype.backgroundLoadBundle=function(t){return U(this,void 0,Promise,function(){var e,i=this;return G(this,function(n){switch(n.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:n.sent(),n.label=2;case 2:return typeof t=="string"&&(t=[t]),e=this.resolver.resolveBundle(t),Object.values(e).forEach(function(s){i._backgroundLoader.add(Object.values(s))}),[2]}})})},r.prototype.reset=function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1},r.prototype.get=function(t){if(typeof t=="string")return He.get(t);for(var e={},i=0;i<t.length;i++)e[i]=He.get(t[i]);return e},r.prototype._mapLoadToResolve=function(t,e){return U(this,void 0,Promise,function(){var i,n,s,a;return G(this,function(o){switch(o.label){case 0:return i=Object.values(t),n=Object.keys(t),this._backgroundLoader.active=!1,[4,this.loader.load(i,e)];case 1:return s=o.sent(),this._backgroundLoader.active=!0,a={},i.forEach(function(h,u){var l=s[h.src],f=[h.src];h.alias&&f.push.apply(f,h.alias),a[n[u]]=l,He.set(f,l)}),[2,a]}})})},r.prototype.unload=function(t){return U(this,void 0,Promise,function(){var e,i;return G(this,function(n){switch(n.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:n.sent(),n.label=2;case 2:return e=Yt(t).map(function(s){return typeof s!="string"?s.src:s}),i=this.resolver.resolve(e),[4,this._unloadFromResolved(i)];case 3:return n.sent(),[2]}})})},r.prototype.unloadBundle=function(t){return U(this,void 0,Promise,function(){var e,i,n=this;return G(this,function(s){switch(s.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:s.sent(),s.label=2;case 2:return t=Yt(t),e=this.resolver.resolveBundle(t),i=Object.keys(e).map(function(a){return n._unloadFromResolved(e[a])}),[4,Promise.all(i)];case 3:return s.sent(),[2]}})})},r.prototype._unloadFromResolved=function(t){return U(this,void 0,void 0,function(){var e;return G(this,function(i){switch(i.label){case 0:return e=Object.values(t),e.forEach(function(n){He.remove(n.src)}),[4,this.loader.unload(e)];case 1:return i.sent(),[2]}})})},Object.defineProperty(r.prototype,"detections",{get:function(){return this._detections},enumerable:!1,configurable:!0}),r}(),Tr=new Zc;At.handleByList(F.LoadParser,Tr.loader.parsers).handleByList(F.ResolveParser,Tr.resolver.parsers).handleByList(F.CacheParser,Tr.cache.parsers).handleByList(F.DetectionParser,Tr.detections);At.add(An,Vc,Nc,Mc,Lc,Bc,Gc,Rc,Pc,$c,qc,Ic,Cc);/*!
* @pixi/graphics - v6.5.8
* Compiled Sun, 23 Oct 2022 23:01:45 UTC
*
* @pixi/graphics is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var Wt;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(Wt||(Wt={}));var Jt;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(Jt||(Jt={}));var Je={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,t){if(t===void 0&&(t=20),!this.adaptive||!r||isNaN(r))return t;var e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.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];a<n;a+=2){var u=r[a],l=r[a+1];s+=(u-o)*(l+h),o=u,h=l}if(!t&&s>0||t&&s<=0)for(var f=n/2,a=f+f%2;a<n;a+=2){var c=n-a-2,d=n-a-1,p=a,v=a+1;e=[r[p],r[c]],r[c]=e[0],r[p]=e[1],i=[r[v],r[d]],r[d]=i[0],r[v]=i[1]}}}var ya={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,t){var e=r.points,i=r.holes,n=t.points,s=t.indices;if(e.length>=6){Ps(e,!1);for(var a=[],o=0;o<i.length;o++){var h=i[o];Ps(h.points,!0),a.push(e.length/2),e=e.concat(h.points)}var u=Ns(e,a,2);if(!u)return;for(var l=n.length/2,o=0;o<u.length;o+=3)s.push(u[o]+l),s.push(u[o+1]+l),s.push(u[o+2]+l);for(var o=0;o<e.length;o++)n.push(e[o])}}},Wr={build:function(r){var t=r.points,e,i,n,s,a,o;if(r.type===at.CIRC){var h=r.shape;e=h.x,i=h.y,a=o=h.radius,n=s=0}else if(r.type===at.ELIP){var u=r.shape;e=u.x,i=u.y,a=u.width,o=u.height,n=s=0}else{var l=r.shape,f=l.width/2,c=l.height/2;e=l.x+f,i=l.y+c,a=o=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-a,s=c-o}if(!(a>=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;T<d;T++){var R=Math.PI/2*(T/d),E=n+Math.cos(R)*a,w=s+Math.sin(R)*o,y=e+E,b=e-E,g=i+w,A=i-w;t[v++]=y,t[v++]=g,t[--_]=g,t[--_]=b,t[m++]=b,t[m++]=A,t[--x]=A,t[--x]=y}{var E=n,w=s+o,y=e+E,b=e-E,g=i+w,A=i-w;t[v++]=y,t[v++]=g,t[--x]=A,t[--x]=y,n&&(t[v++]=b,t[v++]=g,t[--x]=A,t[--x]=b)}}},triangulate:function(r,t){var e=r.points,i=t.points,n=t.indices;if(e.length!==0){var s=i.length/2,a=s,o,h;if(r.type!==at.RREC){var u=r.shape;o=u.x,h=u.y}else{var l=r.shape;o=l.x+l.width/2,h=l.y+l.height/2}var f=r.matrix;i.push(r.matrix?f.a*o+f.c*h+f.tx:o,r.matrix?f.b*o+f.d*h+f.ty:h),s++,i.push(e[0],e[1]);for(var c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),n.push(s++,a,s);n.push(a+1,a,s)}}},Qc={build:function(r){var t=r.shape,e=t.x,i=t.y,n=t.width,s=t.height,a=r.points;a.length=0,a.push(e,i,e+n,i,e+n,i+s,e,i+s)},triangulate:function(r,t){var e=r.points,i=t.points,n=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function Ae(r,t,e){var i=t-r;return r+i*e}function wr(r,t,e,i,n,s,a){a===void 0&&(a=[]);for(var o=20,h=a,u=0,l=0,f=0,c=0,d=0,p=0,v=0,_=0;v<=o;++v)_=v/o,u=Ae(r,e,_),l=Ae(t,i,_),f=Ae(e,n,_),c=Ae(i,s,_),d=Ae(u,f,_),p=Ae(l,c,_),!(v===0&&h[h.length-2]===d&&h[h.length-1]===p)&&h.push(d,p);return h}var Jc={build:function(r){if(Ls.nextRoundedRectBehavior){Wr.build(r);return}var t=r.shape,e=r.points,i=t.x,n=t.y,s=t.width,a=t.height,o=Math.max(0,Math.min(t.radius,Math.min(s,a)/2));e.length=0,o?(wr(i,n+o,i,n,i+o,n,e),wr(i+s-o,n,i+s,n,i+s,n+o,e),wr(i+s,n+a-o,i+s,n+a,i+s-o,n+a,e),wr(i+o,n+a,i,n+a,i,n+a-o,e)):e.push(i,n,i+s,n,i+s,n+a,i,n+a)},triangulate:function(r,t){if(Ls.nextRoundedRectBehavior){Wr.triangulate(r,t);return}for(var e=r.points,i=t.points,n=t.indices,s=i.length/2,a=Ns(e,null,2),o=0,h=a.length;o<h;o+=3)n.push(a[o]+s),n.push(a[o+1]+s),n.push(a[o+2]+s);for(var o=0,h=e.length;o<h;o++)i.push(e[o],e[++o])}};function Cs(r,t,e,i,n,s,a,o){var h=r-e*n,u=t-i*n,l=r+e*s,f=t+i*s,c,d;a?(c=i,d=-e):(c=-i,d=e);var p=h+c,v=u+d,_=l+c,m=f+d;return o.push(p,v),o.push(_,m),2}function oe(r,t,e,i,n,s,a,o){var h=e-r,u=i-t,l=Math.atan2(h,u),f=Math.atan2(n-r,s-t);o&&l<f?l+=Math.PI*2:!o&&l>f&&(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)<n&&Math.abs(a.y-o.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));var l=(a.x+o.x)*.5,f=(o.y+a.y)*.5;i.unshift(l,f),i.push(l,f)}var c=t.points,d=i.length/2,p=i.length,v=c.length/2,_=s.width/2,m=_*_,x=s.miterLimit*s.miterLimit,E=i[0],w=i[1],y=i[2],b=i[3],g=0,A=0,T=-(w-b),R=E-y,O=0,D=0,j=Math.sqrt(T*T+R*R);T/=j,R/=j,T*=_,R*=_;var et=s.alignment,C=(1-et)*2,I=et*2;h||(s.cap===Jt.ROUND?p+=oe(E-T*(C-I)*.5,w-R*(C-I)*.5,E-T*C,w-R*C,E+T*I,w+R*I,c,!0)+2:s.cap===Jt.SQUARE&&(p+=Cs(E,w,T,R,C,I,!0,c))),c.push(E-T*C,w-R*C),c.push(E+T*I,w+R*I);for(var H=1;H<d-1;++H){E=i[(H-1)*2],w=i[(H-1)*2+1],y=i[H*2],b=i[H*2+1],g=i[(H+1)*2],A=i[(H+1)*2+1],T=-(w-b),R=E-y,j=Math.sqrt(T*T+R*R),T/=j,R/=j,T*=_,R*=_,O=-(b-A),D=y-g,j=Math.sqrt(O*O+D*D),O/=j,D/=j,O*=_,D*=_;var lt=y-E,V=w-b,it=y-g,N=A-b,nr=lt*it+V*N,Kt=V*it-N*lt,Lt=Kt<0;if(Math.abs(Kt)<.001*Math.abs(nr)){c.push(y-T*C,b-R*C),c.push(y+T*I,b+R*I),nr>=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;H<p+v-2;++H)E=c[H*2],w=c[H*2+1],y=c[(H+1)*2],b=c[(H+1)*2+1],g=c[(H+2)*2],A=c[(H+2)*2+1],!(Math.abs(E*(b-A)+y*(A-w)+g*(w-b))<Ee)&&Pt.push(H,H+1,H+2)}}function ed(r,t){var e=0,i=r.shape,n=r.points||i.points,s=i.type!==at.POLY||i.closeStroke;if(n.length!==0){var a=t.points,o=t.indices,h=n.length/2,u=a.length/2,l=u;for(a.push(n[0],n[1]),e=1;e<h;e++)a.push(n[e*2],n[e*2+1]),o.push(l,l+1),l++;s&&o.push(l,u)}}function Is(r,t){r.lineStyle.native?ed(r,t):td(r,t)}var Os=function(){function r(){}return r.curveTo=function(t,e,i,n,s,a){var o=a[a.length-2],h=a[a.length-1],u=h-e,l=o-t,f=n-e,c=i-t,d=Math.abs(u*c-l*f);if(d<1e-8||s===0)return(a[a.length-2]!==t||a[a.length-1]!==e)&&a.push(t,e),null;var p=u*u+l*l,v=f*f+c*c,_=u*f+l*c,m=s*Math.sqrt(p)/d,x=s*Math.sqrt(v)/d,E=m*_/p,w=x*_/v,y=m*c+x*l,b=m*f+x*u,g=l*(x+E),A=u*(x+E),T=c*(m+w),R=f*(m+w),O=Math.atan2(A-b,g-y),D=Math.atan2(R-b,T-y);return{cx:y+t,cy:b+e,radius:s,startAngle:O,endAngle:D,anticlockwise:l*f>c*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;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Ar.push(this.drawCalls[e]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var i=this.batches[e];i.reset(),Bs.push(i)}this.batches.length=0},t.prototype.clear=function(){return this.graphicsData.length>0&&(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;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},t.prototype.containsPoint=function(e){for(var i=this.graphicsData,n=0;n<i.length;++n){var s=i[n];if(!!s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(e,Se):Se.copyFrom(e),s.shape.contains(Se.x,Se.y))){var a=!1;if(s.holes)for(var o=0;o<s.holes.length;o++){var h=s.holes[o];if(h.shape.contains(Se.x,Se.y)){a=!0;break}}if(!a)return!0}}return!1},t.prototype.updateBatches=function(){if(!this.graphicsData.length){this.batchable=!0;return}if(!!this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,i=this.graphicsData,n=null,s=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],s=n.style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var o=i[a],h=o.fillStyle,u=o.lineStyle,l=Ri[o.type];l.build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(h.visible||u.visible)&&this.processHoles(o.holes);for(var f=0;f<2;f++){var c=f===0?h:u;if(!!c.visible){var d=c.texture.baseTexture,p=this.indices.length,v=this.points.length/2;d.wrapMode=Be.REPEAT,f===0?this.processFill(o):this.processLine(o);var _=this.points.length/2-v;_!==0&&(n&&!this._compareStyles(s,c)&&(n.end(p,v),n=null),n||(n=Bs.pop()||new nd,n.begin(c,p,v),this.batches.push(n),s=c),this.addUvs(this.points,e,c.texture,v,_,c.matrix))}}}var m=this.indices.length,x=this.points.length/2;if(n&&n.end(m,x),this.batches.length===0){this.batchable=!0;return}var E=x>65535;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;e<i;e++){var n=this.graphicsData[e],s=n.fillStyle,a=n.lineStyle;if(s&&!s.texture.baseTexture.valid||a&&!a.texture.baseTexture.valid)return!1}return!0},t.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var e=this.batches,i=0,n=e.length;i<n;i++)for(var s=e[i],a=0;a<s.size;a++){var o=s.start+a;this.indicesUint16[o]=this.indicesUint16[o]-s.attribStart}},t.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var e=this.batches,i=0;i<e.length;i++)if(e[i].style.native)return!1;return this.points.length<t.BATCHABLE_SIZE*2},t.prototype.buildDrawCalls=function(){for(var e=++X._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Ar.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,a=Ar.pop();a||(a=new Ni,a.texArray=new Fi),a.texArray.count=0,a.start=0,a.size=0,a.type=Tt.TRIANGLES;var o=0,h=null,u=0,l=!1,f=Tt.TRIANGLES,c=0;this.drawCalls.push(a);for(var i=0;i<this.batches.length;i++){var d=this.batches[i],p=8,v=d.style,_=v.texture.baseTexture;l!==!!v.native&&(l=!!v.native,f=l?Tt.LINES:Tt.TRIANGLES,h=null,o=p,e++),h!==_&&(h=_,_._batchEnabled!==e&&(o===p&&(e++,o=0,a.size>0&&(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<e.length/2;l++)o[u++]=e[l*2],o[u++]=e[l*2+1],o[u++]=i[l*2],o[u++]=i[l*2+1],h[u++]=n[l],o[u++]=s[l];this._buffer.update(a),this._indexBuffer.update(this.indicesUint16)},t.prototype.processFill=function(e){if(e.holes.length)ya.triangulate(e,this);else{var i=Ri[e.type];i.triangulate(e,this)}},t.prototype.processLine=function(e){Is(e,this);for(var i=0;i<e.holes.length;i++)Is(e.holes[i],this)},t.prototype.processHoles=function(e){for(var i=0;i<e.length;i++){var n=e[i],s=Ri[n.type];s.build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}},t.prototype.calculateBounds=function(){var e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)},t.prototype.transformPoints=function(e,i){for(var n=0;n<e.length/2;n++){var s=e[n*2],a=e[n*2+1];e[n*2]=i.a*s+i.c*a+i.tx,e[n*2+1]=i.b*s+i.d*a+i.ty}},t.prototype.addColors=function(e,i,n,s,a){a===void 0&&(a=0);var o=(i>>16)+(i&65280)+((i&255)<<16),h=Us(o,n);e.length=Math.max(e.length,a+s);for(var u=0;u<s;u++)e[a+u]=h},t.prototype.addTextureIds=function(e,i,n,s){s===void 0&&(s=0),e.length=Math.max(e.length,s+n);for(var a=0;a<n;a++)e[s+a]=i},t.prototype.addUvs=function(e,i,n,s,a,o){o===void 0&&(o=null);for(var h=0,u=i.length,l=n.frame;h<a;){var f=e[(s+h)*2],c=e[(s+h)*2+1];if(o){var d=o.a*f+o.c*c+o.tx;c=o.b*f+o.d*c+o.ty,f=d}h++,i.push(f/l.width,c/l.height)}var p=n.baseTexture;(l.width<p.width||l.height<p.height)&&this.adjustUvs(i,n,u,a)},t.prototype.adjustUvs=function(e,i,n,s){for(var a=i.baseTexture,o=1e-6,h=n+s*2,u=i.frame,l=u.width/a.width,f=u.height/a.height,c=u.x/u.width,d=u.y/u.height,p=Math.floor(e[n]+o),v=Math.floor(e[n+1]+o),_=n+2;_<h;_+=2)p=Math.min(p,Math.floor(e[_]+o)),v=Math.min(v,Math.floor(e[_+1]+o));c-=p,d-=v;for(var _=n;_<h;_+=2)e[_]=(e[_]+c)*l,e[_+1]=(e[_+1]+d)*f},t.BATCHABLE_SIZE=100,t}(ea),ad=function(r){Sn(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Jt.BUTT,e.join=Wt.MITER,e.miterLimit=10,e}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e},t.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},t}(ga),od=new Float32Array(3),Pi={},Ls=function(r){Sn(t,r);function t(e){e===void 0&&(e=null);var i=r.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new ga,i._lineStyle=new ad,i._matrix=null,i._holeMode=!1,i.state=er.for2d(),i._geometry=e||new sd,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=B.NORMAL,i}return Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return this.finishPoly(),new t(this._geometry)},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,"tint",{get:function(){return this._tint},set:function(e){this._tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),t.prototype.lineStyle=function(e,i,n,s,a){return e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=.5),a===void 0&&(a=!1),typeof e=="number"&&(e={width:e,color:i,alpha:n,alignment:s,native:a}),this.lineTextureStyle(e)},t.prototype.lineTextureStyle=function(e){e=Object.assign({width:0,texture:k.WHITE,color:e&&e.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Jt.BUTT,join:Wt.MITER,miterLimit:10},e),this.currentPath&&this.startPoly();var i=e.width>0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this},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);d<f&&p<f||c.push(u,l)}else this.moveTo(u,l),c=this.currentPath.points;return Os.arc(u,l,e,i,n,s,a,o,c),this},t.prototype.beginFill=function(e,i){return e===void 0&&(e=0),i===void 0&&(i=1),this.beginTextureFill({texture:k.WHITE,color:e,alpha:i})},t.prototype.beginTextureFill=function(e){e=Object.assign({texture:k.WHITE,color:16777215,alpha:1,matrix:null},e),this.currentPath&&this.startPoly();var i=e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this},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<arguments.length;n++)i[n]=e[n];var s,a=!0,o=i[0];o.points?(a=o.closeStroke,s=o.points):Array.isArray(i[0])?s=i[0]:s=i;var h=new Sr(s);return h.closeStroke=a,this.drawShape(h),this},t.prototype.drawShape=function(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},t.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},t.prototype.isFastRect=function(){var e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===at.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)},t.prototype._render=function(e){this.finishPoly();var i=this._geometry;i.updateBatches(),i.batchable?(this.batchDirty!==i.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))},t.prototype._populateBatches=function(){var e=this._geometry,i=this.blendMode,n=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(e.points);for(var s=0;s<n;s++){var a=e.batches[s],o=a.style.color,h=new Float32Array(this.vertexData.buffer,a.attribStart*4*2,a.attribSize*2),u=new Float32Array(e.uvsFloat32.buffer,a.attribStart*4*2,a.attribSize*2),l=new Uint16Array(e.indicesUint16.buffer,a.start*2,a.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:ze(o),_tintRGB:o,_texture:a.style.texture,alpha:a.style.alpha,worldAlpha:1};this.batches[s]=f}},t.prototype._renderBatched=function(e){if(!!this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var i=0,n=this.batches.length;i<n;i++){var s=this.batches[i];s.worldAlpha=this.worldAlpha*s.alpha,e.plugins[this.pluginName].render(s)}}},t.prototype._renderDirect=function(e){var i=this._resolveDirectShader(e),n=this._geometry,s=this.tint,a=this.worldAlpha,o=i.uniforms,h=n.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(s>>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<l;u++)this._renderDrawCallDirect(e,n.drawCalls[u])},t.prototype._renderDrawCallDirect=function(e,i){for(var n=i.texArray,s=i.type,a=i.size,o=i.start,h=n.count,u=0;u<h;u++)e.texture.bind(n.elements[u],u);e.geometry.draw(s,a,o)},t.prototype._resolveDirectShader=function(e){var i=this.shader,n=this.pluginName;if(!i){if(!Pi[n]){for(var s=e.plugins[n].MAX_TEXTURES,a=new Int32Array(s),o=0;o<s;o++)a[o]=o;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new dt,default:ve.from({uSamplers:a},!0)},u=e.plugins[n]._shader.program;Pi[n]=new zr(u,h)}i=Pi[n]}return i},t.prototype._calculateBounds=function(){this.finishPoly();var e=this._geometry;if(!!e.graphicsData.length){var i=e.bounds,n=i.minX,s=i.minY,a=i.maxX,o=i.maxY;this._bounds.addFrame(this.transform,n,s,a,o)}},t.prototype.containsPoint=function(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)},t.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var e=ze(this.tint,od),i=0;i<this.batches.length;i++){var n=this.batches[i],s=n._batchRGB,a=e[0]*s[0]*255,o=e[1]*s[1]*255,h=e[2]*s[2]*255,u=(a<<16)+(o<<8)+(h|0);n._tintRGB=(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<l.length;d+=2){var p=l[d],v=l[d+1];f[c++]=n*p+a*v+h,f[c++]=o*v+s*p+u}}},t.prototype.closePath=function(){var e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this},t.prototype.setMatrix=function(e){return this._matrix=e,this},t.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},t.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},t.prototype.destroy=function(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,e)},t.nextRoundedRectBehavior=!1,t._TEMP_POINT=new q,t}(me);export{Tf as A,of as B,me as C,$ as E,Ls as G,ra as S,fd as T,Tr as a,At as e,cd as u};