@annotorious/openseadragon 3.0.0-rc.1

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.
Files changed (39) hide show
  1. package/README.md +3 -0
  2. package/dist/Annotorious.d.ts +21 -0
  3. package/dist/Annotorious.d.ts.map +1 -0
  4. package/dist/annotation/index.d.ts +3 -0
  5. package/dist/annotation/index.d.ts.map +1 -0
  6. package/dist/annotation/pixi/PixiLayer.svelte.d.ts +1 -0
  7. package/dist/annotation/pixi/PixiLayerClickEvent.d.ts +6 -0
  8. package/dist/annotation/pixi/PixiLayerClickEvent.d.ts.map +1 -0
  9. package/dist/annotation/pixi/PixiLayerConfiguration.d.ts +14 -0
  10. package/dist/annotation/pixi/PixiLayerConfiguration.d.ts.map +1 -0
  11. package/dist/annotation/pixi/index.d.ts +4 -0
  12. package/dist/annotation/pixi/index.d.ts.map +1 -0
  13. package/dist/annotation/pixi/stageRenderer.d.ts +12 -0
  14. package/dist/annotation/pixi/stageRenderer.d.ts.map +1 -0
  15. package/dist/annotation/svg/OSDLayer.svelte.d.ts +1 -0
  16. package/dist/annotation/svg/drawing/OSDToolMount.svelte.d.ts +1 -0
  17. package/dist/annotation/svg/drawing/SVGDrawingLayer.svelte.d.ts +1 -0
  18. package/dist/annotation/svg/index.d.ts +3 -0
  19. package/dist/annotation/svg/index.d.ts.map +1 -0
  20. package/dist/annotation/svg/presence/SVGPresenceLabel.svelte.d.ts +1 -0
  21. package/dist/annotation/svg/presence/SVGPresenceLayer.svelte.d.ts +1 -0
  22. package/dist/annotation/svg/presence/shapes/PresencePolygon.svelte.d.ts +1 -0
  23. package/dist/annotation/svg/presence/shapes/PresenceRectangle.svelte.d.ts +1 -0
  24. package/dist/annotorious-openseadragon.css +1 -0
  25. package/dist/annotorious-openseadragon.es.js +21876 -0
  26. package/dist/annotorious-openseadragon.es.js.map +1 -0
  27. package/dist/annotorious-openseadragon.js +1559 -0
  28. package/dist/annotorious-openseadragon.js.map +1 -0
  29. package/dist/api/fitBounds.d.ts +13 -0
  30. package/dist/api/fitBounds.d.ts.map +1 -0
  31. package/dist/api/index.d.ts +2 -0
  32. package/dist/api/index.d.ts.map +1 -0
  33. package/dist/index.d.ts +17 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/keyCommands.d.ts +4 -0
  36. package/dist/keyCommands.d.ts.map +1 -0
  37. package/dist/themes/setTheme.d.ts +3 -0
  38. package/dist/themes/setTheme.d.ts.map +1 -0
  39. package/package.json +56 -0
@@ -0,0 +1,1559 @@
1
+ (function(ee,Fe){typeof exports=="object"&&typeof module<"u"?Fe(exports,require("openseadragon")):typeof define=="function"&&define.amd?define(["exports","openseadragon"],Fe):(ee=typeof globalThis<"u"?globalThis:ee||self,Fe(ee.AnnotoriousOSD={},ee.OpenSeadragon))})(this,function(ee,Fe){"use strict";var _s=Object.prototype.hasOwnProperty;function qe(r,t){var e,n;if(r===t)return!0;if(r&&t&&(e=r.constructor)===t.constructor){if(e===Date)return r.getTime()===t.getTime();if(e===RegExp)return r.toString()===t.toString();if(e===Array){if((n=r.length)===t.length)for(;n--&&qe(r[n],t[n]););return n===-1}if(!e||typeof r=="object"){n=0;for(e in r)if(_s.call(r,e)&&++n&&!_s.call(t,e)||!(e in t)||!qe(r[e],t[e]))return!1;return Object.keys(t).length===n}}return r!==r&&t!==t}function Vt(){}function mf(r,t){for(const e in t)r[e]=t[e];return r}function gs(r){return r()}function ms(){return Object.create(null)}function Be(r){r.forEach(gs)}function Xt(r){return typeof r=="function"}function Lt(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function yf(r){return Object.keys(r).length===0}function bf(r,...t){if(r==null)return Vt;const e=r.subscribe(...t);return e.unsubscribe?()=>e.unsubscribe():e}function ys(r,t,e){r.$$.on_destroy.push(bf(t,e))}function bs(r,t,e,n){if(r){const i=xs(r,t,e,n);return r[0](i)}}function xs(r,t,e,n){return r[1]&&n?mf(e.ctx.slice(),r[1](n(t))):e.ctx}function Es(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],a=Math.max(t.dirty.length,i.length);for(let s=0;s<a;s+=1)o[s]=t.dirty[s]|i[s];return o}return t.dirty|i}return t.dirty}function Ts(r,t,e,n,i,o){if(i){const a=xs(t,e,n,o);r.p(a,i)}}function ws(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}const xf=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function $e(r,t){r.appendChild(t)}function Z(r,t,e){r.insertBefore(t,e||null)}function $(r){r.parentNode&&r.parentNode.removeChild(r)}function Wi(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function ft(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function qi(r){return document.createTextNode(r)}function re(){return qi(" ")}function Ne(){return qi("")}function zt(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function S(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Ef(r){return Array.from(r.childNodes)}function Tf(r,t){t=""+t,r.data!==t&&(r.data=t)}function Ss(r,t,e){r.classList[e?"add":"remove"](t)}function wf(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let tn;function en(r){tn=r}function $i(){if(!tn)throw new Error("Function called outside component initialization");return tn}function gr(r){$i().$$.on_mount.push(r)}function Sf(r){$i().$$.on_destroy.push(r)}function mr(){const r=$i();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=wf(t,e,{cancelable:n});return i.slice().forEach(a=>{a.call(r,o)}),!o.defaultPrevented}return!0}}function yr(r,t){const e=r.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const br=[],xr=[];let Er=[];const As=[],Af=Promise.resolve();let Ki=!1;function Pf(){Ki||(Ki=!0,Af.then(Ps))}function Zi(r){Er.push(r)}const Ji=new Set;let Tr=0;function Ps(){if(Tr!==0)return;const r=tn;do{try{for(;Tr<br.length;){const t=br[Tr];Tr++,en(t),Of(t.$$)}}catch(t){throw br.length=0,Tr=0,t}for(en(null),br.length=0,Tr=0;xr.length;)xr.pop()();for(let t=0;t<Er.length;t+=1){const e=Er[t];Ji.has(e)||(Ji.add(e),e())}Er.length=0}while(br.length);for(;As.length;)As.pop()();Ki=!1,Ji.clear(),en(r)}function Of(r){if(r.fragment!==null){r.update(),Be(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Zi)}}function Rf(r){const t=[],e=[];Er.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Er=t}const Un=new Set;let Ke;function Le(){Ke={r:0,c:[],p:Ke}}function Ue(){Ke.r||Be(Ke.c),Ke=Ke.p}function lt(r,t){r&&r.i&&(Un.delete(r),r.i(t))}function _t(r,t,e,n){if(r&&r.o){if(Un.has(r))return;Un.add(r),Ke.c.push(()=>{Un.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function ve(r){r&&r.c()}function ne(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||Zi(()=>{const a=r.$$.on_mount.map(gs).filter(Xt);r.$$.on_destroy?r.$$.on_destroy.push(...a):Be(a),r.$$.on_mount=[]}),o.forEach(Zi)}function ie(r,t){const e=r.$$;e.fragment!==null&&(Rf(e.after_update),Be(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function If(r,t){r.$$.dirty[0]===-1&&(br.push(r),Pf(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function Kt(r,t,e,n,i,o,a,s=[-1]){const u=tn;en(r);const h=r.$$={fragment:null,ctx:[],props:o,update:Vt,not_equal:i,bound:ms(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ms(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(h.root);let f=!1;if(h.ctx=e?e(r,t.props||{},(l,c,...d)=>{const p=d.length?d[0]:c;return h.ctx&&i(h.ctx[l],h.ctx[l]=p)&&(!h.skip_bound&&h.bound[l]&&h.bound[l](p),f&&If(r,l)),c}):[],h.update(),f=!0,Be(h.before_update),h.fragment=n?n(h.ctx):!1,t.target){if(t.hydrate){const l=Ef(t.target);h.fragment&&h.fragment.l(l),l.forEach($)}else h.fragment&&h.fragment.c();t.intro&&lt(r.$$.fragment),ne(r,t.target,t.anchor,t.customElement),Ps()}en(u)}class Zt{$destroy(){ie(this,1),this.$destroy=Vt}$on(t,e){if(!Xt(e))return Vt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!yf(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const wr=[];function Qi(r,t=Vt){let e;const n=new Set;function i(s){if(Lt(r,s)&&(r=s,e)){const u=!wr.length;for(const h of n)h[1](),wr.push(h,r);if(u){for(let h=0;h<wr.length;h+=2)wr[h][0](wr[h+1]);wr.length=0}}}function o(s){i(s(r))}function a(s,u=Vt){const h=[s,u];return n.add(h),n.size===1&&(e=t(i)||Vt),s(r),()=>{n.delete(h),n.size===0&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:a}}const Cf=r=>{const{subscribe:t,set:e}=Qi(null);let n=null;return t(i=>n=i),r.observe(({changes:i})=>{if(n){i.deleted.some(s=>s.id===n)&&e(null);const a=i.updated.find(({oldValue:s})=>s.id===n);a&&e(a.newValue.id)}}),{get current(){return n},subscribe:t,set:e}};var to=(r=>(r.EDIT="EDIT",r.SELECT="SELECT",r.NONE="NONE",r))(to||{});const eo={selected:[]},Mf=(r,t="EDIT")=>{const{subscribe:e,set:n}=Qi(eo);let i=eo;e(l=>i=l);const o=()=>n(eo),a=()=>{var l;return((l=i.selected)==null?void 0:l.length)===0},s=l=>{if(i.selected.length===0)return!1;const c=typeof l=="string"?l:l.id;return i.selected.some(d=>d.id===c)},u=(l,c)=>{const d=r.getAnnotation(l);if(d){const p=Df(d,t);n(p==="EDIT"?{selected:[{id:l,editable:!0}],pointerEvent:c}:p==="SELECT"?{selected:[{id:l}],pointerEvent:c}:{selected:[],pointerEvent:c})}else console.warn("Invalid selection: "+l)},h=(l,c=!0)=>{const d=Array.isArray(l)?l:[l],p=d.map(v=>r.getAnnotation(v)).filter(v=>v);n({selected:p.map(({id:v})=>({id:v,editable:c}))}),p.length!==d.length&&console.warn("Invalid selection",l)},f=l=>{if(i.selected.length===0)return!1;const{selected:c}=i;c.filter(({id:p})=>l.includes(p)).length>0&&n({selected:c.filter(({id:p})=>!l.includes(p))})};return r.observe(({changes:l})=>f(l.deleted.map(c=>c.id))),{clear:o,clickSelect:u,get selected(){return i?[...i.selected]:null},get pointerEvent(){return i?i.pointerEvent:null},isEmpty:a,isSelected:s,setSelected:h,subscribe:e}},Df=(r,t)=>typeof t=="function"?t(r)||"EDIT":t||"EDIT";let Gn;const Ff=new Uint8Array(16);function Bf(){if(!Gn&&(Gn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gn(Ff)}const Ut=[];for(let r=0;r<256;++r)Ut.push((r+256).toString(16).slice(1));function Nf(r,t=0){return Ut[r[t+0]]+Ut[r[t+1]]+Ut[r[t+2]]+Ut[r[t+3]]+"-"+Ut[r[t+4]]+Ut[r[t+5]]+"-"+Ut[r[t+6]]+Ut[r[t+7]]+"-"+Ut[r[t+8]]+Ut[r[t+9]]+"-"+Ut[r[t+10]]+Ut[r[t+11]]+Ut[r[t+12]]+Ut[r[t+13]]+Ut[r[t+14]]+Ut[r[t+15]]}const Os={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Rs(r,t,e){if(Os.randomUUID&&!t&&!r)return Os.randomUUID();r=r||{};const n=r.random||(r.rng||Bf)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(let i=0;i<16;++i)t[e+i]=n[i];return t}return Nf(n)}const Lf=(r,t,e,n)=>({id:Rs(),annotation:r.id,created:e||new Date,creator:n,...t}),Uf=(r,t)=>{const e=new Set(r.bodies.map(n=>n.id));return t.bodies.filter(n=>!e.has(n.id))},Gf=(r,t)=>{const e=new Set(t.bodies.map(n=>n.id));return r.bodies.filter(n=>!e.has(n.id))},kf=(r,t)=>t.bodies.map(e=>{const n=r.bodies.find(i=>i.id===e.id);return{newBody:e,oldBody:n&&!qe(n,e)?n:void 0}}).filter(({oldBody:e})=>e),Hf=(r,t)=>!qe(r.target,t.target),Xf=(r,t)=>({oldValue:r,newValue:t,bodiesCreated:Uf(r,t),bodiesDeleted:Gf(r,t),bodiesUpdated:kf(r,t),targetUpdated:Hf(r,t)?{oldTarget:r.target,newTarget:t.target}:void 0});var It=(r=>(r.LOCAL="LOCAL",r.REMOTE="REMOTE",r))(It||{});const jf=(r,t)=>{var o,a;const{changes:e,origin:n}=t;if(!(!r.options.origin||r.options.origin===n))return!1;if(r.options.ignore){const{ignore:s}=r.options,u=f=>(f==null?void 0:f.length)>0;if(!(u(e.created)||u(e.deleted))){const f=(o=e.updated)==null?void 0:o.some(c=>u(c.bodiesCreated)||u(c.bodiesDeleted)||u(c.bodiesUpdated)),l=(a=e.updated)==null?void 0:a.some(c=>c.targetUpdated);if(s==="BODY_ONLY"&&f&&!l||s==="TARGET_ONLY"&&l&&!f)return!1}}if(r.options.annotations){const s=new Set([...e.created.map(h=>h.id),...e.deleted.map(h=>h.id),...e.updated.map(({oldValue:h})=>h.id)]);return!!(Array.isArray(r.options.annotations)?r.options.annotations:[r.options.annotations]).find(h=>s.has(h))}else return!0},Yf=r=>r.id!==void 0,Vf=()=>{const r=new Map,t=new Map,e=[],n=(T,w={})=>e.push({onChange:T,options:w}),i=T=>{const w=e.findIndex(E=>E.onChange==T);w>-1&&e.splice(w,1)},o=(T,w)=>{const E={origin:T,changes:{created:w.created||[],updated:w.updated||[],deleted:w.deleted||[]},state:[...r.values()]};e.forEach(R=>{jf(R,E)&&R.onChange(E)})},a=(T,w=It.LOCAL)=>{if(r.get(T.id))throw Error(`Cannot add annotation ${T.id} - exists already`);r.set(T.id,T),T.bodies.forEach(R=>t.set(R.id,T.id)),o(w,{created:[T]})},s=(T,w=It.LOCAL,E=It.LOCAL)=>{const R=Yf(w)?E:w,O=typeof T=="string"?w:T,C=typeof T=="string"?T:T.id,k=r.get(C);if(k){const B=Xf(k,O);C===O.id?r.set(C,O):(r.delete(C),r.set(O.id,O)),k.bodies.forEach(N=>t.delete(N.id)),O.bodies.forEach(N=>t.set(N.id,O.id)),o(R,{updated:[B]})}else throw Error(`Cannot update annotation ${C} - does not exist`)},u=(T,w=It.LOCAL)=>{const E=r.get(T.annotation);if(E){const R={...E,bodies:[...E.bodies,T]};r.set(E.id,R),t.set(T.id,R.id),o(w,{updated:[{oldValue:E,newValue:R,bodiesCreated:[T]}]})}else console.warn(`Attempt to add body to missing annotation: ${T.annotation}`)},h=()=>[...r.values()],f=(T=It.LOCAL)=>{const w=[...r.values()];r.clear(),t.clear(),o(T,{deleted:w})},l=(T,w=!0,E=It.LOCAL)=>{if(w){const R=[...r.values()];r.clear(),t.clear(),T.forEach(O=>{r.set(O.id,O),O.bodies.forEach(C=>t.set(C.id,O.id))}),o(E,{created:T,deleted:R})}else{const R=T.reduce((O,C)=>{const k=r.get(C.id);return k?[...O,k]:O},[]);if(R.length>0)throw Error(`Bulk insert would overwrite the following annotations: ${R.map(O=>O.id).join(", ")}`);T.forEach(O=>{r.set(O.id,O),O.bodies.forEach(C=>t.set(C.id,O.id))}),o(E,{created:T})}},c=T=>{const w=typeof T=="string"?T:T.id,E=r.get(w);if(E)return r.delete(w),E.bodies.forEach(R=>t.delete(R.id)),E;console.warn(`Attempt to delete missing annotation: ${w}`)},d=(T,w=It.LOCAL)=>{const E=c(T);E&&o(w,{deleted:[E]})},p=(T,w=It.LOCAL)=>{const E=T.reduce((R,O)=>{const C=c(O);return C?[...R,C]:R},[]);E.length>0&&o(w,{deleted:E})},v=(T,w=It.LOCAL)=>{const E=r.get(T.annotation);if(E){const R=E.bodies.find(O=>O.id===T.id);if(R){t.delete(R.id);const O={...E,bodies:E.bodies.filter(k=>k.id!==T.id)};r.set(E.id,O),o(w,{updated:[{oldValue:E,newValue:O,bodiesDeleted:[R]}]})}else console.warn(`Attempt to delete missing body ${T.id} from annotation ${T.annotation}`)}else console.warn(`Attempt to delete body from missing annotation ${T.annotation}`)},_=T=>{const w=r.get(T);return w?{...w}:void 0},g=T=>{const w=t.get(T);if(w){const R=_(w).bodies.find(O=>O.id===T);if(R)return R;console.error(`Store integrity error: body ${T} in index, but not in annotation`)}else console.warn(`Attempt to retrieve missing body: ${T}`)},m=(T,w)=>{if(T.annotation!==w.annotation)throw"Annotation integrity violation: annotation ID must be the same when updating bodies";const E=r.get(T.annotation);if(E){const R=E.bodies.find(C=>C.id===T.id),O={...E,bodies:E.bodies.map(C=>C.id===R.id?w:C)};return r.set(E.id,O),R.id!==w.id&&(t.delete(R.id),t.set(w.id,O.id)),{oldValue:E,newValue:O,bodiesUpdated:[{oldBody:R,newBody:w}]}}else console.warn(`Attempt to add body to missing annotation ${T.annotation}`)},y=(T,w,E=It.LOCAL)=>{const R=m(T,w);o(E,{updated:[R]})},b=(T,w=It.LOCAL)=>{const E=T.map(R=>m({id:R.id,annotation:R.annotation},R));o(w,{updated:E})},x=T=>{const w=r.get(T.annotation);if(w){const E={...w,target:{...w.target,...T}};return r.set(w.id,E),{oldValue:w,newValue:E,targetUpdated:{oldTarget:w.target,newTarget:T}}}else console.warn(`Attempt to update target on missing annotation: ${T.annotation}`)};return{addAnnotation:a,addBody:u,all:h,bulkAddAnnotation:l,bulkDeleteAnnotation:p,bulkUpdateBodies:b,bulkUpdateTargets:(T,w=It.LOCAL)=>{const E=T.map(x).filter(R=>R);E.length>0&&o(w,{updated:E})},clear:f,deleteAnnotation:d,deleteBody:v,getAnnotation:_,getBody:g,observe:n,unobserve:i,updateAnnotation:s,updateBody:y,updateTarget:(T,w=It.LOCAL)=>{const E=x(T);E&&o(w,{updated:[E]})}}},zf=()=>{const{subscribe:r,set:t}=Qi([]);return{subscribe:r,set:t}},Wf=(r,t,e,n,i,o)=>{const a=new Map;let s=[],u,h;const f=(p,v)=>{a.has(p)?a.get(p).push(v):a.set(p,[v])},l=(p,v)=>{const _=a.get(p);_&&_.indexOf(v)>0&&_.splice(_.indexOf(v),1)},c=(p,v,_)=>{a.has(p)&&setTimeout(()=>{a.get(p).forEach(g=>{if(i){const m=Array.isArray(v)?v.map(b=>i.serialize(b)):i.serialize(v),y=_?_ instanceof PointerEvent?_:i.serialize(_):void 0;g(m,y)}else g(v,_)})},1)},d=()=>{const{selected:p}=t,v=p.map(({id:_})=>r.getAnnotation(_));v.forEach(_=>{const g=s.find(m=>m.id===_.id);(!g||!qe(g,_))&&c("updateAnnotation",_,g)}),s=s.map(_=>{const g=v.find(({id:m})=>m===_.id);return g||_})};return t.subscribe(({selected:p})=>{if(!(s.length===0&&p.length===0)){if(s.length===0&&p.length>0)s=p.map(({id:v})=>r.getAnnotation(v));else if(s.length>0&&p.length===0)s.forEach(v=>{const _=r.getAnnotation(v.id);_&&!qe(_,v)&&c("updateAnnotation",_,v)}),s=[];else{const v=new Set(s.map(m=>m.id)),_=new Set(p.map(({id:m})=>m));s.filter(m=>!_.has(m.id)).forEach(m=>{const y=r.getAnnotation(m.id);y&&!qe(y,m)&&c("updateAnnotation",y,m)}),s=[...s.filter(m=>_.has(m.id)),...p.filter(({id:m})=>!v.has(m)).map(({id:m})=>r.getAnnotation(m))]}c("selectionChanged",s)}}),e.subscribe(p=>{!u&&p?c("mouseEnterAnnotation",r.getAnnotation(p)):u&&!p?c("mouseLeaveAnnotation",r.getAnnotation(u)):u&&p&&(c("mouseLeaveAnnotation",r.getAnnotation(u)),c("mouseEnterAnnotation",r.getAnnotation(p))),u=p}),n==null||n.subscribe(p=>c("viewportIntersect",p.map(r.getAnnotation))),r.observe(p=>{o&&(h&&clearTimeout(h),h=setTimeout(d,1e3));const{created:v,deleted:_}=p.changes;v.forEach(m=>c("createAnnotation",m)),_.forEach(m=>c("deleteAnnotation",m)),p.changes.updated.filter(m=>[...m.bodiesCreated||[],...m.bodiesDeleted||[],...m.bodiesUpdated||[]].length>0).forEach(({oldValue:m,newValue:y})=>{const b=s.find(x=>x.id===m.id)||m;s=s.map(x=>x.id===m.id?y:x),c("updateAnnotation",y,b)})},{origin:It.LOCAL}),r.observe(p=>{if(s){const v=new Set(s.map(g=>g.id)),_=p.changes.updated.filter(({newValue:g})=>v.has(g.id)).map(({newValue:g})=>g);_.length>0&&(s=s.map(g=>{const m=_.find(y=>y.id===g.id);return m||g}))}},{origin:It.REMOTE}),{on:f,off:l,emit:c}},qf=r=>t=>t.reduce((e,n)=>{const{parsed:i,error:o}=r.parse(n);return o?{parsed:e.parsed,failed:[...e.failed,n]}:{parsed:[...e.parsed,i],failed:e.failed}},{parsed:[],failed:[]}),$f=(r,t)=>{const e=f=>{if(t){const{parsed:l,error:c}=t.parse(f);l?r.addAnnotation(l,It.REMOTE):console.error(c)}else r.addAnnotation(f,It.REMOTE)},n=()=>r.clear(),i=f=>{const l=r.getAnnotation(f);return t&&l?t.serialize(l):l},o=()=>t?r.all().map(t.serialize):r.all(),a=f=>fetch(f).then(l=>l.json()).then(l=>(u(l),l)),s=f=>{if(typeof f=="string"){const l=r.getAnnotation(f);return r.deleteAnnotation(f),t?t.serialize(l):l}else{const l=t?t.parse(f).parsed:f;return r.deleteAnnotation(l),f}},u=f=>{if(t){const{parsed:l,failed:c}=qf(t)(f);c.length>0&&console.warn(`Discarded ${c.length} invalid annotations`,c),r.bulkAddAnnotation(l,!0,It.REMOTE)}else r.bulkAddAnnotation(f,!0,It.REMOTE)};return{addAnnotation:e,clearAnnotations:n,getAnnotationById:i,getAnnotations:o,loadAnnotations:a,removeAnnotation:s,setAnnotations:u,updateAnnotation:f=>{if(t){const l=t.parse(f).parsed,c=t.serialize(r.getAnnotation(l.id));return r.updateAnnotation(l),c}else{const l=r.getAnnotation(f.id);return r.updateAnnotation(f),l}}}};let Kf=r=>crypto.getRandomValues(new Uint8Array(r)),Zf=(r,t,e)=>{let n=(2<<Math.log(r.length-1)/Math.LN2)-1,i=-~(1.6*n*t/r.length);return(o=t)=>{let a="";for(;;){let s=e(i),u=i;for(;u--;)if(a+=r[s[u]&n]||"",a.length===o)return a}}},Jf=(r,t=21)=>Zf(r,t,Kf),Qf=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((t,e)=>(e&=63,e<36?t+=e.toString(36):e<62?t+=(e-26).toString(36).toUpperCase():e>62?t+="-":t+="_",t),"");const tc=()=>({isGuest:!0,id:Jf("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_",20)()}),ec=["#ff7c00","#1ac938","#e8000b","#8b2be2","#9f4800","#f14cc1","#ffc400","#00d7ff","#023eff"],rc=()=>{const r=[...ec];return{assignRandomColor:()=>{const n=Math.floor(Math.random()*r.length),i=r[n];return r.splice(n,1),i},releaseColor:n=>r.push(n)}};Qf();var Wt=(r=>(r.ELLIPSE="ELLIPSE",r.POLYGON="POLYGON",r.RECTANGLE="RECTANGLE",r))(Wt||{});const ro={},no=(r,t)=>ro[r]=t,Is=r=>ro[r.type].area(r),nc=(r,t,e)=>ro[r.type].intersects(r,t,e),io=r=>{let t=1/0,e=1/0,n=-1/0,i=-1/0;return r.forEach(([o,a])=>{t=Math.min(t,o),e=Math.min(e,a),n=Math.max(n,o),i=Math.max(i,a)}),{minX:t,minY:e,maxX:n,maxY:i}},ic={area:r=>Math.PI*r.geometry.rx*r.geometry.ry,intersects:(r,t,e)=>{const{cx:n,cy:i,rx:o,ry:a}=r.geometry,s=0,u=Math.cos(s),h=Math.sin(s),f=t-n,l=e-i,c=u*f+h*l,d=h*f-u*l;return c*c/(o*o)+d*d/(a*a)<=1}};no(Wt.ELLIPSE,ic);const oc={area:r=>{const{points:t}=r.geometry;let e=0,n=t.length-1;for(let i=0;i<t.length;i++)e+=(t[n][0]+t[i][0])*(t[n][1]-t[i][1]),n=i;return Math.abs(.5*e)},intersects:(r,t,e)=>{const{points:n}=r.geometry;let i=!1;for(let o=0,a=n.length-1;o<n.length;a=o++){const s=n[o][0],u=n[o][1],h=n[a][0],f=n[a][1];u>e!=f>e&&t<(h-s)*(e-u)/(f-u)+s&&(i=!i)}return i}};no(Wt.POLYGON,oc);const ac={area:r=>r.geometry.w*r.geometry.h,intersects:(r,t,e)=>t>=r.geometry.x&&t<=r.geometry.x+r.geometry.w&&e>=r.geometry.y&&e<=r.geometry.y+r.geometry.h};no(Wt.RECTANGLE,ac);function Cs(r,t,e){const n=r.slice();return n[11]=t[e],n[13]=e,n}function Ms(r){let t,e,n,i,o;return{c(){t=ft("rect"),S(t,"class","a9s-corner-handle"),S(t,"x",e=r[11][0]-r[3]/2),S(t,"y",n=r[11][1]-r[3]/2),S(t,"height",r[3]),S(t,"width",r[3])},m(a,s){Z(a,t,s),i||(o=zt(t,"pointerdown",function(){Xt(r[10](V(r[13])))&&r[10](V(r[13])).apply(this,arguments)}),i=!0)},p(a,s){r=a,s&24&&e!==(e=r[11][0]-r[3]/2)&&S(t,"x",e),s&24&&n!==(n=r[11][1]-r[3]/2)&&S(t,"y",n),s&8&&S(t,"height",r[3]),s&8&&S(t,"width",r[3])},d(a){a&&$(t),i=!1,o()}}}function sc(r){let t,e,n,i,o,a,s,u,h,f,l=r[4].points,c=[];for(let d=0;d<l.length;d+=1)c[d]=Ms(Cs(r,l,d));return{c(){t=ft("polygon"),i=re(),o=ft("polygon"),s=re();for(let d=0;d<c.length;d+=1)c[d].c();u=Ne(),S(t,"class","a9s-outer"),S(t,"style",e=r[1]?"display:none;":void 0),S(t,"points",n=r[4].points.map(Ds).join(" ")),S(o,"class","a9s-inner a9s-shape-handle"),S(o,"style",r[1]),S(o,"points",a=r[4].points.map(Fs).join(" "))},m(d,p){Z(d,t,p),Z(d,i,p),Z(d,o,p),Z(d,s,p);for(let v=0;v<c.length;v+=1)c[v]&&c[v].m(d,p);Z(d,u,p),h||(f=[zt(t,"pointerdown",function(){Xt(r[10](V.SHAPE))&&r[10](V.SHAPE).apply(this,arguments)}),zt(o,"pointerdown",function(){Xt(r[10](V.SHAPE))&&r[10](V.SHAPE).apply(this,arguments)})],h=!0)},p(d,p){if(r=d,p&2&&e!==(e=r[1]?"display:none;":void 0)&&S(t,"style",e),p&16&&n!==(n=r[4].points.map(Ds).join(" "))&&S(t,"points",n),p&2&&S(o,"style",r[1]),p&16&&a!==(a=r[4].points.map(Fs).join(" "))&&S(o,"points",a),p&1048){l=r[4].points;let v;for(v=0;v<l.length;v+=1){const _=Cs(r,l,v);c[v]?c[v].p(_,p):(c[v]=Ms(_),c[v].c(),c[v].m(u.parentNode,u))}for(;v<c.length;v+=1)c[v].d(1);c.length=l.length}},d(d){d&&$(t),d&&$(i),d&&$(o),d&&$(s),Wi(c,d),d&&$(u),h=!1,Be(f)}}}function uc(r){let t,e;return t=new Us({props:{shape:r[0],transform:r[2],editor:r[5],$$slots:{default:[sc,({grab:n})=>({10:n}),({grab:n})=>n?1024:0]},$$scope:{ctx:r}}}),t.$on("change",r[7]),t.$on("grab",r[8]),t.$on("release",r[9]),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,[i]){const o={};i&1&&(o.shape=n[0]),i&4&&(o.transform=n[2]),i&17434&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}const Ds=r=>r.join(","),Fs=r=>r.join(",");function hc(r,t,e){let n,i,{shape:o}=t,{computedStyle:a=void 0}=t,{transform:s}=t,{viewportScale:u=1}=t;const h=(d,p,v)=>{let _;p===V.SHAPE?_=d.geometry.points.map(([m,y])=>[m+v[0],y+v[1]]):_=d.geometry.points.map(([m,y],b)=>p===V(b)?[m+v[0],y+v[1]]:[m,y]);const g=io(_);return{...d,geometry:{points:_,bounds:g}}};function f(d){yr.call(this,r,d)}function l(d){yr.call(this,r,d)}function c(d){yr.call(this,r,d)}return r.$$set=d=>{"shape"in d&&e(0,o=d.shape),"computedStyle"in d&&e(1,a=d.computedStyle),"transform"in d&&e(2,s=d.transform),"viewportScale"in d&&e(6,u=d.viewportScale)},r.$$.update=()=>{r.$$.dirty&1&&e(4,n=o.geometry),r.$$.dirty&64&&e(3,i=10/u)},[o,a,s,i,n,h,u,f,l,c]}class lc extends Zt{constructor(t){super(),Kt(this,t,hc,uc,Lt,{shape:0,computedStyle:1,transform:2,viewportScale:6})}}function fc(r){let t,e,n,i,o,a,s,u,h,f,l,c,d,p,v,_,g,m,y,b,x,A,P,T,w,E,R,O,C,k,B,N,q,K,Q,L,F,H,tt,rt,vt,Y,ht,mt,Tt,W,it,at,ct,nt;return{c(){t=ft("rect"),s=re(),u=ft("rect"),d=re(),p=ft("rect"),m=re(),y=ft("rect"),P=re(),T=ft("rect"),O=re(),C=ft("rect"),q=re(),K=ft("rect"),F=re(),H=ft("rect"),vt=re(),Y=ft("rect"),Tt=re(),W=ft("rect"),S(t,"class","a9s-outer"),S(t,"style",e=r[1]?"display:none;":void 0),S(t,"x",n=r[4].x),S(t,"y",i=r[4].y),S(t,"width",o=r[4].w),S(t,"height",a=r[4].h),S(u,"class","a9s-inner a9s-shape-handle"),S(u,"style",r[1]),S(u,"x",h=r[4].x),S(u,"y",f=r[4].y),S(u,"width",l=r[4].w),S(u,"height",c=r[4].h),S(p,"class","a9s-edge-handle a9s-edge-handle-top"),S(p,"x",v=r[4].x),S(p,"y",_=r[4].y),S(p,"height",1),S(p,"width",g=r[4].w),S(y,"class","a9s-edge-handle a9s-edge-handle-right"),S(y,"x",b=r[4].x+r[4].w),S(y,"y",x=r[4].y),S(y,"height",A=r[4].h),S(y,"width",1),S(T,"class","a9s-edge-handle a9s-edge-handle-bottom"),S(T,"x",w=r[4].x),S(T,"y",E=r[4].y+r[4].h),S(T,"height",1),S(T,"width",R=r[4].w),S(C,"class","a9s-edge-handle a9s-edge-handle-left"),S(C,"x",k=r[4].x),S(C,"y",B=r[4].y),S(C,"height",N=r[4].h),S(C,"width",1),S(K,"class","a9s-corner-handle a9s-corner-handle-topleft"),S(K,"x",Q=r[4].x-r[3]/2),S(K,"y",L=r[4].y-r[3]/2),S(K,"height",r[3]),S(K,"width",r[3]),S(H,"class","a9s-corner-handle a9s-corner-handle-topright"),S(H,"x",tt=r[4].x+r[4].w-r[3]/2),S(H,"y",rt=r[4].y-r[3]/2),S(H,"height",r[3]),S(H,"width",r[3]),S(Y,"class","a9s-corner-handle a9s-corner-handle-bottomright"),S(Y,"x",ht=r[4].x+r[4].w-r[3]/2),S(Y,"y",mt=r[4].y+r[4].h-r[3]/2),S(Y,"height",r[3]),S(Y,"width",r[3]),S(W,"class","a9s-corner-handle a9s-corner-handle-bottomleft"),S(W,"x",it=r[4].x-r[3]/2),S(W,"y",at=r[4].y+r[4].h-r[3]/2),S(W,"height",r[3]),S(W,"width",r[3])},m(D,I){Z(D,t,I),Z(D,s,I),Z(D,u,I),Z(D,d,I),Z(D,p,I),Z(D,m,I),Z(D,y,I),Z(D,P,I),Z(D,T,I),Z(D,O,I),Z(D,C,I),Z(D,q,I),Z(D,K,I),Z(D,F,I),Z(D,H,I),Z(D,vt,I),Z(D,Y,I),Z(D,Tt,I),Z(D,W,I),ct||(nt=[zt(t,"pointerdown",function(){Xt(r[10](V.SHAPE))&&r[10](V.SHAPE).apply(this,arguments)}),zt(u,"pointerdown",function(){Xt(r[10](V.SHAPE))&&r[10](V.SHAPE).apply(this,arguments)}),zt(p,"pointerdown",function(){Xt(r[10](V.TOP))&&r[10](V.TOP).apply(this,arguments)}),zt(y,"pointerdown",function(){Xt(r[10](V.RIGHT))&&r[10](V.RIGHT).apply(this,arguments)}),zt(T,"pointerdown",function(){Xt(r[10](V.BOTTOM))&&r[10](V.BOTTOM).apply(this,arguments)}),zt(C,"pointerdown",function(){Xt(r[10](V.LEFT))&&r[10](V.LEFT).apply(this,arguments)}),zt(K,"pointerdown",function(){Xt(r[10](V.TOP_LEFT))&&r[10](V.TOP_LEFT).apply(this,arguments)}),zt(H,"pointerdown",function(){Xt(r[10](V.TOP_RIGHT))&&r[10](V.TOP_RIGHT).apply(this,arguments)}),zt(Y,"pointerdown",function(){Xt(r[10](V.BOTTOM_RIGHT))&&r[10](V.BOTTOM_RIGHT).apply(this,arguments)}),zt(W,"pointerdown",function(){Xt(r[10](V.BOTTOM_LEFT))&&r[10](V.BOTTOM_LEFT).apply(this,arguments)})],ct=!0)},p(D,I){r=D,I&2&&e!==(e=r[1]?"display:none;":void 0)&&S(t,"style",e),I&16&&n!==(n=r[4].x)&&S(t,"x",n),I&16&&i!==(i=r[4].y)&&S(t,"y",i),I&16&&o!==(o=r[4].w)&&S(t,"width",o),I&16&&a!==(a=r[4].h)&&S(t,"height",a),I&2&&S(u,"style",r[1]),I&16&&h!==(h=r[4].x)&&S(u,"x",h),I&16&&f!==(f=r[4].y)&&S(u,"y",f),I&16&&l!==(l=r[4].w)&&S(u,"width",l),I&16&&c!==(c=r[4].h)&&S(u,"height",c),I&16&&v!==(v=r[4].x)&&S(p,"x",v),I&16&&_!==(_=r[4].y)&&S(p,"y",_),I&16&&g!==(g=r[4].w)&&S(p,"width",g),I&16&&b!==(b=r[4].x+r[4].w)&&S(y,"x",b),I&16&&x!==(x=r[4].y)&&S(y,"y",x),I&16&&A!==(A=r[4].h)&&S(y,"height",A),I&16&&w!==(w=r[4].x)&&S(T,"x",w),I&16&&E!==(E=r[4].y+r[4].h)&&S(T,"y",E),I&16&&R!==(R=r[4].w)&&S(T,"width",R),I&16&&k!==(k=r[4].x)&&S(C,"x",k),I&16&&B!==(B=r[4].y)&&S(C,"y",B),I&16&&N!==(N=r[4].h)&&S(C,"height",N),I&24&&Q!==(Q=r[4].x-r[3]/2)&&S(K,"x",Q),I&24&&L!==(L=r[4].y-r[3]/2)&&S(K,"y",L),I&8&&S(K,"height",r[3]),I&8&&S(K,"width",r[3]),I&24&&tt!==(tt=r[4].x+r[4].w-r[3]/2)&&S(H,"x",tt),I&24&&rt!==(rt=r[4].y-r[3]/2)&&S(H,"y",rt),I&8&&S(H,"height",r[3]),I&8&&S(H,"width",r[3]),I&24&&ht!==(ht=r[4].x+r[4].w-r[3]/2)&&S(Y,"x",ht),I&24&&mt!==(mt=r[4].y+r[4].h-r[3]/2)&&S(Y,"y",mt),I&8&&S(Y,"height",r[3]),I&8&&S(Y,"width",r[3]),I&24&&it!==(it=r[4].x-r[3]/2)&&S(W,"x",it),I&24&&at!==(at=r[4].y+r[4].h-r[3]/2)&&S(W,"y",at),I&8&&S(W,"height",r[3]),I&8&&S(W,"width",r[3])},d(D){D&&$(t),D&&$(s),D&&$(u),D&&$(d),D&&$(p),D&&$(m),D&&$(y),D&&$(P),D&&$(T),D&&$(O),D&&$(C),D&&$(q),D&&$(K),D&&$(F),D&&$(H),D&&$(vt),D&&$(Y),D&&$(Tt),D&&$(W),ct=!1,Be(nt)}}}function cc(r){let t,e;return t=new Us({props:{shape:r[0],transform:r[2],editor:r[5],$$slots:{default:[fc,({grab:n})=>({10:n}),({grab:n})=>n?1024:0]},$$scope:{ctx:r}}}),t.$on("grab",r[7]),t.$on("change",r[8]),t.$on("release",r[9]),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,[i]){const o={};i&1&&(o.shape=n[0]),i&4&&(o.transform=n[2]),i&3098&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function dc(r,t,e){let n,i,{shape:o}=t,{computedStyle:a=void 0}=t,{transform:s}=t,{viewportScale:u=1}=t;const h=(d,p,v)=>{const _=d.geometry.bounds;let[g,m]=[_.minX,_.minY],[y,b]=[_.maxX,_.maxY];const[x,A]=v;if(p===V.SHAPE)g+=x,y+=x,m+=A,b+=A;else{switch(p){case V.TOP:case V.TOP_LEFT:case V.TOP_RIGHT:{m+=A;break}case V.BOTTOM:case V.BOTTOM_LEFT:case V.BOTTOM_RIGHT:{b+=A;break}}switch(p){case V.LEFT:case V.TOP_LEFT:case V.BOTTOM_LEFT:{g+=x;break}case V.RIGHT:case V.TOP_RIGHT:case V.BOTTOM_RIGHT:{y+=x;break}}}const P=Math.min(g,y),T=Math.min(m,b),w=Math.abs(y-g),E=Math.abs(b-m);return{...d,geometry:{x:P,y:T,w,h:E,bounds:{minX:P,minY:T,maxX:P+w,maxY:T+E}}}};function f(d){yr.call(this,r,d)}function l(d){yr.call(this,r,d)}function c(d){yr.call(this,r,d)}return r.$$set=d=>{"shape"in d&&e(0,o=d.shape),"computedStyle"in d&&e(1,a=d.computedStyle),"transform"in d&&e(2,s=d.transform),"viewportScale"in d&&e(6,u=d.viewportScale)},r.$$.update=()=>{r.$$.dirty&1&&e(4,n=o.geometry),r.$$.dirty&64&&e(3,i=10/u)},[o,a,s,i,n,h,u,f,l,c]}class pc extends Zt{constructor(t){super(),Kt(this,t,dc,cc,Lt,{shape:0,computedStyle:1,transform:2,viewportScale:6})}}const Bs=new Map([[Wt.RECTANGLE,pc],[Wt.POLYGON,lc]]),Ns=r=>Bs.get(r.type),vc=(r,t)=>Bs.set(r,t),V=r=>`HANDLE-${r}`;V.SHAPE="SHAPE",V.TOP="TOP",V.RIGHT="RIGHT",V.BOTTOM="BOTTOM",V.LEFT="LEFT",V.TOP_LEFT="TOP_LEFT",V.TOP_RIGHT="TOP_RIGHT",V.BOTTOM_RIGHT="BOTTOM_RIGHT",V.BOTTOM_LEFT="BOTTOM_LEFT";const _c=r=>({}),Ls=r=>({grab:r[0]});function gc(r){let t,e,n,i;const o=r[7].default,a=bs(o,r,r[6],Ls);return{c(){t=ft("g"),a&&a.c(),S(t,"class","a9s-annotation selected")},m(s,u){Z(s,t,u),a&&a.m(t,null),e=!0,n||(i=[zt(t,"pointerup",r[2]),zt(t,"pointermove",r[1])],n=!0)},p(s,[u]){a&&a.p&&(!e||u&64)&&Ts(a,o,s,s[6],e?Es(o,s[6],u,_c):ws(s[6]),Ls)},i(s){e||(lt(a,s),e=!0)},o(s){_t(a,s),e=!1},d(s){s&&$(t),a&&a.d(s),n=!1,Be(i)}}}function mc(r,t,e){let{$$slots:n={},$$scope:i}=t;const o=mr();let{shape:a}=t,{editor:s}=t,{transform:u}=t,h=null,f,l=null;const c=v=>_=>{h=v,f=u.elementToImage(_.offsetX,_.offsetY),l=a,_.target.setPointerCapture(_.pointerId),o("grab")},d=v=>{if(h){const[_,g]=u.elementToImage(v.offsetX,v.offsetY),m=[_-f[0],g-f[1]];e(3,a=s(l,h,m)),o("change",a)}},p=v=>{v.target.releasePointerCapture(v.pointerId),h=null,l=a,o("release")};return r.$$set=v=>{"shape"in v&&e(3,a=v.shape),"editor"in v&&e(4,s=v.editor),"transform"in v&&e(5,u=v.transform),"$$scope"in v&&e(6,i=v.$$scope)},[c,d,p,a,s,u,i,n]}class Us extends Zt{constructor(t){super(),Kt(this,t,mc,gc,Lt,{shape:3,editor:4,transform:5})}}const yc=(r,t)=>{const e=typeof t=="function"?t(r):t;if(e){const{fill:n,fillOpacity:i}=e;let o="";return n&&(o+=`fill:${n};stroke:${n};`),o+=`fill-opacity:${i||"0.25"};`,o}};function bc(r,t,e){let n;const i=mr();let{annotation:o}=t,{editor:a}=t,{style:s=void 0}=t,{target:u}=t,{transform:h}=t,{viewportScale:f}=t,l;return gr(()=>(e(6,l=new a({target:u,props:{shape:o.target.selector,computedStyle:n,transform:h,viewportScale:f}})),l.$on("change",c=>{l.$$set({shape:c.detail}),i("change",c.detail)}),l.$on("grab",c=>i("grab",c.detail)),l.$on("release",c=>i("release",c.detail)),()=>{l.$destroy()})),r.$$set=c=>{"annotation"in c&&e(0,o=c.annotation),"editor"in c&&e(1,a=c.editor),"style"in c&&e(2,s=c.style),"target"in c&&e(3,u=c.target),"transform"in c&&e(4,h=c.transform),"viewportScale"in c&&e(5,f=c.viewportScale)},r.$$.update=()=>{r.$$.dirty&5&&(n=yc(o,s)),r.$$.dirty&80&&l&&l.$set({transform:h}),r.$$.dirty&96&&l&&l.$set({viewportScale:f})},[o,a,s,u,h,f,l]}class xc extends Zt{constructor(t){super(),Kt(this,t,bc,null,Lt,{annotation:0,editor:1,style:2,target:3,transform:4,viewportScale:5})}}function Gs(r){let t,e;return{c(){t=ft("rect"),e=ft("rect"),S(t,"class","a9s-outer"),S(t,"x",r[2]),S(t,"y",r[3]),S(t,"width",r[4]),S(t,"height",r[5]),S(e,"class","a9s-inner"),S(e,"x",r[2]),S(e,"y",r[3]),S(e,"width",r[4]),S(e,"height",r[5])},m(n,i){Z(n,t,i),Z(n,e,i)},p(n,i){i&4&&S(t,"x",n[2]),i&8&&S(t,"y",n[3]),i&16&&S(t,"width",n[4]),i&32&&S(t,"height",n[5]),i&4&&S(e,"x",n[2]),i&8&&S(e,"y",n[3]),i&16&&S(e,"width",n[4]),i&32&&S(e,"height",n[5])},d(n){n&&$(t),n&&$(e)}}}function Ec(r){let t,e=r[1]&&Gs(r);return{c(){t=ft("g"),e&&e.c(),S(t,"class","a9s-annotation a9s-rubberband")},m(n,i){Z(n,t,i),e&&e.m(t,null),r[9](t)},p(n,[i]){n[1]?e?e.p(n,i):(e=Gs(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Vt,o:Vt,d(n){n&&$(t),e&&e.d(),r[9](null)}}}function Tc(r,t,e){const n=mr();let{addEventListener:i}=t,{drawingMode:o}=t,{transform:a}=t,s,u,h,f,l,c,d,p;const v=b=>{u=performance.now(),o==="drag"&&(e(1,h=a.elementToImage(b.offsetX,b.offsetY)),f=h,e(2,l=h[0]),e(3,c=h[1]),e(4,d=1),e(5,p=1))},_=b=>{h&&(f=a.elementToImage(b.offsetX,b.offsetY),e(2,l=Math.min(f[0],h[0])),e(3,c=Math.min(f[1],h[1])),e(4,d=Math.abs(f[0]-h[0])),e(5,p=Math.abs(f[1]-h[1])))},g=b=>{const x=performance.now()-u;if(o==="click"){if(x>300)return;b.stopPropagation(),h?m():(e(1,h=a.elementToImage(b.offsetX,b.offsetY)),f=h,e(2,l=h[0]),e(3,c=h[1]),e(4,d=1),e(5,p=1))}else h&&(x>300||d*p>100?(b.stopPropagation(),m()):(e(1,h=null),f=null))},m=()=>{if(d*p>15){const b={type:Wt.RECTANGLE,geometry:{bounds:{minX:l,minY:c,maxX:l+d,maxY:c+p},x:l,y:c,w:d,h:p}};n("create",b)}e(1,h=null),f=null};gr(()=>{i("pointerdown",v),i("pointermove",_),i("pointerup",g,!0)});function y(b){xr[b?"unshift":"push"](()=>{s=b,e(0,s)})}return r.$$set=b=>{"addEventListener"in b&&e(6,i=b.addEventListener),"drawingMode"in b&&e(7,o=b.drawingMode),"transform"in b&&e(8,a=b.transform)},[s,h,l,c,d,p,i,o,a,y]}class wc extends Zt{constructor(t){super(),Kt(this,t,Tc,Ec,Lt,{addEventListener:6,drawingMode:7,transform:8})}}const ks=(r,t)=>{const e=Math.abs(t[0]-r[0]),n=Math.abs(t[1]-r[1]);return Math.sqrt(Math.pow(e,2)+Math.pow(n,2))};function oo(r){const t=r.slice(),e=(t[3]?t[1]:[...t[1],t[2]]).map(n=>n.join(",")).join(" ");return t[17]=e,t}function Hs(r){let t,e,n,i,o,a=r[3]&&Xs(r);return{c(){t=ft("polygon"),n=ft("polygon"),a&&a.c(),o=Ne(),S(t,"class","a9s-outer"),S(t,"points",e=r[17]),S(n,"class","a9s-inner"),S(n,"points",i=r[17])},m(s,u){Z(s,t,u),Z(s,n,u),a&&a.m(s,u),Z(s,o,u)},p(s,u){u&14&&e!==(e=s[17])&&S(t,"points",e),u&14&&i!==(i=s[17])&&S(n,"points",i),s[3]?a?a.p(s,u):(a=Xs(s),a.c(),a.m(o.parentNode,o)):a&&(a.d(1),a=null)},d(s){s&&$(t),s&&$(n),a&&a.d(s),s&&$(o)}}}function Xs(r){let t,e,n;return{c(){t=ft("rect"),S(t,"class","a9s-corner-handle"),S(t,"x",e=r[1][0][0]-r[4]/2),S(t,"y",n=r[1][0][1]-r[4]/2),S(t,"height",r[4]),S(t,"width",r[4])},m(i,o){Z(i,t,o)},p(i,o){o&18&&e!==(e=i[1][0][0]-i[4]/2)&&S(t,"x",e),o&18&&n!==(n=i[1][0][1]-i[4]/2)&&S(t,"y",n),o&16&&S(t,"height",i[4]),o&16&&S(t,"width",i[4])},d(i){i&&$(t)}}}function Sc(r){let t,e=r[2]&&Hs(oo(r));return{c(){t=ft("g"),e&&e.c(),S(t,"class","a9s-annotation a9s-rubberband")},m(n,i){Z(n,t,i),e&&e.m(t,null),r[9](t)},p(n,[i]){n[2]?e?e.p(oo(n),i):(e=Hs(oo(n)),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Vt,o:Vt,d(n){n&&$(t),e&&e.d(),r[9](null)}}}const Ac=20;function Pc(r,t,e){let n;const i=mr();let{addEventListener:o}=t,{drawingMode:a}=t,{transform:s}=t,{viewportScale:u=1}=t,h,f,l=[],c=null,d=!1;const p=b=>{if(f=performance.now(),a==="drag"&&l.length===0){const x=s.elementToImage(b.offsetX,b.offsetY);l.push(x),e(2,c=x)}},v=b=>{if(l.length>0&&(e(2,c=s.elementToImage(b.offsetX,b.offsetY)),l.length>2)){const x=ks(c,l[0])*u;e(3,d=x<Ac)}},_=b=>{const x=performance.now()-f;if(a==="click"){if(x>300)return;if(b.stopPropagation(),d)m();else if(l.length===0){const A=s.elementToImage(b.offsetX,b.offsetY);l.push(A),e(2,c=A)}else l.push(c)}else{if(l.length===1&&ks(l[0],c)<=4){e(1,l=[]),e(2,c=null);return}b.stopImmediatePropagation(),d?m():l.push(c)}},g=()=>{console.log("dblclick");const b=[...l,c],x={type:Wt.POLYGON,geometry:{bounds:io(b),points:b}};e(1,l=[]),e(2,c=null),i("create",x)},m=()=>{const b={type:Wt.POLYGON,geometry:{bounds:io(l),points:[...l]}};e(1,l=[]),e(2,c=null),i("create",b)};gr(()=>{o("pointerdown",p,!0),o("pointermove",v),o("pointerup",_,!0),o("dblclick",g,!0)});function y(b){xr[b?"unshift":"push"](()=>{h=b,e(0,h)})}return r.$$set=b=>{"addEventListener"in b&&e(5,o=b.addEventListener),"drawingMode"in b&&e(6,a=b.drawingMode),"transform"in b&&e(7,s=b.transform),"viewportScale"in b&&e(8,u=b.viewportScale)},r.$$.update=()=>{r.$$.dirty&256&&e(4,n=10/u)},[h,l,c,d,n,o,a,s,u,y]}class Oc extends Zt{constructor(t){super(),Kt(this,t,Pc,Sc,Lt,{addEventListener:5,drawingMode:6,transform:7,viewportScale:8})}}const ao=new Map([["rectangle",{tool:wc}],["polygon",{tool:Oc}]]),Rc=()=>[...ao.keys()],js=r=>ao.get(r),Ic=(r,t,e)=>ao.set(r,{tool:t,opts:e});function Cc(r,t,e,n,i){Ys(r,t,e||0,n||r.length-1,i||Mc)}function Ys(r,t,e,n,i){for(;n>e;){if(n-e>600){var o=n-e+1,a=t-e+1,s=Math.log(o),u=.5*Math.exp(2*s/3),h=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1),f=Math.max(e,Math.floor(t-a*u/o+h)),l=Math.min(n,Math.floor(t+(o-a)*u/o+h));Ys(r,t,f,l,i)}var c=r[t],d=e,p=n;for(rn(r,e,t),i(r[n],c)>0&&rn(r,e,n);d<p;){for(rn(r,d,p),d++,p--;i(r[d],c)<0;)d++;for(;i(r[p],c)>0;)p--}i(r[e],c)===0?rn(r,e,p):(p++,rn(r,p,n)),p<=t&&(e=p+1),t<=p&&(n=p-1)}}function rn(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Mc(r,t){return r<t?-1:r>t?1:0}class Dc{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!Hn(t,e))return n;const i=this.toBBox,o=[];for(;e;){for(let a=0;a<e.children.length;a++){const s=e.children[a],u=e.leaf?i(s):s;Hn(t,u)&&(e.leaf?n.push(s):uo(t,u)?this._all(s,n):o.push(s))}e=o.pop()}return n}collides(t){let e=this.data;if(!Hn(t,e))return!1;const n=[];for(;e;){for(let i=0;i<e.children.length;i++){const o=e.children[i],a=e.leaf?this.toBBox(o):o;if(Hn(t,a)){if(e.leaf||uo(t,a))return!0;n.push(o)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Ar([]),this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t),o=[],a=[];let s,u,h;for(;n||o.length;){if(n||(n=o.pop(),u=o[o.length-1],s=a.pop(),h=!0),n.leaf){const f=Fc(t,n.children,e);if(f!==-1)return n.children.splice(f,1),o.push(n),this._condense(o),this}!h&&!n.leaf&&uo(n,i)?(o.push(n),a.push(s),s=0,u=n,n=n.children[0]):u?(s++,n=u.children[s],h=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,i){const o=n-e+1;let a=this._maxEntries,s;if(o<=a)return s=Ar(t.slice(e,n+1)),Sr(s,this.toBBox),s;i||(i=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,i-1))),s=Ar([]),s.leaf=!1,s.height=i;const u=Math.ceil(o/a),h=u*Math.ceil(Math.sqrt(a));Vs(t,e,n,h,this.compareMinX);for(let f=e;f<=n;f+=h){const l=Math.min(f+h-1,n);Vs(t,f,l,u,this.compareMinY);for(let c=f;c<=l;c+=u){const d=Math.min(c+u-1,l);s.children.push(this._build(t,c,d,i-1))}}return Sr(s,this.toBBox),s}_chooseSubtree(t,e,n,i){for(;i.push(e),!(e.leaf||i.length-1===n);){let o=1/0,a=1/0,s;for(let u=0;u<e.children.length;u++){const h=e.children[u],f=so(h),l=Lc(t,h)-f;l<a?(a=l,o=f<o?f:o,s=h):l===a&&f<o&&(o=f,s=h)}e=s||e.children[0]}return e}_insert(t,e,n){const i=n?t:this.toBBox(t),o=[],a=this._chooseSubtree(i,this.data,e,o);for(a.children.push(t),on(a,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)}_split(t,e){const n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);const a=this._chooseSplitIndex(n,o,i),s=Ar(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,Sr(n,this.toBBox),Sr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=Ar([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Sr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i,o=1/0,a=1/0;for(let s=e;s<=n-e;s++){const u=nn(t,0,s,this.toBBox),h=nn(t,s,n,this.toBBox),f=Uc(u,h),l=so(u)+so(h);f<o?(o=f,i=s,a=l<a?l:a):f===o&&l<a&&(a=l,i=s)}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:Bc,o=t.leaf?this.compareMinY:Nc,a=this._allDistMargin(t,e,n,i),s=this._allDistMargin(t,e,n,o);a<s&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const o=this.toBBox,a=nn(t,0,e,o),s=nn(t,n-e,n,o);let u=kn(a)+kn(s);for(let h=e;h<n-e;h++){const f=t.children[h];on(a,t.leaf?o(f):f),u+=kn(a)}for(let h=n-e-1;h>=e;h--){const f=t.children[h];on(s,t.leaf?o(f):f),u+=kn(s)}return u}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)on(e[i],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Sr(t[e],this.toBBox)}}function Fc(r,t,e){if(!e)return t.indexOf(r);for(let n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1}function Sr(r,t){nn(r,0,r.children.length,t,r)}function nn(r,t,e,n,i){i||(i=Ar(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;o<e;o++){const a=r.children[o];on(i,r.leaf?n(a):a)}return i}function on(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Bc(r,t){return r.minX-t.minX}function Nc(r,t){return r.minY-t.minY}function so(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function kn(r){return r.maxX-r.minX+(r.maxY-r.minY)}function Lc(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function Uc(r,t){const e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),o=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,o-n)}function uo(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function Hn(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Ar(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Vs(r,t,e,n,i){const o=[t,e];for(;o.length;){if(e=o.pop(),t=o.pop(),e-t<=n)continue;const a=t+Math.ceil((e-t)/n/2)*n;Cc(r,a,t,e,i),o.push(t,a,a,e)}}const Gc=()=>{const r=new Dc,t=new Map,e=()=>[...t.values()],n=()=>{r.clear(),t.clear()},i=l=>{const{minX:c,minY:d,maxX:p,maxY:v}=l.selector.geometry.bounds,_={minX:c,minY:d,maxX:p,maxY:v,target:l};r.insert(_),t.set(l.annotation,_)},o=l=>{const c=t.get(l.annotation);r.remove(c),t.delete(l.annotation)};return{all:e,clear:n,getAt:(l,c)=>{const p=r.search({minX:l,minY:c,maxX:l,maxY:c}).map(v=>v.target).filter(v=>v.selector.type===Wt.RECTANGLE||nc(v.selector,l,c));if(p.length>0)return p.sort((v,_)=>Is(v.selector)-Is(_.selector)),p[0]},getIntersecting:(l,c,d,p)=>r.search({minX:l,minY:c,maxX:l+d,maxY:c+p}).map(v=>v.target),insert:i,remove:o,set:(l,c=!0)=>{c&&n();const d=l.map(p=>{const{minX:v,minY:_,maxX:g,maxY:m}=p.selector.geometry.bounds;return{minX:v,minY:_,maxX:g,maxY:m,target:p}});d.forEach(p=>t.set(p.target.annotation,p)),r.load(d)},size:()=>r.all().length,update:(l,c)=>{o(l),i(c)}}},kc=r=>{const t=Vf(),e=Gc(),n=Mf(t,r.pointerSelectAction),i=Cf(t),o=zf();return t.observe(({changes:u})=>{e.set(u.created.map(h=>h.target),!1),u.deleted.forEach(h=>e.remove(h.target)),u.updated.forEach(({oldValue:h,newValue:f})=>e.update(h.target,f.target))}),{store:{...t,getAt:(u,h)=>{const f=e.getAt(u,h);return f?t.getAnnotation(f.annotation):void 0},getIntersecting:(u,h,f,l)=>e.getIntersecting(u,h,f,l).map(c=>t.getAnnotation(c.annotation))},selection:n,hover:i,viewport:o}},Hc=r=>{let t,e;if(r.nodeName==="CANVAS")t=r,e=t.getContext("2d",{willReadFrequently:!0});else{const i=r;t=document.createElement("canvas"),t.width=i.width,t.height=i.height,e=t.getContext("2d",{willReadFrequently:!0}),e.drawImage(i,0,0,i.width,i.height)}let n=0;for(let i=1;i<10;i++)for(let o=1;o<10;o++){const a=Math.round(o*t.width/10),s=Math.round(i*t.height/10),u=e.getImageData(a,s,1,1).data,h=(.299*u[0]+.587*u[1]+.114*u[2])/255;n+=h}return n/81},Xc=(r,t)=>{const e=Hc(r),n=e>.6?"dark":"light";console.log(`[Annotorious] Image brightness: ${e.toFixed(1)}. Setting ${n} theme.`),t.setAttribute("data-theme",n)},jc=r=>({...r,drawingEnabled:r.drawingEnabled===void 0?!0:r.drawingEnabled,drawingMode:r.drawingMode||"drag",pointerSelectAction:r.pointerSelectAction||to.EDIT}),kE="",HE="",XE="";function Yc(r){var t=this.constructor;return this.then(function(e){return t.resolve(r()).then(function(){return e})},function(e){return t.resolve(r()).then(function(){return t.reject(e)})})}function Vc(r){var t=this;return new t(function(e,n){if(!(r&&typeof r.length<"u"))return n(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(r);if(i.length===0)return e([]);var o=i.length;function a(u,h){if(h&&(typeof h=="object"||typeof h=="function")){var f=h.then;if(typeof f=="function"){f.call(h,function(l){a(u,l)},function(l){i[u]={status:"rejected",reason:l},--o===0&&e(i)});return}}i[u]={status:"fulfilled",value:h},--o===0&&e(i)}for(var s=0;s<i.length;s++)a(s,i[s])})}function zs(r,t){this.name="AggregateError",this.errors=r,this.message=t||""}zs.prototype=Error.prototype;function zc(r){var t=this;return new t(function(e,n){if(!(r&&typeof r.length<"u"))return n(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return n();for(var o=[],a=0;a<i.length;a++)try{t.resolve(i[a]).then(e).catch(function(s){o.push(s),o.length===i.length&&n(new zs(o,"All promises were rejected"))})}catch(s){n(s)}})}var Wc=setTimeout;function Ws(r){return!!(r&&typeof r.length<"u")}function qc(){}function $c(r,t){return function(){r.apply(t,arguments)}}function St(r){if(!(this instanceof St))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],$s(r,this)}function qs(r,t){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(t);return}r._handled=!0,St._immediateFn(function(){var e=r._state===1?t.onFulfilled:t.onRejected;if(e===null){(r._state===1?ho:an)(t.promise,r._value);return}var n;try{n=e(r._value)}catch(i){an(t.promise,i);return}ho(t.promise,n)})}function ho(r,t){try{if(t===r)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var e=t.then;if(t instanceof St){r._state=3,r._value=t,lo(r);return}else if(typeof e=="function"){$s($c(e,t),r);return}}r._state=1,r._value=t,lo(r)}catch(n){an(r,n)}}function an(r,t){r._state=2,r._value=t,lo(r)}function lo(r){r._state===2&&r._deferreds.length===0&&St._immediateFn(function(){r._handled||St._unhandledRejectionFn(r._value)});for(var t=0,e=r._deferreds.length;t<e;t++)qs(r,r._deferreds[t]);r._deferreds=null}function Kc(r,t,e){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof t=="function"?t:null,this.promise=e}function $s(r,t){var e=!1;try{r(function(n){e||(e=!0,ho(t,n))},function(n){e||(e=!0,an(t,n))})}catch(n){if(e)return;e=!0,an(t,n)}}St.prototype.catch=function(r){return this.then(null,r)},St.prototype.then=function(r,t){var e=new this.constructor(qc);return qs(this,new Kc(r,t,e)),e},St.prototype.finally=Yc,St.all=function(r){return new St(function(t,e){if(!Ws(r))return e(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(r);if(n.length===0)return t([]);var i=n.length;function o(s,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var h=u.then;if(typeof h=="function"){h.call(u,function(f){o(s,f)},e);return}}n[s]=u,--i===0&&t(n)}catch(f){e(f)}}for(var a=0;a<n.length;a++)o(a,n[a])})},St.any=zc,St.allSettled=Vc,St.resolve=function(r){return r&&typeof r=="object"&&r.constructor===St?r:new St(function(t){t(r)})},St.reject=function(r){return new St(function(t,e){e(r)})},St.race=function(r){return new St(function(t,e){if(!Ws(r))return e(new TypeError("Promise.race accepts an array"));for(var n=0,i=r.length;n<i;n++)St.resolve(r[n]).then(t,e)})},St._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){Wc(r,0)},St._unhandledRejectionFn=function(t){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var Xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Zc(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),e}/*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */var Ks=Object.getOwnPropertySymbols,Jc=Object.prototype.hasOwnProperty,Qc=Object.prototype.propertyIsEnumerable;function td(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function ed(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var n=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var rd=ed()?Object.assign:function(r,t){for(var e,n=td(r),i,o=1;o<arguments.length;o++){e=Object(arguments[o]);for(var a in e)Jc.call(e,a)&&(n[a]=e[a]);if(Ks){i=Ks(e);for(var s=0;s<i.length;s++)Qc.call(e,i[s])&&(n[i[s]]=e[i[s]])}}return n};const nd=fo(rd);/*!
6
+ * @pixi/polyfill - v6.5.10
7
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
8
+ *
9
+ * @pixi/polyfill is licensed under the MIT License.
10
+ * http://www.opensource.org/licenses/mit-license
11
+ */typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=St),Object.assign||(Object.assign=nd);var id=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var od=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-od}}for(var co=Date.now(),Zs=["ms","moz","webkit","o"],po=0;po<Zs.length&&!globalThis.requestAnimationFrame;++po){var vo=Zs[po];globalThis.requestAnimationFrame=globalThis[vo+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[vo+"CancelAnimationFrame"]||globalThis[vo+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var t=Date.now(),e=id+co-t;return e<0&&(e=0),co=t,globalThis.self.setTimeout(function(){co=Date.now(),r(performance.now())},e)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(r){return clearTimeout(r)}),Math.sign||(Math.sign=function(t){return t=Number(t),t===0||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);/*!
12
+ * @pixi/constants - v6.5.10
13
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
14
+ *
15
+ * @pixi/constants is licensed under the MIT License.
16
+ * http://www.opensource.org/licenses/mit-license
17
+ */var Se;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Se||(Se={}));var sn;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(sn||(sn={}));var jn;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(jn||(jn={}));var j;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(j||(j={}));var oe;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(oe||(oe={}));var U;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(U||(U={}));var Ze;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Ze||(Ze={}));var X;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(X||(X={}));var Yn;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(Yn||(Yn={}));var _e;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(_e||(_e={}));var ge;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(ge||(ge={}));var ae;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(ae||(ae={}));var se;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(se||(se={}));var ue;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(ue||(ue={}));var Vn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(Vn||(Vn={}));var Qt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Qt||(Qt={}));var Ct;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(Ct||(Ct={}));var Js;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Js||(Js={}));var wt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(wt||(wt={}));var me;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(me||(me={}));/*!
18
+ * @pixi/settings - v6.5.10
19
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
20
+ *
21
+ * @pixi/settings is licensed under the MIT License.
22
+ * http://www.opensource.org/licenses/mit-license
23
+ */var ad={createCanvas:function(r,t){var e=document.createElement("canvas");return e.width=r,e.height=t,e},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,t){return fetch(r,t)}},_o=/iPhone/i,Qs=/iPod/i,tu=/iPad/i,eu=/\biOS-universal(?:.+)Mac\b/i,go=/\bAndroid(?:.+)Mobile\b/i,ru=/Android/i,Pr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,zn=/Silk/i,Ae=/Windows Phone/i,nu=/\bWindows(?:.+)ARM\b/i,iu=/BlackBerry/i,ou=/BB10/i,au=/Opera Mini/i,su=/\b(CriOS|Chrome)(?:.+)Mobile/i,uu=/Mobile(?:.+)Firefox\b/i,hu=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function sd(r){return function(t){return t.test(r)}}function ud(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,n=e.split("[FBAN");typeof n[1]<"u"&&(e=n[0]),n=e.split("Twitter"),typeof n[1]<"u"&&(e=n[0]);var i=sd(e),o={apple:{phone:i(_o)&&!i(Ae),ipod:i(Qs),tablet:!i(_o)&&(i(tu)||hu(t))&&!i(Ae),universal:i(eu),device:(i(_o)||i(Qs)||i(tu)||i(eu)||hu(t))&&!i(Ae)},amazon:{phone:i(Pr),tablet:!i(Pr)&&i(zn),device:i(Pr)||i(zn)},android:{phone:!i(Ae)&&i(Pr)||!i(Ae)&&i(go),tablet:!i(Ae)&&!i(Pr)&&!i(go)&&(i(zn)||i(ru)),device:!i(Ae)&&(i(Pr)||i(zn)||i(go)||i(ru))||i(/\bokhttp\b/i)},windows:{phone:i(Ae),tablet:i(nu),device:i(Ae)||i(nu)},other:{blackberry:i(iu),blackberry10:i(ou),opera:i(au),firefox:i(uu),chrome:i(su),device:i(iu)||i(ou)||i(au)||i(uu)||i(su)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}var ye=ud(globalThis.navigator);function hd(){return!ye.apple.device}function ld(r){var t=!0;if(ye.tablet||ye.phone){if(ye.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var n=parseInt(e[1],10);n<11&&(t=!1)}}if(ye.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var n=parseInt(e[1],10);n<7&&(t=!1)}}}return t?r:4}var G={ADAPTER:ad,MIPMAP_TEXTURES:ae.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:wt.NONE,SPRITE_MAX_TEXTURES:ld(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Vn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:ge.CLAMP,SCALE_MODE:_e.LINEAR,PRECISION_VERTEX:Qt.HIGH,PRECISION_FRAGMENT:ye.apple.device?Qt.HIGH:Qt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:hd(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},lu={exports:{}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(u,h,f){this.fn=u,this.context=h,this.once=f||!1}function o(u,h,f,l,c){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new i(f,l||u,c),p=e?e+h:h;return u._events[p]?u._events[p].fn?u._events[p]=[u._events[p],d]:u._events[p].push(d):(u._events[p]=d,u._eventsCount++),u}function a(u,h){--u._eventsCount===0?u._events=new n:delete u._events[h]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var h=[],f,l;if(this._eventsCount===0)return h;for(l in f=this._events)t.call(f,l)&&h.push(e?l.slice(1):l);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(f)):h},s.prototype.listeners=function(h){var f=e?e+h:h,l=this._events[f];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,d=l.length,p=new Array(d);c<d;c++)p[c]=l[c].fn;return p},s.prototype.listenerCount=function(h){var f=e?e+h:h,l=this._events[f];return l?l.fn?1:l.length:0},s.prototype.emit=function(h,f,l,c,d,p){var v=e?e+h:h;if(!this._events[v])return!1;var _=this._events[v],g=arguments.length,m,y;if(_.fn){switch(_.once&&this.removeListener(h,_.fn,void 0,!0),g){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,l),!0;case 4:return _.fn.call(_.context,f,l,c),!0;case 5:return _.fn.call(_.context,f,l,c,d),!0;case 6:return _.fn.call(_.context,f,l,c,d,p),!0}for(y=1,m=new Array(g-1);y<g;y++)m[y-1]=arguments[y];_.fn.apply(_.context,m)}else{var b=_.length,x;for(y=0;y<b;y++)switch(_[y].once&&this.removeListener(h,_[y].fn,void 0,!0),g){case 1:_[y].fn.call(_[y].context);break;case 2:_[y].fn.call(_[y].context,f);break;case 3:_[y].fn.call(_[y].context,f,l);break;case 4:_[y].fn.call(_[y].context,f,l,c);break;default:if(!m)for(x=1,m=new Array(g-1);x<g;x++)m[x-1]=arguments[x];_[y].fn.apply(_[y].context,m)}}return!0},s.prototype.on=function(h,f,l){return o(this,h,f,l,!1)},s.prototype.once=function(h,f,l){return o(this,h,f,l,!0)},s.prototype.removeListener=function(h,f,l,c){var d=e?e+h:h;if(!this._events[d])return this;if(!f)return a(this,d),this;var p=this._events[d];if(p.fn)p.fn===f&&(!c||p.once)&&(!l||p.context===l)&&a(this,d);else{for(var v=0,_=[],g=p.length;v<g;v++)(p[v].fn!==f||c&&!p[v].once||l&&p[v].context!==l)&&_.push(p[v]);_.length?this._events[d]=_.length===1?_[0]:_:a(this,d)}return this},s.prototype.removeAllListeners=function(h){var f;return h?(f=e?e+h:h,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=e,s.EventEmitter=s,r.exports=s})(lu);var fd=lu.exports;const un=fo(fd);var mo={exports:{}};mo.exports=Wn,mo.exports.default=Wn;function Wn(r,t,e){e=e||2;var n=t&&t.length,i=n?t[0]*e:r.length,o=fu(r,0,i,e,!0),a=[];if(!o||o.next===o.prev)return a;var s,u,h,f,l,c,d;if(n&&(o=_d(r,t,o,e)),r.length>80*e){s=h=r[0],u=f=r[1];for(var p=e;p<i;p+=e)l=r[p],c=r[p+1],l<s&&(s=l),c<u&&(u=c),l>h&&(h=l),c>f&&(f=c);d=Math.max(h-s,f-u),d=d!==0?32767/d:0}return hn(o,a,e,s,u,d,0),a}function fu(r,t,e,n,i){var o,a;if(i===xo(r,t,e,n)>0)for(o=t;o<e;o+=n)a=pu(o,r[o],r[o+1],a);else for(o=e-n;o>=t;o-=n)a=pu(o,r[o],r[o+1],a);return a&&qn(a,a.next)&&(fn(a),a=a.next),a}function Je(r,t){if(!r)return r;t||(t=r);var e=r,n;do if(n=!1,!e.steiner&&(qn(e,e.next)||At(e.prev,e,e.next)===0)){if(fn(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function hn(r,t,e,n,i,o,a){if(r){!a&&o&&xd(r,n,i,o);for(var s=r,u,h;r.prev!==r.next;){if(u=r.prev,h=r.next,o?dd(r,n,i,o):cd(r)){t.push(u.i/e|0),t.push(r.i/e|0),t.push(h.i/e|0),fn(r),r=h.next,s=h.next;continue}if(r=h,r===s){a?a===1?(r=pd(Je(r),t,e),hn(r,t,e,n,i,o,2)):a===2&&vd(r,t,e,n,i,o):hn(Je(r),t,e,n,i,o,1);break}}}}function cd(r){var t=r.prev,e=r,n=r.next;if(At(t,e,n)>=0)return!1;for(var i=t.x,o=e.x,a=n.x,s=t.y,u=e.y,h=n.y,f=i<o?i<a?i:a:o<a?o:a,l=s<u?s<h?s:h:u<h?u:h,c=i>o?i>a?i:a:o>a?o:a,d=s>u?s>h?s:h:u>h?u:h,p=n.next;p!==t;){if(p.x>=f&&p.x<=c&&p.y>=l&&p.y<=d&&Or(i,s,o,u,a,h,p.x,p.y)&&At(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function dd(r,t,e,n){var i=r.prev,o=r,a=r.next;if(At(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,h=a.x,f=i.y,l=o.y,c=a.y,d=s<u?s<h?s:h:u<h?u:h,p=f<l?f<c?f:c:l<c?l:c,v=s>u?s>h?s:h:u>h?u:h,_=f>l?f>c?f:c:l>c?l:c,g=yo(d,p,t,e,n),m=yo(v,_,t,e,n),y=r.prevZ,b=r.nextZ;y&&y.z>=g&&b&&b.z<=m;){if(y.x>=d&&y.x<=v&&y.y>=p&&y.y<=_&&y!==i&&y!==a&&Or(s,f,u,l,h,c,y.x,y.y)&&At(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=v&&b.y>=p&&b.y<=_&&b!==i&&b!==a&&Or(s,f,u,l,h,c,b.x,b.y)&&At(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=g;){if(y.x>=d&&y.x<=v&&y.y>=p&&y.y<=_&&y!==i&&y!==a&&Or(s,f,u,l,h,c,y.x,y.y)&&At(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=m;){if(b.x>=d&&b.x<=v&&b.y>=p&&b.y<=_&&b!==i&&b!==a&&Or(s,f,u,l,h,c,b.x,b.y)&&At(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function pd(r,t,e){var n=r;do{var i=n.prev,o=n.next.next;!qn(i,o)&&cu(i,n,n.next,o)&&ln(i,o)&&ln(o,i)&&(t.push(i.i/e|0),t.push(n.i/e|0),t.push(o.i/e|0),fn(n),fn(n.next),n=r=o),n=n.next}while(n!==r);return Je(n)}function vd(r,t,e,n,i,o){var a=r;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&wd(a,s)){var u=du(a,s);a=Je(a,a.next),u=Je(u,u.next),hn(a,t,e,n,i,o,0),hn(u,t,e,n,i,o,0);return}s=s.next}a=a.next}while(a!==r)}function _d(r,t,e,n){var i=[],o,a,s,u,h;for(o=0,a=t.length;o<a;o++)s=t[o]*n,u=o<a-1?t[o+1]*n:r.length,h=fu(r,s,u,n,!1),h===h.next&&(h.steiner=!0),i.push(Td(h));for(i.sort(gd),o=0;o<i.length;o++)e=md(i[o],e);return e}function gd(r,t){return r.x-t.x}function md(r,t){var e=yd(r,t);if(!e)return t;var n=du(e,r);return Je(n,n.next),Je(e,e.next)}function yd(r,t){var e=t,n=r.x,i=r.y,o=-1/0,a;do{if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){var s=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=n&&s>o&&(o=s,a=e.x<e.next.x?e:e.next,s===n))return a}e=e.next}while(e!==t);if(!a)return null;var u=a,h=a.x,f=a.y,l=1/0,c;e=a;do n>=e.x&&e.x>=h&&n!==e.x&&Or(i<f?n:o,i,h,f,i<f?o:n,i,e.x,e.y)&&(c=Math.abs(i-e.y)/(n-e.x),ln(e,r)&&(c<l||c===l&&(e.x>a.x||e.x===a.x&&bd(a,e)))&&(a=e,l=c)),e=e.next;while(e!==u);return a}function bd(r,t){return At(r.prev,r,t.prev)<0&&At(t.next,r,r.next)<0}function xd(r,t,e,n){var i=r;do i.z===0&&(i.z=yo(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,Ed(i)}function Ed(r){var t,e,n,i,o,a,s,u,h=1;do{for(e=r,r=null,o=null,a=0;e;){for(a++,n=e,s=0,t=0;t<h&&(s++,n=n.nextZ,!!n);t++);for(u=h;s>0||u>0&&n;)s!==0&&(u===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:r=i,i.prevZ=o,o=i;e=n}o.nextZ=null,h*=2}while(a>1);return r}function yo(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function Td(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Or(r,t,e,n,i,o,a,s){return(i-a)*(t-s)>=(r-a)*(o-s)&&(r-a)*(n-s)>=(e-a)*(t-s)&&(e-a)*(o-s)>=(i-a)*(n-s)}function wd(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!Sd(r,t)&&(ln(r,t)&&ln(t,r)&&Ad(r,t)&&(At(r.prev,r,t.prev)||At(r,t.prev,t))||qn(r,t)&&At(r.prev,r,r.next)>0&&At(t.prev,t,t.next)>0)}function At(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function qn(r,t){return r.x===t.x&&r.y===t.y}function cu(r,t,e,n){var i=Kn(At(r,t,e)),o=Kn(At(r,t,n)),a=Kn(At(e,n,r)),s=Kn(At(e,n,t));return!!(i!==o&&a!==s||i===0&&$n(r,e,t)||o===0&&$n(r,n,t)||a===0&&$n(e,r,n)||s===0&&$n(e,t,n))}function $n(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Kn(r){return r>0?1:r<0?-1:0}function Sd(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&cu(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function ln(r,t){return At(r.prev,r,r.next)<0?At(r,t,r.next)>=0&&At(r,r.prev,t)>=0:At(r,t,r.prev)<0||At(r,r.next,t)<0}function Ad(r,t){var e=r,n=!1,i=(r.x+t.x)/2,o=(r.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&i<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function du(r,t){var e=new bo(r.i,r.x,r.y),n=new bo(t.i,t.x,t.y),i=r.next,o=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,o.next=n,n.prev=o,n}function pu(r,t,e,n){var i=new bo(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function fn(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function bo(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Wn.deviation=function(r,t,e,n){var i=t&&t.length,o=i?t[0]*e:r.length,a=Math.abs(xo(r,0,o,e));if(i)for(var s=0,u=t.length;s<u;s++){var h=t[s]*e,f=s<u-1?t[s+1]*e:r.length;a-=Math.abs(xo(r,h,f,e))}var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*e,d=n[s+1]*e,p=n[s+2]*e;l+=Math.abs((r[c]-r[p])*(r[d+1]-r[c+1])-(r[c]-r[d])*(r[p+1]-r[c+1]))}return a===0&&l===0?0:Math.abs((l-a)/a)};function xo(r,t,e,n){for(var i=0,o=t,a=e-n;o<e;o+=n)i+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return i}Wn.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},n=0,i=0;i<r.length;i++){for(var o=0;o<r[i].length;o++)for(var a=0;a<t;a++)e.vertices.push(r[i][o][a]);i>0&&(n+=r[i-1].length,e.holes.push(n))}return e};var Pd=mo.exports;const vu=fo(Pd);var Zn={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Zn.exports,function(r,t){(function(e){var n=t&&!t.nodeType&&t,i=r&&!r.nodeType&&r,o=typeof Xn=="object"&&Xn;(o.global===o||o.window===o||o.self===o)&&(e=o);var a,s=2147483647,u=36,h=1,f=26,l=38,c=700,d=72,p=128,v="-",_=/^xn--/,g=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-h,x=Math.floor,A=String.fromCharCode,P;function T(L){throw new RangeError(y[L])}function w(L,F){for(var H=L.length,tt=[];H--;)tt[H]=F(L[H]);return tt}function E(L,F){var H=L.split("@"),tt="";H.length>1&&(tt=H[0]+"@",L=H[1]),L=L.replace(m,".");var rt=L.split("."),vt=w(rt,F).join(".");return tt+vt}function R(L){for(var F=[],H=0,tt=L.length,rt,vt;H<tt;)rt=L.charCodeAt(H++),rt>=55296&&rt<=56319&&H<tt?(vt=L.charCodeAt(H++),(vt&64512)==56320?F.push(((rt&1023)<<10)+(vt&1023)+65536):(F.push(rt),H--)):F.push(rt);return F}function O(L){return w(L,function(F){var H="";return F>65535&&(F-=65536,H+=A(F>>>10&1023|55296),F=56320|F&1023),H+=A(F),H}).join("")}function C(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:u}function k(L,F){return L+22+75*(L<26)-((F!=0)<<5)}function B(L,F,H){var tt=0;for(L=H?x(L/c):L>>1,L+=x(L/F);L>b*f>>1;tt+=u)L=x(L/b);return x(tt+(b+1)*L/(L+l))}function N(L){var F=[],H=L.length,tt,rt=0,vt=p,Y=d,ht,mt,Tt,W,it,at,ct,nt,D;for(ht=L.lastIndexOf(v),ht<0&&(ht=0),mt=0;mt<ht;++mt)L.charCodeAt(mt)>=128&&T("not-basic"),F.push(L.charCodeAt(mt));for(Tt=ht>0?ht+1:0;Tt<H;){for(W=rt,it=1,at=u;Tt>=H&&T("invalid-input"),ct=C(L.charCodeAt(Tt++)),(ct>=u||ct>x((s-rt)/it))&&T("overflow"),rt+=ct*it,nt=at<=Y?h:at>=Y+f?f:at-Y,!(ct<nt);at+=u)D=u-nt,it>x(s/D)&&T("overflow"),it*=D;tt=F.length+1,Y=B(rt-W,tt,W==0),x(rt/tt)>s-vt&&T("overflow"),vt+=x(rt/tt),rt%=tt,F.splice(rt++,0,vt)}return O(F)}function q(L){var F,H,tt,rt,vt,Y,ht,mt,Tt,W,it,at=[],ct,nt,D,I;for(L=R(L),ct=L.length,F=p,H=0,vt=d,Y=0;Y<ct;++Y)it=L[Y],it<128&&at.push(A(it));for(tt=rt=at.length,rt&&at.push(v);tt<ct;){for(ht=s,Y=0;Y<ct;++Y)it=L[Y],it>=F&&it<ht&&(ht=it);for(nt=tt+1,ht-F>x((s-H)/nt)&&T("overflow"),H+=(ht-F)*nt,F=ht,Y=0;Y<ct;++Y)if(it=L[Y],it<F&&++H>s&&T("overflow"),it==F){for(mt=H,Tt=u;W=Tt<=vt?h:Tt>=vt+f?f:Tt-vt,!(mt<W);Tt+=u)I=mt-W,D=u-W,at.push(A(k(W+I%D,0))),mt=x(I/D);at.push(A(k(mt,0))),vt=B(H,nt,tt==rt),H=0,++tt}++H,++F}return at.join("")}function K(L){return E(L,function(F){return _.test(F)?N(F.slice(4).toLowerCase()):F})}function Q(L){return E(L,function(F){return g.test(F)?"xn--"+q(F):F})}if(a={version:"1.4.1",ucs2:{decode:R,encode:O},decode:N,encode:q,toASCII:Q,toUnicode:K},n&&i)if(r.exports==n)i.exports=a;else for(P in a)a.hasOwnProperty(P)&&(n[P]=a[P]);else e.punycode=a})(Xn)}(Zn,Zn.exports);var Od=Zn.exports,Rd=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==i||a.enumerable!==!0)return!1}return!0},_u=typeof Symbol<"u"&&Symbol,Id=Rd,Cd=function(){return typeof _u!="function"||typeof Symbol!="function"||typeof _u("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Id()},gu={foo:{}},Md=Object,Dd=function(){return{__proto__:gu}.foo===gu.foo&&!({__proto__:null}instanceof Md)},Fd="Function.prototype.bind called on incompatible ",Bd=Object.prototype.toString,Nd=Math.max,Ld="[object Function]",mu=function(t,e){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var o=0;o<e.length;o+=1)n[o+t.length]=e[o];return n},Ud=function(t,e){for(var n=[],i=e||0,o=0;i<t.length;i+=1,o+=1)n[o]=t[i];return n},Gd=function(r,t){for(var e="",n=0;n<r.length;n+=1)e+=r[n],n+1<r.length&&(e+=t);return e},kd=function(t){var e=this;if(typeof e!="function"||Bd.apply(e)!==Ld)throw new TypeError(Fd+e);for(var n=Ud(arguments,1),i,o=function(){if(this instanceof i){var f=e.apply(this,mu(n,arguments));return Object(f)===f?f:this}return e.apply(t,mu(n,arguments))},a=Nd(0,e.length-n.length),s=[],u=0;u<a;u++)s[u]="$"+u;if(i=Function("binder","return function ("+Gd(s,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var h=function(){};h.prototype=e.prototype,i.prototype=new h,h.prototype=null}return i},Hd=kd,Eo=Function.prototype.bind||Hd,Xd=Function.prototype.call,jd=Object.prototype.hasOwnProperty,Yd=Eo,Vd=Yd.call(Xd,jd),ot,Rr=SyntaxError,yu=Function,Ir=TypeError,To=function(r){try{return yu('"use strict"; return ('+r+").constructor;")()}catch{}},Qe=Object.getOwnPropertyDescriptor;if(Qe)try{Qe({},"")}catch{Qe=null}var wo=function(){throw new Ir},zd=Qe?function(){try{return arguments.callee,wo}catch{try{return Qe(arguments,"callee").get}catch{return wo}}}():wo,Cr=Cd(),Wd=Dd(),Ft=Object.getPrototypeOf||(Wd?function(r){return r.__proto__}:null),Mr={},qd=typeof Uint8Array>"u"||!Ft?ot:Ft(Uint8Array),tr={"%AggregateError%":typeof AggregateError>"u"?ot:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ot:ArrayBuffer,"%ArrayIteratorPrototype%":Cr&&Ft?Ft([][Symbol.iterator]()):ot,"%AsyncFromSyncIteratorPrototype%":ot,"%AsyncFunction%":Mr,"%AsyncGenerator%":Mr,"%AsyncGeneratorFunction%":Mr,"%AsyncIteratorPrototype%":Mr,"%Atomics%":typeof Atomics>"u"?ot:Atomics,"%BigInt%":typeof BigInt>"u"?ot:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ot:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ot:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ot:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ot:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ot:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ot:FinalizationRegistry,"%Function%":yu,"%GeneratorFunction%":Mr,"%Int8Array%":typeof Int8Array>"u"?ot:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ot:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ot:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Cr&&Ft?Ft(Ft([][Symbol.iterator]())):ot,"%JSON%":typeof JSON=="object"?JSON:ot,"%Map%":typeof Map>"u"?ot:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Cr||!Ft?ot:Ft(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ot:Promise,"%Proxy%":typeof Proxy>"u"?ot:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ot:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ot:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Cr||!Ft?ot:Ft(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ot:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Cr&&Ft?Ft(""[Symbol.iterator]()):ot,"%Symbol%":Cr?Symbol:ot,"%SyntaxError%":Rr,"%ThrowTypeError%":zd,"%TypedArray%":qd,"%TypeError%":Ir,"%Uint8Array%":typeof Uint8Array>"u"?ot:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ot:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ot:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ot:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ot:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ot:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ot:WeakSet};if(Ft)try{null.error}catch(r){var $d=Ft(Ft(r));tr["%Error.prototype%"]=$d}var Kd=function r(t){var e;if(t==="%AsyncFunction%")e=To("async function () {}");else if(t==="%GeneratorFunction%")e=To("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=To("async function* () {}");else if(t==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&Ft&&(e=Ft(i.prototype))}return tr[t]=e,e},bu={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},cn=Eo,Jn=Vd,Zd=cn.call(Function.call,Array.prototype.concat),Jd=cn.call(Function.apply,Array.prototype.splice),xu=cn.call(Function.call,String.prototype.replace),Qn=cn.call(Function.call,String.prototype.slice),Qd=cn.call(Function.call,RegExp.prototype.exec),tp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ep=/\\(\\)?/g,rp=function(t){var e=Qn(t,0,1),n=Qn(t,-1);if(e==="%"&&n!=="%")throw new Rr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Rr("invalid intrinsic syntax, expected opening `%`");var i=[];return xu(t,tp,function(o,a,s,u){i[i.length]=s?xu(u,ep,"$1"):a||o}),i},np=function(t,e){var n=t,i;if(Jn(bu,n)&&(i=bu[n],n="%"+i[0]+"%"),Jn(tr,n)){var o=tr[n];if(o===Mr&&(o=Kd(n)),typeof o>"u"&&!e)throw new Ir("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Rr("intrinsic "+t+" does not exist!")},er=function(t,e){if(typeof t!="string"||t.length===0)throw new Ir("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ir('"allowMissing" argument must be a boolean');if(Qd(/^%?[^%]*%?$/,t)===null)throw new Rr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=rp(t),i=n.length>0?n[0]:"",o=np("%"+i+"%",e),a=o.name,s=o.value,u=!1,h=o.alias;h&&(i=h[0],Jd(n,Zd([0,1],h)));for(var f=1,l=!0;f<n.length;f+=1){var c=n[f],d=Qn(c,0,1),p=Qn(c,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new Rr("property names with quotes must have matching quotes");if((c==="constructor"||!l)&&(u=!0),i+="."+c,a="%"+i+"%",Jn(tr,a))s=tr[a];else if(s!=null){if(!(c in s)){if(!e)throw new Ir("base intrinsic for "+t+" exists, but the property is not available.");return}if(Qe&&f+1>=n.length){var v=Qe(s,c);l=!!v,l&&"get"in v&&!("originalValue"in v.get)?s=v.get:s=s[c]}else l=Jn(s,c),s=s[c];l&&!u&&(tr[a]=s)}}return s},Eu={exports:{}},ip=er,So=ip("%Object.defineProperty%",!0),Ao=function(){if(So)try{return So({},"a",{value:1}),!0}catch{return!1}return!1};Ao.hasArrayLengthDefineBug=function(){if(!Ao())return null;try{return So([],"length",{value:1}).length!==1}catch{return!0}};var Tu=Ao,op=er,ti=op("%Object.getOwnPropertyDescriptor%",!0);if(ti)try{ti([],"length")}catch{ti=null}var wu=ti,ap=Tu(),Po=er,dn=ap&&Po("%Object.defineProperty%",!0);if(dn)try{dn({},"a",{value:1})}catch{dn=!1}var sp=Po("%SyntaxError%"),Dr=Po("%TypeError%"),Su=wu,up=function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Dr("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Dr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Dr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Dr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Dr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Dr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,u=!!Su&&Su(t,e);if(dn)dn(t,e,{configurable:a===null&&u?u.configurable:!a,enumerable:i===null&&u?u.enumerable:!i,value:n,writable:o===null&&u?u.writable:!o});else if(s||!i&&!o&&!a)t[e]=n;else throw new sp("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Au=er,Pu=up,hp=Tu(),Ou=wu,Ru=Au("%TypeError%"),lp=Au("%Math.floor%"),fp=function(t,e){if(typeof t!="function")throw new Ru("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||lp(e)!==e)throw new Ru("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in t&&Ou){var a=Ou(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!n)&&(hp?Pu(t,"length",e,!0,!0):Pu(t,"length",e)),t};(function(r){var t=Eo,e=er,n=fp,i=e("%TypeError%"),o=e("%Function.prototype.apply%"),a=e("%Function.prototype.call%"),s=e("%Reflect.apply%",!0)||t.call(a,o),u=e("%Object.defineProperty%",!0),h=e("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}r.exports=function(c){if(typeof c!="function")throw new i("a function is required");var d=s(t,a,arguments);return n(d,1+h(0,c.length-(arguments.length-1)),!0)};var f=function(){return s(t,o,arguments)};u?u(r.exports,"apply",{value:f}):r.exports.apply=f})(Eu);var cp=Eu.exports,Iu=er,Cu=cp,dp=Cu(Iu("String.prototype.indexOf")),pp=function(t,e){var n=Iu(t,!!e);return typeof n=="function"&&dp(t,".prototype.")>-1?Cu(n):n};const vp=Zc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Oo=typeof Map=="function"&&Map.prototype,Ro=Object.getOwnPropertyDescriptor&&Oo?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ei=Oo&&Ro&&typeof Ro.get=="function"?Ro.get:null,Mu=Oo&&Map.prototype.forEach,Io=typeof Set=="function"&&Set.prototype,Co=Object.getOwnPropertyDescriptor&&Io?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ri=Io&&Co&&typeof Co.get=="function"?Co.get:null,Du=Io&&Set.prototype.forEach,_p=typeof WeakMap=="function"&&WeakMap.prototype,pn=_p?WeakMap.prototype.has:null,gp=typeof WeakSet=="function"&&WeakSet.prototype,vn=gp?WeakSet.prototype.has:null,mp=typeof WeakRef=="function"&&WeakRef.prototype,Fu=mp?WeakRef.prototype.deref:null,yp=Boolean.prototype.valueOf,bp=Object.prototype.toString,xp=Function.prototype.toString,Ep=String.prototype.match,Mo=String.prototype.slice,Ge=String.prototype.replace,Tp=String.prototype.toUpperCase,Bu=String.prototype.toLowerCase,Nu=RegExp.prototype.test,Lu=Array.prototype.concat,be=Array.prototype.join,wp=Array.prototype.slice,Uu=Math.floor,Do=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Fo=Object.getOwnPropertySymbols,Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Fr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",jt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Fr||"symbol")?Symbol.toStringTag:null,Gu=Object.prototype.propertyIsEnumerable,ku=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Hu(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Nu.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Uu(-r):Uu(r);if(n!==r){var i=String(n),o=Mo.call(t,i.length+1);return Ge.call(i,e,"$&_")+"."+Ge.call(Ge.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ge.call(t,e,"$&_")}var No=vp,Xu=No.custom,ju=zu(Xu)?Xu:null,Sp=function r(t,e,n,i){var o=e||{};if(ke(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ke(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=ke(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ke(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ke(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return qu(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var u=String(t);return s?Hu(t,u):u}if(typeof t=="bigint"){var h=String(t)+"n";return s?Hu(t,h):h}var f=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof t=="object")return Lo(t)?"[Array]":"[Object]";var l=jp(o,n);if(typeof i>"u")i=[];else if(Wu(i,t)>=0)return"[Circular]";function c(C,k,B){if(k&&(i=wp.call(i),i.push(k)),B){var N={depth:o.depth};return ke(o,"quoteStyle")&&(N.quoteStyle=o.quoteStyle),r(C,N,n+1,i)}return r(C,o,n+1,i)}if(typeof t=="function"&&!Vu(t)){var d=Fp(t),p=ni(t,c);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+be.call(p,", ")+" }":"")}if(zu(t)){var v=Fr?Ge.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Bo.call(t);return typeof t=="object"&&!Fr?_n(v):v}if(kp(t)){for(var _="<"+Bu.call(String(t.nodeName)),g=t.attributes||[],m=0;m<g.length;m++)_+=" "+g[m].name+"="+Yu(Ap(g[m].value),"double",o);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+Bu.call(String(t.nodeName))+">",_}if(Lo(t)){if(t.length===0)return"[]";var y=ni(t,c);return l&&!Xp(y)?"["+Go(y,l)+"]":"[ "+be.call(y,", ")+" ]"}if(Op(t)){var b=ni(t,c);return!("cause"in Error.prototype)&&"cause"in t&&!Gu.call(t,"cause")?"{ ["+String(t)+"] "+be.call(Lu.call("[cause]: "+c(t.cause),b),", ")+" }":b.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+be.call(b,", ")+" }"}if(typeof t=="object"&&a){if(ju&&typeof t[ju]=="function"&&No)return No(t,{depth:f-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Bp(t)){var x=[];return Mu&&Mu.call(t,function(C,k){x.push(c(k,t,!0)+" => "+c(C,t))}),$u("Map",ei.call(t),x,l)}if(Up(t)){var A=[];return Du&&Du.call(t,function(C){A.push(c(C,t))}),$u("Set",ri.call(t),A,l)}if(Np(t))return Uo("WeakMap");if(Gp(t))return Uo("WeakSet");if(Lp(t))return Uo("WeakRef");if(Ip(t))return _n(c(Number(t)));if(Mp(t))return _n(c(Do.call(t)));if(Cp(t))return _n(yp.call(t));if(Rp(t))return _n(c(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===Xn)return"{ [object globalThis] }";if(!Pp(t)&&!Vu(t)){var P=ni(t,c),T=ku?ku(t)===Object.prototype:t instanceof Object||t.constructor===Object,w=t instanceof Object?"":"null prototype",E=!T&&jt&&Object(t)===t&&jt in t?Mo.call(He(t),8,-1):w?"Object":"",R=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",O=R+(E||w?"["+be.call(Lu.call([],E||[],w||[]),": ")+"] ":"");return P.length===0?O+"{}":l?O+"{"+Go(P,l)+"}":O+"{ "+be.call(P,", ")+" }"}return String(t)};function Yu(r,t,e){var n=(e.quoteStyle||t)==="double"?'"':"'";return n+r+n}function Ap(r){return Ge.call(String(r),/"/g,"&quot;")}function Lo(r){return He(r)==="[object Array]"&&(!jt||!(typeof r=="object"&&jt in r))}function Pp(r){return He(r)==="[object Date]"&&(!jt||!(typeof r=="object"&&jt in r))}function Vu(r){return He(r)==="[object RegExp]"&&(!jt||!(typeof r=="object"&&jt in r))}function Op(r){return He(r)==="[object Error]"&&(!jt||!(typeof r=="object"&&jt in r))}function Rp(r){return He(r)==="[object String]"&&(!jt||!(typeof r=="object"&&jt in r))}function Ip(r){return He(r)==="[object Number]"&&(!jt||!(typeof r=="object"&&jt in r))}function Cp(r){return He(r)==="[object Boolean]"&&(!jt||!(typeof r=="object"&&jt in r))}function zu(r){if(Fr)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Bo)return!1;try{return Bo.call(r),!0}catch{}return!1}function Mp(r){if(!r||typeof r!="object"||!Do)return!1;try{return Do.call(r),!0}catch{}return!1}var Dp=Object.prototype.hasOwnProperty||function(r){return r in this};function ke(r,t){return Dp.call(r,t)}function He(r){return bp.call(r)}function Fp(r){if(r.name)return r.name;var t=Ep.call(xp.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function Wu(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1}function Bp(r){if(!ei||!r||typeof r!="object")return!1;try{ei.call(r);try{ri.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Np(r){if(!pn||!r||typeof r!="object")return!1;try{pn.call(r,pn);try{vn.call(r,vn)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Lp(r){if(!Fu||!r||typeof r!="object")return!1;try{return Fu.call(r),!0}catch{}return!1}function Up(r){if(!ri||!r||typeof r!="object")return!1;try{ri.call(r);try{ei.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Gp(r){if(!vn||!r||typeof r!="object")return!1;try{vn.call(r,vn);try{pn.call(r,pn)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function kp(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function qu(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return qu(Mo.call(r,0,t.maxStringLength),t)+n}var i=Ge.call(Ge.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Hp);return Yu(i,"single",t)}function Hp(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Tp.call(t.toString(16))}function _n(r){return"Object("+r+")"}function Uo(r){return r+" { ? }"}function $u(r,t,e,n){var i=n?Go(e,n):be.call(e,", ");return r+" ("+t+") {"+i+"}"}function Xp(r){for(var t=0;t<r.length;t++)if(Wu(r[t],`
24
+ `)>=0)return!1;return!0}function jp(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=be.call(Array(r.indent+1)," ");else return null;return{base:e,prev:be.call(Array(t+1),e)}}function Go(r,t){if(r.length===0)return"";var e=`
25
+ `+t.prev+t.base;return e+be.call(r,","+e)+`
26
+ `+t.prev}function ni(r,t){var e=Lo(r),n=[];if(e){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ke(r,i)?t(r[i],r):""}var o=typeof Fo=="function"?Fo(r):[],a;if(Fr){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s]}for(var u in r)ke(r,u)&&(e&&String(Number(u))===u&&u<r.length||Fr&&a["$"+u]instanceof Symbol||(Nu.call(/[^\w$]/,u)?n.push(t(u,r)+": "+t(r[u],r)):n.push(u+": "+t(r[u],r))));if(typeof Fo=="function")for(var h=0;h<o.length;h++)Gu.call(r,o[h])&&n.push("["+t(o[h])+"]: "+t(r[o[h]],r));return n}var ko=er,Br=pp,Yp=Sp,Vp=ko("%TypeError%"),ii=ko("%WeakMap%",!0),oi=ko("%Map%",!0),zp=Br("WeakMap.prototype.get",!0),Wp=Br("WeakMap.prototype.set",!0),qp=Br("WeakMap.prototype.has",!0),$p=Br("Map.prototype.get",!0),Kp=Br("Map.prototype.set",!0),Zp=Br("Map.prototype.has",!0),Ho=function(r,t){for(var e=r,n;(n=e.next)!==null;e=n)if(n.key===t)return e.next=n.next,n.next=r.next,r.next=n,n},Jp=function(r,t){var e=Ho(r,t);return e&&e.value},Qp=function(r,t,e){var n=Ho(r,t);n?n.value=e:r.next={key:t,next:r.next,value:e}},tv=function(r,t){return!!Ho(r,t)},ev=function(){var t,e,n,i={assert:function(o){if(!i.has(o))throw new Vp("Side channel does not contain "+Yp(o))},get:function(o){if(ii&&o&&(typeof o=="object"||typeof o=="function")){if(t)return zp(t,o)}else if(oi){if(e)return $p(e,o)}else if(n)return Jp(n,o)},has:function(o){if(ii&&o&&(typeof o=="object"||typeof o=="function")){if(t)return qp(t,o)}else if(oi){if(e)return Zp(e,o)}else if(n)return tv(n,o);return!1},set:function(o,a){ii&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new ii),Wp(t,o,a)):oi?(e||(e=new oi),Kp(e,o,a)):(n||(n={key:{},next:null}),Qp(n,o,a))}};return i},rv=String.prototype.replace,nv=/%20/g,Xo={RFC1738:"RFC1738",RFC3986:"RFC3986"},jo={default:Xo.RFC3986,formatters:{RFC1738:function(r){return rv.call(r,nv,"+")},RFC3986:function(r){return String(r)}},RFC1738:Xo.RFC1738,RFC3986:Xo.RFC3986},iv=jo,Yo=Object.prototype.hasOwnProperty,rr=Array.isArray,xe=function(){for(var r=[],t=0;t<256;++t)r.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return r}(),ov=function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(rr(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);e.obj[e.prop]=i}}},Ku=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},av=function r(t,e,n){if(!e)return t;if(typeof e!="object"){if(rr(t))t.push(e);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Yo.call(Object.prototype,e))&&(t[e]=!0);else return[t,e];return t}if(!t||typeof t!="object")return[t].concat(e);var i=t;return rr(t)&&!rr(e)&&(i=Ku(t,n)),rr(t)&&rr(e)?(e.forEach(function(o,a){if(Yo.call(t,a)){var s=t[a];s&&typeof s=="object"&&o&&typeof o=="object"?t[a]=r(s,o,n):t.push(o)}else t[a]=o}),t):Object.keys(e).reduce(function(o,a){var s=e[a];return Yo.call(o,a)?o[a]=r(o[a],s,n):o[a]=s,o},i)},sv=function(t,e){return Object.keys(e).reduce(function(n,i){return n[i]=e[i],n},t)},uv=function(r,t,e){var n=r.replace(/\+/g," ");if(e==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},hv=function(t,e,n,i,o){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var s="",u=0;u<a.length;++u){var h=a.charCodeAt(u);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===iv.RFC1738&&(h===40||h===41)){s+=a.charAt(u);continue}if(h<128){s=s+xe[h];continue}if(h<2048){s=s+(xe[192|h>>6]+xe[128|h&63]);continue}if(h<55296||h>=57344){s=s+(xe[224|h>>12]+xe[128|h>>6&63]+xe[128|h&63]);continue}u+=1,h=65536+((h&1023)<<10|a.charCodeAt(u)&1023),s+=xe[240|h>>18]+xe[128|h>>12&63]+xe[128|h>>6&63]+xe[128|h&63]}return s},lv=function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],i=0;i<e.length;++i)for(var o=e[i],a=o.obj[o.prop],s=Object.keys(a),u=0;u<s.length;++u){var h=s[u],f=a[h];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(e.push({obj:a,prop:h}),n.push(f))}return ov(e),t},fv=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},cv=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},dv=function(t,e){return[].concat(t,e)},pv=function(t,e){if(rr(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(e(t[i]));return n}return e(t)},Zu={arrayToObject:Ku,assign:sv,combine:dv,compact:lv,decode:uv,encode:hv,isBuffer:cv,isRegExp:fv,maybeMap:pv,merge:av},Ju=ev,ai=Zu,gn=jo,vv=Object.prototype.hasOwnProperty,Qu={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},Pe=Array.isArray,_v=Array.prototype.push,th=function(r,t){_v.apply(r,Pe(t)?t:[t])},gv=Date.prototype.toISOString,eh=gn.default,Yt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ai.encode,encodeValuesOnly:!1,format:eh,formatter:gn.formatters[eh],indices:!1,serializeDate:function(t){return gv.call(t)},skipNulls:!1,strictNullHandling:!1},mv=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Vo={},yv=function r(t,e,n,i,o,a,s,u,h,f,l,c,d,p,v,_){for(var g=t,m=_,y=0,b=!1;(m=m.get(Vo))!==void 0&&!b;){var x=m.get(t);if(y+=1,typeof x<"u"){if(x===y)throw new RangeError("Cyclic object value");b=!0}typeof m.get(Vo)>"u"&&(y=0)}if(typeof u=="function"?g=u(e,g):g instanceof Date?g=l(g):n==="comma"&&Pe(g)&&(g=ai.maybeMap(g,function(N){return N instanceof Date?l(N):N})),g===null){if(o)return s&&!p?s(e,Yt.encoder,v,"key",c):e;g=""}if(mv(g)||ai.isBuffer(g)){if(s){var A=p?e:s(e,Yt.encoder,v,"key",c);return[d(A)+"="+d(s(g,Yt.encoder,v,"value",c))]}return[d(e)+"="+d(String(g))]}var P=[];if(typeof g>"u")return P;var T;if(n==="comma"&&Pe(g))p&&s&&(g=ai.maybeMap(g,s)),T=[{value:g.length>0?g.join(",")||null:void 0}];else if(Pe(u))T=u;else{var w=Object.keys(g);T=h?w.sort(h):w}for(var E=i&&Pe(g)&&g.length===1?e+"[]":e,R=0;R<T.length;++R){var O=T[R],C=typeof O=="object"&&typeof O.value<"u"?O.value:g[O];if(!(a&&C===null)){var k=Pe(g)?typeof n=="function"?n(E,O):E:E+(f?"."+O:"["+O+"]");_.set(t,y);var B=Ju();B.set(Vo,_),th(P,r(C,k,n,i,o,a,n==="comma"&&p&&Pe(g)?null:s,u,h,f,l,c,d,p,v,B))}}return P},bv=function(t){if(!t)return Yt;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var e=t.charset||Yt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=gn.default;if(typeof t.format<"u"){if(!vv.call(gn.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=gn.formatters[n],o=Yt.filter;return(typeof t.filter=="function"||Pe(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Yt.addQueryPrefix,allowDots:typeof t.allowDots>"u"?Yt.allowDots:!!t.allowDots,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Yt.charsetSentinel,delimiter:typeof t.delimiter>"u"?Yt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Yt.encode,encoder:typeof t.encoder=="function"?t.encoder:Yt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Yt.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Yt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Yt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Yt.strictNullHandling}},xv=function(r,t){var e=r,n=bv(t),i,o;typeof n.filter=="function"?(o=n.filter,e=o("",e)):Pe(n.filter)&&(o=n.filter,i=o);var a=[];if(typeof e!="object"||e===null)return"";var s;t&&t.arrayFormat in Qu?s=t.arrayFormat:t&&"indices"in t?s=t.indices?"indices":"repeat":s="indices";var u=Qu[s];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=u==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(e)),n.sort&&i.sort(n.sort);for(var f=Ju(),l=0;l<i.length;++l){var c=i[l];n.skipNulls&&e[c]===null||th(a,yv(e[c],c,u,h,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,f))}var d=a.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},Nr=Zu,zo=Object.prototype.hasOwnProperty,Ev=Array.isArray,Bt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Nr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Tv=function(r){return r.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},rh=function(r,t){return r&&typeof r=="string"&&t.comma&&r.indexOf(",")>-1?r.split(","):r},wv="utf8=%26%2310003%3B",Sv="utf8=%E2%9C%93",Av=function(t,e){var n={__proto__:null},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,a=i.split(e.delimiter,o),s=-1,u,h=e.charset;if(e.charsetSentinel)for(u=0;u<a.length;++u)a[u].indexOf("utf8=")===0&&(a[u]===Sv?h="utf-8":a[u]===wv&&(h="iso-8859-1"),s=u,u=a.length);for(u=0;u<a.length;++u)if(u!==s){var f=a[u],l=f.indexOf("]="),c=l===-1?f.indexOf("="):l+1,d,p;c===-1?(d=e.decoder(f,Bt.decoder,h,"key"),p=e.strictNullHandling?null:""):(d=e.decoder(f.slice(0,c),Bt.decoder,h,"key"),p=Nr.maybeMap(rh(f.slice(c+1),e),function(v){return e.decoder(v,Bt.decoder,h,"value")})),p&&e.interpretNumericEntities&&h==="iso-8859-1"&&(p=Tv(p)),f.indexOf("[]=")>-1&&(p=Ev(p)?[p]:p),zo.call(n,d)?n[d]=Nr.combine(n[d],p):n[d]=p}return n},Pv=function(r,t,e,n){for(var i=n?t:rh(t,e),o=r.length-1;o>=0;--o){var a,s=r[o];if(s==="[]"&&e.parseArrays)a=[].concat(i);else{a=e.plainObjects?Object.create(null):{};var u=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,h=parseInt(u,10);!e.parseArrays&&u===""?a={0:i}:!isNaN(h)&&s!==u&&String(h)===u&&h>=0&&e.parseArrays&&h<=e.arrayLimit?(a=[],a[h]=i):u!=="__proto__"&&(a[u]=i)}i=a}return i},Ov=function(t,e,n,i){if(t){var o=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,u=n.depth>0&&a.exec(o),h=u?o.slice(0,u.index):o,f=[];if(h){if(!n.plainObjects&&zo.call(Object.prototype,h)&&!n.allowPrototypes)return;f.push(h)}for(var l=0;n.depth>0&&(u=s.exec(o))!==null&&l<n.depth;){if(l+=1,!n.plainObjects&&zo.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;f.push(u[1])}return u&&f.push("["+o.slice(u.index)+"]"),Pv(f,e,n,i)}},Rv=function(t){if(!t)return Bt;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=typeof t.charset>"u"?Bt.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Bt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Bt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Bt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Bt.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Bt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Bt.comma,decoder:typeof t.decoder=="function"?t.decoder:Bt.decoder,delimiter:typeof t.delimiter=="string"||Nr.isRegExp(t.delimiter)?t.delimiter:Bt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Bt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Bt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Bt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Bt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Bt.strictNullHandling}},Iv=function(r,t){var e=Rv(t);if(r===""||r===null||typeof r>"u")return e.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Av(r,e):r,i=e.plainObjects?Object.create(null):{},o=Object.keys(n),a=0;a<o.length;++a){var s=o[a],u=Ov(s,n[s],e,typeof r=="string");i=Nr.merge(i,u,e)}return e.allowSparse===!0?i:Nr.compact(i)},Cv=xv,Mv=Iv,Dv=jo,Fv={formats:Dv,parse:Mv,stringify:Cv},Bv=Od;function he(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Nv=/^([a-z0-9.+-]+:)/i,Lv=/:[0-9]*$/,Uv=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Gv=["<",">",'"',"`"," ","\r",`
27
+ `," "],kv=["{","}","|","\\","^","`"].concat(Gv),Wo=["'"].concat(kv),nh=["%","/","?",";","#"].concat(Wo),ih=["/","?","#"],Hv=255,oh=/^[+a-z0-9A-Z_-]{0,63}$/,Xv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jv={javascript:!0,"javascript:":!0},qo={javascript:!0,"javascript:":!0},Lr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},$o=Fv;function si(r,t,e){if(r&&typeof r=="object"&&r instanceof he)return r;var n=new he;return n.parse(r,t,e),n}he.prototype.parse=function(r,t,e){if(typeof r!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var n=r.indexOf("?"),i=n!==-1&&n<r.indexOf("#")?"?":"#",o=r.split(i),a=/\\/g;o[0]=o[0].replace(a,"/"),r=o.join(i);var s=r;if(s=s.trim(),!e&&r.split("#").length===1){var u=Uv.exec(s);if(u)return this.path=s,this.href=s,this.pathname=u[1],u[2]?(this.search=u[2],t?this.query=$o.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=Nv.exec(s);if(h){h=h[0];var f=h.toLowerCase();this.protocol=f,s=s.substr(h.length)}if(e||h||s.match(/^\/\/[^@/]+@[^@/]+/)){var l=s.substr(0,2)==="//";l&&!(h&&qo[h])&&(s=s.substr(2),this.slashes=!0)}if(!qo[h]&&(l||h&&!Lr[h])){for(var c=-1,d=0;d<ih.length;d++){var p=s.indexOf(ih[d]);p!==-1&&(c===-1||p<c)&&(c=p)}var v,_;c===-1?_=s.lastIndexOf("@"):_=s.lastIndexOf("@",c),_!==-1&&(v=s.slice(0,_),s=s.slice(_+1),this.auth=decodeURIComponent(v)),c=-1;for(var d=0;d<nh.length;d++){var p=s.indexOf(nh[d]);p!==-1&&(c===-1||p<c)&&(c=p)}c===-1&&(c=s.length),this.host=s.slice(0,c),s=s.slice(c),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var m=this.hostname.split(/\./),d=0,y=m.length;d<y;d++){var b=m[d];if(b&&!b.match(oh)){for(var x="",A=0,P=b.length;A<P;A++)b.charCodeAt(A)>127?x+="x":x+=b[A];if(!x.match(oh)){var T=m.slice(0,d),w=m.slice(d+1),E=b.match(Xv);E&&(T.push(E[1]),w.unshift(E[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=T.join(".");break}}}this.hostname.length>Hv?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Bv.toASCII(this.hostname));var R=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+R,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!jv[f])for(var d=0,y=Wo.length;d<y;d++){var C=Wo[d];if(s.indexOf(C)!==-1){var k=encodeURIComponent(C);k===C&&(k=escape(C)),s=s.split(C).join(k)}}var B=s.indexOf("#");B!==-1&&(this.hash=s.substr(B),s=s.slice(0,B));var N=s.indexOf("?");if(N!==-1?(this.search=s.substr(N),this.query=s.substr(N+1),t&&(this.query=$o.parse(this.query)),s=s.slice(0,N)):t&&(this.search="",this.query={}),s&&(this.pathname=s),Lr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var R=this.pathname||"",q=this.search||"";this.path=R+q}return this.href=this.format(),this};function Yv(r){return typeof r=="string"&&(r=si(r)),r instanceof he?r.format():he.prototype.format.call(r)}he.prototype.format=function(){var r=this.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var t=this.protocol||"",e=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=r+this.host:this.hostname&&(i=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=$o.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||o&&"?"+o||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Lr[t])&&i!==!1?(i="//"+(i||""),e&&e.charAt(0)!=="/"&&(e="/"+e)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),a&&a.charAt(0)!=="?"&&(a="?"+a),e=e.replace(/[?#]/g,function(s){return encodeURIComponent(s)}),a=a.replace("#","%23"),t+i+e+a+n};function Vv(r,t){return si(r,!1,!0).resolve(t)}he.prototype.resolve=function(r){return this.resolveObject(si(r,!1,!0)).format()},he.prototype.resolveObject=function(r){if(typeof r=="string"){var t=new he;t.parse(r,!1,!0),r=t}for(var e=new he,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];e[o]=this[o]}if(e.hash=r.hash,r.href==="")return e.href=e.format(),e;if(r.slashes&&!r.protocol){for(var a=Object.keys(r),s=0;s<a.length;s++){var u=a[s];u!=="protocol"&&(e[u]=r[u])}return Lr[e.protocol]&&e.hostname&&!e.pathname&&(e.pathname="/",e.path=e.pathname),e.href=e.format(),e}if(r.protocol&&r.protocol!==e.protocol){if(!Lr[r.protocol]){for(var h=Object.keys(r),f=0;f<h.length;f++){var l=h[f];e[l]=r[l]}return e.href=e.format(),e}if(e.protocol=r.protocol,!r.host&&!qo[r.protocol]){for(var y=(r.pathname||"").split("/");y.length&&!(r.host=y.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),e.pathname=y.join("/")}else e.pathname=r.pathname;if(e.search=r.search,e.query=r.query,e.host=r.host||"",e.auth=r.auth,e.hostname=r.hostname||r.host,e.port=r.port,e.pathname||e.search){var c=e.pathname||"",d=e.search||"";e.path=c+d}return e.slashes=e.slashes||r.slashes,e.href=e.format(),e}var p=e.pathname&&e.pathname.charAt(0)==="/",v=r.host||r.pathname&&r.pathname.charAt(0)==="/",_=v||p||e.host&&r.pathname,g=_,m=e.pathname&&e.pathname.split("/")||[],y=r.pathname&&r.pathname.split("/")||[],b=e.protocol&&!Lr[e.protocol];if(b&&(e.hostname="",e.port=null,e.host&&(m[0]===""?m[0]=e.host:m.unshift(e.host)),e.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host=null),_=_&&(y[0]===""||m[0]==="")),v)e.host=r.host||r.host===""?r.host:e.host,e.hostname=r.hostname||r.hostname===""?r.hostname:e.hostname,e.search=r.search,e.query=r.query,m=y;else if(y.length)m||(m=[]),m.pop(),m=m.concat(y),e.search=r.search,e.query=r.query;else if(r.search!=null){if(b){e.host=m.shift(),e.hostname=e.host;var x=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;x&&(e.auth=x.shift(),e.hostname=x.shift(),e.host=e.hostname)}return e.search=r.search,e.query=r.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!m.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var A=m.slice(-1)[0],P=(e.host||r.host||m.length>1)&&(A==="."||A==="..")||A==="",T=0,w=m.length;w>=0;w--)A=m[w],A==="."?m.splice(w,1):A===".."?(m.splice(w,1),T++):T&&(m.splice(w,1),T--);if(!_&&!g)for(;T--;T)m.unshift("..");_&&m[0]!==""&&(!m[0]||m[0].charAt(0)!=="/")&&m.unshift(""),P&&m.join("/").substr(-1)!=="/"&&m.push("");var E=m[0]===""||m[0]&&m[0].charAt(0)==="/";if(b){e.hostname=E?"":m.length?m.shift():"",e.host=e.hostname;var x=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;x&&(e.auth=x.shift(),e.hostname=x.shift(),e.host=e.hostname)}return _=_||e.host&&m.length,_&&!E&&m.unshift(""),m.length>0?e.pathname=m.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=r.auth||e.auth,e.slashes=e.slashes||r.slashes,e.href=e.format(),e},he.prototype.parseHost=function(){var r=this.host,t=Lv.exec(r);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),r=r.substr(0,r.length-t.length)),r&&(this.hostname=r)};var zv=si,Wv=Vv,qv=Yv;/*!
28
+ * @pixi/utils - v6.5.10
29
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
30
+ *
31
+ * @pixi/utils is licensed under the MIT License.
32
+ * http://www.opensource.org/licenses/mit-license
33
+ */var Ur={parse:zv,format:qv,resolve:Wv};G.RETINA_PREFIX=/@([0-9\.]+)x/,G.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var ah=!1,sh="6.5.10";function $v(r){var t;if(!ah){if(G.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[`
34
+ %c %c %c PixiJS `+sh+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥
35
+
36
+ `,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,e)}else globalThis.console&&globalThis.console.log("PixiJS "+sh+" - "+r+" - http://www.pixijs.com/");ah=!0}}var Ko;function Kv(){return typeof Ko>"u"&&(Ko=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:G.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!G.ADAPTER.getWebGLRenderingContext())return!1;var e=G.ADAPTER.createCanvas(),n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!!(n&&n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch{return!1}}()),Ko}var Zv="#f0f8ff",Jv="#faebd7",Qv="#00ffff",t_="#7fffd4",e_="#f0ffff",r_="#f5f5dc",n_="#ffe4c4",i_="#000000",o_="#ffebcd",a_="#0000ff",s_="#8a2be2",u_="#a52a2a",h_="#deb887",l_="#5f9ea0",f_="#7fff00",c_="#d2691e",d_="#ff7f50",p_="#6495ed",v_="#fff8dc",__="#dc143c",g_="#00ffff",m_="#00008b",y_="#008b8b",b_="#b8860b",x_="#a9a9a9",E_="#006400",T_="#a9a9a9",w_="#bdb76b",S_="#8b008b",A_="#556b2f",P_="#ff8c00",O_="#9932cc",R_="#8b0000",I_="#e9967a",C_="#8fbc8f",M_="#483d8b",D_="#2f4f4f",F_="#2f4f4f",B_="#00ced1",N_="#9400d3",L_="#ff1493",U_="#00bfff",G_="#696969",k_="#696969",H_="#1e90ff",X_="#b22222",j_="#fffaf0",Y_="#228b22",V_="#ff00ff",z_="#dcdcdc",W_="#f8f8ff",q_="#daa520",$_="#ffd700",K_="#808080",Z_="#008000",J_="#adff2f",Q_="#808080",tg="#f0fff0",eg="#ff69b4",rg="#cd5c5c",ng="#4b0082",ig="#fffff0",og="#f0e68c",ag="#fff0f5",sg="#e6e6fa",ug="#7cfc00",hg="#fffacd",lg="#add8e6",fg="#f08080",cg="#e0ffff",dg="#fafad2",pg="#d3d3d3",vg="#90ee90",_g="#d3d3d3",gg="#ffb6c1",mg="#ffa07a",yg="#20b2aa",bg="#87cefa",xg="#778899",Eg="#778899",Tg="#b0c4de",wg="#ffffe0",Sg="#00ff00",Ag="#32cd32",Pg="#faf0e6",Og="#ff00ff",Rg="#800000",Ig="#66cdaa",Cg="#0000cd",Mg="#ba55d3",Dg="#9370db",Fg="#3cb371",Bg="#7b68ee",Ng="#00fa9a",Lg="#48d1cc",Ug="#c71585",Gg="#191970",kg="#f5fffa",Hg="#ffe4e1",Xg="#ffe4b5",jg="#ffdead",Yg="#000080",Vg="#fdf5e6",zg="#808000",Wg="#6b8e23",qg="#ffa500",$g="#ff4500",Kg="#da70d6",Zg="#eee8aa",Jg="#98fb98",Qg="#afeeee",tm="#db7093",em="#ffefd5",rm="#ffdab9",nm="#cd853f",im="#ffc0cb",om="#dda0dd",am="#b0e0e6",sm="#800080",um="#663399",hm="#ff0000",lm="#bc8f8f",fm="#4169e1",cm="#8b4513",dm="#fa8072",pm="#f4a460",vm="#2e8b57",_m="#fff5ee",gm="#a0522d",mm="#c0c0c0",ym="#87ceeb",bm="#6a5acd",xm="#708090",Em="#708090",Tm="#fffafa",wm="#00ff7f",Sm="#4682b4",Am="#d2b48c",Pm="#008080",Om="#d8bfd8",Rm="#ff6347",Im="#40e0d0",Cm="#ee82ee",Mm="#f5deb3",Dm="#ffffff",Fm="#f5f5f5",Bm="#ffff00",Nm="#9acd32",Lm={aliceblue:Zv,antiquewhite:Jv,aqua:Qv,aquamarine:t_,azure:e_,beige:r_,bisque:n_,black:i_,blanchedalmond:o_,blue:a_,blueviolet:s_,brown:u_,burlywood:h_,cadetblue:l_,chartreuse:f_,chocolate:c_,coral:d_,cornflowerblue:p_,cornsilk:v_,crimson:__,cyan:g_,darkblue:m_,darkcyan:y_,darkgoldenrod:b_,darkgray:x_,darkgreen:E_,darkgrey:T_,darkkhaki:w_,darkmagenta:S_,darkolivegreen:A_,darkorange:P_,darkorchid:O_,darkred:R_,darksalmon:I_,darkseagreen:C_,darkslateblue:M_,darkslategray:D_,darkslategrey:F_,darkturquoise:B_,darkviolet:N_,deeppink:L_,deepskyblue:U_,dimgray:G_,dimgrey:k_,dodgerblue:H_,firebrick:X_,floralwhite:j_,forestgreen:Y_,fuchsia:V_,gainsboro:z_,ghostwhite:W_,goldenrod:q_,gold:$_,gray:K_,green:Z_,greenyellow:J_,grey:Q_,honeydew:tg,hotpink:eg,indianred:rg,indigo:ng,ivory:ig,khaki:og,lavenderblush:ag,lavender:sg,lawngreen:ug,lemonchiffon:hg,lightblue:lg,lightcoral:fg,lightcyan:cg,lightgoldenrodyellow:dg,lightgray:pg,lightgreen:vg,lightgrey:_g,lightpink:gg,lightsalmon:mg,lightseagreen:yg,lightskyblue:bg,lightslategray:xg,lightslategrey:Eg,lightsteelblue:Tg,lightyellow:wg,lime:Sg,limegreen:Ag,linen:Pg,magenta:Og,maroon:Rg,mediumaquamarine:Ig,mediumblue:Cg,mediumorchid:Mg,mediumpurple:Dg,mediumseagreen:Fg,mediumslateblue:Bg,mediumspringgreen:Ng,mediumturquoise:Lg,mediumvioletred:Ug,midnightblue:Gg,mintcream:kg,mistyrose:Hg,moccasin:Xg,navajowhite:jg,navy:Yg,oldlace:Vg,olive:zg,olivedrab:Wg,orange:qg,orangered:$g,orchid:Kg,palegoldenrod:Zg,palegreen:Jg,paleturquoise:Qg,palevioletred:tm,papayawhip:em,peachpuff:rm,peru:nm,pink:im,plum:om,powderblue:am,purple:sm,rebeccapurple:um,red:hm,rosybrown:lm,royalblue:fm,saddlebrown:cm,salmon:dm,sandybrown:pm,seagreen:vm,seashell:_m,sienna:gm,silver:mm,skyblue:ym,slateblue:bm,slategray:xm,slategrey:Em,snow:Tm,springgreen:wm,steelblue:Sm,tan:Am,teal:Pm,thistle:Om,tomato:Rm,turquoise:Im,violet:Cm,wheat:Mm,white:Dm,whitesmoke:Fm,yellow:Bm,yellowgreen:Nm};function Gr(r,t){return t===void 0&&(t=[]),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,t}function uh(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function mn(r){return typeof r=="string"&&(r=Lm[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Um(){for(var r=[],t=[],e=0;e<32;e++)r[e]=e,t[e]=e;r[j.NORMAL_NPM]=j.NORMAL,r[j.ADD_NPM]=j.ADD,r[j.SCREEN_NPM]=j.SCREEN,t[j.NORMAL]=j.NORMAL_NPM,t[j.ADD]=j.ADD_NPM,t[j.SCREEN]=j.SCREEN_NPM;var n=[];return n.push(t),n.push(r),n}var hh=Um();function lh(r,t){return hh[t?1:0][r]}function Gm(r,t,e,n){return e=e||new Float32Array(4),n||n===void 0?(e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t):(e[0]=r[0],e[1]=r[1],e[2]=r[2]),e[3]=t,e}function Zo(r,t){if(t===1)return(t*255<<24)+r;if(t===0)return 0;var e=r>>16&255,n=r>>8&255,i=r&255;return e=e*t+.5|0,n=n*t+.5|0,i=i*t+.5|0,(t*255<<24)+(e<<16)+(n<<8)+i}function fh(r,t,e,n){return e=e||new Float32Array(4),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,(n||n===void 0)&&(e[0]*=t,e[1]*=t,e[2]*=t),e[3]=t,e}function km(r,t){t===void 0&&(t=null);var e=r*6;if(t=t||new Uint16Array(e),t.length!==e)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+e);for(var n=0,i=0;n<e;n+=6,i+=4)t[n+0]=i+0,t[n+1]=i+1,t[n+2]=i+2,t[n+3]=i+0,t[n+4]=i+2,t[n+5]=i+3;return t}function ch(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function ui(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function dh(r){return!(r&r-1)&&!!r}function ph(r){var t=(r>65535?1:0)<<4;r>>>=t;var e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function kr(r,t,e){var n=r.length,i;if(!(t>=n||e===0)){e=t+e>n?n-t:e;var o=n-e;for(i=t;i<o;++i)r[i]=r[i+e];r.length=o}}function Hr(r){return r===0?0:r<0?-1:1}var Hm=0;function nr(){return++Hm}var vh={};function le(r,t,e){if(e===void 0&&(e=3),!vh[t]){var n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",t+`
37
+ Deprecated since v`+r):(n=n.split(`
38
+ `).splice(e).join(`
39
+ `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+`
40
+ Deprecated since v`+r),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+`
41
+ Deprecated since v`+r),console.warn(n))),vh[t]=!0}}var _h={},Oe=Object.create(null),ir=Object.create(null),gh=function(){function r(t,e,n){this.canvas=G.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=n||G.RESOLUTION,this.resize(t,e)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),r}();function Xm(r){var t=r.width,e=r.height,n=r.getContext("2d",{willReadFrequently:!0}),i=n.getImageData(0,0,t,e),o=i.data,a=o.length,s={top:null,left:null,right:null,bottom:null},u=null,h,f,l;for(h=0;h<a;h+=4)o[h+3]!==0&&(f=h/4%t,l=~~(h/4/t),s.top===null&&(s.top=l),(s.left===null||f<s.left)&&(s.left=f),(s.right===null||s.right<f)&&(s.right=f+1),(s.bottom===null||s.bottom<l)&&(s.bottom=l));return s.top!==null&&(t=s.right-s.left,e=s.bottom-s.top+1,u=n.getImageData(s.left,s.top,t,e)),{height:e,width:t,data:u}}var hi;function jm(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,hi||(hi=document.createElement("a")),hi.href=r;var e=Ur.parse(hi.href),n=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!n||e.protocol!==t.protocol?"anonymous":""}function li(r,t){var e=G.RETINA_PREFIX.exec(r);return e?parseFloat(e[1]):t!==void 0?t:1}/*!
42
+ * @pixi/math - v6.5.10
43
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
44
+ *
45
+ * @pixi/math is licensed under the MIT License.
46
+ * http://www.opensource.org/licenses/mit-license
47
+ */var fi=Math.PI*2,Ym=180/Math.PI,Vm=Math.PI/180,Nt;(function(r){r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC"})(Nt||(Nt={}));var Et=function(){function r(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},r.prototype.copyTo=function(t){return t.set(this.x,this.y),t},r.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x=t,this.y=e,this},r.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},r}(),ci=[new Et,new Et,new Et,new Et],st=function(){function r(t,e,n,i){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(n),this.height=Number(i),this.type=Nt.RECT}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r,"EMPTY",{get:function(){return new r(0,0,0,0)},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},r.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},r.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height},r.prototype.intersects=function(t,e){if(!e){var n=this.x<t.x?t.x:this.x,i=this.right>t.right?t.right:this.right;if(i<=n)return!1;var o=this.y<t.y?t.y:this.y,a=this.bottom>t.bottom?t.bottom:this.bottom;return a>o}var s=this.left,u=this.right,h=this.top,f=this.bottom;if(u<=s||f<=h)return!1;var l=ci[0].set(t.left,t.top),c=ci[1].set(t.left,t.bottom),d=ci[2].set(t.right,t.top),p=ci[3].set(t.right,t.bottom);if(d.x<=l.x||c.y<=l.y)return!1;var v=Math.sign(e.a*e.d-e.b*e.c);if(v===0||(e.apply(l,l),e.apply(c,c),e.apply(d,d),e.apply(p,p),Math.max(l.x,c.x,d.x,p.x)<=s||Math.min(l.x,c.x,d.x,p.x)>=u||Math.max(l.y,c.y,d.y,p.y)<=h||Math.min(l.y,c.y,d.y,p.y)>=f))return!1;var _=v*(c.y-l.y),g=v*(l.x-c.x),m=_*s+g*h,y=_*u+g*h,b=_*s+g*f,x=_*u+g*f;if(Math.max(m,y,b,x)<=_*l.x+g*l.y||Math.min(m,y,b,x)>=_*p.x+g*p.y)return!1;var A=v*(l.y-d.y),P=v*(d.x-l.x),T=A*s+P*h,w=A*u+P*h,E=A*s+P*f,R=A*u+P*f;return!(Math.max(T,w,E,R)<=A*l.x+P*l.y||Math.min(T,w,E,R)>=A*p.x+P*p.y)},r.prototype.pad=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this},r.prototype.fit=function(t){var e=Math.max(this.x,t.x),n=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(n-e,0),this.y=i,this.height=Math.max(o-i,0),this},r.prototype.ceil=function(t,e){t===void 0&&(t=1),e===void 0&&(e=.001);var n=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=n-this.x,this.height=i-this.y,this},r.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),n=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=n-e,this.y=i,this.height=o-i,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),zm=function(){function r(t,e,n){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),this.x=t,this.y=e,this.radius=n,this.type=Nt.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(t,e){if(this.radius<=0)return!1;var n=this.radius*this.radius,i=this.x-t,o=this.y-e;return i*=i,o*=o,i+o<=n},r.prototype.getBounds=function(){return new st(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r}(),Wm=function(){function r(t,e,n,i){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=t,this.y=e,this.width=n,this.height=i,this.type=Nt.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var n=(t-this.x)/this.width,i=(e-this.y)/this.height;return n*=n,i*=i,n+i<=1},r.prototype.getBounds=function(){return new st(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),di=function(){function r(){for(var t=arguments,e=[],n=0;n<arguments.length;n++)e[n]=t[n];var i=Array.isArray(e[0])?e[0]:e;if(typeof i[0]!="number"){for(var o=[],a=0,s=i.length;a<s;a++)o.push(i[a].x,i[a].y);i=o}this.points=i,this.type=Nt.POLY,this.closeStroke=!0}return r.prototype.clone=function(){var t=this.points.slice(),e=new r(t);return e.closeStroke=this.closeStroke,e},r.prototype.contains=function(t,e){for(var n=!1,i=this.points.length/2,o=0,a=i-1;o<i;a=o++){var s=this.points[o*2],u=this.points[o*2+1],h=this.points[a*2],f=this.points[a*2+1],l=u>e!=f>e&&t<(h-s)*((e-u)/(f-u))+s;l&&(n=!n)}return n},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(t,e){return t+", "+e},"")+"]")},r}(),qm=function(){function r(t,e,n,i,o){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=0),o===void 0&&(o=20),this.x=t,this.y=e,this.width=n,this.height=i,this.radius=o,this.type=Nt.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+n&&e<=this.y+this.height-n||t>=this.x+n&&t<=this.x+this.width-n)return!0;var i=t-(this.x+n),o=e-(this.y+n),a=n*n;if(i*i+o*o<=a||(i=t-(this.x+this.width-n),i*i+o*o<=a)||(o=e-(this.y+this.height-n),i*i+o*o<=a)||(i=t-(this.x+n),i*i+o*o<=a))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r}(),Xr=function(){function r(t,e,n,i){n===void 0&&(n=0),i===void 0&&(i=0),this._x=n,this._y=i,this.cb=t,this.scope=e}return r.prototype.clone=function(t,e){return t===void 0&&(t=this.cb),e===void 0&&(e=this.scope),new r(t,e,this._x,this._y)},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(t){return t.set(this._x,this._y),t},r.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Mt=function(){function r(t,e,n,i,o,a){t===void 0&&(t=1),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=0),a===void 0&&(a=0),this.array=null,this.a=t,this.b=e,this.c=n,this.d=i,this.tx=o,this.ty=a}return r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.set=function(t,e,n,i,o,a){return this.a=t,this.b=e,this.c=n,this.d=i,this.tx=o,this.ty=a,this},r.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var n=e||this.array;return t?(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},r.prototype.apply=function(t,e){e=e||new Et;var n=t.x,i=t.y;return e.x=this.a*n+this.c*i+this.tx,e.y=this.b*n+this.d*i+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new Et;var n=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*n*i+-this.c*n*o+(this.ty*this.c-this.tx*this.d)*n,e.y=this.a*n*o+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),i=this.a,o=this.c,a=this.tx;return this.a=i*e-this.b*n,this.b=i*n+this.b*e,this.c=o*e-this.d*n,this.d=o*n+this.d*e,this.tx=a*e-this.ty*n,this.ty=a*n+this.ty*e,this},r.prototype.append=function(t){var e=this.a,n=this.b,i=this.c,o=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*n+t.b*o,this.c=t.c*e+t.d*i,this.d=t.c*n+t.d*o,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*n+t.ty*o+this.ty,this},r.prototype.setTransform=function(t,e,n,i,o,a,s,u,h){return this.a=Math.cos(s+h)*o,this.b=Math.sin(s+h)*o,this.c=-Math.sin(s-u)*a,this.d=Math.cos(s-u)*a,this.tx=t-(n*this.a+i*this.c),this.ty=e-(n*this.b+i*this.d),this},r.prototype.prepend=function(t){var e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){var n=this.a,i=this.c;this.a=n*t.a+this.b*t.c,this.b=n*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.decompose=function(t){var e=this.a,n=this.b,i=this.c,o=this.d,a=t.pivot,s=-Math.atan2(-i,o),u=Math.atan2(n,e),h=Math.abs(s+u);return h<1e-5||Math.abs(fi-h)<1e-5?(t.rotation=u,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=u),t.scale.x=Math.sqrt(e*e+n*n),t.scale.y=Math.sqrt(i*i+o*o),t.position.x=this.tx+(a.x*e+a.y*i),t.position.y=this.ty+(a.x*n+a.y*o),t},r.prototype.invert=function(){var t=this.a,e=this.b,n=this.c,i=this.d,o=this.tx,a=t*i-e*n;return this.a=i/a,this.b=-e/a,this.c=-n/a,this.d=t/a,this.tx=(n*this.ty-i*o)/a,this.ty=-(t*this.ty-e*o)/a,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),or=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ar=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],sr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ur=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Jo=[],mh=[],pi=Math.sign;function $m(){for(var r=0;r<16;r++){var t=[];Jo.push(t);for(var e=0;e<16;e++)for(var n=pi(or[r]*or[e]+sr[r]*ar[e]),i=pi(ar[r]*or[e]+ur[r]*ar[e]),o=pi(or[r]*sr[e]+sr[r]*ur[e]),a=pi(ar[r]*sr[e]+ur[r]*ur[e]),s=0;s<16;s++)if(or[s]===n&&ar[s]===i&&sr[s]===o&&ur[s]===a){t.push(s);break}}for(var r=0;r<16;r++){var u=new Mt;u.set(or[r],ar[r],sr[r],ur[r],0,0),mh.push(u)}}$m();var Pt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return or[r]},uY:function(r){return ar[r]},vX:function(r){return sr[r]},vY:function(r){return ur[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return Jo[r][t]},sub:function(r,t){return Jo[r][Pt.inv(t)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,t){return Math.abs(r)*2<=Math.abs(t)?t>=0?Pt.S:Pt.N:Math.abs(t)*2<=Math.abs(r)?r>0?Pt.E:Pt.W:t>0?r>0?Pt.SE:Pt.SW:r>0?Pt.NE:Pt.NW},matrixAppendRotationInv:function(r,t,e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=mh[Pt.inv(t)];i.tx=e,i.ty=n,r.append(i)}},yh=function(){function r(){this.worldTransform=new Mt,this.localTransform=new Mt,this.position=new Xr(this.onChange,this,0,0),this.scale=new Xr(this.onChange,this,1,1),this.pivot=new Xr(this.onChange,this,0,0),this.skew=new Xr(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var n=t.worldTransform,i=this.worldTransform;i.a=e.a*n.a+e.b*n.c,i.b=e.a*n.b+e.b*n.d,i.c=e.c*n.a+e.d*n.c,i.d=e.c*n.b+e.d*n.d,i.tx=e.tx*n.a+e.ty*n.c+n.tx,i.ty=e.tx*n.b+e.ty*n.d+n.ty,this._parentID=t._worldID,this._worldID++}},r.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*!
48
+ * @pixi/display - v6.5.10
49
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
50
+ *
51
+ * @pixi/display is licensed under the MIT License.
52
+ * http://www.opensource.org/licenses/mit-license
53
+ */G.SORTABLE_CHILDREN=!1;var vi=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?st.EMPTY:(t=t||new st(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},r.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},r.prototype.addPointMatrix=function(t,e){var n=t.a,i=t.b,o=t.c,a=t.d,s=t.tx,u=t.ty,h=n*e.x+o*e.y+s,f=i*e.x+a*e.y+u;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,f),this.maxY=Math.max(this.maxY,f)},r.prototype.addQuad=function(t){var e=this.minX,n=this.minY,i=this.maxX,o=this.maxY,a=t[0],s=t[1];e=a<e?a:e,n=s<n?s:n,i=a>i?a:i,o=s>o?s:o,a=t[2],s=t[3],e=a<e?a:e,n=s<n?s:n,i=a>i?a:i,o=s>o?s:o,a=t[4],s=t[5],e=a<e?a:e,n=s<n?s:n,i=a>i?a:i,o=s>o?s:o,a=t[6],s=t[7],e=a<e?a:e,n=s<n?s:n,i=a>i?a:i,o=s>o?s:o,this.minX=e,this.minY=n,this.maxX=i,this.maxY=o},r.prototype.addFrame=function(t,e,n,i,o){this.addFrameMatrix(t.worldTransform,e,n,i,o)},r.prototype.addFrameMatrix=function(t,e,n,i,o){var a=t.a,s=t.b,u=t.c,h=t.d,f=t.tx,l=t.ty,c=this.minX,d=this.minY,p=this.maxX,v=this.maxY,_=a*e+u*n+f,g=s*e+h*n+l;c=_<c?_:c,d=g<d?g:d,p=_>p?_:p,v=g>v?g:v,_=a*i+u*n+f,g=s*i+h*n+l,c=_<c?_:c,d=g<d?g:d,p=_>p?_:p,v=g>v?g:v,_=a*e+u*o+f,g=s*e+h*o+l,c=_<c?_:c,d=g<d?g:d,p=_>p?_:p,v=g>v?g:v,_=a*i+u*o+f,g=s*i+h*o+l,c=_<c?_:c,d=g<d?g:d,p=_>p?_:p,v=g>v?g:v,this.minX=c,this.minY=d,this.maxX=p,this.maxY=v},r.prototype.addVertexData=function(t,e,n){for(var i=this.minX,o=this.minY,a=this.maxX,s=this.maxY,u=e;u<n;u+=2){var h=t[u],f=t[u+1];i=h<i?h:i,o=f<o?f:o,a=h>a?h:a,s=f>s?f:s}this.minX=i,this.minY=o,this.maxX=a,this.maxY=s},r.prototype.addVertices=function(t,e,n,i){this.addVerticesMatrix(t.worldTransform,e,n,i)},r.prototype.addVerticesMatrix=function(t,e,n,i,o,a){o===void 0&&(o=0),a===void 0&&(a=o);for(var s=t.a,u=t.b,h=t.c,f=t.d,l=t.tx,c=t.ty,d=this.minX,p=this.minY,v=this.maxX,_=this.maxY,g=n;g<i;g+=2){var m=e[g],y=e[g+1],b=s*m+h*y+l,x=f*y+u*m+c;d=Math.min(d,b-o),v=Math.max(v,b+o),p=Math.min(p,x-a),_=Math.max(_,x+a)}this.minX=d,this.minY=p,this.maxX=v,this.maxY=_},r.prototype.addBounds=function(t){var e=this.minX,n=this.minY,i=this.maxX,o=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<n?t.minY:n,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>o?t.maxY:o},r.prototype.addBoundsMask=function(t,e){var n=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,o=t.maxX<e.maxX?t.maxX:e.maxX,a=t.maxY<e.maxY?t.maxY:e.maxY;if(n<=o&&i<=a){var s=this.minX,u=this.minY,h=this.maxX,f=this.maxY;this.minX=n<s?n:s,this.minY=i<u?i:u,this.maxX=o>h?o:h,this.maxY=a>f?a:f}},r.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},r.prototype.addBoundsArea=function(t,e){var n=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,o=t.maxX<e.x+e.width?t.maxX:e.x+e.width,a=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(n<=o&&i<=a){var s=this.minX,u=this.minY,h=this.maxX,f=this.maxY;this.minX=n<s?n:s,this.minY=i<u?i:u,this.maxX=o>h?o:h,this.maxY=a>f?a:f}},r.prototype.pad=function(t,e){t===void 0&&(t=0),e===void 0&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},r.prototype.addFramePad=function(t,e,n,i,o,a){t-=o,e-=a,n+=o,i+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i},r}();/*! *****************************************************************************
54
+ Copyright (c) Microsoft Corporation.
55
+
56
+ Permission to use, copy, modify, and/or distribute this software for any
57
+ purpose with or without fee is hereby granted.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
60
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
61
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
62
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
63
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
64
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65
+ PERFORMANCE OF THIS SOFTWARE.
66
+ ***************************************************************************** */var Qo=function(r,t){return Qo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Qo(r,t)};function ta(r,t){Qo(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Rt=function(r){ta(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new yh,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new vi,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return t.mixin=function(e){for(var n=Object.keys(e),i=0;i<n.length;++i){var o=n[i];Object.defineProperty(t.prototype,o,Object.getOwnPropertyDescriptor(e,o))}},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),t.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},t.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},t.prototype.getBounds=function(e,n){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),n||(this._boundsRect||(this._boundsRect=new st),n=this._boundsRect),this._bounds.getRectangle(n)},t.prototype.getLocalBounds=function(e){e||(this._localBoundsRect||(this._localBoundsRect=new st),e=this._localBoundsRect),this._localBounds||(this._localBounds=new vi);var n=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var o=this._bounds,a=this._boundsID;this._bounds=this._localBounds;var s=this.getBounds(!1,e);return this.parent=i,this.transform=n,this._bounds=o,this._bounds.updateID+=this._boundsID-a,s},t.prototype.toGlobal=function(e,n,i){return i===void 0&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,n)},t.prototype.toLocal=function(e,n,i,o){return n&&(e=n.toGlobal(e,i,o)),o||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,i)},t.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},t.prototype.setTransform=function(e,n,i,o,a,s,u,h,f){return e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=1),a===void 0&&(a=0),s===void 0&&(s=0),u===void 0&&(u=0),h===void 0&&(h=0),f===void 0&&(f=0),this.position.x=e,this.position.y=n,this.scale.x=i||1,this.scale.y=o||1,this.rotation=a,this.skew.x=s,this.skew.y=u,this.pivot.x=h,this.pivot.y=f,this},t.prototype.destroy=function(e){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(t.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new bh),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),t.prototype.enableTempParent=function(){var e=this.parent;return this.parent=this._tempDisplayObjectParent,e},t.prototype.disableTempParent=function(e){this.parent=e},Object.defineProperty(t.prototype,"x",{get:function(){return this.position.x},set:function(e){this.transform.position.x=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.position.y},set:function(e){this.transform.position.y=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.transform.position},set:function(e){this.transform.position.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.transform.scale},set:function(e){this.transform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(e){this.transform.pivot.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skew",{get:function(){return this.transform.skew},set:function(e){this.transform.skew.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(e){this.transform.rotation=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.transform.rotation*Ym},set:function(e){this.transform.rotation=e*Vm},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zIndex",{get:function(){return this._zIndex},set:function(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"worldVisible",{get:function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mask",{get:function(){return this._mask},set:function(e){if(this._mask!==e){if(this._mask){var n=this._mask.isMaskData?this._mask.maskObject:this._mask;n&&(n._maskRefCount--,n._maskRefCount===0&&(n.renderable=!0,n.isMask=!1))}if(this._mask=e,this._mask){var n=this._mask.isMaskData?this._mask.maskObject:this._mask;n&&(n._maskRefCount===0&&(n.renderable=!1,n.isMask=!0),n._maskRefCount++)}}},enumerable:!1,configurable:!0}),t}(un),bh=function(r){ta(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.sortDirty=null,e}return t}(Rt);Rt.prototype.displayObjectUpdateTransform=Rt.prototype.updateTransform;function Km(r,t){return r.zIndex===t.zIndex?r._lastSortedIndex-t._lastSortedIndex:r.zIndex-t.zIndex}var Ee=function(r){ta(t,r);function t(){var e=r.call(this)||this;return e.children=[],e.sortableChildren=G.SORTABLE_CHILDREN,e.sortDirty=!1,e}return t.prototype.onChildrenChange=function(e){},t.prototype.addChild=function(){for(var e=arguments,n=[],i=0;i<arguments.length;i++)n[i]=e[i];if(n.length>1)for(var o=0;o<n.length;o++)this.addChild(n[o]);else{var a=n[0];a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.push(a),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",a,this,this.children.length-1),a.emit("added",this)}return n[0]},t.prototype.addChildAt=function(e,n){if(n<0||n>this.children.length)throw new Error(e+"addChildAt: The index "+n+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(n,0,e),this._boundsID++,this.onChildrenChange(n),e.emit("added",this),this.emit("childAdded",e,this,n),e},t.prototype.swapChildren=function(e,n){if(e!==n){var i=this.getChildIndex(e),o=this.getChildIndex(n);this.children[i]=n,this.children[o]=e,this.onChildrenChange(i<o?i:o)}},t.prototype.getChildIndex=function(e){var n=this.children.indexOf(e);if(n===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return n},t.prototype.setChildIndex=function(e,n){if(n<0||n>=this.children.length)throw new Error("The index "+n+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(e);kr(this.children,i,1),this.children.splice(n,0,e),this.onChildrenChange(n)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,n=[],i=0;i<arguments.length;i++)n[i]=e[i];if(n.length>1)for(var o=0;o<n.length;o++)this.removeChild(n[o]);else{var a=n[0],s=this.children.indexOf(a);if(s===-1)return null;a.parent=null,a.transform._parentID=-1,kr(this.children,s,1),this._boundsID++,this.onChildrenChange(s),a.emit("removed",this),this.emit("childRemoved",a,this,s)}return n[0]},t.prototype.removeChildAt=function(e){var n=this.getChildAt(e);return n.parent=null,n.transform._parentID=-1,kr(this.children,e,1),this._boundsID++,this.onChildrenChange(e),n.emit("removed",this),this.emit("childRemoved",n,this,e),n},t.prototype.removeChildren=function(e,n){e===void 0&&(e=0),n===void 0&&(n=this.children.length);var i=e,o=n,a=o-i,s;if(a>0&&a<=o){s=this.children.splice(i,a);for(var u=0;u<s.length;++u)s[u].parent=null,s[u].transform&&(s[u].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var u=0;u<s.length;++u)s[u].emit("removed",this),this.emit("childRemoved",s[u],this,u);return s}else if(a===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},t.prototype.sortChildren=function(){for(var e=!1,n=0,i=this.children.length;n<i;++n){var o=this.children[n];o._lastSortedIndex=n,!e&&o.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(Km),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,n=this.children.length;e<n;++e){var i=this.children[e];i.visible&&i.updateTransform()}},t.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var n=this.children[e];if(!(!n.visible||!n.renderable))if(n.calculateBounds(),n._mask){var i=n._mask.isMaskData?n._mask.maskObject:n._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(n._bounds,i._bounds)):this._bounds.addBounds(n._bounds)}else n.filterArea?this._bounds.addBoundsArea(n._bounds,n.filterArea):this._bounds.addBounds(n._bounds)}this._bounds.updateID=this._boundsID},t.prototype.getLocalBounds=function(e,n){n===void 0&&(n=!1);var i=r.prototype.getLocalBounds.call(this,e);if(!n)for(var o=0,a=this.children.length;o<a;++o){var s=this.children[o];s.visible&&s.updateTransform()}return i},t.prototype._calculateBounds=function(){},t.prototype._renderWithCulling=function(e){var n=e.renderTexture.sourceFrame;if(n.width>0&&n.height>0){var i,o;if(this.cullArea?(i=this.cullArea,o=this.worldTransform):this._render!==t.prototype._render&&(i=this.getBounds(!0)),i&&n.intersects(i,o))this._render(e);else if(this.cullArea)return;for(var a=0,s=this.children.length;a<s;++a){var u=this.children[a],h=u.cullable;u.cullable=h||!this.cullArea,u.render(e),u.cullable=h}}},t.prototype.render=function(e){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(var n=0,i=this.children.length;n<i;++n)this.children[n].render(e)}},t.prototype.renderAdvanced=function(e){var n=this.filters,i=this._mask;if(n){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var o=0;o<n.length;o++)n[o].enabled&&this._enabledFilters.push(n[o])}var a=n&&this._enabledFilters&&this._enabledFilters.length||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==Ct.NONE));if(a&&e.batch.flush(),n&&this._enabledFilters&&this._enabledFilters.length&&e.filter.push(this,this._enabledFilters),i&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(var o=0,s=this.children.length;o<s;++o)this.children[o].render(e)}a&&e.batch.flush(),i&&e.mask.pop(this),n&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},t.prototype._render=function(e){},t.prototype.destroy=function(e){r.prototype.destroy.call(this),this.sortDirty=!1;var n=typeof e=="boolean"?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(n)for(var o=0;o<i.length;++o)i[o].destroy(e)},Object.defineProperty(t.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(e){var n=this.getLocalBounds().width;n!==0?this.scale.x=e/n:this.scale.x=1,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(e){var n=this.getLocalBounds().height;n!==0?this.scale.y=e/n:this.scale.y=1,this._height=e},enumerable:!1,configurable:!0}),t}(Rt);Ee.prototype.containerUpdateTransform=Ee.prototype.updateTransform;/*!
67
+ * @pixi/extensions - v6.5.10
68
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
69
+ *
70
+ * @pixi/extensions is licensed under the MIT License.
71
+ * http://www.opensource.org/licenses/mit-license
72
+ *//*! *****************************************************************************
73
+ Copyright (c) Microsoft Corporation.
74
+
75
+ Permission to use, copy, modify, and/or distribute this software for any
76
+ purpose with or without fee is hereby granted.
77
+
78
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
79
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
80
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
81
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
82
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
83
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
84
+ PERFORMANCE OF THIS SOFTWARE.
85
+ ***************************************************************************** */var yn=function(){return yn=Object.assign||function(t){for(var e=arguments,n,i=1,o=arguments.length;i<o;i++){n=e[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},yn.apply(this,arguments)},gt;(function(r){r.Application="application",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Loader="loader",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser"})(gt||(gt={}));var xh=function(r){if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");var t=typeof r.extension!="object"?{type:r.extension}:r.extension;r=yn(yn({},t),{ref:r})}if(typeof r=="object")r=yn({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Re={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var r=arguments,t=this,e=[],n=0;n<arguments.length;n++)e[n]=r[n];return e.map(xh).forEach(function(i){i.type.forEach(function(o){var a,s;return(s=(a=t._removeHandlers)[o])===null||s===void 0?void 0:s.call(a,i)})}),this},add:function(){for(var r=arguments,t=this,e=[],n=0;n<arguments.length;n++)e[n]=r[n];return e.map(xh).forEach(function(i){i.type.forEach(function(o){var a=t._addHandlers,s=t._queue;a[o]?a[o](i):(s[o]=s[o]||[],s[o].push(i))})}),this},handle:function(r,t,e){var n=this._addHandlers=this._addHandlers||{},i=this._removeHandlers=this._removeHandlers||{};if(n[r]||i[r])throw new Error("Extension type "+r+" already has a handler");n[r]=t,i[r]=e;var o=this._queue;return o[r]&&(o[r].forEach(function(a){return t(a)}),delete o[r]),this},handleByMap:function(r,t){return this.handle(r,function(e){t[e.name]=e.ref},function(e){delete t[e.name]})},handleByList:function(r,t){return this.handle(r,function(e){var n,i;t.includes(e.ref)||(t.push(e.ref),r===gt.Loader&&((i=(n=e.ref).add)===null||i===void 0||i.call(n)))},function(e){var n=t.indexOf(e.ref);n!==-1&&t.splice(n,1)})}};/*!
86
+ * @pixi/runner - v6.5.10
87
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
88
+ *
89
+ * @pixi/runner is licensed under the MIT License.
90
+ * http://www.opensource.org/licenses/mit-license
91
+ */var Gt=function(){function r(t){this.items=[],this._name=t,this._aliasCount=0}return r.prototype.emit=function(t,e,n,i,o,a,s,u){if(arguments.length>8)throw new Error("max arguments reached");var h=this,f=h.name,l=h.items;this._aliasCount++;for(var c=0,d=l.length;c<d;c++)l[c][f](t,e,n,i,o,a,s,u);return l===this.items&&this._aliasCount--,this},r.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},r.prototype.remove=function(t){var e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},r.prototype.contains=function(t){return this.items.indexOf(t)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(Gt.prototype,{dispatch:{value:Gt.prototype.emit},run:{value:Gt.prototype.emit}});/*!
92
+ * @pixi/ticker - v6.5.10
93
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
94
+ *
95
+ * @pixi/ticker is licensed under the MIT License.
96
+ * http://www.opensource.org/licenses/mit-license
97
+ */G.TARGET_FPMS=.06;var Ie;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(Ie||(Ie={}));var ea=function(){function r(t,e,n,i){e===void 0&&(e=null),n===void 0&&(n=0),i===void 0&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=n,this.once=i}return r.prototype.match=function(t,e){return e===void 0&&(e=null),this.fn===t&&this.context===e},r.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},r.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},r.prototype.destroy=function(t){t===void 0&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},r}(),kt=function(){function r(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new ea(null,null,1/0),this.deltaMS=1/G.TARGET_FPMS,this.elapsedMS=1/G.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&t._requestId===null&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(t,e,n){return n===void 0&&(n=Ie.NORMAL),this._addListener(new ea(t,e,n))},r.prototype.addOnce=function(t,e,n){return n===void 0&&(n=Ie.NORMAL),this._addListener(new ea(t,e,n,!0))},r.prototype._addListener=function(t){var e=this._head.next,n=this._head;if(!e)t.connect(n);else{for(;e;){if(t.priority>e.priority){t.connect(n);break}n=e,e=e.next}t.previous||t.connect(n)}return this._startIfPossible(),this},r.prototype.remove=function(t,e){for(var n=this._head.next;n;)n.match(t,e)?n=n.destroy():n=n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(t){t===void 0&&(t=performance.now());var e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*G.TARGET_FPMS;for(var i=this._head,o=i.next;o;)o=o.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(r.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),n=Math.min(Math.max(0,e)/1e3,G.TARGET_FPMS);this._maxElapsedMS=1/n},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(t===0)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"shared",{get:function(){if(!r._shared){var t=r._shared=new r;t.autoStart=!0,t._protected=!0}return r._shared},enumerable:!1,configurable:!0}),Object.defineProperty(r,"system",{get:function(){if(!r._system){var t=r._system=new r;t.autoStart=!0,t._protected=!0}return r._system},enumerable:!1,configurable:!0}),r}(),Zm=function(){function r(){}return r.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,Ie.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?kt.shared:new kt,t.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},r.extension=gt.Application,r}();/*!
98
+ * @pixi/core - v6.5.10
99
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
100
+ *
101
+ * @pixi/core is licensed under the MIT License.
102
+ * http://www.opensource.org/licenses/mit-license
103
+ */G.PREFER_ENV=ye.any?Se.WEBGL:Se.WEBGL2,G.STRICT_TEXTURE_CACHE=!1;var ra=[];function Eh(r,t){if(!r)return null;var e="";if(typeof r=="string"){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);n&&(e=n[1].toLowerCase())}for(var i=ra.length-1;i>=0;--i){var o=ra[i];if(o.test&&o.test(r,e))return new o(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! *****************************************************************************
104
+ Copyright (c) Microsoft Corporation.
105
+
106
+ Permission to use, copy, modify, and/or distribute this software for any
107
+ purpose with or without fee is hereby granted.
108
+
109
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
110
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
111
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
112
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
113
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
114
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
115
+ PERFORMANCE OF THIS SOFTWARE.
116
+ ***************************************************************************** */var na=function(r,t){return na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},na(r,t)};function bt(r,t){na(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ia=function(){return ia=Object.assign||function(t){for(var e=arguments,n,i=1,o=arguments.length;i<o;i++){n=e[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ia.apply(this,arguments)};function Jm(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}var bn=function(){function r(t,e){t===void 0&&(t=0),e===void 0&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Gt("setRealSize"),this.onUpdate=new Gt("update"),this.onError=new Gt("onError")}return r.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},r.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},r.prototype.resize=function(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(r.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),r.prototype.update=function(){this.destroyed||this.onUpdate.emit()},r.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),r.prototype.style=function(t,e,n){return!1},r.prototype.dispose=function(){},r.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},r.test=function(t,e){return!1},r}(),xn=function(r){bt(t,r);function t(e,n){var i=this,o=n||{},a=o.width,s=o.height;if(!a||!s)throw new Error("BufferResource width or height invalid");return i=r.call(this,a,s)||this,i.data=e,i}return t.prototype.upload=function(e,n,i){var o=e.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===se.UNPACK);var a=n.realWidth,s=n.realHeight;return i.width===a&&i.height===s?o.texSubImage2D(n.target,0,0,0,a,s,n.format,i.type,this.data):(i.width=a,i.height=s,o.texImage2D(n.target,0,i.internalFormat,a,s,0,n.format,i.type,this.data)),!0},t.prototype.dispose=function(){this.data=null},t.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},t}(bn),Qm={scaleMode:_e.NEAREST,format:U.RGBA,alphaMode:se.NPM},ut=function(r){bt(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=null);var i=r.call(this)||this;n=n||{};var o=n.alphaMode,a=n.mipmap,s=n.anisotropicLevel,u=n.scaleMode,h=n.width,f=n.height,l=n.wrapMode,c=n.format,d=n.type,p=n.target,v=n.resolution,_=n.resourceOptions;return e&&!(e instanceof bn)&&(e=Eh(e,_),e.internal=!0),i.resolution=v||G.RESOLUTION,i.width=Math.round((h||0)*i.resolution)/i.resolution,i.height=Math.round((f||0)*i.resolution)/i.resolution,i._mipmap=a!==void 0?a:G.MIPMAP_TEXTURES,i.anisotropicLevel=s!==void 0?s:G.ANISOTROPIC_LEVEL,i._wrapMode=l||G.WRAP_MODE,i._scaleMode=u!==void 0?u:G.SCALE_MODE,i.format=c||U.RGBA,i.type=d||X.UNSIGNED_BYTE,i.target=p||Ze.TEXTURE_2D,i.alphaMode=o!==void 0?o:se.UNPACK,i.uid=nr(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=h>0&&f>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(e),i}return Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,n){var i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,i=!0),i&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,n,i){return i=i||this.resolution,this.setRealSize(e*i,n*i,i)},t.prototype.setRealSize=function(e,n,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=dh(this.realWidth)&&dh(this.realHeight)},t.prototype.setResolution=function(e){var n=this.resolution;return n===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*n)/e,this.height=Math.round(this.height*n)/e,this.emit("update",this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ir[this.cacheId],delete Oe[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,i){i===void 0&&(i=G.STRICT_TEXTURE_CACHE);var o=typeof e=="string",a=null;if(o)a=e;else{if(!e._pixiId){var s=n&&n.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+nr()}a=e._pixiId}var u=ir[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||(u=new t(e,n),u.cacheId=a,t.addToCache(u,a)),u},t.fromBuffer=function(e,n,i,o){e=e||new Float32Array(n*i*4);var a=new xn(e,{width:n,height:i}),s=e instanceof Float32Array?X.FLOAT:X.UNSIGNED_BYTE;return new t(a,Object.assign({},Qm,o||{width:n,height:i,type:s}))},t.addToCache=function(e,n){n&&(e.textureCacheIds.indexOf(n)===-1&&e.textureCacheIds.push(n),ir[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),ir[n]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var n=ir[e];if(n){var i=n.textureCacheIds.indexOf(e);return i>-1&&n.textureCacheIds.splice(i,1),delete ir[e],n}}else if(e&&e.textureCacheIds){for(var o=0;o<e.textureCacheIds.length;++o)delete ir[e.textureCacheIds[o]];return e.textureCacheIds.length=0,e}return null},t._globalBatch=0,t}(un),Th=function(r){bt(t,r);function t(e,n){var i=this,o=n||{},a=o.width,s=o.height;i=r.call(this,a,s)||this,i.items=[],i.itemDirtyIds=[];for(var u=0;u<e;u++){var h=new ut;i.items.push(h),i.itemDirtyIds.push(-2)}return i.length=e,i._load=null,i.baseTexture=null,i}return t.prototype.initFromArray=function(e,n){for(var i=0;i<this.length;i++)e[i]&&(e[i].castToBaseTexture?this.addBaseTextureAt(e[i].castToBaseTexture(),i):e[i]instanceof bn?this.addResourceAt(e[i],i):this.addResourceAt(Eh(e[i],n),i))},t.prototype.dispose=function(){for(var e=0,n=this.length;e<n;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},t.prototype.addResourceAt=function(e,n){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[n].setResource(e),this},t.prototype.bind=function(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");r.prototype.bind.call(this,e);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=e,this.items[n].on("update",e.update,e)},t.prototype.unbind=function(e){r.prototype.unbind.call(this,e);for(var n=0;n<this.length;n++)this.items[n].parentTextureArray=null,this.items[n].off("update",e.update,e)},t.prototype.load=function(){var e=this;if(this._load)return this._load;var n=this.items.map(function(o){return o.resource}).filter(function(o){return o}),i=n.map(function(o){return o.load()});return this._load=Promise.all(i).then(function(){var o=e.items[0],a=o.realWidth,s=o.realHeight;return e.resize(a,s),Promise.resolve(e)}),this._load},t}(bn),ty=function(r){bt(t,r);function t(e,n){var i=this,o=n||{},a=o.width,s=o.height,u,h;return Array.isArray(e)?(u=e,h=e.length):h=e,i=r.call(this,h,{width:a,height:s})||this,u&&i.initFromArray(u,n),i}return t.prototype.addBaseTextureAt=function(e,n){if(e.resource)this.addResourceAt(e.resource,n);else throw new Error("ArrayResource does not support RenderTexture");return this},t.prototype.bind=function(e){r.prototype.bind.call(this,e),e.target=Ze.TEXTURE_2D_ARRAY},t.prototype.upload=function(e,n,i){var o=this,a=o.length,s=o.itemDirtyIds,u=o.items,h=e.gl;i.dirtyId<0&&h.texImage3D(h.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,a,0,n.format,i.type,null);for(var f=0;f<a;f++){var l=u[f];s[f]<l.dirtyId&&(s[f]=l.dirtyId,l.valid&&h.texSubImage3D(h.TEXTURE_2D_ARRAY,0,0,0,f,l.resource.width,l.resource.height,1,n.format,i.type,l.resource.source))}return!0},t}(Th),Xe=function(r){bt(t,r);function t(e){var n=this,i=e,o=i.naturalWidth||i.videoWidth||i.width,a=i.naturalHeight||i.videoHeight||i.height;return n=r.call(this,o,a)||this,n.source=e,n.noSubImage=!1,n}return t.crossOrigin=function(e,n,i){i===void 0&&n.indexOf("data:")!==0?e.crossOrigin=jm(n):i!==!1&&(e.crossOrigin=typeof i=="string"?i:"anonymous")},t.prototype.upload=function(e,n,i,o){var a=e.gl,s=n.realWidth,u=n.realHeight;if(o=o||this.source,o instanceof HTMLImageElement){if(!o.complete||o.naturalWidth===0)return!1}else if(o instanceof HTMLVideoElement&&o.readyState<=1)return!1;return a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===se.UNPACK),!this.noSubImage&&n.target===a.TEXTURE_2D&&i.width===s&&i.height===u?a.texSubImage2D(a.TEXTURE_2D,0,0,0,n.format,i.type,o):(i.width=s,i.height=u,a.texImage2D(n.target,0,i.internalFormat,n.format,i.type,o)),!0},t.prototype.update=function(){if(!this.destroyed){var e=this.source,n=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(n,i),r.prototype.update.call(this)}},t.prototype.dispose=function(){this.source=null},t}(bn),ey=function(r){bt(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){var n=globalThis.OffscreenCanvas;return n&&e instanceof n?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement},t}(Xe),ry=function(r){bt(t,r);function t(e,n){var i=this,o=n||{},a=o.width,s=o.height,u=o.autoLoad,h=o.linkBaseTexture;if(e&&e.length!==t.SIDES)throw new Error("Invalid length. Got "+e.length+", expected 6");i=r.call(this,6,{width:a,height:s})||this;for(var f=0;f<t.SIDES;f++)i.items[f].target=Ze.TEXTURE_CUBE_MAP_POSITIVE_X+f;return i.linkBaseTexture=h!==!1,e&&i.initFromArray(e,n),u!==!1&&i.load(),i}return t.prototype.bind=function(e){r.prototype.bind.call(this,e),e.target=Ze.TEXTURE_CUBE_MAP},t.prototype.addBaseTextureAt=function(e,n,i){if(!this.items[n])throw new Error("Index "+n+" is out of bounds");if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,n);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Ze.TEXTURE_CUBE_MAP_POSITIVE_X+n,e.parentTextureArray=this.baseTexture,this.items[n]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[n]=e,this},t.prototype.upload=function(e,n,i){for(var o=this.itemDirtyIds,a=0;a<t.SIDES;a++){var s=this.items[a];(o[a]<s.dirtyId||i.dirtyId<n.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(e,s,i),o[a]=s.dirtyId):o[a]<-1&&(e.gl.texImage2D(s.target,0,i.internalFormat,n.realWidth,n.realHeight,0,n.format,i.type,null),o[a]=-1))}return!0},t.test=function(e){return Array.isArray(e)&&e.length===t.SIDES},t.SIDES=6,t}(Th),wh=function(r){bt(t,r);function t(e,n){var i=this;if(n=n||{},!(e instanceof HTMLImageElement)){var o=new Image;Xe.crossOrigin(o,e,n.crossorigin),o.src=e,e=o}return i=r.call(this,e)||this,!e.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=e.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(n.createBitmap!==void 0?n.createBitmap:G.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode=typeof n.alphaMode=="number"?n.alphaMode:null,i.bitmap=null,i._load=null,n.autoLoad!==!1&&i.load(),i}return t.prototype.load=function(e){var n=this;return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise(function(i,o){var a=n.source;n.url=a.src;var s=function(){n.destroyed||(a.onload=null,a.onerror=null,n.resize(a.width,a.height),n._load=null,n.createBitmap?i(n.process()):i(n))};a.complete&&a.src?s():(a.onload=s,a.onerror=function(u){o(u),n.onError.emit(u)})}),this._load)},t.prototype.process=function(){var e=this,n=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var i=globalThis.createImageBitmap,o=!n.crossOrigin||n.crossOrigin==="anonymous";return this._process=fetch(n.src,{mode:o?"cors":"no-cors"}).then(function(a){return a.blob()}).then(function(a){return i(a,0,0,n.width,n.height,{premultiplyAlpha:e.alphaMode===null||e.alphaMode===se.UNPACK?"premultiply":"none"})}).then(function(a){return e.destroyed?Promise.reject():(e.bitmap=a,e.update(),e._process=null,Promise.resolve(e))}),this._process},t.prototype.upload=function(e,n,i){if(typeof this.alphaMode=="number"&&(n.alphaMode=this.alphaMode),!this.createBitmap)return r.prototype.upload.call(this,e,n,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(r.prototype.upload.call(this,e,n,i,this.bitmap),!this.preserveBitmap){var o=!0,a=n._glTextures;for(var s in a){var u=a[s];if(u!==i&&u.dirtyId!==n.dirtyId){o=!1;break}}o&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},t.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,r.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},t.test=function(e){return typeof e=="string"||e instanceof HTMLImageElement},t}(Xe),ny=function(r){bt(t,r);function t(e,n){var i=this;return n=n||{},i=r.call(this,G.ADAPTER.createCanvas())||this,i._width=0,i._height=0,i.svg=e,i.scale=n.scale||1,i._overrideWidth=n.width,i._overrideHeight=n.height,i._resolve=null,i._crossorigin=n.crossorigin,i._load=null,n.autoLoad!==!1&&i.load(),i}return t.prototype.load=function(){var e=this;return this._load?this._load:(this._load=new Promise(function(n){if(e._resolve=function(){e.resize(e.source.width,e.source.height),n(e)},t.SVG_XML.test(e.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");e.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e.svg)))}e._loadSvg()}),this._load)},t.prototype._loadSvg=function(){var e=this,n=new Image;Xe.crossOrigin(n,this.svg,this._crossorigin),n.src=this.svg,n.onerror=function(i){e._resolve&&(n.onerror=null,e.onError.emit(i))},n.onload=function(){if(e._resolve){var i=n.width,o=n.height;if(!i||!o)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var a=i*e.scale,s=o*e.scale;(e._overrideWidth||e._overrideHeight)&&(a=e._overrideWidth||e._overrideHeight/o*i,s=e._overrideHeight||e._overrideWidth/i*o),a=Math.round(a),s=Math.round(s);var u=e.source;u.width=a,u.height=s,u._pixiId="canvas_"+nr(),u.getContext("2d").drawImage(n,0,0,i,o,0,0,a,s),e._resolve(),e._resolve=null}}},t.getSize=function(e){var n=t.SVG_SIZE.exec(e),i={};return n&&(i[n[1]]=Math.round(parseFloat(n[3])),i[n[5]]=Math.round(parseFloat(n[7]))),i},t.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},t.test=function(e,n){return n==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&t.SVG_XML.test(e)},t.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,t.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Xe),iy=function(r){bt(t,r);function t(e,n){var i=this;if(n=n||{},!(e instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var a=e[0].src||e[0];Xe.crossOrigin(o,a,n.crossorigin);for(var s=0;s<e.length;++s){var u=document.createElement("source"),h=e[s],f=h.src,l=h.mime;f=f||e[s];var c=f.split("?").shift().toLowerCase(),d=c.slice(c.lastIndexOf(".")+1);l=l||t.MIME_TYPES[d]||"video/"+d,u.src=f,u.type=l,o.appendChild(u)}e=o}return i=r.call(this,e)||this,i.noSubImage=!0,i._autoUpdate=!0,i._isConnectedToTicker=!1,i._updateFPS=n.updateFPS||0,i._msToNextUpdate=0,i.autoPlay=n.autoPlay!==!1,i._load=null,i._resolve=null,i._onCanPlay=i._onCanPlay.bind(i),i._onError=i._onError.bind(i),n.autoLoad!==!1&&i.load(),i}return t.prototype.update=function(e){if(!this.destroyed){var n=kt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-n),(!this._updateFPS||this._msToNextUpdate<=0)&&(r.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},t.prototype.load=function(){var e=this;if(this._load)return this._load;var n=this.source;return(n.readyState===n.HAVE_ENOUGH_DATA||n.readyState===n.HAVE_FUTURE_DATA)&&n.width&&n.height&&(n.complete=!0),n.addEventListener("play",this._onPlayStart.bind(this)),n.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(n.addEventListener("canplay",this._onCanPlay),n.addEventListener("canplaythrough",this._onCanPlay),n.addEventListener("error",this._onError,!0)),this._load=new Promise(function(i){e.valid?i(e):(e._resolve=i,n.load())}),this._load},t.prototype._onError=function(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)},t.prototype._isSourcePlaying=function(){var e=this.source;return!e.paused&&!e.ended&&this._isSourceReady()},t.prototype._isSourceReady=function(){var e=this.source;return e.readyState>2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(kt.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(e.videoWidth,e.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),r.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(kt.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(Xe),oy=function(r){bt(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap},t}(Xe);ra.push(wh,oy,ey,iy,ny,xn,ry,ty);var ay=function(r){bt(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,n,i){var o=e.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===se.UNPACK);var a=n.realWidth,s=n.realHeight;return i.width===a&&i.height===s?o.texSubImage2D(n.target,0,0,0,a,s,n.format,i.type,this.data):(i.width=a,i.height=s,o.texImage2D(n.target,0,i.internalFormat,a,s,0,n.format,i.type,this.data)),!0},t}(xn),oa=function(){function r(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Gt("disposeFramebuffer"),this.multisample=wt.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(t,e){return t===void 0&&(t=0),this.colorTextures[t]=e||new ut(null,{scaleMode:_e.NEAREST,resolution:1,mipmap:ae.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ut(new ay(null,{width:this.width,height:this.height}),{scaleMode:_e.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ae.OFF,format:U.DEPTH_COMPONENT,type:X.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var n=0;n<this.colorTextures.length;n++){var i=this.colorTextures[n],o=i.resolution;i.setSize(t/o,e/o)}if(this.depthTexture){var o=this.depthTexture.resolution;this.depthTexture.setSize(t/o,e/o)}}},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},r}(),Sh=function(r){bt(t,r);function t(e){e===void 0&&(e={});var n=this;if(typeof e=="number"){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];e={width:i,height:o,scaleMode:a,resolution:s}}return e.width=e.width||100,e.height=e.height||100,e.multisample=e.multisample!==void 0?e.multisample:wt.NONE,n=r.call(this,null,e)||this,n.mipmap=ae.OFF,n.valid=!0,n.clearColor=[0,0,0,0],n.framebuffer=new oa(n.realWidth,n.realHeight).addColorTexture(0,n),n.framebuffer.multisample=e.multisample,n.maskStack=[],n.filterStack=[{}],n}return t.prototype.resize=function(e,n){this.framebuffer.resize(e*this.resolution,n*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},t.prototype.dispose=function(){this.framebuffer.dispose(),r.prototype.dispose.call(this)},t.prototype.destroy=function(){r.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},t}(ut),Ah=function(){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return r.prototype.set=function(t,e,n){var i=e.width,o=e.height;if(n){var a=t.width/2/i,s=t.height/2/o,u=t.x/i+a,h=t.y/o+s;n=Pt.add(n,Pt.NW),this.x0=u+a*Pt.uX(n),this.y0=h+s*Pt.uY(n),n=Pt.add(n,2),this.x1=u+a*Pt.uX(n),this.y1=h+s*Pt.uY(n),n=Pt.add(n,2),this.x2=u+a*Pt.uX(n),this.y2=h+s*Pt.uY(n),n=Pt.add(n,2),this.x3=u+a*Pt.uX(n),this.y3=h+s*Pt.uY(n)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},r.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},r}(),Ph=new Ah;function _i(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var J=function(r){bt(t,r);function t(e,n,i,o,a,s){var u=r.call(this)||this;if(u.noFrame=!1,n||(u.noFrame=!0,n=new st(0,0,1,1)),e instanceof t&&(e=e.baseTexture),u.baseTexture=e,u._frame=n,u.trim=o,u.valid=!1,u._uvs=Ph,u.uvMatrix=null,u.orig=i||n,u._rotate=Number(a||0),a===!0)u._rotate=2;else if(u._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=s?new Et(s.x,s.y):new Et(0,0),u._updateID=0,u.textureCacheIds=[],e.valid?u.noFrame?e.valid&&u.onBaseTextureUpdated(e):u.frame=n:e.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&e.on("update",u.onBaseTextureUpdated,u),u}return t.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},t.prototype.onBaseTextureUpdated=function(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},t.prototype.destroy=function(e){if(this.baseTexture){if(e){var n=this.baseTexture.resource;n&&n.url&&Oe[n.url]&&t.removeFromCache(n.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,t.removeFromCache(this),this.textureCacheIds=null},t.prototype.clone=function(){var e=this._frame.clone(),n=this._frame===this.orig?e:this.orig.clone(),i=new t(this.baseTexture,!this.noFrame&&e,n,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(i._frame=e),i},t.prototype.updateUvs=function(){this._uvs===Ph&&(this._uvs=new Ah),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},t.from=function(e,n,i){n===void 0&&(n={}),i===void 0&&(i=G.STRICT_TEXTURE_CACHE);var o=typeof e=="string",a=null;if(o)a=e;else if(e instanceof ut){if(!e.cacheId){var s=n&&n.pixiIdPrefix||"pixiid";e.cacheId=s+"-"+nr(),ut.addToCache(e,e.cacheId)}a=e.cacheId}else{if(!e._pixiId){var s=n&&n.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+nr()}a=e._pixiId}var u=Oe[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in TextureCache.');return!u&&!(e instanceof ut)?(n.resolution||(n.resolution=li(e)),u=new t(new ut(e,n)),u.baseTexture.cacheId=a,ut.addToCache(u.baseTexture,a),t.addToCache(u,a)):!u&&e instanceof ut&&(u=new t(e),t.addToCache(u,a)),u},t.fromURL=function(e,n){var i=Object.assign({autoLoad:!1},n==null?void 0:n.resourceOptions),o=t.from(e,Object.assign({resourceOptions:i},n),!1),a=o.baseTexture.resource;return o.baseTexture.valid?Promise.resolve(o):a.load().then(function(){return Promise.resolve(o)})},t.fromBuffer=function(e,n,i,o){return new t(ut.fromBuffer(e,n,i,o))},t.fromLoader=function(e,n,i,o){var a=new ut(e,Object.assign({scaleMode:G.SCALE_MODE,resolution:li(n)},o)),s=a.resource;s instanceof wh&&(s.url=n);var u=new t(a);return i||(i=n),ut.addToCache(u.baseTexture,i),t.addToCache(u,i),i!==n&&(ut.addToCache(u.baseTexture,n),t.addToCache(u,n)),u.baseTexture.valid?Promise.resolve(u):new Promise(function(h){u.baseTexture.once("loaded",function(){return h(u)})})},t.addToCache=function(e,n){n&&(e.textureCacheIds.indexOf(n)===-1&&e.textureCacheIds.push(n),Oe[n]&&console.warn("Texture added to the cache with an id ["+n+"] that already had an entry"),Oe[n]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var n=Oe[e];if(n){var i=n.textureCacheIds.indexOf(e);return i>-1&&n.textureCacheIds.splice(i,1),delete Oe[e],n}}else if(e&&e.textureCacheIds){for(var o=0;o<e.textureCacheIds.length;++o)Oe[e.textureCacheIds[o]]===e&&delete Oe[e.textureCacheIds[o]];return e.textureCacheIds.length=0,e}return null},Object.defineProperty(t.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frame",{get:function(){return this._frame},set:function(e){this._frame=e,this.noFrame=!1;var n=e.x,i=e.y,o=e.width,a=e.height,s=n+o>this.baseTexture.width,u=i+a>this.baseTexture.height;if(s||u){var h=s&&u?"and":"or",f="X: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.width,l="Y: "+i+" + "+a+" = "+(i+a)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(f+" "+h+" "+l))}this.valid=o&&a&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new ut),_i(t._EMPTY),_i(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=G.ADAPTER.createCanvas(16,16),n=e.getContext("2d");e.width=16,e.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),t._WHITE=new t(ut.from(e)),_i(t._WHITE),_i(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(un),hr=function(r){bt(t,r);function t(e,n){var i=r.call(this,e,n)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,n,i){i===void 0&&(i=!0);var o=this.baseTexture.resolution,a=Math.round(e*o)/o,s=Math.round(n*o)/o;this.valid=a>0&&s>0,this._frame.width=this.orig.width=a,this._frame.height=this.orig.height=s,i&&this.baseTexture.resize(a,s),this.updateUvs()},t.prototype.setResolution=function(e){var n=this.baseTexture;n.resolution!==e&&(n.setResolution(e),this.resize(n.width,n.height,!1))},t.create=function(e){for(var n=arguments,i=[],o=1;o<arguments.length;o++)i[o-1]=n[o];return typeof e=="number"&&(le("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),e={width:e,height:i[0],scaleMode:i[1],resolution:i[2]}),new t(new Sh(e))},t}(J),sy=function(){function r(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return r.prototype.createTexture=function(t,e,n){n===void 0&&(n=wt.NONE);var i=new Sh(Object.assign({width:t,height:e,resolution:1,multisample:n},this.textureOptions));return new hr(i)},r.prototype.getOptimalTexture=function(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=wt.NONE);var o;t=Math.ceil(t*n-1e-6),e=Math.ceil(e*n-1e-6),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=ui(t),e=ui(e),o=((t&65535)<<16|e&65535)>>>0,i>1&&(o+=i*4294967296)):o=i>1?-i:-1,this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(t,e,i)),a.filterPoolKey=o,a.setResolution(n),a},r.prototype.getFilterTexture=function(t,e,n){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution,n||wt.NONE);return i.filterFrame=t.filterFrame,i},r.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},r.prototype.returnFilterTexture=function(t){this.returnTexture(t)},r.prototype.clear=function(t){if(t=t!==!1,t)for(var e in this.texturePool){var n=this.texturePool[e];if(n)for(var i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}},r.prototype.setScreenSize=function(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var n=this.texturePool[e];if(n)for(var i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},r.SCREEN_KEY=-1,r}(),Oh=function(){function r(t,e,n,i,o,a,s){e===void 0&&(e=0),n===void 0&&(n=!1),i===void 0&&(i=X.FLOAT),this.buffer=t,this.size=e,this.normalized=n,this.type=i,this.stride=o,this.start=a,this.instance=s}return r.prototype.destroy=function(){this.buffer=null},r.from=function(t,e,n,i,o){return new r(t,e,n,i,o)},r}(),uy=0,Dt=function(){function r(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=e,this.id=uy++,this.disposeRunner=new Gt("disposeBuffer")}return r.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(r.prototype,"index",{get:function(){return this.type===me.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?me.ELEMENT_ARRAY_BUFFER:me.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new r(t)},r}(),hy={Float32Array,Uint32Array,Int32Array,Uint8Array};function ly(r,t){for(var e=0,n=0,i={},o=0;o<r.length;o++)n+=t[o],e+=r[o].length;for(var a=new ArrayBuffer(e*4),s=null,u=0,o=0;o<r.length;o++){var h=t[o],f=r[o],l=ch(f);i[l]||(i[l]=new hy[l](a)),s=i[l];for(var c=0;c<f.length;c++){var d=(c/h|0)*n+u,p=c%h;s[d+p]=f[c]}u+=h}return new Float32Array(a)}var Rh={5126:4,5123:2,5121:1},fy=0,cy={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},En=function(){function r(t,e){t===void 0&&(t=[]),e===void 0&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=fy++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Gt("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(t,e,n,i,o,a,s,u){if(n===void 0&&(n=0),i===void 0&&(i=!1),u===void 0&&(u=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Dt||(e instanceof Array&&(e=new Float32Array(e)),e=new Dt(e));var h=t.split("|");if(h.length>1){for(var f=0;f<h.length;f++)this.addAttribute(h[f],e,n,i,o);return this}var l=this.buffers.indexOf(e);return l===-1&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new Oh(l,n,i,o,a,s,u),this.instanced=this.instanced||u,this},r.prototype.getAttribute=function(t){return this.attributes[t]},r.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},r.prototype.addIndex=function(t){return t instanceof Dt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Dt(t)),t.type=me.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.indexOf(t)===-1&&this.buffers.push(t),this},r.prototype.getIndex=function(){return this.indexBuffer},r.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var t=[],e=[],n=new Dt,i;for(i in this.attributes){var o=this.attributes[i],a=this.buffers[o.buffer];t.push(a.data),e.push(o.size*Rh[o.type]/4),o.buffer=0}for(n.data=ly(t,e),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},r.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t],n=this.buffers[e.buffer];return n.data.length/(e.stride/4||e.size)}return 0},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},r.prototype.clone=function(){for(var t=new r,e=0;e<this.buffers.length;e++)t.buffers[e]=new Dt(this.buffers[e].data.slice(0));for(var e in this.attributes){var n=this.attributes[e];t.attributes[e]=new Oh(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=me.ELEMENT_ARRAY_BUFFER),t},r.merge=function(t){for(var e=new r,n=[],i=[],o=[],a,s=0;s<t.length;s++){a=t[s];for(var u=0;u<a.buffers.length;u++)i[u]=i[u]||0,i[u]+=a.buffers[u].data.length,o[u]=0}for(var s=0;s<a.buffers.length;s++)n[s]=new cy[ch(a.buffers[s].data)](i[s]),e.buffers[s]=new Dt(n[s]);for(var s=0;s<t.length;s++){a=t[s];for(var u=0;u<a.buffers.length;u++)n[u].set(a.buffers[u].data,o[u]),o[u]+=a.buffers[u].data.length}if(e.attributes=a.attributes,a.indexBuffer){e.indexBuffer=e.buffers[a.buffers.indexOf(a.indexBuffer)],e.indexBuffer.type=me.ELEMENT_ARRAY_BUFFER;for(var h=0,f=0,l=0,c=0,s=0;s<a.buffers.length;s++)if(a.buffers[s]!==a.indexBuffer){c=s;break}for(var s in a.attributes){var d=a.attributes[s];(d.buffer|0)===c&&(f+=d.size*Rh[d.type]/4)}for(var s=0;s<t.length;s++){for(var p=t[s].indexBuffer.data,u=0;u<p.length;u++)e.indexBuffer.data[u+l]+=h;h+=t[s].buffers[c].data.length/f,l+=p.length}}return e},r}(),dy=function(r){bt(t,r);function t(){var e=r.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return t}(En),Ih=function(r){bt(t,r);function t(){var e=r.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new Dt(e.vertices),e.uvBuffer=new Dt(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return t.prototype.map=function(e,n){var i=0,o=0;return this.uvs[0]=i,this.uvs[1]=o,this.uvs[2]=i+n.width/e.width,this.uvs[3]=o,this.uvs[4]=i+n.width/e.width,this.uvs[5]=o+n.height/e.height,this.uvs[6]=i,this.uvs[7]=o+n.height/e.height,i=n.x,o=n.y,this.vertices[0]=i,this.vertices[1]=o,this.vertices[2]=i+n.width,this.vertices[3]=o,this.vertices[4]=i+n.width,this.vertices[5]=o+n.height,this.vertices[6]=i,this.vertices[7]=o+n.height,this.invalidate(),this},t.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},t}(En),py=0,lr=function(){function r(t,e,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=py++,this.static=!!e,this.ubo=!!n,t instanceof Dt?(this.buffer=t,this.buffer.type=me.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Dt(new Float32Array(1)),this.buffer.type=me.UNIFORM_BUFFER,this.autoManage=!0))}return r.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},r.prototype.add=function(t,e,n){if(!this.ubo)this.uniforms[t]=new r(e,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},r.from=function(t,e,n){return new r(t,e,n)},r.uboFrom=function(t,e){return new r(t,e??!0,!0)},r}(),vy=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=wt.NONE,this.sourceFrame=new st,this.destinationFrame=new st,this.bindingSourceFrame=new st,this.bindingDestinationFrame=new st,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),gi=[new Et,new Et,new Et,new Et],aa=new Mt,_y=function(){function r(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new sy,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new dy,this.quadUv=new Ih,this.tempRect=new st,this.activeState={},this.globalUniforms=new lr({outputFrame:new st,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return r.prototype.push=function(t,e){for(var n,i,o=this.renderer,a=this.defaultFilterStack,s=this.statePool.pop()||new vy,u=this.renderer.renderTexture,h=e[0].resolution,f=e[0].multisample,l=e[0].padding,c=e[0].autoFit,d=(n=e[0].legacy)!==null&&n!==void 0?n:!0,p=1;p<e.length;p++){var v=e[p];h=Math.min(h,v.resolution),f=Math.min(f,v.multisample),l=this.useMaxPadding?Math.max(l,v.padding):l+v.padding,c=c&&v.autoFit,d=d||((i=v.legacy)!==null&&i!==void 0?i:!0)}a.length===1&&(this.defaultFilterStack[0].renderTexture=u.current),a.push(s),s.resolution=h,s.multisample=f,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(l);var _=this.tempRect.copyFrom(u.sourceFrame);o.projection.transform&&this.transformAABB(aa.copyFrom(o.projection.transform).invert(),_),c?(s.sourceFrame.fit(_),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(_)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,u.current?u.current.resolution:o.resolution,u.sourceFrame,u.destinationFrame,o.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,f),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;var g=this.tempRect;g.x=0,g.y=0,g.width=s.sourceFrame.width,g.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(u.sourceFrame),s.bindingDestinationFrame.copyFrom(u.destinationFrame),s.transform=o.projection.transform,o.projection.transform=null,u.bind(s.renderTexture,s.sourceFrame,g),o.framebuffer.clear(0,0,0,0)},r.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),n=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var o=i.inputSize,a=i.inputPixel,s=i.inputClamp;if(o[0]=e.destinationFrame.width,o[1]=e.destinationFrame.height,o[2]=1/o[0],o[3]=1/o[1],a[0]=Math.round(o[0]*e.resolution),a[1]=Math.round(o[1]*e.resolution),a[2]=1/a[0],a[3]=1/a[1],s[0]=.5*a[2],s[1]=.5*a[3],s[2]=e.sourceFrame.width*o[2]-.5*a[2],s[3]=e.sourceFrame.height*o[3]-.5*a[3],e.legacy){var u=i.filterArea;u[0]=e.destinationFrame.width,u[1]=e.destinationFrame.height,u[2]=e.sourceFrame.x,u[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,e.renderTexture,h.renderTexture,ue.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var f=e.renderTexture,l=this.getOptimalFilterTexture(f.width,f.height,e.resolution);l.filterFrame=f.filterFrame;var c=0;for(c=0;c<n.length-1;++c){c===1&&e.multisample>1&&(l=this.getOptimalFilterTexture(f.width,f.height,e.resolution),l.filterFrame=f.filterFrame),n[c].apply(this,f,l,ue.CLEAR,e);var d=f;f=l,l=d}n[c].apply(this,f,h.renderTexture,ue.BLEND,e),c>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(f),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},r.prototype.bindAndClear=function(t,e){e===void 0&&(e=ue.CLEAR);var n=this.renderer,i=n.renderTexture,o=n.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,i.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=o.stateId&1||this.forceClear;(e===ue.CLEAR||e===ue.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,n,i){var o=this.renderer;o.state.set(t.state),this.bindAndClear(n,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(oe.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(oe.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var n=this.activeState,i=n.sourceFrame,o=n.destinationFrame,a=e._texture.orig,s=t.set(o.width,0,0,o.height,i.x,i.y),u=e.worldTransform.copyTo(Mt.TEMP_MATRIX);return u.invert(),s.prepend(u),s.scale(1/a.width,1/a.height),s.translate(e.anchor.x,e.anchor.y),s},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(t,e,n,i){return n===void 0&&(n=1),i===void 0&&(i=wt.NONE),this.texturePool.getOptimalTexture(t,e,n,i)},r.prototype.getFilterTexture=function(t,e,n){if(typeof t=="number"){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,n||wt.NONE);return o.filterFrame=t.filterFrame,o},r.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(t,e){var n=gi[0],i=gi[1],o=gi[2],a=gi[3];n.set(e.left,e.top),i.set(e.left,e.bottom),o.set(e.right,e.top),a.set(e.right,e.bottom),t.apply(n,n),t.apply(i,i),t.apply(o,o),t.apply(a,a);var s=Math.min(n.x,i.x,o.x,a.x),u=Math.min(n.y,i.y,o.y,a.y),h=Math.max(n.x,i.x,o.x,a.x),f=Math.max(n.y,i.y,o.y,a.y);e.x=s,e.y=u,e.width=h-s,e.height=f-u},r.prototype.roundFrame=function(t,e,n,i,o){if(!(t.width<=0||t.height<=0||n.width<=0||n.height<=0)){if(o){var a=o.a,s=o.b,u=o.c,h=o.d;if((Math.abs(s)>1e-4||Math.abs(u)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(h)>1e-4))return}o=o?aa.copyFrom(o):aa.identity(),o.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(o,t),t.ceil(e),this.transformAABB(o.invert(),t)}},r}(),mi=function(){function r(t){this.renderer=t}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(t){},r}(),gy=function(){function r(t){this.renderer=t,this.emptyRenderer=new mi(t),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(t,e){for(var n=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=n[i]||null,t[i]&&(t[i]._batchLocation=i)},r.prototype.boundArray=function(t,e,n,i){for(var o=t.elements,a=t.ids,s=t.count,u=0,h=0;h<s;h++){var f=o[h],l=f._batchLocation;if(l>=0&&l<i&&e[l]===f){a[h]=l;continue}for(;u<i;){var c=e[u];if(c&&c._batchEnabled===n&&c._batchLocation===u){u++;continue}a[h]=u,f._batchLocation=u,e[u]=f;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),Ch=0,my=function(){function r(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(r.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),r.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Ch++},r.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Ch++,this.renderer.runners.contextChange.emit(t)},r.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},r.prototype.createContext=function(t,e){var n;if(G.PREFER_ENV>=Se.WEBGL2&&(n=t.getContext("webgl2",e)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout(function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(t){var e=t.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=n||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),yy=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=wt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),by=new st,xy=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new oa(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new st,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var e=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;G.PREFER_ENV===Se.WEBGL_LEGACY&&(e=null,n=null),e?t.drawBuffers=function(i){return e.drawBuffersWEBGL(i)}:(this.hasMRT=!1,t.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},r.prototype.bind=function(t,e,n){n===void 0&&(n=0);var i=this.gl;if(t){var o=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,o.framebuffer)),o.mipLevel!==n&&(t.dirtyId++,t.dirtyFormat++,o.mipLevel=n),o.dirtyId!==t.dirtyId&&(o.dirtyId=t.dirtyId,o.dirtyFormat!==t.dirtyFormat?(o.dirtyFormat=t.dirtyFormat,o.dirtySize=t.dirtySize,this.updateFramebuffer(t,n)):o.dirtySize!==t.dirtySize&&(o.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var a=0;a<t.colorTextures.length;a++){var s=t.colorTextures[a];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var u=e.width>>n,h=e.height>>n,f=u/e.width;this.setViewport(e.x*f,e.y*f,u,h)}else{var u=t.width>>n,h=t.height>>n;this.setViewport(0,0,u,h)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(t,e,n,i){var o=this.viewport;t=Math.round(t),e=Math.round(e),n=Math.round(n),i=Math.round(i),(o.width!==n||o.height!==i||o.x!==t||o.y!==e)&&(o.x=t,o.y=e,o.width=n,o.height=i,this.gl.viewport(t,e,n,i))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(t,e,n,i,o){o===void 0&&(o=jn.COLOR|jn.DEPTH);var a=this.gl;a.clearColor(t,e,n,i),a.clear(o)},r.prototype.initFramebuffer=function(t){var e=this.gl,n=new yy(e.createFramebuffer());return n.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(t),t.disposeRunner.add(this),n},r.prototype.resizeFramebuffer=function(t){var e=this.gl,n=t.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,n.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,n.multisample,e.RGBA8,t.width,t.height)),n.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,n.stencil),n.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,n.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,o=i.length;e.drawBuffers||(o=Math.min(o,1));for(var a=0;a<o;a++){var s=i[a],u=s.parentTextureArray||s;this.renderer.texture.bind(u,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},r.prototype.updateFramebuffer=function(t,e){var n=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],o=t.colorTextures,a=o.length;n.drawBuffers||(a=Math.min(a,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.RGBA8,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var s=[],u=0;u<a;u++){var h=o[u],f=h.parentTextureArray||h;this.renderer.texture.bind(f,0),!(u===0&&i.msaaBuffer)&&(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+u,h.target,f._glTextures[this.CONTEXT_UID].texture,e),s.push(n.COLOR_ATTACHMENT0+u))}if(s.length>1&&n.drawBuffers(s),t.depthTexture){var l=this.writeDepthTexture;if(l){var c=t.depthTexture;this.renderer.texture.bind(c,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,e)}}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t.width,t.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)},r.prototype.canMultisampleFramebuffer=function(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture},r.prototype.detectSamples=function(t){var e=this.msaaSamples,n=wt.NONE;if(t<=1||e===null)return n;for(var i=0;i<e.length;i++)if(e[i]<=t){n=e[i];break}return n===1&&(n=wt.NONE),n},r.prototype.blit=function(t,e,n){var i=this,o=i.current,a=i.renderer,s=i.gl,u=i.CONTEXT_UID;if(a.context.webGLVersion===2&&o){var h=o.glFramebuffers[u];if(h){if(!t){if(!h.msaaBuffer)return;var f=o.colorTextures[0];if(!f)return;h.blitFramebuffer||(h.blitFramebuffer=new oa(o.width,o.height),h.blitFramebuffer.addColorTexture(0,f)),t=h.blitFramebuffer,t.colorTextures[0]!==f&&(t.colorTextures[0]=f,t.dirtyId++,t.dirtyFormat++),(t.width!==o.width||t.height!==o.height)&&(t.width=o.width,t.height=o.height,t.dirtyId++,t.dirtySize++)}e||(e=by,e.width=o.width,e.height=o.height),n||(n=e);var l=e.width===n.width&&e.height===n.height;this.bind(t),s.bindFramebuffer(s.READ_FRAMEBUFFER,h.framebuffer),s.blitFramebuffer(e.left,e.top,e.right,e.bottom,n.left,n.top,n.right,n.bottom,s.COLOR_BUFFER_BIT,l?s.NEAREST:s.LINEAR)}}},r.prototype.disposeFramebuffer=function(t,e){var n=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(n){delete t.glFramebuffers[this.CONTEXT_UID];var o=this.managedFramebuffers.indexOf(t);o>=0&&this.managedFramebuffers.splice(o,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n<e.length;n++)this.disposeFramebuffer(e[n],t)},r.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(!(!e||e.stencil)){t.stencil=!0;var n=t.width,i=t.height,o=this.gl,a=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,a),e.msaaBuffer?o.renderbufferStorageMultisample(o.RENDERBUFFER,e.multisample,o.DEPTH24_STENCIL8,n,i):o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,n,i),e.stencil=a,o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,a)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new st},r.prototype.destroy=function(){this.renderer=null},r}(),sa={5126:4,5123:2,5121:1},Ey=function(){function r(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,e.webGLVersion!==2){var n=this.renderer.context.extensions.vertexArrayObject;G.PREFER_ENV===Se.WEBGL_LEGACY&&(n=null),n?(t.createVertexArray=function(){return n.createVertexArrayOES()},t.bindVertexArray=function(o){return n.bindVertexArrayOES(o)},t.deleteVertexArray=function(o){return n.deleteVertexArrayOES(o)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(e.webGLVersion!==2){var i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=function(o,a){return i.vertexAttribDivisorANGLE(o,a)},t.drawElementsInstanced=function(o,a,s,u,h){return i.drawElementsInstancedANGLE(o,a,s,u,h)},t.drawArraysInstanced=function(o,a,s,u){return i.drawArraysInstancedANGLE(o,a,s,u)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex},r.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var n=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID],o=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},o=!0);var a=i[e.program.id]||this.initGeometryVao(t,e,o);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?n.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()},r.prototype.reset=function(){this.unbind()},r.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,n=0;n<t.buffers.length;n++){var i=t.buffers[n];e.update(i)}},r.prototype.checkCompatibility=function(t,e){var n=t.attributes,i=e.attributeData;for(var o in i)if(!n[o])throw new Error('shader and geometry incompatible, geometry missing the "'+o+'" attribute')},r.prototype.getSignature=function(t,e){var n=t.attributes,i=e.attributeData,o=["g",t.id];for(var a in n)i[a]&&o.push(a,i[a].location);return o.join("-")},r.prototype.initGeometryVao=function(t,e,n){n===void 0&&(n=!0);var i=this.gl,o=this.CONTEXT_UID,a=this.renderer.buffer,s=e.program;s.glPrograms[o]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var u=this.getSignature(t,s),h=t.glVertexArrayObjects[this.CONTEXT_UID],f=h[u];if(f)return h[s.id]=f,f;var l=t.buffers,c=t.attributes,d={},p={};for(var v in l)d[v]=0,p[v]=0;for(var v in c)!c[v].size&&s.attributeData[v]?c[v].size=s.attributeData[v].size:c[v].size||console.warn("PIXI Geometry attribute '"+v+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[v].buffer]+=c[v].size*sa[c[v].type];for(var v in c){var _=c[v],g=_.size;_.stride===void 0&&(d[_.buffer]===g*sa[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=p[_.buffer],p[_.buffer]+=g*sa[_.type])}f=i.createVertexArray(),i.bindVertexArray(f);for(var m=0;m<l.length;m++){var y=l[m];a.bind(y),n&&y._glBuffers[o].refCount++}return this.activateVao(t,s),this._activeVao=f,h[s.id]=f,h[u]=f,f},r.prototype.disposeGeometry=function(t,e){var n;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],o=this.gl,a=t.buffers,s=(n=this.renderer)===null||n===void 0?void 0:n.buffer;if(t.disposeRunner.remove(this),!!i){if(s)for(var u=0;u<a.length;u++){var h=a[u]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!e&&s.dispose(a[u],e))}if(!e){for(var f in i)if(f[0]==="g"){var l=i[f];this._activeVao===l&&this.unbind(),o.deleteVertexArray(l)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),n=0;n<e.length;n++)this.disposeGeometry(this.managedGeometries[e[n]],t)},r.prototype.activateVao=function(t,e){var n=this.gl,i=this.CONTEXT_UID,o=this.renderer.buffer,a=t.buffers,s=t.attributes;t.indexBuffer&&o.bind(t.indexBuffer);var u=null;for(var h in s){var f=s[h],l=a[f.buffer],c=l._glBuffers[i];if(e.attributeData[h]){u!==c&&(o.bind(l),u=c);var d=e.attributeData[h].location;if(n.enableVertexAttribArray(d),n.vertexAttribPointer(d,f.size,f.type||n.FLOAT,f.normalized,f.stride,f.start),f.instance)if(this.hasInstance)n.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},r.prototype.draw=function(t,e,n,i){var o=this.gl,a=this._activeGeometry;if(a.indexBuffer){var s=a.indexBuffer.data.BYTES_PER_ELEMENT,u=s===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;s===2||s===4&&this.canUseUInt32ElementIndex?a.instanced?o.drawElementsInstanced(t,e||a.indexBuffer.data.length,u,(n||0)*s,i||1):o.drawElements(t,e||a.indexBuffer.data.length,u,(n||0)*s):console.warn("unsupported index buffer type: uint32")}else a.instanced?o.drawArraysInstanced(t,n,e||a.getSize(),i||1):o.drawArrays(t,n,e||a.getSize());return this},r.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},r.prototype.destroy=function(){this.renderer=null},r}(),Ty=function(){function r(t){t===void 0&&(t=null),this.type=Ct.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=G.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(r.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=Ct.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},r.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},r}();function Mh(r,t,e){var n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}function Dh(r,t){var e=r.getShaderSource(t).split(`
117
+ `).map(function(h,f){return f+": "+h}),n=r.getShaderInfoLog(t),i=n.split(`
118
+ `),o={},a=i.map(function(h){return parseFloat(h.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(h){return h&&!o[h]?(o[h]=!0,!0):!1}),s=[""];a.forEach(function(h){e[h-1]="%c"+e[h-1]+"%c",s.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var u=e.join(`
119
+ `);s[0]=u,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,s),console.groupEnd()}function wy(r,t,e,n){r.getProgramParameter(t,r.LINK_STATUS)||(r.getShaderParameter(e,r.COMPILE_STATUS)||Dh(r,e),r.getShaderParameter(n,r.COMPILE_STATUS)||Dh(r,n),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(t)))}function ua(r){for(var t=new Array(r),e=0;e<t.length;e++)t[e]=!1;return t}function Fh(r,t){switch(r){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return ua(2*t);case"bvec3":return ua(3*t);case"bvec4":return ua(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Bh={},Tn=Bh;function Sy(){if(Tn===Bh||Tn&&Tn.isContextLost()){var r=G.ADAPTER.createCanvas(),t=void 0;G.PREFER_ENV>=Se.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Tn=t}return Tn}var yi;function Ay(){if(!yi){yi=Qt.MEDIUM;var r=Sy();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);yi=t.precision?Qt.HIGH:Qt.MEDIUM}}return yi}function Nh(r,t,e){if(r.substring(0,9)!=="precision"){var n=t;return t===Qt.HIGH&&e!==Qt.HIGH&&(n=Qt.MEDIUM),"precision "+n+` float;
120
+ `+r}else if(e!==Qt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var Py={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Lh(r){return Py[r]}var bi=null,Uh={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Gh(r,t){if(!bi){var e=Object.keys(Uh);bi={};for(var n=0;n<e.length;++n){var i=e[n];bi[r[i]]=Uh[i]}}return bi[t]}var jr=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
121
+ if(uv["`+r+'"] !== ud["'+r+`"].value)
122
+ {
123
+ ud["`+r+'"].value = uv["'+r+`"]
124
+ gl.uniform1f(ud["`+r+'"].location, uv["'+r+`"])
125
+ }
126
+ `}},{test:function(r,t){return(r.type==="sampler2D"||r.type==="samplerCube"||r.type==="sampler2DArray")&&r.size===1&&!r.isArray&&(t==null||t.castToBaseTexture!==void 0)},code:function(r){return`t = syncData.textureCount++;
127
+
128
+ renderer.texture.bind(uv["`+r+`"], t);
129
+
130
+ if(ud["`+r+`"].value !== t)
131
+ {
132
+ ud["`+r+`"].value = t;
133
+ gl.uniform1i(ud["`+r+`"].location, t);
134
+ ; // eslint-disable-line max-len
135
+ }`}},{test:function(r,t){return r.type==="mat3"&&r.size===1&&!r.isArray&&t.a!==void 0},code:function(r){return`
136
+ gl.uniformMatrix3fv(ud["`+r+'"].location, false, uv["'+r+`"].toArray(true));
137
+ `},codeUbo:function(r){return`
138
+ var `+r+"_matrix = uv."+r+`.toArray(true);
139
+
140
+ data[offset] = `+r+`_matrix[0];
141
+ data[offset+1] = `+r+`_matrix[1];
142
+ data[offset+2] = `+r+`_matrix[2];
143
+
144
+ data[offset + 4] = `+r+`_matrix[3];
145
+ data[offset + 5] = `+r+`_matrix[4];
146
+ data[offset + 6] = `+r+`_matrix[5];
147
+
148
+ data[offset + 8] = `+r+`_matrix[6];
149
+ data[offset + 9] = `+r+`_matrix[7];
150
+ data[offset + 10] = `+r+`_matrix[8];
151
+ `}},{test:function(r,t){return r.type==="vec2"&&r.size===1&&!r.isArray&&t.x!==void 0},code:function(r){return`
152
+ cv = ud["`+r+`"].value;
153
+ v = uv["`+r+`"];
154
+
155
+ if(cv[0] !== v.x || cv[1] !== v.y)
156
+ {
157
+ cv[0] = v.x;
158
+ cv[1] = v.y;
159
+ gl.uniform2f(ud["`+r+`"].location, v.x, v.y);
160
+ }`},codeUbo:function(r){return`
161
+ v = uv.`+r+`;
162
+
163
+ data[offset] = v.x;
164
+ data[offset+1] = v.y;
165
+ `}},{test:function(r){return r.type==="vec2"&&r.size===1&&!r.isArray},code:function(r){return`
166
+ cv = ud["`+r+`"].value;
167
+ v = uv["`+r+`"];
168
+
169
+ if(cv[0] !== v[0] || cv[1] !== v[1])
170
+ {
171
+ cv[0] = v[0];
172
+ cv[1] = v[1];
173
+ gl.uniform2f(ud["`+r+`"].location, v[0], v[1]);
174
+ }
175
+ `}},{test:function(r,t){return r.type==="vec4"&&r.size===1&&!r.isArray&&t.width!==void 0},code:function(r){return`
176
+ cv = ud["`+r+`"].value;
177
+ v = uv["`+r+`"];
178
+
179
+ if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
180
+ {
181
+ cv[0] = v.x;
182
+ cv[1] = v.y;
183
+ cv[2] = v.width;
184
+ cv[3] = v.height;
185
+ gl.uniform4f(ud["`+r+`"].location, v.x, v.y, v.width, v.height)
186
+ }`},codeUbo:function(r){return`
187
+ v = uv.`+r+`;
188
+
189
+ data[offset] = v.x;
190
+ data[offset+1] = v.y;
191
+ data[offset+2] = v.width;
192
+ data[offset+3] = v.height;
193
+ `}},{test:function(r){return r.type==="vec4"&&r.size===1&&!r.isArray},code:function(r){return`
194
+ cv = ud["`+r+`"].value;
195
+ v = uv["`+r+`"];
196
+
197
+ if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
198
+ {
199
+ cv[0] = v[0];
200
+ cv[1] = v[1];
201
+ cv[2] = v[2];
202
+ cv[3] = v[3];
203
+
204
+ gl.uniform4f(ud["`+r+`"].location, v[0], v[1], v[2], v[3])
205
+ }`}}],Oy={float:`
206
+ if (cv !== v)
207
+ {
208
+ cu.value = v;
209
+ gl.uniform1f(location, v);
210
+ }`,vec2:`
211
+ if (cv[0] !== v[0] || cv[1] !== v[1])
212
+ {
213
+ cv[0] = v[0];
214
+ cv[1] = v[1];
215
+
216
+ gl.uniform2f(location, v[0], v[1])
217
+ }`,vec3:`
218
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
219
+ {
220
+ cv[0] = v[0];
221
+ cv[1] = v[1];
222
+ cv[2] = v[2];
223
+
224
+ gl.uniform3f(location, v[0], v[1], v[2])
225
+ }`,vec4:`
226
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
227
+ {
228
+ cv[0] = v[0];
229
+ cv[1] = v[1];
230
+ cv[2] = v[2];
231
+ cv[3] = v[3];
232
+
233
+ gl.uniform4f(location, v[0], v[1], v[2], v[3]);
234
+ }`,int:`
235
+ if (cv !== v)
236
+ {
237
+ cu.value = v;
238
+
239
+ gl.uniform1i(location, v);
240
+ }`,ivec2:`
241
+ if (cv[0] !== v[0] || cv[1] !== v[1])
242
+ {
243
+ cv[0] = v[0];
244
+ cv[1] = v[1];
245
+
246
+ gl.uniform2i(location, v[0], v[1]);
247
+ }`,ivec3:`
248
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
249
+ {
250
+ cv[0] = v[0];
251
+ cv[1] = v[1];
252
+ cv[2] = v[2];
253
+
254
+ gl.uniform3i(location, v[0], v[1], v[2]);
255
+ }`,ivec4:`
256
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
257
+ {
258
+ cv[0] = v[0];
259
+ cv[1] = v[1];
260
+ cv[2] = v[2];
261
+ cv[3] = v[3];
262
+
263
+ gl.uniform4i(location, v[0], v[1], v[2], v[3]);
264
+ }`,uint:`
265
+ if (cv !== v)
266
+ {
267
+ cu.value = v;
268
+
269
+ gl.uniform1ui(location, v);
270
+ }`,uvec2:`
271
+ if (cv[0] !== v[0] || cv[1] !== v[1])
272
+ {
273
+ cv[0] = v[0];
274
+ cv[1] = v[1];
275
+
276
+ gl.uniform2ui(location, v[0], v[1]);
277
+ }`,uvec3:`
278
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
279
+ {
280
+ cv[0] = v[0];
281
+ cv[1] = v[1];
282
+ cv[2] = v[2];
283
+
284
+ gl.uniform3ui(location, v[0], v[1], v[2]);
285
+ }`,uvec4:`
286
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
287
+ {
288
+ cv[0] = v[0];
289
+ cv[1] = v[1];
290
+ cv[2] = v[2];
291
+ cv[3] = v[3];
292
+
293
+ gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
294
+ }`,bool:`
295
+ if (cv !== v)
296
+ {
297
+ cu.value = v;
298
+ gl.uniform1i(location, v);
299
+ }`,bvec2:`
300
+ if (cv[0] != v[0] || cv[1] != v[1])
301
+ {
302
+ cv[0] = v[0];
303
+ cv[1] = v[1];
304
+
305
+ gl.uniform2i(location, v[0], v[1]);
306
+ }`,bvec3:`
307
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
308
+ {
309
+ cv[0] = v[0];
310
+ cv[1] = v[1];
311
+ cv[2] = v[2];
312
+
313
+ gl.uniform3i(location, v[0], v[1], v[2]);
314
+ }`,bvec4:`
315
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
316
+ {
317
+ cv[0] = v[0];
318
+ cv[1] = v[1];
319
+ cv[2] = v[2];
320
+ cv[3] = v[3];
321
+
322
+ gl.uniform4i(location, v[0], v[1], v[2], v[3]);
323
+ }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
324
+ if (cv !== v)
325
+ {
326
+ cu.value = v;
327
+
328
+ gl.uniform1i(location, v);
329
+ }`,samplerCube:`
330
+ if (cv !== v)
331
+ {
332
+ cu.value = v;
333
+
334
+ gl.uniform1i(location, v);
335
+ }`,sampler2DArray:`
336
+ if (cv !== v)
337
+ {
338
+ cu.value = v;
339
+
340
+ gl.uniform1i(location, v);
341
+ }`},Ry={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function Iy(r,t){var e,n=[`
342
+ var v = null;
343
+ var cv = null;
344
+ var cu = null;
345
+ var t = 0;
346
+ var gl = renderer.gl;
347
+ `];for(var i in r.uniforms){var o=t[i];if(!o){!((e=r.uniforms[i])===null||e===void 0)&&e.group&&(r.uniforms[i].ubo?n.push(`
348
+ renderer.shader.syncUniformBufferGroup(uv.`+i+", '"+i+`');
349
+ `):n.push(`
350
+ renderer.shader.syncUniformGroup(uv.`+i+`, syncData);
351
+ `));continue}for(var a=r.uniforms[i],s=!1,u=0;u<jr.length;u++)if(jr[u].test(o,a)){n.push(jr[u].code(i,a)),s=!0;break}if(!s){var h=o.size===1&&!o.isArray?Oy:Ry,f=h[o.type].replace("location",'ud["'+i+'"].location');n.push(`
352
+ cu = ud["`+i+`"];
353
+ cv = cu.value;
354
+ v = uv["`+i+`"];
355
+ `+f+";")}}return new Function("ud","uv","renderer","syncData",n.join(`
356
+ `))}var Cy=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
357
+ `);function My(r){for(var t="",e=0;e<r;++e)e>0&&(t+=`
358
+ else `),e<r-1&&(t+="if(test == "+e+".0){}");return t}function Dy(r,t){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var e=t.createShader(t.FRAGMENT_SHADER);;){var n=Cy.replace(/%forloop%/gi,My(r));if(t.shaderSource(e,n),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))r=r/2|0;else break}return r}var wn;function Fy(){if(typeof wn=="boolean")return wn;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");wn=r({a:"b"},"a","b")===!0}catch{wn=!1}return wn}var By=`varying vec2 vTextureCoord;
359
+
360
+ uniform sampler2D uSampler;
361
+
362
+ void main(void){
363
+ gl_FragColor *= texture2D(uSampler, vTextureCoord);
364
+ }`,Ny=`attribute vec2 aVertexPosition;
365
+ attribute vec2 aTextureCoord;
366
+
367
+ uniform mat3 projectionMatrix;
368
+
369
+ varying vec2 vTextureCoord;
370
+
371
+ void main(void){
372
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
373
+ vTextureCoord = aTextureCoord;
374
+ }
375
+ `,Ly=0,xi={},Sn=function(){function r(t,e,n){n===void 0&&(n="pixi-shader"),this.id=Ly++,this.vertexSrc=t||r.defaultVertexSrc,this.fragmentSrc=e||r.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(n=n.replace(/\s+/g,"-"),xi[n]?(xi[n]++,n+="-"+xi[n]):xi[n]=1,this.vertexSrc="#define SHADER_NAME "+n+`
376
+ `+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+n+`
377
+ `+this.fragmentSrc,this.vertexSrc=Nh(this.vertexSrc,G.PRECISION_VERTEX,Qt.HIGH),this.fragmentSrc=Nh(this.fragmentSrc,G.PRECISION_FRAGMENT,Ay())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return Ny},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return By},enumerable:!1,configurable:!0}),r.from=function(t,e,n){var i=t+e,o=_h[i];return o||(_h[i]=o=new r(t,e,n)),o},r}(),je=function(){function r(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof lr?this.uniformGroup=e:this.uniformGroup=new lr(e):this.uniformGroup=new lr({}),this.disposeRunner=new Gt("disposeShader")}return r.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var n in e.uniforms){var i=e.uniforms[n];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},r.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),r.from=function(t,e,n){var i=Sn.from(t,e);return new r(i,n)},r}(),ha=0,la=1,fa=2,ca=3,da=4,pa=5,fr=function(){function r(){this.data=0,this.blendMode=j.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<ha)},set:function(t){!!(this.data&1<<ha)!==t&&(this.data^=1<<ha)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<la)},set:function(t){!!(this.data&1<<la)!==t&&(this.data^=1<<la)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<fa)},set:function(t){!!(this.data&1<<fa)!==t&&(this.data^=1<<fa)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<ca)},set:function(t){!!(this.data&1<<ca)!==t&&(this.data^=1<<ca)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<pa)},set:function(t){!!(this.data&1<<pa)!==t&&(this.data^=1<<pa)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<da)},set:function(t){!!(this.data&1<<da)!==t&&(this.data^=1<<da)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==j.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},r.for2d=function(){var t=new r;return t.depthTest=!1,t.blend=!0,t},r}(),Uy=`varying vec2 vTextureCoord;
378
+
379
+ uniform sampler2D uSampler;
380
+
381
+ void main(void){
382
+ gl_FragColor = texture2D(uSampler, vTextureCoord);
383
+ }
384
+ `,Gy=`attribute vec2 aVertexPosition;
385
+
386
+ uniform mat3 projectionMatrix;
387
+
388
+ varying vec2 vTextureCoord;
389
+
390
+ uniform vec4 inputSize;
391
+ uniform vec4 outputFrame;
392
+
393
+ vec4 filterVertexPosition( void )
394
+ {
395
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
396
+
397
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
398
+ }
399
+
400
+ vec2 filterTextureCoord( void )
401
+ {
402
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
403
+ }
404
+
405
+ void main(void)
406
+ {
407
+ gl_Position = filterVertexPosition();
408
+ vTextureCoord = filterTextureCoord();
409
+ }
410
+ `,Ye=function(r){bt(t,r);function t(e,n,i){var o=this,a=Sn.from(e||t.defaultVertexSrc,n||t.defaultFragmentSrc);return o=r.call(this,a,i)||this,o.padding=0,o.resolution=G.FILTER_RESOLUTION,o.multisample=G.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new fr,o}return t.prototype.apply=function(e,n,i,o,a){e.applyFilter(this,n,i,o)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return Gy},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return Uy},enumerable:!1,configurable:!0}),t}(je),ky=`attribute vec2 aVertexPosition;
411
+ attribute vec2 aTextureCoord;
412
+
413
+ uniform mat3 projectionMatrix;
414
+ uniform mat3 otherMatrix;
415
+
416
+ varying vec2 vMaskCoord;
417
+ varying vec2 vTextureCoord;
418
+
419
+ void main(void)
420
+ {
421
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
422
+
423
+ vTextureCoord = aTextureCoord;
424
+ vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
425
+ }
426
+ `,Hy=`varying vec2 vMaskCoord;
427
+ varying vec2 vTextureCoord;
428
+
429
+ uniform sampler2D uSampler;
430
+ uniform sampler2D mask;
431
+ uniform float alpha;
432
+ uniform float npmAlpha;
433
+ uniform vec4 maskClamp;
434
+
435
+ void main(void)
436
+ {
437
+ float clip = step(3.5,
438
+ step(maskClamp.x, vMaskCoord.x) +
439
+ step(maskClamp.y, vMaskCoord.y) +
440
+ step(vMaskCoord.x, maskClamp.z) +
441
+ step(vMaskCoord.y, maskClamp.w));
442
+
443
+ vec4 original = texture2D(uSampler, vTextureCoord);
444
+ vec4 masky = texture2D(mask, vMaskCoord);
445
+ float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
446
+
447
+ original *= (alphaMul * masky.r * alpha * clip);
448
+
449
+ gl_FragColor = original;
450
+ }
451
+ `,kh=new Mt,va=function(){function r(t,e){this._texture=t,this.mapCoord=new Mt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(t,e){e===void 0&&(e=t);for(var n=this.mapCoord,i=0;i<t.length;i+=2){var o=t[i],a=t[i+1];e[i]=o*n.a+a*n.c+n.tx,e[i+1]=o*n.b+a*n.d+n.ty}return e},r.prototype.update=function(t){var e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var n=e._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);var i=e.orig,o=e.trim;o&&(kh.set(i.width/o.width,0,0,i.height/o.height,-o.x/o.width,-o.y/o.height),this.mapCoord.append(kh));var a=e.baseTexture,s=this.uClampFrame,u=this.clampMargin/a.resolution,h=this.clampOffset;return s[0]=(e._frame.x+u+h)/a.width,s[1]=(e._frame.y+u+h)/a.height,s[2]=(e._frame.x+e._frame.width-u+h)/a.width,s[3]=(e._frame.y+e._frame.height-u+h)/a.height,this.uClampOffset[0]=h/a.realWidth,this.uClampOffset[1]=h/a.realHeight,this.isSimple=e._frame.width===a.width&&e._frame.height===a.height&&e.rotate===0,!0},r}(),Xy=function(r){bt(t,r);function t(e,n,i){var o=this,a=null;return typeof e!="string"&&n===void 0&&i===void 0&&(a=e,e=void 0,n=void 0,i=void 0),o=r.call(this,e||ky,n||Hy,i)||this,o.maskSprite=a,o.maskMatrix=new Mt,o}return Object.defineProperty(t.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),t.prototype.apply=function(e,n,i,o){var a=this._maskSprite,s=a._texture;s.valid&&(s.uvMatrix||(s.uvMatrix=new va(s,0)),s.uvMatrix.update(),this.uniforms.npmAlpha=s.baseTexture.alphaMode?0:1,this.uniforms.mask=s,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,a).prepend(s.uvMatrix.mapCoord),this.uniforms.alpha=a.worldAlpha,this.uniforms.maskClamp=s.uvMatrix.uClampFrame,e.applyFilter(this,n,i,o))},t}(Ye),jy=function(){function r(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return r.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},r.prototype.push=function(t,e){var n=e;if(!n.isMaskData){var i=this.maskDataPool.pop()||new Ty;i.pooled=!0,i.maskObject=e,n=i}var o=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(o),n._colorMask=o?o._colorMask:15,n.autoDetect&&this.detect(n),n._target=t,n.type!==Ct.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ct.SCISSOR:this.renderer.scissor.push(n);break;case Ct.STENCIL:this.renderer.stencil.push(n);break;case Ct.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ct.COLOR:this.pushColorMask(n);break}n.type===Ct.SPRITE&&this.maskStack.push(n)},r.prototype.pop=function(t){var e=this.maskStack.pop();if(!(!e||e._target!==t)){if(e.enabled)switch(e.type){case Ct.SCISSOR:this.renderer.scissor.pop(e);break;case Ct.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case Ct.SPRITE:this.popSpriteMask(e);break;case Ct.COLOR:this.popColorMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){var n=this.maskStack[this.maskStack.length-1];n.type===Ct.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}},r.prototype.detect=function(t){var e=t.maskObject;e?e.isSprite?t.type=Ct.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Ct.SCISSOR:t.type=Ct.STENCIL:t.type=Ct.COLOR},r.prototype.pushSpriteMask=function(t){var e,n,i=t.maskObject,o=t._target,a=t._filters;a||(a=this.alphaMaskPool[this.alphaMaskIndex],a||(a=this.alphaMaskPool[this.alphaMaskIndex]=[new Xy]));var s=this.renderer,u=s.renderTexture,h,f;if(u.current){var l=u.current;h=t.resolution||l.resolution,f=(e=t.multisample)!==null&&e!==void 0?e:l.multisample}else h=t.resolution||s.resolution,f=(n=t.multisample)!==null&&n!==void 0?n:s.multisample;a[0].resolution=h,a[0].multisample=f,a[0].maskSprite=i;var c=o.filterArea;o.filterArea=i.getBounds(!0),s.filter.push(o,a),o.filterArea=c,t._filters||this.alphaMaskIndex++},r.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},r.prototype.pushColorMask=function(t){var e=t._colorMask,n=t._colorMask=e&t.colorMask;n!==e&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.popColorMask=function(t){var e=t._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==e&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),Hh=function(){function r(t){this.renderer=t,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(t){var e=this.renderer.gl,n=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==n&&(i===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),Xh=new Mt,jh=[],Yy=function(r){bt(t,r);function t(e){var n=r.call(this,e)||this;return n.glConst=G.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var n;if(!e._scissorRectLocal){var i=e._scissorRect,o=e.maskObject,a=this.renderer,s=a.renderTexture,u=o.getBounds(!0,(n=jh.pop())!==null&&n!==void 0?n:new st);this.roundFrameToPixels(u,s.current?s.current.resolution:a.resolution,s.sourceFrame,s.destinationFrame,a.projection.transform),i&&u.fit(i),e._scissorRectLocal=u}},t.isMatrixRotated=function(e){if(!e)return!1;var n=e.a,i=e.b,o=e.c,a=e.d;return(Math.abs(i)>1e-4||Math.abs(o)>1e-4)&&(Math.abs(n)>1e-4||Math.abs(a)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect()||t.isMatrixRotated(n.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var i=e._scissorRectLocal;return i.width>0&&i.height>0},t.prototype.roundFrameToPixels=function(e,n,i,o,a){t.isMatrixRotated(a)||(a=a?Xh.copyFrom(a):Xh.identity(),a.translate(-i.x,-i.y).scale(o.width/i.width,o.height/i.height).translate(o.x,o.y),this.renderer.filter.transformAABB(a,e),e.fit(o),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var n=this.renderer.gl;e._scissorRect||n.enable(n.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var n=this.renderer.gl;e&&jh.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():n.disable(n.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,n;this.renderer.renderTexture.current?n=e.y:n=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,n,e.width,e.height)},t}(Hh),Vy=function(r){bt(t,r);function t(e){var n=r.call(this,e)||this;return n.glConst=G.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var n=e.maskObject,i=this.renderer.gl,o=e._stencilCounter;o===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;var a=e._colorMask;a!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,o,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),n.renderable=!0,n.render(this.renderer),this.renderer.batch.flush(),n.renderable=!1,a!==0&&(e._colorMask=a,i.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()},t.prototype.pop=function(e){var n=this.renderer.gl;if(this.getStackLength()===0)n.disable(n.STENCIL_TEST);else{var i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,o=i?i._colorMask:15;o!==0&&(i._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilOp(n.KEEP,n.KEEP,n.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,o!==0&&(i._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Hh),zy=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Mt,this.transform=null}return r.prototype.update=function(t,e,n,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);var o=this.renderer;o.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,o.globalUniforms.update(),o.shader.shader&&o.shader.syncUniformGroup(o.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,n,i){var o=this.projectionMatrix,a=i?-1:1;o.identity(),o.a=1/e.width*2,o.d=a*(1/e.height*2),o.tx=-1-e.x*o.a,o.ty=-a-e.y*o.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),cr=new st,An=new st,Wy=function(){function r(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new st,this.destinationFrame=new st,this.viewportFrame=new st}return r.prototype.bind=function(t,e,n){t===void 0&&(t=null);var i=this.renderer;this.current=t;var o,a,s;t?(o=t.baseTexture,s=o.resolution,e||(cr.width=t.frame.width,cr.height=t.frame.height,e=cr),n||(An.x=t.frame.x,An.y=t.frame.y,An.width=e.width,An.height=e.height,n=An),a=o.framebuffer):(s=i.resolution,e||(cr.width=i.screen.width,cr.height=i.screen.height,e=cr),n||(n=cr,n.width=e.width,n.height=e.height));var u=this.viewportFrame;u.x=n.x*s,u.y=n.y*s,u.width=n.width*s,u.height=n.height*s,t||(u.y=i.view.height-(u.y+u.height)),u.ceil(),this.renderer.framebuffer.bind(a,u),this.renderer.projection.update(n,e,s,!a),t?this.renderer.mask.setMaskStack(o.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(n)},r.prototype.clear=function(t,e){this.current?t=t||this.current.baseTexture.clearColor:t=t||this.clearColor;var n=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,o=n.width!==i.width||n.height!==i.height;if(o){var a=this.viewportFrame,s=a.x,u=a.y,h=a.width,f=a.height;s=Math.round(s),u=Math.round(u),h=Math.round(h),f=Math.round(f),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,u,h,f)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),o&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function qy(r,t,e,n,i){e.buffer.update(i)}var $y={float:`
452
+ data[offset] = v;
453
+ `,vec2:`
454
+ data[offset] = v[0];
455
+ data[offset+1] = v[1];
456
+ `,vec3:`
457
+ data[offset] = v[0];
458
+ data[offset+1] = v[1];
459
+ data[offset+2] = v[2];
460
+
461
+ `,vec4:`
462
+ data[offset] = v[0];
463
+ data[offset+1] = v[1];
464
+ data[offset+2] = v[2];
465
+ data[offset+3] = v[3];
466
+ `,mat2:`
467
+ data[offset] = v[0];
468
+ data[offset+1] = v[1];
469
+
470
+ data[offset+4] = v[2];
471
+ data[offset+5] = v[3];
472
+ `,mat3:`
473
+ data[offset] = v[0];
474
+ data[offset+1] = v[1];
475
+ data[offset+2] = v[2];
476
+
477
+ data[offset + 4] = v[3];
478
+ data[offset + 5] = v[4];
479
+ data[offset + 6] = v[5];
480
+
481
+ data[offset + 8] = v[6];
482
+ data[offset + 9] = v[7];
483
+ data[offset + 10] = v[8];
484
+ `,mat4:`
485
+ for(var i = 0; i < 16; i++)
486
+ {
487
+ data[offset + i] = v[i];
488
+ }
489
+ `},Yh={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Ky(r){for(var t=r.map(function(u){return{data:u,offset:0,dataLen:0,dirty:0}}),e=0,n=0,i=0,o=0;o<t.length;o++){var a=t[o];if(e=Yh[a.data.type],a.data.size>1&&(e=Math.max(e,16)*a.data.size),a.dataLen=e,n%e!==0&&n<16){var s=n%e%16;n+=s,i+=s}n+e>16?(i=Math.ceil(i/16)*16,a.offset=i,i+=e,n=e):(a.offset=i,n+=e,i+=e)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function Zy(r,t){var e=[];for(var n in r)t[n]&&e.push(t[n]);return e.sort(function(i,o){return i.index-o.index}),e}function Jy(r,t){if(!r.autoManage)return{size:0,syncFunc:qy};for(var e=Zy(r.uniforms,t),n=Ky(e),i=n.uboElements,o=n.size,a=[`
490
+ var v = null;
491
+ var v2 = null;
492
+ var cv = null;
493
+ var t = 0;
494
+ var gl = renderer.gl
495
+ var index = 0;
496
+ var data = buffer.data;
497
+ `],s=0;s<i.length;s++){for(var u=i[s],h=r.uniforms[u.data.name],f=u.data.name,l=!1,c=0;c<jr.length;c++){var d=jr[c];if(d.codeUbo&&d.test(u.data,h)){a.push("offset = "+u.offset/4+";",jr[c].codeUbo(u.data.name,h)),l=!0;break}}if(!l)if(u.data.size>1){var p=Lh(u.data.type),v=Math.max(Yh[u.data.type]/16,1),_=p/v,g=(4-_%4)%4;a.push(`
498
+ cv = ud.`+f+`.value;
499
+ v = uv.`+f+`;
500
+ offset = `+u.offset/4+`;
501
+
502
+ t = 0;
503
+
504
+ for(var i=0; i < `+u.data.size*v+`; i++)
505
+ {
506
+ for(var j = 0; j < `+_+`; j++)
507
+ {
508
+ data[offset++] = v[t++];
509
+ }
510
+ offset += `+g+`;
511
+ }
512
+
513
+ `)}else{var m=$y[u.data.type];a.push(`
514
+ cv = ud.`+f+`.value;
515
+ v = uv.`+f+`;
516
+ offset = `+u.offset/4+`;
517
+ `+m+`;
518
+ `)}}return a.push(`
519
+ renderer.buffer.update(buffer);
520
+ `),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",a.join(`
521
+ `))}}var Qy=function(){function r(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function t0(r,t){for(var e={},n=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),i=0;i<n;i++){var o=t.getActiveAttrib(r,i);if(o.name.indexOf("gl_")!==0){var a=Gh(t,o.type),s={type:a,name:o.name,size:Lh(a),location:t.getAttribLocation(r,o.name)};e[o.name]=s}}return e}function e0(r,t){for(var e={},n=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),i=0;i<n;i++){var o=t.getActiveUniform(r,i),a=o.name.replace(/\[.*?\]$/,""),s=!!o.name.match(/\[.*?\]$/),u=Gh(t,o.type);e[a]={name:a,index:i,type:u,size:o.size,isArray:s,value:Fh(u,o.size)}}return e}function r0(r,t){var e=Mh(r,r.VERTEX_SHADER,t.vertexSrc),n=Mh(r,r.FRAGMENT_SHADER,t.fragmentSrc),i=r.createProgram();if(r.attachShader(i,e),r.attachShader(i,n),r.linkProgram(i),r.getProgramParameter(i,r.LINK_STATUS)||wy(r,i,e,n),t.attributeData=t0(i,r),t.uniformData=e0(i,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){var o=Object.keys(t.attributeData);o.sort(function(f,l){return f>l?1:-1});for(var a=0;a<o.length;a++)t.attributeData[o[a]].location=a,r.bindAttribLocation(i,a,o[a]);r.linkProgram(i)}r.deleteShader(e),r.deleteShader(n);var s={};for(var a in t.uniformData){var u=t.uniformData[a];s[a]={location:r.getUniformLocation(i,a),value:Fh(u.type,u.size)}}var h=new Qy(i,s);return h}var n0=0,Ei={textureCount:0,uboCount:0},i0=function(){function r(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=n0++}return r.prototype.systemCheck=function(){if(!Fy())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},r.prototype.contextChange=function(t){this.gl=t,this.reset()},r.prototype.bind=function(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;var n=t.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),e||(Ei.textureCount=0,Ei.uboCount=0,this.syncUniformGroup(t.uniformGroup,Ei)),i},r.prototype.setUniforms=function(t){var e=this.shader.program,n=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(n.uniformData,t,this.renderer)},r.prototype.syncUniformGroup=function(t,e){var n=this.getGlProgram();(!t.static||t.dirtyId!==n.uniformDirtyGroups[t.id])&&(n.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,n,e))},r.prototype.syncUniforms=function(t,e,n){var i=t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t);i(e.uniformData,t.uniforms,this.renderer,n)},r.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=Iy(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},r.prototype.syncUniformBufferGroup=function(t,e){var n=this.getGlProgram();if(!t.static||t.dirtyId!==0||!n.uniformGroups[t.id]){t.dirtyId=0;var i=n.uniformGroups[t.id]||this.createSyncBufferGroup(t,n,e);t.buffer.update(),i(n.uniformData,t.uniforms,this.renderer,Ei,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,n.uniformBufferBindings[e])},r.prototype.createSyncBufferGroup=function(t,e,n){var i=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var o=this.gl.getUniformBlockIndex(e.program,n);e.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,o,this.shader.uniformBindCount),this.shader.uniformBindCount++;var a=this.getSignature(t,this.shader.program.uniformData,"ubo"),s=this._uboCache[a];if(s||(s=this._uboCache[a]=Jy(t,this.shader.program.uniformData)),t.autoManage){var u=new Float32Array(s.size/4);t.buffer.update(u)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},r.prototype.getSignature=function(t,e,n){var i=t.uniforms,o=[n+"-"];for(var a in i)o.push(a),e[a]&&o.push(e[a].type);return o.join("-")},r.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},r.prototype.generateProgram=function(t){var e=this.gl,n=t.program,i=r0(e,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i},r.prototype.reset=function(){this.program=null,this.shader=null},r.prototype.disposeShader=function(t){this.shader===t&&(this.shader=null)},r.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},r}();function o0(r,t){return t===void 0&&(t=[]),t[j.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD]=[r.ONE,r.ONE],t[j.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.NONE]=[0,0],t[j.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t[j.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SRC_IN]=[r.DST_ALPHA,r.ZERO],t[j.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],t[j.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],t[j.DST_IN]=[r.ZERO,r.SRC_ALPHA],t[j.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t[j.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],t[j.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],t}var a0=0,s0=1,u0=2,h0=3,l0=4,f0=5,c0=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=j.NONE,this._blendEq=!1,this.map=[],this.map[a0]=this.setBlend,this.map[s0]=this.setOffset,this.map[u0]=this.setCullFace,this.map[h0]=this.setDepthTest,this.map[l0]=this.setFrontFace,this.map[f0]=this.setDepthMask,this.checks=[],this.defaultState=new fr,this.defaultState.blend=!0}return r.prototype.contextChange=function(t){this.gl=t,this.blendModes=o0(t),this.set(this.defaultState),this.reset()},r.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,n=0;e;)e&1&&this.map[n].call(this,!!(t.data&1<<n)),e=e>>1,n++;this.stateId=t.data}for(var n=0;n<this.checks.length;n++)this.checks[n](this,t)},r.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(var e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},r.prototype.setBlend=function(t){this.updateCheck(r.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(t){this.updateCheck(r.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setDepthMask=function(t){this.gl.depthMask(t)},r.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},r.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],n=this.gl;e.length===2?n.blendFunc(e[0],e[1]):n.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,n.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}},r.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(t,e){var n=this.checks.indexOf(t);e&&n===-1?this.checks.push(t):!e&&n!==-1&&this.checks.splice(n,1)},r.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},r.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},r.prototype.destroy=function(){this.gl=null},r}(),d0=function(){function r(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=G.GC_MAX_IDLE,this.checkCountMax=G.GC_MAX_CHECK_COUNT,this.mode=G.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==Vn.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,n=!1,i=0;i<e.length;i++){var o=e[i];!o.framebuffer&&this.count-o.touched>this.maxIdle&&(t.destroyTexture(o,!0),e[i]=null,n=!0)}if(n){for(var a=0,i=0;i<e.length;i++)e[i]!==null&&(e[a++]=e[i]);e.length=a}},r.prototype.unload=function(t){var e=this.renderer.texture,n=t._texture;n&&!n.framebuffer&&e.destroyTexture(n);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},r.prototype.destroy=function(){this.renderer=null},r}();function p0(r){var t,e,n,i,o,a,s,u,h,f,l,c,d,p,v,_,g,m,y,b,x,A,P;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?P=(t={},t[X.UNSIGNED_BYTE]=(e={},e[U.RGBA]=r.RGBA8,e[U.RGB]=r.RGB8,e[U.RG]=r.RG8,e[U.RED]=r.R8,e[U.RGBA_INTEGER]=r.RGBA8UI,e[U.RGB_INTEGER]=r.RGB8UI,e[U.RG_INTEGER]=r.RG8UI,e[U.RED_INTEGER]=r.R8UI,e[U.ALPHA]=r.ALPHA,e[U.LUMINANCE]=r.LUMINANCE,e[U.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[X.BYTE]=(n={},n[U.RGBA]=r.RGBA8_SNORM,n[U.RGB]=r.RGB8_SNORM,n[U.RG]=r.RG8_SNORM,n[U.RED]=r.R8_SNORM,n[U.RGBA_INTEGER]=r.RGBA8I,n[U.RGB_INTEGER]=r.RGB8I,n[U.RG_INTEGER]=r.RG8I,n[U.RED_INTEGER]=r.R8I,n),t[X.UNSIGNED_SHORT]=(i={},i[U.RGBA_INTEGER]=r.RGBA16UI,i[U.RGB_INTEGER]=r.RGB16UI,i[U.RG_INTEGER]=r.RG16UI,i[U.RED_INTEGER]=r.R16UI,i[U.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,i),t[X.SHORT]=(o={},o[U.RGBA_INTEGER]=r.RGBA16I,o[U.RGB_INTEGER]=r.RGB16I,o[U.RG_INTEGER]=r.RG16I,o[U.RED_INTEGER]=r.R16I,o),t[X.UNSIGNED_INT]=(a={},a[U.RGBA_INTEGER]=r.RGBA32UI,a[U.RGB_INTEGER]=r.RGB32UI,a[U.RG_INTEGER]=r.RG32UI,a[U.RED_INTEGER]=r.R32UI,a[U.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,a),t[X.INT]=(s={},s[U.RGBA_INTEGER]=r.RGBA32I,s[U.RGB_INTEGER]=r.RGB32I,s[U.RG_INTEGER]=r.RG32I,s[U.RED_INTEGER]=r.R32I,s),t[X.FLOAT]=(u={},u[U.RGBA]=r.RGBA32F,u[U.RGB]=r.RGB32F,u[U.RG]=r.RG32F,u[U.RED]=r.R32F,u[U.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,u),t[X.HALF_FLOAT]=(h={},h[U.RGBA]=r.RGBA16F,h[U.RGB]=r.RGB16F,h[U.RG]=r.RG16F,h[U.RED]=r.R16F,h),t[X.UNSIGNED_SHORT_5_6_5]=(f={},f[U.RGB]=r.RGB565,f),t[X.UNSIGNED_SHORT_4_4_4_4]=(l={},l[U.RGBA]=r.RGBA4,l),t[X.UNSIGNED_SHORT_5_5_5_1]=(c={},c[U.RGBA]=r.RGB5_A1,c),t[X.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[U.RGBA]=r.RGB10_A2,d[U.RGBA_INTEGER]=r.RGB10_A2UI,d),t[X.UNSIGNED_INT_10F_11F_11F_REV]=(p={},p[U.RGB]=r.R11F_G11F_B10F,p),t[X.UNSIGNED_INT_5_9_9_9_REV]=(v={},v[U.RGB]=r.RGB9_E5,v),t[X.UNSIGNED_INT_24_8]=(_={},_[U.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),t[X.FLOAT_32_UNSIGNED_INT_24_8_REV]=(g={},g[U.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,g),t):P=(m={},m[X.UNSIGNED_BYTE]=(y={},y[U.RGBA]=r.RGBA,y[U.RGB]=r.RGB,y[U.ALPHA]=r.ALPHA,y[U.LUMINANCE]=r.LUMINANCE,y[U.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,y),m[X.UNSIGNED_SHORT_5_6_5]=(b={},b[U.RGB]=r.RGB,b),m[X.UNSIGNED_SHORT_4_4_4_4]=(x={},x[U.RGBA]=r.RGBA,x),m[X.UNSIGNED_SHORT_5_5_5_1]=(A={},A[U.RGBA]=r.RGBA,A),m),P}var _a=function(){function r(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=X.UNSIGNED_BYTE,this.internalFormat=U.RGBA,this.samplerType=0}return r}(),v0=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ut,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=p0(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var n=0;n<e;n++)this.boundTextures[n]=null;this.emptyTextures={};var i=new _a(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new _a(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(var n=0;n<6;n++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(var n=0;n<this.boundTextures.length;n++)this.bind(null,n)},r.prototype.bind=function(t,e){e===void 0&&(e=0);var n=this.gl;if(t=t==null?void 0:t.castToBaseTexture(),t&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,n.activeTexture(n.TEXTURE0+e)),n.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,n.activeTexture(n.TEXTURE0+e)),this.updateTexture(t)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,n.activeTexture(n.TEXTURE0+e)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[e]=null},r.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},r.prototype.unbind=function(t){var e=this,n=e.gl,i=e.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var o=0;o<i.length;o++)i[o]===this.unknownTexture&&this.bind(null,o)}for(var o=0;o<i.length;o++)i[o]===t&&(this.currentLocation!==o&&(n.activeTexture(n.TEXTURE0+o),this.currentLocation=o),n.bindTexture(t.target,this.emptyTextures[t.target].texture),i[o]=null)},r.prototype.ensureSamplerType=function(t){var e=this,n=e.boundTextures,i=e.hasIntegerTextures,o=e.CONTEXT_UID;if(i)for(var a=t-1;a>=0;--a){var s=n[a];if(s){var u=s._glTextures[o];u.samplerType!==Yn.FLOAT&&this.renderer.texture.unbind(s)}}},r.prototype.initTexture=function(t){var e=new _a(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},r.prototype.initTextureType=function(t,e){var n,i;e.internalFormat=(i=(n=this.internalFormats[t.type])===null||n===void 0?void 0:n[t.format])!==null&&i!==void 0?i:t.format,this.webGLVersion===2&&t.type===X.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},r.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var n=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(n,t,e))e.samplerType!==Yn.FLOAT&&(this.hasIntegerTextures=!0);else{var i=t.realWidth,o=t.realHeight,a=n.gl;(e.width!==i||e.height!==o||e.dirtyId<0)&&(e.width=i,e.height=o,a.texImage2D(t.target,0,e.internalFormat,i,o,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},r.prototype.destroyTexture=function(t,e){var n=this.gl;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),n.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);i!==-1&&kr(this.managedTextures,i,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===ae.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=ge.CLAMP:e.wrapMode=t.wrapMode,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},r.prototype.setStyle=function(t,e){var n=this.gl;if(e.mipmap&&t.mipmap!==ae.ON_MANUAL&&n.generateMipmap(t.target),n.texParameteri(t.target,n.TEXTURE_WRAP_S,e.wrapMode),n.texParameteri(t.target,n.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===_e.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===_e.LINEAR){var o=Math.min(t.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===_e.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===_e.LINEAR?n.LINEAR:n.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),ga=new Mt,_0=function(r){bt(t,r);function t(e,n){e===void 0&&(e=sn.UNKNOWN);var i=r.call(this)||this;return n=Object.assign({},G.RENDER_OPTIONS,n),i.options=n,i.type=e,i.screen=new st(0,0,n.width,n.height),i.view=n.view||G.ADAPTER.createCanvas(),i.resolution=n.resolution||G.RESOLUTION,i.useContextAlpha=n.useContextAlpha,i.autoDensity=!!n.autoDensity,i.preserveDrawingBuffer=n.preserveDrawingBuffer,i.clearBeforeRender=n.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=n.backgroundColor||i._backgroundColor,i.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(le("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=n.transparent,i.backgroundAlpha=n.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return t.prototype.initPlugins=function(e){for(var n in e)this.plugins[n]=new e[n](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,n){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(n*this.resolution);var i=this.view.width/this.resolution,o=this.view.height/this.resolution;this.screen.width=i,this.screen.height=o,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=o+"px"),this.emit("resize",i,o)},t.prototype.generateTexture=function(e,n,i,o){n===void 0&&(n={}),typeof n=="number"&&(le("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:i,region:o});var a=n.region,s=Jm(n,["region"]);o=a||e.getLocalBounds(null,!0),o.width===0&&(o.width=1),o.height===0&&(o.height=1);var u=hr.create(ia({width:o.width,height:o.height},s));return ga.tx=-o.x,ga.ty=-o.y,this.render(e,{renderTexture:u,clear:!1,transform:ga,skipUpdateTransform:!!e.parent}),u},t.prototype.destroy=function(e){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=sn.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=uh(e),Gr(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(un),g0=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),m0=function(){function r(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(t){var e=this,n=e.gl,i=e.CONTEXT_UID,o=t._glBuffers[i]||this.createGLBuffer(t);n.bindBuffer(t.type,o.buffer)},r.prototype.bindBufferBase=function(t,e){var n=this,i=n.gl,o=n.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var a=t._glBuffers[o]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,a.buffer)}},r.prototype.bindBufferRange=function(t,e,n){var i=this,o=i.gl,a=i.CONTEXT_UID;n=n||0;var s=t._glBuffers[a]||this.createGLBuffer(t);o.bindBufferRange(o.UNIFORM_BUFFER,e||0,s.buffer,n*256,256)},r.prototype.update=function(t){var e=this,n=e.gl,i=e.CONTEXT_UID,o=t._glBuffers[i];if(t._updateID!==o.updateID)if(o.updateID=t._updateID,n.bindBuffer(t.type,o.buffer),o.byteLength>=t.data.byteLength)n.bufferSubData(t.type,0,t.data);else{var a=t.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;o.byteLength=t.data.byteLength,n.bufferData(t.type,t.data,a)}},r.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var n=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),n&&(e||i.deleteBuffer(n.buffer),delete t._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),n=0;n<e.length;n++)this.dispose(this.managedBuffers[e[n]],t)},r.prototype.createGLBuffer=function(t){var e=this,n=e.CONTEXT_UID,i=e.gl;return t._glBuffers[n]=new g0(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[n]},r}(),Vh=function(r){bt(t,r);function t(e){var n=r.call(this,sn.WEBGL,e)||this;return e=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new Gt("destroy"),contextChange:new Gt("contextChange"),reset:new Gt("reset"),update:new Gt("update"),postrender:new Gt("postrender"),prerender:new Gt("prerender"),resize:new Gt("resize")},n.runners.contextChange.add(n),n.globalUniforms=new lr({projectionMatrix:new Mt},!0),n.addSystem(jy,"mask").addSystem(my,"context").addSystem(c0,"state").addSystem(i0,"shader").addSystem(v0,"texture").addSystem(m0,"buffer").addSystem(Ey,"geometry").addSystem(xy,"framebuffer").addSystem(Yy,"scissor").addSystem(Vy,"stencil").addSystem(zy,"projection").addSystem(d0,"textureGC").addSystem(_y,"filter").addSystem(Wy,"renderTexture").addSystem(gy,"batch"),n.initPlugins(t.__plugins),n.multisample=void 0,e.context?n.context.initFromContext(e.context):n.context.initFromOptions({alpha:!!n.useContextAlpha,antialias:e.antialias,premultipliedAlpha:n.useContextAlpha&&n.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,$v(n.context.webGLVersion===2?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return t.create=function(e){if(Kv())return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e=this.gl,n;if(this.context.webGLVersion===1){var i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),n=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{var i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),n=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}n>=wt.HIGH?this.multisample=wt.HIGH:n>=wt.MEDIUM?this.multisample=wt.MEDIUM:n>=wt.LOW?this.multisample=wt.LOW:this.multisample=wt.NONE},t.prototype.addSystem=function(e,n){var i=new e(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');this[n]=i;for(var o in this.runners)this.runners[o].add(i);return this},t.prototype.render=function(e,n){var i,o,a,s;if(n&&(n instanceof hr?(le("6.0.0","Renderer#render arguments changed, use options instead."),i=n,o=arguments[2],a=arguments[3],s=arguments[4]):(i=n.renderTexture,o=n.clear,a=n.transform,s=n.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=a,!this.context.isLost){if(i||(this._lastObjectRendered=e),!s){var u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(o!==void 0?o:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(e,n,i,o){n===void 0&&(n={});var a=r.prototype.generateTexture.call(this,e,n,i,o);return this.framebuffer.blit(),a},t.prototype.resize=function(e,n){r.prototype.resize.call(this,e,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(e){this.runners.destroy.emit();for(var n in this.runners)this.runners[n].destroy();r.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return le("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,n){le("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Re.add({name:e,type:gt.RendererPlugin,ref:n})},t.__plugins={},t}(_0);Re.handleByMap(gt.RendererPlugin,Vh.__plugins);function zh(r){return Vh.create(r)}var y0=`attribute vec2 aVertexPosition;
522
+ attribute vec2 aTextureCoord;
523
+
524
+ uniform mat3 projectionMatrix;
525
+
526
+ varying vec2 vTextureCoord;
527
+
528
+ void main(void)
529
+ {
530
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
531
+ vTextureCoord = aTextureCoord;
532
+ }`,b0=`attribute vec2 aVertexPosition;
533
+
534
+ uniform mat3 projectionMatrix;
535
+
536
+ varying vec2 vTextureCoord;
537
+
538
+ uniform vec4 inputSize;
539
+ uniform vec4 outputFrame;
540
+
541
+ vec4 filterVertexPosition( void )
542
+ {
543
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
544
+
545
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
546
+ }
547
+
548
+ vec2 filterTextureCoord( void )
549
+ {
550
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
551
+ }
552
+
553
+ void main(void)
554
+ {
555
+ gl_Position = filterVertexPosition();
556
+ vTextureCoord = filterTextureCoord();
557
+ }
558
+ `,x0=y0,Wh=b0,ma=function(){function r(){this.texArray=null,this.blend=0,this.type=oe.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),ya=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},r}(),ba=function(){function r(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(r.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),r.prototype.view=function(t){return this[t+"View"]},r.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},r.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},r}(),E0=function(r){bt(t,r);function t(e){var n=r.call(this,e)||this;return n.shaderGenerator=null,n.geometryClass=null,n.vertexSize=null,n.state=fr.for2d(),n.size=G.SPRITE_BATCH_SIZE*4,n._vertexCount=0,n._indexCount=0,n._bufferedElements=[],n._bufferedTextures=[],n._bufferSize=0,n._shader=null,n._packedGeometries=[],n._packedGeometryPoolSize=2,n._flushId=0,n._aBuffers={},n._iBuffers={},n.MAX_TEXTURES=1,n.renderer.on("prerender",n.onPrerender,n),e.runners.contextChange.add(n),n._dcIndex=0,n._aIndex=0,n._iIndex=0,n._attributeBuffer=null,n._indexBuffer=null,n._tempBoundTextures=[],n}return t.prototype.contextChange=function(){var e=this.renderer.gl;G.PREFER_ENV===Se.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),G.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=Dy(this.MAX_TEXTURES,e)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var n=0;n<this._packedGeometryPoolSize;n++)this._packedGeometries[n]=new this.geometryClass;this.initFlushBuffers()},t.prototype.initFlushBuffers=function(){for(var e=t._drawCallPool,n=t._textureArrayPool,i=this.size/4,o=Math.floor(i/this.MAX_TEXTURES)+1;e.length<i;)e.push(new ma);for(;n.length<o;)n.push(new ya);for(var a=0;a<this.MAX_TEXTURES;a++)this._tempBoundTextures[a]=null},t.prototype.onPrerender=function(){this._flushId=0},t.prototype.render=function(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,n=e._bufferedTextures,i=e.MAX_TEXTURES,o=t._textureArrayPool,a=this.renderer.batch,s=this._tempBoundTextures,u=this.renderer.textureGC.count,h=++ut._globalBatch,f=0,l=o[0],c=0;a.copyBoundTextures(s,i);for(var d=0;d<this._bufferSize;++d){var p=n[d];n[d]=null,p._batchEnabled!==h&&(l.count>=i&&(a.boundArray(l,s,h,i),this.buildDrawCalls(l,c,d),c=d,l=o[++f],++h),p._batchEnabled=h,p.touched=u,l.elements[l.count++]=p)}l.count>0&&(a.boundArray(l,s,h,i),this.buildDrawCalls(l,c,this._bufferSize),++f,++h);for(var d=0;d<s.length;d++)s[d]=null;ut._globalBatch=h},t.prototype.buildDrawCalls=function(e,n,i){var o=this,a=o._bufferedElements,s=o._attributeBuffer,u=o._indexBuffer,h=o.vertexSize,f=t._drawCallPool,l=this._dcIndex,c=this._aIndex,d=this._iIndex,p=f[l];p.start=this._iIndex,p.texArray=e;for(var v=n;v<i;++v){var _=a[v],g=_._texture.baseTexture,m=hh[g.alphaMode?1:0][_.blendMode];a[v]=null,n<v&&p.blend!==m&&(p.size=d-p.start,n=v,p=f[++l],p.texArray=e,p.start=d),this.packInterleavedGeometry(_,s,u,c,d),c+=_.vertexData.length/2*h,d+=_.indices.length,p.blend=m}n<i&&(p.size=d-p.start,++l),this._dcIndex=l,this._aIndex=c,this._iIndex=d},t.prototype.bindAndClearTexArray=function(e){for(var n=this.renderer.texture,i=0;i<e.count;i++)n.bind(e.elements[i],e.ids[i]),e.elements[i]=null;e.count=0},t.prototype.updateGeometry=function(){var e=this,n=e._packedGeometries,i=e._attributeBuffer,o=e._indexBuffer;G.CAN_UPLOAD_SAME_BUFFER?(n[this._flushId]._buffer.update(i.rawBinaryData),n[this._flushId]._indexBuffer.update(o),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,n[this._flushId]=new this.geometryClass),n[this._flushId]._buffer.update(i.rawBinaryData),n[this._flushId]._indexBuffer.update(o),this.renderer.geometry.bind(n[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},t.prototype.drawBatches=function(){for(var e=this._dcIndex,n=this.renderer,i=n.gl,o=n.state,a=t._drawCallPool,s=null,u=0;u<e;u++){var h=a[u],f=h.texArray,l=h.type,c=h.size,d=h.start,p=h.blend;s!==f&&(s=f,this.bindAndClearTexArray(f)),this.state.blendMode=p,o.set(this.state),i.drawElements(l,c,i.UNSIGNED_SHORT,d*2)}},t.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},t.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),G.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},t.prototype.stop=function(){this.flush()},t.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),r.prototype.destroy.call(this)},t.prototype.getAttributeBuffer=function(e){var n=ui(Math.ceil(e/8)),i=ph(n),o=n*8;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var a=this._aBuffers[o];return a||(this._aBuffers[o]=a=new ba(o*this.vertexSize*4)),a},t.prototype.getIndexBuffer=function(e){var n=ui(Math.ceil(e/12)),i=ph(n),o=n*12;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var a=this._iBuffers[i];return a||(this._iBuffers[i]=a=new Uint16Array(o)),a},t.prototype.packInterleavedGeometry=function(e,n,i,o,a){for(var s=n.uint32View,u=n.float32View,h=o/this.vertexSize,f=e.uvs,l=e.indices,c=e.vertexData,d=e._texture.baseTexture._batchLocation,p=Math.min(e.worldAlpha,1),v=p<1&&e._texture.baseTexture.alphaMode?Zo(e._tintRGB,p):e._tintRGB+(p*255<<24),_=0;_<c.length;_+=2)u[o++]=c[_],u[o++]=c[_+1],u[o++]=f[_],u[o++]=f[_+1],s[o++]=v,u[o++]=d;for(var _=0;_<l.length;_++)i[a++]=h+l[_]},t._drawCallPool=[],t._textureArrayPool=[],t}(mi),T0=function(){function r(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return r.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),n=0;n<t;n++)e[n]=n;this.defaultGroupCache[t]=lr.from({uSamplers:e},!0);var i=this.fragTemplate;i=i.replace(/%count%/gi,""+t),i=i.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Sn(this.vertexSrc,i)}var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new Mt,default:this.defaultGroupCache[t]};return new je(this.programCache[t],o)},r.prototype.generateSampleSrc=function(t){var e="";e+=`
559
+ `,e+=`
560
+ `;for(var n=0;n<t;n++)n>0&&(e+=`
561
+ else `),n<t-1&&(e+="if(vTextureId < "+n+".5)"),e+=`
562
+ {`,e+=`
563
+ color = texture2D(uSamplers[`+n+"], vTextureCoord);",e+=`
564
+ }`;return e+=`
565
+ `,e+=`
566
+ `,e},r}(),qh=function(r){bt(t,r);function t(e){e===void 0&&(e=!1);var n=r.call(this)||this;return n._buffer=new Dt(null,e,!1),n._indexBuffer=new Dt(null,e,!0),n.addAttribute("aVertexPosition",n._buffer,2,!1,X.FLOAT).addAttribute("aTextureCoord",n._buffer,2,!1,X.FLOAT).addAttribute("aColor",n._buffer,4,!0,X.UNSIGNED_BYTE).addAttribute("aTextureId",n._buffer,1,!0,X.FLOAT).addIndex(n._indexBuffer),n}return t}(En),$h=`precision highp float;
567
+ attribute vec2 aVertexPosition;
568
+ attribute vec2 aTextureCoord;
569
+ attribute vec4 aColor;
570
+ attribute float aTextureId;
571
+
572
+ uniform mat3 projectionMatrix;
573
+ uniform mat3 translationMatrix;
574
+ uniform vec4 tint;
575
+
576
+ varying vec2 vTextureCoord;
577
+ varying vec4 vColor;
578
+ varying float vTextureId;
579
+
580
+ void main(void){
581
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
582
+
583
+ vTextureCoord = aTextureCoord;
584
+ vTextureId = aTextureId;
585
+ vColor = aColor * tint;
586
+ }
587
+ `,Kh=`varying vec2 vTextureCoord;
588
+ varying vec4 vColor;
589
+ varying float vTextureId;
590
+ uniform sampler2D uSamplers[%count%];
591
+
592
+ void main(void){
593
+ vec4 color;
594
+ %forloop%
595
+ gl_FragColor = color * vColor;
596
+ }
597
+ `,w0=function(){function r(){}return r.create=function(t){var e=Object.assign({vertex:$h,fragment:Kh,geometryClass:qh,vertexSize:6},t),n=e.vertex,i=e.fragment,o=e.vertexSize,a=e.geometryClass;return function(s){bt(u,s);function u(h){var f=s.call(this,h)||this;return f.shaderGenerator=new T0(n,i),f.geometryClass=a,f.vertexSize=o,f}return u}(E0)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return $h},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return Kh},enumerable:!1,configurable:!0}),r}(),Zh=w0.create();Object.assign(Zh,{extension:{name:"batch",type:gt.RendererPlugin}});/*!
598
+ * @pixi/accessibility - v6.5.10
599
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
600
+ *
601
+ * @pixi/accessibility is licensed under the MIT License.
602
+ * http://www.opensource.org/licenses/mit-license
603
+ */var S0={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Rt.mixin(S0);var A0=9,Ti=100,P0=0,O0=0,Jh=2,Qh=1,R0=-1e3,I0=-1e3,C0=2,M0=function(){function r(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(ye.tablet||ye.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width=Ti+"px",e.style.height=Ti+"px",e.style.position="absolute",e.style.top=P0+"px",e.style.left=O0+"px",e.style.zIndex=Jh.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(r.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),r.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width=Qh+"px",e.style.height=Qh+"px",e.style.position="absolute",e.style.top=R0+"px",e.style.left=I0+"px",e.style.zIndex=C0.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e},r.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},r.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)===null||t===void 0||t.appendChild(this.div))},r.prototype.deactivate=function(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)===null||t===void 0||t.removeChild(this.div))},r.prototype.updateAccessibleObjects=function(t){if(!(!t.visible||!t.accessibleChildren)){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var n=0;n<e.length;n++)this.updateAccessibleObjects(e[n])}},r.prototype.update=function(){var t=performance.now();if(!(ye.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,!!this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),n=e.left,i=e.top,o=e.width,a=e.height,s=this.renderer,u=s.width,h=s.height,f=s.resolution,l=o/u*f,c=a/h*f,d=this.div;d.style.left=n+"px",d.style.top=i+"px",d.style.width=u+"px",d.style.height=h+"px";for(var p=0;p<this.children.length;p++){var v=this.children[p];if(v.renderId!==this.renderId)v._accessibleActive=!1,kr(this.children,p,1),this.div.removeChild(v._accessibleDiv),this.pool.push(v._accessibleDiv),v._accessibleDiv=null,p--;else{d=v._accessibleDiv;var _=v.hitArea,g=v.worldTransform;v.hitArea?(d.style.left=(g.tx+_.x*g.a)*l+"px",d.style.top=(g.ty+_.y*g.d)*c+"px",d.style.width=_.width*g.a*l+"px",d.style.height=_.height*g.d*c+"px"):(_=v.getBounds(),this.capHitArea(_),d.style.left=_.x*l+"px",d.style.top=_.y*c+"px",d.style.width=_.width*l+"px",d.style.height=_.height*c+"px",d.title!==v.accessibleTitle&&v.accessibleTitle!==null&&(d.title=v.accessibleTitle),d.getAttribute("aria-label")!==v.accessibleHint&&v.accessibleHint!==null&&d.setAttribute("aria-label",v.accessibleHint)),(v.accessibleTitle!==d.title||v.tabIndex!==d.tabIndex)&&(d.title=v.accessibleTitle,d.tabIndex=v.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},r.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},r.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,n=e.width,i=e.height;t.x+t.width>n&&(t.width=n-t.x),t.y+t.height>i&&(t.height=i-t.y)},r.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=Ti+"px",e.style.height=Ti+"px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=Jh.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?e.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(e.title="displayObject "+t.tabIndex),t.accessibleHint&&t.accessibleHint!==null&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},r.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,n=t.target.displayObject,i=e.eventData;e.dispatchEvent(n,"click",i),e.dispatchEvent(n,"pointertap",i),e.dispatchEvent(n,"tap",i)},r.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,n=t.target.displayObject,i=e.eventData;e.dispatchEvent(n,"mouseover",i)},r.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,n=t.target.displayObject,i=e.eventData;e.dispatchEvent(n,"mouseout",i)},r.prototype._onKeyDown=function(t){t.keyCode===A0&&this.activate()},r.prototype._onMouseMove=function(t){t.movementX===0&&t.movementY===0||this.deactivate()},r.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},r.extension={name:"accessibility",type:[gt.RendererPlugin,gt.CanvasRendererPlugin]},r}();/*!
604
+ * @pixi/interaction - v6.5.10
605
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
606
+ *
607
+ * @pixi/interaction is licensed under the MIT License.
608
+ * http://www.opensource.org/licenses/mit-license
609
+ */var tl=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Et,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(t,e,n){return t.worldTransform.applyInverse(n||this.global,e)},r.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();/*! *****************************************************************************
610
+ Copyright (c) Microsoft Corporation.
611
+
612
+ Permission to use, copy, modify, and/or distribute this software for any
613
+ purpose with or without fee is hereby granted.
614
+
615
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
616
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
617
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
618
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
619
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
620
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
621
+ PERFORMANCE OF THIS SOFTWARE.
622
+ ***************************************************************************** */var xa=function(r,t){return xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},xa(r,t)};function D0(r,t){xa(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F0=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),Ea=function(){function r(t){this._pointerId=t,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(t,e){e?this._flags=this._flags|t:this._flags=this._flags&~t},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(t){this._doSet(r.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r}(),B0=function(){function r(){this._tempPoint=new Et}return r.prototype.recursiveFindHit=function(t,e,n,i,o){var a;if(!e||!e.visible)return!1;var s=t.data.global;o=e.interactive||o;var u=!1,h=o,f=!0;if(e.hitArea)i&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?u=!0:(i=!1,f=!1)),h=!1;else if(e._mask&&i){var l=e._mask.isMaskData?e._mask.maskObject:e._mask;l&&!(!((a=l.containsPoint)===null||a===void 0)&&a.call(l,s))&&(i=!1)}if(f&&e.interactiveChildren&&e.children)for(var c=e.children,d=c.length-1;d>=0;d--){var p=c[d],v=this.recursiveFindHit(t,p,n,i,h);if(v){if(!p.parent)continue;h=!1,v&&(t.target&&(i=!1),u=!0)}}return o&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(u=!0),e.interactive&&(u&&!t.target&&(t.target=e),n&&n(t,e,!!u))),u},r.prototype.findHit=function(t,e,n,i){this.recursiveFindHit(t,e,n,i,!1)},r}(),N0={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Rt.mixin(N0);var wi=1,Si={target:null,data:{global:null}},L0=function(r){D0(t,r);function t(e,n){var i=r.call(this)||this;return n=n||{},i.renderer=e,i.autoPreventDefault=n.autoPreventDefault!==void 0?n.autoPreventDefault:!0,i.interactionFrequency=n.interactionFrequency||10,i.mouse=new tl,i.mouse.identifier=wi,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[wi]=i.mouse,i.interactionDataPool=[],i.eventData=new F0,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new B0,i._tempDisplayObject=new bh,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=n.useSystemTicker!==void 0?n.useSystemTicker:!0,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,n){return Si.target=null,Si.data.global=e,n||(n=this.lastObjectRendered),this.processInteractive(Si,n,null,!0),Si.target},t.prototype.setTargetElement=function(e,n){n===void 0&&(n=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=n,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(kt.system.add(this.tickerUpdate,this,Ie.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(kt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())},t.prototype.update=function(){if(this.interactionDOMElement){if(this._didMove){this._didMove=!1;return}this.cursor=null;for(var e in this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(e)){var n=this.activeInteractionData[e];if(n.originalEvent&&n.pointerType!=="touch"){var i=this.configureInteractionEventForDOMEvent(this.eventData,n.originalEvent,n);this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},t.prototype.setCursorMode=function(e){e=e||"default";var n=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(n=!1),this.currentCursorMode!==e){this.currentCursorMode=e;var i=this.cursorStyles[e];if(i)switch(typeof i){case"string":n&&(this.interactionDOMElement.style.cursor=i);break;case"function":i(e);break;case"object":n&&Object.assign(this.interactionDOMElement.style,i);break}else n&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.interactionDOMElement.style.cursor=e)}},t.prototype.dispatchEvent=function(e,n,i){(!i.stopPropagationHint||e===i.stopsPropagatingAt)&&(i.currentTarget=e,i.type=n,e.emit(n,i),e[n]&&e[n](i))},t.prototype.delayDispatchEvent=function(e,n,i){this.delayedEvents.push({displayObject:e,eventString:n,eventData:i})},t.prototype.mapPositionToPoint=function(e,n,i){var o;this.interactionDOMElement.parentElement?o=this.interactionDOMElement.getBoundingClientRect():o={x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var a=1/this.resolution;e.x=(n-o.left)*(this.interactionDOMElement.width/o.width)*a,e.y=(i-o.top)*(this.interactionDOMElement.height/o.height)*a},t.prototype.processInteractive=function(e,n,i,o){var a=this.search.findHit(e,n,i,o),s=this.delayedEvents;if(!s.length)return a;e.stopPropagationHint=!1;var u=s.length;this.delayedEvents=[];for(var h=0;h<u;h++){var f=s[h],l=f.displayObject,c=f.eventString,d=f.eventData;d.stopsPropagatingAt===l&&(d.stopPropagationHint=!0),this.dispatchEvent(l,c,d)}return a},t.prototype.onPointerDown=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var n=this.normalizeToPointerData(e);if(this.autoPreventDefault&&n[0].isNormalized){var i=e.cancelable||!("cancelable"in e);i&&e.preventDefault()}for(var o=n.length,a=0;a<o;a++){var s=n[a],u=this.getInteractionDataForPointerId(s),h=this.configureInteractionEventForDOMEvent(this.eventData,s,u);if(h.data.originalEvent=e,this.processInteractive(h,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",h),s.pointerType==="touch")this.emit("touchstart",h);else if(s.pointerType==="mouse"||s.pointerType==="pen"){var f=s.button===2;this.emit(f?"rightdown":"mousedown",this.eventData)}}}},t.prototype.processPointerDown=function(e,n,i){var o=e.data,a=e.data.identifier;if(i){if(n.trackedPointers[a]||(n.trackedPointers[a]=new Ea(a)),this.dispatchEvent(n,"pointerdown",e),o.pointerType==="touch")this.dispatchEvent(n,"touchstart",e);else if(o.pointerType==="mouse"||o.pointerType==="pen"){var s=o.button===2;s?n.trackedPointers[a].rightDown=!0:n.trackedPointers[a].leftDown=!0,this.dispatchEvent(n,s?"rightdown":"mousedown",e)}}},t.prototype.onPointerComplete=function(e,n,i){var o=this.normalizeToPointerData(e),a=o.length,s=e.target;e.composedPath&&e.composedPath().length>0&&(s=e.composedPath()[0]);for(var u=s!==this.interactionDOMElement?"outside":"",h=0;h<a;h++){var f=o[h],l=this.getInteractionDataForPointerId(f),c=this.configureInteractionEventForDOMEvent(this.eventData,f,l);if(c.data.originalEvent=e,this.processInteractive(c,this.lastObjectRendered,i,n||!u),this.emit(n?"pointercancel":"pointerup"+u,c),f.pointerType==="mouse"||f.pointerType==="pen"){var d=f.button===2;this.emit(d?"rightup"+u:"mouseup"+u,c)}else f.pointerType==="touch"&&(this.emit(n?"touchcancel":"touchend"+u,c),this.releaseInteractionDataForPointerId(f.pointerId))}},t.prototype.onPointerCancel=function(e){this.supportsTouchEvents&&e.pointerType==="touch"||this.onPointerComplete(e,!0,this.processPointerCancel)},t.prototype.processPointerCancel=function(e,n){var i=e.data,o=e.data.identifier;n.trackedPointers[o]!==void 0&&(delete n.trackedPointers[o],this.dispatchEvent(n,"pointercancel",e),i.pointerType==="touch"&&this.dispatchEvent(n,"touchcancel",e))},t.prototype.onPointerUp=function(e){this.supportsTouchEvents&&e.pointerType==="touch"||this.onPointerComplete(e,!1,this.processPointerUp)},t.prototype.processPointerUp=function(e,n,i){var o=e.data,a=e.data.identifier,s=n.trackedPointers[a],u=o.pointerType==="touch",h=o.pointerType==="mouse"||o.pointerType==="pen",f=!1;if(h){var l=o.button===2,c=Ea.FLAGS,d=l?c.RIGHT_DOWN:c.LEFT_DOWN,p=s!==void 0&&s.flags&d;i?(this.dispatchEvent(n,l?"rightup":"mouseup",e),p&&(this.dispatchEvent(n,l?"rightclick":"click",e),f=!0)):p&&this.dispatchEvent(n,l?"rightupoutside":"mouseupoutside",e),s&&(l?s.rightDown=!1:s.leftDown=!1)}i?(this.dispatchEvent(n,"pointerup",e),u&&this.dispatchEvent(n,"touchend",e),s&&((!h||f)&&this.dispatchEvent(n,"pointertap",e),u&&(this.dispatchEvent(n,"tap",e),s.over=!1))):s&&(this.dispatchEvent(n,"pointerupoutside",e),u&&this.dispatchEvent(n,"touchendoutside",e)),s&&s.none&&delete n.trackedPointers[a]},t.prototype.onPointerMove=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var n=this.normalizeToPointerData(e);(n[0].pointerType==="mouse"||n[0].pointerType==="pen")&&(this._didMove=!0,this.cursor=null);for(var i=n.length,o=0;o<i;o++){var a=n[o],s=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,s);u.data.originalEvent=e,this.processInteractive(u,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",u),a.pointerType==="touch"&&this.emit("touchmove",u),(a.pointerType==="mouse"||a.pointerType==="pen")&&this.emit("mousemove",u)}n[0].pointerType==="mouse"&&this.setCursorMode(this.cursor)}},t.prototype.processPointerMove=function(e,n,i){var o=e.data,a=o.pointerType==="touch",s=o.pointerType==="mouse"||o.pointerType==="pen";s&&this.processPointerOverOut(e,n,i),(!this.moveWhenInside||i)&&(this.dispatchEvent(n,"pointermove",e),a&&this.dispatchEvent(n,"touchmove",e),s&&this.dispatchEvent(n,"mousemove",e))},t.prototype.onPointerOut=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var n=this.normalizeToPointerData(e),i=n[0];i.pointerType==="mouse"&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var o=this.getInteractionDataForPointerId(i),a=this.configureInteractionEventForDOMEvent(this.eventData,i,o);a.data.originalEvent=i,this.processInteractive(a,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",a),i.pointerType==="mouse"||i.pointerType==="pen"?this.emit("mouseout",a):this.releaseInteractionDataForPointerId(o.identifier)}},t.prototype.processPointerOverOut=function(e,n,i){var o=e.data,a=e.data.identifier,s=o.pointerType==="mouse"||o.pointerType==="pen",u=n.trackedPointers[a];i&&!u&&(u=n.trackedPointers[a]=new Ea(a)),u!==void 0&&(i&&this.mouseOverRenderer?(u.over||(u.over=!0,this.delayDispatchEvent(n,"pointerover",e),s&&this.delayDispatchEvent(n,"mouseover",e)),s&&this.cursor===null&&(this.cursor=n.cursor)):u.over&&(u.over=!1,this.dispatchEvent(n,"pointerout",this.eventData),s&&this.dispatchEvent(n,"mouseout",e),u.none&&delete n.trackedPointers[a]))},t.prototype.onPointerOver=function(e){if(!(this.supportsTouchEvents&&e.pointerType==="touch")){var n=this.normalizeToPointerData(e),i=n[0],o=this.getInteractionDataForPointerId(i),a=this.configureInteractionEventForDOMEvent(this.eventData,i,o);a.data.originalEvent=i,i.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",a),(i.pointerType==="mouse"||i.pointerType==="pen")&&this.emit("mouseover",a)}},t.prototype.getInteractionDataForPointerId=function(e){var n=e.pointerId,i;return n===wi||e.pointerType==="mouse"?i=this.mouse:this.activeInteractionData[n]?i=this.activeInteractionData[n]:(i=this.interactionDataPool.pop()||new tl,i.identifier=n,this.activeInteractionData[n]=i),i.copyEvent(e),i},t.prototype.releaseInteractionDataForPointerId=function(e){var n=this.activeInteractionData[e];n&&(delete this.activeInteractionData[e],n.reset(),this.interactionDataPool.push(n))},t.prototype.configureInteractionEventForDOMEvent=function(e,n,i){return e.data=i,this.mapPositionToPoint(i.global,n.clientX,n.clientY),n.pointerType==="touch"&&(n.globalX=i.global.x,n.globalY=i.global.y),i.originalEvent=n,e.reset(),e},t.prototype.normalizeToPointerData=function(e){var n=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(var i=0,o=e.changedTouches.length;i<o;i++){var a=e.changedTouches[i];typeof a.button>"u"&&(a.button=e.touches.length?1:0),typeof a.buttons>"u"&&(a.buttons=e.touches.length?1:0),typeof a.isPrimary>"u"&&(a.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof a.width>"u"&&(a.width=a.radiusX||1),typeof a.height>"u"&&(a.height=a.radiusY||1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="touch"),typeof a.pointerId>"u"&&(a.pointerId=a.identifier||0),typeof a.pressure>"u"&&(a.pressure=a.force||.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),typeof a.layerX>"u"&&(a.layerX=a.offsetX=a.clientX),typeof a.layerY>"u"&&(a.layerY=a.offsetY=a.clientY),a.isNormalized=!0,n.push(a)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){var s=e;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=wi),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,n.push(s)}else n.push(e);return n},t.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},t.extension={name:"interaction",type:[gt.RendererPlugin,gt.CanvasRendererPlugin]},t}(un);/*!
623
+ * @pixi/extract - v6.5.10
624
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
625
+ *
626
+ * @pixi/extract is licensed under the MIT License.
627
+ * http://www.opensource.org/licenses/mit-license
628
+ */var U0=new st,G0=4,k0=function(){function r(t){this.renderer=t}return r.prototype.image=function(t,e,n){var i=new Image;return i.src=this.base64(t,e,n),i},r.prototype.base64=function(t,e,n){return this.canvas(t).toDataURL(e,n)},r.prototype.canvas=function(t,e){var n=this._rawPixels(t,e),i=n.pixels,o=n.width,a=n.height,s=n.flipY,u=new gh(o,a,1),h=u.context.getImageData(0,0,o,a);if(r.arrayPostDivide(i,h.data),u.context.putImageData(h,0,0),s){var f=new gh(u.width,u.height,1);f.context.scale(1,-1),f.context.drawImage(u.canvas,0,-a),u.destroy(),u=f}return u.canvas},r.prototype.pixels=function(t,e){var n=this._rawPixels(t,e).pixels;return r.arrayPostDivide(n,n),n},r.prototype._rawPixels=function(t,e){var n=this.renderer,i,o=!1,a,s=!1;if(t)if(t instanceof hr)a=t;else{var u=n.context.webGLVersion>=2?n.multisample:wt.NONE;if(a=this.renderer.generateTexture(t,{multisample:u}),u!==wt.NONE){var h=hr.create({width:a.width,height:a.height});n.framebuffer.bind(a.framebuffer),n.framebuffer.blit(h.framebuffer),n.framebuffer.bind(null),a.destroy(!0),a=h}s=!0}a?(i=a.baseTexture.resolution,e=e??a.frame,o=!1,n.renderTexture.bind(a)):(i=n.resolution,e||(e=U0,e.width=n.width,e.height=n.height),o=!0,n.renderTexture.bind(null));var f=Math.round(e.width*i),l=Math.round(e.height*i),c=new Uint8Array(G0*f*l),d=n.gl;return d.readPixels(Math.round(e.x*i),Math.round(e.y*i),f,l,d.RGBA,d.UNSIGNED_BYTE,c),s&&a.destroy(!0),{pixels:c,width:f,height:l,flipY:o}},r.prototype.destroy=function(){this.renderer=null},r.arrayPostDivide=function(t,e){for(var n=0;n<t.length;n+=4){var i=e[n+3]=t[n+3];i!==0?(e[n]=Math.round(Math.min(t[n]*255/i,255)),e[n+1]=Math.round(Math.min(t[n+1]*255/i,255)),e[n+2]=Math.round(Math.min(t[n+2]*255/i,255))):(e[n]=t[n],e[n+1]=t[n+1],e[n+2]=t[n+2])}},r.extension={name:"extract",type:gt.RendererPlugin},r}();/*!
629
+ * @pixi/loaders - v6.5.10
630
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
631
+ *
632
+ * @pixi/loaders is licensed under the MIT License.
633
+ * http://www.opensource.org/licenses/mit-license
634
+ */var Ai=function(){function r(t,e,n){e===void 0&&(e=!1),this._fn=t,this._once=e,this._thisArg=n,this._next=this._prev=this._owner=null}return r.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},r}();function el(r,t){return r._head?(r._tail._next=t,t._prev=r._tail,r._tail=t):(r._head=t,r._tail=t),t._owner=r,t}var Ce=function(){function r(){this._head=this._tail=void 0}return r.prototype.handlers=function(t){t===void 0&&(t=!1);var e=this._head;if(t)return!!e;for(var n=[];e;)n.push(e),e=e._next;return n},r.prototype.has=function(t){if(!(t instanceof Ai))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},r.prototype.dispatch=function(){for(var t=arguments,e=[],n=0;n<arguments.length;n++)e[n]=t[n];var i=this._head;if(!i)return!1;for(;i;)i._once&&this.detach(i),i._fn.apply(i._thisArg,e),i=i._next;return!0},r.prototype.add=function(t,e){if(e===void 0&&(e=null),typeof t!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return el(this,new Ai(t,!1,e))},r.prototype.once=function(t,e){if(e===void 0&&(e=null),typeof t!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return el(this,new Ai(t,!0,e))},r.prototype.detach=function(t){if(!(t instanceof Ai))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this?this:(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,t._next===null&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null,this)},r.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},r}();function rl(r,t){t=t||{};for(var e={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=e.parser[t.strictMode?"strict":"loose"].exec(r),i={},o=14;o--;)i[e.key[o]]=n[o]||"";return i[e.q.name]={},i[e.key[12]].replace(e.q.parser,function(a,s,u){s&&(i[e.q.name][s]=u)}),i}var Ta,Pi=null,H0=0,nl=200,X0=204,j0=1223,Y0=2;function il(){}function ol(r,t,e){t&&t.indexOf(".")===0&&(t=t.substring(1)),t&&(r[t]=e)}function wa(r){return r.toString().replace("object ","")}var Ot=function(){function r(t,e,n){if(this._dequeue=il,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof t!="string"||typeof e!="string")throw new Error("Both name and url are required for constructing a resource.");n=n||{},this._flags=0,this._setFlag(r.STATUS_FLAGS.DATA_URL,e.indexOf("data:")===0),this.name=t,this.url=e,this.extension=this._getExtension(),this.data=null,this.crossOrigin=n.crossOrigin===!0?"anonymous":n.crossOrigin,this.timeout=n.timeout||0,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=r.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=il,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new Ce,this.onProgress=new Ce,this.onComplete=new Ce,this.onAfterMiddleware=new Ce}return r.setExtensionLoadType=function(t,e){ol(r._loadTypeMap,t,e)},r.setExtensionXhrType=function(t,e){ol(r._xhrTypeMap,t,e)},Object.defineProperty(r.prototype,"isDataUrl",{get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isComplete",{get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),r.prototype.complete=function(){this._clearEvents(),this._finish()},r.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=r.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},r.prototype.load=function(t){var e=this;if(!this.isLoading){if(this.isComplete){t&&setTimeout(function(){return t(e)},1);return}else t&&this.onComplete.once(t);switch(this._setFlag(r.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case r.LOAD_TYPE.IMAGE:this.type=r.TYPE.IMAGE,this._loadElement("image");break;case r.LOAD_TYPE.AUDIO:this.type=r.TYPE.AUDIO,this._loadSourceElement("audio");break;case r.LOAD_TYPE.VIDEO:this.type=r.TYPE.VIDEO,this._loadSourceElement("video");break;case r.LOAD_TYPE.XHR:default:typeof Ta>"u"&&(Ta=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),Ta&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(t){return(this._flags&t)!==0},r.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:t==="image"&&typeof globalThis.Image<"u"?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:t==="audio"&&typeof globalThis.Audio<"u"?this.data=new Audio:this.data=document.createElement(t),this.data===null){this.abort("Unsupported element: "+t);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,n=0;n<this.url.length;++n)this.data.appendChild(this._createSource(t,this.url[n],Array.isArray(e)?e[n]:e));else{var e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(t.withCredentials=!0),t.open("GET",this.url,!0),t.timeout=this.timeout,this.xhrType===r.XHR_RESPONSE_TYPE.JSON||this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=r.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("timeout",this._boundXhrOnTimeout,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},r.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},r.prototype._createSource=function(t,e,n){n||(n=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=n,i},r.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},r.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},r.prototype._onTimeout=function(){this.abort("Load timed out.")},r.prototype._xhrOnError=function(){var t=this.xhr;this.abort(wa(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},r.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(wa(t)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(wa(t)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var t=this.xhr,e="",n=typeof t.status>"u"?nl:t.status;(t.responseType===""||t.responseType==="text"||typeof t.responseType>"u")&&(e=t.responseText),n===H0&&(e.length>0||t.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?n=nl:n===j0&&(n=X0);var i=n/100|0;if(i===Y0)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=r.TYPE.JSON}catch(s){this.abort("Error trying to parse loaded json: "+s);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var o=new DOMParser;this.data=o.parseFromString(e,"text/xml")}else{var a=document.createElement("div");a.innerHTML=e,this.data=a}this.type=r.TYPE.XML}catch(s){this.abort("Error trying to parse loaded xml: "+s);return}else this.data=t.response||e;else{this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(t,e){if(t.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,Pi||(Pi=document.createElement("a")),Pi.href=t;var n=rl(Pi.href,{strictMode:!0}),i=!n.port&&e.port===""||n.port===e.port,o=n.protocol?n.protocol+":":"";return n.host!==e.hostname||!i||o!==e.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(t){t===void 0&&(t=this.url);var e="";if(this.isDataUrl){var n=t.indexOf("/");e=t.substring(n+1,t.indexOf(";",n))}else{var i=t.indexOf("?"),o=t.indexOf("#"),a=Math.min(i>-1?i:t.length,o>-1?o:t.length);t=t.substring(0,a),e=t.substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},r.prototype._getMimeFromXhrType=function(t){switch(t){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r}();(function(r){(function(t){t[t.NONE=0]="NONE",t[t.DATA_URL=1]="DATA_URL",t[t.COMPLETE=2]="COMPLETE",t[t.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.JSON=1]="JSON",t[t.XML=2]="XML",t[t.IMAGE=3]="IMAGE",t[t.AUDIO=4]="AUDIO",t[t.VIDEO=5]="VIDEO",t[t.TEXT=6]="TEXT"}(r.TYPE||(r.TYPE={})),function(t){t[t.XHR=1]="XHR",t[t.IMAGE=2]="IMAGE",t[t.AUDIO=3]="AUDIO",t[t.VIDEO=4]="VIDEO"}(r.LOAD_TYPE||(r.LOAD_TYPE={})),function(t){t.DEFAULT="text",t.BUFFER="arraybuffer",t.BLOB="blob",t.DOCUMENT="document",t.JSON="json",t.TEXT="text"}(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(Ot||(Ot={}));function dr(){}function V0(r){return function(){for(var e=arguments,n=[],i=0;i<arguments.length;i++)n[i]=e[i];if(r===null)throw new Error("Callback was already called.");var o=r;r=null,o.apply(this,n)}}var z0=function(){function r(t,e){this.data=t,this.callback=e}return r}(),Sa=function(){function r(t,e){var n=this;if(e===void 0&&(e=1),this.workers=0,this.saturated=dr,this.unsaturated=dr,this.empty=dr,this.drain=dr,this.error=dr,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(i,o,a){if(a&&typeof a!="function")throw new Error("task callback must be a function");if(n.started=!0,i==null&&n.idle()){setTimeout(function(){return n.drain()},1);return}var s=new z0(i,typeof a=="function"?a:dr);o?n._tasks.unshift(s):n._tasks.push(s),setTimeout(n.process,1)},this.process=function(){for(;!n.paused&&n.workers<n.concurrency&&n._tasks.length;){var i=n._tasks.shift();n._tasks.length===0&&n.empty(),n.workers+=1,n.workers===n.concurrency&&n.saturated(),n._worker(i.data,V0(n._next(i)))}},this._worker=t,e===0)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return r.prototype._next=function(t){var e=this;return function(){for(var n=arguments,i=[],o=0;o<arguments.length;o++)i[o]=n[o];e.workers-=1,t.callback.apply(t,i),i[0]!=null&&e.error(i[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},r.prototype.push=function(t,e){this._insert(t,!1,e)},r.prototype.kill=function(){this.workers=0,this.drain=dr,this.started=!1,this._tasks=[]},r.prototype.unshift=function(t,e){this._insert(t,!0,e)},r.prototype.length=function(){return this._tasks.length},r.prototype.running=function(){return this.workers},r.prototype.idle=function(){return this._tasks.length+this.workers===0},r.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},r.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},r.eachSeries=function(t,e,n,i){var o=0,a=t.length;function s(u){if(u||o===a){n&&n(u);return}i?setTimeout(function(){e(t[o++],s)},1):e(t[o++],s)}s()},r.queue=function(t,e){return new r(t,e)},r}(),Aa=100,W0=/(#[\w-]+)?$/,Oi=function(){function r(t,e){var n=this;t===void 0&&(t=""),e===void 0&&(e=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(u,h){return n._loadResource(u,h)},this.resources={},this.baseUrl=t,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(u,h){return n._loadResource(u,h)},this._queue=Sa.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new Ce,this.onError=new Ce,this.onLoad=new Ce,this.onStart=new Ce,this.onComplete=new Ce;for(var i=0;i<r._plugins.length;++i){var o=r._plugins[i],a=o.pre,s=o.use;a&&this.pre(a),s&&this.use(s)}this._protected=!1}return r.prototype._add=function(t,e,n,i){if(this.loading&&(!n||!n.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new Ot(t,e,n),typeof i=="function"&&this.resources[t].onAfterMiddleware.once(i),this.loading){for(var o=n.parentResource,a=[],s=0;s<o.children.length;++s)o.children[s].isComplete||a.push(o.children[s]);var u=o.progressChunk*(a.length+1),h=u/(a.length+2);o.children.push(this.resources[t]),o.progressChunk=h;for(var s=0;s<a.length;++s)a[s].progressChunk=h;this.resources[t].progressChunk=h}return this._queue.push(this.resources[t]),this},r.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},r.prototype.use=function(t){return this._afterMiddleware.push(t),this},r.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var t in this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},r.prototype.load=function(t){if(le("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),typeof t=="function"&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=this._queue._tasks.length,n=Aa/e,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=n;this._onStart(),this._queue.resume()}return this},Object.defineProperty(r.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),r.prototype._prepareUrl=function(t){var e=rl(t,{strictMode:!0}),n;if(e.protocol||!e.path||t.indexOf("//")===0?n=t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&t.charAt(0)!=="/"?n=this.baseUrl+"/"+t:n=this.baseUrl+t,this.defaultQueryString){var i=W0.exec(n)[0];n=n.slice(0,n.length-i.length),n.indexOf("?")!==-1?n+="&"+this.defaultQueryString:n+="?"+this.defaultQueryString,n+=i}return n},r.prototype._loadResource=function(t,e){var n=this;t._dequeue=e,Sa.eachSeries(this._beforeMiddleware,function(i,o){i.call(n,t,function(){o(t.isComplete?{}:null)})},function(){t.isComplete?n._onLoad(t):(t._onLoadBinding=t.onComplete.once(n._onLoad,n),t.load())},!0)},r.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},r.prototype._onComplete=function(){this.progress=Aa,this.loading=!1,this.onComplete.dispatch(this,this.resources)},r.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),Sa.eachSeries(this._afterMiddleware,function(n,i){n.call(e,t,i)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(Aa,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&e._resourcesParsing.length===0&&e._onComplete()},!0)},r.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(r,"shared",{get:function(){var t=r._shared;return t||(t=new r,t._protected=!0,r._shared=t),t},enumerable:!1,configurable:!0}),r.registerPlugin=function(t){return le("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Re.add({type:gt.Loader,ref:t}),r},r._plugins=[],r}();Re.handleByList(gt.Loader,Oi._plugins),Oi.prototype.add=function(t,e,n,i){if(Array.isArray(t)){for(var o=0;o<t.length;++o)this.add(t[o]);return this}if(typeof t=="object"&&(n=t,i=e||n.callback||n.onComplete,e=n.url,t=n.name||n.key||n.url),typeof e!="string"&&(i=n,n=e,e=t),typeof e!="string")throw new Error("No url passed to add resource to loader.");return typeof n=="function"&&(i=n,n=null),this._add(t,e,n,i)};var q0=function(){function r(){}return r.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Oi.shared:new Oi},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=gt.Application,r}(),$0=function(){function r(){}return r.add=function(){Ot.setExtensionLoadType("svg",Ot.LOAD_TYPE.XHR),Ot.setExtensionXhrType("svg",Ot.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){if(t.data&&(t.type===Ot.TYPE.IMAGE||t.extension==="svg")){var n=t.data,i=t.url,o=t.name,a=t.metadata;J.fromLoader(n,i,o,a).then(function(s){t.texture=s,e()}).catch(e)}else e()},r.extension=gt.Loader,r}(),K0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Z0(r){for(var t="",e=0;e<r.length;){for(var n=[0,0,0],i=[0,0,0,0],o=0;o<n.length;++o)e<r.length?n[o]=r.charCodeAt(e++)&255:n[o]=0;i[0]=n[0]>>2,i[1]=(n[0]&3)<<4|n[1]>>4,i[2]=(n[1]&15)<<2|n[2]>>6,i[3]=n[2]&63;var a=e-(r.length-1);switch(a){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64;break}for(var o=0;o<i.length;++o)t+=K0.charAt(i[o])}return t}function J0(r,t){if(!r.data){t();return}if(r.xhr&&r.xhrType===Ot.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof r.data=="string"){var e=r.xhr.getResponseHeader("content-type");if(e&&e.indexOf("image")===0){r.data=new Image,r.data.src="data:"+e+";base64,"+Z0(r.xhr.responseText),r.type=Ot.TYPE.IMAGE,r.data.onload=function(){r.data.onload=null,t()};return}}else if(r.data.type.indexOf("image")===0){var n=globalThis.URL||globalThis.webkitURL,i=n.createObjectURL(r.data);r.blob=r.data,r.data=new Image,r.data.src=i,r.type=Ot.TYPE.IMAGE,r.data.onload=function(){n.revokeObjectURL(i),r.data.onload=null,t()};return}}t()}var Q0=function(){function r(){}return r.extension=gt.Loader,r.use=J0,r}();Re.add($0,Q0);/*!
635
+ * @pixi/compressed-textures - v6.5.10
636
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
637
+ *
638
+ * @pixi/compressed-textures is licensed under the MIT License.
639
+ * http://www.opensource.org/licenses/mit-license
640
+ */var pt,et;(function(r){r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"})(et||(et={}));var Ri=(pt={},pt[et.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,pt[et.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,pt[et.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,pt[et.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,pt[et.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,pt[et.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,pt[et.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,pt[et.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,pt[et.COMPRESSED_R11_EAC]=.5,pt[et.COMPRESSED_SIGNED_R11_EAC]=.5,pt[et.COMPRESSED_RG11_EAC]=1,pt[et.COMPRESSED_SIGNED_RG11_EAC]=1,pt[et.COMPRESSED_RGB8_ETC2]=.5,pt[et.COMPRESSED_RGBA8_ETC2_EAC]=1,pt[et.COMPRESSED_SRGB8_ETC2]=.5,pt[et.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,pt[et.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,pt[et.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,pt[et.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,pt[et.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,pt[et.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,pt[et.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,pt[et.COMPRESSED_RGB_ETC1_WEBGL]=.5,pt[et.COMPRESSED_RGB_ATC_WEBGL]=.5,pt[et.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,pt[et.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,pt[et.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,pt);/*! *****************************************************************************
641
+ Copyright (c) Microsoft Corporation.
642
+
643
+ Permission to use, copy, modify, and/or distribute this software for any
644
+ purpose with or without fee is hereby granted.
645
+
646
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
647
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
648
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
649
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
650
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
651
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
652
+ PERFORMANCE OF THIS SOFTWARE.
653
+ ***************************************************************************** */var Pa=function(r,t){return Pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Pa(r,t)};function al(r,t){Pa(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function tb(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function s(f){try{h(n.next(f))}catch(l){a(l)}}function u(f){try{h(n.throw(f))}catch(l){a(l)}}function h(f){f.done?o(f.value):i(f.value).then(s,u)}h((n=n.apply(r,t||[])).next())})}function eb(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(h){return function(f){return u([h,f])}}function u(h){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=h[0]&2?i.return:h[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,h[1])).done)return o;switch(i=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,i=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){e=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){e.label=h[1];break}if(h[0]===6&&e.label<o[1]){e.label=o[1],o=h;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(h);break}o[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(r,e)}catch(f){h=[6,f],i=0}finally{n=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}var rb=function(r){al(t,r);function t(e,n){n===void 0&&(n={width:1,height:1,autoLoad:!0});var i=this,o,a;return typeof e=="string"?(o=e,a=new Uint8Array):(o=null,a=e),i=r.call(this,a,n)||this,i.origin=o,i.buffer=a?new ba(a):null,i.origin&&n.autoLoad!==!1&&i.load(),a&&a.length&&(i.loaded=!0,i.onBlobLoaded(i.buffer.rawBinaryData)),i}return t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return tb(this,void 0,Promise,function(){var e,n,i;return eb(this,function(o){switch(o.label){case 0:return[4,fetch(this.origin)];case 1:return e=o.sent(),[4,e.blob()];case 2:return n=o.sent(),[4,n.arrayBuffer()];case 3:return i=o.sent(),this.data=new Uint32Array(i),this.buffer=new ba(i),this.loaded=!0,this.onBlobLoaded(i),this.update(),[2,this]}})})},t}(xn),Oa=function(r){al(t,r);function t(e,n){var i=r.call(this,e,n)||this;return i.format=n.format,i.levels=n.levels||1,i._width=n.width,i._height=n.height,i._extension=t._formatToExtension(i.format),(n.levelBuffers||i.buffer)&&(i._levelBuffers=n.levelBuffers||t._createLevelBuffers(e instanceof Uint8Array?e:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return t.prototype.upload=function(e,n,i){var o=e.gl,a=e.context.extensions[this._extension];if(!a)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var s=0,u=this.levels;s<u;s++){var h=this._levelBuffers[s],f=h.levelID,l=h.levelWidth,c=h.levelHeight,d=h.levelBuffer;o.compressedTexImage2D(o.TEXTURE_2D,f,this.format,l,c,0,d)}return!0},t.prototype.onBlobLoaded=function(){this._levelBuffers=t._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},t._formatToExtension=function(e){if(e>=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,n,i,o,a,s,u){for(var h=new Array(i),f=e.byteOffset,l=s,c=u,d=l+o-1&~(o-1),p=c+a-1&~(a-1),v=d*p*Ri[n],_=0;_<i;_++)h[_]={levelID:_,levelWidth:i>1?l:d,levelHeight:i>1?c:p,levelBuffer:new Uint8Array(e.buffer,f,v)},f+=v,l=l>>1||1,c=c>>1||1,d=l+o-1&~(o-1),p=c+a-1&~(a-1),v=d*p*Ri[n];return h},t}(rb),nb=function(){function r(){}return r.use=function(t,e){var n=t.data,i=this;if(t.type===Ot.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var o=n.textures,a=void 0,s=void 0,u=0,h=o.length;u<h;u++){var f=o[u],l=f.src,c=f.format;if(c||(s=l),r.textureFormats[c]){a=l;break}}if(a=a||s,!a){e(new Error("Cannot load compressed-textures in "+t.url+", make sure you provide a fallback"));return}if(a===t.url){e(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var d={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},p=Ur.resolve(t.url.replace(i.baseUrl,""),a),v=n.cacheID;i.add(v,p,d,function(_){if(_.error){e(_.error);return}var g=_.texture,m=g===void 0?null:g,y=_.textures,b=y===void 0?{}:y;Object.assign(t,{texture:m,textures:b}),e()})}else e()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var t=G.ADAPTER.createCanvas(),e=t.getContext("webgl");if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var n={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};r._textureExtensions=n}return r._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(r,"textureFormats",{get:function(){if(!r._textureFormats){var t=r.textureExtensions;r._textureFormats={};for(var e in t){var n=t[e];n&&Object.assign(r._textureFormats,Object.getPrototypeOf(n))}}return r._textureFormats},enumerable:!1,configurable:!0}),r.extension=gt.Loader,r}();function sl(r,t,e){var n={textures:{},texture:null};if(!t)return n;var i=t.map(function(o){return new J(new ut(o,Object.assign({mipmap:ae.OFF,alphaMode:se.NO_PREMULTIPLIED_ALPHA},e)))});return i.forEach(function(o,a){var s=o.baseTexture,u=r+"-"+(a+1);ut.addToCache(s,u),J.addToCache(o,u),a===0&&(ut.addToCache(s,r),J.addToCache(o,r),n.texture=o),n.textures[u]=o}),n}var Pn,fe,Ra=4,Ii=124,ib=32,ul=20,ob=542327876,Ci={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},ab={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},Mi={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},ce;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(ce||(ce={}));var Ia;(function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(Ia||(Ia={}));var sb=1,ub=2,hb=4,lb=64,fb=512,cb=131072,db=827611204,pb=861165636,vb=894720068,_b=808540228,gb=4,mb=(Pn={},Pn[db]=et.COMPRESSED_RGBA_S3TC_DXT1_EXT,Pn[pb]=et.COMPRESSED_RGBA_S3TC_DXT3_EXT,Pn[vb]=et.COMPRESSED_RGBA_S3TC_DXT5_EXT,Pn),yb=(fe={},fe[ce.DXGI_FORMAT_BC1_TYPELESS]=et.COMPRESSED_RGBA_S3TC_DXT1_EXT,fe[ce.DXGI_FORMAT_BC1_UNORM]=et.COMPRESSED_RGBA_S3TC_DXT1_EXT,fe[ce.DXGI_FORMAT_BC2_TYPELESS]=et.COMPRESSED_RGBA_S3TC_DXT3_EXT,fe[ce.DXGI_FORMAT_BC2_UNORM]=et.COMPRESSED_RGBA_S3TC_DXT3_EXT,fe[ce.DXGI_FORMAT_BC3_TYPELESS]=et.COMPRESSED_RGBA_S3TC_DXT5_EXT,fe[ce.DXGI_FORMAT_BC3_UNORM]=et.COMPRESSED_RGBA_S3TC_DXT5_EXT,fe[ce.DXGI_FORMAT_BC1_UNORM_SRGB]=et.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,fe[ce.DXGI_FORMAT_BC2_UNORM_SRGB]=et.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,fe[ce.DXGI_FORMAT_BC3_UNORM_SRGB]=et.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,fe);function bb(r){var t=new Uint32Array(r),e=t[0];if(e!==ob)throw new Error("Invalid DDS file magic word");var n=new Uint32Array(r,0,Ii/Uint32Array.BYTES_PER_ELEMENT),i=n[Ci.HEIGHT],o=n[Ci.WIDTH],a=n[Ci.MIPMAP_COUNT],s=new Uint32Array(r,Ci.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,ib/Uint32Array.BYTES_PER_ELEMENT),u=s[sb];if(u&hb){var h=s[ab.FOURCC];if(h!==_b){var f=mb[h],l=Ra+Ii,c=new Uint8Array(r,l),d=new Oa(c,{format:f,width:o,height:i,levels:a});return[d]}var p=Ra+Ii,v=new Uint32Array(t.buffer,p,ul/Uint32Array.BYTES_PER_ELEMENT),_=v[Mi.DXGI_FORMAT],g=v[Mi.RESOURCE_DIMENSION],m=v[Mi.MISC_FLAG],y=v[Mi.ARRAY_SIZE],b=yb[_];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(m===gb)throw new Error("DDSParser does not support cubemap textures");if(g===Ia.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,A=Ra+Ii+ul;if(y===1)x.push(new Uint8Array(r,A));else{for(var P=Ri[b],T=0,w=o,E=i,R=0;R<a;R++){var O=Math.max(1,w+3&-4),C=Math.max(1,E+3&-4),k=O*C*P;T+=k,w=w>>>1,E=E>>>1}for(var B=A,R=0;R<y;R++)x.push(new Uint8Array(r,B,T)),B+=T}return x.map(function(N){return new Oa(N,{format:b,width:o,height:i,levels:a})})}throw u&lb?new Error("DDSParser does not support uncompressed texture data."):u&fb?new Error("DDSParser does not supported YUV uncompressed texture data."):u&cb?new Error("DDSParser does not support single-channel (lumninance) texture data!"):u&ub?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}var Ve,Me,On,hl=[171,75,84,88,32,49,49,187,13,10,26,10],xb=67305985,de={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},Ca=64,ll=(Ve={},Ve[X.UNSIGNED_BYTE]=1,Ve[X.UNSIGNED_SHORT]=2,Ve[X.INT]=4,Ve[X.UNSIGNED_INT]=4,Ve[X.FLOAT]=4,Ve[X.HALF_FLOAT]=8,Ve),Eb=(Me={},Me[U.RGBA]=4,Me[U.RGB]=3,Me[U.RG]=2,Me[U.RED]=1,Me[U.LUMINANCE]=1,Me[U.LUMINANCE_ALPHA]=2,Me[U.ALPHA]=1,Me),Tb=(On={},On[X.UNSIGNED_SHORT_4_4_4_4]=2,On[X.UNSIGNED_SHORT_5_5_5_1]=2,On[X.UNSIGNED_SHORT_5_6_5]=2,On);function wb(r,t,e){e===void 0&&(e=!1);var n=new DataView(t);if(!Sb(r,n))return null;var i=n.getUint32(de.ENDIANNESS,!0)===xb,o=n.getUint32(de.GL_TYPE,i),a=n.getUint32(de.GL_FORMAT,i),s=n.getUint32(de.GL_INTERNAL_FORMAT,i),u=n.getUint32(de.PIXEL_WIDTH,i),h=n.getUint32(de.PIXEL_HEIGHT,i)||1,f=n.getUint32(de.PIXEL_DEPTH,i)||1,l=n.getUint32(de.NUMBER_OF_ARRAY_ELEMENTS,i)||1,c=n.getUint32(de.NUMBER_OF_FACES,i),d=n.getUint32(de.NUMBER_OF_MIPMAP_LEVELS,i),p=n.getUint32(de.BYTES_OF_KEY_VALUE_DATA,i);if(h===0||f!==1)throw new Error("Only 2D textures are supported");if(c!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(l!==1)throw new Error("WebGL does not support array textures");var v=4,_=4,g=u+3&-4,m=h+3&-4,y=new Array(l),b=u*h;o===0&&(b=g*m);var x;if(o!==0?ll[o]?x=ll[o]*Eb[a]:x=Tb[o]:x=Ri[s],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var A=e?Pb(n,p,i):null,P=b*x,T=P,w=u,E=h,R=g,O=m,C=Ca+p,k=0;k<d;k++){for(var B=n.getUint32(C,i),N=C+4,q=0;q<l;q++){var K=y[q];K||(K=y[q]=new Array(d)),K[k]={levelID:k,levelWidth:d>1||o!==0?w:R,levelHeight:d>1||o!==0?E:O,levelBuffer:new Uint8Array(t,N,T)},N+=T}C+=B+4,C=C%4!==0?C+4-C%4:C,w=w>>1||1,E=E>>1||1,R=w+v-1&~(v-1),O=E+_-1&~(_-1),T=R*O*x}return o!==0?{uncompressed:y.map(function(Q){var L=Q[0].levelBuffer,F=!1;return o===X.FLOAT?L=new Float32Array(Q[0].levelBuffer.buffer,Q[0].levelBuffer.byteOffset,Q[0].levelBuffer.byteLength/4):o===X.UNSIGNED_INT?(F=!0,L=new Uint32Array(Q[0].levelBuffer.buffer,Q[0].levelBuffer.byteOffset,Q[0].levelBuffer.byteLength/4)):o===X.INT&&(F=!0,L=new Int32Array(Q[0].levelBuffer.buffer,Q[0].levelBuffer.byteOffset,Q[0].levelBuffer.byteLength/4)),{resource:new xn(L,{width:Q[0].levelWidth,height:Q[0].levelHeight}),type:o,format:F?Ab(a):a}}),kvData:A}:{compressed:y.map(function(Q){return new Oa(null,{format:s,width:u,height:h,levels:d,levelBuffers:Q})}),kvData:A}}function Sb(r,t){for(var e=0;e<hl.length;e++)if(t.getUint8(e)!==hl[e])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function Ab(r){switch(r){case U.RGBA:return U.RGBA_INTEGER;case U.RGB:return U.RGB_INTEGER;case U.RG:return U.RG_INTEGER;case U.RED:return U.RED_INTEGER;default:return r}}function Pb(r,t,e){for(var n=new Map,i=0;i<t;){var o=r.getUint32(Ca+i,e),a=Ca+i+4,s=3-(o+3)%4;if(o===0||o>t-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u<o&&r.getUint8(a+u)!==0;u++);if(u===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var h=new TextDecoder().decode(new Uint8Array(r.buffer,a,u)),f=new DataView(r.buffer,a+u+1,o-u-1);n.set(h,f),i+=4+o+s}return n}Ot.setExtensionXhrType("dds",Ot.XHR_RESPONSE_TYPE.BUFFER);var Ob=function(){function r(){}return r.use=function(t,e){if(t.extension==="dds"&&t.data)try{Object.assign(t,sl(t.name||t.url,bb(t.data),t.metadata))}catch(n){e(n);return}e()},r.extension=gt.Loader,r}();Ot.setExtensionXhrType("ktx",Ot.XHR_RESPONSE_TYPE.BUFFER);var Rb=function(){function r(){}return r.use=function(t,e){if(t.extension==="ktx"&&t.data)try{var n=t.name||t.url,i=wb(n,t.data,this.loadKeyValueData),o=i.compressed,a=i.uncompressed,s=i.kvData;if(o){var u=sl(n,o,t.metadata);if(s&&u.textures)for(var h in u.textures)u.textures[h].baseTexture.ktxKeyValueData=s;Object.assign(t,u)}else if(a){var f={};a.forEach(function(l,c){var d=new J(new ut(l.resource,{mipmap:ae.OFF,alphaMode:se.NO_PREMULTIPLIED_ALPHA,type:l.type,format:l.format})),p=n+"-"+(c+1);s&&(d.baseTexture.ktxKeyValueData=s),ut.addToCache(d.baseTexture,p),J.addToCache(d,p),c===0&&(f[n]=d,ut.addToCache(d.baseTexture,n),J.addToCache(d,n)),f[p]=d}),Object.assign(t,{textures:f})}}catch(l){e(l);return}e()},r.extension=gt.Loader,r.loadKeyValueData=!1,r}();/*!
654
+ * @pixi/particle-container - v6.5.10
655
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
656
+ *
657
+ * @pixi/particle-container is licensed under the MIT License.
658
+ * http://www.opensource.org/licenses/mit-license
659
+ *//*! *****************************************************************************
660
+ Copyright (c) Microsoft Corporation.
661
+
662
+ Permission to use, copy, modify, and/or distribute this software for any
663
+ purpose with or without fee is hereby granted.
664
+
665
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
666
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
667
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
668
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
669
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
670
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
671
+ PERFORMANCE OF THIS SOFTWARE.
672
+ ***************************************************************************** */var Ma=function(r,t){return Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Ma(r,t)};function fl(r,t){Ma(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}(function(r){fl(t,r);function t(e,n,i,o){e===void 0&&(e=1500),i===void 0&&(i=16384),o===void 0&&(o=!1);var a=r.call(this)||this,s=16384;return i>s&&(i=s),a._properties=[!1,!0,!1,!1,!1],a._maxSize=e,a._batchSize=i,a._buffers=null,a._bufferUpdateIDs=[],a._updateID=0,a.interactiveChildren=!1,a.blendMode=j.NORMAL,a.autoResize=o,a.roundPixels=!0,a.baseTexture=null,a.setProperties(n),a._tint=0,a.tintRgb=new Float32Array(4),a.tint=16777215,a}return t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Gr(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var n=this;!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",function(){return n.onChildrenChange(0)})),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var n=Math.floor(e/this._batchSize);this._bufferUpdateIDs.length<n;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[n]=++this._updateID},t.prototype.dispose=function(){if(this._buffers){for(var e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._buffers=null}},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},t})(Ee);var cl=function(){function r(t,e,n){this.geometry=new En,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<t.length;++i){var o=t[i];o={attributeName:o.attributeName,size:o.size,uploadFunction:o.uploadFunction,type:o.type||X.FLOAT,offset:o.offset},e[i]?this.dynamicProperties.push(o):this.staticProperties.push(o)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new Dt(km(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var n=0;n<this.dynamicProperties.length;++n){var i=this.dynamicProperties[n];i.offset=e,e+=i.size,this.dynamicStride+=i.size}var o=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(o),this.dynamicDataUint32=new Uint32Array(o),this.dynamicBuffer=new Dt(this.dynamicData,!1,!1);var a=0;this.staticStride=0;for(var n=0;n<this.staticProperties.length;++n){var i=this.staticProperties[n];i.offset=a,a+=i.size,this.staticStride+=i.size}var s=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Dt(this.staticData,!0,!1);for(var n=0;n<this.dynamicProperties.length;++n){var i=this.dynamicProperties[n];t.addAttribute(i.attributeName,this.dynamicBuffer,0,i.type===X.UNSIGNED_BYTE,i.type,this.dynamicStride*4,i.offset*4)}for(var n=0;n<this.staticProperties.length;++n){var i=this.staticProperties[n];t.addAttribute(i.attributeName,this.staticBuffer,0,i.type===X.UNSIGNED_BYTE,i.type,this.staticStride*4,i.offset*4)}},r.prototype.uploadDynamic=function(t,e,n){for(var i=0;i<this.dynamicProperties.length;i++){var o=this.dynamicProperties[i];o.uploadFunction(t,e,n,o.type===X.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(t,e,n){for(var i=0;i<this.staticProperties.length;i++){var o=this.staticProperties[i];o.uploadFunction(t,e,n,o.type===X.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r}(),Ib=`varying vec2 vTextureCoord;
673
+ varying vec4 vColor;
674
+
675
+ uniform sampler2D uSampler;
676
+
677
+ void main(void){
678
+ vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
679
+ gl_FragColor = color;
680
+ }`,Cb=`attribute vec2 aVertexPosition;
681
+ attribute vec2 aTextureCoord;
682
+ attribute vec4 aColor;
683
+
684
+ attribute vec2 aPositionCoord;
685
+ attribute float aRotation;
686
+
687
+ uniform mat3 translationMatrix;
688
+ uniform vec4 uColor;
689
+
690
+ varying vec2 vTextureCoord;
691
+ varying vec4 vColor;
692
+
693
+ void main(void){
694
+ float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
695
+ float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
696
+
697
+ vec2 v = vec2(x, y);
698
+ v = v + aPositionCoord;
699
+
700
+ gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
701
+
702
+ vTextureCoord = aTextureCoord;
703
+ vColor = aColor * uColor;
704
+ }
705
+ `,Mb=function(r){fl(t,r);function t(e){var n=r.call(this,e)||this;return n.shader=null,n.properties=null,n.tempMatrix=new Mt,n.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:n.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:n.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:n.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:n.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:X.UNSIGNED_BYTE,uploadFunction:n.uploadTint,offset:0}],n.shader=je.from(Cb,Ib,{}),n.state=fr.for2d(),n}return t.prototype.render=function(e){var n=e.children,i=e._maxSize,o=e._batchSize,a=this.renderer,s=n.length;if(s!==0){s>i&&!e.autoResize&&(s=i);var u=e._buffers;u||(u=e._buffers=this.generateBuffers(e));var h=n[0]._texture.baseTexture,f=h.alphaMode>0;this.state.blendMode=lh(e.blendMode,f),a.state.set(this.state);var l=a.gl,c=e.worldTransform.copyTo(this.tempMatrix);c.prepend(a.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=Gm(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,f),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var d=!1,p=0,v=0;p<s;p+=o,v+=1){var _=s-p;_>o&&(_=o),v>=u.length&&u.push(this._generateOneMoreBuffer(e));var g=u[v];g.uploadDynamic(n,p,_);var m=e._bufferUpdateIDs[v]||0;d=d||g._updateID<m,d&&(g._updateID=e._updateID,g.uploadStatic(n,p,_)),a.geometry.bind(g.geometry),l.drawElements(l.TRIANGLES,_*6,l.UNSIGNED_SHORT,0)}}},t.prototype.generateBuffers=function(e){for(var n=[],i=e._maxSize,o=e._batchSize,a=e._properties,s=0;s<i;s+=o)n.push(new cl(this.properties,a,o));return n},t.prototype._generateOneMoreBuffer=function(e){var n=e._batchSize,i=e._properties;return new cl(this.properties,i,n)},t.prototype.uploadVertices=function(e,n,i,o,a,s){for(var u=0,h=0,f=0,l=0,c=0;c<i;++c){var d=e[n+c],p=d._texture,v=d.scale.x,_=d.scale.y,g=p.trim,m=p.orig;g?(h=g.x-d.anchor.x*m.width,u=h+g.width,l=g.y-d.anchor.y*m.height,f=l+g.height):(u=m.width*(1-d.anchor.x),h=m.width*-d.anchor.x,f=m.height*(1-d.anchor.y),l=m.height*-d.anchor.y),o[s]=h*v,o[s+1]=l*_,o[s+a]=u*v,o[s+a+1]=l*_,o[s+a*2]=u*v,o[s+a*2+1]=f*_,o[s+a*3]=h*v,o[s+a*3+1]=f*_,s+=a*4}},t.prototype.uploadPosition=function(e,n,i,o,a,s){for(var u=0;u<i;u++){var h=e[n+u].position;o[s]=h.x,o[s+1]=h.y,o[s+a]=h.x,o[s+a+1]=h.y,o[s+a*2]=h.x,o[s+a*2+1]=h.y,o[s+a*3]=h.x,o[s+a*3+1]=h.y,s+=a*4}},t.prototype.uploadRotation=function(e,n,i,o,a,s){for(var u=0;u<i;u++){var h=e[n+u].rotation;o[s]=h,o[s+a]=h,o[s+a*2]=h,o[s+a*3]=h,s+=a*4}},t.prototype.uploadUvs=function(e,n,i,o,a,s){for(var u=0;u<i;++u){var h=e[n+u]._texture._uvs;h?(o[s]=h.x0,o[s+1]=h.y0,o[s+a]=h.x1,o[s+a+1]=h.y1,o[s+a*2]=h.x2,o[s+a*2+1]=h.y2,o[s+a*3]=h.x3,o[s+a*3+1]=h.y3,s+=a*4):(o[s]=0,o[s+1]=0,o[s+a]=0,o[s+a+1]=0,o[s+a*2]=0,o[s+a*2+1]=0,o[s+a*3]=0,o[s+a*3+1]=0,s+=a*4)}},t.prototype.uploadTint=function(e,n,i,o,a,s){for(var u=0;u<i;++u){var h=e[n+u],f=h._texture.baseTexture.alphaMode>0,l=h.alpha,c=l<1&&f?Zo(h._tintRGB,l):h._tintRGB+(l*255<<24);o[s]=c,o[s+a]=c,o[s+a*2]=c,o[s+a*3]=c,s+=a*4}},t.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t.extension={name:"particle",type:gt.RendererPlugin},t}(mi);/*!
706
+ * @pixi/graphics - v6.5.10
707
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
708
+ *
709
+ * @pixi/graphics is licensed under the MIT License.
710
+ * http://www.opensource.org/licenses/mit-license
711
+ */var De;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(De||(De={}));var ze;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(ze||(ze={}));var Rn={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,t){if(t===void 0&&(t=20),!this.adaptive||!r||isNaN(r))return t;var e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}},dl=function(){function r(){this.color=16777215,this.alpha=1,this.texture=J.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var t=new r;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=J.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();/*! *****************************************************************************
712
+ Copyright (c) Microsoft Corporation.
713
+
714
+ Permission to use, copy, modify, and/or distribute this software for any
715
+ purpose with or without fee is hereby granted.
716
+
717
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
718
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
719
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
720
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
721
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
722
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
723
+ PERFORMANCE OF THIS SOFTWARE.
724
+ ***************************************************************************** */var Da=function(r,t){return Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Da(r,t)};function Fa(r,t){Da(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function pl(r,t){var e,n;t===void 0&&(t=!1);var i=r.length;if(!(i<6)){for(var o=0,a=0,s=r[i-2],u=r[i-1];a<i;a+=2){var h=r[a],f=r[a+1];o+=(h-s)*(f+u),s=h,u=f}if(!t&&o>0||t&&o<=0)for(var l=i/2,a=l+l%2;a<i;a+=2){var c=i-a-2,d=i-a-1,p=a,v=a+1;e=[r[p],r[c]],r[c]=e[0],r[p]=e[1],n=[r[v],r[d]],r[d]=n[0],r[v]=n[1]}}}var vl={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,t){var e=r.points,n=r.holes,i=t.points,o=t.indices;if(e.length>=6){pl(e,!1);for(var a=[],s=0;s<n.length;s++){var u=n[s];pl(u.points,!0),a.push(e.length/2),e=e.concat(u.points)}var h=vu(e,a,2);if(!h)return;for(var f=i.length/2,s=0;s<h.length;s+=3)o.push(h[s]+f),o.push(h[s+1]+f),o.push(h[s+2]+f);for(var s=0;s<e.length;s++)i.push(e[s])}}},Di={build:function(r){var t=r.points,e,n,i,o,a,s;if(r.type===Nt.CIRC){var u=r.shape;e=u.x,n=u.y,a=s=u.radius,i=o=0}else if(r.type===Nt.ELIP){var h=r.shape;e=h.x,n=h.y,a=h.width,s=h.height,i=o=0}else{var f=r.shape,l=f.width/2,c=f.height/2;e=f.x+l,n=f.y+c,a=s=Math.max(0,Math.min(f.radius,Math.min(l,c))),i=l-a,o=c-s}if(!(a>=0&&s>=0&&i>=0&&o>=0)){t.length=0;return}var d=Math.ceil(2.3*Math.sqrt(a+s)),p=d*8+(i?4:0)+(o?4:0);if(t.length=p,p!==0){if(d===0){t.length=8,t[0]=t[6]=e+i,t[1]=t[3]=n+o,t[2]=t[4]=e-i,t[5]=t[7]=n-o;return}var v=0,_=d*4+(i?2:0)+2,g=_,m=p;{var y=i+a,b=o,x=e+y,A=e-y,P=n+b;if(t[v++]=x,t[v++]=P,t[--_]=P,t[--_]=A,o){var T=n-b;t[g++]=A,t[g++]=T,t[--m]=T,t[--m]=x}}for(var w=1;w<d;w++){var E=Math.PI/2*(w/d),y=i+Math.cos(E)*a,b=o+Math.sin(E)*s,x=e+y,A=e-y,P=n+b,T=n-b;t[v++]=x,t[v++]=P,t[--_]=P,t[--_]=A,t[g++]=A,t[g++]=T,t[--m]=T,t[--m]=x}{var y=i,b=o+s,x=e+y,A=e-y,P=n+b,T=n-b;t[v++]=x,t[v++]=P,t[--m]=T,t[--m]=x,i&&(t[v++]=A,t[v++]=P,t[--m]=T,t[--m]=A)}}},triangulate:function(r,t){var e=r.points,n=t.points,i=t.indices;if(e.length!==0){var o=n.length/2,a=o,s,u;if(r.type!==Nt.RREC){var h=r.shape;s=h.x,u=h.y}else{var f=r.shape;s=f.x+f.width/2,u=f.y+f.height/2}var l=r.matrix;n.push(r.matrix?l.a*s+l.c*u+l.tx:s,r.matrix?l.b*s+l.d*u+l.ty:u),o++,n.push(e[0],e[1]);for(var c=2;c<e.length;c+=2)n.push(e[c],e[c+1]),i.push(o++,a,o);i.push(a+1,a,o)}}},Db={build:function(r){var t=r.shape,e=t.x,n=t.y,i=t.width,o=t.height,a=r.points;a.length=0,a.push(e,n,e+i,n,e+i,n+o,e,n+o)},triangulate:function(r,t){var e=r.points,n=t.points,i=n.length/2;n.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}};function Yr(r,t,e){var n=t-r;return r+n*e}function Fi(r,t,e,n,i,o,a){a===void 0&&(a=[]);for(var s=20,u=a,h=0,f=0,l=0,c=0,d=0,p=0,v=0,_=0;v<=s;++v)_=v/s,h=Yr(r,e,_),f=Yr(t,n,_),l=Yr(e,i,_),c=Yr(n,o,_),d=Yr(h,l,_),p=Yr(f,c,_),!(v===0&&u[u.length-2]===d&&u[u.length-1]===p)&&u.push(d,p);return u}var Fb={build:function(r){if(zr.nextRoundedRectBehavior){Di.build(r);return}var t=r.shape,e=r.points,n=t.x,i=t.y,o=t.width,a=t.height,s=Math.max(0,Math.min(t.radius,Math.min(o,a)/2));e.length=0,s?(Fi(n,i+s,n,i,n+s,i,e),Fi(n+o-s,i,n+o,i,n+o,i+s,e),Fi(n+o,i+a-s,n+o,i+a,n+o-s,i+a,e),Fi(n+s,i+a,n,i+a,n,i+a-s,e)):e.push(n,i,n+o,i,n+o,i+a,n,i+a)},triangulate:function(r,t){if(zr.nextRoundedRectBehavior){Di.triangulate(r,t);return}for(var e=r.points,n=t.points,i=t.indices,o=n.length/2,a=vu(e,null,2),s=0,u=a.length;s<u;s+=3)i.push(a[s]+o),i.push(a[s+1]+o),i.push(a[s+2]+o);for(var s=0,u=e.length;s<u;s++)n.push(e[s],e[++s])}};function _l(r,t,e,n,i,o,a,s){var u=r-e*i,h=t-n*i,f=r+e*o,l=t+n*o,c,d;a?(c=n,d=-e):(c=-n,d=e);var p=u+c,v=h+d,_=f+c,g=l+d;return s.push(p,v),s.push(_,g),2}function pr(r,t,e,n,i,o,a,s){var u=e-r,h=n-t,f=Math.atan2(u,h),l=Math.atan2(i-r,o-t);s&&f<l?f+=Math.PI*2:!s&&f>l&&(l+=Math.PI*2);var c=f,d=l-f,p=Math.abs(d),v=Math.sqrt(u*u+h*h),_=(15*p*Math.sqrt(v)/Math.PI>>0)+1,g=d/_;if(c+=g,s){a.push(r,t),a.push(e,n);for(var m=1,y=c;m<_;m++,y+=g)a.push(r,t),a.push(r+Math.sin(y)*v,t+Math.cos(y)*v);a.push(r,t),a.push(i,o)}else{a.push(e,n),a.push(r,t);for(var m=1,y=c;m<_;m++,y+=g)a.push(r+Math.sin(y)*v,t+Math.cos(y)*v),a.push(r,t);a.push(i,o),a.push(r,t)}return _*2}function Bb(r,t){var e=r.shape,n=r.points||e.points.slice(),i=t.closePointEps;if(n.length!==0){var o=r.lineStyle,a=new Et(n[0],n[1]),s=new Et(n[n.length-2],n[n.length-1]),u=e.type!==Nt.POLY||e.closeStroke,h=Math.abs(a.x-s.x)<i&&Math.abs(a.y-s.y)<i;if(u){n=n.slice(),h&&(n.pop(),n.pop(),s.set(n[n.length-2],n[n.length-1]));var f=(a.x+s.x)*.5,l=(s.y+a.y)*.5;n.unshift(f,l),n.push(f,l)}var c=t.points,d=n.length/2,p=n.length,v=c.length/2,_=o.width/2,g=_*_,m=o.miterLimit*o.miterLimit,y=n[0],b=n[1],x=n[2],A=n[3],P=0,T=0,w=-(b-A),E=y-x,R=0,O=0,C=Math.sqrt(w*w+E*E);w/=C,E/=C,w*=_,E*=_;var k=o.alignment,B=(1-k)*2,N=k*2;u||(o.cap===ze.ROUND?p+=pr(y-w*(B-N)*.5,b-E*(B-N)*.5,y-w*B,b-E*B,y+w*N,b+E*N,c,!0)+2:o.cap===ze.SQUARE&&(p+=_l(y,b,w,E,B,N,!0,c))),c.push(y-w*B,b-E*B),c.push(y+w*N,b+E*N);for(var q=1;q<d-1;++q){y=n[(q-1)*2],b=n[(q-1)*2+1],x=n[q*2],A=n[q*2+1],P=n[(q+1)*2],T=n[(q+1)*2+1],w=-(b-A),E=y-x,C=Math.sqrt(w*w+E*E),w/=C,E/=C,w*=_,E*=_,R=-(A-T),O=x-P,C=Math.sqrt(R*R+O*O),R/=C,O/=C,R*=_,O*=_;var K=x-y,Q=b-A,L=x-P,F=T-A,H=K*L+Q*F,tt=Q*L-F*K,rt=tt<0;if(Math.abs(tt)<.001*Math.abs(H)){c.push(x-w*B,A-E*B),c.push(x+w*N,A+E*N),H>=0&&(o.join===De.ROUND?p+=pr(x,A,x-w*B,A-E*B,x-R*B,A-O*B,c,!1)+4:p+=2,c.push(x-R*N,A-O*N),c.push(x+R*B,A+O*B));continue}var vt=(-w+y)*(-E+A)-(-w+x)*(-E+b),Y=(-R+P)*(-O+A)-(-R+x)*(-O+T),ht=(K*Y-L*vt)/tt,mt=(F*vt-Q*Y)/tt,Tt=(ht-x)*(ht-x)+(mt-A)*(mt-A),W=x+(ht-x)*B,it=A+(mt-A)*B,at=x-(ht-x)*N,ct=A-(mt-A)*N,nt=Math.min(K*K+Q*Q,L*L+F*F),D=rt?B:N,I=nt+D*D*g,dt=Tt<=I;dt?o.join===De.BEVEL||Tt/g>m?(rt?(c.push(W,it),c.push(x+w*N,A+E*N),c.push(W,it),c.push(x+R*N,A+O*N)):(c.push(x-w*B,A-E*B),c.push(at,ct),c.push(x-R*B,A-O*B),c.push(at,ct)),p+=2):o.join===De.ROUND?rt?(c.push(W,it),c.push(x+w*N,A+E*N),p+=pr(x,A,x+w*N,A+E*N,x+R*N,A+O*N,c,!0)+4,c.push(W,it),c.push(x+R*N,A+O*N)):(c.push(x-w*B,A-E*B),c.push(at,ct),p+=pr(x,A,x-w*B,A-E*B,x-R*B,A-O*B,c,!1)+4,c.push(x-R*B,A-O*B),c.push(at,ct)):(c.push(W,it),c.push(at,ct)):(c.push(x-w*B,A-E*B),c.push(x+w*N,A+E*N),o.join===De.ROUND?rt?p+=pr(x,A,x+w*N,A+E*N,x+R*N,A+O*N,c,!0)+2:p+=pr(x,A,x-w*B,A-E*B,x-R*B,A-O*B,c,!1)+2:o.join===De.MITER&&Tt/g<=m&&(rt?(c.push(at,ct),c.push(at,ct)):(c.push(W,it),c.push(W,it)),p+=2),c.push(x-R*B,A-O*B),c.push(x+R*N,A+O*N),p+=2)}y=n[(d-2)*2],b=n[(d-2)*2+1],x=n[(d-1)*2],A=n[(d-1)*2+1],w=-(b-A),E=y-x,C=Math.sqrt(w*w+E*E),w/=C,E/=C,w*=_,E*=_,c.push(x-w*B,A-E*B),c.push(x+w*N,A+E*N),u||(o.cap===ze.ROUND?p+=pr(x-w*(B-N)*.5,A-E*(B-N)*.5,x-w*B,A-E*B,x+w*N,A+E*N,c,!1)+2:o.cap===ze.SQUARE&&(p+=_l(x,A,w,E,B,N,!1,c)));for(var we=t.indices,Qr=Rn.epsilon*Rn.epsilon,q=v;q<p+v-2;++q)y=c[q*2],b=c[q*2+1],x=c[(q+1)*2],A=c[(q+1)*2+1],P=c[(q+2)*2],T=c[(q+2)*2+1],!(Math.abs(y*(A-T)+x*(T-b)+P*(b-A))<Qr)&&we.push(q,q+1,q+2)}}function Nb(r,t){var e=0,n=r.shape,i=r.points||n.points,o=n.type!==Nt.POLY||n.closeStroke;if(i.length!==0){var a=t.points,s=t.indices,u=i.length/2,h=a.length/2,f=h;for(a.push(i[0],i[1]),e=1;e<u;e++)a.push(i[e*2],i[e*2+1]),s.push(f,f+1),f++;o&&s.push(f,h)}}function gl(r,t){r.lineStyle.native?Nb(r,t):Bb(r,t)}var ml=function(){function r(){}return r.curveTo=function(t,e,n,i,o,a){var s=a[a.length-2],u=a[a.length-1],h=u-e,f=s-t,l=i-e,c=n-t,d=Math.abs(h*c-f*l);if(d<1e-8||o===0)return(a[a.length-2]!==t||a[a.length-1]!==e)&&a.push(t,e),null;var p=h*h+f*f,v=l*l+c*c,_=h*l+f*c,g=o*Math.sqrt(p)/d,m=o*Math.sqrt(v)/d,y=g*_/p,b=m*_/v,x=g*c+m*f,A=g*l+m*h,P=f*(m+y),T=h*(m+y),w=c*(g+b),E=l*(g+b),R=Math.atan2(T-A,P-x),O=Math.atan2(E-A,w-x);return{cx:x+t,cy:A+e,radius:o,startAngle:R,endAngle:O,anticlockwise:f*l>c*h}},r.arc=function(t,e,n,i,o,a,s,u,h){for(var f=s-a,l=Rn._segmentsCount(Math.abs(f)*o,Math.ceil(Math.abs(f)/fi)*40),c=f/(l*2),d=c*2,p=Math.cos(c),v=Math.sin(c),_=l-1,g=_%1/_,m=0;m<=_;++m){var y=m+g*m,b=c+a+d*y,x=Math.cos(b),A=-Math.sin(b);h.push((p*x+v*A)*o+n,(p*-A+v*x)*o+i)}},r}(),Lb=function(){function r(){}return r.curveLength=function(t,e,n,i,o,a,s,u){for(var h=10,f=0,l=0,c=0,d=0,p=0,v=0,_=0,g=0,m=0,y=0,b=0,x=t,A=e,P=1;P<=h;++P)l=P/h,c=l*l,d=c*l,p=1-l,v=p*p,_=v*p,g=_*t+3*v*l*n+3*p*c*o+d*s,m=_*e+3*v*l*i+3*p*c*a+d*u,y=x-g,b=A-m,x=g,A=m,f+=Math.sqrt(y*y+b*b);return f},r.curveTo=function(t,e,n,i,o,a,s){var u=s[s.length-2],h=s[s.length-1];s.length-=2;var f=Rn._segmentsCount(r.curveLength(u,h,t,e,n,i,o,a)),l=0,c=0,d=0,p=0,v=0;s.push(u,h);for(var _=1,g=0;_<=f;++_)g=_/f,l=1-g,c=l*l,d=c*l,p=g*g,v=p*g,s.push(d*u+3*c*g*t+3*l*p*n+v*o,d*h+3*c*g*e+3*l*p*i+v*a)},r}(),Ub=function(){function r(){}return r.curveLength=function(t,e,n,i,o,a){var s=t-2*n+o,u=e-2*i+a,h=2*n-2*t,f=2*i-2*e,l=4*(s*s+u*u),c=4*(s*h+u*f),d=h*h+f*f,p=2*Math.sqrt(l+c+d),v=Math.sqrt(l),_=2*l*v,g=2*Math.sqrt(d),m=c/v;return(_*p+v*c*(p-g)+(4*d*l-c*c)*Math.log((2*v+m+p)/(m+g)))/(4*_)},r.curveTo=function(t,e,n,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=Rn._segmentsCount(r.curveLength(a,s,t,e,n,i)),h=0,f=0,l=1;l<=u;++l){var c=l/u;h=a+(t-a)*c,f=s+(e-s)*c,o.push(h+(t+(n-t)*c-h)*c,f+(e+(i-e)*c-f)*c)}},r}(),Gb=function(){function r(){this.reset()}return r.prototype.begin=function(t,e,n){this.reset(),this.style=t,this.start=e,this.attribStart=n},r.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),vr,Ba=(vr={},vr[Nt.POLY]=vl,vr[Nt.CIRC]=Di,vr[Nt.ELIP]=Di,vr[Nt.RECT]=Db,vr[Nt.RREC]=Fb,vr),yl=[],Bi=[],bl=function(){function r(t,e,n,i){e===void 0&&(e=null),n===void 0&&(n=null),i===void 0&&(i=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=n,this.fillStyle=e,this.matrix=i,this.type=t.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),Vr=new Et,kb=function(r){Fa(t,r);function t(){var e=r.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new vi,e.boundsDirty=-1,e}return Object.defineProperty(t.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Bi.push(this.drawCalls[e]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var n=this.batches[e];n.reset(),yl.push(n)}this.batches.length=0},t.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,n,i,o){n===void 0&&(n=null),i===void 0&&(i=null),o===void 0&&(o=null);var a=new bl(e,n,i,o);return this.graphicsData.push(a),this.dirty++,this},t.prototype.drawHole=function(e,n){if(n===void 0&&(n=null),!this.graphicsData.length)return null;var i=new bl(e,null,null,n),o=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=o.lineStyle,o.holes.push(i),this.dirty++,this},t.prototype.destroy=function(){r.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},t.prototype.containsPoint=function(e){for(var n=this.graphicsData,i=0;i<n.length;++i){var o=n[i];if(o.fillStyle.visible&&o.shape&&(o.matrix?o.matrix.applyInverse(e,Vr):Vr.copyFrom(e),o.shape.contains(Vr.x,Vr.y))){var a=!1;if(o.holes)for(var s=0;s<o.holes.length;s++){var u=o.holes[s];if(u.shape.contains(Vr.x,Vr.y)){a=!0;break}}if(!a)return!0}}return!1},t.prototype.updateBatches=function(){if(!this.graphicsData.length){this.batchable=!0;return}if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,n=this.graphicsData,i=null,o=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],o=i.style);for(var a=this.shapeIndex;a<n.length;a++){this.shapeIndex++;var s=n[a],u=s.fillStyle,h=s.lineStyle,f=Ba[s.type];f.build(s),s.matrix&&this.transformPoints(s.points,s.matrix),(u.visible||h.visible)&&this.processHoles(s.holes);for(var l=0;l<2;l++){var c=l===0?u:h;if(c.visible){var d=c.texture.baseTexture,p=this.indices.length,v=this.points.length/2;d.wrapMode=ge.REPEAT,l===0?this.processFill(s):this.processLine(s);var _=this.points.length/2-v;_!==0&&(i&&!this._compareStyles(o,c)&&(i.end(p,v),i=null),i||(i=yl.pop()||new Gb,i.begin(c,p,v),this.batches.push(i),o=c),this.addUvs(this.points,e,c.texture,v,_,c.matrix))}}}var g=this.indices.length,m=this.points.length/2;if(i&&i.end(g,m),this.batches.length===0){this.batchable=!0;return}var y=m>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&y===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},t.prototype._compareStyles=function(e,n){return!(!e||!n||e.texture.baseTexture!==n.texture.baseTexture||e.color+e.alpha!==n.color+n.alpha||!!e.native!=!!n.native)},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,n=this.graphicsData.length;e<n;e++){var i=this.graphicsData[e],o=i.fillStyle,a=i.lineStyle;if(o&&!o.texture.baseTexture.valid||a&&!a.texture.baseTexture.valid)return!1}return!0},t.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var e=this.batches,n=0,i=e.length;n<i;n++)for(var o=e[n],a=0;a<o.size;a++){var s=o.start+a;this.indicesUint16[s]=this.indicesUint16[s]-o.attribStart}},t.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var e=this.batches,n=0;n<e.length;n++)if(e[n].style.native)return!1;return this.points.length<t.BATCHABLE_SIZE*2},t.prototype.buildDrawCalls=function(){for(var e=++ut._globalBatch,n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),Bi.push(this.drawCalls[n]);this.drawCalls.length=0;var i=this.colors,o=this.textureIds,a=Bi.pop();a||(a=new ma,a.texArray=new ya),a.texArray.count=0,a.start=0,a.size=0,a.type=oe.TRIANGLES;var s=0,u=null,h=0,f=!1,l=oe.TRIANGLES,c=0;this.drawCalls.push(a);for(var n=0;n<this.batches.length;n++){var d=this.batches[n],p=8,v=d.style,_=v.texture.baseTexture;f!==!!v.native&&(f=!!v.native,l=f?oe.LINES:oe.TRIANGLES,u=null,s=p,e++),u!==_&&(u=_,_._batchEnabled!==e&&(s===p&&(e++,s=0,a.size>0&&(a=Bi.pop(),a||(a=new ma,a.texArray=new ya),this.drawCalls.push(a)),a.start=c,a.size=0,a.texArray.count=0,a.type=l),_.touched=1,_._batchEnabled=e,_._batchLocation=s,_.wrapMode=ge.REPEAT,a.texArray.elements[a.texArray.count++]=_,s++)),a.size+=d.size,c+=d.size,h=_._batchLocation,this.addColors(i,v.color,v.alpha,d.attribSize,d.attribStart),this.addTextureIds(o,h,d.attribSize,d.attribStart)}ut._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,n=this.uvs,i=this.colors,o=this.textureIds,a=new ArrayBuffer(e.length*3*4),s=new Float32Array(a),u=new Uint32Array(a),h=0,f=0;f<e.length/2;f++)s[h++]=e[f*2],s[h++]=e[f*2+1],s[h++]=n[f*2],s[h++]=n[f*2+1],u[h++]=i[f],s[h++]=o[f];this._buffer.update(a),this._indexBuffer.update(this.indicesUint16)},t.prototype.processFill=function(e){if(e.holes.length)vl.triangulate(e,this);else{var n=Ba[e.type];n.triangulate(e,this)}},t.prototype.processLine=function(e){gl(e,this);for(var n=0;n<e.holes.length;n++)gl(e.holes[n],this)},t.prototype.processHoles=function(e){for(var n=0;n<e.length;n++){var i=e[n],o=Ba[i.type];o.build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},t.prototype.calculateBounds=function(){var e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)},t.prototype.transformPoints=function(e,n){for(var i=0;i<e.length/2;i++){var o=e[i*2],a=e[i*2+1];e[i*2]=n.a*o+n.c*a+n.tx,e[i*2+1]=n.b*o+n.d*a+n.ty}},t.prototype.addColors=function(e,n,i,o,a){a===void 0&&(a=0);var s=(n>>16)+(n&65280)+((n&255)<<16),u=Zo(s,i);e.length=Math.max(e.length,a+o);for(var h=0;h<o;h++)e[a+h]=u},t.prototype.addTextureIds=function(e,n,i,o){o===void 0&&(o=0),e.length=Math.max(e.length,o+i);for(var a=0;a<i;a++)e[o+a]=n},t.prototype.addUvs=function(e,n,i,o,a,s){s===void 0&&(s=null);for(var u=0,h=n.length,f=i.frame;u<a;){var l=e[(o+u)*2],c=e[(o+u)*2+1];if(s){var d=s.a*l+s.c*c+s.tx;c=s.b*l+s.d*c+s.ty,l=d}u++,n.push(l/f.width,c/f.height)}var p=i.baseTexture;(f.width<p.width||f.height<p.height)&&this.adjustUvs(n,i,h,a)},t.prototype.adjustUvs=function(e,n,i,o){for(var a=n.baseTexture,s=1e-6,u=i+o*2,h=n.frame,f=h.width/a.width,l=h.height/a.height,c=h.x/h.width,d=h.y/h.height,p=Math.floor(e[i]+s),v=Math.floor(e[i+1]+s),_=i+2;_<u;_+=2)p=Math.min(p,Math.floor(e[_]+s)),v=Math.min(v,Math.floor(e[_+1]+s));c-=p,d-=v;for(var _=i;_<u;_+=2)e[_]=(e[_]+c)*f,e[_+1]=(e[_+1]+d)*l},t.BATCHABLE_SIZE=100,t}(qh),Hb=function(r){Fa(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=ze.BUTT,e.join=De.MITER,e.miterLimit=10,e}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e},t.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},t}(dl),Xb=new Float32Array(3),Na={},zr=function(r){Fa(t,r);function t(e){e===void 0&&(e=null);var n=r.call(this)||this;return n.shader=null,n.pluginName="batch",n.currentPath=null,n.batches=[],n.batchTint=-1,n.batchDirty=-1,n.vertexData=null,n._fillStyle=new dl,n._lineStyle=new Hb,n._matrix=null,n._holeMode=!1,n.state=fr.for2d(),n._geometry=e||new kb,n._geometry.refCount++,n._transformID=-1,n.tint=16777215,n.blendMode=j.NORMAL,n}return Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return this.finishPoly(),new t(this._geometry)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),t.prototype.lineStyle=function(e,n,i,o,a){return e===void 0&&(e=null),n===void 0&&(n=0),i===void 0&&(i=1),o===void 0&&(o=.5),a===void 0&&(a=!1),typeof e=="number"&&(e={width:e,color:n,alpha:i,alignment:o,native:a}),this.lineTextureStyle(e)},t.prototype.lineTextureStyle=function(e){e=Object.assign({width:0,texture:J.WHITE,color:e&&e.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:ze.BUTT,join:De.MITER,miterLimit:10},e),this.currentPath&&this.startPoly();var n=e.width>0&&e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:n},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,n=this.currentPath.points.length;n>2&&(this.drawShape(this.currentPath),this.currentPath=new di,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[n-2],e[n-1]))}else this.currentPath=new di,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,n){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=n,this},t.prototype.lineTo=function(e,n){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,o=i[i.length-2],a=i[i.length-1];return(o!==e||a!==n)&&i.push(e,n),this},t.prototype._initCurve=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,n]):this.moveTo(e,n)},t.prototype.quadraticCurveTo=function(e,n,i,o){this._initCurve();var a=this.currentPath.points;return a.length===0&&this.moveTo(0,0),Ub.curveTo(e,n,i,o,a),this},t.prototype.bezierCurveTo=function(e,n,i,o,a,s){return this._initCurve(),Lb.curveTo(e,n,i,o,a,s,this.currentPath.points),this},t.prototype.arcTo=function(e,n,i,o,a){this._initCurve(e,n);var s=this.currentPath.points,u=ml.curveTo(e,n,i,o,a,s);if(u){var h=u.cx,f=u.cy,l=u.radius,c=u.startAngle,d=u.endAngle,p=u.anticlockwise;this.arc(h,f,l,c,d,p)}return this},t.prototype.arc=function(e,n,i,o,a,s){if(s===void 0&&(s=!1),o===a)return this;!s&&a<=o?a+=fi:s&&o<=a&&(o+=fi);var u=a-o;if(u===0)return this;var h=e+Math.cos(o)*i,f=n+Math.sin(o)*i,l=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var d=Math.abs(c[c.length-2]-h),p=Math.abs(c[c.length-1]-f);d<l&&p<l||c.push(h,f)}else this.moveTo(h,f),c=this.currentPath.points;return ml.arc(h,f,e,n,i,o,a,s,c),this},t.prototype.beginFill=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=1),this.beginTextureFill({texture:J.WHITE,color:e,alpha:n})},t.prototype.beginTextureFill=function(e){e=Object.assign({texture:J.WHITE,color:16777215,alpha:1,matrix:null},e),this.currentPath&&this.startPoly();var n=e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:n},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,n,i,o){return this.drawShape(new st(e,n,i,o))},t.prototype.drawRoundedRect=function(e,n,i,o,a){return this.drawShape(new qm(e,n,i,o,a))},t.prototype.drawCircle=function(e,n,i){return this.drawShape(new zm(e,n,i))},t.prototype.drawEllipse=function(e,n,i,o){return this.drawShape(new Wm(e,n,i,o))},t.prototype.drawPolygon=function(){for(var e=arguments,n=[],i=0;i<arguments.length;i++)n[i]=e[i];var o,a=!0,s=n[0];s.points?(a=s.closeStroke,o=s.points):Array.isArray(n[0])?o=n[0]:o=n;var u=new di(o);return u.closeStroke=a,this.drawShape(u),this},t.prototype.drawShape=function(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},t.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},t.prototype.isFastRect=function(){var e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Nt.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)},t.prototype._render=function(e){this.finishPoly();var n=this._geometry;n.updateBatches(),n.batchable?(this.batchDirty!==n.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))},t.prototype._populateBatches=function(){var e=this._geometry,n=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(var o=0;o<i;o++){var a=e.batches[o],s=a.style.color,u=new Float32Array(this.vertexData.buffer,a.attribStart*4*2,a.attribSize*2),h=new Float32Array(e.uvsFloat32.buffer,a.attribStart*4*2,a.attribSize*2),f=new Uint16Array(e.indicesUint16.buffer,a.start*2,a.size),l={vertexData:u,blendMode:n,indices:f,uvs:h,_batchRGB:Gr(s),_tintRGB:s,_texture:a.style.texture,alpha:a.style.alpha,worldAlpha:1};this.batches[o]=l}},t.prototype._renderBatched=function(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var n=0,i=this.batches.length;n<i;n++){var o=this.batches[n];o.worldAlpha=this.worldAlpha*o.alpha,e.plugins[this.pluginName].render(o)}}},t.prototype._renderDirect=function(e){var n=this._resolveDirectShader(e),i=this._geometry,o=this.tint,a=this.worldAlpha,s=n.uniforms,u=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(o>>16&255)/255*a,s.tint[1]=(o>>8&255)/255*a,s.tint[2]=(o&255)/255*a,s.tint[3]=a,e.shader.bind(n),e.geometry.bind(i,n),e.state.set(this.state);for(var h=0,f=u.length;h<f;h++)this._renderDrawCallDirect(e,i.drawCalls[h])},t.prototype._renderDrawCallDirect=function(e,n){for(var i=n.texArray,o=n.type,a=n.size,s=n.start,u=i.count,h=0;h<u;h++)e.texture.bind(i.elements[h],h);e.geometry.draw(o,a,s)},t.prototype._resolveDirectShader=function(e){var n=this.shader,i=this.pluginName;if(!n){if(!Na[i]){for(var o=e.plugins[i].MAX_TEXTURES,a=new Int32Array(o),s=0;s<o;s++)a[s]=s;var u={tint:new Float32Array([1,1,1,1]),translationMatrix:new Mt,default:lr.from({uSamplers:a},!0)},h=e.plugins[i]._shader.program;Na[i]=new je(h,u)}n=Na[i]}return n},t.prototype._calculateBounds=function(){this.finishPoly();var e=this._geometry;if(e.graphicsData.length){var n=e.bounds,i=n.minX,o=n.minY,a=n.maxX,s=n.maxY;this._bounds.addFrame(this.transform,i,o,a,s)}},t.prototype.containsPoint=function(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)},t.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var e=Gr(this.tint,Xb),n=0;n<this.batches.length;n++){var i=this.batches[n],o=i._batchRGB,a=e[0]*o[0]*255,s=e[1]*o[1]*255,u=e[2]*o[2]*255,h=(a<<16)+(s<<8)+(u|0);i._tintRGB=(h>>16)+(h&65280)+((h&255)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var n=this.transform.worldTransform,i=n.a,o=n.b,a=n.c,s=n.d,u=n.tx,h=n.ty,f=this._geometry.points,l=this.vertexData,c=0,d=0;d<f.length;d+=2){var p=f[d],v=f[d+1];l[c++]=i*p+a*v+u,l[c++]=s*v+o*p+h}}},t.prototype.closePath=function(){var e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this},t.prototype.setMatrix=function(e){return this._matrix=e,this},t.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},t.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},t.prototype.destroy=function(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,e)},t.nextRoundedRectBehavior=!1,t._TEMP_POINT=new Et,t}(Ee);/*!
725
+ * @pixi/sprite - v6.5.10
726
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
727
+ *
728
+ * @pixi/sprite is licensed under the MIT License.
729
+ * http://www.opensource.org/licenses/mit-license
730
+ *//*! *****************************************************************************
731
+ Copyright (c) Microsoft Corporation.
732
+
733
+ Permission to use, copy, modify, and/or distribute this software for any
734
+ purpose with or without fee is hereby granted.
735
+
736
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
737
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
738
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
739
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
740
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
741
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
742
+ PERFORMANCE OF THIS SOFTWARE.
743
+ ***************************************************************************** */var La=function(r,t){return La=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},La(r,t)};function jb(r,t){La(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var In=new Et,Yb=new Uint16Array([0,1,2,0,2,3]),Cn=function(r){jb(t,r);function t(e){var n=r.call(this)||this;return n._anchor=new Xr(n._onAnchorUpdate,n,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),n._texture=null,n._width=0,n._height=0,n._tint=null,n._tintRGB=null,n.tint=16777215,n.blendMode=j.NORMAL,n._cachedTint=16777215,n.uvs=null,n.texture=e||J.EMPTY,n.vertexData=new Float32Array(8),n.vertexTrimmedData=null,n._transformID=-1,n._textureID=-1,n._transformTrimmedID=-1,n._textureTrimmedID=-1,n.indices=Yb,n.pluginName="batch",n.isSprite=!0,n._roundPixels=G.ROUND_PIXELS,n}return t.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Hr(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Hr(this.scale.y)*this._height/this._texture.orig.height)},t.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},t.prototype.calculateVertices=function(){var e=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===e._updateID)){this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;var n=this.transform.worldTransform,i=n.a,o=n.b,a=n.c,s=n.d,u=n.tx,h=n.ty,f=this.vertexData,l=e.trim,c=e.orig,d=this._anchor,p=0,v=0,_=0,g=0;if(l?(v=l.x-d._x*c.width,p=v+l.width,g=l.y-d._y*c.height,_=g+l.height):(v=-d._x*c.width,p=v+c.width,g=-d._y*c.height,_=g+c.height),f[0]=i*v+a*g+u,f[1]=s*g+o*v+h,f[2]=i*p+a*g+u,f[3]=s*g+o*p+h,f[4]=i*p+a*_+u,f[5]=s*_+o*p+h,f[6]=i*v+a*_+u,f[7]=s*_+o*v+h,this._roundPixels)for(var m=G.RESOLUTION,y=0;y<f.length;++y)f[y]=Math.round((f[y]*m|0)/m)}},t.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var e=this._texture,n=this.vertexTrimmedData,i=e.orig,o=this._anchor,a=this.transform.worldTransform,s=a.a,u=a.b,h=a.c,f=a.d,l=a.tx,c=a.ty,d=-o._x*i.width,p=d+i.width,v=-o._y*i.height,_=v+i.height;n[0]=s*d+h*v+l,n[1]=f*v+u*d+c,n[2]=s*p+h*v+l,n[3]=f*v+u*p+c,n[4]=s*p+h*_+l,n[5]=f*_+u*p+c,n[6]=s*d+h*_+l,n[7]=f*_+u*d+c},t.prototype._render=function(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)},t.prototype._calculateBounds=function(){var e=this._texture.trim,n=this._texture.orig;!e||e.width===n.width&&e.height===n.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},t.prototype.getLocalBounds=function(e){return this.children.length===0?(this._localBounds||(this._localBounds=new vi),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new st),e=this._localBoundsRect),this._localBounds.getRectangle(e)):r.prototype.getLocalBounds.call(this,e)},t.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,In);var n=this._texture.orig.width,i=this._texture.orig.height,o=-n*this.anchor.x,a=0;return In.x>=o&&In.x<o+n&&(a=-i*this.anchor.y,In.y>=a&&In.y<a+i)},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var n=typeof e=="boolean"?e:e&&e.texture;if(n){var i=typeof e=="boolean"?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null},t.from=function(e,n){var i=e instanceof J?e:J.from(e,n);return new t(i)},Object.defineProperty(t.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){var n=Hr(this.scale.x)||1;this.scale.x=n*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){var n=Hr(this.scale.y)||1;this.scale.y=n*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anchor",{get:function(){return this._anchor},set:function(e){this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||J.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(Ee);/*!
744
+ * @pixi/text - v6.5.10
745
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
746
+ *
747
+ * @pixi/text is licensed under the MIT License.
748
+ * http://www.opensource.org/licenses/mit-license
749
+ *//*! *****************************************************************************
750
+ Copyright (c) Microsoft Corporation.
751
+
752
+ Permission to use, copy, modify, and/or distribute this software for any
753
+ purpose with or without fee is hereby granted.
754
+
755
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
756
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
757
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
758
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
759
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
760
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
761
+ PERFORMANCE OF THIS SOFTWARE.
762
+ ***************************************************************************** */var Ua=function(r,t){return Ua=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Ua(r,t)};function Vb(r,t){Ua(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Mn;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Mn||(Mn={}));var Ga={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Mn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},zb=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wr=function(){function r(t){this.styleID=0,this.reset(),Ha(this,t,t)}return r.prototype.clone=function(){var t={};return Ha(t,this,Ga),new r(t)},r.prototype.reset=function(){Ha(this,Ga,Ga)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=ka(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=ka(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){Wb(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=ka(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var t=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var n=e.length-1;n>=0;n--){var i=e[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&zb.indexOf(i)<0&&(i='"'+i+'"'),e[n]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},r}();function xl(r){return typeof r=="number"?uh(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function ka(r){if(Array.isArray(r)){for(var t=0;t<r.length;++t)r[t]=xl(r[t]);return r}else return xl(r)}function Wb(r,t){if(!Array.isArray(r)||!Array.isArray(t)||r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}function Ha(r,t,e){for(var n in e)Array.isArray(t[n])?r[n]=t[n].slice():r[n]=t[n]}var Ni={willReadFrequently:!0},Te=function(){function r(t,e,n,i,o,a,s,u,h){this.text=t,this.style=e,this.width=n,this.height=i,this.lines=o,this.lineWidths=a,this.lineHeight=s,this.maxLineWidth=u,this.fontProperties=h}return r.measureText=function(t,e,n,i){i===void 0&&(i=r._canvas),n=n??e.wordWrap;var o=e.toFontString(),a=r.measureFont(o);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);var s=i.getContext("2d",Ni);s.font=o;for(var u=n?r.wordWrap(t,e,i):t,h=u.split(/(?:\r\n|\r|\n)/),f=new Array(h.length),l=0,c=0;c<h.length;c++){var d=s.measureText(h[c]).width+(h[c].length-1)*e.letterSpacing;f[c]=d,l=Math.max(l,d)}var p=l+e.strokeThickness;e.dropShadow&&(p+=e.dropShadowDistance);var v=e.lineHeight||a.fontSize+e.strokeThickness,_=Math.max(v,a.fontSize+e.strokeThickness)+(h.length-1)*(v+e.leading);return e.dropShadow&&(_+=e.dropShadowDistance),new r(t,e,p,_,h,f,v+e.leading,l,a)},r.wordWrap=function(t,e,n){n===void 0&&(n=r._canvas);for(var i=n.getContext("2d",Ni),o=0,a="",s="",u=Object.create(null),h=e.letterSpacing,f=e.whiteSpace,l=r.collapseSpaces(f),c=r.collapseNewlines(f),d=!l,p=e.wordWrapWidth+h,v=r.tokenize(t),_=0;_<v.length;_++){var g=v[_];if(r.isNewline(g)){if(!c){s+=r.addLine(a),d=!l,a="",o=0;continue}g=" "}if(l){var m=r.isBreakingSpace(g),y=r.isBreakingSpace(a[a.length-1]);if(m&&y)continue}var b=r.getFromCache(g,h,u,i);if(b>p)if(a!==""&&(s+=r.addLine(a),a="",o=0),r.canBreakWords(g,e.breakWords))for(var x=r.wordWrapSplit(g),A=0;A<x.length;A++){for(var P=x[A],T=1;x[A+T];){var w=x[A+T],E=P[P.length-1];if(!r.canBreakChars(E,w,g,A,e.breakWords))P+=w;else break;T++}A+=P.length-1;var R=r.getFromCache(P,h,u,i);R+o>p&&(s+=r.addLine(a),d=!1,a="",o=0),a+=P,o+=R}else{a.length>0&&(s+=r.addLine(a),a="",o=0);var O=_===v.length-1;s+=r.addLine(g,!O),d=!1,a="",o=0}else b+o>p&&(d=!1,s+=r.addLine(a),a="",o=0),(a.length>0||!r.isBreakingSpace(g)||d)&&(a+=g,o+=b)}return s+=r.addLine(a,!1),s},r.addLine=function(t,e){return e===void 0&&(e=!0),t=r.trimRight(t),t=e?t+`
763
+ `:t,t},r.getFromCache=function(t,e,n,i){var o=n[t];if(typeof o!="number"){var a=t.length*e;o=i.measureText(t).width+a,n[t]=o}return o},r.collapseSpaces=function(t){return t==="normal"||t==="pre-line"},r.collapseNewlines=function(t){return t==="normal"},r.trimRight=function(t){if(typeof t!="string")return"";for(var e=t.length-1;e>=0;e--){var n=t[e];if(!r.isBreakingSpace(n))break;t=t.slice(0,-1)}return t},r.isNewline=function(t){return typeof t!="string"?!1:r._newlines.indexOf(t.charCodeAt(0))>=0},r.isBreakingSpace=function(t,e){return typeof t!="string"?!1:r._breakingSpaces.indexOf(t.charCodeAt(0))>=0},r.tokenize=function(t){var e=[],n="";if(typeof t!="string")return e;for(var i=0;i<t.length;i++){var o=t[i],a=t[i+1];if(r.isBreakingSpace(o,a)||r.isNewline(o)){n!==""&&(e.push(n),n=""),e.push(o);continue}n+=o}return n!==""&&e.push(n),e},r.canBreakWords=function(t,e){return e},r.canBreakChars=function(t,e,n,i,o){return!0},r.wordWrapSplit=function(t){return t.split("")},r.measureFont=function(t){if(r._fonts[t])return r._fonts[t];var e={ascent:0,descent:0,fontSize:0},n=r._canvas,i=r._context;i.font=t;var o=r.METRICS_STRING+r.BASELINE_SYMBOL,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(r.BASELINE_SYMBOL).width),u=Math.ceil(r.HEIGHT_MULTIPLIER*s);s=s*r.BASELINE_MULTIPLIER|0,n.width=a,n.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var h=i.getImageData(0,0,a,u).data,f=h.length,l=a*4,c=0,d=0,p=!1;for(c=0;c<s;++c){for(var v=0;v<l;v+=4)if(h[d+v]!==255){p=!0;break}if(!p)d+=l;else break}for(e.ascent=s-c,d=f-l,p=!1,c=u;c>s;--c){for(var v=0;v<l;v+=4)if(h[d+v]!==255){p=!0;break}if(!p)d-=l;else break}return e.descent=c-s,e.fontSize=e.ascent+e.descent,r._fonts[t]=e,e},r.clearMetrics=function(t){t===void 0&&(t=""),t?delete r._fonts[t]:r._fonts={}},Object.defineProperty(r,"_canvas",{get:function(){if(!r.__canvas){var t=void 0;try{var e=new OffscreenCanvas(0,0),n=e.getContext("2d",Ni);if(n&&n.measureText)return r.__canvas=e,e;t=G.ADAPTER.createCanvas()}catch{t=G.ADAPTER.createCanvas()}t.width=t.height=10,r.__canvas=t}return r.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(r,"_context",{get:function(){return r.__context||(r.__context=r._canvas.getContext("2d",Ni)),r.__context},enumerable:!1,configurable:!0}),r}();Te._fonts={},Te.METRICS_STRING="|ÉqÅ",Te.BASELINE_SYMBOL="M",Te.BASELINE_MULTIPLIER=1.4,Te.HEIGHT_MULTIPLIER=2,Te._newlines=[10,13],Te._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var qb={texture:!0,children:!1,baseTexture:!0},El=function(r){Vb(t,r);function t(e,n,i){var o=this,a=!1;i||(i=G.ADAPTER.createCanvas(),a=!0),i.width=3,i.height=3;var s=J.from(i);return s.orig=new st,s.trim=new st,o=r.call(this,s)||this,o._ownCanvas=a,o.canvas=i,o.context=i.getContext("2d",{willReadFrequently:!0}),o._resolution=G.RESOLUTION,o._autoResolution=!0,o._text=null,o._style=null,o._styleListener=null,o._font="",o.text=e,o.style=n,o.localStyleID=-1,o}return t.prototype.updateText=function(e){var n=this._style;if(this.localStyleID!==n.styleID&&(this.dirty=!0,this.localStyleID=n.styleID),!(!this.dirty&&e)){this._font=this._style.toFontString();var i=this.context,o=Te.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=o.width,s=o.height,u=o.lines,h=o.lineHeight,f=o.lineWidths,l=o.maxLineWidth,c=o.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+n.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,s)+n.padding*2)*this._resolution),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=n.strokeThickness,i.textBaseline=n.textBaseline,i.lineJoin=n.lineJoin,i.miterLimit=n.miterLimit;for(var d,p,v=n.dropShadow?2:1,_=0;_<v;++_){var g=n.dropShadow&&_===0,m=g?Math.ceil(Math.max(1,s)+n.padding*2):0,y=m*this._resolution;if(g){i.fillStyle="black",i.strokeStyle="black";var b=n.dropShadowColor,x=Gr(typeof b=="number"?b:mn(b)),A=n.dropShadowBlur*this._resolution,P=n.dropShadowDistance*this._resolution;i.shadowColor="rgba("+x[0]*255+","+x[1]*255+","+x[2]*255+","+n.dropShadowAlpha+")",i.shadowBlur=A,i.shadowOffsetX=Math.cos(n.dropShadowAngle)*P,i.shadowOffsetY=Math.sin(n.dropShadowAngle)*P+y}else i.fillStyle=this._generateFillStyle(n,u,o),i.strokeStyle=n.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;var T=(h-c.fontSize)/2;(!t.nextLineHeightBehavior||h-c.fontSize<0)&&(T=0);for(var w=0;w<u.length;w++)d=n.strokeThickness/2,p=n.strokeThickness/2+w*h+c.ascent+T,n.align==="right"?d+=l-f[w]:n.align==="center"&&(d+=(l-f[w])/2),n.stroke&&n.strokeThickness&&this.drawLetterSpacing(u[w],d+n.padding,p+n.padding-m,!0),n.fill&&this.drawLetterSpacing(u[w],d+n.padding,p+n.padding-m)}this.updateTexture()}},t.prototype.drawLetterSpacing=function(e,n,i,o){o===void 0&&(o=!1);var a=this._style,s=a.letterSpacing,u=t.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(s===0||u){u&&(this.context.letterSpacing=s,this.context.textLetterSpacing=s),o?this.context.strokeText(e,n,i):this.context.fillText(e,n,i);return}for(var h=n,f=Array.from?Array.from(e):e.split(""),l=this.context.measureText(e).width,c=0,d=0;d<f.length;++d){var p=f[d];o?this.context.strokeText(p,h,i):this.context.fillText(p,h,i);for(var v="",_=d+1;_<f.length;++_)v+=f[_];c=this.context.measureText(v).width,h+=l-c+s,l=c}},t.prototype.updateTexture=function(){var e=this.canvas;if(this._style.trim){var n=Xm(e);n.data&&(e.width=n.width,e.height=n.height,this.context.putImageData(n.data,0,0))}var i=this._texture,o=this._style,a=o.trim?0:o.padding,s=i.baseTexture;i.trim.width=i._frame.width=e.width/this._resolution,i.trim.height=i._frame.height=e.height/this._resolution,i.trim.x=-a,i.trim.y=-a,i.orig.width=i._frame.width-a*2,i.orig.height=i._frame.height-a*2,this._onTextureUpdate(),s.setRealSize(e.width,e.height,this._resolution),i.updateUvs(),this.dirty=!1},t.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,e)},t.prototype.updateTransform=function(){this.updateText(!0),r.prototype.updateTransform.call(this)},t.prototype.getBounds=function(e,n){return this.updateText(!0),this._textureID===-1&&(e=!1),r.prototype.getBounds.call(this,e,n)},t.prototype.getLocalBounds=function(e){return this.updateText(!0),r.prototype.getLocalBounds.call(this,e)},t.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},t.prototype._generateFillStyle=function(e,n,i){var o=e.fill;if(Array.isArray(o)){if(o.length===1)return o[0]}else return o;var a,s=e.dropShadow?e.dropShadowDistance:0,u=e.padding||0,h=this.canvas.width/this._resolution-s-u*2,f=this.canvas.height/this._resolution-s-u*2,l=o.slice(),c=e.fillGradientStops.slice();if(!c.length)for(var d=l.length+1,p=1;p<d;++p)c.push(p/d);if(l.unshift(o[0]),c.unshift(0),l.push(o[o.length-1]),c.push(1),e.fillGradientType===Mn.LINEAR_VERTICAL){a=this.context.createLinearGradient(h/2,u,h/2,f+u);for(var v=i.fontProperties.fontSize+e.strokeThickness,p=0;p<n.length;p++){var _=i.lineHeight*(p-1)+v,g=i.lineHeight*p,m=g;p>0&&_>g&&(m=(g+_)/2);var y=g+v,b=i.lineHeight*(p+1),x=y;p+1<n.length&&b<y&&(x=(y+b)/2);for(var A=(x-m)/f,P=0;P<l.length;P++){var T=0;typeof c[P]=="number"?T=c[P]:T=P/l.length;var w=Math.min(1,Math.max(0,m/f+T*A));w=Number(w.toFixed(5)),a.addColorStop(w,l[P])}}}else{a=this.context.createLinearGradient(u,f/2,h+u,f/2);for(var E=l.length+1,R=1,p=0;p<l.length;p++){var O=void 0;typeof c[p]=="number"?O=c[p]:O=R/E,a.addColorStop(O,l[p]),R++}}return a},t.prototype.destroy=function(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},qb,e),r.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(e){this.updateText(!0);var n=Hr(this.scale.x)||1;this.scale.x=n*e/this._texture.orig.width,this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(e){this.updateText(!0);var n=Hr(this.scale.y)||1;this.scale.y=n*e/this._texture.orig.height,this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._style},set:function(e){e=e||{},e instanceof Wr?this._style=e:this._style=new Wr(e),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),t.nextLineHeightBehavior=!1,t.experimentalLetterSpacing=!1,t}(Cn);/*!
764
+ * @pixi/prepare - v6.5.10
765
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
766
+ *
767
+ * @pixi/prepare is licensed under the MIT License.
768
+ * http://www.opensource.org/licenses/mit-license
769
+ */G.UPLOADS_PER_FRAME=4;/*! *****************************************************************************
770
+ Copyright (c) Microsoft Corporation.
771
+
772
+ Permission to use, copy, modify, and/or distribute this software for any
773
+ purpose with or without fee is hereby granted.
774
+
775
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
776
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
777
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
778
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
779
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
780
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
781
+ PERFORMANCE OF THIS SOFTWARE.
782
+ ***************************************************************************** */var Xa=function(r,t){return Xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Xa(r,t)};function $b(r,t){Xa(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Kb=function(){function r(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return r.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},r.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},r}();function Zb(r,t){var e=!1;if(r&&r._textures&&r._textures.length){for(var n=0;n<r._textures.length;n++)if(r._textures[n]instanceof J){var i=r._textures[n].baseTexture;t.indexOf(i)===-1&&(t.push(i),e=!0)}}return e}function Jb(r,t){if(r.baseTexture instanceof ut){var e=r.baseTexture;return t.indexOf(e)===-1&&t.push(e),!0}return!1}function Qb(r,t){if(r._texture&&r._texture instanceof J){var e=r._texture.baseTexture;return t.indexOf(e)===-1&&t.push(e),!0}return!1}function tx(r,t){return t instanceof El?(t.updateText(!0),!0):!1}function ex(r,t){if(t instanceof Wr){var e=t.toFontString();return Te.measureFont(e),!0}return!1}function rx(r,t){if(r instanceof El){t.indexOf(r.style)===-1&&t.push(r.style),t.indexOf(r)===-1&&t.push(r);var e=r._texture.baseTexture;return t.indexOf(e)===-1&&t.push(e),!0}return!1}function nx(r,t){return r instanceof Wr?(t.indexOf(r)===-1&&t.push(r),!0):!1}var ix=function(){function r(t){var e=this;this.limiter=new Kb(G.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(rx),this.registerFindHook(nx),this.registerFindHook(Zb),this.registerFindHook(Jb),this.registerFindHook(Qb),this.registerUploadHook(tx),this.registerUploadHook(ex)}return r.prototype.upload=function(t,e){var n=this;return typeof t=="function"&&(e=t,t=null),e&&le("6.5.0","BasePrepare.upload callback is deprecated, use the return Promise instead."),new Promise(function(i){t&&n.add(t);var o=function(){e==null||e(),i()};n.queue.length?(n.completes.push(o),n.ticking||(n.ticking=!0,kt.system.addOnce(n.tick,n,Ie.UTILITY))):o()})},r.prototype.tick=function(){setTimeout(this.delayedTick,0)},r.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed){for(var n=0,i=this.uploadHooks.length;n<i;n++)if(this.uploadHooks[n](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}}e||this.queue.shift()}if(this.queue.length)kt.system.addOnce(this.tick,this,Ie.UTILITY);else{this.ticking=!1;var o=this.completes.slice(0);this.completes.length=0;for(var n=0,i=o.length;n<i;n++)o[n]()}},r.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},r.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},r.prototype.add=function(t){for(var e=0,n=this.addHooks.length;e<n&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Ee)for(var e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},r.prototype.destroy=function(){this.ticking&&kt.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},r}();function Tl(r,t){return t instanceof ut?(t._glTextures[r.CONTEXT_UID]||r.texture.bind(t),!0):!1}function ox(r,t){if(!(t instanceof zr))return!1;var e=t.geometry;t.finishPoly(),e.updateBatches();for(var n=e.batches,i=0;i<n.length;i++){var o=n[i].style.texture;o&&Tl(r,o.baseTexture)}return e.batchable||r.geometry.bind(e,t._resolveDirectShader(r)),!0}function ax(r,t){return r instanceof zr?(t.push(r),!0):!1}var sx=function(r){$b(t,r);function t(e){var n=r.call(this,e)||this;return n.uploadHookHelper=n.renderer,n.registerFindHook(ax),n.registerUploadHook(Tl),n.registerUploadHook(ox),n}return t.extension={name:"prepare",type:gt.RendererPlugin},t}(ix);/*!
783
+ * @pixi/spritesheet - v6.5.10
784
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
785
+ *
786
+ * @pixi/spritesheet is licensed under the MIT License.
787
+ * http://www.opensource.org/licenses/mit-license
788
+ */var ux=function(){function r(t,e,n){n===void 0&&(n=null),this.linkedSheets=[],this._texture=t instanceof J?t:null,this.baseTexture=t instanceof ut?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var i=this.baseTexture.resource;this.resolution=this._updateResolution(n||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return r.prototype._updateResolution=function(t){t===void 0&&(t=null);var e=this.data.meta.scale,n=li(t,null);return n===null&&(n=e!==void 0?parseFloat(e):1),n!==1&&this.baseTexture.setResolution(n),n},r.prototype.parse=function(t){var e=this;return t&&le("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise(function(n){e._callback=function(i){t==null||t(i),n(i)},e._batchIndex=0,e._frameKeys.length<=r.BATCH_SIZE?(e._processFrames(0),e._processAnimations(),e._parseComplete()):e._nextBatch()})},r.prototype._processFrames=function(t){for(var e=t,n=r.BATCH_SIZE;e-t<n&&e<this._frameKeys.length;){var i=this._frameKeys[e],o=this._frames[i],a=o.frame;if(a){var s=null,u=null,h=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,f=new st(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);o.rotated?s=new st(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):s=new st(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(u=new st(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[i]=new J(this.baseTexture,s,f,u,o.rotated?2:0,o.anchor),J.addToCache(this.textures[i],i)}e++}},r.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var n=0;n<t[e].length;n++){var i=t[e][n];this.animations[e].push(this.textures[i])}}},r.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},r.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*r.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},r.prototype.destroy=function(t){var e;t===void 0&&(t=!1);for(var n in this.textures)this.textures[n].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((e=this._texture)===null||e===void 0||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r}(),hx=function(){function r(){}return r.use=function(t,e){var n,i,o=this,a=t.name+"_image";if(!t.data||t.type!==Ot.TYPE.JSON||!t.data.frames||o.resources[a]){e();return}var s=(i=(n=t.data)===null||n===void 0?void 0:n.meta)===null||i===void 0?void 0:i.related_multi_packs;if(Array.isArray(s))for(var u=function(p){if(typeof p!="string")return"continue";var v=p.replace(".json",""),_=Ur.resolve(t.url.replace(o.baseUrl,""),p);if(o.resources[v]||Object.values(o.resources).some(function(m){return Ur.format(Ur.parse(m.url))===_}))return"continue";var g={crossOrigin:t.crossOrigin,loadType:Ot.LOAD_TYPE.XHR,xhrType:Ot.XHR_RESPONSE_TYPE.JSON,parentResource:t,metadata:t.metadata};o.add(v,_,g)},h=0,f=s;h<f.length;h++){var l=f[h];u(l)}var c={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},d=r.getResourcePath(t,o.baseUrl);o.add(a,d,c,function(v){if(v.error){e(v.error);return}var _=new ux(v.texture,t.data,t.url);_.parse().then(function(){t.spritesheet=_,t.textures=_.textures,e()})})},r.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:Ur.resolve(t.url.replace(e,""),t.data.meta.image)},r.extension=gt.Loader,r}();/*!
789
+ * @pixi/sprite-tiling - v6.5.10
790
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
791
+ *
792
+ * @pixi/sprite-tiling is licensed under the MIT License.
793
+ * http://www.opensource.org/licenses/mit-license
794
+ *//*! *****************************************************************************
795
+ Copyright (c) Microsoft Corporation.
796
+
797
+ Permission to use, copy, modify, and/or distribute this software for any
798
+ purpose with or without fee is hereby granted.
799
+
800
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
801
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
802
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
803
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
804
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
805
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
806
+ PERFORMANCE OF THIS SOFTWARE.
807
+ ***************************************************************************** */var ja=function(r,t){return ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},ja(r,t)};function wl(r,t){ja(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Dn=new Et;(function(r){wl(t,r);function t(e,n,i){n===void 0&&(n=100),i===void 0&&(i=100);var o=r.call(this,e)||this;return o.tileTransform=new yh,o._width=n,o._height=i,o.uvMatrix=o.texture.uvMatrix||new va(e),o.pluginName="tilingSprite",o.uvRespectAnchor=!1,o}return Object.defineProperty(t.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(e){this.uvMatrix.clampMargin=e,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(e){this.tileTransform.scale.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(e){this.tileTransform.position.copyFrom(e)},enumerable:!1,configurable:!0}),t.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},t.prototype._render=function(e){var n=this._texture;!n||!n.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))},t.prototype._calculateBounds=function(){var e=this._width*-this._anchor._x,n=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),o=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,e,n,i,o)},t.prototype.getLocalBounds=function(e){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),e||(this._localBoundsRect||(this._localBoundsRect=new st),e=this._localBoundsRect),this._bounds.getRectangle(e)):r.prototype.getLocalBounds.call(this,e)},t.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,Dn);var n=this._width,i=this._height,o=-n*this.anchor._x;if(Dn.x>=o&&Dn.x<o+n){var a=-i*this.anchor._y;if(Dn.y>=a&&Dn.y<a+i)return!0}return!1},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},t.from=function(e,n){var i=e instanceof J?e:J.from(e,n);return new t(i,n.width,n.height)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),t})(Cn);var lx=`#version 100
808
+ #define SHADER_NAME Tiling-Sprite-Simple-100
809
+
810
+ precision lowp float;
811
+
812
+ varying vec2 vTextureCoord;
813
+
814
+ uniform sampler2D uSampler;
815
+ uniform vec4 uColor;
816
+
817
+ void main(void)
818
+ {
819
+ vec4 texSample = texture2D(uSampler, vTextureCoord);
820
+ gl_FragColor = texSample * uColor;
821
+ }
822
+ `,Sl=`#version 100
823
+ #define SHADER_NAME Tiling-Sprite-100
824
+
825
+ precision lowp float;
826
+
827
+ attribute vec2 aVertexPosition;
828
+ attribute vec2 aTextureCoord;
829
+
830
+ uniform mat3 projectionMatrix;
831
+ uniform mat3 translationMatrix;
832
+ uniform mat3 uTransform;
833
+
834
+ varying vec2 vTextureCoord;
835
+
836
+ void main(void)
837
+ {
838
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
839
+
840
+ vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
841
+ }
842
+ `,fx=`#version 100
843
+ #ifdef GL_EXT_shader_texture_lod
844
+ #extension GL_EXT_shader_texture_lod : enable
845
+ #endif
846
+ #define SHADER_NAME Tiling-Sprite-100
847
+
848
+ precision lowp float;
849
+
850
+ varying vec2 vTextureCoord;
851
+
852
+ uniform sampler2D uSampler;
853
+ uniform vec4 uColor;
854
+ uniform mat3 uMapCoord;
855
+ uniform vec4 uClampFrame;
856
+ uniform vec2 uClampOffset;
857
+
858
+ void main(void)
859
+ {
860
+ vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
861
+ coord = (uMapCoord * vec3(coord, 1.0)).xy;
862
+ vec2 unclamped = coord;
863
+ coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
864
+
865
+ #ifdef GL_EXT_shader_texture_lod
866
+ vec4 texSample = unclamped == coord
867
+ ? texture2D(uSampler, coord)
868
+ : texture2DLodEXT(uSampler, coord, 0);
869
+ #else
870
+ vec4 texSample = texture2D(uSampler, coord);
871
+ #endif
872
+
873
+ gl_FragColor = texSample * uColor;
874
+ }
875
+ `,cx=`#version 300 es
876
+ #define SHADER_NAME Tiling-Sprite-300
877
+
878
+ precision lowp float;
879
+
880
+ in vec2 aVertexPosition;
881
+ in vec2 aTextureCoord;
882
+
883
+ uniform mat3 projectionMatrix;
884
+ uniform mat3 translationMatrix;
885
+ uniform mat3 uTransform;
886
+
887
+ out vec2 vTextureCoord;
888
+
889
+ void main(void)
890
+ {
891
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
892
+
893
+ vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
894
+ }
895
+ `,dx=`#version 300 es
896
+ #define SHADER_NAME Tiling-Sprite-100
897
+
898
+ precision lowp float;
899
+
900
+ in vec2 vTextureCoord;
901
+
902
+ out vec4 fragmentColor;
903
+
904
+ uniform sampler2D uSampler;
905
+ uniform vec4 uColor;
906
+ uniform mat3 uMapCoord;
907
+ uniform vec4 uClampFrame;
908
+ uniform vec2 uClampOffset;
909
+
910
+ void main(void)
911
+ {
912
+ vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
913
+ coord = (uMapCoord * vec3(coord, 1.0)).xy;
914
+ vec2 unclamped = coord;
915
+ coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
916
+
917
+ vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
918
+
919
+ fragmentColor = texSample * uColor;
920
+ }
921
+ `,Li=new Mt,px=function(r){wl(t,r);function t(e){var n=r.call(this,e)||this;return e.runners.contextChange.add(n),n.quad=new Ih,n.state=fr.for2d(),n}return t.prototype.contextChange=function(){var e=this.renderer,n={globals:e.globalUniforms};this.simpleShader=je.from(Sl,lx,n),this.shader=e.context.webGLVersion>1?je.from(cx,dx,n):je.from(Sl,fx,n)},t.prototype.render=function(e){var n=this.renderer,i=this.quad,o=i.vertices;o[0]=o[6]=e._width*-e.anchor.x,o[1]=o[3]=e._height*-e.anchor.y,o[2]=o[4]=e._width*(1-e.anchor.x),o[5]=o[7]=e._height*(1-e.anchor.y);var a=e.uvRespectAnchor?e.anchor.x:0,s=e.uvRespectAnchor?e.anchor.y:0;o=i.uvs,o[0]=o[6]=-a,o[1]=o[3]=-s,o[2]=o[4]=1-a,o[5]=o[7]=1-s,i.invalidate();var u=e._texture,h=u.baseTexture,f=h.alphaMode>0,l=e.tileTransform.localTransform,c=e.uvMatrix,d=h.isPowerOfTwo&&u.frame.width===h.width&&u.frame.height===h.height;d&&(h._glTextures[n.CONTEXT_UID]?d=h.wrapMode!==ge.CLAMP:h.wrapMode===ge.CLAMP&&(h.wrapMode=ge.REPEAT));var p=d?this.simpleShader:this.shader,v=u.width,_=u.height,g=e._width,m=e._height;Li.set(l.a*v/g,l.b*v/m,l.c*_/g,l.d*_/m,l.tx/g,l.ty/m),Li.invert(),d?Li.prepend(c.mapCoord):(p.uniforms.uMapCoord=c.mapCoord.toArray(!0),p.uniforms.uClampFrame=c.uClampFrame,p.uniforms.uClampOffset=c.uClampOffset),p.uniforms.uTransform=Li.toArray(!0),p.uniforms.uColor=fh(e.tint,e.worldAlpha,p.uniforms.uColor,f),p.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),p.uniforms.uSampler=u,n.shader.bind(p),n.geometry.bind(i),this.state.blendMode=lh(e.blendMode,f),n.state.set(this.state),n.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t.extension={name:"tilingSprite",type:gt.RendererPlugin},t}(mi);/*!
922
+ * @pixi/mesh - v6.5.10
923
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
924
+ *
925
+ * @pixi/mesh is licensed under the MIT License.
926
+ * http://www.opensource.org/licenses/mit-license
927
+ *//*! *****************************************************************************
928
+ Copyright (c) Microsoft Corporation.
929
+
930
+ Permission to use, copy, modify, and/or distribute this software for any
931
+ purpose with or without fee is hereby granted.
932
+
933
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
934
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
935
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
936
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
937
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
938
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
939
+ PERFORMANCE OF THIS SOFTWARE.
940
+ ***************************************************************************** */var Ya=function(r,t){return Ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Ya(r,t)};function Va(r,t){Ya(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var vx=function(){function r(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(t){if(!(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},r}(),za=new Et,Al=new di,Fn=function(r){Va(t,r);function t(e,n,i,o){o===void 0&&(o=oe.TRIANGLES);var a=r.call(this)||this;return a.geometry=e,a.shader=n,a.state=i||fr.for2d(),a.drawMode=o,a.start=0,a.size=0,a.uvs=null,a.indices=null,a.vertexData=new Float32Array(1),a.vertexDirty=-1,a._transformID=-1,a._roundPixels=G.ROUND_PIXELS,a.batchUvs=null,a}return Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},set:function(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this.shader},set:function(e){this.shader=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(e){this.shader.tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(e){this.shader.texture=e},enumerable:!1,configurable:!0}),t.prototype._render=function(e){var n=this.geometry.buffers[0].data,i=this.shader;i.batchable&&this.drawMode===oe.TRIANGLES&&n.length<t.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)},t.prototype._renderDefault=function(e){var n=this.shader;n.alpha=this.worldAlpha,n.update&&n.update(),e.batch.flush(),n.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(n),e.state.set(this.state),e.geometry.bind(this.geometry,n),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},t.prototype._renderToBatch=function(e){var n=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=n.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;var o=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[o]),e.plugins[o].render(this)},t.prototype.calculateVertices=function(){var e=this.geometry,n=e.buffers[0],i=n.data,o=n._updateID;if(!(o===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==i.length&&(this.vertexData=new Float32Array(i.length));for(var a=this.transform.worldTransform,s=a.a,u=a.b,h=a.c,f=a.d,l=a.tx,c=a.ty,d=this.vertexData,p=0;p<d.length/2;p++){var v=i[p*2],_=i[p*2+1];d[p*2]=s*v+h*_+l,d[p*2+1]=u*v+f*_+c}if(this._roundPixels)for(var g=G.RESOLUTION,p=0;p<d.length;++p)d[p]=Math.round((d[p]*g|0)/g);this.vertexDirty=o}},t.prototype.calculateUvs=function(){var e=this.geometry.buffers[1],n=this.shader;n.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new vx(e,n.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},t.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},t.prototype.containsPoint=function(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,za);for(var n=this.geometry.getBuffer("aVertexPosition").data,i=Al.points,o=this.geometry.getIndex().data,a=o.length,s=this.drawMode===4?3:1,u=0;u+2<a;u+=s){var h=o[u]*2,f=o[u+1]*2,l=o[u+2]*2;if(i[0]=n[h],i[1]=n[h+1],i[2]=n[f],i[3]=n[f+1],i[4]=n[l],i[5]=n[l+1],Al.contains(za.x,za.y))return!0}return!1},t.prototype.destroy=function(e){r.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},t.BATCHABLE_SIZE=100,t}(Ee),_x=`varying vec2 vTextureCoord;
941
+ uniform vec4 uColor;
942
+
943
+ uniform sampler2D uSampler;
944
+
945
+ void main(void)
946
+ {
947
+ gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
948
+ }
949
+ `,gx=`attribute vec2 aVertexPosition;
950
+ attribute vec2 aTextureCoord;
951
+
952
+ uniform mat3 projectionMatrix;
953
+ uniform mat3 translationMatrix;
954
+ uniform mat3 uTextureMatrix;
955
+
956
+ varying vec2 vTextureCoord;
957
+
958
+ void main(void)
959
+ {
960
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
961
+
962
+ vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
963
+ }
964
+ `,Bn=function(r){Va(t,r);function t(e,n){var i=this,o={uSampler:e,alpha:1,uTextureMatrix:Mt.IDENTITY,uColor:new Float32Array([1,1,1,1])};return n=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},n),n.uniforms&&Object.assign(o,n.uniforms),i=r.call(this,n.program||Sn.from(gx,_x),o)||this,i._colorDirty=!1,i.uvMatrix=new va(e),i.batchable=n.program===void 0,i.pluginName=n.pluginName,i.tint=n.tint,i.alpha=n.alpha,i}return Object.defineProperty(t.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},set:function(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){e!==this._tint&&(this._tint=e,this._tintRGB=(e>>16)+(e&65280)+((e&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;fh(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(je),Ui=function(r){Va(t,r);function t(e,n,i){var o=r.call(this)||this,a=new Dt(e),s=new Dt(n,!0),u=new Dt(i,!0,!0);return o.addAttribute("aVertexPosition",a,2,!1,X.FLOAT).addAttribute("aTextureCoord",s,2,!1,X.FLOAT).addIndex(u),o._updateId=-1,o}return Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(En);/*!
965
+ * @pixi/text-bitmap - v6.5.10
966
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
967
+ *
968
+ * @pixi/text-bitmap is licensed under the MIT License.
969
+ * http://www.opensource.org/licenses/mit-license
970
+ *//*! *****************************************************************************
971
+ Copyright (c) Microsoft Corporation.
972
+
973
+ Permission to use, copy, modify, and/or distribute this software for any
974
+ purpose with or without fee is hereby granted.
975
+
976
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
977
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
978
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
979
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
980
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
981
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
982
+ PERFORMANCE OF THIS SOFTWARE.
983
+ ***************************************************************************** */var Wa=function(r,t){return Wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Wa(r,t)};function mx(r,t){Wa(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Gi=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),yx=function(){function r(){}return r.test=function(t){return typeof t=="string"&&t.indexOf("info face=")===0},r.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in e){var o=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var u in a){var h=a[u].split("="),f=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),d=isNaN(c)?l:c;s[f]=d}n[o].push(s)}var p=new Gi;return n.info.forEach(function(v){return p.info.push({face:v.face,size:parseInt(v.size,10)})}),n.common.forEach(function(v){return p.common.push({lineHeight:parseInt(v.lineHeight,10)})}),n.page.forEach(function(v){return p.page.push({id:parseInt(v.id,10),file:v.file})}),n.char.forEach(function(v){return p.char.push({id:parseInt(v.id,10),page:parseInt(v.page,10),x:parseInt(v.x,10),y:parseInt(v.y,10),width:parseInt(v.width,10),height:parseInt(v.height,10),xoffset:parseInt(v.xoffset,10),yoffset:parseInt(v.yoffset,10),xadvance:parseInt(v.xadvance,10)})}),n.kerning.forEach(function(v){return p.kerning.push({first:parseInt(v.first,10),second:parseInt(v.second,10),amount:parseInt(v.amount,10)})}),n.distanceField.forEach(function(v){return p.distanceField.push({distanceRange:parseInt(v.distanceRange,10),fieldType:v.fieldType})}),p},r}(),qa=function(){function r(){}return r.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(t){for(var e=new Gi,n=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),o=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),u=t.getElementsByTagName("distanceField"),h=0;h<n.length;h++)e.info.push({face:n[h].getAttribute("face"),size:parseInt(n[h].getAttribute("size"),10)});for(var h=0;h<i.length;h++)e.common.push({lineHeight:parseInt(i[h].getAttribute("lineHeight"),10)});for(var h=0;h<o.length;h++)e.page.push({id:parseInt(o[h].getAttribute("id"),10)||0,file:o[h].getAttribute("file")});for(var h=0;h<a.length;h++){var f=a[h];e.char.push({id:parseInt(f.getAttribute("id"),10),page:parseInt(f.getAttribute("page"),10)||0,x:parseInt(f.getAttribute("x"),10),y:parseInt(f.getAttribute("y"),10),width:parseInt(f.getAttribute("width"),10),height:parseInt(f.getAttribute("height"),10),xoffset:parseInt(f.getAttribute("xoffset"),10),yoffset:parseInt(f.getAttribute("yoffset"),10),xadvance:parseInt(f.getAttribute("xadvance"),10)})}for(var h=0;h<s.length;h++)e.kerning.push({first:parseInt(s[h].getAttribute("first"),10),second:parseInt(s[h].getAttribute("second"),10),amount:parseInt(s[h].getAttribute("amount"),10)});for(var h=0;h<u.length;h++)e.distanceField.push({fieldType:u[h].getAttribute("fieldType"),distanceRange:parseInt(u[h].getAttribute("distanceRange"),10)});return e},r}(),bx=function(){function r(){}return r.test=function(t){if(typeof t=="string"&&t.indexOf("<font>")>-1){var e=new globalThis.DOMParser().parseFromString(t,"text/xml");return qa.test(e)}return!1},r.parse=function(t){var e=new globalThis.DOMParser().parseFromString(t,"text/xml");return qa.parse(e)},r}(),$a=[yx,qa,bx];function Pl(r){for(var t=0;t<$a.length;t++)if($a[t].test(r))return $a[t];return null}function xx(r,t,e,n,i,o){var a=e.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var s,u=e.dropShadow?e.dropShadowDistance:0,h=e.padding||0,f=r.width/n-u-h*2,l=r.height/n-u-h*2,c=a.slice(),d=e.fillGradientStops.slice();if(!d.length)for(var p=c.length+1,v=1;v<p;++v)d.push(v/p);if(c.unshift(a[0]),d.unshift(0),c.push(a[a.length-1]),d.push(1),e.fillGradientType===Mn.LINEAR_VERTICAL){s=t.createLinearGradient(f/2,h,f/2,l+h);for(var _=0,g=o.fontProperties.fontSize+e.strokeThickness,m=g/l,v=0;v<i.length;v++)for(var y=o.lineHeight*v,b=0;b<c.length;b++){var x=0;typeof d[b]=="number"?x=d[b]:x=b/c.length;var A=y/l+x*m,P=Math.max(_,A);P=Math.min(P,1),s.addColorStop(P,c[b]),_=P}}else{s=t.createLinearGradient(h,l/2,f+h,l/2);for(var T=c.length+1,w=1,v=0;v<c.length;v++){var E=void 0;typeof d[v]=="number"?E=d[v]:E=w/T,s.addColorStop(E,c[v]),w++}}return s}function Ex(r,t,e,n,i,o,a){var s=e.text,u=e.fontProperties;t.translate(n,i),t.scale(o,o);var h=a.strokeThickness/2,f=-(a.strokeThickness/2);if(t.font=a.toFontString(),t.lineWidth=a.strokeThickness,t.textBaseline=a.textBaseline,t.lineJoin=a.lineJoin,t.miterLimit=a.miterLimit,t.fillStyle=xx(r,t,a,o,[s],e),t.strokeStyle=a.stroke,a.dropShadow){var l=a.dropShadowColor,c=Gr(typeof l=="number"?l:mn(l)),d=a.dropShadowBlur*o,p=a.dropShadowDistance*o;t.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+a.dropShadowAlpha+")",t.shadowBlur=d,t.shadowOffsetX=Math.cos(a.dropShadowAngle)*p,t.shadowOffsetY=Math.sin(a.dropShadowAngle)*p}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;a.stroke&&a.strokeThickness&&t.strokeText(s,h,f+e.lineHeight-u.descent),a.fill&&t.fillText(s,h,f+e.lineHeight-u.descent),t.setTransform(1,0,0,1,0,0),t.fillStyle="rgba(0, 0, 0, 0)"}function Ol(r){return Array.from?Array.from(r):r.split("")}function Tx(r){typeof r=="string"&&(r=[r]);for(var t=[],e=0,n=r.length;e<n;e++){var i=r[e];if(Array.isArray(i)){if(i.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+i.length+".");var o=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<o)throw new Error("[BitmapFont]: Invalid character range.");for(var s=o,u=a;s<=u;s++)t.push(String.fromCharCode(s))}else t.push.apply(t,Ol(i))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}function ki(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var We=function(){function r(t,e,n){var i,o,a=t.info[0],s=t.common[0],u=t.page[0],h=t.distanceField[0],f=li(u.file),l={};this._ownsTextures=n,this.font=a.face,this.size=a.size,this.lineHeight=s.lineHeight/f,this.chars={},this.pageTextures=l;for(var c=0;c<t.page.length;c++){var d=t.page[c],p=d.id,v=d.file;l[p]=e instanceof Array?e[c]:e[v],h!=null&&h.fieldType&&h.fieldType!=="none"&&(l[p].baseTexture.alphaMode=se.NO_PREMULTIPLIED_ALPHA,l[p].baseTexture.mipmap=ae.OFF)}for(var c=0;c<t.char.length;c++){var _=t.char[c],p=_.id,g=_.page,m=t.char[c],y=m.x,b=m.y,x=m.width,A=m.height,P=m.xoffset,T=m.yoffset,w=m.xadvance;y/=f,b/=f,x/=f,A/=f,P/=f,T/=f,w/=f;var E=new st(y+l[g].frame.x/f,b+l[g].frame.y/f,x,A);this.chars[p]={xOffset:P,yOffset:T,xAdvance:w,kerning:{},texture:new J(l[g].baseTexture,E),page:g}}for(var c=0;c<t.kerning.length;c++){var R=t.kerning[c],O=R.first,C=R.second,k=R.amount;O/=f,C/=f,k/=f,this.chars[C]&&(this.chars[C].kerning[O]=k)}this.distanceFieldRange=h==null?void 0:h.distanceRange,this.distanceFieldType=(o=(i=h==null?void 0:h.fieldType)===null||i===void 0?void 0:i.toLowerCase())!==null&&o!==void 0?o:"none"}return r.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},r.install=function(t,e,n){var i;if(t instanceof Gi)i=t;else{var o=Pl(t);if(!o)throw new Error("Unrecognized data format for font.");i=o.parse(t)}e instanceof J&&(e=[e]);var a=new r(i,e,n);return r.available[a.font]=a,a},r.uninstall=function(t){var e=r.available[t];if(!e)throw new Error("No font found named '"+t+"'");e.destroy(),delete r.available[t]},r.from=function(t,e,n){if(!t)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},r.defaultOptions,n),o=i.chars,a=i.padding,s=i.resolution,u=i.textureWidth,h=i.textureHeight,f=Tx(o),l=e instanceof Wr?e:new Wr(e),c=u,d=new Gi;d.info[0]={face:l.fontFamily,size:l.fontSize},d.common[0]={lineHeight:l.fontSize};for(var p=0,v=0,_,g,m,y=0,b=[],x=0;x<f.length;x++){_||(_=G.ADAPTER.createCanvas(),_.width=u,_.height=h,g=_.getContext("2d"),m=new ut(_,{resolution:s}),b.push(new J(m)),d.page.push({id:b.length-1,file:""}));var A=f[x],P=Te.measureText(A,l,!1,_),T=P.width,w=Math.ceil(P.height),E=Math.ceil((l.fontStyle==="italic"?2:1)*T);if(v>=h-w*s){if(v===0)throw new Error("[BitmapFont] textureHeight "+h+"px is too small "+("(fontFamily: '"+l.fontFamily+"', fontSize: "+l.fontSize+"px, char: '"+A+"')"));--x,_=null,g=null,m=null,v=0,p=0,y=0;continue}if(y=Math.max(w+P.fontProperties.descent,y),E*s+p>=c){if(p===0)throw new Error("[BitmapFont] textureWidth "+u+"px is too small "+("(fontFamily: '"+l.fontFamily+"', fontSize: "+l.fontSize+"px, char: '"+A+"')"));--x,v+=y*s,v=Math.ceil(v),p=0,y=0;continue}Ex(_,g,P,p,v,s,l);var R=ki(P.text);d.char.push({id:R,page:b.length-1,x:p/s,y:v/s,width:E,height:w,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(l.dropShadow?l.dropShadowDistance:0)-(l.stroke?l.strokeThickness:0))}),p+=(E+2*a)*s,p=Math.ceil(p)}if(!(n!=null&&n.skipKerning))for(var x=0,O=f.length;x<O;x++)for(var C=f[x],k=0;k<O;k++){var B=f[k],N=g.measureText(C).width,q=g.measureText(B).width,K=g.measureText(C+B).width,Q=K-(N+q);Q&&d.kerning.push({first:ki(C),second:ki(B),amount:Q})}var L=new r(d,b,!0);return r.available[t]!==void 0&&r.uninstall(t),r.available[t]=L,L},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),wx=`// Pixi texture info\r
984
+ varying vec2 vTextureCoord;\r
985
+ uniform sampler2D uSampler;\r
986
+ \r
987
+ // Tint\r
988
+ uniform vec4 uColor;\r
989
+ \r
990
+ // on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
991
+ uniform float uFWidth;\r
992
+ \r
993
+ void main(void) {\r
994
+ \r
995
+ // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
996
+ vec4 texColor = texture2D(uSampler, vTextureCoord);\r
997
+ \r
998
+ // MSDF\r
999
+ float median = texColor.r + texColor.g + texColor.b -\r
1000
+ min(texColor.r, min(texColor.g, texColor.b)) -\r
1001
+ max(texColor.r, max(texColor.g, texColor.b));\r
1002
+ // SDF\r
1003
+ median = min(median, texColor.a);\r
1004
+ \r
1005
+ float screenPxDistance = uFWidth * (median - 0.5);\r
1006
+ float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
1007
+ if (median < 0.01) {\r
1008
+ alpha = 0.0;\r
1009
+ } else if (median > 0.99) {\r
1010
+ alpha = 1.0;\r
1011
+ }\r
1012
+ \r
1013
+ // NPM Textures, NPM outputs\r
1014
+ gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r
1015
+ \r
1016
+ }\r
1017
+ `,Sx=`// Mesh material default fragment\r
1018
+ attribute vec2 aVertexPosition;\r
1019
+ attribute vec2 aTextureCoord;\r
1020
+ \r
1021
+ uniform mat3 projectionMatrix;\r
1022
+ uniform mat3 translationMatrix;\r
1023
+ uniform mat3 uTextureMatrix;\r
1024
+ \r
1025
+ varying vec2 vTextureCoord;\r
1026
+ \r
1027
+ void main(void)\r
1028
+ {\r
1029
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
1030
+ \r
1031
+ vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
1032
+ }\r
1033
+ `,Rl=[],Il=[],Cl=[];(function(r){mx(t,r);function t(e,n){n===void 0&&(n={});var i=r.call(this)||this;i._tint=16777215;var o=Object.assign({},t.styleDefaults,n),a=o.align,s=o.tint,u=o.maxWidth,h=o.letterSpacing,f=o.fontName,l=o.fontSize;if(!We.available[f])throw new Error('Missing BitmapFont "'+f+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=a,i._tint=s,i._font=void 0,i._fontName=f,i._fontSize=l,i.text=e,i._maxWidth=u,i._maxLineHeight=0,i._letterSpacing=h,i._anchor=new Xr(function(){i.dirty=!0},i,0,0),i._roundPixels=G.ROUND_PIXELS,i.dirty=!0,i._resolution=G.RESOLUTION,i._autoResolution=!0,i._textureCache={},i}return t.prototype.updateText=function(){for(var e,n=We.available[this._fontName],i=this.fontSize,o=i/n.size,a=new Et,s=[],u=[],h=[],f=this._text.replace(/(?:\r\n|\r)/g,`
1034
+ `)||" ",l=Ol(f),c=this._maxWidth*n.size/i,d=n.distanceFieldType==="none"?Rl:Il,p=null,v=0,_=0,g=0,m=-1,y=0,b=0,x=0,A=0,P=0;P<l.length;P++){var T=l[P],w=ki(T);if(/(?:\s)/.test(T)&&(m=P,y=v,A++),T==="\r"||T===`
1035
+ `){u.push(v),h.push(-1),_=Math.max(_,v),++g,++b,a.x=0,a.y+=n.lineHeight,p=null,A=0;continue}var E=n.chars[w];if(E){p&&E.kerning[p]&&(a.x+=E.kerning[p]);var R=Cl.pop()||{texture:J.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Et};R.texture=E.texture,R.line=g,R.charCode=w,R.position.x=a.x+E.xOffset+this._letterSpacing/2,R.position.y=a.y+E.yOffset,R.prevSpaces=A,s.push(R),v=R.position.x+Math.max(E.xAdvance-E.xOffset,E.texture.orig.width),a.x+=E.xAdvance+this._letterSpacing,x=Math.max(x,E.yOffset+E.texture.height),p=w,m!==-1&&c>0&&a.x>c&&(++b,kr(s,1+m-b,1+P-m),P=m,m=-1,u.push(y),h.push(s.length>0?s[s.length-1].prevSpaces:0),_=Math.max(_,y),g++,a.x=0,a.y+=n.lineHeight,p=null,A=0)}}var O=l[l.length-1];O!=="\r"&&O!==`
1036
+ `&&(/(?:\s)/.test(O)&&(v=y),u.push(v),_=Math.max(_,v),h.push(-1));for(var C=[],P=0;P<=g;P++){var k=0;this._align==="right"?k=_-u[P]:this._align==="center"?k=(_-u[P])/2:this._align==="justify"&&(k=h[P]<0?0:(_-u[P])/h[P]),C.push(k)}var B=s.length,N={},q=[],K=this._activePagesMeshData;d.push.apply(d,K);for(var P=0;P<B;P++){var Q=s[P].texture,L=Q.baseTexture.uid;if(!N[L]){var F=d.pop();if(!F){var H=new Ui,tt=void 0,rt=void 0;n.distanceFieldType==="none"?(tt=new Bn(J.EMPTY),rt=j.NORMAL):(tt=new Bn(J.EMPTY,{program:Sn.from(Sx,wx),uniforms:{uFWidth:0}}),rt=j.NORMAL_NPM);var vt=new Fn(H,tt);vt.blendMode=rt,F={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:vt,vertices:null,uvs:null,indices:null}}F.index=0,F.indexCount=0,F.vertexCount=0,F.uvsCount=0,F.total=0;var Y=this._textureCache;Y[L]=Y[L]||new J(Q.baseTexture),F.mesh.texture=Y[L],F.mesh.tint=this._tint,q.push(F),N[L]=F}N[L].total++}for(var P=0;P<K.length;P++)q.indexOf(K[P])===-1&&this.removeChild(K[P].mesh);for(var P=0;P<q.length;P++)q[P].mesh.parent!==this&&this.addChild(q[P].mesh);this._activePagesMeshData=q;for(var P in N){var F=N[P],ht=F.total;if(!(((e=F.indices)===null||e===void 0?void 0:e.length)>6*ht)||F.vertices.length<Fn.BATCHABLE_SIZE*2)F.vertices=new Float32Array(4*2*ht),F.uvs=new Float32Array(4*2*ht),F.indices=new Uint16Array(6*ht);else for(var mt=F.total,Tt=F.vertices,W=mt*4*2;W<Tt.length;W++)Tt[W]=0;F.mesh.size=6*ht}for(var P=0;P<B;P++){var T=s[P],it=T.position.x+C[T.line]*(this._align==="justify"?T.prevSpaces:1);this._roundPixels&&(it=Math.round(it));var at=it*o,ct=T.position.y*o,Q=T.texture,nt=N[Q.baseTexture.uid],D=Q.frame,I=Q._uvs,dt=nt.index++;nt.indices[dt*6+0]=0+dt*4,nt.indices[dt*6+1]=1+dt*4,nt.indices[dt*6+2]=2+dt*4,nt.indices[dt*6+3]=0+dt*4,nt.indices[dt*6+4]=2+dt*4,nt.indices[dt*6+5]=3+dt*4,nt.vertices[dt*8+0]=at,nt.vertices[dt*8+1]=ct,nt.vertices[dt*8+2]=at+D.width*o,nt.vertices[dt*8+3]=ct,nt.vertices[dt*8+4]=at+D.width*o,nt.vertices[dt*8+5]=ct+D.height*o,nt.vertices[dt*8+6]=at,nt.vertices[dt*8+7]=ct+D.height*o,nt.uvs[dt*8+0]=I.x0,nt.uvs[dt*8+1]=I.y0,nt.uvs[dt*8+2]=I.x1,nt.uvs[dt*8+3]=I.y1,nt.uvs[dt*8+4]=I.x2,nt.uvs[dt*8+5]=I.y2,nt.uvs[dt*8+6]=I.x3,nt.uvs[dt*8+7]=I.y3}this._textWidth=_*o,this._textHeight=(a.y+n.lineHeight)*o;for(var P in N){var F=N[P];if(this.anchor.x!==0||this.anchor.y!==0)for(var we=0,Qr=this._textWidth*this.anchor.x,zi=this._textHeight*this.anchor.y,pf=0;pf<F.total;pf++)F.vertices[we++]-=Qr,F.vertices[we++]-=zi,F.vertices[we++]-=Qr,F.vertices[we++]-=zi,F.vertices[we++]-=Qr,F.vertices[we++]-=zi,F.vertices[we++]-=Qr,F.vertices[we++]-=zi;this._maxLineHeight=x*o;var vf=F.mesh.geometry.getBuffer("aVertexPosition"),_f=F.mesh.geometry.getBuffer("aTextureCoord"),gf=F.mesh.geometry.getIndex();vf.data=F.vertices,_f.data=F.uvs,gf.data=F.indices,vf.update(),_f.update(),gf.update()}for(var P=0;P<s.length;P++)Cl.push(s[P]);this._font=n,this.dirty=!1},t.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},t.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);var n=We.available[this._fontName],i=n.distanceFieldRange,o=n.distanceFieldType,a=n.size;if(o!=="none")for(var s=this.worldTransform,u=s.a,h=s.b,f=s.c,l=s.d,c=Math.sqrt(u*u+h*h),d=Math.sqrt(f*f+l*l),p=(Math.abs(c)+Math.abs(d))/2,v=this.fontSize/a,_=0,g=this._activePagesMeshData;_<g.length;_++){var m=g[_];m.mesh.shader.uniforms.uFWidth=p*i*v*this._resolution}r.prototype._render.call(this,e)},t.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},t.prototype.validate=function(){var e=We.available[this._fontName];if(!e)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){if(this._tint!==e){this._tint=e;for(var n=0;n<this._activePagesMeshData.length;n++)this._activePagesMeshData[n].mesh.tint=e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},set:function(e){if(!We.available[e])throw new Error('Missing BitmapFont "'+e+'"');this._fontName!==e&&(this._fontName=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){var e;return(e=this._fontSize)!==null&&e!==void 0?e:We.available[this._fontName].size},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anchor",{get:function(){return this._anchor},set:function(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e){var n=this._textureCache,i=We.available[this._fontName],o=i.distanceFieldType==="none"?Rl:Il;o.push.apply(o,this._activePagesMeshData);for(var a=0,s=this._activePagesMeshData;a<s.length;a++){var u=s[a];this.removeChild(u.mesh)}this._activePagesMeshData=[],o.filter(function(l){return n[l.mesh.texture.baseTexture.uid]}).forEach(function(l){l.mesh.texture=J.EMPTY});for(var h in n){var f=n[h];f.destroy(),delete n[h]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,e)},t.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},t})(Ee);var Ax=function(){function r(){}return r.add=function(){Ot.setExtensionXhrType("fnt",Ot.XHR_RESPONSE_TYPE.TEXT)},r.use=function(t,e){var n=Pl(t.data);if(!n){e();return}for(var i=r.getBaseUrl(this,t),o=n.parse(t.data),a={},s=function(v){a[v.metadata.pageFile]=v.texture,Object.keys(a).length===o.page.length&&(t.bitmapFont=We.install(o,a,!0),e())},u=0;u<o.page.length;++u){var h=o.page[u].file,f=i+h,l=!1;for(var c in this.resources){var d=this.resources[c];if(d.url===f){d.metadata.pageFile=h,d.texture?s(d):d.onAfterMiddleware.add(s),l=!0;break}}if(!l){var p={crossOrigin:t.crossOrigin,loadType:Ot.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:h},t.metadata.imageMetadata),parentResource:t};this.add(f,p,s)}}},r.getBaseUrl=function(t,e){var n=e.isDataUrl?"":r.dirname(e.url);return e.isDataUrl&&(n==="."&&(n=""),t.baseUrl&&n&&t.baseUrl.charAt(t.baseUrl.length-1)==="/"&&(n+="/")),n=n.replace(t.baseUrl,""),n&&n.charAt(n.length-1)!=="/"&&(n+="/"),n},r.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":e===""?"/":e},r.extension=gt.Loader,r}();/*!
1037
+ * @pixi/filter-alpha - v6.5.10
1038
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1039
+ *
1040
+ * @pixi/filter-alpha is licensed under the MIT License.
1041
+ * http://www.opensource.org/licenses/mit-license
1042
+ *//*! *****************************************************************************
1043
+ Copyright (c) Microsoft Corporation.
1044
+
1045
+ Permission to use, copy, modify, and/or distribute this software for any
1046
+ purpose with or without fee is hereby granted.
1047
+
1048
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1049
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1050
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1051
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1052
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1053
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1054
+ PERFORMANCE OF THIS SOFTWARE.
1055
+ ***************************************************************************** */var Ka=function(r,t){return Ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Ka(r,t)};function Px(r,t){Ka(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Ox=`varying vec2 vTextureCoord;
1056
+
1057
+ uniform sampler2D uSampler;
1058
+ uniform float uAlpha;
1059
+
1060
+ void main(void)
1061
+ {
1062
+ gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
1063
+ }
1064
+ `;(function(r){Px(t,r);function t(e){e===void 0&&(e=1);var n=r.call(this,x0,Ox,{uAlpha:1})||this;return n.alpha=e,n}return Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t})(Ye);/*!
1065
+ * @pixi/filter-blur - v6.5.10
1066
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1067
+ *
1068
+ * @pixi/filter-blur is licensed under the MIT License.
1069
+ * http://www.opensource.org/licenses/mit-license
1070
+ *//*! *****************************************************************************
1071
+ Copyright (c) Microsoft Corporation.
1072
+
1073
+ Permission to use, copy, modify, and/or distribute this software for any
1074
+ purpose with or without fee is hereby granted.
1075
+
1076
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1077
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1078
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1079
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1080
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1081
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1082
+ PERFORMANCE OF THIS SOFTWARE.
1083
+ ***************************************************************************** */var Za=function(r,t){return Za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Za(r,t)};function Ml(r,t){Za(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Rx=`
1084
+ attribute vec2 aVertexPosition;
1085
+
1086
+ uniform mat3 projectionMatrix;
1087
+
1088
+ uniform float strength;
1089
+
1090
+ varying vec2 vBlurTexCoords[%size%];
1091
+
1092
+ uniform vec4 inputSize;
1093
+ uniform vec4 outputFrame;
1094
+
1095
+ vec4 filterVertexPosition( void )
1096
+ {
1097
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1098
+
1099
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1100
+ }
1101
+
1102
+ vec2 filterTextureCoord( void )
1103
+ {
1104
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
1105
+ }
1106
+
1107
+ void main(void)
1108
+ {
1109
+ gl_Position = filterVertexPosition();
1110
+
1111
+ vec2 textureCoord = filterTextureCoord();
1112
+ %blur%
1113
+ }`;function Ix(r,t){var e=Math.ceil(r/2),n=Rx,i="",o;t?o="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":o="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a<r;a++){var s=o.replace("%index%",a.toString());s=s.replace("%sampleIndex%",a-(e-1)+".0"),i+=s,i+=`
1114
+ `}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var Cx={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},Mx=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
1115
+ `);function Dx(r){for(var t=Cx[r],e=t.length,n=Mx,i="",o="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",a,s=0;s<r;s++){var u=o.replace("%index%",s.toString());a=s,s>=e&&(a=r-s-1),u=u.replace("%value%",t[a].toString()),i+=u,i+=`
1116
+ `}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var Dl=function(r){Ml(t,r);function t(e,n,i,o,a){n===void 0&&(n=8),i===void 0&&(i=4),o===void 0&&(o=G.FILTER_RESOLUTION),a===void 0&&(a=5);var s=this,u=Ix(a,e),h=Dx(a);return s=r.call(this,u,h)||this,s.horizontal=e,s.resolution=o,s._quality=0,s.quality=i,s.blur=n,s}return t.prototype.apply=function(e,n,i,o){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/n.width):this.uniforms.strength=1/i.height*(i.height/n.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/n.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/n.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,n,i,o);else{var a=e.getFilterTexture(),s=e.renderer,u=n,h=a;this.state.blend=!1,e.applyFilter(this,u,h,ue.CLEAR);for(var f=1;f<this.passes-1;f++){e.bindAndClear(u,ue.BLIT),this.uniforms.uSampler=h;var l=h;h=u,u=l,s.shader.bind(this),s.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,h,i,o),e.returnFilterTexture(a)}},Object.defineProperty(t.prototype,"blur",{get:function(){return this.strength},set:function(e){this.padding=1+Math.abs(e)*2,this.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._quality},set:function(e){this._quality=e,this.passes=e},enumerable:!1,configurable:!0}),t}(Ye);(function(r){Ml(t,r);function t(e,n,i,o){e===void 0&&(e=8),n===void 0&&(n=4),i===void 0&&(i=G.FILTER_RESOLUTION),o===void 0&&(o=5);var a=r.call(this)||this;return a.blurXFilter=new Dl(!0,e,n,i,o),a.blurYFilter=new Dl(!1,e,n,i,o),a.resolution=i,a.quality=n,a.blur=e,a.repeatEdgePixels=!1,a}return t.prototype.apply=function(e,n,i,o){var a=Math.abs(this.blurXFilter.strength),s=Math.abs(this.blurYFilter.strength);if(a&&s){var u=e.getFilterTexture();this.blurXFilter.apply(e,n,u,ue.CLEAR),this.blurYFilter.apply(e,u,i,o),e.returnFilterTexture(u)}else s?this.blurYFilter.apply(e,n,i,o):this.blurXFilter.apply(e,n,i,o)},t.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2},Object.defineProperty(t.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(e){this.blurXFilter.quality=this.blurYFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(e){this.blurYFilter.blur=e,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(e){this.blurYFilter.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(e){this._repeatEdgePixels=e,this.updatePadding()},enumerable:!1,configurable:!0}),t})(Ye);/*!
1117
+ * @pixi/filter-color-matrix - v6.5.10
1118
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1119
+ *
1120
+ * @pixi/filter-color-matrix is licensed under the MIT License.
1121
+ * http://www.opensource.org/licenses/mit-license
1122
+ *//*! *****************************************************************************
1123
+ Copyright (c) Microsoft Corporation.
1124
+
1125
+ Permission to use, copy, modify, and/or distribute this software for any
1126
+ purpose with or without fee is hereby granted.
1127
+
1128
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1129
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1130
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1131
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1132
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1133
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1134
+ PERFORMANCE OF THIS SOFTWARE.
1135
+ ***************************************************************************** */var Ja=function(r,t){return Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Ja(r,t)};function Fx(r,t){Ja(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Bx=`varying vec2 vTextureCoord;
1136
+ uniform sampler2D uSampler;
1137
+ uniform float m[20];
1138
+ uniform float uAlpha;
1139
+
1140
+ void main(void)
1141
+ {
1142
+ vec4 c = texture2D(uSampler, vTextureCoord);
1143
+
1144
+ if (uAlpha == 0.0) {
1145
+ gl_FragColor = c;
1146
+ return;
1147
+ }
1148
+
1149
+ // Un-premultiply alpha before applying the color matrix. See issue #3539.
1150
+ if (c.a > 0.0) {
1151
+ c.rgb /= c.a;
1152
+ }
1153
+
1154
+ vec4 result;
1155
+
1156
+ result.r = (m[0] * c.r);
1157
+ result.r += (m[1] * c.g);
1158
+ result.r += (m[2] * c.b);
1159
+ result.r += (m[3] * c.a);
1160
+ result.r += m[4];
1161
+
1162
+ result.g = (m[5] * c.r);
1163
+ result.g += (m[6] * c.g);
1164
+ result.g += (m[7] * c.b);
1165
+ result.g += (m[8] * c.a);
1166
+ result.g += m[9];
1167
+
1168
+ result.b = (m[10] * c.r);
1169
+ result.b += (m[11] * c.g);
1170
+ result.b += (m[12] * c.b);
1171
+ result.b += (m[13] * c.a);
1172
+ result.b += m[14];
1173
+
1174
+ result.a = (m[15] * c.r);
1175
+ result.a += (m[16] * c.g);
1176
+ result.a += (m[17] * c.b);
1177
+ result.a += (m[18] * c.a);
1178
+ result.a += m[19];
1179
+
1180
+ vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
1181
+
1182
+ // Premultiply alpha again.
1183
+ rgb *= result.a;
1184
+
1185
+ gl_FragColor = vec4(rgb, result.a);
1186
+ }
1187
+ `,Fl=function(r){Fx(t,r);function t(){var e=this,n={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return e=r.call(this,Wh,Bx,n)||this,e.alpha=1,e}return t.prototype._loadMatrix=function(e,n){n===void 0&&(n=!1);var i=e;n&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i},t.prototype._multiply=function(e,n,i){return e[0]=n[0]*i[0]+n[1]*i[5]+n[2]*i[10]+n[3]*i[15],e[1]=n[0]*i[1]+n[1]*i[6]+n[2]*i[11]+n[3]*i[16],e[2]=n[0]*i[2]+n[1]*i[7]+n[2]*i[12]+n[3]*i[17],e[3]=n[0]*i[3]+n[1]*i[8]+n[2]*i[13]+n[3]*i[18],e[4]=n[0]*i[4]+n[1]*i[9]+n[2]*i[14]+n[3]*i[19]+n[4],e[5]=n[5]*i[0]+n[6]*i[5]+n[7]*i[10]+n[8]*i[15],e[6]=n[5]*i[1]+n[6]*i[6]+n[7]*i[11]+n[8]*i[16],e[7]=n[5]*i[2]+n[6]*i[7]+n[7]*i[12]+n[8]*i[17],e[8]=n[5]*i[3]+n[6]*i[8]+n[7]*i[13]+n[8]*i[18],e[9]=n[5]*i[4]+n[6]*i[9]+n[7]*i[14]+n[8]*i[19]+n[9],e[10]=n[10]*i[0]+n[11]*i[5]+n[12]*i[10]+n[13]*i[15],e[11]=n[10]*i[1]+n[11]*i[6]+n[12]*i[11]+n[13]*i[16],e[12]=n[10]*i[2]+n[11]*i[7]+n[12]*i[12]+n[13]*i[17],e[13]=n[10]*i[3]+n[11]*i[8]+n[12]*i[13]+n[13]*i[18],e[14]=n[10]*i[4]+n[11]*i[9]+n[12]*i[14]+n[13]*i[19]+n[14],e[15]=n[15]*i[0]+n[16]*i[5]+n[17]*i[10]+n[18]*i[15],e[16]=n[15]*i[1]+n[16]*i[6]+n[17]*i[11]+n[18]*i[16],e[17]=n[15]*i[2]+n[16]*i[7]+n[17]*i[12]+n[18]*i[17],e[18]=n[15]*i[3]+n[16]*i[8]+n[17]*i[13]+n[18]*i[18],e[19]=n[15]*i[4]+n[16]*i[9]+n[17]*i[14]+n[18]*i[19]+n[19],e},t.prototype._colorMatrix=function(e){var n=new Float32Array(e);return n[4]/=255,n[9]/=255,n[14]/=255,n[19]/=255,n},t.prototype.brightness=function(e,n){var i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,n)},t.prototype.tint=function(e,n){var i=e>>16&255,o=e>>8&255,a=e&255,s=[i/255,0,0,0,0,0,o/255,0,0,0,0,0,a/255,0,0,0,0,0,1,0];this._loadMatrix(s,n)},t.prototype.greyscale=function(e,n){var i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,n)},t.prototype.blackAndWhite=function(e){var n=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.hue=function(e,n){e=(e||0)/180*Math.PI;var i=Math.cos(e),o=Math.sin(e),a=Math.sqrt,s=1/3,u=a(s),h=i+(1-i)*s,f=s*(1-i)-u*o,l=s*(1-i)+u*o,c=s*(1-i)+u*o,d=i+s*(1-i),p=s*(1-i)-u*o,v=s*(1-i)-u*o,_=s*(1-i)+u*o,g=i+s*(1-i),m=[h,f,l,0,0,c,d,p,0,0,v,_,g,0,0,0,0,0,1,0];this._loadMatrix(m,n)},t.prototype.contrast=function(e,n){var i=(e||0)+1,o=-.5*(i-1),a=[i,0,0,0,o,0,i,0,0,o,0,0,i,0,o,0,0,0,1,0];this._loadMatrix(a,n)},t.prototype.saturate=function(e,n){e===void 0&&(e=0);var i=e*2/3+1,o=(i-1)*-.5,a=[i,o,o,0,0,o,i,o,0,0,o,o,i,0,0,0,0,0,1,0];this._loadMatrix(a,n)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){var n=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.sepia=function(e){var n=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.technicolor=function(e){var n=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.polaroid=function(e){var n=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.toBGR=function(e){var n=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.kodachrome=function(e){var n=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.browni=function(e){var n=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.vintage=function(e){var n=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.colorTone=function(e,n,i,o,a){e=e||.2,n=n||.15,i=i||16770432,o=o||3375104;var s=(i>>16&255)/255,u=(i>>8&255)/255,h=(i&255)/255,f=(o>>16&255)/255,l=(o>>8&255)/255,c=(o&255)/255,d=[.3,.59,.11,0,0,s,u,h,e,0,f,l,c,n,0,s-f,u-l,h-c,0,0];this._loadMatrix(d,a)},t.prototype.night=function(e,n){e=e||.1;var i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,n)},t.prototype.predator=function(e,n){var i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,n)},t.prototype.lsd=function(e){var n=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(n,e)},t.prototype.reset=function(){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(Ye);Fl.prototype.grayscale=Fl.prototype.greyscale;/*!
1188
+ * @pixi/filter-displacement - v6.5.10
1189
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1190
+ *
1191
+ * @pixi/filter-displacement is licensed under the MIT License.
1192
+ * http://www.opensource.org/licenses/mit-license
1193
+ *//*! *****************************************************************************
1194
+ Copyright (c) Microsoft Corporation.
1195
+
1196
+ Permission to use, copy, modify, and/or distribute this software for any
1197
+ purpose with or without fee is hereby granted.
1198
+
1199
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1200
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1201
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1202
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1203
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1204
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1205
+ PERFORMANCE OF THIS SOFTWARE.
1206
+ ***************************************************************************** */var Qa=function(r,t){return Qa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},Qa(r,t)};function Nx(r,t){Qa(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Lx=`varying vec2 vFilterCoord;
1207
+ varying vec2 vTextureCoord;
1208
+
1209
+ uniform vec2 scale;
1210
+ uniform mat2 rotation;
1211
+ uniform sampler2D uSampler;
1212
+ uniform sampler2D mapSampler;
1213
+
1214
+ uniform highp vec4 inputSize;
1215
+ uniform vec4 inputClamp;
1216
+
1217
+ void main(void)
1218
+ {
1219
+ vec4 map = texture2D(mapSampler, vFilterCoord);
1220
+
1221
+ map -= 0.5;
1222
+ map.xy = scale * inputSize.zw * (rotation * map.xy);
1223
+
1224
+ gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
1225
+ }
1226
+ `,Ux=`attribute vec2 aVertexPosition;
1227
+
1228
+ uniform mat3 projectionMatrix;
1229
+ uniform mat3 filterMatrix;
1230
+
1231
+ varying vec2 vTextureCoord;
1232
+ varying vec2 vFilterCoord;
1233
+
1234
+ uniform vec4 inputSize;
1235
+ uniform vec4 outputFrame;
1236
+
1237
+ vec4 filterVertexPosition( void )
1238
+ {
1239
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1240
+
1241
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1242
+ }
1243
+
1244
+ vec2 filterTextureCoord( void )
1245
+ {
1246
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
1247
+ }
1248
+
1249
+ void main(void)
1250
+ {
1251
+ gl_Position = filterVertexPosition();
1252
+ vTextureCoord = filterTextureCoord();
1253
+ vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
1254
+ }
1255
+ `;(function(r){Nx(t,r);function t(e,n){var i=this,o=new Mt;return e.renderable=!1,i=r.call(this,Ux,Lx,{mapSampler:e._texture,filterMatrix:o,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,i.maskSprite=e,i.maskMatrix=o,n==null&&(n=20),i.scale=new Et(n,n),i}return t.prototype.apply=function(e,n,i,o){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var a=this.maskSprite.worldTransform,s=Math.sqrt(a.a*a.a+a.b*a.b),u=Math.sqrt(a.c*a.c+a.d*a.d);s!==0&&u!==0&&(this.uniforms.rotation[0]=a.a/s,this.uniforms.rotation[1]=a.b/s,this.uniforms.rotation[2]=a.c/u,this.uniforms.rotation[3]=a.d/u),e.applyFilter(this,n,i,o)},Object.defineProperty(t.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0}),t})(Ye);/*!
1256
+ * @pixi/filter-fxaa - v6.5.10
1257
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1258
+ *
1259
+ * @pixi/filter-fxaa is licensed under the MIT License.
1260
+ * http://www.opensource.org/licenses/mit-license
1261
+ *//*! *****************************************************************************
1262
+ Copyright (c) Microsoft Corporation.
1263
+
1264
+ Permission to use, copy, modify, and/or distribute this software for any
1265
+ purpose with or without fee is hereby granted.
1266
+
1267
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1268
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1269
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1270
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1271
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1272
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1273
+ PERFORMANCE OF THIS SOFTWARE.
1274
+ ***************************************************************************** */var ts=function(r,t){return ts=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},ts(r,t)};function Gx(r,t){ts(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var kx=`
1275
+ attribute vec2 aVertexPosition;
1276
+
1277
+ uniform mat3 projectionMatrix;
1278
+
1279
+ varying vec2 v_rgbNW;
1280
+ varying vec2 v_rgbNE;
1281
+ varying vec2 v_rgbSW;
1282
+ varying vec2 v_rgbSE;
1283
+ varying vec2 v_rgbM;
1284
+
1285
+ varying vec2 vFragCoord;
1286
+
1287
+ uniform vec4 inputSize;
1288
+ uniform vec4 outputFrame;
1289
+
1290
+ vec4 filterVertexPosition( void )
1291
+ {
1292
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1293
+
1294
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1295
+ }
1296
+
1297
+ void texcoords(vec2 fragCoord, vec2 inverseVP,
1298
+ out vec2 v_rgbNW, out vec2 v_rgbNE,
1299
+ out vec2 v_rgbSW, out vec2 v_rgbSE,
1300
+ out vec2 v_rgbM) {
1301
+ v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
1302
+ v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
1303
+ v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
1304
+ v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
1305
+ v_rgbM = vec2(fragCoord * inverseVP);
1306
+ }
1307
+
1308
+ void main(void) {
1309
+
1310
+ gl_Position = filterVertexPosition();
1311
+
1312
+ vFragCoord = aVertexPosition * outputFrame.zw;
1313
+
1314
+ texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1315
+ }
1316
+ `,Hx=`varying vec2 v_rgbNW;
1317
+ varying vec2 v_rgbNE;
1318
+ varying vec2 v_rgbSW;
1319
+ varying vec2 v_rgbSE;
1320
+ varying vec2 v_rgbM;
1321
+
1322
+ varying vec2 vFragCoord;
1323
+ uniform sampler2D uSampler;
1324
+ uniform highp vec4 inputSize;
1325
+
1326
+
1327
+ /**
1328
+ Basic FXAA implementation based on the code on geeks3d.com with the
1329
+ modification that the texture2DLod stuff was removed since it's
1330
+ unsupported by WebGL.
1331
+
1332
+ --
1333
+
1334
+ From:
1335
+ https://github.com/mitsuhiko/webgl-meincraft
1336
+
1337
+ Copyright (c) 2011 by Armin Ronacher.
1338
+
1339
+ Some rights reserved.
1340
+
1341
+ Redistribution and use in source and binary forms, with or without
1342
+ modification, are permitted provided that the following conditions are
1343
+ met:
1344
+
1345
+ * Redistributions of source code must retain the above copyright
1346
+ notice, this list of conditions and the following disclaimer.
1347
+
1348
+ * Redistributions in binary form must reproduce the above
1349
+ copyright notice, this list of conditions and the following
1350
+ disclaimer in the documentation and/or other materials provided
1351
+ with the distribution.
1352
+
1353
+ * The names of the contributors may not be used to endorse or
1354
+ promote products derived from this software without specific
1355
+ prior written permission.
1356
+
1357
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1358
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1359
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1360
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1361
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1362
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1363
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1364
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1365
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1366
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1367
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1368
+ */
1369
+
1370
+ #ifndef FXAA_REDUCE_MIN
1371
+ #define FXAA_REDUCE_MIN (1.0/ 128.0)
1372
+ #endif
1373
+ #ifndef FXAA_REDUCE_MUL
1374
+ #define FXAA_REDUCE_MUL (1.0 / 8.0)
1375
+ #endif
1376
+ #ifndef FXAA_SPAN_MAX
1377
+ #define FXAA_SPAN_MAX 8.0
1378
+ #endif
1379
+
1380
+ //optimized version for mobile, where dependent
1381
+ //texture reads can be a bottleneck
1382
+ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
1383
+ vec2 v_rgbNW, vec2 v_rgbNE,
1384
+ vec2 v_rgbSW, vec2 v_rgbSE,
1385
+ vec2 v_rgbM) {
1386
+ vec4 color;
1387
+ vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
1388
+ vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
1389
+ vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
1390
+ vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
1391
+ vec4 texColor = texture2D(tex, v_rgbM);
1392
+ vec3 rgbM = texColor.xyz;
1393
+ vec3 luma = vec3(0.299, 0.587, 0.114);
1394
+ float lumaNW = dot(rgbNW, luma);
1395
+ float lumaNE = dot(rgbNE, luma);
1396
+ float lumaSW = dot(rgbSW, luma);
1397
+ float lumaSE = dot(rgbSE, luma);
1398
+ float lumaM = dot(rgbM, luma);
1399
+ float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
1400
+ float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
1401
+
1402
+ mediump vec2 dir;
1403
+ dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
1404
+ dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
1405
+
1406
+ float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
1407
+ (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
1408
+
1409
+ float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
1410
+ dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
1411
+ max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
1412
+ dir * rcpDirMin)) * inverseVP;
1413
+
1414
+ vec3 rgbA = 0.5 * (
1415
+ texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
1416
+ texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
1417
+ vec3 rgbB = rgbA * 0.5 + 0.25 * (
1418
+ texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
1419
+ texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
1420
+
1421
+ float lumaB = dot(rgbB, luma);
1422
+ if ((lumaB < lumaMin) || (lumaB > lumaMax))
1423
+ color = vec4(rgbA, texColor.a);
1424
+ else
1425
+ color = vec4(rgbB, texColor.a);
1426
+ return color;
1427
+ }
1428
+
1429
+ void main() {
1430
+
1431
+ vec4 color;
1432
+
1433
+ color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1434
+
1435
+ gl_FragColor = color;
1436
+ }
1437
+ `;(function(r){Gx(t,r);function t(){return r.call(this,kx,Hx)||this}return t})(Ye);/*!
1438
+ * @pixi/filter-noise - v6.5.10
1439
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1440
+ *
1441
+ * @pixi/filter-noise is licensed under the MIT License.
1442
+ * http://www.opensource.org/licenses/mit-license
1443
+ *//*! *****************************************************************************
1444
+ Copyright (c) Microsoft Corporation.
1445
+
1446
+ Permission to use, copy, modify, and/or distribute this software for any
1447
+ purpose with or without fee is hereby granted.
1448
+
1449
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1450
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1451
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1452
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1453
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1454
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1455
+ PERFORMANCE OF THIS SOFTWARE.
1456
+ ***************************************************************************** */var es=function(r,t){return es=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},es(r,t)};function Xx(r,t){es(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var jx=`precision highp float;
1457
+
1458
+ varying vec2 vTextureCoord;
1459
+ varying vec4 vColor;
1460
+
1461
+ uniform float uNoise;
1462
+ uniform float uSeed;
1463
+ uniform sampler2D uSampler;
1464
+
1465
+ float rand(vec2 co)
1466
+ {
1467
+ return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
1468
+ }
1469
+
1470
+ void main()
1471
+ {
1472
+ vec4 color = texture2D(uSampler, vTextureCoord);
1473
+ float randomValue = rand(gl_FragCoord.xy * uSeed);
1474
+ float diff = (randomValue - 0.5) * uNoise;
1475
+
1476
+ // Un-premultiply alpha before applying the color matrix. See issue #3539.
1477
+ if (color.a > 0.0) {
1478
+ color.rgb /= color.a;
1479
+ }
1480
+
1481
+ color.r += diff;
1482
+ color.g += diff;
1483
+ color.b += diff;
1484
+
1485
+ // Premultiply alpha again.
1486
+ color.rgb *= color.a;
1487
+
1488
+ gl_FragColor = color;
1489
+ }
1490
+ `;(function(r){Xx(t,r);function t(e,n){e===void 0&&(e=.5),n===void 0&&(n=Math.random());var i=r.call(this,Wh,jx,{uNoise:0,uSeed:0})||this;return i.noise=e,i.seed=n,i}return Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),t})(Ye);/*!
1491
+ * @pixi/mixin-cache-as-bitmap - v6.5.10
1492
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1493
+ *
1494
+ * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.
1495
+ * http://www.opensource.org/licenses/mit-license
1496
+ */var Bl=new Mt;Rt.prototype._cacheAsBitmap=!1,Rt.prototype._cacheData=null,Rt.prototype._cacheAsBitmapResolution=null,Rt.prototype._cacheAsBitmapMultisample=wt.NONE;var Yx=function(){function r(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return r}();Object.defineProperties(Rt.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(r){r!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(r){r!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(r){if(this._cacheAsBitmap!==r){this._cacheAsBitmap=r;var t;r?(this._cacheData||(this._cacheData=new Yx),t=this._cacheData,t.originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(t=this._cacheData,t.sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea)}}}}),Rt.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Rt.prototype._initCachedDisplayObject=function(t){var e;if(!(this._cacheData&&this._cacheData.sprite)){var n=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var o=this.filters[0].padding;i.pad(o)}i.ceil(G.RESOLUTION);var a=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),u=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,f=hr.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:(e=this.cacheAsBitmapMultisample)!==null&&e!==void 0?e:t.multisample}),l="cacheAsBitmap_"+nr();this._cacheData.textureCacheId=l,ut.addToCache(f.baseTexture,l),J.addToCache(f,l);var c=this.transform.localTransform.copyTo(Bl).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:f,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(a,s,u),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var d=new Cn(f);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(i.x/i.width),d.anchor.y=-(i.y/i.height),d.alpha=n,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Rt.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Rt.prototype._initCachedDisplayObjectCanvas=function(t){if(!(this._cacheData&&this._cacheData.sprite)){var e=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var i=t.context,o=t._projTransform;e.ceil(G.RESOLUTION);var a=hr.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+nr();this._cacheData.textureCacheId=s,ut.addToCache(a.baseTexture,s),J.addToCache(a,s);var u=Bl;this.transform.localTransform.copyTo(u),u.invert(),u.tx-=e.x,u.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:a,clear:!0,transform:u,skipUpdateTransform:!1}),t.context=i,t._projTransform=o,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var h=new Cn(a);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-(e.x/e.width),h.anchor.y=-(e.y/e.height),h.alpha=n,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Rt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Rt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Rt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ut.removeFromCache(this._cacheData.textureCacheId),J.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Rt.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)};/*!
1497
+ * @pixi/mixin-get-child-by-name - v6.5.10
1498
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1499
+ *
1500
+ * @pixi/mixin-get-child-by-name is licensed under the MIT License.
1501
+ * http://www.opensource.org/licenses/mit-license
1502
+ */Rt.prototype.name=null,Ee.prototype.getChildByName=function(t,e){for(var n=0,i=this.children.length;n<i;n++)if(this.children[n].name===t)return this.children[n];if(e)for(var n=0,i=this.children.length;n<i;n++){var o=this.children[n];if(o.getChildByName){var a=o.getChildByName(t,!0);if(a)return a}}return null};/*!
1503
+ * @pixi/mixin-get-global-position - v6.5.10
1504
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1505
+ *
1506
+ * @pixi/mixin-get-global-position is licensed under the MIT License.
1507
+ * http://www.opensource.org/licenses/mit-license
1508
+ */Rt.prototype.getGlobalPosition=function(t,e){return t===void 0&&(t=new Et),e===void 0&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};/*!
1509
+ * @pixi/app - v6.5.10
1510
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1511
+ *
1512
+ * @pixi/app is licensed under the MIT License.
1513
+ * http://www.opensource.org/licenses/mit-license
1514
+ */var Vx=function(){function r(){}return r.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame(function(){return e.resize()}))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){e.cancelResize();var n,i;if(e._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{var o=e._resizeTo,a=o.clientWidth,s=o.clientHeight;n=a,i=s}e.renderer.resize(n,i)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},r.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},r.extension=gt.Application,r}(),zx=function(){function r(t){var e=this;this.stage=new Ee,t=Object.assign({forceCanvas:!1},t),this.renderer=zh(t),r._plugins.forEach(function(n){n.init.call(e,t)})}return r.registerPlugin=function(t){le("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Re.add({type:gt.Application,ref:t})},r.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(r.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),r.prototype.destroy=function(t,e){var n=this,i=r._plugins.slice(0);i.reverse(),i.forEach(function(o){o.destroy.call(n)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null},r._plugins=[],r}();Re.handleByList(gt.Application,zx._plugins),Re.add(Vx);/*!
1515
+ * @pixi/mesh-extras - v6.5.10
1516
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1517
+ *
1518
+ * @pixi/mesh-extras is licensed under the MIT License.
1519
+ * http://www.opensource.org/licenses/mit-license
1520
+ *//*! *****************************************************************************
1521
+ Copyright (c) Microsoft Corporation.
1522
+
1523
+ Permission to use, copy, modify, and/or distribute this software for any
1524
+ purpose with or without fee is hereby granted.
1525
+
1526
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1527
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1528
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1529
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1530
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1531
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1532
+ PERFORMANCE OF THIS SOFTWARE.
1533
+ ***************************************************************************** */var rs=function(r,t){return rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},rs(r,t)};function qr(r,t){rs(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Wx=function(r){qr(t,r);function t(e,n,i,o){e===void 0&&(e=100),n===void 0&&(n=100),i===void 0&&(i=10),o===void 0&&(o=10);var a=r.call(this)||this;return a.segWidth=i,a.segHeight=o,a.width=e,a.height=n,a.build(),a}return t.prototype.build=function(){for(var e=this.segWidth*this.segHeight,n=[],i=[],o=[],a=this.segWidth-1,s=this.segHeight-1,u=this.width/a,h=this.height/s,f=0;f<e;f++){var l=f%this.segWidth,c=f/this.segWidth|0;n.push(l*u,c*h),i.push(l/a,c/s)}for(var d=a*s,f=0;f<d;f++){var p=f%a,v=f/a|0,_=v*this.segWidth+p,g=v*this.segWidth+p+1,m=(v+1)*this.segWidth+p,y=(v+1)*this.segWidth+p+1;o.push(_,g,m,g,y,m)}this.buffers[0].data=new Float32Array(n),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(o),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},t}(Ui),qx=function(r){qr(t,r);function t(e,n,i){e===void 0&&(e=200),i===void 0&&(i=0);var o=r.call(this,new Float32Array(n.length*4),new Float32Array(n.length*4),new Uint16Array((n.length-1)*6))||this;return o.points=n,o._width=e,o.textureScale=i,o.build(),o}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),t.prototype.build=function(){var e=this.points;if(e){var n=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),o=this.getIndex();if(!(e.length<1)){n.data.length/4!==e.length&&(n.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),o.data=new Uint16Array((e.length-1)*6));var a=i.data,s=o.data;a[0]=0,a[1]=0,a[2]=0,a[3]=1;for(var u=0,h=e[0],f=this._width*this.textureScale,l=e.length,c=0;c<l;c++){var d=c*4;if(this.textureScale>0){var p=h.x-e[c].x,v=h.y-e[c].y,_=Math.sqrt(p*p+v*v);h=e[c],u+=_/f}else u=c/(l-1);a[d]=u,a[d+1]=0,a[d+2]=u,a[d+3]=1}for(var g=0,c=0;c<l-1;c++){var d=c*2;s[g++]=d,s[g++]=d+1,s[g++]=d+2,s[g++]=d+2,s[g++]=d+1,s[g++]=d+3}i.update(),o.update(),this.updateVertices()}}},t.prototype.updateVertices=function(){var e=this.points;if(!(e.length<1)){for(var n=e[0],i,o=0,a=0,s=this.buffers[0].data,u=e.length,h=0;h<u;h++){var f=e[h],l=h*4;h<e.length-1?i=e[h+1]:i=f,a=-(i.x-n.x),o=i.y-n.y;var c=Math.sqrt(o*o+a*a),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;o/=c,a/=c,o*=d,a*=d,s[l]=f.x+o,s[l+1]=f.y+a,s[l+2]=f.x-o,s[l+3]=f.y-a,n=f}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(Ui);(function(r){qr(t,r);function t(e,n,i){i===void 0&&(i=0);var o=this,a=new qx(e.height,n,i),s=new Bn(e);return i>0&&(e.baseTexture.wrapMode=ge.REPEAT),o=r.call(this,a,s)||this,o.autoUpdate=!0,o}return t.prototype._render=function(e){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),r.prototype._render.call(this,e)},t})(Fn);var $x=function(r){qr(t,r);function t(e,n,i){var o=this,a=new Wx(e.width,e.height,n,i),s=new Bn(J.WHITE);return o=r.call(this,a,s)||this,o.texture=e,o.autoResize=!0,o}return t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,n=this.shader.texture,i=n.width,o=n.height;this.autoResize&&(e.width!==i||e.height!==o)&&(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),r.prototype._render.call(this,e)},t.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),r.prototype.destroy.call(this,e)},t}(Fn);(function(r){qr(t,r);function t(e,n,i,o,a){e===void 0&&(e=J.EMPTY);var s=this,u=new Ui(n,i,o);u.getBuffer("aVertexPosition").static=!1;var h=new Bn(e);return s=r.call(this,u,h,null,a)||this,s.autoUpdate=!0,s}return Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),r.prototype._render.call(this,e)},t})(Fn);var Hi=10;(function(r){qr(t,r);function t(e,n,i,o,a){n===void 0&&(n=Hi),i===void 0&&(i=Hi),o===void 0&&(o=Hi),a===void 0&&(a=Hi);var s=r.call(this,J.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=n,s._rightWidth=o,s._topHeight=i,s._bottomHeight=a,s.texture=e,s}return t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,n=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*n,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*n,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,n=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*n,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*n,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,n=this._width>e?1:this._width/e,i=this._topHeight+this._bottomHeight,o=this._height>i?1:this._height/i,a=Math.min(n,o);return a},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,n=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var i=1/this._origWidth,o=1/this._origHeight;n[0]=n[8]=n[16]=n[24]=0,n[1]=n[3]=n[5]=n[7]=0,n[6]=n[14]=n[22]=n[30]=1,n[25]=n[27]=n[29]=n[31]=1,n[2]=n[10]=n[18]=n[26]=i*this._leftWidth,n[4]=n[12]=n[20]=n[28]=1-i*this._rightWidth,n[9]=n[11]=n[13]=n[15]=o*this._topHeight,n[17]=n[19]=n[21]=n[23]=1-o*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},t})($x);/*!
1534
+ * @pixi/sprite-animated - v6.5.10
1535
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1536
+ *
1537
+ * @pixi/sprite-animated is licensed under the MIT License.
1538
+ * http://www.opensource.org/licenses/mit-license
1539
+ *//*! *****************************************************************************
1540
+ Copyright (c) Microsoft Corporation.
1541
+
1542
+ Permission to use, copy, modify, and/or distribute this software for any
1543
+ purpose with or without fee is hereby granted.
1544
+
1545
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1546
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1547
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1548
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1549
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1550
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1551
+ PERFORMANCE OF THIS SOFTWARE.
1552
+ ***************************************************************************** */var ns=function(r,t){return ns=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])},ns(r,t)};function Kx(r,t){ns(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}(function(r){Kx(t,r);function t(e,n){n===void 0&&(n=!0);var i=r.call(this,e[0]instanceof J?e[0]:e[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=n,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=e,i}return t.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1))},t.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(kt.shared.add(this.update,this,Ie.HIGH),this._isConnectedToTicker=!0))},t.prototype.gotoAndStop=function(e){this.stop();var n=this.currentFrame;this._currentTime=e,n!==this.currentFrame&&this.updateTexture()},t.prototype.gotoAndPlay=function(e){var n=this.currentFrame;this._currentTime=e,n!==this.currentFrame&&this.updateTexture(),this.play()},t.prototype.update=function(e){if(this._playing){var n=this.animationSpeed*e,i=this.currentFrame;if(this._durations!==null){var o=this._currentTime%1*this._durations[this.currentFrame];for(o+=n/60*1e3;o<0;)this._currentTime--,o+=this._durations[this.currentFrame];var a=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);o>=this._durations[this.currentFrame];)o-=this._durations[this.currentFrame]*a,this._currentTime+=a;this._currentTime+=o/this._durations[this.currentFrame]}else this._currentTime+=n;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()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i?this.onLoop():this.animationSpeed<0&&this.currentFrame>i&&this.onLoop()),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],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))},t.prototype.destroy=function(e){this.stop(),r.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var n=[],i=0;i<e.length;++i)n.push(J.from(e[i]));return new t(n)},t.fromImages=function(e){for(var n=[],i=0;i<e.length;++i)n.push(J.from(e[i]));return new t(n)},Object.defineProperty(t.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textures",{get:function(){return this._textures},set:function(e){if(e[0]instanceof J)this._textures=e,this._durations=null;else{this._textures=[],this._durations=[];for(var n=0;n<e.length;n++)this._textures.push(e[n].texture),this._durations.push(e[n].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentFrame",{get:function(){var e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(kt.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),t})(Cn);/*!
1553
+ * pixi.js - v6.5.10
1554
+ * Compiled Thu, 06 Jul 2023 15:25:11 UTC
1555
+ *
1556
+ * pixi.js is licensed under the MIT License.
1557
+ * http://www.opensource.org/licenses/mit-license
1558
+ */Re.add(M0,k0,L0,Mb,sx,Zh,px,Ax,nb,Ob,Rb,hx,Zm,q0);const Xi=1733608,Zx=.25,is=r=>(t,e)=>{const n=e!=null&&e.fill?mn(e.fill):Xi,i=(e==null?void 0:e.fillOpacity)===void 0?Zx:e.fillOpacity,o=new zr;return o.beginFill(16777215,i),o.lineStyle(1,16777215,1,.5,!0),r(t,o),o.endFill(),o.tint=n,o},Jx=is((r,t)=>{const{cx:e,cy:n,rx:i,ry:o}=r.geometry;t.drawEllipse(e,n,i,o)}),Qx=is((r,t)=>{const e=r.geometry.points.reduce((n,i)=>[...n,...i],[]);t.drawPolygon(e)}),t1=is((r,t)=>{const{x:e,y:n,w:i,h:o}=r.geometry;t.drawRect(e,n,i,o)}),e1=(r,t,e)=>()=>{const n=r.viewport.viewportToImageRectangle(r.viewport.getBounds(!0)),i=r.viewport.getContainerSize().x,a=r.viewport.getZoom(!0)*i/r.world.getContentFactor(),s=Math.PI*r.viewport.getRotation()/180,u=-n.x*a,h=-n.y*a;let f,l;s>0&&s<=Math.PI/2?(f=n.height*a,l=0):s>Math.PI/2&&s<=Math.PI?(f=n.width*a,l=n.height*a):s>Math.PI&&s<=Math.PI*1.5?(f=0,l=n.width*a):(f=0,l=0),t.position.x=f+u*Math.cos(s)-h*Math.sin(s),t.position.y=l+u*Math.sin(s)+h*Math.cos(s),t.scale.set(a,a),t.rotation=s,e.render(t)},r1=(r,t)=>{const e=new zr,n=zh({width:t.width,height:t.height,backgroundAlpha:0,view:t,antialias:!0}),i=new Map;let o;const a=l=>{const{selector:c}=l.target,d=typeof o=="function"?o(l):o;let p;c.type===Wt.RECTANGLE?p=t1(c,d):c.type===Wt.POLYGON?p=Qx(c,d):c.type===Wt.ELLIPSE?p=Jx(c,d):console.warn(`Unsupported shape type: ${c.type}`),p&&(e.addChild(p),i.set(l.id,{g:p,annotation:l}))},s=l=>{const c=i.get(l.id);c&&(i.delete(l.id),c.g.destroy())},u=(l,c)=>{const d=i.get(l.id);d&&(i.delete(l.id),d.g.destroy(),a(c))},h=(l,c)=>{n.resize(l,c),n.render(e)},f=l=>{if(typeof l=="function")i.forEach(({g:c,annotation:d},p)=>{const v=l(d);v?c.tint=v.fill?mn(v.fill):Xi:c.tint=Xi});else{const c=l!=null&&l.fill?mn(l.fill):Xi;i.forEach(({g:d},p)=>d.tint=c)}o=l,n.render(e)};return{addAnnotation:a,redraw:e1(r,e,n),removeAnnotation:s,resize:h,setStyle:f,updateAnnotation:u}},VE="";function n1(r,t,e){let n,{state:i}=t,{viewer:o}=t,{style:a=void 0}=t;const{store:s,hover:u,viewport:h}=i;ys(r,u,m=>e(7,n=m));const f=mr();let l,c=!1;const d=m=>{const y=new Fe.Point(m.x,m.y),{x:b,y:x}=o.viewport.pointFromPixel(y);return o.viewport.viewportToImageCoordinates(b,x)},p=m=>y=>{const{x:b,y:x}=d(new Fe.Point(y.offsetX,y.offsetY)),A=s.getAt(b,x);A?(m.classList.add("hover"),n!==A.id&&u.set(A.id)):(m.classList.remove("hover"),n&&u.set(null))},v=m=>{const y=m.originalEvent;if(!c){const{x:b,y:x}=d(m.position),A=s.getAt(b,x);A?f("click",{originalEvent:y,annotation:A}):f("click",{originalEvent:y})}c=!1},_=()=>c=!0;let g;return gr(()=>{const{offsetWidth:m,offsetHeight:y}=o.canvas,b=document.createElement("canvas");b.width=m,b.height=y,b.className="a9s-gl-canvas",o.element.querySelector(".openseadragon-canvas").appendChild(b),e(4,l=r1(o,b));const x=p(b);b.addEventListener("pointermove",x),new ResizeObserver(T=>{const{width:w,height:E}=T[0].contentRect;b.width=w,b.height=E,l.resize(w,E)}).observe(b);const P=()=>{const T=o.viewport.getBounds();g=o.viewport.viewportToImageRectangle(T);const{x:w,y:E,width:R,height:O}=g,C=s.getIntersecting(w,E,R,O);h.set(C.map(k=>k.id))};return o.addHandler("canvas-drag",_),o.addHandler("canvas-release",v),o.addHandler("update-viewport",l.redraw),o.addHandler("animation-finish",P),()=>{b.removeEventListener("pointermove",x),o.removeHandler("canvas-drag",_),o.removeHandler("canvas-release",v),o.removeHandler("update-viewport",l.redraw),o.removeHandler("animation-finish",P),b.parentNode.removeChild(b)}}),s.observe(m=>{const{created:y,updated:b,deleted:x}=m.changes;if(y.forEach(A=>l.addAnnotation(A)),b.forEach(({oldValue:A,newValue:P})=>l.updateAnnotation(A,P)),x.forEach(A=>l.removeAnnotation(A)),g){const{x:A,y:P,width:T,height:w}=g,E=s.getIntersecting(A,P,T,w);h.set(E.map(R=>R.id))}else h.set(s.all().map(A=>A.id));l.redraw()}),r.$$set=m=>{"state"in m&&e(1,i=m.state),"viewer"in m&&e(2,o=m.viewer),"style"in m&&e(3,a=m.style)},r.$$.update=()=>{r.$$.dirty&24&&(l==null||l.setStyle(a))},[u,i,o,a,l]}class i1 extends Zt{constructor(t){super(),Kt(this,t,n1,null,Lt,{state:1,viewer:2,style:3})}}const o1=r=>({transform:r&2,scale:r&1}),Nl=r=>({transform:r[1],scale:r[0]});function a1(r){let t;const e=r[4].default,n=bs(e,r,r[3],Nl);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),t=!0},p(i,[o]){n&&n.p&&(!t||o&11)&&Ts(n,e,i,i[3],t?Es(e,i[3],o,o1):ws(i[3]),Nl)},i(i){t||(lt(n,i),t=!0)},o(i){_t(n,i),t=!1},d(i){n&&n.d(i)}}}function s1(r,t,e){let{$$slots:n={},$$scope:i}=t,{viewer:o}=t,a=1,s;const u=()=>{const h=o.viewport.getContainerSize().x,f=o.viewport.getZoom(!0),l=o.viewport.getFlip(),c=o.viewport.pixelFromPoint(new Fe.Point(0,0),!0);l&&(c.x=h-c.x);const d=f*h/o.world.getContentFactor(),p=l?-d:d,v=o.viewport.getRotation();e(1,s=`translate(${c.x}, ${c.y}) scale(${p}, ${d}) rotate(${v})`),e(0,a=f*h/o.world.getContentFactor())};return gr(()=>(o.addHandler("update-viewport",u),()=>{o.removeHandler("update-viewport",u)})),r.$$set=h=>{"viewer"in h&&e(2,o=h.viewer),"$$scope"in h&&e(3,i=h.$$scope)},[a,s,o,i,n]}class Ll extends Zt{constructor(t){super(),Kt(this,t,s1,a1,Lt,{viewer:2})}}function u1(r,t,e){const n=mr();let{drawingMode:i}=t,{target:o}=t,{tool:a}=t,{transform:s}=t,{viewer:u}=t,{viewportScale:h}=t,f;return gr(()=>{const l=o.closest("svg"),c=[],d=(p,v,_)=>{if(p==="pointerup"||p==="dblclick"){const g=y=>{const{originalEvent:b}=y;v(b)},m=p==="pointerup"?"canvas-click":"canvas-double-click";u.addHandler(m,g),c.push(()=>u.removeHandler(m,g))}else l.addEventListener(p,v,_),c.push(()=>l.removeEventListener(p,v,_))};return e(6,f=new a({target:o,props:{addEventListener:d,drawingMode:i,transform:s,viewportScale:h}})),f.$on("create",p=>n("create",p.detail)),()=>{c.forEach(p=>p()),f.$destroy()}}),r.$$set=l=>{"drawingMode"in l&&e(0,i=l.drawingMode),"target"in l&&e(1,o=l.target),"tool"in l&&e(2,a=l.tool),"transform"in l&&e(3,s=l.transform),"viewer"in l&&e(4,u=l.viewer),"viewportScale"in l&&e(5,h=l.viewportScale)},r.$$.update=()=>{r.$$.dirty&72&&f&&f.$set({transform:s}),r.$$.dirty&96&&f&&f.$set({viewportScale:h})},[i,o,a,s,u,h,f]}class h1 extends Zt{constructor(t){super(),Kt(this,t,u1,null,Lt,{drawingMode:0,target:1,tool:2,transform:3,viewer:4,viewportScale:5})}}const zE="";function Ul(r,t,e){const n=r.slice();return n[23]=t[e],n}function l1(r){let t=r[1],e,n,i=Gl(r);return{c(){i.c(),e=Ne()},m(o,a){i.m(o,a),Z(o,e,a),n=!0},p(o,a){a&2&&Lt(t,t=o[1])?(Le(),_t(i,1,1,Vt),Ue(),i=Gl(o),i.c(),lt(i,1),i.m(e.parentNode,e)):i.p(o,a)},i(o){n||(lt(i),n=!0)},o(o){_t(i),n=!1},d(o){o&&$(e),i.d(o)}}}function f1(r){let t,e,n=r[5],i=[];for(let a=0;a<n.length;a+=1)i[a]=Hl(Ul(r,n,a));const o=a=>_t(i[a],1,1,()=>{i[a]=null});return{c(){for(let a=0;a<i.length;a+=1)i[a].c();t=Ne()},m(a,s){for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(a,s);Z(a,t,s),e=!0},p(a,s){if(s&4196272){n=a[5];let u;for(u=0;u<n.length;u+=1){const h=Ul(a,n,u);i[u]?(i[u].p(h,s),lt(i[u],1)):(i[u]=Hl(h),i[u].c(),lt(i[u],1),i[u].m(t.parentNode,t))}for(Le(),u=n.length;u<i.length;u+=1)o(u);Ue()}},i(a){if(!e){for(let s=0;s<n.length;s+=1)lt(i[s]);e=!0}},o(a){i=i.filter(Boolean);for(let s=0;s<i.length;s+=1)_t(i[s]);e=!1},d(a){Wi(i,a),a&&$(t)}}}function Gl(r){let t,e;return t=new h1({props:{target:r[4],tool:r[1],drawingMode:r[3],transform:{elementToImage:r[7]},viewer:r[2],viewportScale:r[22]}}),t.$on("create",r[11]),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,i){const o={};i&16&&(o.target=n[4]),i&2&&(o.tool=n[1]),i&8&&(o.drawingMode=n[3]),i&4&&(o.viewer=n[2]),i&4194304&&(o.viewportScale=n[22]),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function kl(r){let t,e;return t=new xc({props:{target:r[4],editor:Ns(r[23].target.selector),annotation:r[23],transform:{elementToImage:r[7]},viewportScale:r[22]}}),t.$on("grab",r[8]),t.$on("change",function(){Xt(r[10](r[23]))&&r[10](r[23]).apply(this,arguments)}),t.$on("release",r[9]),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,i){r=n;const o={};i&16&&(o.target=r[4]),i&32&&(o.editor=Ns(r[23].target.selector)),i&32&&(o.annotation=r[23]),i&4194304&&(o.viewportScale=r[22]),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Hl(r){let t=r[23].id,e,n,i=kl(r);return{c(){i.c(),e=Ne()},m(o,a){i.m(o,a),Z(o,e,a),n=!0},p(o,a){a&32&&Lt(t,t=o[23].id)?(Le(),_t(i,1,1,Vt),Ue(),i=kl(o),i.c(),lt(i,1),i.m(e.parentNode,e)):i.p(o,a)},i(o){n||(lt(i),n=!0)},o(o){_t(i),n=!1},d(o){o&&$(e),i.d(o)}}}function c1(r){let t,e,n,i,o,a;const s=[f1,l1],u=[];function h(f,l){return f[4]&&f[5]?0:f[4]&&f[1]&&f[0]?1:-1}return~(n=h(r))&&(i=u[n]=s[n](r)),{c(){t=ft("svg"),e=ft("g"),i&&i.c(),S(e,"transform",o=r[21]),S(e,"class","svelte-190cqdf"),S(t,"class","a9s-annotationlayer a9s-osd-drawinglayer svelte-190cqdf"),Ss(t,"drawing",r[0])},m(f,l){Z(f,t,l),$e(t,e),~n&&u[n].m(e,null),r[17](e),a=!0},p(f,l){let c=n;n=h(f),n===c?~n&&u[n].p(f,l):(i&&(Le(),_t(u[c],1,1,()=>{u[c]=null}),Ue()),~n?(i=u[n],i?i.p(f,l):(i=u[n]=s[n](f),i.c()),lt(i,1),i.m(e,null)):i=null),(!a||l&2097152&&o!==(o=f[21]))&&S(e,"transform",o),(!a||l&1)&&Ss(t,"drawing",f[0])},i(f){a||(lt(i),a=!0)},o(f){_t(i),a=!1},d(f){f&&$(t),~n&&u[n].d(),r[17](null)}}}function d1(r){let t,e;return t=new Ll({props:{viewer:r[2],$$slots:{default:[c1,({transform:n,scale:i})=>({21:n,22:i}),({transform:n,scale:i})=>(n?2097152:0)|(i?4194304:0)]},$$scope:{ctx:r}}}),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,[i]){const o={};i&4&&(o.viewer=n[2]),i&73400383&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function p1(r,t,e){let n,i,{drawingEnabled:o}=t,{preferredDrawingMode:a}=t,{state:s}=t,{tool:u,opts:h}=js("rectangle"),{tool:f=u,opts:l=h}=t,{user:c}=t,{viewer:d}=t,p;const{store:v,selection:_}=s;ys(r,_,E=>e(16,i=E));let g=null,m=null;const y=E=>{v.unobserve(g);const R=E.filter(({editable:O})=>O).map(({id:O})=>O);R.length>0?(e(5,m=R.map(O=>v.getAnnotation(O))),g=O=>{const{updated:C}=O.changes;e(5,m=C.map(k=>k.newValue))},v.observe(g,{annotations:R})):e(5,m=null)},b=(E,R)=>{const{x:O,y:C}=d.viewport.viewerElementToImageCoordinates(new Fe.Point(E,R));return[O,C]},x=()=>d.setMouseNavEnabled(!1),A=()=>d.setMouseNavEnabled(!0),P=E=>R=>{var B;const{target:O}=E,C=10*60*1e3,k=((B=O.creator)==null?void 0:B.id)!==c.id||!O.created||new Date().getTime()-O.created.getTime()>C;v.updateTarget({...O,selector:R.detail,created:k?O.created:new Date,updated:k?new Date:null,updatedBy:k?c:null})},T=E=>{const R=Rs(),O={id:R,bodies:[],target:{annotation:R,selector:E.detail,creator:c,created:new Date}};v.addAnnotation(O),_.setSelected(O.id),d.setMouseNavEnabled(!0)};function w(E){xr[E?"unshift":"push"](()=>{p=E,e(4,p)})}return r.$$set=E=>{"drawingEnabled"in E&&e(0,o=E.drawingEnabled),"preferredDrawingMode"in E&&e(12,a=E.preferredDrawingMode),"state"in E&&e(13,s=E.state),"tool"in E&&e(1,f=E.tool),"opts"in E&&e(14,l=E.opts),"user"in E&&e(15,c=E.user),"viewer"in E&&e(2,d=E.viewer)},r.$$.update=()=>{r.$$.dirty&20480&&e(3,n=(l==null?void 0:l.drawingMode)||a),r.$$.dirty&13&&(o&&n==="drag"?d.setMouseNavEnabled(!1):d.setMouseNavEnabled(!0)),r.$$.dirty&1&&o&&_.clear(),r.$$.dirty&65549&&i.selected.length===0&&n==="drag"&&o&&d.setMouseNavEnabled(!1),r.$$.dirty&65536&&y(i.selected)},[o,f,d,n,p,m,_,b,x,A,P,T,a,s,l,c,i,w]}class v1 extends Zt{constructor(t){super(),Kt(this,t,p1,d1,Lt,{drawingEnabled:0,preferredDrawingMode:12,state:13,tool:1,opts:14,user:15,viewer:2})}}const WE="";function _1(r){let t,e,n,i,o,a,s,u=r[2].appearance.label+"",h,f,l,c;return{c(){t=ft("g"),e=ft("rect"),s=ft("text"),h=qi(u),S(e,"class","a9s-presence-label-bg svelte-1rehw2p"),S(e,"x",r[0]),S(e,"y",n=r[1]-18/r[3]),S(e,"height",i=18/r[3]),S(e,"fill",o=r[2].appearance.color),S(e,"stroke",a=r[2].appearance.color),S(s,"font-size",f=12/r[3]),S(s,"x",l=r[0]+Math.round(5/r[3])),S(s,"y",c=r[1]-5/r[3]),S(s,"class","svelte-1rehw2p"),S(t,"class","a9s-presence-label")},m(d,p){Z(d,t,p),$e(t,e),$e(t,s),$e(s,h),r[6](t)},p(d,[p]){p&1&&S(e,"x",d[0]),p&10&&n!==(n=d[1]-18/d[3])&&S(e,"y",n),p&8&&i!==(i=18/d[3])&&S(e,"height",i),p&4&&o!==(o=d[2].appearance.color)&&S(e,"fill",o),p&4&&a!==(a=d[2].appearance.color)&&S(e,"stroke",a),p&4&&u!==(u=d[2].appearance.label+"")&&Tf(h,u),p&8&&f!==(f=12/d[3])&&S(s,"font-size",f),p&9&&l!==(l=d[0]+Math.round(5/d[3]))&&S(s,"x",l),p&10&&c!==(c=d[1]-5/d[3])&&S(s,"y",c)},i:Vt,o:Vt,d(d){d&&$(t),r[6](null)}}}function g1(r,t,e){let{x:n}=t,{y:i}=t,{user:o}=t,{scale:a}=t,{hAlign:s=null}=t,u;const h=l=>{const c=u.querySelector("text"),d=u.querySelector("rect"),p=c.getBBox().width+10/l;s==="CENTER"&&u.setAttribute("style",`transform: translateX(-${p/2}px)`),d.setAttribute("width",`${p}`)};function f(l){xr[l?"unshift":"push"](()=>{u=l,e(4,u)})}return r.$$set=l=>{"x"in l&&e(0,n=l.x),"y"in l&&e(1,i=l.y),"user"in l&&e(2,o=l.user),"scale"in l&&e(3,a=l.scale),"hAlign"in l&&e(5,s=l.hAlign)},r.$$.update=()=>{r.$$.dirty&24&&u&&h(a)},[n,i,o,a,u,s,f]}class Xl extends Zt{constructor(t){super(),Kt(this,t,g1,_1,Lt,{x:0,y:1,user:2,scale:3,hAlign:5})}}const qE="";function m1(r){let t,e,n,i,o,a;return e=new Xl({props:{scale:r[1],user:r[0],x:r[3][0],y:r[3][1],hAlign:"CENTER"}}),{c(){t=ft("g"),ve(e.$$.fragment),n=ft("polygon"),S(n,"class","a9s-presence-shape a9s-presence-polygon svelte-fgq4n0"),S(n,"stroke",i=r[0].appearance.color),S(n,"fill","transparent"),S(n,"points",o=r[2].points.map(jl).join(" ")),S(t,"class","a9s-presence-overlay")},m(s,u){Z(s,t,u),ne(e,t,null),$e(t,n),a=!0},p(s,[u]){const h={};u&2&&(h.scale=s[1]),u&1&&(h.user=s[0]),u&8&&(h.x=s[3][0]),u&8&&(h.y=s[3][1]),e.$set(h),(!a||u&1&&i!==(i=s[0].appearance.color))&&S(n,"stroke",i),(!a||u&4&&o!==(o=s[2].points.map(jl).join(" ")))&&S(n,"points",o)},i(s){a||(lt(e.$$.fragment,s),a=!0)},o(s){_t(e.$$.fragment,s),a=!1},d(s){s&&$(t),ie(e)}}}const jl=r=>r.join(",");function y1(r,t,e){let n,i,{annotation:o}=t,{user:a}=t,{scale:s}=t;const u=h=>{let[f,...l]=h.points;return l.forEach(([c,d])=>{d<f[1]&&(f=[c,d])}),f};return r.$$set=h=>{"annotation"in h&&e(4,o=h.annotation),"user"in h&&e(0,a=h.user),"scale"in h&&e(1,s=h.scale)},r.$$.update=()=>{r.$$.dirty&16&&e(2,n=o.target.selector.geometry),r.$$.dirty&4&&e(3,i=u(n))},[a,s,n,i,o]}class b1 extends Zt{constructor(t){super(),Kt(this,t,y1,m1,Lt,{annotation:4,user:0,scale:1})}}const $E="";function x1(r){let t,e,n,i,o,a,s,u,h;return e=new Xl({props:{scale:r[1],user:r[0],x:r[2].x,y:r[2].y}}),{c(){t=ft("g"),ve(e.$$.fragment),n=ft("rect"),S(n,"class","a9s-presence-shape a9s-presence-rectangle svelte-gze948"),S(n,"stroke",i=r[0].appearance.color),S(n,"fill","transparent"),S(n,"x",o=r[2].x),S(n,"y",a=r[2].y),S(n,"width",s=r[2].w),S(n,"height",u=r[2].h),S(t,"class","a9s-presence-overlay")},m(f,l){Z(f,t,l),ne(e,t,null),$e(t,n),h=!0},p(f,[l]){const c={};l&2&&(c.scale=f[1]),l&1&&(c.user=f[0]),l&4&&(c.x=f[2].x),l&4&&(c.y=f[2].y),e.$set(c),(!h||l&1&&i!==(i=f[0].appearance.color))&&S(n,"stroke",i),(!h||l&4&&o!==(o=f[2].x))&&S(n,"x",o),(!h||l&4&&a!==(a=f[2].y))&&S(n,"y",a),(!h||l&4&&s!==(s=f[2].w))&&S(n,"width",s),(!h||l&4&&u!==(u=f[2].h))&&S(n,"height",u)},i(f){h||(lt(e.$$.fragment,f),h=!0)},o(f){_t(e.$$.fragment,f),h=!1},d(f){f&&$(t),ie(e)}}}function E1(r,t,e){let n,{annotation:i}=t,{user:o}=t,{scale:a}=t;return r.$$set=s=>{"annotation"in s&&e(3,i=s.annotation),"user"in s&&e(0,o=s.user),"scale"in s&&e(1,a=s.scale)},r.$$.update=()=>{r.$$.dirty&8&&e(2,n=i.target.selector.geometry)},[o,a,n,i]}class T1 extends Zt{constructor(t){super(),Kt(this,t,E1,x1,Lt,{annotation:3,user:0,scale:1})}}const KE="",{Boolean:w1}=xf;function Yl(r,t,e){const n=r.slice();return n[8]=t[e],n}function Vl(r){let t,e;return t=new Ll({props:{viewer:r[0],$$slots:{default:[P1,({transform:n,scale:i})=>({6:n,7:i}),({transform:n,scale:i})=>(n?64:0)|(i?128:0)]},$$scope:{ctx:r}}}),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,i){const o={};i&1&&(o.viewer=n[0]),i&2244&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function zl(r){let t,e,n=r[2],i=[];for(let a=0;a<n.length;a+=1)i[a]=Wl(Yl(r,n,a));const o=a=>_t(i[a],1,1,()=>{i[a]=null});return{c(){for(let a=0;a<i.length;a+=1)i[a].c();t=Ne()},m(a,s){for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(a,s);Z(a,t,s),e=!0},p(a,s){if(s&132){n=a[2];let u;for(u=0;u<n.length;u+=1){const h=Yl(a,n,u);i[u]?(i[u].p(h,s),lt(i[u],1)):(i[u]=Wl(h),i[u].c(),lt(i[u],1),i[u].m(t.parentNode,t))}for(Le(),u=n.length;u<i.length;u+=1)o(u);Ue()}},i(a){if(!e){for(let s=0;s<n.length;s+=1)lt(i[s]);e=!0}},o(a){i=i.filter(w1);for(let s=0;s<i.length;s+=1)_t(i[s]);e=!1},d(a){Wi(i,a),a&&$(t)}}}function S1(r){let t,e;return t=new b1({props:{annotation:r[8].annotation,user:r[8].selectedBy,scale:r[7]}}),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,i){const o={};i&4&&(o.annotation=n[8].annotation),i&4&&(o.user=n[8].selectedBy),i&128&&(o.scale=n[7]),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function A1(r){let t,e;return t=new T1({props:{annotation:r[8].annotation,user:r[8].selectedBy,scale:r[7]}}),{c(){ve(t.$$.fragment)},m(n,i){ne(t,n,i),e=!0},p(n,i){const o={};i&4&&(o.annotation=n[8].annotation),i&4&&(o.user=n[8].selectedBy),i&128&&(o.scale=n[7]),t.$set(o)},i(n){e||(lt(t.$$.fragment,n),e=!0)},o(n){_t(t.$$.fragment,n),e=!1},d(n){ie(t,n)}}}function Wl(r){let t,e,n,i;const o=[A1,S1],a=[];function s(u,h){return u[8].annotation.target.selector.type===Wt.RECTANGLE?0:u[8].annotation.target.selector.type===Wt.POLYGON?1:-1}return~(t=s(r))&&(e=a[t]=o[t](r)),{c(){e&&e.c(),n=Ne()},m(u,h){~t&&a[t].m(u,h),Z(u,n,h),i=!0},p(u,h){let f=t;t=s(u),t===f?~t&&a[t].p(u,h):(e&&(Le(),_t(a[f],1,1,()=>{a[f]=null}),Ue()),~t?(e=a[t],e?e.p(u,h):(e=a[t]=o[t](u),e.c()),lt(e,1),e.m(n.parentNode,n)):e=null)},i(u){i||(lt(e),i=!0)},o(u){_t(e),i=!1},d(u){~t&&a[t].d(u),u&&$(n)}}}function P1(r){let t,e,n,i,o=r[2].length>0&&zl(r);return{c(){t=ft("svg"),e=ft("g"),o&&o.c(),S(e,"transform",n=r[6]),S(t,"class","a9s-osd-presencelayer svelte-1krwc4m")},m(a,s){Z(a,t,s),$e(t,e),o&&o.m(e,null),i=!0},p(a,s){a[2].length>0?o?(o.p(a,s),s&4&&lt(o,1)):(o=zl(a),o.c(),lt(o,1),o.m(e,null)):o&&(Le(),_t(o,1,1,()=>{o=null}),Ue()),(!i||s&64&&n!==(n=a[6]))&&S(e,"transform",n)},i(a){i||(lt(o),i=!0)},o(a){_t(o),i=!1},d(a){a&&$(t),o&&o.d()}}}function O1(r){let t=!!r[1],e,n,i=t&&Vl(r);return{c(){i&&i.c(),e=Ne()},m(o,a){i&&i.m(o,a),Z(o,e,a),n=!0},p(o,[a]){a&2&&(t=!!o[1]),t?i?(i.p(o,a),a&2&&lt(i,1)):(i=Vl(o),i.c(),lt(i,1),i.m(e.parentNode,e)):i&&(Le(),_t(i,1,1,()=>{i=null}),Ue())},i(o){n||(lt(i),n=!0)},o(o){_t(i),n=!1},d(o){i&&i.d(o),o&&$(e)}}}function R1(r,t,e){let{store:n}=t,{viewer:i}=t,{provider:o=null}=t,a=[],s=null;const u=(h,f)=>{e(2,a=[...a.filter(({selectedBy:l})=>l.presenceKey!==h.presenceKey),...(f||[]).map(l=>({annotation:n.getAnnotation(l),selectedBy:h}))].filter(({annotation:l})=>(l||console.warn("Selection event on unknown annotation"),!!l))),s&&n.unobserve(s),s=l=>{const{deleted:c,updated:d}=l.changes,p=new Set(c.map(_=>_.id)),v=a.filter(({annotation:_})=>!p.has(_.id)).map(_=>{const g=d.find(m=>m.oldValue.id===_.annotation.id);return g?{selectedBy:_.selectedBy,annotation:g.newValue}:_});e(2,a=v)},n.observe(s,{annotations:a.map(l=>l.annotation.id)})};return Sf(()=>{s&&n.unobserve(s)}),r.$$set=h=>{"store"in h&&e(3,n=h.store),"viewer"in h&&e(0,i=h.viewer),"provider"in h&&e(1,o=h.provider)},r.$$.update=()=>{r.$$.dirty&2&&o&&o.on("selectionChange",u)},[i,o,a,n]}class I1 extends Zt{constructor(t){super(),Kt(this,t,R1,O1,Lt,{store:3,viewer:0,provider:1})}}const C1=(r,t,e)=>{const n=()=>{const{selected:i}=t;if(i){const o=i.filter(a=>a.editable);o.length>0&&e.bulkDeleteAnnotation(o.map(a=>a.id))}};r.addEventListener("keydown",i=>{i.key==="Delete"&&n()})},M1=r=>{r.addHandler("open",t=>{const e=r.world.getItemCount();r.world.getItemAt(e-1).addOnceHandler("fully-loaded-change",i=>{const{fullyLoaded:o}=i;if(o){const a=r.canvas.querySelector("canvas");Xc(a,r.element)}})})},ql=(r,t,e)=>(n,i={})=>{const o=typeof n=="string"?n:n.id,a=t.getAnnotation(o);if(!a)return;const s=r.container.getBoundingClientRect(),{padding:u}=i;let[h,f,l,c]=u?Array.isArray(u)?u:[u,u,u,u]:[0,0,0,0];h=h/s.height,f=f/s.width,l=l/s.height,c=c/s.width;const{minX:d,minY:p,maxX:v,maxY:_}=a.target.selector.geometry.bounds,g=v-d,m=_-p,y=d-c*g,b=p-h*m,x=g+(f+c)*g,A=m+(h+l)*m,P=r.viewport.imageToViewportRectangle(y,b,x,A);r.viewport[e](P,i.immediately)},D1=(r,t)=>ql(r,t,"fitBounds"),F1=(r,t)=>ql(r,t,"fitBoundsWithConstraints"),ZE="",B1=(r,t={})=>{const e=jc(t),n=kc(e),{hover:i,selection:o,store:a}=n,s=Wf(a,o,i,void 0,e.adapter,e.autoSave);let u=e.style,h=tc(),f=e.drawingEnabled,l=e.drawingMode;C1(r.element,o,a);const c=new i1({target:r.element,props:{state:n,viewer:r,style:u}}),d=new I1({target:r.element.querySelector(".openseadragon-canvas"),props:{store:a,viewer:r,provider:null}}),p=new v1({target:r.element.querySelector(".openseadragon-canvas"),props:{drawingEnabled:f,preferredDrawingMode:l,state:n,user:h,viewer:r}});c.$on("click",O=>{const{originalEvent:C,annotation:k}=O.detail;k&&!(l==="click"&&f)?o.clickSelect(k.id,C):o.isEmpty()||o.clear()}),r.element.addEventListener("pointerdown",O=>{if(i.current){const C=a.getAnnotation(i.current);s.emit("clickAnnotation",C,O)}}),M1(r);const v=$f(a,e.adapter),_=O=>{u=O,c.$set({style:O})},g=()=>{c.$destroy(),d.$destroy(),p.$destroy()},m=D1(r,a),y=F1(r,a),b=()=>h,x=(O,C,k)=>Ic(O,C,k),A=(O,C)=>vc(O,C),P=O=>{const C=js(O);if(!C)throw`Tool not found: ${O}`;const{tool:k,opts:B}=C;l=(B==null?void 0:B.drawingMode)||l,p.$set({tool:k,opts:B})},T=O=>{f=O,p.$set({drawingEnabled:f})},w=O=>{O?o.setSelected(O):o.clear()},E=O=>d.$set({provider:O}),R=O=>{h=O,p.$set({user:O})};return{...v,get style(){return u},set style(O){_(O)},destroy:g,fitBounds:m,fitBoundsWithConstraints:y,getUser:b,listDrawingTools:Rc,on:s.on,off:s.off,registerDrawingTool:x,registerShapeEditor:A,setDrawingEnabled:T,setDrawingTool:P,setPresenceProvider:E,setSelected:w,setUser:R,state:n,viewer:r}};function os(){}function N1(r,t){for(const e in t)r[e]=t[e];return r}function $l(r){return r()}function Kl(){return Object.create(null)}function _r(r){r.forEach($l)}function qt(r){return typeof r=="function"}function as(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function L1(r){return Object.keys(r).length===0}function U1(r,t,e,n){if(r){const i=Zl(r,t,e,n);return r[0](i)}}function Zl(r,t,e,n){return r[1]&&n?N1(e.ctx.slice(),r[1](n(t))):e.ctx}function G1(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],a=Math.max(t.dirty.length,i.length);for(let s=0;s<a;s+=1)o[s]=t.dirty[s]|i[s];return o}return t.dirty|i}return t.dirty}function k1(r,t,e,n,i,o){if(i){const a=Zl(t,e,n,o);r.p(a,i)}}function H1(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function xt(r,t,e){r.insertBefore(t,e||null)}function yt(r){r.parentNode&&r.parentNode.removeChild(r)}function X1(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function Jt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Jl(r){return document.createTextNode(r)}function pe(){return Jl(" ")}function j1(){return Jl("")}function $t(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function M(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Y1(r){return Array.from(r.childNodes)}function V1(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Nn;function Ln(r){Nn=r}function z1(){if(!Nn)throw new Error("Function called outside component initialization");return Nn}function W1(){const r=z1();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=V1(t,e,{cancelable:n});return i.slice().forEach(a=>{a.call(r,o)}),!o.defaultPrevented}return!0}}function $r(r,t){const e=r.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const Kr=[],Ql=[];let Zr=[];const tf=[],q1=Promise.resolve();let ss=!1;function $1(){ss||(ss=!0,q1.then(ef))}function us(r){Zr.push(r)}const hs=new Set;let Jr=0;function ef(){if(Jr!==0)return;const r=Nn;do{try{for(;Jr<Kr.length;){const t=Kr[Jr];Jr++,Ln(t),K1(t.$$)}}catch(t){throw Kr.length=0,Jr=0,t}for(Ln(null),Kr.length=0,Jr=0;Ql.length;)Ql.pop()();for(let t=0;t<Zr.length;t+=1){const e=Zr[t];hs.has(e)||(hs.add(e),e())}Zr.length=0}while(Kr.length);for(;tf.length;)tf.pop()();ss=!1,hs.clear(),Ln(r)}function K1(r){if(r.fragment!==null){r.update(),_r(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(us)}}function Z1(r){const t=[],e=[];Zr.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Zr=t}const ji=new Set;let J1;function Yi(r,t){r&&r.i&&(ji.delete(r),r.i(t))}function ls(r,t,e,n){if(r&&r.o){if(ji.has(r))return;ji.add(r),J1.c.push(()=>{ji.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function rf(r){r&&r.c()}function fs(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||us(()=>{const a=r.$$.on_mount.map($l).filter(qt);r.$$.on_destroy?r.$$.on_destroy.push(...a):_r(a),r.$$.on_mount=[]}),o.forEach(us)}function cs(r,t){const e=r.$$;e.fragment!==null&&(Z1(e.after_update),_r(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Q1(r,t){r.$$.dirty[0]===-1&&(Kr.push(r),$1(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function ds(r,t,e,n,i,o,a,s=[-1]){const u=Nn;Ln(r);const h=r.$$={fragment:null,ctx:[],props:o,update:os,not_equal:i,bound:Kl(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Kl(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(h.root);let f=!1;if(h.ctx=e?e(r,t.props||{},(l,c,...d)=>{const p=d.length?d[0]:c;return h.ctx&&i(h.ctx[l],h.ctx[l]=p)&&(!h.skip_bound&&h.bound[l]&&h.bound[l](p),f&&Q1(r,l)),c}):[],h.update(),f=!0,_r(h.before_update),h.fragment=n?n(h.ctx):!1,t.target){if(t.hydrate){const l=Y1(t.target);h.fragment&&h.fragment.l(l),l.forEach(yt)}else h.fragment&&h.fragment.c();t.intro&&Yi(r.$$.fragment),fs(r,t.target,t.anchor,t.customElement),ef()}Ln(u)}class ps{$destroy(){cs(this,1),this.$destroy=os}$on(t,e){if(!qt(e))return os;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!L1(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var te=(r=>(r.ELLIPSE="ELLIPSE",r.POLYGON="POLYGON",r.RECTANGLE="RECTANGLE",r))(te||{});const vs=(r,t)=>t,nf=r=>{let t=1/0,e=1/0,n=-1/0,i=-1/0;return r.forEach(([o,a])=>{t=Math.min(t,o),e=Math.min(e,a),n=Math.max(n,o),i=Math.max(i,a)}),{minX:t,minY:e,maxX:n,maxY:i}},tE={area:r=>Math.PI*r.geometry.rx*r.geometry.ry,intersects:(r,t,e)=>{const{cx:n,cy:i,rx:o,ry:a}=r.geometry,s=0,u=Math.cos(s),h=Math.sin(s),f=t-n,l=e-i,c=u*f+h*l,d=h*f-u*l;return c*c/(o*o)+d*d/(a*a)<=1}};vs(te.ELLIPSE,tE);const eE={area:r=>{const{points:t}=r.geometry;let e=0,n=t.length-1;for(let i=0;i<t.length;i++)e+=(t[n][0]+t[i][0])*(t[n][1]-t[i][1]),n=i;return Math.abs(.5*e)},intersects:(r,t,e)=>{const{points:n}=r.geometry;let i=!1;for(let o=0,a=n.length-1;o<n.length;a=o++){const s=n[o][0],u=n[o][1],h=n[a][0],f=n[a][1];u>e!=f>e&&t<(h-s)*(e-u)/(f-u)+s&&(i=!i)}return i}};vs(te.POLYGON,eE);const rE={area:r=>r.geometry.w*r.geometry.h,intersects:(r,t,e)=>t>=r.geometry.x&&t<=r.geometry.x+r.geometry.w&&e>=r.geometry.y&&e<=r.geometry.y+r.geometry.h};vs(te.RECTANGLE,rE);const nE=(r,t=!1)=>{const e=typeof r=="string"?r:r.value,n=/^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g,i=[...e.matchAll(n)][0],[o,a,s,u,h,f,l]=i;if(a!=="xywh")throw new Error("Unsupported MediaFragment: "+e);if(s&&s!=="pixel")throw new Error(`Unsupported MediaFragment unit: ${s}`);const[c,d,p,v]=[u,h,f,l].map(parseFloat);return{type:te.RECTANGLE,geometry:{x:c,y:d,w:p,h:v,bounds:{minX:c,minY:t?d-v:d,maxX:c+p,maxY:t?d:d+v}}}},iE=r=>{const{x:t,y:e,w:n,h:i}=r;return{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${t},${e},${n},${i}`}},of="http://www.w3.org/2000/svg",af=r=>{const t=n=>{Array.from(n.attributes).forEach(i=>{i.name.startsWith("on")&&n.removeAttribute(i.name)})},e=r.getElementsByTagName("script");return Array.from(e).reverse().forEach(n=>n.parentNode.removeChild(n)),Array.from(r.querySelectorAll("*")).forEach(t),r},oE=r=>{const t=new XMLSerializer().serializeToString(r.documentElement).replace("<svg>",`<svg xmlns="${of}">`);return new DOMParser().parseFromString(t,"image/svg+xml").documentElement},aE=r=>{const t=new DOMParser().parseFromString(r,"image/svg+xml"),e=t.lookupPrefix(of),n=t.lookupNamespaceURI(null);return e||n?af(t).firstChild:af(oE(t)).firstChild},sE=r=>{const[t,e,n]=r.match(/(<polygon points=["|'])([^("|')]*)/)||[];if(!n)return;const i=n.split(" ").map(o=>o.split(",").map(parseFloat));return{type:te.POLYGON,geometry:{points:i,bounds:nf(i)}}},uE=r=>{const t=aE(r),e=parseFloat(t.getAttribute("cx")),n=parseFloat(t.getAttribute("cy")),i=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a={minX:e-i,minY:n-o,maxX:e+i,maxY:n+o};return{type:te.ELLIPSE,geometry:{cx:e,cy:n,rx:i,ry:o,bounds:a}}},hE=r=>{const t=typeof r=="string"?r:r.value;if(t.includes("<polygon points="))return sE(t);if(t.includes("<ellipse "))return uE(t)},lE=r=>{let t;if(r.type===te.POLYGON){const e=r.geometry,{points:n}=e;t=`<svg><polygon points="${n.map(i=>i.join(",")).join(" ")}" /></svg>`}else if(r.type===te.ELLIPSE){const e=r.geometry;t=`<svg><ellipse cx="${e.cx}" cy="${e.cy}" rx="${e.rx}" ry="${e.ry}" /></svg>`}if(t)return{type:"SvgSelector",value:t};throw`Unsupported shape type: ${r.type}`};let Vi;const fE=new Uint8Array(16);function cE(){if(!Vi&&(Vi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vi(fE)}const Ht=[];for(let r=0;r<256;++r)Ht.push((r+256).toString(16).slice(1));function dE(r,t=0){return Ht[r[t+0]]+Ht[r[t+1]]+Ht[r[t+2]]+Ht[r[t+3]]+"-"+Ht[r[t+4]]+Ht[r[t+5]]+"-"+Ht[r[t+6]]+Ht[r[t+7]]+"-"+Ht[r[t+8]]+Ht[r[t+9]]+"-"+Ht[r[t+10]]+Ht[r[t+11]]+Ht[r[t+12]]+Ht[r[t+13]]+Ht[r[t+14]]+Ht[r[t+15]]}const pE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sf={randomUUID:pE};function vE(r,t,e){if(sf.randomUUID&&!t&&!r)return sf.randomUUID();r=r||{};const n=r.random||(r.rng||cE)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){e=e||0;for(let i=0;i<16;++i)t[e+i]=n[i];return t}return dE(n)}let _E=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((t,e)=>(e&=63,e<36?t+=e.toString(36):e<62?t+=(e-26).toString(36).toUpperCase():e>62?t+="-":t+="_",t),"");const gE=r=>{const t=JSON.stringify(r);let e=0;for(let n=0,i=t.length;n<i;n++){let o=t.charCodeAt(n);e=(e<<5)-e+o,e|=0}return`${e}`},mE=(r,t)=>(Array.isArray(r)?r:[r]).map(e=>{const{id:n,type:i,purpose:o,value:a,created:s,creator:u,...h}=e;return{id:n||`temp-${gE(e)}`,annotation:t,type:i,purpose:o,value:a,created:s,creator:u?typeof u=="object"?{...u}:u:void 0,...h}}),yE=r=>r.map(t=>{var e;const n={...t};return delete n.annotation,(e=n.id)!=null&&e.startsWith("temp-")&&delete n.id,n});_E();const bE=(r,t=!1)=>({parse:e=>xE(e,t),serialize:e=>EE(e,r)}),xE=(r,t=!1)=>{const e=r.id||vE(),n=mE(r.body,e),i=Array.isArray(r.target)?r.target[0]:r.target,o=Array.isArray(i.selector)?i.selector[0]:i.selector,a=o.type==="FragmentSelector"?nE(o,t):o.type==="SvgSelector"?hE(o):void 0;return a?{parsed:{...r,id:e,bodies:n,target:{annotation:e,selector:a}}}:{error:Error(`Unknown selector type: ${a.type}`)}},EE=(r,t)=>{const e=r.target.selector,n=e.type==te.RECTANGLE?iE(e.geometry):lE(e);return{...r,"@context":"http://www.w3.org/ns/anno.jsonld",id:r.id,type:"Annotation",body:yE(r.bodies),target:{source:t,selector:n}}};function uf(r,t,e){const n=r.slice();return n[11]=t[e],n[13]=e,n}function hf(r){let t,e,n,i,o;return{c(){t=Jt("rect"),M(t,"class","a9s-corner-handle"),M(t,"x",e=r[11][0]-r[3]/2),M(t,"y",n=r[11][1]-r[3]/2),M(t,"height",r[3]),M(t,"width",r[3])},m(a,s){xt(a,t,s),i||(o=$t(t,"pointerdown",function(){qt(r[10](z(r[13])))&&r[10](z(r[13])).apply(this,arguments)}),i=!0)},p(a,s){r=a,s&24&&e!==(e=r[11][0]-r[3]/2)&&M(t,"x",e),s&24&&n!==(n=r[11][1]-r[3]/2)&&M(t,"y",n),s&8&&M(t,"height",r[3]),s&8&&M(t,"width",r[3])},d(a){a&&yt(t),i=!1,o()}}}function TE(r){let t,e,n,i,o,a,s,u,h,f,l=r[4].points,c=[];for(let d=0;d<l.length;d+=1)c[d]=hf(uf(r,l,d));return{c(){t=Jt("polygon"),i=pe(),o=Jt("polygon"),s=pe();for(let d=0;d<c.length;d+=1)c[d].c();u=j1(),M(t,"class","a9s-outer"),M(t,"style",e=r[1]?"display:none;":void 0),M(t,"points",n=r[4].points.map(lf).join(" ")),M(o,"class","a9s-inner a9s-shape-handle"),M(o,"style",r[1]),M(o,"points",a=r[4].points.map(ff).join(" "))},m(d,p){xt(d,t,p),xt(d,i,p),xt(d,o,p),xt(d,s,p);for(let v=0;v<c.length;v+=1)c[v]&&c[v].m(d,p);xt(d,u,p),h||(f=[$t(t,"pointerdown",function(){qt(r[10](z.SHAPE))&&r[10](z.SHAPE).apply(this,arguments)}),$t(o,"pointerdown",function(){qt(r[10](z.SHAPE))&&r[10](z.SHAPE).apply(this,arguments)})],h=!0)},p(d,p){if(r=d,p&2&&e!==(e=r[1]?"display:none;":void 0)&&M(t,"style",e),p&16&&n!==(n=r[4].points.map(lf).join(" "))&&M(t,"points",n),p&2&&M(o,"style",r[1]),p&16&&a!==(a=r[4].points.map(ff).join(" "))&&M(o,"points",a),p&1048){l=r[4].points;let v;for(v=0;v<l.length;v+=1){const _=uf(r,l,v);c[v]?c[v].p(_,p):(c[v]=hf(_),c[v].c(),c[v].m(u.parentNode,u))}for(;v<c.length;v+=1)c[v].d(1);c.length=l.length}},d(d){d&&yt(t),d&&yt(i),d&&yt(o),d&&yt(s),X1(c,d),d&&yt(u),h=!1,_r(f)}}}function wE(r){let t,e;return t=new df({props:{shape:r[0],transform:r[2],editor:r[5],$$slots:{default:[TE,({grab:n})=>({10:n}),({grab:n})=>n?1024:0]},$$scope:{ctx:r}}}),t.$on("change",r[7]),t.$on("grab",r[8]),t.$on("release",r[9]),{c(){rf(t.$$.fragment)},m(n,i){fs(t,n,i),e=!0},p(n,[i]){const o={};i&1&&(o.shape=n[0]),i&4&&(o.transform=n[2]),i&17434&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(Yi(t.$$.fragment,n),e=!0)},o(n){ls(t.$$.fragment,n),e=!1},d(n){cs(t,n)}}}const lf=r=>r.join(","),ff=r=>r.join(",");function SE(r,t,e){let n,i,{shape:o}=t,{computedStyle:a=void 0}=t,{transform:s}=t,{viewportScale:u=1}=t;const h=(d,p,v)=>{let _;p===z.SHAPE?_=d.geometry.points.map(([m,y])=>[m+v[0],y+v[1]]):_=d.geometry.points.map(([m,y],b)=>p===z(b)?[m+v[0],y+v[1]]:[m,y]);const g=nf(_);return{...d,geometry:{points:_,bounds:g}}};function f(d){$r.call(this,r,d)}function l(d){$r.call(this,r,d)}function c(d){$r.call(this,r,d)}return r.$$set=d=>{"shape"in d&&e(0,o=d.shape),"computedStyle"in d&&e(1,a=d.computedStyle),"transform"in d&&e(2,s=d.transform),"viewportScale"in d&&e(6,u=d.viewportScale)},r.$$.update=()=>{r.$$.dirty&1&&e(4,n=o.geometry),r.$$.dirty&64&&e(3,i=10/u)},[o,a,s,i,n,h,u,f,l,c]}class AE extends ps{constructor(t){super(),ds(this,t,SE,wE,as,{shape:0,computedStyle:1,transform:2,viewportScale:6})}}function PE(r){let t,e,n,i,o,a,s,u,h,f,l,c,d,p,v,_,g,m,y,b,x,A,P,T,w,E,R,O,C,k,B,N,q,K,Q,L,F,H,tt,rt,vt,Y,ht,mt,Tt,W,it,at,ct,nt;return{c(){t=Jt("rect"),s=pe(),u=Jt("rect"),d=pe(),p=Jt("rect"),m=pe(),y=Jt("rect"),P=pe(),T=Jt("rect"),O=pe(),C=Jt("rect"),q=pe(),K=Jt("rect"),F=pe(),H=Jt("rect"),vt=pe(),Y=Jt("rect"),Tt=pe(),W=Jt("rect"),M(t,"class","a9s-outer"),M(t,"style",e=r[1]?"display:none;":void 0),M(t,"x",n=r[4].x),M(t,"y",i=r[4].y),M(t,"width",o=r[4].w),M(t,"height",a=r[4].h),M(u,"class","a9s-inner a9s-shape-handle"),M(u,"style",r[1]),M(u,"x",h=r[4].x),M(u,"y",f=r[4].y),M(u,"width",l=r[4].w),M(u,"height",c=r[4].h),M(p,"class","a9s-edge-handle a9s-edge-handle-top"),M(p,"x",v=r[4].x),M(p,"y",_=r[4].y),M(p,"height",1),M(p,"width",g=r[4].w),M(y,"class","a9s-edge-handle a9s-edge-handle-right"),M(y,"x",b=r[4].x+r[4].w),M(y,"y",x=r[4].y),M(y,"height",A=r[4].h),M(y,"width",1),M(T,"class","a9s-edge-handle a9s-edge-handle-bottom"),M(T,"x",w=r[4].x),M(T,"y",E=r[4].y+r[4].h),M(T,"height",1),M(T,"width",R=r[4].w),M(C,"class","a9s-edge-handle a9s-edge-handle-left"),M(C,"x",k=r[4].x),M(C,"y",B=r[4].y),M(C,"height",N=r[4].h),M(C,"width",1),M(K,"class","a9s-corner-handle a9s-corner-handle-topleft"),M(K,"x",Q=r[4].x-r[3]/2),M(K,"y",L=r[4].y-r[3]/2),M(K,"height",r[3]),M(K,"width",r[3]),M(H,"class","a9s-corner-handle a9s-corner-handle-topright"),M(H,"x",tt=r[4].x+r[4].w-r[3]/2),M(H,"y",rt=r[4].y-r[3]/2),M(H,"height",r[3]),M(H,"width",r[3]),M(Y,"class","a9s-corner-handle a9s-corner-handle-bottomright"),M(Y,"x",ht=r[4].x+r[4].w-r[3]/2),M(Y,"y",mt=r[4].y+r[4].h-r[3]/2),M(Y,"height",r[3]),M(Y,"width",r[3]),M(W,"class","a9s-corner-handle a9s-corner-handle-bottomleft"),M(W,"x",it=r[4].x-r[3]/2),M(W,"y",at=r[4].y+r[4].h-r[3]/2),M(W,"height",r[3]),M(W,"width",r[3])},m(D,I){xt(D,t,I),xt(D,s,I),xt(D,u,I),xt(D,d,I),xt(D,p,I),xt(D,m,I),xt(D,y,I),xt(D,P,I),xt(D,T,I),xt(D,O,I),xt(D,C,I),xt(D,q,I),xt(D,K,I),xt(D,F,I),xt(D,H,I),xt(D,vt,I),xt(D,Y,I),xt(D,Tt,I),xt(D,W,I),ct||(nt=[$t(t,"pointerdown",function(){qt(r[10](z.SHAPE))&&r[10](z.SHAPE).apply(this,arguments)}),$t(u,"pointerdown",function(){qt(r[10](z.SHAPE))&&r[10](z.SHAPE).apply(this,arguments)}),$t(p,"pointerdown",function(){qt(r[10](z.TOP))&&r[10](z.TOP).apply(this,arguments)}),$t(y,"pointerdown",function(){qt(r[10](z.RIGHT))&&r[10](z.RIGHT).apply(this,arguments)}),$t(T,"pointerdown",function(){qt(r[10](z.BOTTOM))&&r[10](z.BOTTOM).apply(this,arguments)}),$t(C,"pointerdown",function(){qt(r[10](z.LEFT))&&r[10](z.LEFT).apply(this,arguments)}),$t(K,"pointerdown",function(){qt(r[10](z.TOP_LEFT))&&r[10](z.TOP_LEFT).apply(this,arguments)}),$t(H,"pointerdown",function(){qt(r[10](z.TOP_RIGHT))&&r[10](z.TOP_RIGHT).apply(this,arguments)}),$t(Y,"pointerdown",function(){qt(r[10](z.BOTTOM_RIGHT))&&r[10](z.BOTTOM_RIGHT).apply(this,arguments)}),$t(W,"pointerdown",function(){qt(r[10](z.BOTTOM_LEFT))&&r[10](z.BOTTOM_LEFT).apply(this,arguments)})],ct=!0)},p(D,I){r=D,I&2&&e!==(e=r[1]?"display:none;":void 0)&&M(t,"style",e),I&16&&n!==(n=r[4].x)&&M(t,"x",n),I&16&&i!==(i=r[4].y)&&M(t,"y",i),I&16&&o!==(o=r[4].w)&&M(t,"width",o),I&16&&a!==(a=r[4].h)&&M(t,"height",a),I&2&&M(u,"style",r[1]),I&16&&h!==(h=r[4].x)&&M(u,"x",h),I&16&&f!==(f=r[4].y)&&M(u,"y",f),I&16&&l!==(l=r[4].w)&&M(u,"width",l),I&16&&c!==(c=r[4].h)&&M(u,"height",c),I&16&&v!==(v=r[4].x)&&M(p,"x",v),I&16&&_!==(_=r[4].y)&&M(p,"y",_),I&16&&g!==(g=r[4].w)&&M(p,"width",g),I&16&&b!==(b=r[4].x+r[4].w)&&M(y,"x",b),I&16&&x!==(x=r[4].y)&&M(y,"y",x),I&16&&A!==(A=r[4].h)&&M(y,"height",A),I&16&&w!==(w=r[4].x)&&M(T,"x",w),I&16&&E!==(E=r[4].y+r[4].h)&&M(T,"y",E),I&16&&R!==(R=r[4].w)&&M(T,"width",R),I&16&&k!==(k=r[4].x)&&M(C,"x",k),I&16&&B!==(B=r[4].y)&&M(C,"y",B),I&16&&N!==(N=r[4].h)&&M(C,"height",N),I&24&&Q!==(Q=r[4].x-r[3]/2)&&M(K,"x",Q),I&24&&L!==(L=r[4].y-r[3]/2)&&M(K,"y",L),I&8&&M(K,"height",r[3]),I&8&&M(K,"width",r[3]),I&24&&tt!==(tt=r[4].x+r[4].w-r[3]/2)&&M(H,"x",tt),I&24&&rt!==(rt=r[4].y-r[3]/2)&&M(H,"y",rt),I&8&&M(H,"height",r[3]),I&8&&M(H,"width",r[3]),I&24&&ht!==(ht=r[4].x+r[4].w-r[3]/2)&&M(Y,"x",ht),I&24&&mt!==(mt=r[4].y+r[4].h-r[3]/2)&&M(Y,"y",mt),I&8&&M(Y,"height",r[3]),I&8&&M(Y,"width",r[3]),I&24&&it!==(it=r[4].x-r[3]/2)&&M(W,"x",it),I&24&&at!==(at=r[4].y+r[4].h-r[3]/2)&&M(W,"y",at),I&8&&M(W,"height",r[3]),I&8&&M(W,"width",r[3])},d(D){D&&yt(t),D&&yt(s),D&&yt(u),D&&yt(d),D&&yt(p),D&&yt(m),D&&yt(y),D&&yt(P),D&&yt(T),D&&yt(O),D&&yt(C),D&&yt(q),D&&yt(K),D&&yt(F),D&&yt(H),D&&yt(vt),D&&yt(Y),D&&yt(Tt),D&&yt(W),ct=!1,_r(nt)}}}function OE(r){let t,e;return t=new df({props:{shape:r[0],transform:r[2],editor:r[5],$$slots:{default:[PE,({grab:n})=>({10:n}),({grab:n})=>n?1024:0]},$$scope:{ctx:r}}}),t.$on("grab",r[7]),t.$on("change",r[8]),t.$on("release",r[9]),{c(){rf(t.$$.fragment)},m(n,i){fs(t,n,i),e=!0},p(n,[i]){const o={};i&1&&(o.shape=n[0]),i&4&&(o.transform=n[2]),i&3098&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){e||(Yi(t.$$.fragment,n),e=!0)},o(n){ls(t.$$.fragment,n),e=!1},d(n){cs(t,n)}}}function RE(r,t,e){let n,i,{shape:o}=t,{computedStyle:a=void 0}=t,{transform:s}=t,{viewportScale:u=1}=t;const h=(d,p,v)=>{const _=d.geometry.bounds;let[g,m]=[_.minX,_.minY],[y,b]=[_.maxX,_.maxY];const[x,A]=v;if(p===z.SHAPE)g+=x,y+=x,m+=A,b+=A;else{switch(p){case z.TOP:case z.TOP_LEFT:case z.TOP_RIGHT:{m+=A;break}case z.BOTTOM:case z.BOTTOM_LEFT:case z.BOTTOM_RIGHT:{b+=A;break}}switch(p){case z.LEFT:case z.TOP_LEFT:case z.BOTTOM_LEFT:{g+=x;break}case z.RIGHT:case z.TOP_RIGHT:case z.BOTTOM_RIGHT:{y+=x;break}}}const P=Math.min(g,y),T=Math.min(m,b),w=Math.abs(y-g),E=Math.abs(b-m);return{...d,geometry:{x:P,y:T,w,h:E,bounds:{minX:P,minY:T,maxX:P+w,maxY:T+E}}}};function f(d){$r.call(this,r,d)}function l(d){$r.call(this,r,d)}function c(d){$r.call(this,r,d)}return r.$$set=d=>{"shape"in d&&e(0,o=d.shape),"computedStyle"in d&&e(1,a=d.computedStyle),"transform"in d&&e(2,s=d.transform),"viewportScale"in d&&e(6,u=d.viewportScale)},r.$$.update=()=>{r.$$.dirty&1&&e(4,n=o.geometry),r.$$.dirty&64&&e(3,i=10/u)},[o,a,s,i,n,h,u,f,l,c]}class IE extends ps{constructor(t){super(),ds(this,t,RE,OE,as,{shape:0,computedStyle:1,transform:2,viewportScale:6})}}te.RECTANGLE,te.POLYGON;const z=r=>`HANDLE-${r}`;z.SHAPE="SHAPE",z.TOP="TOP",z.RIGHT="RIGHT",z.BOTTOM="BOTTOM",z.LEFT="LEFT",z.TOP_LEFT="TOP_LEFT",z.TOP_RIGHT="TOP_RIGHT",z.BOTTOM_RIGHT="BOTTOM_RIGHT",z.BOTTOM_LEFT="BOTTOM_LEFT";const CE=r=>({}),cf=r=>({grab:r[0]});function ME(r){let t,e,n,i;const o=r[7].default,a=U1(o,r,r[6],cf);return{c(){t=Jt("g"),a&&a.c(),M(t,"class","a9s-annotation selected")},m(s,u){xt(s,t,u),a&&a.m(t,null),e=!0,n||(i=[$t(t,"pointerup",r[2]),$t(t,"pointermove",r[1])],n=!0)},p(s,[u]){a&&a.p&&(!e||u&64)&&k1(a,o,s,s[6],e?G1(o,s[6],u,CE):H1(s[6]),cf)},i(s){e||(Yi(a,s),e=!0)},o(s){ls(a,s),e=!1},d(s){s&&yt(t),a&&a.d(s),n=!1,_r(i)}}}function DE(r,t,e){let{$$slots:n={},$$scope:i}=t;const o=W1();let{shape:a}=t,{editor:s}=t,{transform:u}=t,h=null,f,l=null;const c=v=>_=>{h=v,f=u.elementToImage(_.offsetX,_.offsetY),l=a,_.target.setPointerCapture(_.pointerId),o("grab")},d=v=>{if(h){const[_,g]=u.elementToImage(v.offsetX,v.offsetY),m=[_-f[0],g-f[1]];e(3,a=s(l,h,m)),o("change",a)}},p=v=>{v.target.releasePointerCapture(v.pointerId),h=null,l=a,o("release")};return r.$$set=v=>{"shape"in v&&e(3,a=v.shape),"editor"in v&&e(4,s=v.editor),"transform"in v&&e(5,u=v.transform),"$$scope"in v&&e(6,i=v.$$scope)},[c,d,p,a,s,u,i,n]}class df extends ps{constructor(t){super(),ds(this,t,DE,ME,as,{shape:3,editor:4,transform:5})}}const FE=rc,BE=to,NE=Lf,LE=te,UE=bE;ee.PointerSelectAction=BE,ee.ShapeType=LE,ee.W3CImageFormat=UE,ee.createBody=NE,ee.createOSDAnnotator=B1,ee.defaultColorProvider=FE,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
1559
+ //# sourceMappingURL=annotorious-openseadragon.js.map