@pixi/assets
Advanced tools
Comparing version 6.5.1 to 6.5.2
/*! | ||
* @pixi/assets - v6.5.1 | ||
* Compiled Sun, 24 Jul 2022 20:56:21 UTC | ||
* @pixi/assets - v6.5.2 | ||
* Compiled Wed, 24 Aug 2022 13:51:19 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/assets is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_assets=function(e,t,r,n,s,i,a,o,u){"use strict";var c=function(){return c=Object.assign||function(e){for(var t,r=arguments,n=1,s=arguments.length;n<s;n++)for(var i in t=r[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function l(e,t,r,n){return new(r||(r=Promise))((function(s,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function o(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}u((n=n.apply(e,t||[])).next())}))}function f(e,t){var r,n,s,i,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){a.label=i[1];break}if(6===i[0]&&a.label<s[1]){a.label=s[1],s=i;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(i);break}s[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,o])}}}var h=function(){function e(e,t){void 0===t&&(t=!1),this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}return e.prototype.add=function(e){var t=this;e.forEach((function(e){t._assetList.push(e)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()},e.prototype._next=function(){return l(this,void 0,Promise,(function(){var e,t,r;return f(this,(function(n){switch(n.label){case 0:if(!this._assetList.length||!this._isActive)return[3,2];for(this._isLoading=!0,e=[],t=Math.min(this._assetList.length,this._maxConcurrent),r=0;r<t;r++)e.push(this._assetList.pop());return[4,this._loader.load(e)];case 1:n.sent(),this._isLoading=!1,this._next(),n.label=2;case 2:return[2]}}))}))},Object.defineProperty(e.prototype,"active",{get:function(){return this._isActive},set:function(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())},enumerable:!1,configurable:!0}),e}();var A,p=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function d(e){return p.exec(e).slice(1)}function v(e,t){var r=d(e)[2];return t&&r.substring(-1*t.length)===t&&(r=r.substring(0,r.length-t.length)),r}function m(e){return d(e)[3]}function g(){for(var e=arguments,t=[],r=0;r<arguments.length;r++)t[r]=e[r];for(var n="",s=0;s<t.length;s++){var i=t[s];i&&(n+=n?"/"+i:i)}return y(n)}function b(e){var t=d(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substring(0,n.length-1)),r+n):"."}function y(e){var t=function(e){return"/"===e.charAt(0)}(e),r=e&&"/"===e[e.length-1];return(e=function(e,t){for(var r=[],n=0;n<e.length;n++){var s=e[n];s&&"."!==s&&(".."===s?r.length&&".."!==r[r.length-1]?r.pop():t&&r.push(".."):r.push(s))}return r}(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function _(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(/^[^/:]+:\/*$/.exec(e[0])&&e.length>1){var r=e.shift();e[0]=r+e[0]}/^file:\/\/\//.exec(e[0])?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var s=e[n];if("string"!=typeof s)throw new TypeError("Url must be a string. Received "+s);""!==s&&(n>0&&(s=s.replace(/^[/]+/,"")),s=n<e.length-1?s.replace(/[/]+$/,""):s.replace(/[/]+$/,"/"),t.push(s))}var i=t.join("/"),a=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=a.shift()+(a.length>0?"?":"")+a.join("&")}function x(){for(var e=arguments,t=[],r=0;r<arguments.length;r++)t[r]=e[r];return _("object"==typeof t[0]?t[0]:[].slice.call(t))}function P(e){return!/^[a-zA-Z]:\\/.test(e)&&/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)}function E(e){return new RegExp(/^.*\//).exec(e.split("?")[0])[0].replace(new RegExp(/#\/|#/),"")}function B(e,t){A||(A=E(r.settings.ADAPTER.getBaseUrl()));var n=void 0!==t?E(t):A;return P(e)?e:x(n,e)}var w=function(e,t){return Array.isArray(e)||(e=[e]),t?e.map((function(e){return"string"==typeof e?t(e):e})):e};function T(e,t,r,n,s){for(var i=t[r],a=0;a<i.length;a++){var o=i[a];r<t.length-1?T(e.replace(n[r],o),t,r+1,n,s):s.push(e.replace(n[r],o))}}function L(e){var t=e.match(/\{(.*?)\}/g),r=[];if(t){var n=[];t.forEach((function(e){var t=e.substring(1,e.length-1).split(",");n.push(t)})),T(e,n,0,t,r)}else r.push(e);return r}var I=function(e){return!Array.isArray(e)},k=new(function(){function e(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return e.prototype.reset=function(){this._cacheMap.clear(),this._cache.clear()},e.prototype.has=function(e){return this._cache.has(e)},e.prototype.get=function(e){var t=this._cache.get(e);return t},e.prototype.set=function(e,r){for(var n,s=this,i=w(e),a=0;a<this.parsers.length;a++){var o=this.parsers[a];if(o.test(r)){n=o.getCacheableAssets(i,r);break}}n||(n={},i.forEach((function(e){n[e]=r})));var u=Object.keys(n),c={cacheKeys:u,keys:i};if(i.forEach((function(e){s._cacheMap.set(e,c)})),u.forEach((function(e){s._cache.has(e)&&s._cache.get(e),s._cache.set(e,n[e])})),r instanceof t.Texture){var l=r;i.forEach((function(e){l.baseTexture!==t.Texture.EMPTY.baseTexture&&t.BaseTexture.addToCache(l.baseTexture,e),t.Texture.addToCache(l,e)}))}},e.prototype.remove=function(e){var t=this;if(this._cacheMap.get(e),this._cacheMap.has(e)){var r=this._cacheMap.get(e);r.cacheKeys.forEach((function(e){t._cache.delete(e)})),r.keys.forEach((function(e){t._cacheMap.delete(e)}))}},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}());function O(e,t,r){var n={};if(e.forEach((function(e){n[e]=t})),Object.keys(t.textures).forEach((function(e){n[e]=t.textures[e]})),!r){var s=b(e[0]);t.linkedSheets.forEach((function(e,r){var i=O([s+"/"+t.data.meta.related_multi_packs[r]],e,!0);Object.assign(n,i)}))}return n}var M={extension:t.ExtensionType.CacheParser,test:function(e){return e instanceof n.Spritesheet},getCacheableAssets:function(e,t){return O(e,t,!1)}},R={extension:t.ExtensionType.CacheParser,test:function(e){return Array.isArray(e)&&e.every((function(e){return e instanceof t.Texture}))},getCacheableAssets:function(e,t){var r={};return e.forEach((function(e){t.forEach((function(t,n){r[e+(0===n?"":n+1)]=t}))})),r}};function j(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return l(t,void 0,void 0,(function(){return f(this,(function(t){return e.unshift.apply(e,r),[2,e]}))}))}}function F(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return l(t,void 0,void 0,(function(){var t,n,s,i;return f(this,(function(a){for(t=0,n=r;t<n.length;t++)s=n[t],-1!==(i=e.indexOf(s))&&e.splice(i,1);return[2,e]}))}))}}var C,W,D={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e;return f(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",[4,r.settings.ADAPTER.fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:j("avif"),remove:F("avif")};function S(){W={s3tc:C.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:C.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:C.getExtension("WEBGL_compressed_texture_etc"),etc1:C.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:C.getExtension("WEBGL_compressed_texture_pvrtc")||C.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:C.getExtension("WEBGL_compressed_texture_atc"),astc:C.getExtension("WEBGL_compressed_texture_astc")}}var G={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e,t;return f(this,(function(n){return e=r.settings.ADAPTER.createCanvas(),(t=e.getContext("webgl"))?(C=t,[2,!0]):[2,!1]}))}))},add:function(e){return l(void 0,void 0,Promise,(function(){var t,r;return f(this,(function(n){for(r in W||S(),t=[],W)W[r]&&t.push(r);return e.unshift.apply(e,t),[2,e]}))}))},remove:function(e){return l(void 0,void 0,Promise,(function(){return f(this,(function(t){return W||S(),[2,e.filter((function(e){return!(e in W)}))]}))}))}},X={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){return f(this,(function(e){return[2,!(!s.BasisParser.basisBinding||!s.BasisParser.TranscoderWorker.wasmSource)]}))}))},add:j("basis"),remove:F("basis")},U={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e;return f(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",[4,r.settings.ADAPTER.fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:j("webp"),remove:F("webp")};function H(e,t,r){return l(this,void 0,Promise,(function(){var n,s,a,o,u,c,l,h;return f(this,(function(f){switch(f.label){case 0:for(n=t.page,s=[],a=0;a<n.length;++a)o=n[a].file,u=g(b(e),o),s.push(u);return h=(l=Object).values,[4,r.load(s)];case 1:return c=h.apply(l,[f.sent()]),[2,i.BitmapFont.install(t,c,!0)]}}))}))}var Q,z,N=[".xml",".fnt"],Y={extension:t.ExtensionType.LoadParser,test:function(e){return N.includes(m(e))},testParse:function(e){return l(this,void 0,Promise,(function(){var t,r;return f(this,(function(n){return t=i.TextFormat.test(e),r=i.XMLStringFormat.test(e),[2,t||r]}))}))},parse:function(e,t,r){return l(this,void 0,Promise,(function(){var n;return f(this,(function(s){switch(s.label){case 0:return i.TextFormat.test(e)?(n=i.TextFormat.parse(e),[4,H(t.src,n,r)]):[3,2];case 1:case 3:return[2,s.sent()];case 2:return[4,H(t.src,i.XMLStringFormat.parse(e),r)]}}))}))},load:function(e,t,n){return l(this,void 0,Promise,(function(){var t,s;return f(this,(function(a){switch(a.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,a.sent().text()];case 2:return t=a.sent(),s=(new window.DOMParser).parseFromString(t,"text/xml"),[4,H(e,i.XMLFormat.parse(s),n)];case 3:return[2,a.sent()]}}))}))},unload:function(e){e.destroy()}},Z={extension:t.ExtensionType.LoadParser,test:function(e){return m(e).includes(".json")},load:function(e){return l(this,void 0,Promise,(function(){return f(this,(function(t){switch(t.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))}))}},K={extension:t.ExtensionType.LoadParser,testParse:function(e,t){return l(this,void 0,Promise,(function(){return f(this,(function(r){return[2,m(t.src).includes(".json")&&!!e.frames]}))}))},parse:function(e,t,r){var s,i;return l(this,void 0,Promise,(function(){var a,o,u,c,l,h,A,p,d,v,m,g;return f(this,(function(f){switch(f.label){case 0:return(a=b(t.src))&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),o=a+e.meta.image,[4,r.load([o])];case 1:return u=f.sent(),c=u[o],[4,(l=new n.Spritesheet(c.baseTexture,e,t.src)).parse()];case 2:if(f.sent(),h=null===(s=null==e?void 0:e.meta)||void 0===s?void 0:s.related_multi_packs,!Array.isArray(h))return[3,4];for(A=[],p=0,d=h;p<d.length;p++)"string"==typeof(v=d[p])&&(m=a+v,(null===(i=t.data)||void 0===i?void 0:i.ignoreMultiPack)||A.push(r.load({src:m,data:{ignoreMultiPack:!0}})));return[4,Promise.all(A)];case 3:g=f.sent(),l.linkedSheets=g,g.forEach((function(e){e.linkedSheets=[l].concat(l.linkedSheets.filter((function(t){return t!==e})))})),f.label=4;case 4:return[2,l]}}))}))},unload:function(e){e.destroy(!0)}},V=0,$="\n self.onmessage = function(event) {\n\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap;\n }\n\n loadImageBitmap(event.data.data[0]).then(imageBitmap => {\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }).catch(error => {\n self.postMessage({\n data: null,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n });\n }",q=new(function(){function e(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return e.prototype.loadImageBitmap=function(e){return this._run("loadImageBitmap",[e])},e.prototype._initWorkers=function(){return l(this,void 0,void 0,(function(){return f(this,(function(e){return this._initialized||(this._initialized=!0),[2]}))}))},e.prototype.getWorker=function(){var e=this;void 0===Q&&(Q=navigator.hardwareConcurrency||4);var t=this.workerPool.pop();return!t&&this._createdWorkers<Q&&(z||(z=URL.createObjectURL(new Blob([$],{type:"application/javascript"}))),this._createdWorkers++,(t=new Worker(z)).addEventListener("message",(function(t){e.complete(t.data),e.returnWorker(t.target),e.next()}))),t},e.prototype.returnWorker=function(e){this.workerPool.push(e)},e.prototype.complete=function(e){var t=e.data;this.resolveHash[e.uuid](t),this.resolveHash[e.uuid]=null},e.prototype._run=function(e,t){var r=this;this._initWorkers();var n=new Promise((function(n){r.queue.push({id:e,arguments:t,resolve:n})}));return this.next(),n},e.prototype.next=function(){if(this.queue.length){var e=this.getWorker();if(e){var t=this.queue.pop(),r=t.id;this.resolveHash[V]=t.resolve,e.postMessage({data:t.arguments,uuid:V++,id:r})}}},e}()),J=["jpg","png","jpeg","avif","webp"];function ee(e){return l(this,void 0,Promise,(function(){var t;return f(this,(function(n){switch(n.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,n.sent().blob()];case 2:return t=n.sent(),[4,createImageBitmap(t)];case 3:return[2,n.sent()]}}))}))}var te={extension:t.ExtensionType.LoadParser,config:{preferWorkers:!0},test:function(e){var t=e.split("?")[0].split(".").pop();return J.includes(t)},load:function(e,r,n){return l(this,void 0,Promise,(function(){var s,i,o,u;return f(this,(function(l){switch(l.label){case 0:return s=null,window.createImageBitmap?this.config.preferWorkers?[4,q.loadImageBitmap(e)]:[3,2]:[3,5];case 1:return i=l.sent(),[3,4];case 2:return[4,ee(e)];case 3:i=l.sent(),l.label=4;case 4:return s=i,[3,7];case 5:return[4,new Promise((function(t){(s=new Image).crossOrigin="anonymous",s.src=e,s.complete?t(s):s.onload=function(){t(s)}}))];case 6:s=l.sent(),l.label=7;case 7:return(o=new t.BaseTexture(s,c({resolution:a.getResolutionOfUrl(e)},r.data))).resource.src=e,(u=new t.Texture(o)).baseTexture.on("dispose",(function(){delete n.promiseCache[e]})),[2,u]}}))}))},unload:function(e){e.destroy(!0)}},re={extension:t.ExtensionType.LoadParser,test:function(e){return m(e).includes(".txt")},load:function(e){return l(this,void 0,Promise,(function(){return f(this,(function(t){switch(t.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().text()];case 2:return[2,t.sent()]}}))}))}},ne=["normal","bold","100","200","300","400","500","600","700","800","900"],se=["woff","woff2","ttf","otf"];function ie(e){return v(e,m(e)).replace(/(-|_)/g," ").toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" ")}var ae={extension:t.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return se.includes(t)},load:function(e,t){var r,n,s,i,a,o;return l(this,void 0,Promise,(function(){var u,l,h,A,p,d,v;return f(this,(function(f){switch(f.label){case 0:if(!window.navigator.onLine)throw new Error("[loadWebFont] Cannot load font - navigator is offline");if(!("FontFace"in window))return[3,5];u=[],l=null!==(n=null===(r=t.data)||void 0===r?void 0:r.family)&&void 0!==n?n:ie(e),h=null!==(a=null===(i=null===(s=t.data)||void 0===s?void 0:s.weights)||void 0===i?void 0:i.filter((function(e){return ne.includes(e)})))&&void 0!==a?a:["normal"],A=null!==(o=t.data)&&void 0!==o?o:{},p=0,f.label=1;case 1:return p<h.length?(d=h[p],[4,(v=new FontFace(l,"url("+e+")",c(c({},A),{weight:d}))).load()]):[3,4];case 2:f.sent(),document.fonts.add(v),u.push(v),f.label=3;case 3:return p++,[3,1];case 4:return[2,1===u.length?u[0]:u];case 5:return[2,null]}}))}))},unload:function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return document.fonts.delete(e)}))}},oe=["basis"],ue={extension:t.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return oe.includes(t.toLowerCase())},load:function(e,n,i){return l(this,void 0,Promise,(function(){var a,l,h,A,p;return f(this,(function(f){switch(f.label){case 0:return[4,s.TranscoderWorker.onTranscoderInitialized];case 1:return f.sent(),[4,r.settings.ADAPTER.fetch(e)];case 2:return[4,f.sent().arrayBuffer()];case 3:return a=f.sent(),[4,s.BasisParser.transcode(a)];case 4:return l=f.sent(),h=s.BASIS_FORMAT_TO_TYPE[l.basisFormat],A=l.basisFormat!==s.BASIS_FORMATS.cTFRGBA32?o.FORMATS.RGB:o.FORMATS.RGBA,[2,1===(p=l.map((function(r){var s=new t.BaseTexture(r,c({mipmap:r instanceof u.CompressedTextureResource&&r.levels>1?o.MIPMAP_MODES.ON_MANUAL:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:h,format:A},n.data)),a=new t.Texture(s);return a.baseTexture.on("dispose",(function(){delete i.promiseCache[e]})),a}))).length?p[0]:p]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},ce=["dds"],le={extension:t.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return ce.includes(t.toLowerCase())},load:function(e,n,s){return l(this,void 0,Promise,(function(){var i,l,h;return f(this,(function(f){switch(f.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,f.sent().arrayBuffer()];case 2:return i=f.sent(),l=u.parseDDS(i),[2,1===(h=l.map((function(r){var i=new t.BaseTexture(r,c({mipmap:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:a.getResolutionOfUrl(e)},n.data)),u=new t.Texture(i);return u.baseTexture.on("dispose",(function(){delete s.promiseCache[e]})),u}))).length?h[0]:h]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},fe=["ktx"],he={extension:t.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return fe.includes(t.toLowerCase())},load:function(e,n,s){return l(this,void 0,Promise,(function(){var i,l,h,A,p,d,v,m;return f(this,(function(f){switch(f.label){case 0:return[4,r.settings.ADAPTER.fetch(e)];case 1:return[4,f.sent().arrayBuffer()];case 2:return i=f.sent(),l=u.parseKTX(e,i),h=l.compressed,A=l.uncompressed,p=l.kvData,d=null!=h?h:A,v=c({mipmap:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:a.getResolutionOfUrl(e)},n.data),[2,1===(m=d.map((function(r){d===A&&Object.assign(v,{type:r.type,format:r.format});var n=new t.BaseTexture(r,v);n.ktxKeyValueData=p;var i=new t.Texture(n);return i.baseTexture.on("dispose",(function(){delete s.promiseCache[e]})),i}))).length?m[0]:m]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},Ae=function(){function e(){this._parsers=[],this.promiseCache={}}return e.prototype.reset=function(){this.promiseCache={}},e.prototype._getLoadPromiseAndParser=function(e,t){var r=this,n={promise:null,parser:null};return n.promise=l(r,void 0,void 0,(function(){var r,s,i,a,o,u;return f(this,(function(c){switch(c.label){case 0:r=null,s=0,c.label=1;case 1:return s<this.parsers.length?(i=this.parsers[s]).load&&(null===(o=i.test)||void 0===o?void 0:o.call(i,e,t,this))?[4,i.load(e,t,this)]:[3,3]:[3,4];case 2:return r=c.sent(),n.parser=i,[3,4];case 3:return s++,[3,1];case 4:if(!n.parser)return[2,null];s=0,c.label=5;case 5:return s<this.parsers.length?(i=this.parsers[s]).parse?(a=i.parse)?[4,null===(u=i.testParse)||void 0===u?void 0:u.call(i,r,t,this)]:[3,7]:[3,9]:[3,10];case 6:a=c.sent(),c.label=7;case 7:return a?[4,i.parse(r,t,this)]:[3,9];case 8:r=c.sent()||r,n.parser=i,c.label=9;case 9:return s++,[3,5];case 10:return[2,r]}}))})),n},e.prototype.load=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i,a,o,u=this;return f(this,(function(c){switch(c.label){case 0:return r=0,n={},s=I(e),i=w(e,(function(e){return{src:e}})),a=i.length,o=i.map((function(e){return l(u,void 0,void 0,(function(){var s,i,o,u;return f(this,(function(c){switch(c.label){case 0:if(s=B(e.src),n[e.src])return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),this.promiseCache[s]||(this.promiseCache[s]=this._getLoadPromiseAndParser(s,e)),i=n,o=e.src,[4,this.promiseCache[s].promise];case 2:return i[o]=c.sent(),t&&t(++r/a),[3,4];case 3:throw u=c.sent(),delete this.promiseCache[s],delete n[e.src],new Error("[Loader.load] Failed to load "+s+".\n"+u);case 4:return[2]}}))}))})),[4,Promise.all(o)];case 1:return c.sent(),[2,s?n[i[0].src]:n]}}))}))},e.prototype.unload=function(e){return l(this,void 0,Promise,(function(){var t,r,n=this;return f(this,(function(s){switch(s.label){case 0:return t=w(e,(function(e){return{src:e}})),r=t.map((function(e){return l(n,void 0,void 0,(function(){var t,r,n,s,i;return f(this,(function(a){switch(a.label){case 0:return t=B(e.src),(r=this.promiseCache[t])?[4,r.promise]:[3,2];case 1:n=a.sent(),null===(i=null===(s=r.parser)||void 0===s?void 0:s.unload)||void 0===i||i.call(s,n,e,this),delete this.promiseCache[t],a.label=2;case 2:return[2]}}))}))})),[4,Promise.all(r)];case 1:return s.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}(),pe=["jpg","png","jpeg","avif","webp"],de={extension:t.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split("."),r=t.pop(),n=t.pop();return"json"===r&&pe.includes(n)},parse:function(e){var t,n,s=e.split(".");return{resolution:parseFloat(null!==(n=null===(t=r.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==n?n:"1"),format:s[s.length-2],src:e}}},ve={extension:t.ExtensionType.ResolveParser,test:te.test,parse:function(e){var t,n;return{resolution:parseFloat(null!==(n=null===(t=r.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==n?n:"1"),format:e.split(".").pop(),src:e}}},me={extension:t.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:function(e){var t,n,s,i;if("ktx"===e.split("?")[0].split(".").pop()){var a=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(a.some((function(t){return e.endsWith(t)})))return{resolution:parseFloat(null!==(n=null===(t=r.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==n?n:"1"),format:a.find((function(t){return e.endsWith(t)})),src:e}}return{resolution:parseFloat(null!==(i=null===(s=r.settings.RETINA_PREFIX.exec(e))||void 0===s?void 0:s[1])&&void 0!==i?i:"1"),format:e.split(".").pop(),src:e}}},ge=function(){function e(){this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}return e.prototype.prefer=function(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];r.forEach((function(e){t._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))})),this._resolverHash={}},Object.defineProperty(e.prototype,"basePath",{get:function(){return this._basePath},set:function(e){this._basePath=E(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._preferredOrder=[],this._resolverHash={},this._assetMap={},this._basePath=null,this._manifest=null},e.prototype.addManifest=function(e){var t=this;this._manifest,this._manifest=e,e.bundles.forEach((function(e){t.addBundle(e.name,e.assets)}))},e.prototype.addBundle=function(e,t){var r=this,n=[];Array.isArray(t)?t.forEach((function(e){"string"==typeof e.name?n.push(e.name):n.push.apply(n,e.name),r.add(e.name,e.srcs)})):Object.keys(t).forEach((function(e){n.push(e),r.add(e,t[e])})),this._bundles[e]=n},e.prototype.add=function(e,t,r){var n=this,s=w(e);s.forEach((function(e){n._assetMap[e]})),Array.isArray(t)||(t="string"==typeof t?L(t):[t]);var i=t.map((function(e){var t,i=e;if("string"==typeof e){for(var a=!1,o=0;o<n._parsers.length;o++){var u=n._parsers[o];if(u.test(e)){i=u.parse(e),a=!0;break}}a||(i={src:e})}return i.format||(i.format=i.src.split(".").pop()),i.alias||(i.alias=s),n._basePath&&(i.src=B(i.src,n._basePath)),i.data=null!==(t=i.data)&&void 0!==t?t:r,i}));s.forEach((function(e){n._assetMap[e]=i}))},e.prototype.resolveBundle=function(e){var t=this,r=I(e);e=w(e);var n={};return e.forEach((function(e){var r=t._bundles[e];r&&(n[e]=t.resolve(r))})),r?n[e[0]]:n},e.prototype.resolveUrl=function(e){var t=this.resolve(e);if("string"!=typeof e){var r={};for(var n in t)r[n]=t[n].src;return r}return t.src},e.prototype.resolve=function(e){var t=this,r=I(e);e=w(e);var n={};return e.forEach((function(e){var r;if(!t._resolverHash[e])if(t._assetMap[e]){var s=t._assetMap[e],i=t._getPreferredOrder(s),a=s[0];null==i||i.priority.forEach((function(e){i.params[e].forEach((function(t){var r=s.filter((function(r){return!!r[e]&&r[e]===t}));r.length&&(s=r)}))})),t._resolverHash[e]=null!==(r=s[0])&&void 0!==r?r:a}else{var o=e;t._basePath&&(o=B(o,t._basePath)),t._resolverHash[e]={src:o}}n[e]=t._resolverHash[e]})),r?n[e[0]]:n},e.prototype._getPreferredOrder=function(e){for(var t=function(t){var n=e[0],s=r._preferredOrder.find((function(e){return e.params.format.includes(n.format)}));if(s)return{value:s}},r=this,n=0;n<e.length;n++){var s=t();if("object"==typeof s)return s.value}return this._preferredOrder[0]},e}(),be=function(){function e(){this._detections=[],this._initialized=!1,this.resolver=new ge,this.loader=new Ae,this.cache=k,this._backgroundLoader=new h(this.loader),this._backgroundLoader.active=!0,this.reset()}return e.prototype.init=function(e){var t,r,n,s;return void 0===e&&(e={}),l(this,void 0,Promise,(function(){var i,a,o,u,c,l,h,A,p,d;return f(this,(function(f){switch(f.label){case 0:return this._initialized?[2]:(this._initialized=!0,e.basePath&&(this.resolver.basePath=e.basePath),e.manifest?"string"!=typeof(i=e.manifest)?[3,2]:[4,this.load(i)]:[3,3]);case 1:i=f.sent(),f.label=2;case 2:this.resolver.addManifest(i),f.label=3;case 3:if(a=null!==(r=null===(t=e.texturePreference)||void 0===t?void 0:t.resolution)&&void 0!==r?r:1,o="number"==typeof a?[a]:a,!(null===(n=e.texturePreference)||void 0===n?void 0:n.format))return[3,9];c=null===(s=e.texturePreference)||void 0===s?void 0:s.format,u="string"==typeof c?[c]:c,l=0,h=this._detections,f.label=4;case 4:return l<h.length?[4,(d=h[l]).test()]:[3,8];case 5:return f.sent()?[3,7]:[4,d.remove(u)];case 6:u=f.sent(),f.label=7;case 7:return l++,[3,4];case 8:return[3,14];case 9:u=["png","jpg","jpeg"],A=0,p=this._detections,f.label=10;case 10:return A<p.length?[4,(d=p[A]).test()]:[3,14];case 11:return f.sent()?[4,d.add(u)]:[3,13];case 12:u=f.sent(),f.label=13;case 13:return A++,[3,10];case 14:return this.resolver.prefer({params:{format:u,resolution:o}}),[2]}}))}))},e.prototype.add=function(e,t,r){this.resolver.add(e,t,r)},e.prototype.load=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i,a=this;return f(this,(function(o){switch(o.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:o.sent(),o.label=2;case 2:return r=I(e),n=w(e).map((function(e){return"string"!=typeof e?(a.resolver.add(e.src,e),e.src):e})),s=this.resolver.resolve(n),[4,this._mapLoadToResolve(s,t)];case 3:return i=o.sent(),[2,r?i[n[0]]:i]}}))}))},e.prototype.addBundle=function(e,t){this.resolver.addBundle(e,t)},e.prototype.loadBundle=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i,a=this;return f(this,(function(o){switch(o.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:o.sent(),o.label=2;case 2:return r=!1,"string"==typeof e&&(r=!0,e=[e]),n=this.resolver.resolveBundle(e),s={},i=Object.keys(n).map((function(e){var r=n[e];return a._mapLoadToResolve(r,t).then((function(t){s[e]=t}))})),[4,Promise.all(i)];case 3:return o.sent(),[2,r?s[e[0]]:s]}}))}))},e.prototype.backgroundLoad=function(e){return l(this,void 0,Promise,(function(){var t;return f(this,(function(r){switch(r.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:r.sent(),r.label=2;case 2:return"string"==typeof e&&(e=[e]),t=this.resolver.resolve(e),this._backgroundLoader.add(Object.values(t)),[2]}}))}))},e.prototype.backgroundLoadBundle=function(e){return l(this,void 0,Promise,(function(){var t,r=this;return f(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"string"==typeof e&&(e=[e]),t=this.resolver.resolveBundle(e),Object.values(t).forEach((function(e){r._backgroundLoader.add(Object.values(e))})),[2]}}))}))},e.prototype.reset=function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1},e.prototype.get=function(e){if("string"==typeof e)return k.get(e);for(var t={},r=0;r<e.length;r++)t[r]=k.get(e[r]);return t},e.prototype._mapLoadToResolve=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i;return f(this,(function(a){switch(a.label){case 0:return r=Object.values(e),n=Object.keys(e),this._backgroundLoader.active=!1,[4,this.loader.load(r,t)];case 1:return s=a.sent(),this._backgroundLoader.active=!0,i={},r.forEach((function(e,t){var r=s[e.src],a=[e.src];e.alias&&a.push.apply(a,e.alias),i[n[t]]=r,k.set(a,r)})),[2,i]}}))}))},e.prototype.unload=function(e){return l(this,void 0,Promise,(function(){var t,r;return f(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 t=w(e).map((function(e){return"string"!=typeof e?e.src:e})),r=this.resolver.resolve(t),[4,this._unloadFromResolved(r)];case 3:return n.sent(),[2]}}))}))},e.prototype.unloadBundle=function(e){return l(this,void 0,Promise,(function(){var t,r,n=this;return f(this,(function(s){switch(s.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:s.sent(),s.label=2;case 2:return e=w(e),t=this.resolver.resolveBundle(e),r=Object.keys(t).map((function(e){return n._unloadFromResolved(t[e])})),[4,Promise.all(r)];case 3:return s.sent(),[2]}}))}))},e.prototype._unloadFromResolved=function(e){return l(this,void 0,void 0,(function(){var t;return f(this,(function(r){switch(r.label){case 0:return(t=Object.values(e)).forEach((function(e){k.remove(e.src)})),[4,this.loader.unload(t)];case 1:return r.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"detections",{get:function(){return this._detections},enumerable:!1,configurable:!0}),e}(),ye=new be;return t.extensions.handleByList(t.ExtensionType.LoadParser,ye.loader.parsers).handleByList(t.ExtensionType.ResolveParser,ye.resolver.parsers).handleByList(t.ExtensionType.CacheParser,ye.cache.parsers).handleByList(t.ExtensionType.DetectionParser,ye.detections),t.extensions.add(te,re,Z,K,Y,ae,M,R,ve,de,U,D),e.Assets=ye,e.AssetsClass=be,e.Cache=k,e.addFormats=j,e.basename=v,e.cacheSpritesheet=M,e.cacheTextureArray=R,e.convertToList=w,e.createStringVariations=L,e.detectAvif=D,e.detectBasis=X,e.detectCompressedTextures=G,e.detectWebp=U,e.dirname=b,e.extname=m,e.getBaseUrl=E,e.getFontFamilyName=ie,e.isAbsoluteUrl=P,e.isSingleItem=I,e.join=g,e.loadBasis=ue,e.loadBitmapFont=Y,e.loadDDS=le,e.loadImageBitmap=ee,e.loadJson=Z,e.loadKTX=he,e.loadSpritesheet=K,e.loadTextures=te,e.loadTxt=re,e.loadWebFont=ae,e.makeAbsoluteUrl=B,e.removeFormats=F,e.resolveCompressedTextureUrl=me,e.resolveSpriteSheetUrl=de,e.resolveTextureUrl=ve,e.urlJoin=x,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI,PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI);Object.assign(this.PIXI,_pixi_assets); | ||
this.PIXI=this.PIXI||{};var _pixi_assets=function(e,t,r,n,s,i,o,a,u){"use strict";var c=function(){return c=Object.assign||function(e){for(var t,r=arguments,n=1,s=arguments.length;n<s;n++)for(var i in t=r[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function l(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))}function h(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var f=function(){function e(e,t){void 0===t&&(t=!1),this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}return e.prototype.add=function(e){var t=this;e.forEach((function(e){t._assetList.push(e)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()},e.prototype._next=function(){return l(this,void 0,Promise,(function(){var e,t,r;return h(this,(function(n){switch(n.label){case 0:if(!this._assetList.length||!this._isActive)return[3,2];for(this._isLoading=!0,e=[],t=Math.min(this._assetList.length,this._maxConcurrent),r=0;r<t;r++)e.push(this._assetList.pop());return[4,this._loader.load(e)];case 1:n.sent(),this._isLoading=!1,this._next(),n.label=2;case 2:return[2]}}))}))},Object.defineProperty(e.prototype,"active",{get:function(){return this._isActive},set:function(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())},enumerable:!1,configurable:!0}),e}(),A=function(e,t){return Array.isArray(e)||(e=[e]),t?e.map((function(e){return"string"==typeof e?t(e):e})):e};function d(e,t,r,n,s){for(var i=t[r],o=0;o<i.length;o++){var a=i[o];r<t.length-1?d(e.replace(n[r],a),t,r+1,n,s):s.push(e.replace(n[r],a))}}function p(e){var t=e.match(/\{(.*?)\}/g),r=[];if(t){var n=[];t.forEach((function(e){var t=e.substring(1,e.length-1).split(",");n.push(t)})),d(e,n,0,t,r)}else r.push(e);return r}var v=function(e){return!Array.isArray(e)},m=new(function(){function e(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return e.prototype.reset=function(){this._cacheMap.clear(),this._cache.clear()},e.prototype.has=function(e){return this._cache.has(e)},e.prototype.get=function(e){var t=this._cache.get(e);return t},e.prototype.set=function(e,r){for(var n,s=this,i=A(e),o=0;o<this.parsers.length;o++){var a=this.parsers[o];if(a.test(r)){n=a.getCacheableAssets(i,r);break}}n||(n={},i.forEach((function(e){n[e]=r})));var u=Object.keys(n),c={cacheKeys:u,keys:i};if(i.forEach((function(e){s._cacheMap.set(e,c)})),u.forEach((function(e){s._cache.has(e)&&s._cache.get(e),s._cache.set(e,n[e])})),r instanceof t.Texture){var l=r;i.forEach((function(e){l.baseTexture!==t.Texture.EMPTY.baseTexture&&t.BaseTexture.addToCache(l.baseTexture,e),t.Texture.addToCache(l,e)}))}},e.prototype.remove=function(e){var t=this;if(this._cacheMap.get(e),this._cacheMap.has(e)){var r=this._cacheMap.get(e);r.cacheKeys.forEach((function(e){t._cache.delete(e)})),r.keys.forEach((function(e){t._cacheMap.delete(e)}))}},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}());function g(e,t,r){var s={};if(e.forEach((function(e){s[e]=t})),Object.keys(t.textures).forEach((function(e){s[e]=t.textures[e]})),!r){var i=n.path.dirname(e[0]);t.linkedSheets.forEach((function(e,r){var n=g([i+"/"+t.data.meta.related_multi_packs[r]],e,!0);Object.assign(s,n)}))}return s}var b={extension:t.ExtensionType.CacheParser,test:function(e){return e instanceof r.Spritesheet},getCacheableAssets:function(e,t){return g(e,t,!1)}},y={extension:t.ExtensionType.CacheParser,test:function(e){return Array.isArray(e)&&e.every((function(e){return e instanceof t.Texture}))},getCacheableAssets:function(e,t){var r={};return e.forEach((function(e){t.forEach((function(t,n){r[e+(0===n?"":n+1)]=t}))})),r}};function _(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return l(t,void 0,void 0,(function(){return h(this,(function(t){return e.unshift.apply(e,r),[2,e]}))}))}}function P(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return l(t,void 0,void 0,(function(){var t,n,s,i;return h(this,(function(o){for(t=0,n=r;t<n.length;t++)s=n[t],-1!==(i=e.indexOf(s))&&e.splice(i,1);return[2,e]}))}))}}var x,E,B={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",[4,s.settings.ADAPTER.fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:_("avif"),remove:P("avif")};function w(){E={s3tc:x.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:x.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:x.getExtension("WEBGL_compressed_texture_etc"),etc1:x.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:x.getExtension("WEBGL_compressed_texture_pvrtc")||x.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:x.getExtension("WEBGL_compressed_texture_atc"),astc:x.getExtension("WEBGL_compressed_texture_astc")}}var T={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e,t;return h(this,(function(r){return e=s.settings.ADAPTER.createCanvas(),(t=e.getContext("webgl"))?(x=t,[2,!0]):[2,!1]}))}))},add:function(e){return l(void 0,void 0,Promise,(function(){var t,r;return h(this,(function(n){for(r in E||w(),t=[],E)E[r]&&t.push(r);return e.unshift.apply(e,t),[2,e]}))}))},remove:function(e){return l(void 0,void 0,Promise,(function(){return h(this,(function(t){return E||w(),[2,e.filter((function(e){return!(e in E)}))]}))}))}},L={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){return h(this,(function(e){return[2,!(!i.BasisParser.basisBinding||!i.BasisParser.TranscoderWorker.wasmSource)]}))}))},add:_("basis"),remove:P("basis")},I={extension:t.ExtensionType.DetectionParser,test:function(){return l(void 0,void 0,Promise,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",[4,s.settings.ADAPTER.fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:_("webp"),remove:P("webp")},k=[".xml",".fnt"],O={extension:t.ExtensionType.LoadParser,test:function(e){return k.includes(n.path.extname(e))},testParse:function(e){return l(this,void 0,Promise,(function(){return h(this,(function(t){return[2,o.TextFormat.test(e)||o.XMLStringFormat.test(e)]}))}))},parse:function(e,t,r){return l(this,void 0,Promise,(function(){var s,i,a,u,c,l,f,A,d,p;return h(this,(function(h){switch(h.label){case 0:for(s=o.TextFormat.test(e)?o.TextFormat.parse(e):o.XMLStringFormat.parse(e),i=t.src,a=s.page,u=[],c=0;c<a.length;++c)l=a[c].file,f=n.path.join(n.path.dirname(i),l),u.push(f);return p=(d=Object).values,[4,r.load(u)];case 1:return A=p.apply(d,[h.sent()]),[2,o.BitmapFont.install(s,A,!0)]}}))}))},load:function(e,t){return l(this,void 0,Promise,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[2,t.sent().text()]}}))}))},unload:function(e){e.destroy()}},M={extension:t.ExtensionType.LoadParser,test:function(e){return n.path.extname(e).includes(".json")},load:function(e){return l(this,void 0,Promise,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))}))}},R={extension:t.ExtensionType.LoadParser,testParse:function(e,t){return l(this,void 0,Promise,(function(){return h(this,(function(r){return[2,n.path.extname(t.src).includes(".json")&&!!e.frames]}))}))},parse:function(e,t,s){var i,o;return l(this,void 0,Promise,(function(){var a,u,c,l,f,A,d,p,v,m,g,b;return h(this,(function(h){switch(h.label){case 0:return(a=n.path.dirname(t.src))&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),u=a+e.meta.image,[4,s.load([u])];case 1:return c=h.sent(),l=c[u],[4,(f=new r.Spritesheet(l.baseTexture,e,t.src)).parse()];case 2:if(h.sent(),A=null===(i=null==e?void 0:e.meta)||void 0===i?void 0:i.related_multi_packs,!Array.isArray(A))return[3,4];for(d=[],p=0,v=A;p<v.length;p++)"string"==typeof(m=v[p])&&(g=a+m,(null===(o=t.data)||void 0===o?void 0:o.ignoreMultiPack)||d.push(s.load({src:g,data:{ignoreMultiPack:!0}})));return[4,Promise.all(d)];case 3:b=h.sent(),f.linkedSheets=b,b.forEach((function(e){e.linkedSheets=[f].concat(f.linkedSheets.filter((function(t){return t!==e})))})),h.label=4;case 4:return[2,f]}}))}))},unload:function(e){e.destroy(!0)}},j={extension:t.ExtensionType.LoadParser,test:function(e){return n.path.extname(e).includes(".txt")},load:function(e){return l(this,void 0,Promise,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().text()];case 2:return[2,t.sent()]}}))}))}},F=["normal","bold","100","200","300","400","500","600","700","800","900"],W=["woff","woff2","ttf","otf"];function C(e){var t=n.path.extname(e);return n.path.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" ")}var D={extension:t.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return W.includes(t)},load:function(e,t){var r,n,s,i,o,a;return l(this,void 0,Promise,(function(){var u,l,f,A,d,p,v;return h(this,(function(h){switch(h.label){case 0:if(!window.navigator.onLine)throw new Error("[loadWebFont] Cannot load font - navigator is offline");if(!("FontFace"in window))return[3,5];u=[],l=null!==(n=null===(r=t.data)||void 0===r?void 0:r.family)&&void 0!==n?n:C(e),f=null!==(o=null===(i=null===(s=t.data)||void 0===s?void 0:s.weights)||void 0===i?void 0:i.filter((function(e){return F.includes(e)})))&&void 0!==o?o:["normal"],A=null!==(a=t.data)&&void 0!==a?a:{},d=0,h.label=1;case 1:return d<f.length?(p=f[d],[4,(v=new FontFace(l,"url("+e+")",c(c({},A),{weight:p}))).load()]):[3,4];case 2:h.sent(),document.fonts.add(v),u.push(v),h.label=3;case 3:return d++,[3,1];case 4:return[2,1===u.length?u[0]:u];case 5:return[2,null]}}))}))},unload:function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return document.fonts.delete(e)}))}};function G(e,t){var r=e.split("?")[0],s=n.path.extname(r).toLowerCase();return Array.isArray(t)?t.includes(s.toLowerCase()):s.toLowerCase()===t}function S(e,r,n){var s=new t.Texture(e);return s.baseTexture.on("dispose",(function(){delete r.promiseCache[n]})),s}var X,U,H={extension:t.ExtensionType.LoadParser,test:function(e){return G(e,".basis")},load:function(e,r,n){return l(this,void 0,Promise,(function(){var o,l,f,A,d;return h(this,(function(h){switch(h.label){case 0:return[4,i.TranscoderWorker.onTranscoderInitialized];case 1:return h.sent(),[4,s.settings.ADAPTER.fetch(e)];case 2:return[4,h.sent().arrayBuffer()];case 3:return o=h.sent(),[4,i.BasisParser.transcode(o)];case 4:return l=h.sent(),f=i.BASIS_FORMAT_TO_TYPE[l.basisFormat],A=l.basisFormat!==i.BASIS_FORMATS.cTFRGBA32?u.FORMATS.RGB:u.FORMATS.RGBA,[2,1===(d=l.map((function(s){return S(new t.BaseTexture(s,c({mipmap:s instanceof a.CompressedTextureResource&&s.levels>1?u.MIPMAP_MODES.ON_MANUAL:u.MIPMAP_MODES.OFF,alphaMode:u.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:f,format:A},r.data)),n,e)}))).length?d[0]:d]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},Q={extension:t.ExtensionType.LoadParser,test:function(e){return G(e,".dds")},load:function(e,r,i){return l(this,void 0,Promise,(function(){var o,l,f;return h(this,(function(h){switch(h.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[4,h.sent().arrayBuffer()];case 2:return o=h.sent(),l=a.parseDDS(o),[2,1===(f=l.map((function(s){return S(new t.BaseTexture(s,c({mipmap:u.MIPMAP_MODES.OFF,alphaMode:u.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:n.getResolutionOfUrl(e)},r.data)),i,e)}))).length?f[0]:f]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},N={extension:t.ExtensionType.LoadParser,test:function(e){return G(e,".ktx")},load:function(e,r,i){return l(this,void 0,Promise,(function(){var o,l,f,A,d,p,v,m;return h(this,(function(h){switch(h.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[4,h.sent().arrayBuffer()];case 2:return o=h.sent(),l=a.parseKTX(e,o),f=l.compressed,A=l.uncompressed,d=l.kvData,p=null!=f?f:A,v=c({mipmap:u.MIPMAP_MODES.OFF,alphaMode:u.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:n.getResolutionOfUrl(e)},r.data),[2,1===(m=p.map((function(r){p===A&&Object.assign(v,{type:r.type,format:r.format});var n=new t.BaseTexture(r,v);return n.ktxKeyValueData=d,S(n,i,e)}))).length?m[0]:m]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},Y=0,z="\n self.onmessage = function(event) {\n\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap;\n }\n\n loadImageBitmap(event.data.data[0]).then(imageBitmap => {\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }).catch(error => {\n self.postMessage({\n data: null,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n });\n }",K=new(function(){function e(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return e.prototype.loadImageBitmap=function(e){return this._run("loadImageBitmap",[e])},e.prototype._initWorkers=function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){return this._initialized||(this._initialized=!0),[2]}))}))},e.prototype.getWorker=function(){var e=this;void 0===X&&(X=navigator.hardwareConcurrency||4);var t=this.workerPool.pop();return!t&&this._createdWorkers<X&&(U||(U=URL.createObjectURL(new Blob([z],{type:"application/javascript"}))),this._createdWorkers++,(t=new Worker(U)).addEventListener("message",(function(t){e.complete(t.data),e.returnWorker(t.target),e.next()}))),t},e.prototype.returnWorker=function(e){this.workerPool.push(e)},e.prototype.complete=function(e){var t=e.data;this.resolveHash[e.uuid](t),this.resolveHash[e.uuid]=null},e.prototype._run=function(e,t){var r=this;this._initWorkers();var n=new Promise((function(n){r.queue.push({id:e,arguments:t,resolve:n})}));return this.next(),n},e.prototype.next=function(){if(this.queue.length){var e=this.getWorker();if(e){var t=this.queue.pop(),r=t.id;this.resolveHash[Y]=t.resolve,e.postMessage({data:t.arguments,uuid:Y++,id:r})}}},e}()),Z=[".jpg",".png",".jpeg",".avif",".webp"];function V(e){return l(this,void 0,Promise,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[4,r.sent().blob()];case 2:return t=r.sent(),[4,createImageBitmap(t)];case 3:return[2,r.sent()]}}))}))}var q={extension:t.ExtensionType.LoadParser,config:{preferWorkers:!0},test:function(e){for(var t=!1,r=0;r<Z.length;r++)if(0===e.indexOf("data:image/"+Z[r].slice(1))){t=!0;break}return t||G(e,Z)},load:function(e,r,s){return l(this,void 0,Promise,(function(){var i,o,a;return h(this,(function(u){switch(u.label){case 0:return i=null,window.createImageBitmap?this.config.preferWorkers?[4,K.loadImageBitmap(e)]:[3,2]:[3,5];case 1:return o=u.sent(),[3,4];case 2:return[4,V(e)];case 3:o=u.sent(),u.label=4;case 4:return i=o,[3,7];case 5:return[4,new Promise((function(t){(i=new Image).crossOrigin="anonymous",i.src=e,i.complete?t(i):i.onload=function(){t(i)}}))];case 6:i=u.sent(),u.label=7;case 7:return(a=new t.BaseTexture(i,c({resolution:n.getResolutionOfUrl(e)},r.data))).resource.src=e,[2,S(a,s,e)]}}))}))},unload:function(e){e.destroy(!0)}},J={extension:t.ExtensionType.LoadParser,test:function(e){return n.path.extname(e).includes(".svg")},testParse:function(e){return l(this,void 0,Promise,(function(){return h(this,(function(r){return[2,t.SVGResource.test(e)]}))}))},parse:function(e,r,s){var i,o,a;return l(this,void 0,Promise,(function(){var u,l,f;return h(this,(function(h){switch(h.label){case 0:return u=new t.SVGResource(e,null===(i=null==r?void 0:r.data)||void 0===i?void 0:i.resourceOptions),(l=new t.BaseTexture(u,c({resolution:n.getResolutionOfUrl(e)},null==r?void 0:r.data))).resource.src=e,f=S(l,s,e),(null===(a=null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.resourceOptions)||void 0===a?void 0:a.autoLoad)?[3,2]:[4,u.load()];case 1:h.sent(),h.label=2;case 2:return[2,f]}}))}))},load:function(e,t){return l(this,void 0,Promise,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,s.settings.ADAPTER.fetch(e)];case 1:return[2,t.sent().text()]}}))}))},unload:q.unload},$=function(){function e(){this._parsers=[],this.promiseCache={}}return e.prototype.reset=function(){this.promiseCache={}},e.prototype._getLoadPromiseAndParser=function(e,t){var r=this,n={promise:null,parser:null};return n.promise=l(r,void 0,void 0,(function(){var r,s,i,o,a,u;return h(this,(function(c){switch(c.label){case 0:r=null,s=0,c.label=1;case 1:return s<this.parsers.length?(i=this.parsers[s]).load&&(null===(a=i.test)||void 0===a?void 0:a.call(i,e,t,this))?[4,i.load(e,t,this)]:[3,3]:[3,4];case 2:return r=c.sent(),n.parser=i,[3,4];case 3:return s++,[3,1];case 4:if(!n.parser)return[2,null];s=0,c.label=5;case 5:return s<this.parsers.length?(i=this.parsers[s]).parse?(o=i.parse)?[4,null===(u=i.testParse)||void 0===u?void 0:u.call(i,r,t,this)]:[3,7]:[3,9]:[3,10];case 6:o=c.sent(),c.label=7;case 7:return o?[4,i.parse(r,t,this)]:[3,9];case 8:r=c.sent()||r,n.parser=i,c.label=9;case 9:return s++,[3,5];case 10:return[2,r]}}))})),n},e.prototype.load=function(e,t){return l(this,void 0,Promise,(function(){var r,s,i,o,a,u,c=this;return h(this,(function(f){switch(f.label){case 0:return r=0,s={},i=v(e),o=A(e,(function(e){return{src:e}})),a=o.length,u=o.map((function(e){return l(c,void 0,void 0,(function(){var i,o,u,c;return h(this,(function(l){switch(l.label){case 0:if(i=n.path.toAbsolute(e.src),s[e.src])return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),this.promiseCache[i]||(this.promiseCache[i]=this._getLoadPromiseAndParser(i,e)),o=s,u=e.src,[4,this.promiseCache[i].promise];case 2:return o[u]=l.sent(),t&&t(++r/a),[3,4];case 3:throw c=l.sent(),delete this.promiseCache[i],delete s[e.src],new Error("[Loader.load] Failed to load "+i+".\n"+c);case 4:return[2]}}))}))})),[4,Promise.all(u)];case 1:return f.sent(),[2,i?s[o[0].src]:s]}}))}))},e.prototype.unload=function(e){return l(this,void 0,Promise,(function(){var t,r,s=this;return h(this,(function(i){switch(i.label){case 0:return t=A(e,(function(e){return{src:e}})),r=t.map((function(e){return l(s,void 0,void 0,(function(){var t,r,s,i,o;return h(this,(function(a){switch(a.label){case 0:return t=n.path.toAbsolute(e.src),(r=this.promiseCache[t])?[4,r.promise]:[3,2];case 1:s=a.sent(),null===(o=null===(i=r.parser)||void 0===i?void 0:i.unload)||void 0===o||o.call(i,s,e,this),delete this.promiseCache[t],a.label=2;case 2:return[2]}}))}))})),[4,Promise.all(r)];case 1:return i.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}(),ee=["jpg","png","jpeg","avif","webp"],te={extension:t.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split("."),r=t.pop(),n=t.pop();return"json"===r&&ee.includes(n)},parse:function(e){var t,r,n=e.split(".");return{resolution:parseFloat(null!==(r=null===(t=s.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:n[n.length-2],src:e}}},re={extension:t.ExtensionType.ResolveParser,test:q.test,parse:function(e){var t,r;return{resolution:parseFloat(null!==(r=null===(t=s.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:e.split(".").pop(),src:e}}},ne={extension:t.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:function(e){var t,r,n,i;if("ktx"===e.split("?")[0].split(".").pop()){var o=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(o.some((function(t){return e.endsWith(t)})))return{resolution:parseFloat(null!==(r=null===(t=s.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:o.find((function(t){return e.endsWith(t)})),src:e}}return{resolution:parseFloat(null!==(i=null===(n=s.settings.RETINA_PREFIX.exec(e))||void 0===n?void 0:n[1])&&void 0!==i?i:"1"),format:e.split(".").pop(),src:e}}},se=function(){function e(){this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}return e.prototype.prefer=function(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];r.forEach((function(e){t._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))})),this._resolverHash={}},Object.defineProperty(e.prototype,"basePath",{get:function(){return this._basePath},set:function(e){this._basePath=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootPath",{get:function(){return this._rootPath},set:function(e){this._rootPath=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._preferredOrder=[],this._resolverHash={},this._assetMap={},this._rootPath=null,this._basePath=null,this._manifest=null},e.prototype.addManifest=function(e){var t=this;this._manifest,this._manifest=e,e.bundles.forEach((function(e){t.addBundle(e.name,e.assets)}))},e.prototype.addBundle=function(e,t){var r=this,n=[];Array.isArray(t)?t.forEach((function(e){"string"==typeof e.name?n.push(e.name):n.push.apply(n,e.name),r.add(e.name,e.srcs)})):Object.keys(t).forEach((function(e){n.push(e),r.add(e,t[e])})),this._bundles[e]=n},e.prototype.add=function(e,t,r){var s=this,i=A(e);i.forEach((function(e){s._assetMap[e]})),Array.isArray(t)||(t="string"==typeof t?p(t):[t]);var o=t.map((function(e){var t,o=e;if("string"==typeof e){for(var a=!1,u=0;u<s._parsers.length;u++){var c=s._parsers[u];if(c.test(e)){o=c.parse(e),a=!0;break}}a||(o={src:e})}return o.format||(o.format=o.src.split(".").pop()),o.alias||(o.alias=i),(s._basePath||s._rootPath)&&(o.src=n.path.toAbsolute(o.src,s._basePath,s._rootPath)),o.data=null!==(t=o.data)&&void 0!==t?t:r,o}));i.forEach((function(e){s._assetMap[e]=o}))},e.prototype.resolveBundle=function(e){var t=this,r=v(e);e=A(e);var n={};return e.forEach((function(e){var r=t._bundles[e];r&&(n[e]=t.resolve(r))})),r?n[e[0]]:n},e.prototype.resolveUrl=function(e){var t=this.resolve(e);if("string"!=typeof e){var r={};for(var n in t)r[n]=t[n].src;return r}return t.src},e.prototype.resolve=function(e){var t=this,r=v(e);e=A(e);var s={};return e.forEach((function(e){var r;if(!t._resolverHash[e])if(t._assetMap[e]){var i=t._assetMap[e],o=t._getPreferredOrder(i),a=i[0];null==o||o.priority.forEach((function(e){o.params[e].forEach((function(t){var r=i.filter((function(r){return!!r[e]&&r[e]===t}));r.length&&(i=r)}))})),t._resolverHash[e]=null!==(r=i[0])&&void 0!==r?r:a}else{var u=e;(t._basePath||t._rootPath)&&(u=n.path.toAbsolute(u,t._basePath,t._rootPath)),t._resolverHash[e]={src:u}}s[e]=t._resolverHash[e]})),r?s[e[0]]:s},e.prototype._getPreferredOrder=function(e){for(var t=function(t){var n=e[0],s=r._preferredOrder.find((function(e){return e.params.format.includes(n.format)}));if(s)return{value:s}},r=this,n=0;n<e.length;n++){var s=t();if("object"==typeof s)return s.value}return this._preferredOrder[0]},e}(),ie=function(){function e(){this._detections=[],this._initialized=!1,this.resolver=new se,this.loader=new $,this.cache=m,this._backgroundLoader=new f(this.loader),this._backgroundLoader.active=!0,this.reset()}return e.prototype.init=function(e){var t,r,n,s;return void 0===e&&(e={}),l(this,void 0,Promise,(function(){var i,o,a,u,c,l,f,A,d,p;return h(this,(function(h){switch(h.label){case 0:return this._initialized?[2]:(this._initialized=!0,e.basePath&&(this.resolver.basePath=e.basePath),e.manifest?"string"!=typeof(i=e.manifest)?[3,2]:[4,this.load(i)]:[3,3]);case 1:i=h.sent(),h.label=2;case 2:this.resolver.addManifest(i),h.label=3;case 3:if(o=null!==(r=null===(t=e.texturePreference)||void 0===t?void 0:t.resolution)&&void 0!==r?r:1,a="number"==typeof o?[o]:o,!(null===(n=e.texturePreference)||void 0===n?void 0:n.format))return[3,9];c=null===(s=e.texturePreference)||void 0===s?void 0:s.format,u="string"==typeof c?[c]:c,l=0,f=this._detections,h.label=4;case 4:return l<f.length?[4,(p=f[l]).test()]:[3,8];case 5:return h.sent()?[3,7]:[4,p.remove(u)];case 6:u=h.sent(),h.label=7;case 7:return l++,[3,4];case 8:return[3,14];case 9:u=["png","jpg","jpeg"],A=0,d=this._detections,h.label=10;case 10:return A<d.length?[4,(p=d[A]).test()]:[3,14];case 11:return h.sent()?[4,p.add(u)]:[3,13];case 12:u=h.sent(),h.label=13;case 13:return A++,[3,10];case 14:return this.resolver.prefer({params:{format:u,resolution:a}}),[2]}}))}))},e.prototype.add=function(e,t,r){this.resolver.add(e,t,r)},e.prototype.load=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i,o=this;return h(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 r=v(e),n=A(e).map((function(e){return"string"!=typeof e?(o.resolver.add(e.src,e),e.src):e})),s=this.resolver.resolve(n),[4,this._mapLoadToResolve(s,t)];case 3:return i=a.sent(),[2,r?i[n[0]]:i]}}))}))},e.prototype.addBundle=function(e,t){this.resolver.addBundle(e,t)},e.prototype.loadBundle=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i,o,a,u,c,l=this;return h(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 r=!1,"string"==typeof e&&(r=!0,e=[e]),n=this.resolver.resolveBundle(e),s={},i=Object.keys(n),o=0,a=0,u=function(){null==t||t(++o/a)},c=i.map((function(e){var t=n[e];return a+=Object.keys(t).length,l._mapLoadToResolve(t,u).then((function(t){s[e]=t}))})),[4,Promise.all(c)];case 3:return h.sent(),[2,r?s[e[0]]:s]}}))}))},e.prototype.backgroundLoad=function(e){return l(this,void 0,Promise,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:r.sent(),r.label=2;case 2:return"string"==typeof e&&(e=[e]),t=this.resolver.resolve(e),this._backgroundLoader.add(Object.values(t)),[2]}}))}))},e.prototype.backgroundLoadBundle=function(e){return l(this,void 0,Promise,(function(){var t,r=this;return h(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"string"==typeof e&&(e=[e]),t=this.resolver.resolveBundle(e),Object.values(t).forEach((function(e){r._backgroundLoader.add(Object.values(e))})),[2]}}))}))},e.prototype.reset=function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1},e.prototype.get=function(e){if("string"==typeof e)return m.get(e);for(var t={},r=0;r<e.length;r++)t[r]=m.get(e[r]);return t},e.prototype._mapLoadToResolve=function(e,t){return l(this,void 0,Promise,(function(){var r,n,s,i;return h(this,(function(o){switch(o.label){case 0:return r=Object.values(e),n=Object.keys(e),this._backgroundLoader.active=!1,[4,this.loader.load(r,t)];case 1:return s=o.sent(),this._backgroundLoader.active=!0,i={},r.forEach((function(e,t){var r=s[e.src],o=[e.src];e.alias&&o.push.apply(o,e.alias),i[n[t]]=r,m.set(o,r)})),[2,i]}}))}))},e.prototype.unload=function(e){return l(this,void 0,Promise,(function(){var t,r;return h(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 t=A(e).map((function(e){return"string"!=typeof e?e.src:e})),r=this.resolver.resolve(t),[4,this._unloadFromResolved(r)];case 3:return n.sent(),[2]}}))}))},e.prototype.unloadBundle=function(e){return l(this,void 0,Promise,(function(){var t,r,n=this;return h(this,(function(s){switch(s.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:s.sent(),s.label=2;case 2:return e=A(e),t=this.resolver.resolveBundle(e),r=Object.keys(t).map((function(e){return n._unloadFromResolved(t[e])})),[4,Promise.all(r)];case 3:return s.sent(),[2]}}))}))},e.prototype._unloadFromResolved=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return(t=Object.values(e)).forEach((function(e){m.remove(e.src)})),[4,this.loader.unload(t)];case 1:return r.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"detections",{get:function(){return this._detections},enumerable:!1,configurable:!0}),e}(),oe=new ie;return t.extensions.handleByList(t.ExtensionType.LoadParser,oe.loader.parsers).handleByList(t.ExtensionType.ResolveParser,oe.resolver.parsers).handleByList(t.ExtensionType.CacheParser,oe.cache.parsers).handleByList(t.ExtensionType.DetectionParser,oe.detections),t.extensions.add(q,J,j,M,R,O,D,b,y,re,te,I,B),e.Assets=oe,e.AssetsClass=ie,e.Cache=m,e.addFormats=_,e.cacheSpritesheet=b,e.cacheTextureArray=y,e.convertToList=A,e.createStringVariations=p,e.detectAvif=B,e.detectBasis=L,e.detectCompressedTextures=T,e.detectWebp=I,e.getFontFamilyName=C,e.isSingleItem=v,e.loadBasis=H,e.loadBitmapFont=O,e.loadDDS=Q,e.loadImageBitmap=V,e.loadJson=M,e.loadKTX=N,e.loadSVG=J,e.loadSpritesheet=R,e.loadTextures=q,e.loadTxt=j,e.loadWebFont=D,e.removeFormats=P,e.resolveCompressedTextureUrl=ne,e.resolveSpriteSheetUrl=te,e.resolveTextureUrl=re,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_assets); | ||
//# sourceMappingURL=assets.min.js.map |
/*! | ||
* @pixi/assets - v6.5.1 | ||
* Compiled Sun, 24 Jul 2022 20:56:21 UTC | ||
* @pixi/assets - v6.5.2 | ||
* Compiled Wed, 24 Aug 2022 13:51:19 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/assets is licensed under the MIT License. | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pixi/core"),t=require("@pixi/settings"),r=require("@pixi/spritesheet"),n=require("@pixi/basis"),s=require("@pixi/text-bitmap"),i=require("@pixi/utils"),o=require("@pixi/constants"),a=require("@pixi/compressed-textures"),u=function(){return u=Object.assign||function(e){for(var t,r=arguments,n=1,s=arguments.length;n<s;n++)for(var i in t=r[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var p=function(){function e(e,t){void 0===t&&(t=!1),this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}return e.prototype.add=function(e){var t=this;e.forEach((function(e){t._assetList.push(e)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()},e.prototype._next=function(){return c(this,void 0,Promise,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:if(!this._assetList.length||!this._isActive)return[3,2];for(this._isLoading=!0,e=[],t=Math.min(this._assetList.length,this._maxConcurrent),r=0;r<t;r++)e.push(this._assetList.pop());return[4,this._loader.load(e)];case 1:n.sent(),this._isLoading=!1,this._next(),n.label=2;case 2:return[2]}}))}))},Object.defineProperty(e.prototype,"active",{get:function(){return this._isActive},set:function(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())},enumerable:!1,configurable:!0}),e}();var f,h=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;function A(e){return h.exec(e).slice(1)}function d(e,t){var r=A(e)[2];return t&&r.substring(-1*t.length)===t&&(r=r.substring(0,r.length-t.length)),r}function v(e){return A(e)[3]}function m(){for(var e=arguments,t=[],r=0;r<arguments.length;r++)t[r]=e[r];for(var n="",s=0;s<t.length;s++){var i=t[s];i&&(n+=n?"/"+i:i)}return b(n)}function g(e){var t=A(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substring(0,n.length-1)),r+n):"."}function b(e){var t=function(e){return"/"===e.charAt(0)}(e),r=e&&"/"===e[e.length-1];return(e=function(e,t){for(var r=[],n=0;n<e.length;n++){var s=e[n];s&&"."!==s&&(".."===s?r.length&&".."!==r[r.length-1]?r.pop():t&&r.push(".."):r.push(s))}return r}(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function x(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(/^[^/:]+:\/*$/.exec(e[0])&&e.length>1){var r=e.shift();e[0]=r+e[0]}/^file:\/\/\//.exec(e[0])?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var s=e[n];if("string"!=typeof s)throw new TypeError("Url must be a string. Received "+s);""!==s&&(n>0&&(s=s.replace(/^[/]+/,"")),s=n<e.length-1?s.replace(/[/]+$/,""):s.replace(/[/]+$/,"/"),t.push(s))}var i=t.join("/"),o=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=o.shift()+(o.length>0?"?":"")+o.join("&")}function y(){for(var e=arguments,t=[],r=0;r<arguments.length;r++)t[r]=e[r];return x("object"==typeof t[0]?t[0]:[].slice.call(t))}function _(e){return!/^[a-zA-Z]:\\/.test(e)&&/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)}function P(e){return new RegExp(/^.*\//).exec(e.split("?")[0])[0].replace(new RegExp(/#\/|#/),"")}function E(e,r){f||(f=P(t.settings.ADAPTER.getBaseUrl()));var n=void 0!==r?P(r):f;return _(e)?e:y(n,e)}var B=function(e,t){return Array.isArray(e)||(e=[e]),t?e.map((function(e){return"string"==typeof e?t(e):e})):e};function w(e,t,r,n,s){for(var i=t[r],o=0;o<i.length;o++){var a=i[o];r<t.length-1?w(e.replace(n[r],a),t,r+1,n,s):s.push(e.replace(n[r],a))}}function T(e){var t=e.match(/\{(.*?)\}/g),r=[];if(t){var n=[];t.forEach((function(e){var t=e.substring(1,e.length-1).split(",");n.push(t)})),w(e,n,0,t,r)}else r.push(e);return r}var L=function(e){return!Array.isArray(e)},k=new(function(){function t(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return t.prototype.reset=function(){this._cacheMap.clear(),this._cache.clear()},t.prototype.has=function(e){return this._cache.has(e)},t.prototype.get=function(e){return this._cache.get(e)},t.prototype.set=function(t,r){for(var n,s=this,i=B(t),o=0;o<this.parsers.length;o++){var a=this.parsers[o];if(a.test(r)){n=a.getCacheableAssets(i,r);break}}n||(n={},i.forEach((function(e){n[e]=r})));var u=Object.keys(n),c={cacheKeys:u,keys:i};if(i.forEach((function(e){s._cacheMap.set(e,c)})),u.forEach((function(e){s._cache.has(e)&&s._cache.get(e),s._cache.set(e,n[e])})),r instanceof e.Texture){var l=r;i.forEach((function(t){l.baseTexture!==e.Texture.EMPTY.baseTexture&&e.BaseTexture.addToCache(l.baseTexture,t),e.Texture.addToCache(l,t)}))}},t.prototype.remove=function(e){var t=this;if(this._cacheMap.get(e),this._cacheMap.has(e)){var r=this._cacheMap.get(e);r.cacheKeys.forEach((function(e){t._cache.delete(e)})),r.keys.forEach((function(e){t._cacheMap.delete(e)}))}},Object.defineProperty(t.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),t}());function M(e,t,r){var n={};if(e.forEach((function(e){n[e]=t})),Object.keys(t.textures).forEach((function(e){n[e]=t.textures[e]})),!r){var s=g(e[0]);t.linkedSheets.forEach((function(e,r){var i=M([s+"/"+t.data.meta.related_multi_packs[r]],e,!0);Object.assign(n,i)}))}return n}var O={extension:e.ExtensionType.CacheParser,test:function(e){return e instanceof r.Spritesheet},getCacheableAssets:function(e,t){return M(e,t,!1)}},R={extension:e.ExtensionType.CacheParser,test:function(t){return Array.isArray(t)&&t.every((function(t){return t instanceof e.Texture}))},getCacheableAssets:function(e,t){var r={};return e.forEach((function(e){t.forEach((function(t,n){r[e+(0===n?"":n+1)]=t}))})),r}};function j(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return c(t,void 0,void 0,(function(){return l(this,(function(t){return e.unshift.apply(e,r),[2,e]}))}))}}function F(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return c(t,void 0,void 0,(function(){var t,n,s,i;return l(this,(function(o){for(t=0,n=r;t<n.length;t++)s=n[t],-1!==(i=e.indexOf(s))&&e.splice(i,1);return[2,e]}))}))}}var I,C,W={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e;return l(this,(function(r){switch(r.label){case 0:return globalThis.createImageBitmap?("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",[4,t.settings.ADAPTER.fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=r.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:j("avif"),remove:F("avif")};function D(){C={s3tc:I.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:I.getExtension("WEBGL_compressed_texture_s3tc_srgb"),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"),astc:I.getExtension("WEBGL_compressed_texture_astc")}}var S={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e,r;return l(this,(function(n){return e=t.settings.ADAPTER.createCanvas(),(r=e.getContext("webgl"))?(I=r,[2,!0]):[2,!1]}))}))},add:function(e){return c(void 0,void 0,Promise,(function(){var t,r;return l(this,(function(n){for(r in C||D(),t=[],C)C[r]&&t.push(r);return e.unshift.apply(e,t),[2,e]}))}))},remove:function(e){return c(void 0,void 0,Promise,(function(){return l(this,(function(t){return C||D(),[2,e.filter((function(e){return!(e in C)}))]}))}))}},G={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){return l(this,(function(e){return[2,!(!n.BasisParser.basisBinding||!n.BasisParser.TranscoderWorker.wasmSource)]}))}))},add:j("basis"),remove:F("basis")},U={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e;return l(this,(function(r){switch(r.label){case 0:return globalThis.createImageBitmap?("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",[4,t.settings.ADAPTER.fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=r.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:j("webp"),remove:F("webp")};function H(e,t,r){return c(this,void 0,Promise,(function(){var n,i,o,a,u,c,p,f;return l(this,(function(l){switch(l.label){case 0:for(n=t.page,i=[],o=0;o<n.length;++o)a=n[o].file,u=m(g(e),a),i.push(u);return f=(p=Object).values,[4,r.load(i)];case 1:return c=f.apply(p,[l.sent()]),[2,s.BitmapFont.install(t,c,!0)]}}))}))}var X,Q,z=[".xml",".fnt"],N={extension:e.ExtensionType.LoadParser,test:function(e){return z.includes(v(e))},testParse:function(e){return c(this,void 0,Promise,(function(){var t,r;return l(this,(function(n){return t=s.TextFormat.test(e),r=s.XMLStringFormat.test(e),[2,t||r]}))}))},parse:function(e,t,r){return c(this,void 0,Promise,(function(){var n;return l(this,(function(i){switch(i.label){case 0:return s.TextFormat.test(e)?(n=s.TextFormat.parse(e),[4,H(t.src,n,r)]):[3,2];case 1:case 3:return[2,i.sent()];case 2:return[4,H(t.src,s.XMLStringFormat.parse(e),r)]}}))}))},load:function(e,r,n){return c(this,void 0,Promise,(function(){var r,i;return l(this,(function(o){switch(o.label){case 0:return[4,t.settings.ADAPTER.fetch(e)];case 1:return[4,o.sent().text()];case 2:return r=o.sent(),i=(new window.DOMParser).parseFromString(r,"text/xml"),[4,H(e,s.XMLFormat.parse(i),n)];case 3:return[2,o.sent()]}}))}))},unload:function(e){e.destroy()}},Y={extension:e.ExtensionType.LoadParser,test:function(e){return v(e).includes(".json")},load:function(e){return c(this,void 0,Promise,(function(){return l(this,(function(r){switch(r.label){case 0:return[4,t.settings.ADAPTER.fetch(e)];case 1:return[4,r.sent().json()];case 2:return[2,r.sent()]}}))}))}},Z={extension:e.ExtensionType.LoadParser,testParse:function(e,t){return c(this,void 0,Promise,(function(){return l(this,(function(r){return[2,v(t.src).includes(".json")&&!!e.frames]}))}))},parse:function(e,t,n){var s,i;return c(this,void 0,Promise,(function(){var o,a,u,c,p,f,h,A,d,v,m,b;return l(this,(function(l){switch(l.label){case 0:return(o=g(t.src))&&o.lastIndexOf("/")!==o.length-1&&(o+="/"),a=o+e.meta.image,[4,n.load([a])];case 1:return u=l.sent(),c=u[a],[4,(p=new r.Spritesheet(c.baseTexture,e,t.src)).parse()];case 2:if(l.sent(),f=null===(s=null==e?void 0:e.meta)||void 0===s?void 0:s.related_multi_packs,!Array.isArray(f))return[3,4];for(h=[],A=0,d=f;A<d.length;A++)"string"==typeof(v=d[A])&&(m=o+v,(null===(i=t.data)||void 0===i?void 0:i.ignoreMultiPack)||h.push(n.load({src:m,data:{ignoreMultiPack:!0}})));return[4,Promise.all(h)];case 3:b=l.sent(),p.linkedSheets=b,b.forEach((function(e){e.linkedSheets=[p].concat(p.linkedSheets.filter((function(t){return t!==e})))})),l.label=4;case 4:return[2,p]}}))}))},unload:function(e){e.destroy(!0)}},q=0,K="\n self.onmessage = function(event) {\n\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap;\n }\n\n loadImageBitmap(event.data.data[0]).then(imageBitmap => {\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }).catch(error => {\n self.postMessage({\n data: null,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n });\n }",V=new(function(){function e(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return e.prototype.loadImageBitmap=function(e){return this._run("loadImageBitmap",[e])},e.prototype._initWorkers=function(){return c(this,void 0,void 0,(function(){return l(this,(function(e){return this._initialized||(this._initialized=!0),[2]}))}))},e.prototype.getWorker=function(){var e=this;void 0===X&&(X=navigator.hardwareConcurrency||4);var t=this.workerPool.pop();return!t&&this._createdWorkers<X&&(Q||(Q=URL.createObjectURL(new Blob([K],{type:"application/javascript"}))),this._createdWorkers++,(t=new Worker(Q)).addEventListener("message",(function(t){e.complete(t.data),e.returnWorker(t.target),e.next()}))),t},e.prototype.returnWorker=function(e){this.workerPool.push(e)},e.prototype.complete=function(e){var t=e.data;this.resolveHash[e.uuid](t),this.resolveHash[e.uuid]=null},e.prototype._run=function(e,t){var r=this;this._initWorkers();var n=new Promise((function(n){r.queue.push({id:e,arguments:t,resolve:n})}));return this.next(),n},e.prototype.next=function(){if(this.queue.length){var e=this.getWorker();if(e){var t=this.queue.pop(),r=t.id;this.resolveHash[q]=t.resolve,e.postMessage({data:t.arguments,uuid:q++,id:r})}}},e}()),$=["jpg","png","jpeg","avif","webp"];function J(e){return c(this,void 0,Promise,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return[4,t.settings.ADAPTER.fetch(e)];case 1:return[4,n.sent().blob()];case 2:return r=n.sent(),[4,createImageBitmap(r)];case 3:return[2,n.sent()]}}))}))}var ee={extension:e.ExtensionType.LoadParser,config:{preferWorkers:!0},test:function(e){var t=e.split("?")[0].split(".").pop();return $.includes(t)},load:function(t,r,n){return c(this,void 0,Promise,(function(){var s,o,a,c;return l(this,(function(l){switch(l.label){case 0:return s=null,window.createImageBitmap?this.config.preferWorkers?[4,V.loadImageBitmap(t)]:[3,2]:[3,5];case 1:return o=l.sent(),[3,4];case 2:return[4,J(t)];case 3:o=l.sent(),l.label=4;case 4:return s=o,[3,7];case 5:return[4,new Promise((function(e){(s=new Image).crossOrigin="anonymous",s.src=t,s.complete?e(s):s.onload=function(){e(s)}}))];case 6:s=l.sent(),l.label=7;case 7:return(a=new e.BaseTexture(s,u({resolution:i.getResolutionOfUrl(t)},r.data))).resource.src=t,(c=new e.Texture(a)).baseTexture.on("dispose",(function(){delete n.promiseCache[t]})),[2,c]}}))}))},unload:function(e){e.destroy(!0)}},te={extension:e.ExtensionType.LoadParser,test:function(e){return v(e).includes(".txt")},load:function(e){return c(this,void 0,Promise,(function(){return l(this,(function(r){switch(r.label){case 0:return[4,t.settings.ADAPTER.fetch(e)];case 1:return[4,r.sent().text()];case 2:return[2,r.sent()]}}))}))}},re=["normal","bold","100","200","300","400","500","600","700","800","900"],ne=["woff","woff2","ttf","otf"];function se(e){return d(e,v(e)).replace(/(-|_)/g," ").toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" ")}var ie={extension:e.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return ne.includes(t)},load:function(e,t){var r,n,s,i,o,a;return c(this,void 0,Promise,(function(){var c,p,f,h,A,d,v;return l(this,(function(l){switch(l.label){case 0:if(!window.navigator.onLine)throw new Error("[loadWebFont] Cannot load font - navigator is offline");if(!("FontFace"in window))return[3,5];c=[],p=null!==(n=null===(r=t.data)||void 0===r?void 0:r.family)&&void 0!==n?n:se(e),f=null!==(o=null===(i=null===(s=t.data)||void 0===s?void 0:s.weights)||void 0===i?void 0:i.filter((function(e){return re.includes(e)})))&&void 0!==o?o:["normal"],h=null!==(a=t.data)&&void 0!==a?a:{},A=0,l.label=1;case 1:return A<f.length?(d=f[A],[4,(v=new FontFace(p,"url("+e+")",u(u({},h),{weight:d}))).load()]):[3,4];case 2:l.sent(),document.fonts.add(v),c.push(v),l.label=3;case 3:return A++,[3,1];case 4:return[2,1===c.length?c[0]:c];case 5:return[2,null]}}))}))},unload:function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return document.fonts.delete(e)}))}},oe=["basis"],ae={extension:e.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return oe.includes(t.toLowerCase())},load:function(r,s,i){return c(this,void 0,Promise,(function(){var c,p,f,h,A;return l(this,(function(l){switch(l.label){case 0:return[4,n.TranscoderWorker.onTranscoderInitialized];case 1:return l.sent(),[4,t.settings.ADAPTER.fetch(r)];case 2:return[4,l.sent().arrayBuffer()];case 3:return c=l.sent(),[4,n.BasisParser.transcode(c)];case 4:return p=l.sent(),f=n.BASIS_FORMAT_TO_TYPE[p.basisFormat],h=p.basisFormat!==n.BASIS_FORMATS.cTFRGBA32?o.FORMATS.RGB:o.FORMATS.RGBA,[2,1===(A=p.map((function(t){var n=new e.BaseTexture(t,u({mipmap:t instanceof a.CompressedTextureResource&&t.levels>1?o.MIPMAP_MODES.ON_MANUAL:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:f,format:h},s.data)),c=new e.Texture(n);return c.baseTexture.on("dispose",(function(){delete i.promiseCache[r]})),c}))).length?A[0]:A]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},ue=["dds"],ce={extension:e.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return ue.includes(t.toLowerCase())},load:function(r,n,s){return c(this,void 0,Promise,(function(){var c,p,f;return l(this,(function(l){switch(l.label){case 0:return[4,t.settings.ADAPTER.fetch(r)];case 1:return[4,l.sent().arrayBuffer()];case 2:return c=l.sent(),p=a.parseDDS(c),[2,1===(f=p.map((function(t){var a=new e.BaseTexture(t,u({mipmap:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:i.getResolutionOfUrl(r)},n.data)),c=new e.Texture(a);return c.baseTexture.on("dispose",(function(){delete s.promiseCache[r]})),c}))).length?f[0]:f]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},le=["ktx"],pe={extension:e.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return le.includes(t.toLowerCase())},load:function(r,n,s){return c(this,void 0,Promise,(function(){var c,p,f,h,A,d,v,m;return l(this,(function(l){switch(l.label){case 0:return[4,t.settings.ADAPTER.fetch(r)];case 1:return[4,l.sent().arrayBuffer()];case 2:return c=l.sent(),p=a.parseKTX(r,c),f=p.compressed,h=p.uncompressed,A=p.kvData,d=null!=f?f:h,v=u({mipmap:o.MIPMAP_MODES.OFF,alphaMode:o.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:i.getResolutionOfUrl(r)},n.data),[2,1===(m=d.map((function(t){d===h&&Object.assign(v,{type:t.type,format:t.format});var n=new e.BaseTexture(t,v);n.ktxKeyValueData=A;var i=new e.Texture(n);return i.baseTexture.on("dispose",(function(){delete s.promiseCache[r]})),i}))).length?m[0]:m]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},fe=function(){function e(){this._parsers=[],this.promiseCache={}}return e.prototype.reset=function(){this.promiseCache={}},e.prototype._getLoadPromiseAndParser=function(e,t){var r=this,n={promise:null,parser:null};return n.promise=c(r,void 0,void 0,(function(){var r,s,i,o,a,u;return l(this,(function(c){switch(c.label){case 0:r=null,s=0,c.label=1;case 1:return s<this.parsers.length?(i=this.parsers[s]).load&&(null===(a=i.test)||void 0===a?void 0:a.call(i,e,t,this))?[4,i.load(e,t,this)]:[3,3]:[3,4];case 2:return r=c.sent(),n.parser=i,[3,4];case 3:return s++,[3,1];case 4:if(!n.parser)return[2,null];s=0,c.label=5;case 5:return s<this.parsers.length?(i=this.parsers[s]).parse?(o=i.parse)?[4,null===(u=i.testParse)||void 0===u?void 0:u.call(i,r,t,this)]:[3,7]:[3,9]:[3,10];case 6:o=c.sent(),c.label=7;case 7:return o?[4,i.parse(r,t,this)]:[3,9];case 8:r=c.sent()||r,n.parser=i,c.label=9;case 9:return s++,[3,5];case 10:return[2,r]}}))})),n},e.prototype.load=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i,o,a,u=this;return l(this,(function(p){switch(p.label){case 0:return r=0,n={},s=L(e),i=B(e,(function(e){return{src:e}})),o=i.length,a=i.map((function(e){return c(u,void 0,void 0,(function(){var s,i,a,u;return l(this,(function(c){switch(c.label){case 0:if(s=E(e.src),n[e.src])return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),this.promiseCache[s]||(this.promiseCache[s]=this._getLoadPromiseAndParser(s,e)),i=n,a=e.src,[4,this.promiseCache[s].promise];case 2:return i[a]=c.sent(),t&&t(++r/o),[3,4];case 3:throw u=c.sent(),delete this.promiseCache[s],delete n[e.src],new Error("[Loader.load] Failed to load "+s+".\n"+u);case 4:return[2]}}))}))})),[4,Promise.all(a)];case 1:return p.sent(),[2,s?n[i[0].src]:n]}}))}))},e.prototype.unload=function(e){return c(this,void 0,Promise,(function(){var t,r,n=this;return l(this,(function(s){switch(s.label){case 0:return t=B(e,(function(e){return{src:e}})),r=t.map((function(e){return c(n,void 0,void 0,(function(){var t,r,n,s,i;return l(this,(function(o){switch(o.label){case 0:return t=E(e.src),(r=this.promiseCache[t])?[4,r.promise]:[3,2];case 1:n=o.sent(),null===(i=null===(s=r.parser)||void 0===s?void 0:s.unload)||void 0===i||i.call(s,n,e,this),delete this.promiseCache[t],o.label=2;case 2:return[2]}}))}))})),[4,Promise.all(r)];case 1:return s.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}(),he=["jpg","png","jpeg","avif","webp"],Ae={extension:e.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split("."),r=t.pop(),n=t.pop();return"json"===r&&he.includes(n)},parse:function(e){var r,n,s=e.split(".");return{resolution:parseFloat(null!==(n=null===(r=t.settings.RETINA_PREFIX.exec(e))||void 0===r?void 0:r[1])&&void 0!==n?n:"1"),format:s[s.length-2],src:e}}},de={extension:e.ExtensionType.ResolveParser,test:ee.test,parse:function(e){var r,n;return{resolution:parseFloat(null!==(n=null===(r=t.settings.RETINA_PREFIX.exec(e))||void 0===r?void 0:r[1])&&void 0!==n?n:"1"),format:e.split(".").pop(),src:e}}},ve={extension:e.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:function(e){var r,n,s,i;if("ktx"===e.split("?")[0].split(".").pop()){var o=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(o.some((function(t){return e.endsWith(t)})))return{resolution:parseFloat(null!==(n=null===(r=t.settings.RETINA_PREFIX.exec(e))||void 0===r?void 0:r[1])&&void 0!==n?n:"1"),format:o.find((function(t){return e.endsWith(t)})),src:e}}return{resolution:parseFloat(null!==(i=null===(s=t.settings.RETINA_PREFIX.exec(e))||void 0===s?void 0:s[1])&&void 0!==i?i:"1"),format:e.split(".").pop(),src:e}}},me=function(){function e(){this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}return e.prototype.prefer=function(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];r.forEach((function(e){t._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))})),this._resolverHash={}},Object.defineProperty(e.prototype,"basePath",{get:function(){return this._basePath},set:function(e){this._basePath=P(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._preferredOrder=[],this._resolverHash={},this._assetMap={},this._basePath=null,this._manifest=null},e.prototype.addManifest=function(e){var t=this;this._manifest,this._manifest=e,e.bundles.forEach((function(e){t.addBundle(e.name,e.assets)}))},e.prototype.addBundle=function(e,t){var r=this,n=[];Array.isArray(t)?t.forEach((function(e){"string"==typeof e.name?n.push(e.name):n.push.apply(n,e.name),r.add(e.name,e.srcs)})):Object.keys(t).forEach((function(e){n.push(e),r.add(e,t[e])})),this._bundles[e]=n},e.prototype.add=function(e,t,r){var n=this,s=B(e);s.forEach((function(e){n._assetMap[e]})),Array.isArray(t)||(t="string"==typeof t?T(t):[t]);var i=t.map((function(e){var t,i=e;if("string"==typeof e){for(var o=!1,a=0;a<n._parsers.length;a++){var u=n._parsers[a];if(u.test(e)){i=u.parse(e),o=!0;break}}o||(i={src:e})}return i.format||(i.format=i.src.split(".").pop()),i.alias||(i.alias=s),n._basePath&&(i.src=E(i.src,n._basePath)),i.data=null!==(t=i.data)&&void 0!==t?t:r,i}));s.forEach((function(e){n._assetMap[e]=i}))},e.prototype.resolveBundle=function(e){var t=this,r=L(e);e=B(e);var n={};return e.forEach((function(e){var r=t._bundles[e];r&&(n[e]=t.resolve(r))})),r?n[e[0]]:n},e.prototype.resolveUrl=function(e){var t=this.resolve(e);if("string"!=typeof e){var r={};for(var n in t)r[n]=t[n].src;return r}return t.src},e.prototype.resolve=function(e){var t=this,r=L(e);e=B(e);var n={};return e.forEach((function(e){var r;if(!t._resolverHash[e])if(t._assetMap[e]){var s=t._assetMap[e],i=t._getPreferredOrder(s),o=s[0];null==i||i.priority.forEach((function(e){i.params[e].forEach((function(t){var r=s.filter((function(r){return!!r[e]&&r[e]===t}));r.length&&(s=r)}))})),t._resolverHash[e]=null!==(r=s[0])&&void 0!==r?r:o}else{var a=e;t._basePath&&(a=E(a,t._basePath)),t._resolverHash[e]={src:a}}n[e]=t._resolverHash[e]})),r?n[e[0]]:n},e.prototype._getPreferredOrder=function(e){for(var t=function(t){var n=e[0],s=r._preferredOrder.find((function(e){return e.params.format.includes(n.format)}));if(s)return{value:s}},r=this,n=0;n<e.length;n++){var s=t();if("object"==typeof s)return s.value}return this._preferredOrder[0]},e}(),ge=function(){function e(){this._detections=[],this._initialized=!1,this.resolver=new me,this.loader=new fe,this.cache=k,this._backgroundLoader=new p(this.loader),this._backgroundLoader.active=!0,this.reset()}return e.prototype.init=function(e){var t,r,n,s;return void 0===e&&(e={}),c(this,void 0,Promise,(function(){var i,o,a,u,c,p,f,h,A,d;return l(this,(function(l){switch(l.label){case 0:return this._initialized?[2]:(this._initialized=!0,e.basePath&&(this.resolver.basePath=e.basePath),e.manifest?"string"!=typeof(i=e.manifest)?[3,2]:[4,this.load(i)]:[3,3]);case 1:i=l.sent(),l.label=2;case 2:this.resolver.addManifest(i),l.label=3;case 3:if(o=null!==(r=null===(t=e.texturePreference)||void 0===t?void 0:t.resolution)&&void 0!==r?r:1,a="number"==typeof o?[o]:o,!(null===(n=e.texturePreference)||void 0===n?void 0:n.format))return[3,9];c=null===(s=e.texturePreference)||void 0===s?void 0:s.format,u="string"==typeof c?[c]:c,p=0,f=this._detections,l.label=4;case 4:return p<f.length?[4,(d=f[p]).test()]:[3,8];case 5:return l.sent()?[3,7]:[4,d.remove(u)];case 6:u=l.sent(),l.label=7;case 7:return p++,[3,4];case 8:return[3,14];case 9:u=["png","jpg","jpeg"],h=0,A=this._detections,l.label=10;case 10:return h<A.length?[4,(d=A[h]).test()]:[3,14];case 11:return l.sent()?[4,d.add(u)]:[3,13];case 12:u=l.sent(),l.label=13;case 13:return h++,[3,10];case 14:return this.resolver.prefer({params:{format:u,resolution:a}}),[2]}}))}))},e.prototype.add=function(e,t,r){this.resolver.add(e,t,r)},e.prototype.load=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i,o=this;return l(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 r=L(e),n=B(e).map((function(e){return"string"!=typeof e?(o.resolver.add(e.src,e),e.src):e})),s=this.resolver.resolve(n),[4,this._mapLoadToResolve(s,t)];case 3:return i=a.sent(),[2,r?i[n[0]]:i]}}))}))},e.prototype.addBundle=function(e,t){this.resolver.addBundle(e,t)},e.prototype.loadBundle=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i,o=this;return l(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 r=!1,"string"==typeof e&&(r=!0,e=[e]),n=this.resolver.resolveBundle(e),s={},i=Object.keys(n).map((function(e){var r=n[e];return o._mapLoadToResolve(r,t).then((function(t){s[e]=t}))})),[4,Promise.all(i)];case 3:return a.sent(),[2,r?s[e[0]]:s]}}))}))},e.prototype.backgroundLoad=function(e){return c(this,void 0,Promise,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:r.sent(),r.label=2;case 2:return"string"==typeof e&&(e=[e]),t=this.resolver.resolve(e),this._backgroundLoader.add(Object.values(t)),[2]}}))}))},e.prototype.backgroundLoadBundle=function(e){return c(this,void 0,Promise,(function(){var t,r=this;return l(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"string"==typeof e&&(e=[e]),t=this.resolver.resolveBundle(e),Object.values(t).forEach((function(e){r._backgroundLoader.add(Object.values(e))})),[2]}}))}))},e.prototype.reset=function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1},e.prototype.get=function(e){if("string"==typeof e)return k.get(e);for(var t={},r=0;r<e.length;r++)t[r]=k.get(e[r]);return t},e.prototype._mapLoadToResolve=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i;return l(this,(function(o){switch(o.label){case 0:return r=Object.values(e),n=Object.keys(e),this._backgroundLoader.active=!1,[4,this.loader.load(r,t)];case 1:return s=o.sent(),this._backgroundLoader.active=!0,i={},r.forEach((function(e,t){var r=s[e.src],o=[e.src];e.alias&&o.push.apply(o,e.alias),i[n[t]]=r,k.set(o,r)})),[2,i]}}))}))},e.prototype.unload=function(e){return c(this,void 0,Promise,(function(){var t,r;return l(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 t=B(e).map((function(e){return"string"!=typeof e?e.src:e})),r=this.resolver.resolve(t),[4,this._unloadFromResolved(r)];case 3:return n.sent(),[2]}}))}))},e.prototype.unloadBundle=function(e){return c(this,void 0,Promise,(function(){var t,r,n=this;return l(this,(function(s){switch(s.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:s.sent(),s.label=2;case 2:return e=B(e),t=this.resolver.resolveBundle(e),r=Object.keys(t).map((function(e){return n._unloadFromResolved(t[e])})),[4,Promise.all(r)];case 3:return s.sent(),[2]}}))}))},e.prototype._unloadFromResolved=function(e){return c(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return(t=Object.values(e)).forEach((function(e){k.remove(e.src)})),[4,this.loader.unload(t)];case 1:return r.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"detections",{get:function(){return this._detections},enumerable:!1,configurable:!0}),e}(),be=new ge;e.extensions.handleByList(e.ExtensionType.LoadParser,be.loader.parsers).handleByList(e.ExtensionType.ResolveParser,be.resolver.parsers).handleByList(e.ExtensionType.CacheParser,be.cache.parsers).handleByList(e.ExtensionType.DetectionParser,be.detections),e.extensions.add(ee,te,Y,Z,N,ie,O,R,de,Ae,U,W),exports.Assets=be,exports.AssetsClass=ge,exports.Cache=k,exports.addFormats=j,exports.basename=d,exports.cacheSpritesheet=O,exports.cacheTextureArray=R,exports.convertToList=B,exports.createStringVariations=T,exports.detectAvif=W,exports.detectBasis=G,exports.detectCompressedTextures=S,exports.detectWebp=U,exports.dirname=g,exports.extname=v,exports.getBaseUrl=P,exports.getFontFamilyName=se,exports.isAbsoluteUrl=_,exports.isSingleItem=L,exports.join=m,exports.loadBasis=ae,exports.loadBitmapFont=N,exports.loadDDS=ce,exports.loadImageBitmap=J,exports.loadJson=Y,exports.loadKTX=pe,exports.loadSpritesheet=Z,exports.loadTextures=ee,exports.loadTxt=te,exports.loadWebFont=ie,exports.makeAbsoluteUrl=E,exports.removeFormats=F,exports.resolveCompressedTextureUrl=ve,exports.resolveSpriteSheetUrl=Ae,exports.resolveTextureUrl=de,exports.urlJoin=y; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pixi/core"),t=require("@pixi/spritesheet"),r=require("@pixi/utils"),n=require("@pixi/settings"),s=require("@pixi/basis"),i=require("@pixi/text-bitmap"),o=require("@pixi/compressed-textures"),a=require("@pixi/constants"),u=function(){return u=Object.assign||function(e){for(var t,r=arguments,n=1,s=arguments.length;n<s;n++)for(var i in t=r[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var h=function(){function e(e,t){void 0===t&&(t=!1),this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}return e.prototype.add=function(e){var t=this;e.forEach((function(e){t._assetList.push(e)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()},e.prototype._next=function(){return c(this,void 0,Promise,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:if(!this._assetList.length||!this._isActive)return[3,2];for(this._isLoading=!0,e=[],t=Math.min(this._assetList.length,this._maxConcurrent),r=0;r<t;r++)e.push(this._assetList.pop());return[4,this._loader.load(e)];case 1:n.sent(),this._isLoading=!1,this._next(),n.label=2;case 2:return[2]}}))}))},Object.defineProperty(e.prototype,"active",{get:function(){return this._isActive},set:function(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())},enumerable:!1,configurable:!0}),e}(),f=function(e,t){return Array.isArray(e)||(e=[e]),t?e.map((function(e){return"string"==typeof e?t(e):e})):e};function p(e,t,r,n,s){for(var i=t[r],o=0;o<i.length;o++){var a=i[o];r<t.length-1?p(e.replace(n[r],a),t,r+1,n,s):s.push(e.replace(n[r],a))}}function A(e){var t=e.match(/\{(.*?)\}/g),r=[];if(t){var n=[];t.forEach((function(e){var t=e.substring(1,e.length-1).split(",");n.push(t)})),p(e,n,0,t,r)}else r.push(e);return r}var d=function(e){return!Array.isArray(e)},v=new(function(){function t(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}return t.prototype.reset=function(){this._cacheMap.clear(),this._cache.clear()},t.prototype.has=function(e){return this._cache.has(e)},t.prototype.get=function(e){return this._cache.get(e)},t.prototype.set=function(t,r){for(var n,s=this,i=f(t),o=0;o<this.parsers.length;o++){var a=this.parsers[o];if(a.test(r)){n=a.getCacheableAssets(i,r);break}}n||(n={},i.forEach((function(e){n[e]=r})));var u=Object.keys(n),c={cacheKeys:u,keys:i};if(i.forEach((function(e){s._cacheMap.set(e,c)})),u.forEach((function(e){s._cache.has(e)&&s._cache.get(e),s._cache.set(e,n[e])})),r instanceof e.Texture){var l=r;i.forEach((function(t){l.baseTexture!==e.Texture.EMPTY.baseTexture&&e.BaseTexture.addToCache(l.baseTexture,t),e.Texture.addToCache(l,t)}))}},t.prototype.remove=function(e){var t=this;if(this._cacheMap.get(e),this._cacheMap.has(e)){var r=this._cacheMap.get(e);r.cacheKeys.forEach((function(e){t._cache.delete(e)})),r.keys.forEach((function(e){t._cacheMap.delete(e)}))}},Object.defineProperty(t.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),t}());function m(e,t,n){var s={};if(e.forEach((function(e){s[e]=t})),Object.keys(t.textures).forEach((function(e){s[e]=t.textures[e]})),!n){var i=r.path.dirname(e[0]);t.linkedSheets.forEach((function(e,r){var n=m([i+"/"+t.data.meta.related_multi_packs[r]],e,!0);Object.assign(s,n)}))}return s}var g={extension:e.ExtensionType.CacheParser,test:function(e){return e instanceof t.Spritesheet},getCacheableAssets:function(e,t){return m(e,t,!1)}},b={extension:e.ExtensionType.CacheParser,test:function(t){return Array.isArray(t)&&t.every((function(t){return t instanceof e.Texture}))},getCacheableAssets:function(e,t){var r={};return e.forEach((function(e){t.forEach((function(t,n){r[e+(0===n?"":n+1)]=t}))})),r}};function x(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return c(t,void 0,void 0,(function(){return l(this,(function(t){return e.unshift.apply(e,r),[2,e]}))}))}}function y(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];return function(e){return c(t,void 0,void 0,(function(){var t,n,s,i;return l(this,(function(o){for(t=0,n=r;t<n.length;t++)s=n[t],-1!==(i=e.indexOf(s))&&e.splice(i,1);return[2,e]}))}))}}var _,P,E={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=",[4,n.settings.ADAPTER.fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:x("avif"),remove:y("avif")};function B(){P={s3tc:_.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:_.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:_.getExtension("WEBGL_compressed_texture_etc"),etc1:_.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:_.getExtension("WEBGL_compressed_texture_pvrtc")||_.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:_.getExtension("WEBGL_compressed_texture_atc"),astc:_.getExtension("WEBGL_compressed_texture_astc")}}var w={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e,t;return l(this,(function(r){return e=n.settings.ADAPTER.createCanvas(),(t=e.getContext("webgl"))?(_=t,[2,!0]):[2,!1]}))}))},add:function(e){return c(void 0,void 0,Promise,(function(){var t,r;return l(this,(function(n){for(r in P||B(),t=[],P)P[r]&&t.push(r);return e.unshift.apply(e,t),[2,e]}))}))},remove:function(e){return c(void 0,void 0,Promise,(function(){return l(this,(function(t){return P||B(),[2,e.filter((function(e){return!(e in P)}))]}))}))}},T={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){return l(this,(function(e){return[2,!(!s.BasisParser.basisBinding||!s.BasisParser.TranscoderWorker.wasmSource)]}))}))},add:x("basis"),remove:y("basis")},L={extension:e.ExtensionType.DetectionParser,test:function(){return c(void 0,void 0,Promise,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return globalThis.createImageBitmap?("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",[4,n.settings.ADAPTER.fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then((function(e){return e.blob()}))]):[2,!1];case 1:return e=t.sent(),[2,createImageBitmap(e).then((function(){return!0}),(function(){return!1}))]}}))}))},add:x("webp"),remove:y("webp")},k=[".xml",".fnt"],O={extension:e.ExtensionType.LoadParser,test:function(e){return k.includes(r.path.extname(e))},testParse:function(e){return c(this,void 0,Promise,(function(){return l(this,(function(t){return[2,i.TextFormat.test(e)||i.XMLStringFormat.test(e)]}))}))},parse:function(e,t,n){return c(this,void 0,Promise,(function(){var s,o,a,u,c,h,f,p,A,d;return l(this,(function(l){switch(l.label){case 0:for(s=i.TextFormat.test(e)?i.TextFormat.parse(e):i.XMLStringFormat.parse(e),o=t.src,a=s.page,u=[],c=0;c<a.length;++c)h=a[c].file,f=r.path.join(r.path.dirname(o),h),u.push(f);return d=(A=Object).values,[4,n.load(u)];case 1:return p=d.apply(A,[l.sent()]),[2,i.BitmapFont.install(s,p,!0)]}}))}))},load:function(e,t){return c(this,void 0,Promise,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,n.settings.ADAPTER.fetch(e)];case 1:return[2,t.sent().text()]}}))}))},unload:function(e){e.destroy()}},M={extension:e.ExtensionType.LoadParser,test:function(e){return r.path.extname(e).includes(".json")},load:function(e){return c(this,void 0,Promise,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,n.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))}))}},R={extension:e.ExtensionType.LoadParser,testParse:function(e,t){return c(this,void 0,Promise,(function(){return l(this,(function(n){return[2,r.path.extname(t.src).includes(".json")&&!!e.frames]}))}))},parse:function(e,n,s){var i,o;return c(this,void 0,Promise,(function(){var a,u,c,h,f,p,A,d,v,m,g,b;return l(this,(function(l){switch(l.label){case 0:return(a=r.path.dirname(n.src))&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),u=a+e.meta.image,[4,s.load([u])];case 1:return c=l.sent(),h=c[u],[4,(f=new t.Spritesheet(h.baseTexture,e,n.src)).parse()];case 2:if(l.sent(),p=null===(i=null==e?void 0:e.meta)||void 0===i?void 0:i.related_multi_packs,!Array.isArray(p))return[3,4];for(A=[],d=0,v=p;d<v.length;d++)"string"==typeof(m=v[d])&&(g=a+m,(null===(o=n.data)||void 0===o?void 0:o.ignoreMultiPack)||A.push(s.load({src:g,data:{ignoreMultiPack:!0}})));return[4,Promise.all(A)];case 3:b=l.sent(),f.linkedSheets=b,b.forEach((function(e){e.linkedSheets=[f].concat(f.linkedSheets.filter((function(t){return t!==e})))})),l.label=4;case 4:return[2,f]}}))}))},unload:function(e){e.destroy(!0)}},j={extension:e.ExtensionType.LoadParser,test:function(e){return r.path.extname(e).includes(".txt")},load:function(e){return c(this,void 0,Promise,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,n.settings.ADAPTER.fetch(e)];case 1:return[4,t.sent().text()];case 2:return[2,t.sent()]}}))}))}},F=["normal","bold","100","200","300","400","500","600","700","800","900"],I=["woff","woff2","ttf","otf"];function W(e){var t=r.path.extname(e);return r.path.basename(e,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" ")}var C={extension:e.ExtensionType.LoadParser,test:function(e){var t=e.split("?")[0].split(".").pop();return I.includes(t)},load:function(e,t){var r,n,s,i,o,a;return c(this,void 0,Promise,(function(){var c,h,f,p,A,d,v;return l(this,(function(l){switch(l.label){case 0:if(!window.navigator.onLine)throw new Error("[loadWebFont] Cannot load font - navigator is offline");if(!("FontFace"in window))return[3,5];c=[],h=null!==(n=null===(r=t.data)||void 0===r?void 0:r.family)&&void 0!==n?n:W(e),f=null!==(o=null===(i=null===(s=t.data)||void 0===s?void 0:s.weights)||void 0===i?void 0:i.filter((function(e){return F.includes(e)})))&&void 0!==o?o:["normal"],p=null!==(a=t.data)&&void 0!==a?a:{},A=0,l.label=1;case 1:return A<f.length?(d=f[A],[4,(v=new FontFace(h,"url("+e+")",u(u({},p),{weight:d}))).load()]):[3,4];case 2:l.sent(),document.fonts.add(v),c.push(v),l.label=3;case 3:return A++,[3,1];case 4:return[2,1===c.length?c[0]:c];case 5:return[2,null]}}))}))},unload:function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return document.fonts.delete(e)}))}};function D(e,t){var n=e.split("?")[0],s=r.path.extname(n).toLowerCase();return Array.isArray(t)?t.includes(s.toLowerCase()):s.toLowerCase()===t}function G(t,r,n){var s=new e.Texture(t);return s.baseTexture.on("dispose",(function(){delete r.promiseCache[n]})),s}var S,U,H={extension:e.ExtensionType.LoadParser,test:function(e){return D(e,".basis")},load:function(t,r,i){return c(this,void 0,Promise,(function(){var c,h,f,p,A;return l(this,(function(l){switch(l.label){case 0:return[4,s.TranscoderWorker.onTranscoderInitialized];case 1:return l.sent(),[4,n.settings.ADAPTER.fetch(t)];case 2:return[4,l.sent().arrayBuffer()];case 3:return c=l.sent(),[4,s.BasisParser.transcode(c)];case 4:return h=l.sent(),f=s.BASIS_FORMAT_TO_TYPE[h.basisFormat],p=h.basisFormat!==s.BASIS_FORMATS.cTFRGBA32?a.FORMATS.RGB:a.FORMATS.RGBA,[2,1===(A=h.map((function(n){return G(new e.BaseTexture(n,u({mipmap:n instanceof o.CompressedTextureResource&&n.levels>1?a.MIPMAP_MODES.ON_MANUAL:a.MIPMAP_MODES.OFF,alphaMode:a.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:f,format:p},r.data)),i,t)}))).length?A[0]:A]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},Q={extension:e.ExtensionType.LoadParser,test:function(e){return D(e,".dds")},load:function(t,s,i){return c(this,void 0,Promise,(function(){var c,h,f;return l(this,(function(l){switch(l.label){case 0:return[4,n.settings.ADAPTER.fetch(t)];case 1:return[4,l.sent().arrayBuffer()];case 2:return c=l.sent(),h=o.parseDDS(c),[2,1===(f=h.map((function(n){return G(new e.BaseTexture(n,u({mipmap:a.MIPMAP_MODES.OFF,alphaMode:a.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:r.getResolutionOfUrl(t)},s.data)),i,t)}))).length?f[0]:f]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},X={extension:e.ExtensionType.LoadParser,test:function(e){return D(e,".ktx")},load:function(t,s,i){return c(this,void 0,Promise,(function(){var c,h,f,p,A,d,v,m;return l(this,(function(l){switch(l.label){case 0:return[4,n.settings.ADAPTER.fetch(t)];case 1:return[4,l.sent().arrayBuffer()];case 2:return c=l.sent(),h=o.parseKTX(t,c),f=h.compressed,p=h.uncompressed,A=h.kvData,d=null!=f?f:p,v=u({mipmap:a.MIPMAP_MODES.OFF,alphaMode:a.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:r.getResolutionOfUrl(t)},s.data),[2,1===(m=d.map((function(r){d===p&&Object.assign(v,{type:r.type,format:r.format});var n=new e.BaseTexture(r,v);return n.ktxKeyValueData=A,G(n,i,t)}))).length?m[0]:m]}}))}))},unload:function(e){Array.isArray(e)?e.forEach((function(e){return e.destroy(!0)})):e.destroy(!0)}},N=0,Y="\n self.onmessage = function(event) {\n\n async function loadImageBitmap(url)\n {\n const response = await fetch(url);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap;\n }\n\n loadImageBitmap(event.data.data[0]).then(imageBitmap => {\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id,\n }, [imageBitmap]);\n }).catch(error => {\n self.postMessage({\n data: null,\n uuid: event.data.uuid,\n id: event.data.id,\n });\n });\n }",z=new(function(){function e(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}return e.prototype.loadImageBitmap=function(e){return this._run("loadImageBitmap",[e])},e.prototype._initWorkers=function(){return c(this,void 0,void 0,(function(){return l(this,(function(e){return this._initialized||(this._initialized=!0),[2]}))}))},e.prototype.getWorker=function(){var e=this;void 0===S&&(S=navigator.hardwareConcurrency||4);var t=this.workerPool.pop();return!t&&this._createdWorkers<S&&(U||(U=URL.createObjectURL(new Blob([Y],{type:"application/javascript"}))),this._createdWorkers++,(t=new Worker(U)).addEventListener("message",(function(t){e.complete(t.data),e.returnWorker(t.target),e.next()}))),t},e.prototype.returnWorker=function(e){this.workerPool.push(e)},e.prototype.complete=function(e){var t=e.data;this.resolveHash[e.uuid](t),this.resolveHash[e.uuid]=null},e.prototype._run=function(e,t){var r=this;this._initWorkers();var n=new Promise((function(n){r.queue.push({id:e,arguments:t,resolve:n})}));return this.next(),n},e.prototype.next=function(){if(this.queue.length){var e=this.getWorker();if(e){var t=this.queue.pop(),r=t.id;this.resolveHash[N]=t.resolve,e.postMessage({data:t.arguments,uuid:N++,id:r})}}},e}()),q=[".jpg",".png",".jpeg",".avif",".webp"];function K(e){return c(this,void 0,Promise,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,n.settings.ADAPTER.fetch(e)];case 1:return[4,r.sent().blob()];case 2:return t=r.sent(),[4,createImageBitmap(t)];case 3:return[2,r.sent()]}}))}))}var Z={extension:e.ExtensionType.LoadParser,config:{preferWorkers:!0},test:function(e){for(var t=!1,r=0;r<q.length;r++)if(0===e.indexOf("data:image/"+q[r].slice(1))){t=!0;break}return t||D(e,q)},load:function(t,n,s){return c(this,void 0,Promise,(function(){var i,o,a;return l(this,(function(c){switch(c.label){case 0:return i=null,window.createImageBitmap?this.config.preferWorkers?[4,z.loadImageBitmap(t)]:[3,2]:[3,5];case 1:return o=c.sent(),[3,4];case 2:return[4,K(t)];case 3:o=c.sent(),c.label=4;case 4:return i=o,[3,7];case 5:return[4,new Promise((function(e){(i=new Image).crossOrigin="anonymous",i.src=t,i.complete?e(i):i.onload=function(){e(i)}}))];case 6:i=c.sent(),c.label=7;case 7:return(a=new e.BaseTexture(i,u({resolution:r.getResolutionOfUrl(t)},n.data))).resource.src=t,[2,G(a,s,t)]}}))}))},unload:function(e){e.destroy(!0)}},V={extension:e.ExtensionType.LoadParser,test:function(e){return r.path.extname(e).includes(".svg")},testParse:function(t){return c(this,void 0,Promise,(function(){return l(this,(function(r){return[2,e.SVGResource.test(t)]}))}))},parse:function(t,n,s){var i,o,a;return c(this,void 0,Promise,(function(){var c,h,f;return l(this,(function(l){switch(l.label){case 0:return c=new e.SVGResource(t,null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.resourceOptions),(h=new e.BaseTexture(c,u({resolution:r.getResolutionOfUrl(t)},null==n?void 0:n.data))).resource.src=t,f=G(h,s,t),(null===(a=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.resourceOptions)||void 0===a?void 0:a.autoLoad)?[3,2]:[4,c.load()];case 1:l.sent(),l.label=2;case 2:return[2,f]}}))}))},load:function(e,t){return c(this,void 0,Promise,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,n.settings.ADAPTER.fetch(e)];case 1:return[2,t.sent().text()]}}))}))},unload:Z.unload},J=function(){function e(){this._parsers=[],this.promiseCache={}}return e.prototype.reset=function(){this.promiseCache={}},e.prototype._getLoadPromiseAndParser=function(e,t){var r=this,n={promise:null,parser:null};return n.promise=c(r,void 0,void 0,(function(){var r,s,i,o,a,u;return l(this,(function(c){switch(c.label){case 0:r=null,s=0,c.label=1;case 1:return s<this.parsers.length?(i=this.parsers[s]).load&&(null===(a=i.test)||void 0===a?void 0:a.call(i,e,t,this))?[4,i.load(e,t,this)]:[3,3]:[3,4];case 2:return r=c.sent(),n.parser=i,[3,4];case 3:return s++,[3,1];case 4:if(!n.parser)return[2,null];s=0,c.label=5;case 5:return s<this.parsers.length?(i=this.parsers[s]).parse?(o=i.parse)?[4,null===(u=i.testParse)||void 0===u?void 0:u.call(i,r,t,this)]:[3,7]:[3,9]:[3,10];case 6:o=c.sent(),c.label=7;case 7:return o?[4,i.parse(r,t,this)]:[3,9];case 8:r=c.sent()||r,n.parser=i,c.label=9;case 9:return s++,[3,5];case 10:return[2,r]}}))})),n},e.prototype.load=function(e,t){return c(this,void 0,Promise,(function(){var n,s,i,o,a,u,h=this;return l(this,(function(p){switch(p.label){case 0:return n=0,s={},i=d(e),o=f(e,(function(e){return{src:e}})),a=o.length,u=o.map((function(e){return c(h,void 0,void 0,(function(){var i,o,u,c;return l(this,(function(l){switch(l.label){case 0:if(i=r.path.toAbsolute(e.src),s[e.src])return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),this.promiseCache[i]||(this.promiseCache[i]=this._getLoadPromiseAndParser(i,e)),o=s,u=e.src,[4,this.promiseCache[i].promise];case 2:return o[u]=l.sent(),t&&t(++n/a),[3,4];case 3:throw c=l.sent(),delete this.promiseCache[i],delete s[e.src],new Error("[Loader.load] Failed to load "+i+".\n"+c);case 4:return[2]}}))}))})),[4,Promise.all(u)];case 1:return p.sent(),[2,i?s[o[0].src]:s]}}))}))},e.prototype.unload=function(e){return c(this,void 0,Promise,(function(){var t,n,s=this;return l(this,(function(i){switch(i.label){case 0:return t=f(e,(function(e){return{src:e}})),n=t.map((function(e){return c(s,void 0,void 0,(function(){var t,n,s,i,o;return l(this,(function(a){switch(a.label){case 0:return t=r.path.toAbsolute(e.src),(n=this.promiseCache[t])?[4,n.promise]:[3,2];case 1:s=a.sent(),null===(o=null===(i=n.parser)||void 0===i?void 0:i.unload)||void 0===o||o.call(i,s,e,this),delete this.promiseCache[t],a.label=2;case 2:return[2]}}))}))})),[4,Promise.all(n)];case 1:return i.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e}(),$=["jpg","png","jpeg","avif","webp"],ee={extension:e.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split("."),r=t.pop(),n=t.pop();return"json"===r&&$.includes(n)},parse:function(e){var t,r,s=e.split(".");return{resolution:parseFloat(null!==(r=null===(t=n.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:s[s.length-2],src:e}}},te={extension:e.ExtensionType.ResolveParser,test:Z.test,parse:function(e){var t,r;return{resolution:parseFloat(null!==(r=null===(t=n.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:e.split(".").pop(),src:e}}},re={extension:e.ExtensionType.ResolveParser,test:function(e){var t=e.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:function(e){var t,r,s,i;if("ktx"===e.split("?")[0].split(".").pop()){var o=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(o.some((function(t){return e.endsWith(t)})))return{resolution:parseFloat(null!==(r=null===(t=n.settings.RETINA_PREFIX.exec(e))||void 0===t?void 0:t[1])&&void 0!==r?r:"1"),format:o.find((function(t){return e.endsWith(t)})),src:e}}return{resolution:parseFloat(null!==(i=null===(s=n.settings.RETINA_PREFIX.exec(e))||void 0===s?void 0:s[1])&&void 0!==i?i:"1"),format:e.split(".").pop(),src:e}}},ne=function(){function e(){this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}return e.prototype.prefer=function(){for(var e=arguments,t=this,r=[],n=0;n<arguments.length;n++)r[n]=e[n];r.forEach((function(e){t._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))})),this._resolverHash={}},Object.defineProperty(e.prototype,"basePath",{get:function(){return this._basePath},set:function(e){this._basePath=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootPath",{get:function(){return this._rootPath},set:function(e){this._rootPath=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parsers",{get:function(){return this._parsers},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this._preferredOrder=[],this._resolverHash={},this._assetMap={},this._rootPath=null,this._basePath=null,this._manifest=null},e.prototype.addManifest=function(e){var t=this;this._manifest,this._manifest=e,e.bundles.forEach((function(e){t.addBundle(e.name,e.assets)}))},e.prototype.addBundle=function(e,t){var r=this,n=[];Array.isArray(t)?t.forEach((function(e){"string"==typeof e.name?n.push(e.name):n.push.apply(n,e.name),r.add(e.name,e.srcs)})):Object.keys(t).forEach((function(e){n.push(e),r.add(e,t[e])})),this._bundles[e]=n},e.prototype.add=function(e,t,n){var s=this,i=f(e);i.forEach((function(e){s._assetMap[e]})),Array.isArray(t)||(t="string"==typeof t?A(t):[t]);var o=t.map((function(e){var t,o=e;if("string"==typeof e){for(var a=!1,u=0;u<s._parsers.length;u++){var c=s._parsers[u];if(c.test(e)){o=c.parse(e),a=!0;break}}a||(o={src:e})}return o.format||(o.format=o.src.split(".").pop()),o.alias||(o.alias=i),(s._basePath||s._rootPath)&&(o.src=r.path.toAbsolute(o.src,s._basePath,s._rootPath)),o.data=null!==(t=o.data)&&void 0!==t?t:n,o}));i.forEach((function(e){s._assetMap[e]=o}))},e.prototype.resolveBundle=function(e){var t=this,r=d(e);e=f(e);var n={};return e.forEach((function(e){var r=t._bundles[e];r&&(n[e]=t.resolve(r))})),r?n[e[0]]:n},e.prototype.resolveUrl=function(e){var t=this.resolve(e);if("string"!=typeof e){var r={};for(var n in t)r[n]=t[n].src;return r}return t.src},e.prototype.resolve=function(e){var t=this,n=d(e);e=f(e);var s={};return e.forEach((function(e){var n;if(!t._resolverHash[e])if(t._assetMap[e]){var i=t._assetMap[e],o=t._getPreferredOrder(i),a=i[0];null==o||o.priority.forEach((function(e){o.params[e].forEach((function(t){var r=i.filter((function(r){return!!r[e]&&r[e]===t}));r.length&&(i=r)}))})),t._resolverHash[e]=null!==(n=i[0])&&void 0!==n?n:a}else{var u=e;(t._basePath||t._rootPath)&&(u=r.path.toAbsolute(u,t._basePath,t._rootPath)),t._resolverHash[e]={src:u}}s[e]=t._resolverHash[e]})),n?s[e[0]]:s},e.prototype._getPreferredOrder=function(e){for(var t=function(t){var n=e[0],s=r._preferredOrder.find((function(e){return e.params.format.includes(n.format)}));if(s)return{value:s}},r=this,n=0;n<e.length;n++){var s=t();if("object"==typeof s)return s.value}return this._preferredOrder[0]},e}(),se=function(){function e(){this._detections=[],this._initialized=!1,this.resolver=new ne,this.loader=new J,this.cache=v,this._backgroundLoader=new h(this.loader),this._backgroundLoader.active=!0,this.reset()}return e.prototype.init=function(e){var t,r,n,s;return void 0===e&&(e={}),c(this,void 0,Promise,(function(){var i,o,a,u,c,h,f,p,A,d;return l(this,(function(l){switch(l.label){case 0:return this._initialized?[2]:(this._initialized=!0,e.basePath&&(this.resolver.basePath=e.basePath),e.manifest?"string"!=typeof(i=e.manifest)?[3,2]:[4,this.load(i)]:[3,3]);case 1:i=l.sent(),l.label=2;case 2:this.resolver.addManifest(i),l.label=3;case 3:if(o=null!==(r=null===(t=e.texturePreference)||void 0===t?void 0:t.resolution)&&void 0!==r?r:1,a="number"==typeof o?[o]:o,!(null===(n=e.texturePreference)||void 0===n?void 0:n.format))return[3,9];c=null===(s=e.texturePreference)||void 0===s?void 0:s.format,u="string"==typeof c?[c]:c,h=0,f=this._detections,l.label=4;case 4:return h<f.length?[4,(d=f[h]).test()]:[3,8];case 5:return l.sent()?[3,7]:[4,d.remove(u)];case 6:u=l.sent(),l.label=7;case 7:return h++,[3,4];case 8:return[3,14];case 9:u=["png","jpg","jpeg"],p=0,A=this._detections,l.label=10;case 10:return p<A.length?[4,(d=A[p]).test()]:[3,14];case 11:return l.sent()?[4,d.add(u)]:[3,13];case 12:u=l.sent(),l.label=13;case 13:return p++,[3,10];case 14:return this.resolver.prefer({params:{format:u,resolution:a}}),[2]}}))}))},e.prototype.add=function(e,t,r){this.resolver.add(e,t,r)},e.prototype.load=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i,o=this;return l(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 r=d(e),n=f(e).map((function(e){return"string"!=typeof e?(o.resolver.add(e.src,e),e.src):e})),s=this.resolver.resolve(n),[4,this._mapLoadToResolve(s,t)];case 3:return i=a.sent(),[2,r?i[n[0]]:i]}}))}))},e.prototype.addBundle=function(e,t){this.resolver.addBundle(e,t)},e.prototype.loadBundle=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i,o,a,u,c,h=this;return l(this,(function(l){switch(l.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:l.sent(),l.label=2;case 2:return r=!1,"string"==typeof e&&(r=!0,e=[e]),n=this.resolver.resolveBundle(e),s={},i=Object.keys(n),o=0,a=0,u=function(){null==t||t(++o/a)},c=i.map((function(e){var t=n[e];return a+=Object.keys(t).length,h._mapLoadToResolve(t,u).then((function(t){s[e]=t}))})),[4,Promise.all(c)];case 3:return l.sent(),[2,r?s[e[0]]:s]}}))}))},e.prototype.backgroundLoad=function(e){return c(this,void 0,Promise,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:r.sent(),r.label=2;case 2:return"string"==typeof e&&(e=[e]),t=this.resolver.resolve(e),this._backgroundLoader.add(Object.values(t)),[2]}}))}))},e.prototype.backgroundLoadBundle=function(e){return c(this,void 0,Promise,(function(){var t,r=this;return l(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"string"==typeof e&&(e=[e]),t=this.resolver.resolveBundle(e),Object.values(t).forEach((function(e){r._backgroundLoader.add(Object.values(e))})),[2]}}))}))},e.prototype.reset=function(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1},e.prototype.get=function(e){if("string"==typeof e)return v.get(e);for(var t={},r=0;r<e.length;r++)t[r]=v.get(e[r]);return t},e.prototype._mapLoadToResolve=function(e,t){return c(this,void 0,Promise,(function(){var r,n,s,i;return l(this,(function(o){switch(o.label){case 0:return r=Object.values(e),n=Object.keys(e),this._backgroundLoader.active=!1,[4,this.loader.load(r,t)];case 1:return s=o.sent(),this._backgroundLoader.active=!0,i={},r.forEach((function(e,t){var r=s[e.src],o=[e.src];e.alias&&o.push.apply(o,e.alias),i[n[t]]=r,v.set(o,r)})),[2,i]}}))}))},e.prototype.unload=function(e){return c(this,void 0,Promise,(function(){var t,r;return l(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 t=f(e).map((function(e){return"string"!=typeof e?e.src:e})),r=this.resolver.resolve(t),[4,this._unloadFromResolved(r)];case 3:return n.sent(),[2]}}))}))},e.prototype.unloadBundle=function(e){return c(this,void 0,Promise,(function(){var t,r,n=this;return l(this,(function(s){switch(s.label){case 0:return this._initialized?[3,2]:[4,this.init()];case 1:s.sent(),s.label=2;case 2:return e=f(e),t=this.resolver.resolveBundle(e),r=Object.keys(t).map((function(e){return n._unloadFromResolved(t[e])})),[4,Promise.all(r)];case 3:return s.sent(),[2]}}))}))},e.prototype._unloadFromResolved=function(e){return c(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return(t=Object.values(e)).forEach((function(e){v.remove(e.src)})),[4,this.loader.unload(t)];case 1:return r.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"detections",{get:function(){return this._detections},enumerable:!1,configurable:!0}),e}(),ie=new se;e.extensions.handleByList(e.ExtensionType.LoadParser,ie.loader.parsers).handleByList(e.ExtensionType.ResolveParser,ie.resolver.parsers).handleByList(e.ExtensionType.CacheParser,ie.cache.parsers).handleByList(e.ExtensionType.DetectionParser,ie.detections),e.extensions.add(Z,V,j,M,R,O,C,g,b,te,ee,L,E),exports.Assets=ie,exports.AssetsClass=se,exports.Cache=v,exports.addFormats=x,exports.cacheSpritesheet=g,exports.cacheTextureArray=b,exports.convertToList=f,exports.createStringVariations=A,exports.detectAvif=E,exports.detectBasis=T,exports.detectCompressedTextures=w,exports.detectWebp=L,exports.getFontFamilyName=W,exports.isSingleItem=d,exports.loadBasis=H,exports.loadBitmapFont=O,exports.loadDDS=Q,exports.loadImageBitmap=K,exports.loadJson=M,exports.loadKTX=X,exports.loadSVG=V,exports.loadSpritesheet=R,exports.loadTextures=Z,exports.loadTxt=j,exports.loadWebFont=C,exports.removeFormats=y,exports.resolveCompressedTextureUrl=re,exports.resolveSpriteSheetUrl=ee,exports.resolveTextureUrl=te; | ||
//# sourceMappingURL=assets.min.js.map |
/// <reference types="css-font-loading-module" /> | ||
import { BaseTexture } from '@pixi/core'; | ||
import { BitmapFont } from '@pixi/text-bitmap'; | ||
import type { ExtensionMetadata } from '@pixi/core'; | ||
import type { IBaseTextureOptions } from '@pixi/core'; | ||
import { Resource } from '@pixi/core'; | ||
@@ -465,9 +465,2 @@ import { Spritesheet } from '@pixi/spritesheet'; | ||
/** | ||
* Returns the last portion of a path | ||
* @param path - The path to get the last portion of | ||
* @param ext - An optional extension to add to the end of the path | ||
*/ | ||
export declare function basename(path: string, ext: string): string; | ||
declare const Cache_2: CacheClass; | ||
@@ -577,15 +570,2 @@ export { Cache_2 as Cache } | ||
/** | ||
* Returns the directory name of a path | ||
* @param path - The path to resolve. | ||
*/ | ||
export declare function dirname(path: string): string; | ||
/** | ||
* Returns the extension of the path, from the last occurrence of the . (period) character | ||
* to end of the string in the last portion of the path | ||
* @param path - The path to get the extension of | ||
*/ | ||
export declare function extname(path: string): string; | ||
export declare interface FormatDetectionParser { | ||
@@ -598,4 +578,2 @@ extension?: ExtensionMetadata; | ||
export declare function getBaseUrl(url: string): string; | ||
/** | ||
@@ -609,13 +587,2 @@ * Return font face name from a file name | ||
/** | ||
* Used to check whether the given URL is an absolute URL or not. | ||
* An absolute URL is defined as a URL that contains the complete details needed to locate a file | ||
* | ||
* Taken directly from here: https://github.com/sindresorhus/is-absolute-url/blob/master/index.js | ||
* | ||
* returns true if the URL is absolute, false if relative. | ||
* @param url - The URL to test | ||
*/ | ||
export declare function isAbsoluteUrl(url: string): boolean; | ||
/** | ||
* Checks if the given value is an array. | ||
@@ -626,9 +593,2 @@ * @param item - The item to test | ||
/** | ||
* Returns the extension of the path, from the last occurrence of the . (period) character to the end of | ||
* string in the last portion of the path. | ||
* @param parts - The path parts to join | ||
*/ | ||
export declare function join(...parts: string[]): string; | ||
export declare interface LoadAsset<T = any> { | ||
@@ -640,3 +600,3 @@ src: string; | ||
/** Load BASIS textures! */ | ||
export declare const loadBasis: LoaderParser<Texture<Resource> | Texture<Resource>[], LoadTextureData>; | ||
export declare const loadBasis: LoaderParser<Texture<Resource> | Texture<Resource>[], IBaseTextureOptions<any>>; | ||
@@ -789,3 +749,3 @@ /** simple loader plugin for loading in bitmap fonts! */ | ||
/** Loads KTX textures! */ | ||
export declare const loadKTX: LoaderParser<Texture<Resource> | Texture<Resource>[], LoadTextureData>; | ||
export declare const loadKTX: LoaderParser<Texture<Resource> | Texture<Resource>[], IBaseTextureOptions<any>>; | ||
@@ -800,5 +760,4 @@ /** | ||
export declare type LoadTextureData = { | ||
baseTexture: BaseTexture; | ||
}; | ||
/** Loads SVG's into Textures */ | ||
export declare const loadSVG: LoaderParser<string | Texture<Resource>, IBaseTextureOptions<any>>; | ||
@@ -811,3 +770,3 @@ /** | ||
*/ | ||
export declare const loadTextures: LoaderParser<Texture<Resource>, LoadTextureData>; | ||
export declare const loadTextures: LoaderParser<Texture<Resource>, IBaseTextureOptions<any>>; | ||
@@ -821,12 +780,2 @@ /** Simple loader plugin for loading text data */ | ||
/** | ||
* Converts URL to an absolute path. | ||
* When loading from a Web Worker, we must use absolute paths. | ||
* If the URL is already absolute we return it as is | ||
* If it's not, we convert it | ||
* @param url - The URL to test | ||
* @param customBaseUrl - The base URL to use | ||
*/ | ||
export declare function makeAbsoluteUrl(url: string, customBaseUrl?: string): string; | ||
/** | ||
* A prefer order lets the resolver know which assets to prefere depending on the various parameters passed to it. | ||
@@ -903,2 +852,3 @@ * @memberof PIXI | ||
private _resolverHash; | ||
private _rootPath; | ||
private _basePath; | ||
@@ -925,3 +875,3 @@ private _manifest; | ||
/** | ||
* Set the base path to append to all urls when resolving | ||
* Set the base path to prepend to all urls when resolving | ||
* @example | ||
@@ -936,2 +886,15 @@ * resolver.basePath = 'https://home.com/'; | ||
/** | ||
* Set the root path for root-relative URLs. By default the `basePath`'s root is used. If no `basePath` is set, then the | ||
* default value for browsers is `window.location.origin` | ||
* @example | ||
* // Application hosted on https://home.com/some-path/index.html | ||
* resolver.basePath = 'https://home.com/some-path/'; | ||
* resolver.rootPath = 'https://home.com/'; | ||
* resolver.add('foo', '/bar.png'); | ||
* resolver.resolveUrl('foo', '/bar.png'); // => 'https://home.com/bar.png' | ||
* @param rootPath - the root path to use | ||
*/ | ||
set rootPath(rootPath: string); | ||
get rootPath(): string; | ||
/** | ||
* All the active URL parsers that help the parser to extract information and create | ||
@@ -1138,4 +1101,2 @@ * an asset object-based on parsing the URL itself. | ||
export declare function urlJoin(...arg: string[]): string; | ||
export { } |
{ | ||
"name": "@pixi/assets", | ||
"version": "6.5.1", | ||
"version": "6.5.2", | ||
"description": "Asset manager for PixiJS, loading resolving and Cacheing", | ||
@@ -48,12 +48,12 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@pixi/basis": "6.5.1", | ||
"@pixi/compressed-textures": "6.5.1", | ||
"@pixi/constants": "6.5.1", | ||
"@pixi/core": "6.5.1", | ||
"@pixi/settings": "6.5.1", | ||
"@pixi/spritesheet": "6.5.1", | ||
"@pixi/text-bitmap": "6.5.1", | ||
"@pixi/utils": "6.5.1" | ||
"@pixi/basis": "6.5.2", | ||
"@pixi/compressed-textures": "6.5.2", | ||
"@pixi/constants": "6.5.2", | ||
"@pixi/core": "6.5.2", | ||
"@pixi/settings": "6.5.2", | ||
"@pixi/spritesheet": "6.5.2", | ||
"@pixi/text-bitmap": "6.5.2", | ||
"@pixi/utils": "6.5.2" | ||
}, | ||
"gitHead": "a344b58dc859e3a60f75d2dc95b7d45180c766d8" | ||
"gitHead": "48ab2f2d009bfb541079ef169df79e4174930f0a" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1465710
9406