@ivoryheart/herdr-world 0.1.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +42 -0
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/UPSTREAM.md +33 -0
- package/bin/herdr-world +128 -0
- package/docs/world-assets.md +51 -0
- package/lib/bridges/linux-x64/herdr-world-bridge +0 -0
- package/lib/bridges/macos-arm64/herdr-world-bridge +0 -0
- package/lib/bridges/macos-x64/herdr-world-bridge +0 -0
- package/lib/herdr-world-launcher.sh +518 -0
- package/package.json +36 -0
- package/share/herdr-world/web/assets/BufferResource-TmONtVkO.js +311 -0
- package/share/herdr-world/web/assets/CanvasPool-C4EP4giG.js +1 -0
- package/share/herdr-world/web/assets/FederatedEventTarget-CkoT1sfc.js +1 -0
- package/share/herdr-world/web/assets/FilterSystem-Cc8XEqAi.js +173 -0
- package/share/herdr-world/web/assets/NoteMarkdownPreview-DSlfOjOc.js +29 -0
- package/share/herdr-world/web/assets/SpacesSurface-KQpjWcgW.js +1 -0
- package/share/herdr-world/web/assets/WebGLRenderer-COAVtjkI.js +1 -0
- package/share/herdr-world/web/assets/WebGPURenderer-DgfOPeWV.js +1 -0
- package/share/herdr-world/web/assets/WorldSurface-DvbdAI-_.js +197 -0
- package/share/herdr-world/web/assets/__vite-browser-external-2447137e-BvRk9kiK.js +0 -0
- package/share/herdr-world/web/assets/browserAll-B8-kqmYE.js +1 -0
- package/share/herdr-world/web/assets/chunk-QTnfLwEv.js +1 -0
- package/share/herdr-world/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/share/herdr-world/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/share/herdr-world/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/share/herdr-world/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/share/herdr-world/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/share/herdr-world/web/assets/getBatchSamplersUniformGroup-D-hqfegN.js +1 -0
- package/share/herdr-world/web/assets/ghostty-web-8_X1K5z2.js +13 -0
- package/share/herdr-world/web/assets/index-B1fwFDFH.css +1 -0
- package/share/herdr-world/web/assets/index-BAVYPHsj.js +17 -0
- package/share/herdr-world/web/assets/init-DeL9YIMj.js +1 -0
- package/share/herdr-world/web/assets/localUniformBit-BnogyqF-.js +264 -0
- package/share/herdr-world/web/assets/web-CkXGA1Hr.js +1 -0
- package/share/herdr-world/web/assets/web-DXrm_vsa.js +1 -0
- package/share/herdr-world/web/assets/webworkerAll-BFZtmp1G.js +1 -0
- package/share/herdr-world/web/herdr-logo-180.png +0 -0
- package/share/herdr-world/web/herdr-logo-192.png +0 -0
- package/share/herdr-world/web/herdr-logo-512.png +0 -0
- package/share/herdr-world/web/herdr-logo-maskable-192.png +0 -0
- package/share/herdr-world/web/herdr-logo-maskable-512.png +0 -0
- package/share/herdr-world/web/herdr-logo.svg +6 -0
- package/share/herdr-world/web/index.html +24 -0
- package/share/herdr-world/web/legal/Apache-2.0.txt +190 -0
- package/share/herdr-world/web/legal/LICENSE.txt +22 -0
- package/share/herdr-world/web/legal/PixiJS-MIT.txt +21 -0
- package/share/herdr-world/web/legal/THIRD_PARTY_NOTICES.md +52 -0
- package/share/herdr-world/web/legal/UPSTREAM.md +33 -0
- package/share/herdr-world/web/legal/manifest.json +33 -0
- package/share/herdr-world/web/legal/npm-licenses.txt +1381 -0
- package/share/herdr-world/web/legal/world-assets.md +51 -0
- package/share/herdr-world/web/manifest.json +42 -0
- package/share/herdr-world/web/world/LICENSE-PixiJS.txt +21 -0
- package/share/herdr-world/web/world/characters/1-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/10-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/11-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/12-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/2-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/3-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/4-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/5-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/6-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/7-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/8-D-1.png +0 -0
- package/share/herdr-world/web/world/characters/9-D-1.png +0 -0
- package/third_party/dependencies/README.md +22 -0
- package/third_party/dependencies/cargo-licenses.html +7696 -0
- package/third_party/dependencies/npm-licenses.txt +1381 -0
- package/third_party/licenses/Apache-2.0.txt +190 -0
- package/third_party/licenses/PixiJS-MIT.txt +21 -0
- package/vendor/herdr-compat/VENDOR-MANIFEST.toml +186 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pt as e}from"./localUniformBit-BnogyqF-.js";import{_ as t,a as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,v as m}from"./FilterSystem-Cc8XEqAi.js";e.add(m),e.add(t),e.add(s),e.add(i),e.add(u),e.add(o),e.add(r),e.add(f),e.add(n),e.add(l),e.add(a),e.add(d),e.add(p),e.add(c);
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import{r as e,t}from"./chunk-QTnfLwEv.js";var n=(e=>(e.Application=`application`,e.WebGLPipes=`webgl-pipes`,e.WebGLPipesAdaptor=`webgl-pipes-adaptor`,e.WebGLSystem=`webgl-system`,e.WebGPUPipes=`webgpu-pipes`,e.WebGPUPipesAdaptor=`webgpu-pipes-adaptor`,e.WebGPUSystem=`webgpu-system`,e.CanvasSystem=`canvas-system`,e.CanvasPipesAdaptor=`canvas-pipes-adaptor`,e.CanvasPipes=`canvas-pipes`,e.Asset=`asset`,e.LoadParser=`load-parser`,e.ResolveParser=`resolve-parser`,e.CacheParser=`cache-parser`,e.DetectionParser=`detection-parser`,e.MaskEffect=`mask-effect`,e.BlendMode=`blend-mode`,e.TextureSource=`texture-source`,e.Environment=`environment`,e.ShapeBuilder=`shape-builder`,e))(n||{}),r=e=>{if(typeof e==`function`||typeof e==`object`&&e.extension){if(!e.extension)throw Error(`Extension class must have an extension object`);e={...typeof e.extension==`object`?e.extension:{type:e.extension},ref:e}}if(typeof e==`object`)e={...e};else throw Error(`Invalid extension type`);return typeof e.type==`string`&&(e.type=[e.type]),e},i=(e,t)=>r(e).priority??t,a={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(r).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...e){return e.map(r).forEach(e=>{e.type.forEach(t=>{let n=this._addHandlers,r=this._queue;n[t]?n[t]?.(e):(r[t]=r[t]||[],r[t]?.push(e))})}),this},handle(e,t,n){let r=this._addHandlers,i=this._removeHandlers;if(r[e]||i[e])throw Error(`Extension type ${e} already has a handler`);r[e]=t,i[e]=n;let a=this._queue;return a[e]&&(a[e]?.forEach(e=>t(e)),delete a[e]),this},handleByMap(e,t){return this.handle(e,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,e=>{t.findIndex(t=>t.name===e.name)>=0||(t.push({name:e.name,value:e.ref}),t.sort((e,t)=>i(t.value,n)-i(e.value,n)))},e=>{let n=t.findIndex(t=>t.name===e.name);n!==-1&&t.splice(n,1)})},handleByList(e,t,n=-1){return this.handle(e,e=>{t.includes(e.ref)||(t.push(e.ref),t.sort((e,t)=>i(t,n)-i(e,n)))},e=>{let n=t.indexOf(e.ref);n!==-1&&t.splice(n,1)})}},o=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,s={grad:.9,turn:360,rad:360/(2*Math.PI)},c=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},l=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},u=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},d=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},f=function(e){return{r:u(e.r,0,255),g:u(e.g,0,255),b:u(e.b,0,255),a:u(e.a)}},p=function(e){return{r:l(e.r),g:l(e.g),b:l(e.b),a:l(e.a,3)}},m=/^#([0-9a-f]{3,8})$/i,h=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},g=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},_=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:255*[r,s,o,o,c,r][l],g:255*[c,r,r,s,o,o][l],b:255*[o,o,c,r,r,s][l],a:i}},v=function(e){return{h:d(e.h),s:u(e.s,0,100),l:u(e.l,0,100),a:u(e.a)}},y=function(e){return{h:l(e.h),s:l(e.s),l:l(e.l),a:l(e.a,3)}},b=function(e){return _((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},x=function(e){return{h:(t=g(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},ee=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,te=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,re=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ie={string:[[function(e){var t=m.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?l(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?l(parseInt(e.substr(6,2),16)/255,2):1}:null:null},`hex`],[function(e){var t=ne.exec(e)||re.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:f({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},`rgb`],[function(e){var t=ee.exec(e)||te.exec(e);if(!t)return null;var n,r;return b(v({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(s[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return c(t)&&c(n)&&c(r)?f({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!c(t)||!c(n)||!c(r)?null:b(v({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!c(t)||!c(n)||!c(r)?null:_(function(e){return{h:d(e.h),s:u(e.s,0,100),v:u(e.v,0,100),a:u(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},ae=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},oe=function(e){return typeof e==`string`?ae(e.trim(),ie.string):typeof e==`object`&&e?ae(e,ie.object):[null,void 0]},se=function(e,t){var n=x(e);return{h:n.h,s:u(n.s+100*t,0,100),l:n.l,a:n.a}},ce=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},le=function(e,t){var n=x(e);return{h:n.h,s:n.s,l:u(n.l+100*t,0,100),a:n.a}},ue=function(){function e(e){this.parsed=oe(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return l(ce(this.rgba),2)},e.prototype.isDark=function(){return ce(this.rgba)<.5},e.prototype.isLight=function(){return ce(this.rgba)>=.5},e.prototype.toHex=function(){return e=p(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?h(l(255*i)):``,`#`+h(t)+h(n)+h(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return p(this.rgba)},e.prototype.toRgbString=function(){return e=p(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return y(x(this.rgba))},e.prototype.toHslString=function(){return e=y(x(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=g(this.rgba),{h:l(e.h),s:l(e.s),v:l(e.v),a:l(e.a,3)};var e},e.prototype.invert=function(){return S({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return e===void 0&&(e=.1),S(se(this.rgba,e))},e.prototype.desaturate=function(e){return e===void 0&&(e=.1),S(se(this.rgba,-e))},e.prototype.grayscale=function(){return S(se(this.rgba,-1))},e.prototype.lighten=function(e){return e===void 0&&(e=.1),S(le(this.rgba,e))},e.prototype.darken=function(e){return e===void 0&&(e=.1),S(le(this.rgba,-e))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return typeof e==`number`?S({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):l(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=x(this.rgba);return typeof e==`number`?S({h:e,s:t.s,l:t.l,a:t.a}):l(t.h)},e.prototype.isEqual=function(e){return this.toHex()===S(e).toHex()},e}(),S=function(e){return e instanceof ue?e:new ue(e)},de=[],fe=function(e){e.forEach(function(e){de.indexOf(e)<0&&(e(ue,ie),de.push(e))})};function pe(e,t){var n={white:`#ffffff`,bisque:`#ffe4c4`,blue:`#0000ff`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,antiquewhite:`#faebd7`,aqua:`#00ffff`,azure:`#f0ffff`,whitesmoke:`#f5f5f5`,papayawhip:`#ffefd5`,plum:`#dda0dd`,blanchedalmond:`#ffebcd`,black:`#000000`,gold:`#ffd700`,goldenrod:`#daa520`,gainsboro:`#dcdcdc`,cornsilk:`#fff8dc`,cornflowerblue:`#6495ed`,burlywood:`#deb887`,aquamarine:`#7fffd4`,beige:`#f5f5dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkkhaki:`#bdb76b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,peachpuff:`#ffdab9`,darkmagenta:`#8b008b`,darkred:`#8b0000`,darkorchid:`#9932cc`,darkorange:`#ff8c00`,darkslateblue:`#483d8b`,gray:`#808080`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,wheat:`#f5deb3`,firebrick:`#b22222`,floralwhite:`#fffaf0`,ghostwhite:`#f8f8ff`,darkviolet:`#9400d3`,magenta:`#ff00ff`,green:`#008000`,dodgerblue:`#1e90ff`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,blueviolet:`#8a2be2`,forestgreen:`#228b22`,lawngreen:`#7cfc00`,indianred:`#cd5c5c`,indigo:`#4b0082`,fuchsia:`#ff00ff`,brown:`#a52a2a`,maroon:`#800000`,mediumblue:`#0000cd`,lightcoral:`#f08080`,darkturquoise:`#00ced1`,lightcyan:`#e0ffff`,ivory:`#fffff0`,lightyellow:`#ffffe0`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,linen:`#faf0e6`,mediumaquamarine:`#66cdaa`,lemonchiffon:`#fffacd`,lime:`#00ff00`,khaki:`#f0e68c`,mediumseagreen:`#3cb371`,limegreen:`#32cd32`,mediumspringgreen:`#00fa9a`,lightskyblue:`#87cefa`,lightblue:`#add8e6`,midnightblue:`#191970`,lightpink:`#ffb6c1`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,mintcream:`#f5fffa`,lightslategray:`#778899`,lightslategrey:`#778899`,navajowhite:`#ffdead`,navy:`#000080`,mediumvioletred:`#c71585`,powderblue:`#b0e0e6`,palegoldenrod:`#eee8aa`,oldlace:`#fdf5e6`,paleturquoise:`#afeeee`,mediumturquoise:`#48d1cc`,mediumorchid:`#ba55d3`,rebeccapurple:`#663399`,lightsteelblue:`#b0c4de`,mediumslateblue:`#7b68ee`,thistle:`#d8bfd8`,tan:`#d2b48c`,orchid:`#da70d6`,mediumpurple:`#9370db`,purple:`#800080`,pink:`#ffc0cb`,skyblue:`#87ceeb`,springgreen:`#00ff7f`,palegreen:`#98fb98`,red:`#ff0000`,yellow:`#ffff00`,slateblue:`#6a5acd`,lavenderblush:`#fff0f5`,peru:`#cd853f`,palevioletred:`#db7093`,violet:`#ee82ee`,teal:`#008080`,slategray:`#708090`,slategrey:`#708090`,aliceblue:`#f0f8ff`,darkseagreen:`#8fbc8f`,darkolivegreen:`#556b2f`,greenyellow:`#adff2f`,seagreen:`#2e8b57`,seashell:`#fff5ee`,tomato:`#ff6347`,silver:`#c0c0c0`,sienna:`#a0522d`,lavender:`#e6e6fa`,lightgreen:`#90ee90`,orange:`#ffa500`,orangered:`#ff4500`,steelblue:`#4682b4`,royalblue:`#4169e1`,turquoise:`#40e0d0`,yellowgreen:`#9acd32`,salmon:`#fa8072`,saddlebrown:`#8b4513`,sandybrown:`#f4a460`,rosybrown:`#bc8f8f`,darksalmon:`#e9967a`,lightgoldenrodyellow:`#fafad2`,snow:`#fffafa`,lightgrey:`#d3d3d3`,lightgray:`#d3d3d3`,dimgray:`#696969`,dimgrey:`#696969`,olivedrab:`#6b8e23`,olive:`#808000`},r={};for(var i in n)r[n[i]]=i;var a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return`transparent`;var i,o,s=r[this.toHex()];if(s)return s;if(t?.closest){var c=this.toRgb(),l=1/0,u=`black`;if(!a.length)for(var d in n)a[d]=new e(n[d]).toRgb();for(var f in n){var p=(i=c,o=a[f],(i.r-o.r)**2+(i.g-o.g)**2+(i.b-o.b)**2);p<l&&(l=p,u=f)}return u}},t.string.push([function(t){var r=t.toLowerCase(),i=r===`transparent`?`#0000`:n[r];return i?new e(i).toRgb():null},`name`])}fe([pe]);var C=class e{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(t){if(t instanceof e)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else if(t===null)throw Error(`Cannot set Color#value to null`);else (this._value===null||!this._isSourceEqual(this._value,t))&&(this._normalize(t),this._value=this._cloneSource(t))}get value(){return this._value}_cloneSource(e){return typeof e==`string`||typeof e==`number`||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e==`object`&&e?{...e}:e}_isSourceEqual(e,t){let n=typeof e;if(n!==typeof t)return!1;if(n===`number`||n===`string`||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length===t.length?e.every((e,n)=>e===t[n]):!1;if(e!==null&&t!==null){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1}return e===t}toRgba(){let[e,t,n,r]=this._components;return{r:e,g:t,b:n,a:r}}toRgb(){let[e,t,n]=this._components;return{r:e,g:t,b:n}}toRgbaString(){let[e,t,n]=this.toUint8RgbArray();return`rgba(${e},${t},${n},${this.alpha})`}toUint8RgbArray(e){let[t,n,r]=this._components;return this._arrayRgb||=[],e||=this._arrayRgb,e[0]=Math.round(t*255),e[1]=Math.round(n*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||=[],e||=this._arrayRgba;let[t,n,r,i]=this._components;return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}toRgbArray(e){this._arrayRgb||=[],e||=this._arrayRgb;let[t,n,r]=this._components;return e[0]=t,e[1]=n,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){let[e,t,n]=this.toUint8RgbArray();return(n<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(t){let[n,r,i,a]=e._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=r,this._components[2]*=i,this._components[3]*=a,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let n=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return t&&(n=n*e+.5|0,r=r*e+.5|0,i=i*e+.5|0),(e*255<<24)+(n<<16)+(r<<8)+i}toHex(){let e=this._int.toString(16);return`#${`000000`.substring(0,6-e.length)+e}`}toHexa(){let e=Math.round(this._components[3]*255).toString(16);return this.toHex()+`00`.substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(t){let n,r,i,a;if((typeof t==`number`||t instanceof Number)&&t>=0&&t<=16777215){let e=t;n=(e>>16&255)/255,r=(e>>8&255)/255,i=(e&255)/255,a=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,r,i,a=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,r,i,a=255]=t,n/=255,r/=255,i/=255,a/=255;else if(typeof t==`string`||typeof t==`object`){if(typeof t==`string`){let n=e.HEX_PATTERN.exec(t);n&&(t=`#${n[2]}`)}let o=S(t);o.isValid()&&({r:n,g:r,b:i,a}=o.rgba,n/=255,r/=255,i/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=r,this._components[2]=i,this._components[3]=a,this._refreshInt();else throw Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);let[e,t,n]=this._components;this._int=(e*255<<16)+(t*255<<8)+(n*255|0)}_clamp(e,t=0,n=1){return typeof e==`number`?Math.min(Math.max(e,t),n):(e.forEach((r,i)=>{e[i]=Math.min(Math.max(r,t),n)}),e)}static isColorLike(t){return typeof t==`number`||typeof t==`string`||t instanceof Number||t instanceof e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};C.shared=new C,C._temp=new C,C.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;var me=C,he={cullArea:null,cullable:!1,cullableChildren:!0},ge=Math.PI*2,_e=180/Math.PI,ve=Math.PI/180,w=class e{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new e(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ye.x=0,ye.y=0,ye}},ye=new w,T=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this}toArray(e,t){this.array||=new Float32Array(9);let n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,t){t||=new w;let n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t}applyInverse(e,t){t||=new w;let n=this.a,r=this.b,i=this.c,a=this.d,o=this.tx,s=this.ty,c=1/(n*a+i*-r),l=e.x,u=e.y;return t.x=a*c*l+-i*c*u+(s*i-o*a)*c,t.y=n*c*u+-r*c*l+(-s*n+o*r)*c,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this}append(e){let t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this}appendFrom(e,t){let n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=t.a,l=t.b,u=t.c,d=t.d;return this.a=n*c+r*u,this.b=n*l+r*d,this.c=i*c+a*u,this.d=i*l+a*d,this.tx=o*c+s*u+t.tx,this.ty=o*l+s*d+t.ty,this}setTransform(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let t=this.a,n=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s);return c<1e-5||Math.abs(ge-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e}invert(){let e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return xe.identity()}static get shared(){return be.identity()}},be=new T,xe=new T,E=class e{constructor(e,t,n){this._x=t||0,this._y=n||0,this._observer=e}clone(t){return new e(t??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}},Se={default:-1};function D(e=`default`){return Se[e]===void 0&&(Se[e]=-1),++Se[e]}var Ce={},O=`8.0.0`;function k(e,t,n=3){if(Ce[t])return;let r=Error().stack;r===void 0?console.warn(`PixiJS Deprecation Warning: `,`${t}
|
|
2
|
+
Deprecated since v${e}`):(r=r.split(`
|
|
3
|
+
`).splice(n).join(`
|
|
4
|
+
`),console.groupCollapsed?(console.groupCollapsed(`%cPixiJS Deprecation Warning: %c%s`,`color:#614108;background:#fffbe6`,`font-weight:normal;color:#614108;background:#fffbe6`,`${t}
|
|
5
|
+
Deprecated since v${e}`),console.warn(r),console.groupEnd()):(console.warn(`PixiJS Deprecation Warning: `,`${t}
|
|
6
|
+
Deprecated since v${e}`),console.warn(r))),Ce[t]=!0}var we=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){let t;return t=this._index>0?this._pool[--this._index]:new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}},A=new class{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new we(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let n=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[n]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}};function Te(e,t,n){let r=e.length,i;if(t>=r||n===0)return;n=t+n>r?r-t:n;let a=r-n;for(i=t;i<a;++i)e[i]=e[i+n];e.length=a}var Ee={allowChildren:!0,removeChildren(e=0,t){let n=t??this.children.length,r=n-e,i=[];if(r>0&&r<=n){for(let t=n-1;t>=e;t--){let e=this.children[t];e&&(i.push(e),e.parent=null)}Te(this.children,e,n);let t=this.renderGroup||this.parentRenderGroup;t&&t.removeChildren(i);for(let e=0;e<i.length;++e)this.emit(`childRemoved`,i[e],this,e),i[e].emit(`removed`,this);return i}else if(r===0&&this.children.length===0)return i;throw RangeError(`removeChildren: numeric values are outside the acceptable range.`)},removeChildAt(e){let t=this.getChildAt(e);return this.removeChild(t)},getChildAt(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){let t=this.children.indexOf(e);if(t===-1)throw Error(`The supplied Container must be a child of the caller`);return t},addChildAt(e,t){this.allowChildren||k(O,`addChildAt: Only Containers will be allowed to add children in v8.0.0`);let{children:n}=this;if(t<0||t>n.length)throw Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);if(e.parent){let n=e.parent.children.indexOf(e);if(e.parent===this&&n===t)return e;n!==-1&&e.parent.children.splice(n,1)}t===n.length?n.push(e):n.splice(t,0,e),e.parent=this,e.didChange=!0,e.didViewUpdate=!1,e._updateFlags=15;let r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(e),this.sortableChildren&&(this.sortDirty=!0),this.emit(`childAdded`,e,this,t),e.emit(`added`,this),e},swapChildren(e,t){if(e===t)return;let n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...e){return e.length===1?this.reparentChildAt(e[0],this.children.length):(e.forEach(e=>this.reparentChildAt(e,this.children.length)),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;let n=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);let r=this.worldTransform.clone();return r.invert(),n.prepend(r),e.setFromMatrix(n),e}},De=class{constructor(){this.pipe=`filter`,this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}},Oe=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let n=this._tests[t];if(n.test(e))return A.get(n.maskClass,e)}return e}returnMaskEffect(e){A.return(e)}};a.handleByList(n.MaskEffect,Oe._effectClasses);var ke={_maskEffect:null,_filterEffect:null,effects:[],addEffect(e){if(this.effects.indexOf(e)!==-1)return;this.effects.push(e),this.effects.sort((e,t)=>e.priority-t.priority);let t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0),this._updateIsSimple()},removeEffect(e){let t=this.effects.indexOf(e);t!==-1&&(this.effects.splice(t,1),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(e){let t=this._maskEffect;t?.mask!==e&&(t&&(this.removeEffect(t),Oe.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=Oe.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},set filters(e){!Array.isArray(e)&&e&&(e=[e]);let t=this._filterEffect||=new De;e=e;let n=e?.length>0,r=n!==t.filters?.length>0;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){return this._filterEffect?.filters},set filterArea(e){this._filterEffect||=new De,this._filterEffect.filterArea=e},get filterArea(){return this._filterEffect?.filterArea}},Ae={label:null,get name(){return k(O,`Container.name property has been removed, use Container.label instead`),this.label},set name(e){k(O,`Container.name property has been removed, use Container.label instead`),this.label=e},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){let n=this.children;for(let t=0;t<n.length;t++){let r=n[t];if(r.label===e||e instanceof RegExp&&e.test(r.label))return r}if(t)for(let t=0;t<n.length;t++){let r=n[t].getChildByLabel(e,!0);if(r)return r}return null},getChildrenByLabel(e,t=!1,n=[]){let r=this.children;for(let t=0;t<r.length;t++){let i=r[t];(i.label===e||e instanceof RegExp&&e.test(i.label))&&n.push(i)}if(t)for(let t=0;t<r.length;t++)r[t].getChildrenByLabel(e,!0,n);return n}},j=[new w,new w,new w,new w],je=class e{constructor(e=0,t=0,n=0,r=0){this.type=`rectangle`,this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new e(0,0,0,0)}clone(){return new e(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,n){let{width:r,height:i}=this;if(r<=0||i<=0)return!1;let a=this.x,o=this.y,s=a-n/2,c=a+r+n/2,l=o-n/2,u=o+i+n/2,d=a+n/2,f=a+r-n/2,p=o+n/2,m=o+i-n/2;return e>=s&&e<=c&&t>=l&&t<=u&&!(e>d&&e<f&&t>p&&t<m)}intersects(e,t){if(!t){let t=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=t)return!1;let n=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>n}let n=this.left,r=this.right,i=this.top,a=this.bottom;if(r<=n||a<=i)return!1;let o=j[0].set(e.left,e.top),s=j[1].set(e.left,e.bottom),c=j[2].set(e.right,e.top),l=j[3].set(e.right,e.bottom);if(c.x<=o.x||s.y<=o.y)return!1;let u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(o,o),t.apply(s,s),t.apply(c,c),t.apply(l,l),Math.max(o.x,s.x,c.x,l.x)<=n||Math.min(o.x,s.x,c.x,l.x)>=r||Math.max(o.y,s.y,c.y,l.y)<=i||Math.min(o.y,s.y,c.y,l.y)>=a))return!1;let d=u*(s.y-o.y),f=u*(o.x-s.x),p=d*n+f*i,m=d*r+f*i,h=d*n+f*a,g=d*r+f*a;if(Math.max(p,m,h,g)<=d*o.x+f*o.y||Math.min(p,m,h,g)>=d*l.x+f*l.y)return!1;let _=u*(o.y-c.y),v=u*(c.x-o.x),y=_*n+v*i,b=_*r+v*i,x=_*n+v*a,ee=_*r+v*a;return!(Math.max(y,b,x,ee)<=_*o.x+v*o.y||Math.min(y,b,x,ee)>=_*l.x+v*l.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(e=1,t=.001){let n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this}getBounds(t){return t||=new e,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}},Me=new T,M=class e{constructor(e=1/0,t=1/0,n=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Me,this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||=new je;let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Me,this}set(e,t,n,r){this.minX=e,this.minY=t,this.maxX=n,this.maxY=r}addFrame(e,t,n,r,i){i||=this.matrix;let a=i.a,o=i.b,s=i.c,c=i.d,l=i.tx,u=i.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*e+s*t+l,g=o*e+c*t+u;h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*t+l,g=o*n+c*t+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*e+s*r+l,g=o*e+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),h=a*n+s*r+l,g=o*n+c*r+u,h<d&&(d=h),g<f&&(f=g),h>p&&(p=h),g>m&&(m=g),this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){let t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,{a,b:o,c:s,d:c,tx:l,ty:u}=e,d=a*t+s*n+l,f=o*t+c*n+u;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=a*r+s*n+l,f=o*r+c*n+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*t+s*i+l,f=o*t+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=a*r+s*i+l,f=o*r+c*i+u,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,n,r){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<n&&(this.minY=n),this.maxY>r&&(this.maxY=r),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new e(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,n,r){let i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;r||=this.matrix;let c=r.a,l=r.b,u=r.c,d=r.d,f=r.tx,p=r.ty;for(let r=t;r<n;r+=2){let t=e[r],n=e[r+1],m=c*t+u*n+f,h=l*t+d*n+p;i=m<i?m:i,a=h<a?h:a,o=m>o?m:o,s=h>s?h:s}this.minX=i,this.minY=a,this.maxX=o,this.maxY=s}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}},N=new we(T),P=new we(M);function Ne(e,t,n){n.clear();let r,i;return e.parent?t?r=e.parent.worldTransform:(i=N.get().identity(),r=F(e,i)):r=T.IDENTITY,Pe(e,n,r,t),i&&N.return(i),n.isValid||n.set(0,0,0,0),n}function Pe(e,t,n,r){if(!e.visible||!e.measurable)return;let i;r?i=e.worldTransform:(e.updateLocalTransform(),i=N.get(),i.appendFrom(e.localTransform,n));let a=t,o=!!e.effects.length;if(o&&(t=P.get().clear()),e.boundsArea)t.addRect(e.boundsArea,i);else{e.addBounds&&(t.matrix=i,e.addBounds(t));for(let n=0;n<e.children.length;n++)Pe(e.children[n],t,i,r)}if(o){for(let n=0;n<e.effects.length;n++)e.effects[n].addBounds?.(t);a.addBounds(t,T.IDENTITY),P.return(t)}r||N.return(i)}function F(e,t){let n=e.parent;return n&&(F(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}var Fe=0,Ie=500;function Le(...e){Fe!==Ie&&(Fe++,Fe===Ie?console.warn(`PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS.`):console.warn(`PixiJS Warning: `,...e))}function Re(e,t,n){return t.clear(),n||=T.IDENTITY,ze(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function ze(e,t,n,r,i){let a;if(i)a=N.get(),a=n.copyTo(a);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();let t=e.localTransform;a=N.get(),a.appendFrom(t,n)}let o=t,s=!!e.effects.length;if(s&&(t=P.get().clear()),e.boundsArea)t.addRect(e.boundsArea,a);else{e.renderPipeId&&(t.matrix=a,e.addBounds(t));let n=e.children;for(let e=0;e<n.length;e++)ze(n[e],t,a,r,!1)}if(s){for(let n=0;n<e.effects.length;n++)e.effects[n].addLocalBounds?.(t,r);o.addBounds(t,T.IDENTITY),P.return(t)}N.return(a)}function Be(e,t){let n=e.children;for(let e=0;e<n.length;e++){let r=n[e],i=r.uid,a=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,o=t.index;(t.data[o]!==i||t.data[o+1]!==a)&&(t.data[t.index]=i,t.data[t.index+1]=a,t.didChange=!0),t.index=o+2,r.children.length&&Be(r,t)}return t.didChange}var Ve=new T,He={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(e,t){let n=Math.sign(this.scale.x)||1;t===0?this.scale.x=n:this.scale.x=e/t*n},_setHeight(e,t){let n=Math.sign(this.scale.y)||1;t===0?this.scale.y=n:this.scale.y=e/t*n},getLocalBounds(){this._localBoundsCacheData||={data:[],index:1,didChange:!1,localBounds:new M};let e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),Be(this,e),e.didChange&&Re(this,e.localBounds,Ve),e.localBounds},getBounds(e,t){return Ne(this,e,t||new M)}},Ue={_onRender:null,set onRender(e){let t=this.renderGroup||this.parentRenderGroup;if(!e){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=e},get onRender(){return this._onRender}},We={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Ge))}};function Ge(e,t){return e._zIndex-t._zIndex}var Ke={getGlobalPosition(e=new w,t=!1){return this.parent?this.parent.toGlobal(this._position,e,t):(e.x=this._position.x,e.y=this._position.y),e},toGlobal(e,t,n=!1){if(!n){this.updateLocalTransform();let n=F(this,new T);return n.append(this.localTransform),n.apply(e,t)}return this.worldTransform.apply(e,t)},toLocal(e,t,n,r){if(t&&(e=t.toGlobal(e,n,r)),!r){this.updateLocalTransform();let t=F(this,new T);return t.append(this.localTransform),t.applyInverse(e,n)}return this.worldTransform.applyInverse(e,n)}},qe=0,Je=class{constructor(){this.uid=D(`instructionSet`),this.instructions=[],this.instructionSize=0,this.renderables=[],this.tick=0}reset(){this.instructionSize=0,this.tick=qe++}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,[`type`,`action`])}},Ye=class{constructor(){this.renderPipeId=`renderGroup`,this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new T,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Je,this._onRenderContainers=[]}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;let t=e.children;for(let e=0;e<t.length;e++)this.addChild(t[e])}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let e=0;e<t.length;e++)this.addChild(t[e])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let e=0;e<t.length;e++)this.removeChild(t[e])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]},t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(e.didViewUpdate=!1,this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e))}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender()}destroy(){this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){let t=this.root.children;for(let n=0;n<t.length;n++)this._getChildren(t[n],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let n=e.children;for(let e=0;e<n.length;e++)this._getChildren(n[e],t);return t}};function Xe(e,t,n={}){for(let r in t)!n[r]&&t[r]!==void 0&&(e[r]=t[r])}var Ze=new E(null),Qe=new E(null),$e=new E(null,1,1),I=class e extends o{constructor(e={}){super(),this.uid=D(`renderable`),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.updateTick=-1,this.localTransform=new T,this.relativeGroupTransform=new T,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new E(this,0,0),this._scale=$e,this._pivot=Qe,this._skew=Ze,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode=`inherit`,this.groupBlendMode=`normal`,this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Xe(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach(e=>this.addChild(e)),e.parent?.addChild(this)}static mixin(t){Object.defineProperties(e.prototype,Object.getOwnPropertyDescriptors(t))}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||k(O,`addChild: Only Containers will be allowed to add children in v8.0.0`),e.length>1){for(let t=0;t<e.length;t++)this.addChild(e[t]);return e[0]}let t=e[0];if(t.parent===this)return this.children.splice(this.children.indexOf(t),1),this.children.push(t),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),t;t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t.didViewUpdate=!1,t._updateFlags=15;let n=this.renderGroup||this.parentRenderGroup;return n&&n.addChild(t),this.emit(`childAdded`,t,this,this.children.length-1),t.emit(`added`,this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t}removeChild(...e){if(e.length>1){for(let t=0;t<e.length;t++)this.removeChild(e[t]);return e[0]}let t=e[0],n=this.children.indexOf(t);return n>-1&&(this._didViewChangeTick++,this.children.splice(n,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parent=null,this.emit(`childRemoved`,t,this,n),t.emit(`removed`,this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=A.get(Ye,this),this.groupTransform=T.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),A.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||=new T,this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*_e}set angle(e){this.rotation=e*ve}get pivot(){return this._pivot===Qe&&(this._pivot=new E(this,0,0)),this._pivot}set pivot(e){this._pivot===Qe&&(this._pivot=new E(this,0,0)),typeof e==`number`?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===Ze&&(this._skew=new E(this,0,0)),this._skew}set skew(e){this._skew===Ze&&(this._skew=new E(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===$e&&(this._scale=new E(this,1,1)),this._scale}set scale(e){this._scale===$e&&(this._scale=new E(this,0,0)),typeof e==`number`?this._scale.set(e):this._scale.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||={};let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let n=this.getLocalBounds();typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,n.width),t!==void 0&&this._setHeight(t,n.height)}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x==`number`?e.x:this.position.x,typeof e.y==`number`?e.y:this.position.y),this.scale.set(typeof e.scaleX==`number`?e.scaleX||1:this.scale.x,typeof e.scaleY==`number`?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation==`number`?e.rotation:this.rotation,this.skew.set(typeof e.skewX==`number`?e.skewX:this.skew.x,typeof e.skewY==`number`?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX==`number`?e.pivotX:this.pivot.x,typeof e.pivotY==`number`?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,n=this._scale,r=this._pivot,i=this._position,a=n._x,o=n._y,s=r._x,c=r._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*o,t.d=this._sy*o,t.tx=i._x-(s*t.a+c*t.c),t.ty=i._y-(s*t.b+c*t.d)}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){let t=me.shared.setValue(e??16777215).toBgrNumber();t!==this.localColor&&(this.localColor=t,this._updateFlags|=1,this._onUpdate())}get tint(){let e=this.localColor;return((e&255)<<16)+(e&65280)+(e>>16&255)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){let t=+!!e;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;let t=this.removeChildren(0,this.children.length);if(this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit(`destroyed`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.children)for(let n=0;n<t.length;++n)t[n].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null}};I.mixin(Ee),I.mixin(Ke),I.mixin(Ue),I.mixin(He),I.mixin(ke),I.mixin(Ae),I.mixin(We),I.mixin(he);var L=(e=>(e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`,e))(L||{}),et=class{constructor(e,t=null,n=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=n,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}},tt=class e{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new et(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,n=L.NORMAL){return this._addListener(new et(e,t,n))}addOnce(e,t,n=L.NORMAL){return this._addListener(new et(e,t,n,!0))}_addListener(e){let t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,t){let n=this._head.next;for(;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){let e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*e.targetFPMS;let r=this._head,i=r.next;for(;i;)i=i.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let n=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,n)/1e3,e.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!e._shared){let t=e._shared=new e;t.autoStart=!0,t._protected=!0}return e._shared}static get system(){if(!e._system){let t=e._system=new e;t.autoStart=!0,t._protected=!0}return e._system}};tt.targetFPMS=.06;var nt=tt,rt={createCanvas:(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(e,t)=>fetch(e,t),parseXML:e=>new DOMParser().parseFromString(e,`text/xml`)},it={get(){return rt},set(e){rt=e}},R=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],z=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],B=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],V=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],at=[],ot=[],H=Math.sign;function st(){for(let e=0;e<16;e++){let t=[];at.push(t);for(let n=0;n<16;n++){let r=H(R[e]*R[n]+B[e]*z[n]),i=H(z[e]*R[n]+V[e]*z[n]),a=H(R[e]*B[n]+B[e]*V[n]),o=H(z[e]*B[n]+V[e]*V[n]);for(let e=0;e<16;e++)if(R[e]===r&&z[e]===i&&B[e]===a&&V[e]===o){t.push(e);break}}}for(let e=0;e<16;e++){let t=new T;t.set(R[e],z[e],B[e],V[e],0,0),ot.push(t)}}st();var U={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:e=>R[e],uY:e=>z[e],vX:e=>B[e],vY:e=>V[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>at[e][t],sub:(e,t)=>at[e][U.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)==2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?U.S:U.N:Math.abs(t)*2<=Math.abs(e)?e>0?U.E:U.W:t>0?e>0?U.SE:U.SW:e>0?U.NE:U.NW,matrixAppendRotationInv:(e,t,n=0,r=0)=>{let i=ot[U.inv(t)];i.tx=n,i.ty=r,e.append(i)}},ct=()=>{};function lt(e){return e+=+(e===0),--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function ut(e){return!(e&e-1)&&!!e}function dt(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}var ft=Object.create(null);function pt(e){let t=ft[e];return t===void 0&&(ft[e]=D(`resource`)),t}var mt=class e extends o{constructor(t={}){super(),this._resourceType=`textureSampler`,this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...e.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){k(O,`TextureStyle.wrapMode is now TextureStyle.addressMode`),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode=`linear`)}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit(`change`,this),this._sharedResourceId=null}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=pt(e),this._resourceId}destroy(){this.destroyed=!0,this.emit(`destroy`,this),this.emit(`change`,this),this.removeAllListeners()}};mt.defaultOptions={addressMode:`clamp-to-edge`,scaleMode:`linear`};var ht=mt,gt=class e extends o{constructor(t={}){super(),this.options=t,this.uid=D(`textureSource`),this._resourceType=`textureSource`,this._resourceId=D(`resource`),this.uploadMethodId=`unknown`,this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format=`rgba8unorm`,this.dimension=`2d`,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...e.defaultOptions,...t},this.label=t.label??``,this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new ht(dt(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off(`change`,this._onStyleChange,this),this._style=e,this._style?.on(`change`,this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit(`styleChange`,this)}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit(`update`,this)}destroy(){this.destroyed=!0,this.emit(`destroy`,this),this.emit(`change`,this),this._style&&=(this._style.destroy(),null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=D(`resource`),this.emit(`change`,this),this.emit(`unload`,this)}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,n){n||=this._resolution,e||=this.width,t||=this.height;let r=Math.round(e*n),i=Math.round(t*n);return this.width=r/n,this.height=i/n,this._resolution=n,this.pixelWidth===r&&this.pixelHeight===i?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=i,this.emit(`resize`,this),this._resourceId=D(`resource`),this.emit(`change`,this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit(`updateMipmaps`,this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=ut(this.pixelWidth)&&ut(this.pixelHeight)}static test(e){throw Error(`Unimplemented`)}};gt.defaultOptions={resolution:1,format:`bgra8unorm`,alphaMode:`premultiply-alpha-on-upload`,dimensions:`2d`,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};var W=gt,_t=class extends W{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),n=e.format;n||=t instanceof Float32Array?`rgba32float`:t instanceof Int32Array||t instanceof Uint32Array?`rgba32uint`:t instanceof Int16Array||t instanceof Uint16Array?`rgba16uint`:(t instanceof Int8Array,`bgra8unorm`),super({...e,resource:t,format:n}),this.uploadMethodId=`buffer`}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};_t.extension=n.TextureSource;var vt=new T,yt=class{constructor(e,t){this.mapCoord=new T,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,t===void 0?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener(`update`,this.update,this),this._texture=e,this._texture.addListener(`update`,this.update,this),this.update())}multiplyUvs(e,t){t===void 0&&(t=e);let n=this.mapCoord;for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];t[r]=i*n.a+a*n.c+n.tx,t[r+1]=i*n.b+a*n.d+n.ty}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let n=e.orig,r=e.trim;r&&(vt.set(n.width/r.width,0,0,n.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(vt));let i=e.source,a=this.uClampFrame,o=this.clampMargin/i._resolution,s=this.clampOffset/i._resolution;return a[0]=(e.frame.x+o+s)/i.width,a[1]=(e.frame.y+o+s)/i.height,a[2]=(e.frame.x+e.frame.width-o+s)/i.width,a[3]=(e.frame.y+e.frame.height-o+s)/i.height,this.uClampOffset[0]=this.clampOffset/i.pixelWidth,this.uClampOffset[1]=this.clampOffset/i.pixelHeight,this.isSimple=e.frame.width===i.width&&e.frame.height===i.height&&e.rotate===0,!0}},G=class extends o{constructor({source:e,label:t,frame:n,orig:r,trim:i,defaultAnchor:a,defaultBorders:o,rotate:s,dynamic:c}={}){if(super(),this.uid=D(`texture`),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new je,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=e?.source??new W,this.noFrame=!n,n)this.frame.copyFrom(n);else{let{width:e,height:t}=this._source;this.frame.width=e,this.frame.height=t}this.orig=r||this.frame,this.trim=i,this.rotate=s??0,this.defaultAnchor=a,this.defaultBorders=o,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(e){this._source&&this._source.off(`resize`,this.update,this),this._source=e,e.on(`resize`,this.update,this),this.emit(`update`,this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||=new yt(this),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:n,height:r}=this._source,i=t.x/n,a=t.y/r,o=t.width/n,s=t.height/r,c=this.rotate;if(c){let t=o/2,n=s/2,r=i+t,l=a+n;c=U.add(c,U.NW),e.x0=r+t*U.uX(c),e.y0=l+n*U.uY(c),c=U.add(c,2),e.x1=r+t*U.uX(c),e.y1=l+n*U.uY(c),c=U.add(c,2),e.x2=r+t*U.uX(c),e.y2=l+n*U.uY(c),c=U.add(c,2),e.x3=r+t*U.uX(c),e.y3=l+n*U.uY(c)}else e.x0=i,e.y0=a,e.x1=i+o,e.y1=a,e.x2=i+o,e.y2=a+s,e.x3=i,e.y3=a+s}destroy(e=!1){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit(`destroy`,this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit(`update`,this)}get baseTexture(){return k(O,`Texture.baseTexture is now Texture.source`),this._source}};G.EMPTY=new G({label:`EMPTY`,source:new W({label:`EMPTY`})}),G.EMPTY.destroy=ct,G.WHITE=new G({source:new _t({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:`premultiply-alpha-on-upload`,label:`WHITE`}),label:`WHITE`}),G.WHITE.destroy=ct;function bt(e,t,n,r){let{width:i,height:a}=n.orig,o=n.trim;if(o){let n=o.width,s=o.height;e.minX=o.x-t._x*i-r,e.maxX=e.minX+n,e.minY=o.y-t._y*a-r,e.maxY=e.minY+s}else e.minX=-t._x*i-r,e.maxX=e.minX+i,e.minY=-t._y*a-r,e.maxY=e.minY+a}var xt=class extends I{constructor(){super(...arguments),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=0,this._lastInstructionTick=-1,this._bounds=new M(0,1,0,0),this._boundsDirty=!0}_updateBounds(){}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=+!!e}containsPoint(e){let t=this.bounds,{x:n,y:r}=e;return n>=t.minX&&n<=t.maxX&&r>=t.minY&&r<=t.maxY}destroy(e){super.destroy(e),this._bounds=null}},St=class e extends xt{constructor(e=G.EMPTY){e instanceof G&&(e={texture:e});let{texture:t=G.EMPTY,anchor:n,roundPixels:r,width:i,height:a,...o}=e;super({label:`Sprite`,...o}),this.renderPipeId=`sprite`,this.batched=!0,this._didSpriteUpdate=!1,this._sourceBounds={minX:0,maxX:1,minY:0,maxY:0},this._sourceBoundsDirty=!0,this._anchor=new E({_onUpdate:()=>{this.onViewUpdate()}}),n?this.anchor=n:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,i!==void 0&&(this.width=i),a!==void 0&&(this.height=a)}static from(t,n=!1){return t instanceof G?new e(t):new e(G.from(t,n))}set texture(e){e||=G.EMPTY;let t=this._texture;t!==e&&(t&&t.dynamic&&t.off(`update`,this.onViewUpdate,this),e.dynamic&&e.on(`update`,this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get bounds(){return this._boundsDirty&&=(this._updateBounds(),!1),this._bounds}get sourceBounds(){return this._sourceBoundsDirty&&=(this._updateSourceBounds(),!1),this._sourceBounds}containsPoint(e){let t=this.sourceBounds;return e.x>=t.maxX&&e.x<=t.minX&&e.y>=t.maxY&&e.y<=t.minY}addBounds(e){let t=this._texture.trim?this.sourceBounds:this.bounds;e.addFrame(t.minX,t.minY,t.maxX,t.maxY)}onViewUpdate(){if(this._didViewChangeTick++,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}_updateBounds(){bt(this._bounds,this._anchor,this._texture,0)}_updateSourceBounds(){let e=this._anchor,t=this._texture,n=this._sourceBounds,{width:r,height:i}=t.orig;n.maxX=-e._x*r,n.minX=n.maxX+r,n.maxY=-e._y*i,n.minY=n.maxY+i}destroy(e=!1){if(super.destroy(e),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._texture.destroy(t)}this._texture=null,this._bounds=null,this._sourceBounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e==`number`?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||={},e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}},Ct=class extends W{constructor(e){e.resource||=it.get().createCanvas(),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId=`image`,this.autoDensity=e.autoDensity;let t=e.resource;(this.pixelWidth!==t.width||this.pixelWidth!==t.height)&&this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,n=this._resolution){let r=super.resize(e,t,n);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}};Ct.extension=n.TextureSource;var K=class{constructor(e){this.resources=Object.create(null),this._dirty=!0;let t=0;for(let n in e){let r=e[n];this.setResource(r,t++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;let e=[],t=0;for(let n in this.resources)e[t++]=this.resources[n]._resourceId;this._key=e.join(`|`)}setResource(e,t){let n=this.resources[t];e!==n&&(n&&e.off?.(`change`,this.onResourceChange,this),e.on?.(`change`,this.onResourceChange,this),this.resources[t]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){let t=this.resources;for(let n in t)t[n]._touched=e}destroy(){let e=this.resources;for(let t in e)e[t].off?.(`change`,this.onResourceChange,this);this.resources=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){let t=this.resources;for(let n in t)t[n]===e&&(t[n]=null)}else this._updateKey()}},q;function wt(){return(!q||q?.isContextLost())&&(q=it.get().createCanvas().getContext(`webgl`,{})),q}var Tt=[`precision mediump float;`,`void main(void){`,`float test = 0.1;`,`%forloop%`,`gl_FragColor = vec4(0.0);`,`}`].join(`
|
|
7
|
+
`);function Et(e){let t=``;for(let n=0;n<e;++n)n>0&&(t+=`
|
|
8
|
+
else `),n<e-1&&(t+=`if(test == ${n}.0){}`);return t}function Dt(e,t){if(e===0)throw Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let n=t.createShader(t.FRAGMENT_SHADER);try{for(;;){let r=Tt.replace(/%forloop%/gi,Et(e));if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))e=e/2|0;else break}}finally{t.deleteShader(n)}return e}var J=null;function Ot(){if(J)return J;let e=wt();return J=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),J=Dt(J,e),e.getExtension(`WEBGL_lose_context`)?.loseContext(),J}var kt=class{constructor(e){typeof e==`number`?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||=new Int8Array(this.rawBinaryData),this._int8View}get uint8View(){return this._uint8View||=new Uint8Array(this.rawBinaryData),this._uint8View}get int16View(){return this._int16View||=new Int16Array(this.rawBinaryData),this._int16View}get int32View(){return this._int32View||=new Int32Array(this.rawBinaryData),this._int32View}get float64View(){return this._float64Array||=new Float64Array(this.rawBinaryData),this._float64Array}get bigUint64View(){return this._bigUint64Array||=new BigUint64Array(this.rawBinaryData),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case`int8`:case`uint8`:return 1;case`int16`:case`uint16`:return 2;case`int32`:case`uint32`:case`float32`:return 4;default:throw Error(`${e} isn't a valid view type`)}}};function At(e,t){let n=e.byteLength/8|0,r=new Float64Array(e,0,n);new Float64Array(t,0,n).set(r);let i=e.byteLength-n*8;if(i>0){let r=new Uint8Array(e,n*8,i);new Uint8Array(t,n*8,i).set(r)}}var jt={normal:`normal-npm`,add:`add-npm`,screen:`screen-npm`},Mt=(e=>(e[e.DISABLED=0]=`DISABLED`,e[e.RENDERING_MASK_ADD=1]=`RENDERING_MASK_ADD`,e[e.MASK_ACTIVE=2]=`MASK_ACTIVE`,e[e.RENDERING_MASK_REMOVE=3]=`RENDERING_MASK_REMOVE`,e[e.NONE=4]=`NONE`,e))(Mt||{});function Nt(e,t){return t.alphaMode===`no-premultiply-alpha`&&jt[e]||e}var Pt=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){let t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null}this.count=0}},Ft=class{constructor(){this.renderPipeId=`batch`,this.action=`startBatch`,this.start=0,this.size=0,this.textures=new Pt,this.blendMode=`normal`,this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}},It=[],Lt=0;function Rt(){return Lt>0?It[--Lt]:new Ft}function zt(e){It[Lt++]=e}var Y=0,Bt=class e{constructor(t={}){this.uid=D(`batcher`),this.dirty=!0,this.batchIndex=0,this.batches=[],this._vertexSize=6,this._elements=[],e.defaultOptions.maxTextures=e.defaultOptions.maxTextures??Ot(),t={...e.defaultOptions,...t};let{vertexSize:n,indexSize:r,maxTextures:i}=t;this.attributeBuffer=new kt(n*this._vertexSize*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=i}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)zt(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e.indexStart=this.indexSize,e.location=this.attributeSize,e.batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.vertexSize*this._vertexSize}checkAndUpdateTexture(e,t){let n=e.batch.textures.ids[t._source.uid];return!n&&n!==0?!1:(e.textureId=n,e.texture=t,!0)}updateElement(e){this.dirty=!0,e.packAttributes(this.attributeBuffer.float32View,this.attributeBuffer.uint32View,e.location,e.textureId)}break(e){let t=this._elements;if(!t[this.elementStart])return;let n=Rt(),r=n.textures;r.clear();let i=t[this.elementStart],a=Nt(i.blendMode,i.texture._source);this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let o=this.attributeBuffer.float32View,s=this.attributeBuffer.uint32View,c=this.indexBuffer,l=this._batchIndexSize,u=this._batchIndexStart,d=`startBatch`,f=this.maxTextures;for(let i=this.elementStart;i<this.elementSize;++i){let p=t[i];t[i]=null;let m=p.texture._source,h=Nt(p.blendMode,m),g=a!==h;if(m._batchTick===Y&&!g){p.textureId=m._textureBindLocation,l+=p.indexSize,p.packAttributes(o,s,p.location,p.textureId),p.packIndex(c,p.indexStart,p.location/this._vertexSize),p.batch=n;continue}m._batchTick=Y,(r.count>=f||g)&&(this._finishBatch(n,u,l-u,r,a,e,d),d=`renderBatch`,u=l,a=h,n=Rt(),r=n.textures,r.clear(),++Y),p.textureId=m._textureBindLocation=r.count,r.ids[m.uid]=r.count,r.textures[r.count++]=m,p.batch=n,l+=p.indexSize,p.packAttributes(o,s,p.location,p.textureId),p.packIndex(c,p.indexStart,p.location/this._vertexSize)}r.count>0&&(this._finishBatch(n,u,l-u,r,a,e,d),u=l,++Y),this.elementStart=this.elementSize,this._batchIndexStart=u,this._batchIndexSize=l}_finishBatch(e,t,n,r,i,a,o){e.gpuBindGroup=null,e.bindGroup=null,e.action=o,e.batcher=this,e.textures=r,e.blendMode=i,e.start=t,e.size=n,++Y,this.batches[this.batchIndex++]=e,a.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){let t=new kt(Math.max(e,this.attributeBuffer.size*2));At(this.attributeBuffer.rawBinaryData,t.rawBinaryData),this.attributeBuffer=t}_resizeIndexBuffer(e){let t=this.indexBuffer,n=Math.max(e,t.length*1.5);n+=n%2;let r=n>65535?new Uint32Array(n):new Uint16Array(n);if(r.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let e=0;e<t.length;e++)r[e]=t[e];else At(t.buffer,r.buffer);this.indexBuffer=r}destroy(){for(let e=0;e<this.batches.length;e++)zt(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e].batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}};Bt.defaultOptions={vertexSize:4,indexSize:6,maxTextures:null};var Vt=Bt,X=(e=>(e[e.MAP_READ=1]=`MAP_READ`,e[e.MAP_WRITE=2]=`MAP_WRITE`,e[e.COPY_SRC=4]=`COPY_SRC`,e[e.COPY_DST=8]=`COPY_DST`,e[e.INDEX=16]=`INDEX`,e[e.VERTEX=32]=`VERTEX`,e[e.UNIFORM=64]=`UNIFORM`,e[e.STORAGE=128]=`STORAGE`,e[e.INDIRECT=256]=`INDIRECT`,e[e.QUERY_RESOLVE=512]=`QUERY_RESOLVE`,e[e.STATIC=1024]=`STATIC`,e))(X||{}),Z=class extends o{constructor(e){let{data:t,size:n}=e,{usage:r,label:i,shrinkToFit:a}=e;super(),this.uid=D(`buffer`),this._resourceType=`buffer`,this._resourceId=D(`resource`),this._touched=0,this._updateID=1,this.shrinkToFit=!0,this.destroyed=!1,t instanceof Array&&(t=new Float32Array(t)),this._data=t,n??=t?.byteLength;let o=!!t;this.descriptor={size:n,usage:r,mappedAtCreation:o,label:i},this.shrinkToFit=a??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get static(){return!!(this.descriptor.usage&X.STATIC)}set static(e){e?this.descriptor.usage|=X.STATIC:this.descriptor.usage&=~X.STATIC}setDataWithSize(e,t,n){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){n&&this.emit(`update`,this);return}let r=this._data;if(this._data=e,r.length!==e.length){!this.shrinkToFit&&e.byteLength<r.byteLength?n&&this.emit(`update`,this):(this.descriptor.size=e.byteLength,this._resourceId=D(`resource`),this.emit(`change`,this));return}n&&this.emit(`update`,this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit(`update`,this)}destroy(){this.destroyed=!0,this.emit(`destroy`,this),this.emit(`change`,this),this._data=null,this.descriptor=null,this.removeAllListeners()}};function Ht(e,t){if(!(e instanceof Z)){let n=t?X.INDEX:X.VERTEX;e instanceof Array&&(t?(e=new Uint32Array(e),n=X.INDEX|X.COPY_DST):(e=new Float32Array(e),n=X.VERTEX|X.COPY_DST)),e=new Z({data:e,label:t?`index-mesh-buffer`:`vertex-mesh-buffer`,usage:n})}return e}function Ut(e,t,n){let r=e.getAttribute(t);if(!r)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;let i=r.buffer.data,a=1/0,o=1/0,s=-1/0,c=-1/0,l=i.BYTES_PER_ELEMENT,u=(r.offset||0)/l,d=(r.stride||8)/l;for(let e=u;e<i.length;e+=d){let t=i[e],n=i[e+1];t>s&&(s=t),n>c&&(c=n),t<a&&(a=t),n<o&&(o=n)}return n.minX=a,n.minY=o,n.maxX=s,n.maxY=c,n}function Wt(e){return(e instanceof Z||Array.isArray(e)||e.BYTES_PER_ELEMENT)&&(e={buffer:e}),e.buffer=Ht(e.buffer,!1),e}var Gt=class extends o{constructor(e){let{attributes:t,indexBuffer:n,topology:r}=e;super(),this.uid=D(`geometry`),this._layoutKey=0,this.instanceCount=1,this._bounds=new M,this._boundsDirty=!0,this.attributes=t,this.buffers=[],this.instanceCount=e.instanceCount||1;for(let e in t){let n=t[e]=Wt(t[e]);this.buffers.indexOf(n.buffer)===-1&&(this.buffers.push(n.buffer),n.buffer.on(`update`,this.onBufferUpdate,this),n.buffer.on(`change`,this.onBufferUpdate,this))}n&&(this.indexBuffer=Ht(n,!0),this.buffers.push(this.indexBuffer)),this.topology=r||`triangle-list`}onBufferUpdate(){this._boundsDirty=!0,this.emit(`update`,this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(let e in this.attributes){let t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,Ut(this,`aPosition`,this._bounds)):this._bounds}destroy(e=!1){this.emit(`destroy`,this),this.removeAllListeners(),e&&this.buffers.forEach(e=>e.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}},Kt=new Float32Array(1),qt=new Uint32Array(1),Jt=class extends Gt{constructor(){let e=new Z({data:Kt,label:`attribute-batch-buffer`,usage:X.VERTEX|X.COPY_DST,shrinkToFit:!1}),t=new Z({data:qt,label:`index-batch-buffer`,usage:X.INDEX|X.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:e,format:`float32x2`,stride:24,offset:0},aUV:{buffer:e,format:`float32x2`,stride:24,offset:8},aColor:{buffer:e,format:`unorm8x4`,stride:24,offset:16},aTextureIdAndRound:{buffer:e,format:`uint16x2`,stride:24,offset:20}},indexBuffer:t})}},Yt={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Xt=0,Zt=1,Qt=2,$t=3,en=4,tn=5,nn=class e{constructor(){this.data=0,this.blendMode=`normal`,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Xt)}set blend(e){!!(this.data&1<<Xt)!==e&&(this.data^=1<<Xt)}get offsets(){return!!(this.data&1<<Zt)}set offsets(e){!!(this.data&1<<Zt)!==e&&(this.data^=1<<Zt)}set cullMode(e){if(e===`none`){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e===`front`}get cullMode(){return this.culling?this.clockwiseFrontFace?`front`:`back`:`none`}get culling(){return!!(this.data&1<<Qt)}set culling(e){!!(this.data&1<<Qt)!==e&&(this.data^=1<<Qt)}get depthTest(){return!!(this.data&1<<$t)}set depthTest(e){!!(this.data&1<<$t)!==e&&(this.data^=1<<$t)}get depthMask(){return!!(this.data&1<<tn)}set depthMask(e){!!(this.data&1<<tn)!==e&&(this.data^=1<<tn)}get clockwiseFrontFace(){return!!(this.data&1<<en)}set clockwiseFrontFace(e){!!(this.data&1<<en)!==e&&(this.data^=1<<en)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==`none`,this._blendMode=e,this._blendModeId=Yt[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new e;return t.depthTest=!1,t.blend=!0,t}};nn.default2d=nn.for2d();var rn=nn;function an(e,t,n){let r=(e>>24&255)/255;t[n++]=(e&255)/255*r,t[n++]=(e>>8&255)/255*r,t[n++]=(e>>16&255)/255*r,t[n++]=r}var on=Object.create(null),sn=Object.create(null);function cn(e,t){let n=sn[e];return n===void 0&&(on[t]===void 0&&(on[t]=1),sn[e]=n=on[t]++),n}var ln=[`f32`,`i32`,`vec2<f32>`,`vec3<f32>`,`vec4<f32>`,`mat2x2<f32>`,`mat3x3<f32>`,`mat4x4<f32>`,`mat3x2<f32>`,`mat4x2<f32>`,`mat2x3<f32>`,`mat4x3<f32>`,`mat2x4<f32>`,`mat3x4<f32>`],un=ln.reduce((e,t)=>(e[t]=!0,e),{});function dn(e,t){switch(e){case`f32`:return 0;case`vec2<f32>`:return new Float32Array(2*t);case`vec3<f32>`:return new Float32Array(3*t);case`vec4<f32>`:return new Float32Array(4*t);case`mat2x2<f32>`:return new Float32Array([1,0,0,1]);case`mat3x3<f32>`:return new Float32Array([1,0,0,0,1,0,0,0,1]);case`mat4x4<f32>`:return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var fn=class e{constructor(t,n){this._touched=0,this.uid=D(`uniform`),this._resourceType=`uniformGroup`,this._resourceId=D(`resource`),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...e.defaultOptions,...n},this.uniformStructures=t;let r={};for(let e in t){let n=t[e];if(n.name=e,n.size=n.size??1,!un[n.type])throw Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${ln.join(`, `)}`);n.value??=dn(n.type,n.size),r[e]=n.value}this.uniforms=r,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=cn(Object.keys(r).map(e=>`${e}-${t[e].type}`).join(`-`),`uniform-group`)}update(){this._dirtyId++}};fn.defaultOptions={ubo:!1,isStatic:!1};var pn=fn,mn=class{constructor(){this.vertexSize=4,this.indexSize=6,this.location=0,this.batcher=null,this.batch=null,this.roundPixels=0}get blendMode(){return this.renderable.groupBlendMode}packAttributes(e,t,n,r){let i=this.renderable,a=this.texture,o=i.groupTransform,s=o.a,c=o.b,l=o.c,u=o.d,d=o.tx,f=o.ty,p=this.bounds,m=p.maxX,h=p.minX,g=p.maxY,_=p.minY,v=a.uvs,y=i.groupColorAlpha,b=r<<16|this.roundPixels&65535;e[n+0]=s*h+l*_+d,e[n+1]=u*_+c*h+f,e[n+2]=v.x0,e[n+3]=v.y0,t[n+4]=y,t[n+5]=b,e[n+6]=s*m+l*_+d,e[n+7]=u*_+c*m+f,e[n+8]=v.x1,e[n+9]=v.y1,t[n+10]=y,t[n+11]=b,e[n+12]=s*m+l*g+d,e[n+13]=u*g+c*m+f,e[n+14]=v.x2,e[n+15]=v.y2,t[n+16]=y,t[n+17]=b,e[n+18]=s*h+l*g+d,e[n+19]=u*g+c*h+f,e[n+20]=v.x3,e[n+21]=v.y3,t[n+22]=y,t[n+23]=b}packIndex(e,t,n){e[t]=n+0,e[t+1]=n+1,e[t+2]=n+2,e[t+3]=n+0,e[t+4]=n+2,e[t+5]=n+3}reset(){this.renderable=null,this.texture=null,this.batcher=null,this.batch=null,this.bounds=null}},hn=0,gn=new class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1}createTexture(e,t,n){return new G({source:new W({...this.textureOptions,width:e,height:t,resolution:1,antialias:n,autoGarbageCollect:!0}),label:`texturePool_${hn++}`})}getOptimalTexture(e,t,n=1,r){let i=Math.ceil(e*n-1e-6),a=Math.ceil(t*n-1e-6);i=lt(i),a=lt(a);let o=(i<<17)+(a<<1)+ +!!r;this._texturePool[o]||(this._texturePool[o]=[]);let s=this._texturePool[o].pop();return s||=this.createTexture(i,a,r),s.source._resolution=n,s.source.width=i/n,s.source.height=a/n,s.source.pixelWidth=i,s.source.pixelHeight=a,s.frame.x=0,s.frame.y=0,s.frame.width=e,s.frame.height=t,s.updateUvs(),this._poolKeyHash[s.uid]=o,s}getSameSizeTexture(e,t=!1){let n=e.source;return this.getOptimalTexture(e.width,e.height,n._resolution,t)}returnTexture(e){let t=this._poolKeyHash[e.uid];this._texturePool[t].push(e)}clear(e){if(e=e!==!1,e)for(let e in this._texturePool){let t=this._texturePool[e];if(t)for(let e=0;e<t.length;e++)t[e].destroy(!0)}this._texturePool={}}},_n;function vn(){if(!_n){_n=`mediump`;let e=wt();e&&e.getShaderPrecisionFormat&&(_n=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision?`highp`:`mediump`)}return _n}function yn(e,t,n){return t?e:n?(e=e.replace(`out vec4 finalColor;`,``),`
|
|
9
|
+
|
|
10
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
11
|
+
#define in varying
|
|
12
|
+
#define finalColor gl_FragColor
|
|
13
|
+
#define texture texture2D
|
|
14
|
+
#endif
|
|
15
|
+
${e}
|
|
16
|
+
`):`
|
|
17
|
+
|
|
18
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
19
|
+
#define in attribute
|
|
20
|
+
#define out varying
|
|
21
|
+
#endif
|
|
22
|
+
${e}
|
|
23
|
+
`}function bn(e,t,n){let r=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(e.substring(0,9)!==`precision`){let i=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return i===`highp`&&r!==`highp`&&(i=`mediump`),`precision ${i} float;
|
|
24
|
+
${e}`}else if(r!==`highp`&&e.substring(0,15)===`precision highp`)return e.replace(`precision highp`,`precision mediump`);return e}function xn(e,t){return t?`#version 300 es
|
|
25
|
+
${e}`:e}var Sn={},Cn={};function wn(e,{name:t=`pixi-program`},n=!0){t=t.replace(/\s+/g,`-`),t+=n?`-fragment`:`-vertex`;let r=n?Sn:Cn;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,e.indexOf(`#define SHADER_NAME`)===-1?`${`#define SHADER_NAME ${t}`}
|
|
26
|
+
${e}`:e}function Tn(e,t){return t?e.replace(`#version 300 es`,``):e}var En={stripVersion:Tn,ensurePrecision:bn,addProgramDefines:yn,setProgramName:wn,insertVersion:xn},Dn=Object.create(null),On=class e{constructor(t){t={...e.defaultOptions,...t};let n=t.fragment.indexOf(`#version 300 es`)!==-1,r={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:`highp`,maxSupportedFragmentPrecision:vn()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n},i=t.fragment,a=t.vertex;Object.keys(En).forEach(e=>{let t=r[e];i=En[e](i,t,!0),a=En[e](a,t,!1)}),this.fragment=i,this.vertex=a,this._key=cn(`${this.vertex}:${this.fragment}`,`gl-program`)}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){let n=`${t.vertex}:${t.fragment}`;return Dn[n]||(Dn[n]=new e(t)),Dn[n]}};On.defaultOptions={preferredVertexPrecision:`highp`,preferredFragmentPrecision:`mediump`};var kn=On,An={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function jn(e){return An[e]??An.float32}var Mn={f32:`float32`,"vec2<f32>":`float32x2`,"vec3<f32>":`float32x3`,"vec4<f32>":`float32x4`,vec2f:`float32x2`,vec3f:`float32x3`,vec4f:`float32x4`,i32:`sint32`,"vec2<i32>":`sint32x2`,"vec3<i32>":`sint32x3`,"vec4<i32>":`sint32x4`,u32:`uint32`,"vec2<u32>":`uint32x2`,"vec3<u32>":`uint32x3`,"vec4<u32>":`uint32x4`,bool:`uint32`,"vec2<bool>":`uint32x2`,"vec3<bool>":`uint32x3`,"vec4<bool>":`uint32x4`};function Nn({source:e,entryPoint:t}){let n={},r=e.indexOf(`fn ${t}`);if(r!==-1){let t=e.indexOf(`->`,r);if(t!==-1){let i=e.substring(r,t),a=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g,o;for(;(o=a.exec(i))!==null;){let e=Mn[o[3]]??`float32`;n[o[2]]={location:parseInt(o[1],10),format:e,stride:jn(e).stride,offset:0,instance:!1,start:0}}}}return n}function Pn(e){let t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,a=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,s=/(\w+)\s*:\s*([\w\<\>]+)/g,c=/struct\s+(\w+)/,l=e.match(t)?.map(e=>({group:parseInt(e.match(n)[1],10),binding:parseInt(e.match(r)[1],10),name:e.match(i)[2],isUniform:e.match(i)[1]===`<uniform>`,type:e.match(a)[1]}));return l?{groups:l,structs:e.match(o)?.map(e=>{let t=e.match(c)[1],n=e.match(s).reduce((e,t)=>{let[n,r]=t.split(`:`);return e[n.trim()]=r.trim(),e},{});return n?{name:t,members:n}:null}).filter(({name:e})=>l.some(t=>t.type===e))??[]}:{groups:[],structs:[]}}var Q=(e=>(e[e.VERTEX=1]=`VERTEX`,e[e.FRAGMENT=2]=`FRAGMENT`,e[e.COMPUTE=4]=`COMPUTE`,e))(Q||{});function Fn({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]=[]),r.isUniform?t[r.group].push({binding:r.binding,visibility:Q.VERTEX|Q.FRAGMENT,buffer:{type:`uniform`}}):r.type===`sampler`?t[r.group].push({binding:r.binding,visibility:Q.FRAGMENT,sampler:{type:`filtering`}}):r.type===`texture_2d`&&t[r.group].push({binding:r.binding,visibility:Q.FRAGMENT,texture:{sampleType:`float`,viewDimension:`2d`,multisampled:!1}})}return t}function In({groups:e}){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function Ln(e,t){let n=new Set,r=new Set;return{structs:[...e.structs,...t.structs].filter(e=>n.has(e.name)?!1:(n.add(e.name),!0)),groups:[...e.groups,...t.groups].filter(e=>{let t=`${e.name}-${e.binding}`;return r.has(t)?!1:(r.add(t),!0)})}}var Rn=Object.create(null),zn=class e{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:t,vertex:n,layout:r,gpuLayout:i,name:a}=e;if(this.name=a,this.fragment=t,this.vertex=n,t.source===n.source){let e=Pn(t.source);this.structsAndGroups=e}else{let e=Pn(n.source),r=Pn(t.source);this.structsAndGroups=Ln(e,r)}this.layout=r??In(this.structsAndGroups),this.gpuLayout=i??Fn(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){let{vertex:e,fragment:t}=this,n=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=cn(n,`program`)}get attributeData(){return this._attributeData??=Nn(this.vertex),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){let n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Rn[n]||(Rn[n]=new e(t)),Rn[n]}};function Bn(e,t,n){if(e)for(let r in e){let i=t[r.toLocaleLowerCase()];if(i){let t=e[r];r===`header`&&(t=t.replace(/@in\s+[^;]+;\s*/g,``).replace(/@out\s+[^;]+;\s*/g,``)),n&&i.push(`//----${n}----//`),i.push(t)}else Le(`${r} placement hook does not exist in shader`)}}var Vn=/\{\{(.*?)\}\}/g;function Hn(e){let t={};return(e.match(Vn)?.map(e=>e.replace(/[{()}]/g,``))??[]).forEach(e=>{t[e]=[]}),t}function Un(e,t){let n,r=/@in\s+([^;]+);/g;for(;(n=r.exec(e))!==null;)t.push(n[1])}function Wn(e,t,n=!1){let r=[];Un(t,r),e.forEach(e=>{e.header&&Un(e.header,r)});let i=r;n&&i.sort();let a=i.map((e,t)=>` @location(${t}) ${e},`).join(`
|
|
27
|
+
`),o=t.replace(/@in\s+[^;]+;\s*/g,``);return o=o.replace(`{{in}}`,`
|
|
28
|
+
${a}
|
|
29
|
+
`),o}function Gn(e,t){let n,r=/@out\s+([^;]+);/g;for(;(n=r.exec(e))!==null;)t.push(n[1])}function Kn(e){let t=/\b(\w+)\s*:/g.exec(e);return t?t[1]:``}function qn(e){return e.replace(/@.*?\s+/g,``)}function Jn(e,t){let n=[];Gn(t,n),e.forEach(e=>{e.header&&Gn(e.header,n)});let r=0,i=n.sort().map(e=>e.indexOf(`builtin`)>-1?e:`@location(${r++}) ${e}`).join(`,
|
|
30
|
+
`),a=n.sort().map(e=>` var ${qn(e)};`).join(`
|
|
31
|
+
`),o=`return VSOutput(
|
|
32
|
+
${n.sort().map(e=>` ${Kn(e)}`).join(`,
|
|
33
|
+
`)});`,s=t.replace(/@out\s+[^;]+;\s*/g,``);return s=s.replace(`{{struct}}`,`
|
|
34
|
+
${i}
|
|
35
|
+
`),s=s.replace(`{{start}}`,`
|
|
36
|
+
${a}
|
|
37
|
+
`),s=s.replace(`{{return}}`,`
|
|
38
|
+
${o}
|
|
39
|
+
`),s}function Yn(e,t){let n=e;for(let e in t){let r=t[e];n=r.join(`
|
|
40
|
+
`).length?n.replace(`{{${e}}}`,`//-----${e} START-----//
|
|
41
|
+
${r.join(`
|
|
42
|
+
`)}
|
|
43
|
+
//----${e} FINISH----//`):n.replace(`{{${e}}}`,``)}return n}var $=Object.create(null),Xn=new Map,Zn=0;function Qn({template:e,bits:t}){let n=tr(e,t);if($[n])return $[n];let{vertex:r,fragment:i}=er(e,t);return $[n]=nr(r,i,t),$[n]}function $n({template:e,bits:t}){let n=tr(e,t);return $[n]||($[n]=nr(e.vertex,e.fragment,t)),$[n]}function er(e,t){let n=t.map(e=>e.vertex).filter(e=>!!e),r=t.map(e=>e.fragment).filter(e=>!!e),i=Wn(n,e.vertex,!0);i=Jn(n,i);let a=Wn(r,e.fragment,!0);return{vertex:i,fragment:a}}function tr(e,t){return t.map(e=>(Xn.has(e)||Xn.set(e,Zn++),Xn.get(e))).sort((e,t)=>e-t).join(`-`)+e.vertex+e.fragment}function nr(e,t,n){let r=Hn(e),i=Hn(t);return n.forEach(e=>{Bn(e.vertex,r,e.name),Bn(e.fragment,i,e.name)}),{vertex:Yn(e,r),fragment:Yn(t,i)}}var rr=`
|
|
44
|
+
@in aPosition: vec2<f32>;
|
|
45
|
+
@in aUV: vec2<f32>;
|
|
46
|
+
|
|
47
|
+
@out @builtin(position) vPosition: vec4<f32>;
|
|
48
|
+
@out vUV : vec2<f32>;
|
|
49
|
+
@out vColor : vec4<f32>;
|
|
50
|
+
|
|
51
|
+
{{header}}
|
|
52
|
+
|
|
53
|
+
struct VSOutput {
|
|
54
|
+
{{struct}}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
@vertex
|
|
58
|
+
fn main( {{in}} ) -> VSOutput {
|
|
59
|
+
|
|
60
|
+
var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
|
|
61
|
+
var modelMatrix = mat3x3<f32>(
|
|
62
|
+
1.0, 0.0, 0.0,
|
|
63
|
+
0.0, 1.0, 0.0,
|
|
64
|
+
0.0, 0.0, 1.0
|
|
65
|
+
);
|
|
66
|
+
var position = aPosition;
|
|
67
|
+
var uv = aUV;
|
|
68
|
+
|
|
69
|
+
{{start}}
|
|
70
|
+
|
|
71
|
+
vColor = vec4<f32>(1., 1., 1., 1.);
|
|
72
|
+
|
|
73
|
+
{{main}}
|
|
74
|
+
|
|
75
|
+
vUV = uv;
|
|
76
|
+
|
|
77
|
+
var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
78
|
+
|
|
79
|
+
vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
|
|
80
|
+
|
|
81
|
+
vColor *= globalUniforms.uWorldColorAlpha;
|
|
82
|
+
|
|
83
|
+
{{end}}
|
|
84
|
+
|
|
85
|
+
{{return}}
|
|
86
|
+
};
|
|
87
|
+
`,ir=`
|
|
88
|
+
@in vUV : vec2<f32>;
|
|
89
|
+
@in vColor : vec4<f32>;
|
|
90
|
+
|
|
91
|
+
{{header}}
|
|
92
|
+
|
|
93
|
+
@fragment
|
|
94
|
+
fn main(
|
|
95
|
+
{{in}}
|
|
96
|
+
) -> @location(0) vec4<f32> {
|
|
97
|
+
|
|
98
|
+
{{start}}
|
|
99
|
+
|
|
100
|
+
var outColor:vec4<f32>;
|
|
101
|
+
|
|
102
|
+
{{main}}
|
|
103
|
+
|
|
104
|
+
return outColor * vColor;
|
|
105
|
+
};
|
|
106
|
+
`,ar=`
|
|
107
|
+
in vec2 aPosition;
|
|
108
|
+
in vec2 aUV;
|
|
109
|
+
|
|
110
|
+
out vec4 vColor;
|
|
111
|
+
out vec2 vUV;
|
|
112
|
+
|
|
113
|
+
{{header}}
|
|
114
|
+
|
|
115
|
+
void main(void){
|
|
116
|
+
|
|
117
|
+
mat3 worldTransformMatrix = uWorldTransformMatrix;
|
|
118
|
+
mat3 modelMatrix = mat3(
|
|
119
|
+
1.0, 0.0, 0.0,
|
|
120
|
+
0.0, 1.0, 0.0,
|
|
121
|
+
0.0, 0.0, 1.0
|
|
122
|
+
);
|
|
123
|
+
vec2 position = aPosition;
|
|
124
|
+
vec2 uv = aUV;
|
|
125
|
+
|
|
126
|
+
{{start}}
|
|
127
|
+
|
|
128
|
+
vColor = vec4(1.);
|
|
129
|
+
|
|
130
|
+
{{main}}
|
|
131
|
+
|
|
132
|
+
vUV = uv;
|
|
133
|
+
|
|
134
|
+
mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
135
|
+
|
|
136
|
+
gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
137
|
+
|
|
138
|
+
vColor *= uWorldColorAlpha;
|
|
139
|
+
|
|
140
|
+
{{end}}
|
|
141
|
+
}
|
|
142
|
+
`,or=`
|
|
143
|
+
|
|
144
|
+
in vec4 vColor;
|
|
145
|
+
in vec2 vUV;
|
|
146
|
+
|
|
147
|
+
out vec4 finalColor;
|
|
148
|
+
|
|
149
|
+
{{header}}
|
|
150
|
+
|
|
151
|
+
void main(void) {
|
|
152
|
+
|
|
153
|
+
{{start}}
|
|
154
|
+
|
|
155
|
+
vec4 outColor;
|
|
156
|
+
|
|
157
|
+
{{main}}
|
|
158
|
+
|
|
159
|
+
finalColor = outColor * vColor;
|
|
160
|
+
}
|
|
161
|
+
`,sr={name:`global-uniforms-bit`,vertex:{header:`
|
|
162
|
+
struct GlobalUniforms {
|
|
163
|
+
uProjectionMatrix:mat3x3<f32>,
|
|
164
|
+
uWorldTransformMatrix:mat3x3<f32>,
|
|
165
|
+
uWorldColorAlpha: vec4<f32>,
|
|
166
|
+
uResolution: vec2<f32>,
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
170
|
+
`}},cr={name:`global-uniforms-bit`,vertex:{header:`
|
|
171
|
+
uniform mat3 uProjectionMatrix;
|
|
172
|
+
uniform mat3 uWorldTransformMatrix;
|
|
173
|
+
uniform vec4 uWorldColorAlpha;
|
|
174
|
+
uniform vec2 uResolution;
|
|
175
|
+
`}};function lr({bits:e,name:t}){let n=Qn({template:{fragment:ir,vertex:rr},bits:[sr,...e]});return zn.from({name:t,vertex:{source:n.vertex,entryPoint:`main`},fragment:{source:n.fragment,entryPoint:`main`}})}function ur({bits:e,name:t}){return new kn({name:t,...$n({template:{vertex:ar,fragment:or},bits:[cr,...e]})})}var dr={name:`color-bit`,vertex:{header:`
|
|
176
|
+
@in aColor: vec4<f32>;
|
|
177
|
+
`,main:`
|
|
178
|
+
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
179
|
+
`}},fr={name:`color-bit`,vertex:{header:`
|
|
180
|
+
in vec4 aColor;
|
|
181
|
+
`,main:`
|
|
182
|
+
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
183
|
+
`}},pr={};function mr(e){let t=[];if(e===1)t.push(`@group(1) @binding(0) var textureSource1: texture_2d<f32>;`),t.push(`@group(1) @binding(1) var textureSampler1: sampler;`);else{let n=0;for(let r=0;r<e;r++)t.push(`@group(1) @binding(${n++}) var textureSource${r+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${r+1}: sampler;`)}return t.join(`
|
|
184
|
+
`)}function hr(e){let t=[];if(e===1)t.push(`outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);`);else{t.push(`switch vTextureId {`);for(let n=0;n<e;n++)n===e-1?t.push(` default:{`):t.push(` case ${n}:{`),t.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),t.push(` break;}`);t.push(`}`)}return t.join(`
|
|
185
|
+
`)}function gr(e){return pr[e]||(pr[e]={name:`texture-batch-bit`,vertex:{header:`
|
|
186
|
+
@in aTextureIdAndRound: vec2<u32>;
|
|
187
|
+
@out @interpolate(flat) vTextureId : u32;
|
|
188
|
+
`,main:`
|
|
189
|
+
vTextureId = aTextureIdAndRound.y;
|
|
190
|
+
`,end:`
|
|
191
|
+
if(aTextureIdAndRound.x == 1)
|
|
192
|
+
{
|
|
193
|
+
vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
194
|
+
}
|
|
195
|
+
`},fragment:{header:`
|
|
196
|
+
@in @interpolate(flat) vTextureId: u32;
|
|
197
|
+
|
|
198
|
+
${mr(e)}
|
|
199
|
+
`,main:`
|
|
200
|
+
var uvDx = dpdx(vUV);
|
|
201
|
+
var uvDy = dpdy(vUV);
|
|
202
|
+
|
|
203
|
+
${hr(e)}
|
|
204
|
+
`}}),pr[e]}var _r={};function vr(e){let t=[];for(let n=0;n<e;n++)n>0&&t.push(`else`),n<e-1&&t.push(`if(vTextureId < ${n}.5)`),t.push(`{`),t.push(` outColor = texture(uTextures[${n}], vUV);`),t.push(`}`);return t.join(`
|
|
205
|
+
`)}function yr(e){return _r[e]||(_r[e]={name:`texture-batch-bit`,vertex:{header:`
|
|
206
|
+
in vec2 aTextureIdAndRound;
|
|
207
|
+
out float vTextureId;
|
|
208
|
+
|
|
209
|
+
`,main:`
|
|
210
|
+
vTextureId = aTextureIdAndRound.y;
|
|
211
|
+
`,end:`
|
|
212
|
+
if(aTextureIdAndRound.x == 1.)
|
|
213
|
+
{
|
|
214
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
215
|
+
}
|
|
216
|
+
`},fragment:{header:`
|
|
217
|
+
in float vTextureId;
|
|
218
|
+
|
|
219
|
+
uniform sampler2D uTextures[${e}];
|
|
220
|
+
|
|
221
|
+
`,main:`
|
|
222
|
+
|
|
223
|
+
${vr(e)}
|
|
224
|
+
`}}),_r[e]}var br={name:`round-pixels-bit`,vertex:{header:`
|
|
225
|
+
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
226
|
+
{
|
|
227
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
228
|
+
}
|
|
229
|
+
`}},xr={name:`round-pixels-bit`,vertex:{header:`
|
|
230
|
+
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
231
|
+
{
|
|
232
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
233
|
+
}
|
|
234
|
+
`}},Sr=(e=>(e[e.WEBGL=1]=`WEBGL`,e[e.WEBGPU=2]=`WEBGPU`,e[e.BOTH=3]=`BOTH`,e))(Sr||{}),Cr=class e extends o{constructor(e){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:n,groups:r,resources:i,compatibleRenderers:a,groupMap:o}=e;this.gpuProgram=t,this.glProgram=n,a===void 0&&(a=0,t&&(a|=Sr.WEBGPU),n&&(a|=Sr.WEBGL)),this.compatibleRenderers=a;let s={};if(!i&&!r&&(i={}),i&&r)throw Error(`[Shader] Cannot have both resources and groups`);if(!t&&r&&!o)throw Error(`[Shader] No group map or WebGPU shader provided - consider using resources instead.`);if(!t&&r&&o)for(let e in o)for(let t in o[e]){let n=o[e][t];s[n]={group:e,binding:t,name:n}}else if(t&&r&&!o){let e=t.structsAndGroups.groups;o={},e.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,s[e.name]=e})}else if(i){r={},o={},t&&t.structsAndGroups.groups.forEach(e=>{o[e.group]=o[e.group]||{},o[e.group][e.binding]=e.name,s[e.name]=e});let e=0;for(let t in i)s[t]||(r[99]||(r[99]=new K,this._ownedBindGroups.push(r[99])),s[t]={group:99,binding:e,name:t},o[99]=o[99]||{},o[99][e]=t,e++);for(let e in i){let t=e,n=i[e];!n.source&&!n._resourceType&&(n=new pn(n));let a=s[t];a&&(r[a.group]||(r[a.group]=new K,this._ownedBindGroups.push(r[a.group])),r[a.group].setResource(n,a.binding))}}this.groups=r,this._uniformBindMap=o,this.resources=this._buildResourceAccessor(r,s)}addResource(e,t,n){var r,i;(r=this._uniformBindMap)[t]||(r[t]={}),(i=this._uniformBindMap[t])[n]||(i[n]=e),this.groups[t]||(this.groups[t]=new K,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){let n={};for(let r in t){let i=t[r];Object.defineProperty(n,i.name,{get(){return e[i.group].getResource(i.binding)},set(t){e[i.group].setResource(t,i.binding)}})}return n}destroy(e=!1){this.emit(`destroy`,this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=zn.from(n)),r&&(o=kn.from(r)),new e({gpuProgram:a,glProgram:o,...i})}},wr={name:`local-uniform-bit`,vertex:{header:`
|
|
235
|
+
|
|
236
|
+
struct LocalUniforms {
|
|
237
|
+
uTransformMatrix:mat3x3<f32>,
|
|
238
|
+
uColor:vec4<f32>,
|
|
239
|
+
uRound:f32,
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
243
|
+
`,main:`
|
|
244
|
+
vColor *= localUniforms.uColor;
|
|
245
|
+
modelMatrix *= localUniforms.uTransformMatrix;
|
|
246
|
+
`,end:`
|
|
247
|
+
if(localUniforms.uRound == 1)
|
|
248
|
+
{
|
|
249
|
+
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
250
|
+
}
|
|
251
|
+
`}},Tr={...wr,vertex:{...wr.vertex,header:wr.vertex.header.replace(`group(1)`,`group(2)`)}},Er={name:`local-uniform-bit`,vertex:{header:`
|
|
252
|
+
|
|
253
|
+
uniform mat3 uTransformMatrix;
|
|
254
|
+
uniform vec4 uColor;
|
|
255
|
+
uniform float uRound;
|
|
256
|
+
`,main:`
|
|
257
|
+
vColor *= uColor;
|
|
258
|
+
modelMatrix = uTransformMatrix;
|
|
259
|
+
`,end:`
|
|
260
|
+
if(uRound == 1.)
|
|
261
|
+
{
|
|
262
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
263
|
+
}
|
|
264
|
+
`}};export{M as $,At as A,W as B,Jt as C,Vt as D,X as E,xt as F,L as G,lt as H,bt as I,Re as J,I as K,G as L,K as M,Ct as N,Nt as O,St as P,N as Q,yt as R,rn as S,Z as T,it as U,ht as V,nt as W,Ne as X,Le as Y,P as Z,gn as _,Sr as a,O as at,cn as b,gr as c,T as ct,fr as d,o as dt,je as et,ur as f,n as ft,kn as g,jn as h,Cr as i,k as it,Ot as j,Mt as k,yr as l,w as lt,zn as m,Er as n,Te as nt,br as o,D as ot,lr as p,a as pt,Je as q,Tr as r,A as rt,xr as s,E as st,wr as t,De as tt,dr as u,me as ut,mn as v,Gt as w,an as x,pn as y,_t as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./index-BAVYPHsj.js";var t=class extends e{constructor(){super(...arguments),this.group=`CapacitorStorage`}async configure({group:e}){typeof e==`string`&&(this.group=e)}async get(e){return{value:this.impl.getItem(this.applyPrefix(e.key))}}async set(e){this.impl.setItem(this.applyPrefix(e.key),e.value)}async remove(e){this.impl.removeItem(this.applyPrefix(e.key))}async keys(){return{keys:this.rawKeys().map(e=>e.substring(this.prefix.length))}}async clear(){for(let e of this.rawKeys())this.impl.removeItem(e)}async migrate(){let e=[],t=[],n=Object.keys(this.impl).filter(e=>e.indexOf(`_cap_`)===0);for(let r of n){let n=r.substring(5),i=this.impl.getItem(r)??``,{value:a}=await this.get({key:n});typeof a==`string`?t.push(n):(await this.set({key:n,value:i}),e.push(n))}return{migrated:e,existing:t}}async removeOld(){let e=Object.keys(this.impl).filter(e=>e.indexOf(`_cap_`)===0);for(let t of e)this.impl.removeItem(t)}get impl(){return window.localStorage}get prefix(){return this.group===`NativeStorage`?``:`${this.group}.`}rawKeys(){return Object.keys(this.impl).filter(e=>e.indexOf(this.prefix)===0)}applyPrefix(e){return this.prefix+e}};export{t as PreferencesWeb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./index-BAVYPHsj.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./FilterSystem-Cc8XEqAi.js";import"./init-DeL9YIMj.js";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg role="img" aria-label="Herdr logo" xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
|
|
2
|
+
<rect width="512" height="512" fill="#d9dad8"/>
|
|
3
|
+
<g fill="#303438" transform="translate(0 512) scale(.1 -.1)" stroke="none">
|
|
4
|
+
<path d="M2794 3710 c-129 -33 -299 -135 -359 -214 -21 -28 -26 -42 -21 -63 9 -38 154 -178 199 -192 32 -11 41 -9 104 23 171 86 354 70 475 -43 150 -138 150 -379 0 -511 -107 -95 -278 -94 -386 2 l-46 40 -11 -29 c-16 -40 -14 -122 4 -164 60 -144 264 -222 452 -174 360 92 559 494 430 868 -36 103 -81 173 -175 267 -71 72 -100 93 -180 132 -52 26 -127 54 -167 62 -96 21 -230 20 -319 -4z M2183 3695 c-116 -32 -221 -108 -273 -199 -17 -28 -30 -54 -30 -58 0 -4 20 1 45 12 66 28 220 68 294 76 64 7 65 7 137 83 40 41 71 77 69 79 -2 2 -21 8 -42 13 -55 12 -140 10 -200 -6z M2212 3388 c-159 -22 -390 -122 -559 -241 -299 -210 -585 -600 -609 -828 -12 -118 40 -251 125 -318 96 -76 178 -98 426 -116 110 -8 224 -21 254 -29 125 -34 230 -115 272 -211 11 -24 24 -81 30 -127 20 -170 65 -271 166 -374 34 -35 63 -65 63 -67 0 -1 -10 -27 -22 -57 -29 -76 -37 -259 -14 -350 42 -170 158 -318 311 -397 44 -23 98 -46 120 -52 22 -6 45 -14 51 -18 5 -5 15 -48 22 -96 6 -48 14 -92 17 -97 4 -6 415 -10 1131 -10 l1124 0 0 1584 0 1585 -55 -19 c-84 -29 -143 -68 -232 -154 l-83 -78 -54 49 c-111 102 -233 151 -391 160 -113 6 -199 -10 -298 -54 l-60 -27 -26 34 c-37 51 -120 134 -127 128 -3 -4 0 -34 7 -67 17 -89 7 -268 -21 -356 -103 -328 -377 -545 -688 -545 -161 0 -273 41 -373 137 -37 35 -66 75 -85 116 -79 173 -8 407 124 407 44 0 68 -14 117 -66 74 -78 167 -82 238 -9 60 62 72 147 33 231 -42 90 -120 130 -238 122 -50 -4 -85 -14 -131 -37 -89 -45 -122 -52 -176 -40 -92 20 -262 163 -302 253 -11 25 -21 45 -22 45 -1 -1 -30 -6 -65 -11z m-256 -505 c115 -88 129 -102 132 -131 2 -18 -2 -40 -9 -49 -7 -8 -69 -55 -138 -105 -103 -73 -130 -88 -151 -83 -35 8 -51 34 -48 74 3 31 12 42 83 92 44 31 80 61 82 66 1 4 -30 31 -69 58 -39 28 -77 56 -85 63 -18 19 -16 72 4 94 32 35 63 23 199 -79z m528 -88 c23 -24 28 -52 14 -82 l-13 -28 -141 -3 c-130 -2 -142 -1 -158 17 -23 26 -24 66 -1 91 16 18 32 20 151 20 105 0 136 -3 148 -15z"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
|
|
8
|
+
/>
|
|
9
|
+
<meta name="theme-color" content="#11111b" />
|
|
10
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
11
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
12
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
13
|
+
<link rel="manifest" href="/manifest.json" />
|
|
14
|
+
<link rel="apple-touch-icon" href="/herdr-logo-180.png" />
|
|
15
|
+
<link rel="icon" href="/herdr-logo.svg" type="image/svg+xml" />
|
|
16
|
+
<title>Herdr World</title>
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-BAVYPHsj.js"></script>
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-QTnfLwEv.js">
|
|
19
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B1fwFDFH.css">
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<div id="root"></div>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|