mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-29 03:21:42 +00:00
851 lines
379 KiB
JavaScript
851 lines
379 KiB
JavaScript
import{E as Nr}from"./eventemitter3.dc5195d7.js";import{e as Zn}from"./earcut.7c12e2a9.js";import{p as Ca,f as Oa,r as Ba}from"./url.5a27916e.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 kt;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(kt||(kt={}));var Ue;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Ue||(Ue={}));var mr;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(mr||(mr={}));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 Et;(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"})(Et||(Et={}));var w;(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"})(w||(w={}));var oe;(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"})(oe||(oe={}));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 yr;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(yr||(yr={}));var Rt;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Rt||(Rt={}));var Ae;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ae||(Ae={}));var ot;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(ot||(ot={}));var lt;(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"})(lt||(lt={}));var Vt;(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"})(Vt||(Vt={}));var br;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(br||(br={}));var ct;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(ct||(ct={}));var et;(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"})(et||(et={}));var Yi;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Yi||(Yi={}));var J;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(J||(J={}));var St;(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"})(St||(St={}));/*!
|
|
* @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 Ma={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)}},Ur=/iPhone/i,zi=/iPod/i,qi=/iPad/i,$i=/\biOS-universal(?:.+)Mac\b/i,Gr=/\bAndroid(?:.+)Mobile\b/i,Ki=/Android/i,_e=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ke=/Silk/i,Ct=/Windows Phone/i,Zi=/\bWindows(?:.+)ARM\b/i,Qi=/BlackBerry/i,Ji=/BB10/i,tn=/Opera Mini/i,en=/\b(CriOS|Chrome)(?:.+)Mobile/i,rn=/Mobile(?:.+)Firefox\b/i,nn=function(r){return typeof r!="undefined"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream=="undefined"};function Na(r){return function(t){return t.test(r)}}function Fa(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=Na(e),a={apple:{phone:n(Ur)&&!n(Ct),ipod:n(zi),tablet:!n(Ur)&&(n(qi)||nn(t))&&!n(Ct),universal:n($i),device:(n(Ur)||n(zi)||n(qi)||n($i)||nn(t))&&!n(Ct)},amazon:{phone:n(_e),tablet:!n(_e)&&n(Ke),device:n(_e)||n(Ke)},android:{phone:!n(Ct)&&n(_e)||!n(Ct)&&n(Gr),tablet:!n(Ct)&&!n(_e)&&!n(Gr)&&(n(Ke)||n(Ki)),device:!n(Ct)&&(n(_e)||n(Ke)||n(Gr)||n(Ki))||n(/\bokhttp\b/i)},windows:{phone:n(Ct),tablet:n(Zi),device:n(Ct)||n(Zi)},other:{blackberry:n(Qi),blackberry10:n(Ji),opera:n(tn),firefox:n(rn),chrome:n(en),device:n(Qi)||n(Ji)||n(tn)||n(rn)||n(en)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var se=Fa(globalThis.navigator);function La(){return!se.apple.device}function Da(r){var t=!0;if(se.tablet||se.phone){if(se.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(t=!1)}}if(se.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 S={ADAPTER:Ma,MIPMAP_TEXTURES:ot.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:J.NONE,SPRITE_MAX_TEXTURES:Da(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:br.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Ae.CLAMP,SCALE_MODE:Rt.LINEAR,PRECISION_VERTEX:ct.HIGH,PRECISION_FRAGMENT:se.apple.device?ct.HIGH:ct.MEDIUM,CAN_UPLOAD_SAME_BUFFER:La(),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 be={parse:Ca,format:Oa,resolve:Ba};function gt(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function an(r){var t=r.split("?")[0];return t.split("#")[0]}function Ua(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ga(r,t,e){return r.replace(new RegExp(Ua(t),"g"),e)}function ka(r,t){for(var e="",i=0,n=-1,a=0,s,o=0;o<=r.length;++o){if(o<r.length)s=r.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(n===o-1||a===1))if(n!==o-1&&a===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,a=0;continue}}else if(e.length===2||e.length===1){e="",i=0,n=o,a=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,a=0}else s===46&&a!==-1?++a:a=-1}return e}var st={toPosix:function(r){return Ga(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){gt(r),r=this.toPosix(r);var t="",e=/^file:\/\/\//.exec(r),i=/^[^/:]+:\/\//.exec(r),n=/^[^/:]+:\//.exec(r);if(e||i||n){var a=(e==null?void 0:e[0])||(i==null?void 0:i[0])||(n==null?void 0:n[0]);t=a,r=r.slice(a.length)}return t},toAbsolute:function(r,t,e){if(this.isDataUrl(r))return r;var i=an(this.toPosix(t!=null?t:S.ADAPTER.getBaseUrl())),n=an(this.toPosix(e!=null?e:this.rootname(i)));if(gt(r),r=this.toPosix(r),r.startsWith("/"))return st.join(n,r.slice(1));var a=this.isAbsolute(r)?r:this.join(i,r);return a},normalize:function(r){if(r=this.toPosix(r),gt(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=ka(r,!1),r.length>0&&i&&(r+="/"),e?"/"+r:t+r},isAbsolute:function(r){return gt(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,a=0;a<e.length;++a){var s=e[a];if(gt(s),s.length>0)if(n===void 0)n=s;else{var o=(t=e[a-1])!==null&&t!==void 0?t:"";this.extname(o)?n+="/../"+s:n+="/"+s}}return n===void 0?".":this.normalize(n)},dirname:function(r){if(gt(r),r.length===0)return".";r=this.toPosix(r);var t=r.charCodeAt(0),e=t===47,i=-1,n=!0,a=this.getProtocol(r),s=r;r=r.slice(a.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(s)?a+r:a:e&&i===1?"//":a+r.slice(0,i)},rootname:function(r){gt(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){gt(r),t&>(t),r=this.toPosix(r);var e=0,i=-1,n=!0,a;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";var s=t.length-1,o=-1;for(a=r.length-1;a>=0;--a){var h=r.charCodeAt(a);if(h===47){if(!n){e=a+1;break}}else o===-1&&(n=!1,o=a+1),s>=0&&(h===t.charCodeAt(s)?--s===-1&&(i=a):(s=-1,i=o))}return e===i?i=o:i===-1&&(i=r.length),r.slice(e,i)}for(a=r.length-1;a>=0;--a)if(r.charCodeAt(a)===47){if(!n){e=a+1;break}}else i===-1&&(n=!1,i=a+1);return i===-1?"":r.slice(e,i)},extname:function(r){gt(r),r=this.toPosix(r);for(var t=-1,e=0,i=-1,n=!0,a=0,s=r.length-1;s>=0;--s){var o=r.charCodeAt(s);if(o===47){if(!n){e=s+1;break}continue}i===-1&&(n=!1,i=s+1),o===46?t===-1?t=s:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||i===-1||a===0||a===1&&t===i-1&&t===e+1?"":r.slice(t,i)},parse:function(r){gt(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 a=-1,s=0,o=-1,h=!0,u=r.length-1,l=0;u>=n;--u){if(e=r.charCodeAt(u),e===47){if(!h){s=u+1;break}continue}o===-1&&(h=!1,o=u+1),e===46?a===-1?a=u:l!==1&&(l=1):a!==-1&&(l=-1)}return a===-1||o===-1||l===0||l===1&&a===o-1&&a===s+1?o!==-1&&(s===0&&i?t.base=t.name=r.slice(1,o):t.base=t.name=r.slice(s,o)):(s===0&&i?(t.name=r.slice(1,a),t.base=r.slice(1,o)):(t.name=r.slice(s,a),t.base=r.slice(s,o)),t.ext=r.slice(a,o)),t.dir=this.dirname(r),t},sep:"/",delimiter:":"};S.RETINA_PREFIX=/@([0-9\.]+)x/;S.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var sn=!1,on="6.5.8";function Xa(r){var t;if(!sn){if(S.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[`
|
|
%c %c %c PixiJS `+on+" - \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 "+on+" - "+r+" - http://www.pixijs.com/");sn=!0}}var kr;function Ha(){return typeof kr=="undefined"&&(kr=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:S.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!S.ADAPTER.getWebGLRenderingContext())return!1;var e=S.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!!(i&&i.getContextAttributes().stencil);if(i){var a=i.getExtension("WEBGL_lose_context");a&&a.loseContext()}return i=null,n}catch{return!1}}()),kr}var ja="#f0f8ff",Wa="#faebd7",Va="#00ffff",Ya="#7fffd4",za="#f0ffff",qa="#f5f5dc",$a="#ffe4c4",Ka="#000000",Za="#ffebcd",Qa="#0000ff",Ja="#8a2be2",ts="#a52a2a",es="#deb887",rs="#5f9ea0",is="#7fff00",ns="#d2691e",as="#ff7f50",ss="#6495ed",os="#fff8dc",hs="#dc143c",us="#00ffff",ls="#00008b",fs="#008b8b",cs="#b8860b",ds="#a9a9a9",vs="#006400",ps="#a9a9a9",_s="#bdb76b",gs="#8b008b",ms="#556b2f",ys="#ff8c00",bs="#9932cc",Es="#8b0000",Ts="#e9967a",xs="#8fbc8f",As="#483d8b",ws="#2f4f4f",Rs="#2f4f4f",Ss="#00ced1",Ps="#9400d3",Is="#ff1493",Cs="#00bfff",Os="#696969",Bs="#696969",Ms="#1e90ff",Ns="#b22222",Fs="#fffaf0",Ls="#228b22",Ds="#ff00ff",Us="#dcdcdc",Gs="#f8f8ff",ks="#daa520",Xs="#ffd700",Hs="#808080",js="#008000",Ws="#adff2f",Vs="#808080",Ys="#f0fff0",zs="#ff69b4",qs="#cd5c5c",$s="#4b0082",Ks="#fffff0",Zs="#f0e68c",Qs="#fff0f5",Js="#e6e6fa",to="#7cfc00",eo="#fffacd",ro="#add8e6",io="#f08080",no="#e0ffff",ao="#fafad2",so="#d3d3d3",oo="#90ee90",ho="#d3d3d3",uo="#ffb6c1",lo="#ffa07a",fo="#20b2aa",co="#87cefa",vo="#778899",po="#778899",_o="#b0c4de",go="#ffffe0",mo="#00ff00",yo="#32cd32",bo="#faf0e6",Eo="#ff00ff",To="#800000",xo="#66cdaa",Ao="#0000cd",wo="#ba55d3",Ro="#9370db",So="#3cb371",Po="#7b68ee",Io="#00fa9a",Co="#48d1cc",Oo="#c71585",Bo="#191970",Mo="#f5fffa",No="#ffe4e1",Fo="#ffe4b5",Lo="#ffdead",Do="#000080",Uo="#fdf5e6",Go="#808000",ko="#6b8e23",Xo="#ffa500",Ho="#ff4500",jo="#da70d6",Wo="#eee8aa",Vo="#98fb98",Yo="#afeeee",zo="#db7093",qo="#ffefd5",$o="#ffdab9",Ko="#cd853f",Zo="#ffc0cb",Qo="#dda0dd",Jo="#b0e0e6",th="#800080",eh="#663399",rh="#ff0000",ih="#bc8f8f",nh="#4169e1",ah="#8b4513",sh="#fa8072",oh="#f4a460",hh="#2e8b57",uh="#fff5ee",lh="#a0522d",fh="#c0c0c0",ch="#87ceeb",dh="#6a5acd",vh="#708090",ph="#708090",_h="#fffafa",gh="#00ff7f",mh="#4682b4",yh="#d2b48c",bh="#008080",Eh="#d8bfd8",Th="#ff6347",xh="#40e0d0",Ah="#ee82ee",wh="#f5deb3",Rh="#ffffff",Sh="#f5f5f5",Ph="#ffff00",Ih="#9acd32",Ch={aliceblue:ja,antiquewhite:Wa,aqua:Va,aquamarine:Ya,azure:za,beige:qa,bisque:$a,black:Ka,blanchedalmond:Za,blue:Qa,blueviolet:Ja,brown:ts,burlywood:es,cadetblue:rs,chartreuse:is,chocolate:ns,coral:as,cornflowerblue:ss,cornsilk:os,crimson:hs,cyan:us,darkblue:ls,darkcyan:fs,darkgoldenrod:cs,darkgray:ds,darkgreen:vs,darkgrey:ps,darkkhaki:_s,darkmagenta:gs,darkolivegreen:ms,darkorange:ys,darkorchid:bs,darkred:Es,darksalmon:Ts,darkseagreen:xs,darkslateblue:As,darkslategray:ws,darkslategrey:Rs,darkturquoise:Ss,darkviolet:Ps,deeppink:Is,deepskyblue:Cs,dimgray:Os,dimgrey:Bs,dodgerblue:Ms,firebrick:Ns,floralwhite:Fs,forestgreen:Ls,fuchsia:Ds,gainsboro:Us,ghostwhite:Gs,goldenrod:ks,gold:Xs,gray:Hs,green:js,greenyellow:Ws,grey:Vs,honeydew:Ys,hotpink:zs,indianred:qs,indigo:$s,ivory:Ks,khaki:Zs,lavenderblush:Qs,lavender:Js,lawngreen:to,lemonchiffon:eo,lightblue:ro,lightcoral:io,lightcyan:no,lightgoldenrodyellow:ao,lightgray:so,lightgreen:oo,lightgrey:ho,lightpink:uo,lightsalmon:lo,lightseagreen:fo,lightskyblue:co,lightslategray:vo,lightslategrey:po,lightsteelblue:_o,lightyellow:go,lime:mo,limegreen:yo,linen:bo,magenta:Eo,maroon:To,mediumaquamarine:xo,mediumblue:Ao,mediumorchid:wo,mediumpurple:Ro,mediumseagreen:So,mediumslateblue:Po,mediumspringgreen:Io,mediumturquoise:Co,mediumvioletred:Oo,midnightblue:Bo,mintcream:Mo,mistyrose:No,moccasin:Fo,navajowhite:Lo,navy:Do,oldlace:Uo,olive:Go,olivedrab:ko,orange:Xo,orangered:Ho,orchid:jo,palegoldenrod:Wo,palegreen:Vo,paleturquoise:Yo,palevioletred:zo,papayawhip:qo,peachpuff:$o,peru:Ko,pink:Zo,plum:Qo,powderblue:Jo,purple:th,rebeccapurple:eh,red:rh,rosybrown:ih,royalblue:nh,saddlebrown:ah,salmon:sh,sandybrown:oh,seagreen:hh,seashell:uh,sienna:lh,silver:fh,skyblue:ch,slateblue:dh,slategray:vh,slategrey:ph,snow:_h,springgreen:gh,steelblue:mh,tan:yh,teal:bh,thistle:Eh,tomato:Th,turquoise:xh,violet:Ah,wheat:wh,white:Rh,whitesmoke:Sh,yellow:Ph,yellowgreen:Ih};function Ge(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 Qn(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function Jn(r){return typeof r=="string"&&(r=Ch[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Oh(){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 Bh=Oh();function ta(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 Mh(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 ea(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 Er(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 hn(r){return!(r&r-1)&&!!r}function un(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 Fe(r,t,e){var i=r.length,n;if(!(t>=i||e===0)){e=t+e>i?i-t:e;var a=i-e;for(n=t;n<a;++n)r[n]=r[n+e];r.length=a}}function Ee(r){return r===0?0:r<0?-1:1}var Nh=0;function ke(){return++Nh}var ln={};function Pt(r,t,e){if(e===void 0&&(e=3),!ln[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))),ln[t]=!0}}var fn={},Mt=Object.create(null),Zt=Object.create(null);(function(){function r(t,e,i){this.canvas=S.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||S.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 Fh(r){var t=r.width,e=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,t,e),a=n.data,s=a.length,o={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<s;u+=4)a[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 Ze;function Lh(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,Ze||(Ze=document.createElement("a")),Ze.href=r;var e=be.parse(Ze.href),i=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!i||e.protocol!==t.protocol?"anonymous":""}function qt(r,t){var e=S.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 Le=function(){return Le=Object.assign||function(t){for(var e=arguments,i,n=1,a=arguments.length;n<a;n++){i=e[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},Le.apply(this,arguments)},L;(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"})(L||(L={}));var cn=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=Le(Le({},t),{ref:r})}if(typeof r=="object")r=Le({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Tt={_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(cn).forEach(function(n){n.type.forEach(function(a){var s,o;return(o=(s=t._removeHandlers)[a])===null||o===void 0?void 0:o.call(s,n)})}),this},add:function(){for(var r=arguments,t=this,e=[],i=0;i<arguments.length;i++)e[i]=r[i];return e.map(cn).forEach(function(n){n.type.forEach(function(a){var s=t._addHandlers,o=t._queue;s[a]?s[a](n):(o[a]=o[a]||[],o[a].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 a=this._queue;return a[r]&&(a[r].forEach(function(s){return t(s)}),delete a[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===L.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 at=function(){function r(t){this.items=[],this._name=t,this._aliasCount=0}return r.prototype.emit=function(t,e,i,n,a,s,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,a,s,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(at.prototype,{dispatch:{value:at.prototype.emit},run:{value:at.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
|
|
*/S.TARGET_FPMS=.06;var Xe;(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"})(Xe||(Xe={}));var Xr=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}(),Yt=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 Xr(null,null,1/0),this.deltaMS=1/S.TARGET_FPMS,this.elapsedMS=1/S.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=Xe.NORMAL),this._addListener(new Xr(t,e,i))},r.prototype.addOnce=function(t,e,i){return i===void 0&&(i=Xe.NORMAL),this._addListener(new Xr(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*S.TARGET_FPMS;for(var n=this._head,a=n.next;a;)a=a.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=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,S.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}(),cc=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,Xe.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?Yt.shared:new Yt,t.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},r.extension=L.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 Tr=Math.PI*2,Dh=180/Math.PI,Uh=Math.PI/180,nt;(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"})(nt||(nt={}));var rt=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}(),Qe=[new rt,new rt,new rt,new rt],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=nt.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 a=this.y<t.y?t.y:this.y,s=this.bottom>t.bottom?t.bottom:this.bottom;return s>a}var o=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=o||l<=u)return!1;var f=Qe[0].set(t.left,t.top),c=Qe[1].set(t.left,t.bottom),d=Qe[2].set(t.right,t.top),v=Qe[3].set(t.right,t.bottom);if(d.x<=f.x||c.y<=f.y)return!1;var p=Math.sign(e.a*e.d-e.b*e.c);if(p===0||(e.apply(f,f),e.apply(c,c),e.apply(d,d),e.apply(v,v),Math.max(f.x,c.x,d.x,v.x)<=o||Math.min(f.x,c.x,d.x,v.x)>=h||Math.max(f.y,c.y,d.y,v.y)<=u||Math.min(f.y,c.y,d.y,v.y)>=l))return!1;var _=p*(c.y-f.y),g=p*(f.x-c.x),b=_*o+g*u,T=_*h+g*u,x=_*o+g*l,m=_*h+g*l;if(Math.max(b,T,x,m)<=_*f.x+g*f.y||Math.min(b,T,x,m)>=_*v.x+g*v.y)return!1;var y=p*(f.y-d.y),E=p*(d.x-f.x),P=y*o+E*u,A=y*h+E*u,R=y*o+E*l,O=y*h+E*l;return!(Math.max(P,A,R,O)<=y*f.x+E*f.y||Math.min(P,A,R,O)>=y*v.x+E*v.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),a=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(a-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),a=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=a-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Gh=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=nt.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,a=this.y-e;return n*=n,a*=a,n+a<=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}(),kh=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=nt.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}(),pr=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 a=[],s=0,o=n.length;s<o;s++)a.push(n[s].x,n[s].y);n=a}this.points=n,this.type=nt.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,a=0,s=n-1;a<n;s=a++){var o=this.points[a*2],h=this.points[a*2+1],u=this.points[s*2],l=this.points[s*2+1],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}(),Xh=function(){function r(t,e,i,n,a){t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),a===void 0&&(a=20),this.x=t,this.y=e,this.width=i,this.height=n,this.radius=a,this.type=nt.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),a=e-(this.y+i),s=i*i;if(n*n+a*a<=s||(n=t-(this.x+this.width-i),n*n+a*a<=s)||(a=e-(this.y+this.height-i),n*n+a*a<=s)||(n=t-(this.x+i),n*n+a*a<=s))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}(),Te=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}(),ft=function(){function r(t,e,i,n,a,s){t===void 0&&(t=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=0),s===void 0&&(s=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=s}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,a,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=a,this.ty=s,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 rt;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 rt;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,a=t.y;return e.x=this.d*i*n+-this.c*i*a+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*a+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},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,a=this.c,s=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=a*e-this.d*i,this.d=a*i+this.d*e,this.tx=s*e-this.ty*i,this.ty=s*i+this.ty*e,this},r.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,a=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*a,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*a,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*a+this.ty,this},r.prototype.setTransform=function(t,e,i,n,a,s,o,h,u){return this.a=Math.cos(o+u)*a,this.b=Math.sin(o+u)*a,this.c=-Math.sin(o-h)*s,this.d=Math.cos(o-h)*s,this.tx=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,a=this.d,s=t.pivot,o=-Math.atan2(-n,a),h=Math.atan2(i,e),u=Math.abs(o+h);return u<1e-5||Math.abs(Tr-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+a*a),t.position.x=this.tx+(s.x*e+s.y*n),t.position.y=this.ty+(s.x*i+s.y*a),t},r.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,a=this.tx,s=t*n-e*i;return this.a=n/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-n*a)/s,this.ty=-(t*this.ty-e*a)/s,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}(),re=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ie=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ne=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ae=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],vi=[],ra=[],Je=Math.sign;function Hh(){for(var r=0;r<16;r++){var t=[];vi.push(t);for(var e=0;e<16;e++)for(var i=Je(re[r]*re[e]+ne[r]*ie[e]),n=Je(ie[r]*re[e]+ae[r]*ie[e]),a=Je(re[r]*ne[e]+ne[r]*ae[e]),s=Je(ie[r]*ne[e]+ae[r]*ae[e]),o=0;o<16;o++)if(re[o]===i&&ie[o]===n&&ne[o]===a&&ae[o]===s){t.push(o);break}}for(var r=0;r<16;r++){var h=new ft;h.set(re[r],ie[r],ne[r],ae[r],0,0),ra.push(h)}}Hh();var Z={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 re[r]},uY:function(r){return ie[r]},vX:function(r){return ne[r]},vY:function(r){return ae[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return vi[r][t]},sub:function(r,t){return vi[r][Z.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?Z.S:Z.N:Math.abs(t)*2<=Math.abs(r)?r>0?Z.E:Z.W:t>0?r>0?Z.SE:Z.SW:r>0?Z.NE:Z.NW},matrixAppendRotationInv:function(r,t,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=ra[Z.inv(t)];n.tx=e,n.ty=i,r.append(n)}},jh=function(){function r(){this.worldTransform=new ft,this.localTransform=new ft,this.position=new Te(this.onChange,this,0,0),this.scale=new Te(this.onChange,this,1,1),this.pivot=new Te(this.onChange,this,0,0),this.skew=new Te(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
|
|
*/S.PREFER_ENV=se.any?kt.WEBGL:kt.WEBGL2;S.STRICT_TEXTURE_CACHE=!1;var pi=[];function ia(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=pi.length-1;n>=0;--n){var a=pi[n];if(a.test&&a.test(r,e))return new a(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 _i=function(r,t){return _i=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])},_i(r,t)};function q(r,t){_i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var gi=function(){return gi=Object.assign||function(t){for(var e=arguments,i,n=1,a=arguments.length;n<a;n++){i=e[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},gi.apply(this,arguments)};function Wh(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 He=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 at("setRealSize"),this.onUpdate=new at("update"),this.onError=new at("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}(),ue=function(r){q(t,r);function t(e,i){var n=this,a=i||{},s=a.width,o=a.height;if(!s||!o)throw new Error("BufferResource width or height invalid");return n=r.call(this,s,o)||this,n.data=e,n}return t.prototype.upload=function(e,i,n){var a=e.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===lt.UNPACK);var s=i.realWidth,o=i.realHeight;return n.width===s&&n.height===o?a.texSubImage2D(i.target,0,0,0,s,o,i.format,n.type,this.data):(n.width=s,n.height=o,a.texImage2D(i.target,0,n.internalFormat,s,o,0,i.format,n.type,this.data)),!0},t.prototype.dispose=function(){this.data=null},t.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},t}(He),Vh={scaleMode:Rt.NEAREST,format:w.RGBA,alphaMode:lt.NPM},k=function(r){q(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 a=i.alphaMode,s=i.mipmap,o=i.anisotropicLevel,h=i.scaleMode,u=i.width,l=i.height,f=i.wrapMode,c=i.format,d=i.type,v=i.target,p=i.resolution,_=i.resourceOptions;return e&&!(e instanceof He)&&(e=ia(e,_),e.internal=!0),n.resolution=p||S.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((l||0)*n.resolution)/n.resolution,n._mipmap=s!==void 0?s:S.MIPMAP_TEXTURES,n.anisotropicLevel=o!==void 0?o:S.ANISOTROPIC_LEVEL,n._wrapMode=f||S.WRAP_MODE,n._scaleMode=h!==void 0?h:S.SCALE_MODE,n.format=c||w.RGBA,n.type=d||M.UNSIGNED_BYTE,n.target=v||oe.TEXTURE_2D,n.alphaMode=a!==void 0?a:lt.UNPACK,n.uid=ke(),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=hn(this.realWidth)&&hn(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 Zt[this.cacheId],delete Mt[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=S.STRICT_TEXTURE_CACHE);var a=typeof e=="string",s=null;if(a)s=e;else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+ke()}s=e._pixiId}var h=Zt[s];if(a&&n&&!h)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return h||(h=new t(e,i),h.cacheId=s,t.addToCache(h,s)),h},t.fromBuffer=function(e,i,n,a){e=e||new Float32Array(i*n*4);var s=new ue(e,{width:i,height:n}),o=e instanceof Float32Array?M.FLOAT:M.UNSIGNED_BYTE;return new t(s,Object.assign({},Vh,a||{width:i,height:n,type:o}))},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),Zt[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),Zt[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=Zt[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Zt[e],i}}else if(e&&e.textureCacheIds){for(var a=0;a<e.textureCacheIds.length;++a)delete Zt[e.textureCacheIds[a]];return e.textureCacheIds.length=0,e}return null},t._globalBatch=0,t}(Nr),na=function(r){q(t,r);function t(e,i){var n=this,a=i||{},s=a.width,o=a.height;n=r.call(this,s,o)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<e;h++){var u=new k;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 He?this.addResourceAt(e[n],n):this.addResourceAt(ia(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(a){return a.resource}).filter(function(a){return a}),n=i.map(function(a){return a.load()});return this._load=Promise.all(n).then(function(){var a=e.items[0],s=a.realWidth,o=a.realHeight;return e.resize(s,o),Promise.resolve(e)}),this._load},t}(He),Yh=function(r){q(t,r);function t(e,i){var n=this,a=i||{},s=a.width,o=a.height,h,u;return Array.isArray(e)?(h=e,u=e.length):u=e,n=r.call(this,u,{width:s,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=oe.TEXTURE_2D_ARRAY},t.prototype.upload=function(e,i,n){var a=this,s=a.length,o=a.itemDirtyIds,h=a.items,u=e.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,s,0,i.format,n.type,null);for(var l=0;l<s;l++){var 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}(na),$t=function(r){q(t,r);function t(e){var i=this,n=e,a=n.naturalWidth||n.videoWidth||n.width,s=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,a,s)||this,i.source=e,i.noSubImage=!1,i}return t.crossOrigin=function(e,i,n){n===void 0&&i.indexOf("data:")!==0?e.crossOrigin=Lh(i):n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous")},t.prototype.upload=function(e,i,n,a){var s=e.gl,o=i.realWidth,h=i.realHeight;if(a=a||this.source,a instanceof HTMLImageElement){if(!a.complete||a.naturalWidth===0)return!1}else if(a instanceof HTMLVideoElement&&a.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===lt.UNPACK),!this.noSubImage&&i.target===s.TEXTURE_2D&&n.width===o&&n.height===h?s.texSubImage2D(s.TEXTURE_2D,0,0,0,i.format,n.type,a):(n.width=o,n.height=h,s.texImage2D(i.target,0,n.internalFormat,i.format,n.type,a)),!0},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}(He),zh=function(r){q(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}($t),qh=function(r){q(t,r);function t(e,i){var n=this,a=i||{},s=a.width,o=a.height,h=a.autoLoad,u=a.linkBaseTexture;if(e&&e.length!==t.SIDES)throw new Error("Invalid length. Got "+e.length+", expected 6");n=r.call(this,6,{width:s,height:o})||this;for(var l=0;l<t.SIDES;l++)n.items[l].target=oe.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=oe.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=oe.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 a=this.itemDirtyIds,s=0;s<t.SIDES;s++){var o=this.items[s];(a[s]<o.dirtyId||n.dirtyId<i.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(e,o,n),a[s]=o.dirtyId):a[s]<-1&&(e.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),a[s]=-1))}return!0},t.test=function(e){return Array.isArray(e)&&e.length===t.SIDES},t.SIDES=6,t}(na),aa=function(r){q(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLImageElement)){var a=new Image;$t.crossOrigin(a,e,i.crossorigin),a.src=e,e=a}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:S.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,a){var s=i.source;i.url=s.src;var o=function(){i.destroyed||(s.onload=null,s.onerror=null,i.resize(s.width,s.height),i._load=null,i.createBitmap?n(i.process()):n(i))};s.complete&&s.src?o():(s.onload=o,s.onerror=function(h){a(h),i.onError.emit(h)})}),this._load)},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,a=!i.crossOrigin||i.crossOrigin==="anonymous";return this._process=fetch(i.src,{mode:a?"cors":"no-cors"}).then(function(s){return s.blob()}).then(function(s){return n(s,0,0,i.width,i.height,{premultiplyAlpha:e.alphaMode===null||e.alphaMode===lt.UNPACK?"premultiply":"none"})}).then(function(s){return e.destroyed?Promise.reject():(e.bitmap=s,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 a=!0,s=i._glTextures;for(var o in s){var h=s[o];if(h!==n&&h.dirtyId!==i.dirtyId){a=!1;break}}a&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},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}($t),mi=function(r){q(t,r);function t(e,i){var n=this;return i=i||{},n=r.call(this,S.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;$t.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(n){!e._resolve||(i.onerror=null,e.onError.emit(n))},i.onload=function(){if(!!e._resolve){var n=i.width,a=i.height;if(!n||!a)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var s=n*e.scale,o=a*e.scale;(e._overrideWidth||e._overrideHeight)&&(s=e._overrideWidth||e._overrideHeight/a*n,o=e._overrideHeight||e._overrideWidth/n*a),s=Math.round(s),o=Math.round(o);var h=e.source;h.width=s,h.height=o,h._pixiId="canvas_"+ke(),h.getContext("2d").drawImage(i,0,0,n,a,0,0,s,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}($t),$h=function(r){q(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var a=document.createElement("video");a.setAttribute("preload","auto"),a.setAttribute("webkit-playsinline",""),a.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var s=e[0].src||e[0];$t.crossOrigin(a,s,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,a.appendChild(h)}e=a}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=Yt.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&&(Yt.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Yt.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&&(Yt.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?(Yt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Yt.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}($t),Kh=function(r){q(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}($t);pi.push(aa,Kh,zh,$h,mi,ue,qh,Yh);var Zh=function(r){q(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,i,n){var a=e.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===lt.UNPACK);var s=i.realWidth,o=i.realHeight;return n.width===s&&n.height===o?a.texSubImage2D(i.target,0,0,0,s,o,i.format,n.type,this.data):(n.width=s,n.height=o,a.texImage2D(i.target,0,n.internalFormat,s,o,0,i.format,n.type,this.data)),!0},t}(ue),yi=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 at("disposeFramebuffer"),this.multisample=J.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 k(null,{scaleMode:Rt.NEAREST,resolution:1,mipmap:ot.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new k(new Zh(null,{width:this.width,height:this.height}),{scaleMode:Rt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ot.OFF,format:w.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],a=n.resolution;n.setSize(t/a,e/a)}if(this.depthTexture){var a=this.depthTexture.resolution;this.depthTexture.setSize(t/a,e/a)}}},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}(),sa=function(r){q(t,r);function t(e){e===void 0&&(e={});var i=this;if(typeof e=="number"){var n=arguments[0],a=arguments[1],s=arguments[2],o=arguments[3];e={width:n,height:a,scaleMode:s,resolution:o}}return e.width=e.width||100,e.height=e.height||100,e.multisample=e.multisample!==void 0?e.multisample:J.NONE,i=r.call(this,null,e)||this,i.mipmap=ot.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new yi(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}(k),oa=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,a=e.height;if(i){var s=t.width/2/n,o=t.height/2/a,h=t.x/n+s,u=t.y/a+o;i=Z.add(i,Z.NW),this.x0=h+s*Z.uX(i),this.y0=u+o*Z.uY(i),i=Z.add(i,2),this.x1=h+s*Z.uX(i),this.y1=u+o*Z.uY(i),i=Z.add(i,2),this.x2=h+s*Z.uX(i),this.y2=u+o*Z.uY(i),i=Z.add(i,2),this.x3=h+s*Z.uX(i),this.y3=u+o*Z.uY(i)}else this.x0=t.x/n,this.y0=t.y/a,this.x1=(t.x+t.width)/n,this.y1=t.y/a,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/a,this.x3=t.x/n,this.y3=(t.y+t.height)/a;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},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}(),dn=new oa;function tr(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var X=function(r){q(t,r);function t(e,i,n,a,s,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=a,h.valid=!1,h._uvs=dn,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(s||0),s===!0)h._rotate=2;else if(h._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=o?new rt(o.x,o.y):new rt(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&&Mt[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===dn&&(this._uvs=new oa),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=S.STRICT_TEXTURE_CACHE);var a=typeof e=="string",s=null;if(a)s=e;else if(e instanceof k){if(!e.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";e.cacheId=o+"-"+ke(),k.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";e._pixiId=o+"_"+ke()}s=e._pixiId}var h=Mt[s];if(a&&n&&!h)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return!h&&!(e instanceof k)?(i.resolution||(i.resolution=qt(e)),h=new t(new k(e,i)),h.baseTexture.cacheId=s,k.addToCache(h.baseTexture,s),t.addToCache(h,s)):!h&&e instanceof k&&(h=new t(e),t.addToCache(h,s)),h},t.fromURL=function(e,i){var n=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),a=t.from(e,Object.assign({resourceOptions:n},i),!1),s=a.baseTexture.resource;return a.baseTexture.valid?Promise.resolve(a):s.load().then(function(){return Promise.resolve(a)})},t.fromBuffer=function(e,i,n,a){return new t(k.fromBuffer(e,i,n,a))},t.fromLoader=function(e,i,n,a){var s=new k(e,Object.assign({scaleMode:S.SCALE_MODE,resolution:qt(i)},a)),o=s.resource;o instanceof aa&&(o.url=i);var h=new t(s);return n||(n=i),k.addToCache(h.baseTexture,n),t.addToCache(h,n),n!==i&&(k.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),Mt[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Mt[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=Mt[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete Mt[e],i}}else if(e&&e.textureCacheIds){for(var a=0;a<e.textureCacheIds.length;++a)Mt[e.textureCacheIds[a]]===e&&delete Mt[e.textureCacheIds[a]];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,a=e.width,s=e.height,o=i+a>this.baseTexture.width,h=n+s>this.baseTexture.height;if(o||h){var u=o&&h?"and":"or",l="X: "+i+" + "+a+" = "+(i+a)+" > "+this.baseTexture.width,f="Y: "+n+" + "+s+" = "+(n+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=a&&s&&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 k),tr(t._EMPTY),tr(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=S.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(k.from(e)),tr(t._WHITE),tr(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(Nr),Ni=function(r){q(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 a=this.baseTexture.resolution,s=Math.round(e*a)/a,o=Math.round(i*a)/a;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(s,o),this.updateUvs()},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=[],a=1;a<arguments.length;a++)n[a-1]=i[a];return typeof e=="number"&&(Pt("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 sa(e))},t}(X),Qh=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=J.NONE);var n=new sa(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new Ni(n)},r.prototype.getOptimalTexture=function(t,e,i,n){i===void 0&&(i=1),n===void 0&&(n=J.NONE);var a;t=Math.ceil(t*i-1e-6),e=Math.ceil(e*i-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Er(t),e=Er(e),a=((t&65535)<<16|e&65535)>>>0,n>1&&(a+=n*4294967296)):a=n>1?-n:-1,this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(t,e,n)),s.filterPoolKey=a,s.setResolution(i),s},r.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||J.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}(),vn=function(){function r(t,e,i,n,a,s,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=a,this.start=s,this.instance=o}return r.prototype.destroy=function(){this.buffer=null},r.from=function(t,e,i,n,a){return new r(t,e,i,n,a)},r}(),Jh=0,ut=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=Jh++,this.disposeRunner=new at("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===St.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?St.ELEMENT_ARRAY_BUFFER:St.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new r(t)},r}(),tu={Float32Array,Uint32Array,Int32Array,Uint8Array};function eu(r,t){for(var e=0,i=0,n={},a=0;a<r.length;a++)i+=t[a],e+=r[a].length;for(var s=new ArrayBuffer(e*4),o=null,h=0,a=0;a<r.length;a++){var u=t[a],l=r[a],f=ea(l);n[f]||(n[f]=new tu[f](s)),o=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,v=c%u;o[d+v]=l[c]}h+=u}return new Float32Array(s)}var pn={5126:4,5123:2,5121:1},ru=0,iu={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Fr=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=ru++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new at("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(t,e,i,n,a,s,o,h){if(i===void 0&&(i=0),n===void 0&&(n=!1),h===void 0&&(h=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof ut||(e instanceof Array&&(e=new Float32Array(e)),e=new ut(e));var u=t.split("|");if(u.length>1){for(var l=0;l<u.length;l++)this.addAttribute(u[l],e,i,n,a);return this}var f=this.buffers.indexOf(e);return f===-1&&(this.buffers.push(e),f=this.buffers.length-1),this.attributes[t]=new vn(f,i,n,a,s,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 ut||(t instanceof Array&&(t=new Uint16Array(t)),t=new ut(t)),t.type=St.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 ut,n;for(n in this.attributes){var a=this.attributes[n],s=this.buffers[a.buffer];t.push(s.data),e.push(a.size*pn[a.type]/4),a.buffer=0}for(i.data=eu(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 ut(this.buffers[e].data.slice(0));for(var e in this.attributes){var i=this.attributes[e];t.attributes[e]=new vn(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=St.ELEMENT_ARRAY_BUFFER),t},r.merge=function(t){for(var e=new r,i=[],n=[],a=[],s,o=0;o<t.length;o++){s=t[o];for(var h=0;h<s.buffers.length;h++)n[h]=n[h]||0,n[h]+=s.buffers[h].data.length,a[h]=0}for(var o=0;o<s.buffers.length;o++)i[o]=new iu[ea(s.buffers[o].data)](n[o]),e.buffers[o]=new ut(i[o]);for(var o=0;o<t.length;o++){s=t[o];for(var h=0;h<s.buffers.length;h++)i[h].set(s.buffers[h].data,a[h]),a[h]+=s.buffers[h].data.length}if(e.attributes=s.attributes,s.indexBuffer){e.indexBuffer=e.buffers[s.buffers.indexOf(s.indexBuffer)],e.indexBuffer.type=St.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,o=0;o<s.buffers.length;o++)if(s.buffers[o]!==s.indexBuffer){c=o;break}for(var o in s.attributes){var d=s.attributes[o];(d.buffer|0)===c&&(l+=d.size*pn[d.type]/4)}for(var o=0;o<t.length;o++){for(var v=t[o].indexBuffer.data,h=0;h<v.length;h++)e.indexBuffer.data[h+f]+=u;u+=t[o].buffers[c].data.length/l,f+=v.length}}return e},r}(),nu=function(r){q(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}(Fr),au=function(r){q(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 ut(e.vertices),e.uvBuffer=new ut(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,a=0;return this.uvs[0]=n,this.uvs[1]=a,this.uvs[2]=n+i.width/e.width,this.uvs[3]=a,this.uvs[4]=n+i.width/e.width,this.uvs[5]=a+i.height/e.height,this.uvs[6]=n,this.uvs[7]=a+i.height/e.height,n=i.x,a=i.y,this.vertices[0]=n,this.vertices[1]=a,this.vertices[2]=n+i.width,this.vertices[3]=a,this.vertices[4]=n+i.width,this.vertices[5]=a+i.height,this.vertices[6]=n,this.vertices[7]=a+i.height,this.invalidate(),this},t.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},t}(Fr),su=0,he=function(){function r(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=su++,this.static=!!e,this.ubo=!!i,t instanceof ut?(this.buffer=t,this.buffer.type=St.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new ut(new Float32Array(1)),this.buffer.type=St.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}(),ou=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=J.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}(),er=[new rt,new rt,new rt,new rt],Hr=new ft,hu=function(){function r(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new Qh,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new nu,this.quadUv=new au,this.tempRect=new W,this.activeState={},this.globalUniforms=new he({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,a=this.renderer,s=this.defaultFilterStack,o=this.statePool.pop()||new ou,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,v=1;v<e.length;v++){var p=e[v];u=Math.min(u,p.resolution),l=Math.min(l,p.multisample),f=this.useMaxPadding?Math.max(f,p.padding):f+p.padding,c=c&&p.autoFit,d=d||((n=p.legacy)!==null&&n!==void 0?n:!0)}s.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),s.push(o),o.resolution=u,o.multisample=l,o.legacy=d,o.target=t,o.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),o.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);a.projection.transform&&this.transformAABB(Hr.copyFrom(a.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:a.resolution,h.sourceFrame,h.destinationFrame,a.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,l),o.filters=e,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var g=this.tempRect;g.x=0,g.y=0,g.width=o.sourceFrame.width,g.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(h.sourceFrame),o.bindingDestinationFrame.copyFrom(h.destinationFrame),o.transform=a.projection.transform,a.projection.transform=null,h.bind(o.renderTexture,o.sourceFrame,g),a.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 a=n.inputSize,s=n.inputPixel,o=n.inputClamp;if(a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=1/a[0],a[3]=1/a[1],s[0]=Math.round(a[0]*e.resolution),s[1]=Math.round(a[1]*e.resolution),s[2]=1/s[0],s[3]=1/s[1],o[0]=.5*s[2],o[1]=.5*s[3],o[2]=e.sourceFrame.width*a[2]-.5*s[2],o[3]=e.sourceFrame.height*a[3]-.5*s[3],e.legacy){var h=n.filterArea;h[0]=e.destinationFrame.width,h[1]=e.destinationFrame.height,h[2]=e.sourceFrame.x,h[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,e.renderTexture,u.renderTexture,Vt.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,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,Vt.CLEAR,e);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,Vt.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=Vt.CLEAR);var i=this.renderer,n=i.renderTexture,a=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 s=this.tempRect;s.x=0,s.y=0,s.width=t.filterFrame.width,s.height=t.filterFrame.height,n.bind(t,t.filterFrame,s)}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=a.stateId&1||this.forceClear;(e===Vt.CLEAR||e===Vt.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,i,n){var a=this.renderer;a.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(Et.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(Et.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,a=i.destinationFrame,s=e._texture.orig,o=t.set(a.width,0,0,a.height,n.x,n.y),h=e.worldTransform.copyTo(ft.TEMP_MATRIX);return h.invert(),o.prepend(h),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o},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=J.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 a=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||J.NONE);return a.filterFrame=t.filterFrame,a},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=er[0],n=er[1],a=er[2],s=er[3];i.set(e.left,e.top),n.set(e.left,e.bottom),a.set(e.right,e.top),s.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(a,a),t.apply(s,s);var o=Math.min(i.x,n.x,a.x,s.x),h=Math.min(i.y,n.y,a.y,s.y),u=Math.max(i.x,n.x,a.x,s.x),l=Math.max(i.y,n.y,a.y,s.y);e.x=o,e.y=h,e.width=u-o,e.height=l-h},r.prototype.roundFrame=function(t,e,i,n,a){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(a){var s=a.a,o=a.b,h=a.c,u=a.d;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(u)>1e-4))return}a=a?Hr.copyFrom(a):Hr.identity(),a.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(a,t),t.ceil(e),this.transformAABB(a.invert(),t)}},r}(),ha=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}(),uu=function(){function r(t){this.renderer=t,this.emptyRenderer=new ha(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 a=t.elements,s=t.ids,o=t.count,h=0,u=0;u<o;u++){var l=a[u],f=l._batchLocation;if(f>=0&&f<n&&e[f]===l){s[u]=f;continue}for(;h<n;){var c=e[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}s[u]=h,l._batchLocation=h,e[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),_n=0,lu=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=_n++,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=_n++,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(S.PREFER_ENV>=kt.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}(),fu=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=J.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),cu=new W,du=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new yi(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;S.PREFER_ENV===kt.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 a=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,a.framebuffer)),a.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,a.mipLevel=i),a.dirtyId!==t.dirtyId&&(a.dirtyId=t.dirtyId,a.dirtyFormat!==t.dirtyFormat?(a.dirtyFormat=t.dirtyFormat,a.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):a.dirtySize!==t.dirtySize&&(a.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var s=0;s<t.colorTextures.length;s++){var o=t.colorTextures[s];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 a=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(a.width!==i||a.height!==n||a.x!==t||a.y!==e)&&(a.x=t,a.y=e,a.width=i,a.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,a){a===void 0&&(a=mr.COLOR|mr.DEPTH);var s=this.gl;s.clearColor(t,e,i,n),s.clear(a)},r.prototype.initFramebuffer=function(t){var e=this.gl,i=new fu(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,a=n.length;e.drawBuffers||(a=Math.min(a,1));for(var s=0;s<a;s++){var o=n[s],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0)}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],a=t.colorTextures,s=a.length;i.drawBuffers||(s=Math.min(s,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<s;h++){var u=a[h],l=u.parentTextureArray||u;this.renderer.texture.bind(l,0),!(h===0&&n.msaaBuffer)&&(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,u.target,l._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),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=J.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=J.NONE),i},r.prototype.blit=function(t,e,i){var n=this,a=n.current,s=n.renderer,o=n.gl,h=n.CONTEXT_UID;if(s.context.webGLVersion===2&&!!a){var u=a.glFramebuffers[h];if(!!u){if(!t){if(!u.msaaBuffer)return;var l=a.colorTextures[0];if(!l)return;u.blitFramebuffer||(u.blitFramebuffer=new yi(a.width,a.height),u.blitFramebuffer.addColorTexture(0,l)),t=u.blitFramebuffer,t.colorTextures[0]!==l&&(t.colorTextures[0]=l,t.dirtyId++,t.dirtyFormat++),(t.width!==a.width||t.height!==a.height)&&(t.width=a.width,t.height=a.height,t.dirtyId++,t.dirtySize++)}e||(e=cu,e.width=a.width,e.height=a.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 a=this.managedFramebuffers.indexOf(t);a>=0&&this.managedFramebuffers.splice(a,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,a=this.gl,s=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,s),e.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,e.multisample,a.DEPTH24_STENCIL8,i,n):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,i,n),e.stencil=s,a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,s)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new W},r.prototype.destroy=function(){this.renderer=null},r}(),jr={5126:4,5123:2,5121:1},vu=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;S.PREFER_ENV===kt.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(a){return i.bindVertexArrayOES(a)},t.deleteVertexArray=function(a){return i.deleteVertexArrayOES(a)}):(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(a,s){return n.vertexAttribDivisorANGLE(a,s)},t.drawElementsInstanced=function(a,s,o,h,u){return n.drawElementsInstancedANGLE(a,s,o,h,u)},t.drawArraysInstanced=function(a,s,o,h){return n.drawArraysInstancedANGLE(a,s,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],a=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},a=!0);var s=n[e.program.id]||this.initGeometryVao(t,e,a);this._activeGeometry=t,this._activeVao!==s&&(this._activeVao=s,this.hasVao?i.bindVertexArray(s):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 a in n)if(!i[a])throw new Error('shader and geometry incompatible, geometry missing the "'+a+'" attribute')},r.prototype.getSignature=function(t,e){var i=t.attributes,n=e.attributeData,a=["g",t.id];for(var s in i)n[s]&&a.push(s,n[s].location);return a.join("-")},r.prototype.initGeometryVao=function(t,e,i){i===void 0&&(i=!0);var n=this.gl,a=this.CONTEXT_UID,s=this.renderer.buffer,o=e.program;o.glPrograms[a]||this.renderer.shader.generateProgram(e),this.checkCompatibility(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={},v={};for(var p in f)d[p]=0,v[p]=0;for(var p in c)!c[p].size&&o.attributeData[p]?c[p].size=o.attributeData[p].size:c[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[p].buffer]+=c[p].size*jr[c[p].type];for(var p in c){var _=c[p],g=_.size;_.stride===void 0&&(d[_.buffer]===g*jr[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=v[_.buffer],v[_.buffer]+=g*jr[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var b=0;b<f.length;b++){var T=f[b];s.bind(T),i&&T._glBuffers[a].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],a=this.gl,s=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<s.length;h++){var u=s[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!e&&o.dispose(s[h],e))}if(!e){for(var l in n)if(l[0]==="g"){var f=n[l];this._activeVao===f&&this.unbind(),a.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,a=this.renderer.buffer,s=t.buffers,o=t.attributes;t.indexBuffer&&a.bind(t.indexBuffer);var h=null;for(var u in o){var l=o[u],f=s[l.buffer],c=f._glBuffers[n];if(e.attributeData[u]){h!==c&&(a.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 a=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?s.instanced?a.drawElementsInstanced(t,e||s.indexBuffer.data.length,h,(i||0)*o,n||1):a.drawElements(t,e||s.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?a.drawArraysInstanced(t,i,e||s.getSize(),n||1):a.drawArrays(t,i,e||s.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}(),pu=function(){function r(t){t===void 0&&(t=null),this.type=et.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=S.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=et.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 gn(r,t,e){var i=r.createShader(t);return r.shaderSource(i,e),r.compileShader(i),i}function mn(r,t){var e=r.getShaderSource(t).split(`
|
|
`).map(function(u,l){return l+": "+u}),i=r.getShaderInfoLog(t),n=i.split(`
|
|
`),a={},s=n.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return u&&!a[u]?(a[u]=!0,!0):!1}),o=[""];s.forEach(function(u){e[u-1]="%c"+e[u-1]+"%c",o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=e.join(`
|
|
`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function _u(r,t,e,i){r.getProgramParameter(t,r.LINK_STATUS)||(r.getShaderParameter(e,r.COMPILE_STATUS)||mn(r,e),r.getShaderParameter(i,r.COMPILE_STATUS)||mn(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(t)))}function Wr(r){for(var t=new Array(r),e=0;e<t.length;e++)t[e]=!1;return t}function ua(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 Wr(2*t);case"bvec3":return Wr(3*t);case"bvec4":return Wr(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 la={},Re=la;function gu(){if(Re===la||Re&&Re.isContextLost()){var r=S.ADAPTER.createCanvas(),t=void 0;S.PREFER_ENV>=kt.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Re=t}return Re}var rr;function mu(){if(!rr){rr=ct.MEDIUM;var r=gu();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);rr=t.precision?ct.HIGH:ct.MEDIUM}}return rr}function yn(r,t,e){if(r.substring(0,9)!=="precision"){var i=t;return t===ct.HIGH&&e!==ct.HIGH&&(i=ct.MEDIUM),"precision "+i+` float;
|
|
`+r}else if(e!==ct.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var yu={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 fa(r){return yu[r]}var ir=null,bn={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 ca(r,t){if(!ir){var e=Object.keys(bn);ir={};for(var i=0;i<e.length;++i){var n=e[i];ir[r[n]]=bn[n]}}return ir[t]}var xe=[{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])
|
|
}`}}],bu={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);
|
|
}`},Eu={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 Tu(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 a=t[n];if(!a){!((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 s=r.uniforms[n],o=!1,h=0;h<xe.length;h++)if(xe[h].test(a,s)){i.push(xe[h].code(n,s)),o=!0;break}if(!o){var u=a.size===1&&!a.isArray?bu:Eu,l=u[a.type].replace("location",'ud["'+n+'"].location');i.push(`
|
|
cu = ud["`+n+`"];
|
|
cv = cu.value;
|
|
v = uv["`+n+`"];
|
|
`+l+";")}}return new Function("ud","uv","renderer","syncData",i.join(`
|
|
`))}var xu=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
`);function Au(r){for(var t="",e=0;e<r;++e)e>0&&(t+=`
|
|
else `),e<r-1&&(t+="if(test == "+e+".0){}");return t}function wu(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=xu.replace(/%forloop%/gi,Au(r));if(t.shaderSource(e,i),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))r=r/2|0;else break}return r}var Se;function Ru(){if(typeof Se=="boolean")return Se;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Se=r({a:"b"},"a","b")===!0}catch{Se=!1}return Se}var Su=`varying vec2 vTextureCoord;
|
|
|
|
uniform sampler2D uSampler;
|
|
|
|
void main(void){
|
|
gl_FragColor *= texture2D(uSampler, vTextureCoord);
|
|
}`,Pu=`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;
|
|
}
|
|
`,Iu=0,nr={},Ve=function(){function r(t,e,i){i===void 0&&(i="pixi-shader"),this.id=Iu++,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,"-"),nr[i]?(nr[i]++,i+="-"+nr[i]):nr[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
|
|
`+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
|
|
`+this.fragmentSrc,this.vertexSrc=yn(this.vertexSrc,S.PRECISION_VERTEX,ct.HIGH),this.fragmentSrc=yn(this.fragmentSrc,S.PRECISION_FRAGMENT,mu())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return Pu},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return Su},enumerable:!1,configurable:!0}),r.from=function(t,e,i){var n=t+e,a=fn[n];return a||(fn[n]=a=new r(t,e,i)),a},r}(),Lr=function(){function r(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof he?this.uniformGroup=e:this.uniformGroup=new he(e):this.uniformGroup=new he({}),this.disposeRunner=new at("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=Ve.from(t,e);return new r(n,i)},r}(),Vr=0,Yr=1,zr=2,qr=3,$r=4,Kr=5,Ye=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<<Vr)},set:function(t){!!(this.data&1<<Vr)!==t&&(this.data^=1<<Vr)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<Yr)},set:function(t){!!(this.data&1<<Yr)!==t&&(this.data^=1<<Yr)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<zr)},set:function(t){!!(this.data&1<<zr)!==t&&(this.data^=1<<zr)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<qr)},set:function(t){!!(this.data&1<<qr)!==t&&(this.data^=1<<qr)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<Kr)},set:function(t){!!(this.data&1<<Kr)!==t&&(this.data^=1<<Kr)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<$r)},set:function(t){!!(this.data&1<<$r)!==t&&(this.data^=1<<$r)},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}(),Cu=`varying vec2 vTextureCoord;
|
|
|
|
uniform sampler2D uSampler;
|
|
|
|
void main(void){
|
|
gl_FragColor = texture2D(uSampler, vTextureCoord);
|
|
}
|
|
`,Ou=`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();
|
|
}
|
|
`,Bu=function(r){q(t,r);function t(e,i,n){var a=this,s=Ve.from(e||t.defaultVertexSrc,i||t.defaultFragmentSrc);return a=r.call(this,s,n)||this,a.padding=0,a.resolution=S.FILTER_RESOLUTION,a.multisample=S.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Ye,a}return t.prototype.apply=function(e,i,n,a,s){e.applyFilter(this,i,n,a)},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 Ou},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return Cu},enumerable:!1,configurable:!0}),t}(Lr),Mu=`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;
|
|
}
|
|
`,Nu=`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;
|
|
}
|
|
`,En=new ft,da=function(){function r(t,e){this._texture=t,this.mapCoord=new ft,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 a=t[n],s=t[n+1];e[n]=a*i.a+s*i.c+i.tx,e[n+1]=a*i.b+s*i.d+i.ty}return e},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,a=e.trim;a&&(En.set(n.width/a.width,0,0,n.height/a.height,-a.x/a.width,-a.y/a.height),this.mapCoord.append(En));var s=e.baseTexture,o=this.uClampFrame,h=this.clampMargin/s.resolution,u=this.clampOffset;return o[0]=(e._frame.x+h+u)/s.width,o[1]=(e._frame.y+h+u)/s.height,o[2]=(e._frame.x+e._frame.width-h+u)/s.width,o[3]=(e._frame.y+e._frame.height-h+u)/s.height,this.uClampOffset[0]=u/s.realWidth,this.uClampOffset[1]=u/s.realHeight,this.isSimple=e._frame.width===s.width&&e._frame.height===s.height&&e.rotate===0,!0},r}(),Fu=function(r){q(t,r);function t(e,i,n){var a=this,s=null;return typeof e!="string"&&i===void 0&&n===void 0&&(s=e,e=void 0,i=void 0,n=void 0),a=r.call(this,e||Mu,i||Nu,n)||this,a.maskSprite=s,a.maskMatrix=new ft,a}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,a){var s=this._maskSprite,o=s._texture;!o.valid||(o.uvMatrix||(o.uvMatrix=new da(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,e.applyFilter(this,i,n,a))},t}(Bu),Lu=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 pu;n.pooled=!0,n.maskObject=e,i=n}var a=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(a),i._colorMask=a?a._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==et.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case et.SCISSOR:this.renderer.scissor.push(i);break;case et.STENCIL:this.renderer.stencil.push(i);break;case et.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case et.COLOR:this.pushColorMask(i);break}i.type===et.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 et.SCISSOR:this.renderer.scissor.pop(e);break;case et.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case et.SPRITE:this.popSpriteMask(e);break;case et.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===et.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(t){var e=t.maskObject;e?e.isSprite?t.type=et.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=et.SCISSOR:t.type=et.STENCIL:t.type=et.COLOR},r.prototype.pushSpriteMask=function(t){var e,i,n=t.maskObject,a=t._target,s=t._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex],s||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new Fu]));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;s[0].resolution=u,s[0].multisample=l,s[0].maskSprite=n;var c=a.filterArea;a.filterArea=n.getBounds(!0),o.filter.push(a,s),a.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}(),va=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}(),Tn=new ft,xn=[],Du=function(r){q(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=S.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,a=e.maskObject,s=this.renderer,o=s.renderTexture,h=a.getBounds(!0,(i=xn.pop())!==null&&i!==void 0?i:new W);this.roundFrameToPixels(h,o.current?o.current.resolution:s.resolution,o.sourceFrame,o.destinationFrame,s.projection.transform),n&&h.fit(n),e._scissorRectLocal=h}},t.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,a=e.c,s=e.d;return(Math.abs(n)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(s)>1e-4)},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,a,s){t.isMatrixRotated(s)||(s=s?Tn.copyFrom(s):Tn.identity(),s.translate(-n.x,-n.y).scale(a.width/n.width,a.height/n.height).translate(a.x,a.y),this.renderer.filter.transformAABB(s,e),e.fit(a),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))},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&&xn.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}(va),Uu=function(r){q(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=S.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,a=e._stencilCounter;a===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var s=e._colorMask;s!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,a,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,s!==0&&(e._colorMask=s,n.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&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,a=n?n._colorMask:15;a!==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,a!==0&&(n._colorMask=a,i.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&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}(va),Gu=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ft,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 a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,i,n){var a=this.projectionMatrix,s=n?-1:1;a.identity(),a.a=1/e.width*2,a.d=s*(1/e.height*2),a.tx=-1-e.x*a.a,a.ty=-s-e.y*a.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),Qt=new W,Pe=new W,ku=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 a,s,o;t?(a=t.baseTexture,o=a.resolution,e||(Qt.width=t.frame.width,Qt.height=t.frame.height,e=Qt),i||(Pe.x=t.frame.x,Pe.y=t.frame.y,Pe.width=e.width,Pe.height=e.height,i=Pe),s=a.framebuffer):(o=n.resolution,e||(Qt.width=n.screen.width,Qt.height=n.screen.height,e=Qt),i||(i=Qt,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(s,h),this.renderer.projection.update(i,e,o,!s),t?this.renderer.mask.setMaskStack(a.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,a=i.width!==n.width||i.height!==n.height;if(a){var s=this.viewportFrame,o=s.x,h=s.y,u=s.width,l=s.height;o=Math.round(o),h=Math.round(h),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,h,u,l)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),a&&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 Xu(r,t,e,i,n){e.buffer.update(n)}var Hu={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];
|
|
}
|
|
`},pa={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 ju(r){for(var t=r.map(function(h){return{data:h,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,a=0;a<t.length;a++){var s=t[a];if(e=pa[s.data.type],s.data.size>1&&(e=Math.max(e,16)*s.data.size),s.dataLen=e,i%e!==0&&i<16){var o=i%e%16;i+=o,n+=o}i+e>16?(n=Math.ceil(n/16)*16,s.offset=n,n+=e,i=e):(s.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function Wu(r,t){var e=[];for(var i in r)t[i]&&e.push(t[i]);return e.sort(function(n,a){return n.index-a.index}),e}function Vu(r,t){if(!r.autoManage)return{size:0,syncFunc:Xu};for(var e=Wu(r.uniforms,t),i=ju(e),n=i.uboElements,a=i.size,s=[`
|
|
var v = null;
|
|
var v2 = null;
|
|
var cv = null;
|
|
var t = 0;
|
|
var gl = renderer.gl
|
|
var index = 0;
|
|
var data = buffer.data;
|
|
`],o=0;o<n.length;o++){for(var h=n[o],u=r.uniforms[h.data.name],l=h.data.name,f=!1,c=0;c<xe.length;c++){var d=xe[c];if(d.codeUbo&&d.test(h.data,u)){s.push("offset = "+h.offset/4+";",xe[c].codeUbo(h.data.name,u)),f=!0;break}}if(!f)if(h.data.size>1){var v=fa(h.data.type),p=Math.max(pa[h.data.type]/16,1),_=v/p,g=(4-_%4)%4;s.push(`
|
|
cv = ud.`+l+`.value;
|
|
v = uv.`+l+`;
|
|
offset = `+h.offset/4+`;
|
|
|
|
t = 0;
|
|
|
|
for(var i=0; i < `+h.data.size*p+`; i++)
|
|
{
|
|
for(var j = 0; j < `+_+`; j++)
|
|
{
|
|
data[offset++] = v[t++];
|
|
}
|
|
offset += `+g+`;
|
|
}
|
|
|
|
`)}else{var b=Hu[h.data.type];s.push(`
|
|
cv = ud.`+l+`.value;
|
|
v = uv.`+l+`;
|
|
offset = `+h.offset/4+`;
|
|
`+b+`;
|
|
`)}}return s.push(`
|
|
renderer.buffer.update(buffer);
|
|
`),{size:a,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
|
|
`))}}var Yu=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 zu(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var a=t.getActiveAttrib(r,n);if(a.name.indexOf("gl_")!==0){var s=ca(t,a.type),o={type:s,name:a.name,size:fa(s),location:t.getAttribLocation(r,a.name)};e[a.name]=o}}return e}function qu(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),n=0;n<i;n++){var a=t.getActiveUniform(r,n),s=a.name.replace(/\[.*?\]$/,""),o=!!a.name.match(/\[.*?\]$/),h=ca(t,a.type);e[s]={name:s,index:n,type:h,size:a.size,isArray:o,value:ua(h,a.size)}}return e}function $u(r,t){var e=gn(r,r.VERTEX_SHADER,t.vertexSrc),i=gn(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)||_u(r,n,e,i),t.attributeData=zu(n,r),t.uniformData=qu(n,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){var a=Object.keys(t.attributeData);a.sort(function(l,f){return l>f?1:-1});for(var s=0;s<a.length;s++)t.attributeData[a[s]].location=s,r.bindAttribLocation(n,s,a[s]);r.linkProgram(n)}r.deleteShader(e),r.deleteShader(i);var o={};for(var s in t.uniformData){var h=t.uniformData[s];o[s]={location:r.getUniformLocation(n,s),value:ua(h.type,h.size)}}var u=new Yu(n,o);return u}var Ku=0,ar={textureCount:0,uboCount:0},Zu=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=Ku++}return r.prototype.systemCheck=function(){if(!Ru())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||(ar.textureCount=0,ar.uboCount=0,this.syncUniformGroup(t.uniformGroup,ar)),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]=Tu(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,ar,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 a=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,a,this.shader.uniformBindCount),this.shader.uniformBindCount++;var s=this.getSignature(t,this.shader.program.uniformData,"ubo"),o=this._uboCache[s];if(o||(o=this._uboCache[s]=Vu(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,a=[i+"-"];for(var s in n)a.push(s),e[s]&&a.push(e[s].type);return a.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=$u(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 Qu(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 Ju=0,tl=1,el=2,rl=3,il=4,nl=5,al=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=B.NONE,this._blendEq=!1,this.map=[],this.map[Ju]=this.setBlend,this.map[tl]=this.setOffset,this.map[el]=this.setCullFace,this.map[rl]=this.setDepthTest,this.map[il]=this.setFrontFace,this.map[nl]=this.setDepthMask,this.checks=[],this.defaultState=new Ye,this.defaultState.blend=!0}return r.prototype.contextChange=function(t){this.gl=t,this.blendModes=Qu(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}(),sl=function(){function r(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=S.GC_MAX_IDLE,this.checkCountMax=S.GC_MAX_CHECK_COUNT,this.mode=S.GC_MODE}return r.prototype.postrender=function(){!this.renderer.renderingToScreen||(this.count++,this.mode!==br.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 a=e[n];!a.framebuffer&&this.count-a.touched>this.maxIdle&&(t.destroyTexture(a,!0),e[n]=null,i=!0)}if(i){for(var s=0,n=0;n<e.length;n++)e[n]!==null&&(e[s++]=e[n]);e.length=s}},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 ol(r){var t,e,i,n,a,s,o,h,u,l,f,c,d,v,p,_,g,b,T,x,m,y,E;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?E=(t={},t[M.UNSIGNED_BYTE]=(e={},e[w.RGBA]=r.RGBA8,e[w.RGB]=r.RGB8,e[w.RG]=r.RG8,e[w.RED]=r.R8,e[w.RGBA_INTEGER]=r.RGBA8UI,e[w.RGB_INTEGER]=r.RGB8UI,e[w.RG_INTEGER]=r.RG8UI,e[w.RED_INTEGER]=r.R8UI,e[w.ALPHA]=r.ALPHA,e[w.LUMINANCE]=r.LUMINANCE,e[w.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[M.BYTE]=(i={},i[w.RGBA]=r.RGBA8_SNORM,i[w.RGB]=r.RGB8_SNORM,i[w.RG]=r.RG8_SNORM,i[w.RED]=r.R8_SNORM,i[w.RGBA_INTEGER]=r.RGBA8I,i[w.RGB_INTEGER]=r.RGB8I,i[w.RG_INTEGER]=r.RG8I,i[w.RED_INTEGER]=r.R8I,i),t[M.UNSIGNED_SHORT]=(n={},n[w.RGBA_INTEGER]=r.RGBA16UI,n[w.RGB_INTEGER]=r.RGB16UI,n[w.RG_INTEGER]=r.RG16UI,n[w.RED_INTEGER]=r.R16UI,n[w.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),t[M.SHORT]=(a={},a[w.RGBA_INTEGER]=r.RGBA16I,a[w.RGB_INTEGER]=r.RGB16I,a[w.RG_INTEGER]=r.RG16I,a[w.RED_INTEGER]=r.R16I,a),t[M.UNSIGNED_INT]=(s={},s[w.RGBA_INTEGER]=r.RGBA32UI,s[w.RGB_INTEGER]=r.RGB32UI,s[w.RG_INTEGER]=r.RG32UI,s[w.RED_INTEGER]=r.R32UI,s[w.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,s),t[M.INT]=(o={},o[w.RGBA_INTEGER]=r.RGBA32I,o[w.RGB_INTEGER]=r.RGB32I,o[w.RG_INTEGER]=r.RG32I,o[w.RED_INTEGER]=r.R32I,o),t[M.FLOAT]=(h={},h[w.RGBA]=r.RGBA32F,h[w.RGB]=r.RGB32F,h[w.RG]=r.RG32F,h[w.RED]=r.R32F,h[w.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),t[M.HALF_FLOAT]=(u={},u[w.RGBA]=r.RGBA16F,u[w.RGB]=r.RGB16F,u[w.RG]=r.RG16F,u[w.RED]=r.R16F,u),t[M.UNSIGNED_SHORT_5_6_5]=(l={},l[w.RGB]=r.RGB565,l),t[M.UNSIGNED_SHORT_4_4_4_4]=(f={},f[w.RGBA]=r.RGBA4,f),t[M.UNSIGNED_SHORT_5_5_5_1]=(c={},c[w.RGBA]=r.RGB5_A1,c),t[M.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[w.RGBA]=r.RGB10_A2,d[w.RGBA_INTEGER]=r.RGB10_A2UI,d),t[M.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[w.RGB]=r.R11F_G11F_B10F,v),t[M.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[w.RGB]=r.RGB9_E5,p),t[M.UNSIGNED_INT_24_8]=(_={},_[w.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),t[M.FLOAT_32_UNSIGNED_INT_24_8_REV]=(g={},g[w.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,g),t):E=(b={},b[M.UNSIGNED_BYTE]=(T={},T[w.RGBA]=r.RGBA,T[w.RGB]=r.RGB,T[w.ALPHA]=r.ALPHA,T[w.LUMINANCE]=r.LUMINANCE,T[w.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,T),b[M.UNSIGNED_SHORT_5_6_5]=(x={},x[w.RGB]=r.RGB,x),b[M.UNSIGNED_SHORT_4_4_4_4]=(m={},m[w.RGBA]=r.RGBA,m),b[M.UNSIGNED_SHORT_5_5_5_1]=(y={},y[w.RGBA]=r.RGBA,y),b),E}var Zr=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=w.RGBA,this.samplerType=0}return r}(),hl=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new k,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=ol(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 Zr(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 Zr(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 a=0;a<n.length;a++)n[a]===this.unknownTexture&&this.bind(null,a)}for(var a=0;a<n.length;a++)n[a]===t&&(this.currentLocation!==a&&(i.activeTexture(i.TEXTURE0+a),this.currentLocation=a),i.bindTexture(t.target,this.emptyTextures[t.target].texture),n[a]=null)},r.prototype.ensureSamplerType=function(t){var e=this,i=e.boundTextures,n=e.hasIntegerTextures,a=e.CONTEXT_UID;if(!!n)for(var s=t-1;s>=0;--s){var o=i[s];if(o){var h=o._glTextures[a];h.samplerType!==yr.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(t){var e=new Zr(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!==yr.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,a=t.realHeight,s=i.gl;(e.width!==n||e.height!==a||e.dirtyId<0)&&(e.width=n,e.height=a,s.texImage2D(t.target,0,e.internalFormat,n,a,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&&Fe(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];!e||((t.mipmap===ot.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ae.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!==ot.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===Rt.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===Rt.LINEAR){var a=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Rt.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===Rt.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Qr=new ft,ul=function(r){q(t,r);function t(e,i){e===void 0&&(e=Ue.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},S.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new W(0,0,i.width,i.height),n.view=i.view||S.ADAPTER.createCanvas(),n.resolution=i.resolution||S.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&&(Pt("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,a=this.view.height/this.resolution;this.screen.width=n,this.screen.height=a,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=a+"px"),this.emit("resize",n,a)},t.prototype.generateTexture=function(e,i,n,a){i===void 0&&(i={}),typeof i=="number"&&(Pt("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:a});var s=i.region,o=Wh(i,["region"]);a=s||e.getLocalBounds(null,!0),a.width===0&&(a.width=1),a.height===0&&(a.height=1);var h=Ni.create(gi({width:a.width,height:a.height},o));return Qr.tx=-a.x,Qr.ty=-a.y,this.render(e,{renderTexture:h,clear:!1,transform:Qr,skipUpdateTransform:!!e.parent}),h},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=Ue.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=Qn(e),Ge(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}(Nr),ll=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),fl=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,a=t._glBuffers[n]||this.createGLBuffer(t);i.bindBuffer(t.type,a.buffer)},r.prototype.bindBufferBase=function(t,e){var i=this,n=i.gl,a=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var s=t._glBuffers[a]||this.createGLBuffer(t);this.boundBufferBases[e]=t,n.bindBufferBase(n.UNIFORM_BUFFER,e,s.buffer)}},r.prototype.bindBufferRange=function(t,e,i){var n=this,a=n.gl,s=n.CONTEXT_UID;i=i||0;var o=t._glBuffers[s]||this.createGLBuffer(t);a.bindBufferRange(a.UNIFORM_BUFFER,e||0,o.buffer,i*256,256)},r.prototype.update=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,a=t._glBuffers[n];if(t._updateID!==a.updateID)if(a.updateID=t._updateID,i.bindBuffer(t.type,a.buffer),a.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var s=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;a.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,s)}},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 ll(n.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[i]},r}(),_a=function(r){q(t,r);function t(e){var i=r.call(this,Ue.WEBGL,e)||this;return e=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new at("destroy"),contextChange:new at("contextChange"),reset:new at("reset"),update:new at("update"),postrender:new at("postrender"),prerender:new at("prerender"),resize:new at("resize")},i.runners.contextChange.add(i),i.globalUniforms=new he({projectionMatrix:new ft},!0),i.addSystem(Lu,"mask").addSystem(lu,"context").addSystem(al,"state").addSystem(Zu,"shader").addSystem(hl,"texture").addSystem(fl,"buffer").addSystem(vu,"geometry").addSystem(du,"framebuffer").addSystem(Du,"scissor").addSystem(Uu,"stencil").addSystem(Gu,"projection").addSystem(sl,"textureGC").addSystem(hu,"filter").addSystem(ku,"renderTexture").addSystem(uu,"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,Xa(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return t.create=function(e){if(Ha())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>=J.HIGH?this.multisample=J.HIGH:i>=J.MEDIUM?this.multisample=J.MEDIUM:i>=J.LOW?this.multisample=J.LOW:this.multisample=J.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 a in this.runners)this.runners[a].add(n);return this},t.prototype.render=function(e,i){var n,a,s,o;if(i&&(i instanceof Ni?(Pt("6.0.0","Renderer#render arguments changed, use options instead."),n=i,a=arguments[2],s=arguments[3],o=arguments[4]):(n=i.renderTexture,a=i.clear,s=i.transform,o=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(n||(this._lastObjectRendered=e),!o){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(a!==void 0?a:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(e,i,n,a){i===void 0&&(i={});var s=r.prototype.generateTexture.call(this,e,i,n,a);return this.framebuffer.blit(),s},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 Pt("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){Pt("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Tt.add({name:e,type:L.RendererPlugin,ref:i})},t.__plugins={},t}(ul);Tt.handleByMap(L.RendererPlugin,_a.__plugins);function cl(r){return _a.create(r)}var bi=function(){function r(){this.texArray=null,this.blend=0,this.type=Et.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),Ei=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}(),Ti=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}(),dl=function(r){q(t,r);function t(e){var i=r.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=Ye.for2d(),i.size=S.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;S.PREFER_ENV===kt.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),S.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=wu(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,a=Math.floor(n/this.MAX_TEXTURES)+1;e.length<n;)e.push(new bi);for(;i.length<a;)i.push(new Ei);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=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,a=t._textureArrayPool,s=this.renderer.batch,o=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++k._globalBatch,l=0,f=a[0],c=0;s.copyBoundTextures(o,n);for(var d=0;d<this._bufferSize;++d){var v=i[d];i[d]=null,v._batchEnabled!==u&&(f.count>=n&&(s.boundArray(f,o,u,n),this.buildDrawCalls(f,c,d),c=d,f=a[++l],++u),v._batchEnabled=u,v.touched=h,f.elements[f.count++]=v)}f.count>0&&(s.boundArray(f,o,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d<o.length;d++)o[d]=null;k._globalBatch=u},t.prototype.buildDrawCalls=function(e,i,n){var a=this,s=a._bufferedElements,o=a._attributeBuffer,h=a._indexBuffer,u=a.vertexSize,l=t._drawCallPool,f=this._dcIndex,c=this._aIndex,d=this._iIndex,v=l[f];v.start=this._iIndex,v.texArray=e;for(var p=i;p<n;++p){var _=s[p],g=_._texture.baseTexture,b=Bh[g.alphaMode?1:0][_.blendMode];s[p]=null,i<p&&v.blend!==b&&(v.size=d-v.start,i=p,v=l[++f],v.texArray=e,v.start=d),this.packInterleavedGeometry(_,o,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,v.blend=b}i<n&&(v.size=d-v.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,a=e._indexBuffer;S.CAN_UPLOAD_SAME_BUFFER?(i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(a),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,i[this._flushId]=new this.geometryClass),i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(a),this.renderer.geometry.bind(i[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},t.prototype.drawBatches=function(){for(var e=this._dcIndex,i=this.renderer,n=i.gl,a=i.state,s=t._drawCallPool,o=null,h=0;h<e;h++){var u=s[h],l=u.texArray,f=u.type,c=u.size,d=u.start,v=u.blend;o!==l&&(o=l,this.bindAndClearTexArray(l)),this.state.blendMode=v,a.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),S.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=Er(Math.ceil(e/8)),n=un(i),a=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var s=this._aBuffers[a];return s||(this._aBuffers[a]=s=new Ti(a*this.vertexSize*4)),s},t.prototype.getIndexBuffer=function(e){var i=Er(Math.ceil(e/12)),n=un(i),a=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var s=this._iBuffers[n];return s||(this._iBuffers[n]=s=new Uint16Array(a)),s},t.prototype.packInterleavedGeometry=function(e,i,n,a,s){for(var o=i.uint32View,h=i.float32View,u=a/this.vertexSize,l=e.uvs,f=e.indices,c=e.vertexData,d=e._texture.baseTexture._batchLocation,v=Math.min(e.worldAlpha,1),p=v<1&&e._texture.baseTexture.alphaMode?ta(e._tintRGB,v):e._tintRGB+(v*255<<24),_=0;_<c.length;_+=2)h[a++]=c[_],h[a++]=c[_+1],h[a++]=l[_],h[a++]=l[_+1],o[a++]=p,h[a++]=d;for(var _=0;_<f.length;_++)n[s++]=u+f[_]},t._drawCallPool=[],t._textureArrayPool=[],t}(ha),vl=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]=he.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 Ve(this.vertexSrc,n)}var a={tint:new Float32Array([1,1,1,1]),translationMatrix:new ft,default:this.defaultGroupCache[t]};return new Lr(this.programCache[t],a)},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}(),ga=function(r){q(t,r);function t(e){e===void 0&&(e=!1);var i=r.call(this)||this;return i._buffer=new ut(null,e,!1),i._indexBuffer=new ut(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}(Fr),An=`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;
|
|
}
|
|
`,wn=`varying vec2 vTextureCoord;
|
|
varying vec4 vColor;
|
|
varying float vTextureId;
|
|
uniform sampler2D uSamplers[%count%];
|
|
|
|
void main(void){
|
|
vec4 color;
|
|
%forloop%
|
|
gl_FragColor = color * vColor;
|
|
}
|
|
`,pl=function(){function r(){}return r.create=function(t){var e=Object.assign({vertex:An,fragment:wn,geometryClass:ga,vertexSize:6},t),i=e.vertex,n=e.fragment,a=e.vertexSize,s=e.geometryClass;return function(o){q(h,o);function h(u){var l=o.call(this,u)||this;return l.shaderGenerator=new vl(i,n),l.geometryClass=s,l.vertexSize=a,l}return h}(dl)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return An},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return wn},enumerable:!1,configurable:!0}),r}(),_l=pl.create();Object.assign(_l,{extension:{name:"batch",type:L.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
|
|
*/S.SORTABLE_CHILDREN=!1;var xr=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,a=t.c,s=t.d,o=t.tx,h=t.ty,u=i*e.x+a*e.y+o,l=n*e.x+s*e.y+h;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},r.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,a=this.maxY,s=t[0],o=t[1];e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=t[2],o=t[3],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=t[4],o=t[5],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,s=t[6],o=t[7],e=s<e?s:e,i=o<i?o:i,n=s>n?s:n,a=o>a?o:a,this.minX=e,this.minY=i,this.maxX=n,this.maxY=a},r.prototype.addFrame=function(t,e,i,n,a){this.addFrameMatrix(t.worldTransform,e,i,n,a)},r.prototype.addFrameMatrix=function(t,e,i,n,a){var s=t.a,o=t.b,h=t.c,u=t.d,l=t.tx,f=t.ty,c=this.minX,d=this.minY,v=this.maxX,p=this.maxY,_=s*e+h*i+l,g=o*e+u*i+f;c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=s*n+h*i+l,g=o*n+u*i+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=s*e+h*a+l,g=o*e+u*a+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=s*n+h*a+l,g=o*n+u*a+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,this.minX=c,this.minY=d,this.maxX=v,this.maxY=p},r.prototype.addVertexData=function(t,e,i){for(var n=this.minX,a=this.minY,s=this.maxX,o=this.maxY,h=e;h<i;h+=2){var u=t[h],l=t[h+1];n=u<n?u:n,a=l<a?l:a,s=u>s?u:s,o=l>o?l:o}this.minX=n,this.minY=a,this.maxX=s,this.maxY=o},r.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},r.prototype.addVerticesMatrix=function(t,e,i,n,a,s){a===void 0&&(a=0),s===void 0&&(s=a);for(var o=t.a,h=t.b,u=t.c,l=t.d,f=t.tx,c=t.ty,d=this.minX,v=this.minY,p=this.maxX,_=this.maxY,g=i;g<n;g+=2){var b=e[g],T=e[g+1],x=o*b+u*T+f,m=l*T+h*b+c;d=Math.min(d,x-a),p=Math.max(p,x+a),v=Math.min(v,m-s),_=Math.max(_,m+s)}this.minX=d,this.minY=v,this.maxX=p,this.maxY=_},r.prototype.addBounds=function(t){var e=this.minX,i=this.minY,n=this.maxX,a=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>a?t.maxY:a},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,a=t.maxX<e.maxX?t.maxX:e.maxX,s=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},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,a=t.maxX<e.x+e.width?t.maxX:e.x+e.width,s=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=a&&n<=s){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=a>u?a:u,this.maxY=s>l?s:l}},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,a,s){t-=a,e-=s,i+=a,n+=s,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 xi=function(r,t){return xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},xi(r,t)};function Fi(r,t){xi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Ar=function(r){Fi(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new jh,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 xr,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 a=i[n];Object.defineProperty(t.prototype,a,Object.getOwnPropertyDescriptor(e,a))}},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 xr);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var a=this._bounds,s=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,e);return this.parent=n,this.transform=i,this._bounds=a,this._bounds.updateID+=this._boundsID-s,o},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,a){return i&&(e=i.toGlobal(e,n,a)),a||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)},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,a,s,o,h,u,l){return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=1),s===void 0&&(s=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=e,this.position.y=i,this.scale.x=n||1,this.scale.y=a||1,this.rotation=s,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},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 gl),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*Dh},set:function(e){this.transform.rotation=e*Uh},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}(Nr),gl=function(r){Fi(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.sortDirty=null,e}return t}(Ar);Ar.prototype.displayObjectUpdateTransform=Ar.prototype.updateTransform;function ml(r,t){return r.zIndex===t.zIndex?r._lastSortedIndex-t._lastSortedIndex:r.zIndex-t.zIndex}var le=function(r){Fi(t,r);function t(){var e=r.call(this)||this;return e.children=[],e.sortableChildren=S.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 a=0;a<i.length;a++)this.addChild(i[a]);else{var s=i[0];s.parent&&s.parent.removeChild(s),s.parent=this,this.sortDirty=!0,s.transform._parentID=-1,this.children.push(s),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",s,this,this.children.length-1),s.emit("added",this)}return i[0]},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),a=this.getChildIndex(i);this.children[n]=i,this.children[a]=e,this.onChildrenChange(n<a?n:a)}},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);Fe(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 a=0;a<i.length;a++)this.removeChild(i[a]);else{var s=i[0],o=this.children.indexOf(s);if(o===-1)return null;s.parent=null,s.transform._parentID=-1,Fe(this.children,o,1),this._boundsID++,this.onChildrenChange(o),s.emit("removed",this),this.emit("childRemoved",s,this,o)}return i[0]},t.prototype.removeChildAt=function(e){var i=this.getChildAt(e);return i.parent=null,i.transform._parentID=-1,Fe(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,a=i,s=a-n,o;if(s>0&&s<=a){o=this.children.splice(n,s);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(s===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},t.prototype.sortChildren=function(){for(var e=!1,i=0,n=this.children.length;i<n;++i){var a=this.children[i];a._lastSortedIndex=i,!e&&a.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(ml),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 a=0,s=this.children.length;a<s;++a){var o=this.children[a];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,a;if(this.cullArea?(n=this.cullArea,a=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,a))this._render(e);else if(this.cullArea)return;for(var s=0,o=this.children.length;s<o;++s){var h=this.children[s],u=h.cullable;h.cullable=u||!this.cullArea,h.render(e),h.cullable=u}}},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 a=0;a<i.length;a++)i[a].enabled&&this._enabledFilters.push(i[a])}var s=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==et.NONE));if(s&&e.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(var a=0,o=this.children.length;a<o;++a)this.children[a].render(e)}s&&e.batch.flush(),n&&e.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},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 a=0;a<n.length;++a)n[a].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}(Ar);le.prototype.containerUpdateTransform=le.prototype.updateTransform;/*!
|
|
* @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 yl=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 a=e._resizeTo,s=a.clientWidth,o=a.clientHeight;i=s,n=o}e.renderer.resize(i,n)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=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=L.Application,r}(),bl=function(){function r(t){var e=this;this.stage=new le,t=Object.assign({forceCanvas:!1},t),this.renderer=cl(t),r._plugins.forEach(function(i){i.init.call(e,t)})}return r.registerPlugin=function(t){Pt("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Tt.add({type:L.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(a){a.destroy.call(i)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null},r._plugins=[],r}();Tt.handleByList(L.Application,bl._plugins);Tt.add(yl);/*!
|
|
* @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 sr=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 Rn(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 Dt=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 sr))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 Rn(this,new sr(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 Rn(this,new sr(t,!0,e))},r.prototype.detach=function(t){if(!(t instanceof sr))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 ma(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={},a=14;a--;)n[e.key[a]]=i[a]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(s,o,h){o&&(n[e.q.name][o]=h)}),n}var Jr,or=null,El=0,Sn=200,Tl=204,xl=1223,Al=2;function Pn(){}function In(r,t,e){t&&t.indexOf(".")===0&&(t=t.substring(1)),t&&(r[t]=e)}function ti(r){return r.toString().replace("object ","")}var K=function(){function r(t,e,i){if(this._dequeue=Pn,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=Pn,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 Dt,this.onProgress=new Dt,this.onComplete=new Dt,this.onAfterMiddleware=new Dt}return r.setExtensionLoadType=function(t,e){In(r._loadTypeMap,t,e)},r.setExtensionXhrType=function(t,e){In(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 Jr=="undefined"&&(Jr=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),Jr&&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(ti(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},r.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(ti(t)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(ti(t)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var t=this.xhr,e="",i=typeof t.status=="undefined"?Sn:t.status;(t.responseType===""||t.responseType==="text"||typeof t.responseType=="undefined")&&(e=t.responseText),i===El&&(e.length>0||t.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=Sn:i===xl&&(i=Tl);var n=i/100|0;if(n===Al)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 a=new DOMParser;this.data=a.parseFromString(e,"text/xml")}else{var s=document.createElement("div");s.innerHTML=e,this.data=s}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,or||(or=document.createElement("a")),or.href=t;var i=ma(or.href,{strictMode:!0}),n=!i.port&&e.port===""||i.port===e.port,a=i.protocol?i.protocol+":":"";return i.host!==e.hostname||!n||a!==e.protocol?"anonymous":""},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("?"),a=t.indexOf("#"),s=Math.min(n>-1?n:t.length,a>-1?a:t.length);t=t.substring(0,s),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=="})(K||(K={}));function Jt(){}function wl(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 a=r;r=null,a.apply(this,i)}}var Rl=function(){function r(t,e){this.data=t,this.callback=e}return r}(),ei=function(){function r(t,e){var i=this;if(e===void 0&&(e=1),this.workers=0,this.saturated=Jt,this.unsaturated=Jt,this.empty=Jt,this.drain=Jt,this.error=Jt,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,a,s){if(s&&typeof s!="function")throw new Error("task callback must be a function");if(i.started=!0,n==null&&i.idle()){setTimeout(function(){return i.drain()},1);return}var o=new Rl(n,typeof s=="function"?s:Jt);a?i._tasks.unshift(o):i._tasks.push(o),setTimeout(i.process,1)},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var n=i._tasks.shift();i._tasks.length===0&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(n.data,wl(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=[],a=0;a<arguments.length;a++)n[a]=i[a];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=Jt,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 a=0,s=t.length;function o(h){if(h||a===s){i&&i(h);return}n?setTimeout(function(){e(t[a++],o)},1):e(t[a++],o)}o()},r.queue=function(t,e){return new r(t,e)},r}(),ri=100,Sl=/(#[\w-]+)?$/,wr=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=ei.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new Dt,this.onError=new Dt,this.onLoad=new Dt,this.onStart=new Dt,this.onComplete=new Dt;for(var n=0;n<r._plugins.length;++n){var a=r._plugins[n],s=a.pre,o=a.use;s&&this.pre(s),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 K(t,e,i),typeof n=="function"&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var a=i.parentResource,s=[],o=0;o<a.children.length;++o)a.children[o].isComplete||s.push(a.children[o]);var h=a.progressChunk*(s.length+1),u=h/(s.length+2);a.children.push(this.resources[t]),a.progressChunk=u;for(var o=0;o<s.length;++o)s[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(Pt("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=ri/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=ma(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=Sl.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,ei.eachSeries(this._beforeMiddleware,function(n,a){n.call(i,t,function(){a(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=ri,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(),ei.eachSeries(this._afterMiddleware,function(i,n){i.call(e,t,n)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(ri,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 Pt("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Tt.add({type:L.Loader,ref:t}),r},r._plugins=[],r}();Tt.handleByList(L.Loader,wr._plugins);wr.prototype.add=function(t,e,i,n){if(Array.isArray(t)){for(var a=0;a<t.length;++a)this.add(t[a]);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?wr.shared:new wr},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=L.Application,r})();var Pl=function(){function r(){}return r.add=function(){K.setExtensionLoadType("svg",K.LOAD_TYPE.XHR),K.setExtensionXhrType("svg",K.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){if(t.data&&(t.type===K.TYPE.IMAGE||t.extension==="svg")){var i=t.data,n=t.url,a=t.name,s=t.metadata;X.fromLoader(i,n,a,s).then(function(o){t.texture=o,e()}).catch(e)}else e()},r.extension=L.Loader,r}(),Il="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Cl(r){for(var t="",e=0;e<r.length;){for(var i=[0,0,0],n=[0,0,0,0],a=0;a<i.length;++a)e<r.length?i[a]=r.charCodeAt(e++)&255:i[a]=0;n[0]=i[0]>>2,n[1]=(i[0]&3)<<4|i[1]>>4,n[2]=(i[1]&15)<<2|i[2]>>6,n[3]=i[2]&63;var s=e-(r.length-1);switch(s){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var a=0;a<n.length;++a)t+=Il.charAt(n[a])}return t}function Ol(r,t){if(!r.data){t();return}if(r.xhr&&r.xhrType===K.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,"+Cl(r.xhr.responseText),r.type=K.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=K.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,t()};return}}t()}var Bl=function(){function r(){}return r.extension=L.Loader,r.use=Ol,r}();Tt.add(Pl,Bl);/*!
|
|
* @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 Li=function(){function r(t,e,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=t instanceof X?t:null,this.baseTexture=t instanceof k?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=qt(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&&Pt("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],a=this._frames[n],s=a.frame;if(s){var o=null,h=null,u=a.trimmed!==!1&&a.sourceSize?a.sourceSize:a.frame,l=new W(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);a.rotated?o=new W(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):o=new W(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),a.trimmed!==!1&&a.spriteSourceSize&&(h=new W(Math.floor(a.spriteSourceSize.x)/this.resolution,Math.floor(a.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[n]=new X(this.baseTexture,o,l,h,a.rotated?2:0,a.anchor),X.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,a=this,s=t.name+"_image";if(!t.data||t.type!==K.TYPE.JSON||!t.data.frames||a.resources[s]){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(v){if(typeof v!="string")return"continue";var p=v.replace(".json",""),_=be.resolve(t.url.replace(a.baseUrl,""),v);if(a.resources[p]||Object.values(a.resources).some(function(b){return be.format(be.parse(b.url))===_}))return"continue";var g={crossOrigin:t.crossOrigin,loadType:K.LOAD_TYPE.XHR,xhrType:K.XHR_RESPONSE_TYPE.JSON,parentResource:t,metadata:t.metadata};a.add(p,_,g)},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,a.baseUrl);a.add(s,d,c,function(p){if(p.error){e(p.error);return}var _=new Li(p.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:be.resolve(t.url.replace(e,""),t.data.meta.image)},r.extension=L.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,N;(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"})(N||(N={}));var Rr=(z={},z[N.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,z[N.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,z[N.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,z[N.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,z[N.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,z[N.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,z[N.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,z[N.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,z[N.COMPRESSED_R11_EAC]=.5,z[N.COMPRESSED_SIGNED_R11_EAC]=.5,z[N.COMPRESSED_RG11_EAC]=1,z[N.COMPRESSED_SIGNED_RG11_EAC]=1,z[N.COMPRESSED_RGB8_ETC2]=.5,z[N.COMPRESSED_RGBA8_ETC2_EAC]=1,z[N.COMPRESSED_SRGB8_ETC2]=.5,z[N.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,z[N.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[N.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,z[N.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,z[N.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,z[N.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,z[N.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,z[N.COMPRESSED_RGB_ETC1_WEBGL]=.5,z[N.COMPRESSED_RGB_ATC_WEBGL]=.5,z[N.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,z[N.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,z[N.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 Ai=function(r,t){return Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Ai(r,t)};function ya(r,t){Ai(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ml(r,t,e,i){function n(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(l){try{u(i.next(l))}catch(f){s(f)}}function h(l){try{u(i.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):n(l.value).then(o,h)}u((i=i.apply(r,t||[])).next())})}function Nl(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Fl=function(r){ya(t,r);function t(e,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,a,s;return typeof e=="string"?(a=e,s=new Uint8Array):(a=null,s=e),n=r.call(this,s,i)||this,n.origin=a,n.buffer=s?new Ti(s):null,n.origin&&i.autoLoad!==!1&&n.load(),s&&s.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return Ml(this,void 0,Promise,function(){var e,i,n;return Nl(this,function(a){switch(a.label){case 0:return[4,fetch(this.origin)];case 1:return e=a.sent(),[4,e.blob()];case 2:return i=a.sent(),[4,i.arrayBuffer()];case 3:return n=a.sent(),this.data=new Uint32Array(n),this.buffer=new Ti(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},t}(ue),fe=function(r){ya(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 a=e.gl,s=e.context.extensions[this._extension];if(!s)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,h=this.levels;o<h;o++){var u=this._levelBuffers[o],l=u.levelID,f=u.levelWidth,c=u.levelHeight,d=u.levelBuffer;a.compressedTexImage2D(a.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,a,s,o,h){for(var u=new Array(n),l=e.byteOffset,f=o,c=h,d=f+a-1&~(a-1),v=c+s-1&~(s-1),p=d*v*Rr[i],_=0;_<n;_++)u[_]={levelID:_,levelWidth:n>1?f:d,levelHeight:n>1?c:v,levelBuffer:new Uint8Array(e.buffer,l,p)},l+=p,f=f>>1||1,c=c>>1||1,d=f+a-1&~(a-1),v=c+s-1&~(s-1),p=d*v*Rr[i];return u},t}(Fl);(function(){function r(){}return r.use=function(t,e){var i=t.data,n=this;if(t.type===K.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var a=i.textures,s=void 0,o=void 0,h=0,u=a.length;h<u;h++){var l=a[h],f=l.src,c=l.format;if(c||(o=f),r.textureFormats[c]){s=f;break}}if(s=s||o,!s){e(new Error("Cannot load compressed-textures in "+t.url+", make sure you provide a fallback"));return}if(s===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},v=be.resolve(t.url.replace(n.baseUrl,""),s),p=i.cacheID;n.add(p,v,d,function(_){if(_.error){e(_.error);return}var g=_.texture,b=g===void 0?null:g,T=_.textures,x=T===void 0?{}:T;Object.assign(t,{texture:b,textures:x}),e()})}else e()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var t=S.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=L.Loader,r})();function ba(r,t,e){var i={textures:{},texture:null};if(!t)return i;var n=t.map(function(a){return new X(new k(a,Object.assign({mipmap:ot.OFF,alphaMode:lt.NO_PREMULTIPLIED_ALPHA},e)))});return n.forEach(function(a,s){var o=a.baseTexture,h=r+"-"+(s+1);k.addToCache(o,h),X.addToCache(a,h),s===0&&(k.addToCache(o,r),X.addToCache(a,r),i.texture=a),i.textures[h]=a}),i}var Ie,mt,ii=4,hr=124,Ll=32,Cn=20,Dl=542327876,ur={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},Ul={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},lr={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},bt;(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"})(bt||(bt={}));var wi;(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"})(wi||(wi={}));var Gl=1,kl=2,Xl=4,Hl=64,jl=512,Wl=131072,Vl=827611204,Yl=861165636,zl=894720068,ql=808540228,$l=4,Kl=(Ie={},Ie[Vl]=N.COMPRESSED_RGBA_S3TC_DXT1_EXT,Ie[Yl]=N.COMPRESSED_RGBA_S3TC_DXT3_EXT,Ie[zl]=N.COMPRESSED_RGBA_S3TC_DXT5_EXT,Ie),Zl=(mt={},mt[bt.DXGI_FORMAT_BC1_TYPELESS]=N.COMPRESSED_RGBA_S3TC_DXT1_EXT,mt[bt.DXGI_FORMAT_BC1_UNORM]=N.COMPRESSED_RGBA_S3TC_DXT1_EXT,mt[bt.DXGI_FORMAT_BC2_TYPELESS]=N.COMPRESSED_RGBA_S3TC_DXT3_EXT,mt[bt.DXGI_FORMAT_BC2_UNORM]=N.COMPRESSED_RGBA_S3TC_DXT3_EXT,mt[bt.DXGI_FORMAT_BC3_TYPELESS]=N.COMPRESSED_RGBA_S3TC_DXT5_EXT,mt[bt.DXGI_FORMAT_BC3_UNORM]=N.COMPRESSED_RGBA_S3TC_DXT5_EXT,mt[bt.DXGI_FORMAT_BC1_UNORM_SRGB]=N.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,mt[bt.DXGI_FORMAT_BC2_UNORM_SRGB]=N.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,mt[bt.DXGI_FORMAT_BC3_UNORM_SRGB]=N.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,mt);function Ea(r){var t=new Uint32Array(r),e=t[0];if(e!==Dl)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,hr/Uint32Array.BYTES_PER_ELEMENT),n=i[ur.HEIGHT],a=i[ur.WIDTH],s=i[ur.MIPMAP_COUNT],o=new Uint32Array(r,ur.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Ll/Uint32Array.BYTES_PER_ELEMENT),h=o[Gl];if(h&Xl){var u=o[Ul.FOURCC];if(u!==ql){var l=Kl[u],f=ii+hr,c=new Uint8Array(r,f),d=new fe(c,{format:l,width:a,height:n,levels:s});return[d]}var v=ii+hr,p=new Uint32Array(t.buffer,v,Cn/Uint32Array.BYTES_PER_ELEMENT),_=p[lr.DXGI_FORMAT],g=p[lr.RESOURCE_DIMENSION],b=p[lr.MISC_FLAG],T=p[lr.ARRAY_SIZE],x=Zl[_];if(x===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(b===$l)throw new Error("DDSParser does not support cubemap textures");if(g===wi.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var m=new Array,y=ii+hr+Cn;if(T===1)m.push(new Uint8Array(r,y));else{for(var E=Rr[x],P=0,A=a,R=n,O=0;O<s;O++){var D=Math.max(1,A+3&-4),j=Math.max(1,R+3&-4),Q=D*j*E;P+=Q,A=A>>>1,R=R>>>1}for(var I=y,O=0;O<T;O++)m.push(new Uint8Array(r,I,P)),I+=P}return m.map(function(C){return new fe(C,{format:x,width:a,height:n,levels:s})})}throw h&Hl?new Error("DDSParser does not support uncompressed texture data."):h&jl?new Error("DDSParser does not supported YUV uncompressed texture data."):h&Wl?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&kl?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 Wt,Ot,Ce,On=[171,75,84,88,32,49,49,187,13,10,26,10],Ql=67305985,yt={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},Ri=64,Bn=(Wt={},Wt[M.UNSIGNED_BYTE]=1,Wt[M.UNSIGNED_SHORT]=2,Wt[M.INT]=4,Wt[M.UNSIGNED_INT]=4,Wt[M.FLOAT]=4,Wt[M.HALF_FLOAT]=8,Wt),Jl=(Ot={},Ot[w.RGBA]=4,Ot[w.RGB]=3,Ot[w.RG]=2,Ot[w.RED]=1,Ot[w.LUMINANCE]=1,Ot[w.LUMINANCE_ALPHA]=2,Ot[w.ALPHA]=1,Ot),tf=(Ce={},Ce[M.UNSIGNED_SHORT_4_4_4_4]=2,Ce[M.UNSIGNED_SHORT_5_5_5_1]=2,Ce[M.UNSIGNED_SHORT_5_6_5]=2,Ce);function Ta(r,t,e){e===void 0&&(e=!1);var i=new DataView(t);if(!ef(r,i))return null;var n=i.getUint32(yt.ENDIANNESS,!0)===Ql,a=i.getUint32(yt.GL_TYPE,n),s=i.getUint32(yt.GL_FORMAT,n),o=i.getUint32(yt.GL_INTERNAL_FORMAT,n),h=i.getUint32(yt.PIXEL_WIDTH,n),u=i.getUint32(yt.PIXEL_HEIGHT,n)||1,l=i.getUint32(yt.PIXEL_DEPTH,n)||1,f=i.getUint32(yt.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(yt.NUMBER_OF_FACES,n),d=i.getUint32(yt.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(yt.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 p=4,_=4,g=h+3&-4,b=u+3&-4,T=new Array(f),x=h*u;a===0&&(x=g*b);var m;if(a!==0?Bn[a]?m=Bn[a]*Jl[s]:m=tf[a]:m=Rr[o],m===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var y=e?nf(i,v,n):null,E=x*m,P=E,A=h,R=u,O=g,D=b,j=Ri+v,Q=0;Q<d;Q++){for(var I=i.getUint32(j,n),C=j+4,H=0;H<f;H++){var ht=T[H];ht||(ht=T[H]=new Array(d)),ht[Q]={levelID:Q,levelWidth:d>1||a!==0?A:O,levelHeight:d>1||a!==0?R:D,levelBuffer:new Uint8Array(t,C,P)},C+=P}j+=I+4,j=j%4!==0?j+4-j%4:j,A=A>>1||1,R=R>>1||1,O=A+p-1&~(p-1),D=R+_-1&~(_-1),P=O*D*m}return a!==0?{uncompressed:T.map(function(V){var tt=V[0].levelBuffer,F=!1;return a===M.FLOAT?tt=new Float32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4):a===M.UNSIGNED_INT?(F=!0,tt=new Uint32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4)):a===M.INT&&(F=!0,tt=new Int32Array(V[0].levelBuffer.buffer,V[0].levelBuffer.byteOffset,V[0].levelBuffer.byteLength/4)),{resource:new ue(tt,{width:V[0].levelWidth,height:V[0].levelHeight}),type:a,format:F?rf(s):s}}),kvData:y}:{compressed:T.map(function(V){return new fe(null,{format:o,width:h,height:u,levels:d,levelBuffers:V})}),kvData:y}}function ef(r,t){for(var e=0;e<On.length;e++)if(t.getUint8(e)!==On[e])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function rf(r){switch(r){case w.RGBA:return w.RGBA_INTEGER;case w.RGB:return w.RGB_INTEGER;case w.RG:return w.RG_INTEGER;case w.RED:return w.RED_INTEGER;default:return r}}function nf(r,t,e){for(var i=new Map,n=0;n<t;){var a=r.getUint32(Ri+n,e),s=Ri+n+4,o=3-(a+3)%4;if(a===0||a>t-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h<a&&r.getUint8(s+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,s,h)),l=new DataView(r.buffer,s+h+1,a-h-1);i.set(u,l),n+=4+a+o}return i}K.setExtensionXhrType("dds",K.XHR_RESPONSE_TYPE.BUFFER);(function(){function r(){}return r.use=function(t,e){if(t.extension==="dds"&&t.data)try{Object.assign(t,ba(t.name||t.url,Ea(t.data),t.metadata))}catch(i){e(i);return}e()},r.extension=L.Loader,r})();K.setExtensionXhrType("ktx",K.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=Ta(i,t.data,this.loadKeyValueData),a=n.compressed,s=n.uncompressed,o=n.kvData;if(a){var h=ba(i,a,t.metadata);if(o&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=o;Object.assign(t,h)}else if(s){var l={};s.forEach(function(f,c){var d=new X(new k(f.resource,{mipmap:ot.OFF,alphaMode:lt.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);o&&(d.baseTexture.ktxKeyValueData=o),k.addToCache(d.baseTexture,v),X.addToCache(d,v),c===0&&(l[i]=d,k.addToCache(d.baseTexture,i),X.addToCache(d,i)),l[v]=d}),Object.assign(t,{textures:l})}}catch(f){e(f);return}e()},r.extension=L.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 Sr(r,t,e,i){function n(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(l){try{u(i.next(l))}catch(f){s(f)}}function h(l){try{u(i.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):n(l.value).then(o,h)}u((i=i.apply(r,t||[])).next())})}function Pr(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Bt,Oe,Be,it;(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"})(it||(it={}));var Ir=(Bt={},Bt[it.cTFETC1]=N.COMPRESSED_RGB_ETC1_WEBGL,Bt[it.cTFBC1]=N.COMPRESSED_RGB_S3TC_DXT1_EXT,Bt[it.cTFBC3]=N.COMPRESSED_RGBA_S3TC_DXT5_EXT,Bt[it.cTFPVRTC1_4_RGB]=N.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,Bt[it.cTFPVRTC1_4_RGBA]=N.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,Bt[it.cTFATC_RGB]=N.COMPRESSED_RGB_ATC_WEBGL,Bt[it.cTFASTC_4x4]=N.COMPRESSED_RGBA_ASTC_4x4_KHR,Bt),xa=(Oe={},Oe[it.cTFRGBA32]=M.UNSIGNED_BYTE,Oe[it.cTFRGB565]=M.UNSIGNED_SHORT_5_6_5,Oe[it.cTFRGBA4444]=M.UNSIGNED_SHORT_4_4_4_4,Oe),af=Object.keys(Ir).map(function(r){return Number(r)}).reduce(function(r,t){return r[Ir[t]]=t,r},{}),Mn=(Be={},Be[it.cTFBC3]=!0,Be[it.cTFPVRTC1_4_RGBA]=!0,Be[it.cTFASTC_4x4]=!0,Be);function sf(){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,a=i,s=new n.BasisFile(a),o=s.getNumImages(),h=s.getHasAlpha(),u=h?e.rgbaFormat:e.rgbFormat,l=14,f=new Array(o),c=!1;if(!s.startTranscoding())return s.close(),s.delete(),{type:"transcode",requestID:e.requestID,success:!1,imageArray:null};for(var d=0;d<o;d++){for(var v=s.getNumLevels(d),p={imageID:d,levelArray:new Array,width:null,height:null},_=0;_<v;_++){var g=c?l:u,b=s.getImageWidth(d,_),T=s.getImageHeight(d,_),x=s.getImageTranscodedSizeInBytes(d,_,g),m=b+3&-4,y=T+3&-4;_===0&&(p.width=m,p.height=y);var E=new Uint8Array(x);if(!s.transcodeImage(E,d,_,g,!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}p.levelArray.push({levelID:_,levelWidth:b,levelHeight:T,levelBuffer:E})}f[d]=p}return s.close(),s.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 De=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=sf.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 Sr(this,void 0,Promise,function(){var n,a,s=this;return Pr(this,function(o){return++this.load,n=r._tempID++,a=new Promise(function(h,u){s.requests[n]={resolve:h,reject:u}}),this.worker.postMessage({requestID:n,basisData:t,rgbaFormat:e,rgbFormat:i,type:"transcode"}),[2,a]})})},r.loadTranscoder=function(t,e){var i=this,n=fetch(t).then(function(s){return s.text()}).then(function(s){r.jsSource=s}),a=fetch(e).then(function(s){return s.arrayBuffer()}).then(function(s){r.wasmSource=s});return Promise.all([n,a]).then(function(s){return i._onTranscoderInitializedResolve(),s})},r.setTranscoder=function(t,e){r.jsSource=t,r.wasmSource=e},r.onTranscoderInitialized=new Promise(function(t){r._onTranscoderInitializedResolve=t}),r._tempID=0,r}(),Lt=function(){function r(){}return r.transcode=function(t){return Sr(this,void 0,Promise,function(){var e;return Pr(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 Sr(this,void 0,Promise,function(){var e,i,n,f,c,a,s,o,h,u,l,f,c;return Pr(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 De,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(a=d.sent(),s=a.basisFormat,o=a.imageArray,h=s>12,h)u=o.map(function(v){return new ue(new Uint16Array(v.levelArray[0].levelBuffer.buffer),{width:v.width,height:v.height})});else for(l=Ir[a.basisFormat],u=new Array(o.length),f=0,c=o.length;f<c;f++)u[f]=new fe(null,{format:l,width:o[f].width,height:o[f].height,levelBuffers:o[f].levelArray,levels:o[f].levelArray.length});return u.basisFormat=s,[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),a=n.getNumImages(),s=n.getHasAlpha(),o=s?r.defaultRGBAFormat.basisFormat:r.defaultRGBFormat.basisFormat,h=it.cTFRGB565,u=new Array(a),l=r.fallbackMode;if(!n.startTranscoding())return console.error("Basis failed to start transcoding!"),n.close(),n.delete(),null;for(var f=0;f<a;f++){for(var c=l?1:n.getNumLevels(f),d=n.getImageWidth(f,0),v=n.getImageHeight(f,0),p=d+3&-4,_=v+3&-4,g=new Array(c),b=0;b<c;b++){var T=n.getImageWidth(f,b),x=n.getImageHeight(f,b),m=n.getImageTranscodedSizeInBytes(f,0,l?h:o);if(g[b]={levelID:b,levelBuffer:new Uint8Array(m),levelWidth:T,levelHeight:x},!n.transcodeImage(g[b].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 y=void 0;l?y=new ue(new Uint16Array(g[0].levelBuffer.buffer),{width:d,height:v}):y=new fe(null,{format:Ir[o],width:p,height:_,levelBuffers:g,levels:c}),u[f]=y}n.close(),n.delete();var E=u;return E.basisFormat=l?h:o,E},r.autoDetectFormats=function(t){if(!t){var e=S.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 a in t){var s=t[a];!s||Object.assign(n,Object.getPrototypeOf(s))}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=af[u],l!==void 0&&(h&&Mn[l]||!h&&!Mn[l]))break;u?r[h?"defaultRGBAFormat":"defaultRGBFormat"]={textureFormat:u,basisFormat:l}:(r[h?"defaultRGBAFormat":"defaultRGBFormat"]={textureFormat:M.UNSIGNED_SHORT_5_6_5,basisFormat:it.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 De,this.workerPool[e].initAsync()},enumerable:!1,configurable:!0}),r.extension=L.Loader,r.fallbackMode=!1,r.workerPool=[],r.TranscoderWorker=De,r}();K.setExtensionXhrType("basis",K.XHR_RESPONSE_TYPE.BUFFER);var of=function(){function r(){}return r.use=function(t,e){var i=this;t.extension==="basis"&&t.data?function(){return Sr(i,void 0,void 0,function(){var n;return Pr(this,function(a){switch(a.label){case 0:return!Lt.basisBinding&&!Lt.TranscoderWorker.wasmSource?[4,De.onTranscoderInitialized]:[3,2];case 1:a.sent(),a.label=2;case 2:return[4,Lt.transcode(t.data)];case 3:return n=a.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 a=xa[e.basisFormat],s=e.basisFormat!==it.cTFRGBA32?w.RGB:w.RGBA,o=e,h=o.map(function(u){return new X(new k(u,Object.assign({mipmap:u instanceof fe&&u.levels>1?ot.ON_MANUAL:ot.OFF,alphaMode:lt.NO_PREMULTIPLIED_ALPHA,type:a,format:s},i)))});return h.forEach(function(u,l){var f=u.baseTexture,c=t+"-"+(l+1);k.addToCache(f,c),X.addToCache(u,c),l===0&&(k.addToCache(f,t),X.addToCache(u,t),n.texture=u),n.textures[c]=u}),n},r.bindTranscoder=function(t){Lt.basisBinding=t},r.loadTranscoder=function(t,e){return Lt.TranscoderWorker.loadTranscoder(t,e)},r.setTranscoder=function(t,e){Lt.TranscoderWorker.setTranscoder(t,e)},r.extension=L.Loader,r}();Tt.add(of);/*!
|
|
* @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 Si=function(r,t){return Si=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])},Si(r,t)};function Di(r,t){Si(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var hf=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}(),ni=new rt,Nn=new pr,Fn=function(r){Di(t,r);function t(e,i,n,a){a===void 0&&(a=Et.TRIANGLES);var s=r.call(this)||this;return s.geometry=e,s.shader=i,s.state=n||Ye.for2d(),s.drawMode=a,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=S.ROUND_PIXELS,s.batchUvs=null,s}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===Et.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 a=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[a]),e.plugins[a].render(this)},t.prototype.calculateVertices=function(){var e=this.geometry,i=e.buffers[0],n=i.data,a=i._updateID;if(!(a===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==n.length&&(this.vertexData=new Float32Array(n.length));for(var s=this.transform.worldTransform,o=s.a,h=s.b,u=s.c,l=s.d,f=s.tx,c=s.ty,d=this.vertexData,v=0;v<d.length/2;v++){var p=n[v*2],_=n[v*2+1];d[v*2]=o*p+u*_+f,d[v*2+1]=h*p+l*_+c}if(this._roundPixels)for(var g=S.RESOLUTION,v=0;v<d.length;++v)d[v]=Math.round((d[v]*g|0)/g);this.vertexDirty=a}},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 hf(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,ni);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=Nn.points,a=this.geometry.getIndex().data,s=a.length,o=this.drawMode===4?3:1,h=0;h+2<s;h+=o){var u=a[h]*2,l=a[h+1]*2,f=a[h+2]*2;if(n[0]=i[u],n[1]=i[u+1],n[2]=i[l],n[3]=i[l+1],n[4]=i[f],n[5]=i[f+1],Nn.contains(ni.x,ni.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}(le),uf=`varying vec2 vTextureCoord;
|
|
uniform vec4 uColor;
|
|
|
|
uniform sampler2D uSampler;
|
|
|
|
void main(void)
|
|
{
|
|
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
|
|
}
|
|
`,lf=`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;
|
|
}
|
|
`,Ln=function(r){Di(t,r);function t(e,i){var n=this,a={uSampler:e,alpha:1,uTextureMatrix:ft.IDENTITY,uColor:new Float32Array([1,1,1,1])};return i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i),i.uniforms&&Object.assign(a,i.uniforms),n=r.call(this,i.program||Ve.from(lf,uf),a)||this,n._colorDirty=!1,n.uvMatrix=new da(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;Mh(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(Lr),ff=function(r){Di(t,r);function t(e,i,n){var a=r.call(this)||this,s=new ut(e),o=new ut(i,!0),h=new ut(n,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,M.FLOAT).addAttribute("aTextureCoord",o,2,!1,M.FLOAT).addIndex(h),a._updateId=-1,a}return Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(Fr);/*!
|
|
* @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 Pi=function(r,t){return Pi=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])},Pi(r,t)};function cf(r,t){Pi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Me=new rt,df=new Uint16Array([0,1,2,0,2,3]),vf=function(r){cf(t,r);function t(e){var i=r.call(this)||this;return i._anchor=new Te(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||X.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=df,i.pluginName="batch",i.isSprite=!0,i._roundPixels=S.ROUND_PIXELS,i}return t.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Ee(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Ee(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,a=i.b,s=i.c,o=i.d,h=i.tx,u=i.ty,l=this.vertexData,f=e.trim,c=e.orig,d=this._anchor,v=0,p=0,_=0,g=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,g=f.y-d._y*c.height,_=g+f.height):(p=-d._x*c.width,v=p+c.width,g=-d._y*c.height,_=g+c.height),l[0]=n*p+s*g+h,l[1]=o*g+a*p+u,l[2]=n*v+s*g+h,l[3]=o*g+a*v+u,l[4]=n*v+s*_+h,l[5]=o*_+a*v+u,l[6]=n*p+s*_+h,l[7]=o*_+a*p+u,this._roundPixels)for(var b=S.RESOLUTION,T=0;T<l.length;++T)l[T]=Math.round((l[T]*b|0)/b)}},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,a=this._anchor,s=this.transform.worldTransform,o=s.a,h=s.b,u=s.c,l=s.d,f=s.tx,c=s.ty,d=-a._x*n.width,v=d+n.width,p=-a._y*n.height,_=p+n.height;i[0]=o*d+u*p+f,i[1]=l*p+h*d+c,i[2]=o*v+u*p+f,i[3]=l*p+h*v+c,i[4]=o*v+u*_+f,i[5]=l*_+h*v+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 xr),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,Me);var i=this._texture.orig.width,n=this._texture.orig.height,a=-i*this.anchor.x,s=0;return Me.x>=a&&Me.x<a+i&&(s=-n*this.anchor.y,Me.y>=s&&Me.y<s+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 X?e:X.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=Ee(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=Ee(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||X.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}(le);/*!
|
|
* @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 Ii=function(r,t){return Ii=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])},Ii(r,t)};function pf(r,t){Ii(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var je;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(je||(je={}));var ai={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:je.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},_f=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Cr=function(){function r(t){this.styleID=0,this.reset(),oi(this,t,t)}return r.prototype.clone=function(){var t={};return oi(t,this,ai),new r(t)},r.prototype.reset=function(){oi(this,ai,ai)},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=si(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=si(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){gf(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=si(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)&&_f.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},r}();function Dn(r){return typeof r=="number"?Qn(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function si(r){if(Array.isArray(r)){for(var t=0;t<r.length;++t)r[t]=Dn(r[t]);return r}else return Dn(r)}function gf(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 oi(r,t,e){for(var i in e)Array.isArray(t[i])?r[i]=t[i].slice():r[i]=t[i]}var fr={willReadFrequently:!0},Ht=function(){function r(t,e,i,n,a,s,o,h,u){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=a,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=u}return r.measureText=function(t,e,i,n){n===void 0&&(n=r._canvas),i=i==null?e.wordWrap:i;var a=e.toFontString(),s=r.measureFont(a);s.fontSize===0&&(s.fontSize=e.fontSize,s.ascent=e.fontSize);var o=n.getContext("2d",fr);o.font=a;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 v=f+e.strokeThickness;e.dropShadow&&(v+=e.dropShadowDistance);var p=e.lineHeight||s.fontSize+e.strokeThickness,_=Math.max(p,s.fontSize+e.strokeThickness)+(u.length-1)*(p+e.leading);return e.dropShadow&&(_+=e.dropShadowDistance),new r(t,e,v,_,u,l,p+e.leading,f,s)},r.wordWrap=function(t,e,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",fr),a=0,s="",o="",h=Object.create(null),u=e.letterSpacing,l=e.whiteSpace,f=r.collapseSpaces(l),c=r.collapseNewlines(l),d=!f,v=e.wordWrapWidth+u,p=r.tokenize(t),_=0;_<p.length;_++){var g=p[_];if(r.isNewline(g)){if(!c){o+=r.addLine(s),d=!f,s="",a=0;continue}g=" "}if(f){var b=r.isBreakingSpace(g),T=r.isBreakingSpace(s[s.length-1]);if(b&&T)continue}var x=r.getFromCache(g,u,h,n);if(x>v)if(s!==""&&(o+=r.addLine(s),s="",a=0),r.canBreakWords(g,e.breakWords))for(var m=r.wordWrapSplit(g),y=0;y<m.length;y++){for(var E=m[y],P=1;m[y+P];){var A=m[y+P],R=E[E.length-1];if(!r.canBreakChars(R,A,g,y,e.breakWords))E+=A;else break;P++}y+=E.length-1;var O=r.getFromCache(E,u,h,n);O+a>v&&(o+=r.addLine(s),d=!1,s="",a=0),s+=E,a+=O}else{s.length>0&&(o+=r.addLine(s),s="",a=0);var D=_===p.length-1;o+=r.addLine(g,!D),d=!1,s="",a=0}else x+a>v&&(d=!1,o+=r.addLine(s),s="",a=0),(s.length>0||!r.isBreakingSpace(g)||d)&&(s+=g,a+=x)}return o+=r.addLine(s,!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 a=i[t];if(typeof a!="number"){var s=t.length*e;a=n.measureText(t).width+s,i[t]=a}return a},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 a=t[n],s=t[n+1];if(r.isBreakingSpace(a,s)||r.isNewline(a)){i!==""&&(e.push(i),i=""),e.push(a);continue}i+=a}return i!==""&&e.push(i),e},r.canBreakWords=function(t,e){return e},r.canBreakChars=function(t,e,i,n,a){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 a=r.METRICS_STRING+r.BASELINE_SYMBOL,s=Math.ceil(n.measureText(a).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=s,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,s,h),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a,0,o);var u=n.getImageData(0,0,s,h).data,l=u.length,f=s*4,c=0,d=0,v=!1;for(c=0;c<o;++c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)d+=f;else break}for(e.ascent=o-c,d=l-f,v=!1,c=h;c>o;--c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)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",fr);if(i&&i.measureText)return r.__canvas=e,e;t=S.ADAPTER.createCanvas()}catch{t=S.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",fr)),r.__context},enumerable:!1,configurable:!0}),r}();Ht._fonts={};Ht.METRICS_STRING="|\xC9q\xC5";Ht.BASELINE_SYMBOL="M";Ht.BASELINE_MULTIPLIER=1.4;Ht.HEIGHT_MULTIPLIER=2;Ht._newlines=[10,13];Ht._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var mf={texture:!0,children:!1,baseTexture:!0};(function(r){pf(t,r);function t(e,i,n){var a=this,s=!1;n||(n=S.ADAPTER.createCanvas(),s=!0),n.width=3,n.height=3;var o=X.from(n);return o.orig=new W,o.trim=new W,a=r.call(this,o)||this,a._ownCanvas=s,a.canvas=n,a.context=n.getContext("2d",{willReadFrequently:!0}),a._resolution=S.RESOLUTION,a._autoResolution=!0,a._text=null,a._style=null,a._styleListener=null,a._font="",a.text=e,a.style=i,a.localStyleID=-1,a}return 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,a=Ht.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=a.width,o=a.height,h=a.lines,u=a.lineHeight,l=a.lineWidths,f=a.maxLineWidth,c=a.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+i.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=i.strokeThickness,n.textBaseline=i.textBaseline,n.lineJoin=i.lineJoin,n.miterLimit=i.miterLimit;for(var d,v,p=i.dropShadow?2:1,_=0;_<p;++_){var g=i.dropShadow&&_===0,b=g?Math.ceil(Math.max(1,o)+i.padding*2):0,T=b*this._resolution;if(g){n.fillStyle="black",n.strokeStyle="black";var x=i.dropShadowColor,m=Ge(typeof x=="number"?x:Jn(x)),y=i.dropShadowBlur*this._resolution,E=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+m[0]*255+","+m[1]*255+","+m[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=y,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*E,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*E+T}else n.fillStyle=this._generateFillStyle(i,h,a),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var P=(u-c.fontSize)/2;(!t.nextLineHeightBehavior||u-c.fontSize<0)&&(P=0);for(var A=0;A<h.length;A++)d=i.strokeThickness/2,v=i.strokeThickness/2+A*u+c.ascent+P,i.align==="right"?d+=f-l[A]:i.align==="center"&&(d+=(f-l[A])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[A],d+i.padding,v+i.padding-b,!0),i.fill&&this.drawLetterSpacing(h[A],d+i.padding,v+i.padding-b)}this.updateTexture()}},t.prototype.drawLetterSpacing=function(e,i,n,a){a===void 0&&(a=!1);var s=this._style,o=s.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),a?this.context.strokeText(e,i,n):this.context.fillText(e,i,n);return}for(var u=i,l=Array.from?Array.from(e):e.split(""),f=this.context.measureText(e).width,c=0,d=0;d<l.length;++d){var v=l[d];a?this.context.strokeText(v,u,n):this.context.fillText(v,u,n);for(var p="",_=d+1;_<l.length;++_)p+=l[_];c=this.context.measureText(p).width,u+=f-c+o,f=c}},t.prototype.updateTexture=function(){var e=this.canvas;if(this._style.trim){var i=Fh(e);i.data&&(e.width=i.width,e.height=i.height,this.context.putImageData(i.data,0,0))}var n=this._texture,a=this._style,s=a.trim?0:a.padding,o=n.baseTexture;n.trim.width=n._frame.width=e.width/this._resolution,n.trim.height=n._frame.height=e.height/this._resolution,n.trim.x=-s,n.trim.y=-s,n.orig.width=n._frame.width-s*2,n.orig.height=n._frame.height-s*2,this._onTextureUpdate(),o.setRealSize(e.width,e.height,this._resolution),n.updateUvs(),this.dirty=!1},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 a=e.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var s,o=e.dropShadow?e.dropShadowDistance:0,h=e.padding||0,u=this.canvas.width/this._resolution-o-h*2,l=this.canvas.height/this._resolution-o-h*2,f=a.slice(),c=e.fillGradientStops.slice();if(!c.length)for(var d=f.length+1,v=1;v<d;++v)c.push(v/d);if(f.unshift(a[0]),c.unshift(0),f.push(a[a.length-1]),c.push(1),e.fillGradientType===je.LINEAR_VERTICAL){s=this.context.createLinearGradient(u/2,h,u/2,l+h);for(var p=n.fontProperties.fontSize+e.strokeThickness,v=0;v<i.length;v++){var _=n.lineHeight*(v-1)+p,g=n.lineHeight*v,b=g;v>0&&_>g&&(b=(g+_)/2);var T=g+p,x=n.lineHeight*(v+1),m=T;v+1<i.length&&x<T&&(m=(T+x)/2);for(var y=(m-b)/l,E=0;E<f.length;E++){var P=0;typeof c[E]=="number"?P=c[E]:P=E/f.length;var A=Math.min(1,Math.max(0,b/l+P*y));A=Number(A.toFixed(5)),s.addColorStop(A,f[E])}}}else{s=this.context.createLinearGradient(h,l/2,u+h,l/2);for(var R=f.length+1,O=1,v=0;v<f.length;v++){var D=void 0;typeof c[v]=="number"?D=c[v]:D=O/R,s.addColorStop(D,f[v]),O++}}return s},t.prototype.destroy=function(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},mf,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=Ee(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=Ee(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 Cr?this._style=e:this._style=new Cr(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})(vf);/*!
|
|
* @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 Ci=function(r,t){return Ci=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])},Ci(r,t)};function yf(r,t){Ci(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Or=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),_r=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 a=e[n].match(/^[a-z]+/gm)[0],s=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var h in s){var u=s[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;o[l]=d}i[a].push(o)}var v=new Or;return i.info.forEach(function(p){return v.info.push({face:p.face,size:parseInt(p.size,10)})}),i.common.forEach(function(p){return v.common.push({lineHeight:parseInt(p.lineHeight,10)})}),i.page.forEach(function(p){return v.page.push({id:parseInt(p.id,10),file:p.file})}),i.char.forEach(function(p){return v.char.push({id:parseInt(p.id,10),page:parseInt(p.page,10),x:parseInt(p.x,10),y:parseInt(p.y,10),width:parseInt(p.width,10),height:parseInt(p.height,10),xoffset:parseInt(p.xoffset,10),yoffset:parseInt(p.yoffset,10),xadvance:parseInt(p.xadvance,10)})}),i.kerning.forEach(function(p){return v.kerning.push({first:parseInt(p.first,10),second:parseInt(p.second,10),amount:parseInt(p.amount,10)})}),i.distanceField.forEach(function(p){return v.distanceField.push({distanceRange:parseInt(p.distanceRange,10),fieldType:p.fieldType})}),v},r}(),Oi=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 Or,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),a=t.getElementsByTagName("page"),s=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<a.length;u++)e.page.push({id:parseInt(a[u].getAttribute("id"),10)||0,file:a[u].getAttribute("file")});for(var u=0;u<s.length;u++){var l=s[u];e.char.push({id:parseInt(l.getAttribute("id"),10),page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xoffset:parseInt(l.getAttribute("xoffset"),10),yoffset:parseInt(l.getAttribute("yoffset"),10),xadvance:parseInt(l.getAttribute("xadvance"),10)})}for(var u=0;u<o.length;u++)e.kerning.push({first:parseInt(o[u].getAttribute("first"),10),second:parseInt(o[u].getAttribute("second"),10),amount:parseInt(o[u].getAttribute("amount"),10)});for(var u=0;u<h.length;u++)e.distanceField.push({fieldType:h[u].getAttribute("fieldType"),distanceRange:parseInt(h[u].getAttribute("distanceRange"),10)});return e},r}(),Bi=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 Oi.test(e)}return!1},r.parse=function(t){var e=new globalThis.DOMParser().parseFromString(t,"text/xml");return Oi.parse(e)},r}(),hi=[_r,Oi,Bi];function Aa(r){for(var t=0;t<hi.length;t++)if(hi[t].test(r))return hi[t];return null}function bf(r,t,e,i,n,a){var s=e.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var o,h=e.dropShadow?e.dropShadowDistance:0,u=e.padding||0,l=r.width/i-h-u*2,f=r.height/i-h-u*2,c=s.slice(),d=e.fillGradientStops.slice();if(!d.length)for(var v=c.length+1,p=1;p<v;++p)d.push(p/v);if(c.unshift(s[0]),d.unshift(0),c.push(s[s.length-1]),d.push(1),e.fillGradientType===je.LINEAR_VERTICAL){o=t.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,g=a.fontProperties.fontSize+e.strokeThickness,b=g/f,p=0;p<n.length;p++)for(var T=a.lineHeight*p,x=0;x<c.length;x++){var m=0;typeof d[x]=="number"?m=d[x]:m=x/c.length;var y=T/f+m*b,E=Math.max(_,y);E=Math.min(E,1),o.addColorStop(E,c[x]),_=E}}else{o=t.createLinearGradient(u,f/2,l+u,f/2);for(var P=c.length+1,A=1,p=0;p<c.length;p++){var R=void 0;typeof d[p]=="number"?R=d[p]:R=A/P,o.addColorStop(R,c[p]),A++}}return o}function Ef(r,t,e,i,n,a,s){var o=e.text,h=e.fontProperties;t.translate(i,n),t.scale(a,a);var u=s.strokeThickness/2,l=-(s.strokeThickness/2);if(t.font=s.toFontString(),t.lineWidth=s.strokeThickness,t.textBaseline=s.textBaseline,t.lineJoin=s.lineJoin,t.miterLimit=s.miterLimit,t.fillStyle=bf(r,t,s,a,[o],e),t.strokeStyle=s.stroke,s.dropShadow){var f=s.dropShadowColor,c=Ge(typeof f=="number"?f:Jn(f)),d=s.dropShadowBlur*a,v=s.dropShadowDistance*a;t.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+s.dropShadowAlpha+")",t.shadowBlur=d,t.shadowOffsetX=Math.cos(s.dropShadowAngle)*v,t.shadowOffsetY=Math.sin(s.dropShadowAngle)*v}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;s.stroke&&s.strokeThickness&&t.strokeText(o,u,l+e.lineHeight-h.descent),s.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 wa(r){return Array.from?Array.from(r):r.split("")}function Tf(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 a=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<a)throw new Error("[BitmapFont]: Invalid character range.");for(var o=a,h=s;o<=h;o++)t.push(String.fromCharCode(o))}else t.push.apply(t,wa(n))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}function gr(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var Ft=function(){function r(t,e,i){var n,a,s=t.info[0],o=t.common[0],h=t.page[0],u=t.distanceField[0],l=qt(h.file),f={};this._ownsTextures=i,this.font=s.face,this.size=s.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],v=d.id,p=d.file;f[v]=e instanceof Array?e[c]:e[p],(u==null?void 0:u.fieldType)&&u.fieldType!=="none"&&(f[v].baseTexture.alphaMode=lt.NO_PREMULTIPLIED_ALPHA,f[v].baseTexture.mipmap=ot.OFF)}for(var c=0;c<t.char.length;c++){var _=t.char[c],v=_.id,g=_.page,b=t.char[c],T=b.x,x=b.y,m=b.width,y=b.height,E=b.xoffset,P=b.yoffset,A=b.xadvance;T/=l,x/=l,m/=l,y/=l,E/=l,P/=l,A/=l;var R=new W(T+f[g].frame.x/l,x+f[g].frame.y/l,m,y);this.chars[v]={xOffset:E,yOffset:P,xAdvance:A,kerning:{},texture:new X(f[g].baseTexture,R),page:g}}for(var c=0;c<t.kerning.length;c++){var O=t.kerning[c],D=O.first,j=O.second,Q=O.amount;D/=l,j/=l,Q/=l,this.chars[j]&&(this.chars[j].kerning[D]=Q)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(a=(n=u==null?void 0:u.fieldType)===null||n===void 0?void 0:n.toLowerCase())!==null&&a!==void 0?a:"none"}return 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 Or)n=t;else{var a=Aa(t);if(!a)throw new Error("Unrecognized data format for font.");n=a.parse(t)}e instanceof X&&(e=[e]);var s=new r(n,e,i);return r.available[s.font]=s,s},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),a=n.chars,s=n.padding,o=n.resolution,h=n.textureWidth,u=n.textureHeight,l=Tf(a),f=e instanceof Cr?e:new Cr(e),c=h,d=new Or;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var v=0,p=0,_,g,b,T=0,x=[],m=0;m<l.length;m++){_||(_=S.ADAPTER.createCanvas(),_.width=h,_.height=u,g=_.getContext("2d"),b=new k(_,{resolution:o}),x.push(new X(b)),d.page.push({id:x.length-1,file:""}));var y=l[m],E=Ht.measureText(y,f,!1,_),P=E.width,A=Math.ceil(E.height),R=Math.ceil((f.fontStyle==="italic"?2:1)*P);if(p>=u-A*o){if(p===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+y+"')"));--m,_=null,g=null,b=null,p=0,v=0,T=0;continue}if(T=Math.max(A+E.fontProperties.descent,T),R*o+v>=c){if(v===0)throw new Error("[BitmapFont] textureWidth "+h+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+y+"')"));--m,p+=T*o,p=Math.ceil(p),v=0,T=0;continue}Ef(_,g,E,v,p,o,f);var O=gr(E.text);d.char.push({id:O,page:x.length-1,x:v/o,y:p/o,width:R,height:A,xoffset:0,yoffset:0,xadvance:Math.ceil(P-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),v+=(R+2*s)*o,v=Math.ceil(v)}for(var m=0,D=l.length;m<D;m++)for(var j=l[m],Q=0;Q<D;Q++){var I=l[Q],C=g.measureText(j).width,H=g.measureText(I).width,ht=g.measureText(j+I).width,V=ht-(C+H);V&&d.kerning.push({first:gr(j),second:gr(I),amount:V})}var tt=new r(d,x,!0);return r.available[t]!==void 0&&r.uninstall(t),r.available[t]=tt,tt},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}(),xf=`// 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
|
|
`,Af=`// 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
|
|
`,Un=[],Gn=[],kn=[];(function(r){yf(t,r);function t(e,i){i===void 0&&(i={});var n=r.call(this)||this;n._tint=16777215;var a=Object.assign({},t.styleDefaults,i),s=a.align,o=a.tint,h=a.maxWidth,u=a.letterSpacing,l=a.fontName,f=a.fontSize;if(!Ft.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=s,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 Te(function(){n.dirty=!0},n,0,0),n._roundPixels=S.ROUND_PIXELS,n.dirty=!0,n._resolution=S.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return t.prototype.updateText=function(){for(var e,i=Ft.available[this._fontName],n=this.fontSize,a=n/i.size,s=new rt,o=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
|
|
`)||" ",f=wa(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?Un:Gn,v=null,p=0,_=0,g=0,b=-1,T=0,x=0,m=0,y=0,E=0;E<f.length;E++){var P=f[E],A=gr(P);if(/(?:\s)/.test(P)&&(b=E,T=p,y++),P==="\r"||P===`
|
|
`){h.push(p),u.push(-1),_=Math.max(_,p),++g,++x,s.x=0,s.y+=i.lineHeight,v=null,y=0;continue}var R=i.chars[A];if(!!R){v&&R.kerning[v]&&(s.x+=R.kerning[v]);var O=kn.pop()||{texture:X.EMPTY,line:0,charCode:0,prevSpaces:0,position:new rt};O.texture=R.texture,O.line=g,O.charCode=A,O.position.x=s.x+R.xOffset+this._letterSpacing/2,O.position.y=s.y+R.yOffset,O.prevSpaces=y,o.push(O),p=O.position.x+Math.max(R.xAdvance-R.xOffset,R.texture.orig.width),s.x+=R.xAdvance+this._letterSpacing,m=Math.max(m,R.yOffset+R.texture.height),v=A,b!==-1&&c>0&&s.x>c&&(++x,Fe(o,1+b-x,1+E-b),E=b,b=-1,h.push(T),u.push(o.length>0?o[o.length-1].prevSpaces:0),_=Math.max(_,T),g++,s.x=0,s.y+=i.lineHeight,v=null,y=0)}}var D=f[f.length-1];D!=="\r"&&D!==`
|
|
`&&(/(?:\s)/.test(D)&&(p=T),h.push(p),_=Math.max(_,p),u.push(-1));for(var j=[],E=0;E<=g;E++){var Q=0;this._align==="right"?Q=_-h[E]:this._align==="center"?Q=(_-h[E])/2:this._align==="justify"&&(Q=u[E]<0?0:(_-h[E])/u[E]),j.push(Q)}var I=o.length,C={},H=[],ht=this._activePagesMeshData;d.push.apply(d,ht);for(var E=0;E<I;E++){var V=o[E].texture,tt=V.baseTexture.uid;if(!C[tt]){var F=d.pop();if(!F){var qe=new ff,jt=void 0,It=void 0;i.distanceFieldType==="none"?(jt=new Ln(X.EMPTY),It=B.NORMAL):(jt=new Ln(X.EMPTY,{program:Ve.from(Af,xf),uniforms:{uFWidth:0}}),It=B.NORMAL_NPM);var we=new Fn(qe,jt);we.blendMode=It,F={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:we,vertices:null,uvs:null,indices:null}}F.index=0,F.indexCount=0,F.vertexCount=0,F.uvsCount=0,F.total=0;var ce=this._textureCache;ce[tt]=ce[tt]||new X(V.baseTexture),F.mesh.texture=ce[tt],F.mesh.tint=this._tint,H.push(F),C[tt]=F}C[tt].total++}for(var E=0;E<ht.length;E++)H.indexOf(ht[E])===-1&&this.removeChild(ht[E].mesh);for(var E=0;E<H.length;E++)H[E].mesh.parent!==this&&this.addChild(H[E].mesh);this._activePagesMeshData=H;for(var E in C){var F=C[E],xt=F.total;if(!(((e=F.indices)===null||e===void 0?void 0:e.length)>6*xt)||F.vertices.length<Fn.BATCHABLE_SIZE*2)F.vertices=new Float32Array(4*2*xt),F.uvs=new Float32Array(4*2*xt),F.indices=new Uint16Array(6*xt);else for(var de=F.total,ve=F.vertices,pt=de*4*2;pt<ve.length;pt++)ve[pt]=0;F.mesh.size=6*xt}for(var E=0;E<I;E++){var P=o[E],_t=P.position.x+j[P.line]*(this._align==="justify"?P.prevSpaces:1);this._roundPixels&&(_t=Math.round(_t));var dt=_t*a,vt=P.position.y*a,V=P.texture,$=C[V.baseTexture.uid],Kt=V.frame,At=V._uvs,Y=$.index++;$.indices[Y*6+0]=0+Y*4,$.indices[Y*6+1]=1+Y*4,$.indices[Y*6+2]=2+Y*4,$.indices[Y*6+3]=0+Y*4,$.indices[Y*6+4]=2+Y*4,$.indices[Y*6+5]=3+Y*4,$.vertices[Y*8+0]=dt,$.vertices[Y*8+1]=vt,$.vertices[Y*8+2]=dt+Kt.width*a,$.vertices[Y*8+3]=vt,$.vertices[Y*8+4]=dt+Kt.width*a,$.vertices[Y*8+5]=vt+Kt.height*a,$.vertices[Y*8+6]=dt,$.vertices[Y*8+7]=vt+Kt.height*a,$.uvs[Y*8+0]=At.x0,$.uvs[Y*8+1]=At.y0,$.uvs[Y*8+2]=At.x1,$.uvs[Y*8+3]=At.y1,$.uvs[Y*8+4]=At.x2,$.uvs[Y*8+5]=At.y2,$.uvs[Y*8+6]=At.x3,$.uvs[Y*8+7]=At.y3}this._textWidth=_*a,this._textHeight=(s.y+i.lineHeight)*a;for(var E in C){var F=C[E];if(this.anchor.x!==0||this.anchor.y!==0)for(var wt=0,pe=this._textWidth*this.anchor.x,$e=this._textHeight*this.anchor.y,Hi=0;Hi<F.total;Hi++)F.vertices[wt++]-=pe,F.vertices[wt++]-=$e,F.vertices[wt++]-=pe,F.vertices[wt++]-=$e,F.vertices[wt++]-=pe,F.vertices[wt++]-=$e,F.vertices[wt++]-=pe,F.vertices[wt++]-=$e;this._maxLineHeight=m*a;var ji=F.mesh.geometry.getBuffer("aVertexPosition"),Wi=F.mesh.geometry.getBuffer("aTextureCoord"),Vi=F.mesh.geometry.getIndex();ji.data=F.vertices,Wi.data=F.uvs,Vi.data=F.indices,ji.update(),Wi.update(),Vi.update()}for(var E=0;E<o.length;E++)kn.push(o[E]);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=Ft.available[this._fontName],n=i.distanceFieldRange,a=i.distanceFieldType,s=i.size;if(a!=="none")for(var o=this.worldTransform,h=o.a,u=o.b,l=o.c,f=o.d,c=Math.sqrt(h*h+u*u),d=Math.sqrt(l*l+f*f),v=(Math.abs(c)+Math.abs(d))/2,p=this.fontSize/s,_=0,g=this._activePagesMeshData;_<g.length;_++){var b=g[_];b.mesh.shader.uniforms.uFWidth=v*n*p*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=Ft.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(!Ft.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:Ft.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=Ft.available[this._fontName],a=n.distanceFieldType==="none"?Un:Gn;a.push.apply(a,this._activePagesMeshData);for(var s=0,o=this._activePagesMeshData;s<o.length;s++){var h=o[s];this.removeChild(h.mesh)}this._activePagesMeshData=[],a.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=X.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})(le);(function(){function r(){}return r.add=function(){K.setExtensionXhrType("fnt",K.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){var i=Aa(t.data);if(!i){e();return}for(var n=r.getBaseUrl(this,t),a=i.parse(t.data),s={},o=function(p){s[p.metadata.pageFile]=p.texture,Object.keys(s).length===a.page.length&&(t.bitmapFont=Ft.install(a,s,!0),e())},h=0;h<a.page.length;++h){var u=a.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 v={crossOrigin:t.crossOrigin,loadType:K.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},t.metadata.imageMetadata),parentResource:t};this.add(l,v,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=L.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 Xt=function(){return Xt=Object.assign||function(t){for(var e=arguments,i,n=1,a=arguments.length;n<a;n++){i=e[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},Xt.apply(this,arguments)};function U(r,t,e,i){function n(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(l){try{u(i.next(l))}catch(f){s(f)}}function h(l){try{u(i.throw(l))}catch(f){s(f)}}function u(l){l.done?a(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(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var wf=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}(),Gt=function(r,t){return Array.isArray(r)||(r=[r]),t?r.map(function(e){return typeof e=="string"?t(e):e}):r};function Ra(r,t,e,i,n){for(var a=t[e],s=0;s<a.length;s++){var o=a[s];e<t.length-1?Ra(r.replace(i[e],o),t,e+1,i,n):n.push(r.replace(i[e],o))}}function Rf(r){var t=/\{(.*?)\}/g,e=r.match(t),i=[];if(e){var n=[];e.forEach(function(a){var s=a.substring(1,a.length-1).split(",");n.push(s)}),Ra(r,n,0,e,i)}else i.push(r);return i}var Br=function(r){return!Array.isArray(r)},Sf=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=Gt(t),a,s=0;s<this.parsers.length;s++){var o=this.parsers[s];if(o.test(e)){a=o.getCacheableAssets(n,e);break}}a||(a={},n.forEach(function(f){a[f]=e}));var h=Object.keys(a),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,a[f])}),e instanceof X){var l=e;n.forEach(function(f){l.baseTexture!==X.EMPTY.baseTexture&&k.addToCache(l.baseTexture,f),X.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(a){e._cache.delete(a)}),i.keys.forEach(function(a){e._cacheMap.delete(a)})},Object.defineProperty(r.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),r}(),Ne=new Sf;function Sa(r,t,e){var i={};if(r.forEach(function(a){i[a]=t}),Object.keys(t.textures).forEach(function(a){i[a]=t.textures[a]}),!e){var n=st.dirname(r[0]);t.linkedSheets.forEach(function(a,s){var o=Sa([n+"/"+t.data.meta.related_multi_packs[s]],a,!0);Object.assign(i,o)})}return i}var Pf={extension:L.CacheParser,test:function(r){return r instanceof Li},getCacheableAssets:function(r,t){return Sa(r,t,!1)}},If={extension:L.CacheParser,test:function(r){return Array.isArray(r)&&r.every(function(t){return t instanceof X})},getCacheableAssets:function(r,t){var e={};return r.forEach(function(i){t.forEach(function(n,a){e[i+(a===0?"":a+1)]=n})}),e}};function Ui(){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(a){return n.unshift.apply(n,e),[2,n]})})}}function Gi(){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 a,s,o,h;return G(this,function(u){for(a=0,s=e;a<s.length;a++)o=s[a],h=n.indexOf(o),h!==-1&&n.splice(h,1);return[2,n]})})}}var Cf={extension:L.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,S.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:Ui("avif"),remove:Gi("avif")},Nt,ye;function Xn(){ye={s3tc:Nt.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Nt.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:Nt.getExtension("WEBGL_compressed_texture_etc"),etc1:Nt.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:Nt.getExtension("WEBGL_compressed_texture_pvrtc")||Nt.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:Nt.getExtension("WEBGL_compressed_texture_atc"),astc:Nt.getExtension("WEBGL_compressed_texture_astc")}}L.DetectionParser;L.DetectionParser,Ui("basis"),Gi("basis");var Of={extension:L.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,S.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:Ui("webp"),remove:Gi("webp")},Bf=[".xml",".fnt"],Mf={extension:L.LoadParser,test:function(r){return Bf.includes(st.extname(r))},testParse:function(r){return U(this,void 0,Promise,function(){return G(this,function(t){return[2,_r.test(r)||Bi.test(r)]})})},parse:function(r,t,e){return U(this,void 0,Promise,function(){var i,n,a,s,o,h,u,l,f;return G(this,function(c){switch(c.label){case 0:for(i=_r.test(r)?_r.parse(r):Bi.parse(r),n=t.src,a=i.page,s=[],o=0;o<a.length;++o)h=a[o].file,u=st.join(st.dirname(n),h),s.push(u);return[4,e.load(s)];case 1:return l=c.sent(),f=s.map(function(d){return l[d]}),[2,Ft.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,S.ADAPTER.fetch(r)];case 1:return e=i.sent(),[2,e.text()]}})})},unload:function(r){r.destroy()}},Nf={extension:L.LoadParser,test:function(r){return st.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,S.ADAPTER.fetch(r)];case 1:return t=i.sent(),[4,t.json()];case 2:return e=i.sent(),[2,e]}})})}},Ff={extension:L.LoadParser,testParse:function(r,t){return U(this,void 0,Promise,function(){return G(this,function(e){return[2,st.extname(t.src).includes(".json")&&!!r.frames]})})},parse:function(r,t,e){var i,n;return U(this,void 0,Promise,function(){var a,s,o,h,u,l,f,c,d,v,p,_;return G(this,function(g){switch(g.label){case 0:return a=st.dirname(t.src),a&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),s=a+r.meta.image,[4,e.load([s])];case 1:return o=g.sent(),h=o[s],u=new Li(h.baseTexture,r,t.src),[4,u.parse()];case 2:if(g.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++)v=d[c],typeof v=="string"&&(p=a+v,!(!((n=t.data)===null||n===void 0)&&n.ignoreMultiPack)&&f.push(e.load({src:p,data:{ignoreMultiPack:!0}})));return[4,Promise.all(f)];case 3:_=g.sent(),u.linkedSheets=_,_.forEach(function(b){b.linkedSheets=[u].concat(u.linkedSheets.filter(function(T){return T!==b}))}),g.label=4;case 4:return[2,u]}})})},unload:function(r){r.destroy(!0)}},Lf={extension:L.LoadParser,test:function(r){return st.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,S.ADAPTER.fetch(r)];case 1:return t=i.sent(),[4,t.text()];case 2:return e=i.sent(),[2,e]}})})}},Df=["normal","bold","100","200","300","400","500","600","700","800","900"],Uf=["woff","woff2","ttf","otf"];function Gf(r){var t=st.extname(r),e=st.basename(r,t),i=e.replace(/(-|_)/g," "),n=i.toLowerCase().split(" ").map(function(a){return a.charAt(0).toUpperCase()+a.slice(1)}).join(" ");return n}var kf={extension:L.LoadParser,test:function(r){var t=r.split("?")[0],e=t.split(".").pop();return Uf.includes(e)},load:function(r,t){var e,i,n,a,s,o;return U(this,void 0,Promise,function(){var h,u,l,f,c,d,v;return G(this,function(p){switch(p.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:Gf(r),l=(s=(a=(n=t.data)===null||n===void 0?void 0:n.weights)===null||a===void 0?void 0:a.filter(function(_){return Df.includes(_)}))!==null&&s!==void 0?s:["normal"],f=(o=t.data)!==null&&o!==void 0?o:{},c=0,p.label=1;case 1:return c<l.length?(d=l[c],v=new FontFace(u,"url("+r+")",Xt(Xt({},f),{weight:d})),[4,v.load()]):[3,4];case 2:p.sent(),document.fonts.add(v),h.push(v),p.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 Dr(r,t){var e=r.split("?")[0],i=st.extname(e).toLowerCase();return Array.isArray(t)?t.includes(i.toLowerCase()):i.toLowerCase()===t}function ze(r,t,e){var i=new X(r);return i.baseTexture.on("dispose",function(){delete t.promiseCache[e]}),i}L.LoadParser;L.LoadParser;L.LoadParser;var Hn=0,ui,Xf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",Hf={id:"checkImageBitmap",code:`
|
|
async function checkImageBitmap()
|
|
{
|
|
try
|
|
{
|
|
if (typeof createImageBitmap !== 'function') return false;
|
|
|
|
const response = await fetch('`+Xf+`');
|
|
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); });
|
|
`},jf={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,
|
|
});
|
|
}
|
|
};`},li,Wf=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([Hf.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;ui===void 0&&(ui=navigator.hardwareConcurrency||4);var e=this.workerPool.pop();return!e&&this._createdWorkers<ui&&(li||(li=URL.createObjectURL(new Blob([jf.code],{type:"application/javascript"}))),this._createdWorkers++,e=new Worker(li),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(a){switch(a.label){case 0:return[4,this._initWorkers()];case 1:return a.sent(),i=new Promise(function(s,o){n.queue.push({id:t,arguments:e,resolve:s,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[Hn]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Hn++,id:i})}}},r}(),jn=new Wf,fi=[".jpg",".png",".jpeg",".avif",".webp"];function Vf(r){return U(this,void 0,Promise,function(){var t,e,i;return G(this,function(n){switch(n.label){case 0:return[4,S.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 ki={extension:L.LoadParser,config:{preferWorkers:!0},test:function(r){for(var t=!1,e=0;e<fi.length;e++)if(r.indexOf("data:image/"+fi[e].slice(1))===0){t=!0;break}return t||Dr(r,fi)},load:function(r,t,e){return U(this,void 0,Promise,function(){var i,n,a;return G(this,function(s){switch(s.label){case 0:return i=null,window.createImageBitmap?(n=this.config.preferWorkers,n?[4,jn.isImageBitmapSupported()]:[3,2]):[3,7];case 1:n=s.sent(),s.label=2;case 2:return n?[4,jn.loadImageBitmap(r)]:[3,4];case 3:return i=s.sent(),[3,6];case 4:return[4,Vf(r)];case 5:i=s.sent(),s.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=s.sent(),s.label=9;case 9:return a=new k(i,Xt({resolution:qt(r)},t.data)),a.resource.src=r,[2,ze(a,e,r)]}})})},unload:function(r){r.destroy(!0)}},Yf={extension:L.LoadParser,test:function(r){return st.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,a;return U(this,void 0,Promise,function(){var s,o,h;return G(this,function(u){switch(u.label){case 0:return s=new mi(r,(i=t==null?void 0:t.data)===null||i===void 0?void 0:i.resourceOptions),o=new k(s,Xt({resolution:qt(r)},t==null?void 0:t.data)),o.resource.src=r,h=ze(o,e,r),!((a=(n=t==null?void 0:t.data)===null||n===void 0?void 0:n.resourceOptions)===null||a===void 0)&&a.autoLoad?[3,2]:[4,s.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,S.ADAPTER.fetch(r)];case 1:return e=i.sent(),[2,e.text()]}})})},unload:ki.unload},zf=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 a,s,o,s,o,h,u,l;return G(this,function(f){switch(f.label){case 0:a=null,s=0,f.label=1;case 1:return s<this.parsers.length?(o=this.parsers[s],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 a=f.sent(),n.parser=o,[3,4];case 3:return s++,[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];s=0,f.label=5;case 5:return s<this.parsers.length?(o=this.parsers[s],o.parse?(h=o.parse,h?[4,(l=o.testParse)===null||l===void 0?void 0:l.call(o,a,e,this)]:[3,7]):[3,9]):[3,10];case 6:h=f.sent(),f.label=7;case 7:return h?[4,o.parse(a,e,this)]:[3,9];case 8:a=f.sent()||a,n.parser=o,f.label=9;case 9:return s++,[3,5];case 10:return[2,a]}})})}(),n},r.prototype.load=function(t,e){return U(this,void 0,Promise,function(){var i,n,a,s,o,h,u=this;return G(this,function(l){switch(l.label){case 0:return i=0,n={},a=Br(t),s=Gt(t,function(f){return{src:f}}),o=s.length,h=s.map(function(f){return U(u,void 0,void 0,function(){var c,d,v,p;return G(this,function(_){switch(_.label){case 0:if(c=st.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,v=f.src,[4,this.promiseCache[c].promise];case 2:return d[v]=_.sent(),e&&e(++i/o),[3,4];case 3:throw p=_.sent(),delete this.promiseCache[c],delete n[f.src],new Error("[Loader.load] Failed to load "+c+`.
|
|
`+p);case 4:return[2]}})})}),[4,Promise.all(h)];case 1:return l.sent(),[2,a?n[s[0].src]:n]}})})},r.prototype.unload=function(t){return U(this,void 0,Promise,function(){var e,i,n=this;return G(this,function(a){switch(a.label){case 0:return e=Gt(t,function(s){return{src:s}}),i=e.map(function(s){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=st.toAbsolute(s.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,s,this),delete this.promiseCache[o],c.label=2;case 2:return[2]}})})}),[4,Promise.all(i)];case 1:return a.sent(),[2]}})})},Object.defineProperty(r.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),r}(),qf=["jpg","png","jpeg","avif","webp"],$f={extension:L.ResolveParser,test:function(r){var t=r.split("?")[0],e=t.split("."),i=e.pop(),n=e.pop();return i==="json"&&qf.includes(n)},parse:function(r){var t,e,i=r.split(".");return{resolution:parseFloat((e=(t=S.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}}},Kf={extension:L.ResolveParser,test:ki.test,parse:function(r){var t,e;return{resolution:parseFloat((e=(t=S.RETINA_PREFIX.exec(r))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:"1"),format:r.split(".").pop(),src:r}}};L.ResolveParser;var Zf=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(a){e._preferredOrder.push(a),a.priority||(a.priority=Object.keys(a.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(a){typeof a.name=="string"?n.push(a.name):n.push.apply(n,a.name),i.add(a.name,a.srcs)}):Object.keys(e).forEach(function(a){n.push(a),i.add(a,e[a])}),this._bundles[t]=n},r.prototype.add=function(t,e,i){var n=this,a=Gt(t);a.forEach(function(o){n._assetMap[o]&&console.warn("[Resolver] already has key: "+o+" overwriting")}),Array.isArray(e)||(typeof e=="string"?e=Rf(e):e=[e]);var s=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=a),(n._basePath||n._rootPath)&&(u.src=st.toAbsolute(u.src,n._basePath,n._rootPath)),u.data=(h=u.data)!==null&&h!==void 0?h:i,u});a.forEach(function(o){n._assetMap[o]=s})},r.prototype.resolveBundle=function(t){var e=this,i=Br(t);t=Gt(t);var n={};return t.forEach(function(a){var s=e._bundles[a];s&&(n[a]=e.resolve(s))}),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=Br(t);t=Gt(t);var n={};return t.forEach(function(a){var s;if(!e._resolverHash[a])if(e._assetMap[a]){var o=e._assetMap[a],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(v){return v[f]?v[f]===c:!1});d.length&&(o=d)})}),e._resolverHash[a]=(s=o[0])!==null&&s!==void 0?s:u}else{var l=a;(e._basePath||e._rootPath)&&(l=st.toAbsolute(l,e._basePath,e._rootPath)),e._resolverHash[a]={src:l}}n[a]=e._resolverHash[a]}),i?n[t[0]]:n},r.prototype._getPreferredOrder=function(t){for(var e=function(s){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 a=e();if(typeof a=="object")return a.value}return this._preferredOrder[0]},r}(),Qf=function(){function r(){this._detections=[],this._initialized=!1,this.resolver=new Zf,this.loader=new zf,this.cache=Ne,this._backgroundLoader=new wf(this.loader),this._backgroundLoader.active=!0,this.reset()}return r.prototype.init=function(t){var e,i,n,a;return t===void 0&&(t={}),U(this,void 0,Promise,function(){var s,o,h,u,l,f,c,p,d,v,p;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?(s=t.manifest,typeof s!="string"?[3,2]:[4,this.load(s)]):[3,3]);case 1:s=_.sent(),_.label=2;case 2:this.resolver.addManifest(s),_.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=(a=t.texturePreference)===null||a===void 0?void 0:a.format,u=typeof l=="string"?[l]:l,f=0,c=this._detections,_.label=4;case 4:return f<c.length?(p=c[f],[4,p.test()]):[3,8];case 5:return _.sent()?[3,7]:[4,p.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,v=this._detections,_.label=10;case 10:return d<v.length?(p=v[d],[4,p.test()]):[3,14];case 11:return _.sent()?[4,p.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,a,s,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=Br(t),n=Gt(t).map(function(u){return typeof u!="string"?(o.resolver.add(u.src,u),u.src):u}),a=this.resolver.resolve(n),[4,this._mapLoadToResolve(a,e)];case 3:return s=h.sent(),[2,i?s[n[0]]:s]}})})},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,a,s,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),a={},s=Object.keys(n),o=0,h=0,u=function(){e==null||e(++o/h)},l=s.map(function(d){var v=n[d];return h+=Object.keys(v).length,f._mapLoadToResolve(v,u).then(function(p){a[d]=p})}),[4,Promise.all(l)];case 3:return c.sent(),[2,i?a[t[0]]:a]}})})},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(a){i._backgroundLoader.add(Object.values(a))}),[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 Ne.get(t);for(var e={},i=0;i<t.length;i++)e[i]=Ne.get(t[i]);return e},r.prototype._mapLoadToResolve=function(t,e){return U(this,void 0,Promise,function(){var i,n,a,s;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 a=o.sent(),this._backgroundLoader.active=!0,s={},i.forEach(function(h,u){var l=a[h.src],f=[h.src];h.alias&&f.push.apply(f,h.alias),s[n[u]]=l,Ne.set(f,l)}),[2,s]}})})},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=Gt(t).map(function(a){return typeof a!="string"?a.src:a}),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(a){switch(a.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:a.sent(),a.label=2;case 2:return t=Gt(t),e=this.resolver.resolveBundle(t),i=Object.keys(e).map(function(s){return n._unloadFromResolved(e[s])}),[4,Promise.all(i)];case 3:return a.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){Ne.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}(),cr=new Qf;Tt.handleByList(L.LoadParser,cr.loader.parsers).handleByList(L.ResolveParser,cr.resolver.parsers).handleByList(L.CacheParser,cr.cache.parsers).handleByList(L.DetectionParser,cr.detections);Tt.add(ki,Yf,Lf,Nf,Ff,Mf,kf,Pf,If,Kf,$f,Of,Cf);/*!
|
|
* @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 Ut;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(Ut||(Ut={}));var zt;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(zt||(zt={}));var We={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}},Pa=function(){function r(){this.color=16777215,this.alpha=1,this.texture=X.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=X.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 Mi=function(r,t){return Mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Mi(r,t)};function Xi(r,t){Mi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Wn(r,t){var e,i;t===void 0&&(t=!1);var n=r.length;if(!(n<6)){for(var a=0,s=0,o=r[n-2],h=r[n-1];s<n;s+=2){var u=r[s],l=r[s+1];a+=(u-o)*(l+h),o=u,h=l}if(!t&&a>0||t&&a<=0)for(var f=n/2,s=f+f%2;s<n;s+=2){var c=n-s-2,d=n-s-1,v=s,p=s+1;e=[r[v],r[c]],r[c]=e[0],r[v]=e[1],i=[r[p],r[d]],r[d]=i[0],r[p]=i[1]}}}var Ia={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,t){var e=r.points,i=r.holes,n=t.points,a=t.indices;if(e.length>=6){Wn(e,!1);for(var s=[],o=0;o<i.length;o++){var h=i[o];Wn(h.points,!0),s.push(e.length/2),e=e.concat(h.points)}var u=Zn(e,s,2);if(!u)return;for(var l=n.length/2,o=0;o<u.length;o+=3)a.push(u[o]+l),a.push(u[o+1]+l),a.push(u[o+2]+l);for(var o=0;o<e.length;o++)n.push(e[o])}}},Mr={build:function(r){var t=r.points,e,i,n,a,s,o;if(r.type===nt.CIRC){var h=r.shape;e=h.x,i=h.y,s=o=h.radius,n=a=0}else if(r.type===nt.ELIP){var u=r.shape;e=u.x,i=u.y,s=u.width,o=u.height,n=a=0}else{var l=r.shape,f=l.width/2,c=l.height/2;e=l.x+f,i=l.y+c,s=o=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-s,a=c-o}if(!(s>=0&&o>=0&&n>=0&&a>=0)){t.length=0;return}var d=Math.ceil(2.3*Math.sqrt(s+o)),v=d*8+(n?4:0)+(a?4:0);if(t.length=v,v!==0){if(d===0){t.length=8,t[0]=t[6]=e+n,t[1]=t[3]=i+a,t[2]=t[4]=e-n,t[5]=t[7]=i-a;return}var p=0,_=d*4+(n?2:0)+2,g=_,b=v;{var T=n+s,x=a,m=e+T,y=e-T,E=i+x;if(t[p++]=m,t[p++]=E,t[--_]=E,t[--_]=y,a){var P=i-x;t[g++]=y,t[g++]=P,t[--b]=P,t[--b]=m}}for(var A=1;A<d;A++){var R=Math.PI/2*(A/d),T=n+Math.cos(R)*s,x=a+Math.sin(R)*o,m=e+T,y=e-T,E=i+x,P=i-x;t[p++]=m,t[p++]=E,t[--_]=E,t[--_]=y,t[g++]=y,t[g++]=P,t[--b]=P,t[--b]=m}{var T=n,x=a+o,m=e+T,y=e-T,E=i+x,P=i-x;t[p++]=m,t[p++]=E,t[--b]=P,t[--b]=m,n&&(t[p++]=y,t[p++]=E,t[--b]=P,t[--b]=y)}}},triangulate:function(r,t){var e=r.points,i=t.points,n=t.indices;if(e.length!==0){var a=i.length/2,s=a,o,h;if(r.type!==nt.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),a++,i.push(e[0],e[1]);for(var c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),n.push(a++,s,a);n.push(s+1,s,a)}}},Jf={build:function(r){var t=r.shape,e=t.x,i=t.y,n=t.width,a=t.height,s=r.points;s.length=0,s.push(e,i,e+n,i,e+n,i+a,e,i+a)},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 ge(r,t,e){var i=t-r;return r+i*e}function dr(r,t,e,i,n,a,s){s===void 0&&(s=[]);for(var o=20,h=s,u=0,l=0,f=0,c=0,d=0,v=0,p=0,_=0;p<=o;++p)_=p/o,u=ge(r,e,_),l=ge(t,i,_),f=ge(e,n,_),c=ge(i,a,_),d=ge(u,f,_),v=ge(l,c,_),!(p===0&&h[h.length-2]===d&&h[h.length-1]===v)&&h.push(d,v);return h}var tc={build:function(r){if(Kn.nextRoundedRectBehavior){Mr.build(r);return}var t=r.shape,e=r.points,i=t.x,n=t.y,a=t.width,s=t.height,o=Math.max(0,Math.min(t.radius,Math.min(a,s)/2));e.length=0,o?(dr(i,n+o,i,n,i+o,n,e),dr(i+a-o,n,i+a,n,i+a,n+o,e),dr(i+a,n+s-o,i+a,n+s,i+a-o,n+s,e),dr(i+o,n+s,i,n+s,i,n+s-o,e)):e.push(i,n,i+a,n,i+a,n+s,i,n+s)},triangulate:function(r,t){if(Kn.nextRoundedRectBehavior){Mr.triangulate(r,t);return}for(var e=r.points,i=t.points,n=t.indices,a=i.length/2,s=Zn(e,null,2),o=0,h=s.length;o<h;o+=3)n.push(s[o]+a),n.push(s[o+1]+a),n.push(s[o+2]+a);for(var o=0,h=e.length;o<h;o++)i.push(e[o],e[++o])}};function Vn(r,t,e,i,n,a,s,o){var h=r-e*n,u=t-i*n,l=r+e*a,f=t+i*a,c,d;s?(c=i,d=-e):(c=-i,d=e);var v=h+c,p=u+d,_=l+c,g=f+d;return o.push(v,p),o.push(_,g),2}function te(r,t,e,i,n,a,s,o){var h=e-r,u=i-t,l=Math.atan2(h,u),f=Math.atan2(n-r,a-t);o&&l<f?l+=Math.PI*2:!o&&l>f&&(f+=Math.PI*2);var c=l,d=f-l,v=Math.abs(d),p=Math.sqrt(h*h+u*u),_=(15*v*Math.sqrt(p)/Math.PI>>0)+1,g=d/_;if(c+=g,o){s.push(r,t),s.push(e,i);for(var b=1,T=c;b<_;b++,T+=g)s.push(r,t),s.push(r+Math.sin(T)*p,t+Math.cos(T)*p);s.push(r,t),s.push(n,a)}else{s.push(e,i),s.push(r,t);for(var b=1,T=c;b<_;b++,T+=g)s.push(r+Math.sin(T)*p,t+Math.cos(T)*p),s.push(r,t);s.push(n,a),s.push(r,t)}return _*2}function ec(r,t){var e=r.shape,i=r.points||e.points.slice(),n=t.closePointEps;if(i.length!==0){var a=r.lineStyle,s=new rt(i[0],i[1]),o=new rt(i[i.length-2],i[i.length-1]),h=e.type!==nt.POLY||e.closeStroke,u=Math.abs(s.x-o.x)<n&&Math.abs(s.y-o.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));var l=(s.x+o.x)*.5,f=(o.y+s.y)*.5;i.unshift(l,f),i.push(l,f)}var c=t.points,d=i.length/2,v=i.length,p=c.length/2,_=a.width/2,g=_*_,b=a.miterLimit*a.miterLimit,T=i[0],x=i[1],m=i[2],y=i[3],E=0,P=0,A=-(x-y),R=T-m,O=0,D=0,j=Math.sqrt(A*A+R*R);A/=j,R/=j,A*=_,R*=_;var Q=a.alignment,I=(1-Q)*2,C=Q*2;h||(a.cap===zt.ROUND?v+=te(T-A*(I-C)*.5,x-R*(I-C)*.5,T-A*I,x-R*I,T+A*C,x+R*C,c,!0)+2:a.cap===zt.SQUARE&&(v+=Vn(T,x,A,R,I,C,!0,c))),c.push(T-A*I,x-R*I),c.push(T+A*C,x+R*C);for(var H=1;H<d-1;++H){T=i[(H-1)*2],x=i[(H-1)*2+1],m=i[H*2],y=i[H*2+1],E=i[(H+1)*2],P=i[(H+1)*2+1],A=-(x-y),R=T-m,j=Math.sqrt(A*A+R*R),A/=j,R/=j,A*=_,R*=_,O=-(y-P),D=m-E,j=Math.sqrt(O*O+D*D),O/=j,D/=j,O*=_,D*=_;var ht=m-T,V=x-y,tt=m-E,F=P-y,qe=ht*tt+V*F,jt=V*tt-F*ht,It=jt<0;if(Math.abs(jt)<.001*Math.abs(qe)){c.push(m-A*I,y-R*I),c.push(m+A*C,y+R*C),qe>=0&&(a.join===Ut.ROUND?v+=te(m,y,m-A*I,y-R*I,m-O*I,y-D*I,c,!1)+4:v+=2,c.push(m-O*C,y-D*C),c.push(m+O*I,y+D*I));continue}var we=(-A+T)*(-R+y)-(-A+m)*(-R+x),ce=(-O+E)*(-D+y)-(-O+m)*(-D+P),xt=(ht*ce-tt*we)/jt,de=(F*we-V*ce)/jt,ve=(xt-m)*(xt-m)+(de-y)*(de-y),pt=m+(xt-m)*I,_t=y+(de-y)*I,dt=m-(xt-m)*C,vt=y-(de-y)*C,$=Math.min(ht*ht+V*V,tt*tt+F*F),Kt=It?I:C,At=$+Kt*Kt*g,Y=ve<=At;Y?a.join===Ut.BEVEL||ve/g>b?(It?(c.push(pt,_t),c.push(m+A*C,y+R*C),c.push(pt,_t),c.push(m+O*C,y+D*C)):(c.push(m-A*I,y-R*I),c.push(dt,vt),c.push(m-O*I,y-D*I),c.push(dt,vt)),v+=2):a.join===Ut.ROUND?It?(c.push(pt,_t),c.push(m+A*C,y+R*C),v+=te(m,y,m+A*C,y+R*C,m+O*C,y+D*C,c,!0)+4,c.push(pt,_t),c.push(m+O*C,y+D*C)):(c.push(m-A*I,y-R*I),c.push(dt,vt),v+=te(m,y,m-A*I,y-R*I,m-O*I,y-D*I,c,!1)+4,c.push(m-O*I,y-D*I),c.push(dt,vt)):(c.push(pt,_t),c.push(dt,vt)):(c.push(m-A*I,y-R*I),c.push(m+A*C,y+R*C),a.join===Ut.ROUND?It?v+=te(m,y,m+A*C,y+R*C,m+O*C,y+D*C,c,!0)+2:v+=te(m,y,m-A*I,y-R*I,m-O*I,y-D*I,c,!1)+2:a.join===Ut.MITER&&ve/g<=b&&(It?(c.push(dt,vt),c.push(dt,vt)):(c.push(pt,_t),c.push(pt,_t)),v+=2),c.push(m-O*I,y-D*I),c.push(m+O*C,y+D*C),v+=2)}T=i[(d-2)*2],x=i[(d-2)*2+1],m=i[(d-1)*2],y=i[(d-1)*2+1],A=-(x-y),R=T-m,j=Math.sqrt(A*A+R*R),A/=j,R/=j,A*=_,R*=_,c.push(m-A*I,y-R*I),c.push(m+A*C,y+R*C),h||(a.cap===zt.ROUND?v+=te(m-A*(I-C)*.5,y-R*(I-C)*.5,m-A*I,y-R*I,m+A*C,y+R*C,c,!1)+2:a.cap===zt.SQUARE&&(v+=Vn(m,y,A,R,I,C,!1,c)));for(var wt=t.indices,pe=We.epsilon*We.epsilon,H=p;H<v+p-2;++H)T=c[H*2],x=c[H*2+1],m=c[(H+1)*2],y=c[(H+1)*2+1],E=c[(H+2)*2],P=c[(H+2)*2+1],!(Math.abs(T*(y-P)+m*(P-x)+E*(x-y))<pe)&&wt.push(H,H+1,H+2)}}function rc(r,t){var e=0,i=r.shape,n=r.points||i.points,a=i.type!==nt.POLY||i.closeStroke;if(n.length!==0){var s=t.points,o=t.indices,h=n.length/2,u=s.length/2,l=u;for(s.push(n[0],n[1]),e=1;e<h;e++)s.push(n[e*2],n[e*2+1]),o.push(l,l+1),l++;a&&o.push(l,u)}}function Yn(r,t){r.lineStyle.native?rc(r,t):ec(r,t)}var zn=function(){function r(){}return r.curveTo=function(t,e,i,n,a,s){var o=s[s.length-2],h=s[s.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||a===0)return(s[s.length-2]!==t||s[s.length-1]!==e)&&s.push(t,e),null;var v=u*u+l*l,p=f*f+c*c,_=u*f+l*c,g=a*Math.sqrt(v)/d,b=a*Math.sqrt(p)/d,T=g*_/v,x=b*_/p,m=g*c+b*l,y=g*f+b*u,E=l*(b+T),P=u*(b+T),A=c*(g+x),R=f*(g+x),O=Math.atan2(P-y,E-m),D=Math.atan2(R-y,A-m);return{cx:m+t,cy:y+e,radius:a,startAngle:O,endAngle:D,anticlockwise:l*f>c*u}},r.arc=function(t,e,i,n,a,s,o,h,u){for(var l=o-s,f=We._segmentsCount(Math.abs(l)*a,Math.ceil(Math.abs(l)/Tr)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),_=f-1,g=_%1/_,b=0;b<=_;++b){var T=b+g*b,x=c+s+d*T,m=Math.cos(x),y=-Math.sin(x);u.push((v*m+p*y)*a+i,(v*-y+p*m)*a+n)}},r}(),ic=function(){function r(){}return r.curveLength=function(t,e,i,n,a,s,o,h){for(var u=10,l=0,f=0,c=0,d=0,v=0,p=0,_=0,g=0,b=0,T=0,x=0,m=t,y=e,E=1;E<=u;++E)f=E/u,c=f*f,d=c*f,v=1-f,p=v*v,_=p*v,g=_*t+3*p*f*i+3*v*c*a+d*o,b=_*e+3*p*f*n+3*v*c*s+d*h,T=m-g,x=y-b,m=g,y=b,l+=Math.sqrt(T*T+x*x);return l},r.curveTo=function(t,e,i,n,a,s,o){var h=o[o.length-2],u=o[o.length-1];o.length-=2;var l=We._segmentsCount(r.curveLength(h,u,t,e,i,n,a,s)),f=0,c=0,d=0,v=0,p=0;o.push(h,u);for(var _=1,g=0;_<=l;++_)g=_/l,f=1-g,c=f*f,d=c*f,v=g*g,p=v*g,o.push(d*h+3*c*g*t+3*f*v*i+p*a,d*u+3*c*g*e+3*f*v*n+p*s)},r}(),nc=function(){function r(){}return r.curveLength=function(t,e,i,n,a,s){var o=t-2*i+a,h=e-2*n+s,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,v=2*Math.sqrt(f+c+d),p=Math.sqrt(f),_=2*f*p,g=2*Math.sqrt(d),b=c/p;return(_*v+p*c*(v-g)+(4*d*f-c*c)*Math.log((2*p+b+v)/(b+g)))/(4*_)},r.curveTo=function(t,e,i,n,a){for(var s=a[a.length-2],o=a[a.length-1],h=We._segmentsCount(r.curveLength(s,o,t,e,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=s+(t-s)*c,l=o+(e-o)*c,a.push(u+(t+(i-t)*c-u)*c,l+(e+(n-e)*c-l)*c)}},r}(),ac=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}(),ee,ci=(ee={},ee[nt.POLY]=Ia,ee[nt.CIRC]=Mr,ee[nt.ELIP]=Mr,ee[nt.RECT]=Jf,ee[nt.RREC]=tc,ee),qn=[],vr=[],$n=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}(),me=new rt,sc=function(r){Xi(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 xr,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(),vr.push(this.drawCalls[e]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var i=this.batches[e];i.reset(),qn.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,a){i===void 0&&(i=null),n===void 0&&(n=null),a===void 0&&(a=null);var s=new $n(e,i,n,a);return this.graphicsData.push(s),this.dirty++,this},t.prototype.drawHole=function(e,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new $n(e,null,null,i),a=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=a.lineStyle,a.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 a=i[n];if(!!a.fillStyle.visible&&a.shape&&(a.matrix?a.matrix.applyInverse(e,me):me.copyFrom(e),a.shape.contains(me.x,me.y))){var s=!1;if(a.holes)for(var o=0;o<a.holes.length;o++){var h=a.holes[o];if(h.shape.contains(me.x,me.y)){s=!0;break}}if(!s)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,a=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],a=n.style);for(var s=this.shapeIndex;s<i.length;s++){this.shapeIndex++;var o=i[s],h=o.fillStyle,u=o.lineStyle,l=ci[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,v=this.indices.length,p=this.points.length/2;d.wrapMode=Ae.REPEAT,f===0?this.processFill(o):this.processLine(o);var _=this.points.length/2-p;_!==0&&(n&&!this._compareStyles(a,c)&&(n.end(v,p),n=null),n||(n=qn.pop()||new ac,n.begin(c,v,p),this.batches.push(n),a=c),this.addUvs(this.points,e,c.texture,p,_,c.matrix))}}}var g=this.indices.length,b=this.points.length/2;if(n&&n.end(g,b),this.batches.length===0){this.batchable=!0;return}var T=b>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&T===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=T?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],a=n.fillStyle,s=n.lineStyle;if(a&&!a.texture.baseTexture.valid||s&&!s.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 a=e[i],s=0;s<a.size;s++){var o=a.start+s;this.indicesUint16[o]=this.indicesUint16[o]-a.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=++k._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),vr.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,a=this.textureIds,s=vr.pop();s||(s=new bi,s.texArray=new Ei),s.texArray.count=0,s.start=0,s.size=0,s.type=Et.TRIANGLES;var o=0,h=null,u=0,l=!1,f=Et.TRIANGLES,c=0;this.drawCalls.push(s);for(var i=0;i<this.batches.length;i++){var d=this.batches[i],v=8,p=d.style,_=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,f=l?Et.LINES:Et.TRIANGLES,h=null,o=v,e++),h!==_&&(h=_,_._batchEnabled!==e&&(o===v&&(e++,o=0,s.size>0&&(s=vr.pop(),s||(s=new bi,s.texArray=new Ei),this.drawCalls.push(s)),s.start=c,s.size=0,s.texArray.count=0,s.type=f),_.touched=1,_._batchEnabled=e,_._batchLocation=o,_.wrapMode=Ae.REPEAT,s.texArray.elements[s.texArray.count++]=_,o++)),s.size+=d.size,c+=d.size,u=_._batchLocation,this.addColors(n,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(a,u,d.attribSize,d.attribStart)}k._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,i=this.uvs,n=this.colors,a=this.textureIds,s=new ArrayBuffer(e.length*3*4),o=new Float32Array(s),h=new Uint32Array(s),u=0,l=0;l<e.length/2;l++)o[u++]=e[l*2],o[u++]=e[l*2+1],o[u++]=i[l*2],o[u++]=i[l*2+1],h[u++]=n[l],o[u++]=a[l];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)},t.prototype.processFill=function(e){if(e.holes.length)Ia.triangulate(e,this);else{var i=ci[e.type];i.triangulate(e,this)}},t.prototype.processLine=function(e){Yn(e,this);for(var i=0;i<e.holes.length;i++)Yn(e.holes[i],this)},t.prototype.processHoles=function(e){for(var i=0;i<e.length;i++){var n=e[i],a=ci[n.type];a.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 a=e[n*2],s=e[n*2+1];e[n*2]=i.a*a+i.c*s+i.tx,e[n*2+1]=i.b*a+i.d*s+i.ty}},t.prototype.addColors=function(e,i,n,a,s){s===void 0&&(s=0);var o=(i>>16)+(i&65280)+((i&255)<<16),h=ta(o,n);e.length=Math.max(e.length,s+a);for(var u=0;u<a;u++)e[s+u]=h},t.prototype.addTextureIds=function(e,i,n,a){a===void 0&&(a=0),e.length=Math.max(e.length,a+n);for(var s=0;s<n;s++)e[a+s]=i},t.prototype.addUvs=function(e,i,n,a,s,o){o===void 0&&(o=null);for(var h=0,u=i.length,l=n.frame;h<s;){var f=e[(a+h)*2],c=e[(a+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 v=n.baseTexture;(l.width<v.width||l.height<v.height)&&this.adjustUvs(i,n,u,s)},t.prototype.adjustUvs=function(e,i,n,a){for(var s=i.baseTexture,o=1e-6,h=n+a*2,u=i.frame,l=u.width/s.width,f=u.height/s.height,c=u.x/u.width,d=u.y/u.height,v=Math.floor(e[n]+o),p=Math.floor(e[n+1]+o),_=n+2;_<h;_+=2)v=Math.min(v,Math.floor(e[_]+o)),p=Math.min(p,Math.floor(e[_+1]+o));c-=v,d-=p;for(var _=n;_<h;_+=2)e[_]=(e[_]+c)*l,e[_+1]=(e[_+1]+d)*f},t.BATCHABLE_SIZE=100,t}(ga),oc=function(r){Xi(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=zt.BUTT,e.join=Ut.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}(Pa),hc=new Float32Array(3),di={},Kn=function(r){Xi(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 Pa,i._lineStyle=new oc,i._matrix=null,i._holeMode=!1,i.state=Ye.for2d(),i._geometry=e||new sc,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,a,s){return e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=1),a===void 0&&(a=.5),s===void 0&&(s=!1),typeof e=="number"&&(e={width:e,color:i,alpha:n,alignment:a,native:s}),this.lineTextureStyle(e)},t.prototype.lineTextureStyle=function(e){e=Object.assign({width:0,texture:X.WHITE,color:e&&e.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:zt.BUTT,join:Ut.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 pr,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[i-2],e[i-1]))}else this.currentPath=new pr,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,a=n[n.length-2],s=n[n.length-1];return(a!==e||s!==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,a){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),nc.curveTo(e,i,n,a,s),this},t.prototype.bezierCurveTo=function(e,i,n,a,s,o){return this._initCurve(),ic.curveTo(e,i,n,a,s,o,this.currentPath.points),this},t.prototype.arcTo=function(e,i,n,a,s){this._initCurve(e,i);var o=this.currentPath.points,h=zn.curveTo(e,i,n,a,s,o);if(h){var u=h.cx,l=h.cy,f=h.radius,c=h.startAngle,d=h.endAngle,v=h.anticlockwise;this.arc(u,l,f,c,d,v)}return this},t.prototype.arc=function(e,i,n,a,s,o){if(o===void 0&&(o=!1),a===s)return this;!o&&s<=a?s+=Tr:o&&a<=s&&(a+=Tr);var h=s-a;if(h===0)return this;var u=e+Math.cos(a)*n,l=i+Math.sin(a)*n,f=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var d=Math.abs(c[c.length-2]-u),v=Math.abs(c[c.length-1]-l);d<f&&v<f||c.push(u,l)}else this.moveTo(u,l),c=this.currentPath.points;return zn.arc(u,l,e,i,n,a,s,o,c),this},t.prototype.beginFill=function(e,i){return e===void 0&&(e=0),i===void 0&&(i=1),this.beginTextureFill({texture:X.WHITE,color:e,alpha:i})},t.prototype.beginTextureFill=function(e){e=Object.assign({texture:X.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,a){return this.drawShape(new W(e,i,n,a))},t.prototype.drawRoundedRect=function(e,i,n,a,s){return this.drawShape(new Xh(e,i,n,a,s))},t.prototype.drawCircle=function(e,i,n){return this.drawShape(new Gh(e,i,n))},t.prototype.drawEllipse=function(e,i,n,a){return this.drawShape(new kh(e,i,n,a))},t.prototype.drawPolygon=function(){for(var e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];var a,s=!0,o=i[0];o.points?(s=o.closeStroke,a=o.points):Array.isArray(i[0])?a=i[0]:a=i;var h=new pr(a);return h.closeStroke=s,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===nt.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 a=0;a<n;a++){var s=e.batches[a],o=s.style.color,h=new Float32Array(this.vertexData.buffer,s.attribStart*4*2,s.attribSize*2),u=new Float32Array(e.uvsFloat32.buffer,s.attribStart*4*2,s.attribSize*2),l=new Uint16Array(e.indicesUint16.buffer,s.start*2,s.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Ge(o),_tintRGB:o,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[a]=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 a=this.batches[i];a.worldAlpha=this.worldAlpha*a.alpha,e.plugins[this.pluginName].render(a)}}},t.prototype._renderDirect=function(e){var i=this._resolveDirectShader(e),n=this._geometry,a=this.tint,s=this.worldAlpha,o=i.uniforms,h=n.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(a>>16&255)/255*s,o.tint[1]=(a>>8&255)/255*s,o.tint[2]=(a&255)/255*s,o.tint[3]=s,e.shader.bind(i),e.geometry.bind(n,i),e.state.set(this.state);for(var u=0,l=h.length;u<l;u++)this._renderDrawCallDirect(e,n.drawCalls[u])},t.prototype._renderDrawCallDirect=function(e,i){for(var n=i.texArray,a=i.type,s=i.size,o=i.start,h=n.count,u=0;u<h;u++)e.texture.bind(n.elements[u],u);e.geometry.draw(a,s,o)},t.prototype._resolveDirectShader=function(e){var i=this.shader,n=this.pluginName;if(!i){if(!di[n]){for(var a=e.plugins[n].MAX_TEXTURES,s=new Int32Array(a),o=0;o<a;o++)s[o]=o;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new ft,default:he.from({uSamplers:s},!0)},u=e.plugins[n]._shader.program;di[n]=new Lr(u,h)}i=di[n]}return i},t.prototype._calculateBounds=function(){this.finishPoly();var e=this._geometry;if(!!e.graphicsData.length){var i=e.bounds,n=i.minX,a=i.minY,s=i.maxX,o=i.maxY;this._bounds.addFrame(this.transform,n,a,s,o)}},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=Ge(this.tint,hc),i=0;i<this.batches.length;i++){var n=this.batches[i],a=n._batchRGB,s=e[0]*a[0]*255,o=e[1]*a[1]*255,h=e[2]*a[2]*255,u=(s<<16)+(o<<8)+(h|0);n._tintRGB=(u>>16)+(u&65280)+((u&255)<<16)}}},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,a=i.b,s=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 v=l[d],p=l[d+1];f[c++]=n*v+s*p+h,f[c++]=o*p+a*v+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 rt,t}(le);export{cr as A,_l as B,le as C,Kn as G,vf as S,cc as T,bl as a,Tt as e};
|