>>1,E=E>>>1}let M=y;for(let S=0;Snew Ae(b,{format:m,width:r,height:s,levels:n}))}throw o&Rp?new Error("DDSParser does not support uncompressed texture data."):o&Ip?new Error("DDSParser does not supported YUV uncompressed texture data."):o&Cp?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&wp?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const vl=[171,75,84,88,32,49,49,187,13,10,26,10],Lp=67305985,Vt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Bn=64,Fn={[k.UNSIGNED_BYTE]:1,[k.UNSIGNED_SHORT]:2,[k.INT]:4,[k.UNSIGNED_INT]:4,[k.FLOAT]:4,[k.HALF_FLOAT]:8},yl={[A.RGBA]:4,[A.RGB]:3,[A.RG]:2,[A.RED]:1,[A.LUMINANCE]:1,[A.LUMINANCE_ALPHA]:2,[A.ALPHA]:1},xl={[k.UNSIGNED_SHORT_4_4_4_4]:2,[k.UNSIGNED_SHORT_5_5_5_1]:2,[k.UNSIGNED_SHORT_5_6_5]:2};function bl(i,t,e=!1){const s=new DataView(t);if(!Up(i,s))return null;const r=s.getUint32(Vt.ENDIANNESS,!0)===Lp,n=s.getUint32(Vt.GL_TYPE,r),a=s.getUint32(Vt.GL_FORMAT,r),o=s.getUint32(Vt.GL_INTERNAL_FORMAT,r),h=s.getUint32(Vt.PIXEL_WIDTH,r),l=s.getUint32(Vt.PIXEL_HEIGHT,r)||1,u=s.getUint32(Vt.PIXEL_DEPTH,r)||1,c=s.getUint32(Vt.NUMBER_OF_ARRAY_ELEMENTS,r)||1,d=s.getUint32(Vt.NUMBER_OF_FACES,r),f=s.getUint32(Vt.NUMBER_OF_MIPMAP_LEVELS,r),p=s.getUint32(Vt.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||u!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(c!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,y=h+3&-4,b=l+3&-4,v=new Array(c);let x=h*l;n===0&&(x=y*b);let E;if(n!==0?Fn[n]?E=Fn[n]*yl[a]:E=xl[n]:E=Ns[o],E===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const M=e?Gp(s,p,r):null;let S=x*E,w=h,F=l,G=y,Y=b,N=Bn+p;for(let T=0;T1||n!==0?w:G,levelHeight:f>1||n!==0?F:Y,levelBuffer:new Uint8Array(t,$,S)},$+=S}N+=R+4,N=N%4!==0?N+4-N%4:N,w=w>>1||1,F=F>>1||1,G=w+m-1&~(m-1),Y=F+g-1&~(g-1),S=G*Y*E}return n!==0?{uncompressed:v.map(T=>{let R=T[0].levelBuffer,$=!1;return n===k.FLOAT?R=new Float32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4):n===k.UNSIGNED_INT?($=!0,R=new Uint32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)):n===k.INT&&($=!0,R=new Int32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)),{resource:new _s(R,{width:T[0].levelWidth,height:T[0].levelHeight}),type:n,format:$?kp(a):a}}),kvData:M}:{compressed:v.map(T=>new Ae(null,{format:o,width:h,height:l,levels:f,levelBuffers:T})),kvData:M}}function Up(i,t){for(let e=0;et-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;ht in i?$p(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Vp=(i,t)=>{for(var e in t||(t={}))Hp.call(t,e)&&El(i,e,t[e]);if(Tl)for(var e of Tl(t))Xp.call(t,e)&&El(i,e,t[e]);return i};const Al={extension:{type:I.LoadParser,priority:Nt.High},name:"loadDDS",test(i){return de(i,".dds")},async load(i,t,e){const s=await(await O.ADAPTER.fetch(i)).arrayBuffer(),r=_l(s).map(n=>{const a=new V(n,Vp({mipmap:Ut.OFF,alphaMode:Tt.NO_PREMULTIPLIED_ALPHA,resolution:Kt(i)},t.data));return Ze(a,e,i)});return r.length===1?r[0]:r},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};L.add(Al);var jp=Object.defineProperty,wl=Object.getOwnPropertySymbols,Wp=Object.prototype.hasOwnProperty,zp=Object.prototype.propertyIsEnumerable,Sl=(i,t,e)=>t in i?jp(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Yp=(i,t)=>{for(var e in t||(t={}))Wp.call(t,e)&&Sl(i,e,t[e]);if(wl)for(var e of wl(t))zp.call(t,e)&&Sl(i,e,t[e]);return i};const Rl={extension:{type:I.LoadParser,priority:Nt.High},name:"loadKTX",test(i){return de(i,".ktx")},async load(i,t,e){const s=await(await O.ADAPTER.fetch(i)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=bl(i,s),o=r!=null?r:n,h=Yp({mipmap:Ut.OFF,alphaMode:Tt.NO_PREMULTIPLIED_ALPHA,resolution:Kt(i)},t.data),l=o.map(u=>{var c;o===n&&Object.assign(h,{type:u.type,format:u.format});const d=(c=u.resource)!=null?c:u,f=new V(d,h);return f.ktxKeyValueData=a,Ze(f,e,i)});return l.length===1?l[0]:l},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};L.add(Rl);const qp=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],Il={extension:I.ResolveParser,test:i=>{const t=ct.extname(i).slice(1);return["basis","ktx","dds"].includes(t)},parse:i=>{var t,e,s,r;const n=i.split("."),a=n.pop();if(["ktx","dds"].includes(a)){const o=n.pop();if(qp.includes(o))return{resolution:parseFloat((e=(t=O.RETINA_PREFIX.exec(i))==null?void 0:t[1])!=null?e:"1"),format:o,src:i}}return{resolution:parseFloat((r=(s=O.RETINA_PREFIX.exec(i))==null?void 0:s[1])!=null?r:"1"),format:a,src:i}}};L.add(Il);const Hi=new j,Kp=4,Cl=class Ks{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(t,e,s,r){const n=new Image;return n.src=await this.base64(t,e,s,r),n}async base64(t,e,s,r){const n=this.canvas(t,r);if(n.toBlob!==void 0)return new Promise((a,o)=>{n.toBlob(h=>{if(!h){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=o,l.readAsDataURL(h)},e,s)});if(n.toDataURL!==void 0)return n.toDataURL(e,s);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:e,quality:s});return new Promise((o,h)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(a)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);a&&Ks._flipY(s,r,n),o&&Ks._unpremultiplyAlpha(s);const h=new eo(r,n,1),l=new ImageData(new Uint8ClampedArray(s.buffer),r,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);return a&&Ks._flipY(s,r,n),o&&Ks._unpremultiplyAlpha(s),s}_rawPixels(t,e){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let r,n=!1,a=!1,o,h=!1;t&&(t instanceof xe?o=t:(o=s.generateTexture(t,{region:e,resolution:s.resolution,multisample:s.multisample}),h=!0,e&&(Hi.width=e.width,Hi.height=e.height,e=Hi)));const l=s.gl;if(o){if(r=o.baseTexture.resolution,e=e!=null?e:o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===A.RGBA,!h){s.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[s.CONTEXT_UID];f.blitFramebuffer&&s.framebuffer.bind(f.blitFramebuffer)}}else r=s.resolution,e||(e=Hi,e.width=s.width/r,e.height=s.height/r),n=!0,a=this._rendererPremultipliedAlpha,s.renderTexture.bind();const u=Math.max(Math.round(e.width*r),1),c=Math.max(Math.round(e.height*r),1),d=new Uint8Array(Kp*u*c);return l.readPixels(Math.round(e.x*r),Math.round(e.y*r),u,c,l.RGBA,l.UNSIGNED_BYTE,d),h&&(o==null||o.destroy(!0)),{pixels:d,width:u,height:c,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,s){const r=e<<2,n=s>>1,a=new Uint8Array(r);for(let o=0;o=0&&o>=0&&r>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(a+o)),l=h*8+(r?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+r,t[1]=t[3]=s+n,t[2]=t[4]=e-r,t[5]=t[7]=s-n;return}let u=0,c=h*4+(r?2:0)+2,d=c,f=l;{const p=r+a,m=n,g=e+p,y=e-p,b=s+m;if(t[u++]=g,t[u++]=b,t[--c]=b,t[--c]=y,n){const v=s-m;t[d++]=y,t[d++]=v,t[--f]=v,t[--f]=g}}for(let p=1;p0||t&&s<=0){const r=e/2;for(let n=r+r%2;n=6){Ml(e,!1);const a=[];for(let l=0;l=0&&n>=0&&a.push(e,s,e+r,s,e+r,s+n,e,s+n)},triangulate(i,t){const e=i.points,s=t.points;if(e.length===0)return;const r=s.length/2;s.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},Ol={build(i){Ls.build(i)},triangulate(i,t){Ls.triangulate(i,t)}};var It=(i=>(i.MITER="miter",i.BEVEL="bevel",i.ROUND="round",i))(It||{}),fe=(i=>(i.BUTT="butt",i.ROUND="round",i.SQUARE="square",i))(fe||{});const we={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(i,t=20){if(!this.adaptive||!i||isNaN(i))return t;let e=Math.ceil(i/this.maxLength);return ethis.maxSegments&&(e=this.maxSegments),e}},Zp=we;class Ln{static curveTo(t,e,s,r,n,a){const o=a[a.length-2],h=a[a.length-1]-e,l=o-t,u=r-e,c=s-t,d=Math.abs(h*c-l*u);if(d<1e-8||n===0)return(a[a.length-2]!==t||a[a.length-1]!==e)&&a.push(t,e),null;const f=h*h+l*l,p=u*u+c*c,m=h*u+l*c,g=n*Math.sqrt(f)/d,y=n*Math.sqrt(p)/d,b=g*m/f,v=y*m/p,x=g*c+y*l,E=g*u+y*h,M=l*(y+b),S=h*(y+b),w=c*(g+v),F=u*(g+v),G=Math.atan2(S-E,M-x),Y=Math.atan2(F-E,w-x);return{cx:x+t,cy:E+e,radius:n,startAngle:G,endAngle:Y,anticlockwise:l*u>c*h}}static arc(t,e,s,r,n,a,o,h,l){const u=o-a,c=we._segmentsCount(Math.abs(u)*n,Math.ceil(Math.abs(u)/ys)*40),d=u/(c*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=c-1,y=g%1/g;for(let b=0;b<=g;++b){const v=b+y*b,x=d+a+f*v,E=Math.cos(x),M=-Math.sin(x);l.push((p*E+m*M)*n+s,(p*-M+m*E)*n+r)}}}class Bl{constructor(){this.reset()}begin(t,e,s){this.reset(),this.style=t,this.start=e,this.attribStart=s}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Xi{static curveLength(t,e,s,r,n,a,o,h){let l=0,u=0,c=0,d=0,f=0,p=0,m=0,g=0,y=0,b=0,v=0,x=t,E=e;for(let M=1;M<=10;++M)u=M/10,c=u*u,d=c*u,f=1-u,p=f*f,m=p*f,g=m*t+3*p*u*s+3*f*c*n+d*o,y=m*e+3*p*u*r+3*f*c*a+d*h,b=x-g,v=E-y,x=g,E=y,l+=Math.sqrt(b*b+v*v);return l}static curveTo(t,e,s,r,n,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const u=we._segmentsCount(Xi.curveLength(h,l,t,e,s,r,n,a));let c=0,d=0,f=0,p=0,m=0;o.push(h,l);for(let g=1,y=0;g<=u;++g)y=g/u,c=1-y,d=c*c,f=d*c,p=y*y,m=p*y,o.push(f*h+3*d*y*t+3*c*p*s+m*n,f*l+3*d*y*e+3*c*p*r+m*a)}}function Fl(i,t,e,s,r,n,a,o){const h=i-e*r,l=t-s*r,u=i+e*n,c=t+s*n;let d,f;a?(d=s,f=-e):(d=-s,f=e);const p=h+d,m=l+f,g=u+d,y=c+f;return o.push(p,m,g,y),2}function Ge(i,t,e,s,r,n,a,o){const h=e-i,l=s-t;let u=Math.atan2(h,l),c=Math.atan2(r-i,n-t);o&&uc&&(c+=Math.PI*2);let d=u;const f=c-u,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=f/g;if(d+=y,o){a.push(i,t,e,s);for(let b=1,v=d;b=0&&(n.join===It.ROUND?d+=Ge(v,x,v-S*T,x-w*T,v-F*T,x-G*T,u,!1)+4:d+=2,u.push(v-F*R,x-G*R,v+F*T,x+G*T));continue}const _t=(-S+y)*(-w+x)-(-S+v)*(-w+b),lt=(-F+E)*(-G+x)-(-F+v)*(-G+M),vt=(W*lt-P*_t)/Q,bt=(C*_t-ot*lt)/Q,Ct=(vt-v)*(vt-v)+(bt-x)*(bt-x),yt=v+(vt-v)*T,it=x+(bt-x)*T,ut=v-(vt-v)*R,dt=x-(bt-x)*R,se=Math.min(W*W+ot*ot,P*P+C*C),ie=J?T:R,zs=se+ie*ie*m,jm=Ct<=zs;let ir=n.join;if(ir===It.MITER&&Ct/m>g&&(ir=It.BEVEL),jm)switch(ir){case It.MITER:{u.push(yt,it,ut,dt);break}case It.BEVEL:{J?u.push(yt,it,v+S*R,x+w*R,yt,it,v+F*R,x+G*R):u.push(v-S*T,x-w*T,ut,dt,v-F*T,x-G*T,ut,dt),d+=2;break}case It.ROUND:{J?(u.push(yt,it,v+S*R,x+w*R),d+=Ge(v,x,v+S*R,x+w*R,v+F*R,x+G*R,u,!0)+4,u.push(yt,it,v+F*R,x+G*R)):(u.push(v-S*T,x-w*T,ut,dt),d+=Ge(v,x,v-S*T,x-w*T,v-F*T,x-G*T,u,!1)+4,u.push(v-F*T,x-G*T,ut,dt));break}}else{switch(u.push(v-S*T,x-w*T,v+S*R,x+w*R),ir){case It.MITER:{J?u.push(ut,dt,ut,dt):u.push(yt,it,yt,it),d+=2;break}case It.ROUND:{J?d+=Ge(v,x,v+S*R,x+w*R,v+F*R,x+G*R,u,!0)+2:d+=Ge(v,x,v-S*T,x-w*T,v-F*T,x-G*T,u,!1)+2;break}}u.push(v-F*T,x-G*T,v+F*R,x+G*R),d+=2}}y=s[(c-2)*2],b=s[(c-2)*2+1],v=s[(c-1)*2],x=s[(c-1)*2+1],S=-(b-x),w=y-v,Y=Math.sqrt(S*S+w*w),S/=Y,w/=Y,S*=p,w*=p,u.push(v-S*T,x-w*T,v+S*R,x+w*R),h||(n.cap===fe.ROUND?d+=Ge(v-S*(T-R)*.5,x-w*(T-R)*.5,v-S*T,x-w*T,v+S*R,x+w*R,u,!1)+2:n.cap===fe.SQUARE&&(d+=Fl(v,x,S,w,T,R,!1,u)));const $=t.indices,z=we.epsilon*we.epsilon;for(let X=f;X0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,s=null,r=null){const n=new ks(t,e,s,r);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const s=new ks(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=r.lineStyle,r.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let t=0;t0&&(s=this.batches[this.batches.length-1],r=s.style);for(let h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t65535*2)return!1;const t=this.batches;for(let e=0;e0&&(r=Us.pop(),r||(r=new fi,r.texArray=new Ei),this.drawCalls.push(r)),r.start=u,r.size=0,r.texArray.count=0,r.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=zt.REPEAT,r.texArray.elements[r.texArray.count++]=m,n++)),r.size+=d.size,u+=d.size,o=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,o,d.attribSize,d.attribStart)}V._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,s=this.colors,r=this.textureIds,n=new ArrayBuffer(t.length*3*4),a=new Float32Array(n),o=new Uint32Array(n);let h=0;for(let l=0;l0&&t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:s},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Pe,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Pe,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,r=s[s.length-2],n=s[s.length-1];return(r!==t||n!==e)&&s.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,s,r){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Vi.curveTo(t,e,s,r,n),this}bezierCurveTo(t,e,s,r,n,a){return this._initCurve(),Xi.curveTo(t,e,s,r,n,a,this.currentPath.points),this}arcTo(t,e,s,r,n){this._initCurve(t,e);const a=this.currentPath.points,o=Ln.curveTo(t,e,s,r,n,a);if(o){const{cx:h,cy:l,radius:u,startAngle:c,endAngle:d,anticlockwise:f}=o;this.arc(h,l,u,c,d,f)}return this}arc(t,e,s,r,n,a=!1){if(r===n)return this;if(!a&&n<=r?n+=ys:a&&r<=n&&(r+=ys),n-r===0)return this;const o=t+Math.cos(r)*s,h=e+Math.sin(r)*s,l=this._geometry.closePointEps;let u=this.currentPath?this.currentPath.points:null;if(u){const c=Math.abs(u[u.length-2]-o),d=Math.abs(u[u.length-1]-h);c0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,s,r){return this.drawShape(new j(t,e,s,r))}drawRoundedRect(t,e,s,r,n){return this.drawShape(new _i(t,e,s,r,n))}drawCircle(t,e,s){return this.drawShape(new mi(t,e,s))}drawEllipse(t,e,s,r){return this.drawShape(new gi(t,e,s,r))}drawPolygon(...t){let e,s=!0;const r=t[0];r.points?(s=r.closeStroke,e=r.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new Pe(e);return n.closeStroke=s,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===pt.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,s=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(t.points);for(let r=0;r0){const p=h.x-t[d].x,m=h.y-t[d].y,g=Math.sqrt(p*p+m*m);h=t[d],o+=g/l}else o=d/(u-1);n[f]=o,n[f+1]=0,n[f+2]=o,n[f+3]=1}let c=0;for(let d=0;d0?this.textureScale*this._width/2:this._width/2;for(let l=0;l1&&(d=1);const f=Math.sqrt(r*r+n*n);f<1e-6?(r=0,n=0):(r/=f,n/=f,r*=h,n*=h),a[c]=u.x+r,a[c+1]=u.y+n,a[c+2]=u.x-r,a[c+3]=u.y-n,e=u}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class Xl extends es{constructor(t,e,s){const r=new $l(t.width,t.height,e,s),n=new ss(B.WHITE);super(r,n),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:s}=this.shader.texture;this.autoResize&&(t.width!==e||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}const zi=10;class im extends Xl{constructor(t,e,s,r,n){var a,o,h,l,u,c,d,f;super(B.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=(o=e!=null?e:(a=t.defaultBorders)==null?void 0:a.left)!=null?o:zi,this._rightWidth=(l=r!=null?r:(h=t.defaultBorders)==null?void 0:h.right)!=null?l:zi,this._topHeight=(c=s!=null?s:(u=t.defaultBorders)==null?void 0:u.top)!=null?c:zi,this._bottomHeight=(f=n!=null?n:(d=t.defaultBorders)==null?void 0:d.bottom)!=null?f:zi,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,s=this._topHeight+this._bottomHeight,r=this._height>s?1:this._height/s;return Math.min(e,r)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const s=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=s*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-s*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class rm extends es{constructor(t=B.EMPTY,e,s,r,n){const a=new $s(e,s,r);a.getBuffer("aVertexPosition").static=!1;const o=new ss(t);super(a,o,null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class nm extends es{constructor(t,e,s=0){const r=new Hl(t.height,e,s),n=new ss(t);s>0&&(t.baseTexture.wrapMode=zt.REPEAT),super(r,n),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}class am extends Rt{constructor(t=1500,e,s=16384,r=!1){super();const n=16384;s>n&&(s=n),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=H.NORMAL,this.autoResize=r,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e),this._tintColor=new Z(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const e=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.lengths&&!t.autoResize&&(a=s);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=Rr(t.blendMode,l),n.state.set(this.state);const u=n.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=Z.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fr&&(m=r),p>=o.length&&o.push(this._generateOneMoreBuffer(t));const g=o[p];g.uploadDynamic(e,f,m);const y=t._bufferUpdateIDs[p]||0;d=d||g._updateID0);r[a]=l,r[a+n]=l,r[a+n*2]=l,r[a+n*3]=l,a+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Vn.extension={name:"particle",type:I.RendererPlugin},L.add(Vn);var Hs=(i=>(i[i.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",i[i.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",i))(Hs||{});const Yi={willReadFrequently:!0},ee=class U{static get experimentalLetterSpacingSupported(){let t=U._experimentalLetterSpacingSupported;if(t!==void 0){const e=O.ADAPTER.getCanvasRenderingContext2D().prototype;t=U._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,r,n,a,o,h,l){this.text=t,this.style=e,this.width=s,this.height=r,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,s,r=U._canvas){s=s==null?e.wordWrap:s;const n=e.toFontString(),a=U.measureFont(n);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const o=r.getContext("2d",Yi);o.font=n;const h=(s?U.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let u=0;for(let p=0;p0&&(r?n-=e:n+=(U.graphemeSegmenter(t).length-1)*e),n}static wordWrap(t,e,s=U._canvas){const r=s.getContext("2d",Yi);let n=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:u}=e,c=U.collapseSpaces(u),d=U.collapseNewlines(u);let f=!c;const p=e.wordWrapWidth+l,m=U.tokenize(t);for(let g=0;gp)if(a!==""&&(o+=U.addLine(a),a="",n=0),U.canBreakWords(y,e.breakWords)){const v=U.wordWrapSplit(y);for(let x=0;xp&&(o+=U.addLine(a),f=!1,a="",n=0),a+=E,n+=w}}else{a.length>0&&(o+=U.addLine(a),a="",n=0);const v=g===m.length-1;o+=U.addLine(y,!v),f=!1,a="",n=0}else b+n>p&&(f=!1,o+=U.addLine(a),a="",n=0),(a.length>0||!U.isBreakingSpace(y)||f)&&(a+=y,n+=b)}return o+=U.addLine(a,!1),o}static addLine(t,e=!0){return t=U.trimRight(t),t=e?`${t}
- `:t,t}static getFromCache(t,e,s,r){let n=s[t];return typeof n!="number"&&(n=U._measureText(t,e,r)+e,s[t]=n),n}static collapseSpaces(t){return t==="normal"||t==="pre-line"}static collapseNewlines(t){return t==="normal"}static trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const s=t[e];if(!U.isBreakingSpace(s))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:U._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:U._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let s="";if(typeof t!="string")return e;for(let r=0;ro;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const i=new Intl.Segmenter;return t=>[...i.segment(t)].map(e=>e.segment)}return i=>[...i]})(),ee.experimentalLetterSpacing=!1,ee._fonts={},ee._newlines=[10,13],ee._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let pe=ee;const lm=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jl=class Zs{constructor(t){this.styleID=0,this.reset(),Wn(this,t,t)}clone(){const t={};return Wn(t,this,Zs.defaultStyle),new Zs(t)}reset(){Wn(this,Zs.defaultStyle,Zs.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=jn(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=jn(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){um(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=jn(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let s=e.length-1;s>=0;s--){let r=e[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!lm.includes(r)&&(r=`"${r}"`),e[s]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};jl.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Hs.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let me=jl;function jn(i){const t=Z.shared,e=s=>{const r=t.setValue(s);return r.alpha===1?r.toHex():r.toRgbaString()};return Array.isArray(i)?i.map(e):e(i)}function um(i,t){if(!Array.isArray(i)||!Array.isArray(t)||i.length!==t.length)return!1;for(let e=0;e0&&p>m&&(g=(m+p)/2);const y=m+d,b=s.lineHeight*(f+1);let v=y;f+10}}function dm(i,t){var e;let s=!1;if((e=i==null?void 0:i._textures)!=null&&e.length){for(let r=0;r{this.queue&&this.prepareItems()},this.registerFindHook(_m),this.registerFindHook(vm),this.registerFindHook(dm),this.registerFindHook(fm),this.registerFindHook(pm),this.registerUploadHook(mm),this.registerUploadHook(gm)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,mt.system.addOnce(this.tick,this,ue.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed){for(let s=0,r=this.uploadHooks.length;s=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&mt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};Yl.uploadsPerFrame=4;let qi=Yl;Object.defineProperties(O,{UPLOADS_PER_FRAME:{get(){return qi.uploadsPerFrame},set(i){qi.uploadsPerFrame=i}}});function ql(i,t){return t instanceof V?(t._glTextures[i.CONTEXT_UID]||i.texture.bind(t),!0):!1}function ym(i,t){if(!(t instanceof Hn))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:s}=e;for(let r=0;r=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrames)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let s=0;sthis.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(mt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(mt.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const Xs=new q;class qn extends ce{constructor(t,e=100,s=100){super(t),this.tileTransform=new yi,this._width=e,this._height=s,this.uvMatrix=this.texture.uvMatrix||new Ri(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const e=this._texture;!e||!e.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,s=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,s,r)}getLocalBounds(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new j),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,Xs);const e=this._width,s=this._height,r=-e*this.anchor._x;if(Xs.x>=r&&Xs.x=n&&Xs.y1?Xt.from(Em,Tm,e):Xt.from(Kl,Am,e)}render(t){const e=this.renderer,s=this.quad;let r=s.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;r=s.uvs,r[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,s.invalidate();const o=t._texture,h=o.baseTexture,l=h.alphaMode>0,u=t.tileTransform.localTransform,c=t.uvMatrix;let d=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==zt.CLAMP:h.wrapMode===zt.CLAMP&&(h.wrapMode=zt.REPEAT));const f=d?this.simpleShader:this.shader,p=o.width,m=o.height,g=t._width,y=t._height;Zi.set(u.a*p/g,u.b*p/y,u.c*m/g,u.d*m/y,u.tx/g,u.ty/y),Zi.invert(),d?Zi.prepend(c.mapCoord):(f.uniforms.uMapCoord=c.mapCoord.toArray(!0),f.uniforms.uClampFrame=c.uClampFrame,f.uniforms.uClampOffset=c.uClampOffset),f.uniforms.uTransform=Zi.toArray(!0),f.uniforms.uColor=Z.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,e.shader.bind(f),e.geometry.bind(s),this.state.blendMode=Rr(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Kn.extension={name:"tilingSprite",type:I.RendererPlugin},L.add(Kn);const Zl=class Qs{constructor(t,e,s){this.linkedSheets=[],(t instanceof V||t instanceof B)&&(t={texture:t,data:e,resolutionFilename:s});const{texture:r,data:n,resolutionFilename:a=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=r instanceof B?r:null,this.baseTexture=r instanceof V?r:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(a||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let s=Kt(t,null);return s===null&&(s=typeof e=="number"?e:parseFloat(e!=null?e:"1")),s!==1&&this.baseTexture.setResolution(s),s}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Qs.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Qs.BATCH_SIZE;for(;e-t{this._batchIndex*Qs.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=ct.dirname(i[0]);t.linkedSheets.forEach((n,a)=>{Object.assign(s,Ql([`${r}/${t.data.meta.related_multi_packs[a]}`],n,!0))})}return s}const Jl={extension:I.Asset,cache:{test:i=>i instanceof Zn,getCacheableAssets:(i,t)=>Ql(i,t,!1)},resolver:{test:i=>{const t=i.split("?")[0].split("."),e=t.pop(),s=t.pop();return e==="json"&&Sm.includes(s)},parse:i=>{var t,e;const s=i.split(".");return{resolution:parseFloat((e=(t=O.RETINA_PREFIX.exec(i))==null?void 0:t[1])!=null?e:"1"),format:s[s.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:I.LoadParser,priority:Nt.Normal},async testParse(i,t){return ct.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){var s,r,n;const{texture:a,imageFilename:o,cachePrefix:h}=(s=t==null?void 0:t.data)!=null?s:{};let l=ct.dirname(t.src);l&&l.lastIndexOf("/")!==l.length-1&&(l+="/");let u;if(a&&a.baseTexture)u=a;else{const f=Ui(l+(o!=null?o:i.meta.image),t.src);u=(await e.load([f]))[f]}const c=new Zn({texture:u.baseTexture,data:i,resolutionFilename:t.src,cachePrefix:h});await c.parse();const d=(r=i==null?void 0:i.meta)==null?void 0:r.related_multi_packs;if(Array.isArray(d)){const f=[];for(const m of d){if(typeof m!="string")continue;let g=l+m;(n=t.data)!=null&&n.ignoreMultiPack||(g=Ui(g,t.src),f.push(e.load({src:g,data:{ignoreMultiPack:!0}})))}const p=await Promise.all(f);c.linkedSheets=p,p.forEach(m=>{m.linkedSheets=[c].concat(c.linkedSheets.filter(g=>g!==m))})}return c},unload(i){i.destroy(!0)}}};L.add(Jl);class Vs{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class js{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in e){const a=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in o){const u=o[l].split("="),c=u[0],d=u[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[c]=p}s[a].push(h)}const r=new Vs;return s.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),s.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),s.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),s.char.forEach(n=>r.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),s.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),s.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class Qi{static test(t){const e=t;return typeof t!="string"&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const e=new Vs,s=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?Qi.test(O.ADAPTER.parseXML(t)):!1}static parse(t){return Qi.parse(O.ADAPTER.parseXML(t))}}const Qn=[js,Qi,Ji];function tu(i){for(let t=0;tt in i?Pm(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Mm=(i,t)=>{for(var e in t||(t={}))su.call(t,e)&&ru(i,e,t[e]);if(er)for(var e of er(t))iu.call(t,e)&&ru(i,e,t[e]);return i},Dm=(i,t)=>{var e={};for(var s in i)su.call(i,s)&&t.indexOf(s)<0&&(e[s]=i[s]);if(i!=null&&er)for(var s of er(i))t.indexOf(s)<0&&iu.call(i,s)&&(e[s]=i[s]);return e};const Se=class re{constructor(t,e,s){var r,n;const[a]=t.info,[o]=t.common,[h]=t.page,[l]=t.distanceField,u=Kt(h.file),c={};this._ownsTextures=s,this.font=a.face,this.size=a.size,this.lineHeight=o.lineHeight/u,this.chars={},this.pageTextures=c;for(let d=0;d=l-N*o){if(g===0)throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${F}')`);--w,y=null,b=null,v=null,g=0,m=0,x=0;continue}if(x=Math.max(N+G.fontProperties.descent,x),T*o+m>=f){if(m===0)throw new Error(`[BitmapFont] textureWidth ${h}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${F}')`);--w,g+=x*o,g=Math.ceil(g),m=0,x=0;continue}Im(y,b,G,m,g,o,d);const R=tr(G.text);p.char.push({id:R,page:M.length-1,x:m/o,y:g/o,width:T,height:N,xoffset:0,yoffset:0,xadvance:Y-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),m+=(T+2*a)*o,m=Math.ceil(m)}if(!(s!=null&&s.skipKerning))for(let w=0,F=c.length;w 0.99) {\r
- alpha = 1.0;\r
- }\r
- \r
- // Gamma correction for coverage-like alpha\r
- float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
- float gamma = mix(1.0, 1.0 / 2.2, luma);\r
- float coverage = pow(uColor.a * alpha, gamma); \r
- \r
- // NPM Textures, NPM outputs\r
- gl_FragColor = vec4(uColor.rgb, coverage);\r
- }\r
- `,Bm=`// Mesh material default fragment\r
- attribute vec2 aVertexPosition;\r
- attribute vec2 aTextureCoord;\r
- \r
- uniform mat3 projectionMatrix;\r
- uniform mat3 translationMatrix;\r
- uniform mat3 uTextureMatrix;\r
- \r
- varying vec2 vTextureCoord;\r
- \r
- void main(void)\r
- {\r
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
- \r
- vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
- }\r
- `;const nu=[],au=[],ou=[],hu=class mu extends Rt{constructor(t,e={}){super();const{align:s,tint:r,maxWidth:n,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},mu.styleDefaults,e);if(!ge.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Z(r),this._font=void 0,this._fontName=o,this._fontSize=h,this.text=t,this._maxWidth=n,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new le(()=>{this.dirty=!0},this,0,0),this._roundPixels=O.ROUND_PIXELS,this.dirty=!0,this._resolution=O.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var t;const e=ge.available[this._fontName],s=this.fontSize,r=s/e.size,n=new q,a=[],o=[],h=[],l=this._text.replace(/(?:\r\n|\r)/g,`
- `)||" ",u=eu(l),c=this._maxWidth*e.size/s,d=e.distanceFieldType==="none"?nu:au;let f=null,p=0,m=0,g=0,y=-1,b=0,v=0,x=0,E=0;for(let N=0;N0&&n.x>c&&(++v,Ce(a,1+y-v,1+N-y),N=y,y=-1,o.push(b),h.push(a.length>0?a[a.length-1].prevSpaces:0),m=Math.max(m,b),g++,n.x=0,n.y+=e.lineHeight,f=null,E=0)}const M=u[u.length-1];M!=="\r"&&M!==`
- `&&(/(?:\s)/.test(M)&&(p=b),o.push(p),m=Math.max(m,p),h.push(-1));const S=[];for(let N=0;N<=g;N++){let T=0;this._align==="right"?T=m-o[N]:this._align==="center"?T=(m-o[N])/2:this._align==="justify"&&(T=h[N]<0?0:(m-o[N])/h[N]),S.push(T)}const w=a.length,F={},G=[],Y=this._activePagesMeshData;d.push(...Y);for(let N=0;N6*R)||T.vertices.lengthe[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=B.EMPTY});for(const r in e)e[r].destroy(),delete e[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};hu.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};let Fm=hu;const Nm=[".xml",".fnt"],lu={extension:{type:I.LoadParser,priority:Nt.Normal},name:"loadBitmapFont",test(i){return Nm.includes(ct.extname(i).toLowerCase())},async testParse(i){return js.test(i)||Ji.test(i)},async parse(i,t,e){const s=js.test(i)?js.parse(i):Ji.parse(i),{src:r}=t,{page:n}=s,a=[];for(let l=0;lo[l]);return ge.install(s,h,!0)},async load(i,t){return(await O.ADAPTER.fetch(i)).text()},unload(i){i.destroy()}};L.add(lu);var Lm=Object.defineProperty,Um=Object.defineProperties,km=Object.getOwnPropertyDescriptors,uu=Object.getOwnPropertySymbols,Gm=Object.prototype.hasOwnProperty,$m=Object.prototype.propertyIsEnumerable,cu=(i,t,e)=>t in i?Lm(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Hm=(i,t)=>{for(var e in t||(t={}))Gm.call(t,e)&&cu(i,e,t[e]);if(uu)for(var e of uu(t))$m.call(t,e)&&cu(i,e,t[e]);return i},Xm=(i,t)=>Um(i,km(t));const Jn=class ns extends me{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new ns(Object.keys(ns.defaultOptions).reduce((e,s)=>Xm(Hm({},e),{[s]:t[s]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete ns.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:s}=ns;if(s[t]){const r=s[t];return this._fonts.push(r),r.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return O.ADAPTER.fetch(t).then(r=>r.blob()).then(async r=>new Promise((n,a)=>{const o=URL.createObjectURL(r),h=new FileReader;h.onload=()=>n([o,h.result]),h.onerror=a,h.readAsDataURL(r)})).then(async([r,n])=>{const a=Object.assign({family:ct.basename(t,ct.extname(t)),weight:"normal",style:"normal",display:"auto",src:r,dataSrc:n,refs:1,originalUrl:t,fontFace:null},e);s[t]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(s=>!this._overrides.includes(s));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(s=>this._overrides.includes(s));e.length>0&&(this._overrides=this._overrides.filter(s=>!e.includes(s)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t}
- @font-face {
- font-family: "${e.family}";
- src: url('${e.dataSrc}');
- font-weight: ${e.weight};
- font-style: ${e.style};
- font-display: ${e.display};
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=Qa(t)),typeof t=="number"?Za(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${s}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,ns.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=O.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};Jn.availableFonts={},Jn.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let sr=Jn;const Ws=class as extends ce{constructor(t="",e={}){var s;super(B.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const r=new Image,n=B.from(r,{scaleMode:O.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new j,n.trim=new j,this.texture=n;const a="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",h=document.createElementNS(a,"svg"),l=document.createElementNS(a,"foreignObject"),u=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",h.appendChild(l),this.maxWidth=as.defaultMaxWidth,this.maxHeight=as.defaultMaxHeight,this._domElement=u,this._styleElement=c,this._svgRoot=h,this._foreignObject=l,this._foreignObject.appendChild(c),this._foreignObject.appendChild(u),this._image=r,this._loadImage=new Image,this._autoResolution=as.defaultAutoResolution,this._resolution=(s=as.defaultResolution)!=null?s:O.RESOLUTION,this.text=t,this.style=e}measureText(t){var e,s;const{text:r,style:n,resolution:a}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:r,style:n.toCSS(a)}),this._styleElement.textContent=n.toGlobalCSS(),document.body.appendChild(this._svgRoot);const o=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:h,height:l}=o,u=Math.min(this.maxWidth,Math.ceil(h)),c=Math.min(this.maxHeight,Math.ceil(l));return this._svgRoot.setAttribute("width",u.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),n!==this._style&&(Object.assign(this._domElement,{style:(e=this._style)==null?void 0:e.toCSS(a)}),this._styleElement.textContent=(s=this._style)==null?void 0:s.toGlobalCSS()),{width:u+n.padding*2,height:c+n.padding*2}}async updateText(t=!0){const{style:e,_image:s,_loadImage:r}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:a}=this.measureText();s.width=r.width=Math.ceil(Math.max(1,n)),s.height=r.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(h=>{r.onload=async()=>{if(o/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};Ws.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Ws.defaultMaxWidth=2024,Ws.defaultMaxHeight=2024,Ws.defaultAutoResolution=!0;let Vm=Ws;return _.ALPHA_MODES=Tt,_.AbstractMultiResource=bn,_.AccessibilityManager=In,_.AlphaFilter=fh,_.AnimatedSprite=Ki,_.Application=Rh,_.ArrayResource=ah,_.Assets=Fs,_.AssetsClass=sl,_.Attribute=vs,_.BLEND_MODES=H,_.BUFFER_BITS=Js,_.BUFFER_TYPE=Gt,_.BackgroundSystem=As,_.BaseImageResource=Jt,_.BasePrepare=qi,_.BaseRenderTexture=qr,_.BaseTexture=V,_.BatchDrawCall=fi,_.BatchGeometry=Hr,_.BatchRenderer=ye,_.BatchShaderGenerator=Co,_.BatchSystem=Yr,_.BatchTextureArray=Ei,_.BitmapFont=ge,_.BitmapFontData=Vs,_.BitmapText=Fm,_.BlobResource=ml,_.BlurFilter=ph,_.BlurFilterPass=Bi,_.Bounds=Ps,_.BrowserAdapter=ha,_.Buffer=nt,_.BufferResource=_s,_.BufferSystem=yn,_.CLEAR_MODES=kt,_.COLOR_MASK_BITS=oa,_.Cache=Ee,_.CanvasResource=oh,_.Circle=mi,_.Color=Z,_.ColorMatrixFilter=Fi,_.CompressedTextureResource=Ae,_.Container=Rt,_.ContextSystem=ws,_.CountLimiter=zl,_.CubeResource=lh,_.DEG_TO_RAD=_o,_.DRAW_MODES=Lt,_.DisplacementFilter=mh,_.DisplayObject=st,_.ENV=_e,_.Ellipse=gi,_.EventBoundary=vh,_.EventSystem=Ni,_.ExtensionType=I,_.Extract=Pl,_.FORMATS=A,_.FORMATS_TO_COMPONENTS=yl,_.FXAAFilter=gh,_.FederatedDisplayObject=Th,_.FederatedEvent=Ye,_.FederatedMouseEvent=Ds,_.FederatedPointerEvent=Bt,_.FederatedWheelEvent=Ue,_.FillStyle=Gs,_.Filter=xt,_.FilterState=Oo,_.FilterSystem=en,_.Framebuffer=Ai,_.FramebufferSystem=sn,_.GC_MODES=ti,_.GLFramebuffer=Bo,_.GLProgram=jo,_.GLTexture=Ci,_.GRAPHICS_CURVES=Zp,_.GenerateTextureSystem=un,_.Geometry=he,_.GeometrySystem=nn,_.Graphics=Hn,_.GraphicsData=ks,_.GraphicsGeometry=Ll,_.HTMLText=Vm,_.HTMLTextStyle=sr,_.IGLUniformData=_d,_.INSTALLED=di,_.INTERNAL_FORMATS=gt,_.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL=Ns,_.ImageBitmapResource=Le,_.ImageResource=Kr,_.LINE_CAP=fe,_.LINE_JOIN=It,_.LineStyle=Wi,_.LoaderParserPriority=Nt,_.MASK_TYPES=ht,_.MIPMAP_MODES=Ut,_.MSAA_QUALITY=at,_.MaskData=Lo,_.MaskSystem=an,_.Matrix=tt,_.Mesh=es,_.MeshBatchUvs=Ul,_.MeshGeometry=$s,_.MeshMaterial=ss,_.MultisampleSystem=vn,_.NineSlicePlane=im,_.NoiseFilter=_h,_.ObjectRenderer=Ts,_.ObjectRendererSystem=xn,_.ObservablePoint=le,_.PI_2=ys,_.PRECISION=At,_.ParticleContainer=am,_.ParticleRenderer=Vn,_.PlaneGeometry=$l,_.PluginSystem=hn,_.Point=q,_.Polygon=Pe,_.Prepare=Yn,_.Program=Qt,_.ProjectionSystem=ln,_.Quad=Do,_.QuadUv=Jr,_.RAD_TO_DEG=go,_.RENDERER_TYPE=lr,_.Rectangle=j,_.RenderTexture=xe,_.RenderTexturePool=Qr,_.RenderTextureSystem=cn,_.Renderer=Di,_.ResizePlugin=Cn,_.Resource=ze,_.RopeGeometry=Hl,_.RoundedRectangle=_i,_.Runner=St,_.SAMPLER_TYPES=D,_.SCALE_MODES=Wt,_.SHAPES=pt,_.SVGResource=Oi,_.ScissorSystem=Ho,_.Shader=Xt,_.ShaderSystem=dn,_.SimpleMesh=rm,_.SimplePlane=Xl,_.SimpleRope=nm,_.Sprite=ce,_.SpriteMaskFilter=No,_.Spritesheet=Zn,_.StartupSystem=Rs,_.State=Zt,_.StateSystem=Qo,_.StencilSystem=on,_.SystemManager=Jo,_.TARGETS=Re,_.TEXT_GRADIENT=Hs,_.TYPES=k,_.TYPES_TO_BYTES_PER_COMPONENT=Fn,_.TYPES_TO_BYTES_PER_PIXEL=xl,_.TemporaryDisplayObject=uh,_.Text=zn,_.TextFormat=js,_.TextMetrics=pe,_.TextStyle=me,_.Texture=B,_.TextureGCSystem=be,_.TextureMatrix=Ri,_.TextureSystem=fn,_.TextureUvs=Zr,_.Ticker=mt,_.TickerPlugin=gn,_.TilingSprite=qn,_.TilingSpriteRenderer=Kn,_.TimeLimiter=bm,_.Transform=yi,_.TransformFeedback=kd,_.TransformFeedbackSystem=pn,_.UPDATE_PRIORITY=ue,_.UniformGroup=Ot,_.VERSION=Gd,_.VideoResource=An,_.ViewSystem=Cs,_.ViewableBuffer=ci,_.WRAP_MODES=zt,_.XMLFormat=Qi,_.XMLStringFormat=Ji,_.accessibleTarget=Eh,_.autoDetectFormat=tu,_.autoDetectRenderer=rh,_.autoDetectResource=Gr,_.cacheTextureArray=il,_.checkDataUrl=ke,_.checkExtension=de,_.checkMaxIfStatementsInShader=co,_.convertToList=Ft,_.copySearchParams=Ui,_.createStringVariations=Ph,_.createTexture=Ze,_.createUBOElements=Yo,_.curves=we,_.defaultFilterVertex=_n,_.defaultVertex=nh,_.detectAvif=nl,_.detectCompressedTextures=pl,_.detectDefaults=hl,_.detectMp4=ul,_.detectOgv=cl,_.detectWebm=ll,_.detectWebp=al,_.extensions=L,_.filters=wn,_.generateProgram=Wo,_.generateUniformBufferSync=Ko,_.getFontFamilyName=Lh,_.getTestContext=To,_.getUBOData=qo,_.graphicsUtils=tm,_.groupD8=et,_.isMobile=$t,_.isSingleItem=Os,_.loadBitmapFont=lu,_.loadDDS=Al,_.loadImageBitmap=jh,_.loadJson=Oh,_.loadKTX=Rl,_.loadSVG=Yh,_.loadTextures=Bs,_.loadTxt=Bh,_.loadVideo=Qh,_.loadWebFont=Uh,_.parseDDS=_l,_.parseKTX=bl,_.resolveCompressedTextureUrl=Il,_.resolveTextureUrl=dl,_.settings=O,_.spritesheetAsset=Jl,_.uniformParsers=Fe,_.unsafeEvalSupported=Io,_.utils=Ic,_}({});
- //# sourceMappingURL=pixi.min.js.map
\ No newline at end of file
diff --git a/utils/db.js b/utils/db.js
index d901575..2754429 100644
--- a/utils/db.js
+++ b/utils/db.js
@@ -1,6 +1,6 @@
// BaseDBStore.js
import IndexedDBHelper from '@/common/IndexedDBHelper.js'
-// import UniStorageHelper from '../common/UniStorageHelper'
+import UniStorageHelper from '../common/UniStorageHelper'
import useChatGroupDBStore from '@/stores/userChatGroupStore'
import config from '@/config'
@@ -43,6 +43,10 @@ class BaseStore {
this.db = new IndexedDBHelper(this.dbName, config.DBversion);
// // #endif
+ // #ifdef APP-PLUS
+ this.db = new UniStorageHelper(this.dbName, );
+ // #endif
+
return this.db.openDB([{
name: 'record',
keyPath: "id",