studiograph 1.3.19 → 1.3.21

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 (74) hide show
  1. package/dist/core/types.d.ts +3 -0
  2. package/dist/core/types.js +1 -0
  3. package/dist/core/types.js.map +1 -1
  4. package/dist/server/chrome/chrome.css +4 -8
  5. package/dist/server/index.js +15 -2
  6. package/dist/server/index.js.map +1 -1
  7. package/dist/web/_app/immutable/assets/0.D8EoqqcB.css +1 -0
  8. package/dist/web/_app/immutable/assets/2.DRZ4qWy8.css +1 -0
  9. package/dist/web/_app/immutable/assets/{3.C-bIa9M8.css → 3.Bxy1xbfc.css} +1 -1
  10. package/dist/web/_app/immutable/assets/{4.BhKgiXd2.css → 4.aFSdMTV2.css} +1 -1
  11. package/dist/web/_app/immutable/assets/{5.CydFyZSu.css → 5.CquhUpOu.css} +1 -1
  12. package/dist/web/_app/immutable/assets/{6.kqeOo0OW.css → 6.CT4xL4K3.css} +1 -1
  13. package/dist/web/_app/immutable/assets/{7.CseIx7qQ.css → 7.BMfme7ZM.css} +1 -1
  14. package/dist/web/_app/immutable/assets/{8.BYpFDZHK.css → 8.BUrHkYry.css} +1 -1
  15. package/dist/web/_app/immutable/assets/AppShell.DFQamTEo.css +1 -0
  16. package/dist/web/_app/immutable/assets/ViewToolbar.39HnhXNY.css +1 -0
  17. package/dist/web/_app/immutable/chunks/2lIPsyS1.js +1 -0
  18. package/dist/web/_app/immutable/chunks/{BVmVTxxa.js → 8_3AquXS.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/9H0Eug-K.js +1 -0
  20. package/dist/web/_app/immutable/chunks/{DKQjBKyp.js → B340SUKR.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/{DJKRyj_1.js → BCc0wQRF.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{CIZkRAuY.js → CXrT-896.js} +1 -1
  23. package/dist/web/_app/immutable/chunks/D2nVx4xh.js +1 -0
  24. package/dist/web/_app/immutable/chunks/DGXEf2nW.js +1 -0
  25. package/dist/web/_app/immutable/chunks/DJCIIlIq.js +91 -0
  26. package/dist/web/_app/immutable/chunks/DJk-tEOI.js +1 -0
  27. package/dist/web/_app/immutable/chunks/DQ4B6jbE.js +2 -0
  28. package/dist/web/_app/immutable/chunks/{CnKc_Tae.js → DVeBSOEs.js} +1 -1
  29. package/dist/web/_app/immutable/chunks/{BUSlXG5Y.js → DZcH3k7y.js} +1 -1
  30. package/dist/web/_app/immutable/chunks/EXt9EGH6.js +1 -0
  31. package/dist/web/_app/immutable/chunks/{BaUG0bh_.js → EpaeaOC3.js} +2 -2
  32. package/dist/web/_app/immutable/chunks/_VqKaRO3.js +2 -0
  33. package/dist/web/_app/immutable/chunks/bZnjPslN.js +1 -0
  34. package/dist/web/_app/immutable/chunks/u-BJ4rdO.js +1 -0
  35. package/dist/web/_app/immutable/chunks/{BpUdqMox.js → xf3JUd0V.js} +1 -1
  36. package/dist/web/_app/immutable/entry/app.Bq3TZW-V.js +2 -0
  37. package/dist/web/_app/immutable/entry/start.C4gZuziE.js +1 -0
  38. package/dist/web/_app/immutable/nodes/0.BEIzN223.js +10 -0
  39. package/dist/web/_app/immutable/nodes/1.B5D1CJ1m.js +1 -0
  40. package/dist/web/_app/immutable/nodes/2.BGaiMS7x.js +1 -0
  41. package/dist/web/_app/immutable/nodes/3.C3goG01r.js +11 -0
  42. package/dist/web/_app/immutable/nodes/{4.CD5YzRYT.js → 4.C4ze80_s.js} +2 -2
  43. package/dist/web/_app/immutable/nodes/5.IqOopG3B.js +2 -0
  44. package/dist/web/_app/immutable/nodes/6.DaqAOjv4.js +1 -0
  45. package/dist/web/_app/immutable/nodes/7.C_M49E5I.js +2 -0
  46. package/dist/web/_app/immutable/nodes/8.CuCVLNZd.js +1 -0
  47. package/dist/web/_app/version.json +1 -1
  48. package/dist/web/index.html +11 -11
  49. package/package.json +1 -1
  50. package/dist/web/_app/immutable/assets/0.CupILLQs.css +0 -1
  51. package/dist/web/_app/immutable/assets/2.DRHi7ABa.css +0 -1
  52. package/dist/web/_app/immutable/assets/AppShell.D3hRAjzT.css +0 -1
  53. package/dist/web/_app/immutable/assets/ChatPanel.CP-_8txt.css +0 -1
  54. package/dist/web/_app/immutable/chunks/0x0awhVy.js +0 -2
  55. package/dist/web/_app/immutable/chunks/8FUQuwgM.js +0 -1
  56. package/dist/web/_app/immutable/chunks/Bl1mtM70.js +0 -1
  57. package/dist/web/_app/immutable/chunks/C7R6dA2m.js +0 -1
  58. package/dist/web/_app/immutable/chunks/CbJfRYJV.js +0 -1
  59. package/dist/web/_app/immutable/chunks/DKIqe64p.js +0 -64
  60. package/dist/web/_app/immutable/chunks/DVuLyxG5.js +0 -1
  61. package/dist/web/_app/immutable/chunks/DxxhVGi2.js +0 -1
  62. package/dist/web/_app/immutable/chunks/EDLlAC9C.js +0 -2
  63. package/dist/web/_app/immutable/chunks/Scb_NG-a.js +0 -28
  64. package/dist/web/_app/immutable/chunks/glgUBDR2.js +0 -1
  65. package/dist/web/_app/immutable/entry/app.DjTkwlaQ.js +0 -2
  66. package/dist/web/_app/immutable/entry/start.Bupokdng.js +0 -1
  67. package/dist/web/_app/immutable/nodes/0.Q3C-jhjE.js +0 -10
  68. package/dist/web/_app/immutable/nodes/1.BPCfgPXb.js +0 -1
  69. package/dist/web/_app/immutable/nodes/2.Bdsd2uts.js +0 -1
  70. package/dist/web/_app/immutable/nodes/3.Doh56lgy.js +0 -11
  71. package/dist/web/_app/immutable/nodes/5.DN4bEWf-.js +0 -2
  72. package/dist/web/_app/immutable/nodes/6.BfA9chPb.js +0 -1
  73. package/dist/web/_app/immutable/nodes/7.DhU0-U33.js +0 -2
  74. package/dist/web/_app/immutable/nodes/8.wSRycWoC.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as i,s as T,f as B,b as h,c as Y}from"./_VqKaRO3.js";import{p as k,l as M,s as A,d as V,g as b,a as Z,c as p,n as j,r as f,b as D,m as C,t as G,P as q,v as u,u as E}from"./D2nVx4xh.js";import{a as F,s as I,c as J}from"./DQ4B6jbE.js";import{l as P,p as z,i as g}from"./2lIPsyS1.js";import{i as K}from"./DGXEf2nW.js";import{n as L}from"./u-BJ4rdO.js";import{B as Q}from"./8_3AquXS.js";var S=B("<title> </title>"),U=B('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function W(y,t){const s=P(t,["children","$$slots","$$events","$$legacy"]),_=P(s,["size","title"]);k(t,!1);const r=C(),l=C();let c=z(t,"size",8,16),o=z(t,"title",8,void 0);M(()=>(V(s),V(o())),()=>{A(r,s["aria-label"]||s["aria-labelledby"]||o())}),M(()=>(b(r),V(s)),()=>{A(l,{"aria-hidden":b(r)?void 0:!0,role:b(r)?"img":void 0,focusable:Number(s.tabindex)===0?!0:void 0})}),Z(),K();var n=U();F(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...b(l),..._}));var w=p(n);{var x=d=>{var v=S(),m=p(v,!0);f(v),G(()=>T(m,o())),i(d,v)};g(w,d=>{o()&&d(x)})}j(3),f(n),i(y,n),D()}var X=h('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><span class="toggle-label">Details</span></span>'),$=h('<a class="toggle-btn svelte-r6dy5f"><span class="toggle-label">Details</span></a>'),aa=h('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><span class="toggle-label">Graph</span></span>'),ea=h('<a class="toggle-btn svelte-r6dy5f" href="/graph"><span class="toggle-label">Graph</span></a>'),ta=h('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><!> <!></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function ca(y,t){k(t,!0);let s=z(t,"activeView",3,"entity");const _=q("chat");var r=ta(),l=u(p(r),2),c=p(l);{var o=a=>{var e=X();i(a,e)},n=a=>{var e=$();G(()=>I(e,"href",L.entityPath??"/")),i(a,e)};g(c,a=>{s()==="entity"?a(o):a(n,!1)})}var w=u(c,2);{var x=a=>{var e=aa();i(a,e)},d=a=>{var e=ea();i(a,e)};g(w,a=>{s()==="graph"?a(x):a(d,!1)})}f(l);var v=u(l,2),m=p(v);{var N=a=>{var e=Y(),H=E(e);J(H,()=>t.right),i(a,e)};g(m,a=>{t.right&&a(N)})}var O=u(m,2);{var R=a=>{Q(a,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return _.toggle},children:(e,H)=>{W(e,{size:14})},$$slots:{default:!0}})};g(O,a=>{_.open||a(R)})}f(v),f(r),i(y,r),D()}export{ca as V};
@@ -0,0 +1,2 @@
1
+ import{f as $t,z as Lt,b7 as ct,X as x,Z as ft,O as dt,h as U,as as kt,b8 as Pt,b9 as Mt,aW as Rt,ba as Ut,bb as Nt,bc as jt,g as s,bd as Ft,be as Jt,bf as H,j as rt,bg as Gt,bh as Wt,a4 as Bt,bi as Dt,bj as Ht,x as A,a9 as J,s as l,V as Vt}from"./D2nVx4xh.js";import{B as zt}from"./2lIPsyS1.js";import{i as Kt,d as qt,g as Qt,j as Yt,n as Xt,k as Zt}from"./_VqKaRO3.js";function Ne(t,e,...r){var n=new zt(t);$t(()=>{const a=e()??null;n.ensure(a,a&&(f=>a(f,...r)))},Lt)}function xt(t,e){var r=void 0,n;ct(()=>{r!==(r=e())&&(n&&(x(n),n=null),r&&(n=ft(()=>{dt(()=>r(t))})))})}function pt(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=pt(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=pt(t))&&(n&&(n+=" "),n+=e);return n}function ee(t){return typeof t=="object"?te(t):t??""}const nt=[...`
2
+ \r\f \v\uFEFF`];function re(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var a of Object.keys(r))if(r[a])n=n?n+" "+a:a;else if(n.length)for(var f=a.length,d=0;(d=n.indexOf(a,d))>=0;){var S=d+f;(d===0||nt.includes(n[d-1]))&&(S===n.length||nt.includes(n[S]))?n=(d===0?"":n.substring(0,d))+n.substring(S+1):d=S}}return n===""?null:n}function ot(t,e=!1){var r=e?" !important;":";",n="";for(var a of Object.keys(t)){var f=t[a];f!=null&&f!==""&&(n+=" "+a+": "+f+r)}return n}function X(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ne(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var f=!1,d=0,S=!1,E=[];n&&E.push(...Object.keys(n).map(X)),a&&E.push(...Object.keys(a).map(X));var g=0,T=-1;const O=t.length;for(var C=0;C<O;C++){var p=t[C];if(S?p==="/"&&t[C-1]==="*"&&(S=!1):f?f===p&&(f=!1):p==="/"&&t[C+1]==="*"?S=!0:p==='"'||p==="'"?f=p:p==="("?d++:p===")"&&d--,!S&&f===!1&&d===0){if(p===":"&&T===-1)T=C;else if(p===";"||C===O-1){if(T!==-1){var k=X(t.substring(g,T).trim());if(!E.includes(k)){p!==";"&&C++;var L=t.substring(g,C).trim();r+=" "+L+";"}}g=C+1,T=-1}}}}return n&&(r+=ot(n)),a&&(r+=ot(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function oe(t,e,r,n,a,f){var d=t.__className;if(U||d!==r||d===void 0){var S=re(r,n,f);(!U||S!==t.getAttribute("class"))&&(S==null?t.removeAttribute("class"):e?t.className=S:t.setAttribute("class",S)),t.__className=r}else if(f&&a!==f)for(var E in f){var g=!!f[E];(a==null||g!==!!a[E])&&t.classList.toggle(E,g)}return f}function Z(t,e={},r,n){for(var a in r){var f=r[a];e[a]!==f&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,f,n))}}function ae(t,e,r,n){var a=t.__style;if(U||a!==e){var f=ne(e,n);(!U||f!==t.getAttribute("style"))&&(f==null?t.removeAttribute("style"):t.style.cssText=f),t.__style=e}else n&&(Array.isArray(n)?(Z(t,r?.[0],n[0]),Z(t,r?.[1],n[1],"important")):Z(t,r,n));return n}function tt(t,e,r=!1){if(t.multiple){if(e==null)return;if(!kt(e))return Pt();for(var n of t.options)n.selected=e.includes(at(n));return}for(n of t.options){var a=at(n);if(Mt(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function se(t){var e=new MutationObserver(()=>{tt(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Rt(()=>{e.disconnect()})}function at(t){return"__value"in t?t.__value:t.value}const B=Symbol("class"),D=Symbol("style"),gt=Symbol("is custom element"),ht=Symbol("is html"),ie=H?"link":"LINK",ue=H?"input":"INPUT",le=H?"option":"OPTION",ce=H?"select":"SELECT",fe=H?"progress":"PROGRESS";function de(t){if(U){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;Q(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var a=t.checked;Q(t,"checked",null),t.checked=a}}};t.__on_r=r,Bt(r),Dt()}}function je(t,e){var r=et(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==fe)||(t.value=e??"")}function pe(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Q(t,e,r,n){var a=et(t);U&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===ie)||a[e]!==(a[e]=r)&&(e==="loading"&&(t[Ht]=r),r==null?t.removeAttribute(e):typeof r!="string"&&yt(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function ge(t,e,r,n,a=!1,f=!1){if(U&&a&&t.nodeName===ue){var d=t,S=d.type==="checkbox"?"defaultChecked":"defaultValue";S in r||de(d)}var E=et(t),g=E[gt],T=!E[ht];let C=U&&g;C&&rt(!1);var p=e||{},k=t.nodeName===le;for(var L in e)L in r||(r[L]=null);r.class?r.class=ee(r.class):(n||r[B])&&(r.class=null),r[D]&&(r.style??=null);var O=yt(t);for(const y in r){let b=r[y];if(k&&y==="value"&&b==null){t.value=t.__value="",p[y]=b;continue}if(y==="class"){var P=t.namespaceURI==="http://www.w3.org/1999/xhtml";oe(t,P,b,n,e?.[B],r[B]),p[y]=b,p[B]=r[B];continue}if(y==="style"){ae(t,b,e?.[D],r[D]),p[y]=b,p[D]=r[D];continue}var m=p[y];if(!(b===m&&!(b===void 0&&t.hasAttribute(y)))){p[y]=b;var M=y[0]+y[1];if(M!=="$$")if(M==="on"){const w={},R="$$"+y;let I=y.slice(2);var W=Zt(I);if(Kt(I)&&(I=I.slice(0,-7),w.capture=!0),!W&&m){if(b!=null)continue;t.removeEventListener(I,p[R],w),p[R]=null}if(W)qt(I,t,b),Qt([I]);else if(b!=null){let F=function(Y){p[y].call(this,Y)};p[R]=Yt(I,t,F,w)}}else if(y==="style")Q(t,y,b);else if(y==="autofocus")Gt(t,!!b);else if(!g&&(y==="__value"||y==="value"&&b!=null))t.value=t.__value=b;else if(y==="selected"&&k)pe(t,b);else{var _=y;T||(_=Xt(_));var V=_==="defaultValue"||_==="defaultChecked";if(b==null&&!g&&!V)if(E[y]=null,_==="value"||_==="checked"){let w=t;const R=e===void 0;if(_==="value"){let I=w.defaultValue;w.removeAttribute(_),w.defaultValue=I,w.value=w.__value=R?I:null}else{let I=w.defaultChecked;w.removeAttribute(_),w.defaultChecked=I,w.checked=R?I:!1}}else t.removeAttribute(y);else V||O.includes(_)&&(g||typeof b!="string")?(t[_]=b,_ in E&&(E[_]=Wt)):typeof b!="function"&&Q(t,_,b)}}}return C&&rt(!0),p}function Fe(t,e,r=[],n=[],a=[],f,d=!1,S=!1){Ut(a,r,n,E=>{var g=void 0,T={},C=t.nodeName===ce,p=!1;if(ct(()=>{var L=e(...E.map(s)),O=ge(t,g,L,f,d,S);p&&C&&"value"in L&&tt(t,L.value);for(let m of Object.getOwnPropertySymbols(T))L[m]||x(T[m]);for(let m of Object.getOwnPropertySymbols(L)){var P=L[m];m.description===Ft&&(!g||P!==g[m])&&(T[m]&&x(T[m]),T[m]=ft(()=>xt(t,()=>P))),O[m]=P}g=O}),C){var k=t;dt(()=>{tt(k,g.value,!0),se(k)})}p=!0})}function et(t){return t.__attributes??={[gt]:t.nodeName.includes("-"),[ht]:t.namespaceURI===Nt}}var st=new Map;function yt(t){var e=t.getAttribute("is")||t.nodeName,r=st.get(e);if(r)return r;st.set(e,r=[]);for(var n,a=t,f=Element.prototype;f!==a;){n=Jt(a);for(var d in n)n[d].set&&r.push(d);a=jt(a)}return r}const he="";class bt extends Error{constructor(e,r){super(r),this.status=e,this.name="ApiError"}}async function v(t,e){const r={...e?.headers};e?.body&&(r["Content-Type"]=r["Content-Type"]??"application/json");const n=await fetch(`${he}${t}`,{...e,headers:r});if(!n.ok){const a=await n.json().catch(()=>({error:n.statusText}));throw n.status===401&&typeof window<"u"&&!t.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new bt(n.status,a.error??n.statusText)}return n.json()}const Je=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bt,apiFetch:v},Symbol.toStringTag,{value:"Module"}));function ye(){return v("/api/workspace")}function be(t){return v("/api/workspace",{method:"PUT",body:JSON.stringify(t)})}function Ge(){return v("/api/workspace/mcp-config")}function it(){return v("/api/repos")}function ve(t,e,r){return v("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,description:e,...r?{private:!0}:{}})})}function Se(t,e){return v(`/api/repos/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})}function Ce(t){return v(`/api/repos/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ee(){return v("/api/apps")}function me(t){return v(`/api/repos/${encodeURIComponent(t)}/entities?summary=true`)}function We(t,e,r){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`)}function Be(t,e,r,n,a){return v(`/api/repos/${encodeURIComponent(t)}/entities`,{method:"POST",body:JSON.stringify({entityType:e,entityId:r,data:n,content:a})})}function De(t,e,r){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`,{method:"DELETE"})}function He(t,e,r,n){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify(n)})}function Ve(t){return v(`/api/repos/${encodeURIComponent(t)}/commit`,{method:"POST"})}function we(t){return t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}const Ae="#e05050";function ut(t){if(typeof document>"u")return;const e=t||Ae,r=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16),f=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const d of f)d.style.setProperty("--color-accent",e),d.style.setProperty("--color-accent-hover",Te(e,15)),d.style.setProperty("--color-accent-muted",`rgba(${r}, ${n}, ${a}, 0.08)`),d.style.setProperty("--color-link",lt(e,15)),d.style.setProperty("--color-badge-bg",`rgba(${r}, ${n}, ${a}, 0.1)`),d.style.setProperty("--color-badge-text",lt(e,20))}function Te(t,e){const r=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e/100))),n=Math.max(0,Math.round(parseInt(t.slice(3,5),16)*(1-e/100))),a=Math.max(0,Math.round(parseInt(t.slice(5,7),16)*(1-e/100)));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`}function lt(t,e){const r=Math.min(255,Math.round(parseInt(t.slice(1,3),16)+(255-parseInt(t.slice(1,3),16))*e/100)),n=Math.min(255,Math.round(parseInt(t.slice(3,5),16)+(255-parseInt(t.slice(3,5),16))*e/100)),a=Math.min(255,Math.round(parseInt(t.slice(5,7),16)+(255-parseInt(t.slice(5,7),16))*e/100));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`}function _e(){let t=A(""),e=A(null),r=A(null),n=A(!1),a=A(J([]));const f={};let d=A(J([])),S=A(!1),E=A(null),g=A(J({})),T=J({}),C=J({}),p=J({}),k=A(0),L=A(null),O=A(""),P=null,m=A(0),M=A(0),W=A("alpha");async function _(){l(S,!0),l(E,null),l(m,0),l(M,0);try{const[o,i,u]=await Promise.all([it(),Ee().catch(()=>[]),ye().catch(()=>({name:""}))]);l(d,i,!0),l(t,u.name,!0),l(e,u.about??null,!0),l(r,u.accent_color??null,!0),l(n,!0),ut(s(r)),l(a,o.map(c=>({name:c.name,type:c.type,private:c.private,sync:c.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(s(a).map(c=>w(c.name)))}catch(o){l(E,o.message,!0)}finally{l(S,!1)}}function V(o,i,u){const c=s(a).find(h=>h.name===o);c&&(c.entities=c.entities.filter(h=>!(h.id===u&&h.entityType===i)),c.count=c.entities.length)}async function y(o){s(a).find(u=>u.name===o)&&await w(o,!0)}async function b(){l(m,0),l(M,0),await Promise.all(s(a).map(o=>w(o.name,!0)))}async function w(o,i=!1){const u=s(a).find(h=>h.name===o);if(!u||u.loading||!i&&u.loaded)return;const c=(f[o]??0)+1;f[o]=c,i||(u.loading=!0);try{const h=await me(o);if(f[o]!==c)return;let N=0,z=0;for(const $ of h)N+=$.document?.wikilinks?.length??0,z+=$.subContentCount??0;l(m,s(m)+N),l(M,s(M)+z),u.entities=h.filter($=>!$.id.toLowerCase().startsWith("readme")).map($=>({id:$.id,title:$.data?.name??we($.id),entityType:$.entityType,repo:o,hasSubContent:!!$.hasSubContent,wikilinks:$.document?.wikilinks??[],createdAt:$.data?.created_at??null,updatedAt:$.data?.updated_at??null})).sort(($,Ot)=>$.title.localeCompare(Ot.title)),u.count=u.entities.length,u.loaded=!0}catch(h){console.error(`Failed to load entities for ${o}:`,h)}finally{u.loading=!1}}function R(o){s(g)[o]=!s(g)[o]}function I(o){return s(g)[o]??!1}function F(o,i,u){return`${o}/${i}/${u}`}function Y(o,i,u){const c=F(o,i,u),h=T[c]??!1;T[c]=!h,!h&&!C[c]?.loaded&&Ct(o,i,u)}function vt(o,i,u){return T[F(o,i,u)]??!1}function St(o,i,u){return C[F(o,i,u)]??{entries:[],loading:!1,loaded:!1}}async function Ct(o,i,u){const c=F(o,i,u);C[c]={entries:[],loading:!1,loaded:!0}}function Et(o){const i=s(O).trim().toLowerCase();if(!i)return o;const u=[];for(const c of o){const h=c.entities.filter(N=>N.title.toLowerCase().includes(i)||N.id.toLowerCase().includes(i));h.length>0&&u.push({...c,entities:h,count:h.length})}return u}function mt(o){if(o&&!s(O)?P={...s(g)}:!o&&s(O)&&P&&(l(g,P,!0),P=null),l(O,o,!0),o){const i=o.trim().toLowerCase();for(const u of s(a)){const c=u.entities.some(h=>h.title.toLowerCase().includes(i)||h.id.toLowerCase().includes(i));s(g)[u.name]=c}}}function wt(o){const i=o.startsWith("type:");p[o]=!(p[o]??i)}function At(o){return p[o]??!1}function Tt(o){return p[o]===!1}const _t=Vt(()=>s(a).reduce((o,i)=>o+(i.count??0),0));function It(o){return s(d).find(i=>i.entityTypes.includes(o))}return{get name(){return s(t)},get about(){return s(e)},get accentColor(){return s(r)},get nameLoaded(){return s(n)},async updateWorkspace(o){o.accent_color!==void 0&&(l(r,o.accent_color,!0),ut(o.accent_color)),await be(o),o.name?.trim()&&l(t,o.name.trim(),!0),typeof o.about=="string"&&l(e,o.about,!0)},get repos(){return s(a)},get apps(){return s(d)},get loading(){return s(S)},get error(){return s(E)},get totalEntities(){return s(_t)},get totalLinks(){return s(m)},get totalFiles(){return s(M)},get sortedRepos(){const o=[...s(a)].sort((i,u)=>i.name.localeCompare(u.name));return Et(o)},get filteredIds(){const o=s(O).trim().toLowerCase();if(!o)return null;const i=new Set;for(const u of s(a))for(const c of u.entities)(c.title.toLowerCase().includes(o)||c.id.toLowerCase().includes(o))&&i.add(c.id);return i},get filterQuery(){return s(O)},setFilterQuery:mt,get sortMode(){return s(W)},set sortMode(o){l(W,o,!0)},get recentEntities(){const o=s(O).trim().toLowerCase();let i=[];for(const u of s(a))for(const c of u.entities)o&&!c.title.toLowerCase().includes(o)&&!c.id.toLowerCase().includes(o)||i.push(c);return i.sort((u,c)=>{const h=u.updatedAt??"";return(c.updatedAt??"").localeCompare(h)})},get sidebarScrollTop(){return s(k)},set sidebarScrollTop(o){l(k,o,!0)},get lastAutoExpandedFor(){return s(L)},set lastAutoExpandedFor(o){l(L,o,!0)},load:_,loadEntities:w,removeEntity:V,refreshEntities:y,refreshAll:b,toggleRepo:R,isExpanded:I,toggleEntity:Y,isEntityExpanded:vt,getEntityContents:St,toggleFolder:wt,isFolderExpanded:At,isFolderCollapsed:Tt,getAppForEntityType:It,async renameCollectionTo(o,i){await Se(o,i);const u=s(a).find(c=>c.name===o);u&&(u.name=i,s(g)[o]&&(s(g)[i]=!0,delete s(g)[o]))},async removeCollection(o){await Ce(o),l(a,s(a).filter(i=>i.name!==o),!0),delete s(g)[o]},async addCollection(o,i,u){await ve(o,i,u);const c=await it();l(a,c.map(h=>s(a).find(z=>z.name===h.name)??{name:h.name,type:h.type,private:h.private,count:null,entities:[],loading:!1,loaded:!1}),!0),s(g)[o]=!0,await w(o)}}}const ze=_e();function Ie(){return v("/api/auth/status")}function Oe(){return v("/api/auth/me")}function $e(t,e){return v("/api/auth/login",{method:"POST",body:JSON.stringify({email:t,password:e})})}function Le(){return v("/api/auth/logout",{method:"POST"})}function ke(t,e,r){return v("/api/auth/setup",{method:"POST",body:JSON.stringify({email:t,password:e,displayName:r})})}function Ke(){return v("/api/auth/users")}function qe(t,e,r,n){return v("/api/auth/users",{method:"POST",body:JSON.stringify({email:t,password:e,displayName:r,role:n})})}function Qe(t){return v(`/api/auth/users/${t}`,{method:"DELETE"})}function Ye(t,e){return v(`/api/auth/users/${t}/password`,{method:"PATCH",body:JSON.stringify({password:e})})}let G=A(null),K=A(!1),q=A(!1),j=A(!0);const Pe={get user(){return s(G)},get authEnabled(){return s(K)},get needsSetup(){return s(q)},get loading(){return s(j)},async checkAuth(){l(j,!0);try{const t=await Ie();if(l(K,t.authEnabled,!0),l(q,t.userCount===0),s(q))return l(j,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!t.authEnabled)return l(j,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:e}=await Oe();return l(G,e,!0),l(j,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return l(G,null),l(j,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return l(j,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(t,e){const{user:r}=await $e(t,e);return l(G,r,!0),l(K,!0),r},async setup(t,e,r){const{user:n}=await ke(t,e,r);return l(G,n,!0),l(K,!0),l(q,!1),n},async logout(){await Le(),l(G,null)}},Xe=Object.freeze(Object.defineProperty({__proto__:null,auth:Pe},Symbol.toStringTag,{value:"Module"}));export{D as S,Fe as a,Pe as b,Ne as c,oe as d,Ve as e,We as f,te as g,je as h,ae as i,ee as j,v as k,Ke as l,Ge as m,Qe as n,Ye as o,qe as p,De as q,de as r,Q as s,Be as t,He as u,Je as v,ze as w,Xe as x};
@@ -1 +1 @@
1
- import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./glgUBDR2.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
1
+ import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./u-BJ4rdO.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
@@ -1 +1 @@
1
- import{extensions as i,AccessibilitySystem as t,Container as e,accessibilityTarget as n,EventSystem as s,FederatedContainer as a}from"./BaUG0bh_.js";import"./BpUdqMox.js";i.add(t);i.mixin(e,n);i.add(s);i.mixin(e,a);
1
+ import{extensions as i,AccessibilitySystem as t,Container as e,accessibilityTarget as n,EventSystem as s,FederatedContainer as a}from"./EpaeaOC3.js";import"./xf3JUd0V.js";i.add(t);i.mixin(e,n);i.add(s);i.mixin(e,a);
@@ -0,0 +1 @@
1
+ import{a as p,s as $,f as h}from"./_VqKaRO3.js";import{i as M}from"./DGXEf2nW.js";import{p as I,l as c,a as P,g as i,c as m,n as Z,r as _,b as k,m as u,s as g,d as n,t as B}from"./D2nVx4xh.js";import{l as v,p as b,i as C}from"./2lIPsyS1.js";import{a as N}from"./DQ4B6jbE.js";var R=h("<title> </title>"),V=h('<svg><!><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm0,26A12,12,0,0,1,16,4V16l8.4812,8.4814A11.9625,11.9625,0,0,1,16,28Z"></path></svg>');function F(x,t){const e=v(t,["children","$$slots","$$events","$$legacy"]),w=v(e,["size","title"]);I(t,!1);const a=u(),d=u();let f=b(t,"size",8,16),s=b(t,"title",8,void 0);c(()=>(n(e),n(s())),()=>{g(a,e["aria-label"]||e["aria-labelledby"]||s())}),c(()=>(i(a),n(e)),()=>{g(d,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),P(),M();var r=V();N(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...w}));var y=m(r);{var z=l=>{var o=R(),A=m(o,!0);_(o),B(()=>$(A,s())),p(l,o)};C(y,l=>{s()&&l(z)})}Z(),_(r),p(x,r),k()}export{F as I};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BUSlXG5Y.js","./BpUdqMox.js"])))=>i.map(i=>d[i]);
2
- import{_ as Or}from"./DJKRyj_1.js";import{g as _c}from"./CqkleIqs.js";var S=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(S||{});const $i=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},$n=(n,e)=>$i(n).priority??e,Z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map($i).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...n){return n.map($i).forEach(e=>{e.type.forEach(t=>{const r=this._addHandlers,s=this._queue;r[t]?r[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e))})}),this},handle(n,e,t){const r=this._addHandlers,s=this._removeHandlers;if(r[n]||s[n])throw new Error(`Extension type ${n} already has a handler`);r[n]=e,s[n]=t;const i=this._queue;return i[n]&&(i[n]?.forEach(o=>e(o)),delete i[n]),this},handleByMap(n,e){return this.handle(n,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(n,e,t=-1){return this.handle(n,r=>{e.findIndex(i=>i.name===r.name)>=0||(e.push({name:r.name,value:r.ref}),e.sort((i,o)=>$n(o.value,t)-$n(i.value,t)))},r=>{const s=e.findIndex(i=>i.name===r.name);s!==-1&&e.splice(s,1)})},handleByList(n,e,t=-1){return this.handle(n,r=>{e.includes(r.ref)||(e.push(r.ref),e.sort((s,i)=>$n(i,t)-$n(s,t)))},r=>{const s=e.indexOf(r.ref);s!==-1&&e.splice(s,1)})},mixin(n,...e){for(const t of e)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(t))}},Gp={extension:{type:S.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Or(()=>import("./BUSlXG5Y.js"),__vite__mapDeps([0,1]),import.meta.url)}},Op={extension:{type:S.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Or(()=>import("./BpUdqMox.js"),[],import.meta.url)}};class Ee{constructor(e,t,r){this._x=t||0,this._y=r||0,this._observer=e}clone(e){return new Ee(e??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var ti={exports:{}},Ja;function Lp(){return Ja||(Ja=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(u,l,c){this.fn=u,this.context=l,this.once=c||!1}function i(u,l,c,h,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new s(c,h||u,d),m=t?t+l:l;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],f]:u._events[m].push(f):(u._events[m]=f,u._eventsCount++),u}function o(u,l){--u._eventsCount===0?u._events=new r:delete u._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,h;if(this._eventsCount===0)return l;for(h in c=this._events)e.call(c,h)&&l.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var d=0,f=h.length,m=new Array(f);d<f;d++)m[d]=h[d].fn;return m},a.prototype.listenerCount=function(l){var c=t?t+l:l,h=this._events[c];return h?h.fn?1:h.length:0},a.prototype.emit=function(l,c,h,d,f,m){var b=t?t+l:l;if(!this._events[b])return!1;var p=this._events[b],_=arguments.length,y,v;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),_){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,h),!0;case 4:return p.fn.call(p.context,c,h,d),!0;case 5:return p.fn.call(p.context,c,h,d,f),!0;case 6:return p.fn.call(p.context,c,h,d,f,m),!0}for(v=1,y=new Array(_-1);v<_;v++)y[v-1]=arguments[v];p.fn.apply(p.context,y)}else{var C=p.length,w;for(v=0;v<C;v++)switch(p[v].once&&this.removeListener(l,p[v].fn,void 0,!0),_){case 1:p[v].fn.call(p[v].context);break;case 2:p[v].fn.call(p[v].context,c);break;case 3:p[v].fn.call(p[v].context,c,h);break;case 4:p[v].fn.call(p[v].context,c,h,d);break;default:if(!y)for(w=1,y=new Array(_-1);w<_;w++)y[w-1]=arguments[w];p[v].fn.apply(p[v].context,y)}}return!0},a.prototype.on=function(l,c,h){return i(this,l,c,h,!1)},a.prototype.once=function(l,c,h){return i(this,l,c,h,!0)},a.prototype.removeListener=function(l,c,h,d){var f=t?t+l:l;if(!this._events[f])return this;if(!c)return o(this,f),this;var m=this._events[f];if(m.fn)m.fn===c&&(!d||m.once)&&(!h||m.context===h)&&o(this,f);else{for(var b=0,p=[],_=m.length;b<_;b++)(m[b].fn!==c||d&&!m[b].once||h&&m[b].context!==h)&&p.push(m[b]);p.length?this._events[f]=p.length===1?p[0]:p:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(ti)),ti.exports}var Np=Lp();const Je=_c(Np),Hp=Math.PI*2,Wp=180/Math.PI,zp=Math.PI/180;class he{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new he(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ri.x=0,ri.y=0,ri}}const ri=new he;class X{constructor(e=1,t=0,r=0,s=1,i=0,o=0){this.array=null,this.a=e,this.b=t,this.c=r,this.d=s,this.tx=i,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,r,s,i,o){return this.a=e,this.b=t,this.c=r,this.d=s,this.tx=i,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const r=t||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,t){t=t||new he;const r=e.x,s=e.y;return t.x=this.a*r+this.c*s+this.tx,t.y=this.b*r+this.d*s+this.ty,t}applyInverse(e,t){t=t||new he;const r=this.a,s=this.b,i=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(r*o+i*-s),c=e.x,h=e.y;return t.x=o*l*c+-i*l*h+(u*i-a*o)*l,t.y=r*l*h+-s*l*c+(-u*r+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.a,i=this.c,o=this.tx;return this.a=s*t-this.b*r,this.b=s*r+this.b*t,this.c=i*t-this.d*r,this.d=i*r+this.d*t,this.tx=o*t-this.ty*r,this.ty=o*r+this.ty*t,this}append(e){const t=this.a,r=this.b,s=this.c,i=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*r+e.b*i,this.c=e.c*t+e.d*s,this.d=e.c*r+e.d*i,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*r+e.ty*i+this.ty,this}appendFrom(e,t){const r=e.a,s=e.b,i=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=r*l+s*h,this.b=r*c+s*d,this.c=i*l+o*h,this.d=i*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,r,s,i,o,a,u,l){return this.a=Math.cos(a+l)*i,this.b=Math.sin(a+l)*i,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(r*this.a+s*this.c),this.ty=t-(r*this.b+s*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,s=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,r=this.b,s=this.c,i=this.d,o=e.pivot,a=-Math.atan2(-s,i),u=Math.atan2(r,t),l=Math.abs(a+u);return l<1e-5||Math.abs(Hp-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(s*s+i*i),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*r+o.y*i),e}invert(){const e=this.a,t=this.b,r=this.c,s=this.d,i=this.tx,o=e*s-t*r;return this.a=s/o,this.b=-t/o,this.c=-r/o,this.d=e/o,this.tx=(r*this.ty-s*i)/o,this.ty=-(e*this.ty-t*i)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new X;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Xp.identity()}static get shared(){return Vp.identity()}}const Vp=new X,Xp=new X,ur=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],cr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],hr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Yi=[],bc=[],Yn=Math.sign;function $p(){for(let n=0;n<16;n++){const e=[];Yi.push(e);for(let t=0;t<16;t++){const r=Yn(ur[n]*ur[t]+cr[n]*lr[t]),s=Yn(lr[n]*ur[t]+hr[n]*lr[t]),i=Yn(ur[n]*cr[t]+cr[n]*hr[t]),o=Yn(lr[n]*cr[t]+hr[n]*hr[t]);for(let a=0;a<16;a++)if(ur[a]===r&&lr[a]===s&&cr[a]===i&&hr[a]===o){e.push(a);break}}}for(let n=0;n<16;n++){const e=new X;e.set(ur[n],lr[n],cr[n],hr[n],0,0),bc.push(e)}}$p();const ee={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:n=>ur[n],uY:n=>lr[n],vX:n=>cr[n],vY:n=>hr[n],inv:n=>n&8?n&15:-n&7,add:(n,e)=>Yi[n][e],sub:(n,e)=>Yi[n][ee.inv(e)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,e)=>Math.abs(n)*2<=Math.abs(e)?e>=0?ee.S:ee.N:Math.abs(e)*2<=Math.abs(n)?n>0?ee.E:ee.W:e>0?n>0?ee.SE:ee.SW:n>0?ee.NE:ee.NW,matrixAppendRotationInv:(n,e,t=0,r=0,s=0,i=0)=>{const o=bc[ee.inv(e)],a=o.a,u=o.b,l=o.c,c=o.d,h=t-Math.min(0,a*s,l*i,a*s+l*i),d=r-Math.min(0,u*s,c*i,u*s+c*i),f=n.a,m=n.b,b=n.c,p=n.d;n.a=a*f+u*b,n.b=a*m+u*p,n.c=l*f+c*b,n.d=l*m+c*p,n.tx=h*f+d*b+n.tx,n.ty=h*m+d*p+n.ty},transformRectCoords:(n,e,t,r)=>{const{x:s,y:i,width:o,height:a}=n,{x:u,y:l,width:c,height:h}=e;return t===ee.E?(r.set(s+u,i+l,o,a),r):t===ee.S?r.set(c-i-a+u,s+l,a,o):t===ee.W?r.set(c-s-o+u,h-i-a+l,o,a):t===ee.N?r.set(i+u,h-s-o+l,a,o):r.set(s+u,i+l,o,a)}},jn=[new he,new he,new he,new he];class de{constructor(e=0,t=0,r=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(r),this.height=Number(s)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new de(0,0,0,0)}clone(){return new de(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,r,s=.5){const{width:i,height:o}=this;if(i<=0||o<=0)return!1;const a=this.x,u=this.y,l=r*(1-s),c=r-l,h=a-l,d=a+i+l,f=u-l,m=u+o+l,b=a+c,p=a+i-c,_=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=m&&!(e>b&&e<p&&t>_&&t<y)}intersects(e,t){if(!t){const F=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=F)return!1;const R=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>R}const r=this.left,s=this.right,i=this.top,o=this.bottom;if(s<=r||o<=i)return!1;const a=jn[0].set(e.left,e.top),u=jn[1].set(e.left,e.bottom),l=jn[2].set(e.right,e.top),c=jn[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return!1;const h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=r||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=i||Math.min(a.y,u.y,l.y,c.y)>=o))return!1;const d=h*(u.y-a.y),f=h*(a.x-u.x),m=d*r+f*i,b=d*s+f*i,p=d*r+f*o,_=d*s+f*o;if(Math.max(m,b,p,_)<=d*a.x+f*a.y||Math.min(m,b,p,_)>=d*c.x+f*c.y)return!1;const y=h*(a.y-l.y),v=h*(l.x-a.x),C=y*r+v*i,w=y*s+v*i,P=y*r+v*o,A=y*s+v*o;return!(Math.max(C,w,P,A)<=y*a.x+v*a.y||Math.min(C,w,P,A)>=y*c.x+v*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(r-t,0),this.y=s,this.height=Math.max(i-s,0),this}ceil(e=1,t=.001){const r=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=s-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){const t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=r-t,this.y=s,this.height=i-s,this}getBounds(e){return e||(e=new de),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const t=e.x,r=e.y,s=e.x+e.width,i=e.y+e.height;return t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height&&s>=this.x&&s<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(e,t,r,s){return this.x=e,this.y=t,this.width=r,this.height=s,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const bn={default:-1};function ge(n="default"){return bn[n]===void 0&&(bn[n]=-1),++bn[n]}function $1(){for(const n in bn)delete bn[n]}const eu=new Set,se="8.0.0",Yp="8.3.4",kr={quiet:!1,noColor:!1},V=((n,e,t=3)=>{if(kr.quiet||eu.has(e))return;let r=new Error().stack;const s=`${e}
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DZcH3k7y.js","./xf3JUd0V.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Or}from"./BCc0wQRF.js";import{g as _c}from"./CqkleIqs.js";var S=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(S||{});const $i=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},$n=(n,e)=>$i(n).priority??e,Z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map($i).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e))}),this},add(...n){return n.map($i).forEach(e=>{e.type.forEach(t=>{const r=this._addHandlers,s=this._queue;r[t]?r[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e))})}),this},handle(n,e,t){const r=this._addHandlers,s=this._removeHandlers;if(r[n]||s[n])throw new Error(`Extension type ${n} already has a handler`);r[n]=e,s[n]=t;const i=this._queue;return i[n]&&(i[n]?.forEach(o=>e(o)),delete i[n]),this},handleByMap(n,e){return this.handle(n,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(n,e,t=-1){return this.handle(n,r=>{e.findIndex(i=>i.name===r.name)>=0||(e.push({name:r.name,value:r.ref}),e.sort((i,o)=>$n(o.value,t)-$n(i.value,t)))},r=>{const s=e.findIndex(i=>i.name===r.name);s!==-1&&e.splice(s,1)})},handleByList(n,e,t=-1){return this.handle(n,r=>{e.includes(r.ref)||(e.push(r.ref),e.sort((s,i)=>$n(i,t)-$n(s,t)))},r=>{const s=e.indexOf(r.ref);s!==-1&&e.splice(s,1)})},mixin(n,...e){for(const t of e)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(t))}},Gp={extension:{type:S.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Or(()=>import("./DZcH3k7y.js"),__vite__mapDeps([0,1]),import.meta.url)}},Op={extension:{type:S.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Or(()=>import("./xf3JUd0V.js"),[],import.meta.url)}};class Ee{constructor(e,t,r){this._x=t||0,this._y=r||0,this._observer=e}clone(e){return new Ee(e??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var ti={exports:{}},Ja;function Lp(){return Ja||(Ja=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(u,l,c){this.fn=u,this.context=l,this.once=c||!1}function i(u,l,c,h,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new s(c,h||u,d),m=t?t+l:l;return u._events[m]?u._events[m].fn?u._events[m]=[u._events[m],f]:u._events[m].push(f):(u._events[m]=f,u._eventsCount++),u}function o(u,l){--u._eventsCount===0?u._events=new r:delete u._events[l]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,h;if(this._eventsCount===0)return l;for(h in c=this._events)e.call(c,h)&&l.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var d=0,f=h.length,m=new Array(f);d<f;d++)m[d]=h[d].fn;return m},a.prototype.listenerCount=function(l){var c=t?t+l:l,h=this._events[c];return h?h.fn?1:h.length:0},a.prototype.emit=function(l,c,h,d,f,m){var b=t?t+l:l;if(!this._events[b])return!1;var p=this._events[b],_=arguments.length,y,v;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),_){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,h),!0;case 4:return p.fn.call(p.context,c,h,d),!0;case 5:return p.fn.call(p.context,c,h,d,f),!0;case 6:return p.fn.call(p.context,c,h,d,f,m),!0}for(v=1,y=new Array(_-1);v<_;v++)y[v-1]=arguments[v];p.fn.apply(p.context,y)}else{var C=p.length,w;for(v=0;v<C;v++)switch(p[v].once&&this.removeListener(l,p[v].fn,void 0,!0),_){case 1:p[v].fn.call(p[v].context);break;case 2:p[v].fn.call(p[v].context,c);break;case 3:p[v].fn.call(p[v].context,c,h);break;case 4:p[v].fn.call(p[v].context,c,h,d);break;default:if(!y)for(w=1,y=new Array(_-1);w<_;w++)y[w-1]=arguments[w];p[v].fn.apply(p[v].context,y)}}return!0},a.prototype.on=function(l,c,h){return i(this,l,c,h,!1)},a.prototype.once=function(l,c,h){return i(this,l,c,h,!0)},a.prototype.removeListener=function(l,c,h,d){var f=t?t+l:l;if(!this._events[f])return this;if(!c)return o(this,f),this;var m=this._events[f];if(m.fn)m.fn===c&&(!d||m.once)&&(!h||m.context===h)&&o(this,f);else{for(var b=0,p=[],_=m.length;b<_;b++)(m[b].fn!==c||d&&!m[b].once||h&&m[b].context!==h)&&p.push(m[b]);p.length?this._events[f]=p.length===1?p[0]:p:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a})(ti)),ti.exports}var Np=Lp();const Je=_c(Np),Hp=Math.PI*2,Wp=180/Math.PI,zp=Math.PI/180;class he{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new he(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ri.x=0,ri.y=0,ri}}const ri=new he;class X{constructor(e=1,t=0,r=0,s=1,i=0,o=0){this.array=null,this.a=e,this.b=t,this.c=r,this.d=s,this.tx=i,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,r,s,i,o){return this.a=e,this.b=t,this.c=r,this.d=s,this.tx=i,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const r=t||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(e,t){t=t||new he;const r=e.x,s=e.y;return t.x=this.a*r+this.c*s+this.tx,t.y=this.b*r+this.d*s+this.ty,t}applyInverse(e,t){t=t||new he;const r=this.a,s=this.b,i=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(r*o+i*-s),c=e.x,h=e.y;return t.x=o*l*c+-i*l*h+(u*i-a*o)*l,t.y=r*l*h+-s*l*c+(-u*r+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.a,i=this.c,o=this.tx;return this.a=s*t-this.b*r,this.b=s*r+this.b*t,this.c=i*t-this.d*r,this.d=i*r+this.d*t,this.tx=o*t-this.ty*r,this.ty=o*r+this.ty*t,this}append(e){const t=this.a,r=this.b,s=this.c,i=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*r+e.b*i,this.c=e.c*t+e.d*s,this.d=e.c*r+e.d*i,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*r+e.ty*i+this.ty,this}appendFrom(e,t){const r=e.a,s=e.b,i=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=r*l+s*h,this.b=r*c+s*d,this.c=i*l+o*h,this.d=i*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,r,s,i,o,a,u,l){return this.a=Math.cos(a+l)*i,this.b=Math.sin(a+l)*i,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(r*this.a+s*this.c),this.ty=t-(r*this.b+s*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const r=this.a,s=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,r=this.b,s=this.c,i=this.d,o=e.pivot,a=-Math.atan2(-s,i),u=Math.atan2(r,t),l=Math.abs(a+u);return l<1e-5||Math.abs(Hp-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(s*s+i*i),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*r+o.y*i),e}invert(){const e=this.a,t=this.b,r=this.c,s=this.d,i=this.tx,o=e*s-t*r;return this.a=s/o,this.b=-t/o,this.c=-r/o,this.d=e/o,this.tx=(r*this.ty-s*i)/o,this.ty=-(e*this.ty-t*i)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new X;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Xp.identity()}static get shared(){return Vp.identity()}}const Vp=new X,Xp=new X,ur=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],cr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],hr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Yi=[],bc=[],Yn=Math.sign;function $p(){for(let n=0;n<16;n++){const e=[];Yi.push(e);for(let t=0;t<16;t++){const r=Yn(ur[n]*ur[t]+cr[n]*lr[t]),s=Yn(lr[n]*ur[t]+hr[n]*lr[t]),i=Yn(ur[n]*cr[t]+cr[n]*hr[t]),o=Yn(lr[n]*cr[t]+hr[n]*hr[t]);for(let a=0;a<16;a++)if(ur[a]===r&&lr[a]===s&&cr[a]===i&&hr[a]===o){e.push(a);break}}}for(let n=0;n<16;n++){const e=new X;e.set(ur[n],lr[n],cr[n],hr[n],0,0),bc.push(e)}}$p();const ee={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:n=>ur[n],uY:n=>lr[n],vX:n=>cr[n],vY:n=>hr[n],inv:n=>n&8?n&15:-n&7,add:(n,e)=>Yi[n][e],sub:(n,e)=>Yi[n][ee.inv(e)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,e)=>Math.abs(n)*2<=Math.abs(e)?e>=0?ee.S:ee.N:Math.abs(e)*2<=Math.abs(n)?n>0?ee.E:ee.W:e>0?n>0?ee.SE:ee.SW:n>0?ee.NE:ee.NW,matrixAppendRotationInv:(n,e,t=0,r=0,s=0,i=0)=>{const o=bc[ee.inv(e)],a=o.a,u=o.b,l=o.c,c=o.d,h=t-Math.min(0,a*s,l*i,a*s+l*i),d=r-Math.min(0,u*s,c*i,u*s+c*i),f=n.a,m=n.b,b=n.c,p=n.d;n.a=a*f+u*b,n.b=a*m+u*p,n.c=l*f+c*b,n.d=l*m+c*p,n.tx=h*f+d*b+n.tx,n.ty=h*m+d*p+n.ty},transformRectCoords:(n,e,t,r)=>{const{x:s,y:i,width:o,height:a}=n,{x:u,y:l,width:c,height:h}=e;return t===ee.E?(r.set(s+u,i+l,o,a),r):t===ee.S?r.set(c-i-a+u,s+l,a,o):t===ee.W?r.set(c-s-o+u,h-i-a+l,o,a):t===ee.N?r.set(i+u,h-s-o+l,a,o):r.set(s+u,i+l,o,a)}},jn=[new he,new he,new he,new he];class de{constructor(e=0,t=0,r=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(r),this.height=Number(s)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new de(0,0,0,0)}clone(){return new de(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,r,s=.5){const{width:i,height:o}=this;if(i<=0||o<=0)return!1;const a=this.x,u=this.y,l=r*(1-s),c=r-l,h=a-l,d=a+i+l,f=u-l,m=u+o+l,b=a+c,p=a+i-c,_=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=m&&!(e>b&&e<p&&t>_&&t<y)}intersects(e,t){if(!t){const F=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=F)return!1;const R=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>R}const r=this.left,s=this.right,i=this.top,o=this.bottom;if(s<=r||o<=i)return!1;const a=jn[0].set(e.left,e.top),u=jn[1].set(e.left,e.bottom),l=jn[2].set(e.right,e.top),c=jn[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return!1;const h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=r||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=i||Math.min(a.y,u.y,l.y,c.y)>=o))return!1;const d=h*(u.y-a.y),f=h*(a.x-u.x),m=d*r+f*i,b=d*s+f*i,p=d*r+f*o,_=d*s+f*o;if(Math.max(m,b,p,_)<=d*a.x+f*a.y||Math.min(m,b,p,_)>=d*c.x+f*c.y)return!1;const y=h*(a.y-l.y),v=h*(l.x-a.x),C=y*r+v*i,w=y*s+v*i,P=y*r+v*o,A=y*s+v*o;return!(Math.max(C,w,P,A)<=y*a.x+v*a.y||Math.min(C,w,P,A)>=y*c.x+v*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(r-t,0),this.y=s,this.height=Math.max(i-s,0),this}ceil(e=1,t=.001){const r=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=s-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){const t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=r-t,this.y=s,this.height=i-s,this}getBounds(e){return e||(e=new de),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const t=e.x,r=e.y,s=e.x+e.width,i=e.y+e.height;return t>=this.x&&t<this.x+this.width&&r>=this.y&&r<this.y+this.height&&s>=this.x&&s<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(e,t,r,s){return this.x=e,this.y=t,this.width=r,this.height=s,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const bn={default:-1};function ge(n="default"){return bn[n]===void 0&&(bn[n]=-1),++bn[n]}function $1(){for(const n in bn)delete bn[n]}const eu=new Set,se="8.0.0",Yp="8.3.4",kr={quiet:!1,noColor:!1},V=((n,e,t=3)=>{if(kr.quiet||eu.has(e))return;let r=new Error().stack;const s=`${e}
3
3
  Deprecated since v${n}`,i=typeof console.groupCollapsed=="function"&&!kr.noColor;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",s):(r=r.split(`
4
4
  `).splice(t).join(`
5
5
  `),i?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",s),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",s),console.warn(r))),eu.add(e)});Object.defineProperties(V,{quiet:{get:()=>kr.quiet,set:n=>{kr.quiet=n},enumerable:!0,configurable:!1},noColor:{get:()=>kr.noColor,set:n=>{kr.noColor=n},enumerable:!0,configurable:!1}});const xc=()=>{};function zr(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function tu(n){return!(n&n-1)&&!!n}function Y1(n){let e=(n>65535?1:0)<<4;n>>>=e;let t=(n>255?1:0)<<3;return n>>>=t,e|=t,t=(n>15?1:0)<<2,n>>>=t,e|=t,t=(n>3?1:0)<<1,n>>>=t,e|=t,e|n>>1}function Bt(n){const e={};for(const t in n)n[t]!==void 0&&(e[t]=n[t]);return e}const ru=Object.create(null);function jp(n){const e=ru[n];return e===void 0&&(ru[n]=ge("resource")),e}const yc=class vc extends Je{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...vc.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){V(se,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=jp(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};yc.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let ht=yc;const Sc=class Tc extends Je{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=ge("textureSource"),this._resourceType="textureSource",this._resourceId=ge("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...Tc.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new ht(Bt(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=ge("resource"),this.emit("change",this),this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,r){r||(r=this._resolution),e||(e=this.width),t||(t=this.height);const s=Math.round(e*r),i=Math.round(t*r);return this.width=s/r,this.height=i/r,this._resolution=r,this.pixelWidth===s&&this.pixelHeight===i?!1:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=i,this.emit("resize",this),this._resourceId=ge("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=tu(this.pixelWidth)&&tu(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};Sc.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Ce=Sc;class Io extends Ce{constructor(e){const t=e.resource||new Float32Array(e.width*e.height*4);let r=e.format;r||(t instanceof Float32Array?r="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?r="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?r="rgba16uint":(t instanceof Int8Array,r="bgra8unorm")),super({...e,resource:t,format:r}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}Io.extension=S.TextureSource;const nu=new X;class Cc{constructor(e,t){this.mapCoord=new X,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,t){t===void 0&&(t=e);const r=this.mapCoord;for(let s=0;s<e.length;s+=2){const i=e[s],o=e[s+1];t[s]=i*r.a+o*r.c+r.tx,t[s+1]=i*r.b+o*r.d+r.ty}return t}update(){const e=this._texture;this._updateID++;const t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);const r=e.orig,s=e.trim;s&&(nu.set(r.width/s.width,0,0,r.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(nu));const i=e.source,o=this.uClampFrame,a=this.clampMargin/i._resolution,u=this.clampOffset/i._resolution;return o[0]=(e.frame.x+a+u)/i.width,o[1]=(e.frame.y+a+u)/i.height,o[2]=(e.frame.x+e.frame.width-a+u)/i.width,o[3]=(e.frame.y+e.frame.height-a+u)/i.height,this.uClampOffset[0]=this.clampOffset/i.pixelWidth,this.uClampOffset[1]=this.clampOffset/i.pixelHeight,this.isSimple=e.frame.width===i.width&&e.frame.height===i.height&&e.rotate===0,!0}}class z extends Je{constructor({source:e,label:t,frame:r,orig:s,trim:i,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=ge("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new de,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=e?.source??new Ce,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h}this.orig=s||this.frame,this.trim=i,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=l||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Cc(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:t}=this,{width:r,height:s}=this._source,i=t.x/r,o=t.y/s,a=t.width/r,u=t.height/s;let l=this.rotate;if(l){const c=a/2,h=u/2,d=i+c,f=o+h;l=ee.add(l,ee.NW),e.x0=d+c*ee.uX(l),e.y0=f+h*ee.uY(l),l=ee.add(l,2),e.x1=d+c*ee.uX(l),e.y1=f+h*ee.uY(l),l=ee.add(l,2),e.x2=d+c*ee.uX(l),e.y2=f+h*ee.uY(l),l=ee.add(l,2),e.x3=d+c*ee.uX(l),e.y3=f+h*ee.uY(l)}else e.x0=i,e.y0=o,e.x1=i+a,e.y1=o,e.x2=i+a,e.y2=o+u,e.x3=i,e.y3=o+u}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return V(se,"Texture.baseTexture is now Texture.source"),this._source}}z.EMPTY=new z({label:"EMPTY",source:new Ce({label:"EMPTY"})});z.EMPTY.destroy=xc;z.WHITE=new z({source:new Io({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});z.WHITE.destroy=xc;function wc(n,e,t){const{width:r,height:s}=t.orig,i=t.trim;if(i){const o=i.width,a=i.height;n.minX=i.x-e._x*r,n.maxX=n.minX+o,n.minY=i.y-e._y*s,n.maxY=n.minY+a}else n.minX=-e._x*r,n.maxX=n.minX+r,n.minY=-e._y*s,n.maxY=n.minY+s}const su=new X;class Ge{constructor(e=1/0,t=1/0,r=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=su,this.minX=e,this.minY=t,this.maxX=r,this.maxY=s}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new de);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=su,this}set(e,t,r,s){this.minX=e,this.minY=t,this.maxX=r,this.maxY=s}addFrame(e,t,r,s,i){i||(i=this.matrix);const o=i.a,a=i.b,u=i.c,l=i.d,c=i.tx,h=i.ty;let d=this.minX,f=this.minY,m=this.maxX,b=this.maxY,p=o*e+u*t+c,_=a*e+l*t+h;p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>b&&(b=_),p=o*r+u*t+c,_=a*r+l*t+h,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>b&&(b=_),p=o*e+u*s+c,_=a*e+l*s+h,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>b&&(b=_),p=o*r+u*s+c,_=a*r+l*s+h,p<d&&(d=p),_<f&&(f=_),p>m&&(m=p),_>b&&(b=_),this.minX=d,this.minY=f,this.maxX=m,this.maxY=b}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const t=this.minX,r=this.minY,s=this.maxX,i=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e;let d=o*t+u*r+c,f=a*t+l*r+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+u*r+c,f=a*s+l*r+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*t+u*i+c,f=a*t+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*s+u*i+c,f=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,r,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<r&&(this.minY=r),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new Ge(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){const t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){const t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,r,s){let i=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);const l=s.a,c=s.b,h=s.c,d=s.d,f=s.tx,m=s.ty;for(let b=t;b<r;b+=2){const p=e[b],_=e[b+1],y=l*p+h*_+f,v=c*p+d*_+m;i=y<i?y:i,o=v<o?v:o,a=y>a?y:a,u=v>u?v:u}this.minX=i,this.minY=o,this.maxX=a,this.maxY=u}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var qp={grad:.9,turn:360,rad:360/(2*Math.PI)},It=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},He=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t+0},ct=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n>e?n:e},Ec=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},iu=function(n){return{r:ct(n.r,0,255),g:ct(n.g,0,255),b:ct(n.b,0,255),a:ct(n.a)}},ni=function(n){return{r:He(n.r),g:He(n.g),b:He(n.b),a:He(n.a,3)}},Kp=/^#([0-9a-f]{3,8})$/i,qn=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},Ac=function(n){var e=n.r,t=n.g,r=n.b,s=n.a,i=Math.max(e,t,r),o=i-Math.min(e,t,r),a=o?i===e?(t-r)/o:i===t?2+(r-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:i?o/i*100:0,v:i/255*100,a:s}},Pc=function(n){var e=n.h,t=n.s,r=n.v,s=n.a;e=e/360*6,t/=100,r/=100;var i=Math.floor(e),o=r*(1-t),a=r*(1-(e-i)*t),u=r*(1-(1-e+i)*t),l=i%6;return{r:255*[r,a,o,o,u,r][l],g:255*[u,r,r,a,o,o][l],b:255*[o,o,u,r,r,a][l],a:s}},ou=function(n){return{h:Ec(n.h),s:ct(n.s,0,100),l:ct(n.l,0,100),a:ct(n.a)}},au=function(n){return{h:He(n.h),s:He(n.s),l:He(n.l),a:He(n.a,3)}},uu=function(n){return Pc((t=(e=n).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},xn=function(n){return{h:(e=Ac(n)).h,s:(s=(200-(t=e.s))*(r=e.v)/100)>0&&s<200?t*r/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,r,s},Zp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Jp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,em=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ji={string:[[function(n){var e=Kp.exec(n);return e?(n=e[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?He(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?He(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var e=Jp.exec(n)||em.exec(n);return e?e[2]!==e[4]||e[4]!==e[6]?null:iu({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(n){var e=Zp.exec(n)||Qp.exec(n);if(!e)return null;var t,r,s=ou({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(qp[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return uu(s)},"hsl"]],object:[[function(n){var e=n.r,t=n.g,r=n.b,s=n.a,i=s===void 0?1:s;return It(e)&&It(t)&&It(r)?iu({r:Number(e),g:Number(t),b:Number(r),a:Number(i)}):null},"rgb"],[function(n){var e=n.h,t=n.s,r=n.l,s=n.a,i=s===void 0?1:s;if(!It(e)||!It(t)||!It(r))return null;var o=ou({h:Number(e),s:Number(t),l:Number(r),a:Number(i)});return uu(o)},"hsl"],[function(n){var e=n.h,t=n.s,r=n.v,s=n.a,i=s===void 0?1:s;if(!It(e)||!It(t)||!It(r))return null;var o=(function(a){return{h:Ec(a.h),s:ct(a.s,0,100),v:ct(a.v,0,100),a:ct(a.a)}})({h:Number(e),s:Number(t),v:Number(r),a:Number(i)});return Pc(o)},"hsv"]]},lu=function(n,e){for(var t=0;t<e.length;t++){var r=e[t][0](n);if(r)return[r,e[t][1]]}return[null,void 0]},tm=function(n){return typeof n=="string"?lu(n.trim(),ji.string):typeof n=="object"&&n!==null?lu(n,ji.object):[null,void 0]},si=function(n,e){var t=xn(n);return{h:t.h,s:ct(t.s+100*e,0,100),l:t.l,a:t.a}},ii=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},cu=function(n,e){var t=xn(n);return{h:t.h,s:t.s,l:ct(t.l+100*e,0,100),a:t.a}},qi=(function(){function n(e){this.parsed=tm(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return He(ii(this.rgba),2)},n.prototype.isDark=function(){return ii(this.rgba)<.5},n.prototype.isLight=function(){return ii(this.rgba)>=.5},n.prototype.toHex=function(){return e=ni(this.rgba),t=e.r,r=e.g,s=e.b,o=(i=e.a)<1?qn(He(255*i)):"","#"+qn(t)+qn(r)+qn(s)+o;var e,t,r,s,i,o},n.prototype.toRgb=function(){return ni(this.rgba)},n.prototype.toRgbString=function(){return e=ni(this.rgba),t=e.r,r=e.g,s=e.b,(i=e.a)<1?"rgba("+t+", "+r+", "+s+", "+i+")":"rgb("+t+", "+r+", "+s+")";var e,t,r,s,i},n.prototype.toHsl=function(){return au(xn(this.rgba))},n.prototype.toHslString=function(){return e=au(xn(this.rgba)),t=e.h,r=e.s,s=e.l,(i=e.a)<1?"hsla("+t+", "+r+"%, "+s+"%, "+i+")":"hsl("+t+", "+r+"%, "+s+"%)";var e,t,r,s,i},n.prototype.toHsv=function(){return e=Ac(this.rgba),{h:He(e.h),s:He(e.s),v:He(e.v),a:He(e.a,3)};var e},n.prototype.invert=function(){return wt({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},n.prototype.saturate=function(e){return e===void 0&&(e=.1),wt(si(this.rgba,e))},n.prototype.desaturate=function(e){return e===void 0&&(e=.1),wt(si(this.rgba,-e))},n.prototype.grayscale=function(){return wt(si(this.rgba,-1))},n.prototype.lighten=function(e){return e===void 0&&(e=.1),wt(cu(this.rgba,e))},n.prototype.darken=function(e){return e===void 0&&(e=.1),wt(cu(this.rgba,-e))},n.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},n.prototype.alpha=function(e){return typeof e=="number"?wt({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):He(this.rgba.a,3);var t},n.prototype.hue=function(e){var t=xn(this.rgba);return typeof e=="number"?wt({h:e,s:t.s,l:t.l,a:t.a}):He(t.h)},n.prototype.isEqual=function(e){return this.toHex()===wt(e).toHex()},n})(),wt=function(n){return n instanceof qi?n:new qi(n)},hu=[],rm=function(n){n.forEach(function(e){hu.indexOf(e)<0&&(e(qi,ji),hu.push(e))})};function nm(n,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var s in t)r[t[s]]=s;var i={};n.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,u,l=r[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!i.length)for(var f in t)i[f]=new n(t[f]).toRgb();for(var m in t){var b=(a=c,u=i[m],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));b<h&&(h=b,d=m)}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new n(u).toRgb():null},"name"])}rm([nm]);const Vr=class mn{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof mn)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){const r=typeof e;if(r!==typeof t)return!1;if(r==="number"||r==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((i,o)=>i===t[o]);if(e!==null&&t!==null){const i=Object.keys(e),o=Object.keys(t);return i.length!==o.length?!1:i.every(a=>e[a]===t[a])}return e===t}toRgba(){const[e,t,r,s]=this._components;return{r:e,g:t,b:r,a:s}}toRgb(){const[e,t,r]=this._components;return{r:e,g:t,b:r}}toRgbaString(){const[e,t,r]=this.toUint8RgbArray();return`rgba(${e},${t},${r},${this.alpha})`}toUint8RgbArray(e){const[t,r,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(r*255),e[2]=Math.round(s*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[t,r,s,i]=this._components;return e[0]=t,e[1]=r,e[2]=s,e[3]=i,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[t,r,s]=this._components;return e[0]=t,e[1]=r,e[2]=s,e}toNumber(){return this._int}toBgrNumber(){const[e,t,r]=this.toUint8RgbArray();return(r<<16)+(t<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,r,s,i]=mn._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=r,this._components[2]*=s,this._components[3]*=i,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let r=this._int>>16&255,s=this._int>>8&255,i=this._int&255;return t&&(r=r*e+.5|0,s=s*e+.5|0,i=i*e+.5|0),(e*255<<24)+(r<<16)+(s<<8)+i}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,r,s,i;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,r=(o>>8&255)/255,s=(o&255)/255,i=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,r,s,i=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,r,s,i=255]=e,t/=255,r/=255,s/=255,i/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=mn.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=wt(e);o.isValid()&&({r:t,g:r,b:s,a:i}=o.rgba,t/=255,r/=255,s/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=r,this._components[2]=s,this._components[3]=i,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,t,r]=this._components;this._int=(e*255<<16)+(t*255<<8)+(r*255|0)}_clamp(e,t=0,r=1){return typeof e=="number"?Math.min(Math.max(e,t),r):(e.forEach((s,i)=>{e[i]=Math.min(Math.max(s,t),r)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof mn||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};Vr.shared=new Vr;Vr._temp=new Vr;Vr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let oe=Vr;const sm={cullArea:null,cullable:!1,cullableChildren:!0};let oi=0;const du=500;function j(...n){oi!==du&&(oi++,oi===du?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...n))}const jr={_registeredResources:new Set,register(n){this._registeredResources.add(n)},unregister(n){this._registeredResources.delete(n)},release(){this._registeredResources.forEach(n=>n.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(n){return this._registeredResources.has(n)},reset(){this._registeredResources.clear()}};class im{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){let t;return this._index>0?t=this._pool[--this._index]:(t=new this._classType,this._count++),t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class om{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new im(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(t=>{const r=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[r]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const ke=new om;jr.register(ke);const am={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(n){typeof n=="boolean"&&n===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(n===!0?{}:n))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(n){V("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(n)}};function Bc(n,e,t){const r=n.length;let s;if(e>=r||t===0)return;t=e+t>r?r-e:t;const i=r-t;for(s=e;s<i;++s)n[s]=n[s+t];n.length=i}const um={allowChildren:!0,removeChildren(n=0,e){const t=e??this.children.length,r=t-n,s=[];if(r>0&&r<=t){for(let o=t-1;o>=n;o--){const a=this.children[o];a&&(s.push(a),a.parent=null)}Bc(this.children,n,t);const i=this.renderGroup||this.parentRenderGroup;i&&i.removeChildren(s);for(let o=0;o<s.length;++o){const a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this)}return s.length>0&&this._didViewChangeTick++,s}else if(r===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(n){const e=this.getChildAt(n);return this.removeChild(e)},getChildAt(n){if(n<0||n>=this.children.length)throw new Error(`getChildAt: Index (${n}) does not exist.`);return this.children[n]},setChildIndex(n,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(n),this.addChildAt(n,e)},getChildIndex(n){const e=this.children.indexOf(n);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(n,e){this.allowChildren||V(se,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:t}=this;if(e<0||e>t.length)throw new Error(`${n}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(n.parent){const s=n.parent.children.indexOf(n);if(n.parent===this&&s===e)return n;s!==-1&&n.parent.children.splice(s,1)}e===t.length?t.push(n):t.splice(e,0,n),n.parent=this,n.didChange=!0,n._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(n),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",n,this,e),n.emit("added",this),n},swapChildren(n,e){if(n===e)return;const t=this.getChildIndex(n),r=this.getChildIndex(e);this.children[t]=e,this.children[r]=n;const s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...n){return n.length===1?this.reparentChildAt(n[0],this.children.length):(n.forEach(e=>this.reparentChildAt(e,this.children.length)),n[0])},reparentChildAt(n,e){if(n.parent===this)return this.setChildIndex(n,e),n;const t=n.worldTransform.clone();n.removeFromParent(),this.addChildAt(n,e);const r=this.worldTransform.clone();return r.invert(),t.prepend(r),n.setFromMatrix(t),n},replaceChild(n,e){n.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(n)),e.setFromMatrix(n.localTransform),e.updateLocalTransform(),this.removeChild(n)}},lm={collectRenderables(n,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(n,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,n):this.collectRenderablesWithEffects(n,e,t))},collectRenderablesSimple(n,e,t){const r=this.children,s=r.length;for(let i=0;i<s;i++)r[i].collectRenderables(n,e,t)},collectRenderablesWithEffects(n,e,t){const{renderPipes:r}=e;for(let s=0;s<this.effects.length;s++){const i=this.effects[s];r[i.pipe].push(i,this,n)}this.collectRenderablesSimple(n,e,t);for(let s=this.effects.length-1;s>=0;s--){const i=this.effects[s];r[i.pipe].pop(i,this,n)}}};class Ms{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class cm{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){const r=this._tests[t];if(r.test(e))return ke.get(r.maskClass,e)}return e}returnMaskEffect(e){ke.return(e)}}const Ki=new cm;Z.handleByList(S.MaskEffect,Ki._effectClasses);const hm={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)},addEffect(n){this.effects.indexOf(n)===-1&&(this.effects.push(n),this.effects.sort((t,r)=>t.priority-r.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(n){const e=this.effects.indexOf(n);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(n){const e=this._maskEffect;e?.mask!==n&&(e&&(this.removeEffect(e),Ki.returnMaskEffect(e),this._maskEffect=null),n!=null&&(this._maskEffect=Ki.getMaskEffect(n),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(n){this._maskOptions={...this._maskOptions,...n},n.mask&&(this.mask=n.mask),this._markStructureAsChanged()},set filters(n){!Array.isArray(n)&&n&&(n=[n]);const e=this._filterEffect||(this._filterEffect=new Ms);n=n;const t=n?.length>0,r=e.filters?.length>0,s=t!==r;n=Array.isArray(n)?n.slice(0):n,e.filters=Object.freeze(n),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=n??null))},get filters(){return this._filterEffect?.filters},set filterArea(n){this._filterEffect||(this._filterEffect=new Ms),this._filterEffect.filterArea=n},get filterArea(){return this._filterEffect?.filterArea}},dm={label:null,get name(){return V(se,"Container.name property has been removed, use Container.label instead"),this.label},set name(n){V(se,"Container.name property has been removed, use Container.label instead"),this.label=n},getChildByName(n,e=!1){return this.getChildByLabel(n,e)},getChildByLabel(n,e=!1){const t=this.children;for(let r=0;r<t.length;r++){const s=t[r];if(s.label===n||n instanceof RegExp&&n.test(s.label))return s}if(e)for(let r=0;r<t.length;r++){const i=t[r].getChildByLabel(n,!0);if(i)return i}return null},getChildrenByLabel(n,e=!1,t=[]){const r=this.children;for(let s=0;s<r.length;s++){const i=r[s];(i.label===n||n instanceof RegExp&&n.test(i.label))&&t.push(i)}if(e)for(let s=0;s<r.length;s++)r[s].getChildrenByLabel(n,!0,t);return t}},$e=ke.getPool(X),Nt=ke.getPool(Ge),fm=new X,pm={getFastGlobalBounds(n,e){e||(e=new Ge),e.clear(),this._getGlobalBoundsRecursive(!!n,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(n,e,t){let r=e;if(n&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;const s=!!this.effects.length;if((this.renderGroup||s)&&(r=Nt.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const o=this.bounds;r.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}const i=this.children;for(let o=0;o<i.length;o++)i[o]._getGlobalBoundsRecursive(n,r,t)}if(s){let i=!1;const o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(i||(i=!0,r.applyMatrix(o.worldTransform)),this.effects[a].addBounds(r,!0));i&&r.applyMatrix(o.worldTransform.copyTo(fm).invert()),e.addBounds(r),Nt.return(r)}else this.renderGroup&&(e.addBounds(r,this.relativeGroupTransform),Nt.return(r))}};function Ns(n,e,t){t.clear();let r,s;return n.parent?e?r=n.parent.worldTransform:(s=$e.get().identity(),r=ko(n,s)):r=X.IDENTITY,Rc(n,t,r,e),s&&$e.return(s),t.isValid||t.set(0,0,0,0),t}function Rc(n,e,t,r){if(!n.visible||!n.measurable)return;let s;r?s=n.worldTransform:(n.updateLocalTransform(),s=$e.get(),s.appendFrom(n.localTransform,t));const i=e,o=!!n.effects.length;if(o&&(e=Nt.get().clear()),n.boundsArea)e.addRect(n.boundsArea,s);else{const a=n.bounds;a&&!a.isEmpty()&&(e.matrix=s,e.addBounds(a));for(let u=0;u<n.children.length;u++)Rc(n.children[u],e,s,r)}if(o){for(let a=0;a<n.effects.length;a++)n.effects[a].addBounds?.(e);i.addBounds(e,X.IDENTITY),Nt.return(e)}r||$e.return(s)}function ko(n,e){const t=n.parent;return t&&(ko(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}function Qt(n,e){if(n===16777215||!e)return e;if(e===16777215||!n)return n;const t=n>>16&255,r=n>>8&255,s=n&255,i=e>>16&255,o=e>>8&255,a=e&255,u=t*i/255|0,l=r*o/255|0,c=s*a/255|0;return(u<<16)+(l<<8)+c}const fu=16777215;function Ds(n,e){return n===fu?e:e===fu?n:Qt(n,e)}function Ht(n){return((n&255)<<16)+(n&65280)+(n>>16&255)}const mm={getGlobalAlpha(n){if(n)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(n=new X,e){if(e)return n.copyFrom(this.worldTransform);this.updateLocalTransform();const t=ko(this,$e.get().identity());return n.appendFrom(this.localTransform,t),$e.return(t),n},getGlobalTint(n){if(n)return this.renderGroup?Ht(this.renderGroup.worldColor):this.parentRenderGroup?Ht(Ds(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=Ds(e,t.localColor),t=t.parent;return Ht(e)}};function Uo(n,e,t){return e.clear(),t||(t=X.IDENTITY),Mc(n,e,t,n,!0),e.isValid||e.set(0,0,0,0),e}function Mc(n,e,t,r,s){let i;if(s)i=$e.get(),i=t.copyTo(i);else{if(!n.visible||!n.measurable)return;n.updateLocalTransform();const u=n.localTransform;i=$e.get(),i.appendFrom(u,t)}const o=e,a=!!n.effects.length;if(a&&(e=Nt.get().clear()),n.boundsArea)e.addRect(n.boundsArea,i);else{n.renderPipeId&&(e.matrix=i,e.addBounds(n.bounds));const u=n.children;for(let l=0;l<u.length;l++)Mc(u[l],e,i,r,!1)}if(a){for(let u=0;u<n.effects.length;u++)n.effects[u].addLocalBounds?.(e,r);o.addBounds(e,X.IDENTITY),Nt.return(e)}$e.return(i)}function Dc(n,e){const t=n.children;for(let r=0;r<t.length;r++){const s=t[r],i=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==i||e.data[a+1]!==o)&&(e.data[e.index]=i,e.data[e.index+1]=o,e.didChange=!0),e.index=a+2,s.children.length&&Dc(s,e)}return e.didChange}const gm=new X,_m={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(n,e){const t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=n/e*t:this.scale.x=t},_setHeight(n,e){const t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=n/e*t:this.scale.y=t},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new Ge});const n=this._localBoundsCacheData;return n.index=1,n.didChange=!1,n.data[0]!==this._didViewChangeTick&&(n.didChange=!0,n.data[0]=this._didViewChangeTick),Dc(this,n),n.didChange&&Uo(this,n.localBounds,gm),n.localBounds},getBounds(n,e){return Ns(this,n,e||new Ge)}},bm={_onRender:null,set onRender(n){const e=this.renderGroup||this.parentRenderGroup;if(!n){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=n},get onRender(){return this._onRender}},xm={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(n){this._zIndex!==n&&(this._zIndex=n,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(ym))}};function ym(n,e){return n._zIndex-e._zIndex}const vm={getGlobalPosition(n=new he,e=!1){return this.parent?this.parent.toGlobal(this._position,n,e):(n.x=this._position.x,n.y=this._position.y),n},toGlobal(n,e,t=!1){const r=this.getGlobalTransform($e.get(),t);return e=r.apply(n,e),$e.return(r),e},toLocal(n,e,t,r){e&&(n=e.toGlobal(n,t,r));const s=this.getGlobalTransform($e.get(),r);return t=s.applyInverse(n,t),$e.return(s),t}};class Go{constructor(){this.uid=ge("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let Sm=0;class Tm{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new ht(this.textureOptions)}createTexture(e,t,r){const s=new Ce({...this.textureOptions,width:e,height:t,resolution:1,antialias:r,autoGarbageCollect:!1});return new z({source:s,label:`texturePool_${Sm++}`})}getOptimalTexture(e,t,r=1,s){let i=Math.ceil(e*r-1e-6),o=Math.ceil(t*r-1e-6);i=zr(i),o=zr(o);const a=(i<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(i,o,s)),u.source._resolution=r,u.source.width=i/r,u.source.height=o/r,u.source.pixelWidth=i,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=!1){const r=e.source;return this.getOptimalTexture(e.width,e.height,r._resolution,t)}returnTexture(e,t=!1){const r=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[r].push(e)}clear(e){if(e=e!==!1,e)for(const t in this._texturePool){const r=this._texturePool[t];if(r)for(let s=0;s<r.length;s++)r[s].destroy(!0)}this._texturePool={}}}const De=new Tm;jr.register(De);class Zi{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new X,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Go,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const t=e.children;for(let r=0;r<t.length;r++){const s=t[r];s._updateFlags=15,this.addChild(s)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(De.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const t=e.children;for(let r=0;r<t.length;r++)this.addChild(t[r])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const t=e.children;for(let r=0;r<t.length;r++)this.removeChild(t[r])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const t=this.root.children;for(let r=0;r<t.length;r++)this._getChildren(t[r],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;const r=e.children;for(let s=0;s<r.length;s++)this._getChildren(r[s],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new X),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new X),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new X),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function Qi(n,e,t={}){for(const r in e)!t[r]&&e[r]!==void 0&&(n[r]=e[r])}const ai=new Ee(null),Kn=new Ee(null),ui=new Ee(null,1,1),Zn=new Ee(null),Fs=1,Oo=2,yn=4,j1=8;class Be extends Je{constructor(e={}){super(),this.uid=ge("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new X,this.relativeGroupTransform=new X,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Ee(this,0,0),this._scale=ui,this._pivot=Kn,this._origin=Zn,this._skew=ai,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Qi(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this)}static mixin(e){V("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Z.mixin(Be,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||V(se,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}const t=e[0],r=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),r&&(r.structureDidChange=!0),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t._updateFlags=15,r&&r.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}const t=e[0],r=this.children.indexOf(t);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,r),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=ke.get(Zi,this),this.groupTransform=X.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e?.removeChild(this),ke.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new X),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*Wp}set angle(e){this.rotation=e*zp}get pivot(){return this._pivot===Kn&&(this._pivot=new Ee(this,0,0)),this._pivot}set pivot(e){this._pivot===Kn&&(this._pivot=new Ee(this,0,0),this._origin!==Zn&&j("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===ai&&(this._skew=new Ee(this,0,0)),this._skew}set skew(e){this._skew===ai&&(this._skew=new Ee(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===ui&&(this._scale=new Ee(this,1,1)),this._scale}set scale(e){this._scale===ui&&(this._scale=new Ee(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Zn&&(this._origin=new Ee(this,0,0)),this._origin}set origin(e){this._origin===Zn&&(this._origin=new Ee(this,0,0),this._pivot!==Kn&&j("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||(e={});const t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){const r=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,r.width),t!==void 0&&this._setHeight(t,r.height)}_updateSkew(){const e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const t=this.localTransform,r=this._scale,s=this._pivot,i=this._origin,o=this._position,a=r._x,u=r._y,l=s._x,c=s._y,h=-i._x,d=-i._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*u,t.d=this._sy*u,t.tx=o._x-(l*t.a+c*t.c)+(h*t.a+d*t.c)-h,t.ty=o._y-(l*t.b+c*t.d)+(h*t.b+d*t.d)-d}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=Fs,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const r=oe.shared.setValue(e??16777215).toBgrNumber();r!==this.localColor&&(this.localColor=r,this._updateFlags|=Fs,this._onUpdate())}get tint(){return Ht(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Oo,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yn,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yn,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=yn,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null}}Z.mixin(Be,um,pm,vm,bm,_m,hm,dm,xm,sm,am,mm,lm);class Vt extends Be{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new Ge(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const t=this.bounds,{x:r,y:s}=e;return r>=t.minX&&r<=t.maxX&&s>=t.minY&&s<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,t,r){const{renderPipes:s}=t;s.blendMode.pushBlendMode(this,this.groupBlendMode,e);const o=s[this.renderPipeId];o?.addRenderable&&o.addRenderable(this,e),this.didViewUpdate=!1;const a=this.children,u=a.length;for(let l=0;l<u;l++)a[l].collectRenderables(e,t,r);s.blendMode.popBlendMode(e)}}class Rt extends Vt{constructor(e=z.EMPTY){e instanceof z&&(e={texture:e});const{texture:t=z.EMPTY,anchor:r,roundPixels:s,width:i,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Ee({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=s??!1,i!==void 0&&(this.width=i),o!==void 0&&(this.height=o)}static from(e,t=!1){return e instanceof z?new Rt(e):new Rt(z.from(e,t))}set texture(e){e||(e=z.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return wc(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return V("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,t=this._texture,r=this._bounds,{width:s,height:i}=t.orig;r.minX=-e._x*s,r.maxX=r.minX+s,r.minY=-e._y*i,r.maxY=r.minY+i}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){const r=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(r)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}}const Cm=new Ge;function Lo(n,e,t){const r=Cm;n.measurable=!0,Ns(n,t,r),e.addBoundsMask(r),n.measurable=!1}function No(n,e,t){const r=Nt.get();n.measurable=!0;const s=$e.get().identity(),i=Fc(n,t,s);Uo(n,r,i),n.measurable=!1,e.addBoundsMask(r),$e.return(s),Nt.return(r)}function Fc(n,e,t){return n?(n!==e&&(Fc(n.parent,e,t),n.updateLocalTransform(),t.append(n.localTransform)),t):(j("Mask bounds, renderable is not inside the root container"),t)}class Ic{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Rt),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||Lo(this.mask,e,t)}addLocalBounds(e,t){No(this.mask,e,t)}containsPoint(e,t){const r=this.mask;return t(r,e)}destroy(){this.reset()}static test(e){return e instanceof Rt}}Ic.extension=S.MaskEffect;class kc{constructor(e){this.priority=0,this.pipe="colorMask",e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}kc.extension=S.MaskEffect;class Uc{constructor(e){this.priority=0,this.pipe="stencilMask",e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){Lo(this.mask,e,t)}addLocalBounds(e,t){No(this.mask,e,t)}containsPoint(e,t){const r=this.mask;return t(r,e)}destroy(){this.reset()}static test(e){return e instanceof Be}}Uc.extension=S.MaskEffect;const wm={createCanvas:(n,e)=>{const t=document.createElement("canvas");return t.width=n,t.height=e,t},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,e)=>fetch(n,e),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")};let pu=wm;const J={get(){return pu},set(n){pu=n}};class At extends Ce{constructor(e){e.resource||(e.resource=J.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,r=this._resolution){const s=super.resize(e,t,r);return s&&this.resizeCanvas(),s}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}At.extension=S.TextureSource;class xr extends Ce{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}xr.extension=S.TextureSource;var zt=(n=>(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(zt||{});class li{constructor(e,t=null,r=0,s=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=r,this._once=s}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Gc=class tt{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new li(null,null,1/0),this.deltaMS=1/tt.targetFPMS,this.elapsedMS=1/tt.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,r=zt.NORMAL){return this._addListener(new li(e,t,r))}addOnce(e,t,r=zt.NORMAL){return this._addListener(new li(e,t,r,!0))}_addListener(e){let t=this._head.next,r=this._head;if(!t)e.connect(r);else{for(;t;){if(e.priority>t.priority){e.connect(r);break}r=t,t=t.next}e.previous||e.connect(r)}return this._startIfPossible(),this}remove(e,t){let r=this._head.next;for(;r;)r.match(e,t)?r=r.destroy():r=r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*tt.targetFPMS;const r=this._head;let s=r.next;for(;s;)s=s.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,t)/1e3,tt.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!tt._shared){const e=tt._shared=new tt;e.autoStart=!0,e._protected=!0}return tt._shared}static get system(){if(!tt._system){const e=tt._system=new tt;e.autoStart=!0,e._protected=!0}return tt._system}};Gc.targetFPMS=.06;let We=Gc,ci;async function Oc(){return ci??(ci=(async()=>{const e=J.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const t=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!t)return"premultiply-alpha-on-upload";const r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);const s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);const i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(s),e.deleteTexture(r),e.getExtension("WEBGL_lose_context")?.loseContext(),i[0]<=i[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),ci}const Hs=class Lc extends Ce{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...Lc.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=We.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await Oc(),this._load=new Promise((r,s)=>{this.isValid?r(this):(this._resolve=r,this._reject=s,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(We.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(We.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(We.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Hs.extension=S.TextureSource;Hs.defaultOptions={...Ce.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Hs.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let vn=Hs;const xt=(n,e,t=!1)=>(Array.isArray(n)||(n=[n]),e?n.map(r=>typeof r=="string"||t?e(r):r):n);class Em{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||j(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const r=xt(e);let s;for(let u=0;u<this.parsers.length;u++){const l=this.parsers[u];if(l.test(t)){s=l.getCacheableAssets(r,t);break}}const i=new Map(Object.entries(s||{}));s||r.forEach(u=>{i.set(u,t)});const o=[...i.keys()],a={cacheKeys:o,keys:r};r.forEach(u=>{this._cacheMap.set(u,a)}),o.forEach(u=>{const l=s?s[u]:t;this._cache.has(u)&&this._cache.get(u)!==l&&j("[Cache] already has key:",u),this._cache.set(u,i.get(u))})}remove(e){if(!this._cacheMap.has(e)){j(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s)}),t.keys.forEach(s=>{this._cacheMap.delete(s)})}get parsers(){return this._parsers}}const ae=new Em,Ji=[];Z.handleByList(S.TextureSource,Ji);function q1(n={}){return Ho(n)}function Ho(n={}){const e=n&&n.resource,t=e?n.resource:n,r=e?n:{resource:n};for(let s=0;s<Ji.length;s++){const i=Ji[s];if(i.test(t))return new i(r)}throw new Error(`Could not find a source type for resource: ${r.resource}`)}function Am(n={},e=!1){const t=n&&n.resource,r=t?n.resource:n,s=t?n:{resource:n};if(!e&&ae.has(r))return ae.get(r);const i=new z({source:Ho(s)});return i.on("destroy",()=>{ae.has(r)&&ae.remove(r)}),e||ae.set(r,i),i}function Pm(n,e=!1){return typeof n=="string"?ae.get(n):n instanceof Ce?new z({source:n}):Am(n,e)}z.from=Pm;Ce.from=Ho;Z.add(Ic,kc,Uc,vn,xr,At,Io);var ft=(n=>(n[n.Low=0]="Low",n[n.Normal=1]="Normal",n[n.High=2]="High",n))(ft||{});function _t(n){if(typeof n!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(n)}`)}function en(n){return n.split("?")[0].split("#")[0]}function Bm(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rm(n,e,t){return n.replace(new RegExp(Bm(e),"g"),t)}function Mm(n,e){let t="",r=0,s=-1,i=0,o=-1;for(let a=0;a<=n.length;++a){if(a<n.length)o=n.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(t.length<2||r!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){const u=t.lastIndexOf("/");if(u!==t.length-1){u===-1?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length===2||t.length===1){t="",r=0,s=a,i=0;continue}}}else t.length>0?t+=`/${n.slice(s+1,a)}`:t=n.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i!==-1?++i:i=-1}return t}const it={toPosix(n){return Rm(n,"\\","/")},isUrl(n){return/^https?:/.test(this.toPosix(n))},isDataUrl(n){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(n)},isBlobUrl(n){return n.startsWith("blob:")},hasProtocol(n){return/^[^/:]+:/.test(this.toPosix(n))},getProtocol(n){_t(n),n=this.toPosix(n);const e=/^file:\/\/\//.exec(n);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(n);return t?t[0]:""},toAbsolute(n,e,t){if(_t(n),this.isDataUrl(n)||this.isBlobUrl(n))return n;const r=en(this.toPosix(e??J.get().getBaseUrl())),s=en(this.toPosix(t??this.rootname(r)));return n=this.toPosix(n),n.startsWith("/")?it.join(s,n.slice(1)):this.isAbsolute(n)?n:this.join(r,n)},normalize(n){if(_t(n),n.length===0)return".";if(this.isDataUrl(n)||this.isBlobUrl(n))return n;n=this.toPosix(n);let e="";const t=n.startsWith("/");this.hasProtocol(n)&&(e=this.rootname(n),n=n.slice(e.length));const r=n.endsWith("/");return n=Mm(n),n.length>0&&r&&(n+="/"),t?`/${n}`:e+n},isAbsolute(n){return _t(n),n=this.toPosix(n),this.hasProtocol(n)?!0:n.startsWith("/")},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const r=n[t];if(_t(r),r.length>0)if(e===void 0)e=r;else{const s=n[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${r}`:e+=`/${r}`}}return e===void 0?".":this.normalize(e)},dirname(n){if(_t(n),n.length===0)return".";n=this.toPosix(n);let e=n.charCodeAt(0);const t=e===47;let r=-1,s=!0;const i=this.getProtocol(n),o=n;n=n.slice(i.length);for(let a=n.length-1;a>=1;--a)if(e=n.charCodeAt(a),e===47){if(!s){r=a;break}}else s=!1;return r===-1?t?"/":this.isUrl(o)?i+n:i:t&&r===1?"//":i+n.slice(0,r)},rootname(n){_t(n),n=this.toPosix(n);let e="";if(n.startsWith("/")?e="/":e=this.getProtocol(n),this.isUrl(n)){const t=n.indexOf("/",e.length);t!==-1?e=n.slice(0,t):e=n,e.endsWith("/")||(e+="/")}return e},basename(n,e){_t(n),e&&_t(e),n=en(this.toPosix(n));let t=0,r=-1,s=!0,i;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e.length===n.length&&e===n)return"";let o=e.length-1,a=-1;for(i=n.length-1;i>=0;--i){const u=n.charCodeAt(i);if(u===47){if(!s){t=i+1;break}}else a===-1&&(s=!1,a=i+1),o>=0&&(u===e.charCodeAt(o)?--o===-1&&(r=i):(o=-1,r=a))}return t===r?r=a:r===-1&&(r=n.length),n.slice(t,r)}for(i=n.length-1;i>=0;--i)if(n.charCodeAt(i)===47){if(!s){t=i+1;break}}else r===-1&&(s=!1,r=i+1);return r===-1?"":n.slice(t,r)},extname(n){_t(n),n=en(this.toPosix(n));let e=-1,t=0,r=-1,s=!0,i=0;for(let o=n.length-1;o>=0;--o){const a=n.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}r===-1&&(s=!1,r=o+1),a===46?e===-1?e=o:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||r===-1||i===0||i===1&&e===r-1&&e===t+1?"":n.slice(e,r)},parse(n){_t(n);const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;n=en(this.toPosix(n));let t=n.charCodeAt(0);const r=this.isAbsolute(n);let s;e.root=this.rootname(n),r||this.hasProtocol(n)?s=1:s=0;let i=-1,o=0,a=-1,u=!0,l=n.length-1,c=0;for(;l>=s;--l){if(t=n.charCodeAt(l),t===47){if(!u){o=l+1;break}continue}a===-1&&(u=!1,a=l+1),t===46?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||a===-1||c===0||c===1&&i===a-1&&i===o+1?a!==-1&&(o===0&&r?e.base=e.name=n.slice(1,a):e.base=e.name=n.slice(o,a)):(o===0&&r?(e.name=n.slice(1,i),e.base=n.slice(1,a)):(e.name=n.slice(o,i),e.base=n.slice(o,a)),e.ext=n.slice(i,a)),e.dir=this.dirname(n),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function Nc(n,e,t,r,s){const i=e[t];for(let o=0;o<i.length;o++){const a=i[o];t<e.length-1?Nc(n.replace(r[t],a),e,t+1,r,s):s.push(n.replace(r[t],a))}}function Dm(n){const e=/\{(.*?)\}/g,t=n.match(e),r=[];if(t){const s=[];t.forEach(i=>{const o=i.substring(1,i.length-1).split(",");s.push(o)}),Nc(n,s,0,t,r)}else r.push(n);return r}const Is=n=>!Array.isArray(n);class vr{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(t[r])}`).join("&")}}getAlias(e){const{alias:t,src:r}=e;return xt(t||r,i=>typeof i=="string"?i:Array.isArray(i)?i.map(o=>o?.src??o):i?.src?i.src:i,!0)}addManifest(e){this._manifest&&j("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const r=[];let s=t;Array.isArray(t)||(s=Object.entries(t).map(([i,o])=>typeof o=="string"||Array.isArray(o)?{alias:i,src:o}:{alias:i,...o})),s.forEach(i=>{const o=i.src,a=i.alias;let u;if(typeof a=="string"){const l=this._createBundleAssetId(e,a);r.push(l),u=[a,l]}else{const l=a.map(c=>this._createBundleAssetId(e,c));r.push(...l),u=[...a,...l]}this.add({...i,alias:u,src:o})}),this._bundles[e]=r}add(e){const t=[];Array.isArray(e)?t.push(...e):t.push(e);let r;r=i=>{this.hasKey(i)&&j(`[Resolver] already has key: ${i} overwriting`)},xt(t).forEach(i=>{const{src:o}=i;let{data:a,format:u,loadParser:l,parser:c}=i;const h=xt(o).map(b=>typeof b=="string"?Dm(b):Array.isArray(b)?b:[b]),d=this.getAlias(i);Array.isArray(d)?d.forEach(r):r(d);const f=[],m=b=>{const p=this._parsers.find(_=>_.test(b));return{src:b,...p?.parse(b)}};h.forEach(b=>{b.forEach(p=>{let _={};if(typeof p!="object"?_=m(p):(a=p.data??a,u=p.format??u,(p.loadParser||p.parser)&&(l=p.loadParser??l,c=p.parser??c),_={...m(p.src),...p}),!d)throw new Error(`[Resolver] alias is undefined for this asset: ${_.src}`);_=this._buildResolvedAsset(_,{aliases:d,data:a,format:u,loadParser:l,parser:c,progressSize:i.progressSize}),f.push(_)})}),d.forEach(b=>{this._assetMap[b]=f})})}resolveBundle(e){const t=Is(e);e=xt(e);const r={};return e.forEach(s=>{const i=this._bundles[s];if(i){const o=this.resolve(i),a={};for(const u in o){const l=o[u];a[this._extractAssetIdFromBundle(s,u)]=l}r[s]=a}}),t?r[e[0]]:r}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const r={};for(const s in t)r[s]=t[s].src;return r}return t.src}resolve(e){const t=Is(e);e=xt(e);const r={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let i=this._assetMap[s];const o=this._getPreferredOrder(i);o?.priority.forEach(a=>{o.params[a].forEach(u=>{const l=i.filter(c=>c[a]?c[a]===u:!1);l.length&&(i=l)})}),this._resolverHash[s]=i[0]}else this._resolverHash[s]=this._buildResolvedAsset({alias:[s],src:s},{});r[s]=this._resolverHash[s]}),t?r[e[0]]:r}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){const r=e[t],s=this._preferredOrder.find(i=>i.params.format.includes(r.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){const{aliases:r,data:s,loadParser:i,parser:o,format:a,progressSize:u}=t;return(this._basePath||this._rootPath)&&(e.src=it.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=r??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=i??e.loadParser,e.parser=o??e.parser,e.format=a??e.format??Fm(e.src),u!==void 0&&(e.progressSize=u),e}}vr.RETINA_PREFIX=/@([0-9\.]+)x/;function Fm(n){return n.split(".").pop().split("?").shift().split("#").shift()}const eo=(n,e)=>{const t=e.split("?")[1];return t&&(n+=`?${t}`),n},Hc=class gn{constructor(e,t){this.linkedSheets=[];let r=e;e?.source instanceof Ce&&(r={texture:e,data:t});const{texture:s,data:i,cachePrefix:o=""}=r;this.cachePrefix=o,this._texture=s instanceof z?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=i;const a=parseFloat(i.meta.scale);a?(this.resolution=a,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=gn.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,t=!1){let r=e;const s=t?1/0:gn.BATCH_SIZE;for(;r-e<s&&r<this._frameKeys.length;){const i=this._frameKeys[r],o=this._frames[i],a=o.frame;if(a){let u=null,l=null;const c=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,h=new de(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);o.rotated?u=new de(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):u=new de(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&&(l=new de(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 z({source:this.textureSource,frame:u,orig:h,trim:l,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:i.toString()})}r++}}_processAnimations(){const e=this.data.animations||{};for(const t in e){this.animations[t]=[];for(let r=0;r<e[t].length;r++){const s=e[t][r];this.animations[t].push(this.textures[s])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*gn.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*gn.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Hc.BATCH_SIZE=1e3;let mu=Hc;const Im=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Wc(n,e,t){const r={};if(n.forEach(s=>{r[s]=e}),Object.keys(e.textures).forEach(s=>{r[`${e.cachePrefix}${s}`]=e.textures[s]}),!t){const s=it.dirname(n[0]);e.linkedSheets.forEach((i,o)=>{const a=Wc([`${s}/${e.data.meta.related_multi_packs[o]}`],i,!0);Object.assign(r,a)})}return r}const km={extension:S.Asset,cache:{test:n=>n instanceof mu,getCacheableAssets:(n,e)=>Wc(n,e,!1)},resolver:{extension:{type:S.ResolveParser,name:"resolveSpritesheet"},test:n=>{const t=n.split("?")[0].split("."),r=t.pop(),s=t.pop();return r==="json"&&Im.includes(s)},parse:n=>{const e=n.split(".");return{resolution:parseFloat(vr.RETINA_PREFIX.exec(n)?.[1]??"1"),format:e[e.length-2],src:n}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:S.LoadParser,priority:ft.Normal,name:"spritesheetLoader"},async testParse(n,e){return it.extname(e.src).toLowerCase()===".json"&&!!n.frames},async parse(n,e,t){const{texture:r,imageFilename:s,textureOptions:i,cachePrefix:o}=e?.data??{};let a=it.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(r instanceof z)u=r;else{const h=eo(a+(s??n.meta.image),e.src);u=(await t.load([{src:h,data:i}]))[h]}const l=new mu({texture:u.source,data:n,cachePrefix:o});await l.parse();const c=n?.meta?.related_multi_packs;if(Array.isArray(c)){const h=[];for(const f of c){if(typeof f!="string")continue;let m=a+f;e.data?.ignoreMultiPack||(m=eo(m,e.src),h.push(t.load({src:m,data:{textureOptions:i,ignoreMultiPack:!0}})))}const d=await Promise.all(h);l.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[l].concat(l.linkedSheets.filter(m=>m!==f))})}return l},async unload(n,e,t){await t.unload(n.textureSource._sourceOrigin),n.destroy(!1)}}};Z.add(km);class zc{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),r=this._canvas.width,s=this._canvas.height,i=t.width/r*this._renderer.resolution,o=t.height/s*this._renderer.resolution,a=t.left,u=t.top,l=`translate(${a}px, ${u}px) scale(${i}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const r=this.canvas.width,s=this.canvas.height,i=t.contentRect.width/r*this._renderer.resolution,o=t.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==i||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=i,this._lastScaleY=o)}}),this._observer.observe(this._canvas)):this._tickerAttached||We.shared.add(this.updateTranslation,this,zt.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&We.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class Un{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Un.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new he,this.page=new he,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,r,s,i){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var hi=/iPhone/i,gu=/iPod/i,_u=/iPad/i,bu=/\biOS-universal(?:.+)Mac\b/i,di=/\bAndroid(?:.+)Mobile\b/i,xu=/Android/i,Mr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Qn=/Silk/i,kt=/Windows Phone/i,yu=/\bWindows(?:.+)ARM\b/i,vu=/BlackBerry/i,Su=/BB10/i,Tu=/Opera Mini/i,Cu=/\b(CriOS|Chrome)(?:.+)Mobile/i,wu=/Mobile(?:.+)Firefox\b/i,Eu=function(n){return typeof n<"u"&&n.platform==="MacIntel"&&typeof n.maxTouchPoints=="number"&&n.maxTouchPoints>1&&typeof MSStream>"u"};function Um(n){return function(e){return e.test(n)}}function Au(n){var e={userAgent:"",platform:"",maxTouchPoints:0};!n&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof n=="string"?e.userAgent=n:n&&n.userAgent&&(e={userAgent:n.userAgent,platform:n.platform,maxTouchPoints:n.maxTouchPoints||0});var t=e.userAgent,r=t.split("[FBAN");typeof r[1]<"u"&&(t=r[0]),r=t.split("Twitter"),typeof r[1]<"u"&&(t=r[0]);var s=Um(t),i={apple:{phone:s(hi)&&!s(kt),ipod:s(gu),tablet:!s(hi)&&(s(_u)||Eu(e))&&!s(kt),universal:s(bu),device:(s(hi)||s(gu)||s(_u)||s(bu)||Eu(e))&&!s(kt)},amazon:{phone:s(Mr),tablet:!s(Mr)&&s(Qn),device:s(Mr)||s(Qn)},android:{phone:!s(kt)&&s(Mr)||!s(kt)&&s(di),tablet:!s(kt)&&!s(Mr)&&!s(di)&&(s(Qn)||s(xu)),device:!s(kt)&&(s(Mr)||s(Qn)||s(di)||s(xu))||s(/\bokhttp\b/i)},windows:{phone:s(kt),tablet:s(yu),device:s(kt)||s(yu)},other:{blackberry:s(vu),blackberry10:s(Su),opera:s(Tu),firefox:s(wu),chrome:s(Cu),device:s(vu)||s(Su)||s(Tu)||s(wu)||s(Cu)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}const Gm=Au.default??Au,Om=Gm(globalThis.navigator),Lm=9,Pu=100,Nm=0,Hm=0,Bu=2,Ru=1,Wm=-1e3,zm=-1e3,Vm=2,Wo=class Vc{constructor(e,t=Om){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${Ru}px`,e.style.height=`${Ru}px`,e.style.position="absolute",e.style.top=`${Wm}px`,e.style.left=`${zm}px`,e.style.zIndex=Vm.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${Nm}px`,this._div.style.left=`${Hm}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=Bu.toString(),this._canvasObserver=new zc({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let r=0;r<t.length;r++)this._updateAccessibleObjects(t[r])}init(e){const r={accessibilityOptions:{...Vc.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=r.accessibilityOptions.debug,this._activateOnTab=r.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=r.accessibilityOptions.deactivateOnMouseMove,r.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const r of this._children)r._renderId===this._renderId&&t.add(this._children.indexOf(r))}for(let r=this._children.length-1;r>=0;r--){const s=this._children[r];t.has(r)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._getPool(s.accessibleType).push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=!1,Bc(this._children,r,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let r=0;r<this._children.length;r++){const s=this._children[r];if(!s._accessibleActive||!s._accessibleDiv)continue;const i=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){const a=s.worldTransform;i.style.left=`${a.tx+o.x*a.a}px`,i.style.top=`${a.ty+o.y*a.d}px`,i.style.width=`${o.width*a.a}px`,i.style.height=`${o.height*a.d}px`}else this._capHitArea(o),i.style.left=`${o.x}px`,i.style.top=`${o.y}px`,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:r}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>r&&(e.height=r-e.y)}_addChild(e){let r=this._getPool(e.accessibleType).pop();r?(r.innerHTML="",r.removeAttribute("title"),r.removeAttribute("aria-label"),r.tabIndex=0):(e.accessibleType==="button"?r=document.createElement("button"):(r=document.createElement(e.accessibleType),r.style.cssText=`
@@ -0,0 +1,2 @@
1
+ import{aE as ie,g as Z,a3 as oe,ak as Q,K as le,aF as q,a4 as N,o as l,h as _,ab as m,aG as U,f as ue,y as $,a2 as fe,aH as z,Z as y,e as R,aI as x,Y as C,a0 as ce,aJ as X,aK as de,aL as G,aM as he,aN as _e,am as M,aO as O,aP as J,aQ as pe,aR as ee,F as te,an as ve,X as F,k as S,n as ge,B as me,aS as D,z as ye,E as be,aT as Ee,aU as Te,aV as we,S as Ne,aW as Re,aX as Se,q as A,aY as Ae,aZ as De,a_ as ke,a$ as Le,b0 as Me,b1 as Oe,C as B,b2 as P,D as Ie,i as xe,b3 as V,j as k,b4 as Ce,ay as Fe,b5 as Pe,at as Ve,p as We,au as Ye,b6 as He,b as $e}from"./D2nVx4xh.js";function Be(t){let e=0,r=Q(0),s;return()=>{ie()&&(Z(r),oe(()=>(e===0&&(s=le(()=>t(()=>q(r)))),e+=1,()=>{N(()=>{e-=1,e===0&&(s?.(),s=void 0,q(r))})})))}}var je=ye|be;function qe(t,e,r,s){new Ue(t,e,r,s)}class Ue{parent;is_pending=!1;transform_error;#t;#v=_?l:null;#s;#u;#e;#a=null;#r=null;#n=null;#i=null;#f=0;#l=0;#c=!1;#d=new Set;#h=new Set;#o=null;#y=Be(()=>(this.#o=Q(this.#f),()=>{this.#o=null}));constructor(e,r,s,a){this.#t=e,this.#s=r,this.#u=n=>{var i=m;i.b=this,i.f|=U,s(n)},this.parent=m.b,this.transform_error=a??this.parent?.transform_error??(n=>n),this.#e=ue(()=>{if(_){const n=this.#v;$();const i=n.data===fe;if(n.data.startsWith(z)){const o=JSON.parse(n.data.slice(z.length));this.#E(o)}else i?this.#T():this.#b()}else this.#g()},je),_&&(this.#t=l)}#b(){try{this.#a=y(()=>this.#u(this.#t))}catch(e){this.error(e)}}#E(e){const r=this.#s.failed;r&&(this.#n=y(()=>{r(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#s.pending;e&&(this.is_pending=!0,this.#r=y(()=>e(this.#t)),N(()=>{var r=this.#i=document.createDocumentFragment(),s=R();r.append(s),this.#a=this.#p(()=>(x.ensure(),y(()=>this.#u(s)))),this.#l===0&&(this.#t.before(r),this.#i=null,C(this.#r,()=>{this.#r=null}),this.#_())}))}#g(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#f=0,this.#a=y(()=>{this.#u(this.#t)}),this.#l>0){var e=this.#i=document.createDocumentFragment();ce(this.#a,e);const r=this.#s.pending;this.#r=y(()=>r(this.#t))}else this.#_()}catch(r){this.error(r)}}#_(){this.is_pending=!1;for(const e of this.#d)X(e,de),G(e);for(const e of this.#h)X(e,he),G(e);this.#d.clear(),this.#h.clear()}defer_effect(e){_e(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#s.pending}#p(e){var r=m,s=ee,a=te;M(this.#e),O(this.#e),J(this.#e.ctx);try{return e()}catch(n){return pe(n),null}finally{M(r),O(s),J(a)}}#m(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#m(e);return}this.#l+=e,this.#l===0&&(this.#_(),this.#r&&C(this.#r,()=>{this.#r=null}),this.#i&&(this.#t.before(this.#i),this.#i=null))}update_pending_count(e){this.#m(e),this.#f+=e,!(!this.#o||this.#c)&&(this.#c=!0,N(()=>{this.#c=!1,this.#o&&ve(this.#o,this.#f)}))}get_effect_pending(){return this.#y(),Z(this.#o)}error(e){var r=this.#s.onerror;let s=this.#s.failed;if(!r&&!s)throw e;this.#a&&(F(this.#a),this.#a=null),this.#r&&(F(this.#r),this.#r=null),this.#n&&(F(this.#n),this.#n=null),_&&(S(this.#v),ge(),S(me()));var a=!1,n=!1;const i=()=>{if(a){Te();return}a=!0,n&&Ee(),this.#n!==null&&C(this.#n,()=>{this.#n=null}),this.#p(()=>{x.ensure(),this.#g()})},f=o=>{try{n=!0,r?.(o,i),n=!1}catch(u){D(u,this.#e&&this.#e.parent)}s&&(this.#n=this.#p(()=>{x.ensure();try{return y(()=>{var u=m;u.b=this,u.f|=U,s(this.#t,()=>o,()=>i)})}catch(u){return D(u,this.#e.parent),null}}))};N(()=>{var o;try{o=this.transform_error(e)}catch(u){D(u,this.#e&&this.#e.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(f,u=>D(u,this.#e&&this.#e.parent)):f(o)})}}function st(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const ze=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function at(t){return ze.includes(t)}const Xe={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function it(t){return t=t.toLowerCase(),Xe[t]??t}const Ge=["touchstart","touchmove"];function Je(t){return Ge.includes(t)}const Ke=["textarea","script","style","title"];function ot(t){return Ke.includes(t)}const w=Symbol("events"),re=new Set,W=new Set;function ne(t,e,r,s={}){function a(n){if(s.capture||Y.call(e,n),!n.cancelBubble)return we(()=>r?.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?N(()=>{e.addEventListener(t,a,s)}):e.addEventListener(t,a,s),a}function lt(t,e,r,s={}){var a=ne(e,t,r,s);return()=>{t.removeEventListener(e,a,s)}}function ut(t,e,r,s,a){var n={capture:s,passive:a},i=ne(t,e,r,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Re(()=>{e.removeEventListener(t,i,n)})}function ft(t,e,r){(e[w]??={})[t]=r}function ct(t){for(var e=0;e<t.length;e++)re.add(t[e]);for(var r of W)r(t)}let K=null;function Y(t){var e=this,r=e.ownerDocument,s=t.type,a=t.composedPath?.()||[],n=a[0]||t.target;K=t;var i=0,f=K===t&&t[w];if(f){var o=a.indexOf(f);if(o!==-1&&(e===document||e===window)){t[w]=e;return}var u=a.indexOf(e);if(u===-1)return;o<=u&&(i=o)}if(n=a[i]||t.target,n!==e){Ne(t,"currentTarget",{configurable:!0,get(){return n||r}});var b=ee,T=m;O(null),M(null);try{for(var g,d=[];n!==null;){var c=n.assignedSlot||n.parentNode||n.host||null;try{var h=n[w]?.[s];h!=null&&(!n.disabled||t.target===n)&&h.call(n,t)}catch(p){g?d.push(p):g=p}if(t.cancelBubble||c===e||c===null)break;n=c}if(g){for(let p of d)queueMicrotask(()=>{throw p});throw g}}finally{t[w]=e,delete t.currentTarget,O(b),M(T)}}}const Ze=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Qe(t){return Ze?.createHTML(t)??t}function se(t){var e=Se("template");return e.innerHTML=Qe(t.replaceAll("<!>","<!---->")),e.content}function v(t,e){var r=m;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function dt(t,e){var r=(e&De)!==0,s=(e&ke)!==0,a,n=!t.startsWith("<!>");return()=>{if(_)return v(l,null),l;a===void 0&&(a=se(n?t:"<!>"+t),r||(a=A(a)));var i=s||Ae?document.importNode(a,!0):a.cloneNode(!0);if(r){var f=A(i),o=i.lastChild;v(f,o)}else v(i,i);return i}}function et(t,e,r="svg"){var s=!t.startsWith("<!>"),a=`<${r}>${s?t:"<!>"+t}</${r}>`,n;return()=>{if(_)return v(l,null),l;if(!n){var i=se(a),f=A(i);n=A(f)}var o=n.cloneNode(!0);return v(o,o),o}}function ht(t,e){return et(t,e,"svg")}function _t(t=""){if(!_){var e=R(t+"");return v(e,e),e}var r=l;return r.nodeType!==Le?(r.before(r=R()),S(r)):Me(r),v(r,r),r}function pt(){if(_)return v(l,null),l;var t=document.createDocumentFragment(),e=document.createComment(""),r=R();return t.append(e,r),v(e,r),t}function vt(t,e){if(_){var r=m;((r.f&Oe)===0||r.nodes.end===null)&&(r.nodes.end=l),$();return}t!==null&&t.before(e)}function gt(){if(_&&l&&l.nodeType===B&&l.textContent?.startsWith("$")){const t=l.textContent.substring(1);return $(),t}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function mt(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=`${r}`)}function tt(t,e){return ae(t,e)}function yt(t,e){P(),e.intro=e.intro??!1;const r=e.target,s=_,a=l;try{for(var n=A(r);n&&(n.nodeType!==B||n.data!==Ie);)n=xe(n);if(!n)throw V;k(!0),S(n);const i=ae(t,{...e,anchor:n});return k(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
+ `).some(f=>f.startsWith("https://svelte.dev/e/")))throw i;return i!==V&&console.warn("Failed to hydrate: ",i),e.recover===!1&&Ce(),P(),Fe(r),k(!1),tt(t,e)}finally{k(s),S(a)}}const L=new Map;function ae(t,{target:e,anchor:r,props:s={},events:a,context:n,intro:i=!0,transformError:f}){P();var o=void 0,u=Pe(()=>{var b=r??e.appendChild(R());qe(b,{pending:()=>{}},d=>{We({});var c=te;if(n&&(c.c=n),a&&(s.$$events=a),_&&v(d,null),o=t(d,s)||{},_&&(m.nodes.end=l,l===null||l.nodeType!==B||l.data!==Ye))throw He(),V;$e()},f);var T=new Set,g=d=>{for(var c=0;c<d.length;c++){var h=d[c];if(!T.has(h)){T.add(h);var p=Je(h);for(const I of[e,document]){var E=L.get(I);E===void 0&&(E=new Map,L.set(I,E));var j=E.get(h);j===void 0?(I.addEventListener(h,Y,{passive:p}),E.set(h,1)):E.set(h,j+1)}}}};return g(Ve(re)),W.add(g),()=>{for(var d of T)for(const p of[e,document]){var c=L.get(p),h=c.get(d);--h==0?(p.removeEventListener(d,Y),c.delete(d),c.size===0&&L.delete(p)):c.set(d,h)}W.delete(g),b!==r&&b.parentNode?.removeChild(b)}});return H.set(o,u),o}let H=new WeakMap;function bt(t,e){const r=H.get(t);return r?(H.delete(t),r(e)):Promise.resolve()}const rt="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(rt);export{vt as a,dt as b,pt as c,ft as d,ut as e,ht as f,ct as g,yt as h,st as i,ne as j,at as k,Be as l,tt as m,it as n,lt as o,v as p,ot as q,gt as r,mt as s,_t as t,bt as u};
@@ -0,0 +1 @@
1
+ import{e as y,f as o,H as u,E as _,h as t,C as g,i,j as l,k as d,o as p,q as m}from"./D2nVx4xh.js";function C(n,r){let s=null,E=t;var a;if(t){s=p;for(var e=m(document.head);e!==null&&(e.nodeType!==g||e.data!==n);)e=i(e);if(e===null)l(!1);else{var f=i(e);e.remove(),d(f)}}t||(a=document.head.appendChild(y()));try{o(()=>r(a),u|_)}finally{E&&(l(!0),d(s))}}export{C as h};
@@ -0,0 +1 @@
1
+ import{e as Y,f as _e,g as d,an as ee,_ as Se,Z as K,ao as ve,a1 as we,ah as be,ap as Ie,ak as te,aq as $e,ar as xe,m as Ae,h as M,k as G,q as Ce,y as Ne,as as ke,at as Q,A as Oe,a2 as He,B as ne,j as J,o as V,C as De,au as Re,av as C,W as ce,Y as fe,aw as X,ax as Pe,ay as Me,X as Be,a4 as Fe,i as Ue,az as de,aA as ze,s as u,x as w,a9 as se,K as re,V as Ve}from"./D2nVx4xh.js";import{i as Le}from"./CXrT-896.js";import{e as ie,u as oe,w as A,b as We}from"./DQ4B6jbE.js";function Tt(e,t){return t}function qe(e,t,n){for(var s=[],i=t.length,a,o=t.length,g=0;g<i;g++){let v=t[g];fe(v,()=>{if(a){if(a.pending.delete(v),a.done.add(v),a.pending.size===0){var h=e.outrogroups;Z(Q(a.done)),h.delete(a),h.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=s.length===0&&n!==null;if(c){var T=n,f=T.parentNode;Me(f),f.append(T),e.items.clear()}Z(t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Z(e,t=!0){for(var n=0;n<e.length;n++)Be(e[n],t)}var ae;function Et(e,t,n,s,i,a=null){var o=e,g=new Map,c=(t&de)!==0;if(c){var T=e;o=M?G(Ce(T)):T.appendChild(Y())}M&&Ne();var f=null,v=be(()=>{var l=n();return ke(l)?l:l==null?[]:Q(l)}),h,y=!0;function p(){r.fallback=f,Ye(r,h,o,t,s),f!==null&&(h.length===0?(f.f&C)===0?ce(f):(f.f^=C,U(f,null,o)):fe(f,()=>{f=null}))}var m=_e(()=>{h=d(v);var l=h.length;let x=!1;if(M){var D=Oe(o)===He;D!==(l===0)&&(o=ne(),G(o),J(!1),x=!0)}for(var I=new Set,k=Se,R=we(),b=0;b<l;b+=1){M&&V.nodeType===De&&V.data===Re&&(o=V,x=!0,J(!1));var O=h[b],P=s(O,b),S=y?null:g.get(P);S?(S.v&&ee(S.v,O),S.i&&ee(S.i,b),R&&k.unskip_effect(S.e)):(S=Ge(g,y?o:ae??=Y(),O,P,b,i,t,n),y||(S.e.f|=C),g.set(P,S)),I.add(P)}if(l===0&&a&&!f&&(y?f=K(()=>a(o)):(f=K(()=>a(ae??=Y())),f.f|=C)),l>I.size&&ve(),M&&l>0&&G(ne()),!y)if(R){for(const[Te,Ee]of g)I.has(Te)||k.skip_effect(Ee.e);k.oncommit(p),k.ondiscard(()=>{})}else p();x&&J(!0),d(v)}),r={effect:m,items:g,outrogroups:null,fallback:f};y=!1,M&&(o=V)}function B(e){for(;e!==null&&(e.f&Pe)===0;)e=e.next;return e}function Ye(e,t,n,s,i){var a=(s&ze)!==0,o=t.length,g=e.items,c=B(e.effect.first),T,f=null,v,h=[],y=[],p,m,r,l;if(a)for(l=0;l<o;l+=1)p=t[l],m=i(p,l),r=g.get(m).e,(r.f&C)===0&&(r.nodes?.a?.measure(),(v??=new Set).add(r));for(l=0;l<o;l+=1){if(p=t[l],m=i(p,l),r=g.get(m).e,e.outrogroups!==null)for(const S of e.outrogroups)S.pending.delete(r),S.done.delete(r);if((r.f&C)!==0)if(r.f^=C,r===c)U(r,null,n);else{var x=f?f.next:c;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),N(e,f,r),N(e,r,x),U(r,x,n),f=r,h=[],y=[],c=B(f.next);continue}if((r.f&X)!==0&&(ce(r),a&&(r.nodes?.a?.unfix(),(v??=new Set).delete(r))),r!==c){if(T!==void 0&&T.has(r)){if(h.length<y.length){var D=y[0],I;f=D.prev;var k=h[0],R=h[h.length-1];for(I=0;I<h.length;I+=1)U(h[I],D,n);for(I=0;I<y.length;I+=1)T.delete(y[I]);N(e,k.prev,R.next),N(e,f,k),N(e,R,D),c=D,f=R,l-=1,h=[],y=[]}else T.delete(r),U(r,c,n),N(e,r.prev,r.next),N(e,r,f===null?e.effect.first:f.next),N(e,f,r),f=r;continue}for(h=[],y=[];c!==null&&c!==r;)(T??=new Set).add(c),y.push(c),c=B(c.next);if(c===null)continue}(r.f&C)===0&&h.push(r),f=r,c=B(r.next)}if(e.outrogroups!==null){for(const S of e.outrogroups)S.pending.size===0&&(Z(Q(S.done)),e.outrogroups?.delete(S));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||T!==void 0){var b=[];if(T!==void 0)for(r of T)(r.f&X)===0&&b.push(r);for(;c!==null;)(c.f&X)===0&&c!==e.fallback&&b.push(c),c=B(c.next);var O=b.length;if(O>0){var P=(s&de)!==0&&o===0?n:null;if(a){for(l=0;l<O;l+=1)b[l].nodes?.a?.measure();for(l=0;l<O;l+=1)b[l].nodes?.a?.fix()}qe(e,b,P)}}a&&Fe(()=>{if(v!==void 0)for(r of v)r.nodes?.a?.apply()})}function Ge(e,t,n,s,i,a,o,g){var c=(o&$e)!==0?(o&xe)===0?Ae(n,!1,!1):te(n):null,T=(o&Ie)!==0?te(i):null;return{v:c,i:T,e:K(()=>(a(t,c??n,T??i,g),()=>{e.delete(s)}))}}function U(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&C)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function N(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Je(){let e=w(null),t=w(null),n=w(null),s=w(null),i=w("entity"),a=w(null),o=w("general");function g(p,m){d(e)&&(d(e)!==p||d(n)!==m)&&ie(d(e)).catch(()=>{})}function c(p,m,r,l){g(p,r),u(e,p,!0),u(t,m,!0),u(n,r,!0),u(s,l??null,!0)}function T(){u(i,"entity")}function f(){u(i,"graph")}function v(){u(i,"settings"),u(o,"general")}function h(p,m,r){d(n)===r&&d(e)===p?(u(e,null),u(t,null),u(n,null)):(u(e,p,!0),u(t,m,!0),u(n,r,!0)),u(s,null)}function y(){d(e)&&ie(d(e)).catch(()=>{}),u(e,null),u(t,null),u(n,null),u(s,null)}return{get selectedRepo(){return d(e)},get selectedType(){return d(t)},get selectedId(){return d(n)},get selectedSubPath(){return d(s)},get activeView(){return d(i)},get entityPath(){return d(e)&&d(t)&&d(n)?`/${d(e)}/${d(t)}/${d(n)}`:null},get hoveredEntityId(){return d(a)},set hoveredEntityId(p){u(a,p,!0)},get settingsTab(){return d(o)},set settingsTab(p){u(o,p,!0)},select:c,deselect:y,selectOnGraph:h,showEntity:T,showGraph:f,showSettings:v}}const F=Je();function _t(...e){return e.filter(Boolean).join(" ")}const Xe=typeof document<"u";let ue=0;class Ke{#e=w(se([]));get toasts(){return d(this.#e)}set toasts(t){u(this.#e,t,!0)}#t=w(se([]));get heights(){return d(this.#t)}set heights(t){u(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{Xe&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(g=>g.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return re(()=>{this.toasts.find(c=>c.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(re(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const g=Ze(o);this.create({id:s,type:"error",message:g})}else if(n.success!==void 0){a=!1;const g=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:g})}}).catch(o=>{if(n.error!==void 0){a=!1;const g=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:g})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function Ze(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const $=new Ke;function je(e,t){return $.create({message:e,...t})}class St{#e=Ve(()=>$.toasts.filter(t=>!t.dismiss));get toasts(){return d(this.#e)}}const Qe=je,_=Object.assign(Qe,{success:$.success,info:$.info,warning:$.warning,error:$.error,custom:$.custom,message:$.message,promise:$.promise,dismiss:$.dismiss,loading:$.loading,getActiveToasts:()=>$.toasts.filter(e=>!e.dismiss)}),et=800;function tt(){let e=w(!1),t=w(null),n=w(null),s=null,i=null,a=!1;function o(h,y,p,m){s&&s.repo===h&&s.type===y&&s.id===p?(m.data!==void 0&&(s.payload.data=m.data),m.content!==void 0&&(s.payload.content=m.content)):s={repo:h,type:y,id:p,payload:{...m}},g()}function g(){i&&clearTimeout(i),i=setTimeout(c,et)}async function c(){if(i=null,!a&&s){const{repo:h,type:y,id:p,payload:m}=s;s=null,a=!0,u(e,!0),u(n,null);try{if(await oe(h,y,p,m),u(t,new Date,!0),m.data?.name){const l=A.repos.find(x=>x.name===h)?.entities.find(x=>x.id===p);l&&(l.title=m.data.name)}}catch(r){u(n,r.message??"Save failed",!0);const l=r.status??r.statusCode;(!l||l>=500)&&(s={repo:h,type:y,id:p,payload:m})}finally{u(e,!1),a=!1,s&&c()}}}function T(){i&&(clearTimeout(i),i=null),s&&c()}async function f(h,y,p,m){u(e,!0),u(n,null);try{const r=await oe(h,y,p,m);return u(t,new Date,!0),r}catch(r){return u(n,r.message??"Save failed",!0),null}finally{u(e,!1)}}function v(){u(n,null),u(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return d(e)},get lastSaved(){return d(t)},get error(){return d(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:T,saveEntity:f,reset:v}}const nt=tt();let E=null,he=null,pe=null,ge=[],W=null,L=1e3,q=w(!1),ye=w(null);const H=new Map,z={},j={};function le(e,t){H.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;_(s)}function st(e){for(const[t,n]of H)n.repo===e&&(clearTimeout(n.timer),H.delete(t))}function rt(e){const t=We.user?.displayName;if(e.type==="sync_progress"){const n=z[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(j[e.repo]=`Syncing ${i[1].trim()}…`);const a=j[e.repo]??`Syncing ${e.repo}…`;_.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){A.refreshEntities(e.repo);return}if(A.refreshEntities(e.repo),F.selectedRepo===e.repo&&F.selectedType===e.entityType&&F.selectedId===e.entityId){nt.hasPending?_(`${e.actor} also saved changes to this entity`):Le();return}const s=H.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>le(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>le(e.actor,i),1e4)};H.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){u(ye,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;_(s),A.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(st(e.repo),!z[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;_.success(s)}A.refreshEntities(e.repo);return}if(e.type==="collection_created"){_(`${e.actor} created collection ${e.repo}`),A.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){_(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){_(`${e.actor} pushed to ${e.repo}`),A.refreshEntities(e.repo);return}if(e.type==="presence"){he?.(e);return}if(e.type==="online"){pe?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&F.selectedRepo===e.repo&&F.deselect(),A.load();return}}function me(){if(typeof window>"u"||E&&(E.readyState===WebSocket.OPEN||E.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;E=new WebSocket(t),E.binaryType="arraybuffer",E.onopen=()=>{u(q,!0),L=1e3,A.refreshAll();for(const n of ge)n()},E.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){E?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&rt(i)}catch{}},E.onclose=()=>{u(q,!1),E=null,W=setTimeout(()=>{L=Math.min(L*2,1e4),me()},L)},E.onerror=()=>{}}function it(){W&&(clearTimeout(W),W=null),E&&(E.close(),E=null),u(q,!1);for(const[,e]of H)clearTimeout(e.timer);H.clear()}function ot(e,t=4e3){_(e,{duration:t})}function at(e,t){const n=crypto.randomUUID();return t?.loading?_.loading(e,{id:n,duration:36e5}):_(e,{id:n}),n}function ut(e,t,n){if(n?.loading){_.loading(t,{id:e});return}/failed|error/i.test(t)?_.error(t,{id:e,duration:n?.duration??6e3}):_.success(t,{id:e,duration:n?.duration??4e3})}function lt(e){const t=crypto.randomUUID();z[e]=t,_.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function ct(e,t,n){const s=z[e];s&&(delete z[e],delete j[e],n?_.error(t,{id:s,duration:6e3}):_.success(t,{id:s,duration:4e3}))}function ft(e){he=e}function dt(e){pe=e}function ht(e){ge.push(e)}function pt(e){E?.readyState===WebSocket.OPEN&&E.send(JSON.stringify(e))}const vt={get connected(){return d(q)},get lastAutoSaved(){return d(ye)},get ws(){return E},connect:me,disconnect:it,showToast:ot,showPersistentToast:at,updateToast:ut,startSyncToast:lt,finishSyncToast:ct,send:pt,setPresenceHandler:ft,setOnlineHandler:dt,addConnectHandler:ht};export{St as S,nt as a,_t as c,Et as e,Tt as i,F as n,vt as r,$ as t};
@@ -1 +1 @@
1
- import{extensions as e,FilterSystem as i,FilterPipe as t}from"./BaUG0bh_.js";e.add(i);e.add(t);
1
+ import{extensions as e,FilterSystem as i,FilterPipe as t}from"./EpaeaOC3.js";e.add(i);e.add(t);
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BEIzN223.js","../chunks/BCc0wQRF.js","../chunks/D2nVx4xh.js","../chunks/2lIPsyS1.js","../chunks/_VqKaRO3.js","../chunks/DQ4B6jbE.js","../chunks/bZnjPslN.js","../chunks/CXrT-896.js","../chunks/u-BJ4rdO.js","../chunks/DGXEf2nW.js","../chunks/EXt9EGH6.js","../assets/0.D8EoqqcB.css","../nodes/1.B5D1CJ1m.js","../nodes/2.BGaiMS7x.js","../chunks/DJCIIlIq.js","../chunks/8_3AquXS.js","../assets/AppShell.DFQamTEo.css","../chunks/DJk-tEOI.js","../assets/ViewToolbar.39HnhXNY.css","../assets/2.DRZ4qWy8.css","../nodes/3.C3goG01r.js","../chunks/9H0Eug-K.js","../chunks/CqkleIqs.js","../assets/3.Bxy1xbfc.css","../nodes/4.C4ze80_s.js","../assets/4.aFSdMTV2.css","../nodes/5.IqOopG3B.js","../assets/5.CquhUpOu.css","../nodes/6.DaqAOjv4.js","../assets/6.CT4xL4K3.css","../nodes/7.C_M49E5I.js","../assets/7.BMfme7ZM.css","../nodes/8.CuCVLNZd.js","../assets/8.BUrHkYry.css"])))=>i.map(i=>d[i]);
2
+ import{c as y,_ as u}from"../chunks/BCc0wQRF.js";import{s as b,Q as U,g as m,R as Y,S as q,m as z,p as B,G as F,J as H,T as K,U as N,u as E,v as W,b as X,x as p,c as Z,r as $,V as P,t as tt}from"../chunks/D2nVx4xh.js";import{h as et,m as rt,u as st,a as h,c as O,b as D,t as at,s as ot}from"../chunks/_VqKaRO3.js";import{p as R,i as x,b as A}from"../chunks/2lIPsyS1.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=z(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===U?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Y(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=D('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ut=D("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);F(()=>t.stores.page.set(t.page)),H(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);K(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(b(r,!0),N().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),o});const j=P(()=>t.constructors[1]);var L=ut(),T=E(L);{var w=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);y(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var V=O(),G=E(V);y(G,()=>m(j),(M,J)=>{A(J(M,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),Q=>s()[1]=Q,()=>s()?.[1])}),h(g,V)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);y(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(T,o=>{t.constructors[1]?o(w):o(k,!1)})}var C=W(T,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,L),X()}const Et=nt(mt),bt=[()=>u(()=>import("../nodes/0.BEIzN223.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),()=>u(()=>import("../nodes/1.B5D1CJ1m.js"),__vite__mapDeps([12,4,2,9,7]),import.meta.url),()=>u(()=>import("../nodes/2.BGaiMS7x.js"),__vite__mapDeps([13,4,2,9,3,14,5,1,8,7,15,16,17,18,19]),import.meta.url),()=>u(()=>import("../nodes/3.C3goG01r.js"),__vite__mapDeps([20,5,2,3,4,1,8,7,14,9,15,16,17,18,21,22,10,23]),import.meta.url),()=>u(()=>import("../nodes/4.C4ze80_s.js"),__vite__mapDeps([24,5,2,3,4,14,1,8,7,9,15,16,25]),import.meta.url),()=>u(()=>import("../nodes/5.IqOopG3B.js"),__vite__mapDeps([26,4,2,14,3,5,1,8,7,9,15,16,17,18,27]),import.meta.url),()=>u(()=>import("../nodes/6.DaqAOjv4.js"),__vite__mapDeps([28,4,2,3,6,7,5,15,29]),import.meta.url),()=>u(()=>import("../nodes/7.C_M49E5I.js"),__vite__mapDeps([30,4,2,9,14,3,5,1,8,7,15,16,21,31]),import.meta.url),()=>u(()=>import("../nodes/8.CuCVLNZd.js"),__vite__mapDeps([32,4,2,3,6,7,5,15,33]),import.meta.url)],yt=[],pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},I={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.decode])),Pt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.encode])),Ot=!1,Rt=(a,t)=>_t[a](t);export{Rt as decode,_t as decoders,pt as dictionary,Pt as encoders,Ot as hash,I as hooks,gt as matchers,bt as nodes,Et as root,yt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/CXrT-896.js";export{o as load_css,r as start};